From 0f1031aa169f9cf623aa282241cc80fa56658c53 Mon Sep 17 00:00:00 2001 From: GermanBluefox Date: Sat, 21 Mar 2026 18:40:28 +0100 Subject: [PATCH 1/7] Added support for plain import/export: https://github.com/ioBroker/ioBroker.javascript/issues/2128 --- README.md | 3 + ...g-Bm9Brfi_.js => OpenAiDialog-DibIpG1Q.js} | 2 +- admin/assets/index-BT3MfKxA.js | 1230 ---------------- .../{index-CTvnL3j4.js => index-DnqTM0A3.js} | 2 +- admin/assets/index-_UYoIw1I.js | 1234 +++++++++++++++++ .../{index-CH_9mIwq.js => index-vgcfJH38.js} | 2 +- admin/tab.html | 2 +- io-package.json | 13 - src-admin/package-lock.json | 21 +- src-admin/package.json | 2 +- src-editor/package-lock.json | 168 +-- src-editor/package.json | 3 +- src-editor/src/App.tsx | 265 +++- src-editor/src/Dialogs/ImportFile.tsx | 4 +- src-editor/src/SideMenu.tsx | 53 +- src-editor/src/i18n/de.json | 2 + src-editor/src/i18n/en.json | 2 + src-editor/src/i18n/es.json | 2 + src-editor/src/i18n/fr.json | 2 + src-editor/src/i18n/it.json | 2 + src-editor/src/i18n/nl.json | 2 + src-editor/src/i18n/pl.json | 2 + src-editor/src/i18n/pt.json | 2 + src-editor/src/i18n/ru.json | 2 + src-editor/src/i18n/uk.json | 2 + src-editor/src/i18n/zh-cn.json | 2 + 26 files changed, 1561 insertions(+), 1465 deletions(-) rename admin/assets/{OpenAiDialog-Bm9Brfi_.js => OpenAiDialog-DibIpG1Q.js} (99%) delete mode 100644 admin/assets/index-BT3MfKxA.js rename admin/assets/{index-CTvnL3j4.js => index-DnqTM0A3.js} (99%) create mode 100644 admin/assets/index-_UYoIw1I.js rename admin/assets/{index-CH_9mIwq.js => index-vgcfJH38.js} (99%) diff --git a/README.md b/README.md index 24687849b..6c781c8a9 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,9 @@ Executes Javascript, Typescript Scripts. +### **WORK IN PROGRESS** +* (@GermanBluefox) Added support for plain import/export + ### 9.1.1 (2026-03-19) * (GermanBluefox) Small GUI optimizations * Added support for custom OpenAI-compatible API endpoints (e.g. Ollama, LM Studio, Google Gemini, DeepSeek, OpenRouter) diff --git a/admin/assets/OpenAiDialog-Bm9Brfi_.js b/admin/assets/OpenAiDialog-DibIpG1Q.js similarity index 99% rename from admin/assets/OpenAiDialog-Bm9Brfi_.js rename to admin/assets/OpenAiDialog-DibIpG1Q.js index 2ea4d5995..399fa4a77 100644 --- a/admin/assets/OpenAiDialog-Bm9Brfi_.js +++ b/admin/assets/OpenAiDialog-DibIpG1Q.js @@ -1,4 +1,4 @@ -import{c as ie,j as n}from"./createSvgIcon-DPvF8xqu.js";import{j as S,b as H,k as J,c as re}from"./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js";import{_ as F,a as Q,b as Z,i as $,h as X,c as oe,$ as ae,d as ce,e as le,f as de,g as ee}from"./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js";import{_ as l}from"./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js";import{_ as me}from"./preload-helper-BDBacUwf.js";import{C as he,b as ue,R as fe}from"./index-gIA8x-8f.js";import pe from"./ScriptEditorVanillaMonaco-DSYvOslZ.js";import{c as te,I as ge}from"./index-C49cpVll.js";import{h as ye}from"./index-BT3MfKxA.js";import"./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js";import"./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js";import"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js";import"./inheritsLoose-B0Ba5G9z.js";const ve=ie(n.jsx("path",{d:"M11.07 12.85c.77-1.39 2.25-2.21 3.11-3.44.91-1.29.4-3.7-2.18-3.7-1.69 0-2.52 1.28-2.87 2.34L6.54 6.96C7.25 4.83 9.18 3 11.99 3c2.35 0 3.96 1.07 4.78 2.41.7 1.15 1.11 3.3.03 4.9-1.2 1.77-2.35 2.31-2.97 3.45-.25.46-.35.76-.35 2.24h-2.89c-.01-.78-.13-2.05.48-3.15M14 20c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2"}),"QuestionMark"),je=me(()=>import("./docs-BrInh2Pn.js"),[],import.meta.url);let G=null;async function xe(s){if(G)return G;const f=await s.getObjectViewSystem("state","","香"),r=await s.getObjectViewSystem("channel","","香"),v=await s.getObjectViewSystem("device","","香"),d=await s.getObjectViewSystem("folder","","香"),k=await s.getObjectViewSystem("enum","","香");return G=Object.assign(f,r,v,d,k),G}function V(s,f){return s&&typeof s=="object"?s[f]||s.en:s||""}async function Ie(s){var P,N,L,K;const f=l.I18n.getLanguage(),r=await xe(s),v=Object.keys(r).sort(),d=new he,k=[],A=["UNREACH_STICKY"],W=[ue.Types.info],_=[],b=[],R=[],D=[];v.forEach(m=>{var a,h,c;((a=r[m])==null?void 0:a.type)==="enum"?_.push(m):(c=(h=r[m])==null?void 0:h.common)!=null&&c.smartName&&D.push(m)}),_.forEach(m=>{m.startsWith("enum.rooms.")?b.push(m):m.startsWith("enum.functions.")&&R.push(m);const a=r[m].common.members;a!=null&&a.length&&a.forEach(h=>{r[h]&&(D.includes(h)||D.push(h))})});const M={id:"",objects:r,_keysOptional:v,_usedIdsOptional:k,ignoreIndicators:A,excludedTypes:W},E=[];D.forEach(m=>{M.id=m;const a=d.detect(M);a&&a.forEach(h=>{var w;const c=(w=h.states.find(i=>i.id))==null?void 0:w.id;if(!c||E.find(i=>i.id===c))return;const j=r[c],z={id:c,name:V(j.common.name,f),type:j.type,deviceType:h.type,states:h.states.filter(i=>i.id).map(i=>({id:i.id,name:i.name,role:i.defaultRole,type:r[i.id].common.type,unit:r[i.id].common.unit,read:r[i.id].common.read===void 0?!0:r[i.id].common.read,write:r[i.id].common.write===void 0?!0:r[i.id].common.write}))},T=c.split(".");let e,o;(j.type==="channel"||j.type==="state")&&(T.pop(),e=T.join("."),r[e]&&(r[e].type==="channel"||r[e].type==="folder")?(T.pop(),o=T.join("."),(!r[o]||r[o].type!=="device"&&r[e].type!=="folder")&&(o=void 0)):e=void 0);const I=b.find(i=>{var x,p,t;return(x=r[i].common.members)!=null&&x.includes(c)||e&&((p=r[i].common.members)!=null&&p.includes(e))?!0:o&&((t=r[i].common.members)==null?void 0:t.includes(o))});I&&(z.room=V(r[I].common.name,f));const g=R.find(i=>{var x,p,t;return(x=r[i].common.members)!=null&&x.includes(c)||e&&((p=r[i].common.members)!=null&&p.includes(e))?!0:o&&((t=r[i].common.members)==null?void 0:t.includes(o))});g&&(z.function=V(r[g].common.name,f)),E.push(z)})});for(let m=0;m(await je).default,we={ru:"Russian",en:"English",de:"German",es:"Spanish",fr:"French",it:"Italian",pl:"Polish",nl:"Dutch",pt:"Portuguese",uk:"Ukrainian","zh-cn":"Chinese"},Y={flexShrink:0,opacity:.7},ne={openai:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",style:Y,children:n.jsx("path",{d:"M22.282 9.821a5.985 5.985 0 0 0-.516-4.91 6.046 6.046 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a5.985 5.985 0 0 0-3.998 2.9 6.046 6.046 0 0 0 .743 7.097 5.98 5.98 0 0 0 .51 4.911 6.051 6.051 0 0 0 6.515 2.9A5.985 5.985 0 0 0 13.26 24a6.056 6.056 0 0 0 5.772-4.206 5.99 5.99 0 0 0 3.997-2.9 6.056 6.056 0 0 0-.747-7.073zM13.26 22.43a4.476 4.476 0 0 1-2.876-1.04l.141-.081 4.779-2.758a.795.795 0 0 0 .392-.681v-6.737l2.02 1.168a.071.071 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494zM3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085 4.783 2.759a.771.771 0 0 0 .78 0l5.843-3.369v2.332a.08.08 0 0 1-.033.062L9.74 19.95a4.5 4.5 0 0 1-6.14-1.646zM2.34 7.896a4.485 4.485 0 0 1 2.366-1.973V11.6a.766.766 0 0 0 .388.676l5.815 3.355-2.02 1.168a.076.076 0 0 1-.071 0l-4.83-2.786A4.504 4.504 0 0 1 2.34 7.872zm16.597 3.855-5.833-3.387L15.119 7.2a.076.076 0 0 1 .071 0l4.83 2.791a4.494 4.494 0 0 1-.676 8.105v-5.678a.79.79 0 0 0-.407-.667zm2.01-3.023-.141-.085-4.774-2.782a.776.776 0 0 0-.785 0L9.409 9.23V6.897a.066.066 0 0 1 .028-.061l4.83-2.787a4.5 4.5 0 0 1 6.68 4.66zm-12.64 4.135-2.02-1.164a.08.08 0 0 1-.038-.057V6.075a4.5 4.5 0 0 1 7.375-3.453l-.142.08L8.704 5.46a.795.795 0 0 0-.393.681zm1.097-2.365 2.602-1.5 2.607 1.5v2.999l-2.597 1.5-2.607-1.5z"})}),anthropic:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",style:Y,children:n.jsx("path",{d:"M17.304 3.54h-3.604L7.128 20.46h3.604l1.345-3.462h6.932l1.345 3.462H24L17.304 3.54zm-3.45 10.696 2.647-6.812 2.647 6.812h-5.295zM6.696 3.54H3.092L0 20.46h3.604L6.696 3.54z"})}),gemini:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",style:Y,children:n.jsx("path",{d:"M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0z"})}),deepseek:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",style:Y,children:n.jsx("path",{d:"M5 3h6a9 9 0 0 1 0 18H5V3zm4 14V7h2a5 5 0 0 1 0 10H9z"})})};async function se(s,f){const r=Object.keys(f);for(let v=0;v{const[f,r]=S(window.localStorage.getItem("openai-question")||""),[v,d]=S(""),[k,A]=S(!1),[W,_]=S(!1),[b,R]=S(window.localStorage.getItem("openai-model")||""),[D,M]=S(!1),[E,P]=S([]),[N,L]=S(!0),[K,m]=S(null),a=H(null),h=H(null),c=H({}),j=H(null),z=J(async e=>{L(!0),m(null);try{const o=await se(s.socket,s.runningInstances);if(e!=null&&e.current)return;if(!o){L(!1);return}h.current=o;const I=Object.keys(s.runningInstances)[0];if(!I){m(l.I18n.t("No running javascript instance found")),L(!1);return}const g=[],w={},i=[],x=[],p=(t,B)=>{for(const O of t){const C=O.toLowerCase();C.includes("embedding")||C.includes("moderation")||C.startsWith("dall-e")||C.startsWith("tts-")||C.startsWith("whisper")||C.startsWith("babbage")||C.startsWith("davinci")||C.startsWith("sora")||C.startsWith("omni-moderation")||w[O]||(g.push(O),w[O]=B)}};if((o.gptKey||o.gptBaseUrl)&&x.push(s.socket.sendTo(I,"testApiConnection",{apiKey:o.gptKey,baseUrl:o.gptBaseUrl||"",provider:"openai"}).then(t=>{t.models?p(t.models,"openai"):t.error&&i.push(`OpenAI: ${t.error}`)}).catch(t=>{i.push(`OpenAI: ${String(t)}`)})),o.claudeKey&&x.push(s.socket.sendTo(I,"testApiConnection",{apiKey:o.claudeKey,provider:"anthropic"}).then(t=>{t.models?p(t.models,"anthropic"):t.error&&i.push(`Anthropic: ${t.error}`)}).catch(t=>{i.push(`Anthropic: ${String(t)}`)})),o.geminiKey&&x.push(s.socket.sendTo(I,"testApiConnection",{apiKey:o.geminiKey,provider:"gemini"}).then(t=>{t.models?p(t.models,"gemini"):t.error&&i.push(`Gemini: ${t.error}`)}).catch(t=>{i.push(`Gemini: ${String(t)}`)})),o.deepseekKey&&x.push(s.socket.sendTo(I,"testApiConnection",{apiKey:o.deepseekKey,provider:"deepseek"}).then(t=>{t.models?p(t.models,"deepseek"):t.error&&i.push(`DeepSeek: ${t.error}`)}).catch(t=>{i.push(`DeepSeek: ${String(t)}`)})),await Promise.all(x),e!=null&&e.current)return;if(c.current=w,g.length>0){g.sort(),P(g);const t=window.localStorage.getItem("openai-model");t&&g.includes(t)?R(t):R(g[0])}i.length>0&&m(i.join("; "))}catch(o){console.error("Failed to fetch models:",o),e!=null&&e.current||m(l.I18n.t("Request failed: %s",String(o)))}e!=null&&e.current||L(!1)},[s.socket,s.runningInstances]);re(()=>{const e={current:!1};return z(e),()=>{e.current=!0}},[z]);const T=J(async()=>{let e;a.current?e=a.current:(e=await Ie(s.socket),a.current=e,console.log(`devices: ${JSON.stringify(e,null,2)}`));let o=h.current;o||(o=await se(s.socket,s.runningInstances),h.current=o);let I;if(j.current?I=j.current:(I=await _e(),j.current=I),!o){M(!0);return}const g=c.current[b];if(!g){_(l.I18n.t("Please select a valid model"));return}let w,i;g==="anthropic"?(w=o.claudeKey,i=""):g==="gemini"?(w=o.geminiKey,i=""):g==="deepseek"?(w=o.deepseekKey,i=""):(w=o.gptKey,i=o.gptBaseUrl||"");const x=Object.keys(s.runningInstances)[0];if(!x){_(l.I18n.t("No running javascript instance found"));return}A(!0),_(!1);try{const p=await s.socket.sendTo(x,"chatCompletion",{apiKey:w,baseUrl:i,model:b,provider:g,messages:[{role:"system",content:`You are programmer. Here is a documentation: +import{c as ie,j as n}from"./createSvgIcon-DPvF8xqu.js";import{j as S,b as H,k as J,c as re}from"./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js";import{_ as F,a as Q,b as Z,i as $,h as X,c as oe,$ as ae,d as ce,e as le,f as de,g as ee}from"./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js";import{_ as l}from"./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js";import{_ as me}from"./preload-helper-BDBacUwf.js";import{C as he,b as ue,R as fe}from"./index-gIA8x-8f.js";import pe from"./ScriptEditorVanillaMonaco-DSYvOslZ.js";import{c as te,I as ge}from"./index-C49cpVll.js";import{h as ye}from"./index-_UYoIw1I.js";import"./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js";import"./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js";import"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js";import"./inheritsLoose-B0Ba5G9z.js";const ve=ie(n.jsx("path",{d:"M11.07 12.85c.77-1.39 2.25-2.21 3.11-3.44.91-1.29.4-3.7-2.18-3.7-1.69 0-2.52 1.28-2.87 2.34L6.54 6.96C7.25 4.83 9.18 3 11.99 3c2.35 0 3.96 1.07 4.78 2.41.7 1.15 1.11 3.3.03 4.9-1.2 1.77-2.35 2.31-2.97 3.45-.25.46-.35.76-.35 2.24h-2.89c-.01-.78-.13-2.05.48-3.15M14 20c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2"}),"QuestionMark"),je=me(()=>import("./docs-BrInh2Pn.js"),[],import.meta.url);let G=null;async function xe(s){if(G)return G;const f=await s.getObjectViewSystem("state","","香"),r=await s.getObjectViewSystem("channel","","香"),v=await s.getObjectViewSystem("device","","香"),d=await s.getObjectViewSystem("folder","","香"),k=await s.getObjectViewSystem("enum","","香");return G=Object.assign(f,r,v,d,k),G}function V(s,f){return s&&typeof s=="object"?s[f]||s.en:s||""}async function Ie(s){var P,N,L,K;const f=l.I18n.getLanguage(),r=await xe(s),v=Object.keys(r).sort(),d=new he,k=[],A=["UNREACH_STICKY"],W=[ue.Types.info],_=[],b=[],R=[],D=[];v.forEach(m=>{var a,h,c;((a=r[m])==null?void 0:a.type)==="enum"?_.push(m):(c=(h=r[m])==null?void 0:h.common)!=null&&c.smartName&&D.push(m)}),_.forEach(m=>{m.startsWith("enum.rooms.")?b.push(m):m.startsWith("enum.functions.")&&R.push(m);const a=r[m].common.members;a!=null&&a.length&&a.forEach(h=>{r[h]&&(D.includes(h)||D.push(h))})});const M={id:"",objects:r,_keysOptional:v,_usedIdsOptional:k,ignoreIndicators:A,excludedTypes:W},E=[];D.forEach(m=>{M.id=m;const a=d.detect(M);a&&a.forEach(h=>{var w;const c=(w=h.states.find(i=>i.id))==null?void 0:w.id;if(!c||E.find(i=>i.id===c))return;const j=r[c],z={id:c,name:V(j.common.name,f),type:j.type,deviceType:h.type,states:h.states.filter(i=>i.id).map(i=>({id:i.id,name:i.name,role:i.defaultRole,type:r[i.id].common.type,unit:r[i.id].common.unit,read:r[i.id].common.read===void 0?!0:r[i.id].common.read,write:r[i.id].common.write===void 0?!0:r[i.id].common.write}))},T=c.split(".");let e,o;(j.type==="channel"||j.type==="state")&&(T.pop(),e=T.join("."),r[e]&&(r[e].type==="channel"||r[e].type==="folder")?(T.pop(),o=T.join("."),(!r[o]||r[o].type!=="device"&&r[e].type!=="folder")&&(o=void 0)):e=void 0);const I=b.find(i=>{var x,p,t;return(x=r[i].common.members)!=null&&x.includes(c)||e&&((p=r[i].common.members)!=null&&p.includes(e))?!0:o&&((t=r[i].common.members)==null?void 0:t.includes(o))});I&&(z.room=V(r[I].common.name,f));const g=R.find(i=>{var x,p,t;return(x=r[i].common.members)!=null&&x.includes(c)||e&&((p=r[i].common.members)!=null&&p.includes(e))?!0:o&&((t=r[i].common.members)==null?void 0:t.includes(o))});g&&(z.function=V(r[g].common.name,f)),E.push(z)})});for(let m=0;m(await je).default,we={ru:"Russian",en:"English",de:"German",es:"Spanish",fr:"French",it:"Italian",pl:"Polish",nl:"Dutch",pt:"Portuguese",uk:"Ukrainian","zh-cn":"Chinese"},Y={flexShrink:0,opacity:.7},ne={openai:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",style:Y,children:n.jsx("path",{d:"M22.282 9.821a5.985 5.985 0 0 0-.516-4.91 6.046 6.046 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a5.985 5.985 0 0 0-3.998 2.9 6.046 6.046 0 0 0 .743 7.097 5.98 5.98 0 0 0 .51 4.911 6.051 6.051 0 0 0 6.515 2.9A5.985 5.985 0 0 0 13.26 24a6.056 6.056 0 0 0 5.772-4.206 5.99 5.99 0 0 0 3.997-2.9 6.056 6.056 0 0 0-.747-7.073zM13.26 22.43a4.476 4.476 0 0 1-2.876-1.04l.141-.081 4.779-2.758a.795.795 0 0 0 .392-.681v-6.737l2.02 1.168a.071.071 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494zM3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085 4.783 2.759a.771.771 0 0 0 .78 0l5.843-3.369v2.332a.08.08 0 0 1-.033.062L9.74 19.95a4.5 4.5 0 0 1-6.14-1.646zM2.34 7.896a4.485 4.485 0 0 1 2.366-1.973V11.6a.766.766 0 0 0 .388.676l5.815 3.355-2.02 1.168a.076.076 0 0 1-.071 0l-4.83-2.786A4.504 4.504 0 0 1 2.34 7.872zm16.597 3.855-5.833-3.387L15.119 7.2a.076.076 0 0 1 .071 0l4.83 2.791a4.494 4.494 0 0 1-.676 8.105v-5.678a.79.79 0 0 0-.407-.667zm2.01-3.023-.141-.085-4.774-2.782a.776.776 0 0 0-.785 0L9.409 9.23V6.897a.066.066 0 0 1 .028-.061l4.83-2.787a4.5 4.5 0 0 1 6.68 4.66zm-12.64 4.135-2.02-1.164a.08.08 0 0 1-.038-.057V6.075a4.5 4.5 0 0 1 7.375-3.453l-.142.08L8.704 5.46a.795.795 0 0 0-.393.681zm1.097-2.365 2.602-1.5 2.607 1.5v2.999l-2.597 1.5-2.607-1.5z"})}),anthropic:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",style:Y,children:n.jsx("path",{d:"M17.304 3.54h-3.604L7.128 20.46h3.604l1.345-3.462h6.932l1.345 3.462H24L17.304 3.54zm-3.45 10.696 2.647-6.812 2.647 6.812h-5.295zM6.696 3.54H3.092L0 20.46h3.604L6.696 3.54z"})}),gemini:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",style:Y,children:n.jsx("path",{d:"M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0z"})}),deepseek:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",style:Y,children:n.jsx("path",{d:"M5 3h6a9 9 0 0 1 0 18H5V3zm4 14V7h2a5 5 0 0 1 0 10H9z"})})};async function se(s,f){const r=Object.keys(f);for(let v=0;v{const[f,r]=S(window.localStorage.getItem("openai-question")||""),[v,d]=S(""),[k,A]=S(!1),[W,_]=S(!1),[b,R]=S(window.localStorage.getItem("openai-model")||""),[D,M]=S(!1),[E,P]=S([]),[N,L]=S(!0),[K,m]=S(null),a=H(null),h=H(null),c=H({}),j=H(null),z=J(async e=>{L(!0),m(null);try{const o=await se(s.socket,s.runningInstances);if(e!=null&&e.current)return;if(!o){L(!1);return}h.current=o;const I=Object.keys(s.runningInstances)[0];if(!I){m(l.I18n.t("No running javascript instance found")),L(!1);return}const g=[],w={},i=[],x=[],p=(t,B)=>{for(const O of t){const C=O.toLowerCase();C.includes("embedding")||C.includes("moderation")||C.startsWith("dall-e")||C.startsWith("tts-")||C.startsWith("whisper")||C.startsWith("babbage")||C.startsWith("davinci")||C.startsWith("sora")||C.startsWith("omni-moderation")||w[O]||(g.push(O),w[O]=B)}};if((o.gptKey||o.gptBaseUrl)&&x.push(s.socket.sendTo(I,"testApiConnection",{apiKey:o.gptKey,baseUrl:o.gptBaseUrl||"",provider:"openai"}).then(t=>{t.models?p(t.models,"openai"):t.error&&i.push(`OpenAI: ${t.error}`)}).catch(t=>{i.push(`OpenAI: ${String(t)}`)})),o.claudeKey&&x.push(s.socket.sendTo(I,"testApiConnection",{apiKey:o.claudeKey,provider:"anthropic"}).then(t=>{t.models?p(t.models,"anthropic"):t.error&&i.push(`Anthropic: ${t.error}`)}).catch(t=>{i.push(`Anthropic: ${String(t)}`)})),o.geminiKey&&x.push(s.socket.sendTo(I,"testApiConnection",{apiKey:o.geminiKey,provider:"gemini"}).then(t=>{t.models?p(t.models,"gemini"):t.error&&i.push(`Gemini: ${t.error}`)}).catch(t=>{i.push(`Gemini: ${String(t)}`)})),o.deepseekKey&&x.push(s.socket.sendTo(I,"testApiConnection",{apiKey:o.deepseekKey,provider:"deepseek"}).then(t=>{t.models?p(t.models,"deepseek"):t.error&&i.push(`DeepSeek: ${t.error}`)}).catch(t=>{i.push(`DeepSeek: ${String(t)}`)})),await Promise.all(x),e!=null&&e.current)return;if(c.current=w,g.length>0){g.sort(),P(g);const t=window.localStorage.getItem("openai-model");t&&g.includes(t)?R(t):R(g[0])}i.length>0&&m(i.join("; "))}catch(o){console.error("Failed to fetch models:",o),e!=null&&e.current||m(l.I18n.t("Request failed: %s",String(o)))}e!=null&&e.current||L(!1)},[s.socket,s.runningInstances]);re(()=>{const e={current:!1};return z(e),()=>{e.current=!0}},[z]);const T=J(async()=>{let e;a.current?e=a.current:(e=await Ie(s.socket),a.current=e,console.log(`devices: ${JSON.stringify(e,null,2)}`));let o=h.current;o||(o=await se(s.socket,s.runningInstances),h.current=o);let I;if(j.current?I=j.current:(I=await _e(),j.current=I),!o){M(!0);return}const g=c.current[b];if(!g){_(l.I18n.t("Please select a valid model"));return}let w,i;g==="anthropic"?(w=o.claudeKey,i=""):g==="gemini"?(w=o.geminiKey,i=""):g==="deepseek"?(w=o.deepseekKey,i=""):(w=o.gptKey,i=o.gptBaseUrl||"");const x=Object.keys(s.runningInstances)[0];if(!x){_(l.I18n.t("No running javascript instance found"));return}A(!0),_(!1);try{const p=await s.socket.sendTo(x,"chatCompletion",{apiKey:w,baseUrl:i,model:b,provider:g,messages:[{role:"system",content:`You are programmer. Here is a documentation: ${I}`},{role:"system",content:`Here is list of devices: diff --git a/admin/assets/index-BT3MfKxA.js b/admin/assets/index-BT3MfKxA.js deleted file mode 100644 index 25c4b2bfb..000000000 --- a/admin/assets/index-BT3MfKxA.js +++ /dev/null @@ -1,1230 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CH_9mIwq.js","./createSvgIcon-DPvF8xqu.js","./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js","./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js","./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js","./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js","./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js","./index-C49cpVll.js","./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js","./preload-helper-BDBacUwf.js","./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js","./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js","./inheritsLoose-B0Ba5G9z.js","./index-BCK6q-N6.css","./index-CTvnL3j4.js","./ScriptEditorVanillaMonaco-DSYvOslZ.js","./ScriptEditor-C-fO5h68.js","./Save-Cld9qv9i.js","./OpenAiDialog-Bm9Brfi_.js","./index-gIA8x-8f.js"])))=>i.map(i=>d[i]); -import{d as Xy}from"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js";import{j as g,c as ht,g as Cw,r as Tw,_ as Tg,i as Zy}from"./createSvgIcon-DPvF8xqu.js";import{r as Ek}from"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js";import{a as Y,_ as Ik,b as Bo,c as Mt,d as xk,e as kw,f as kg,g as rm,h as am,i as lm,j as vt,k as _n,l as rs,m as Xr,n as Sw,o as Sg,p as Dk,q as Ak,r as Ew,s as Rk,t as pn}from"./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js";import{_ as Gt,a as as,b as Vt,c as vo,d as _i,e as Eg,f as wi,g as Ge,h as Kt,i as De,j as Yl,k as Jl,l as ql,m as Xl,n as Zl,o as Me,p as Iw,q as $i,r as Ig,s as Qy,t as xg,u as Dg,v as Dn,w as xw,x as Ok,y as cm,z as $t,A as Mk,B as e_,C as Nk,D as Yp,E as bc,F as Lk,G as Pk,H as Bk,I as jk,J as Dw,K as Fk,L as zk,M as t_,N as gn,O as Uk,P as Hk,Q as Wk,R as Gk,S as Vk,T as Aw,U as Kk,V as Ag,W as Rw,X as Yk}from"./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js";import{_ as b}from"./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js";import{I as zo,a as qs,b as dc,C as Jk,c as Ow,F as qk,d as Xk,e as vc,f as Rg,g as Zk,h as Qk,i as eS,j as tS,M as sS,k as oS,l as iS,m as nS,_ as rS,n as Ql,o as aS,p as lS,q as ec,r as s_,s as cS,t as uS,u as dS,v as hS,w as o_,x as Wc,y as pS,z as gS,A as mS,B as fS,D as $S,E as bS,G as vS,H as Mw,J as Nw,K as Lw,L as yS,N as _S,O as wS,P as CS,Q as TS,R as kS}from"./index-C49cpVll.js";import{y as SS,_ as ES,a as IS,m as xS,S as i_,T as n_}from"./inheritsLoose-B0Ba5G9z.js";import{c as wn}from"./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js";function Si(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}import{_ as On}from"./preload-helper-BDBacUwf.js";import{P as Z}from"./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js";import{_ as DS}from"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function i(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function r(l){if(l.ep)return;l.ep=!0;const u=i(l);fetch(l.href,u)}})();var Pw,r_=Ek;Pw=r_.createRoot,r_.hydrateRoot;var Bw={exports:{}},rt={};var Gc=60103,Vc=60106,Zr=60107,Qr=60108,ea=60114,ta=60109,sa=60110,oa=60112,ia=60113,um=60120,na=60115,ra=60116,jw=60121,Fw=60122,zw=60117,Uw=60129,Hw=60131;if(typeof Symbol=="function"&&Symbol.for){var Rt=Symbol.for;Gc=Rt("react.element"),Vc=Rt("react.portal"),Zr=Rt("react.fragment"),Qr=Rt("react.strict_mode"),ea=Rt("react.profiler"),ta=Rt("react.provider"),sa=Rt("react.context"),oa=Rt("react.forward_ref"),ia=Rt("react.suspense"),um=Rt("react.suspense_list"),na=Rt("react.memo"),ra=Rt("react.lazy"),jw=Rt("react.block"),Fw=Rt("react.server.block"),zw=Rt("react.fundamental"),Uw=Rt("react.debug_trace_mode"),Hw=Rt("react.legacy_hidden")}function Rs(a){if(typeof a=="object"&&a!==null){var s=a.$$typeof;switch(s){case Gc:switch(a=a.type,a){case Zr:case ea:case Qr:case ia:case um:return a;default:switch(a=a&&a.$$typeof,a){case sa:case oa:case ra:case na:case ta:return a;default:return s}}case Vc:return s}}}var AS=ta,RS=Gc,OS=oa,MS=Zr,NS=ra,LS=na,PS=Vc,BS=ea,jS=Qr,FS=ia;rt.ContextConsumer=sa;rt.ContextProvider=AS;rt.Element=RS;rt.ForwardRef=OS;rt.Fragment=MS;rt.Lazy=NS;rt.Memo=LS;rt.Portal=PS;rt.Profiler=BS;rt.StrictMode=jS;rt.Suspense=FS;rt.isAsyncMode=function(){return!1};rt.isConcurrentMode=function(){return!1};rt.isContextConsumer=function(a){return Rs(a)===sa};rt.isContextProvider=function(a){return Rs(a)===ta};rt.isElement=function(a){return typeof a=="object"&&a!==null&&a.$$typeof===Gc};rt.isForwardRef=function(a){return Rs(a)===oa};rt.isFragment=function(a){return Rs(a)===Zr};rt.isLazy=function(a){return Rs(a)===ra};rt.isMemo=function(a){return Rs(a)===na};rt.isPortal=function(a){return Rs(a)===Vc};rt.isProfiler=function(a){return Rs(a)===ea};rt.isStrictMode=function(a){return Rs(a)===Qr};rt.isSuspense=function(a){return Rs(a)===ia};rt.isValidElementType=function(a){return typeof a=="string"||typeof a=="function"||a===Zr||a===ea||a===Uw||a===Qr||a===ia||a===um||a===Hw||typeof a=="object"&&a!==null&&(a.$$typeof===ra||a.$$typeof===na||a.$$typeof===ta||a.$$typeof===sa||a.$$typeof===oa||a.$$typeof===zw||a.$$typeof===jw||a[0]===Fw)};rt.typeOf=Rs;Bw.exports=rt;var zS=Bw.exports;function yc(a,s){const i=getComputedStyle(s);if(!i)return;let r=a===dt.Horizontal?s.clientWidth:s.clientHeight;return r!==0?(a===dt.Horizontal?r-=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight):r-=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom),r):void 0}function tc(a,s,i=[],r={condition:!0}){const{condition:l}=r,u=(function(d,p){var m={};for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&p.indexOf(f)<0&&(m[f]=d[f]);if(d!=null&&typeof Object.getOwnPropertySymbols=="function"){var v=0;for(f=Object.getOwnPropertySymbols(d);v(l&&window.addEventListener(a,s,u),()=>{l&&window.removeEventListener(a,s)})),[a,s,l,...i])}(function(a,s){s===void 0&&(s={});var i=s.insertAt;if(typeof document<"u"){var r=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css",i==="top"&&r.firstChild?r.insertBefore(l,r.firstChild):r.appendChild(l),l.styleSheet?l.styleSheet.cssText=a:l.appendChild(document.createTextNode(a))}})(`/* === Main Container === */ -.__dbk__container { - height: 100%; - width: 100%; - - display: flex; - overflow: hidden; -} - -.__dbk__container.Horizontal { - flex-direction: row; -} - -.__dbk__container.Vertical { - flex-direction: column; -} -/* ====== */ - -/* === Wrapper for each child element === */ -.__dbk__child-wrapper { - height: 100%; - width: 100%; -} -/* ====== */ - -/* === Gutter === */ -.__dbk__gutter { - display: flex; - align-items: center; - justify-content: center; -} -/* .__dbk__gutter > div { - background: red; -} */ -.__dbk__gutter.Horizontal { - height: 100%; - padding: 0 2px; - flex-direction: column; -} -.__dbk__gutter.Horizontal:hover { - cursor: col-resize; -} - -.__dbk__gutter.Vertical { - width: 100%; - padding: 2px 0; - flex-direction: row; -} -.__dbk__gutter.Vertical:hover { - cursor: row-resize; -} - -.__dbk__gutter.Light { - background: #EDF0EF; -} -.__dbk__gutter.Light:hover > .__dbk__dragger { - background: #76747B; -} - -.__dbk__gutter.Dark { - background: #020203; -} -.__dbk__gutter.Dark:hover > .__dbk__dragger { - background: #9995A3; -} -/* ====== */ - -/* === Gutter's Dragger === */ -.__dbk__dragger { - border-radius: 2px; -} - -.__dbk__dragger.Horizontal { - width: 4px; - height: 24px; -} - -.__dbk__dragger.Vertical { - width: 24px; - height: 4px; -} - -.__dbk__dragger.Light { - background: #A6ACB5; -} - -.__dbk__dragger.Dark { - background: #434252; -} -/* ====== */`);const US=Y.forwardRef((({className:a,theme:s,draggerClassName:i,direction:r=dt.Vertical,onDragging:l},u)=>{const d=`__dbk__gutter ${r} ${a||s}`,p=`__dbk__dragger ${r} ${i||s}`;return g.jsx("div",Object.assign({className:d,ref:u,dir:r,onMouseDown:l,onTouchStart:hc?l:void 0},{children:g.jsx("div",{className:p},void 0)}),void 0)}));var vs;function Og(a,s,i){let r,l;return s?(r=a/2,l=a):i?(r=a,l=a/2):(r=a,l=a),{aGutterSize:r,bGutterSize:l}}function HS(a,s){switch(s.type){case vs.SetIsReadyToCompute:return Object.assign(Object.assign({},a),{isReady:s.payload.isReady});case vs.CreatePairs:{const{direction:i,children:r,gutters:l}=s.payload,u=r[0].parentNode;if(!u)throw new Error("Cannot create pairs - parent is undefined.");const d=yc(i,u);if(d===void 0)throw new Error(`Cannot create pairs - parent has undefined or zero size: ${d}.`);const p=[];return r.forEach(((m,f)=>{if(f>0){const v=r[f-1],_=r[f],y=l[f-1],k=i===dt.Horizontal?v.getBoundingClientRect().left:v.getBoundingClientRect().top,C=i===dt.Horizontal?_.getBoundingClientRect().right:_.getBoundingClientRect().bottom,w=i===dt.Horizontal?v.getBoundingClientRect().width+y.getBoundingClientRect().width+_.getBoundingClientRect().width:v.getBoundingClientRect().height+y.getBoundingClientRect().height+_.getBoundingClientRect().height,E=i===dt.Horizontal?y.getBoundingClientRect().width:y.getBoundingClientRect().height,R={idx:f-1,a:v,b:_,gutter:y,parent:u,start:k,end:C,size:w,gutterSize:E,aSizePct:100/r.length,bSizePct:100/r.length};p.push(R)}})),Object.assign(Object.assign({},a),{pairs:p})}case vs.StartDragging:{const{gutterIdx:i}=s.payload;return Object.assign(Object.assign({},a),{isDragging:!0,draggingIdx:i})}case vs.StopDragging:return Object.assign(Object.assign({},a),{isDragging:!1});case vs.CalculateSizes:{const{direction:i,gutterIdx:r}=s.payload,l=a.pairs[r],u=yc(i,l.parent);if(!u)throw new Error("Cannot calculate sizes - 'pair.parent' has undefined or zero size.");const d=l.gutter[i===dt.Horizontal?"clientWidth":"clientHeight"],p=r===0,m=r===a.pairs.length-1,{aGutterSize:f,bGutterSize:v}=Og(d,p,m);let _,y,k,C,w;return i===dt.Horizontal?(_=l.a.getBoundingClientRect().left,y=l.b.getBoundingClientRect().right,C=(l.a.getBoundingClientRect().width+f)/u*100,w=(l.b.getBoundingClientRect().width+v)/u*100,k=l.a.getBoundingClientRect().width+f+v+l.b.getBoundingClientRect().width):(_=l.a.getBoundingClientRect().top,y=l.b.getBoundingClientRect().bottom,C=(l.a.getBoundingClientRect().height+f)/u*100,w=(l.b.getBoundingClientRect().height+v)/u*100,k=l.a.getBoundingClientRect().height+f+v+l.b.getBoundingClientRect().height),a.pairs[r]=Object.assign(Object.assign({},l),{start:_,end:y,size:k,aSizePct:C,bSizePct:w,gutterSize:d}),Object.assign({},a)}default:return a}}function Ww(a,s=0,i=[]){return xk.toArray(a).reduce(((r,l,u)=>(zS.isFragment(l)?r.push.apply(r,Ww(l.props.children,s+1,i.concat(l.key||u))):kw(l)?r.push(kg(l,{key:i.concat(String(l.key)).join(".")})):typeof l!="string"&&typeof l!="number"||r.push(l),r)),[])}(function(a){a[a.SetIsReadyToCompute=0]="SetIsReadyToCompute",a[a.CreatePairs=1]="CreatePairs",a[a.CalculateSizes=2]="CalculateSizes",a[a.StartDragging=3]="StartDragging",a[a.StopDragging=4]="StopDragging"})(vs||(vs={}));const a_=a=>"changedTouches"in a;var dt,Mg;(function(a){a.Horizontal="Horizontal",a.Vertical="Vertical"})(dt||(dt={})),(function(a){a.Light="Light",a.Dark="Dark"})(Mg||(Mg={}));const hc=typeof window<"u"&&"ontouchstart"in window;function Jp(a){return a===dt.Horizontal?"col-resize":"row-resize"}const WS={isReady:!1,isDragging:!1,pairs:[]};function l_({direction:a=dt.Horizontal,minWidths:s=[],minHeights:i=[],initialSizes:r,gutterTheme:l=Mg.Dark,gutterClassName:u,draggerClassName:d,children:p,onResizeStarted:m,onResizeFinished:f,classes:v=[]}){const _=Ww(p),[y,k]=Ik(HS,WS),C=Bo(null),w=Bo([]),E=Bo([]);w.current=[],E.current=[];const R=Y.useCallback((ae=>{k({type:vs.SetIsReadyToCompute,payload:{isReady:ae}})}),[]),D=Y.useCallback(((ae,ce)=>{k({type:vs.StartDragging,payload:{gutterIdx:ce}});const K=y.pairs[ce];m==null||m(K.idx),K.a.style.userSelect="none",K.b.style.userSelect="none",K.gutter.style.cursor=Jp(ae),K.parent.style.cursor=Jp(ae),document.body.style.cursor=Jp(ae)}),[y.pairs]),A=Y.useCallback((()=>{k({type:vs.StopDragging});const ae=[];for(let K=0;K{k({type:vs.CalculateSizes,payload:{direction:ae,gutterIdx:ce}})}),[]),ie=Y.useCallback(((ae,ce,K)=>{k({type:vs.CreatePairs,payload:{direction:ae,children:ce,gutters:K}})}),[]),se=Y.useCallback(((ae,ce,K,ye)=>{const he=ce[0].parentNode;if(!he)throw new Error("Cannot set initial sizes - parent is undefined");if(yc(ae,he)===void 0)throw new Error("Cannot set initial sizes - parent has undefined size");ce.forEach(((je,V)=>{const tt=V===0,q=V===ce.length-1;let ee,B=0;ce.length>1&&(B=K[q?V-1:V].getBoundingClientRect()[ae===dt.Horizontal?"width":"height"],B=tt||q?B/2:B),ee=ye&&V{if(y.draggingIdx===void 0)throw new Error("Cannot adjust size - 'draggingIdx' is undefined");const K=y.pairs[y.draggingIdx];if(K.size===void 0)throw new Error("Cannot adjust size - 'pair.size' is undefined");if(K.gutterSize===void 0)throw new Error("Cannot adjust size - 'pair.gutterSize' is undefined");const ye=K.aSizePct+K.bSizePct,he=ce/K.size*ye,je=ye-ce/K.size*ye,V=y.draggingIdx===0,tt=y.draggingIdx===y.pairs.length-1,{aGutterSize:q,bGutterSize:ee}=Og(K.gutterSize,V,tt),B=`calc(${he}% - ${q}px)`,H=`calc(${je}% - ${ee}px)`;ae===dt.Horizontal?(K.a.style.width=B,K.b.style.width=H):(K.a.style.height=B,K.b.style.height=H)}),[y.draggingIdx,y.pairs,a]),z=Y.useCallback(((ae,ce,K)=>{if(!y.isDragging)return;if(y.draggingIdx===void 0)throw new Error("Cannot drag - 'draggingIdx' is undefined");const ye=y.pairs[y.draggingIdx];if(ye.start===void 0)throw new Error("Cannot drag - 'pair.start' is undefined");if(ye.size===void 0)throw new Error("Cannot drag - 'pair.size' is undefined");if(ye.gutterSize===void 0)throw new Error("Cannot drag - 'pair.gutterSize' is undefined");let he=(function(tt,q){const ee=a_(q)?q.changedTouches[0]:q;return tt===dt.Horizontal?ee.clientX:ee.clientY})(ce,ae)-ye.start,je=16,V=16;K.length>y.draggingIdx&&(je=K[y.draggingIdx]),K.length>=y.draggingIdx+1&&(V=K[y.draggingIdx+1]),he=ye.size-(ye.gutterSize+V)&&(he=ye.size-(ye.gutterSize+V)),me(ce,he)}),[y.isDragging,y.draggingIdx,y.pairs,me]),Oe=()=>{if(y.isDragging){if(y.draggingIdx===void 0)throw new Error("Cannot calculate sizes after dragging = 'state.draggingIdx' is undefined");J(a,y.draggingIdx),A()}},Ne=ae=>{y.isDragging&&(a_(ae)&&ae.preventDefault(),z(ae,a,a===dt.Horizontal?s:i))};function Ze(ae,ce){if(!ae.current)throw new Error("Can't add element to ref object - ref isn't initialized");ce&&!ae.current.includes(ce)&&ae.current.push(ce)}return tc("mouseup",Oe,[y.isDragging,A]),tc("mousemove",Ne,[a,y.isDragging,z,s,i]),tc("touchend",Oe,[y.isDragging,A],{condition:hc}),tc("touchmove",Ne,[a,y.isDragging,z,s,i],{condition:hc,passive:!hc}),Mt((function(){if(!C.current)return;const ae=C.current.parentElement;if(!ae)return;const ce=new ResizeObserver((()=>{const K=getComputedStyle(ae),ye=a===dt.Horizontal?ae.clientWidth:ae.clientHeight;R(!!K&&!!ye)}));return ce.observe(ae),()=>{ce.disconnect()}}),[C.current,a]),Mt((function(){if(y.isReady&&(!w.current||w.current[0].offsetParent)){if(!w.current||!E.current)throw new Error("Cannot create pairs - either variable 'childRefs' or 'gutterRefs' is undefined");_.length<=1?se(a,w.current,E.current,r):(se(a,w.current,E.current,r),ie(a,w.current,E.current))}}),[p,y.isReady,a,se,ie,r]),g.jsx("div",Object.assign({className:`__dbk__container ${a}`,ref:C},{children:y.isReady&&_.map(((ae,ce)=>g.jsxs(Y.Fragment,{children:[g.jsx("div",Object.assign({ref:K=>Ze(w,K),className:"__dbk__child-wrapper "+(ceZe(E,K),className:u,theme:l,draggerClassName:d,direction:a,onDragging:()=>{return J(a,K=ce),void D(a,K);var K}},void 0)]},ce)))}),void 0)}const Gw=rm({dragDropManager:void 0});function Vr(a){"@babel/helpers - typeof";return Vr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},Vr(a)}function GS(a,s){if(Vr(a)!="object"||!a)return a;var i=a[Symbol.toPrimitive];if(i!==void 0){var r=i.call(a,s);if(Vr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(a)}function VS(a){var s=GS(a,"string");return Vr(s)=="symbol"?s:s+""}function KS(a,s,i){return(s=VS(s))in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function ms(a){return"Minified Redux error #"+a+"; visit https://redux.js.org/Errors?code="+a+" for the full message or use the non-minified dev environment for full errors. "}var c_=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),u_=function(){return Math.random().toString(36).substring(7).split("").join(".")},d_={INIT:"@@redux/INIT"+u_(),REPLACE:"@@redux/REPLACE"+u_()};function YS(a){if(typeof a!="object"||a===null)return!1;for(var s=a;Object.getPrototypeOf(s)!==null;)s=Object.getPrototypeOf(s);return Object.getPrototypeOf(a)===s}function Vw(a,s,i){var r;if(typeof s=="function"&&typeof i=="function"||typeof i=="function"&&typeof arguments[3]=="function")throw new Error(ms(0));if(typeof s=="function"&&typeof i>"u"&&(i=s,s=void 0),typeof i<"u"){if(typeof i!="function")throw new Error(ms(1));return i(Vw)(a,s)}if(typeof a!="function")throw new Error(ms(2));var l=a,u=s,d=[],p=d,m=!1;function f(){p===d&&(p=d.slice())}function v(){if(m)throw new Error(ms(3));return u}function _(w){if(typeof w!="function")throw new Error(ms(4));if(m)throw new Error(ms(5));var E=!0;return f(),p.push(w),function(){if(E){if(m)throw new Error(ms(6));E=!1,f();var D=p.indexOf(w);p.splice(D,1),d=null}}}function y(w){if(!YS(w))throw new Error(ms(7));if(typeof w.type>"u")throw new Error(ms(8));if(m)throw new Error(ms(9));try{m=!0,u=l(u,w)}finally{m=!1}for(var E=d=p,R=0;Rr&&r[l]?r[l]:i||null,a)}function XS(a,s){return a.filter(i=>i!==s)}function Kw(a){return typeof a=="object"}function ZS(a,s){const i=new Map,r=u=>{i.set(u,i.has(u)?i.get(u)+1:1)};a.forEach(r),s.forEach(r);const l=[];return i.forEach((u,d)=>{u===1&&l.push(d)}),l}function QS(a,s){return a.filter(i=>s.indexOf(i)>-1)}const dm="dnd-core/INIT_COORDS",Kc="dnd-core/BEGIN_DRAG",hm="dnd-core/PUBLISH_DRAG_SOURCE",Yc="dnd-core/HOVER",Jc="dnd-core/DROP",qc="dnd-core/END_DRAG";function h_(a,s){return{type:dm,payload:{sourceClientOffset:s||null,clientOffset:a||null}}}const eE={type:dm,payload:{clientOffset:null,sourceClientOffset:null}};function tE(a){return function(i=[],r={publishSource:!0}){const{publishSource:l=!0,clientOffset:u,getSourceClientOffset:d}=r,p=a.getMonitor(),m=a.getRegistry();a.dispatch(h_(u)),sE(i,p,m);const f=nE(i,p);if(f==null){a.dispatch(eE);return}let v=null;if(u){if(!d)throw new Error("getSourceClientOffset must be defined");oE(d),v=d(f)}a.dispatch(h_(u,v));const y=m.getSource(f).beginDrag(p,f);if(y==null)return;iE(y),m.pinSource(f);const k=m.getSourceType(f);return{type:Kc,payload:{itemType:k,item:y,sourceId:f,clientOffset:u||null,sourceClientOffset:v||null,isSourcePublic:!!l}}}}function sE(a,s,i){Ie(!s.isDragging(),"Cannot call beginDrag while dragging."),a.forEach(function(r){Ie(i.getSource(r),"Expected sourceIds to be registered.")})}function oE(a){Ie(typeof a=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function iE(a){Ie(Kw(a),"Item must be an object.")}function nE(a,s){let i=null;for(let r=a.length-1;r>=0;r--)if(s.canDragSource(a[r])){i=a[r];break}return i}function rE(a,s,i){return s in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function aE(a){for(var s=1;s{const m=uE(d,p,l,r),f={type:Jc,payload:{dropResult:aE({},i,m)}};a.dispatch(f)})}}function cE(a){Ie(a.isDragging(),"Cannot call drop while not dragging."),Ie(!a.didDrop(),"Cannot call drop twice during one drag operation.")}function uE(a,s,i,r){const l=i.getTarget(a);let u=l?l.drop(r,a):void 0;return dE(u),typeof u>"u"&&(u=s===0?{}:r.getDropResult()),u}function dE(a){Ie(typeof a>"u"||Kw(a),"Drop result must either be an object or undefined.")}function hE(a){const s=a.getTargetIds().filter(a.canDropOnTarget,a);return s.reverse(),s}function pE(a){return function(){const i=a.getMonitor(),r=a.getRegistry();gE(i);const l=i.getSourceId();return l!=null&&(r.getSource(l,!0).endDrag(i,l),r.unpinSource()),{type:qc}}}function gE(a){Ie(a.isDragging(),"Cannot call endDrag while not dragging.")}function Ng(a,s){return s===null?a===null:Array.isArray(a)?a.some(i=>i===s):a===s}function mE(a){return function(i,{clientOffset:r}={}){fE(i);const l=i.slice(0),u=a.getMonitor(),d=a.getRegistry(),p=u.getItemType();return bE(l,d,p),$E(l,u,d),vE(l,u,d),{type:Yc,payload:{targetIds:l,clientOffset:r||null}}}}function fE(a){Ie(Array.isArray(a),"Expected targetIds to be an array.")}function $E(a,s,i){Ie(s.isDragging(),"Cannot call hover while not dragging."),Ie(!s.didDrop(),"Cannot call hover after drop.");for(let r=0;r=0;r--){const l=a[r],u=s.getTargetType(l);Ng(u,i)||a.splice(r,1)}}function vE(a,s,i){a.forEach(function(r){i.getTarget(r).hover(s,r)})}function yE(a){return function(){if(a.getMonitor().isDragging())return{type:hm}}}function _E(a){return{beginDrag:tE(a),publishDragSource:yE(a),hover:mE(a),drop:lE(a),endDrag:pE(a)}}class wE{receiveBackend(s){this.backend=s}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const s=this,{dispatch:i}=this.store;function r(u){return(...d)=>{const p=u.apply(s,d);typeof p<"u"&&i(p)}}const l=_E(this);return Object.keys(l).reduce((u,d)=>{const p=l[d];return u[d]=r(p),u},{})}dispatch(s){this.store.dispatch(s)}constructor(s,i){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=s,this.monitor=i,s.subscribe(this.handleRefCountChange)}}function CE(a,s){return{x:a.x+s.x,y:a.y+s.y}}function Yw(a,s){return{x:a.x-s.x,y:a.y-s.y}}function TE(a){const{clientOffset:s,initialClientOffset:i,initialSourceClientOffset:r}=a;return!s||!i||!r?null:Yw(CE(s,r),i)}function kE(a){const{clientOffset:s,initialClientOffset:i}=a;return!s||!i?null:Yw(s,i)}const Fr=[],pm=[];Fr.__IS_NONE__=!0;pm.__IS_ALL__=!0;function SE(a,s){return a===Fr?!1:a===pm||typeof s>"u"?!0:QS(s,a).length>0}class EE{subscribeToStateChange(s,i={}){const{handlerIds:r}=i;Ie(typeof s=="function","listener must be a function."),Ie(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let l=this.store.getState().stateId;const u=()=>{const d=this.store.getState(),p=d.stateId;try{p===l||p===l+1&&!SE(d.dirtyHandlerIds,r)||s()}finally{l=p}};return this.store.subscribe(u)}subscribeToOffsetChange(s){Ie(typeof s=="function","listener must be a function.");let i=this.store.getState().dragOffset;const r=()=>{const l=this.store.getState().dragOffset;l!==i&&(i=l,s())};return this.store.subscribe(r)}canDragSource(s){if(!s)return!1;const i=this.registry.getSource(s);return Ie(i,`Expected to find a valid source. sourceId=${s}`),this.isDragging()?!1:i.canDrag(this,s)}canDropOnTarget(s){if(!s)return!1;const i=this.registry.getTarget(s);if(Ie(i,`Expected to find a valid target. targetId=${s}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(s),l=this.getItemType();return Ng(r,l)&&i.canDrop(this,s)}isDragging(){return!!this.getItemType()}isDraggingSource(s){if(!s)return!1;const i=this.registry.getSource(s,!0);if(Ie(i,`Expected to find a valid source. sourceId=${s}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(s),l=this.getItemType();return r!==l?!1:i.isDragging(this,s)}isOverTarget(s,i={shallow:!1}){if(!s)return!1;const{shallow:r}=i;if(!this.isDragging())return!1;const l=this.registry.getTargetType(s),u=this.getItemType();if(u&&!Ng(l,u))return!1;const d=this.getTargetIds();if(!d.length)return!1;const p=d.indexOf(s);return r?p===d.length-1:p>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return TE(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return kE(this.store.getState().dragOffset)}constructor(s,i){this.store=s,this.registry=i}}const p_=typeof global<"u"?global:self,Jw=p_.MutationObserver||p_.WebKitMutationObserver;function qw(a){return function(){const i=setTimeout(l,0),r=setInterval(l,50);function l(){clearTimeout(i),clearInterval(r),a()}}}function IE(a){let s=1;const i=new Jw(a),r=document.createTextNode("");return i.observe(r,{characterData:!0}),function(){s=-s,r.data=s}}const xE=typeof Jw=="function"?IE:qw;class DE{enqueueTask(s){const{queue:i,requestFlush:r}=this;i.length||(r(),this.flushing=!0),i[i.length]=s}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:s}=this;for(;this.indexthis.capacity){for(let r=0,l=s.length-this.index;r{this.pendingErrors.push(s),this.requestErrorThrow()},this.requestFlush=xE(this.flush),this.requestErrorThrow=qw(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class AE{call(){try{this.task&&this.task()}catch(s){this.onError(s)}finally{this.task=null,this.release(this)}}constructor(s,i){this.onError=s,this.release=i,this.task=null}}class RE{create(s){const i=this.freeTasks,r=i.length?i.pop():new AE(this.onError,l=>i[i.length]=l);return r.task=s,r}constructor(s){this.onError=s,this.freeTasks=[]}}const Xw=new DE,OE=new RE(Xw.registerPendingError);function ME(a){Xw.enqueueTask(OE.create(a))}const gm="dnd-core/ADD_SOURCE",mm="dnd-core/ADD_TARGET",fm="dnd-core/REMOVE_SOURCE",Xc="dnd-core/REMOVE_TARGET";function NE(a){return{type:gm,payload:{sourceId:a}}}function LE(a){return{type:mm,payload:{targetId:a}}}function PE(a){return{type:fm,payload:{sourceId:a}}}function BE(a){return{type:Xc,payload:{targetId:a}}}function jE(a){Ie(typeof a.canDrag=="function","Expected canDrag to be a function."),Ie(typeof a.beginDrag=="function","Expected beginDrag to be a function."),Ie(typeof a.endDrag=="function","Expected endDrag to be a function.")}function FE(a){Ie(typeof a.canDrop=="function","Expected canDrop to be a function."),Ie(typeof a.hover=="function","Expected hover to be a function."),Ie(typeof a.drop=="function","Expected beginDrag to be a function.")}function Lg(a,s){if(s&&Array.isArray(a)){a.forEach(i=>Lg(i,!1));return}Ie(typeof a=="string"||typeof a=="symbol",s?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var bs;(function(a){a.SOURCE="SOURCE",a.TARGET="TARGET"})(bs||(bs={}));let zE=0;function UE(){return zE++}function HE(a){const s=UE().toString();switch(a){case bs.SOURCE:return`S${s}`;case bs.TARGET:return`T${s}`;default:throw new Error(`Unknown Handler Role: ${a}`)}}function g_(a){switch(a[0]){case"S":return bs.SOURCE;case"T":return bs.TARGET;default:throw new Error(`Cannot parse handler ID: ${a}`)}}function m_(a,s){const i=a.entries();let r=!1;do{const{done:l,value:[,u]}=i.next();if(u===s)return!0;r=!!l}while(!r);return!1}class WE{addSource(s,i){Lg(s),jE(i);const r=this.addHandler(bs.SOURCE,s,i);return this.store.dispatch(NE(r)),r}addTarget(s,i){Lg(s,!0),FE(i);const r=this.addHandler(bs.TARGET,s,i);return this.store.dispatch(LE(r)),r}containsHandler(s){return m_(this.dragSources,s)||m_(this.dropTargets,s)}getSource(s,i=!1){return Ie(this.isSourceId(s),"Expected a valid source ID."),i&&s===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(s)}getTarget(s){return Ie(this.isTargetId(s),"Expected a valid target ID."),this.dropTargets.get(s)}getSourceType(s){return Ie(this.isSourceId(s),"Expected a valid source ID."),this.types.get(s)}getTargetType(s){return Ie(this.isTargetId(s),"Expected a valid target ID."),this.types.get(s)}isSourceId(s){return g_(s)===bs.SOURCE}isTargetId(s){return g_(s)===bs.TARGET}removeSource(s){Ie(this.getSource(s),"Expected an existing source."),this.store.dispatch(PE(s)),ME(()=>{this.dragSources.delete(s),this.types.delete(s)})}removeTarget(s){Ie(this.getTarget(s),"Expected an existing target."),this.store.dispatch(BE(s)),this.dropTargets.delete(s),this.types.delete(s)}pinSource(s){const i=this.getSource(s);Ie(i,"Expected an existing source."),this.pinnedSourceId=s,this.pinnedSource=i}unpinSource(){Ie(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(s,i,r){const l=HE(s);return this.types.set(l,i),s===bs.SOURCE?this.dragSources.set(l,r):s===bs.TARGET&&this.dropTargets.set(l,r),l}constructor(s){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=s}}const GE=(a,s)=>a===s;function VE(a,s){return!a&&!s?!0:!a||!s?!1:a.x===s.x&&a.y===s.y}function KE(a,s,i=GE){if(a.length!==s.length)return!1;for(let r=0;r0||!KE(i,r)))return Fr;const d=r[r.length-1],p=i[i.length-1];return d!==p&&(d&&l.push(d),p&&l.push(p)),l}function JE(a,s,i){return s in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function qE(a){for(var s=1;s=0)&&Object.prototype.propertyIsEnumerable.call(a,r)&&(i[r]=a[r])}return i}function cI(a,s){if(a==null)return{};var i={},r=Object.keys(a),l,u;for(u=0;u=0)&&(i[l]=a[l]);return i}let $_=0;const pc=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var Zw=am(function(s){var{children:i}=s,r=lI(s,["children"]);const[l,u]=uI(r);return Mt(()=>{if(u){const d=Qw();return++$_,()=>{--$_===0&&(d[pc]=null)}}},[]),g.jsx(Gw.Provider,{value:l,children:i})});function uI(a){if("manager"in a)return[{dragDropManager:a.manager},!1];const s=dI(a.backend,a.context,a.options,a.debugMode),i=!a.context;return[s,i]}function dI(a,s=Qw(),i,r){const l=s;return l[pc]||(l[pc]={dragDropManager:rI(a,s,i,r)}),l[pc]}function Qw(){return typeof global<"u"?global:window}var hI=function a(s,i){if(s===i)return!0;if(s&&i&&typeof s=="object"&&typeof i=="object"){if(s.constructor!==i.constructor)return!1;var r,l,u;if(Array.isArray(s)){if(r=s.length,r!=i.length)return!1;for(l=r;l--!==0;)if(!a(s[l],i[l]))return!1;return!0}if(s.constructor===RegExp)return s.source===i.source&&s.flags===i.flags;if(s.valueOf!==Object.prototype.valueOf)return s.valueOf()===i.valueOf();if(s.toString!==Object.prototype.toString)return s.toString()===i.toString();if(u=Object.keys(s),r=u.length,r!==Object.keys(i).length)return!1;for(l=r;l--!==0;)if(!Object.prototype.hasOwnProperty.call(i,u[l]))return!1;for(l=r;l--!==0;){var d=u[l];if(!a(s[d],i[d]))return!1}return!0}return s!==s&&i!==i};const pI=Si(hI),Ci=typeof window<"u"?lm:Mt;function gI(a,s,i){const[r,l]=vt(()=>s(a)),u=_n(()=>{const d=s(a);pI(r,d)||(l(d),i&&i())},[r,a,i]);return Ci(u),[r,u]}function mI(a,s,i){const[r,l]=gI(a,s,i);return Ci(function(){const d=a.getHandlerId();if(d!=null)return a.subscribeToStateChange(l,{handlerIds:[d]})},[a,l]),r}function eC(a,s,i){return mI(s,a||(()=>({})),()=>i.reconnect())}function tC(a,s){const i=[];return typeof a!="function"&&i.push(a),rs(()=>typeof a=="function"?a():a,i)}function fI(a){return rs(()=>a.hooks.dragSource(),[a])}function $I(a){return rs(()=>a.hooks.dragPreview(),[a])}let qp=!1,Xp=!1;class bI{receiveHandlerId(s){this.sourceId=s}getHandlerId(){return this.sourceId}canDrag(){Ie(!qp,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return qp=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{qp=!1}}isDragging(){if(!this.sourceId)return!1;Ie(!Xp,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Xp=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Xp=!1}}subscribeToStateChange(s,i){return this.internalMonitor.subscribeToStateChange(s,i)}isDraggingSource(s){return this.internalMonitor.isDraggingSource(s)}isOverTarget(s,i){return this.internalMonitor.isOverTarget(s,i)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(s){return this.internalMonitor.subscribeToOffsetChange(s)}canDragSource(s){return this.internalMonitor.canDragSource(s)}canDropOnTarget(s){return this.internalMonitor.canDropOnTarget(s)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(s){this.sourceId=null,this.internalMonitor=s.getMonitor()}}let Zp=!1;class vI{receiveHandlerId(s){this.targetId=s}getHandlerId(){return this.targetId}subscribeToStateChange(s,i){return this.internalMonitor.subscribeToStateChange(s,i)}canDrop(){if(!this.targetId)return!1;Ie(!Zp,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Zp=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Zp=!1}}isOver(s){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,s):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(s){this.targetId=null,this.internalMonitor=s.getMonitor()}}function yI(a,s,i){const r=i.getRegistry(),l=r.addTarget(a,s);return[l,()=>r.removeTarget(l)]}function _I(a,s,i){const r=i.getRegistry(),l=r.addSource(a,s);return[l,()=>r.removeSource(l)]}function Pg(a,s,i,r){let l;if(l!==void 0)return!!l;if(a===s)return!0;if(typeof a!="object"||!a||typeof s!="object"||!s)return!1;const u=Object.keys(a),d=Object.keys(s);if(u.length!==d.length)return!1;const p=Object.prototype.hasOwnProperty.bind(s);for(let m=0;m, or turn it into a drag source or a drop target itself.`)}function CI(a){return(s=null,i=null)=>{if(!kw(s)){const u=s;return a(u,i),u}const r=s;return wI(r),TI(r,i?u=>a(u,i):a)}}function sC(a){const s={};return Object.keys(a).forEach(i=>{const r=a[i];if(i.endsWith("Ref"))s[i]=a[i];else{const l=CI(r);s[i]=()=>l}}),s}function b_(a,s){typeof a=="function"?a(s):a.current=s}function TI(a,s){const i=a.ref;return Ie(typeof i!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a or
. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),i?kg(a,{ref:r=>{b_(i,r),b_(s,r)}}):kg(a,{ref:s})}class kI{receiveHandlerId(s){this.handlerId!==s&&(this.handlerId=s,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(s){this.dragSourceOptionsInternal=s}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(s){this.dragPreviewOptionsInternal=s}reconnect(){const s=this.reconnectDragSource();this.reconnectDragPreview(s)}reconnectDragSource(){const s=this.dragSource,i=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return i&&this.disconnectDragSource(),this.handlerId?s?(i&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=s,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,s,this.dragSourceOptions)),i):(this.lastConnectedDragSource=s,i):i}reconnectDragPreview(s=!1){const i=this.dragPreview,r=s||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!i){this.lastConnectedDragPreview=i;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=i,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,i,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Pg(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Pg(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(s){this.hooks=sC({dragSource:(i,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,Bg(i)?this.dragSourceRef=i:this.dragSourceNode=i,this.reconnectDragSource()},dragPreview:(i,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,Bg(i)?this.dragPreviewRef=i:this.dragPreviewNode=i,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=s}}class SI{get connectTarget(){return this.dropTarget}reconnect(){const s=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();s&&this.disconnectDropTarget();const i=this.dropTarget;if(this.handlerId){if(!i){this.lastConnectedDropTarget=i;return}s&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=i,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,i,this.dropTargetOptions))}}receiveHandlerId(s){s!==this.handlerId&&(this.handlerId=s,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(s){this.dropTargetOptionsInternal=s}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Pg(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(s){this.hooks=sC({dropTarget:(i,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,Bg(i)?this.dropTargetRef=i:this.dropTargetNode=i,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=s}}function Mn(){const{dragDropManager:a}=Xr(Gw);return Ie(a!=null,"Expected drag drop context"),a}function EI(a,s){const i=Mn(),r=rs(()=>new kI(i.getBackend()),[i]);return Ci(()=>(r.dragSourceOptions=a||null,r.reconnect(),()=>r.disconnectDragSource()),[r,a]),Ci(()=>(r.dragPreviewOptions=s||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,s]),r}function II(){const a=Mn();return rs(()=>new bI(a),[a])}class xI{beginDrag(){const s=this.spec,i=this.monitor;let r=null;return typeof s.item=="object"?r=s.item:typeof s.item=="function"?r=s.item(i):r={},r??null}canDrag(){const s=this.spec,i=this.monitor;return typeof s.canDrag=="boolean"?s.canDrag:typeof s.canDrag=="function"?s.canDrag(i):!0}isDragging(s,i){const r=this.spec,l=this.monitor,{isDragging:u}=r;return u?u(l):i===s.getSourceId()}endDrag(){const s=this.spec,i=this.monitor,r=this.connector,{end:l}=s;l&&l(i.getItem(),i),r.reconnect()}constructor(s,i,r){this.spec=s,this.monitor=i,this.connector=r}}function DI(a,s,i){const r=rs(()=>new xI(a,s,i),[s,i]);return Mt(()=>{r.spec=a},[a]),r}function AI(a){return rs(()=>{const s=a.type;return Ie(s!=null,"spec.type must be defined"),s},[a])}function RI(a,s,i){const r=Mn(),l=DI(a,s,i),u=AI(a);Ci(function(){if(u!=null){const[p,m]=_I(u,l,r);return s.receiveHandlerId(p),i.receiveHandlerId(p),m}},[r,s,i,l,u])}function OI(a,s){const i=tC(a);Ie(!i.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=II(),l=EI(i.options,i.previewOptions);return RI(i,r,l),[eC(i.collect,r,l),fI(l),$I(l)]}function MI(a){return rs(()=>a.hooks.dropTarget(),[a])}function NI(a){const s=Mn(),i=rs(()=>new SI(s.getBackend()),[s]);return Ci(()=>(i.dropTargetOptions=a||null,i.reconnect(),()=>i.disconnectDropTarget()),[a]),i}function LI(){const a=Mn();return rs(()=>new vI(a),[a])}function PI(a){const{accept:s}=a;return rs(()=>(Ie(a.accept!=null,"accept must be defined"),Array.isArray(s)?s:[s]),[s])}class BI{canDrop(){const s=this.spec,i=this.monitor;return s.canDrop?s.canDrop(i.getItem(),i):!0}hover(){const s=this.spec,i=this.monitor;s.hover&&s.hover(i.getItem(),i)}drop(){const s=this.spec,i=this.monitor;if(s.drop)return s.drop(i.getItem(),i)}constructor(s,i){this.spec=s,this.monitor=i}}function jI(a,s){const i=rs(()=>new BI(a,s),[s]);return Mt(()=>{i.spec=a},[a]),i}function FI(a,s,i){const r=Mn(),l=jI(a,s),u=PI(a);Ci(function(){const[p,m]=yI(u,l,r);return s.receiveHandlerId(p),i.receiveHandlerId(p),m},[r,s,l,i,u.map(d=>d.toString()).join("|")])}function zI(a,s){const i=tC(a),r=LI(),l=NI(i.options);return FI(i,r,l),[eC(i.collect,r,l),MI(l)]}function oC(a){let s=null;return()=>(s==null&&(s=a()),s)}function UI(a,s){return a.filter(i=>i!==s)}function HI(a,s){const i=new Set,r=u=>i.add(u);a.forEach(r),s.forEach(r);const l=[];return i.forEach(u=>l.push(u)),l}class WI{enter(s){const i=this.entered.length,r=l=>this.isNodeInDocument(l)&&(!l.contains||l.contains(s));return this.entered=HI(this.entered.filter(r),[s]),i===0&&this.entered.length>0}leave(s){const i=this.entered.length;return this.entered=UI(this.entered.filter(this.isNodeInDocument),s),i>0&&this.entered.length===0}reset(){this.entered=[]}constructor(s){this.entered=[],this.isNodeInDocument=s}}class GI{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(s=>{Object.defineProperty(this.item,s,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${s}" until the drop event.`),null}})})}loadDataTransfer(s){if(s){const i={};Object.keys(this.config.exposeProperties).forEach(r=>{const l=this.config.exposeProperties[r];l!=null&&(i[r]={value:l(s,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,i)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(s,i){return i===s.getSourceId()}endDrag(){}constructor(s){this.config=s,this.item={},this.initializeExposedProperties()}}const iC="__NATIVE_FILE__",nC="__NATIVE_URL__",rC="__NATIVE_TEXT__",aC="__NATIVE_HTML__",v_=Object.freeze(Object.defineProperty({__proto__:null,FILE:iC,HTML:aC,TEXT:rC,URL:nC},Symbol.toStringTag,{value:"Module"}));function Qp(a,s,i){const r=s.reduce((l,u)=>l||a.getData(u),"");return r??i}const jg={[iC]:{exposeProperties:{files:a=>Array.prototype.slice.call(a.files),items:a=>a.items,dataTransfer:a=>a},matchesTypes:["Files"]},[aC]:{exposeProperties:{html:(a,s)=>Qp(a,s,""),dataTransfer:a=>a},matchesTypes:["Html","text/html"]},[nC]:{exposeProperties:{urls:(a,s)=>Qp(a,s,"").split(` -`),dataTransfer:a=>a},matchesTypes:["Url","text/uri-list"]},[rC]:{exposeProperties:{text:(a,s)=>Qp(a,s,""),dataTransfer:a=>a},matchesTypes:["Text","text/plain"]}};function VI(a,s){const i=jg[a];if(!i)throw new Error(`native type ${a} has no configuration`);const r=new GI(i);return r.loadDataTransfer(s),r}function eg(a){if(!a)return null;const s=Array.prototype.slice.call(a.types||[]);return Object.keys(jg).filter(i=>{const r=jg[i];return r!=null&&r.matchesTypes?r.matchesTypes.some(l=>s.indexOf(l)>-1):!1})[0]||null}const KI=oC(()=>/firefox/i.test(navigator.userAgent)),lC=oC(()=>!!window.safari);class y_{interpolate(s){const{xs:i,ys:r,c1s:l,c2s:u,c3s:d}=this;let p=i.length-1;if(s===i[p])return r[p];let m=0,f=d.length-1,v;for(;m<=f;){v=Math.floor(.5*(m+f));const k=i[v];if(ks)f=v-1;else return r[v]}p=Math.max(0,f);const _=s-i[p],y=_*_;return r[p]+l[p]*_+u[p]*y+d[p]*_*y}constructor(s,i){const{length:r}=s,l=[];for(let k=0;ks[k]{let se=new y_([0,.5,1],[m.y,m.y/v*C,m.y+C-v]).interpolate(y);return lC()&&u&&(se+=(window.devicePixelRatio-1)*C),se},E=()=>new y_([0,.5,1],[m.x,m.x/f*k,m.x+k-f]).interpolate(_),{offsetX:R,offsetY:D}=l,A=R===0||R,J=D===0||D;return{x:A?R:E(),y:J?D:w()}}let ZI=class{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var s;return!((s=this.globalContext)===null||s===void 0)&&s.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var s;return((s=this.optionsArgs)===null||s===void 0?void 0:s.rootElement)||this.window}constructor(s,i){this.ownerDocument=null,this.globalContext=s,this.optionsArgs=i}};function QI(a,s,i){return s in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function __(a){for(var s=1;s{this.sourcePreviewNodes.delete(s),this.sourcePreviewNodeOptions.delete(s)}}connectDragSource(s,i,r){this.sourceNodes.set(s,i),this.sourceNodeOptions.set(s,r);const l=d=>this.handleDragStart(d,s),u=d=>this.handleSelectStart(d);return i.setAttribute("draggable","true"),i.addEventListener("dragstart",l),i.addEventListener("selectstart",u),()=>{this.sourceNodes.delete(s),this.sourceNodeOptions.delete(s),i.removeEventListener("dragstart",l),i.removeEventListener("selectstart",u),i.setAttribute("draggable","false")}}connectDropTarget(s,i){const r=d=>this.handleDragEnter(d,s),l=d=>this.handleDragOver(d,s),u=d=>this.handleDrop(d,s);return i.addEventListener("dragenter",r),i.addEventListener("dragover",l),i.addEventListener("drop",u),()=>{i.removeEventListener("dragenter",r),i.removeEventListener("dragover",l),i.removeEventListener("drop",u)}}addEventListeners(s){s.addEventListener&&(s.addEventListener("dragstart",this.handleTopDragStart),s.addEventListener("dragstart",this.handleTopDragStartCapture,!0),s.addEventListener("dragend",this.handleTopDragEndCapture,!0),s.addEventListener("dragenter",this.handleTopDragEnter),s.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),s.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),s.addEventListener("dragover",this.handleTopDragOver),s.addEventListener("dragover",this.handleTopDragOverCapture,!0),s.addEventListener("drop",this.handleTopDrop),s.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(s){s.removeEventListener&&(s.removeEventListener("dragstart",this.handleTopDragStart),s.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),s.removeEventListener("dragend",this.handleTopDragEndCapture,!0),s.removeEventListener("dragenter",this.handleTopDragEnter),s.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),s.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),s.removeEventListener("dragover",this.handleTopDragOver),s.removeEventListener("dragover",this.handleTopDragOverCapture,!0),s.removeEventListener("drop",this.handleTopDrop),s.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const s=this.monitor.getSourceId(),i=this.sourceNodeOptions.get(s);return __({dropEffect:this.altKeyPressed?"copy":"move"},i||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const s=this.monitor.getSourceId(),i=this.sourcePreviewNodeOptions.get(s);return __({anchorX:.5,anchorY:.5,captureDraggingState:!1},i||{})}isDraggingNativeItem(){const s=this.monitor.getItemType();return Object.keys(v_).some(i=>v_[i]===s)}beginDragNativeItem(s,i){this.clearCurrentDragSourceNode(),this.currentNativeSource=VI(s,i),this.currentNativeHandle=this.registry.addSource(s,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(s){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=s;const i=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},i)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var s;(s=this.window)===null||s===void 0||s.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(s,i){s.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(i))}handleDragEnter(s,i){this.dragEnterTargetIds.unshift(i)}handleDragOver(s,i){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(i)}handleDrop(s,i){this.dropTargetIds.unshift(i)}constructor(s,i,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=l=>{const u=this.sourceNodes.get(l);return u&&cC(u)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=l=>!!(l&&this.document&&this.document.body&&this.document.body.contains(l)),this.endDragIfSourceWasRemovedFromDOM=()=>{const l=this.currentDragSourceNode;l==null||this.isNodeInDocument(l)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=l=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(l||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=l=>{if(l.defaultPrevented)return;const{dragStartSourceIds:u}=this;this.dragStartSourceIds=null;const d=sc(l);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(u||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:d});const{dataTransfer:p}=l,m=eg(p);if(this.monitor.isDragging()){if(p&&typeof p.setDragImage=="function"){const v=this.monitor.getSourceId(),_=this.sourceNodes.get(v),y=this.sourcePreviewNodes.get(v)||_;if(y){const{anchorX:k,anchorY:C,offsetX:w,offsetY:E}=this.getCurrentSourcePreviewNodeOptions(),A=XI(_,y,d,{anchorX:k,anchorY:C},{offsetX:w,offsetY:E});p.setDragImage(y,A.x,A.y)}}try{p==null||p.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(l.target);const{captureDraggingState:f}=this.getCurrentSourcePreviewNodeOptions();f?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(m)this.beginDragNativeItem(m);else{if(p&&!p.types&&(l.target&&!l.target.hasAttribute||!l.target.hasAttribute("draggable")))return;l.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=l=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var u;(u=this.currentNativeSource)===null||u===void 0||u.loadDataTransfer(l.dataTransfer)}if(!this.enterLeaveCounter.enter(l.target)||this.monitor.isDragging())return;const{dataTransfer:p}=l,m=eg(p);m&&this.beginDragNativeItem(m,p)},this.handleTopDragEnter=l=>{const{dragEnterTargetIds:u}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=l.altKey,u.length>0&&this.actions.hover(u,{clientOffset:sc(l)}),u.some(p=>this.monitor.canDropOnTarget(p))&&(l.preventDefault(),l.dataTransfer&&(l.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=l=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var u;(u=this.currentNativeSource)===null||u===void 0||u.loadDataTransfer(l.dataTransfer)}},this.handleTopDragOver=l=>{const{dragOverTargetIds:u}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){l.preventDefault(),l.dataTransfer&&(l.dataTransfer.dropEffect="none");return}this.altKeyPressed=l.altKey,this.lastClientOffset=sc(l),this.scheduleHover(u),(u||[]).some(p=>this.monitor.canDropOnTarget(p))?(l.preventDefault(),l.dataTransfer&&(l.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?l.preventDefault():(l.preventDefault(),l.dataTransfer&&(l.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=l=>{this.isDraggingNativeItem()&&l.preventDefault(),this.enterLeaveCounter.leave(l.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=l=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var u;l.preventDefault(),(u=this.currentNativeSource)===null||u===void 0||u.loadDataTransfer(l.dataTransfer)}else eg(l.dataTransfer)&&l.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=l=>{const{dropTargetIds:u}=this;this.dropTargetIds=[],this.actions.hover(u,{clientOffset:sc(l)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=l=>{const u=l.target;typeof u.dragDrop=="function"&&(u.tagName==="INPUT"||u.tagName==="SELECT"||u.tagName==="TEXTAREA"||u.isContentEditable||(l.preventDefault(),u.dragDrop()))},this.options=new ZI(i,r),this.actions=s.getActions(),this.monitor=s.getMonitor(),this.registry=s.getRegistry(),this.enterLeaveCounter=new WI(this.isNodeInDocument)}}const uC=function(s,i,r){return new ex(s,i,r)},tx=ht([g.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),g.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"AccessTime"),sx=ht(g.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox"),ox=ht(g.jsx("path",{d:"M4 8h4V4H4zm6 12h4v-4h-4zm-6 0h4v-4H4zm0-6h4v-4H4zm6 0h4v-4h-4zm6-10v4h4V4zm-6 4h4V4h-4zm6 6h4v-4h-4zm0 6h4v-4h-4z"}),"Apps"),ix=ht(g.jsx("path",{d:"M9 2c-1.05 0-2.05.16-3 .46 4.06 1.27 7 5.06 7 9.54s-2.94 8.27-7 9.54c.95.3 1.95.46 3 .46 5.52 0 10-4.48 10-10S14.52 2 9 2"}),"Brightness3"),nx=ht(g.jsx("path",{d:"M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5s-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20zm-6 8h-4v-2h4zm0-4h-4v-2h4z"}),"BugReport"),rx=ht(g.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm-1 4 6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2zm-1 7h5.5L14 6.5z"}),"FileCopy"),ax=ht(g.jsx("path",{d:"M7 2v11h3v9l7-12h-4l4-8z"}),"FlashOn"),lx=ht(g.jsx("path",{d:"M3.27 5 2 6.27l6.97 6.97L6.5 19h3l1.57-3.66L16.73 21 18 19.73 3.55 5.27zM6 5v.18L8.82 8h2.4l-.72 1.68 2.1 2.1L14.21 8H20V5z"}),"FormatClear"),cx=ht(g.jsx("path",{d:"M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z"}),"Functions"),dC=ht(g.jsx("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutline"),ux=ht(g.jsx("path",{d:"M21 3.01H3c-1.1 0-2 .9-2 2V9h2V4.99h18v14.03H3V15H1v4.01c0 1.1.9 1.98 2 1.98h18c1.1 0 2-.88 2-1.98v-14c0-1.11-.9-2-2-2M11 16l4-4-4-4v3H1v2h10z"}),"Input"),w_=ht(g.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"}),"Lock"),dx=ht(g.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert"),hx=ht(g.jsx("path",{d:"M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10c1.38 0 2.5-1.12 2.5-2.5 0-.61-.23-1.2-.64-1.67-.08-.1-.13-.21-.13-.33 0-.28.22-.5.5-.5H16c3.31 0 6-2.69 6-6 0-4.96-4.49-9-10-9m5.5 11c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m-3-4c-.83 0-1.5-.67-1.5-1.5S13.67 6 14.5 6s1.5.67 1.5 1.5S15.33 9 14.5 9M5 11.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5S7.33 13 6.5 13 5 12.33 5 11.5m6-4c0 .83-.67 1.5-1.5 1.5S8 8.33 8 7.5 8.67 6 9.5 6s1.5.67 1.5 1.5"}),"Palette"),gc=ht(g.jsx("path",{d:"M6 19h4V5H6zm8-14v14h4V5z"}),"Pause"),Fg=ht(g.jsx("path",{d:"M8 5v14l11-7z"}),"PlayArrow"),px=ht(g.jsx("path",{d:"M11 5v5.59H7.5l4.5 4.5 4.5-4.5H13V5zm-5 9c0 3.31 2.69 6 6 6s6-2.69 6-6h-2c0 2.21-1.79 4-4 4s-4-1.79-4-4z"}),"PlayForWork"),gx=ht(g.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search"),mx=ht(g.jsx("path",{d:"M10.59 9.17 5.41 4 4 5.41l5.17 5.17zM14.5 4l2.04 2.04L4 18.59 5.41 20 17.96 7.46 20 9.5V4zm.33 9.41-1.41 1.41 3.13 3.13L14.5 20H20v-5.5l-2.04 2.04z"}),"Shuffle"),fx=ht(g.jsx("path",{d:"M2 20h20v-4H2zm2-3h2v2H4zM2 4v4h20V4zm4 3H4V5h2zm-4 7h20v-4H2zm2-3h2v2H4z"}),"Storage"),$x=ht(g.jsx("path",{d:"M14 17H4v2h10zm6-8H4v2h16zM4 15h16v-2H4zM4 5v2h16V5z"}),"Subject"),bx=ht(g.jsx("path",{d:"M16 17.01V10h-2v7.01h-3L15 21l4-3.99zM9 3 5 6.99h3V14h2V6.99h3z"}),"SwapVert"),vx=ht(g.jsx("path",{d:"M7.41 18.59 8.83 20 12 16.83 15.17 20l1.41-1.41L12 14zm9.18-13.18L15.17 4 12 7.17 8.83 4 7.41 5.41 12 10z"}),"UnfoldLess"),yx=ht(g.jsx("path",{d:"M12 5.83 15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15z"}),"UnfoldMore"),_c="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='512'%20height='512'%20shape-rendering='geometricPrecision'%20image-rendering='optimizeQuality'%20fill-rule='evenodd'%20xmlns:v='https://vecta.io/nano'%3e%3cpath%20fill='%23efda4e'%20d='M-.5-.5h512v512H-.5V-.5z'/%3e%3cpath%20fill='%23020100'%20d='M308.5%20287.5c1.777-3.005%202.777-6.338%203-10%209.147-21.963%2025.48-35.463%2049-40.5%2021.999-4.173%2043.666-2.84%2065%204%2014.575%205.411%2025.575%2014.911%2033%2028.5l-1%202c-12.413%205.624-24.58%2011.624-36.5%2018-5.321-8.25-12.821-13.417-22.5-15.5-13.957-3.122-27.29-1.455-40%205-8.125%205.36-10.958%2012.86-8.5%2022.5%203.223%206.223%208.057%2010.723%2014.5%2013.5l64%2020c38.459%2016.085%2052.626%2044.585%2042.5%2085.5-7.572%2026.208-24.738%2042.041-51.5%2047.5-25.102%205.733-49.768%204.4-74-4-19.291-8.625-32.291-22.958-39-43%2011.266-8.887%2023.433-16.387%2036.5-22.5%203.117%206.896%206.784%2013.563%2011%2020%2012.705%2012.307%2027.872%2016.807%2045.5%2013.5%2022.189-3.504%2032.355-16.338%2030.5-38.5-2.833-6.833-7.667-11.667-14.5-14.5l-57-17c-36.004-11.84-52.67-36.673-50-74.5z'/%3e%3cpath%20fill='%23020200'%20d='M222.5%20238.5h43l-.5%20159c-2.688%2052.355-30.188%2076.855-82.5%2073.5-24.871-3.543-41.204-17.21-49-41l.5-2.5a12.14%2012.14%200%200%200%204.5-3.5c10.653-5.825%2021.32-11.325%2032-16.5%204.763%2021.72%2017.763%2028.887%2039%2021.5%204.616-2.618%207.783-6.451%209.5-11.5%201.163-5.968%202.163-11.968%203-18l.5-161z'/%3e%3cpath%20fill='%23615820'%20d='M311.5%20277.5c-.223%203.662-1.223%206.995-3%2010%20.223-3.662%201.223-6.995%203-10z'/%3e%3c/svg%3e",hC="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20500%20500'%3e%3cpath%20fill='%234285f4'%20d='M44.271%2027.275l206.5%201v170l-58.5-36.5c-7.005-.916-12.505%201.584-16.5%207.5v147c4.625%204.412%2010.125%206.245%2016.5%205.5l57.5-35.5c.833%2054.003%201.356%20108.003.189%20162-1.272.546-45.599-.242-48.689%201.121-3.674%207.844-4.79%2011.207-13%2023.879-4.372%205.527-2.19%204.097-10.689%2012.258-5.166%202.748-4.191%203.45-14.311%206.242-17.67%201.983-35.336%201.983-53%200-9.535-3.774-10.879-4.163-18.526-11.22-5.562-4.39-11.131-11.803-11.974-15.28-4.068-7.881-3.42-9.116-5.5-13.5-3.672-1.503-35.798.203-40.746-1.335-5.823-2.314-2.946-.422-7.954-3.689-2.888-2.668-2.255-3.221-2.421-9.904L20.771%2050.275c.36-2.108-.41-5.806%202.522-11.615%204.343-5.852%205.374-7%2010.061-9.146%206.083-2.73%208.677-1.475%2010.917-2.239z'/%3e%3cpath%20d='M258.271%2030.275l154.63.407c5.654.559%2010.783%203.17%2014.37%207.093%204.907%204.408%206.204%208.723%207.5%2013.5v373c-.208%205.716-.297%207.982-4.848%2015.404-7.078%206.393-9.879%206.39-15.652%206.692-24.804%201.296-50.079%201.189-74.96%201.041-24.516-.014-68.46.89-81.5.391l-2.512-172.528c-20.083%2012.625-42.777%2025.125-63.028%2037.5-4.127%201.292-7.294.125-9.5-3.5l1-137c1.864-2.707%204.364-3.541%207.5-2.5%2020.366%2013.427%2064.35%2038.947%2065.581%2038.339l1.419-177.839z'%20fill='%23DDD'/%3e%3c/svg%3e",pC="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20512%20512'%20width='32'%20height='32'%3e%3cpath%20fill='%23007acc'%20d='M-.5-.5h503l-1%20179h10v333h-421v-7h-91V-.5z'/%3e%3cpath%20fill='%230f81cf'%20d='M502.5-.5h9v179h-10l1-179z'/%3e%3cpath%20fill='%23fdfefe'%20d='M470.5%20227.5c.33%2017.508-.003%2034.841-1%2052-23.486-15.709-48.82-19.875-76-12.5-15.89%208.078-19.39%2019.911-10.5%2035.5%204.673%205.577%2010.173%2010.077%2016.5%2013.5l38%2019c17.945%209.278%2031.112%2023.112%2039.5%2041.5%201.352%203.22%202.186%206.553%202.5%2010a305.16%20305.16%200%200%201%201%2026c-3.553%2033.726-21.886%2054.559-55%2062.5-34.769%207.363-68.435%204.196-101-9.5-.167-19.003%200-38.003.5-57%2022.903%2021.314%2049.736%2029.147%2080.5%2023.5%2019.435-5.701%2025.268-17.868%2017.5-36.5-4.718-6.44-10.552-11.606-17.5-15.5a1552.42%201552.42%200%200%201-47-24c-27.679-19.331-38.846-45.831-33.5-79.5%206.43-26.433%2022.597-43.933%2048.5-52.5%2026.131-6.625%2052.464-7.292%2079-2a565.56%20565.56%200%200%201%2018%205.5z'/%3e%3cpath%20fill='%23fefefe'%20d='M122.5%20222.5h182v46h-65v206h-52v-206h-65v-46z'/%3e%3cpath%20fill='%2370b3e1'%20d='M470.5%20227.5c1.327%2017.505%201.327%2035.171%200%2053-.607-.124-.94-.457-1-1%20.997-17.159%201.33-34.492%201-52z'/%3e%3cpath%20fill='%236cafe0'%20d='M479.5%20386.5c1.465%205.09%202.132%2010.423%202%2016-.002%203.518-.335%206.851-1%2010a305.16%20305.16%200%200%200-1-26z'/%3e%3cpath%20fill='%231283cf'%20d='M-.5%20504.5h91v7h-91v-7z'/%3e%3c/svg%3e",gC="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIj4KICAgIDxyYWRpYWxHcmFkaWVudCBpZD0ibXlHcmFkaWVudCI+CiAgICAgICAgPHN0b3Agb2Zmc2V0PSIxMCUiIHN0b3AtY29sb3I9IiMxQzJENUYiIC8+CiAgICAgICAgPHN0b3Agb2Zmc2V0PSI5NSUiIHN0b3AtY29sb3I9IiMwQjFENTMiIC8+CiAgICA8L3JhZGlhbEdyYWRpZW50PgogICAgPHBhdGggZmlsbD0idXJsKCcjbXlHcmFkaWVudCcpIiBkPSJNLS4xLS4xaDUxMnY1MTJILS4xVi0uMXoiLz4KICAgIDxwYXRoIGZpbGw9IiNmOGY4ZmEiCiA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xsPSIjYTZhZGMwIiBkPSJNMzQ0LjUgMjQ3LjVoNDV2MThoLTQ1YzE0LjQ5LS45OTYgMjkuMTU3LTEuMzI5IDQ0LTF2LTE2Yy0xNC44NDMuMzI5LTI5LjUxLS4wMDQtNDQtMXoiLz4KICAgIDxwYXRoIGZpbGw9IiNhMmE5YmUiIGQ9Ik00MjguNSAyNzUuNWgtMjV2OGMtLjk3Ny0yLjc4Ny0xLjMxLTUuNzg3LTEtOSA4Ljg0OS0uMzI2IDE3LjUxNi4wMDcgMjYgMXoiLz4KICAgIDxwYXRoIGZpbGw9IiNhNWFjYmYiCiAgICAgICAgICBkPSJNMTEzLjUgMzAxLjVjLjk3OC4zMTEgMS42NDUuOTc4IDIgMmwtMTYgMWMtNS43MTEtLjAwNS0xMS4wNDQtLjY3Mi0xNi0yYTEyOC4xOSAxMjguMTkgMCAwIDAgMTUuNSAxYzUuMjE2LS4wMDYgMTAuMDQ5LS42NzMgMTQuNS0yeiIvPgogICAgPHBhdGggZmlsbD0iI2E1YWNjMCIgZD0iTTIzMy41IDIwOS41djk0aDY5di0xN2MtMTMuNTEuMzI5LTI2Ljg0NC0uMDA0LTQwLTFoNDF2MTloLTcxYTIyNTYuNDEgMjI1Ni40MSAwIDAgMSAxLTk1eiIvPgogICAgPHBhdGggZmlsbD0iI2E2YWNjMCIKICAgICAgICAgIGQ9Ik0zMTYuNSAyMDkuNWMtLjk5OCAzMS4xNjItMS4zMzIgNjIuNDk2LTEgOTRoNzN2LTE3Yy0xNC44NDMuMzI5LTI5LjUxLS4wMDQtNDQtMWg0NXYxOWgtNzVhMjMwNC45NSAyMzA0Ljk1IDAgMCAxIDEtOTZjLjYwNy4xMjQuOTQuNDU3IDEgMXoiLz4KPC9zdmc+";class $m extends Y.Component{isShowInstance;oldId;constructor(s){super(s),this.state={name:s.name,id:s.id,instance:s.instance||0,prefix:$m.getPrefix(s.id)},this.isShowInstance=!s.folder&&!!s.instances&&(!!s.instance||!!s.instances[0]||s.instances.length>1),this.oldId=s.id}static getPrefix(s){const i=(s||"").split(".");return i.pop(),i.join(".")}getId(s){return s=(s||"").replace(/[\\/\][*,;'"`<>?\s]/g,"_"),`${this.state.prefix}.${s}`}handleCancel=()=>{this.props.onClose()};handleOk=()=>{this.props.onRename(this.oldId,this.state.id,this.state.name,this.state.instance===0?0:this.state.instance||void 0),this.props.onClose()};handleChange=s=>{this.setState({name:s,id:this.getId(s)})};render(){return g.jsxs(Gt,{onClose:()=>!1,maxWidth:"md",fullWidth:!0,open:!0,"aria-labelledby":"confirmation-dialog-title",children:[g.jsx(as,{id:"confirmation-dialog-title",children:b.I18n.t("Rename")}),g.jsx(Vt,{children:g.jsxs("form",{noValidate:!0,autoComplete:"off",children:[g.jsx(vo,{variant:"standard",style:{width:"100%"},id:"standard-name",autoFocus:!0,label:b.I18n.t("Name"),value:this.state.name,onKeyUp:s=>{s.key==="Enter"&&(s.preventDefault(),setTimeout(()=>this.handleOk(),200))},onChange:s=>this.handleChange(s.target.value),margin:"normal"}),g.jsx(vo,{variant:"standard",id:"standard-name-id",style:{width:"100%"},label:b.I18n.t("ID"),value:this.state.id,disabled:!0,margin:"normal"}),this.isShowInstance&&g.jsxs(_i,{variant:"standard",children:[g.jsx(Eg,{htmlFor:"instance",children:b.I18n.t("Instance")}),g.jsx(wi,{variant:"standard",value:this.state.instance,onChange:s=>this.setState({instance:parseInt(s.target.value,10)}),inputProps:{name:"instance",id:"instance"},children:this.props.instances.map(s=>g.jsx(Ge,{value:s,children:s||"0"},s))})]})]})}),g.jsxs(Kt,{children:[g.jsx(De,{variant:"contained",onClick:this.handleOk,color:"primary",startIcon:g.jsx(zo,{}),children:b.I18n.t("Ok")}),g.jsx(De,{color:"grey",variant:"contained",onClick:this.handleCancel,startIcon:g.jsx(qs,{}),children:b.I18n.t("Cancel")})]})]})}}class _x extends Y.Component{constructor(s){super(s),this.state={name:s.name,id:s.id}}handleCancel=()=>{this.props.onClose()};handleOk=()=>{this.props.onDelete(this.state.id),this.props.onClose()};render(){return g.jsxs(Gt,{onClose:()=>!1,maxWidth:"md",open:!0,"aria-labelledby":"confirmation-dialog-title",children:[g.jsx(as,{id:"confirmation-dialog-title",children:b.I18n.t("Are you sure?")}),g.jsxs(Vt,{children:[g.jsx(dc,{}),g.jsx("span",{style:{fontSize:14,fontWeight:"bold"},children:b.I18n.t("Delete %s",this.state.name)})]}),g.jsxs(Kt,{children:[g.jsx(De,{variant:"contained",onClick:this.handleOk,color:"primary",startIcon:g.jsx(zo,{}),children:b.I18n.t("Ok")}),g.jsx(De,{color:"grey",variant:"contained",onClick:this.handleCancel,startIcon:g.jsx(qs,{}),children:b.I18n.t("Cancel")})]})]})}}const wx=""+new URL("tileJS-C48gYbHw.png",import.meta.url).href,Cx=""+new URL("tileTS-CsXmgy4B.png",import.meta.url).href,Tx=""+new URL("tileBlockly-BMpdinN3.png",import.meta.url).href,kx=""+new URL("tileRules-BkbaFIhs.png",import.meta.url).href,Pt={card:{maxWidth:345,minWidth:250,display:"inline-block",margin:"0 10px 0 10px"},media:{height:122},text:{maxWidth:218,minHeight:30},complexity:{fontWeight:"bold",fontStyle:"italic",marginBottom:8}};class Cn extends Y.Component{handleCancel=()=>{this.props.onClose()};static openHtml(s){const i=b.I18n.getLanguage();!s.includes("javascript.md")&&(i==="de"||i==="ru")&&(s=s.replace(/\/en\//,`/${i}/`));const r=window.open(s,"_blank");r==null||r.focus()}getJSCard(){return g.jsxs(Yl,{style:Pt.card,children:[g.jsxs(Jl,{onClick:()=>this.props.onClose&&this.props.onClose("Javascript/js"),children:[g.jsx(ql,{style:Pt.media,image:wx,title:"JavaScript"}),g.jsxs(Xl,{children:[g.jsx("h2",{children:"JavaScript"}),g.jsx("div",{style:Pt.complexity,children:b.I18n.t("for programmers")}),g.jsx("div",{style:Pt.text,children:b.I18n.t("JS description")})]})]}),g.jsxs(Zl,{children:[g.jsx(De,{size:"small",color:"primary",variant:"contained",onClick:()=>this.props.onClose&&this.props.onClose("Javascript/js"),children:b.I18n.t("Add")}),g.jsx(De,{size:"small",color:"secondary",onClick:()=>Cn.openHtml("https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/javascript.md"),children:b.I18n.t("Learn More")})]})]})}getTSCard(){return g.jsxs(Yl,{style:Pt.card,children:[g.jsxs(Jl,{onClick:()=>this.props.onClose&&this.props.onClose("TypeScript/ts"),children:[g.jsx(ql,{style:Pt.media,image:Cx,title:"TypeScript"}),g.jsxs(Xl,{children:[g.jsx("h2",{children:"TypeScript"}),g.jsx("div",{style:Pt.complexity,children:b.I18n.t("for professionals")}),g.jsx("div",{style:Pt.text,children:b.I18n.t("TS description")})]})]}),g.jsxs(Zl,{children:[g.jsx(De,{size:"small",color:"primary",variant:"contained",onClick:()=>this.props.onClose&&this.props.onClose("TypeScript/ts"),children:b.I18n.t("Add")}),g.jsx(De,{size:"small",color:"secondary",onClick:()=>Cn.openHtml("https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/javascript.md"),children:b.I18n.t("Learn More")})]})]})}getBlocklyCard(){return g.jsxs(Yl,{style:Pt.card,children:[g.jsxs(Jl,{onClick:()=>this.props.onClose&&this.props.onClose("Blockly"),children:[g.jsx(ql,{style:Pt.media,image:Tx,title:"Blockly"}),g.jsxs(Xl,{children:[g.jsx("h2",{children:"Blockly"}),g.jsx("div",{style:Pt.complexity,children:b.I18n.t("normal")}),g.jsx("div",{style:Pt.text,children:b.I18n.t("Blockly description")})]})]}),g.jsxs(Zl,{children:[g.jsx(De,{size:"small",color:"primary",variant:"contained",onClick:()=>this.props.onClose&&this.props.onClose("Blockly"),children:b.I18n.t("Add")}),g.jsx(De,{size:"small",color:"secondary",onClick:()=>Cn.openHtml("https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/blockly.md"),children:b.I18n.t("Learn More")})]})]})}getRulesCard(){return g.jsxs(Yl,{style:Pt.card,children:[g.jsxs(Jl,{onClick:()=>this.props.onClose&&this.props.onClose("Rules"),children:[g.jsx(ql,{style:Pt.media,image:kx,title:"Rules"}),g.jsxs(Xl,{children:[g.jsx("h2",{children:"Rules"}),g.jsx("div",{style:Pt.complexity,children:b.I18n.t("easy")}),g.jsx("div",{style:Pt.text,children:b.I18n.t("Rules description")})]})]}),g.jsxs(Zl,{children:[g.jsx(De,{size:"small",color:"primary",variant:"contained",onClick:()=>this.props.onClose&&this.props.onClose("Rules"),children:b.I18n.t("Add")}),g.jsx(De,{size:"small",color:"secondary",onClick:()=>Cn.openHtml("https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/javascript.md"),children:b.I18n.t("Learn More")})]})]})}render(){return g.jsxs(Gt,{onClose:()=>!1,maxWidth:"lg",fullWidth:!0,open:!0,"aria-labelledby":"confirmation-dialog-title",children:[g.jsx(as,{id:"confirmation-dialog-title",children:b.I18n.t("Add new script")}),g.jsxs(Vt,{style:{textAlign:"center"},children:[this.getRulesCard(),this.getBlocklyCard(),this.getJSCard(),this.getTSCard()]}),g.jsx(Kt,{children:g.jsx(De,{color:"grey",onClick:this.handleCancel,startIcon:g.jsx(qs,{}),children:b.I18n.t("Cancel")})})]})}}class tg extends Y.Component{isShowInstance;constructor(s){super(s),this.state={name:s.name||"Script",instance:s.instance||0,parent:s.parent,error:"",id:""},this.isShowInstance=!s.folder&&!!s.instances&&(!!s.instance||!!s.instances[0]||s.instances.length>1)}getId(s){return s=s||this.state.name||"",s=s.replace(/[\\/\][.*,;'"`<>?\s]/g,"_").trim().replace(/\.$/,"_"),`${this.state?this.state.parent:this.props.parent}.${s}`}handleOk=()=>{this.props.onAdd(this.getId(this.state.name),this.state.name,this.state.instance,this.props.type),this.props.onClose()};render(){var s;return g.jsxs(Gt,{onClose:()=>!1,maxWidth:"md",fullWidth:!0,open:!0,"aria-labelledby":"confirmation-dialog-title",children:[g.jsx(as,{id:"confirmation-dialog-title",children:this.props.title||b.I18n.t("Create new")}),g.jsx(Vt,{children:g.jsxs("form",{noValidate:!0,autoComplete:"off",children:[g.jsx(vo,{variant:"standard",style:{width:"100%"},id:"standard-name",autoFocus:!0,error:!!this.state.error,label:b.I18n.t("Name"),value:this.state.name||"",helperText:this.state.error,slotProps:{input:{endAdornment:this.state.name?g.jsx(Me,{size:"small",onClick:()=>this.setState({name:""}),children:g.jsx(Jk,{})}):void 0}},onKeyUp:i=>{i.preventDefault(),i.key==="Enter"&&!this.state.error&&setTimeout(()=>this.handleOk(),200)},onChange:i=>{var u;const r=i.target.value,l=this.getId(r);r?(u=this.props.existingItems)!=null&&u.includes(l)?this.setState({name:r,id:l,error:b.I18n.t("Duplicate name")}):this.setState({name:r,id:l,error:""}):this.setState({name:r,id:l,error:b.I18n.t("Empty name is not allowed")})},margin:"normal"}),g.jsxs(_i,{variant:"standard",style:{width:"100%"},children:[g.jsx(Eg,{htmlFor:"parent",children:b.I18n.t("Folder")}),g.jsx(wi,{variant:"standard",style:{width:"100%"},value:this.state.parent,onChange:i=>this.setState({parent:i.target.value}),inputProps:{name:"parent",id:"parent"},children:this.props.parents.map(i=>{const r=i.id.split(".");r.splice(0,2);const l=[];let u="script.js";return r.forEach(d=>{u+=`.${d}`;const p=this.props.parents.find(m=>m.id===u);p?l.push(p.name):l.push(d)}),l.length||l.push(i.name),g.jsx(Ge,{value:i.id,children:l.join(" / ")},i.id)})})]}),g.jsx(vo,{variant:"standard",id:"standard-name-id",style:{width:"100%"},label:b.I18n.t("ID"),value:this.getId(),disabled:!0,margin:"normal"}),this.isShowInstance&&g.jsxs(_i,{variant:"standard",children:[g.jsx(Eg,{htmlFor:"instance",children:b.I18n.t("Instance")}),g.jsx(wi,{variant:"standard",value:this.state.instance,onChange:i=>this.setState({instance:parseInt(i.target.value,10)}),inputProps:{name:"instance",id:"instance"},children:(s=this.props.instances)==null?void 0:s.map(i=>g.jsx(Ge,{value:i,children:i||"0"},`instance${i}`))})]})]})}),g.jsxs(Kt,{children:[g.jsx(De,{variant:"contained",onClick:this.handleOk,disabled:!!this.state.error,color:"primary",startIcon:g.jsx(zo,{}),children:b.I18n.t("Ok")}),g.jsx(De,{color:"grey",variant:"contained",onClick:()=>this.props.onClose(),startIcon:g.jsx(qs,{}),children:b.I18n.t("Cancel")})]})]})}}const Sx={title:a=>({background:a.palette.error.main,color:a.palette.error.contrastText,"&>h2":{color:a.palette.error.contrastText}})};class Zc extends Y.Component{handleOk=()=>{this.props.onClose()};render(){return g.jsxs(Gt,{open:!0,maxWidth:"sm",fullWidth:!0,onClose:()=>this.handleOk(),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[g.jsx(as,{sx:Sx.title,id:"alert-dialog-title",children:this.props.title||b.I18n.t("Error")}),g.jsx(Vt,{children:g.jsx(Iw,{id:"alert-dialog-description",children:this.props.text||b.I18n.t("Unknown error!")})}),g.jsx(Kt,{children:g.jsx(De,{variant:"contained",onClick:()=>this.handleOk(),color:"primary",autoFocus:!0,startIcon:g.jsx(zo,{}),children:b.I18n.t("Ok")})})]})}}const Mr={icon:{width:24,height:24},filterWithButton:{width:"100%"},title:{fontWeight:"bold",marginTop:16}};class Ex extends Y.Component{constructor(s){super(s),this.state={instances:[],filter:window.localStorage.getItem("javascript.debug.filter")||"",showAskForStop:!1,jsInstance:window.localStorage.getItem("javascript.debug.instance")||"",jsInstanceHost:"",adapterToDebug:window.localStorage.getItem("javascript.debug.adapter")||""}}componentDidMount(){this.props.socket.getAdapterInstances().then(s=>{const i=s.filter(p=>{var m;return p&&!((m=p.common)!=null&&m.onlyWWW)}).map(p=>{var v,_,y;const m=p._id.replace(/^system\.adapter\./,""),[f]=m.split(".");return{id:m,enabled:(v=p.common)==null?void 0:v.enabled,host:(_=p.common)==null?void 0:_.host,icon:(y=p.common)!=null&&y.icon?`../../adapter/${f}/${p.common.icon}`:""}});i.sort((p,m)=>p.id>m.id?1:p.idp.id===this.state.jsInstance):null;let u;if(!this.state.jsInstance||!l){const p=i.find(m=>m.id.startsWith("javascript."));u=(p==null?void 0:p.host)||"",r=(p==null?void 0:p.id)||""}else u=(l==null?void 0:l.host)||"";let d=this.state.adapterToDebug||"";d&&!i.find(p=>p.id===d)&&(d=""),this.setState({instances:i,jsInstance:r,adapterToDebug:d,jsInstanceHost:u})})}handleOk=()=>{var s;if((s=this.state.instances.find(i=>i.id===this.state.adapterToDebug))!=null&&s.enabled){this.props.socket.getObject(`system.adapter.${this.state.adapterToDebug}`).then(i=>{i&&(i.common.enabled=!1,this.props.socket.setObject(i._id,i).then(()=>this.props.onDebug(this.state.jsInstance,this.state.adapterToDebug)))});return}this.props.onDebug(this.state.jsInstance,this.state.adapterToDebug)};renderJavascriptList(){const s=this.state.instances.filter(i=>i.id.startsWith("javascript."));return s.length<2?null:g.jsxs($i,{children:[g.jsx("div",{style:Mr.title,children:b.I18n.t("Host")}),g.jsx(Ig,{component:"nav",children:s.map(i=>g.jsxs(Qy,{component:"div",selected:this.state.jsInstance===i.id,onClick:()=>this.setState({jsInstance:i.id,jsInstanceHost:i.host}),children:[g.jsx(xg,{children:g.jsx("img",{src:i.icon,alt:i.id,style:Mr.icon})}),g.jsx(Dg,{primary:i.id})]},i.id))})]})}renderInstances(){if(!this.state.jsInstance)return g.jsx($i,{});const s=this.state.instances.filter(i=>i.id!==this.state.jsInstance&&i.host===this.state.jsInstanceHost&&(!this.state.filter||i.id.includes(this.state.filter.toLowerCase())));return g.jsxs($i,{children:[g.jsx("div",{style:Mr.title,children:b.I18n.t("Instances")}),g.jsx(Ig,{component:"nav",children:s.map(i=>g.jsxs(Qy,{selected:this.state.adapterToDebug===i.id,onDoubleClick:()=>this.setState({adapterToDebug:i.id},()=>this.handleOk()),onClick:()=>this.setState({adapterToDebug:i.id}),children:[g.jsx(xg,{children:g.jsx("img",{src:i.icon,alt:i.id,style:Mr.icon})}),g.jsx(Dg,{primary:i.id})]},i.id))})]})}render(){return g.jsxs(Gt,{maxWidth:"md",fullWidth:!1,open:!0,onClose:()=>!1,"aria-labelledby":"confirmation-dialog-title",children:[g.jsx(as,{id:"confirmation-dialog-title",children:this.props.title||b.I18n.t("Debug instance")}),g.jsx(Vt,{children:g.jsxs($i,{container:!0,direction:"column",children:[g.jsx($i,{children:g.jsx(Dn,{style:Mr.filterWithButton,value:this.state.filter,placeholder:b.I18n.t("Filter"),onChange:s=>{this.setState({filter:s.target.value}),window.localStorage.setItem("javascript.debug.filter",s.target.value)},endAdornment:g.jsx(xw,{position:"end",children:this.state.filter?g.jsx(Me,{size:"small","aria-label":"toggle password visibility",onClick:()=>this.setState({filter:""}),children:g.jsx(Ow,{})}):""})})}),g.jsx($i,{children:g.jsxs($i,{container:!0,children:[this.renderJavascriptList(),this.renderInstances()]})})]})}),g.jsxs(Kt,{children:[g.jsx(De,{variant:"contained",onClick:this.handleOk,disabled:!this.state.jsInstance||!this.state.adapterToDebug,color:"primary",startIcon:g.jsx(zo,{}),children:b.I18n.t("Start")}),g.jsx(De,{color:"grey",variant:"contained",onClick:()=>this.props.onClose(),startIcon:g.jsx(qs,{}),children:b.I18n.t("Close")})]})]})}}function mC(a){if(!a)throw new Error("Password must be a non-empty string.")}function zg(a){return new TextEncoder().encode(a)}function Ix(a){return new TextDecoder().decode(a)}function xx(a){let s="";for(let i=0;i({height:a.toolbar.height}),toolbarButtons:a=>({color:a.palette.mode==="dark"?"white !important":"black !important"}),iconButtonsDisabled:{filter:"grayscale(100%)",opacity:.5},toolbarSearch:{width:"calc(100% - 105px)",lineHeight:"34px",marginLeft:5},iconButtons:{width:32,height:32,padding:2},iconDropdownMenu:{paddingRight:5},menu:{width:"100%",height:"100%"},innerMenu:{width:"100%",height:"calc(100% - 76px)",overflowX:"hidden",overflowY:"auto"},listItemIcon:{minWidth:32},scriptIcon:{width:18,height:18,borderRadius:2,marginTop:4,marginBottom:4,marginLeft:8,marginRight:4},folder:{cursor:"pointer",padding:0,userSelect:"none"},folderReorder:{opacity:.3,transitionDuration:"0.5s",transitionProperty:"opacity"},folderIcon:{width:20,height:20},folderIconReorder:{paddingTop:4,paddingBottom:4,paddingLeft:8,paddingRight:4},folderIconNoReorder:{cursor:"pointer",paddingTop:4,paddingBottom:4,paddingLeft:8,paddingRight:4},script:{cursor:"pointer",padding:0,userSelect:"none"},scriptReorder:{opacity:1,transitionDuration:"0.5s",transitionProperty:"opacity"},reorder:{},selected:window.vendorPrefix?a=>({backgroundColor:a.palette.primary.main,color:a.palette.text.primary}):{backgroundColor:"#164477",color:"white"},instances:{color:"gray",fontSize:"smaller"},childrenCount:{fontSize:10,opacity:.4},footer:{height:24,display:"flex"},footerButtons:a=>({"& img":{color:a.palette.mode==="dark"?"#ffffff":"#111111",cursor:"pointer",mt:"1px",mr:"2px",height:22,width:22,"&:hover":{backgroundColor:"#dbdbdb"}},"& svg":{color:a.palette.mode==="dark"?"#ffffff":"#111111",cursor:"pointer",mt:"1px",mr:"2px",height:22,width:22,"&:hover":{backgroundColor:"#dbdbdb"}}}),footerButtonsRight:{float:"right"}},$n={Blockly:hC,"Javascript/js":_c,def:_c,Rules:gC,"TypeScript/ts":pC};function Hg(a,s,i){var r;return i=i||b.I18n.getLanguage(),(r=s==null?void 0:s.common)!=null&&r.name?typeof s.common.name=="object"?(s.common.name[i]||s.common.name.en||a.replace(/^script\.js./,"")).toString():s.common.name.toString():a.replace(/^script\.js./,"")}function S_(a){var l;const s=[{id:Wt,depth:0,index:0,parent:null,title:"root",type:"folder",parentIndex:null}],i=Object.keys(a);for(let u=0;u1?p.join("."):null,instance:d.common.engine?parseInt(d.common.engine.split(".").pop(),10)||0:null,index:0,parentIndex:0}):s.push({id:i[u],title:Hg(i[u],d),depth:p.length-1,type:"folder",parent:p.length>1?p.join("."):null,index:0,parentIndex:null})}let r;do r=!1,s.forEach(u=>{if(u.parent&&!s.find(p=>p.id===u.parent)){const p=u.parent.split(".");p.pop(),s.push({id:u.parent,title:u.parent.split(".").pop()||"",depth:p.length-1,type:"folder",parent:p.length>1?p.join("."):null,index:0,parentIndex:null}),r=!0}});while(r);return s.sort((u,d)=>{const p=u.id.toLowerCase(),m=d.id.toLowerCase();return u.type==="folder"&&d.type!=="folder"?-1:d.type==="folder"&&u.type!=="folder"||p>m?1:pu.index=d),s.forEach(u=>{if(u.parent){const d=s.find(p=>p.id===u.parent);d&&(u.parentIndex=d.index)}}),s}function Ox(a){const{onDrop:s}=a,[{isOver:i,isOverAny:r},l]=zI({accept:"script",drop:u=>i?s(u):void 0,collect:u=>({isOver:u.isOver({shallow:!0}),isOverAny:u.isOver()})});return g.jsx("div",{ref:l,style:{background:i?"#40adff":void 0,opacity:r?.7:void 0},children:a.children},a.folderName)}function E_(a){const{name:s}=a,[{opacity:i},r]=OI({type:"script",item:()=>({name:s}),collect:l=>({opacity:l.isDragging()?.3:1})});return g.jsx("div",{ref:r,style:{opacity:i,transform:"translate3d(0, 0, 0)"},children:a.children},s)}class bo extends Y.Component{inputRef;filterTimer;problems;problemsTimer;onProblemUpdatedBound;parent=null;constructor(s){super(s);const i=window.localStorage?window.localStorage.getItem("SideMenu.expanded"):"[]";let r;try{r=JSON.parse(i||"[]")||[]}catch{r=[]}this.inputRef=Y.createRef(),this.state={listItems:S_(s.scripts||{}),expanded:r,problems:[],reorder:!1,themeName:this.props.themeName,selected:window.localStorage&&window.localStorage.getItem("SideMenu.selected")||null,creatingScript:null,creatingFolder:!1,copingScript:"",renaming:null,deleting:null,choosingType:!1,errorText:"",instances:s.instances||[],menuOpened:!1,menuAnchorEl:null,menuAnchorFilterEl:null,searchMode:!1,expertMode:this.props.expertMode,searchText:"",width:this.props.width||300,typeFilter:window.localStorage&&window.localStorage.getItem("SideMenu.typeFilter")||"",statusFilter:window.localStorage&&window.localStorage.getItem("SideMenu.statusFilter")||"",runningInstances:this.props.runningInstances||{},scriptsHash:s.scriptsHash,showAdapterDebug:!1,isAllZeroInstances:!1};const l=this.ensureSelectedIsVisible();l&&Object.assign(this.state,{expanded:l}),this.filterTimer=null,Object.assign(this.state,{isAllZeroInstances:this.getIsAllZeroInstances()}),this.problems=null,this.problemsTimer=null,this.onProblemUpdatedBound=this.onProblemUpdated.bind(this)}readProblems(s,i){var r,l;if(i||(i=Object.keys(this.props.scripts)),!i||!i.length)s&&s();else{const u=i.shift(),d=this.props.scripts[u];if(((r=this.props.scripts)==null?void 0:r[u].type)==="script"&&((l=d.common)!=null&&l.enabled)&&!u.match(/^script\.js\.global\./)){const p=d.common.engine.split(".").pop(),m=this,f=`javascript.${p}.scriptProblem.${u.substring(Wt.length+1)}`;this.props.socket.getState(f).then(v=>{m.onProblemUpdated(f,v),setTimeout(()=>m.readProblems(s,i),0)})}else setTimeout(()=>this.readProblems(s,i),0)}}componentDidMount(){this.readProblems(()=>{this.props.instances.forEach(s=>{this.props.socket.subscribeState(`javascript.${s}.scriptProblem.*`,this.onProblemUpdatedBound)})})}componentWillUnmount(){this.props.instances.forEach(s=>{this.props.socket.unsubscribeState(`javascript.${s}.scriptProblem.*`,this.onProblemUpdatedBound)})}onProblemUpdated(s,i){if(!i||!s)return;s=`${Wt}.${s.replace(/^javascript\.\d+\.scriptProblem\./,"")}`,this.problems||(this.problems=JSON.parse(JSON.stringify(this.state.problems))||[]);let r=!1;if(i.val)this.problems.includes(s)||(this.problems.push(s),r=!0);else{const l=this.problems.indexOf(s);l!==-1&&(this.problems.splice(l,1),r=!0)}r&&!this.problemsTimer&&(this.problemsTimer=setTimeout(()=>{this.problemsTimer=null,this.setState({problems:this.problems}),this.problems=null},300))}static filterListStatic(s,i,r,l,u){i=JSON.parse(JSON.stringify(i));let d=!1;const p={listItems:i};if(s&&r&&l){const m=l.toLowerCase();if(i.forEach(f=>{var k;const v=f.title.toLowerCase();f.filteredPartly=!1;let _=v.includes(m);const y=(k=u==null?void 0:u[f.id])==null?void 0:k.common;if(!_&&(y!=null&&y.source))if(y.engineType==="Blockly"){const C=y.source.lastIndexOf("//");_=y.source.substring(0,C).toLowerCase().includes(m)}else _=y.source.toLowerCase().includes(m);_?f.filtered&&(f.filtered=!1,d=!0):f.filtered||(f.filtered=!0,d=!0)}),d)for(let f=i.length-1;f>=0;f--){const v=i[f];if(!v.filtered||v.filteredPartly){let _=v;do _!=null&&_.parent&&i[_.parentIndex]&&(d=!0,i[_.parentIndex].filteredPartly=!0),_=_!=null&&_.parent&&i[_.parentIndex]?i[_.parentIndex]:null;while(_)}}}else i.forEach(m=>{(m.filtered||m.filteredPartly)&&(m.filtered=!1,m.filteredPartly=!1,d=!0)}),s||(p.searchText="",p.searchMode=!1,d=!0);return d?p:null}filterList(s,i){const r=bo.filterListStatic(s,this.state.listItems,this.state.searchMode,this.state.searchText,this.props.scripts);r?this.setState(r,()=>i&&i()):i&&i()}static ensureSelectedIsVisibleStatic(s,i,r){i=JSON.parse(JSON.stringify(i));let l=!1,u=typeof s=="object"?s:r.find(d=>d.id===s);do{if(u!=null&&u.parent){const d=u.parent;u=r.find(p=>p.id===d)}else u=void 0;u&&(i.includes(u.id)||(i.push(u.id),l=!0))}while(u);return l?i:null}ensureSelectedIsVisible(s,i){return bo.ensureSelectedIsVisibleStatic(s||this.state.selected,i||this.state.expanded,this.state.listItems)}static getDerivedStateFromProps(s,i){const r={};let l=!1;if(i.expertMode!==s.expertMode&&(l=!0,r.expertMode=s.expertMode),i.scriptsHash!==s.scriptsHash&&s.scripts){const u=S_(s.scripts||{});if(r.listItems=u,i.searchText){const m=bo.filterListStatic(!0,u,i.searchMode,i.searchText,s.scripts);m&&Object.assign(r,m)}const d=bo.getIsAllZeroInstancesStatic(u,s.instances||[]),p=bo.ensureSelectedIsVisibleStatic(i.selected,i.expanded,i.listItems);r.isAllZeroInstances=d,p&&(r.expanded=p),l=!0}if(i.width!==s.width&&(l=!0,r.width=s.width),i.themeName!==s.themeName&&(l=!0,r.themeName=s.themeName),s.selectId&&i.selected!==s.selectId){const u=i.listItems.find(d=>d.id===s.selectId);if(!i.reorder&&u){const d=bo.ensureSelectedIsVisibleStatic(u,i.expanded,i.listItems);r.selected=u.id,d&&(r.expanded=d),l=!0,window.localStorage&&window.localStorage.setItem("SideMenu.selected",u.id)}}return l?r:null}static getIsAllZeroInstancesStatic(s,i){let r=!i[0]&&i.length<=1;return r&&s.forEach(l=>{l.type!=="folder"&&l.instance!==0&&(r=!1)}),r}getIsAllZeroInstances(s,i){return s=s||this.state.listItems,i=i||this.state.instances,bo.getIsAllZeroInstancesStatic(s||this.state.listItems,i||this.state.instances)}saveExpanded(s){window.localStorage.setItem("SideMenu.expanded",JSON.stringify(s||this.state.expanded))}showError(s){this.setState({errorText:s})}onToggle(s,i){if(i==null||i.stopPropagation(),s===Wt)return;const r=[...this.state.expanded],l=r.indexOf(s);l!==-1?(r.splice(l,1),this.state.selected&&this.state.selected.startsWith(`${s}.`)&&window.localStorage&&window.localStorage.setItem("SideMenu.selected",s)):(r.push(s),r.sort()),this.setState({expanded:r}),this.saveExpanded(r)}renderItemButtonsOnEnd(s,i){if(this.state.reorder)return null;if(s.type!=="folder"){let r=s.enabled?C_:k_;return s.enabled&&this.state.problems.includes(s.id)&&(r=T_),[g.jsx(Me,{onClick:l=>{l.stopPropagation(),this.props.onEnableDisable&&this.props.onEnableDisable(s.id,!s.enabled)},title:s.enabled?b.I18n.t("Pause script"):b.I18n.t("Run script"),disabled:this.props.debugMode,style:{...fe.iconButtons,...this.props.debugMode?fe.iconButtonsDisabled:void 0,color:r},size:"medium",children:s.enabled?g.jsx(gc,{}):g.jsx(Fg,{})},"startStop"),this.state.width>Nr?g.jsx(Me,{style:this.props.debugMode?fe.iconButtonsDisabled:void 0,title:b.I18n.t("Delete script"),disabled:s.id===$o||s.id===fn||this.props.debugMode,onClick:l=>this.onDelete(s,l),size:"medium",children:g.jsx(dc,{})},"delete"):null,g.jsx(Me,{style:this.props.debugMode?fe.iconButtonsDisabled:void 0,disabled:this.props.debugMode,title:b.I18n.t("Edit script or just double click"),onClick:l=>this.onEdit(s,l),size:"medium",children:g.jsx(ux,{})},"openInEdit")]}return this.state.width>Nr&&s.id!==Wt&&s.id!==fn&&s.id!==$o&&!(i!=null&&i.length)?g.jsx(Me,{style:this.props.debugMode?fe.iconButtonsDisabled:void 0,title:b.I18n.t("Delete folder"),disabled:s.id===$o||s.id===fn||this.props.debugMode,onClick:r=>this.onDelete(s,r),size:"medium",children:g.jsx(dc,{})},"delete"):null}onDelete(s,i){return i==null||i.stopPropagation(),new Promise(r=>{if(!s){r();return}typeof s!="object"?this.setState({deleting:s},()=>r()):this.setState({deleting:s.id},()=>r())})}onEdit(s,i){this.onClick(s,i),this.props.onEdit&&this.props.onEdit(s.id)}getTextStyle(s){return!this.state.reorder&&s.type!=="folder"?{width:`calc(100% - ${this.state.width>Nr?185:137}px)`,overflow:"hidden",whiteSpace:"nowrap",flex:"none",padding:"0 16px 0 0"}:{whiteSpace:"nowrap",padding:"0 16px 0 0"}}onClick(s,i){if(i==null||i.stopPropagation(),!this.state.reorder&&s){const r=this.ensureSelectedIsVisible(s),l={selected:s.id};r&&(l.expanded=r),this.setState(l),window.localStorage&&window.localStorage.setItem("SideMenu.selected",s.id)}}onDblClick(s,i){i==null||i.stopPropagation(),!this.state.reorder&&(s.type==="folder"?this.onToggle(s.id):this.onEdit(s))}isFilteredOut(s){var i,r;return s.filtered&&!s.filteredPartly||this.state.typeFilter&&s.type!=="folder"&&s.type.toLowerCase()!==this.state.typeFilter.toLowerCase()||!this.state.expertMode&&((r=(i=this.props.scripts[s.id])==null?void 0:i.native)!=null&&r.protected)||this.state.statusFilter&&s.type!=="folder"&&(this.state.statusFilter==="running"&&!s.enabled||this.state.statusFilter==="paused"&&s.enabled||this.state.statusFilter==="problems"&&(!s.enabled||this.state.problems.indexOf(s.id)===-1))?!0:s.id===$o&&!this.state.expertMode}renderListItem(s,i,r){var y,k;if(s.id===Wt&&!this.state.reorder)return null;const l=(this.state.reorder?s.depth:s.depth-1)*Rx;let u=s.title;if(this.state.searchText){const C=u.toLowerCase().indexOf(this.state.searchText.toLowerCase());C!==-1&&(u=[g.jsx("span",{children:u.substring(0,C)},"first"),g.jsx("span",{style:{color:"orange"},children:u.substring(C,C+this.state.searchText.length)},"second"),g.jsx("span",{children:u.substring(C+this.state.searchText.length)},"third")])}!this.state.isAllZeroInstances&&s.type!=="folder"&&(u=[g.jsx("span",{children:u},"title"),g.jsxs("span",{title:b.I18n.t("Instance"),style:fe.instances,children:["[",s.instance,"]"]},"instance")]);const d=this.state.reorder&&!this.props.debugMode,p={marginLeft:l,cursor:s.type==="folder"&&d?"default":"inherit",width:`calc(100% - ${l}px)`};d||(p.opacity=s.filteredPartly?.5:1),s.id===$o&&s.id!==this.state.selected&&(p.color="#00a200");let m=s.id===Wt;!m&&i&&(m=this.state.expanded.includes(s.id));let f;s.type==="folder"?f={...fe.folderIcon,...d?fe.folderIconReorder:fe.folderIconNoReorder}:f={...fe.scriptIcon},s.id===$o?f.color="#356956":s.id===fn&&(f.color="#4899e1");let v=null;(r&&r.length||i&&i.length)&&(v=g.jsx("span",{style:fe.childrenCount,children:r&&r.length!==i.length?`${r.length}(${i.length})`:i.length}));const _={...s.type==="folder"?fe.folder:fe.script,...d?fe.reorder:void 0,...d&&s.type!=="folder"?fe.scriptReorder:void 0,...d&&s.type==="folder"?fe.folderReorder:void 0,...p};return g.jsxs(Ok,{style:_,sx:s.id===this.state.selected&&!d?fe.selected:void 0,className:b.Utils.clsx(d&&s.type==="folder"&&"folder-reorder",d&&s.type!=="folder"&&"script-reorder"),onClick:C=>this.onClick(s,C),onDoubleClick:C=>this.onDblClick(s,C),secondaryAction:this.renderItemButtonsOnEnd(s,i),children:[(k=(y=this.props.scripts[s.id])==null?void 0:y.native)!=null&&k.protected?g.jsx(w_,{style:{color:"orange",position:"absolute",right:5,width:10,height:10}}):null,g.jsx(xg,{style:fe.listItemIcon,children:s.type==="folder"?d||m?g.jsx(qk,{style:f,onClick:C=>!d&&this.onToggle(s.id,C)}):g.jsx(Xk,{style:f,onClick:C=>!d&&this.onToggle(s.id,C)}):g.jsx("img",{style:f,alt:s.type,src:$n[s.type]||$n.def})}),g.jsx(Dg,{sx:{"& .MuiListItemText-primary":s.id===this.state.selected&&!d?fe.selected:void 0},style:this.getTextStyle(s),primary:g.jsxs("span",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[u,v]})})]},s.id)}onDragFinish(s,i){let r=`${i}.${s.split(".").pop()}`;r!==s&&(this.state.listItems.find(l=>l.id===r)&&(r+=`_${b.I18n.t("copy")}`),this.props.onRename&&this.props.onRename(s,r))}renderOneItem(s,i){const r=this.state.statusFilter||this.state.typeFilter?s.filter(f=>f.parent===i.id?!this.isFilteredOut(f):!1):[],l=s.filter(f=>f.parent===i.id);if(this.isFilteredOut(i)||i.type==="folder"&&(this.state.statusFilter||this.state.typeFilter)&&!r.length)return null;const u=this.state.reorder&&!this.props.debugMode,d=this.renderListItem(i,l,r),p=[];let m;return l&&(u||this.state.expanded.includes(i.id)||i.id===Wt)&&(m=l.map(f=>this.renderOneItem(s,f))),u?i.type==="folder"?p.push(g.jsxs(Ox,{onDrop:f=>this.onDragFinish(f.name,i.id),folderName:i.id,children:[g.jsx(E_,{name:i.id,children:d},`draggable_${i.id}`),m||null]},`droppable_${i.id}`)):p.push(g.jsxs(E_,{name:i.id,children:[d,m||null]},`draggable_${i.id}`)):(p.push(d),m==null||m.forEach(f=>p.push(f))),p}renderAllItems(s){const i=s.filter(r=>!r.parent).map(r=>this.renderOneItem(s,r));return g.jsx(Ig,{dense:!0,disablePadding:!0,sx:fe.mainList,children:i})}onAddNew(s){s==null||s.stopPropagation();let i=this.state.listItems.find(l=>l.id===this.state.selected),r=Wt;for(;i&&i.type!=="folder";)i=this.state.listItems[i.parentIndex];i&&(r=i.id),this.parent=r,this.setState({choosingType:!0})}onCopy(s,i){s==null||s.stopPropagation();let r=this.state.listItems.find(u=>u.id===i),l=Wt;for(;r&&r.type!=="folder";)r=this.state.listItems[r.parentIndex];r&&(l=r.id),this.parent=l,this.setState({copingScript:i||""})}onAddNewFolder(s){s==null||s.stopPropagation();let i=this.state.listItems.find(l=>l.id===this.state.selected),r=Wt;for(;i&&i.type!=="folder";)i=this.state.listItems[i.parentIndex];i&&(r=i.id),this.parent=r,this.setState({creatingFolder:!0})}onRename(s){s==null||s.stopPropagation(),this.setState({renaming:this.state.selected})}getUniqueName(s){let i=1,r=`${b.I18n.t("Script")} `;if(s){const l=Hg(s,this.props.scripts[s]),u=l.match(/\d+$/);u?(r=l.replace(/\d+$/,""),i=parseInt(u[0],10)+1):r=l}for(;this.state.listItems.find(l=>l.id===`${this.parent}.${r.replace(/\.\s/g,"_")}${i}`);)i++;return r+i}getUniqueFolderName(){let s=1;for(;this.state.listItems.find(i=>i.id===`${this.parent}.${b.I18n.t("Folder")}_${s}`);)s++;return`${b.I18n.t("Folder")} ${s}`}onCloseMenu(s){this.setState({menuOpened:!1,menuAnchorEl:null,menuAnchorFilterEl:null},s)}getMainMenu(s,i){var l,u,d,p;const r=this.state.expertMode&&!!Object.keys(this.props.changedScripts).find(m=>{var f,v;return this.props.changedScripts[m]&&((v=(f=this.props.scripts[m])==null?void 0:f.native)==null?void 0:v.protected)});return g.jsxs(cm,{id:"long-menu",anchorEl:this.state.menuAnchorEl,open:this.state.menuOpened,onClose:()=>this.setState({menuOpened:!1,menuAnchorEl:null}),slotProps:{paper:{style:{maxHeight:Ax*7.5}}},children:[this.state.width<=Nr?g.jsxs(Ge,{disabled:this.props.debugMode||!this.state.selected||this.state.selected===$o||this.state.selected===fn||!!(s!=null&&s.length),onClick:m=>{if(m.stopPropagation(),m.preventDefault(),this.state.listItems.find(f=>f.parent===this.state.selected)){this.showError(b.I18n.t("Cannot delete non empty item!"));return}this.setState({menuOpened:!1,menuAnchorEl:null},()=>this.onDelete(this.state.selected).then(()=>{}))},children:[g.jsx(dc,{style:{...fe.iconDropdownMenu,color:"red"}}),b.I18n.t("Delete")]},"delete"):null,g.jsxs(Ge,{disabled:this.props.debugMode||r,selected:this.state.expertMode,onClick:m=>{m.stopPropagation(),m.preventDefault(),this.onCloseMenu(()=>this.props.onExpertModeChange&&this.props.onExpertModeChange(!this.state.expertMode))},children:[g.jsx(b.IconExpert,{style:{...fe.iconDropdownMenu,color:this.state.expertMode?"orange":"inherit"}}),b.I18n.t("Expert mode")]},"expertMode"),this.props.onExport&&g.jsxs(Ge,{onClick:m=>{m.stopPropagation(),m.preventDefault(),this.onCloseMenu(()=>this.props.onExport())},children:[g.jsx(vc,{style:fe.iconDropdownMenu}),b.I18n.t("Export all scripts")]},"exportAll"),this.props.onImport&&g.jsxs(Ge,{disabled:this.props.debugMode,onClick:m=>{m.stopPropagation(),m.preventDefault(),this.onCloseMenu(()=>this.props.onImport())},children:[g.jsx(Rg,{style:fe.iconDropdownMenu}),b.I18n.t("Import scripts")]},"import"),this.props.onThemeChange&&g.jsxs(Ge,{onClick:()=>this.onCloseMenu(()=>{this.props.onThemeChange&&this.props.onThemeChange(b.Utils.toggleTheme(this.state.themeName))}),children:[g.jsx(hx,{style:fe.iconDropdownMenu}),b.I18n.t('Change theme (actual "%s")',this.state.themeName)]},"dark"),this.props.onAddNew&&g.jsxs(Ge,{disabled:!this.state.selected||!i||i.type==="folder",onClick:m=>{const f=this.state.selected;this.onCloseMenu(()=>this.onCopy(m,f))},children:[g.jsx(Zk,{style:fe.iconDropdownMenu}),b.I18n.t("Copy script")]},"copy"),this.state.expertMode&&g.jsxs(Ge,{disabled:this.props.debugMode,onClick:m=>{m.stopPropagation(),m.preventDefault(),this.onCloseMenu(()=>this.setState({showAdapterDebug:!0}))},children:[g.jsx(nx,{style:fe.iconDropdownMenu}),b.I18n.t("Debug instance")]},"debugInstance"),this.state.selected&&this.props.password&&this.props.scripts[this.state.selected].type==="script"?g.jsxs(Ge,{disabled:this.props.debugMode||this.props.changedScripts[this.state.selected],onClick:m=>{m.stopPropagation(),m.preventDefault(),this.onCloseMenu(async()=>{var v;const f=await this.props.socket.getObject(this.state.selected);f&&((v=f.native)!=null&&v.protected?(delete f.native.protected,f.common.source=Ug(this.props.password,f.common.source||"")):(f.native||={},f.native.protected=!0,f.common.source=mc(this.props.password,f.common.source||"")),await this.props.socket.setObject(f._id,f))})},children:[g.jsx(w_,{style:{...fe.iconDropdownMenu,color:"orange"}}),(u=(l=this.props.scripts[this.state.selected])==null?void 0:l.native)!=null&&u.protected?g.jsx("span",{style:{color:(p=(d=this.props.scripts[this.state.selected])==null?void 0:d.native)!=null&&p.protected?"orange":void 0},children:b.I18n.t("Unprotect script")}):b.I18n.t("Protect script")]},"encrypt"):null]},"menu")}getToolbarButtons(){const s=[],i=this.state.reorder&&!this.props.debugMode;if(this.state.searchMode&&!this.props.debugMode)s.push(g.jsx(Dn,{value:this.state.searchText,style:fe.toolbarSearch,ref:this.inputRef,autoFocus:!0,placeholder:b.I18n.t("Search..."),onChange:r=>{this.setState({searchText:r.target.value}),this.filterTimer&&clearTimeout(this.filterTimer),this.filterTimer=setTimeout(()=>{this.filterTimer=null,this.filterList(!0),this.props.onSearch&&this.props.onSearch(this.state.searchText)},400)}},"searchInput")),s.push(g.jsx(Me,{sx:fe.toolbarButtons,style:{float:"right"},title:b.I18n.t("End search mode"),onClick:r=>{r.stopPropagation(),this.filterList(!1,()=>this.props.onSearch&&this.props.onSearch(this.state.searchText))},size:"medium",children:g.jsx(lx,{})},"disableSearch")),this.state.searchText&&s.push(g.jsx(Me,{title:b.I18n.t("Clear search input"),sx:fe.toolbarButtons,style:{marginTop:7,float:"right"},onClick:r=>{r.stopPropagation(),this.setState({searchText:""},()=>{this.filterList(!0),this.props.onSearch&&this.props.onSearch(this.state.searchText)})},size:"medium",children:g.jsx(Ow,{fontSize:"small"})},"cleanSearch"));else{if(!i){s.push(g.jsx(Me,{"aria-label":"More","aria-owns":this.state.menuOpened?"long-menu":void 0,title:b.I18n.t("Menu"),"aria-haspopup":"true",onClick:u=>{u.stopPropagation(),u.preventDefault(),this.setState({menuOpened:!0,menuAnchorEl:u.currentTarget})},size:"medium",children:g.jsx(dx,{})},"menuButton"));const r=this.state.listItems.find(u=>u.id===this.state.selected);let l;r&&this.state.width<=Nr&&r.type==="folder"&&(l=this.state.listItems.filter(u=>u.parent===this.state.selected)),s.push(this.getMainMenu(l,r)),s.push(g.jsx(Me,{disabled:this.props.debugMode,title:b.I18n.t("Create new script"),sx:{...fe.toolbarButtons,...this.props.debugMode?fe.iconButtonsDisabled:void 0},style:{color:i?"red":"inherit"},onClick:u=>this.onAddNew(u),size:"medium",children:g.jsx(Qk,{})},"new-script")),s.push(g.jsx(Me,{disabled:this.props.debugMode,title:b.I18n.t("Create new folder"),sx:{...fe.toolbarButtons,...this.props.debugMode?fe.iconButtonsDisabled:void 0},style:{color:i?"red":"inherit"},onClick:u=>this.onAddNewFolder(u),size:"medium",children:g.jsx(eS,{})},"new-folder"))}s.push(g.jsx(Me,{disabled:i||this.props.debugMode,sx:{...fe.toolbarButtons,...this.props.debugMode?fe.iconButtonsDisabled:void 0},title:b.I18n.t("Search in scripts"),style:{float:"right",opacity:this.props.debugMode?.5:i?0:1},onClick:r=>{r.stopPropagation(),this.setState({searchMode:!0})},size:"medium",children:g.jsx(gx,{})},"search")),s.push(g.jsx(Me,{disabled:this.props.debugMode,title:b.I18n.t("Reorder scripts in folders"),sx:{...fe.toolbarButtons,...this.props.debugMode?fe.iconButtonsDisabled:void 0},style:{color:i?"red":"inherit",float:"right"},onClick:r=>{r.stopPropagation(),this.setState({reorder:!this.state.reorder})},size:"medium",children:g.jsx(bx,{})},"reorder")),!i&&this.state.selected&&this.state.selected!==$o&&this.state.selected!==fn&&s.push(g.jsx(Me,{sx:{...fe.toolbarButtons,...this.props.debugMode?fe.iconButtonsDisabled:void 0},disabled:this.props.debugMode,title:b.I18n.t("Rename"),onClick:r=>this.onRename(r),size:"medium",children:g.jsx(tS,{})},"rename")),s.push(g.jsxs("span",{style:{opacity:.5,fontSize:10},children:["v",this.props.version]},"version"))}return s}getFolders(){const s=[{id:Wt,name:b.I18n.t("Root folder")}];return this.state.listItems.forEach(i=>{i.type==="folder"&&i.id!==Wt&&(!i.id.startsWith($o)||this.state.expertMode)&&s.push({id:i.id,name:i.title})}),s}onCollapseAll(){this.setState({expanded:[]}),this.saveExpanded([])}onExpandAll(){const s=[];this.state.listItems.forEach(i=>this.state.listItems.find(r=>r.parent===i.id)&&s.push(i.id)),this.setState({expanded:s}),this.saveExpanded(s)}getBottomButtons(){return this.state.reorder||this.props.debugMode?null:[g.jsx($t,{sx:fe.footerButtons,title:b.I18n.t("Show only running scripts"),onClick:s=>{s.stopPropagation(),s.preventDefault();const i=this.state.statusFilter==="running"?"":"running";window.localStorage&&window.localStorage.setItem("SideMenu.statusFilter",i),this.setState({statusFilter:i})},children:g.jsx(gc,{style:{color:C_,opacity:this.state.statusFilter==="running"?1:.3,background:this.state.statusFilter==="running"?"gray":"inherit"}})},"filterByRunning"),g.jsx($t,{sx:fe.footerButtons,title:b.I18n.t("Show only paused scripts"),onClick:()=>{const s=this.state.statusFilter==="paused"?"":"paused";window.localStorage&&window.localStorage.setItem("SideMenu.statusFilter",s),this.setState({statusFilter:s})},children:g.jsx(Fg,{style:{color:k_,opacity:this.state.statusFilter==="paused"?1:.3,background:this.state.statusFilter==="paused"?"gray":"inherit"}})},"filterByPaused"),g.jsx($t,{sx:fe.footerButtons,style:{marginRight:16},title:b.I18n.t("Show only scripts with problems"),onClick:()=>{const s=this.state.statusFilter==="problems"?"":"problems";window.localStorage&&window.localStorage.setItem("SideMenu.statusFilter",s),this.setState({statusFilter:s})},children:g.jsx(gc,{style:{color:T_,opacity:this.state.statusFilter==="problems"?1:.3,background:this.state.statusFilter==="problems"?"gray":"inherit"}})},"filterByProblem"),g.jsx($t,{sx:fe.footerButtons,children:g.jsx("img",{alt:"Blockly",style:{opacity:this.state.typeFilter==="Blockly"?1:.3,background:this.state.typeFilter==="Blockly"?"gray":"inherit"},src:$n.Blockly,onClick:()=>{const s=this.state.typeFilter==="Blockly"?"":"Blockly";window.localStorage&&window.localStorage.setItem("SideMenu.typeFilter",s),this.setState({typeFilter:s})}})},"filterBlockly"),g.jsx($t,{sx:fe.footerButtons,children:g.jsx("img",{alt:"Javascript",style:{opacity:this.state.typeFilter==="Javascript/js"?1:.3,background:this.state.typeFilter==="Javascript/js"?"gray":"inherit"},src:$n["Javascript/js"],onClick:()=>{const s=this.state.typeFilter==="Javascript/js"?"":"Javascript/js";window.localStorage&&window.localStorage.setItem("SideMenu.typeFilter",s),this.setState({typeFilter:s})}})},"filterJS"),g.jsx($t,{sx:fe.footerButtons,children:g.jsx("img",{alt:"TypeScript",style:{opacity:this.state.typeFilter==="TypeScript/ts"?1:.3,background:this.state.typeFilter==="TypeScript/ts"?"gray":"inherit"},src:$n["TypeScript/ts"],onClick:()=>{const s=this.state.typeFilter==="TypeScript/ts"?"":"TypeScript/ts";window.localStorage&&window.localStorage.setItem("SideMenu.typeFilter",s),this.setState({typeFilter:s})}})},"filterTS"),g.jsx($t,{sx:fe.footerButtons,children:g.jsx("img",{alt:"Rules",style:{opacity:this.state.typeFilter==="Rules"?1:.3,background:this.state.typeFilter==="Rules"?"gray":"inherit"},src:$n.Rules,onClick:()=>{const s=this.state.typeFilter==="Rules"?"":"Rules";window.localStorage&&window.localStorage.setItem("SideMenu.typeFilter",s),this.setState({typeFilter:s})}})},"filterRules"),g.jsx("div",{style:{flexGrow:1}},"padding"),g.jsx($t,{sx:fe.footerButtons,onClick:()=>this.onExpandAll(),title:b.I18n.t("Expand all"),children:g.jsx(yx,{style:fe.footerButtonsRight})},"expandAll"),this.state.expanded.length?g.jsx($t,{sx:fe.footerButtons,onClick:()=>this.onCollapseAll(),title:b.I18n.t("Collapse all"),children:g.jsx(vx,{style:fe.footerButtonsRight})},"collapseAll"):g.jsx("div",{style:{height:22,width:24}})]}getAdapterDebugDialog(){return this.state.showAdapterDebug?g.jsx(Ex,{socket:this.props.socket,onClose:()=>this.setState({showAdapterDebug:!1}),onDebug:(s,i)=>this.setState({showAdapterDebug:!1},()=>this.props.onDebugInstance({instance:s,adapter:i}))},"debug"):null}render(){var r,l,u;const s=this.state.renaming?this.state.listItems.find(d=>d.id===this.state.renaming):void 0,i=this.state.copingScript&&this.props.scripts[this.state.copingScript].type==="script"?this.props.scripts[this.state.copingScript]:void 0;return[g.jsxs(Mk,{variant:"permanent",style:fe.menu,sx:{"& .MuiDrawer-paper":fe.drawerPaper},anchor:"left",onClick:()=>this.onClick({id:""}),children:[g.jsx($t,{sx:fe.toolbar,children:this.getToolbarButtons()}),g.jsx(e_,{}),g.jsx(Zw,{backend:uC,children:g.jsx("div",{style:fe.innerMenu,children:this.renderAllItems(this.state.listItems)})}),g.jsx(e_,{}),g.jsx("div",{style:fe.footer,children:this.getBottomButtons()})]},"drawer"),s?g.jsx($m,{name:s.title,id:this.state.renaming||"",folder:s.type==="folder",instance:s.instance,instances:this.props.instances,onClose:()=>this.setState({renaming:null}),onRename:(d,p,m,f)=>this.props.onRename&&this.props.onRename(d,p,m,f)},"dialog-rename"):null,this.state.deleting?g.jsx(_x,{name:this.state.listItems.find(d=>d.id===this.state.deleting).title,id:this.state.deleting,onClose:()=>this.setState({deleting:null}),onDelete:d=>this.props.onDelete&&this.props.onDelete(d)},"dialog-delete"):null,this.state.choosingType?g.jsx(Cn,{onClose:d=>{const p={choosingType:!1};d&&(p.creatingScript=d),this.setState(p)}},"dialog-script-type"):null,this.state.creatingScript?g.jsx(tg,{onClose:()=>this.setState({creatingScript:null}),title:b.I18n.t("Create new script"),name:this.getUniqueName(),parents:this.getFolders(),folder:!1,existingItems:this.state.listItems.map(d=>d.id),instance:this.props.instances[0]||0,instances:this.props.instances,type:this.state.creatingScript,parent:this.parent,onAdd:(d,p,m,f)=>this.props.onAddNew&&this.props.onAddNew(d,p,!1,m,f)},"dialog-new-script"):null,this.state.copingScript?g.jsx(tg,{onClose:()=>this.setState({copingScript:""}),title:b.I18n.t("Copy script"),name:this.getUniqueName(this.state.copingScript),parents:this.getFolders(),folder:!1,instance:parseInt((l=(r=i==null?void 0:i.common)==null?void 0:r.engine)==null?void 0:l.split(".").pop(),10)||0,instances:this.props.instances,type:((u=i==null?void 0:i.common)==null?void 0:u.engineType)||"Javascript/js",parent:this.parent,onAdd:(d,p,m,f)=>{var _;const v=this.state.copingScript&&this.props.scripts[this.state.copingScript].type==="script"?this.props.scripts[this.state.copingScript]:void 0;v!=null&&v.common&&(v.common.enabled=!1),this.props.onAddNew&&this.props.onAddNew(d,p,!1,m,f,(_=v==null?void 0:v.common)==null?void 0:_.source)}},"dialog-copy-script"):null,this.state.creatingFolder?g.jsx(tg,{onClose:()=>this.setState({creatingFolder:!1}),title:b.I18n.t("Create new folder"),parents:this.getFolders(),name:this.getUniqueFolderName(),parent:this.parent,onAdd:(d,p)=>this.props.onAddNew&&this.props.onAddNew(d,p,!0)},"dialog-new-folder"):null,this.state.errorText?g.jsx(Zc,{onClose:()=>this.setState({errorText:""}),text:this.state.errorText},"error"):null,this.getAdapterDebugDialog()]}}const Mx="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgAQMAAADYVuV7AAAABlBMVEUAAAAzMzPI8eYgAAAAAXRSTlMAQObYZgAAACFJREFUeAFjAIJRwP////8PYIKWHCigNQdKj/pn1D+jAABTG16wVQqVpQAAAABJRU5ErkJggg==",Nx="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgAQMAAADYVuV7AAAABlBMVEUAAAAzMzPI8eYgAAAAAXRSTlMAQObYZgAAABtJREFUeAFjAIJRwP8fCj7QkENn/4z6Z5QzCgBjbWaoyx1PqQAAAABJRU5ErkJggg==";function Lx(a){let s,i=a.getHours();return i<10&&(i=`0${i.toString()}`),s=`${i}:`,i=a.getMinutes(),i<10&&(i=`0${i.toString()}`),s+=`${i}:`,i=a.getSeconds(),i<10&&(i=`0${i.toString()}`),s+=`${i}.`,i=a.getMilliseconds(),i<10?i=`00${i.toString()}`:i<100&&(i=`0${i.toString()}`),s+=i,s}const I_=34,Bt={logBox:{width:"100%",height:"100%",position:"relative",overflow:"hidden"},logBoxInner:a=>({display:"inline-block",color:a.palette.mode==="dark"?"white":"black",width:`calc(100% - ${I_}px)`,height:"100%",overflow:"auto",position:"relative",verticalAlign:"top"}),info:a=>({background:a.palette.mode==="dark"?"darkgrey":"lightgrey",color:(a.palette.mode==="dark","black")}),error:a=>({background:"#FF0000",color:a.palette.mode==="dark"?"black":"white"}),warn:a=>({background:"#FF8000",color:a.palette.mode==="dark"?"black":"white"}),debug:a=>({background:"gray",opacity:.8,color:a.palette.mode==="dark"?"black":"white"}),silly:a=>({background:"gray",opacity:.6,color:a.palette.mode==="dark"?"black":"white"}),table:{fontFamily:"monospace",width:"100%"},toolbox:{width:I_,height:"100%",boxShadow:"2px 0px 4px -1px rgba(0, 0, 0, 0.2), 4px 0px 5px 0px rgba(0, 0, 0, 0.14), 1px 0px 10px 0px rgba(0, 0, 0, 0.12)",display:"inline-block",verticalAlign:"top",overflow:"hidden"},trFrom:{width:90},trTime:{width:90},trSeverity:{width:40,fontWeight:"bold"},trPreMessage:{padding:0,margin:0},iconButtons:{width:32,height:32,padding:4},layoutIcon:a=>({"& img":{width:24,height:24,background:a.palette.mode==="dark"?"#9d9d9d":void 0,borderRadius:a.palette.mode==="dark"?"30px":void 0}})};function Px(a){return a<10?`00${a}`:a<100?`0${a}`:a.toString()}const Ks={};class bm extends Y.Component{messagesEnd;constructor(s){super(s),this.state={lines:{},goBottom:!0,selected:null,editing:this.props.editing||[]},this.messagesEnd=Y.createRef()}static generateLine(s,i){let r=s.message||"";if(typeof r!="object"){const l=new RegExp(`${s.from.replace(".","\\.").replace(")","\\)").replace("(","\\(")} \\(\\d+\\) `,"g"),u=r.match(l);u?r=r.replace(u[0],""):r=r.replace(`${s.from} `,"")}return r.startsWith(`${i}: `)&&(r=r.substring(i.length+2)),g.jsxs($t,{component:"tr",sx:Bt[s.severity],children:[g.jsx("td",{style:Bt.trFrom,children:s.from}),g.jsx("td",{style:Bt.trTime,children:Lx(new Date(s.ts))}),g.jsx("td",{style:Bt.trSeverity,children:s.severity}),g.jsx("td",{children:g.jsx("pre",{style:Bt.trPreMessage,children:r})})]},`tr_${s.ts}_${s.message.substring(s.message.length-10)}`)}scrollToBottom(){var s,i;(i=(s=this.messagesEnd)==null?void 0:s.current)==null||i.scrollIntoView({behavior:"smooth"})}logHandler=s=>{const i=this.state.lines,r=this.state.editing.filter(f=>s.message.includes(f));let l=null;if(!r.length||(r.length===1?l=r[0]:(r.sort(),l=r[r.length-1]),!l))return;const u=i[l]||[],d=Ks[l]||[];u.push(bm.generateLine(s,l));let p=s.severity;(p==="info"||p==="warn")&&(p+=" ");const m=new Date(s.ts);d.push(`${m.toLocaleString()}.${Px(m.getMilliseconds())} [${p}]: ${s.message}`),u.length>300&&(u.splice(0,u.length-300),d.splice(0,u.length-300)),Ks[l]=d,i[l]=u,this.setState({lines:i})};componentDidMount(){this.props.socket.registerLogHandler(this.logHandler)}componentWillUnmount(){this.props.socket.unregisterLogHandler(this.logHandler)}componentDidUpdate(){this.state.goBottom&&this.scrollToBottom()}static getDerivedStateFromProps(s,i){let r=!1;const l={};if(s.selected!==i.selected){const u=s.selected,d=i.lines;u&&(d[u]=d[u]||[],Ks[u]=Ks[u]||[]),l.selected=u,r=!0}if(JSON.stringify(s.editing)!==JSON.stringify(i.editing)){const u=JSON.parse(JSON.stringify(s.editing));r=!0;const d=i.lines;for(const p in Ks)Object.prototype.hasOwnProperty.call(Ks,p)&&(u.includes(p)||(delete Ks[p],delete d[p]));l.editing=u}return r?l:null}onCopy(){b.Utils.copyToClipboard((Ks[this.state.selected]||[]).join(` -`))}clearLog(){const s=this.state.lines;s[this.state.selected]&&(s[this.state.selected]=[]),Ks[this.state.selected]&&(Ks[this.state.selected]=[]),this.setState({lines:s})}renderLogList(s){return this.state.selected&&(s!=null&&s.length)?g.jsxs($t,{sx:Bt.logBoxInner,children:[g.jsx("table",{style:Bt.table,children:g.jsx("tbody",{children:s})},"logTable"),g.jsx("div",{ref:this.messagesEnd,style:{float:"left",clear:"both"}},"logScrollPoint")]},"logList"):g.jsx($t,{sx:Bt.logBoxInner,style:{paddingLeft:10},children:b.I18n.t("Log outputs")},"logList")}render(){const s=this.state.selected?this.state.lines[this.state.selected]:null;return g.jsxs("div",{style:Bt.logBox,children:[g.jsxs("div",{style:Bt.toolbox,children:[g.jsx(Me,{style:Bt.iconButtons,onClick:()=>this.setState({goBottom:!this.state.goBottom}),color:this.state.goBottom?"secondary":void 0,size:"medium",children:g.jsx(sS,{})}),s!=null&&s.length?g.jsx(Me,{style:Bt.iconButtons,onClick:()=>this.clearLog(),size:"medium",children:g.jsx(oS,{})}):null,s!=null&&s.length?g.jsx(Me,{style:Bt.iconButtons,onClick:()=>this.onCopy(),size:"medium",children:g.jsx(iS,{})}):null,this.props.onLayoutChange?g.jsx(Me,{style:Bt.iconButtons,onClick:()=>this.props.onLayoutChange&&this.props.onLayoutChange(),title:b.I18n.t("Change layout"),size:"medium",sx:Bt.layoutIcon,children:g.jsx("img",{alt:"split",src:this.props.verticalLayout?Mx:Nx})}):null,g.jsx(Me,{style:Bt.iconButtons,onClick:()=>this.props.onHideLog(),title:b.I18n.t("Hide logs"),size:"medium",children:g.jsx(nS,{})})]},"toolbox"),this.renderLogList(s)]})}}var x_="focus-outline-hidden";function $C(){var a=this;document.addEventListener("keydown",function(s){a.focusByKeyboard=!0},!0),document.addEventListener("mousedown",function(s){a.focusByKeyboard=!1},!0),document.addEventListener("focus",function(s){a.updateVisibility()},!0),document.addEventListener("focusout",function(s){window.setTimeout(function(){document.hasFocus()||(a.focusByKeyboard=!0,a.updateVisibility())},0)}),this.updateVisibility()}$C.prototype={focusByKeyboard:!0,updateVisibility:function(){this.hidden=!this.focusByKeyboard},set hidden(a){document.documentElement.classList.toggle(x_,a)},get hidden(){return document.documentElement.classList.contains(x_)}};new $C;var bC={exports:{}};(function(a){(function(){var s={}.hasOwnProperty;function i(){for(var r=[],l=0;l4&&arguments[4]!==void 0?arguments[4]:"easeInOutCubic";return r>l?i:s+(i-s)*jx[u](r/l)};Ei.calcEndPoint=function(s){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(Fx(s))return parseInt(s)+r;var l=i===window||i===document.documentElement?window.pageYOffset:i.scrollTop-i.getBoundingClientRect().top,u=s.nodeName.toLowerCase()==="html"?-l:s.getBoundingClientRect().top+l;return u+r};(function(a,s){Object.defineProperty(s,"__esModule",{value:!0});var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},r=Ei;s.default=function(l){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d=u.duration,p=d===void 0?500:d,m=u.context,f=m===void 0?window:m,v=u.offset,_=v===void 0?0:v,y=u.ease,k=y===void 0?"easeInOutCubic":y,C=u.callback;if((typeof window>"u"?"undefined":i(window))==="object"){var w=f.scrollTop!==null&&f.scrollTop!==void 0?f.scrollTop:window.pageYOffset,E=(0,r.calcEndPoint)(l,f,_),R=performance.now(),D=window.requestAnimationFrame,A=function J(){var ie=performance.now()-R,se=(0,r.setPosition)(w,E,ie,p,k);f!==window?f.scrollTop=se:window.scroll(0,se),ie>p?typeof C=="function"&&C(l):D(J)};A()}},a.exports=s.default})(Gg,Gg.exports);var vC=Gg.exports,Vg={exports:{}};(function(a,s){Object.defineProperty(s,"__esModule",{value:!0});var i=Object.assign||function(d){for(var p=1;p0&&arguments[0]!==void 0?arguments[0]:{},p=d.query,m=p===void 0?'[href^="#"]:not([href="#"]':p,f=d.match,v=f===void 0?function(E){return document.getElementById(E.hash.substring(1))}:f,_=d.hashChange,y=_===void 0?!0:_,k=d.scrollSmoothConfig,C=document.querySelectorAll(m),w=function(R){R.preventDefault();var D=v(R.target);D&&(y&&history.replaceState(null,null,"#"+D.id),(0,l.default)(D,i({},k)))};Array.from(C).map(function(E){E.addEventListener("click",w,!1)})},a.exports=s.default})(Vg,Vg.exports);var zx=Vg.exports,Kg={exports:{}};(function(a,s){Object.defineProperty(s,"__esModule",{value:!0});function i(r){if(Array.isArray(r)){for(var l=0,u=Array(r.length);l0&&arguments[0]!==void 0?arguments[0]:{},l=r.activeClass,u=l===void 0?"active":l,d=r.query,p=d===void 0?'[href^="#"]:not([href="#"]):not([href="#0"])':d,m=r.threshold,f=m===void 0?[.25,.5,.75]:m,v=r.detectType,_=v===void 0?"max":v,y={threshold:f},k=function(se){return se.classList.remove(u)},C=function(se){return se.classList.add(u)},w=function(){document.querySelectorAll("."+u).forEach(k)},E=function(se){w(),C(document.querySelector('a[href="#'+se.id+'"]'))},R=function(se){se.forEach(function(me){me.intersectionRatio>=Math[_].apply(Math,i(f))&&E(me.target)})},D=document.querySelectorAll(p),A=new IntersectionObserver(R,y),J=function(se){var me=document.querySelector("#"+se.hash.slice(1));A.observe(me)};D.forEach(J)},a.exports=s.default})(Kg,Kg.exports);var Ux=Kg.exports;(function(a,s){Object.defineProperty(s,"__esModule",{value:!0});var i=vC,r=f(i),l=Ei,u=zx,d=f(u),p=Ux,m=f(p);function f(v){return v&&v.__esModule?v:{default:v}}s.default={to:r.default,calcEndPoint:l.calcEndPoint,anchorScroll:d.default,observe:m.default},a.exports=s.default})(Wg,Wg.exports);var Hx=Wg.exports;const Wx=Si(Hx);var vm={exports:{}},Gx=vm.exports;(function(a){(function(s,i){a.exports?a.exports=i():s.Scrollparent=i()})(Gx,function(){var s=/(auto|scroll)/,i=function(p,m){return p.parentNode===null?m:i(p.parentNode,m.concat([p]))},r=function(p,m){return getComputedStyle(p,null).getPropertyValue(m)},l=function(p){return r(p,"overflow")+r(p,"overflow-y")+r(p,"overflow-x")},u=function(p){return s.test(l(p))},d=function(p){if(p instanceof HTMLElement||p instanceof SVGElement){for(var m=i(p.parentNode,[]),f=0;f=s||me<0||_&&z>=u}function R(){var se=sg();if(E(se))return D(se);p=setTimeout(R,w(se))}function D(se){return p=void 0,y&&r?k(se):(r=l=void 0,d)}function A(){p!==void 0&&clearTimeout(p),f=0,r=m=l=p=void 0}function J(){return p===void 0?d:D(sg())}function ie(){var se=sg(),me=E(se);if(r=arguments,l=this,m=se,me){if(p===void 0)return C(m);if(_)return p=setTimeout(R,s),k(m)}return p===void 0&&(p=setTimeout(R,s)),d}return ie.cancel=A,ie.flush=J,ie}function Yg(a){var s=typeof a;return!!a&&(s=="object"||s=="function")}function cD(a){return!!a&&typeof a=="object"}function uD(a){return typeof a=="symbol"||cD(a)&&nD.call(a)==Jx}function R_(a){if(typeof a=="number")return a;if(uD(a))return A_;if(Yg(a)){var s=typeof a.valueOf=="function"?a.valueOf():a;a=Yg(s)?s+"":s}if(typeof a!="string")return a===0?a:+a;a=a.replace(qx,"");var i=Zx.test(a);return i||Qx.test(a)?eD(a.slice(2),i?2:8):Xx.test(a)?A_:+a}var dD=lD;const hD=Si(dD);var Jg="data-focus-lock",yC="data-focus-lock-disabled",pD="data-no-focus-lock",gD="data-autofocus-inside",mD="data-no-autofocus";function og(a,s){return typeof a=="function"?a(s):a&&(a.current=s),a}function fD(a,s){var i=vt(function(){return{value:a,callback:s,facade:{get current(){return i.value},set current(r){var l=i.value;l!==r&&(i.value=r,i.callback(r,l))}}}})[0];return i.callback=s,i.facade}var $D=typeof window<"u"?lm:Mt,O_=new WeakMap;function bD(a,s){var i=fD(null,function(r){return a.forEach(function(l){return og(l,r)})});return $D(function(){var r=O_.get(i);if(r){var l=new Set(r),u=new Set(a),d=i.current;l.forEach(function(p){u.has(p)||og(p,null)}),u.forEach(function(p){l.has(p)||og(p,d)})}O_.set(i,a)},[a]),i}var ig={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"};function _C(a){return a}function wC(a,s){s===void 0&&(s=_C);var i=[],r=!1,l={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:a},useMedium:function(u){var d=s(u,r);return i.push(d),function(){i=i.filter(function(p){return p!==d})}},assignSyncMedium:function(u){for(r=!0;i.length;){var d=i;i=[],d.forEach(u)}i={push:function(p){return u(p)},filter:function(){return i}}},assignMedium:function(u){r=!0;var d=[];if(i.length){var p=i;i=[],p.forEach(u),d=i}var m=function(){var v=d;d=[],v.forEach(u)},f=function(){return Promise.resolve().then(m)};f(),i={push:function(v){d.push(v),f()},filter:function(v){return d=d.filter(v),i}}}};return l}function ym(a,s){return s===void 0&&(s=_C),wC(a,s)}function vD(a){a===void 0&&(a={});var s=wC(null);return s.options=rS({async:!0,ssr:!1},a),s}var CC=ym({},function(a){var s=a.target,i=a.currentTarget;return{target:s,currentTarget:i}}),TC=ym(),yD=ym(),_D=vD({async:!0,ssr:typeof document<"u"}),wD=rm(void 0),CD=[],_m=Sw(function(s,i){var r,l=vt(),u=l[0],d=l[1],p=Bo(),m=Bo(!1),f=Bo(null),v=vt({}),_=v[1],y=s.children,k=s.disabled,C=k===void 0?!1:k,w=s.noFocusGuards,E=w===void 0?!1:w,R=s.persistentFocus,D=R===void 0?!1:R,A=s.crossFrame,J=A===void 0?!0:A,ie=s.autoFocus,se=ie===void 0?!0:ie;s.allowTextSelection;var me=s.group,z=s.className,Oe=s.whiteList,Ne=s.hasPositiveIndices,Ze=s.shards,ae=Ze===void 0?CD:Ze,ce=s.as,K=ce===void 0?"div":ce,ye=s.lockProps,he=ye===void 0?{}:ye,je=s.sideCar,V=s.returnFocus,tt=V===void 0?!1:V,q=s.focusOptions,ee=s.onActivation,B=s.onDeactivation,H=vt({}),U=H[0],re=_n(function(ke){var $e=ke.captureFocusRestore;if(!f.current){var Pe,bt=(Pe=document)==null?void 0:Pe.activeElement;f.current=bt,bt!==document.body&&(f.current=$e(bt))}p.current&&ee&&ee(p.current),m.current=!0,_()},[ee]),I=_n(function(){m.current=!1,B&&B(p.current),_()},[B]),de=_n(function(ke){var $e=f.current;if($e){var Pe=(typeof $e=="function"?$e():$e)||document.body,bt=typeof tt=="function"?tt(Pe):tt;if(bt){var X=typeof bt=="object"?bt:void 0;f.current=null,ke?Promise.resolve().then(function(){return Pe.focus(X)}):Pe.focus(X)}}},[tt]),W=_n(function(ke){m.current&&CC.useMedium(ke)},[]),Ce=TC.useMedium,be=_n(function(ke){p.current!==ke&&(p.current=ke,d(ke))},[]),Se=Tg((r={},r[yC]=C&&"disabled",r[Jg]=me,r),he),pe=E!==!0,Ve=pe&&E!=="tail",Je=bD([i,be]),_e=rs(function(){return{observed:p,shards:ae,enabled:!C,active:m.current}},[C,m.current,ae,u]);return Y.createElement(Sg,null,pe&&[Y.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:C?-1:0,style:ig}),Ne?Y.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:C?-1:1,style:ig}):null],!C&&Y.createElement(je,{id:U,sideCar:_D,observed:u,disabled:C,persistentFocus:D,crossFrame:J,autoFocus:se,whiteList:Oe,shards:ae,onActivation:re,onDeactivation:I,returnFocus:de,focusOptions:q,noFocusGuards:E}),Y.createElement(K,Tg({ref:Je},Se,{className:z,onBlur:Ce,onFocus:W}),Y.createElement(wD.Provider,{value:_e},y)),Ve&&Y.createElement("div",{"data-focus-guard":!0,tabIndex:C?-1:0,style:ig}))});_m.propTypes={};function TD(a,s){function i(r){return r.displayName||r.name||"Component"}return function(l){var u=[],d;function p(){d=a(u.map(function(f){return f.props})),s(d)}var m=(function(f){ES(v,f);function v(){return f.apply(this,arguments)||this}v.peek=function(){return d};var _=v.prototype;return _.componentDidMount=function(){u.push(this),p()},_.componentDidUpdate=function(){p()},_.componentWillUnmount=function(){var k=u.indexOf(this);u.splice(k,1),p()},_.render=function(){return Y.createElement(l,this.props)},v})(Dk);return KS(m,"displayName","SideEffect("+i(l)+")"),m}}var Xs=function(a){for(var s=Array(a.length),i=0;i=0}).sort(OD)},ND=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],Tm=ND.join(","),LD="".concat(Tm,", [data-focus-guard]"),OC=function(a,s){return Xs((a.shadowRoot||a).children).reduce(function(i,r){return i.concat(r.matches(s?LD:Tm)?[r]:[],OC(r))},[])},PD=function(a,s){var i;return a instanceof HTMLIFrameElement&&(!((i=a.contentDocument)===null||i===void 0)&&i.body)?An([a.contentDocument.body],s):[a]},An=function(a,s){return a.reduce(function(i,r){var l,u=OC(r,s),d=(l=[]).concat.apply(l,u.map(function(p){return PD(p,s)}));return i.concat(d,r.parentNode?Xs(r.parentNode.querySelectorAll(Tm)).filter(function(p){return p===r}):[])},[])},BD=function(a){var s=a.querySelectorAll("[".concat(gD,"]"));return Xs(s).map(function(i){return An([i])}).reduce(function(i,r){return i.concat(r)},[])},km=function(a,s){return Xs(a).filter(function(i){return IC(s,i)}).filter(function(i){return DD(i)})},M_=function(a,s){return s===void 0&&(s=new Map),Xs(a).filter(function(i){return xC(s,i)})},Sm=function(a,s,i){return Cm(km(An(a,i),s),!0,i)},Kr=function(a,s){return Cm(km(An(a),s),!1)},jD=function(a,s){return km(BD(a),s)},yi=function(a,s){return a.shadowRoot?yi(a.shadowRoot,s):Object.getPrototypeOf(a).contains!==void 0&&Object.getPrototypeOf(a).contains.call(a,s)?!0:Xs(a.children).some(function(i){var r;if(i instanceof HTMLIFrameElement){var l=(r=i.contentDocument)===null||r===void 0?void 0:r.body;return l?yi(l,s):!1}return yi(i,s)})},FD=function(a){for(var s=new Set,i=a.length,r=0;r0&&s.add(l),(u&Node.DOCUMENT_POSITION_CONTAINS)>0&&s.add(r)}return a.filter(function(d,p){return!s.has(p)})},MC=function(a){return a.parentNode?MC(a.parentNode):a},Em=function(a){var s=Ti(a);return s.filter(Boolean).reduce(function(i,r){var l=r.getAttribute(Jg);return i.push.apply(i,l?FD(Xs(MC(r).querySelectorAll("[".concat(Jg,'="').concat(l,'"]:not([').concat(yC,'="disabled"])')))):[r]),i},[])},zD=function(a){try{return a()}catch{return}},Yr=function(a){if(a===void 0&&(a=document),!(!a||!a.activeElement)){var s=a.activeElement;return s.shadowRoot?Yr(s.shadowRoot):s instanceof HTMLIFrameElement&&zD(function(){return s.contentWindow.document})?Yr(s.contentWindow.document):s}},UD=function(a,s){return a===s},HD=function(a,s){return!!Xs(a.querySelectorAll("iframe")).some(function(i){return UD(i,s)})},NC=function(a,s){return s===void 0&&(s=Yr(kC(a).ownerDocument)),!s||s.dataset&&s.dataset.focusGuard?!1:Em(a).some(function(i){return yi(i,s)||HD(i,s)})},WD=function(a){a===void 0&&(a=document);var s=Yr(a);return s?Xs(a.querySelectorAll("[".concat(pD,"]"))).some(function(i){return yi(i,s)}):!1},GD=function(a,s){return s.filter(RC).filter(function(i){return i.name===a.name}).filter(function(i){return i.checked})[0]||a},Im=function(a,s){return RC(a)&&a.name?GD(a,s):a},VD=function(a){var s=new Set;return a.forEach(function(i){return s.add(Im(i,a))}),a.filter(function(i){return s.has(i)})},N_=function(a){return a[0]&&a.length>1?Im(a[0],a):a[0]},L_=function(a,s){return a.indexOf(Im(s,a))},Xg="NEW_FOCUS",KD=function(a,s,i,r,l){var u=a.length,d=a[0],p=a[u-1],m=wm(r);if(!(r&&a.indexOf(r)>=0)){var f=r!==void 0?i.indexOf(r):-1,v=l?i.indexOf(l):f,_=l?a.indexOf(l):-1;if(f===-1)return _!==-1?_:Xg;if(_===-1)return Xg;var y=f-v,k=i.indexOf(d),C=i.indexOf(p),w=VD(i),E=r!==void 0?w.indexOf(r):-1,R=l?w.indexOf(l):E,D=w.filter(function(z){return z.tabIndex>=0}),A=r!==void 0?D.indexOf(r):-1,J=l?D.indexOf(l):A,ie=A>=0&&J>=0?J-A:R-E;if(!y&&_>=0||s.length===0)return _;var se=L_(a,s[0]),me=L_(a,s[s.length-1]);if(f<=k&&m&&Math.abs(y)>1)return me;if(f>=C&&m&&Math.abs(y)>1)return se;if(y&&Math.abs(ie)>1)return _;if(f<=k)return me;if(f>C)return se;if(y)return Math.abs(y)>1?_:(u+_+y)%u}},YD=function(a){return function(s){var i,r=(i=DC(s))===null||i===void 0?void 0:i.autofocus;return s.autofocus||r!==void 0&&r!=="false"||a.indexOf(s)>=0}},P_=function(a,s,i){var r=a.map(function(u){var d=u.node;return d}),l=M_(r.filter(YD(i)));return l&&l.length?N_(l):N_(M_(s))},Zg=function(a,s){return s===void 0&&(s=[]),s.push(a),a.parentNode&&Zg(a.parentNode.host||a.parentNode,s),s},ng=function(a,s){for(var i=Zg(a),r=Zg(s),l=0;l=0)return u}return!1},LC=function(a,s,i){var r=Ti(a),l=Ti(s),u=r[0],d=!1;return l.filter(Boolean).forEach(function(p){d=ng(d||p,p)||d,i.filter(Boolean).forEach(function(m){var f=ng(u,m);f&&(!d||yi(f,d)?d=f:d=ng(f,d))})}),d},B_=function(a,s){return a.reduce(function(i,r){return i.concat(jD(r,s))},[])},JD=function(a,s){var i=new Map;return s.forEach(function(r){return i.set(r.node,r)}),a.map(function(r){return i.get(r)}).filter(RD)},qD=function(a,s){var i=Yr(Ti(a).length>0?document:kC(a).ownerDocument),r=Em(a).filter(qg),l=LC(i||a,a,r),u=new Map,d=Kr(r,u),p=d.filter(function(C){var w=C.node;return qg(w)});if(p[0]){var m=Kr([l],u).map(function(C){var w=C.node;return w}),f=JD(m,p),v=f.map(function(C){var w=C.node;return w}),_=f.filter(function(C){var w=C.tabIndex;return w>=0}).map(function(C){var w=C.node;return w}),y=KD(v,_,m,i,s);if(y===Xg){var k=P_(d,_,B_(r,u))||P_(d,v,B_(r,u));if(k)return{node:k};console.warn("focus-lock: cannot find any node to move focus into");return}return y===void 0?y:f[y]}},XD=function(a){var s=Em(a).filter(qg),i=LC(a,a,s),r=Cm(An([i],!0),!0,!0),l=An(s,!1);return r.map(function(u){var d=u.node,p=u.index;return{node:d,index:p,lockItem:l.indexOf(d)>=0,guard:wm(d)}})},xm=function(a,s){a&&("focus"in a&&a.focus(s),"contentWindow"in a&&a.contentWindow&&a.contentWindow.focus())},rg=0,ag=!1,PC=function(a,s,i){i===void 0&&(i={});var r=qD(a,s);if(!ag&&r){if(rg>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),ag=!0,setTimeout(function(){ag=!1},1);return}rg++,xm(r.node,i.focusOptions),rg--}};function Lr(a){if(!a)return null;if(typeof WeakRef>"u")return function(){return a||null};var s=a?new WeakRef(a):null;return function(){return(s==null?void 0:s.deref())||null}}var ZD=function(a){if(!a)return null;for(var s=[],i=a;i&&i!==document.body;)s.push({current:Lr(i),parent:Lr(i.parentElement),left:Lr(i.previousElementSibling),right:Lr(i.nextElementSibling)}),i=i.parentElement;return{element:Lr(a),stack:s,ownerDocument:a.ownerDocument}},QD=function(a){var s,i,r,l,u;if(a)for(var d=a.stack,p=a.ownerDocument,m=new Map,f=0,v=d;f-1&&(E.filter(function(D){var A=D.guard,J=D.node;return A&&J.dataset.focusAutoGuard}).forEach(function(D){var A=D.node;return A.removeAttribute("tabIndex")}),F_(R,E.length,1,E),F_(R,-1,-1,E))}}}return s},HC=function(s){wc()&&s&&(s.stopPropagation(),s.preventDefault())},Rm=function(){return Dm(wc)},$A=function(s){var i=s.target,r=s.currentTarget;r.contains(i)||dA(r,i)},bA=function(){return null},WC=function(){Am=!0},GC=function(){Am=!1,Jr="just",Dm(function(){Jr="meanwhile"})},vA=function(){document.addEventListener("focusin",HC),document.addEventListener("focusout",Rm),window.addEventListener("focus",WC),window.addEventListener("blur",GC)},yA=function(){document.removeEventListener("focusin",HC),document.removeEventListener("focusout",Rm),window.removeEventListener("focus",WC),window.removeEventListener("blur",GC)};function _A(a){return a.filter(function(s){var i=s.disabled;return!i})}var VC={moveFocusInside:PC,focusInside:NC,focusNextElement:oA,focusPrevElement:iA,focusFirstElement:nA,focusLastElement:rA,captureFocusRestore:BC};function wA(a){var s=a.slice(-1)[0];s&&!Sn&&vA();var i=Sn,r=i&&s&&s.id===i.id;Sn=s,i&&!r&&(i.onDeactivation(),a.filter(function(l){var u=l.id;return u===i.id}).length||i.returnFocus(!s)),s?(Zt=null,(!r||i.observed!==s.observed)&&s.onActivation(VC),wc(),Dm(wc)):(yA(),Zt=null)}CC.assignSyncMedium($A);TC.assignMedium(Rm);yD.assignMedium(function(a){return a(VC)});const CA=TD(_A,wA)(bA);var KC=Sw(function(s,i){return Y.createElement(_m,Tg({sideCar:CA,ref:i},s))}),YC=_m.propTypes||{};YC.sideCar;IS(YC,["sideCar"]);KC.propTypes={};var JC={exports:{}},et={};var Om=Symbol.for("react.element"),Mm=Symbol.for("react.portal"),Qc=Symbol.for("react.fragment"),eu=Symbol.for("react.strict_mode"),tu=Symbol.for("react.profiler"),su=Symbol.for("react.provider"),ou=Symbol.for("react.context"),TA=Symbol.for("react.server_context"),iu=Symbol.for("react.forward_ref"),nu=Symbol.for("react.suspense"),ru=Symbol.for("react.suspense_list"),au=Symbol.for("react.memo"),lu=Symbol.for("react.lazy"),kA=Symbol.for("react.offscreen"),qC;qC=Symbol.for("react.module.reference");function _s(a){if(typeof a=="object"&&a!==null){var s=a.$$typeof;switch(s){case Om:switch(a=a.type,a){case Qc:case tu:case eu:case nu:case ru:return a;default:switch(a=a&&a.$$typeof,a){case TA:case ou:case iu:case lu:case au:case su:return a;default:return s}}case Mm:return s}}}et.ContextConsumer=ou;et.ContextProvider=su;et.Element=Om;et.ForwardRef=iu;et.Fragment=Qc;et.Lazy=lu;et.Memo=au;et.Portal=Mm;et.Profiler=tu;et.StrictMode=eu;et.Suspense=nu;et.SuspenseList=ru;et.isAsyncMode=function(){return!1};et.isConcurrentMode=function(){return!1};et.isContextConsumer=function(a){return _s(a)===ou};et.isContextProvider=function(a){return _s(a)===su};et.isElement=function(a){return typeof a=="object"&&a!==null&&a.$$typeof===Om};et.isForwardRef=function(a){return _s(a)===iu};et.isFragment=function(a){return _s(a)===Qc};et.isLazy=function(a){return _s(a)===lu};et.isMemo=function(a){return _s(a)===au};et.isPortal=function(a){return _s(a)===Mm};et.isProfiler=function(a){return _s(a)===tu};et.isStrictMode=function(a){return _s(a)===eu};et.isSuspense=function(a){return _s(a)===nu};et.isSuspenseList=function(a){return _s(a)===ru};et.isValidElementType=function(a){return typeof a=="string"||typeof a=="function"||a===Qc||a===tu||a===eu||a===nu||a===ru||a===kA||typeof a=="object"&&a!==null&&(a.$$typeof===lu||a.$$typeof===au||a.$$typeof===su||a.$$typeof===ou||a.$$typeof===iu||a.$$typeof===qC||a.getModuleId!==void 0)};et.typeOf=_s;JC.exports=et;var XC=JC.exports;function SA(a){function s(B,H,U,re,I){for(var de=0,W=0,Ce=0,be=0,Se,pe,Ve=0,Je=0,_e,ke=_e=Se=0,$e=0,Pe=0,bt=0,X=0,ct=U.length,ze=ct-1,kt,ve="",st="",Zs="",St="",Et;$eSe)&&(X=(ve=ve.replace(" ",":")).length),0re&&(re=(H=H.trim()).charCodeAt(0)),re){case 38:return H.replace(R,"$1"+B.trim());case 58:return B.trim()+H.replace(R,"$1"+B.trim());default:if(0<1*U&&0W.charCodeAt(8))break;case 115:I=I.replace(W,"-webkit-"+W)+";"+I;break;case 207:case 102:I=I.replace(W,"-webkit-"+(102U.charCodeAt(0)&&(U=U.trim()),ee=U,U=[ee],01?s-1:0),r=1;r0?" Args: "+i.join(", "):""))}var DA=(function(){function a(i){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=i}var s=a.prototype;return s.indexOfGroup=function(i){for(var r=0,l=0;l=this.groupSizes.length){for(var l=this.groupSizes,u=l.length,d=u;i>=d;)(d<<=1)<0&&aa(16,""+i);this.groupSizes=new Uint32Array(d),this.groupSizes.set(l),this.length=d;for(var p=u;p=this.length||this.groupSizes[i]===0)return r;for(var l=this.groupSizes[i],u=this.indexOfGroup(i),d=u+l,p=u;p=zr&&(zr=s+1),fc.set(a,s),Tc.set(s,a)},OA="style["+Rn+'][data-styled-version="5.3.11"]',MA=new RegExp("^"+Rn+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),NA=function(a,s,i){for(var r,l=i.split(","),u=0,d=l.length;u=0;f--){var v=m[f];if(v&&v.nodeType===1&&v.hasAttribute(Rn))return v}})(i),u=l!==void 0?l.nextSibling:null;r.setAttribute(Rn,"active"),r.setAttribute("data-styled-version","5.3.11");var d=PA();return d&&r.setAttribute("nonce",d),i.insertBefore(r,u),r},BA=(function(){function a(i){var r=this.element=ZC(i);r.appendChild(document.createTextNode("")),this.sheet=(function(l){if(l.sheet)return l.sheet;for(var u=document.styleSheets,d=0,p=u.length;d=0){var l=document.createTextNode(r),u=this.nodes[i];return this.element.insertBefore(l,u||null),this.length++,!0}return!1},s.deleteRule=function(i){this.element.removeChild(this.nodes[i]),this.length--},s.getRule=function(i){return i0&&(_+=y+",")})),u+=""+f+v+'{content:"'+_+`"}/*!sc*/ -`}}}return u})(this)},a})(),UA=/(a)(d)/gi,W_=function(a){return String.fromCharCode(a+(a>25?39:97))};function em(a){var s,i="";for(s=Math.abs(a);s>52;s=s/52|0)i=W_(s%52)+i;return(W_(s%52)+i).replace(UA,"$1-$2")}var Tn=function(a,s){for(var i=s.length;i;)a=33*a^s.charCodeAt(--i);return a},QC=function(a){return Tn(5381,a)};function eT(a){for(var s=0;s>>0);if(!i.hasNameForId(l,p)){var m=r(d,"."+p,void 0,l);i.insertRules(l,p,m)}u.push(p),this.staticRulesId=p}else{for(var f=this.rules.length,v=Tn(this.baseHash,r.hash),_="",y=0;y>>0);if(!i.hasNameForId(l,E)){var R=r(_,"."+E,void 0,l);i.insertRules(l,E,R)}u.push(E)}}return u.join(" ")},a})(),GA=/^\s*\/\/.*$/gm,VA=[":","[",".","#"];function KA(a){var s,i,r,l,u=jo,d=u.options,p=d===void 0?jo:d,m=u.plugins,f=m===void 0?Cc:m,v=new SA(p),_=[],y=(function(w){function E(R){if(R)try{w(R+"}")}catch{}}return function(R,D,A,J,ie,se,me,z,Oe,Ne){switch(R){case 1:if(Oe===0&&D.charCodeAt(0)===64)return w(D+";"),"";break;case 2:if(z===0)return D+"/*|*/";break;case 3:switch(z){case 102:case 112:return w(A[0]+D),"";default:return D+(Ne===0?"/*|*/":"")}case-2:D.split("/*|*/}").forEach(E)}}})((function(w){_.push(w)})),k=function(w,E,R){return E===0&&VA.indexOf(R[i.length])!==-1||R.match(l)?w:"."+s};function C(w,E,R,D){D===void 0&&(D="&");var A=w.replace(GA,""),J=E&&R?R+" "+E+" { "+A+" }":A;return s=D,i=E,r=new RegExp("\\"+i+"\\b","g"),l=new RegExp("(\\"+i+"\\b){2,}"),v(R||!E?"":E,J)}return v.use([].concat(f,[function(w,E,R){w===2&&R.length&&R[0].lastIndexOf(i)>0&&(R[0]=R[0].replace(r,k))},y,function(w){if(w===-2){var E=_;return _=[],E}}])),C.hash=f.length?f.reduce((function(w,E){return E.name||aa(15),Tn(w,E.name)}),5381).toString():"",C}var tT=Y.createContext();tT.Consumer;var sT=Y.createContext(),YA=(sT.Consumer,new kc),tm=KA();function oT(){return Xr(tT)||YA}function iT(){return Xr(sT)||tm}var JA=(function(){function a(s,i){var r=this;this.inject=function(l,u){u===void 0&&(u=tm);var d=r.name+u.hash;l.hasNameForId(r.id,d)||l.insertRules(r.id,d,u(r.rules,d,"@keyframes"))},this.toString=function(){return aa(12,String(r.name))},this.name=s,this.id="sc-keyframes-"+s,this.rules=i}return a.prototype.getName=function(s){return s===void 0&&(s=tm),this.name+s.hash},a})(),qA=/([A-Z])/,XA=/([A-Z])/g,ZA=/^ms-/,QA=function(a){return"-"+a.toLowerCase()};function G_(a){return qA.test(a)?a.replace(XA,QA).replace(ZA,"-ms-"):a}var V_=function(a){return a==null||a===!1||a===""};function ki(a,s,i,r){if(Array.isArray(a)){for(var l,u=[],d=0,p=a.length;d1?s-1:0),r=1;r?@[\\\]^`{|}~-]+/g,t0=/(^-|-$)/g;function lg(a){return a.replace(e0,"-").replace(t0,"")}var aT=function(a){return em(QC(a)>>>0)};function ic(a){return typeof a=="string"&&!0}var sm=function(a){return typeof a=="function"||typeof a=="object"&&a!==null&&!Array.isArray(a)},s0=function(a){return a!=="__proto__"&&a!=="constructor"&&a!=="prototype"};function o0(a,s,i){var r=a[i];sm(s)&&sm(r)?lT(r,s):a[i]=s}function lT(a){for(var s=arguments.length,i=new Array(s>1?s-1:0),r=1;r=0||(Ne[z]=se[z]);return Ne})(s,["componentId"]),ie=A&&A+"-"+(ic(D)?D:lg(U_(D)));return cT(D,Js({},J,{attrs:y,componentId:ie}),i)},Object.defineProperty(C,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(D){this._foldedDefaultProps=r?lT({},a.defaultProps,D):D}}),Object.defineProperty(C,"toString",{value:function(){return"."+C.styledComponentId}}),l&&xS(C,a,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),C}var ys=function(a){return(function s(i,r,l){if(l===void 0&&(l=jo),!XC.isValidElementType(r))return aa(1,String(r));var u=function(){return i(r,l,nT.apply(void 0,arguments))};return u.withConfig=function(d){return s(i,r,Js({},l,{},d))},u.attrs=function(d){return s(i,r,Js({},l,{attrs:Array.prototype.concat(l.attrs,d).filter(Boolean)}))},u})(cT,a)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(a){ys[a]=ys(a)}));var i0=(function(){function a(i,r){this.rules=i,this.componentId=r,this.isStatic=eT(i),kc.registerId(this.componentId+1)}var s=a.prototype;return s.createStyles=function(i,r,l,u){var d=u(ki(this.rules,r,l,u).join(""),""),p=this.componentId+i;l.insertRules(p,p,d)},s.removeStyles=function(i,r){r.clearRules(this.componentId+i)},s.renderStyles=function(i,r,l,u){i>2&&kc.registerId(this.componentId+i),this.removeStyles(i,l),this.createStyles(i,r,l,u)},a})();function n0(a){for(var s=arguments.length,i=new Array(s>1?s-1:0),r=1;ra.length)&&(s=a.length);for(var i=0,r=Array(s);i=a.length?{done:!0}:{done:!1,value:a[r++]}},e:function(m){throw m},f:l}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var u,d=!0,p=!1;return{s:function(){i=i.call(a)},n:function(){var m=i.next();return d=m.done,m},e:function(m){p=!0,u=m},f:function(){try{d||i.return==null||i.return()}finally{if(p)throw u}}}}function fs(a,s,i){return(s=dT(s))in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function Sc(a){return Sc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(s){return s.__proto__||Object.getPrototypeOf(s)},Sc(a)}function h0(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(s&&s.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),s&&om(a,s)}function uT(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(uT=function(){return!!a})()}function p0(a,s){var i=a==null?null:typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(i!=null){var r,l,u,d,p=[],m=!0,f=!1;try{if(u=(i=i.call(a)).next,s!==0)for(;!(m=(r=u.call(i)).done)&&(p.push(r.value),p.length!==s);m=!0);}catch(v){f=!0,l=v}finally{try{if(!m&&i.return!=null&&(d=i.return(),Object(d)!==d))return}finally{if(f)throw l}}return p}}function g0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function J_(a,s){var i=Object.keys(a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(a);s&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(a,l).enumerable})),i.push.apply(i,r)}return i}function Ec(a){for(var s=1;si.right&&(i.right=p.right),p.bottom>i.bottom&&(i.bottom=p.bottom),p.left=0+m&&l>=0+m&&r<=d-m&&i<=u-m}function w0(a){return a===document.querySelector("body")||a===document.querySelector("html")}var C0=function(s){return/(left|right)/.test(s)},ug=function(s,i){return s>i},dg=function(s,i){return s>i},Ys=function(s){return s<0?0:s};function T0(a){return Object.keys(a).map(function(s){return{position:s,value:a[s]}}).sort(function(s,i){return i.value-s.value}).map(function(s){return s.position})}var sw,k0=ys.div(sw||(sw=Os([` - --reactour-accent: `,`; - `,` - position: fixed; - transition: transform 0.3s; - top: 0; - left: 0; - z-index: 1000000; - - transform: `,`; -`])),function(a){return a.accentColor},function(a){return a.defaultStyles?` - max-width: 331px; - min-width: 150px; - padding-right: 40px; - border-radius: `.concat(a.rounded,`px; - background-color: #fff; - padding: 24px 30px; - box-shadow: 0 0.5em 3em rgba(0, 0, 0, 0.3); - color: inherit; - `):""},function(a){var s=a.targetTop,i=a.targetRight,r=a.targetBottom,l=a.targetLeft,u=a.windowWidth,d=a.windowHeight,p=a.helperWidth,m=a.helperHeight,f=a.helperPosition,v=a.padding,_={left:l,right:u-i,top:s,bottom:d-r},y=function(R){return _[R]>(C0(R)?p+v*2:m+v*2)},k=function(R){for(var D=T0(_),A=0;Av?ie:v,me=dg(s+m,d)?dg(r+v,d)?r-m:r-m+v:s-v,z=me>v?me:v,Oe={top:[se,s-m-v*2],right:[i+v*2,z],bottom:[se,r+v*2],left:[l-p-v*2,z],center:[u/2-p/2,d/2-m/2]};return R==="center"||y(R)?Oe[R]:k(Oe)},w=C(f);return"translate(".concat(Math.round(w[0]),"px, ").concat(Math.round(w[1]),"px)")}),ow,S0=ys.span(ow||(ow=Os([` - position: absolute; - font-family: monospace; - background: var(--reactour-accent); - background: `,`; - height: 1.875em; - line-height: 2; - padding-left: 0.8125em; - padding-right: 0.8125em; - font-size: 1em; - border-radius: 1.625em; - color: white; - text-align: center; - box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.3); - top: -0.8125em; - left: -0.8125em; -`])),function(a){return a.accentColor}),iw,E0=ys.div(iw||(iw=Os([` - display: flex; - margin-top: 24px; - align-items: center; - justify-content: center; -`]))),nw,I0=ys.nav(nw||(nw=Os([` - counter-reset: dot; - display: flex; - justify-content: center; - align-items: center; - flex-wrap: wrap; -`]))),rw,x0=ys.button(rw||(rw=Os([` - counter-increment: dot; - width: 8px; - height: 8px; - border: `,`; - - border-radius: 100%; - padding: 0; - display: block; - margin: 4px; - transition: opacity 0.3s, transform 0.3s; - cursor: `,`; - transform: scale(`,`); - - color: `,`; - background: `,`; - - color: `,`; - background: `,`; - - &:before { - content: counter(dot); - position: absolute; - bottom: calc(100% + 0.25em); - left: 50%; - opacity: 0; - transform: translate(-50%, 1em); - transition: 0.3s; - display: `,`; - } - - &:hover { - background-color: currentColor; - - &:before { - opacity: 0.5; - transform: translate(-50%, -2px); - } - } -`])),function(a){return a.current===a.index?"0":"1px solid #caccce"},function(a){return a.disabled?"not-allowed":"pointer"},function(a){return a.current===a.index?1.25:1},function(a){return a.current===a.index?"var(--reactour-accent)":"#caccce"},function(a){return a.current===a.index?"var(--reactour-accent)":"none"},function(a){return a.current===a.index?a.accentColor:"#caccce"},function(a){return a.current===a.index?a.accentColor:"none"},function(a){return a.showNumber?"block":"none"}),aw,D0=ys.div(aw||(aw=Os([` - opacity: `,`; - color: `,`; - width: 100%; - left: 0; - top: 0; - height: 100%; - position: fixed; - z-index: 99999; - pointer-events: none; -`])),function(a){return!a.maskClassName&&.7},function(a){return!a.maskClassName&&"#000"});function $T(a){var s=a.windowWidth,i=a.windowHeight,r=a.targetWidth,l=a.targetHeight,u=a.targetTop,d=a.targetLeft,p=a.padding,m=a.rounded,f=a.roundedStep,v=a.disableInteraction,_=a.disableInteractionClassName,y=a.className,k=a.onClick,C=a.highlightedBorder,w=Ys(r+p*2),E=Ys(l+p*2),R=Ys(u-p),D=Ys(d-p),A=f?Math.min(w/2,E/2):m;return Y.createElement(D0,{onClick:k,maskClassName:y},Y.createElement("svg",{width:s,height:i,xmlns:"http://www.w3.org/2000/svg",className:y},Y.createElement("defs",null,Y.createElement("mask",{id:"mask-main"},Y.createElement("rect",{x:0,y:0,width:s,height:i,fill:"white"}),Y.createElement("rect",{x:D,y:R,width:w,height:E,fill:"black"}),Y.createElement("rect",{x:D-1,y:R-1,width:A,height:A,fill:"white"}),Y.createElement("circle",{cx:D+A,cy:R+A,r:A,fill:"black"}),Y.createElement("rect",{x:D+w-A+1,y:R-1,width:A,height:A,fill:"white"}),Y.createElement("circle",{cx:D+w-A,cy:R+A,r:A,fill:"black"}),Y.createElement("rect",{x:D-1,y:R+E-A+1,width:A,height:A,fill:"white"}),Y.createElement("circle",{cx:D+A,cy:R+E-A,r:A,fill:"black"}),Y.createElement("rect",{x:D+w-A+1,y:R+E-A+1,width:A,height:A,fill:"white"}),Y.createElement("circle",{cx:D+w-A,cy:R+E-A,r:A,fill:"black "})),Y.createElement("clipPath",{id:"clip-path"},Y.createElement("rect",{x:0,y:0,width:s,height:R}),Y.createElement("rect",{x:0,y:R,width:D,height:E}),Y.createElement("rect",{x:d+r+p,y:R,width:Ys(s-r-D),height:E}),Y.createElement("rect",{x:0,y:u+l+p,width:s,height:Ys(i-l-R)}))),Y.createElement("rect",{x:0,y:0,width:s,height:i,fill:"currentColor",mask:"url(#mask-main)"}),Y.createElement("rect",{x:0,y:0,width:s,height:i,fill:"currentColor",clipPath:"url(#clip-path)",pointerEvents:"auto"}),Y.createElement("rect",{x:D,y:R,width:w,height:E,pointerEvents:"auto",fill:"transparent",display:v?"block":"none",className:_}),C&&Y.createElement("rect",{x:Ys(D+C.width/2),y:Ys(R+C.width/2),width:Ys(w-C.width),height:Ys(E-C.width),pointerEvents:"auto",fill:"none",strokeWidth:C.width,stroke:C.color,rx:A-2})))}$T.propTypes={windowWidth:Z.number.isRequired,windowHeight:Z.number.isRequired,targetWidth:Z.number.isRequired,targetHeight:Z.number.isRequired,targetTop:Z.number.isRequired,targetLeft:Z.number.isRequired,padding:Z.number.isRequired,rounded:Z.number.isRequired,roundedStep:Z.bool,disableInteraction:Z.bool.isRequired,disableInteractionClassName:Z.string.isRequired,highlightedBorder:Z.shape({color:Z.string.isRequired,width:Z.number.isRequired})};var A0=(function(a){var s=a.step,i=a.refresh,r=vt(0),l=f0(r,2),u=l[0],d=l[1];return Mt(function(){if(s.resizeObservables){var p=function(y){var k=In(y),C;try{var w=function(){var R=C.value;if(!R.attributes)return 1;var D=s.resizeObservables.find(function(A){return R.matches(A)||R.querySelector(A)!=null});D&&d(u+1)};for(k.s();!(C=k.n()).done;)w()}catch(E){k.e(E)}finally{k.f()}},m=new MutationObserver(function(_){var y=In(_),k;try{for(y.s();!(k=y.n()).done;){var C=k.value;C.addedNodes.length!==0&&p(C.addedNodes),C.removedNodes.length!==0&&p(C.removedNodes)}}catch(w){y.e(w)}finally{y.f()}}),f=document.documentElement||document.body,v={childList:!0,subtree:!0};return m.observe(f,v),function(){m.disconnect()}}},[s,u]),Mt(function(){if(s.resizeObservables){var p=new ResizeObserver(function(y){i()}),m=In(s.resizeObservables),f;try{for(m.s();!(f=m.n()).done;){var v=f.value,_=document.querySelector(v);_&&p.observe(_)}}catch(y){m.e(y)}finally{m.f()}return function(){p.disconnect()}}},[s,u]),null}),R0=(function(a){var s=a.step,i=a.refresh;return Mt(function(){if(s.mutationObservables){var r=function(m){var f=In(m),v;try{var _=function(){var k=v.value;if(!k.attributes)return 1;var C=s.mutationObservables.find(function(w){return k.matches(w)||k.querySelector(w)!=null});C&&i()};for(f.s();!(v=f.n()).done;)_()}catch(y){f.e(y)}finally{f.f()}},l=new MutationObserver(function(p){var m=In(p),f;try{for(m.s();!(f=m.n()).done;){var v=f.value;v.addedNodes.length!==0&&r(v.addedNodes),v.removedNodes.length!==0&&r(v.removedNodes)}}catch(_){m.e(_)}finally{m.f()}}),u=document.documentElement||document.body,d={childList:!0,subtree:!0};return l.observe(u,d),function(){l.disconnect()}}},[s]),null});function O0(a){var s=a.children,i=Bo(null);return i.current===null&&(i.current=document.createElement("div"),i.current.setAttribute("id","___reactour")),Mt(function(){return document.body.appendChild(i.current),function(){document.body.removeChild(i.current)}},[i]),DS(s,i.current)}var M0={disableFocusLock:Z.bool,badgeContent:Z.func,highlightedMaskClassName:Z.string,children:Z.oneOfType([Z.node,Z.element]),className:Z.string,closeButtonAriaLabel:Z.string,closeWithMask:Z.bool,inViewThreshold:Z.number,isOpen:Z.bool.isRequired,lastStepNextButton:Z.node,maskClassName:Z.string,maskSpace:Z.number,nextButton:Z.node,onAfterOpen:Z.func,onBeforeClose:Z.func,onRequestClose:Z.func,prevButton:Z.node,scrollDuration:Z.number,scrollOffset:Z.number,showButtons:Z.bool,showCloseButton:Z.bool,showNavigation:Z.bool,showNavigationNumber:Z.bool,showNumber:Z.bool,startAt:Z.number,goToStep:Z.number,getCurrentStep:Z.func,nextStep:Z.func,prevStep:Z.func,steps:Z.arrayOf(Z.shape({selector:Z.string,content:Z.oneOfType([Z.node,Z.element,Z.func]).isRequired,position:Z.oneOfType([Z.arrayOf(Z.number),Z.oneOf(["top","right","bottom","left","center"])]),action:Z.func,style:Z.object,stepInteraction:Z.bool,navDotAriaLabel:Z.string,roundedStep:Z.bool})),update:Z.string,updateDelay:Z.number,disableInteraction:Z.bool,disableDotsNavigation:Z.bool,disableKeyboardNavigation:Z.oneOfType([Z.arrayOf(Z.oneOf(["esc","right","left"])),Z.bool]),rounded:Z.number,accentColor:Z.string,highlightedBorder:Z.shape({color:Z.string.isRequired,width:Z.number.isRequired})},N0={disableFocusLock:!1,showNavigation:!0,showNavigationNumber:!0,showButtons:!0,showCloseButton:!0,closeButtonAriaLabel:"Close",showNumber:!0,scrollDuration:1,maskSpace:10,updateDelay:1,disableInteraction:!1,rounded:0,accentColor:"#007aff",closeWithMask:!0},bn={mask:{disableInteraction:"reactour__mask--disable-interaction"},helper:{base:"reactour__helper",isOpen:"reactour__helper--is-open"},dot:{base:"reactour__dot",active:"reactour__dot--is-active"}},Bm=(function(a){function s(){var i;return c0(this,s),i=l0(this,s),fs(i,"unlockFocus",function(r){i.setState({focusUnlocked:!0},r())}),fs(i,"showStep",function(){if(!(!i.helper||!i.helper.current)){var r=i.props.steps,l=i.state,u=l.current,d=l.focusUnlocked;d&&i.setState({focusUnlocked:!1});var p=r[u],m=p.selector?document.querySelector(p.selector):null,f=function(C){p.action&&typeof p.action=="function"&&i.unlockFocus(function(){return p.action(C)})};if(p.observe){var v=document.querySelector(p.observe),_={attributes:!0,childList:!0,characterData:!0};i.setState(function(k){return k.observer&&setTimeout(function(){k.observer.disconnect()},0),{observer:new MutationObserver(function(C){C.forEach(function(w){if(w.type==="childList"&&w.addedNodes.length>0){var E=function(){return f(w.addedNodes[0])};setTimeout(function(){return i.calculateNode(w.addedNodes[0],p,E)},100)}else if(w.type==="childList"&&w.removedNodes.length>0){var R=function(){return f(m)};i.calculateNode(m,p,R)}})})}},function(){return i.state.observer.observe(v,_)})}else i.state.observer&&(i.state.observer.disconnect(),i.setState({observer:null}));if(m){var y=function(){return f(m)};i.calculateNode(m,p,y)}else i.setState(hg(null,p,i.helper.current),f),p.selector&&console.warn("Doesn't find a DOM node '".concat(p.selector,"'. Please check the 'steps' Tour prop Array at position ").concat(u,"."))}}),fs(i,"calculateNode",function(r,l,u){var d=i.props,p=d.scrollDuration,m=d.inViewThreshold,f=d.scrollOffset,v=fT(r,l),_=Math.max(document.documentElement.clientWidth,window.innerWidth||0),y=Math.max(document.documentElement.clientHeight,window.innerHeight||0);if(_0(Ec(Ec({},v),{},{w:_,h:y,threshold:m})))i.setState(hg(r,l,i.helper.current),u);else{var k=Kx(r),C=f||(v.height>y?-25:-(y/2)+v.height/2);Wx.to(r,{context:w0(k)?window:k,duration:p,offset:C,callback:function(E){i.setState(hg(E,l,i.helper.current),u)}})}}),fs(i,"recalculateNode",function(r){var l=document.querySelector(r.selector),u=function(p){r.action&&typeof r.action=="function"&&i.unlockFocus(function(){return r.action(p)})};i.calculateNode(l,r,function(){return u(l)})}),fs(i,"maskClickHandler",function(r){var l=i.props,u=l.closeWithMask,d=l.onRequestClose;u&&!r.target.classList.contains(bn.mask.disableInteraction)&&d(r)}),fs(i,"nextStep",function(){var r=i.props,l=r.steps,u=r.getCurrentStep;i.setState(function(d){var p=d.current0?l.current-1:l.current;return typeof r=="function"&&r(u),{current:u}},i.showStep)}),fs(i,"gotoStep",function(r){var l=i.props,u=l.steps,d=l.getCurrentStep;i.setState(function(p){var m=u[r]?r:p.current;return typeof d=="function"&&d(m),{current:m}},i.showStep)}),fs(i,"keyDownHandler",function(r){var l=i.props,u=l.onRequestClose,d=l.nextStep,p=l.prevStep,m=l.disableKeyboardNavigation;if(r.stopPropagation(),m!==!0){var f,v,_;m&&(f=m.includes("esc"),v=m.includes("right"),_=m.includes("left")),r.keyCode===27&&!f&&(r.preventDefault(),u()),r.keyCode===39&&!v&&(r.preventDefault(),typeof d=="function"?d():i.nextStep()),r.keyCode===37&&!_&&(r.preventDefault(),typeof p=="function"?p():i.prevStep())}}),i.state={isOpen:!1,current:0,top:0,right:0,bottom:0,left:0,width:0,height:0,w:0,h:0,inDOM:!1,observer:null,focusUnlocked:!1},i.helper=Rk(),i.helperElement=null,i.debouncedShowStep=hD(i.showStep,70),i}return h0(s,a),d0(s,[{key:"componentDidMount",value:function(){var r=this.props,l=r.isOpen,u=r.startAt;l&&this.open(u)}},{key:"UNSAFE_componentWillReceiveProps",value:function(r){var l=this.props,u=l.isOpen,d=l.update,p=l.updateDelay;!u&&r.isOpen?this.open(r.startAt):u&&!r.isOpen&&this.close(),u&&d!==r.update&&(r.steps[this.state.current]?setTimeout(this.showStep,p):this.props.onRequestClose()),u&&r.isOpen&&this.state.current!==r.goToStep&&this.gotoStep(r.goToStep)}},{key:"componentWillUnmount",value:function(){var r=this.props.isOpen;r&&this.close(),this.state.observer&&this.state.observer.disconnect()}},{key:"open",value:function(r){var l=this,u=this.props.onAfterOpen;this.setState(function(d){return{isOpen:!0,current:r!==void 0?r:d.current}},function(){setTimeout(l.showStep,1),l.helperElement=l.helper.current,l.props.disableFocusLock||l.helper.current.focus(),u&&u(l.helperElement)}),window.addEventListener("resize",this.debouncedShowStep,!1),window.addEventListener("keydown",this.keyDownHandler,!1)}},{key:"close",value:function(){this.setState(function(r){return r.observer&&r.observer.disconnect(),{isOpen:!1,observer:null}},this.onBeforeClose),window.removeEventListener("resize",this.debouncedShowStep),window.removeEventListener("keydown",this.keyDownHandler)}},{key:"onBeforeClose",value:function(){var r=this.props.onBeforeClose;r&&r(this.helperElement)}},{key:"render",value:function(){var r=this,l=this.props,u=l.className,d=l.steps,p=l.maskClassName,m=l.showButtons,f=l.showCloseButton,v=l.closeButtonAriaLabel,_=l.showNavigation,y=l.showNavigationNumber,k=l.showNumber,C=l.onRequestClose,w=l.maskSpace,E=l.lastStepNextButton,R=l.nextButton,D=l.prevButton,A=l.badgeContent,J=l.highlightedMaskClassName,ie=l.disableInteraction,se=l.disableDotsNavigation,me=l.nextStep,z=l.prevStep,Oe=l.rounded,Ne=l.accentColor,Ze=l.CustomHelper,ae=l.disableFocusLock,ce=l.highlightedBorder,K=this.state,ye=K.isOpen,he=K.current,je=K.inDOM,V=K.top,tt=K.right,q=K.bottom,ee=K.left,B=K.width,H=K.height,U=K.w,re=K.h,I=K.helperWidth,de=K.helperHeight,W=K.helperPosition;return ye?Y.createElement(O0,null,Y.createElement(b0,null),Y.createElement(A0,{step:d[he],refresh:function(){return r.recalculateNode(d[he])}}),Y.createElement(R0,{step:d[he],refresh:function(){return r.recalculateNode(d[he])}}),Y.createElement($T,{onClick:this.maskClickHandler,forwardRef:function(be){return r.mask=be},windowWidth:U,windowHeight:re,targetWidth:B,targetHeight:H,targetTop:V,targetLeft:ee,padding:w,rounded:Oe,roundedStep:d[he].roundedStep,className:p,disableInteraction:d[he].stepInteraction===!1||ie?!d[he].stepInteraction:ie,disableInteractionClassName:"".concat(bn.mask.disableInteraction," ").concat(J),highlightedBorder:ce}),Y.createElement(KC,{disabled:ae,autoFocus:!1},Y.createElement(k0,{ref:this.helper,targetHeight:H,targetWidth:B,targetTop:V,targetRight:tt,targetBottom:q,targetLeft:ee,windowWidth:U,windowHeight:re,helperWidth:I,helperHeight:de,helperPosition:W,padding:w,tabIndex:-1,current:he,style:d[he].style?d[he].style:{},rounded:Oe,className:D_(bn.helper.base,u,fs({},bn.helper.isOpen,ye)),accentColor:Ne,defaultStyles:!Ze,role:"dialog"},Ze?Y.createElement(Ze,{current:he,totalSteps:d.length,gotoStep:this.gotoStep,close:C,content:d[he]&&(typeof d[he].content=="function"?d[he].content({close:C,goTo:this.gotoStep,inDOM:je,step:he+1}):d[he].content)},this.props.children):Y.createElement(Y.Fragment,null,this.props.children,d[he]&&(typeof d[he].content=="function"?d[he].content({close:C,goTo:this.gotoStep,inDOM:je,step:he+1}):d[he].content),k&&Y.createElement(S0,{"data-tour-elem":"badge",accentColor:Ne},typeof A=="function"?A(he+1,d.length):he+1),(m||_)&&Y.createElement(E0,{"data-tour-elem":"controls"},m&&Y.createElement(ew,{onClick:typeof z=="function"?z:this.prevStep,disabled:he===0,label:D||null}),_&&Y.createElement(I0,{"data-tour-elem":"navigation"},d.map(function(Ce,be){return Y.createElement(x0,{key:"".concat(Ce.selector?Ce.selector:"undef","_").concat(be),onClick:function(){return r.gotoStep(be)},current:he,index:be,accentColor:Ne,disabled:he===be||se,showNumber:y,"data-tour-elem":"dot",className:D_(bn.dot.base,fs({},bn.dot.active,he===be)),"aria-label":Ce.navDotAriaLabel})})),m&&Y.createElement(ew,{onClick:he===d.length-1?E?C:function(){}:typeof me=="function"?me:this.nextStep,disabled:!E&&he===d.length-1,inverted:!0,label:E&&he===d.length-1?E:R||null})),f&&Y.createElement(y0,{onClick:C,className:"reactour__close",ariaLabel:v}))))):null}}])})(Ew),hg=function(s,i,r){if(r){var l=Math.max(document.documentElement.clientWidth,window.innerWidth||0),u=Math.max(document.documentElement.clientHeight,window.innerHeight||0),d=$c(r),p=d.width,m=d.height,f={top:u+10,right:l/2+9,bottom:u/2+9,left:l/2-p/2,width:0,height:0,w:l,h:u,helperPosition:"center"};return s&&(f=fT(s,i)),function(){return Ec(Ec({w:l,h:u,helperWidth:p,helperHeight:m,helperPosition:i.position},f),{},{inDOM:!!s})}}};Bm.propTypes=M0;Bm.defaultProps=N0;const L0=""+new URL("blockly2js-B3Jxf2e-.svg",import.meta.url).href,P0=""+new URL("rules2js-DnYyR8mI.svg",import.meta.url).href,As={selectTriggers:0,addScheduleByDoubleClick:1,openTagsMenu:2,selectIntervalTag:3,selectActions:4,addActionPrintText:5,showJavascript:6,switchBackToRules:7,saveTheScript:8},B0=[{selector:".blocks-triggers",content:"Select triggers"},{selector:".block-TriggerScheduleBlock",content:"Double click to add the block"},{selector:".tag-card",content:"Open drop down menu"},{selector:".tag-card-interval",content:"Select interval"},{selector:".blocks-actions",content:"Select action blocks"},{selector:".block-ActionPrintText",content:"Double click to add the block"},{selector:".button-js-code",content:"Check the script"},{selector:".button-js-code",content:"Switch back to rules"},{selector:".button-save",content:"Save the script"}],pg=187,nc={root:{left:0,top:0,width:"100%",height:"100%",position:"fixed",background:"rgba(0, 0, 0, .3)",zIndex:2e4},connecting:{left:"40%",top:"40%",width:"20%",height:"20%",position:"absolute"},spinner:{animation:"admin-connecting-rotator 1.4s linear infinite"},path:{strokeDasharray:187,strokeDashoffset:0,transformOrigin:"center",animation:"admin-connecting-dash 1.4s ease-in-out infinite, $colors 5.6s ease-in-out infinite"}};function vn(){return g.jsxs("div",{style:nc.root,children:[g.jsx("style",{children:` -' @keyframes admin-connecting-colors { - 0% { - stroke: #4285F4; - } - 25% { - stroke: #DE3E35; - } - 50% { - stroke: #F7C223; - } - 75% { - stroke: #1B9A59; - } - 100% { - stroke: #4285F4; - } - } - @keyframes admin-connecting-dash { - 0% { - stroke-dashoffset: ${pg}; - } - 50% { - stroke-dashoffset: ${pg/4}; - transform: rotate(135deg); - } - 100% { - stroke-dashoffset: ${pg}; - transform: 'rotate(450deg); - } - } - @keyframes admin-connecting-rotator { - 0% { - transform: rotate(0deg); - } - 100% { - transform: rotate(270deg); - } - } -`}),g.jsx("div",{style:nc.connecting,children:g.jsx("svg",{style:nc.spinner,width:"100%",height:"100%",viewBox:"0 0 66 66",xmlns:"http://www.w3.org/2000/svg",children:g.jsx("circle",{style:nc.path,fill:"none",strokeWidth:"6",strokeLinecap:"round",cx:"33",cy:"33",r:"30"})})})]})}const j0=Y.lazy(()=>On(()=>Promise.resolve().then(()=>fR),void 0,import.meta.url)),F0=Y.lazy(()=>On(()=>import("./index-CH_9mIwq.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url)),z0=Y.lazy(()=>On(()=>import("./index-CTvnL3j4.js"),__vite__mapDeps([14,1,2,3,4,6,7,5,15,8,9,10,11,12]),import.meta.url)),U0=Y.lazy(()=>On(()=>import("./ScriptEditorVanillaMonaco-DSYvOslZ.js"),__vite__mapDeps([15,1,2,3,4,6,7,5]),import.meta.url)),H0=Y.lazy(()=>On(()=>import("./ScriptEditor-C-fO5h68.js"),__vite__mapDeps([16,1,2,3,4,6,5,15,7,17]),import.meta.url)),W0=Y.lazy(()=>On(()=>import("./OpenAiDialog-Bm9Brfi_.js"),__vite__mapDeps([18,1,2,3,4,6,5,9,19,15,7,8,10,11,12]),import.meta.url)),lw={Blockly:hC,"Javascript/js":_c,Rules:gC,def:_c,"TypeScript/ts":pC},G0=48,cw="#02a102",gg="#70aae9",V0=Cw[400],K0=Tw[400],Te={toolbar:a=>({minHeight:38,boxShadow:"0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12)",backgroundColor:a.palette.mode==="dark"?"#1e1e1e":"#E2E2E2"}),toolbarButtons:{padding:4,marginLeft:4},toolbarButtonsDisabled:{filter:"grayscale(100%)",opacity:.5},editorDiv:a=>({height:`calc(100% - ${(parseInt(a.toolbar.height,10)||48)+38+10}px)`,width:"100%",overflow:"hidden",position:"relative"}),textButton:{marginRight:10,minHeight:24,padding:"6px 16px",height:32},saveButton:{background:"#ff9900"},tabIcon:{width:24,height:24,verticalAlign:"middle",marginBottom:2,marginRight:2,borderRadius:3},hintIcon:{padding:"0 8px 0 8px"},hintButton:{marginTop:8,marginLeft:20},tabMenuButton:{position:"absolute",top:0,right:0},tabChanged:a=>({color:a.palette.secondary.main}),tabText:{maxWidth:130,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",display:"inline-block",verticalAlign:"middle"},tabChangedIcon:{color:"#FF0000",fontSize:16,marginLeft:5},closeButton:{marginLeft:5},notRunning:{color:"#ffbc00",marginRight:8,marginLeft:8},tabButton:{minHeight:48},tabButtonWrapper:{display:"inline-block"},menuIcon:{width:18,height:18,borderRadius:2,marginRight:5}};class kn extends Y.Component{getSelect=null;changedMirror={};cron={initValue:null,callback:null};scriptDialog={initValue:null,callback:null,args:null,isReturn:!1};objects;scripts;selectId={initValue:null,callback:null};confirmCallback=null;constructor(s){var u,d;super(s);let i=window.localStorage.getItem("Editor.selected")||"";const r=window.localStorage.getItem("Editor.editing")||"[]";let l;try{l=JSON.parse(r)}catch{l=[]}i&&!l.includes(i)&&l.push(i),i&&!this.props.password&&((d=(u=this.props.objects[i])==null?void 0:u.native)!=null&&d.protected)&&(i=l.find(p=>{var m,f;return!((f=(m=this.props.objects[p])==null?void 0:m.native)!=null&&f.protected)})||""),!i&&l.length&&(this.props.password?i=l[0]:i=l.find(p=>{var m,f;return!((f=(m=this.props.objects[p])==null?void 0:m.native)!=null&&f.protected)})||""),this.state={askAboutDebug:!1,astroEvents:null,blockly:null,changed:{},cmdToBlockly:"",cmdToRules:"",confirm:"",debugEnabled:!1,editing:l,insert:"",instancesLoaded:!1,isTourOpen:window.localStorage.getItem("tour")!=="true",menuDebugAnchorEl:null,menuOpened:!!this.props.menuOpened,menuTabsOpened:!1,openAiDialog:!1,triggerPrettier:1,rules:null,runningInstances:this.props.runningInstances||{},searchText:"",selected:i,showAdapterDebug:!1,showAstro:!1,showCompiledCode:!1,showCron:!1,showDebugMenu:!1,showScript:!1,showSelectId:!1,themeType:this.props.themeType,toast:"",tourStep:As.selectTriggers,verboseEnabled:!1,visible:s.visible},this.setChangedInAdmin(),window.systemLang=b.I18n.getLanguage(),window.main={objects:{},getObject:(p,m)=>this.props.socket.getObject(p).then(f=>m==null?void 0:m(null,f)).catch(f=>m==null?void 0:m(f)),instances:[],selectIdDialog:(p,m,f)=>{typeof m=="function"&&(f=m,m=null),this.selectId.callback=f,this.selectId.initValue=p,this.selectId.type=m,this.setState({showSelectId:!0})},cronDialog:(p,m)=>{this.cron.callback=m,this.cron.initValue=p,this.setState({showCron:!0})},showScriptDialog:(p,m,f,v)=>{this.scriptDialog.callback=v,this.scriptDialog.initValue=p,this.scriptDialog.args=m,this.scriptDialog.isReturn=f||!1,this.setState({showScript:!0})}},this.objects=s.objects,this.scripts={},this.getAllAdapterInstances().then(()=>{this.props.onSelectedChange&&this.state.selected&&setTimeout(()=>this.props.onSelectedChange(this.state.selected,this.state.editing),100)})}async getAllAdapterInstances(){const s=await this.props.socket.getAdapterInstances(!0),i={},r=s.map(l=>(i[l._id]=l,l._id));window.main.objects=i,window.main.instances=r,this.setState({instancesLoaded:!0})}static onInstanceChanged(s,i){if(s)if(!i&&window.main.instances.includes(s)){delete window.main.objects[s];const r=window.main.instances.indexOf(s);window.main.instances.splice(r,1)}else(i==null?void 0:i.type)==="instance"&&(window.main.instances.includes(s)||(window.main.instances.push(s),window.main.instances.sort()),window.main.objects[s]=i)}setChangedInAdmin(){const s=Object.keys(this.state.changed).find(i=>this.state.changed[i]);Object.keys(this.state.changed).forEach(i=>{this.changedMirror[i]=this.state.changed[i]}),Object.keys(this.changedMirror).forEach(i=>{this.state.changed[i]===void 0&&delete this.changedMirror[i]}),this.props.onChangedChanged(this.changedMirror),typeof window.parent<"u"&&window.parent&&(window.parent.configNotSaved=!!s)}componentDidMount(){window.addEventListener("beforeunload",this.onBrowserClose,!1),this.props.socket.subscribeObject("system.adapter.*",kn.onInstanceChanged)}componentWillUnmount(){window.removeEventListener("beforeunload",this.onBrowserClose),this.props.socket.unsubscribeObject("system.adapter.*",kn.onInstanceChanged)}onBrowserClose=s=>{const i=Object.keys(this.scripts).find(r=>JSON.stringify(this.scripts[r])!==JSON.stringify(this.getScriptFromObject(r)));if(i){console.log(`Script ${JSON.stringify(this.scripts[i])}`);const r=b.I18n.t("Configuration not saved.");return s=s||window.event,s&&(s.returnValue=r),r}};removeNonExistingScripts(s,i){s=s||this.props,i=i||{};let r=!1;if(this.state.editing&&this.state.editing.find(u=>s&&!s.objects[u])){const u=[...this.state.editing];for(let d=u.length-1;d>=0;d--)this.objects[u[d]]||(r=!0,u.splice(d,1));r&&(i.editing=u),this.state.selected&&!this.objects[this.state.selected]&&(r=!0,i.selected=u[0]||"",i.selected&&this.scripts[i.selected]&&(this.state.blockly!==(this.scripts[i.selected].engineType==="Blockly")&&(i.blockly=this.scripts[i.selected].engineType==="Blockly",r=!0),this.state.rules!==(this.scripts[i.selected].engineType==="Rules")&&(i.rules=this.scripts[i.selected].engineType==="Rules",r=!0),this.state.verboseEnabled!==this.scripts[i.selected].verbose&&(i.verboseEnabled=this.scripts[i.selected].verbose,r=!0),this.state.debugEnabled!==this.scripts[i.selected].debug&&(i.debugEnabled=this.scripts[i.selected].debug,r=!0)))}return r}UNSAFE_componentWillReceiveProps(s){var l,u,d;const i={};let r=!1;if(JSON.stringify(s.runningInstances)!==JSON.stringify(this.state.runningInstances)&&(r=!0,i.runningInstances=s.runningInstances),this.state.menuOpened!==s.menuOpened&&(i.menuOpened=s.menuOpened,r=!0),this.state.themeType!==s.themeType&&(i.themeType=s.themeType,r=!0),this.removeNonExistingScripts(s,i)&&(r=!0),this.state.searchText!==s.searchText&&(i.searchText=s.searchText,r=!0),this.objects!==s.objects){this.objects=s.objects,window.main.objects=s.objects,Object.keys(this.scripts).forEach(m=>{const f=this.scripts[m].source;this.scripts[m]=JSON.parse(JSON.stringify(this.objects[m].common)),this.scripts[m].source=f}),this.state.selected&&this.objects[this.state.selected]&&(this.scripts[this.state.selected]||=JSON.parse(JSON.stringify(this.objects[this.state.selected].common)),this.state.blockly!==(this.scripts[this.state.selected].engineType==="Blockly")&&(i.blockly=this.scripts[this.state.selected].engineType==="Blockly",r=!0),this.state.rules!==(this.scripts[this.state.selected].engineType==="Rules")&&(i.rules=this.scripts[this.state.selected].engineType==="Rules",r=!0),this.state.verboseEnabled!==this.scripts[this.state.selected].verbose&&(i.verboseEnabled=this.scripts[this.state.selected].verbose,r=!0),this.state.debugEnabled!==this.scripts[this.state.selected].debug&&(i.debugEnabled=this.scripts[this.state.selected].debug,r=!0));const p=[...this.state.editing];for(let m=p.length-1;m>=0;m--)this.objects[p[m]]||(r=!0,p.splice(m,1),this.state.changed[p[m]]!==void 0&&(i.changed||={...this.state.changed},i.changed&&delete i.changed[p[m]]));this.state.selected&&!this.objects[this.state.selected]&&(i.selected=p[0]||""),r&&(i.editing=p)}else for(const p in this.scripts)if(Object.prototype.hasOwnProperty.call(this.scripts,p)){if((l=this.objects[p])!=null&&l.common){if(this.objects[p].type==="script"){const m=this.scripts[p].source,f=JSON.parse(JSON.stringify(this.scripts[p]));f.source=this.objects[p].common.source,JSON.stringify(f)!==JSON.stringify(this.objects[p].common)&&(this.scripts[p]=JSON.parse(JSON.stringify(this.objects[p].common)),this.scripts[p].source=m),m!==this.objects[p].common.source?this.state.changed[p]?(d=this.objects[p].from)!=null&&d.startsWith("system.adapter.javascript.")&&(this.objects[p].from="system.adapter.admin.0",this.setState({toast:b.I18n.t("Script %s was modified on disk.",p.split(".").pop())})):this.props.password&&((u=this.objects[p].native)!=null&&u.protected)?this.scripts[p].source=Ug(this.props.password,this.objects[p].common.source):this.scripts[p].source=this.objects[p].common.source:this.state.changed[p]&&(i.changed||={...this.state.changed},i.changed&&(i.changed[p]=!1),r=!0)}}else if(this.scripts[p]&&(delete this.scripts[p],this.state.selected===p)){if(this.state.editing.indexOf(p)!==-1){const m=[...this.state.editing],f=m.indexOf(p);f!==-1&&(m.splice(f,1),i.editing=m,r=!0)}i.selected=this.state.editing[0]||"",r=!0}}if(s.selected&&this.state.selected!==s.selected){const p=this.getScriptFromObject(s.selected);this.scripts[s.selected]||=p;const m=p&&JSON.stringify(this.scripts[s.selected])!==JSON.stringify(p),f=[...this.state.editing];s.selected&&!f.includes(s.selected)&&(f.push(s.selected),this.props.onSelectedChange(s.selected,f),window.localStorage.setItem("Editor.editing",JSON.stringify(f))),r=!0,i.changed||={...this.state.changed},i.changed[s.selected]=!!m,i.editing=f,i.selected=s.selected,i.blockly=this.scripts[s.selected].engineType==="Blockly",i.rules=this.scripts[s.selected].engineType==="Rules",i.verboseEnabled=this.scripts[s.selected].verbose,i.debugEnabled=this.scripts[s.selected].debug,i.showCompiledCode=!1}this.state.visible!==s.visible&&(r=!0,i.visible=s.visible),r&&this.setState(i,()=>this.setChangedInAdmin())}onRestart(){var s,i;(i=(s=this.props).onRestart)==null||i.call(s,this.state.selected)}onStartStop(){var i,r,l;const s=JSON.parse(JSON.stringify(this.scripts[this.state.selected]));s.enabled=!s.enabled,this.props.password&&((i=this.props.objects[this.state.selected].native)!=null&&i.protected)&&(s.source=mc(this.props.password,s.source)),(l=(r=this.props).onChange)==null||l.call(r,this.state.selected,s)}onSave(){if(this.state.isTourOpen&&this.state.tourStep===As.saveTheScript&&(this.setState({isTourOpen:!1}),window.localStorage.setItem("tour","true")),this.state.changed[this.state.selected]){const s={...this.state.changed};s[this.state.selected]=!1,this.setState({changed:s},()=>{var r,l,u;this.setChangedInAdmin();const i=JSON.parse(JSON.stringify(this.scripts[this.state.selected]));this.props.password&&((r=this.props.objects[this.state.selected].native)!=null&&r.protected)&&(i.source=mc(this.props.password,i.source)),(u=(l=this.props).onChange)==null||u.call(l,this.state.selected,i)})}}onSaveAll(){const s={...this.state.changed};Object.keys(s).forEach(i=>{var r,l,u;if(s[i]){s[i]=!1;const d=JSON.parse(JSON.stringify(this.scripts[i]));this.props.password&&((r=this.props.objects[i].native)!=null&&r.protected)&&(d.source=mc(this.props.password,d.source)),(u=(l=this.props).onChange)==null||u.call(l,i,d)}}),this.setState({changed:s},()=>this.setChangedInAdmin())}onCancel(){this.scripts[this.state.selected]=this.getScriptFromObject(this.state.selected);const s={...this.state.changed};s[this.state.selected]=!1,this.setState({changed:s},()=>this.setChangedInAdmin())}onRegisterSelect(s){this.getSelect=s}onConvertBlockly2JS(){this.showConfirmDialog(b.I18n.t("It will not be possible to revert this operation."),s=>{if(s){this.scripts[this.state.selected].engineType="Javascript/js";const r=this.scripts[this.state.selected].source.split(` -`);r.pop(),this.scripts[this.state.selected].source=r.join(` -`);const l=this.state.selected,u={...this.state.changed};u[this.state.selected]=!0,this.setState({changed:u,blockly:!1,selected:""},()=>{this.setChangedInAdmin(),setTimeout(()=>this.setState({selected:l}),100)})}})}onChange(s){if(s.script!==void 0){if(s.script===this.scripts[this.state.selected].source)return;this.scripts[this.state.selected].source=s.script}s.debug!==void 0&&(this.scripts[this.state.selected].debug=s.debug),s.verbose!==void 0&&(this.scripts[this.state.selected].verbose=s.verbose);const i=JSON.stringify(this.scripts[this.state.selected])!==JSON.stringify(this.getScriptFromObject(this.state.selected));if(i!==!!this.state.changed[this.state.selected]){const r={...this.state.changed};r[this.state.selected]=i,this.objects[this.state.selected].from="system.adapter.admin.0",this.setState({changed:r},()=>this.setChangedInAdmin())}}onTabChange(s){var r,l;if(this.props.debugMode)return;window.localStorage.setItem("Editor.selected",s);const i=this.scripts[s]||this.getScriptFromObject(s);this.setState({selected:s,rules:i.engineType==="Rules",blockly:i.engineType==="Blockly",showCompiledCode:!1,verboseEnabled:i.verbose,debugEnabled:i.debug}),(l=(r=this.props).onSelectedChange)==null||l.call(r,s,this.state.editing)}isScriptChanged(s){return!!(this.scripts[s]&&this.props.objects[s]&&JSON.stringify(this.scripts[s])!==JSON.stringify(this.getScriptFromObject(s)))}onTabClose(s,i){i==null||i.stopPropagation();const r=this.state.editing.indexOf(s);if(this.state.editing.includes(s))if(this.isScriptChanged(s))this.showConfirmDialog(b.I18n.t("Discard changes for %s",this.props.objects[s].common.name),l=>{l&&(delete this.scripts[s],this.onTabClose(s))});else{const l=[...this.state.editing];l.splice(r,1);const u={editing:l};if(s===this.state.selected?l.length?r===0||l.length===1?u.selected=l[0]:u.selected=l[r-1]:u.selected="":this.state.selected&&!l.length&&(u.selected=""),window.localStorage.setItem("Editor.editing",JSON.stringify(l)),u.selected!==void 0){u.changed||={...this.state.changed},u.changed[u.selected]=this.isScriptChanged(u.selected);const d=u.selected?this.scripts[u.selected]||this.getScriptFromObject(u.selected):void 0;u.blockly=(d==null?void 0:d.engineType)==="Blockly",u.rules=(d==null?void 0:d.engineType)==="Rules",u.verboseEnabled=!!(d!=null&&d.verbose),u.debugEnabled=!!(d!=null&&d.debug),u.showCompiledCode=!1}this.setState(u,()=>{var d,p,m,f;this.setChangedInAdmin(),u.selected!==void 0?((p=(d=this.props).onSelectedChange)==null||p.call(d,u.selected,this.state.editing),window.localStorage.setItem("Editor.selected",u.selected)):(f=(m=this.props).onSelectedChange)==null||f.call(m,this.state.selected,this.state.editing)})}}showConfirmDialog(s,i){this.confirmCallback=i,this.setState({confirm:s})}sendCommandToBlockly(s){this.setState({cmdToBlockly:s},()=>setTimeout(()=>this.setState({cmdToBlockly:""}),200))}sendCommandToRules(s){this.setState({cmdToRules:s},()=>setTimeout(()=>this.setState({cmdToRules:""}),200))}static getText(s){return typeof s=="object"?s[b.I18n.getLanguage()]||s.en:s}getScriptFullName(s){var u;const i=s.split(".");i.shift(),i.shift();const r=[];let l="script.js";for(let d=0;dthis.onTabChange(i),indicatorColor:"primary",style:{position:"relative",marginLeft:10,width:this.state.editing.length>1?"calc(100% - 50px)":"100%",display:"inline-block"},textColor:"primary",variant:"scrollable",scrollButtons:"auto",allowScrollButtonsMobile:!0,children:[this.state.editing.map(s=>{var p,m;if(!this.props.objects[s]){const f=[g.jsx($t,{sx:this.isScriptChanged(s)?Te.tabChanged:void 0,style:Te.tabText,children:s.split(".").pop()},"text"),g.jsx(Me,{onClick:v=>this.onTabClose(s,v),style:Te.closeButton,size:"small",component:"span",children:g.jsx(Ql,{})},"icon")];return g.jsx(Yp,{wrapped:!0,href:`#${s}`,label:f,value:s,sx:{"& .MuiTab-wrapper":Te.tabButtonWrapper}},s)}if(!this.props.password&&((p=this.props.objects[s].native)!=null&&p.protected))return null;let i=kn.getText(this.props.objects[s].common.name)||"";const r=this.getScriptFullName(s);i.length>18&&(i=`${i.substring(0,15)}...`);const l=(m=this.getScriptFromObject(s))==null?void 0:m.source,u=this.scripts[s]&&l!==this.scripts[s].source,d=[g.jsx($t,{sx:this.isScriptChanged(s)?Te.tabChanged:void 0,style:Te.tabText,children:i},"text"),u?g.jsx("span",{style:Te.tabChangedIcon,children:"▣"},"changedSign"):null,!this.props.debugInstance&&(!this.props.debugMode||this.state.selected!==s)&&g.jsx(Me,{onClick:f=>this.onTabClose(s,f),style:Te.closeButton,size:"small",component:"span",children:g.jsx(Ql,{})},"icon")];return g.jsx(Yp,{disabled:!!this.props.debugInstance||this.state.selected!==s&&this.props.debugMode,wrapped:!0,iconPosition:"start",icon:g.jsx("img",{alt:"",src:lw[this.props.objects[s].common.engineType]||lw.def,style:Te.tabIcon},"icon"),href:`#${s}`,label:d,style:Te.tabButton,value:s,title:r,sx:{"& .MuiTab-wrapper":Te.tabButtonWrapper}},s)}),this.props.debugInstance?g.jsx(Yp,{disabled:!1,wrapped:!0,href:`#${this.props.debugInstance.adapter}`,label:this.props.debugInstance.adapter,style:Te.tabButton,value:this.props.debugInstance.adapter,title:this.props.debugInstance.adapter,sx:{"& .MuiTab-wrapper":Te.tabButtonWrapper}},this.props.debugInstance.adapter):""]},"tabs1"),this.state.editing.length>1?g.jsx(Me,{href:"#","aria-label":"Close all but current",style:Te.tabMenuButton,title:b.I18n.t("Close all but current"),"aria-haspopup":"false",onClick:s=>{const i=[this.state.selected];Object.keys(this.scripts).forEach(r=>r!==this.state.selected&&JSON.stringify(this.scripts[r])!==JSON.stringify(this.getScriptFromObject(r))&&i.push(r)),window.localStorage.setItem("Editor.editing",JSON.stringify(i)),this.setState({menuTabsOpened:!1,editing:i})},size:"medium",children:g.jsx(aS,{})},"menuButton"):null]:g.jsx($t,{sx:Te.toolbar,children:g.jsxs(De,{color:"grey",disabled:!0,style:Te.hintButton,href:"",children:[g.jsx("span",{children:b.I18n.t("Click on this icon")},"select2"),g.jsx(lS,{style:Te.hintIcon},"select3"),g.jsx("span",{children:b.I18n.t("for edit or create script")},"select4")]},"select1")},"tabs2")}getDebugMenu(){return this.state.showDebugMenu?g.jsxs(cm,{id:"menu-debug",anchorEl:this.state.menuDebugAnchorEl,open:this.state.showDebugMenu,onClose:()=>this.setState({showDebugMenu:!1,menuDebugAnchorEl:null}),slotProps:{root:{style:{maxHeight:G0*7.5}}},children:[g.jsxs(Ge,{title:b.I18n.t("debug_help"),onClick:s=>{s.stopPropagation(),s.preventDefault(),this.setState({showDebugMenu:!1,menuDebugAnchorEl:null,debugEnabled:!this.state.debugEnabled},()=>this.onChange({debug:this.state.debugEnabled}))},children:[g.jsx(bc,{checked:this.state.debugEnabled}),g.jsx(ec,{style:{...Te.menuIcon,color:cw}}),b.I18n.t("debug_label")]},"debugEnabled"),g.jsxs(Ge,{title:b.I18n.t("verbose_help"),onClick:s=>{s.stopPropagation(),s.preventDefault(),this.setState({showDebugMenu:!1,menuDebugAnchorEl:null,verboseEnabled:!this.state.verboseEnabled},()=>this.onChange({verbose:this.state.verboseEnabled}))},children:[g.jsx(bc,{checked:this.state.verboseEnabled}),g.jsx(s_,{style:{...Te.menuIcon,color:gg}}),b.I18n.t("verbose_label")]},"verboseEnabled")]},"menuDebug"):null}getDebugBadge(){return[this.state.debugEnabled&&this.state.verboseEnabled?g.jsx(ec,{style:{...Te.menuIcon,color:gg}},"DebugVerbose"):null,this.state.debugEnabled&&!this.state.verboseEnabled?g.jsx(ec,{style:{...Te.menuIcon,color:cw}},"DebugNoVerbose"):null,!this.state.debugEnabled&&this.state.verboseEnabled?g.jsx(s_,{style:{...Te.menuIcon,color:gg}},"noDebugVerbose"):null]}getAskAboutDebug(){return this.state.askAboutDebug?g.jsx(b.DialogConfirm,{onClose:()=>{this.setState({askAboutDebug:!1},()=>this.props.onDebugModeChange(!0))},ok:b.I18n.t("Yes"),cancel:b.I18n.t("Cancel"),text:b.I18n.t("The script will be stopped and must be activated manually after debugging. Continue?")}):null}renderOpenAiDialog(){return this.state.openAiDialog?g.jsx(pn,{fallback:g.jsx(vn,{}),children:g.jsx(W0,{adapterName:this.props.adapterName,socket:this.props.socket,runningInstances:this.state.runningInstances,themeType:this.state.themeType,onClose:()=>this.setState({openAiDialog:!1}),language:this.scripts[this.state.selected].engineType==="TypeScript/ts"?"typescript":"javascript",onAddCode:s=>this.setState({insert:s})})}):null}getToolbar(){var r,l;const s=!!(this.state.selected&&((r=this.scripts[this.state.selected])!=null&&r.engine)&&this.state.runningInstances[this.scripts[this.state.selected].engine]),i=!!(this.state.selected&&((l=this.scripts[this.state.selected])!=null&&l.enabled));if(this.state.selected){const u=Object.keys(this.state.changed).filter(p=>this.state.changed[p]).length,d=this.state.changed[this.state.selected];return g.jsxs(Lk,{variant:"dense",sx:Te.toolbar,children:[!this.props.debugInstance&&this.state.menuOpened&&this.props.onLocate&&g.jsx(Me,{style:Te.toolbarButtons,title:b.I18n.t("Locate file"),onClick:()=>this.props.onLocate(this.state.selected),size:"medium",children:g.jsx(cS,{})},"locate"),!this.props.debugInstance&&!d&&s?g.jsx(Me,{disabled:this.props.debugMode,style:Te.toolbarButtons,onClick:()=>this.onRestart(),title:b.I18n.t("Restart"),size:"medium",children:g.jsx(uS,{})},"restart"):null,!this.props.debugInstance&&!d?g.jsx(Me,{disabled:this.props.debugMode,onClick:()=>this.onStartStop(),title:i?b.I18n.t("Pause script"):b.I18n.t("Run script"),size:"medium",style:{...Te.toolbarButtons,color:i?V0:K0},children:i?g.jsx(dS,{}):g.jsx(hS,{})},"start-stop"):null,!this.props.debugInstance&&!d&&!i?g.jsx("span",{style:Te.notRunning,children:b.I18n.t("Script is not running")}):null,!d&&i&&!s?g.jsx("span",{style:Te.notRunning,children:b.I18n.t("Instance is disabled")}):null,d?g.jsx(De,{color:"grey",variant:"contained",style:{...Te.textButton,...Te.saveButton},className:"button-save",onClick:()=>this.onSave(),endIcon:g.jsx(o_,{}),children:b.I18n.t("Save")},"save"):null,u>1||u===1&&!d?g.jsx(De,{color:"grey",variant:"contained",style:Te.textButton,onClick:()=>this.onSaveAll(),endIcon:g.jsx(o_,{}),children:b.I18n.t("Save all")},"saveall"):null,d?g.jsx(De,{color:"grey",variant:"contained",style:Te.textButton,onClick:()=>this.onCancel(),endIcon:g.jsx(Wc,{}),children:b.I18n.t("Cancel")},"cancel"):null,g.jsx("div",{style:{flex:2}}),!this.props.debugInstance&&!this.state.showCompiledCode&&g.jsx(Me,{style:Te.toolbarButtons,title:b.I18n.t("Prettify the script"),onClick:()=>this.setState({triggerPrettier:this.state.triggerPrettier+1}),size:"medium",children:g.jsx(pS,{})},"prettier"),this.state.blockly&&!this.state.showCompiledCode?g.jsx(Me,{"aria-label":"Export Blocks",title:b.I18n.t("Export blocks"),style:Te.toolbarButtons,onClick:()=>this.sendCommandToBlockly("export"),size:"medium",children:g.jsx(vc,{})},"export"):null,this.state.blockly&&!this.state.showCompiledCode&&g.jsx(Me,{"aria-label":"Import Blocks",title:b.I18n.t("Import blocks"),style:Te.toolbarButtons,onClick:()=>this.sendCommandToBlockly("import"),size:"medium",children:g.jsx(Rg,{})},"import"),this.state.blockly&&!this.state.showCompiledCode&&g.jsx(Me,{"aria-label":"Check code",title:b.I18n.t("Check blocks"),style:Te.toolbarButtons,onClick:()=>this.sendCommandToBlockly("check"),size:"medium",children:g.jsx(gS,{})},"check"),!this.props.debugMode&&!this.state.blockly&&!this.state.rules&&!this.state.showCompiledCode?g.jsx(Me,{"aria-label":"create CRON",title:b.I18n.t("Create or edit CRON or time wizard"),style:Te.toolbarButtons,onClick:()=>this.setState({showCron:!0}),size:"medium",children:g.jsx(mS,{})},"select-cron"):null,this.scripts[this.state.selected]&&this.scripts[this.state.selected].engineType!=="Blockly"&&this.scripts[this.state.selected].engineType!=="Rules"?g.jsx(Me,{"aria-label":"AI",title:b.I18n.t("AI code generator"),style:Te.toolbarButtons,size:"medium",onClick:()=>this.setState({openAiDialog:!0}),children:g.jsx(fS,{})},"ai"):null,g.jsx(Me,{"aria-label":"Show astronomical events",title:b.I18n.t("Show astronomical events"),style:Te.toolbarButtons,disabled:!s,onClick:()=>{this.setState({showAstro:!0,astroEvents:null}),this.props.socket.sendTo(this.scripts[this.state.selected].engine.replace("system.adapter.",""),"calcAstroAll",{}).then(p=>this.setState({astroEvents:p}))},size:"medium",children:g.jsx($S,{})},"show-astro"),!this.props.debugMode&&!this.state.blockly&&!this.state.rules&&!this.state.showCompiledCode&&g.jsx(Me,{"aria-label":"select ID",title:b.I18n.t("Insert object ID"),style:Te.toolbarButtons,onClick:()=>this.setState({showSelectId:!0}),size:"medium",children:g.jsx(bS,{})},"select-id"),this.state.blockly&&!this.state.rules&&this.state.showCompiledCode&&g.jsx(De,{color:"grey","aria-label":"convert to javascript",title:b.I18n.t("Convert blockly to javascript for ever."),onClick:()=>this.onConvertBlockly2JS(),children:"Blockly=>JS"},"convert2js"),this.state.rules&&!this.state.showCompiledCode&&g.jsx(Me,{"aria-label":"Export Blocks",title:b.I18n.t("Export blocks"),style:Te.toolbarButtons,onClick:()=>this.sendCommandToRules("export"),size:"medium",children:g.jsx(vc,{})},"export"),this.state.rules&&!this.state.showCompiledCode&&g.jsx(Me,{"aria-label":"Import Blocks",title:b.I18n.t("Import blocks"),style:Te.toolbarButtons,onClick:()=>this.sendCommandToRules("import"),size:"medium",children:g.jsx(Rg,{})},"import"),this.props.expertMode&&!d&&(this.props.debugMode||!this.state.blockly&&!this.state.rules||(this.state.blockly||this.state.rules)&&this.state.showCompiledCode)&&g.jsx(Me,{style:Te.toolbarButtons,color:this.props.debugMode?"primary":"default",disabled:!this.props.debugMode&&!s,onClick:()=>{!this.props.debugMode&&i?this.setState({askAboutDebug:!0}):this.props.onDebugModeChange(!this.props.debugMode)},size:"medium",children:g.jsx(ec,{style:{fontSize:32}})}),(this.state.blockly||this.state.rules)&&g.jsx(De,{"aria-label":"blockly",title:b.I18n.t("Show javascript code"),className:"button-js-code",color:this.state.showCompiledCode?"secondary":"inherit",disabled:this.props.debugMode,style:{...Te.toolbarButtons,...this.props.debugMode?Te.toolbarButtonsDisabled:void 0,padding:"0 5px"},onClick:()=>{this.props.debugMode||(this.setState({showCompiledCode:!this.state.showCompiledCode}),this.state.isTourOpen&&this.state.tourStep===As.showJavascript&&this.setState({tourStep:As.switchBackToRules}),this.state.isTourOpen&&this.state.tourStep===As.switchBackToRules&&this.setState({tourStep:As.saveTheScript}))},children:g.jsx("img",{alt:this.state.blockly?"blockly2js":"rules2js",src:this.state.blockly?L0:P0})},"blockly-code"),g.jsx(Me,{disabled:this.props.debugMode,"aria-label":"Debug menu",title:b.I18n.t("Debug options"),style:Te.toolbarButtons,onClick:p=>this.setState({showDebugMenu:!0,menuDebugAnchorEl:p.currentTarget}),size:"medium",children:g.jsx(Pk,{style:Te.badgeMargin,badgeContent:this.getDebugBadge(),children:g.jsx(vS,{})})},"debug")]},"toolbar1")}return null}getScriptEditor(){return!this.props.debugMode&&this.state.selected&&this.props.objects[this.state.selected]&&this.state.blockly!==null&&(!this.state.blockly||this.state.showCompiledCode)&&(!this.state.rules||this.state.showCompiledCode)?(this.scripts[this.state.selected]||=this.getScriptFromObject(this.state.selected),g.jsx($t,{sx:Te.editorDiv,children:g.jsx(pn,{fallback:g.jsx(vn,{}),children:g.jsx(U0,{name:this.state.selected,adapterName:this.props.adapterName,insert:this.state.insert,onInserted:()=>this.setState({insert:""}),onForceSave:()=>this.onSave(),searchText:this.state.searchText,onRegisterSelect:s=>this.onRegisterSelect(s),readOnly:this.state.showCompiledCode,changed:this.state.changed[this.state.selected],code:this.scripts[this.state.selected].source||"",isDark:this.state.themeType==="dark",socket:this.props.socket,runningInstances:this.state.runningInstances,triggerPrettier:this.state.triggerPrettier,onChange:s=>this.onChange({script:s}),language:this.scripts[this.state.selected].engineType==="TypeScript/ts"?"typescript":"javascript"},"scriptEditor1")})},"scriptEditorDiv")):null}getBlocklyEditor(){return!this.props.debugMode&&this.state.instancesLoaded&&this.state.selected&&this.props.objects[this.state.selected]&&this.state.blockly&&!this.state.showCompiledCode&&this.state.visible?(this.scripts[this.state.selected]||=this.getScriptFromObject(this.state.selected),g.jsx($t,{sx:Te.editorDiv,children:g.jsx(pn,{fallback:g.jsx(vn,{}),children:g.jsx(j0,{command:this.state.cmdToBlockly,themeType:this.state.themeType,searchText:this.state.searchText,code:this.scripts[this.state.selected].source||"",scriptId:this.state.selected,onChange:s=>this.onChange({script:s})},"BlocklyEditor")})},"blocklyEditorDiv")):null}getRulesEditor(){var s,i;if(!this.props.debugMode&&this.state.instancesLoaded&&this.state.selected&&this.props.objects[this.state.selected]&&this.state.rules&&!this.state.showCompiledCode&&this.state.visible){this.scripts[this.state.selected]||=this.getScriptFromObject(this.state.selected);const r=!!this.state.selected&&!!((s=this.scripts[this.state.selected])!=null&&s.engine)&&this.state.runningInstances[this.scripts[this.state.selected].engine],l=!!this.state.selected&&((i=this.scripts[this.state.selected])==null?void 0:i.enabled);return g.jsx($t,{sx:Te.editorDiv,children:g.jsx(pn,{fallback:g.jsx(vn,{}),children:g.jsx(F0,{scriptId:this.state.selected,setTourStep:this.setTourStep,tourStep:this.state.tourStep,isTourOpen:this.state.isTourOpen,changed:this.state.changed[this.state.selected],running:r&&l,command:this.state.cmdToRules,themeType:this.state.themeType,themeName:this.props.themeName,theme:this.props.theme,searchText:this.state.searchText,resizing:this.props.resizing,code:this.scripts[this.state.selected].source||"",onChange:u=>this.onChange({script:u})},"flowEditor")})},"flowEditorDiv")}return null}getConfirmDialog(){return this.state.confirm?g.jsx(b.DialogConfirm,{text:this.state.confirm,onClose:s=>{if(this.confirmCallback){const i=this.confirmCallback;this.confirmCallback=null,i(s)}this.setState({confirm:""})}},"dialogConfirm1"):null}getSelectIdDialog(){var s;if(this.state.showSelectId){const i=["state","channel","device","adapter","instance","enum","host","config","script","user","group"],r=["adapter","instance","enum","host","config","script","user","group"];let l=this.selectId.callback?this.selectId.initValue||"":this.getSelect&&this.getSelect()||"",u=l.indexOf("/*");u!==-1&&(l=l.substring(0,u)),u=l.indexOf("//"),u!==-1&&(l=l.substring(0,u));let d=l.match(/"([^"]+)"/);return d&&(l=d[1]),d=l.match(/'([^']+)'/),d&&(l=d[1]),g.jsx(b.DialogSelectID,{theme:this.props.theme,imagePrefix:"../..",themeName:this.props.themeName,themeType:this.state.themeType,socket:this.props.socket,selected:l,expertMode:this.selectId.type&&this.selectId.type!=="all"&&r.includes(this.selectId.type)?!0:void 0,types:((s=this.selectId)==null?void 0:s.type)==="all"?i:[this.selectId.type||"state"],onClose:()=>{this.setState({showSelectId:!1}),this.selectId.callback&&(this.selectId.callback=null)},onOk:(p,m)=>{this.selectId.initValue=null,this.selectId.callback?(this.selectId.callback(p),this.selectId.callback=null):this.setState({insert:`'${p}'/*${m}*/`})}},"dialogSelectID1")}return null}getCronDialog(){return this.state.showCron?g.jsx(b.DialogCron,{theme:this.props.theme,cron:this.cron.callback?this.cron.initValue||"":this.getSelect?this.getSelect():"* * * * *",onClose:()=>this.setState({showCron:!1}),onOk:s=>{this.cron.initValue=null,this.cron.callback?(this.cron.callback(s),this.cron.callback=null):this.setState({insert:`'${s}'`})}},"dialogCron1"):null}getAstroDialog(){return this.state.showAstro?g.jsxs(Gt,{open:!0,onClose:()=>this.setState({showAstro:!1}),children:[g.jsx(as,{children:b.I18n.t("Astronomical events today")}),g.jsx(Vt,{children:this.state.astroEvents?g.jsx(jk,{component:Dw,children:g.jsxs(Fk,{size:"small",children:[g.jsx(zk,{children:g.jsxs(t_,{children:[g.jsx(gn,{children:b.I18n.t("Name")}),g.jsx(gn,{children:b.I18n.t("Server time")}),g.jsx(gn,{children:b.I18n.t("Description")})]})}),g.jsx(Uk,{children:Object.keys(this.state.astroEvents).map(s=>{var i,r,l,u;return g.jsxs(t_,{children:[g.jsx(gn,{component:"th",scope:"row",children:s.startsWith("next")?"":s}),g.jsx(Hk,{title:`${b.I18n.t("Local time")}: ${(i=this.state.astroEvents)!=null&&i[s].isValidDate?new Date((r=this.state.astroEvents)==null?void 0:r[s].date).toLocaleTimeString():"n/a"}`,children:g.jsx(gn,{align:"right",children:(l=this.state.astroEvents)!=null&&l[s].isValidDate?(u=this.state.astroEvents)==null?void 0:u[s].serverTime:"n/a"})}),g.jsx(gn,{children:b.I18n.t(s)})]},s)})})]})}):g.jsx(Bk,{})}),g.jsx(Kt,{children:g.jsx(De,{variant:"contained",onClick:()=>this.setState({showAstro:!1}),color:"primary",startIcon:g.jsx(Ql,{}),children:b.I18n.t("Close")})})]},"dialogAstro"):null}getEditorDialog(){return this.state.showScript?g.jsx(pn,{fallback:g.jsx(vn,{}),children:g.jsx(H0,{adapterName:this.props.adapterName,source:this.scriptDialog.initValue||"",args:this.scriptDialog.args?this.scriptDialog.args.join(", "):"",isReturn:this.scriptDialog.isReturn,socket:this.props.socket,runningInstances:this.state.runningInstances,themeType:this.state.themeType,onClose:s=>{this.scriptDialog.initValue=null,this.scriptDialog.callback&&(s!==!1&&this.scriptDialog.callback(s||""),this.scriptDialog.callback=null),this.setState({showScript:!1})}},"scriptEditorDialog")}):null}getToast(){return g.jsx(Wk,{anchorOrigin:{vertical:"bottom",horizontal:"left"},open:!!this.state.toast,autoHideDuration:6e3,onClose:()=>this.setState({toast:""}),slotProps:{content:{"aria-describedby":"message-id"}},message:g.jsx("span",{id:"message-id",children:this.state.toast}),action:[g.jsx(Me,{"aria-label":"close",color:"inherit",style:Te.closeToast,onClick:()=>this.setState({toast:""}),size:"medium",children:g.jsx(Ql,{})},"close")]},"toast")}setTourStep=s=>this.setState({tourStep:s});getTour(){return this.state.instancesLoaded&&this.state.selected&&this.props.isAnyRulesExists===1&&this.props.objects[this.state.selected]&&this.state.rules&&this.state.visible?g.jsx(Bm,{steps:B0,isOpen:this.state.isTourOpen,onRequestClose:()=>{this.setState({isTourOpen:!1}),window.localStorage.setItem("tour","true"),this.props.socket.setState("javascript.0.variables.rulesTour",{val:!0,ack:!0})},goToStep:this.state.tourStep},"tour"):null}getDebug(){return this.props.debugMode?this.state.selected&&this.scripts[this.state.selected]&&this.scripts[this.state.selected].engine&&this.state.runningInstances[this.scripts[this.state.selected].engine]?g.jsx(pn,{fallback:g.jsx(vn,{}),children:g.jsx(z0,{runningInstances:this.state.runningInstances,adapterName:this.props.adapterName,socket:this.props.socket,themeName:this.props.themeName,themeType:this.props.themeType,src:this.props.debugInstance?this.props.debugInstance.adapter:this.state.selected,debugInstance:this.props.debugInstance},"debugger")}):(setTimeout(()=>this.props.onDebugModeChange(!1)),null):null}getScriptFromObject(s){var r,l;if(!((r=this.props.objects[s])!=null&&r.common))return;const i=JSON.parse(JSON.stringify(this.props.objects[s].common));return(l=this.props.objects[s].native)!=null&&l.protected&&this.props.password&&(i.source=Ug(this.props.password,i.source)),i}render(){var s,i;return this.state.selected&&this.props.objects[this.state.selected]&&this.state.blockly===null&&this.state.rules===null&&(this.scripts[this.state.selected]||=this.getScriptFromObject(this.state.selected),setTimeout(()=>{const r={blockly:this.scripts[this.state.selected].engineType==="Blockly",rules:this.scripts[this.state.selected].engineType==="Rules",showCompiledCode:!1,debugEnabled:this.scripts[this.state.selected].debug,verboseEnabled:this.scripts[this.state.selected].verbose};this.removeNonExistingScripts(null,r),this.setState(r)},100)),this.state.selected&&!this.props.password&&((i=(s=this.props.objects[this.state.selected])==null?void 0:s.native)!=null&&i.protected)&&setTimeout(()=>{const r=this.state.editing.find(l=>{var u,d;return!((d=(u=this.props.objects[l])==null?void 0:u.native)!=null&&d.protected)})||"";Object.keys(this.scripts).forEach(l=>{var u,d;(d=(u=this.props.objects[l])==null?void 0:u.native)!=null&&d.protected&&delete this.scripts[l]}),this.setState({selected:r},()=>{var l,u;(u=(l=this.props).onSelectedChange)==null||u.call(l,r,this.state.editing),this.state.selected?window.localStorage.setItem("Editor.selected",this.state.selected):window.localStorage.removeItem("Editor.selected")})},50),!this.state.selected&&this.props.password&&this.state.editing.length&&setTimeout(()=>{const r=this.state.editing[0];this.setState({selected:r},()=>{var l,u;(u=(l=this.props).onSelectedChange)==null||u.call(l,r,this.state.editing),window.localStorage.setItem("Editor.selected",this.state.selected)})},50),[this.getTabs(),this.getToolbar(),this.getScriptEditor(),this.getAskAboutDebug(),this.getBlocklyEditor(),this.getRulesEditor(),this.getDebug(),this.getConfirmDialog(),this.getSelectIdDialog(),this.getCronDialog(),this.getEditorDialog(),this.getAstroDialog(),this.getDebugMenu(),this.renderOpenAiDialog(),this.getToast(),this.getTour()]}}const Ht={dialog:{height:"95%"},dropzone:{marginTop:20,width:"100%",borderWidth:5,borderStyle:"dashed",borderColor:"#d0cccc",textAlign:"center",boxSizing:"border-box",paddingTop:45,borderRadius:10,height:"calc(100% - 10px)"},dropzoneDiv:{width:"100%",height:"100%"},dropzoneRejected:{borderColor:"#970000"},dropzoneAccepted:{borderColor:"#17cd02"},icon:{height:"30%",width:"30%",color:"#eeeeee",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",zIndex:0},iconError:{color:"#ffc3c6"},iconOk:{color:"#aaeebc"},text:{top:"50%",left:"50%",transform:"translate(-50%,-50%)",color:"#868686",position:"absolute",zIndex:1}};class jm extends Y.Component{constructor(s){super(s),this.state={error:"",imageStatus:""}}componentDidMount(){setTimeout(()=>{var s;try{(s=window.document.getElementById("import-text-area"))==null||s.focus()}catch{}},100)}handleCancel(){this.props.onClose()}static readFileDataUrl(s,i){const r=new FileReader;r.onload=()=>{i(null,{data:r.result,name:s.name})},r.onabort=()=>{console.error("file reading was aborted"),i(b.I18n.t("file reading was aborted"))},r.onerror=l=>{console.error("file reading has failed"),i(b.I18n.t("file reading has failed: %s",l))},r.readAsDataURL(s)}handleDropFile(s){if(!(s!=null&&s.length))return;const i=s[s.length-1];i&&jm.readFileDataUrl(i,(r,l)=>{var u;r||!l?this.setState({error:r||"No data"}):this.props.onClose(((u=l.data)==null?void 0:u.toString())||"")})}render(){const s={...Ht.dropzone,...this.state.imageStatus==="accepted"?Ht.dropzoneAccepted:this.state.imageStatus==="rejected"?Ht.dropzoneRejected:void 0};return g.jsxs(Gt,{onClose:()=>!1,maxWidth:"lg",sx:{"& .MuiDialog-paper":Ht.dialog},fullWidth:!0,open:!0,"aria-labelledby":"import-dialog-title",PaperProps:{style:{minHeight:"90%",maxHeight:"90%"}},children:[g.jsx(as,{id:"import-dialog-title",children:b.I18n.t("Import scripts")}),g.jsxs(Vt,{children:[g.jsx(Mw,{maxSize:5e7,onDrop:(i,r)=>{var l,u,d;i.length?this.handleDropFile(i):window.alert(((d=(u=(l=r==null?void 0:r[0])==null?void 0:l.errors)==null?void 0:u[0])==null?void 0:d.message)||b.I18n.t("ra_Cannot upload"))},multiple:!1,accept:{"application/zip":[],"application/x-zip-compressed":[]},children:({getRootProps:i,getInputProps:r,isDragActive:l,isDragReject:u})=>u?(this.state.imageStatus!=="rejected"&&this.setState({imageStatus:"rejected"}),g.jsxs("div",{style:{...s,...Ht.dropzoneDiv},...i(),children:[g.jsx("input",{...r()}),g.jsx("span",{style:Ht.text,children:b.I18n.t("Some files will be rejected")},"text"),g.jsx(Wc,{style:{...Ht.icon,...Ht.iconError}},"icon")]})):l?(this.state.imageStatus!=="accepted"&&this.setState({imageStatus:"accepted"}),g.jsxs("div",{style:{...s,...Ht.dropzoneDiv},...i(),children:[g.jsx("input",{...r()}),g.jsx("span",{style:Ht.text,children:b.I18n.t("All files will be accepted")},"text"),g.jsx(Nw,{style:{...Ht.icon,...Ht.iconOk}},"icon")]})):(this.state.imageStatus!=="wait"&&this.setState({imageStatus:"wait"}),g.jsxs("div",{style:{...s,...Ht.dropzoneDiv},...i(),children:[g.jsx("input",{...r()}),g.jsx("span",{style:Ht.text,children:b.I18n.t("Drop some files here or click...")},"text"),g.jsx(Lw,{style:Ht.icon},"icon")]}))},"image-drop"),this.state.error?g.j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i$,qn,ud,dd,Ba,ja,n$,Xn,hd,Zn,r$,a$,wo,pd,Ls,l$,c$,gd,u$,qo,md,d$,h$,p$,g$,m$,fd,f$,$$,Fa,b$,v$,$d,za,bd,Ua,vd,yd,ji,Xo,so,Ps,y$,_$,w$,_d,Ha,C$,T$,k$,wd,Wa,Cd,Ga,S$,E$,I$,x$,ue,Yt,wt,at,Bs,Fi,ne,gt,Td,D$,Co,Va,Ka,kd,A$,Sd,Ya,Ed,Id,R$,xd,O$,Ja,M$,N$,L$,P$,B$,Dd,j$,Qn,er,F$,Ad,Rd,Od,Md,qa,Nd,z$,U$,H$,zi,Ld,W$,Xa,ls,G$,To,Pd,V$,tr,Bd,jd,Fd,zd,Ud,Hd,Wd,Gd,Vd,Kd,K$,Y$,J$,q$,X$,Z$,Za,Q$,eb,Yd,Jd,qd,Xd,Zd,Qd,eh,Qa,sr,th,tb,sh,oh,ih,nh,rh,ah,lh,ch,uh,dh,sb,ob,ib,hh,nb,rb,ab,lb,cb,j;r=function(e,t,o,n){if(!(e instanceof F)&&typeof e!="string"||`${e}`.trim()==="")throw Error('Invalid type "'+e+'". The type must be a non-empty string or a Blockly.registry.Type.');if(e=`${e}`.toLowerCase(),typeof t!="string"||t.trim()==="")throw Error('Invalid name "'+t+'". The name must be a non-empty string.');const c=t.toLowerCase();if(!o)throw Error("Can not register a null value");let h=ko[e],$=el[e];if(h||(h=ko[e]=Object.create(null),$=el[e]=Object.create(null)),l(e,o),!n&&h[c]&&h[c]!==o)throw Error('Name "'+c+'" with type "'+e+'" already registered.');h[c]=o,$[c]=t},l=function(e,t){switch(e){case String(F.FIELD):if(typeof t.fromJson!="function")throw Error('Type "'+e+'" must have a fromJson function')}},u=function(e,t){e=`${e}`.toLowerCase(),t=t.toLowerCase();const o=ko[e];o&&o[t]?(delete ko[e][t],delete el[e][t]):console.warn("Unable to unregister ["+t+"]["+e+"] from the registry.")},d=function(e,t,o){e=`${e}`.toLowerCase(),t=t.toLowerCase();const n=ko[e];if(!n||!n[t]){if(t="Unable to find ["+t+"]["+e+"] in the registry.",o)throw Error(t+" You must require or register a "+e+" plugin.");return console.warn(t),null}return n[t]},p=function(e,t){return e=`${e}`.toLowerCase(),t=t.toLowerCase(),(e=ko[e])?!!e[t]:!1},m=function(e,t,o){return d(e,t,o)},f=function(e,t,o){return d(e,t,o)},v=function(e,t,o){e=`${e}`.toLowerCase();var n=ko[e];if(!n){if(n=`Unable to find [${e}] in the registry.`,o)throw Error(`${n} You must require or register a ${e} plugin.`);return console.warn(n),null}if(!t)return n;e=el[e],o=Object.create(null);for(const c of Object.keys(n))o[e[c]]=n[c];return o},_=function(e,t,o){return t=t.plugins[String(e)]||js,typeof t=="function"?t:m(e,t,o)},y=function(e,t,o,n){e=e+" was deprecated in "+t+" and will be deleted in "+o+".",n&&(e+=` -Use `+n+" instead."),db.has(e)||(db.add(e),console.warn(e))},k=function(){return"blockly-"+(OT++).toString(36)},C=function(){return gb.genUid()},w=function(e){return e.type===O.BLOCK_CREATE},E=function(e){return e.type===O.BLOCK_DELETE},R=function(e){return e.type===O.BLOCK_CHANGE},D=function(e){return e.type===O.BLOCK_FIELD_INTERMEDIATE_CHANGE},A=function(e){return e.type===O.BLOCK_MOVE},J=function(e){return e.type===O.CLICK},ie=function(e){return e.type===O.BUBBLE_OPEN},se=function(e){return e.type===O.VIEWPORT_CHANGE},i.setRecordUndo$$module$build$src$core$events$utils=function(e){or=e},me=function(){return or},z=function(e){fb.fireInternal(e)},Oe=function(e){if(K()){if(!io.length)try{requestAnimationFrame(()=>{setTimeout(Ne,0)})}catch{setTimeout(Ne,0)}Ze(e)}},Ne=function(){const e=ae(io,!0);io.length=0;for(const t of e){if(!t.workspaceId)continue;let o;(o=q(t.workspaceId))==null||o.fireChangeListener(t)}},Ze=function(e){if(R(e)&&e.element==="mutation"){let t;for(t=io.length;0!n.isNull()),t||e.reverse(),e},ce=function(){for(let e=0,t;t=io[e];e++)t.recordUndo=!1},i.disable$$module$build$src$core$events$utils=function(){gh++},i.enable$$module$build$src$core$events$utils=function(){gh--},K=function(){return gh===0},i.getGroup$$module$build$src$core$events$utils=function(){return mb},i.setGroup$$module$build$src$core$events$utils=function(e){fb.setGroupInternal(e)},ye=function(e){mb=typeof e=="boolean"?e?C():"":e},he=function(e){const t=[];e=e.getDescendants(!1);for(let o=0,n;n=e[o];o++)t[o]=n.id;return t},je=function(e,t){const o=V(e.type);if(!o)throw Error("Unknown event type.");return o.fromJson(e,t)},V=function(e){const t=m(F.EVENT,e);if(!t)throw Error(`Event type ${e} not found in registry.`);return t},tt=function(e){if((A(e)||w(e))&&e.workspaceId){var t=q(e.workspaceId);if(!e.blockId)throw Error("Encountered a blockEvent without a proper blockId");if(e=t.getBlockById(e.blockId)){const o=or;try{or=!1;const n=e.getParent();if(n&&!n.hasDisabledReason(mh)){const c=e.getDescendants(!1);for(let h=0,$;$=c[h];h++)$.setDisabledReason(!1,mh)}else if((e.outputConnection||e.previousConnection)&&!t.isDragging())do e.setDisabledReason(!0,mh),e=e.getNextBlock();while(e)}finally{or=o}}}},q=function(e){return ir[e]||null},ee=function(){const e=[];for(const t in ir)e.push(ir[t]);return e},B=function(e){ir[e.id]=e},H=function(e){delete ir[e.id]},U=function(){return $b},re=function(e){$b=e},I=function(){return Zo},i.setSelected$$module$build$src$core$common=function(e){if(Zo!==e){var t,o,n,c,h,$,T=new(V(O.SELECTED))((n=(t=Zo)==null?void 0:t.id)!=null?n:null,(c=e==null?void 0:e.id)!=null?c:null,($=(h=e==null?void 0:e.workspace.id)!=null?h:(o=Zo)==null?void 0:o.workspace.id)!=null?$:"");z(T);var L;(L=Zo)==null||L.unselect(),Zo=e;var te;(te=Zo)==null||te.select()}},de=function(){return bb},W=function(e){bb=e},Ce=function(e){for(;e.options.parentWorkspace;)e=e.options.parentWorkspace;const t=e.getParentSvg(),o=e.getCachedParentSvgSize();var n=t.parentElement;if(n instanceof HTMLElement){var c=n.offsetWidth;n=n.offsetHeight,o.width!==c&&(t.setAttribute("width",c+"px"),e.setCachedParentSvgSize(c,null)),o.height!==n&&(t.setAttribute("height",n+"px"),e.setCachedParentSvgSize(null,n)),e.resize()}},be=function(e,t){const o=Object.create(null),n=e.getDescendants(!0);t&&(e=e.getNextBlock())&&(e=n.indexOf(e),n.splice(e,n.length-e));for(let c=0,h;h=n[c];c++)o[h.type]?o[h.type]++:o[h.type]=1;return o},Se=function(e){return function(){this.jsonInit(e)}},pe=function(e){vb.defineBlocksWithJsonArrayInternal(e)},Ve=function(e){i.defineBlocks$$module$build$src$core$common(i.createBlockDefinitionsFromJsonArray$$module$build$src$core$common(e))},i.createBlockDefinitionsFromJsonArray$$module$build$src$core$common=function(e){const t={};for(let o=0;o>>/g,e),Ch="",e=document.createElement("style"),e.id="blockly-common-style",t=document.createTextNode(t),e.appendChild(t),document.head.insertBefore(e,document.head.firstChild)))},N=function(e,t,o){e=document.createElementNS(rr,`${e}`);for(const n in t)e.setAttribute(n,`${t[n]}`);return o&&o.appendChild(e),e},ge=function(e,t){return t=t.split(" "),t.every(o=>e.classList.contains(o))?!1:(e.classList.add(...t),!0)},la=function(e,t){e.classList.remove(...t.split(" "))},ot=function(e,t){return t=t.split(" "),t.every(o=>!e.classList.contains(o))?!1:(e.classList.remove(...t),!0)},Hm=function(e,t){return e.classList.contains(t)},Ke=function(e){return e&&e.parentNode?e.parentNode.removeChild(e):null},Uo=function(e,t){const o=t.nextSibling;if(t=t.parentNode,!t)throw Error("Reference node has no parent.");o?t.insertBefore(e,o):t.appendChild(e)},ca=function(e,t){e.style.transform=t,e.style["-webkit-transform"]=t},Ho=function(){kh++,Ts||(Ts=Object.create(null))},Wo=function(){kh--,kh||(Ts=null)},uu=function(e){const t=e.textContent+` -`+e.className.baseVal;let o;if(Ts&&(o=Ts[t]))return o;try{o=e.getComputedTextLength()}catch{return 8*e.textContent.length}return Ts&&(Ts[t]=o),o},Nn=function(e,t,o,n){return ua(e,t+"pt",o,n)},ua=function(e,t,o,n){const c=e.textContent;e=c+` -`+e.className.baseVal;var h;return Ts&&(h=Ts[e])||(rl||(h=document.createElement("canvas"),h.className="blocklyComputeCanvas",document.body.appendChild(h),rl=h.getContext("2d")),rl.font=o+" "+t+" "+n,h=c?rl.measureText(c).width:0,Ts&&(Ts[e]=h)),h},da=function(e,t,o,n){const c=document.createElement("span");c.style.font=o+" "+t+" "+n,c.textContent=e,e=document.createElement("div"),e.style.width="1px",e.style.height="0",t=document.createElement("div"),t.style.display="flex",t.style.position="fixed",t.style.top="0",t.style.left="0",t.appendChild(c),t.appendChild(e),document.body.appendChild(t),o={height:0,baseline:0};try{t.style.alignItems="baseline",o.baseline=e.offsetTop-c.offsetTop,t.style.alignItems="flex-end",o.height=e.offsetTop-c.offsetTop}finally{document.body.removeChild(t)}return o},Ln=function(e){return Mb.getSizeInternal(e)},Wm=function(e){if(Ms(e,"display")!=="none")return du(e);const t=e.style,o=t.display,n=t.visibility,c=t.position;t.visibility="hidden",t.position="absolute",t.display="inline";const h=e.offsetWidth;return e=e.offsetHeight,t.display=o,t.position=c,t.visibility=n,new Le(h,e)},du=function(e){return new Le(e.offsetWidth,e.offsetHeight)},Ms=function(e,t){return e=window.getComputedStyle(e),e[t]||e.getPropertyValue(t)},yo=function(e){const t=new G(0,0);e=e.getBoundingClientRect();var o=document.documentElement;return o=new G(window.pageXOffset||o.scrollLeft,window.pageYOffset||o.scrollTop),t.x=e.left+o.x,t.y=e.top+o.y,t},hu=function(){const e=document.body,t=document.documentElement;return new G(e.scrollLeft||t.scrollLeft,e.scrollTop||t.scrollTop)},pu=function(e){const t=parseFloat(Ms(e,"borderLeftWidth")),o=parseFloat(Ms(e,"borderRightWidth")),n=parseFloat(Ms(e,"borderTopWidth"));return e=parseFloat(Ms(e,"borderBottomWidth")),new qe(n,e,t,o)},ha=function(e,t,o){e=gu(e,t,o),t.scrollLeft=e.x,t.scrollTop=e.y},gu=function(e,t,o){var n=yo(e),c=yo(t),h=pu(t);const $=n.x-c.x-h.left;return n=n.y-c.y-h.top,c=du(e),e=t.clientWidth-c.width,c=t.clientHeight-c.height,h=t.scrollLeft,t=t.scrollTop,o?(h+=$-e/2,t+=n-c/2):(h+=Math.min($,Math.max($-e,0)),t+=Math.min(n,Math.max(n-c,0))),new G(h,t)},Pn=function(e){const t=new G(0,0);var o=e.x&&e.getAttribute("x");const n=e.y&&e.getAttribute("y");return o&&(t.x=parseInt(o)),n&&(t.y=parseInt(n)),(o=(o=e.getAttribute("transform"))&&o.match(Nb))&&(t.x+=Number(o[1]),o[3]&&(t.y+=Number(o[3]))),(e=e.getAttribute("style"))&&e.includes("translate")&&(e=e.match(Lb))&&(t.x+=Number(e[1]),e[3]&&(t.y+=Number(e[3]))),t},pa=function(e){let t=0,o=0;for(;e;){const n=Pn(e);if(t+=n.x,o+=n.y,(" "+(e.getAttribute("class")||"")+" ").includes(" injectionDiv "))break;e=e.parentNode}return new G(t,o)},mu=function(){const e=hu();return new qe(e.y,document.documentElement.clientHeight+e.y,e.x,document.documentElement.clientWidth+e.x)},fu=function(){const e=document.documentElement,t=window;return new G(t.pageXOffset||e.scrollLeft,t.pageYOffset||e.scrollTop)},Gm=function(e,t){var o=t.x;t=t.y;const n=e.getInjectionDiv().getBoundingClientRect();return o=new G(o-n.left,t-n.top),t=e.getOriginOffsetInPixels(),G.difference(o,t).scale(1/e.scale)},Vm=function(e,t){var o=t.scale(e.scale);t=o.x,o=o.y;const n=e.getInjectionDiv().getBoundingClientRect();return e=e.getOriginOffsetInPixels(),new G(t+n.left+e.x,o+n.top+e.y)},Km=function(e){({document:ll=ll,DOMParser:ar=ar,XMLSerializer:lr=lr}=e),al=new ar,Sh=new lr},i.createElement$$module$build$src$core$utils$xml=function(e){return ll.createElementNS(Pb,e)},i.createTextNode$$module$build$src$core$utils$xml=function(e){return ll.createTextNode(e)},i.textToDom$$module$build$src$core$utils$xml=function(e){let t=al.parseFromString(e,"text/xml");if(t&&t.documentElement&&!t.getElementsByTagName("parsererror").length)return t.documentElement;if((t=al.parseFromString(e,"text/html"))&&t.body.firstChild&&t.body.firstChild.nodeName.toLowerCase()==="xml")return t.body.firstChild;throw Error(`DOMParser was unable to parse: ${e}`)},Ii=function(e){return Ym(Sh.serializeToString(e))},Ym=function(e){return e.replace(BT,t=>`&#${t.charCodeAt(0)};`)},ga=function(e){return e?((e instanceof Element||typeof e=="string")&&(e=bu(e),e=Xm(e)),Jm(e),e):null},Jm=function(e){const t=e.kind;if(e=e.contents,t&&t!==Bb&&t!==Eh)throw Error("Invalid toolbox kind "+t+". Please supply either "+Bb+" or "+Eh);if(!e)throw Error("Toolbox must have a contents attribute.")},Bn=function(e){return e?e.contents?e.contents:Array.isArray(e)&&0o.kind.toUpperCase()==="CATEGORY").length},fa=function(e){return e&&e.contents?!!e.contents.filter(function(t){return t.kind.toUpperCase()==="CATEGORY"}).length:!1},Xm=function(e){const t={contents:$a(e)};return e instanceof Node&&$u(e,t),t},$a=function(e){const t=[];let o=e.childNodes;o||(o=e);for(let n=0,c;c=o[n];n++){if(!c.tagName)continue;e={};const h=c.tagName.toUpperCase();e.kind=h,h==="BLOCK"?e.blockxml=c:c.childNodes&&0 document.")}else e instanceof Element&&(t=e);return t},ba=function(e,t,o,n,c,h){const $=h.scrollbar&&h.scrollbar.canScrollVertically();return e.horizontal===Wi.LEFT?(o=c.absoluteMetrics.left+o,$&&h.RTL&&(o+=mt.scrollbarThickness)):(o=c.absoluteMetrics.left+c.viewMetrics.width-t.width-o,$&&!h.RTL&&(o-=mt.scrollbarThickness)),e.vertical===lo.TOP?e=c.absoluteMetrics.top+n:(e=c.absoluteMetrics.top+c.viewMetrics.height-t.height-n,h.scrollbar&&h.scrollbar.canScrollHorizontally()&&(e-=mt.scrollbarThickness)),new qe(e,e+t.height,o,o+t.width)},va=function(e,t){return{horizontal:t.toolboxMetrics.position===Ee.LEFT||e.horizontalLayout&&!e.RTL?Wi.RIGHT:Wi.LEFT,vertical:t.toolboxMetrics.position===Ee.BOTTOM?lo.TOP:lo.BOTTOM}},ya=function(e,t,o,n){const c=e.left,h=e.right-e.left,$=e.bottom-e.top;for(let T=0;Th.id!==e.id).map(h=>h.getRelativeToSurfaceXY());for(;tf(G.sum(o,n),c);)n.translate(t.RTL?-30:30,30);e.moveTo(G.sum(o,n))},tf=function(e,t){return t.some(o=>1>=Math.abs(o.x-e.x)&&1>=Math.abs(o.y-e.y))},_o=function(e,t){e.setAttribute(zT,t)},It=function(e,t,o){Array.isArray(o)&&(o=o.join(" ")),e.setAttribute(FT+t,`${o}`)},zn=function(e){return e.saveState!==void 0&&e.loadState!==void 0},vu=function(e){return yu(e),sf()?(wa(),Promise.resolve()):(Gi||(Gi=new Promise(t=>{Nh=t,Vb=window.requestAnimationFrame(()=>{wa(),t()})})),Gi)},ws=function(){return Gi||Promise.resolve()},Qs=function(e){e||window.cancelAnimationFrame(Vb),wa(e),!e&&Nh&&Nh()},sf=function(){return Eb},yu=function(e){Oh.add(e),Mh.set(e,i.getGroup$$module$build$src$core$events$utils());const t=e.getParent();t?yu(t):hl.add(e)},wa=function(e){const t=e?new Set([e]):new Set([...hl].map(h=>h.workspace)),o=[...hl].filter(of).filter(h=>t.has(h.workspace));for(var n of o)wu(n);for(const h of t)h.resizeContents();for(var c of o)n=c.getRelativeToSurfaceXY(),c.updateComponentLocations(n);for(const h of o)c=i.getGroup$$module$build$src$core$events$utils(),(n=Mh.get(h))&&i.setGroup$$module$build$src$core$events$utils(n),h.bumpNeighbours(),i.setGroup$$module$build$src$core$events$utils(c);for(const h of o)_u(h);e||(Gi=null)},_u=function(e){hl.delete(e),Oh.delete(e),Mh.delete(e);for(const t of e.getChildren(!1))_u(t)},of=function(e){return!e.isDisposed()&&!e.getParent()},wu=function(e){if(Oh.has(e)&&e.initialized){for(const t of e.getChildren(!1))wu(t);e.renderEfficiently()}},Un=function(e,t){Kb(e,t)},nf=function(e){Kb=e},Ca=function(e,t){qb.confirmInternal(e,t)},rf=function(e,t){Yb(e,t)},af=function(e){Yb=e},Ta=function(e,t,o){Jb(e,t,o)},lf=function(e){Jb=e},Di=function(e){return e.getProcedureDef!==void 0},cf=function(e){return e.getProcedureCall!==void 0&&e.renameProcedure!==void 0},Cu=function(e){return e.getVariableModel!==void 0},i.allUsedVarModels$$module$build$src$core$variables=function(e){e=e.getAllBlocks(!1);const t=new Set;for(let o=0;o1'),n.appendChild(o),t.push(n)),Jt.variables_get){e.sort(hr.compareByName);for(let c=0,h;h=e[c];c++)o=i.createElement$$module$build$src$core$utils$xml("block"),o.setAttribute("type","variables_get"),o.setAttribute("gap","8"),o.appendChild(Go(h)),t.push(o)}}return t},ku=function(e){return Zb.generateUniqueNameInternal(e)},uf=function(e){return Sa(jh.charAt(0),e.getAllVariableNames())},Sa=function(e,t){if(!t.length)return e;const o=jh;let n="",c=o.indexOf(e);for(;;){let h=!1;for(let $=0;$h.getVariableModel().name);if(n&&(o=n.some(h=>h.toLowerCase()===e),n=n.some(h=>h.toLowerCase()===t),o&&n))return c.getName()}return null},pf=function(e,t,o){e=e.toLowerCase(),t=t.toLowerCase(),o=o.getAllBlocks(!1);for(const c of o){if(!Di(c))continue;o=c.getProcedureDef();var n=o[1];const h=n.some($=>$.toLowerCase()===e);if(n=n.some($=>$.toLowerCase()===t),h&&n)return o[0]}return null},Go=function(e){const t=i.createElement$$module$build$src$core$utils$xml("field");return t.setAttribute("name","VAR"),t.setAttribute("id",e.getId()),t.setAttribute("variabletype",e.type),e=i.createTextNode$$module$build$src$core$utils$xml(e.name),t.appendChild(e),t},i.getOrCreateVariablePackage$$module$build$src$core$variables=function(e,t,o,n){let c=i.getVariable$$module$build$src$core$variables(e,t,o,n);return c||(c=gf(e,t,o,n)),c},i.getVariable$$module$build$src$core$variables=function(e,t,o,n){const c=e.getPotentialVariableMap();let h=null;if(t&&(h=e.getVariableById(t),!h&&c&&(h=c.getVariableById(t)),h))return h;if(o){if(n===void 0)throw Error("Tried to look up a variable by name without a type");h=e.getVariable(o,n),!h&&c&&(h=c.getVariable(o,n))}return h},gf=function(e,t,o,n){const c=e.getPotentialVariableMap();return o||(o=ku(e.isFlyout?e.targetWorkspace:e)),c?c.createVariable(o,n,t):e.createVariable(o,n,t)},Hn=function(e,t){e=e.getAllVariables();const o=[];if(t.length!==e.length)for(let n=0;n{L.disposed||L.setConnectionTracking(!0)},1)}return T},xu=function(e,t,{parentConnection:o,isShadow:n=!1}={}){if(!e.type)throw new Qb(e);const c=t.newBlock(e.type,e.id);return c.setShadow(n),Cf(c,e),Tf(c,e),kf(c,e),Sf(o,c,e),Ef(c,e),If(c,e),xf(c,e),Df(c,e),Af(c,t.rendered),c},wf=function(e,t){if(K())for(e=Hn(e,t),t=0;tt&&(t=o[n].length);var c=-1/0;let h,$=1;do{n=c,h=e,e=[],c=o.length/$;let T=1;for(let L=0;Ln);return h},Ra=function(e,t,o){const n=[0],c=[];for(var h=0;hn&&(n=T,c=$)}return c?Ku(e,c,o):t},Lf=function(e,t){const o=[];for(let n=0;ncv&&to()}else $r!==cs&&(clearTimeout(ci),Wh=e.pageX,Gh=e.pageY,ci=setTimeout(Vf,uv))},Xu=function(){$r=cs=null,to()},to=function(){fr&&(fr=!1,_t&&(_t.style.display="none")),ci&&(clearTimeout(ci),ci=0)},Zu=function(){to(),Xi=!0},Qu=function(){Xi=!1},Hf=function(){_t&&cs&&(typeof $l=="function"?$l(_t,cs):Wf())},Wf=function(){var e=Ni(cs);e=i.wrap$$module$build$src$core$utils$string(e,av),e=e.split(` -`);for(let t=0;to+window.scrollY&&(c-=_t.offsetHeight+2*Kh),e?n=Math.max(bl-window.scrollX,n):n+_t.offsetWidth>t+window.scrollX-2*bl&&(n=t-_t.offsetWidth-2*bl),{x:n,y:c}},Vf=function(){if(!Xi&&($r=cs,_t)){_t.textContent="",Hf();var e=cs.RTL;_t.style.direction=e?"rtl":"ltr",_t.style.display="block",fr=!0;var{x:t,y:o}=Gf(e);_t.style.left=t+"px",_t.style.top=o+"px"}},ed=function(){return Yh},Kf=function(e){Yh=e},td=function(){return Jh},Yf=function(e){Jh=e},Vo=function(e){e=`${e}`.toLowerCase().trim();var t=dv[e];if(t||(t=e.substring(0,2)==="0x"?"#"+e.substring(2):e,t=t[0]==="#"?t:"#"+t,/^#[0-9a-f]{6}$/.test(t)))return t;if(/^#[0-9a-f]{3}$/.test(t))return["#",t[1],t[1],t[2],t[2],t[3],t[3]].join("");var o=e.match(/^(?:rgb)?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);return o&&(e=Number(o[1]),t=Number(o[2]),o=Number(o[3]),0<=e&&256>e&&0<=t&&256>t&&0<=o&&256>o)?Kn(e,t,o):null},Kn=function(e,t,o){return t=e<<16|t<<8|o,16>e?"#"+(16777216|t).toString(16).substr(1):"#"+t.toString(16)},Ma=function(e){return e=Vo(e),e?(e=parseInt(e.substr(1),16),[e>>16,e>>8&255,e&255]):[0,0,0]},Na=function(e,t,o){let n=0,c=0,h=0;if(t===0)h=c=n=o;else{const $=Math.floor(e/60),T=e/60-$;e=o*(1-t);const L=o*(1-t*T);switch(t=o*(1-t*(1-T)),$){case 1:n=L,c=o,h=e;break;case 2:n=e,c=o,h=t;break;case 3:n=e,c=L,h=o;break;case 4:n=t,c=e,h=o;break;case 5:n=o,c=e,h=L;break;case 6:case 0:n=o,c=t,h=e}}return Kn(Math.floor(n),Math.floor(c),Math.floor(h))},Ko=function(e,t,o){return e=Vo(e),!e||(t=Vo(t),!t)?null:(e=Ma(e),t=Ma(t),Kn(Math.round(t[0]+o*(e[0]-t[0])),Math.round(t[1]+o*(e[1]-t[1])),Math.round(t[2]+o*(e[2]-t[2]))))},sd=function(e){return Na(e,Yh,255*Jh)},La=function(e,t,o){const n=[];var c=e.split("");c.push("");var h=0;e=[];let $=null;for(let te=0;te=T?(h=2,$=T,(T=e.join(""))&&n.push(T),e.length=0):T==="{"?h=3:(e.push("%",T),h=0);else if(h===2)if("0"<=T&&"9">=T)$+=T;else{var L=void 0;n.push(parseInt((L=$)!=null?L:"",10)),te--,h=0}else h===3&&(T===""?(e.splice(0,0,"%{"),te--,h=0):T!=="}"?e.push(T):(h=e.join(""),/[A-Z]\w*/i.test(h)?(T=h.toUpperCase(),(T=T.startsWith("BKY_")?T.substring(4):null)&&T in i.Msg$$module$build$src$core$msg?(h=i.Msg$$module$build$src$core$msg[T],typeof h=="string"?Array.prototype.push.apply(n,La(h,t,o)):t?n.push(`${h}`):n.push(h)):n.push("%{"+h+"}")):n.push("%{"+h+"}"),h=e.length=0))}for((t=e.join(""))&&n.push(t),L=[],e.length=0,c=0;c=o)return{hue:o,hex:Na(o,ed(),255*td())};if(o=Vo(t))return{hue:null,hex:o};throw o='Invalid colour: "'+t+'"',e!==t&&(o+=' (from "'+e+'")'),Error(o)},Yo=function(){return Ss},qf=function(e){if(Ss=e,e===null){let t;(t=document.querySelector("."+yl))==null||t.remove()}},id=function(){const e=de()||document.body;document.querySelector("."+yl)?Ss=document.querySelector("."+yl):(Ss=document.createElement("div"),Ss.className=yl),e.appendChild(Ss)},Pa=function(e,t,o,n){if(Bi(),Zi=e,vl=o,o=Ss){if(o.style.direction=t?"rtl":"ltr",o.style.display="block",!n&&e instanceof Qe){let $;n=($=e.getSourceBlock())==null?void 0:$.workspace}var c;qh=(c=n)!=null?c:null;var h;e=(h=n)!=null?h:U(),Qi=e.getRenderer().getClassName(),en=e.getTheme().getClassName(),Qi&&ge(o,Qi),en&&ge(o,en)}},Bi=function(){if(nd()){Zi=null;var e=Ss;e&&(e.style.display="none",e.style.left="",e.style.top="",vl&&vl(),vl=null,e.textContent="",Qi&&(ot(e,Qi),Qi=""),en&&(ot(e,en),en=""),U().markFocused())}},nd=function(){return!!Zi},Jo=function(e){Zi===e&&Bi()},Yn=function(e){qh!==null&&qh!==e||Bi()},rd=function(e,t,o){Ss.style.left=e+"px",Ss.style.top=t+"px",Ss.style.height=o+"px"},ad=function(e,t,o,n){const c=Zf(e,t,o);e=Xf(e,t,o,n),0>c?rd(e,0,o.height+c):rd(e,c,o.height)},Xf=function(e,t,o,n){return n?Math.min(Math.max(t.right-o.width,e.left),e.right-o.width):Math.max(Math.min(t.left,e.right-o.width),e.left)},Zf=function(e,t,o){return t.bottom+o.height>=e.bottom?t.top-o.height:t.bottom},Qf=function(e){return!(e==null||!e.repositionForWindowResize)},ld=function(){Qf(Zi)&&Zi.repositionForWindowResize()||Bi()},e$=function(){return _l},cd=function(e){_l=e},Jn=function(e,t,o,n){if(Pa(hv,o,ud,n),t.length){var c=t$(t,o,e);wl=c,s$(c,e,o),setTimeout(function(){c.focus()},1),_l=null}else qn()},t$=function(e,t,o){const n=new Ah;n.setRole(ks.MENU);for(let c=0;c{setTimeout(()=>{h.callback(h.scope,o)},0)})},{})}return n},s$=function(e,t,o){const n=mu();t=new qe(t.clientY+n.top,t.clientY+n.top,t.clientX+n.left,t.clientX+n.left),o$(e);const c=e.getSize();o&&(t.left+=c.width,t.right+=c.width,n.left+=c.width,n.right+=c.width),ad(n,t,c,o),e.focus()},o$=function(e){var t=Yo();if(!t)throw Error("Attempting to create a context menu when widget div is null");t=e.render(t),ge(t,"blocklyContextMenu"),X(t,"contextmenu",null,i$),e.focus()},i$=function(e){e.preventDefault(),e.stopPropagation()},qn=function(){Jo(hv),_l=null},ud=function(){wl&&(wl.dispose(),wl=null)},i.callbackFactory$$module$build$src$core$contextmenu=function(e,t){return()=>{i.disable$$module$build$src$core$events$utils();let o;try{o=t instanceof Element?qo(t,e.workspace):Ri(t,e.workspace);const n=e.getRelativeToSurfaceXY();n.x=e.RTL?n.x-i.config$$module$build$src$core$config.snapRadius:n.x+i.config$$module$build$src$core$config.snapRadius,n.y+=2*i.config$$module$build$src$core$config.snapRadius,o.moveBy(n.x,n.y)}finally{i.enable$$module$build$src$core$events$utils()}return K()&&!o.isShadow()&&z(new(V(O.BLOCK_CREATE))(o)),i.setSelected$$module$build$src$core$common(o),o}},dd=function(e,t){return t=st(t,e.getParentSvg(),e.getInverseScreenCTM()),t.x/=e.scale,t.y/=e.scale,t},Ba=function(e,t,o){t=dd(e,t),gv.set(e,G.difference(o,t))},ja=function(e,t){if(t=dd(e,t),e=gv.get(e),!e)throw Error("Drag not initialized");return G.sum(e,t)},n$=function(e,t=!1){const o=i.createElement$$module$build$src$core$utils$xml("xml");var n=hd(i.allUsedVarModels$$module$build$src$core$variables(e));n.hasChildNodes()&&o.appendChild(n);for(const c of e.getTopComments())o.appendChild(Xn(c,t));for(e=e.getTopBlocks(!0),n=0;n/g,"<$1$2>")},l$=function(e){e=Ls(e).split("<");let t="";for(let o=1;o"&&(t+=" ")}return e=e.join(` -`),e=e.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1"),e.replace(/^\n/,"")},c$=function(e,t){return t.setResizesEnabled(!1),t.clear(),e=i.domToWorkspace$$module$build$src$core$xml(e,t),t.setResizesEnabled(!0),e},i.domToWorkspace$$module$build$src$core$xml=function(e,t){let o=0;t.RTL&&(o=t.getWidth());const n=[];Ho();const c=i.getGroup$$module$build$src$core$events$utils();c||i.setGroup$$module$build$src$core$events$utils(!0),t.setResizesEnabled&&t.setResizesEnabled(!1);let h=!0;try{for(let $=0,T;T=e.childNodes[$];$++){const L=T.nodeName.toLowerCase(),te=T;if(L==="block"||L==="shadow"&&!me()){const nt=qo(te,t);n.push(nt.id);let it;const Xt=parseInt((it=te.getAttribute("x"))!=null?it:"10",10);let hn;const Or=parseInt((hn=te.getAttribute("y"))!=null?hn:"10",10);isNaN(Xt)||isNaN(Or)||nt.moveBy(t.RTL?o-Xt:Xt,Or,["create"]),h=!1}else{if(L==="shadow")throw TypeError("Shadow block cannot be a top-level block.");if(L==="comment")gd(te,t);else if(L==="variables"){if(h)md(te,t);else throw Error("'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location.");h=!1}}}}finally{i.setGroup$$module$build$src$core$events$utils(c),t.setResizesEnabled&&t.setResizesEnabled(!0),t.rendered&&Qs(),Wo()}return z(new(V(O.FINISHED_LOADING))(t)),n},gd=function(e,t){var o;const n=(o=e.getAttribute("id"))!=null?o:void 0;o=t.rendered?new kl(t,n):new Tl(t,n);var c;o.setText((c=e.textContent)!=null?c:"");var h;c=parseInt((h=e.getAttribute("x"))!=null?h:"",10);let $;h=parseInt(($=e.getAttribute("y"))!=null?$:"",10),isNaN(c)||isNaN(h)||(c=t.RTL?t.getWidth()-c:c,o.moveTo(new G(c,h)));var T;t=parseInt((T=e.getAttribute("w"))!=null?T:"",10);let L;return T=parseInt((L=e.getAttribute("h"))!=null?L:"",10),isNaN(t)||isNaN(T)||o.setSize(new Le(t,T)),e.getAttribute("collapsed")==="true"&&o.setCollapsed(!0),e.getAttribute("editable")==="false"&&o.setEditable(!1),e.getAttribute("movable")==="false"&&o.setMovable(!1),e.getAttribute("deletable")==="false"&&o.setDeletable(!1),o},u$=function(e,t){if(!t.getBlocksBoundingBox)return i.domToWorkspace$$module$build$src$core$xml(e,t);var o=t.getBlocksBoundingBox();if(e=i.domToWorkspace$$module$build$src$core$xml(e,t),o&&o.top!==o.bottom){var n=o.bottom;o=t.RTL?o.right:o.left;var c=1/0;let h=-1/0,$=1/0;for(let T=0;Th&&(h=L.x)}for(n=n-$+10,o=t.RTL?o-h:o-c,c=0;cte.setBubbleVisible(h),1)}},g$=function(e,t){for(let o=0;oc}),bd(c,{x:n.x,y:n.y,width:e.width,height:e.height},t.RTL,new Date)}},bd=function(e,t,o,n){const c=(new Date().getTime()-n.getTime())/150;1o)){var n=t.getSvgXY(e.getSvgRoot());e.outputConnection?(n.x+=(e.RTL?3:-3)*o,n.y+=13*o):e.previousConnection&&(n.x+=(e.RTL?-23:23)*o,n.y+=3*o);var c=N(x.CIRCLE,{cx:n.x,cy:n.y,r:0,fill:"none",stroke:"#888","stroke-width":10},t.getParentSvg());e=N(x.ANIMATE,{id:"animationCircle",begin:"indefinite",attributeName:"r",dur:"150ms",from:0,to:25*o},c),t=N(x.ANIMATE,{id:"animationOpacity",begin:"indefinite",attributeName:"opacity",dur:"150ms",from:1,to:0},c),e.beginElement(),t.beginElement(),setTimeout(()=>{Ke(c)},150)}},vd=function(e){if(ji(),e.workspace.getAudioManager().play("disconnect"),!(1>e.workspace.scale)){var t=e.getHeightWidth().height;t=Math.atan(10/t)/Math.PI*180,e.RTL||(t*=-1),vr=e,yd(e,t,new Date,0)}},yd=function(e,t,o,n){const c=[.66,1,.66,0,-.66,-1,-.66,0];let h="";o.getTime()+200>new Date().getTime()&&(h=`skewX(${Math.round(c[n%c.length]*t)})`,Sl=setTimeout(yd,15,e,t,o,n+1)),e.getSvgRoot().setAttribute("transform",`${e.getTranslation()} ${h}`)},ji=function(){vr&&(Sl&&(clearTimeout(Sl),Sl=null),vr.getSvgRoot().setAttribute("transform",vr.getTranslation()),vr=null)},Xo=function(e){return e.getRelativeToSurfaceXY!==void 0&&e.isMovable!==void 0&&e.startDrag!==void 0&&e.drag!==void 0&&e.endDrag!==void 0&&e.revertDrag!==void 0},so=function(e,t){for(const o in t)e[o]=t[o]!==null&&typeof t[o]=="object"?so(e[o]||Object.create(null),t[o]):t[o];return e},Ps=function(e,t){r(F.FIELD,e,t)},y$=function(e){u(F.FIELD,e)},i.fromJson$$module$build$src$core$field_registry=function(e){return bv.fromJsonInternal(e)},_$=function(e){const t=f(F.FIELD,e.type);return t?t.fromJson(e):(console.warn("Blockly could not create a field of type "+e.type+". The field is probably not being registered. This could be because the file is not loaded, the field does not register itself (Issue #1584), or the registration is not being reached."),null)},i.register$$module$build$src$core$extensions=function(e,t){if(typeof e!="string"||e.trim()==="")throw Error('Error: Invalid extension name "'+e+'"');if(sn[e])throw Error('Error: Extension "'+e+'" is already registered.');if(typeof t!="function")throw Error('Error: Extension "'+e+'" must be a function');sn[e]=t},i.registerMixin$$module$build$src$core$extensions=function(e,t){if(!t||typeof t!="object")throw Error('Error: Mixin "'+e+'" must be a object');i.register$$module$build$src$core$extensions(e,function(){this.mixin(t)})},i.registerMutator$$module$build$src$core$extensions=function(e,t,o,n){const c='Error when registering mutator "'+e+'": ';Cd(c,t);const h=wd(t,c);if(o&&typeof o!="function")throw Error(c+'Extension "'+e+'" is not a function');i.register$$module$build$src$core$extensions(e,function(){h&&this.setMutator(new i.MutatorIcon$$module$build$src$core$icons$mutator_icon(n||[],this)),this.mixin(t),o&&o.apply(this)})},w$=function(e){_d(e)?delete sn[e]:console.warn('No extension mapping for name "'+e+'" found to unregister')},_d=function(e){return!!sn[e]},Ha=function(e,t,o){const n=sn[e];if(typeof n!="function")throw Error('Error: Extension "'+e+'" not found.');let c;if(o?C$(e,t):c=Ga(t),n.apply(t),o)Cd('Error after applying mutator "'+e+'": ',t);else if(!S$(c,t))throw Error('Error when applying extension "'+e+'": mutation properties changed when applying a non-mutator extension.')},C$=function(e,t){if(Ga(t).length)throw Error('Error: tried to apply mutation "'+e+'" to a block that already has mutator functions. Block id: '+t.id)},T$=function(e,t){return Wa(e.mutationToDom,e.domToMutation,t+" mutationToDom/domToMutation")},k$=function(e,t){return Wa(e.saveExtraState,e.loadExtraState,t+" saveExtraState/loadExtraState")},wd=function(e,t){return Wa(e.compose,e.decompose,t+" compose/decompose")},Wa=function(e,t,o){if(e&&t){if(typeof e!="function"||typeof t!="function")throw Error(o+" must be a function");return!0}if(!e&&!t)return!1;throw Error(o+"Must have both or neither functions")},Cd=function(e,t){const o=T$(t,e),n=k$(t,e);if(!o&&!n)throw Error(e+"Mutations must contain either XML hooks, or JSON hooks, or both");wd(t,e)},Ga=function(e){const t=[];return e.domToMutation!==void 0&&t.push(e.domToMutation),e.mutationToDom!==void 0&&t.push(e.mutationToDom),e.saveExtraState!==void 0&&t.push(e.saveExtraState),e.loadExtraState!==void 0&&t.push(e.loadExtraState),e.compose!==void 0&&t.push(e.compose),e.decompose!==void 0&&t.push(e.decompose),t},S$=function(e,t){if(t=Ga(t),t.length!==e.length)return!1;for(let o=0;o!n.getReturnTypes()).map(n=>[n.getName(),n.getParameters().map(c=>c.getName()),!1]);e.getBlocksByType("procedures_defnoreturn",!1).forEach(n=>{!Co(n)&&Di(n)&&t.push(n.getProcedureDef())});const o=e.getProcedureMap().getProcedures().filter(n=>!!n.getReturnTypes()).map(n=>[n.getName(),n.getParameters().map(c=>c.getName()),!0]);return e.getBlocksByType("procedures_defreturn",!1).forEach(n=>{!Co(n)&&Di(n)&&o.push(n.getProcedureDef())}),t.sort(kd),o.sort(kd),[t,o]},kd=function(e,t){return e[0].localeCompare(t[0],void 0,{sensitivity:"base"})},i.findLegalName$$module$build$src$core$procedures=function(e,t){if(t.isInFlyout)return e;for(e=e||i.Msg$$module$build$src$core$msg.UNNAMED_KEY||"unnamed";!A$(e,t.workspace,t);){const o=e.match(/^(.*?)(\d+)$/);e=o?o[1]+(parseInt(o[2])+1):e+"2"}return e},A$=function(e,t,o){return!Sd(e,t,o)},Sd=function(e,t,o){for(const n of t.getAllBlocks(!1))if(n!==o&&Di(n)&&i.Names$$module$build$src$core$names.equals(n.getProcedureDef()[0],e))return!0;o=o&&Co(o)?o==null?void 0:o.getProcedureModel():void 0;for(const n of t.getProcedureMap().getProcedures())if(n!==o&&i.Names$$module$build$src$core$names.equals(n.getName(),e))return!0;return!1},i.rename$$module$build$src$core$procedures=function(e){var t=this.getSourceBlock();if(!t)throw new ft;e=e.trim();const o=i.findLegalName$$module$build$src$core$procedures(e,t);Co(t)&&!t.isInsertionMarker()&&t.getProcedureModel().setName(o);const n=this.getValue();if(n!==e&&n!==o)for(e=t.workspace.getAllBlocks(!1),t=0;tO$(o,e)||cf(o)&&i.Names$$module$build$src$core$names.equals(o.getProcedureCall(),e))},O$=function(e,t){return Co(e)&&!e.isProcedureDef()&&e.getProcedureModel()&&i.Names$$module$build$src$core$names.equals(e.getProcedureModel().getName(),t)},i.mutateCallers$$module$build$src$core$procedures=function(e){const t=me();var o=e.getProcedureDef()[0];const n=e.mutationToDom(!0);e=xd(o,e.workspace);for(let h=0,$;$=e[h];h++){o=(o=$.mutationToDom())&&Ii(o),$.domToMutation&&$.domToMutation(n);var c=$.mutationToDom();c=c&&Ii(c),o!==c&&(i.setRecordUndo$$module$build$src$core$events$utils(!1),z(new(V(O.BLOCK_CHANGE))($,"mutation",null,o,c)),i.setRecordUndo$$module$build$src$core$events$utils(t))}},i.getDefinition$$module$build$src$core$procedures=function(e,t){for(const o of t.getAllBlocks(!1))if(Co(o)&&o.isProcedureDef()&&i.Names$$module$build$src$core$names.equals(o.getProcedureModel().getName(),e)||Di(o)&&i.Names$$module$build$src$core$names.equals(o.getProcedureDef()[0],e))return o;return null},Ja=function(e){return e.isDynamic},M$=function(e){return e.pathDown!==void 0&&e.pathUp!==void 0},N$=function(e){return e.pathLeft!==void 0&&e.pathRight!==void 0},L$=function(e,t){if(!e||!t)throw Error("Cannot connect null connections.");e.targetConnection=t,t.targetConnection=e},P$=function(e,t){let o=null;t=t.outputConnection;const n=t==null?void 0:t.getConnectionChecker();for(let c=0,h;h=e.inputList[c];c++){const $=h.connection;let T;if($&&((T=n)!=null&&T.canConnect(t,$,!1))){if(o)return null;o=$}}return o},B$=function(e,t){let o;for(;o=P$(e,t);)if(e=o.targetBlock(),!e||e.isShadow())return o;return null},Dd=function(e){return e.getType!==void 0&&e.initView!==void 0&&e.dispose!==void 0&&e.getWeight!==void 0&&e.getSize!==void 0&&e.applyColour!==void 0&&e.hideForInsertionMarker!==void 0&&e.updateEditable!==void 0&&e.updateCollapsed!==void 0&&e.isShownWhenCollapsed!==void 0&&e.setOffsetInBlock!==void 0&&e.onLocationChange!==void 0&&e.onClick!==void 0},j$=function(e){return Dd(e)&&Oi(e)&&zn(e)&&e.setText!==void 0&&e.getText!==void 0&&e.setBubbleSize!==void 0&&e.getBubbleSize!==void 0&&e.getType()===yt.COMMENT},Qn=function(e){let t=e.outputConnection;return(!t||e.previousConnection&&e.previousConnection.isConnected())&&(t=e.previousConnection),t},er=function(e,t){r(F.RENDERER,e,t)},F$=function(e){u(F.RENDERER,e)},Ad=function(e,t,o){return e=new(m(F.RENDERER,e))(e),e.init(t,o),e},Rd=function(e){Ai(e.getTargetWorkspace(),void 0,"String")},Od=function(e){Ai(e.getTargetWorkspace(),void 0,"Number")},Md=function(e){Ai(e.getTargetWorkspace(),void 0,"Colour")},qa=function(e){let t=[],o=document.createElement("button");return o.setAttribute("text",i.Msg$$module$build$src$core$msg.NEW_STRING_VARIABLE),o.setAttribute("callbackKey","CREATE_VARIABLE_STRING"),t.push(o),o=document.createElement("button"),o.setAttribute("text",i.Msg$$module$build$src$core$msg.NEW_NUMBER_VARIABLE),o.setAttribute("callbackKey","CREATE_VARIABLE_NUMBER"),t.push(o),o=document.createElement("button"),o.setAttribute("text",i.Msg$$module$build$src$core$msg.NEW_COLOUR_VARIABLE),o.setAttribute("callbackKey","CREATE_VARIABLE_COLOUR"),t.push(o),e.registerButtonCallback("CREATE_VARIABLE_STRING",Rd),e.registerButtonCallback("CREATE_VARIABLE_NUMBER",Od),e.registerButtonCallback("CREATE_VARIABLE_COLOUR",Md),e=Nd(e),t=t.concat(e)},Nd=function(e){e=e.getAllVariables();const t=[];if(0T.id!=e.id).map(T=>T.getRelativeToSurfaceXY());for(;U$(G.sum(t,h),$)||H$(e,G.sum(c,h),n);)o.RTL?h.translate(-n,2*n):h.translate(n,2*n);e.moveTo(G.sum(t,h))},U$=function(e,t){return t.some(o=>1>=Math.abs(o.x-e.x)&&1>=Math.abs(o.y-e.y))},H$=function(e,t,o){return e.getConnections_(!1).some(n=>!!n.closest(o,t).connection)},zi=function(e,t,o){const n=o.getBoundingRectangle(),c=n.right-n.left,h=Mi(t.top,n.top,t.top+t.height-(n.bottom-n.top))-n.top;let $=t.left;return t=t.left+t.width-c,e.RTL?$=Math.min(t,$):t=Math.max($,t),(e=Mi($,n.left,t)-n.left)||h?(o.moveBy(e,h,["inbounds"]),!0):!1},Ld=function(e){return t=>{var o=e.getMetricsManager();if(o.hasFixedEdges()&&!e.isDragging()){var n;if(ub.includes((n=t.type)!=null?n:"")){n=o.getScrollMetrics(!0);const c=W$(e,t);c&&(o=i.getGroup$$module$build$src$core$events$utils()||!1,i.setGroup$$module$build$src$core$events$utils(t.group),zi(e,n,c)&&!t.group&&console.warn("Moved object in bounds but there was no event group. This may break undo."),i.setGroup$$module$build$src$core$events$utils(o))}else se(t)&&t.scale&&t.oldScale&&t.scale>t.oldScale&&Xa(e)}}},W$=function(e,t){let o=null;switch(t.type){case O.BLOCK_CREATE:case O.BLOCK_MOVE:(o=e.getBlockById(t.blockId))&&(o=o.getRootBlock());break;case O.COMMENT_CREATE:case O.COMMENT_MOVE:case O.COMMENT_RESIZE:o=e.getCommentById(t.commentId)}return o},Xa=function(e){var t=e.getMetricsManager();if(t.hasFixedEdges()&&!e.isDragging()){t=t.getScrollMetrics(!0);var o=e.getTopBoundedElements();for(let n=0,c;c=o[n];n++)zi(e,t,c)}},ls=function(e){return e.isDeletable!==void 0&&e.dispose!==void 0&&e.setDeleteStyle!==void 0},G$=function(e){const t=e.toCopyData();Tp=t;let o;return kp=(o=e.workspace)!=null?o:null,t},To=function(e,t,o){return e&&t?Pd(e,t,o):Tp&&kp?Pd(Tp,kp):null},Pd=function(e,t,o){let n;t=t.isMutator?t:(n=t.getRootWorkspace())!=null?n:t;let c,h;return(h=(c=f(F.PASTER,e.paster,!1))==null?void 0:c.paste(e,t,o))!=null?h:null},V$=function(e){const t=e.toCopyData();return t?To(t,e.workspace):null},tr=function(e){return e.toCopyData!==void 0},Bd=function(){He.registry.register({name:Hs.ESCAPE,preconditionFn(e){return!e.options.readOnly},callback(e){return e.hideChaff(),!0},keyCodes:[Ae.ESC]})},jd=function(){He.registry.register({name:Hs.DELETE,preconditionFn(e){const t=I();return!e.options.readOnly&&t!=null&&ls(t)&&t.isDeletable()&&!co.inProgress()},callback(e,t){return t.preventDefault(),e=I(),e instanceof gs?e.checkAndDelete():ls(e)&&e.isDeletable()&&(i.setGroup$$module$build$src$core$events$utils(!0),e.dispose(),i.setGroup$$module$build$src$core$events$utils(!1)),!0},keyCodes:[Ae.DELETE,Ae.BACKSPACE]})},Fd=function(){const e=He.registry.createSerializedKey(Ae.C,[Ae.CTRL]),t=He.registry.createSerializedKey(Ae.C,[Ae.ALT]),o=He.registry.createSerializedKey(Ae.C,[Ae.META]);He.registry.register({name:Hs.COPY,preconditionFn(n){const c=I();return!n.options.readOnly&&!co.inProgress()&&c!=null&&ls(c)&&c.isDeletable()&&Xo(c)&&c.isMovable()&&tr(c)},callback(n,c){return c.preventDefault(),n.hideChaff(),c=I(),!c||!tr(c)?!1:(Mo=c.toCopyData(),No=c.workspace instanceof ns?c.workspace:n,cn=Xo(c)?c.getRelativeToSurfaceXY():null,!!Mo)},keyCodes:[e,t,o]})},zd=function(){const e=He.registry.createSerializedKey(Ae.X,[Ae.CTRL]),t=He.registry.createSerializedKey(Ae.X,[Ae.ALT]),o=He.registry.createSerializedKey(Ae.X,[Ae.META]);He.registry.register({name:Hs.CUT,preconditionFn(n){const c=I();return!n.options.readOnly&&!co.inProgress()&&c!=null&&ls(c)&&c.isDeletable()&&Xo(c)&&c.isMovable()&&!c.workspace.isFlyout},callback(n){const c=I();return c instanceof gs?(Mo=c.toCopyData(),No=n,cn=c.getRelativeToSurfaceXY(),c.checkAndDelete(),!0):ls(c)&&c.isDeletable()&&tr(c)?(Mo=c.toCopyData(),No=n,cn=Xo(c)?c.getRelativeToSurfaceXY():null,c.dispose(),!0):!1},keyCodes:[e,t,o]})},Ud=function(){const e=He.registry.createSerializedKey(Ae.V,[Ae.CTRL]),t=He.registry.createSerializedKey(Ae.V,[Ae.ALT]),o=He.registry.createSerializedKey(Ae.V,[Ae.META]);He.registry.register({name:Hs.PASTE,preconditionFn(n){return!n.options.readOnly&&!co.inProgress()},callback(){if(!Mo||!No)return!1;if(!cn)return!!To(Mo,No);const{left:n,top:c,width:h,height:$}=No.getMetricsManager().getViewMetrics(!0);if(new qe(c,c+$,n,n+h).contains(cn.x,cn.y))return!!To(Mo,No);const T=new G(n+h/2,c+$/2);return!!To(Mo,No,T)},keyCodes:[e,t,o]})},Hd=function(){const e=He.registry.createSerializedKey(Ae.Z,[Ae.CTRL]),t=He.registry.createSerializedKey(Ae.Z,[Ae.ALT]),o=He.registry.createSerializedKey(Ae.Z,[Ae.META]);He.registry.register({name:Hs.UNDO,preconditionFn(n){return!n.options.readOnly&&!co.inProgress()},callback(n,c){return n.hideChaff(),n.undo(!1),c.preventDefault(),!0},keyCodes:[e,t,o]})},Wd=function(){const e=He.registry.createSerializedKey(Ae.Z,[Ae.SHIFT,Ae.CTRL]),t=He.registry.createSerializedKey(Ae.Z,[Ae.SHIFT,Ae.ALT]),o=He.registry.createSerializedKey(Ae.Z,[Ae.SHIFT,Ae.META]),n=He.registry.createSerializedKey(Ae.Y,[Ae.CTRL]);He.registry.register({name:Hs.REDO,preconditionFn(c){return!co.inProgress()&&!c.options.readOnly},callback(c,h){return c.hideChaff(),c.undo(!0),h.preventDefault(),!0},keyCodes:[e,t,o,n]})},Gd=function(){Bd(),jd(),Fd(),zd(),Ud(),Hd(),Wd()},Vd=function(e){const t=e.saveState();return e.getParameters().length&&(t.parameters=e.getParameters().map(o=>o.saveState())),t},Kd=function(e,t,o,n){if(e=e.loadState(o,n),!o.parameters)return e;for(const[c,h]of o.parameters.entries())e.insertParameter(t.loadState(h,n),c);return e},K$=function(e){const t=Object.create(null),o=v(F.SERIALIZER,!0);for(const n in o){let c;const h=(c=o[n])==null?void 0:c.save(e);h&&(t[n]=h)}return t},Y$=function(e,t,{recordUndo:o=!1}={}){var n=v(F.SERIALIZER,!0);if(n){n=Object.entries(n).sort((h,$)=>$[1].priority-h[1].priority);var c=me();i.setRecordUndo$$module$build$src$core$events$utils(o),(o=i.getGroup$$module$build$src$core$events$utils())||i.setGroup$$module$build$src$core$events$utils(!0),Ho(),t instanceof ns&&t.setResizesEnabled(!1);for(const[,h]of n.reverse()){let $;($=h)==null||$.clear(t)}for(const[h,$]of n.reverse())if(e[h]){let T;(T=$)==null||T.load(e[h],t)}t instanceof ns&&t.setResizesEnabled(!0),Wo(),z(new(V(O.FINISHED_LOADING))(t)),i.setGroup$$module$build$src$core$events$utils(o),i.setRecordUndo$$module$build$src$core$events$utils(c)}},J$=function(e,t){let o=null;o=typeof e=="string"?document.getElementById(e)||document.querySelector(e):e;var n;if(!document.contains(o)&&document!==((n=o)==null?void 0:n.ownerDocument))throw Error("Error: container is not in current document");e=new ds(t||{}),n=document.createElement("div"),ge(n,"injectionDiv"),t!=null&&t.rtl&&ge(n,"blocklyRTL"),n.tabIndex=0,It(n,Ct.LABEL,i.Msg$$module$build$src$core$msg.WORKSPACE_ARIA_LABEL),o.appendChild(n),t=q$(n,e);const c=X$(n,t,e);return Z$(c),re(c),Ce(c),n.addEventListener("focusin",function(){re(c)}),X(n,"keydown",null,Za),X(Wn(),"keydown",null,Za),(t=Yo())&&X(t,"keydown",null,Za),c},q$=function(e,t){e.setAttribute("dir","LTR"),cu(t.hasCss,t.pathToMedia),e=N(x.SVG,{xmlns:rr,"xmlns:html":Fs,"xmlns:xlink":es,version:"1.1",class:"blocklySvg",tabindex:"0"},e);const o=N(x.DEFS,{},e),n=String(Math.random()).substring(2);return t.gridPattern=ep.createDom(n,t.gridOptions,o),e},X$=function(e,t,o){o.parentWorkspace=null,o=new ns(o);const n=o.options;o.scale=n.zoomOptions.startScale,t.appendChild(o.createDom("blocklyMainBackground",e));var c=o.getRenderer().getClassName();return c&&ge(e,c),(c=o.getTheme().getClassName())&&ge(e,c),!n.hasCategories&&n.languageTree&&(e=o.addFlyout(x.SVG),Uo(e,t)),n.hasTrashcan&&o.addTrashcan(),n.zoomOptions&&n.zoomOptions.controls&&o.addZoomControls(),o.getThemeManager().subscribe(t,"workspaceBackgroundColour","background-color"),o.translate(0,0),o.addChangeListener(Ld(o)),Ce(o),id(),Au(),Ju(),o},Z$=function(e){const t=e.options;var o=e.getParentSvg();if(X(o.parentNode,"contextmenu",null,function(n){kt(n)||n.preventDefault()}),o=X(window,"resize",null,function(){to(),e.hideComponents(!0),Wu(),ld(),Ce(e),Xa(e)}),e.setResizeHandlerWrapper(o),Q$(),t.languageTree){o=e.getToolbox();const n=e.getFlyout(!0);o?o.init():n&&(n.init(e),n.show(t.languageTree),typeof n.scrollToStart=="function"&&n.scrollToStart())}t.hasTrashcan&&e.trashcan.init(),t.zoomOptions&&t.zoomOptions.controls&&e.zoomControls_.init(),t.moveOptions&&t.moveOptions.scrollbars?(e.scrollbar=new Ep(e,t.moveOptions.scrollbars===!0||!!t.moveOptions.scrollbars.horizontal,t.moveOptions.scrollbars===!0||!!t.moveOptions.scrollbars.vertical,"blocklyMainWorkspaceScrollbar"),e.scrollbar.resize()):e.setMetrics({x:.5,y:.5}),t.hasSounds&&eb(t.pathToMedia,e)},Za=function(e){const t=U();t&&!(kt(e)||t.rendered&&!t.isVisible())&&He.registry.onKeyDown(t,e)},Q$=function(){oy||(X(document,"scroll",null,function(){const e=ee();for(let t=0,o;o=e[t];t++)o instanceof ns&&o.updateInverseScreenCTM()}),ct(document,"touchend",null,_e),ct(document,"touchcancel",null,_e)),oy=!0},eb=function(e,t){function o(){for(;c.length;){const h=c.pop();h&&ze(h)}n.preload()}const n=t.getAudioManager();n.load([e+"click.mp3",e+"click.wav",e+"click.ogg"],"click"),n.load([e+"disconnect.wav",e+"disconnect.mp3",e+"disconnect.ogg"],"disconnect"),n.load([e+"delete.mp3",e+"delete.ogg",e+"delete.wav"],"delete");const c=[];c.push(X(document,"pointermove",null,o,!0)),c.push(X(document,"touchstart",null,o,!0))},Yd=function(){xe.registry.register({displayText(){return i.Msg$$module$build$src$core$msg.UNDO},preconditionFn(e){return 0t.length?sr(t):Ca(i.Msg$$module$build$src$core$msg.DELETE_ALL_BLOCKS.replace("%1",String(t.length)),function(o){o&&sr(t)})}},scopeType:xe.ScopeType.WORKSPACE,id:"workspaceDelete",weight:6})},tb=function(){Yd(),Jd(),qd(),Zd(),Qd(),th()},sh=function(){xe.registry.register({displayText(){return i.Msg$$module$build$src$core$msg.DUPLICATE_BLOCK},preconditionFn(e){return e=e.block,!e.isInFlyout&&e.isDeletable()&&e.isMovable()?e.isDuplicatable()?"enabled":"disabled":"hidden"},callback(e){if(e.block){var t=e.block.toCopyData();t&&To(t,e.block.workspace)}},scopeType:xe.ScopeType.BLOCK,id:"blockDuplicate",weight:1})},oh=function(){xe.registry.register({displayText(e){return e.block.hasIcon(po.TYPE)?i.Msg$$module$build$src$core$msg.REMOVE_COMMENT:i.Msg$$module$build$src$core$msg.ADD_COMMENT},preconditionFn(e){return e=e.block,!e.isInFlyout&&e.workspace.options.comments&&!e.isCollapsed()&&e.isEditable()?"enabled":"hidden"},callback(e){e=e.block,e.hasIcon(po.TYPE)?e.setCommentText(null):e.setCommentText("")},scopeType:xe.ScopeType.BLOCK,id:"blockComment",weight:2})},ih=function(){xe.registry.register({displayText(e){return e.block.getInputsInline()?i.Msg$$module$build$src$core$msg.EXTERNAL_INPUTS:i.Msg$$module$build$src$core$msg.INLINE_INPUTS},preconditionFn(e){if(e=e.block,!e.isInFlyout&&e.isMovable()&&!e.isCollapsed()){for(let t=1;t(t.has(Ft)?1:0),e.getInheritedDisabled()||t?"disabled":"enabled"}return"hidden"},callback(e){e=e.block;const t=i.getGroup$$module$build$src$core$events$utils();t||i.setGroup$$module$build$src$core$events$utils(!0),e.setDisabledReason(!e.hasDisabledReason(Ft),Ft),i.setGroup$$module$build$src$core$events$utils(t)},scopeType:xe.ScopeType.BLOCK,id:"blockDisable",weight:5})},ah=function(){xe.registry.register({displayText(e){var t=e.block;return e=t.getDescendants(!1).length,(t=t.getNextBlock())&&(e-=t.getDescendants(!1).length),e===1?i.Msg$$module$build$src$core$msg.DELETE_BLOCK:i.Msg$$module$build$src$core$msg.DELETE_X_BLOCKS.replace("%1",`${e}`)},preconditionFn(e){return!e.block.isInFlyout&&e.block.isDeletable()?"enabled":"hidden"},callback(e){e.block&&e.block.checkAndDelete()},scopeType:xe.ScopeType.BLOCK,id:"blockDelete",weight:6})},lh=function(){xe.registry.register({displayText(){return i.Msg$$module$build$src$core$msg.HELP},preconditionFn(e){return e=e.block,(typeof e.helpUrl=="function"?e.helpUrl():e.helpUrl)?"enabled":"hidden"},callback(e){e.block.showHelp()},scopeType:xe.ScopeType.BLOCK,id:"blockHelp",weight:7})},ch=function(){xe.registry.register({displayText:()=>i.Msg$$module$build$src$core$msg.REMOVE_COMMENT,preconditionFn(e){let t;return(t=e.comment)!=null&&t.isDeletable()?"enabled":"hidden"},callback(e){i.setGroup$$module$build$src$core$events$utils(!0);let t;(t=e.comment)==null||t.dispose(),i.setGroup$$module$build$src$core$events$utils(!1)},scopeType:xe.ScopeType.COMMENT,id:"commentDelete",weight:6})},uh=function(){xe.registry.register({displayText:()=>i.Msg$$module$build$src$core$msg.DUPLICATE_COMMENT,preconditionFn(e){let t;return(t=e.comment)!=null&&t.isMovable()?"enabled":"hidden"},callback(e){if(e.comment){var t=e.comment.toCopyData();t&&To(t,e.comment.workspace)}},scopeType:xe.ScopeType.COMMENT,id:"commentDuplicate",weight:1})},dh=function(){xe.registry.register({displayText:()=>i.Msg$$module$build$src$core$msg.ADD_COMMENT,preconditionFn:e=>{let t;return(t=e.workspace)!=null&&t.isMutator?"hidden":"enabled"},callback:(e,t)=>{if(e=e.workspace){i.setGroup$$module$build$src$core$events$utils(!0);var o=new kl(e);o.setText(i.Msg$$module$build$src$core$msg.WORKSPACE_COMMENT_DEFAULT_TEXT),o.moveTo(sb(new G(t.clientX,t.clientY),e)),i.setSelected$$module$build$src$core$common(o),i.setGroup$$module$build$src$core$events$utils(!1)}},scopeType:xe.ScopeType.WORKSPACE,id:"commentCreate",weight:8})},sb=function(e,t){var o=t.getInjectionDiv().getBoundingClientRect();return e=new G(e.x-o.left,e.y-o.top),o=t.getOriginOffsetInPixels(),e=G.difference(e,o),e.scale(1/t.scale),e},ob=function(){sh(),oh(),ih(),nh(),rh(),ah(),lh()},ib=function(){uh(),ch(),dh()},hh=function(){tb(),ob()},nb=function(e){return e.paste!==void 0},rb=function(e){return e.getSvgRoot!==void 0},ab=function(e){return typeof e.id=="string"&&e.workspace!==void 0&&e.select!==void 0&&e.unselect!==void 0},lb=function(e){return e.isSelectable()},cb=function(e){U().hideChaff(e)},j=j||{},j.scope={},j.ASSUME_ES5=!1,j.ASSUME_NO_NATIVE_MAP=!1,j.ASSUME_NO_NATIVE_SET=!1,j.SIMPLE_FROUND_POLYFILL=!1,j.ISOLATE_POLYFILLS=!1,j.FORCE_POLYFILL_PROMISE=!1,j.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1,j.defineProperty=j.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(e,t,o){return e==Array.prototype||e==Object.prototype||(e[t]=o.value),e},j.getGlobal=function(e){e=[typeof globalThis=="object"&&globalThis,e,typeof window=="object"&&window,typeof self=="object"&&self,typeof wn=="object"&&wn];for(var t=0;t>>0,j.propertyToPolyfillSymbol[c]=j.IS_SYMBOL_NATIVE?j.global.Symbol(c):j.POLYFILL_PREFIX+o+"$"+c),j.defineProperty(n,j.propertyToPolyfillSymbol[c],{configurable:!0,writable:!0,value:t})))},j.underscoreProtoCanBeSet=function(){var e={a:!0},t={};try{return t.__proto__=e,t.a}catch{}return!1},j.setPrototypeOf=j.TRUST_ES6_POLYFILLS&&typeof Object.setPrototypeOf=="function"?Object.setPrototypeOf:j.underscoreProtoCanBeSet()?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null,j.arrayIteratorImpl=function(e){var t=0;return function(){return to&&(o=Math.max(o+c,0));o{const e=pb.length,t=[];for(let o=0;20>o;o++)t[o]=pb.charAt(Math.random()*e);return t.join("")}},OT=0,ph={TEST_ONLY:gb};ph.genUid=C,ph.getNextUniqueId=k;var mb="",or=!0,gh=0,mh="ORPHANED_BLOCK",io=[],fb={FIRE_QUEUE:io,enqueueEvent:Ze,fireNow:Ne,fireInternal:Oe,setGroupInternal:ye};i.disable$$module$build$src$core$events$utils,i.enable$$module$build$src$core$events$utils,i.getGroup$$module$build$src$core$events$utils,i.setGroup$$module$build$src$core$events$utils,i.setRecordUndo$$module$build$src$core$events$utils;var ir=Object.create(null),$b,Zo=null,bb,nr=[],vb={defineBlocksWithJsonArrayInternal:Ve},Dt={TEST_ONLY:vb};Dt.createBlockDefinitionsFromJsonArray=i.createBlockDefinitionsFromJsonArray$$module$build$src$core$common,Dt.defineBlocks=i.defineBlocks$$module$build$src$core$common,Dt.defineBlocksWithJsonArray=pe,Dt.draggingConnections=nr,Dt.getAllWorkspaces=ee,Dt.getBlockTypeCounts=be,Dt.getMainWorkspace=U,Dt.getParentContainer=de,Dt.getSelected=I,Dt.getWorkspaceById=q,Dt.registerWorkspace=B,Dt.setMainWorkspace=re,Dt.setParentContainer=W,Dt.setSelected=i.setSelected$$module$build$src$core$common,Dt.svgResize=Ce,Dt.unregisterWorkpace=H;var Ui=class{constructor(){this.workspaceId=void 0,this.isUiEvent=!1,this.type="",this.group=i.getGroup$$module$build$src$core$events$utils(),this.recordUndo=me()}toJson(){return{type:this.type,group:this.group}}static fromJson(e,t,o){return o.isBlank=!1,o.group=e.group||"",o.workspaceId=t.id,o}isNull(){return!1}run(e){}getEventWorkspace_(){let e;if(this.workspaceId&&(e=q(this.workspaceId)),!e)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return e}},Cs=class extends Ui{constructor(e){super(),this.recordUndo=!1,this.isUiEvent=!0,this.isBlank=typeof e>"u",this.workspaceId=e||""}},fh=class extends Cs{constructor(e,t,o){t=e?e.workspace.id:t,t===null&&(t=void 0),super(t),this.type=O.CLICK,this.blockId=e?e.id:void 0,this.targetType=o}toJson(){const e=super.toJson();if(!this.targetType)throw Error("The click target type is undefined. Either pass a block to the constructor, or call fromJson");return e.targetType=this.targetType,e.blockId=this.blockId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new fh),t.targetType=e.targetType,t.blockId=e.blockId,t}},$h;(function(e){e.BLOCK="block",e.WORKSPACE="workspace",e.ZOOM_CONTROLS="zoom_controls"})($h||($h={})),r(F.EVENT,O.CLICK,fh);var MT=750,yb="ontouchstart"in globalThis||!!(globalThis.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!globalThis.navigator||!globalThis.navigator.maxTouchPoints&&!globalThis.navigator.msMaxTouchPoints),tl=null,Qo={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"],mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]},sl=0,ei={TOUCH_ENABLED:yb,TOUCH_MAP:Qo};ei.checkTouchIdentifier=bt,ei.clearTouchIdentifier=ke,ei.getTouchIdentifierFromEvent=Pe,ei.longStart=Je,ei.longStop=_e,ei.shouldHandleEvent=$e;var bh,_b,wb,Cb,ol,il,vh,Tb,kb,Sb;(function(e){function t(n){return o.includes(n.toUpperCase())}bh=e;const o=bh.toUpperCase();_b=t("JavaFX"),wb=t("WebKit"),Cb=t("Gecko")&&!wb,ol=t("Android"),e=globalThis.navigator&&globalThis.navigator.maxTouchPoints,il=t("iPad")||t("Macintosh")&&0{n.push(this.componentData.get(c))}),n.sort(function(c,h){return c.weight-h.weight}),n.forEach(function(c){o.push(c.component)})}else e.forEach(n=>{o.push(this.componentData.get(n).component)});return o}};lt.Capability=ro,(function(e){e=e.ComponentWeight||(e.ComponentWeight={}),e[e.TOOLBOX_WEIGHT=0]="TOOLBOX_WEIGHT",e[e.FLYOUT_WEIGHT=1]="FLYOUT_WEIGHT",e[e.TRASHCAN_WEIGHT=2]="TRASHCAN_WEIGHT",e[e.ZOOM_CONTROLS_WEIGHT=3]="ZOOM_CONTROLS_WEIGHT"})(lt||(lt={})),lt.ComponentWeight;var wh=!1,Ch=` -.blocklySvg { - background-color: #fff; - outline: none; - overflow: hidden; /* IE overflows by default. */ - position: absolute; - display: block; -} - -.blocklyWidgetDiv { - display: none; - position: absolute; - z-index: 99999; /* big value for bootstrap3 compatibility */ -} - -.injectionDiv { - height: 100%; - position: relative; - overflow: hidden; /* So blocks in drag surface disappear at edges */ - touch-action: none; - user-select: none; - -webkit-user-select: none; -} - -.blocklyNonSelectable { - user-select: none; - -ms-user-select: none; - -webkit-user-select: none; -} - -.blocklyBlockCanvas.blocklyCanvasTransitioning, -.blocklyBubbleCanvas.blocklyCanvasTransitioning { - transition: transform .5s; -} - -.blocklyTooltipDiv { - background-color: #ffffc7; - border: 1px solid #ddc; - box-shadow: 4px 4px 20px 1px rgba(0,0,0,.15); - color: #000; - display: none; - font: 9pt sans-serif; - opacity: .9; - padding: 2px; - position: absolute; - z-index: 100000; /* big value for bootstrap3 compatibility */ -} - -.blocklyDropDownDiv { - position: absolute; - left: 0; - top: 0; - z-index: 1000; - display: none; - border: 1px solid; - border-color: #dadce0; - background-color: #fff; - border-radius: 2px; - padding: 4px; - box-shadow: 0 0 3px 1px rgba(0,0,0,.3); -} - -.blocklyDropDownDiv.blocklyFocused { - box-shadow: 0 0 6px 1px rgba(0,0,0,.3); -} - -.blocklyDropDownContent { - max-height: 300px; /* @todo: spec for maximum height. */ - overflow: auto; - overflow-x: hidden; - position: relative; -} - -.blocklyDropDownArrow { - position: absolute; - left: 0; - top: 0; - width: 16px; - height: 16px; - z-index: -1; - background-color: inherit; - border-color: inherit; -} - -.blocklyDropDownButton { - display: inline-block; - float: left; - padding: 0; - margin: 4px; - border-radius: 4px; - outline: none; - border: 1px solid; - transition: box-shadow .1s; - cursor: pointer; -} - -.blocklyArrowTop { - border-top: 1px solid; - border-left: 1px solid; - border-top-left-radius: 4px; - border-color: inherit; -} - -.blocklyArrowBottom { - border-bottom: 1px solid; - border-right: 1px solid; - border-bottom-right-radius: 4px; - border-color: inherit; -} - -.blocklyResizeSE { - cursor: se-resize; - fill: #aaa; -} - -.blocklyResizeSW { - cursor: sw-resize; - fill: #aaa; -} - -.blocklyResizeLine { - stroke: #515A5A; - stroke-width: 1; -} - -.blocklyHighlightedConnectionPath { - fill: none; - stroke: #fc3; - stroke-width: 4px; -} - -.blocklyPathLight { - fill: none; - stroke-linecap: round; - stroke-width: 1; -} - -.blocklySelected>.blocklyPathLight { - display: none; -} - -.blocklyDraggable { - cursor: grab; - cursor: -webkit-grab; -} - -.blocklyDragging { - cursor: grabbing; - cursor: -webkit-grabbing; - /* Drag surface disables events to not block the toolbox, so we have to - * reenable them here for the cursor values to work. */ - pointer-events: auto; -} - - /* Changes cursor on mouse down. Not effective in Firefox because of - https://bugzilla.mozilla.org/show_bug.cgi?id=771241 */ -.blocklyDraggable:active { - cursor: grabbing; - cursor: -webkit-grabbing; -} - -.blocklyDragging.blocklyDraggingDelete { - cursor: url("<<>>/handdelete.cur"), auto; -} - -.blocklyDragging>.blocklyPath, -.blocklyDragging>.blocklyPathLight { - fill-opacity: .8; - stroke-opacity: .8; -} - -.blocklyDragging>.blocklyPathDark { - display: none; -} - -.blocklyDisabled>.blocklyPath { - fill-opacity: .5; - stroke-opacity: .5; -} - -.blocklyDisabled>.blocklyPathLight, -.blocklyDisabled>.blocklyPathDark { - display: none; -} - -.blocklyInsertionMarker>.blocklyPath, -.blocklyInsertionMarker>.blocklyPathLight, -.blocklyInsertionMarker>.blocklyPathDark { - fill-opacity: .2; - stroke: none; -} - -.blocklyNonEditableText>text { - pointer-events: none; -} - -.blocklyFlyout { - position: absolute; - z-index: 20; -} - -.blocklyText text { - cursor: default; -} - -.blocklyHidden { - display: none; -} - -.blocklyFieldDropdown:not(.blocklyHidden) { - display: block; -} - -.blocklyIconGroup { - cursor: default; -} - -.blocklyIconGroup:not(:hover), -.blocklyIconGroupReadonly { - opacity: .6; -} - -.blocklyIconShape { - fill: #00f; - stroke: #fff; - stroke-width: 1px; -} - -.blocklyIconSymbol { - fill: #fff; -} - -.blocklyMinimalBody { - margin: 0; - padding: 0; - height: 100%; -} - -.blocklyHtmlInput { - border: none; - border-radius: 4px; - height: 100%; - margin: 0; - outline: none; - padding: 0; - width: 100%; - text-align: center; - display: block; - box-sizing: border-box; -} - -/* Remove the increase and decrease arrows on the field number editor */ -input.blocklyHtmlInput[type=number]::-webkit-inner-spin-button, -input.blocklyHtmlInput[type=number]::-webkit-outer-spin-button { - -webkit-appearance: none; - margin: 0; -} - -input[type=number] { - -moz-appearance: textfield; -} - -.blocklyMainBackground { - stroke-width: 1; - stroke: #c6c6c6; /* Equates to #ddd due to border being off-pixel. */ -} - -.blocklyMutatorBackground { - fill: #fff; - stroke: #ddd; - stroke-width: 1; -} - -.blocklyFlyoutBackground { - fill: #ddd; - fill-opacity: .8; -} - -.blocklyMainWorkspaceScrollbar { - z-index: 20; -} - -.blocklyFlyoutScrollbar { - z-index: 30; -} - -.blocklyScrollbarHorizontal, -.blocklyScrollbarVertical { - position: absolute; - outline: none; -} - -.blocklyScrollbarBackground { - opacity: 0; - pointer-events: none; -} - -.blocklyScrollbarHandle { - fill: #ccc; -} - -.blocklyScrollbarBackground:hover+.blocklyScrollbarHandle, -.blocklyScrollbarHandle:hover { - fill: #bbb; -} - -/* Darken flyout scrollbars due to being on a grey background. */ -/* By contrast, workspace scrollbars are on a white background. */ -.blocklyFlyout .blocklyScrollbarHandle { - fill: #bbb; -} - -.blocklyFlyout .blocklyScrollbarBackground:hover+.blocklyScrollbarHandle, -.blocklyFlyout .blocklyScrollbarHandle:hover { - fill: #aaa; -} - -.blocklyInvalidInput { - background: #faa; -} - -.blocklyVerticalMarker { - stroke-width: 3px; - fill: rgba(255,255,255,.5); - pointer-events: none; -} - -.blocklyComputeCanvas { - position: absolute; - width: 0; - height: 0; -} - -.blocklyNoPointerEvents { - pointer-events: none; -} - -.blocklyContextMenu { - border-radius: 4px; - max-height: 100%; -} - -.blocklyDropdownMenu { - border-radius: 2px; - padding: 0 !important; -} - -.blocklyDropdownMenu .blocklyMenuItem { - /* 28px on the left for icon or checkbox. */ - padding-left: 28px; -} - -/* BiDi override for the resting state. */ -.blocklyDropdownMenu .blocklyMenuItemRtl { - /* Flip left/right padding for BiDi. */ - padding-left: 5px; - padding-right: 28px; -} - -.blocklyWidgetDiv .blocklyMenu { - background: #fff; - border: 1px solid transparent; - box-shadow: 0 0 3px 1px rgba(0,0,0,.3); - font: normal 13px Arial, sans-serif; - margin: 0; - outline: none; - padding: 4px 0; - position: absolute; - overflow-y: auto; - overflow-x: hidden; - max-height: 100%; - z-index: 20000; /* Arbitrary, but some apps depend on it... */ -} - -.blocklyWidgetDiv .blocklyMenu.blocklyFocused { - box-shadow: 0 0 6px 1px rgba(0,0,0,.3); -} - -.blocklyDropDownDiv .blocklyMenu { - background: inherit; /* Compatibility with gapi, reset from goog-menu */ - border: inherit; /* Compatibility with gapi, reset from goog-menu */ - font: normal 13px "Helvetica Neue", Helvetica, sans-serif; - outline: none; - position: relative; /* Compatibility with gapi, reset from goog-menu */ - z-index: 20000; /* Arbitrary, but some apps depend on it... */ -} - -/* State: resting. */ -.blocklyMenuItem { - border: none; - color: #000; - cursor: pointer; - list-style: none; - margin: 0; - /* 7em on the right for shortcut. */ - min-width: 7em; - padding: 6px 15px; - white-space: nowrap; -} - -/* State: disabled. */ -.blocklyMenuItemDisabled { - color: #ccc; - cursor: inherit; -} - -/* State: hover. */ -.blocklyMenuItemHighlight { - background-color: rgba(0,0,0,.1); -} - -/* State: selected/checked. */ -.blocklyMenuItemCheckbox { - height: 16px; - position: absolute; - width: 16px; -} - -.blocklyMenuItemSelected .blocklyMenuItemCheckbox { - background: url(<<>>/sprites.png) no-repeat -48px -16px; - float: left; - margin-left: -24px; - position: static; /* Scroll with the menu. */ -} - -.blocklyMenuItemRtl .blocklyMenuItemCheckbox { - float: right; - margin-right: -24px; -} - -.blocklyBlockDragSurface, .blocklyAnimationLayer { - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - overflow: visible !important; - z-index: 80; - pointer-events: none; -} -`,Th={};Th.inject=cu,Th.register=Et;var G=class{constructor(e,t){this.x=e,this.y=t}clone(){return new G(this.x,this.y)}scale(e){return this.x*=e,this.y*=e,this}translate(e,t){return this.x+=e,this.y+=t,this}static equals(e,t){return e===t?!0:e&&t?e.x===t.x&&e.y===t.y:!1}static distance(e,t){const o=e.x-t.x;return e=e.y-t.y,Math.sqrt(o*o+e*e)}static magnitude(e){return Math.sqrt(e.x*e.x+e.y*e.y)}static difference(e,t){return new G(e.x-t.x,e.y-t.y)}static sum(e,t){return new G(e.x+t.x,e.y+t.y)}},rr="http://www.w3.org/2000/svg",Fs="http://www.w3.org/1999/xhtml",es="http://www.w3.org/1999/xlink",ao;(function(e){e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE"})(ao||(ao={}));var Ts=null,kh=0,rl=null,xt={HTML_NS:Fs};xt.NodeType=ao,xt.SVG_NS=rr,xt.XLINK_NS=es,xt.addClass=ge,xt.createSvgElement=N,xt.getFastTextWidth=Nn,xt.getFastTextWidthWithSizeString=ua,xt.getTextWidth=uu,xt.hasClass=Hm,xt.insertAfter=Uo,xt.measureFontMetrics=da,xt.removeClass=ot,xt.removeClasses=la,xt.removeNode=Ke,xt.setCssTransform=ca,xt.startTextWidthCache=Ho,xt.stopTextWidthCache=Wo;var x=class{constructor(e){this.tagName=e}toString(){return this.tagName}};x.ANIMATE=new x("animate"),x.CIRCLE=new x("circle"),x.CLIPPATH=new x("clipPath"),x.DEFS=new x("defs"),x.FECOMPOSITE=new x("feComposite"),x.FECOMPONENTTRANSFER=new x("feComponentTransfer"),x.FEFLOOD=new x("feFlood"),x.FEFUNCA=new x("feFuncA"),x.FEGAUSSIANBLUR=new x("feGaussianBlur"),x.FEPOINTLIGHT=new x("fePointLight"),x.FESPECULARLIGHTING=new x("feSpecularLighting"),x.FILTER=new x("filter"),x.FOREIGNOBJECT=new x("foreignObject"),x.G=new x("g"),x.IMAGE=new x("image"),x.LINE=new x("line"),x.PATH=new x("path"),x.PATTERN=new x("pattern"),x.POLYGON=new x("polygon"),x.RECT=new x("rect"),x.SVG=new x("svg"),x.TEXT=new x("text"),x.TSPAN=new x("tspan");var qe=class{constructor(e,t,o,n){this.top=e,this.bottom=t,this.left=o,this.right=n}clone(){return new qe(this.top,this.bottom,this.left,this.right)}getHeight(){return this.bottom-this.top}getWidth(){return this.right-this.left}contains(e,t){return e>=this.left&&e<=this.right&&t>=this.top&&t<=this.bottom}intersects(e){return this.left<=e.right&&this.right>=e.left&&this.bottom>=e.top&&this.top<=e.bottom}static equals(e,t){return e===t?!0:e&&t?e.top===t.top&&e.bottom===t.bottom&&e.left===t.left&&e.right===t.right:!1}static createFromPoint(e,t,o){const n=e.x;return e=e.y,new qe(e,e+o,n,n+t)}},Le=class{constructor(e,t){this.width=e,this.height=t}static equals(e,t){return e===t?!0:e&&t?e.width===t.width&&e.height===t.height:!1}static max(e,t){return new Le(Math.max(e.width,t.width),Math.max(e.height,t.height))}static min(e,t){return new Le(Math.min(e.width,t.width),Math.min(e.height,t.height))}},Mb={getSizeInternal:Wm},So={TEST_ONLY:Mb};So.getBorderBox=pu,So.getComputedStyle=Ms,So.getContainerOffsetToScrollInto=gu,So.getPageOffset=yo,So.getSize=Ln,So.getViewportPageOffset=hu,So.scrollIntoContainerView=ha;var Nb=/translate\(\s*([-+\d.e]+)([ ,]\s*([-+\d.e]+)\s*)?/,Lb=/transform:\s*translate(?:3d)?\(\s*([-+\d.e]+)\s*px([ ,]\s*([-+\d.e]+)\s*px)?/,PT={XY_REGEX:Nb,XY_STYLE_REGEX:Lb},ti={TEST_ONLY:PT};ti.getDocumentScroll=fu,ti.getInjectionDivXY=pa,ti.getRelativeXY=Pn,ti.getViewportBBox=mu,ti.screenToWsCoordinates=Gm,ti.wsToScreenCoordinates=Vm;var mt=class{constructor(e,t,o,n,c){this.workspace=e,this.horizontal=t,this.oldHostMetrics=null,this.ratio=1,this.origin=new G(0,0),this.startDragHandle=this.handlePosition=this.handleLength=this.scrollbarLength=this.startDragMouse=0,this.containerVisible=this.isHandleVisible=!0,this.position=new G(0,0),this.onMouseMoveWrapper_=this.onMouseUpWrapper_=null,this.pair=o||!1,this.margin=c!==void 0?c:mt.DEFAULT_SCROLLBAR_MARGIN,e="blocklyScrollbar"+(this.horizontal?"Horizontal":"Vertical"),n&&(e+=" "+n),this.outerSvg=N(x.SVG,{class:e}),n=N(x.G,{},this.outerSvg),this.svgBackground=N(x.RECT,{class:"blocklyScrollbarBackground"},n),e=Math.floor((mt.scrollbarThickness-5)/2),this.svgHandle=N(x.RECT,{class:"blocklyScrollbarHandle",rx:e,ry:e},n),this.workspace.getThemeManager().subscribe(this.svgHandle,"scrollbarColour","fill"),this.workspace.getThemeManager().subscribe(this.svgHandle,"scrollbarOpacity","fill-opacity"),Uo(this.outerSvg,this.workspace.getParentSvg()),this.setInitialThickness(),t?(this.lengthAttribute_="width",this.positionAttribute_="x"):(this.lengthAttribute_="height",this.positionAttribute_="y"),this.onMouseDownBarWrapper_=X(this.svgBackground,"pointerdown",this,this.onMouseDownBar),this.onMouseDownHandleWrapper_=X(this.svgHandle,"pointerdown",this,this.onMouseDownHandle)}setInitialThickness(){const e=mt.scrollbarThickness;this.horizontal?(this.svgBackground.setAttribute("height",String(e)),this.outerSvg.setAttribute("height",String(e)),this.svgHandle.setAttribute("height",String(e-5)),this.svgHandle.setAttribute("y","2.5")):(this.svgBackground.setAttribute("width",String(e)),this.outerSvg.setAttribute("width",String(e)),this.svgHandle.setAttribute("width",String(e-5)),this.svgHandle.setAttribute("x","2.5"))}dispose(){this.cleanUp(),ze(this.onMouseDownBarWrapper_),ze(this.onMouseDownHandleWrapper_),Ke(this.outerSvg),this.workspace.getThemeManager().unsubscribe(this.svgHandle)}constrainHandleLength(e){return e=0>=e||isNaN(e)?0:Math.min(e,this.scrollbarLength)}setHandleLength(e){this.handleLength=e,this.svgHandle.setAttribute(this.lengthAttribute_,String(this.handleLength))}constrainHandlePosition(e){return e=0>=e||isNaN(e)?0:Math.min(e,this.scrollbarLength-this.handleLength)}setHandlePosition(e){this.handlePosition=e,this.svgHandle.setAttribute(this.positionAttribute_,String(this.handlePosition))}setScrollbarLength(e){this.scrollbarLength=e,this.outerSvg.setAttribute(this.lengthAttribute_,String(this.scrollbarLength)),this.svgBackground.setAttribute(this.lengthAttribute_,String(this.scrollbarLength))}setPosition(e,t){this.position.x=e,this.position.y=t,ca(this.outerSvg,"translate("+(this.position.x+this.origin.x)+"px,"+(this.position.y+this.origin.y)+"px)")}resize(e){!e&&(e=this.workspace.getMetrics(),!e)||this.oldHostMetrics&&mt.metricsAreEquivalent(e,this.oldHostMetrics)||(this.horizontal?this.resizeHorizontal(e):this.resizeVertical(e),this.oldHostMetrics=e,this.updateMetrics())}requiresViewResize(e){return this.oldHostMetrics?this.oldHostMetrics.viewWidth!==e.viewWidth||this.oldHostMetrics.viewHeight!==e.viewHeight||this.oldHostMetrics.absoluteLeft!==e.absoluteLeft||this.oldHostMetrics.absoluteTop!==e.absoluteTop:!0}resizeHorizontal(e){this.requiresViewResize(e)?this.resizeViewHorizontal(e):this.resizeContentHorizontal(e)}resizeViewHorizontal(e){var t=e.viewWidth-2*this.margin;this.pair&&(t-=mt.scrollbarThickness),this.setScrollbarLength(Math.max(0,t)),t=e.absoluteLeft+this.margin,this.pair&&this.workspace.RTL&&(t+=mt.scrollbarThickness),this.setPosition(t,e.absoluteTop+e.viewHeight-mt.scrollbarThickness-this.margin),this.resizeContentHorizontal(e)}resizeContentHorizontal(e){if(e.viewWidth>=e.scrollWidth)this.setHandleLength(this.scrollbarLength),this.setHandlePosition(0),this.pair||this.setVisible(!1);else{this.pair||this.setVisible(!0);var t=this.scrollbarLength*e.viewWidth/e.scrollWidth;t=this.constrainHandleLength(t),this.setHandleLength(t),t=e.scrollWidth-e.viewWidth;var o=this.scrollbarLength-this.handleLength;e=(e.viewLeft-e.scrollLeft)/t*o,e=this.constrainHandlePosition(e),this.setHandlePosition(e),this.ratio=o/t}}resizeVertical(e){this.requiresViewResize(e)?this.resizeViewVertical(e):this.resizeContentVertical(e)}resizeViewVertical(e){let t=e.viewHeight-2*this.margin;this.pair&&(t-=mt.scrollbarThickness),this.setScrollbarLength(Math.max(0,t)),this.setPosition(this.workspace.RTL?e.absoluteLeft+this.margin:e.absoluteLeft+e.viewWidth-mt.scrollbarThickness-this.margin,e.absoluteTop+this.margin),this.resizeContentVertical(e)}resizeContentVertical(e){if(e.viewHeight>=e.scrollHeight)this.setHandleLength(this.scrollbarLength),this.setHandlePosition(0),this.pair||this.setVisible(!1);else{this.pair||this.setVisible(!0);var t=this.scrollbarLength*e.viewHeight/e.scrollHeight;t=this.constrainHandleLength(t),this.setHandleLength(t),t=e.scrollHeight-e.viewHeight;var o=this.scrollbarLength-this.handleLength;e=(e.viewTop-e.scrollTop)/t*o,e=this.constrainHandlePosition(e),this.setHandlePosition(e),this.ratio=o/t}}isVisible(){return this.isHandleVisible}setContainerVisible(e){const t=e!==this.containerVisible;this.containerVisible=e,t&&this.updateDisplay_()}setVisible(e){if(this.pair)throw Error("Unable to toggle visibility of paired scrollbars.");this.setVisibleInternal(e)}setVisibleInternal(e){const t=e!==this.isVisible();this.isHandleVisible=e,t&&this.updateDisplay_()}updateDisplay_(){this.containerVisible&&this.isVisible()?this.outerSvg.setAttribute("display","block"):this.outerSvg.setAttribute("display","none")}onMouseDownBar(e){if(this.workspace.markFocused(),ke(),this.cleanUp(),ve(e))e.stopPropagation();else{var t=st(e,this.workspace.getParentSvg(),this.workspace.getInverseScreenCTM());t=this.horizontal?t.x:t.y;var o=pa(this.svgHandle);o=this.horizontal?o.x:o.y;var n=this.handlePosition,c=.95*this.handleLength;t<=o?n-=c:t>=o+this.handleLength&&(n+=c),this.setHandlePosition(this.constrainHandlePosition(n)),this.updateMetrics(),e.stopPropagation(),e.preventDefault()}}onMouseDownHandle(e){this.workspace.markFocused(),this.cleanUp(),ve(e)?e.stopPropagation():(this.startDragHandle=this.handlePosition,this.startDragMouse=this.horizontal?e.clientX:e.clientY,this.onMouseUpWrapper_=X(document,"pointerup",this,this.onMouseUpHandle),this.onMouseMoveWrapper_=X(document,"pointermove",this,this.onMouseMoveHandle),e.stopPropagation(),e.preventDefault())}onMouseMoveHandle(e){this.setHandlePosition(this.constrainHandlePosition(this.startDragHandle+((this.horizontal?e.clientX:e.clientY)-this.startDragMouse))),this.updateMetrics()}onMouseUpHandle(){ke(),this.cleanUp()}cleanUp(){this.workspace.hideChaff(!0),this.onMouseUpWrapper_&&(ze(this.onMouseUpWrapper_),this.onMouseUpWrapper_=null),this.onMouseMoveWrapper_&&(ze(this.onMouseMoveWrapper_),this.onMouseMoveWrapper_=null)}getRatio_(){let e=this.handlePosition/(this.scrollbarLength-this.handleLength);return isNaN(e)&&(e=0),e}updateMetrics(){const e=this.getRatio_();this.horizontal?this.workspace.setMetrics({x:e}):this.workspace.setMetrics({y:e})}set(e,t){this.setHandlePosition(this.constrainHandlePosition(e*this.ratio)),(t||t===void 0)&&this.updateMetrics()}setOrigin(e,t){this.origin=new G(e,t)}static metricsAreEquivalent(e,t){return e.viewWidth===t.viewWidth&&e.viewHeight===t.viewHeight&&e.viewLeft===t.viewLeft&&e.viewTop===t.viewTop&&e.absoluteTop===t.absoluteTop&&e.absoluteLeft===t.absoluteLeft&&e.scrollWidth===t.scrollWidth&&e.scrollHeight===t.scrollHeight&&e.scrollLeft===t.scrollLeft&&e.scrollTop===t.scrollTop}};mt.scrollbarThickness=yb?25:15,mt.DEFAULT_SCROLLBAR_MARGIN=.5;var al={parseFromString:function(){throw Error("DOMParser was not found in the global scope and was not properly injected using injectDependencies")}},Sh={serializeToString:function(){throw Error("XMLSerializer was not foundin the global scope and was not properly injected using injectDependencies")}},{document:ll,DOMParser:ar,XMLSerializer:lr}=globalThis;ar&&(al=new ar),lr&&(Sh=new lr);var Pb="https://developers.google.com/blockly/xml",BT=/[\x00-\x09\x0B\x0C\x0E-\x1F]/g,Hi={NAME_SPACE:Pb};Hi.createElement=i.createElement$$module$build$src$core$utils$xml,Hi.createTextNode=i.createTextNode$$module$build$src$core$utils$xml,Hi.domToText=Ii,Hi.injectDependencies=Km,Hi.textToDom=i.textToDom$$module$build$src$core$utils$xml;var Eh="categoryToolbox",Bb="flyoutToolbox",Ee;(function(e){e[e.TOP=0]="TOP",e[e.BOTTOM=1]="BOTTOM",e[e.LEFT=2]="LEFT",e[e.RIGHT=3]="RIGHT"})(Ee||(Ee={}));var jb={hasCategoriesInternal:qm},Eo={};Eo.Position=Ee,Eo.TEST_ONLY=jb,Eo.convertFlyoutDefToJsonArray=Bn,Eo.convertToolboxDefToJson=ga,Eo.hasCategories=ma,Eo.isCategoryCollapsible=fa,Eo.parseToolboxTree=bu;var lo;(function(e){e[e.TOP=0]="TOP",e[e.BOTTOM=1]="BOTTOM"})(lo||(lo={}));var Wi;(function(e){e[e.LEFT=0]="LEFT",e[e.RIGHT=1]="RIGHT"})(Wi||(Wi={}));var Io;(function(e){e[e.UP=0]="UP",e[e.DOWN=1]="DOWN"})(Io||(Io={}));var si={};si.bumpDirection=Io,si.bumpPositionRect=ya,si.getCornerOppositeToolbox=va,si.getStartPositionRect=ba,si.horizontalPosition=Wi,si.verticalPosition=lo;var jt={width:96,height:124,url:"sprites.png"},Fb=class{constructor(e){this.workspace=e,this.id="zoomControls",this.boundEvents=[],this.zoomResetGroup=this.zoomOutGroup=this.zoomInGroup=null,this.HEIGHT=this.WIDTH=32,this.SMALL_SPACING=2,this.LARGE_SPACING=11,this.MARGIN_HORIZONTAL=this.MARGIN_VERTICAL=20,this.svgGroup=null,this.top=this.left=0,this.initialized=!1}createDom(){this.svgGroup=N(x.G,{});const e=String(Math.random()).substring(2);return this.createZoomOutSvg(e),this.createZoomInSvg(e),this.workspace.isMovable()&&this.createZoomResetSvg(e),this.svgGroup}init(){this.workspace.getComponentManager().addComponent({component:this,weight:lt.ComponentWeight.ZOOM_CONTROLS_WEIGHT,capabilities:[lt.Capability.POSITIONABLE]}),this.initialized=!0}dispose(){this.workspace.getComponentManager().removeComponent("zoomControls"),this.svgGroup&&Ke(this.svgGroup);for(const e of this.boundEvents)ze(e);this.boundEvents.length=0}getBoundingRectangle(){let e=this.SMALL_SPACING+2*this.HEIGHT;return this.zoomResetGroup&&(e+=this.LARGE_SPACING+this.HEIGHT),new qe(this.top,this.top+e,this.left,this.left+this.WIDTH)}position(e,t){if(this.initialized){var o=va(this.workspace,e),n=this.SMALL_SPACING+2*this.HEIGHT;if(this.zoomResetGroup&&(n+=this.LARGE_SPACING+this.HEIGHT),e=ba(o,new Le(this.WIDTH,n),this.MARGIN_HORIZONTAL,this.MARGIN_VERTICAL,e,this.workspace),o=o.vertical,t=ya(e,this.MARGIN_VERTICAL,o===lo.TOP?Io.DOWN:Io.UP,t),o===lo.TOP){var c=this.SMALL_SPACING+this.HEIGHT,h;(h=this.zoomInGroup)==null||h.setAttribute("transform","translate(0, "+c+")"),this.zoomResetGroup&&this.zoomResetGroup.setAttribute("transform","translate(0, "+(c+this.LARGE_SPACING+this.HEIGHT)+")")}else{h=this.zoomResetGroup?this.LARGE_SPACING+this.HEIGHT:0;let T;(T=this.zoomInGroup)==null||T.setAttribute("transform","translate(0, "+h+")"),h=h+this.SMALL_SPACING+this.HEIGHT,(c=this.zoomOutGroup)==null||c.setAttribute("transform","translate(0, "+h+")")}this.top=t.top,this.left=t.left;var $;($=this.svgGroup)==null||$.setAttribute("transform","translate("+this.left+","+this.top+")")}}createZoomOutSvg(e){this.zoomOutGroup=N(x.G,{class:"blocklyZoom blocklyZoomOut"},this.svgGroup);const t=N(x.CLIPPATH,{id:"blocklyZoomoutClipPath"+e},this.zoomOutGroup);N(x.RECT,{width:32,height:32},t),N(x.IMAGE,{width:jt.width,height:jt.height,x:-64,y:-92,"clip-path":"url(#blocklyZoomoutClipPath"+e+")"},this.zoomOutGroup).setAttributeNS(es,"xlink:href",this.workspace.options.pathToMedia+jt.url),this.boundEvents.push(X(this.zoomOutGroup,"pointerdown",null,this.zoom.bind(this,-1)))}createZoomInSvg(e){this.zoomInGroup=N(x.G,{class:"blocklyZoom blocklyZoomIn"},this.svgGroup);const t=N(x.CLIPPATH,{id:"blocklyZoominClipPath"+e},this.zoomInGroup);N(x.RECT,{width:32,height:32},t),N(x.IMAGE,{width:jt.width,height:jt.height,x:-32,y:-92,"clip-path":"url(#blocklyZoominClipPath"+e+")"},this.zoomInGroup).setAttributeNS(es,"xlink:href",this.workspace.options.pathToMedia+jt.url),this.boundEvents.push(X(this.zoomInGroup,"pointerdown",null,this.zoom.bind(this,1)))}zoom(e,t){this.workspace.markFocused(),this.workspace.zoomCenter(e),this.fireZoomEvent(),ke(),t.stopPropagation(),t.preventDefault()}createZoomResetSvg(e){this.zoomResetGroup=N(x.G,{class:"blocklyZoom blocklyZoomReset"},this.svgGroup);const t=N(x.CLIPPATH,{id:"blocklyZoomresetClipPath"+e},this.zoomResetGroup);N(x.RECT,{width:32,height:32},t),N(x.IMAGE,{width:jt.width,height:jt.height,y:-92,"clip-path":"url(#blocklyZoomresetClipPath"+e+")"},this.zoomResetGroup).setAttributeNS(es,"xlink:href",this.workspace.options.pathToMedia+jt.url),this.boundEvents.push(X(this.zoomResetGroup,"pointerdown",null,this.resetZoom.bind(this)))}resetZoom(e){this.workspace.markFocused();const t=Math.log(this.workspace.options.zoomOptions.startScale/this.workspace.scale)/Math.log(this.workspace.options.zoomOptions.scaleSpeed);this.workspace.beginCanvasTransition(),this.workspace.zoomCenter(t),this.workspace.scrollCenter(),setTimeout(this.workspace.endCanvasTransition.bind(this.workspace),500),this.fireZoomEvent(),ke(),e.stopPropagation(),e.preventDefault()}fireZoomEvent(){const e=new(V(O.CLICK))(null,this.workspace.id,"zoom_controls");z(e)}};Et(` -.blocklyZoom>image, .blocklyZoom>svg>image { - opacity: .4; -} - -.blocklyZoom>image:hover, .blocklyZoom>svg>image:hover { - opacity: .6; -} - -.blocklyZoom>image:active, .blocklyZoom>svg>image:active { - opacity: .8; -} -`);var zb=100,Ub=75,Hb=50,Wb=25,jT={BLOCKS:Hb,PROCEDURES:Ub,VARIABLES:zb,WORKSPACE_COMMENTS:Wb},Ih={};Ih.register=jn,Ih.unregister=Zm;var Gb=class{constructor(){this.priority=Wb}save(e){const t=[];for(const o of e.getTopComments())(e=xi(o,{addCoordinates:!0,saveIds:!0}))&&t.push(e);return t.length?t:null}load(e,t){for(const o of e)Fn(o,t,{recordUndo:me()})}clear(e){for(const t of e.getTopComments())t.dispose()}};jn("workspaceComments",new Gb);var cl={};cl.WorkspaceCommentSerializer=Gb,cl.append=Fn,cl.save=xi;var xh={};xh.register=_a,xh.unregister=Qm;var ul=class{paste(e,t,o){e=e.commentState,o&&(e.x=o.x,e.y=o.y),i.disable$$module$build$src$core$events$utils();let n;try{n=Fn(e,t),ef(n)}finally{i.enable$$module$build$src$core$events$utils()}return n?(K()&&z(new(V(O.COMMENT_CREATE))(n)),i.setSelected$$module$build$src$core$common(n),n):null}};ul.TYPE="workspace-comment",_a(ul.TYPE,new ul);var Dh;Dh=28,i.config$$module$build$src$core$config={dragRadius:5,flyoutDragRadius:10,snapRadius:Dh,connectingSnapRadius:Dh,currentConnectionPreference:8,bumpDelay:250},i.config$$module$build$src$core$config;var FT="aria-",zT="role",ks;(function(e){e.GRID="grid",e.GRIDCELL="gridcell",e.GROUP="group",e.LISTBOX="listbox",e.MENU="menu",e.MENUITEM="menuitem",e.MENUITEMCHECKBOX="menuitemcheckbox",e.OPTION="option",e.PRESENTATION="presentation",e.ROW="row",e.TREE="tree",e.TREEITEM="treeitem"})(ks||(ks={}));var Ct;(function(e){e.ACTIVEDESCENDANT="activedescendant",e.COLCOUNT="colcount",e.DISABLED="disabled",e.EXPANDED="expanded",e.INVALID="invalid",e.LABEL="label",e.LABELLEDBY="labelledby",e.LEVEL="level",e.ORIENTATION="orientation",e.POSINSET="posinset",e.ROWCOUNT="rowcount",e.SELECTED="selected",e.SETSIZE="setsize",e.VALUEMAX="valuemax",e.VALUEMIN="valuemin"})(Ct||(Ct={}));var cr={};cr.Role=ks,cr.State=Ct,cr.setRole=_o,cr.setState=It;var Ah=class{constructor(){this.menuItems=[],this.roleName=this.element=this.onKeyDownHandler=this.pointerLeaveHandler=this.pointerEnterHandler=this.clickHandler=this.pointerMoveHandler=this.highlightedItem=this.openingCoords=null}addChild(e){this.menuItems.push(e)}render(e){const t=document.createElement("div");t.className="blocklyMenu goog-menu blocklyNonSelectable",t.tabIndex=0,this.roleName&&_o(t,this.roleName),this.element=t;for(let o=0,n;n=this.menuItems[o];o++)t.appendChild(n.createDom());return this.pointerMoveHandler=X(t,"pointermove",this,this.handlePointerMove,!0),this.clickHandler=X(t,"pointerup",this,this.handleClick,!0),this.pointerEnterHandler=X(t,"pointerenter",this,this.handlePointerEnter,!0),this.pointerLeaveHandler=X(t,"pointerleave",this,this.handlePointerLeave,!0),this.onKeyDownHandler=X(t,"keydown",this,this.handleKeyEvent),e.appendChild(t),t}getElement(){return this.element}focus(){const e=this.getElement();e&&(e.focus({preventScroll:!0}),ge(e,"blocklyFocused"))}blur(){const e=this.getElement();e&&(e.blur(),ot(e,"blocklyFocused"))}setRole(e){this.roleName=e}dispose(){this.pointerMoveHandler&&(ze(this.pointerMoveHandler),this.pointerMoveHandler=null),this.clickHandler&&(ze(this.clickHandler),this.clickHandler=null),this.pointerEnterHandler&&(ze(this.pointerEnterHandler),this.pointerEnterHandler=null),this.pointerLeaveHandler&&(ze(this.pointerLeaveHandler),this.pointerLeaveHandler=null),this.onKeyDownHandler&&(ze(this.onKeyDownHandler),this.onKeyDownHandler=null);for(let e=0,t;t=this.menuItems[e];e++)t.dispose();this.element=null}getMenuItem(e){const t=this.getElement();for(;e&&e!==t;){if(e.classList.contains("blocklyMenuItem")){for(let o=0,n;n=this.menuItems[o];o++)if(n.getElement()===e)return n}e=e.parentElement}return null}setHighlighted(e){var t=this.highlightedItem;if(t&&(t.setHighlighted(!1),this.highlightedItem=null),e){e.setHighlighted(!0),this.highlightedItem=e,t=this.getElement();const o=t==null?void 0:t.parentElement,n=e.getElement();o&&n&&(ha(n,o),It(t,Ct.ACTIVEDESCENDANT,e.getId()))}}highlightNext(){const e=this.highlightedItem?this.menuItems.indexOf(this.highlightedItem):-1;this.highlightHelper(e,1)}highlightPrevious(){const e=this.highlightedItem?this.menuItems.indexOf(this.highlightedItem):-1;this.highlightHelper(0>e?this.menuItems.length:e,-1)}highlightFirst(){this.highlightHelper(-1,1)}highlightLast(){this.highlightHelper(this.menuItems.length,-1)}highlightHelper(e,t){e+=t;let o;for(;o=this.menuItems[e];){if(o.isEnabled()){this.setHighlighted(o);break}e+=t}}handlePointerMove(e){Math.max(Math.abs(e.movementX),Math.abs(e.movementY))!==0&&(e=this.getMenuItem(e.target))&&(e.isEnabled()?this.highlightedItem!==e&&this.setHighlighted(e):this.setHighlighted(null))}handleClick(e){const t=this.openingCoords;if(this.openingCoords=null,t&&typeof e.clientX=="number"){const o=new G(e.clientX,e.clientY);if(1>G.distance(t,o))return}(e=this.getMenuItem(e.target))&&e.performAction()}handlePointerEnter(e){this.focus()}handlePointerLeave(e){this.getElement()&&this.setHighlighted(null)}handleKeyEvent(e){if(this.menuItems.length&&!(e.shiftKey||e.ctrlKey||e.metaKey||e.altKey)){var t=this.highlightedItem;switch(e.key){case"Enter":case" ":t&&t.performAction();break;case"ArrowUp":this.highlightPrevious();break;case"ArrowDown":this.highlightNext();break;case"PageUp":case"Home":this.highlightFirst();break;case"PageDown":case"End":this.highlightLast();break;default:return}e.preventDefault(),e.stopPropagation()}}getSize(){const e=this.getElement(),t=Ln(e);return t.height=e.scrollHeight,t}},Rh=class{constructor(e,t){this.content=e,this.opt_value=t,this.enabled=!0,this.element=null,this.rightToLeft=!1,this.roleName=null,this.highlight=this.checked=this.checkable=!1,this.actionHandler=null}createDom(){const e=document.createElement("div");e.id=k(),this.element=e,e.className="blocklyMenuItem goog-menuitem "+(this.enabled?"":"blocklyMenuItemDisabled goog-menuitem-disabled ")+(this.checked?"blocklyMenuItemSelected goog-option-selected ":"")+(this.highlight?"blocklyMenuItemHighlight goog-menuitem-highlight ":"")+(this.rightToLeft?"blocklyMenuItemRtl goog-menuitem-rtl ":"");const t=document.createElement("div");if(t.className="blocklyMenuItemContent goog-menuitem-content",this.checkable){var o=document.createElement("div");o.className="blocklyMenuItemCheckbox goog-menuitem-checkbox",t.appendChild(o)}return o=this.content,typeof this.content=="string"&&(o=document.createTextNode(this.content)),t.appendChild(o),e.appendChild(t),this.roleName&&_o(e,this.roleName),It(e,Ct.SELECTED,this.checkable&&this.checked||!1),It(e,Ct.DISABLED,!this.enabled),e}dispose(){this.element=null}getElement(){return this.element}getId(){return this.element.id}getValue(){let e;return(e=this.opt_value)!=null?e:null}setRightToLeft(e){this.rightToLeft=e}setRole(e){this.roleName=e}setCheckable(e){this.checkable=e}setChecked(e){this.checked=e}setHighlighted(e){this.highlight=e;const t=this.getElement();t&&this.isEnabled()&&(e?(ge(t,"blocklyMenuItemHighlight"),ge(t,"goog-menuitem-highlight")):(ot(t,"blocklyMenuItemHighlight"),ot(t,"goog-menuitem-highlight")))}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}performAction(){this.isEnabled()&&this.actionHandler&&this.actionHandler(this)}onAction(e,t){this.actionHandler=e.bind(t)}},ur="_TEMP_COLLAPSED_INPUT",dl="_TEMP_COLLAPSED_FIELD",Ft="MANUALLY_DISABLED",UT={COLLAPSED_FIELD_NAME:dl,COLLAPSED_INPUT_NAME:ur,MANUALLY_DISABLED:Ft};(function(e){e[e.VALUE=1]="VALUE",e[e.STATEMENT=3]="STATEMENT",e[e.DUMMY=5]="DUMMY",e[e.CUSTOM=6]="CUSTOM",e[e.END_ROW=7]="END_ROW"})(i.inputTypes$$module$build$src$core$inputs$input_types||(i.inputTypes$$module$build$src$core$inputs$input_types={})),i.inputTypes$$module$build$src$core$inputs$input_types;var hl=new Set,Oh=new WeakSet,Mh=new WeakMap,Gi=null,Nh=null,Vb=0,pl={};pl.finishQueuedRenders=ws,pl.queueRender=vu,pl.triggerQueuedRenders=Qs;var Kb=function(e,t){window.alert(e),t&&t()},Yb=function(e,t){t(window.confirm(e))},Jb=function(e,t,o){o(window.prompt(e,t))},qb={confirmInternal:rf},oi={TEST_ONLY:qb};oi.alert=Un,oi.confirm=Ca,oi.prompt=Ta,oi.setAlert=nf,oi.setConfirm=af,oi.setPrompt=lf;var Lh,Xb;i.Msg$$module$build$src$core$msg=Object.create(null),Lh=function(e){Object.keys(e).forEach(function(t){i.Msg$$module$build$src$core$msg[t]=e[t]})},Xb={Msg:i.Msg$$module$build$src$core$msg,setLocale:Lh};var dr=class extends Ui{constructor(e){super(),this.isBlank=typeof e>"u",e&&(this.varId=e.getId(),this.workspaceId=e.workspace.id)}toJson(){const e=super.toJson();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");return e.varId=this.varId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new dr),t.varId=e.varId,t}},Ph=class extends dr{constructor(e){super(e),this.type=O.VAR_CREATE,e&&(this.varType=e.type,this.varName=e.name)}toJson(){const e=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");return e.varType=this.varType,e.varName=this.varName,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Ph),t.varType=e.varType,t.varName=e.varName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");e?t.createVariable(this.varName,this.varType,this.varId):t.deleteVariableById(this.varId)}};r(F.EVENT,O.VAR_CREATE,Ph);var hr=class{constructor(e,t,o,n){this.workspace=e,this.name=t,this.type=o||"",this.id=n||C()}getId(){return this.id}static compareByName(e,t){return e.name.localeCompare(t.name,void 0,{sensitivity:"base"})}},Bh="VARIABLE",jh="ijkmnopqrstuvwxyzabcdefgh",Zb={generateUniqueNameInternal:uf},At={CATEGORY_NAME:Bh,TEST_ONLY:Zb,VAR_LETTER_OPTIONS:jh};At.allDeveloperVariables=i.allDeveloperVariables$$module$build$src$core$variables,At.allUsedVarModels=i.allUsedVarModels$$module$build$src$core$variables,At.createVariableButtonHandler=Ai,At.flyoutCategory=ka,At.flyoutCategoryBlocks=Tu,At.generateUniqueName=ku,At.generateUniqueNameFromOptions=Sa,At.generateVariableFieldDom=Go,At.getAddedVariables=Hn,At.getOrCreateVariablePackage=i.getOrCreateVariablePackage$$module$build$src$core$variables,At.getVariable=i.getVariable$$module$build$src$core$variables,At.nameUsedWithAnyType=Su,At.nameUsedWithConflictingParam=Eu,At.promptName=Ea,At.renameVariable=i.renameVariable$$module$build$src$core$variables;var Vi=class extends Error{},Qb=class extends Vi{constructor(e){super("Expected to find a 'type' property, defining the block type"),this.state=e}},pr=class extends Vi{constructor(e,t,o){super(`The block ${t.toDevString()} is missing a(n) ${e} -connection`),this.block=t,this.state=o}},ev=class extends Vi{constructor(e,t,o,n){super(`The block ${o.toDevString()} could not connect its -${t} to its parent, because: ${e}`),this.childBlock=o,this.childState=n}},tv=class extends Vi{constructor(e){super(`Encountered a real block which is defined as a child of a shadow -block. It is an invariant of Blockly that shadow blocks only have shadow -children`),this.state=e}},sv=class extends Vi{constructor(e,t,o){super(`Cannot add an icon of type '${e}' to the block ${t.toDevString()}, because there is no icon registered with type '${e}'. Make sure that all of your icons have been registered.`),this.block=t,this.state=o}},ii={};ii.BadConnectionCheck=ev,ii.DeserializationError=Vi,ii.MissingBlockType=Qb,ii.MissingConnection=pr,ii.RealChildOfShadow=tv,ii.UnregisteredIcon=sv;var ov=class{constructor(){this.priority=Hb}save(e){const t=[];for(const o of e.getTopBlocks(!1))(e=Qt(o,{addCoordinates:!0,doFullSerialization:!1}))&&t.push(e);return t.length?{languageVersion:0,blocks:t}:null}load(e,t){e=e.blocks;for(const o of e)eo(o,t,{recordUndo:me()})}clear(e){for(const t of e.getTopBlocks(!1))t.dispose(!1)}};jn("blocks",new ov);var gr={};gr.BlockSerializer=ov,gr.append=eo,gr.appendInternal=Ri,gr.save=Qt;var yt=class{constructor(e){this.name=e}toString(){return this.name}equals(e){return this.name===e.toString()}};yt.MUTATOR=new yt("mutator"),yt.WARNING=new yt("warning"),yt.COMMENT=new yt("comment");var ni=class extends Ui{constructor(e){super(),this.isBlank=!e,e&&(this.blockId=e.id,this.workspaceId=e.workspace.id)}toJson(){const e=super.toJson();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");return e.blockId=this.blockId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new ni),t.blockId=e.blockId,t}},ri=class extends ni{constructor(e,t,o,n,c){super(e),this.type=O.BLOCK_CHANGE,e&&(this.element=t,this.name=o||void 0,this.oldValue=n,this.newValue=c)}toJson(){const e=super.toJson();if(!this.element)throw Error("The changed element is undefined. Either pass an element to the constructor, or call fromJson");return e.element=this.element,e.name=this.name,e.oldValue=this.oldValue,e.newValue=this.newValue,this.disabledReason&&(e.disabledReason=this.disabledReason),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new ri),t.element=e.element,t.name=e.name,t.oldValue=e.oldValue,t.newValue=e.newValue,e.disabledReason!==void 0&&(t.disabledReason=e.disabledReason),t}setDisabledReason(e){if(this.element!=="disabled")throw Error('Cannot set the disabled reason for a BlockChange event if the element is not "disabled".');this.disabledReason=e}isNull(){return this.oldValue===this.newValue}run(e){var t=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");if(t=t.getBlockById(this.blockId),!t)throw Error("The associated block is undefined. Either pass a block to the constructor, or call fromJson");const o=t.getIcon(yt.MUTATOR);switch(o&&Oi(o)&&o.bubbleIsVisible()&&o.setBubbleVisible(!1),e=e?this.newValue:this.oldValue,this.element){case"field":(t=t.getField(this.name))?t.setValue(e):console.warn("Can't set non-existent field: "+this.name);break;case"comment":t.setCommentText(e||null);break;case"collapsed":t.setCollapsed(!!e);break;case"disabled":var n;t.setDisabledReason(!!e,(n=this.disabledReason)!=null?n:Ft);break;case"inline":t.setInputsInline(!!e);break;case"mutation":n=ri.getExtraBlockState_(t),t.loadExtraState?t.loadExtraState(JSON.parse(e||"{}")):t.domToMutation&&t.domToMutation(i.textToDom$$module$build$src$core$utils$xml(e||"")),z(new ri(t,"mutation",null,n,e));break;default:console.warn("Unknown change type: "+this.element)}}static getExtraBlockState_(e){return e.saveExtraState?(e=e.saveExtraState(!0))?JSON.stringify(e):"":e.mutationToDom&&(e=e.mutationToDom())?Ls(e):""}};r(F.EVENT,O.BLOCK_CHANGE,ri);var gl={};gl.clamp=Mi,gl.toDegrees=Rf,gl.toRadians=Ia;var ml=16,iv=1,nv=12,Fh=16,fl=.25,zh=null,ai=null,Ki="",Yi="",Ue,Ji,li,Uh=null,xo=null,rv=null,Hh={getBoundsInfo:function(){const e=yo(Uh),t=Ln(Uh);return{left:e.x,right:e.x+t.width,top:e.y,bottom:e.y+t.height,width:t.width,height:t.height}},getPositionMetrics:function(e,t,o,n){const c=Hh.getBoundsInfo(),h=Ln(Ue);return t+h.heightc.top?zu(o,n,c,h):t+h.heightdocument.documentElement.clientTop?zu(o,n,c,h):Mf(e,c,h)}},Nt={ANIMATION_TIME:fl,ARROW_HORIZONTAL_PADDING:nv,ARROW_SIZE:ml,BORDER_SIZE:iv,PADDING_Y:Fh,TEST_ONLY:Hh};Nt.clearContent=xa,Nt.createDom=Au,Nt.getContentDiv=Wn,Nt.getOwner=Ou,Nt.getPositionX=Gn,Nt.hide=Aa,Nt.hideIfOwner=Da,Nt.hideWithoutAnimation=Ns,Nt.isVisible=Uu,Nt.repositionForWindowResize=Wu,Nt.setBoundsElement=Ru,Nt.setColour=Mu,Nt.show=ju,Nt.showPositionedByBlock=Of,Nt.showPositionedByField=Nu;var mr=class{constructor(e){this.workspace=e,this.cursorSvg=this.cursor=null,this.markers=new Map,this.markerSvg=null}registerMarker(e,t){this.markers.has(e)&&this.unregisterMarker(e),t.setDrawer(this.workspace.getRenderer().makeMarkerDrawer(this.workspace,t)),this.setMarkerSvg(t.getDrawer().createDom()),this.markers.set(e,t)}unregisterMarker(e){const t=this.markers.get(e);if(t)t.dispose(),this.markers.delete(e);else throw Error("Marker with ID "+e+" does not exist. Can only unregister markers that exist.")}getCursor(){return this.cursor}getMarker(e){return this.markers.get(e)||null}setCursor(e){this.cursor&&this.cursor.getDrawer()&&this.cursor.getDrawer().dispose(),(this.cursor=e)&&(e=this.workspace.getRenderer().makeMarkerDrawer(this.workspace,this.cursor),this.cursor.setDrawer(e),this.setCursorSvg(this.cursor.getDrawer().createDom()))}setCursorSvg(e){e?(this.workspace.getBlockCanvas().appendChild(e),this.cursorSvg=e):this.cursorSvg=null}setMarkerSvg(e){e?this.workspace.getBlockCanvas()&&(this.cursorSvg?this.workspace.getBlockCanvas().insertBefore(e,this.cursorSvg):this.workspace.getBlockCanvas().appendChild(e)):this.markerSvg=null}updateMarkers(){this.workspace.keyboardAccessibilityMode&&this.cursorSvg&&this.workspace.getCursor().draw()}dispose(){const e=Object.keys(this.markers);for(let t=0,o;o=e[t];t++)this.unregisterMarker(o);this.markers.clear(),this.cursor&&(this.cursor.dispose(),this.cursor=null)}};mr.LOCAL_MARKER="local_marker_1";var qi={};qi.commonWordPrefix=Gu,qi.commonWordSuffix=Vu,qi.isNumber=i.isNumber$$module$build$src$core$utils$string,qi.shortestStringLength=Vn,qi.wrap=i.wrap$$module$build$src$core$utils$string;var $l=void 0,fr=!1,Xi=!1,av=50,lv=0,ci=0,Wh=0,Gh=0,cs=null,$r=null,Vh=0,Kh=10,cv=10,uv=750,bl=5,_t=null,ts={HOVER_MS:uv,LIMIT:av,MARGINS:bl,OFFSET_X:Vh,OFFSET_Y:Kh,RADIUS_OK:cv};ts.bindMouseEvents=Li,ts.block=Zu,ts.createDom=Ju,ts.dispose=Xu,ts.getCustomTooltip=Bf,ts.getDiv=Ff,ts.getTooltipOfObject=Ni,ts.hide=to,ts.isVisible=jf,ts.setCustomTooltip=Pf,ts.unbindMouseEvents=Oa,ts.unblock=Qu;var Yh=.45,Jh=.65,dv={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00"},us={};us.blend=Ko,us.getHsvSaturation=ed,us.getHsvValue=td,us.hexToRgb=Ma,us.hsvToHex=Na,us.hueToHex=sd,us.names=dv,us.parse=Vo,us.rgbToHex=Kn,us.setHsvSaturation=Kf,us.setHsvValue=Yf;var br={};br.checkMessageReferences=Jf,br.parseBlockColour=Pi,br.replaceMessageReferences=pt,br.tokenizeInterpolation=od;var Qe=class{constructor(e,t,o){this.DEFAULT_VALUE=null,this.name=void 0,this.constants_=this.mouseDownWrapper=this.textContent_=this.textElement_=this.borderRect_=this.fieldGroup_=this.markerSvg=this.cursorSvg=this.tooltip=this.validator_=null,this.disposed=!1,this.maxDisplayLength=50,this.sourceBlock_=null,this.enabled_=this.visible_=this.isDirty_=!0,this.suffixField=this.prefixField=this.clickTarget_=null,this.EDITABLE=!0,this.SERIALIZABLE=!1,this.CURSOR="",this.value_="DEFAULT_VALUE"in new.target.prototype?new.target.prototype.DEFAULT_VALUE:this.DEFAULT_VALUE,this.size_=new Le(0,0),e!==Qe.SKIP_SETUP&&(o&&this.configure_(o),this.setValue(e),t&&this.setValidator(t))}configure_(e){e.tooltip&&this.setTooltip(pt(e.tooltip))}setSourceBlock(e){if(this.sourceBlock_)throw Error("Field already bound to a block");this.sourceBlock_=e}getConstants(){return!this.constants_&&this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&this.sourceBlock_.workspace.rendered&&(this.constants_=this.sourceBlock_.workspace.getRenderer().getConstants()),this.constants_}getSourceBlock(){return this.sourceBlock_}init(){this.fieldGroup_||(this.fieldGroup_=N(x.G,{}),this.isVisible()||(this.fieldGroup_.style.display="none"),this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_),this.initView(),this.updateEditable(),this.setTooltip(this.tooltip),this.bindEvents_(),this.initModel(),this.applyColour())}initView(){this.createBorderRect_(),this.createTextElement_()}initModel(){}isFullBlockField(){return!this.borderRect_}createBorderRect_(){this.borderRect_=N(x.RECT,{rx:this.getConstants().FIELD_BORDER_RECT_RADIUS,ry:this.getConstants().FIELD_BORDER_RECT_RADIUS,x:0,y:0,height:this.size_.height,width:this.size_.width,class:"blocklyFieldRect"},this.fieldGroup_)}createTextElement_(){this.textElement_=N(x.TEXT,{class:"blocklyText"},this.fieldGroup_),this.getConstants().FIELD_TEXT_BASELINE_CENTER&&this.textElement_.setAttribute("dominant-baseline","central"),this.textContent_=document.createTextNode(""),this.textElement_.appendChild(this.textContent_)}bindEvents_(){const e=this.getClickTarget_();if(!e)throw Error("A click target has not been set.");Li(e),this.mouseDownWrapper=X(e,"pointerdown",this,this.onMouseDown_)}fromXml(e){this.setValue(e.textContent)}toXml(e){return e.textContent=this.getValue(),e}saveState(e){return e=this.saveLegacyState(Qe),e!==null?e:this.getValue()}loadState(e){this.loadLegacyState(Qe,e)||this.setValue(e)}saveLegacyState(e){return e.prototype.saveState===this.saveState&&e.prototype.toXml!==this.toXml?(e=i.createElement$$module$build$src$core$utils$xml("field"),e.setAttribute("name",this.name||""),Ii(this.toXml(e)).replace(' xmlns="https://developers.google.com/blockly/xml"',"")):null}loadLegacyState(e,t){return e.prototype.loadState===this.loadState&&e.prototype.fromXml!==this.fromXml?(this.fromXml(i.textToDom$$module$build$src$core$utils$xml(t)),!0):!1}dispose(){Da(this),Jo(this);let e;(e=this.getSourceBlock())!=null&&e.isDeadOrDying()||Ke(this.fieldGroup_),this.disposed=!0}updateEditable(){const e=this.fieldGroup_,t=this.getSourceBlock();this.EDITABLE&&e&&t&&(this.enabled_&&t.isEditable()?(ge(e,"blocklyEditableText"),ot(e,"blocklyNonEditableText"),e.style.cursor=this.CURSOR):(ge(e,"blocklyNonEditableText"),ot(e,"blocklyEditableText"),e.style.cursor=""))}setEnabled(e){this.enabled_=e,this.updateEditable()}isEnabled(){return this.enabled_}isClickable(){return this.enabled_&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()&&this.showEditor_!==Qe.prototype.showEditor_}isClickableInFlyout(e){return!e}isCurrentlyEditable(){return this.enabled_&&this.EDITABLE&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()}isSerializable(){let e=!1;return this.name&&(this.SERIALIZABLE?e=!0:this.EDITABLE&&(console.warn("Detected an editable field that was not serializable. Please define SERIALIZABLE property as true on all editable custom fields. Proceeding with serialization."),e=!0)),e}isVisible(){return this.visible_}setVisible(e){if(this.visible_!==e){this.visible_=e;var t=this.fieldGroup_;t&&(t.style.display=e?"block":"none")}}setValidator(e){this.validator_=e}getValidator(){return this.validator_}getSvgRoot(){return this.fieldGroup_}getBorderRect(){if(!this.borderRect_)throw Error(`The border rectangle is ${this.borderRect_}.`);return this.borderRect_}getTextElement(){if(!this.textElement_)throw Error(`The text element is ${this.textElement_}.`);return this.textElement_}getTextContent(){if(!this.textContent_)throw Error(`The text content is ${this.textContent_}.`);return this.textContent_}applyColour(){}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_()}showEditor(e){this.isClickable()&&this.showEditor_(e)}showEditor_(e){}repositionForWindowResize(){return!1}updateSize_(e){const t=this.getConstants();e=e!==void 0?e:this.isFullBlockField()?0:this.getConstants().FIELD_BORDER_RECT_X_PADDING;let o=2*e,n=t.FIELD_TEXT_HEIGHT,c=0;this.textElement_&&(c=Nn(this.textElement_,t.FIELD_TEXT_FONTSIZE,t.FIELD_TEXT_FONTWEIGHT,t.FIELD_TEXT_FONTFAMILY),o+=c),this.isFullBlockField()||(n=Math.max(n,t.FIELD_BORDER_RECT_HEIGHT)),this.size_.height=n,this.size_.width=o,this.positionTextElement_(e,c),this.positionBorderRect_()}positionTextElement_(e,t){if(this.textElement_){var o=this.getConstants(),n=this.size_.height/2,c;this.textElement_.setAttribute("x",String((c=this.getSourceBlock())!=null&&c.RTL?this.size_.width-t-e:e)),this.textElement_.setAttribute("y",String(o.FIELD_TEXT_BASELINE_CENTER?n:n-o.FIELD_TEXT_HEIGHT/2+o.FIELD_TEXT_BASELINE))}}positionBorderRect_(){this.borderRect_&&(this.borderRect_.setAttribute("width",String(this.size_.width)),this.borderRect_.setAttribute("height",String(this.size_.height)),this.borderRect_.setAttribute("rx",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)),this.borderRect_.setAttribute("ry",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)))}getSize(){return this.isVisible()?(this.isDirty_?(this.render_(),this.isDirty_=!1):this.visible_&&this.size_.width===0&&(this.render_(),this.size_.width!==0&&console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead.")),this.size_):new Le(0,0)}getScaledBBox(){let e;var t=this.getSourceBlock();if(!t)throw new ft;if(this.isFullBlockField()){var o=this.sourceBlock_.getHeightWidth();const n=t.workspace.scale;e=this.getAbsoluteXY_(),t=(o.width+1)*n,o=(o.height+1)*n,Ib?(e.x+=1.5*n,e.y+=1.5*n):(e.x-=.5*n,e.y-=.5*n)}else o=this.borderRect_.getBoundingClientRect(),e=yo(this.borderRect_),t=o.width,o=o.height;return new qe(e.y,e.y+o,e.x,e.x+t)}onLocationChange(e){}getDisplayText_(){let e=this.getText();return e?(e.length>this.maxDisplayLength&&(e=e.substring(0,this.maxDisplayLength-2)+"…"),e=e.replace(/\s/g,Qe.NBSP),this.sourceBlock_&&this.sourceBlock_.RTL&&(e+="‏"),e):Qe.NBSP}getText(){const e=this.getText_();return String(e!==null?e:this.getValue())}getText_(){return null}markDirty(){this.isDirty_=!0,this.constants_=null}forceRerender(){this.isDirty_=!0,this.sourceBlock_&&this.sourceBlock_.rendered&&this.sourceBlock_.queueRender()}setValue(e,t=!0){if(e!==null){var o=i.getGroup$$module$build$src$core$events$utils();o||i.setGroup$$module$build$src$core$events$utils(!0);try{const L=this.doClassValidation_(e),te=this.processValidation(e,L,t);if(!(te instanceof Error)){var n,c=(n=this.getValidator())==null?void 0:n.call(this,te),h=this.processValidation(te,c,t);if(!(h instanceof Error)){var $=this.sourceBlock_;if(!$||!$.disposed){var T=this.getValue();T===h?this.doValueUpdate_(h):(this.doValueUpdate_(h),t&&$&&K()&&z(new(V(O.BLOCK_CHANGE))($,"field",this.name||null,T,h)),this.isDirty_&&this.forceRerender())}}}}finally{i.setGroup$$module$build$src$core$events$utils(o)}}}processValidation(e,t,o){return t===null?(this.doValueInvalid_(e,o),this.isDirty_&&this.forceRerender(),Error()):t===void 0?e:t}getValue(){return this.value_}doClassValidation_(e){return e??null}doValueUpdate_(e){this.value_=e,this.isDirty_=!0}doValueInvalid_(e,t){}onMouseDown_(e){this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&(e=this.sourceBlock_.workspace.getGesture(e))&&e.setStartField(this)}setTooltip(e){e||e===""||(e=this.sourceBlock_);const t=this.getClickTarget_();t?t.tooltip=e:this.tooltip=e}getTooltip(){const e=this.getClickTarget_();return Ni(e||{tooltip:this.tooltip})}getClickTarget_(){return this.clickTarget_||this.getSvgRoot()}getAbsoluteXY_(){return yo(this.getClickTarget_())}referencesVariables(){return!1}refreshVariableName(){}getParentInput(){let e=null;const t=this.getSourceBlock();if(!t)throw new ft;const o=t.inputList;for(let n=0;n{o.stopPropagation()})}addModelUpdateBindings(){this.view.addTextChangeListener((e,t)=>{super.setText(t)}),this.view.addSizeChangeListener((e,t)=>{super.setSize(t)}),this.view.addOnCollapseListener(()=>{super.setCollapsed(this.view.isCollapsed())}),this.view.addDisposeListener(()=>{this.isDeadOrDying()||this.dispose()})}setText(e){this.view.setText(e)}setSize(e){this.view.setSize(e)}setCollapsed(e){this.view.setCollapsed(e)}setEditable(e){super.setEditable(e),this.view.setEditable(this.isEditable())}getSvgRoot(){return this.view.getSvgRoot()}getSize(){return super.getSize()}getBoundingRectangle(){const e=this.getRelativeToSurfaceXY();var t,o;const n=(o=(t=this.view)==null?void 0:t.getSize())!=null?o:this.getSize();return this.workspace.RTL?(t=e.x-n.width,o=e.x):(t=e.x,o=e.x+n.width),new qe(e.y,e.y+n.height,t,o)}moveBy(e,t,o){const n=this.getRelativeToSurfaceXY();e=new G(n.x+e,n.y+t),this.moveTo(e,o)}moveTo(e,t){super.moveTo(e,t),this.view.moveTo(e)}moveDuringDrag(e){this.location=e,this.view.moveTo(e)}setDragging(e){e?ge(this.getSvgRoot(),"blocklyDragging"):ot(this.getSvgRoot(),"blocklyDragging")}dispose(){this.disposing=!0,this.view.isDeadOrDying()||this.view.dispose(),super.dispose()}startGesture(e){const t=this.workspace.getGesture(e);if(t){if(kt(e))e.stopPropagation();else{t.handleCommentStart(e,this);let o;(o=this.workspace.getLayerManager())==null||o.append(this,Do)}i.setSelected$$module$build$src$core$common(this)}}setDeleteStyle(e){e?ge(this.getSvgRoot(),"blocklyDraggingDelete"):ot(this.getSvgRoot(),"blocklyDraggingDelete")}isMovable(){return this.dragStrategy.isMovable()}startDrag(){this.dragStrategy.startDrag()}drag(e){this.dragStrategy.drag(e)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){ge(this.getSvgRoot(),"blocklySelected")}unselect(){ot(this.getSvgRoot(),"blocklySelected")}toCopyData(){return{paster:ul.TYPE,commentState:xi(this,{addCoordinates:!0})}}showContextMenu(e){const t=xe.registry.getContextMenuOptions(xe.ScopeType.COMMENT,{comment:this});Jn(e,t,this.workspace.RTL,this.workspace)}snapToGrid(){if(!this.isDeadOrDying()){var e=this.workspace.getGrid();if(e!=null&&e.shouldSnap()){var t=this.getRelativeToSurfaceXY();e=e.alignXY(t),e!==t&&this.moveTo(e,["snap"])}}}},Lt={};Lt.appendDomToWorkspace=u$,Lt.blockToDom=wo,Lt.blockToDomWithXY=Zn,Lt.clearWorkspaceAndLoadFromXml=c$,Lt.deleteNext=v$,Lt.domToBlock=i.domToBlock$$module$build$src$core$xml,Lt.domToBlockInternal=qo,Lt.domToPrettyText=l$,Lt.domToText=Ls,Lt.domToVariables=md,Lt.domToWorkspace=i.domToWorkspace$$module$build$src$core$xml,Lt.loadWorkspaceComment=gd,Lt.saveWorkspaceComment=Xn,Lt.variablesToDom=hd,Lt.workspaceToDom=n$;var Xh=class extends ni{constructor(e){super(e),this.type=O.BLOCK_CREATE,e&&(e.isShadow()&&(this.recordUndo=!1),this.xml=Zn(e),this.ids=he(e),this.json=Qt(e,{addCoordinates:!0}))}toJson(){const e=super.toJson();if(!this.xml)throw Error("The block XML is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");return e.xml=Ls(this.xml),e.ids=this.ids,e.json=this.json,this.recordUndo||(e.recordUndo=this.recordUndo),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Xh),t.xml=i.textToDom$$module$build$src$core$utils$xml(e.xml),t.ids=e.ids,t.json=e.json,e.recordUndo!==void 0&&(t.recordUndo=e.recordUndo),t}run(e){const t=this.getEventWorkspace_();if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!WT(t,this.ids))if(e)eo(this.json,t);else for(e=0;ee.getBlockById(o)).filter(o=>o&&o.isShadow()).length===t.length};r(F.EVENT,O.BLOCK_CREATE,Xh);var Zh=class extends Cs{constructor(e,t){super(t),this.type=O.THEME_CHANGE,this.themeName=e}toJson(){const e=super.toJson();if(!this.themeName)throw Error("The theme name is undefined. Either pass a theme name to the constructor, or call fromJson");return e.themeName=this.themeName,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Zh),t.themeName=e.themeName,t}};r(F.EVENT,O.THEME_CHANGE,Zh);var Qh=class extends Cs{constructor(e,t,o,n,c){super(n),this.type=O.VIEWPORT_CHANGE,this.viewTop=e,this.viewLeft=t,this.scale=o,this.oldScale=c}toJson(){const e=super.toJson();if(this.viewTop===void 0)throw Error("The view top is undefined. Either pass a value to the constructor, or call fromJson");if(this.viewLeft===void 0)throw Error("The view left is undefined. Either pass a value to the constructor, or call fromJson");if(this.scale===void 0)throw Error("The scale is undefined. Either pass a value to the constructor, or call fromJson");if(this.oldScale===void 0)throw Error("The old scale is undefined. Either pass a value to the constructor, or call fromJson");return e.viewTop=this.viewTop,e.viewLeft=this.viewLeft,e.scale=this.scale,e.oldScale=this.oldScale,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Qh),t.viewTop=e.viewTop,t.viewLeft=e.viewLeft,t.scale=e.scale,t.oldScale=e.oldScale,t}};r(F.EVENT,O.VIEWPORT_CHANGE,Qh);var oe;(function(e){e[e.INPUT_VALUE=1]="INPUT_VALUE",e[e.OUTPUT_VALUE=2]="OUTPUT_VALUE",e[e.NEXT_STATEMENT=3]="NEXT_STATEMENT",e[e.PREVIOUS_STATEMENT=4]="PREVIOUS_STATEMENT"})(oe||(oe={}));var tn=class{constructor(e){this.connectionChecker=e,this.connections=[]}addConnection(e,t){t=this.calculateIndexForYPos(t),this.connections.splice(t,0,e)}findIndexOfConnection(e,t){if(!this.connections.length)return-1;const o=this.calculateIndexForYPos(t);if(o>=this.connections.length)return-1;t=e.y;let n=o;for(;0<=n&&this.connections[n].y===t;){if(this.connections[n]===e)return n;n--}for(n=o;ne)o=n;else{t=n;break}}return t}removeConnection(e,t){if(e=this.findIndexOfConnection(e,t),e===-1)throw Error("Unable to find connection in connectionDB.");this.connections.splice(e,1)}getNeighbours(e,t){function o(te){const nt=c-n[te].x,it=h-n[te].y;return Math.sqrt(nt*nt+it*it)<=t&&L.push(n[te]),it(this.flyout?i.config$$module$build$src$core$config.flyoutDragRadius:i.config$$module$build$src$core$config.dragRadius)}updateIsDraggingFromFlyout(){let e;if(!this.targetBlock||(e=this.flyout)==null||!e.isBlockCreatable(this.targetBlock))return!1;if(!this.flyout.targetWorkspace)throw Error(`Cannot update dragging from the flyout because the ' + - 'flyout's target workspace is undefined`);return!this.flyout.isScrollable()||this.flyout.isDragTowardWorkspace(this.currentDragDeltaXY)?(this.startWorkspace_=this.flyout.targetWorkspace,this.startWorkspace_.updateScreenCalculationsIfScrolled(),i.getGroup$$module$build$src$core$events$utils()||i.setGroup$$module$build$src$core$events$utils(!0),this.startBlock=null,this.targetBlock=this.flyout.createBlock(this.targetBlock),i.setSelected$$module$build$src$core$common(this.targetBlock),!0):!1}updateIsDraggingWorkspace(){if(!this.startWorkspace_)throw Error("Cannot update dragging the workspace because the start workspace is undefined");(this.flyout?this.flyout.isScrollable():this.startWorkspace_&&this.startWorkspace_.isDraggable())&&(this.dragging=!0,this.workspaceDragger=new fv(this.startWorkspace_),this.workspaceDragger.startDrag())}updateIsDragging(e){if(!this.startWorkspace_)throw Error("Cannot update dragging because the start workspace is undefined");if(this.calledUpdateIsDragging)throw Error("updateIsDragging_ should only be called once per gesture.");this.calledUpdateIsDragging=!0,this.flyout&&this.updateIsDraggingFromFlyout();const t=I();t&&Xo(t)&&t.isMovable()?(this.dragging=!0,this.dragger=this.createDragger(t,this.startWorkspace_),this.dragger.onDragStart(e),this.dragger.onDrag(e,this.currentDragDeltaXY)):this.updateIsDraggingWorkspace()}createDragger(e,t){return new(_(F.BLOCK_DRAGGER,this.creatorWorkspace.options,!0))(e,t)}doStart(e){if(!this.startWorkspace_)throw Error("Cannot start the touch gesture becauase the start workspace is undefined");this.isPinchZoomEnabled=this.startWorkspace_.options.zoomOptions&&this.startWorkspace_.options.zoomOptions.pinch,kt(e)?this.cancel():(this.gestureHasStarted=!0,ji(),this.startWorkspace_.updateScreenCalculationsIfScrolled(),this.startWorkspace_.isMutator&&this.startWorkspace_.resize(),this.currentDropdownOwner=Ou(),this.startWorkspace_.hideChaff(!!this.flyout),this.startWorkspace_.markFocused(),this.mostRecentEvent=e,Zu(),ve(e)?this.handleRightClick(e):(e.type.toLowerCase()==="pointerdown"&&e.pointerType!=="mouse"&&Je(e,this),this.mouseDownXY=new G(e.clientX,e.clientY),this.bindMouseEvents(e),this.isEnding_||this.handleTouchStart(e)))}bindMouseEvents(e){this.boundEvents.push(X(document,"pointerdown",null,this.handleStart.bind(this),!0)),this.boundEvents.push(X(document,"pointermove",null,this.handleMove.bind(this),!0)),this.boundEvents.push(X(document,"pointerup",null,this.handleUp.bind(this),!0)),e.preventDefault(),e.stopPropagation()}handleStart(e){this.isDragging()||(this.handleTouchStart(e),this.isMultiTouch()&&_e())}handleMove(e){this.isDragging()&&$e(e)||!this.isMultiTouch()?(this.updateFromEvent(e),this.workspaceDragger?this.workspaceDragger.drag(this.currentDragDeltaXY):this.dragger&&this.dragger.onDrag(this.mostRecentEvent,this.currentDragDeltaXY),e.preventDefault(),e.stopPropagation()):this.isMultiTouch()&&(this.handleTouchMove(e),_e())}handleUp(e){if(this.isDragging()||this.handleTouchEnd(e),!this.isMultiTouch()||this.isDragging()){if(!$e(e))return;if(this.updateFromEvent(e),_e(),this.isEnding_){console.log("Trying to end a gesture recursively.");return}this.isEnding_=!0,this.dragger?this.dragger.onDragEnd(e,this.currentDragDeltaXY):this.workspaceDragger?this.workspaceDragger.endDrag(this.currentDragDeltaXY):this.isBubbleClick()||this.isCommentClick()||(this.isFieldClick()?this.doFieldClick():this.isIconClick()?this.doIconClick():this.isBlockClick()?this.doBlockClick():this.isWorkspaceClick()&&this.doWorkspaceClick(e))}e.preventDefault(),e.stopPropagation(),this.dispose()}handleTouchStart(e){var t=Pe(e);this.cachedPoints.set(t,this.getTouchPoint(e));var o=Array.from(this.cachedPoints.keys());o.length===2&&(t=this.cachedPoints.get(o[0]),o=this.cachedPoints.get(o[1]),this.startDistance=G.distance(t,o),this.multiTouch=!0,e.preventDefault())}handleTouchMove(e){const t=Pe(e);this.cachedPoints.set(t,this.getTouchPoint(e)),this.isPinchZoomEnabled&&this.cachedPoints.size===2?this.handlePinch(e):(this.updateFromEvent(e),this.workspaceDragger?this.workspaceDragger.drag(this.currentDragDeltaXY):this.dragger&&this.dragger.onDrag(this.mostRecentEvent,this.currentDragDeltaXY),e.preventDefault(),e.stopPropagation())}handlePinch(e){var t=Array.from(this.cachedPoints.keys()),o=this.cachedPoints.get(t[0]);if(t=this.cachedPoints.get(t[1]),o=G.distance(o,t)/this.startDistance,0this.previousScale){if(t=o-this.previousScale,t=0this.cachedPoints.size&&(this.cachedPoints.clear(),this.previousScale=0)}getTouchPoint(e){return this.startWorkspace_?new G(e.pageX,e.pageY):null}isMultiTouch(){return this.multiTouch}cancel(){this.isEnding_||(_e(),this.dragger?this.dragger.onDragEnd(this.mostRecentEvent,this.currentDragDeltaXY):this.workspaceDragger&&this.workspaceDragger.endDrag(this.currentDragDeltaXY),this.dispose())}handleRightClick(e){this.targetBlock?(this.bringBlockToFront(),this.targetBlock.workspace.hideChaff(!!this.flyout),this.targetBlock.showContextMenu(e)):this.startBubble?this.startBubble.showContextMenu(e):this.startComment?(this.startComment.workspace.hideChaff(),this.startComment.showContextMenu(e)):this.startWorkspace_&&!this.flyout&&(this.startWorkspace_.hideChaff(),this.startWorkspace_.showContextMenu(e)),e.preventDefault(),e.stopPropagation(),this.dispose()}handleWsStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");this.setStartWorkspace(t),this.mostRecentEvent=e,this.startBlock||this.startBubble||this.startComment||i.setSelected$$module$build$src$core$common(null),this.doStart(e)}fireWorkspaceClick(e){z(new(V(O.CLICK))(null,e.id,"workspace"))}handleFlyoutStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");this.setStartFlyout(t),this.handleWsStart(e,t.getWorkspace())}handleBlockStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBlockStart, but the gesture had already been started.");this.setStartBlock(t),this.mostRecentEvent=e}handleBubbleStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");this.setStartBubble(t),this.mostRecentEvent=e}handleCommentStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleCommentStart, but the gesture had already been started.");this.setStartComment(t),this.mostRecentEvent=e}doFieldClick(){if(!this.startField)throw Error("Cannot do a field click because the start field is undefined");this.currentDropdownOwner!==this.startField&&this.startField.showEditor(this.mostRecentEvent),this.bringBlockToFront()}doIconClick(){if(!this.startIcon)throw Error("Cannot do an icon click because the start icon is undefined");this.bringBlockToFront(),this.startIcon.onClick()}doBlockClick(){if(this.flyout&&this.flyout.autoClose){if(!this.targetBlock)throw Error("Cannot do a block click because the target block is undefined");if(this.targetBlock.isEnabled()){i.getGroup$$module$build$src$core$events$utils()||i.setGroup$$module$build$src$core$events$utils(!0);var e=this.flyout.createBlock(this.targetBlock);e.snapToGrid(),e.bumpNeighbours()}}else{if(!this.startWorkspace_)throw Error("Cannot do a block click because the start workspace is undefined");e=new(V(O.CLICK))(this.startBlock,this.startWorkspace_.id,"block"),z(e)}this.bringBlockToFront(),i.setGroup$$module$build$src$core$events$utils(!1)}doWorkspaceClick(e){e=this.creatorWorkspace,I()&&I().unselect(),this.fireWorkspaceClick(this.startWorkspace_||e)}bringBlockToFront(){this.targetBlock&&!this.flyout&&this.targetBlock.bringToFront()}setStartField(e){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");this.startField||(this.startField=e)}setStartIcon(e){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartIcon, but the gesture had already been started.");this.startIcon||(this.startIcon=e)}setStartBubble(e){this.startBubble||(this.startBubble=e)}setStartComment(e){this.startComment||(this.startComment=e)}setStartBlock(e){this.startBlock||this.startBubble||(this.startBlock=e,i.setSelected$$module$build$src$core$common(this.startBlock),e.isInFlyout&&e!==e.getRootBlock()?this.setTargetBlock(e.getRootBlock()):this.setTargetBlock(e))}setTargetBlock(e){e.isShadow()?this.setTargetBlock(e.getParent()):this.targetBlock=e}setStartWorkspace(e){this.startWorkspace_||(this.startWorkspace_=e)}setStartFlyout(e){this.flyout||(this.flyout=e)}isBubbleClick(){return!!this.startBubble&&!this.hasExceededDragRadius}isCommentClick(){return!!this.startComment&&!this.hasExceededDragRadius}isBlockClick(){return!!this.startBlock&&!this.hasExceededDragRadius&&!this.isFieldClick()&&!this.isIconClick()}isFieldClick(){return this.startField?this.startField.isClickable()&&!this.hasExceededDragRadius&&(!this.flyout||this.startField.isClickableInFlyout(this.flyout.autoClose)):!1}isIconClick(){if(!this.startIcon)return!1;const e=!this.flyout||!this.startIcon.isClickableInFlyout||this.startIcon.isClickableInFlyout(this.flyout.autoClose);return!this.hasExceededDragRadius&&e}isWorkspaceClick(){return!this.startBlock&&!this.startBubble&&!this.startField&&!this.hasExceededDragRadius}getCurrentDragger(){let e,t;return(t=(e=this.workspaceDragger)!=null?e:this.dragger)!=null?t:null}isDragging(){return this.dragging}hasStarted(){return this.gestureHasStarted}static inProgress(){const e=ee();for(let t=0,o;o=e[t];t++)if(o.currentGesture_)return!0;return!1}},ep=class{constructor(e,t){this.pattern=e,this.scale=1;let o;this.spacing=(o=t.spacing)!=null?o:0;let n;this.length=(n=t.length)!=null?n:1,this.line2=(this.line1=e.firstChild)&&this.line1.nextSibling;let c;this.snapToGrid=(c=t.snap)!=null?c:!1}setSpacing(e){this.spacing=e,this.update(this.scale)}getSpacing(){return this.spacing}setLength(e){this.length=e,this.update(this.scale)}getLength(){return this.length}setSnapToGrid(e){this.snapToGrid=e}shouldSnap(){return this.snapToGrid}getPatternId(){return this.pattern.id}update(e){this.scale=e;var t=this.spacing*e;this.pattern.setAttribute("width",`${t}`),this.pattern.setAttribute("height",`${t}`),t=Math.floor(this.spacing/2)+.5;let o=t-this.length/2,n=t+this.length/2;t*=e,o*=e,n*=e,this.setLineAttributes(this.line1,e,o,n,t,t),this.setLineAttributes(this.line2,e,t,t,o,n)}setLineAttributes(e,t,o,n,c,h){e&&(e.setAttribute("stroke-width",`${t}`),e.setAttribute("x1",`${o}`),e.setAttribute("y1",`${c}`),e.setAttribute("x2",`${n}`),e.setAttribute("y2",`${h}`))}moveTo(e,t){this.pattern.setAttribute("x",`${e}`),this.pattern.setAttribute("y",`${t}`)}alignXY(e){var t=this.getSpacing();const o=t/2,n=Math.round(Math.round((e.x-o)/t)*t+o);return t=Math.round(Math.round((e.y-o)/t)*t+o),n===e.x&&t===e.y?e:new G(n,t)}static createDom(e,t,o){e=N(x.PATTERN,{id:"blocklyGridPattern"+e,patternUnits:"userSpaceOnUse"},o);let n,c;if(0<((n=t.length)!=null?n:1)&&0<((c=t.spacing)!=null?c:0)){N(x.LINE,{stroke:t.colour},e);let h;(h=t.length)!=null&&h&&N(x.LINE,{stroke:t.colour},e)}else N(x.LINE,{},e);return e}},KT=class{constructor(e){this.workspace=e,this.layers=new Map,(e=e.getInjectionDiv())&&(this.dragLayer=this.createDragLayer(e),this.animationLayer=this.createAnimationLayer(e)),e=this.createLayer(Do),ge(e,"blocklyBlockCanvas"),e=this.createLayer(Cl),ge(e,"blocklyBubbleCanvas")}createDragLayer(e){const t=N(x.SVG,{class:"blocklyBlockDragSurface",xmlns:rr,"xmlns:html":Fs,"xmlns:xlink":es,version:"1.1"});return e.append(t),N(x.G,{},t)}createAnimationLayer(e){const t=N(x.SVG,{class:"blocklyAnimationLayer",xmlns:rr,"xmlns:html":Fs,"xmlns:xlink":es,version:"1.1"});return e.append(t),N(x.G,{},t)}appendToAnimationLayer(e){let t;const o=(t=this.dragLayer)==null?void 0:t.getAttribute("transform");if(o){let c;(c=this.animationLayer)==null||c.setAttribute("transform",o)}let n;(n=this.animationLayer)==null||n.appendChild(e.getSvgRoot())}translateLayers(e,t){e=`translate(${e.x}, ${e.y}) scale(${t})`;let o;(o=this.dragLayer)==null||o.setAttribute("transform",e);for(const[,n]of this.layers)n.setAttribute("transform",e)}moveToDragLayer(e){let t;(t=this.dragLayer)==null||t.appendChild(e.getSvgRoot())}moveOffDragLayer(e,t){this.append(e,t)}append(e,t){this.layers.has(t)||this.createLayer(t);let o;(o=this.layers.get(t))==null||o.appendChild(e.getSvgRoot())}createLayer(e){const t=this.workspace.getSvgGroup(),o=N(x.G,{});let n=!1;const c=[...this.layers].sort((h,$)=>h[0]-$[0]);for(const[h,$]of c)if(et[1]===e)?e:(this.sourceBlock_&&console.warn("Cannot set the dropdown's value to an unavailable option. Block type: "+this.sourceBlock_.type+", Field name: "+this.name+", Value: "+e),null)}doValueUpdate_(e){super.doValueUpdate_(e),e=this.getOptions(!0);for(let t=0,o;o=e[t];t++)o[1]===this.value_&&(this.selectedOption=o)}applyColour(){const e=this.sourceBlock_;this.borderRect_&&(this.borderRect_.setAttribute("stroke",e.getColourTertiary()),this.menu_?this.borderRect_.setAttribute("fill",e.getColourTertiary()):this.borderRect_.setAttribute("fill","transparent")),e&&this.arrow&&(e.isShadow()?this.arrow.style.fill=e.getColourSecondary():this.arrow.style.fill=e.getColour())}render_(){this.getTextContent().nodeValue="",this.imageElement.style.display="none";const e=this.selectedOption&&this.selectedOption[0];e&&typeof e=="object"?this.renderSelectedImage(e):this.renderSelectedText(),this.positionBorderRect_()}renderSelectedImage(e){const t=this.getSourceBlock();if(!t)throw new ft;this.imageElement.style.display="",this.imageElement.setAttributeNS(es,"xlink:href",e.src),this.imageElement.setAttribute("height",String(e.height)),this.imageElement.setAttribute("width",String(e.width));const o=Number(e.height);e=Number(e.width);var n=!!this.borderRect_;const c=Math.max(n?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,o+qt.IMAGE_Y_PADDING);n=n?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let h;h=this.svgArrow?this.positionSVGArrow(e+n,c/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2):Nn(this.arrow,this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY),this.size_.width=e+h+2*n,this.size_.height=c;let $=0;t.RTL?this.imageElement.setAttribute("x",`${n+h}`):($=e+h,this.getTextElement().setAttribute("text-anchor","end"),this.imageElement.setAttribute("x",`${n}`)),this.imageElement.setAttribute("y",String(c/2-o/2)),this.positionTextElement_($+n,e+h)}renderSelectedText(){this.getTextContent().nodeValue=this.getDisplayText_();var e=this.getTextElement();ge(e,"blocklyDropdownText"),e.setAttribute("text-anchor","start");var t=!!this.borderRect_;e=Math.max(t?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,this.getConstants().FIELD_TEXT_HEIGHT);const o=Nn(this.getTextElement(),this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY);t=t?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let n=0;this.svgArrow&&(n=this.positionSVGArrow(o+t,e/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2)),this.size_.width=o+n+2*t,this.size_.height=e,this.positionTextElement_(t,o)}positionSVGArrow(e,t){if(!this.svgArrow)return 0;const o=this.getSourceBlock();if(!o)throw new ft;const n=this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0,c=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_PADDING,h=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE;return this.svgArrow.setAttribute("transform","translate("+(o.RTL?n:e+c)+","+t+")"),h+c}getText_(){if(!this.selectedOption)return null;const e=this.selectedOption[0];return typeof e=="object"?e.alt:e}static fromJson(e){if(!e.options)throw Error("options are required for the dropdown field. The options property must be assigned an array of [humanReadableValue, languageNeutralValue] tuples.");return new this(e.options,void 0,e)}trimOptions(e){let t=!1;const o=e.map(([$,T])=>typeof $=="string"?[pt($),T]:(t=!0,[$.alt!==null?Object.assign({},$,{alt:pt($.alt)}):Object.assign({},$),T]));if(t||2>e.length)return{options:o};var n=o.map(([$])=>$),c=Vn(n);e=Gu(n,c);const h=Vu(n,c);return!e&&!h||c<=e+h?{options:o}:(c=e?n[0].substring(0,e-1):void 0,n=h?n[0].substr(1-h):void 0,{options:this.applyTrim(o,e,h),prefix:c,suffix:n})}applyTrim(e,t,o){return e.map(([n,c])=>[n.substring(t,n.length-o),c])}validateOptions(e){if(!Array.isArray(e))throw TypeError("FieldDropdown options must be an array.");if(!e.length)throw TypeError("FieldDropdown options must not be an empty array.");let t=!1;for(let o=0;oe.width)return t;if(e=this.getWorkspaceViewRect(e),this.workspace.RTL){var o=this.anchor.x-t;o-this.size.widthe.right&&(t=-(e.right-this.anchor.x))}else{o=t+this.anchor.x;const n=o+this.size.width;oe.right&&(t=e.right-this.anchor.x-this.size.width)}return t}getOptimalRelativeTop(e){let t=-this.size.height/4;if(this.size.height>e.height)return t;const o=this.anchor.y+t,n=o+this.size.height;return e=this.getWorkspaceViewRect(e),oe.bottom&&(t=e.bottom-this.anchor.y-this.size.height),t}getWorkspaceViewRect(e){const t=e.top;let o=e.top+e.height,n=e.left;return e=e.left+e.width,o-=this.getScrollbarThickness(),this.workspace.RTL?n-=this.getScrollbarThickness():e-=this.getScrollbarThickness(),new qe(t,o,n,e)}getScrollbarThickness(){return mt.scrollbarThickness/this.workspace.scale}renderTail(){const e=[];var t=this.size.width/2,o=this.size.height/2,n=-this.relativeLeft,c=-this.relativeTop;if(t===n&&o===c)e.push("M "+t+","+o);else{c-=o,n-=t,this.workspace.RTL&&(n*=-1);var h=Math.sqrt(c*c+n*n),$=Math.acos(n/h);0>c&&($=2*Math.PI-$);var T=$+Math.PI/2;T>2*Math.PI&&(T-=2*Math.PI);var L=Math.sin(T);const nt=Math.cos(T);let it=(this.size.width+this.size.height)/ss.TAIL_THICKNESS;it=Math.min(it,this.size.width,this.size.height)/4,T=1-ss.ANCHOR_RADIUS/h,n=t+T*n,c=o+T*c,T=t+it*nt;const Xt=o+it*L;t-=it*nt,o-=it*L,L=Ia(this.workspace.RTL?-ss.TAIL_ANGLE:ss.TAIL_ANGLE),L=$+L,L>2*Math.PI&&(L-=2*Math.PI),$=Math.sin(L)*h/ss.TAIL_BEND,h=Math.cos(L)*h/ss.TAIL_BEND,e.push("M"+T+","+Xt),e.push("C"+(T+h)+","+(Xt+$)+" "+n+","+c+" "+n+","+c),e.push("C"+n+","+c+" "+(t+h)+","+(o+$)+" "+t+","+o)}e.push("z");let te;(te=this.tail)==null||te.setAttribute("d",e.join(" "))}bringToFront(){let e;const t=(e=this.svgRoot)==null?void 0:e.parentNode;return this.svgRoot&&(t==null?void 0:t.lastChild)!==this.svgRoot?(t==null||t.appendChild(this.svgRoot),!0):!1}getRelativeToSurfaceXY(){return new G(this.workspace.RTL?-this.relativeLeft+this.anchor.x-this.size.width:this.anchor.x+this.relativeLeft,this.anchor.y+this.relativeTop)}getSvgRoot(){return this.svgRoot}moveDuringDrag(e){this.moveTo(e.x,e.y),this.relativeLeft=this.workspace.RTL?this.anchor.x-e.x-this.size.width:e.x-this.anchor.x,this.relativeTop=e.y-this.anchor.y,this.renderTail()}setDragging(e){}setDeleteStyle(e){}isDeletable(){return!1}showContextMenu(e){}isMovable(){return!0}startDrag(){this.dragStrategy.startDrag()}drag(e){this.dragStrategy.drag(e)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){}unselect(){}};ss=Ye,Ye.BORDER_WIDTH=6,Ye.DOUBLE_BORDER=2*ss.BORDER_WIDTH,Ye.MIN_SIZE=ss.DOUBLE_BORDER,Ye.TAIL_THICKNESS=1,Ye.TAIL_ANGLE=20,Ye.TAIL_BEND=4,Ye.ANCHOR_RADIUS=8;var uo=class extends Ye{constructor(e,t,o,n){super(t,o,n),this.workspace=t,this.anchor=o,this.ownerRect=n,this.autoLayout=!0,t=new ds(e),this.validateWorkspaceOptions(t),this.svgDialog=N(x.SVG,{x:Ye.BORDER_WIDTH,y:Ye.BORDER_WIDTH},this.contentContainer),e.parentWorkspace=this.workspace,this.miniWorkspace=this.newWorkspaceSvg(new ds(e)),this.miniWorkspace.internalIsMutator=!0,e=this.miniWorkspace.createDom("blocklyMutatorBackground"),this.svgDialog.appendChild(e),t.languageTree&&(e.insertBefore(this.miniWorkspace.addFlyout(x.G),this.miniWorkspace.getCanvas()),e=this.miniWorkspace.getFlyout(),e==null||e.init(this.miniWorkspace),e==null||e.show(t.languageTree)),this.miniWorkspace.addChangeListener(this.onWorkspaceChange.bind(this));let c,h;(c=this.miniWorkspace.getFlyout())==null||(h=c.getWorkspace())==null||h.addChangeListener(this.onWorkspaceChange.bind(this)),this.updateBubbleSize()}dispose(){this.miniWorkspace.dispose(),super.dispose()}getWorkspace(){return this.miniWorkspace}addWorkspaceChangeListener(e){this.miniWorkspace.addChangeListener(e)}validateWorkspaceOptions(e){if(e.hasCategories)throw Error("The miniworkspace bubble does not support toolboxes with categories");if(e.hasTrashcan)throw Error("The miniworkspace bubble does not support trashcans");if(e.zoomOptions.controls||e.zoomOptions.wheel||e.zoomOptions.pinch)throw Error("The miniworkspace bubble does not support zooming");if(e.moveOptions.scrollbars||e.moveOptions.wheel||e.moveOptions.drag)throw Error("The miniworkspace bubble does not scrolling/moving the workspace");if(e.horizontalLayout)throw Error("The miniworkspace bubble does not support horizontal layouts")}onWorkspaceChange(){this.bumpBlocksIntoBounds(),this.updateBubbleSize()}bumpBlocksIntoBounds(){if(!this.miniWorkspace.isDragging())for(const e of this.miniWorkspace.getTopBlocks(!1)){const t=e.getRelativeToSurfaceXY();if(20>t.y&&e.moveBy(0,20-t.y),e.RTL){let o=-20;const n=this.miniWorkspace.getFlyout();n&&(o-=n.getWidth()),t.x>o&&e.moveBy(o-t.x,0)}else 20>t.x&&e.moveBy(20-t.x,0)}}updateBubbleSize(){if(!this.miniWorkspace.isDragging()){var e=this.getSize(),t=this.calculateWorkspaceSize();Math.abs(e.width-t.width)({kind:"block",type:o}))}),t}getAnchorLocation(){const e=Dl/2;return G.sum(this.workspaceLocation,new G(e,e))}getBubbleOwnerRect(){const e=this.sourceBlock.getSvgRoot().getBBox();return new qe(e.y,e.y+e.height,e.x,e.x+e.width)}createRootBlock(){if(!this.sourceBlock.decompose)throw Error("Blocks with mutator icons must include a decompose method");this.rootBlock=this.sourceBlock.decompose(this.miniWorkspaceBubble.getWorkspace());for(var e of this.rootBlock.getDescendants(!1))e.queueRender();this.rootBlock.setMovable(!1),this.rootBlock.setDeletable(!1);let t,o,n,c;e=(c=(t=this.miniWorkspaceBubble)==null||(o=t.getWorkspace())==null||(n=o.getFlyout())==null?void 0:n.getWidth())!=null?c:0,this.rootBlock.moveBy(this.rootBlock.RTL?-(e+Al):Al,Al)}addSaveConnectionsListener(){this.sourceBlock.saveConnections&&this.rootBlock&&(this.saveConnectionsListener=()=>{this.sourceBlock.saveConnections&&this.rootBlock&&this.sourceBlock.saveConnections(this.rootBlock)},this.saveConnectionsListener(),this.sourceBlock.workspace.addChangeListener(this.saveConnectionsListener))}createMiniWorkspaceChangeListener(){return e=>{i.MutatorIcon$$module$build$src$core$icons$mutator_icon.isIgnorableMutatorEvent(e)||this.updateWorkspacePid||(this.updateWorkspacePid=setTimeout(()=>{this.updateWorkspacePid=null,this.recomposeSourceBlock()},0))}}static isIgnorableMutatorEvent(e){return e.isUiEvent||w(e)||R(e)&&e.element==="disabled"}recomposeSourceBlock(){if(this.rootBlock){if(!this.sourceBlock.compose)throw Error("Blocks with mutator icons must include a compose method");var e=i.getGroup$$module$build$src$core$events$utils();e||i.setGroup$$module$build$src$core$events$utils(!0);var t=ri.getExtraBlockState_(this.sourceBlock);this.sourceBlock.compose(this.rootBlock);var o=ri.getExtraBlockState_(this.sourceBlock);t!==o&&z(new(V(O.BLOCK_CHANGE))(this.sourceBlock,"mutation",null,t,o)),i.setGroup$$module$build$src$core$events$utils(e)}}getWorkspace(){let e;return(e=this.miniWorkspaceBubble)==null?void 0:e.getWorkspace()}},i.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE=yt.MUTATOR,i.MutatorIcon$$module$build$src$core$icons$mutator_icon.WEIGHT=1,i.MutatorIcon$$module$build$src$core$icons$mutator_icon;var sn=Object.create(null),qT={allExtensions:sn};i.register$$module$build$src$core$extensions("parent_tooltip_when_inline",x$);var Is={TEST_ONLY:qT};Is.apply=Ha,Is.buildTooltipForDropdown=i.buildTooltipForDropdown$$module$build$src$core$extensions,Is.buildTooltipWithFieldText=i.buildTooltipWithFieldText$$module$build$src$core$extensions,Is.isRegistered=_d,Is.register=i.register$$module$build$src$core$extensions,Is.registerMixin=i.registerMixin$$module$build$src$core$extensions,Is.registerMutator=i.registerMutator$$module$build$src$core$extensions,Is.runAfterPageLoad=E$,Is.unregister=w$;var Ae;(function(e){e[e.WIN_KEY_FF_LINUX=0]="WIN_KEY_FF_LINUX",e[e.MAC_ENTER=3]="MAC_ENTER",e[e.BACKSPACE=8]="BACKSPACE",e[e.TAB=9]="TAB",e[e.NUM_CENTER=12]="NUM_CENTER",e[e.ENTER=13]="ENTER",e[e.SHIFT=16]="SHIFT",e[e.CTRL=17]="CTRL",e[e.ALT=18]="ALT",e[e.PAUSE=19]="PAUSE",e[e.CAPS_LOCK=20]="CAPS_LOCK",e[e.ESC=27]="ESC",e[e.SPACE=32]="SPACE",e[e.PAGE_UP=33]="PAGE_UP",e[e.PAGE_DOWN=34]="PAGE_DOWN",e[e.END=35]="END",e[e.HOME=36]="HOME",e[e.LEFT=37]="LEFT",e[e.UP=38]="UP",e[e.RIGHT=39]="RIGHT",e[e.DOWN=40]="DOWN",e[e.PLUS_SIGN=43]="PLUS_SIGN",e[e.PRINT_SCREEN=44]="PRINT_SCREEN",e[e.INSERT=45]="INSERT",e[e.DELETE=46]="DELETE",e[e.ZERO=48]="ZERO",e[e.ONE=49]="ONE",e[e.TWO=50]="TWO",e[e.THREE=51]="THREE",e[e.FOUR=52]="FOUR",e[e.FIVE=53]="FIVE",e[e.SIX=54]="SIX",e[e.SEVEN=55]="SEVEN",e[e.EIGHT=56]="EIGHT",e[e.NINE=57]="NINE",e[e.FF_SEMICOLON=59]="FF_SEMICOLON",e[e.FF_EQUALS=61]="FF_EQUALS",e[e.FF_DASH=173]="FF_DASH",e[e.FF_HASH=163]="FF_HASH",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.AT_SIGN=64]="AT_SIGN",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.META=91]="META",e[e.WIN_KEY_RIGHT=92]="WIN_KEY_RIGHT",e[e.CONTEXT_MENU=93]="CONTEXT_MENU",e[e.NUM_ZERO=96]="NUM_ZERO",e[e.NUM_ONE=97]="NUM_ONE",e[e.NUM_TWO=98]="NUM_TWO",e[e.NUM_THREE=99]="NUM_THREE",e[e.NUM_FOUR=100]="NUM_FOUR",e[e.NUM_FIVE=101]="NUM_FIVE",e[e.NUM_SIX=102]="NUM_SIX",e[e.NUM_SEVEN=103]="NUM_SEVEN",e[e.NUM_EIGHT=104]="NUM_EIGHT",e[e.NUM_NINE=105]="NUM_NINE",e[e.NUM_MULTIPLY=106]="NUM_MULTIPLY",e[e.NUM_PLUS=107]="NUM_PLUS",e[e.NUM_MINUS=109]="NUM_MINUS",e[e.NUM_PERIOD=110]="NUM_PERIOD",e[e.NUM_DIVISION=111]="NUM_DIVISION",e[e.F1=112]="F1",e[e.F2=113]="F2",e[e.F3=114]="F3",e[e.F4=115]="F4",e[e.F5=116]="F5",e[e.F6=117]="F6",e[e.F7=118]="F7",e[e.F8=119]="F8",e[e.F9=120]="F9",e[e.F10=121]="F10",e[e.F11=122]="F11",e[e.F12=123]="F12",e[e.NUMLOCK=144]="NUMLOCK",e[e.SCROLL_LOCK=145]="SCROLL_LOCK",e[e.FIRST_MEDIA_KEY=166]="FIRST_MEDIA_KEY",e[e.LAST_MEDIA_KEY=183]="LAST_MEDIA_KEY",e[e.SEMICOLON=186]="SEMICOLON",e[e.DASH=189]="DASH",e[e.EQUALS=187]="EQUALS",e[e.COMMA=188]="COMMA",e[e.PERIOD=190]="PERIOD",e[e.SLASH=191]="SLASH",e[e.APOSTROPHE=192]="APOSTROPHE",e[e.TILDE=192]="TILDE",e[e.SINGLE_QUOTE=222]="SINGLE_QUOTE",e[e.OPEN_SQUARE_BRACKET=219]="OPEN_SQUARE_BRACKET",e[e.BACKSLASH=220]="BACKSLASH",e[e.CLOSE_SQUARE_BRACKET=221]="CLOSE_SQUARE_BRACKET",e[e.WIN_KEY=224]="WIN_KEY",e[e.MAC_FF_META=224]="MAC_FF_META",e[e.MAC_WK_CMD_LEFT=91]="MAC_WK_CMD_LEFT",e[e.MAC_WK_CMD_RIGHT=93]="MAC_WK_CMD_RIGHT",e[e.WIN_IME=229]="WIN_IME",e[e.VK_NONAME=252]="VK_NONAME",e[e.PHANTOM=255]="PHANTOM"})(Ae||(Ae={}));var ho={};ho.arc=gt,ho.curve=Yt,ho.line=Fi,ho.lineOnAxis=ne,ho.lineTo=Bs,ho.moveBy=at,ho.moveTo=wt,ho.point=ue;var ut={};ut.Coordinate=G,ut.KeyCodes=Ae,ut.Rect=qe,ut.Size=Le,ut.Svg=x,ut.aria=cr,ut.array=Ob,ut.browserEvents=no,ut.colour=us,ut.deprecation=hb,ut.dom=xt,ut.extensions=Is,ut.idGenerator=ph,ut.math=gl,ut.object=$v,ut.parsing=br,ut.string=qi,ut.style=So,ut.svgMath=ti,ut.svgPaths=ho,ut.toolbox=Eo,ut.userAgent=LT,ut.xml=Hi;var yv=class extends Ye{constructor(e,t,o){super(e,t,o),this.workspace=e,this.anchor=t,this.ownerRect=o,this.resizePointerMoveListener=this.resizePointerUpListener=null,this.textChangeListeners=[],this.sizeChangeListeners=[],this.text="",this.DEFAULT_SIZE=new Le(160+Ye.DOUBLE_BORDER,80+Ye.DOUBLE_BORDER),this.MIN_SIZE=new Le(45+Ye.DOUBLE_BORDER,20+Ye.DOUBLE_BORDER),this.editable=!0,ge(this.svgRoot,"blocklyTextInputBubble"),{inputRoot:this.inputRoot,textArea:this.textArea}=this.createEditor(this.contentContainer),this.resizeGroup=this.createResizeHandle(this.svgRoot,e),this.setSize(this.DEFAULT_SIZE,!0)}getText(){return this.text}setText(e){this.text=e,this.textArea.value=e,this.onTextChange()}setEditable(e){(this.editable=e)?this.textArea.removeAttribute("readonly"):this.textArea.setAttribute("readonly","")}isEditable(){return this.editable}addTextChangeListener(e){this.textChangeListeners.push(e)}addSizeChangeListener(e){this.sizeChangeListeners.push(e)}createEditor(e){e=N(x.FOREIGNOBJECT,{x:Ye.BORDER_WIDTH,y:Ye.BORDER_WIDTH},e);const t=document.createElementNS(Fs,"body");t.setAttribute("xmlns",Fs),t.className="blocklyMinimalBody";const o=document.createElementNS(Fs,"textarea");return o.className="blocklyTextarea blocklyText",o.setAttribute("dir",this.workspace.RTL?"RTL":"LTR"),t.appendChild(o),e.appendChild(t),this.bindTextAreaEvents(o),setTimeout(()=>{o.focus()},0),{inputRoot:e,textArea:o}}bindTextAreaEvents(e){X(e,"wheel",this,t=>{t.stopPropagation()}),X(e,"focus",this,this.onStartEdit,!0),X(e,"change",this,this.onTextChange)}createResizeHandle(e,t){return e=N(x.IMAGE,{class:"blocklyResizeHandle",href:`${t.options.pathToMedia}resize-handle.svg`},e),X(e,"pointerdown",this,this.onResizePointerDown),e}setSize(e,t=!1){e.width=Math.max(e.width,this.MIN_SIZE.width),e.height=Math.max(e.height,this.MIN_SIZE.height);const o=e.width-Ye.DOUBLE_BORDER,n=e.height-Ye.DOUBLE_BORDER;this.inputRoot.setAttribute("width",`${o}`),this.inputRoot.setAttribute("height",`${n}`),this.resizeGroup.setAttribute("y",`${n}`),this.workspace.RTL?this.resizeGroup.setAttribute("x",`${-Ye.DOUBLE_BORDER}`):this.resizeGroup.setAttribute("x",`${o}`),super.setSize(e,t),this.onSizeChange()}getSize(){return super.getSize()}onResizePointerDown(e){this.bringToFront(),ve(e)||(Ba(this.workspace,e,new G(this.workspace.RTL?-this.getSize().width:this.getSize().width,this.getSize().height)),this.resizePointerUpListener=X(document,"pointerup",this,this.onResizePointerUp),this.resizePointerMoveListener=X(document,"pointermove",this,this.onResizePointerMove),this.workspace.hideChaff()),e.stopPropagation()}onResizePointerUp(e){ke(),this.resizePointerUpListener&&(ze(this.resizePointerUpListener),this.resizePointerUpListener=null),this.resizePointerMoveListener&&(ze(this.resizePointerMoveListener),this.resizePointerMoveListener=null)}onResizePointerMove(e){e=ja(this.workspace,e),this.setSize(new Le(this.workspace.RTL?-e.x:e.x,e.y),!1),this.onSizeChange()}onStartEdit(){this.bringToFront()&&this.textArea.focus()}onTextChange(){this.text=this.textArea.value;for(const e of this.textChangeListeners)e()}onSizeChange(){for(const e of this.sizeChangeListeners)e()}};Et(` -.blocklyTextInputBubble .blocklyTextarea { - background-color: var(--commentFillColour); - border: 0; - box-sizing: border-box; - display: block; - outline: 0; - padding: 5px; - resize: none; - width: 100%; - height: 100%; -} -`);var tp={};tp.register=Td,tp.unregister=D$;var sp=17,_v=160,wv=80,po=class extends xl{constructor(e){super(e),this.sourceBlock=e,this.textInputBubble=null,this.text="",this.bubbleSize=new Le(_v,wv),this.bubbleVisiblity=!1}getType(){return po.TYPE}initView(e){this.svgRoot||(super.initView(e),N(x.CIRCLE,{class:"blocklyIconShape",r:"8",cx:"8",cy:"8"},this.svgRoot),N(x.PATH,{class:"blocklyIconSymbol",d:"m6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.4050.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25-1.201,0.998 -1.201,1.528 -1.204,2.19z"},this.svgRoot),N(x.RECT,{class:"blocklyIconSymbol",x:"6.8",y:"10.78",height:"2",width:"2"},this.svgRoot),ge(this.svgRoot,"blockly-icon-comment"))}dispose(){super.dispose();let e;(e=this.textInputBubble)==null||e.dispose()}getWeight(){return po.WEIGHT}getSize(){return new Le(sp,sp)}applyColour(){super.applyColour();const e=this.sourceBlock.getColour();let t;(t=this.textInputBubble)==null||t.setColour(e)}updateEditable(){const e=this,t=()=>super.updateEditable;return j.asyncExecutePromiseGeneratorFunction(function*(){t().call(e),e.bubbleIsVisible()&&(yield e.setBubbleVisible(!1),yield e.setBubbleVisible(!0))})}onLocationChange(e){super.onLocationChange(e),e=this.getAnchorLocation();let t;(t=this.textInputBubble)==null||t.setAnchorLocation(e)}setText(e){const t=this.text;z(new(V(O.BLOCK_CHANGE))(this.sourceBlock,"comment",null,t,e)),this.text=e;let o;(o=this.textInputBubble)==null||o.setText(this.text)}getText(){return this.text}setBubbleSize(e){this.bubbleSize=e;let t;(t=this.textInputBubble)==null||t.setSize(this.bubbleSize,!0)}getBubbleSize(){return this.bubbleSize}saveState(){return this.text?{text:this.text,pinned:this.bubbleIsVisible(),height:this.bubbleSize.height,width:this.bubbleSize.width}:null}loadState(e){let t;this.text=(t=e.text)!=null?t:"";let o,n;this.bubbleSize=new Le((o=e.width)!=null?o:_v,(n=e.height)!=null?n:wv);let c;this.bubbleVisiblity=(c=e.pinned)!=null?c:!1,this.setBubbleVisible(this.bubbleVisiblity)}onClick(){super.onClick(),this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}onTextChange(){if(this.textInputBubble){var e=this.textInputBubble.getText();this.text!==e&&(z(new(V(O.BLOCK_CHANGE))(this.sourceBlock,"comment",null,this.text,e)),this.text=e)}}onSizeChange(){this.textInputBubble&&(this.bubbleSize=this.textInputBubble.getSize())}bubbleIsVisible(){return this.bubbleVisiblity}setBubbleVisible(e){const t=this;return j.asyncExecutePromiseGeneratorFunction(function*(){t.bubbleVisiblity!==e&&(t.bubbleVisiblity=e,yield ws(),!t.sourceBlock.rendered||t.sourceBlock.isInFlyout||t.sourceBlock.isInsertionMarker()||(e?(t.sourceBlock.isEditable()?t.showEditableBubble():t.showNonEditableBubble(),t.applyColour()):t.hideBubble(),z(new(V(O.BUBBLE_OPEN))(t.sourceBlock,e,"comment"))))})}showEditableBubble(){this.createBubble();let e;(e=this.textInputBubble)==null||e.addTextChangeListener(()=>this.onTextChange());let t;(t=this.textInputBubble)==null||t.addSizeChangeListener(()=>this.onSizeChange())}showNonEditableBubble(){this.createBubble();let e;(e=this.textInputBubble)==null||e.setEditable(!1)}createBubble(){this.textInputBubble=new yv(this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect()),this.textInputBubble.setText(this.getText()),this.textInputBubble.setSize(this.bubbleSize,!0)}hideBubble(){let e;(e=this.textInputBubble)==null||e.dispose(),this.textInputBubble=null}getAnchorLocation(){const e=sp/2;return G.sum(this.workspaceLocation,new G(e,e))}getBubbleOwnerRect(){return this.sourceBlock.getBoundingRectangleWithoutChildren()}};po.TYPE=yt.COMMENT,po.WEIGHT=3,Td(po.TYPE,po);var Cv=class extends Error{constructor(e){super(`Tried to append an icon of type ${e.getType()} when an icon of that type already exists on the block. Use getIcon to access the existing icon.`),this.icon=e}},Tv={};Tv.DuplicateIconType=Cv;var kv=class extends Ye{constructor(e,t,o,n){super(t,o,n),this.text=e,this.workspace=t,this.anchor=o,this.ownerRect=n,this.paragraph=this.stringToSvg(e,this.contentContainer),this.updateBubbleSize()}getText(){return this.text}setText(e){this.text=e,Ke(this.paragraph),this.paragraph=this.stringToSvg(e,this.contentContainer),this.updateBubbleSize()}stringToSvg(e,t){return t=this.createParagraph(t),e=this.createTextFragments(t,e),this.workspace.RTL&&this.rightAlignTextFragments(t.getBBox().width,e),t}createParagraph(e){return N(x.G,{class:"blocklyText blocklyBubbleText blocklyNoPointerEvents",transform:`translate(0,${Ye.BORDER_WIDTH})`,style:`direction: ${this.workspace.RTL?"rtl":"ltr"}`},e)}createTextFragments(e,t){let o=1;return t.split(` -`).map(n=>{const c=N(x.TEXT,{y:`${o}em`,x:Ye.BORDER_WIDTH},e);return n=document.createTextNode(n),c.appendChild(n),o+=1,c})}rightAlignTextFragments(e,t){for(const o of t)o.setAttribute("text-anchor","start"),o.setAttribute("x",`${e+Ye.BORDER_WIDTH}`)}updateBubbleSize(){const e=this.paragraph.getBBox();this.setSize(new Le(e.width+2*Ye.BORDER_WIDTH,e.height+2*Ye.BORDER_WIDTH),!0)}},op=17,go=class extends xl{constructor(e){super(e),this.sourceBlock=e,this.textMap=new Map,this.textBubble=null}getType(){return go.TYPE}initView(e){this.svgRoot||(super.initView(e),N(x.PATH,{class:"blocklyIconShape",d:"M2,15Q-1,15 0.5,12L6.5,1.7Q8,-1 9.5,1.7L15.5,12Q17,15 14,15z"},this.svgRoot),N(x.PATH,{class:"blocklyIconSymbol",d:"m7,4.8v3.16l0.27,2.27h1.46l0.27,-2.27v-3.16z"},this.svgRoot),N(x.RECT,{class:"blocklyIconSymbol",x:"7",y:"11",height:"2",width:"2"},this.svgRoot),ge(this.svgRoot,"blockly-icon-warning"))}dispose(){super.dispose();let e;(e=this.textBubble)==null||e.dispose()}getWeight(){return go.WEIGHT}getSize(){return new Le(op,op)}applyColour(){super.applyColour();let e;(e=this.textBubble)==null||e.setColour(this.sourceBlock.getColour())}updateCollapsed(){}isShownWhenCollapsed(){return!0}onLocationChange(e){super.onLocationChange(e);let t;(t=this.textBubble)==null||t.setAnchorLocation(this.getAnchorLocation())}addMessage(e,t){if(this.textMap.get(t)===e)return this;e?this.textMap.set(t,e):this.textMap.delete(t);let o;return(o=this.textBubble)==null||o.setText(this.getText()),this}getText(){return[...this.textMap.values()].join(` -`)}onClick(){super.onClick(),this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}bubbleIsVisible(){return!!this.textBubble}setBubbleVisible(e){const t=this;return j.asyncExecutePromiseGeneratorFunction(function*(){if(t.bubbleIsVisible()!==e){if(yield ws(),e)t.textBubble=new kv(t.getText(),t.sourceBlock.workspace,t.getAnchorLocation(),t.getBubbleOwnerRect()),t.applyColour();else{let o;(o=t.textBubble)==null||o.dispose(),t.textBubble=null}z(new(V(O.BUBBLE_OPEN))(t.sourceBlock,e,"warning"))}})}getAnchorLocation(){const e=op/2;return G.sum(this.workspaceLocation,new G(e,e))}getBubbleOwnerRect(){const e=this.sourceBlock.getSvgRoot().getBBox();return new qe(e.y,e.y+e.height,e.x,e.x+e.width)}};go.TYPE=yt.WARNING,go.WEIGHT=2;var Ao={};Ao.CommentIcon=po,Ao.Icon=xl,Ao.IconType=yt,Ao.MutatorIcon=i.MutatorIcon$$module$build$src$core$icons$mutator_icon,Ao.WarningIcon=go,Ao.exceptions=Tv,Ao.registry=tp,i.Names$$module$build$src$core$names=class{constructor(e,t){this.db=new Map,this.dbReverse=new Set,this.variableMap=null,this.variablePrefix=t||"",this.reservedWords=new Set(e?e.split(","):[])}reset(){this.db.clear(),this.dbReverse.clear(),this.variableMap=null}setVariableMap(e){this.variableMap=e}getNameForUserVariable(e){return this.variableMap?(e=this.variableMap.getVariableById(e))?e.name:null:(console.warn(`Deprecated call to Names.prototype.getName without defining a variable map. To fix, add the following code in your generator's init() function: -Blockly.YourGeneratorName.nameDB_.setVariableMap(workspace.getVariableMap());`),null)}populateVariables(e){e=i.allUsedVarModels$$module$build$src$core$variables(e);for(let t=0;trect,`,`${e} .blocklyEditableText>rect {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"fill-opacity: .6;","stroke: none;","}",`${e} .blocklyNonEditableText>text,`,`${e} .blocklyEditableText>text {`,"fill: #000;","}",`${e} .blocklyFlyoutLabelText {`,"fill: #000;","}",`${e} .blocklyText.blocklyBubbleText {`,"fill: #000;","}",`${e} .blocklyEditableText:not(.editing):hover>rect {`,"stroke: #fff;","stroke-width: 2;","}",`${e} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,"}",`${e} .blocklySelected>.blocklyPath {`,"stroke: #fc3;","stroke-width: 3px;","}",`${e} .blocklyHighlightedConnectionPath {`,"stroke: #fc3;","}",`${e} .blocklyReplaceable .blocklyPath {`,"fill-opacity: .5;","}",`${e} .blocklyReplaceable .blocklyPathLight,`,`${e} .blocklyReplaceable .blocklyPathDark {`,"display: none;","}",`${e} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"]}},Nl=class{constructor(e,t){this.inlinePath_=this.outlinePath_="",this.block_=e,this.info_=t,this.topLeft_=e.getRelativeToSurfaceXY(),this.constants_=t.getRenderer().getConstants()}draw(){this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights(),this.block_.pathObject.setPath(this.outlinePath_+` -`+this.inlinePath_),this.info_.RTL&&this.block_.pathObject.flipRTL(),this.recordSizeOnBlock_()}recordSizeOnBlock_(){this.block_.height=this.info_.height,this.block_.width=this.info_.widthWithChildren,this.block_.childlessWidth=this.info_.width}drawOutline_(){this.drawTop_();for(let e=1;ee||e>this.fieldRow.length)throw Error("index "+e+" out of bounds.");return(t||t===""&&o)&&(typeof t=="string"&&(t=i.fromJson$$module$build$src$core$field_registry({type:"field_label",text:t})),t.setSourceBlock(this.sourceBlock),this.sourceBlock.initialized&&this.initField(t),t.name=o,t.setVisible(this.isVisible()),t.prefixField&&(e=this.insertFieldAt(e,t.prefixField)),this.fieldRow.splice(e,0,t),e++,t.suffixField&&(e=this.insertFieldAt(e,t.suffixField)),this.sourceBlock.rendered&&this.sourceBlock.queueRender()),e}removeField(e,t){for(let o=0,n;n=this.fieldRow[o];o++)if(n.name===e)return n.dispose(),this.fieldRow.splice(o,1),this.sourceBlock.rendered&&this.sourceBlock.queueRender(),!0;if(t)return!1;throw Error('Field "'+e+'" not found.')}isVisible(){return this.visible}setVisible(e){let t=[];if(this.visible===e)return t;this.visible=e;for(let n=0,c;c=this.fieldRow[n];n++)c.setVisible(e);if(this.connection){var o=this.connection;e?t=o.startTrackingAll():o.stopTrackingAll(),(o=o.targetBlock())&&(o.getSvgRoot().style.display=e?"block":"none")}return t}markDirty(){for(let e=0,t;t=this.fieldRow[e];e++)t.markDirty()}setCheck(e){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setCheck(e),this}setAlign(e){return this.align=e,this.sourceBlock.rendered&&this.sourceBlock.queueRender(),this}setShadowDom(e){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setShadowDom(e),this}getShadowDom(){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.getShadowDom()}init(){for(const e of this.fieldRow)e.init()}initModel(){for(const e of this.fieldRow)e.initModel()}initField(e){this.sourceBlock.rendered?e.init():e.initModel()}dispose(){for(let e=0,t;t=this.fieldRow[e];e++)t.dispose();this.connection&&this.connection.dispose()}makeConnection(e){return this.sourceBlock.makeConnection_(e)}},Us=class extends nn{constructor(e,t){super(e,t),this.name=e,this.type=i.inputTypes$$module$build$src$core$inputs$input_types.DUMMY}},fo=class extends nn{constructor(e,t){super(e,t),this.name=e,this.type=i.inputTypes$$module$build$src$core$inputs$input_types.END_ROW}},is=class extends nn{constructor(e,t){if(!e)throw Error("Statement inputs must have a non-empty name");super(e,t),this.name=e,this.type=i.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT,this.connection=this.makeConnection(oe.NEXT_STATEMENT)}},Rv;i.ValueInput$$module$build$src$core$inputs$value_input=class extends nn{constructor(e,t){if(!e)throw Error("Value inputs must have a non-empty name");super(e,t),this.name=e,this.type=i.inputTypes$$module$build$src$core$inputs$input_types.VALUE,this.connection=this.makeConnection(oe.INPUT_VALUE)}},Rv={},Rv.ValueInput=i.ValueInput$$module$build$src$core$inputs$value_input;var kr=class{constructor(e,t){this.statementEdge=this.width=this.widthWithChildren=this.height=0,this.rows=[],this.inputRows=[],this.startY=this.startX=0,this.renderer_=e,this.block_=t,this.constants_=this.renderer_.getConstants(),this.outputConnection=t.outputConnection?new Dv(this.constants_,t.outputConnection):null,this.isInline=t.getInputsInline()&&!t.isCollapsed(),this.isCollapsed=t.isCollapsed(),this.isInsertionMarker=t.isInsertionMarker(),this.RTL=t.RTL,this.topRow=new cp(this.constants_),this.bottomRow=new ip(this.constants_)}getRenderer(){return this.renderer_}measure(){this.createRows_(),this.addElemSpacing_(),this.addRowSpacing_(),this.computeBounds_(),this.alignRowElements_(),this.finalize_()}createRows_(){this.populateTopRow_(),this.rows.push(this.topRow);let e=new ap(this.constants_);this.inputRows.push(e);var t=this.block_.getIcons();for(let o=0,n;n=t[o];o++){const c=new Ev(this.constants_,n);this.isCollapsed&&!n.isShownWhenCollapsed()||e.elements.push(c)}t=void 0;for(let o=0,n;n=this.block_.inputList[o];o++)if(n.isVisible()){this.shouldStartNewRow_(n,t)&&(this.rows.push(e),e=new ap(this.constants_),this.inputRows.push(e));for(let c=0,h;h=n.fieldRow[c];c++)e.elements.push(new on(this.constants_,h,n));this.addInput_(n,e),t=n}this.isCollapsed&&(e.hasJaggedEdge=!0,e.elements.push(new Iv(this.constants_))),(e.elements.length||e.hasDummyInput)&&this.rows.push(e),this.populateBottomRow_(),this.rows.push(this.bottomRow)}populateTopRow_(){var e=!!this.block_.previousConnection;const t=(this.block_.hat?this.block_.hat==="cap":this.constants_.ADD_START_HATS)&&!this.outputConnection&&!e;let o=this.topRow.hasLeftSquareCorner(this.block_)?Tr:Cr;this.topRow.elements.push(new o(this.constants_)),t?(e=new np(this.constants_),this.topRow.elements.push(e),this.topRow.capline=e.ascenderHeight):e&&(this.topRow.hasPreviousConnection=!0,this.topRow.connection=new Av(this.constants_,this.block_.previousConnection),this.topRow.elements.push(this.topRow.connection)),this.block_.inputList.length&&this.block_.inputList[0]instanceof is&&!this.block_.isCollapsed()?this.topRow.minHeight=this.constants_.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT:this.topRow.minHeight=this.constants_.TOP_ROW_MIN_HEIGHT,o=this.topRow.hasRightSquareCorner(this.block_)?Tr:Cr,this.topRow.elements.push(new o(this.constants_,"right"))}populateBottomRow_(){this.bottomRow.hasNextConnection=!!this.block_.nextConnection,this.bottomRow.minHeight=this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1]instanceof is?this.constants_.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT:this.constants_.BOTTOM_ROW_MIN_HEIGHT,this.bottomRow.hasLeftSquareCorner(this.block_)?this.bottomRow.elements.push(new Tr(this.constants_)):this.bottomRow.elements.push(new Cr(this.constants_)),this.bottomRow.hasNextConnection&&(this.bottomRow.connection=new xv(this.constants_,this.block_.nextConnection),this.bottomRow.elements.push(this.bottomRow.connection)),this.bottomRow.hasRightSquareCorner(this.block_)?this.bottomRow.elements.push(new Tr(this.constants_,"right")):this.bottomRow.elements.push(new Cr(this.constants_,"right"))}addInput_(e,t){this.isInline&&e instanceof i.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new rp(this.constants_,e)),t.hasInlineInput=!0):e instanceof is?(t.elements.push(new wr(this.constants_,e)),t.hasStatement=!0):e instanceof i.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new Ol(this.constants_,e)),t.hasExternalInput=!0):(e instanceof Us||e instanceof fo)&&(t.minHeight=Math.max(t.minHeight,e.getSourceBlock()&&e.getSourceBlock().isShadow()?this.constants_.DUMMY_INPUT_SHADOW_MIN_HEIGHT:this.constants_.DUMMY_INPUT_MIN_HEIGHT),t.hasDummyInput=!0),t.align===null&&(t.align=e.align)}shouldStartNewRow_(e,t){return t?t instanceof fo||e instanceof is||t instanceof is?!0:e instanceof i.ValueInput$$module$build$src$core$inputs$value_input||e instanceof Us||t instanceof i.ValueInput$$module$build$src$core$inputs$value_input?!this.isInline:!1:!1}addElemSpacing_(){for(let e=0,t;t=this.rows[e];e++){const o=t.elements;if(t.elements=[],t.startsWithElemSpacer()&&t.elements.push(new os(this.constants_,this.getInRowSpacing_(null,o[0]))),o.length){for(let n=0;ne.disposeInternal()),this.inputList.forEach(e=>e.dispose()),this.inputList.length=0,this.getConnections_(!0).forEach(e=>e.dispose()),this.disposed=!0}isDeadOrDying(){return this.disposing||this.disposed}initModel(){if(!this.initialized){for(const e of this.inputList)e.initModel();this.initialized=!0}}unplug(e){this.outputConnection&&this.unplugFromRow(e),this.previousConnection&&this.unplugFromStack(e)}unplugFromRow(e){let t=null,o;(o=this.outputConnection)!=null&&o.isConnected()&&(t=this.outputConnection.targetConnection,this.outputConnection.disconnect()),t&&e&&(e=this.getOnlyValueConnection())&&e.isConnected()&&!e.targetBlock().isShadow()&&(e=e.targetConnection,e==null||e.disconnect(),this.workspace.connectionChecker.canConnect(e,t,!1)?t.connect(e):e==null||e.onFailedConnect(t))}getOnlyValueConnection(){let e=null;for(let t=0;t(n=n+(o==="("||c===")"?"":" ")+c,o=c[c.length-1],n),""),t=t.trim()||"???",e&&t.length>e&&(t=t.substring(0,e-3)+"..."),t}toTokens(e="?"){const t=[];for(const n of this.inputList)if(n.name!=ur){for(const c of n.fieldRow)t.push(c.getText());if(n.connection){const c=n.connection.targetBlock();if(c){var o=n.connection;let h=o.getCheck();!h&&o.targetConnection&&(h=o.targetConnection.getCheck()),(o=!!h&&(h.includes("Boolean")||h.includes("Number")))&&t.push("("),t.push(...c.toTokens(e)),o&&t.push(")")}else t.push(e)}}return t}appendValueInput(e){return this.appendInput(new i.ValueInput$$module$build$src$core$inputs$value_input(e,this))}appendStatementInput(e){return this.statementInputCount++,this.appendInput(new is(e,this))}appendDummyInput(e=""){return this.appendInput(new Us(e,this))}appendEndRowInput(e=""){return this.appendInput(new fo(e,this))}appendInput(e){return this.inputList.push(e),e}appendInputFromRegistry(e,t){return(e=m(F.INPUT,e,!1))?this.appendInput(new e(t,this)):null}jsonInit(e){var t=e.type?'Block "'+e.type+'": ':"";if(e.output&&e.previousStatement)throw Error(t+"Must not have both an output and a previousStatement.");for(var o=0;e["args"+o];){if(e["message"+o]===void 0)throw Error(t+`args${o} must have a corresponding message (message${o}).`);o++}if(e.style&&e.style.hat&&(this.hat=e.style.hat,e.style=null),e.style&&e.colour)throw Error(t+"Must not have both a colour and a style.");for(e.style?this.jsonInitStyle(e,t):this.jsonInitColour(e,t),o=0;e["message"+o]!==void 0;)this.interpolate(e["message"+o],e["args"+o]||[],e["implicitAlign"+o]||e["lastDummyAlign"+o],t),o++;if(e.inputsInline!==void 0&&(i.disable$$module$build$src$core$events$utils(),this.setInputsInline(e.inputsInline),i.enable$$module$build$src$core$events$utils()),e.output!==void 0&&this.setOutput(!0,e.output),e.outputShape!==void 0&&this.setOutputShape(e.outputShape),e.previousStatement!==void 0&&this.setPreviousStatement(!0,e.previousStatement),e.nextStatement!==void 0&&this.setNextStatement(!0,e.nextStatement),e.tooltip!==void 0&&(o=pt(e.tooltip),this.setTooltip(o)),e.enableContextMenu!==void 0&&(this.contextMenu=!!e.enableContextMenu),e.suppressPrefixSuffix!==void 0&&(this.suppressPrefixSuffix=!!e.suppressPrefixSuffix),e.helpUrl!==void 0&&(o=pt(e.helpUrl),this.setHelpUrl(o)),typeof e.extensions=="string"&&(console.warn(t+"JSON attribute 'extensions' should be an array of strings. Found raw string in JSON for '"+e.type+"' block."),e.extensions=[e.extensions]),e.mutator!==void 0&&Ha(e.mutator,this,!0),e=e.extensions,Array.isArray(e))for(t=0;th||h>t)throw Error('Block "'+this.type+'": Message index %'+h+" out of range.");if(o[h])throw Error('Block "'+this.type+'": Message index %'+h+" duplicated.");o[h]=!0,n++}}if(n!==t)throw Error('Block "'+this.type+'": Message does not reference all '+t+" arg(s).")}interpolateArguments(e,t,o){const n=[];for(let h=0;h=this.inputList.length)throw RangeError("Input index "+e+" out of bounds.");if(t>this.inputList.length)throw RangeError("Reference input "+t+" out of bounds.");const o=this.inputList[e];this.inputList.splice(e,1),et.getWeight()-o.getWeight()),e}removeIcon(e){if(!this.hasIcon(e))return!1;let t;return(t=this.getIcon(e))==null||t.dispose(),this.icons=this.icons.filter(o=>!o.getType().equals(e)),!0}hasIcon(e){return this.icons.some(t=>t.getType().equals(e))}getIcon(e){return e instanceof yt?this.icons.find(t=>t.getType().equals(e)):this.icons.find(t=>t.getType().toString()===e)}getIcons(){return[...this.icons]}getRelativeToSurfaceXY(){return this.xy}moveBy(e,t,o){if(this.parentBlock_)throw Error("Block has parent");const n=new(V(O.BLOCK_MOVE))(this);o&&n.setReason(o),this.xy.translate(e,t),n.recordNew(),z(n)}makeConnection_(e){return new Be(this,e)}allInputsFilled(e){if(e===void 0&&(e=!0),!e&&this.isShadow())return!1;for(let o=0,n;n=this.inputList[o];o++)if(n.connection){var t=n.connection.targetBlock();if(!t||!t.allInputsFilled(e))return!1}return(t=this.getNextBlock())?t.allInputsFilled(e):!0}toDevString(){let e=this.type?'"'+this.type+'" block':"Block";return this.id&&(e+=' (id="'+this.id+'")'),e}};Oo.COLLAPSED_INPUT_NAME=ur,Oo.COLLAPSED_FIELD_NAME=dl;var hs=class{constructor(e,t,o,n){this.workspace=e,this.targetWorkspace=t,this.isFlyoutLabel=n,this.onMouseUpWrapper=null,this.height=this.width=0,this.cursorSvg=this.svgText=this.svgGroup=null,this.text=o.text,this.position=new G(0,0),this.callbackKey=o.callbackKey||o.callbackkey,this.cssClass=o["web-class"]||null,this.info=o}createDom(){var e=this.isFlyoutLabel?"blocklyFlyoutLabel":"blocklyFlyoutButton";this.cssClass&&(e+=" "+this.cssClass),this.svgGroup=N(x.G,{class:e},this.workspace.getCanvas());let t;this.isFlyoutLabel||(t=N(x.RECT,{class:"blocklyFlyoutButtonShadow",rx:hs.BORDER_RADIUS,ry:hs.BORDER_RADIUS,x:1,y:1},this.svgGroup)),e=N(x.RECT,{class:this.isFlyoutLabel?"blocklyFlyoutLabelBackground":"blocklyFlyoutButtonBackground",rx:hs.BORDER_RADIUS,ry:hs.BORDER_RADIUS},this.svgGroup);const o=N(x.TEXT,{class:this.isFlyoutLabel?"blocklyFlyoutLabelText":"blocklyText",x:0,y:0,"text-anchor":"middle"},this.svgGroup);var n=pt(this.text);this.workspace.RTL&&(n+="‏"),o.textContent=n,this.isFlyoutLabel&&(this.svgText=o,this.workspace.getThemeManager().subscribe(this.svgText,"flyoutForegroundColour","fill"));const c=Ms(o,"fontSize"),h=Ms(o,"fontWeight"),$=Ms(o,"fontFamily");if(this.width=ua(o,c,h,$),n=da(n,c,h,$),this.height=n.height,!this.isFlyoutLabel){this.width+=2*hs.TEXT_MARGIN_X,this.height+=2*hs.TEXT_MARGIN_Y;let T;(T=t)==null||T.setAttribute("width",String(this.width));let L;(L=t)==null||L.setAttribute("height",String(this.height))}return e.setAttribute("width",String(this.width)),e.setAttribute("height",String(this.height)),o.setAttribute("x",String(this.width/2)),o.setAttribute("y",String(this.height/2-n.height/2+n.baseline)),this.updateTransform(),this.onMouseUpWrapper=X(this.svgGroup,"pointerup",this,this.onMouseUp),this.svgGroup}show(){this.updateTransform(),this.svgGroup.setAttribute("display","block")}updateTransform(){this.svgGroup.setAttribute("transform","translate("+this.position.x+","+this.position.y+")")}moveTo(e,t){this.position.x=e,this.position.y=t,this.updateTransform()}isLabel(){return this.isFlyoutLabel}getPosition(){return this.position}getButtonText(){return this.text}getTargetWorkspace(){return this.targetWorkspace}getWorkspace(){return this.workspace}dispose(){this.onMouseUpWrapper&&ze(this.onMouseUpWrapper),this.svgGroup&&Ke(this.svgGroup),this.svgText&&this.workspace.getThemeManager().unsubscribe(this.svgText)}setCursorSvg(e){e?this.svgGroup&&(this.svgGroup.appendChild(e),this.cursorSvg=e):this.cursorSvg=null}setMarkerSvg(){throw Error("Attempted to set a marker on a button.")}onMouseUp(e){(e=this.targetWorkspace.getGesture(e))&&e.cancel(),this.isFlyoutLabel&&this.callbackKey?console.warn("Labels should not have callbacks. Label text: "+this.text):this.isFlyoutLabel||this.callbackKey&&this.targetWorkspace.getButtonCallback(this.callbackKey)?this.isFlyoutLabel||(e=this.targetWorkspace.getButtonCallback(this.callbackKey))&&e(this):console.warn("Buttons should have callbacks. Button text: "+this.text)}};hs.TEXT_MARGIN_X=5,hs.TEXT_MARGIN_Y=2,hs.BORDER_RADIUS=4,Et(` -.blocklyFlyoutButton { - fill: #888; - cursor: default; -} - -.blocklyFlyoutButtonShadow { - fill: #666; -} - -.blocklyFlyoutButton:hover { - fill: #aaa; -} - -.blocklyFlyoutLabel { - cursor: default; -} - -.blocklyFlyoutLabelBackground { - opacity: 0; -} -`);var P=class{constructor(e,t,o){if(this.wsCoordinate=null,!t)throw Error("Cannot create a node without a location.");this.type=e,this.isConnectionLocation=P.isConnectionType(e),this.location=t,this.processParams(o||null)}processParams(e){e&&e.wsCoordinate&&(this.wsCoordinate=e.wsCoordinate)}getLocation(){return this.location}getType(){return this.type}getWsCoordinate(){return this.wsCoordinate}isConnection(){return this.isConnectionLocation}findNextForInput(){var e=this.location.getParentInput();const t=e.getSourceBlock();for(e=t.inputList.indexOf(e),e+=1;et instanceof Oo&&c.block===t||t instanceof hs&&c.button===t);return 0>n?null:(o=o?n+1:n-1,o===-1||o===e.length?null:e[o])}findTopASTNodeForBlock(e){const t=Qn(e);return t?P.createConnectionNode(t):P.createBlockNode(e)}getOutAstNodeForBlock(e){if(!e)return null;e=e.getTopStackBlock();const t=Qn(e);return t&&t.targetConnection&&t.targetConnection.getParentInput()?P.createInputNode(t.targetConnection.getParentInput()):P.createStackNode(e)}findFirstFieldOrInput(e){e=e.inputList;for(let t=0;t{Ua(o.getSourceBlock()),setTimeout(()=>{n.bringToFront()},0)})}}update(e,t){const o=this.getCandidate(e);((this.wouldDeleteBlock=this.shouldDelete(!!o,t))||this.shouldUpdatePreviews(o,e))&&(i.disable$$module$build$src$core$events$utils(),this.maybeHidePreview(o),this.maybeShowPreview(o),i.enable$$module$build$src$core$events$utils())}createMarkerBlock(e){i.disable$$module$build$src$core$events$utils();let t;try{const o=Qt(e,{addCoordinates:!1,addInputBlocks:!1,addNextBlocks:!1,doFullSerialization:!1});if(!o)throw Error(`Failed to serialize source block. ${e.toDevString()}`);t=eo(o,this.workspace);for(const n of t.getDescendants(!1))n.setInsertionMarker(!0);t.initSvg(),t.getSvgRoot().setAttribute("visibility","hidden")}finally{i.enable$$module$build$src$core$events$utils()}return t}initAvailableConnections(){const e=this.topBlock.getConnections_(!1),t=this.topBlock.lastConnectionInStack(!0);return t&&t!==this.topBlock.nextConnection&&(e.push(t),this.lastOnStack=t),e}shouldUpdatePreviews(e,t){if(!e)return!!this.activeCandidate;if(!this.activeCandidate)return!0;const{local:o,closest:n}=this.activeCandidate;if(n===e.closest&&o===e.local)return!1;const c=o.x+t.x-n.x;return t=o.y+t.y-n.y,e.radius{let L;(L=n)==null||L.positionNearConnection(T,h,$);let te;(te=n)==null||te.getSvgRoot().setAttribute("visibility","visible")}),this.markerConnection=c}hideInsertionMarker(){if(this.markerConnection){var e=this.markerConnection,t=e.getSourceBlock(),o=t.outputConnection,n;if((n=t.previousConnection)!=null&&n.targetConnection||o!=null&&o.targetConnection)t.unplug(!0);else{let c;(c=e.targetBlock())==null||c.unplug(!1)}if(e.targetConnection)throw Error("markerConnection still connected at the end of disconnectInsertionMarker");this.markerConnection=null,(e=t.getSvgRoot())&&e.setAttribute("visibility","hidden")}}showInsertionInputOutline(e){e=e.closest,this.highlightedBlock=e.getSourceBlock(),this.highlightedBlock.highlightShapeForInput(e,!0)}hideInsertionInputOutline(){if(this.highlightedBlock){if(!this.activeCandidate)throw Error("Cannot hide the insertion marker outline because there is no active candidate");this.highlightedBlock.highlightShapeForInput(this.activeCandidate.closest,!1),this.highlightedBlock=null}}showReplacementFade(e){if(this.fadedBlock=e.closest.targetBlock(),!this.fadedBlock)throw Error("Cannot show the replacement fade because the closest connection does not have a target block");this.fadedBlock.fadeForReplacement(!0)}hideReplacementFade(){this.fadedBlock&&(this.fadedBlock.fadeForReplacement(!1),this.fadedBlock=null)}getInsertionMarkers(){const e=[];return this.firstMarker&&e.push(this.firstMarker),this.lastMarker&&e.push(this.lastMarker),e}disposeInsertionMarker(e){if(e){i.disable$$module$build$src$core$events$utils();try{e.dispose()}finally{i.enable$$module$build$src$core$events$utils()}}}};(function(e){e=e.PREVIEW_TYPE||(e.PREVIEW_TYPE={}),e[e.INSERTION_MARKER=0]="INSERTION_MARKER",e[e.INPUT_OUTLINE=1]="INPUT_OUTLINE",e[e.REPLACEMENT_FADE=2]="REPLACEMENT_FADE"})(ps||(ps={})),ps.PREVIEW_TYPE;var Pl=class{constructor(e){this.overrides=null,this.name=e}getClassName(){return this.name+"-renderer"}init(e,t){this.constants_=this.makeConstants_(),t&&(this.overrides=t,Object.assign(this.constants_,t)),this.constants_.setTheme(e),this.constants_.init()}createDom(e,t){this.constants_.createDom(e,this.name+"-"+t.name,"."+this.getClassName()+"."+t.getClassName())}refreshDom(e,t){const o=this.getConstants();o.dispose(),this.constants_=this.makeConstants_(),this.overrides&&Object.assign(this.constants_,this.overrides),this.constants_.randomIdentifier=o.randomIdentifier,this.constants_.setTheme(t),this.constants_.init(),this.createDom(e,t)}dispose(){this.constants_&&this.constants_.dispose()}makeConstants_(){return new Ml}makeRenderInfo_(e){return new kr(this,e)}makeDrawer_(e,t){return new Nl(e,t)}makeMarkerDrawer(e,t){return new hp(e,this.getConstants(),t)}makePathObject(e,t){return new Ll(e,t,this.constants_)}getConstants(){return this.constants_}shouldHighlightConnection(e){return!0}orphanCanConnectAtEnd(e,t,o){return!!Be.getConnectionForOrphanedConnection(e,o===oe.OUTPUT_VALUE?t.outputConnection:t.previousConnection)}getConnectionPreviewMethod(e,t,o){return y("getConnectionPreviewMethod","v10","v12","an IConnectionPreviewer, if it fulfills your use case."),t.type===oe.OUTPUT_VALUE||t.type===oe.PREVIOUS_STATEMENT?!e.isConnected()||this.orphanCanConnectAtEnd(o,e.targetBlock(),t.type)?ps.PREVIEW_TYPE.INSERTION_MARKER:ps.PREVIEW_TYPE.REPLACEMENT_FADE:ps.PREVIEW_TYPE.INSERTION_MARKER}render(e){const t=this.makeRenderInfo_(e);t.measure(),this.makeDrawer_(e,t).draw()}},We={};We.BottomRow=ip,We.Connection=mo,We.ConstantProvider=Ml,We.Drawer=Nl,We.ExternalValueInput=Ol,We.Field=on,We.Hat=np,We.Icon=Ev,We.InRowSpacer=os,We.InlineInput=rp,We.InputConnection=Ro,We.InputRow=ap,We.JaggedEdge=Iv,We.MarkerSvg=hp,We.Measurable=zs,We.NextConnection=xv,We.OutputConnection=Dv,We.PathObject=Ll,We.PreviousConnection=Av,We.RenderInfo=kr,We.Renderer=Pl,We.RoundCorner=Cr,We.Row=_r,We.SpacerRow=lp,We.SquareCorner=Tr,We.StatementInput=wr,We.TopRow=cp,We.Types=S,We.init=Ad,We.register=er,We.unregister=F$;var Ov=class{constructor(e,t){this.workspace=e,this.theme=t,this.subscribedWorkspaces=[],this.componentDB=new Map}getTheme(){return this.theme}setTheme(e){var t=this.theme;this.theme=e,(e=this.workspace.getInjectionDiv())&&(t&&(t=t.getClassName())&&ot(e,t),(t=this.theme.getClassName())&&ge(e,t));for(let o=0,n;n=this.subscribedWorkspaces[o];o++)n.refreshTheme();for(const[o,n]of this.componentDB)for(const c of n){e=c.element,t=c.propertyName;const h=this.theme&&this.theme.getComponentStyle(o);e.style.setProperty(t,h||"")}for(const o of this.subscribedWorkspaces)o.hideChaff()}subscribeWorkspace(e){this.subscribedWorkspaces.push(e)}unsubscribeWorkspace(e){if(!St(this.subscribedWorkspaces,e))throw Error("Cannot unsubscribe a workspace that hasn't been subscribed.")}subscribe(e,t,o){this.componentDB.has(t)||this.componentDB.set(t,[]),this.componentDB.get(t).push({element:e,propertyName:o}),t=this.theme&&this.theme.getComponentStyle(t),e.style.setProperty(o,t||"")}unsubscribe(e){if(e)for(const[t,o]of this.componentDB){for(let n=o.length-1;0<=n;n--)o[n].element===e&&o.splice(n,1);o.length||this.componentDB.delete(t)}}dispose(){this.subscribedWorkspaces.length=0,this.componentDB.clear()}},pp="VARIABLE_DYNAMIC",pi={CATEGORY_NAME:pp};pi.flyoutCategory=qa,pi.flyoutCategoryBlocks=Nd,pi.onCreateVariableButtonClick_Colour=Md,pi.onCreateVariableButtonClick_Number=Od,pi.onCreateVariableButtonClick_String=Rd;var Mv=30,gi=[];gi[oe.INPUT_VALUE]=oe.OUTPUT_VALUE,gi[oe.OUTPUT_VALUE]=oe.INPUT_VALUE,gi[oe.NEXT_STATEMENT]=oe.PREVIOUS_STATEMENT,gi[oe.PREVIOUS_STATEMENT]=oe.NEXT_STATEMENT;var gp="RENAME_VARIABLE_ID",mp="DELETE_VARIABLE_ID",Nv=class{canConnect(e,t,o,n){return this.canConnectWithReason(e,t,o,n)===Be.CAN_CONNECT}canConnectWithReason(e,t,o,n){const c=this.doSafetyChecks(e,t);return c!==Be.CAN_CONNECT?c:this.doTypeChecks(e,t)?o&&!this.doDragChecks(e,t,n||0)?Be.REASON_DRAG_CHECKS_FAILED:Be.CAN_CONNECT:Be.REASON_CHECKS_FAILED}getErrorMessage(e,t,o){switch(e){case Be.REASON_SELF_CONNECTION:return"Attempted to connect a block to itself.";case Be.REASON_DIFFERENT_WORKSPACES:return"Blocks not on same workspace.";case Be.REASON_WRONG_TYPE:return"Attempt to connect incompatible types.";case Be.REASON_TARGET_NULL:return"Target connection is null.";case Be.REASON_CHECKS_FAILED:return"Connection checks failed. "+(t+" expected "+t.getCheck()+", found "+o.getCheck());case Be.REASON_SHADOW_PARENT:return"Connecting non-shadow to shadow block.";case Be.REASON_DRAG_CHECKS_FAILED:return"Drag checks failed.";case Be.REASON_PREVIOUS_AND_OUTPUT:return"Block would have an output and a previous connection.";default:return"Unknown connection failure: this should never happen!"}}doSafetyChecks(e,t){if(!e||!t)return Be.REASON_TARGET_NULL;let o,n,c;return e.isSuperior()?(o=e.getSourceBlock(),n=t.getSourceBlock(),c=t):(n=e.getSourceBlock(),o=t.getSourceBlock(),c=e,e=t),o===n?Be.REASON_SELF_CONNECTION:c.type!==gi[e.type]?Be.REASON_WRONG_TYPE:o.workspace!==n.workspace?Be.REASON_DIFFERENT_WORKSPACES:o.isShadow()&&!n.isShadow()?Be.REASON_SHADOW_PARENT:c.type===oe.OUTPUT_VALUE&&n.previousConnection&&n.previousConnection.isConnected()||c.type===oe.PREVIOUS_STATEMENT&&n.outputConnection&&n.outputConnection.isConnected()?Be.REASON_PREVIOUS_AND_OUTPUT:Be.CAN_CONNECT}doTypeChecks(e,t){if(e=e.getCheck(),t=t.getCheck(),!e||!t)return!0;for(let o=0;oo||t.getSourceBlock().isInsertionMarker())return!1;switch(t.type){case oe.PREVIOUS_STATEMENT:return this.canConnectToPrevious_(e,t);case oe.OUTPUT_VALUE:if(t.isConnected()&&!t.targetBlock().isInsertionMarker()||e.isConnected())return!1;break;case oe.INPUT_VALUE:if(t.isConnected()&&!t.targetBlock().isMovable()&&!t.targetBlock().isShadow())return!1;break;case oe.NEXT_STATEMENT:if(t.isConnected()&&!e.getSourceBlock().nextConnection&&!t.targetBlock().isShadow()&&t.targetBlock().nextConnection||t.targetBlock()&&!t.targetBlock().isMovable()&&!t.targetBlock().isShadow())return!1;break;default:return!1}return!nr.includes(t)}canConnectToPrevious_(e,t){return e.targetConnection||nr.includes(t)?!1:t.targetConnection?(e=t.targetBlock(),e.isInsertionMarker()?!e.getPreviousBlock():!1):!0}};r(F.CONNECTION_CHECKER,js,Nv);var fp=class extends dr{constructor(e){super(e),this.type=O.VAR_DELETE,e&&(this.varType=e.type,this.varName=e.name)}toJson(){const e=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");return e.varType=this.varType,e.varName=this.varName,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new fp),t.varType=e.varType,t.varName=e.varName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");e?t.deleteVariableById(this.varId):t.createVariable(this.varName,this.varType,this.varId)}};r(F.EVENT,O.VAR_DELETE,fp);var $p=class extends dr{constructor(e,t){super(e),this.type=O.VAR_RENAME,e&&(this.oldName=e.name,this.newName=typeof t>"u"?"":t)}toJson(){const e=super.toJson();if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson");return e.oldName=this.oldName,e.newName=this.newName,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new $p),t.oldName=e.oldName,t.newName=e.newName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson");e?t.renameVariableById(this.varId,this.newName):t.renameVariableById(this.varId,this.oldName)}};r(F.EVENT,O.VAR_RENAME,$p);var bp=class{constructor(e){this.workspace=e,this.variableMap=new Map}clear(){for(const e of this.variableMap.values())for(;0{c&&t&&this.deleteVariableInternal(t,n)})):this.deleteVariableInternal(t,n)}else console.warn("Can't delete non-existent variable: "+e)}deleteVariableInternal(e,t){const o=i.getGroup$$module$build$src$core$events$utils();o||i.setGroup$$module$build$src$core$events$utils(!0);try{for(let n=0;ne.name)}getVariableUsesById(e){const t=[],o=this.workspace.getAllBlocks(!1);for(let n=0;n!o.isInsertionMarker())):[]}addTopComment(e){this.topComments.push(e),this.commentDB.has(e.id)&&console.warn('Overriding an existing comment on this workspace, with id "'+e.id+'"'),this.commentDB.set(e.id,e)}removeTopComment(e){if(!St(this.topComments,e))throw Error("Comment not present in workspace's list of top-most comments.");this.commentDB.delete(e.id)}getTopComments(e=!1){const t=[].concat(this.topComments);return e&&1!o.isInsertionMarker())}clear(){this.isClearing=!0;try{const e=i.getGroup$$module$build$src$core$events$utils();for(e||i.setGroup$$module$build$src$core$events$utils(!0);this.topBlocks.length;)this.topBlocks[0].dispose(!1);for(;this.topComments.length;)this.topComments[this.topComments.length-1].dispose();i.setGroup$$module$build$src$core$events$utils(e),this.variableMap.clear(),this.potentialVariableMap&&this.potentialVariableMap.clear()}finally{this.isClearing=!1}}renameVariableById(e,t){this.variableMap.renameVariableById(e,t)}createVariable(e,t,o){return this.variableMap.createVariable(e,t,o)}getVariableUsesById(e){return this.variableMap.getVariableUsesById(e)}deleteVariableById(e){this.variableMap.deleteVariableById(e)}getVariable(e,t){return this.variableMap.getVariable(e,t)}getVariableById(e){return this.variableMap.getVariableById(e)}getVariablesOfType(e){return this.variableMap.getVariablesOfType(e)}getVariableTypes(){return this.variableMap.getVariableTypes(this)}getAllVariables(){return this.variableMap.getAllVariables()}getAllVariableNames(){return this.variableMap.getAllVariableNames()}getWidth(){return 0}newBlock(e,t){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts")}newComment(e){throw Error("The implementation of newComment should be monkey-patched in by blockly.ts")}remainingCapacity(){return isNaN(this.options.maxBlocks)?1/0:this.options.maxBlocks-this.getAllBlocks(!1).length}remainingCapacityOfType(e){return this.options.maxInstances?(this.options.maxInstances[e]!==void 0?this.options.maxInstances[e]:1/0)-this.getBlocksByType(e,!1).length:1/0}isCapacityAvailable(e){if(!this.hasBlockLimits())return!0;let t=0;for(const o in e){if(e[o]>this.remainingCapacityOfType(o))return!1;t+=e[o]}return!(t>this.remainingCapacity())}hasBlockLimits(){return this.options.maxBlocks!==1/0||!!this.options.maxInstances}getUndoStack(){return this.undoStack_}getRedoStack(){return this.redoStack_}undo(e){var t=e?this.redoStack_:this.undoStack_,o=e?this.undoStack_:this.redoStack_;const n=t.pop();if(n){for(var c=[n];t.length&&n.group&&n.group===t[t.length-1].group;){const h=t.pop();h&&c.push(h)}for(t=0;tthis.MAX_UNDO&&0<=this.MAX_UNDO;)this.undoStack_.shift();for(let t=0;t!!t.getStyleName())),this.refreshToolboxSelection(),this.toolbox&&this.toolbox.refreshTheme(),this.isVisible()&&this.setVisible(!0);const e=new(V(O.THEME_CHANGE))(this.getTheme().name,this.id);z(e)}updateBlockStyles(e){for(let t=0,o;o=e[t];t++){const n=o.getStyleName();n&&o.setStyle(n)}}getInverseScreenCTM(){if(this.inverseScreenCTMDirty){const e=this.getParentSvg().getScreenCTM();e&&(this.inverseScreenCTM=e.inverse(),this.inverseScreenCTMDirty=!1)}return this.inverseScreenCTM}updateInverseScreenCTM(){this.inverseScreenCTMDirty=!0}isVisible(){return this.visible}getSvgXY(e){let t=0,o=0,n=1;(this.getCanvas().contains(e)||this.getBubbleCanvas().contains(e))&&(n=this.scale);do{const c=Pn(e);(e===this.getCanvas()||e===this.getBubbleCanvas())&&(n=1),t+=c.x*n,o+=c.y*n,e=e.parentNode}while(e&&e!==this.getParentSvg()&&e!==this.getInjectionDiv());return new G(t,o)}getCachedParentSvgSize(){const e=this.cachedParentSvgSize;return new Le(e.width,e.height)}getOriginOffsetInPixels(){return pa(this.getCanvas())}getInjectionDiv(){if(!this.injectionDiv){let e=this.svgGroup_;for(;e;){if((" "+(e.getAttribute("class")||"")+" ").includes(" injectionDiv ")){this.injectionDiv=e;break}e=e.parentNode}}return this.injectionDiv}getSvgGroup(){return this.svgGroup_}getBlockCanvas(){return this.getCanvas()}setResizeHandlerWrapper(e){this.resizeHandlerWrapper=e}createDom(e,t){return this.injectionDiv||(this.injectionDiv=t??null),this.svgGroup_=N(x.G,{class:"blocklyWorkspace"}),e&&(this.svgBackground_=N(x.RECT,{height:"100%",width:"100%",class:e},this.svgGroup_),e==="blocklyMainBackground"&&this.grid?this.svgBackground_.style.fill="url(#"+this.grid.getPatternId()+")":this.themeManager_.subscribe(this.svgBackground_,"workspaceBackgroundColour","fill")),this.layerManager=new KT(this),this.svgBlockCanvas_=this.layerManager.getBlockLayer(),this.svgBubbleCanvas_=this.layerManager.getBubbleLayer(),this.isFlyout||(X(this.svgGroup_,"pointerdown",this,this.onMouseDown,!1),this.dummyWheelListener=()=>{},document.body.addEventListener("wheel",this.dummyWheelListener),X(this.svgGroup_,"wheel",this,this.onMouseWheel)),this.options.hasCategories&&(this.toolbox=new(_(F.TOOLBOX,this.options,!0))(this)),this.grid&&this.grid.update(this.scale),this.recordDragTargets(),(e=_(F.CURSOR,this.options))&&this.markerManager.setCursor(new e),this.renderer.createDom(this.svgGroup_,this.getTheme()),this.svgGroup_}dispose(){if(this.rendered=!1,this.currentGesture_&&this.currentGesture_.cancel(),this.svgGroup_&&Ke(this.svgGroup_),this.toolbox&&(this.toolbox.dispose(),this.toolbox=null),this.flyout&&(this.flyout.dispose(),this.flyout=null),this.trashcan&&(this.trashcan.dispose(),this.trashcan=null),this.scrollbar&&(this.scrollbar.dispose(),this.scrollbar=null),this.zoomControls_&&this.zoomControls_.dispose(),this.audioManager&&this.audioManager.dispose(),this.grid&&(this.grid=null),this.renderer.dispose(),this.markerManager&&this.markerManager.dispose(),super.dispose(),this.themeManager_&&(this.themeManager_.unsubscribeWorkspace(this),this.themeManager_.unsubscribe(this.svgBackground_),this.options.parentWorkspace||this.themeManager_.dispose()),this.connectionDBList.length=0,this.toolboxCategoryCallbacks.clear(),this.flyoutButtonCallbacks.clear(),!this.options.parentWorkspace){const e=this.getParentSvg();e&&e.parentNode&&Ke(e.parentNode)}this.resizeHandlerWrapper&&(ze(this.resizeHandlerWrapper),this.resizeHandlerWrapper=null),this.dummyWheelListener&&(document.body.removeEventListener("wheel",this.dummyWheelListener),this.dummyWheelListener=null)}addTrashcan(){this.trashcan=ns.newTrashcan(this);const e=this.trashcan.createDom();this.svgGroup_.insertBefore(e,this.getCanvas())}static newTrashcan(e){throw Error("The implementation of newTrashcan should be monkey-patched in by blockly.ts")}addZoomControls(){this.zoomControls_=new Fb(this);const e=this.zoomControls_.createDom();this.svgGroup_.appendChild(e)}addFlyout(e){const t=new ds({parentWorkspace:this,rtl:this.RTL,oneBasedIndex:this.options.oneBasedIndex,horizontalLayout:this.horizontalLayout,renderer:this.options.renderer,rendererOverrides:this.options.rendererOverrides,move:{scrollbars:!0}});return t.toolboxPosition=this.options.toolboxPosition,this.flyout=this.horizontalLayout?new(_(F.FLYOUTS_HORIZONTAL_TOOLBOX,this.options,!0))(t):new(_(F.FLYOUTS_VERTICAL_TOOLBOX,this.options,!0))(t),this.flyout.autoClose=!1,this.flyout.getWorkspace().setVisible(!0),this.flyout.createDom(e)}getFlyout(e){return this.flyout||e?this.flyout:this.toolbox?this.toolbox.getFlyout():null}getToolbox(){return this.toolbox}updateScreenCalculations(){this.updateInverseScreenCTM(),this.recordDragTargets()}resizeContents(){this.resizesEnabled&&this.rendered&&(this.scrollbar&&this.scrollbar.resize(),this.updateInverseScreenCTM())}resize(){this.toolbox&&this.toolbox.position(),this.flyout&&this.flyout.position();const e=this.componentManager.getComponents(lt.Capability.POSITIONABLE,!0),t=this.getMetricsManager().getUiMetrics(),o=[];for(let n=0,c;c=e[n];n++){c.position(t,o);const h=c.getBoundingRectangle();h&&o.push(h)}this.scrollbar&&this.scrollbar.resize(),this.updateScreenCalculations()}updateScreenCalculationsIfScrolled(){const e=fu();G.equals(this.lastRecordedPageScroll,e)||(this.lastRecordedPageScroll=e,this.updateScreenCalculations())}getLayerManager(){return this.layerManager}getCanvas(){return this.layerManager.getBlockLayer()}setCachedParentSvgSize(e,t){const o=this.getParentSvg();e!=null&&(this.cachedParentSvgSize.width=e,o.setAttribute("data-cached-width",`${e}`)),t!=null&&(this.cachedParentSvgSize.height=t,o.setAttribute("data-cached-height",`${t}`))}getBubbleCanvas(){return this.layerManager.getBubbleLayer()}getParentSvg(){if(!this.cachedParentSvg){let e=this.svgGroup_;for(;e;){if(e.tagName==="svg"){this.cachedParentSvg=e;break}e=e.parentNode}}return this.cachedParentSvg}maybeFireViewportChangeEvent(){if(K()){var e=this.scale,t=-this.scrollY,o=-this.scrollX;if(!(e===this.oldScale&&1>Math.abs(t-this.oldTop)&&1>Math.abs(o-this.oldLeft))){var n=new(V(O.VIEWPORT_CHANGE))(t,o,e,this.id,this.oldScale);this.oldScale=e,this.oldTop=t,this.oldLeft=o,z(n)}}}translate(e,t){let o;(o=this.layerManager)==null||o.translateLayers(new G(e,t),this.scale);let n;(n=this.grid)==null||n.moveTo(e,t),this.maybeFireViewportChangeEvent()}getWidth(){const e=this.getMetrics();return e?e.viewWidth/this.scale:0}setVisible(e){this.visible=e,this.svgGroup_&&(this.scrollbar&&this.scrollbar.setContainerVisible(e),this.getFlyout()&&this.getFlyout().setContainerVisible(e),this.getParentSvg().style.display=e?"block":"none",this.toolbox&&this.toolbox.setVisible(e),e||this.hideChaff(!0))}render(){const e=this.getAllBlocks(!1);for(let t=e.length-1;0<=t;t--)e[t].queueRender();this.getTopBlocks().flatMap(t=>t.getDescendants(!1)).filter(t=>t.isInsertionMarker()).forEach(t=>t.queueRender()),ws().then(()=>{this.markerManager.updateMarkers()})}highlightBlock(e,t){if(t===void 0){for(let o=0,n;n=this.highlightedBlocks[o];o++)n.setHighlighted(!1);this.highlightedBlocks.length=0}(e=e?this.getBlockById(e):null)&&((t=t===void 0||t)?this.highlightedBlocks.includes(e)||this.highlightedBlocks.push(e):St(this.highlightedBlocks,e),e.setHighlighted(t))}refreshToolboxSelection(){const e=this.isFlyout?this.targetWorkspace:this;e&&!e.currentGesture_&&e.toolbox&&e.toolbox.getFlyout()&&e.toolbox.refreshSelection()}renameVariableById(e,t){super.renameVariableById(e,t),this.refreshToolboxSelection()}deleteVariableById(e){super.deleteVariableById(e),this.refreshToolboxSelection()}createVariable(e,t,o){return e=super.createVariable(e,t,o),this.refreshToolboxSelection(),e}recordDragTargets(){const e=this.componentManager.getComponents(lt.Capability.DRAG_TARGET,!0);this.dragTargetAreas=[];for(let t=0,o;o=e[t];t++){const n=o.getClientRect();n&&this.dragTargetAreas.push({component:o,clientRect:n})}}newBlock(e,t){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts")}newComment(e){throw Error("The implementation of newComment should be monkey-patched in by blockly.ts")}getDragTarget(e){for(let t=0,o;o=this.dragTargetAreas[t];t++)if(o.clientRect.contains(e.clientX,e.clientY))return o.component;return null}onMouseDown(e){const t=this.getGesture(e);t&&t.handleWsStart(e,this)}startDrag(e,t){Ba(this,e,t)}moveDrag(e){return ja(this,e)}isDragging(){return this.currentGesture_!==null&&this.currentGesture_.isDragging()}isDraggable(){return this.options.moveOptions&&this.options.moveOptions.drag}isMovable(){return this.options.moveOptions&&!!this.options.moveOptions.scrollbars||this.options.moveOptions&&this.options.moveOptions.wheel||this.options.moveOptions&&this.options.moveOptions.drag||this.options.zoomOptions&&this.options.zoomOptions.wheel||this.options.zoomOptions&&this.options.zoomOptions.pinch}isMovableHorizontally(){const e=!!this.scrollbar;return this.isMovable()&&(!e||e&&this.scrollbar.canScrollHorizontally())}isMovableVertically(){const e=!!this.scrollbar;return this.isMovable()&&(!e||e&&this.scrollbar.canScrollVertically())}onMouseWheel(e){if(co.inProgress())e.preventDefault(),e.stopPropagation();else{var t=this.options.zoomOptions&&this.options.zoomOptions.wheel,o=this.options.moveOptions&&this.options.moveOptions.wheel;if(t||o){var n=Zs(e);if(_h)var c=e.metaKey;t&&(e.ctrlKey||c||!o)?(n=-n.y/50,t=st(e,this.getParentSvg(),this.getInverseScreenCTM()),this.zoom(t.x,t.y,n)):(t=this.scrollX-n.x,o=this.scrollY-n.y,e.shiftKey&&!n.x&&(t=this.scrollX-n.y,o=this.scrollY),this.scroll(t,o)),e.preventDefault()}}}getBlocksBoundingBox(){const e=this.getTopBoundedElements();if(!e.length)return new qe(0,0,0,0);const t=e[0].getBoundingRectangle();for(let n=1;nt.bottom&&(t.bottom=o.bottom),o.leftt.right&&(t.right=o.right))}return t}cleanUp(){this.setResizesEnabled(!1),i.setGroup$$module$build$src$core$events$utils(!0);var e=this.getTopBlocks(!0),t=e.filter(h=>h.isMovable());const o=e.filter(h=>!h.isMovable()).map(h=>h.getBoundingRectangle());e=function(h){for(const $ of o)if(h.intersects($))return $;return null};var n=0;const c=this.renderer.getConstants().MIN_BLOCK_HEIGHT;for(const h of t){for(t=h.getBoundingRectangle(),h.moveBy(-t.left,n-t.top,["cleanup"]),h.snapToGrid(),t=h.getBoundingRectangle(),n=e(t);n!=null;)n=n.top+n.getHeight()+c,h.moveBy(0,n-t.top,["cleanup"]),h.snapToGrid(),t=h.getBoundingRectangle(),n=e(t);n=h.getRelativeToSurfaceXY().y+h.getHeightWidth().height+c}i.setGroup$$module$build$src$core$events$utils(!1),this.setResizesEnabled(!0)}showContextMenu(e){if(!this.options.readOnly&&!this.isFlyout){var t=xe.registry.getContextMenuOptions(xe.ScopeType.WORKSPACE,{workspace:this});this.configureContextMenu&&this.configureContextMenu(t,e),Jn(e,t,this.RTL,this)}}updateToolbox(e){if(e=ga(e)){if(!this.options.languageTree)throw Error("Existing toolbox is null. Can't create new toolbox.");if(ma(e)){if(!this.toolbox)throw Error("Existing toolbox has no categories. Can't change mode.");this.options.languageTree=e,this.toolbox.render(e)}else{if(!this.flyout)throw Error("Existing toolbox has categories. Can't change mode.");this.options.languageTree=e,this.flyout.show(e)}}else if(this.options.languageTree)throw Error("Can't nullify an existing toolbox.")}markFocused(){this.options.parentWorkspace?this.options.parentWorkspace.markFocused():(re(this),this.getParentSvg().focus({preventScroll:!0}))}zoom(e,t,o){o=Math.pow(this.options.zoomOptions.scaleSpeed,o);const n=this.scale*o;if(this.scale!==n){n>this.options.zoomOptions.maxScale?o=this.options.zoomOptions.maxScale/this.scale:nthis.options.zoomOptions.maxScale?e=this.options.zoomOptions.maxScale:this.options.zoomOptions.minScale&&et.autoHide(e))}static setTopLevelWorkspaceMetrics(e){const t=this.getMetrics();typeof e.x=="number"&&(this.scrollX=-(t.scrollLeft+(t.scrollWidth-t.viewWidth)*e.x)),typeof e.y=="number"&&(this.scrollY=-(t.scrollTop+(t.scrollHeight-t.viewHeight)*e.y)),this.translate(this.scrollX+t.absoluteLeft,this.scrollY+t.absoluteTop)}},vp=class extends Cs{constructor(e,t,o){super(o),this.type=O.SELECTED,this.oldElementId=e??void 0,this.newElementId=t??void 0}toJson(){const e=super.toJson();return e.oldElementId=this.oldElementId,e.newElementId=this.newElementId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new vp),t.oldElementId=e.oldElementId,t.newElementId=e.newElementId,t}};r(F.EVENT,O.SELECTED,vp);var Sr=class{paste(e,t,o){if(!t.isCapacityAvailable(e.typeCounts))return null;o&&(e.blockState.x=o.x,e.blockState.y=o.y),o=o||new G(e.blockState.x||0,e.blockState.y||0),i.disable$$module$build$src$core$events$utils();let n;try{n=eo(e.blockState,t),z$(n,o)}finally{i.enable$$module$build$src$core$events$utils()}return n&&(K()&&!n.isShadow()&&z(new(V(O.BLOCK_CREATE))(n)),i.setSelected$$module$build$src$core$common(n),n)}};Sr.TYPE="block",_a(Sr.TYPE,new Sr);var Bl={};Bl.bumpIntoBounds=zi,Bl.bumpIntoBoundsHandler=Ld,Bl.bumpTopObjectsIntoBounds=Xa;var Pv=class{constructor(e){this.block=e,this.connectionPreviewer=this.connectionCandidate=this.startLoc=this.startChildConn=this.startParentConn=null,this.dragging=!1,this.dragOffset=new G(0,0),this.inGroup=!1,this.workspace=e.workspace}isMovable(){if(this.block.isShadow()){let e,t;return(t=(e=this.block.getParent())==null?void 0:e.isMovable())!=null?t:!1}return this.block.isOwnMovable()&&!this.block.isDeadOrDying()&&!this.workspace.options.readOnly&&!this.block.isInFlyout}startDrag(e){if(this.block.isShadow())this.startDraggingShadow(e);else{this.dragging=!0,(this.inGroup=!!i.getGroup$$module$build$src$core$events$utils())||i.setGroup$$module$build$src$core$events$utils(!0),this.fireDragStartEvent(),this.startLoc=this.block.getRelativeToSurfaceXY(),this.connectionCandidate=null,this.connectionPreviewer=new(_(F.CONNECTION_PREVIEWER,this.workspace.options))(this.block),Ho(),this.workspace.setResizesEnabled(!1),ji(),e=!!e&&(e.altKey||e.ctrlKey||e.metaKey),this.shouldDisconnect(e)&&this.disconnectBlock(e),this.block.setDragging(!0);var t;(t=this.workspace.getLayerManager())==null||t.moveToDragLayer(this.block)}}startDraggingShadow(e){const t=this.block.getParent();if(!t)throw Error("Tried to drag a shadow block with no parent. Shadow blocks should always have parents.");this.dragOffset=G.difference(t.getRelativeToSurfaceXY(),this.block.getRelativeToSurfaceXY()),t.startDrag(e)}shouldDisconnect(e){return!!(this.block.getParent()||e&&this.block.nextConnection&&this.block.nextConnection.targetBlock())}disconnectBlock(e){let t,o,n;if(this.startParentConn=(n=(t=this.block.outputConnection)==null?void 0:t.targetConnection)!=null?n:(o=this.block.previousConnection)==null?void 0:o.targetConnection,e){let c;this.startChildConn=(c=this.block.nextConnection)==null?void 0:c.targetConnection}this.block.unplug(e),vd(this.block)}fireDragStartEvent(){const e=new(V(O.BLOCK_DRAG))(this.block,!0,this.block.getDescendants(!1));z(e)}fireDragEndEvent(){const e=new(V(O.BLOCK_DRAG))(this.block,!1,this.block.getDescendants(!1));z(e)}fireMoveEvent(){if(!this.block.isDeadOrDying()){var e=new(V(O.BLOCK_MOVE))(this.block);e.setReason(["drag"]),e.oldCoordinate=this.startLoc,e.recordNew(),z(e)}}drag(e){if(this.block.isShadow()){let t;(t=this.block.getParent())==null||t.drag(G.sum(e,this.dragOffset))}else this.block.moveDuringDrag(e),this.updateConnectionPreview(this.block,G.difference(e,this.startLoc))}updateConnectionPreview(e,t){var o=this.connectionCandidate;const n=this.getConnectionCandidate(e,t);if(n){this.connectionCandidate=t=o&&this.currCandidateIsBetter(o,t,n)?o:n;var{local:c,neighbour:h}=t;t=c.type===oe.OUTPUT_VALUE||c.type===oe.PREVIOUS_STATEMENT,o=h.isConnected()&&!h.targetBlock().isInsertionMarker(),t&&o&&!this.orphanCanConnectAtEnd(e,h.targetBlock(),c.type)?this.connectionPreviewer.previewReplacement(c,h,h.targetBlock()):this.connectionPreviewer.previewConnection(c,h)}else this.connectionPreviewer.hidePreview(),this.connectionCandidate=null}orphanCanConnectAtEnd(e,t,o){return!!Be.getConnectionForOrphanedConnection(e,o===oe.OUTPUT_VALUE?t.outputConnection:t.previousConnection)}currCandidateIsBetter(e,t,o){const{local:n,neighbour:c}=e;e=new G(n.x,n.y);const h=new G(c.x,c.y);return t=G.distance(G.sum(e,t),h),o.distance>t-i.config$$module$build$src$core$config.currentConnectionPreference}getConnectionCandidate(e,t){e=this.getLocalConnections(e);let o=this.connectionCandidate?i.config$$module$build$src$core$config.connectingSnapRadius:i.config$$module$build$src$core$config.snapRadius,n=null;for(const c of e){const{connection:h,radius:$}=c.closest(o,t);h&&(n={local:c,neighbour:h,distance:$},o=$)}return n}getLocalConnections(e){const t=e.getConnections_(!1),o=e.lastConnectionInStack(!0);return o&&o!==e.nextConnection&&t.push(o),t}endDrag(e){if(this.block.isShadow()){let t;(t=this.block.getParent())==null||t.endDrag(e)}else{if(this.fireDragEndEvent(),this.fireMoveEvent(),Wo(),ji(),this.connectionPreviewer.hidePreview(),!this.block.isDeadOrDying()&&this.dragging){let t;(t=this.workspace.getLayerManager())==null||t.moveOffDragLayer(this.block,Do),this.block.setDragging(!1)}this.connectionCandidate?(this.applyConnections(this.connectionCandidate),this.disposeStep()):this.block.queueRender().then(()=>this.disposeStep()),this.inGroup||i.setGroup$$module$build$src$core$events$utils(!1)}}disposeStep(){this.block.snapToGrid(),this.connectionPreviewer.dispose(),this.workspace.setResizesEnabled(!0)}applyConnections(e){const{local:t,neighbour:o}=e;t.connect(o);const n=t.isSuperior()?o:t,c=this.block.getRootBlock();ws().then(()=>{Ua(n.getSourceBlock()),setTimeout(()=>{c.bringToFront()},0)})}revertDrag(){if(this.block.isShadow()){let t;(t=this.block.getParent())==null||t.revertDrag()}else{var e;if((e=this.startChildConn)==null||e.connect(this.block.nextConnection),this.startParentConn)switch(this.startParentConn.type){case oe.INPUT_VALUE:this.startParentConn.connect(this.block.outputConnection);break;case oe.NEXT_STATEMENT:this.startParentConn.connect(this.block.previousConnection)}else{this.block.moveTo(this.startLoc,["drag"]);let t;(t=this.workspace.getLayerManager())==null||t.moveOffDragLayer(this.block,Do),zi(this.workspace,this.workspace.getMetricsManager().getScrollMetrics(!0),this.block)}this.startParentConn=this.startChildConn=null,this.connectionPreviewer.hidePreview(),this.connectionCandidate=null,this.block.setDragging(!1),this.dragging=!1}}},Bv=class{constructor(){this.drawer=this.curNode=this.colour=null,this.type="marker"}setDrawer(e){this.drawer=e}getDrawer(){return this.drawer}getCurNode(){return this.curNode}setCurNode(e){const t=this.curNode;this.curNode=e,this.drawer&&this.drawer.draw(t,this.curNode)}draw(){this.drawer&&this.drawer.draw(this.curNode,this.curNode)}hide(){this.drawer&&this.drawer.hide()}dispose(){this.getDrawer()&&this.getDrawer().dispose()}},yp=class extends Bv{constructor(){super(),this.type="cursor"}next(){var e=this.getCurNode();if(!e)return null;for(e=e.next();e&&e.next()&&(e.getType()===P.types.NEXT||e.getType()===P.types.BLOCK);)e=e.next();return e&&this.setCurNode(e),e}in(){var e=this.getCurNode();if(!e)return null;(e.getType()===P.types.PREVIOUS||e.getType()===P.types.OUTPUT)&&(e=e.next());let t,o;return(e=(o=(t=e)==null?void 0:t.in())!=null?o:null)&&this.setCurNode(e),e}prev(){var e=this.getCurNode();if(!e)return null;for(e=e.prev();e&&e.prev()&&(e.getType()===P.types.NEXT||e.getType()===P.types.BLOCK);)e=e.prev();return e&&this.setCurNode(e),e}out(){var e=this.getCurNode();return e?((e=e.out())&&e.getType()===P.types.BLOCK&&(e=e.prev()||e),e&&this.setCurNode(e),e):null}};r(F.CURSOR,js,yp);var Er=class extends yp{constructor(){super()}next(){var e=this.getCurNode();return e?((e=this.getNextNode_(e,this.validNode_))&&this.setCurNode(e),e):null}in(){return this.next()}prev(){var e=this.getCurNode();return e?((e=this.getPreviousNode_(e,this.validNode_))&&this.setCurNode(e),e):null}out(){return this.prev()}getNextNode_(e,t){if(!e)return null;const o=e.in()||e.next();return t(o)?o:o?this.getNextNode_(o,t):(e=this.findSiblingOrParent(e.out()),t(e)?e:e?this.getNextNode_(e,t):null)}getPreviousNode_(e,t){if(!e)return null;let o=e.prev();return o=o?this.getRightMostChild(o):e.out(),t(o)?o:o?this.getPreviousNode_(o,t):null}validNode_(e){let t=!1;return e=e&&e.getType(),(e===P.types.OUTPUT||e===P.types.INPUT||e===P.types.FIELD||e===P.types.NEXT||e===P.types.PREVIOUS||e===P.types.WORKSPACE)&&(t=!0),t}findSiblingOrParent(e){if(!e)return null;const t=e.next();return t||this.findSiblingOrParent(e.out())}getRightMostChild(e){if(!e.in())return e;for(e=e.in();e&&e.next();)e=e.next();return this.getRightMostChild(e)}};Er.registrationName="basicCursor",r(F.CURSOR,Er.registrationName,Er);var jv=class extends Er{validNode_(e){let t=!1;const o=e&&e.getType();return e&&(e=e.getLocation(),o===P.types.FIELD&&e&&e.isTabNavigable()&&e.isClickable()&&(t=!0)),t}},Fv=10,Ut=class extends Be{constructor(e,t){super(e,t),this.highlighted=!1,this.targetConnection=null,this.db=e.workspace.connectionDBList[t],this.dbOpposite=e.workspace.connectionDBList[gi[t]],this.offsetInBlock=new G(0,0),this.trackedState=Ut.TrackedState.WILL_TRACK}dispose(){super.dispose(),this.trackedState===Ut.TrackedState.TRACKED&&this.db.removeConnection(this,this.y);let e,t;(t=(e=this.sourceBlock_.pathObject).removeConnectionHighlight)==null||t.call(e,this)}getSourceBlock(){return super.getSourceBlock()}targetBlock(){return super.targetBlock()}distanceFrom(e){const t=this.x-e.x;return e=this.y-e.y,Math.sqrt(t*t+e*e)}bumpAwayFrom(e,t=!1){if(!this.sourceBlock_.workspace.isDragging()){var o=i.config$$module$build$src$core$config.snapRadius+Math.floor(Math.random()*Fv),n=i.config$$module$build$src$core$config.snapRadius+Math.floor(Math.random()*Fv),c=e.sourceBlock_.getRootBlock(),h=this.sourceBlock_.getRootBlock();if(!c.isInFlyout&&!h.isInFlyout){var $=!0;if(h.isMovable())c.isMovable()&&t&&(n=-n);else if(c.isMovable())$=!1,o=-o,n=-n;else return;t=$?e:this,e=$?this:e,c=$?h:c,(h=I()===c)||c.addSelect(),c.RTL&&(o=-o),c.moveBy(t.x+o-e.x,t.y+n-e.y,["bump"]),h||c.removeSelect()}}}moveTo(e,t){let o=!1;return this.trackedState===Ut.TrackedState.WILL_TRACK?(this.db.addConnection(this,t),this.trackedState=Ut.TrackedState.TRACKED,o=!0):this.trackedState===Ut.TrackedState.TRACKED&&(this.db.removeConnection(this,this.y),this.db.addConnection(this,t),o=!0),this.x=e,this.y=t,o}moveBy(e,t){return this.moveTo(this.x+e,this.y+t)}moveToOffset(e){return this.moveTo(e.x+this.offsetInBlock.x,e.y+this.offsetInBlock.y)}setOffsetInBlock(e,t){this.offsetInBlock.x=e,this.offsetInBlock.y=t}getOffsetInBlock(){return this.offsetInBlock}tightenEfficiently(){var e=this.targetConnection;const t=this.targetBlock();e&&t&&(e=G.difference(this.offsetInBlock,e.offsetInBlock),t.translate(e.x,e.y))}closest(e,t){return this.dbOpposite.searchForClosest(this,e,t)}highlight(){this.highlighted=!0,this.getSourceBlock().queueRender()}unhighlight(){this.highlighted=!1,this.getSourceBlock().queueRender()}isHighlighted(){return this.highlighted}setTracking(e){e&&this.trackedState===Ut.TrackedState.TRACKED||!e&&this.trackedState===Ut.TrackedState.UNTRACKED||this.sourceBlock_.isInFlyout||(e?(this.db.addConnection(this,this.y),this.trackedState=Ut.TrackedState.TRACKED):(this.trackedState===Ut.TrackedState.TRACKED&&this.db.removeConnection(this,this.y),this.trackedState=Ut.TrackedState.UNTRACKED))}stopTrackingAll(){if(this.setTracking(!1),this.targetConnection){const e=this.targetBlock().getDescendants(!1);for(let t=0;tclearTimeout(e)),this.warningTextDb.clear(),this.getIcons().forEach(e=>e.dispose())}checkAndDelete(){this.workspace.isFlyout||(i.setGroup$$module$build$src$core$events$utils(!0),this.workspace.hideChaff(),this.outputConnection?this.dispose(!1,!0):this.dispose(!0,!0),i.setGroup$$module$build$src$core$events$utils(!1))}toCopyData(){return this.isInsertionMarker_?null:{paster:Sr.TYPE,blockState:Qt(this,{addCoordinates:!0,addNextBlocks:!1}),typeCounts:be(this,!0)}}applyColour(){this.pathObject.applyColour(this);const e=this.getIcons();for(let t=0;t{this.isDeadOrDying()||(this.warningTextDb.delete(t),this.setWarningText(e,t))},100));else if(this.isInFlyout&&(e=null),o=this.getIcon(go.TYPE),e){let n=this.getSurroundParent(),c=null;for(;n;)n.isCollapsed()&&(c=n),n=n.getSurroundParent();c&&c.setWarningText(i.Msg$$module$build$src$core$msg.COLLAPSED_WARNINGS_WARNING,gs.COLLAPSED_WARNING_ID),o?o.addMessage(e,t):this.addIcon(new go(this).addMessage(e,t))}else o&&(t?(o.addMessage("",t),o.getText()||this.removeIcon(go.TYPE)):this.removeIcon(go.TYPE))}setMutator(e){this.removeIcon(i.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE),e&&this.addIcon(e)}addIcon(e){return super.addIcon(e),e instanceof i.MutatorIcon$$module$build$src$core$icons$mutator_icon&&(this.mutator=e),e.initView(this.createIconPointerDownListener(e)),e.applyColour(),e.updateEditable(),this.queueRender(),e}createIconPointerDownListener(e){return t=>{this.isDeadOrDying()||(t=this.workspace.getGesture(t))&&t.setStartIcon(e)}}removeIcon(e){const t=super.removeIcon(e);return e.equals(i.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE)&&(this.mutator=null),this.queueRender(),t}setEnabled(e){y("setEnabled","v11","v12","the setDisabledReason method of BlockSvg");const t=this.isEnabled();super.setEnabled(e),this.isEnabled()===t||this.getInheritedDisabled()||this.updateDisabled()}setDisabledReason(e,t){const o=this.isEnabled();super.setDisabledReason(e,t),this.isEnabled()===o||this.getInheritedDisabled()||this.updateDisabled()}setHighlighted(e){this.pathObject.updateHighlighted(e)}addSelect(){this.pathObject.updateSelected(!0)}removeSelect(){this.pathObject.updateSelected(!1)}setDeleteStyle(e){this.pathObject.updateDraggingDelete(e)}getColour(){return this.style.colourPrimary}setColour(e){super.setColour(e),e=this.workspace.getRenderer().getConstants().getBlockStyleForColour(this.colour_),this.pathObject.setStyle(e.style),this.style=e.style,this.styleName_=e.name,this.applyColour()}setStyle(e){const t=this.workspace.getRenderer().getConstants().getBlockStyle(e);if(this.styleName_=e,t)this.hat=t.hat,this.pathObject.setStyle(t),this.colour_=t.colourPrimary,this.style=t,this.applyColour();else throw Error("Invalid style name: "+e)}getStyle(){return this.style}bringToFront(e=!1){let t=this;if(!t.isDeadOrDying())do{const o=t.getSvgRoot(),n=o.parentNode,c=n.childNodes;if(c[c.length-1]!==o&&n.appendChild(o),e)break;t=t.getParent()}while(t)}setPreviousStatement(e,t){super.setPreviousStatement(e,t),this.queueRender()}setNextStatement(e,t){super.setNextStatement(e,t),this.queueRender()}setOutput(e,t){super.setOutput(e,t),this.queueRender()}setInputsInline(e){super.setInputsInline(e),this.queueRender()}removeInput(e,t){return e=super.removeInput(e,t),this.queueRender(),e}moveNumberedInputBefore(e,t){super.moveNumberedInputBefore(e,t),this.queueRender()}appendInput(e){return super.appendInput(e),this.queueRender(),e}setConnectionTracking(e){if(this.previousConnection&&this.previousConnection.setTracking(e),this.outputConnection&&this.outputConnection.setTracking(e),this.nextConnection){this.nextConnection.setTracking(e);var t=this.nextConnection.targetBlock();t&&t.setConnectionTracking(e)}if(!this.collapsed_)for(t=0;t=this.workspace.options.maxTrashcanContents||(e=new ds({scrollbars:!0,parentWorkspace:this.workspace,rtl:this.workspace.RTL,oneBasedIndex:this.workspace.options.oneBasedIndex,renderer:this.workspace.options.renderer,rendererOverrides:this.workspace.options.rendererOverrides,move:{scrollbars:!0}}),this.workspace.horizontalLayout?(e.toolboxPosition=this.workspace.toolboxPosition===Ee.TOP?Ee.BOTTOM:Ee.TOP,this.flyout=new(_(F.FLYOUTS_HORIZONTAL_TOOLBOX,this.workspace.options,!0))(e)):(e.toolboxPosition=this.workspace.toolboxPosition===Ee.RIGHT?Ee.LEFT:Ee.RIGHT,this.flyout=new(_(F.FLYOUTS_VERTICAL_TOOLBOX,this.workspace.options,!0))(e)),this.workspace.addChangeListener(this.onDelete.bind(this)))}createDom(){this.svgGroup=N(x.G,{class:"blocklyTrash"});let e;const t=String(Math.random()).substring(2);e=N(x.CLIPPATH,{id:"blocklyTrashBodyClipPath"+t},this.svgGroup),N(x.RECT,{width:an,height:Fl,y:ln},e);const o=N(x.IMAGE,{width:jt.width,x:-wp,height:jt.height,y:-Cp,"clip-path":"url(#blocklyTrashBodyClipPath"+t+")"},this.svgGroup);return o.setAttributeNS(es,"xlink:href",this.workspace.options.pathToMedia+jt.url),e=N(x.CLIPPATH,{id:"blocklyTrashLidClipPath"+t},this.svgGroup),N(x.RECT,{width:an,height:ln},e),this.svgLid=N(x.IMAGE,{width:jt.width,x:-wp,height:jt.height,y:-Cp,"clip-path":"url(#blocklyTrashLidClipPath"+t+")"},this.svgGroup),this.svgLid.setAttributeNS(es,"xlink:href",this.workspace.options.pathToMedia+jt.url),ct(this.svgGroup,"pointerdown",this,this.blockMouseDownWhenOpenable),ct(this.svgGroup,"pointerup",this,this.click),ct(o,"pointerover",this,this.mouseOver),ct(o,"pointerout",this,this.mouseOut),this.animateLid(),this.svgGroup}init(){0{let o;(o=this.flyout)==null||o.show(e),t.cursor="";let n;(n=this.workspace.scrollbar)==null||n.setVisible(!1)},10),this.fireUiEvent(!0)}}closeFlyout(){if(this.contentsIsOpen()){var e;(e=this.flyout)==null||e.hide();var t;(t=this.workspace.scrollbar)==null||t.setVisible(!0),this.fireUiEvent(!1),this.workspace.recordDragTargets()}}autoHide(e){!e&&this.flyout&&this.closeFlyout()}emptyContents(){this.hasContents()&&(this.contents.length=0,this.setMinOpenness(0),this.closeFlyout())}position(e,t){if(this.initialized){var o=va(this.workspace,e);e=ba(o,new Le(an,Fl+ln),ok,Hv,e,this.workspace),t=ya(e,Hv,o.vertical===lo.TOP?Io.DOWN:Io.UP,t),this.top=t.top,this.left=t.left;var n;(n=this.svgGroup)==null||n.setAttribute("transform","translate("+this.left+","+this.top+")");var c;(c=this.flyout)==null||c.position()}}getBoundingRectangle(){return new qe(this.top,this.top+Fl+ln,this.left,this.left+an)}getClientRect(){if(!this.svgGroup)return null;var e=this.svgGroup.getBoundingClientRect();const t=e.top+Cp-zl;return e=e.left+wp-zl,new qe(t,t+ln+Fl+2*zl,e,e+an+2*zl)}onDragOver(e){this.setLidOpen(this.wouldDelete_)}onDragExit(e){this.setLidOpen(!1)}onDrop(e){setTimeout(this.setLidOpen.bind(this,!1),100)}setLidOpen(e){this.isLidOpen!==e&&(this.lidTask&&clearTimeout(this.lidTask),this.isLidOpen=e,this.animateLid())}animateLid(){const e=rk;var t=1/(e+1);this.lidOpen+=this.isLidOpen?t:-t,this.lidOpen=Math.min(Math.max(this.lidOpen,this.minOpenness),1),this.setLidAngle(this.lidOpen*Gv),t=Wv+this.lidOpen*(ak-Wv),this.svgGroup&&(this.svgGroup.style.opacity=`${t}`),this.lidOpen>this.minOpenness&&1>this.lidOpen&&(this.lidTask=setTimeout(this.animateLid.bind(this),nk/e))}setLidAngle(e){const t=this.workspace.toolboxPosition===Ee.RIGHT||this.workspace.horizontalLayout&&this.workspace.RTL;let o;(o=this.svgLid)==null||o.setAttribute("transform","rotate("+(t?-e:e)+","+(t?4:an-4)+","+(ln-2)+")")}setMinOpenness(e){this.minOpenness=e,this.isLidOpen||this.setLidAngle(e*Gv)}closeLid(){this.setLidOpen(!1)}click(){this.hasContents()&&!this.workspace.isDragging()&&this.openFlyout()}fireUiEvent(e){e=new(V(O.TRASHCAN_OPEN))(e,this.workspace.id),z(e)}blockMouseDownWhenOpenable(e){!this.contentsIsOpen()&&this.hasContents()&&e.stopPropagation()}mouseOver(){this.hasContents()&&this.setLidOpen(!0)}mouseOut(){this.setLidOpen(!1)}onDelete(e){if(!(0>=this.workspace.options.maxTrashcanContents||!E(e)||e.wasShadow)){if(!e.oldJson)throw Error("Encountered a delete event without proper oldJson");if(e=JSON.stringify(this.cleanBlockJson(e.oldJson)),!this.contents.includes(e)){for(this.contents.unshift(e);this.contents.length>this.workspace.options.maxTrashcanContents;)this.contents.pop();this.setMinOpenness(ik)}}}cleanBlockJson(e){function t(o){if(o){if(delete o.id,delete o.x,delete o.y,delete o.enabled,delete o.disabledReasons,o.icons&&o.icons.comment){var n=o.icons.comment;delete n.height,delete n.width,delete n.pinned}n=o.inputs;for(var c in n){var h=n[c];const $=h.block;h=h.shadow,$&&t($),h&&t(h)}o.next&&(c=o.next,o=c.block,c=c.shadow,o&&t(o),c&&t(c))}}return e=JSON.parse(JSON.stringify(e)),t(e),Object.assign({},{kind:"BLOCK"},e)}},an=47,Fl=44,ln=16,Hv=20,ok=20,zl=10,wp=0,Cp=32,ik=.1,nk=80,rk=4,Wv=.4,ak=.8,Gv=45,He=class{constructor(){this.shortcuts=new Map,this.keyMap=new Map,this.reset()}reset(){this.shortcuts.clear(),this.keyMap.clear()}register(e,t){if(this.shortcuts.get(e.name)&&!t)throw Error(`Shortcut named "${e.name}" already exists.`);if(this.shortcuts.set(e.name,e),t=e.keyCodes,t!=null&&t.length)for(const o of t)this.addKeyMapping(o,e.name,!!e.allowCollision)}unregister(e){return this.shortcuts.get(e)?(this.removeAllKeyMappings(e),this.shortcuts.delete(e),!0):(console.warn(`Keyboard shortcut named "${e}" not found.`),!1)}addKeyMapping(e,t,o){e=`${e}`;const n=this.keyMap.get(e);if(n&&!o)throw Error(`Shortcut named "${t}" collides with shortcuts "${n}"`);n&&o?n.unshift(t):this.keyMap.set(e,[t])}removeKeyMapping(e,t,o){const n=this.keyMap.get(e);if(!n)return o||console.warn(`No keyboard shortcut named "${t}" registered with key code "${e}"`),!1;const c=n.indexOf(t);return-1Vd(t)),e.length?e:null}load(e,t){const o=t.getProcedureMap();for(const n of e)o.add(Kd(this.procedureModelClass,this.parameterModelClass,n,t))}clear(e){e.getProcedureMap().clear()}},Ul={};Ul.ProcedureSerializer=ck,Ul.loadProcedure=Kd,Ul.saveProcedure=Vd;var Vv=class{constructor(){this.priority=zb}save(e){const t=[];for(const o of e.getAllVariables())e={name:o.name,id:o.getId()},o.type&&(e.type=o.type),t.push(e);return t.length?t:null}load(e,t){for(const o of e)t.createVariable(o.name,o.type,o.id)}clear(e){e.getVariableMap().clear()}};jn("variables",new Vv);var Kv={};Kv.VariableSerializer=Vv;var Sp={};Sp.load=Y$,Sp.save=K$;var uk={blocks:gr,exceptions:ii,priorities:jT,procedures:Ul,registry:Ih,variables:Kv,workspaceComments:cl,workspaces:Sp},Ep=class{constructor(e,t,o,n,c){this.workspace=e,this.oldHostMetrics=this.corner_=this.vScroll=this.hScroll=null,t=t===void 0?!0:t,o=o===void 0?!0:o;const h=t&&o;t&&(this.hScroll=new mt(e,!0,h,n,c)),o&&(this.vScroll=new mt(e,!1,h,n,c)),h&&(this.corner_=N(x.RECT,{height:mt.scrollbarThickness,width:mt.scrollbarThickness,class:"blocklyScrollbarBackground"}),Uo(this.corner_,e.getBubbleCanvas()))}dispose(){Ke(this.corner_),this.oldHostMetrics=this.corner_=null,this.hScroll&&(this.hScroll.dispose(),this.hScroll=null),this.vScroll&&(this.vScroll.dispose(),this.vScroll=null)}resize(){const e=this.workspace.getMetrics();if(e){var t=!1,o=!1;if(this.oldHostMetrics&&this.oldHostMetrics.viewWidth===e.viewWidth&&this.oldHostMetrics.viewHeight===e.viewHeight&&this.oldHostMetrics.absoluteTop===e.absoluteTop&&this.oldHostMetrics.absoluteLeft===e.absoluteLeft?(this.oldHostMetrics&&this.oldHostMetrics.scrollWidth===e.scrollWidth&&this.oldHostMetrics.viewLeft===e.viewLeft&&this.oldHostMetrics.scrollLeft===e.scrollLeft||(t=!0),this.oldHostMetrics&&this.oldHostMetrics.scrollHeight===e.scrollHeight&&this.oldHostMetrics.viewTop===e.viewTop&&this.oldHostMetrics.scrollTop===e.scrollTop||(o=!0)):o=t=!0,t||o){try{i.disable$$module$build$src$core$events$utils(),this.hScroll&&t&&this.hScroll.resize(e),this.vScroll&&o&&this.vScroll.resize(e)}finally{i.enable$$module$build$src$core$events$utils()}this.workspace.maybeFireViewportChangeEvent()}if(this.hScroll&&this.vScroll){if(!this.oldHostMetrics||this.oldHostMetrics.viewWidth!==e.viewWidth||this.oldHostMetrics.absoluteLeft!==e.absoluteLeft){let n;(n=this.corner_)==null||n.setAttribute("x",String(this.vScroll.position.x))}if(!this.oldHostMetrics||this.oldHostMetrics.viewHeight!==e.viewHeight||this.oldHostMetrics.absoluteTop!==e.absoluteTop){let n;(n=this.corner_)==null||n.setAttribute("y",String(this.hScroll.position.y))}}this.oldHostMetrics=e}}canScrollHorizontally(){return!!this.hScroll}canScrollVertically(){return!!this.vScroll}setOrigin(e,t){this.hScroll&&this.hScroll.setOrigin(e,t),this.vScroll&&this.vScroll.setOrigin(e,t)}set(e,t,o){this.hScroll&&this.hScroll.set(e,!1),this.vScroll&&this.vScroll.set(t,!1),(o||o===void 0)&&(e={},this.hScroll&&(e.x=this.hScroll.getRatio_()),this.vScroll&&(e.y=this.vScroll.getRatio_()),this.workspace.setMetrics(e))}setX(e){this.hScroll&&this.hScroll.set(e,!0)}setY(e){this.vScroll&&this.vScroll.set(e,!0)}setContainerVisible(e){this.hScroll&&this.hScroll.setContainerVisible(e),this.vScroll&&this.vScroll.setContainerVisible(e)}isVisible(){let e=!1;return this.hScroll&&(e=this.hScroll.isVisible()),this.vScroll&&(e=e||this.vScroll.isVisible()),e}setVisible(e){this.hScroll&&this.hScroll.setVisibleInternal(e),this.vScroll&&this.vScroll.setVisibleInternal(e)}resizeContent(e){this.hScroll&&this.hScroll.resizeContentHorizontal(e),this.vScroll&&this.vScroll.resizeContentVertical(e)}resizeView(e){this.hScroll&&this.hScroll.resizeViewHorizontal(e),this.vScroll&&this.vScroll.resizeViewVertical(e)}},Ip=class{constructor(e){this.workspace_=e}getDimensionsPx_(e){let t=0,o=0;return e&&(t=e.getWidth(),o=e.getHeight()),new Le(t,o)}getFlyoutMetrics(e){return e=this.getDimensionsPx_(this.workspace_.getFlyout(e)),{width:e.width,height:e.height,position:this.workspace_.toolboxPosition}}getToolboxMetrics(){const e=this.getDimensionsPx_(this.workspace_.getToolbox());return{width:e.width,height:e.height,position:this.workspace_.toolboxPosition}}getSvgMetrics(){return this.workspace_.getCachedParentSvgSize()}getAbsoluteMetrics(){let e=0,t=0;const o=this.getToolboxMetrics(),n=this.getFlyoutMetrics(),c=!!this.workspace_.getToolbox();var h;const $=!((h=this.workspace_.getFlyout())!=null&&h.autoClose);h=c?o.position:n.position;const T=h===Ee.TOP;return h===Ee.LEFT&&(c&&(e+=o.width),$&&(e+=n.width)),T&&(c&&(t+=o.height),$&&(t+=n.height)),{top:t,left:e}}getViewMetrics(e){e=e?this.workspace_.scale:1;const t=this.getSvgMetrics(),o=this.getToolboxMetrics(),n=this.getFlyoutMetrics(),c=!!this.workspace_.getToolbox();var h;const $=!((h=this.workspace_.getFlyout())!=null&&h.autoClose);h=c?o.position:n.position;const T=h===Ee.LEFT||h===Ee.RIGHT;return(h===Ee.TOP||h===Ee.BOTTOM)&&(c&&(t.height-=o.height),$&&(t.height-=n.height)),T&&(c&&(t.width-=o.width),$&&(t.width-=n.width)),{height:t.height/e,width:t.width/e,top:-this.workspace_.scrollY/e,left:-this.workspace_.scrollX/e}}getContentMetrics(e){e=e?1:this.workspace_.scale;const t=this.workspace_.getBlocksBoundingBox();return{height:(t.bottom-t.top)*e,width:(t.right-t.left)*e,top:t.top*e,left:t.left*e}}hasFixedEdges(){return!this.workspace_.isMovableHorizontally()||!this.workspace_.isMovableVertically()}getComputedFixedEdges_(e){if(!this.hasFixedEdges())return{};const t=this.workspace_.isMovableHorizontally(),o=this.workspace_.isMovableVertically();e=e||this.getViewMetrics(!1);const n={};return o||(n.top=e.top,n.bottom=e.top+e.height),t||(n.left=e.left,n.right=e.left+e.width),n}getPaddedContent_(e,t){const o=t.top+t.height,n=t.left+t.width,c=e.width;e=e.height;const h=c/2,$=e/2;return{top:Math.min(t.top-$,o-e),bottom:Math.max(o+$,t.top+e),left:Math.min(t.left-h,n-c),right:Math.max(n+h,t.left+c)}}getScrollMetrics(e,t,o){e=e?this.workspace_.scale:1,t=t||this.getViewMetrics(!1);var n=o||this.getContentMetrics();o=this.getComputedFixedEdges_(t),t=this.getPaddedContent_(t,n),n=o.top!==void 0?o.top:t.top;const c=o.left!==void 0?o.left:t.left;return{top:n/e,left:c/e,width:((o.right!==void 0?o.right:t.right)-c)/e,height:((o.bottom!==void 0?o.bottom:t.bottom)-n)/e}}getUiMetrics(){return{viewMetrics:this.getViewMetrics(),absoluteMetrics:this.getAbsoluteMetrics(),toolboxMetrics:this.getToolboxMetrics()}}getMetrics(){const e=this.getToolboxMetrics(),t=this.getFlyoutMetrics(!0),o=this.getSvgMetrics(),n=this.getAbsoluteMetrics(),c=this.getViewMetrics(),h=this.getContentMetrics(),$=this.getScrollMetrics(!1,c,h);return{contentHeight:h.height,contentWidth:h.width,contentTop:h.top,contentLeft:h.left,scrollHeight:$.height,scrollWidth:$.width,scrollTop:$.top,scrollLeft:$.left,viewHeight:c.height,viewWidth:c.width,viewTop:c.top,viewLeft:c.left,absoluteTop:n.top,absoluteLeft:n.left,svgHeight:o.height,svgWidth:o.width,toolboxWidth:e.width,toolboxHeight:e.height,toolboxPosition:e.position,flyoutWidth:t.width,flyoutHeight:t.height}}};r(F.METRICS_MANAGER,js,Ip),"Blockly"in globalThis||(globalThis.Blockly={Msg:Xb});var Yv=class extends Ml{constructor(){super(),this.GRID_UNIT=4,this.CURSOR_COLOUR="#ffa200",this.CURSOR_RADIUS=5,this.JAGGED_TEETH_WIDTH=this.JAGGED_TEETH_HEIGHT=0,this.START_HAT_HEIGHT=22,this.START_HAT_WIDTH=96,this.SHAPES={HEXAGONAL:1,ROUND:2,SQUARE:3,PUZZLE:4,NOTCH:5},this.SHAPE_IN_SHAPE_PADDING={1:{0:5*this.GRID_UNIT,1:2*this.GRID_UNIT,2:5*this.GRID_UNIT,3:5*this.GRID_UNIT},2:{0:3*this.GRID_UNIT,1:3*this.GRID_UNIT,2:1*this.GRID_UNIT,3:2*this.GRID_UNIT},3:{0:2*this.GRID_UNIT,1:2*this.GRID_UNIT,2:2*this.GRID_UNIT,3:2*this.GRID_UNIT}},this.FULL_BLOCK_FIELDS=!0,this.FIELD_TEXT_FONTWEIGHT="bold",this.FIELD_TEXT_FONTFAMILY='"Helvetica Neue", "Segoe UI", Helvetica, sans-serif',this.FIELD_COLOUR_FULL_BLOCK=this.FIELD_TEXTINPUT_BOX_SHADOW=this.FIELD_DROPDOWN_SVG_ARROW=this.FIELD_DROPDOWN_COLOURED_DIV=this.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW=!0,this.SELECTED_GLOW_COLOUR="#fff200",this.SELECTED_GLOW_SIZE=.5,this.REPLACEMENT_GLOW_COLOUR="#fff200",this.REPLACEMENT_GLOW_SIZE=2,this.selectedGlowFilterId="",this.selectedGlowFilter=null,this.replacementGlowFilterId="",this.SQUARED=this.ROUNDED=this.HEXAGONAL=this.replacementGlowFilter=null,this.SMALL_PADDING=this.GRID_UNIT,this.MEDIUM_PADDING=2*this.GRID_UNIT,this.MEDIUM_LARGE_PADDING=3*this.GRID_UNIT,this.LARGE_PADDING=4*this.GRID_UNIT,this.CORNER_RADIUS=1*this.GRID_UNIT,this.NOTCH_WIDTH=9*this.GRID_UNIT,this.NOTCH_HEIGHT=2*this.GRID_UNIT,this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT=3*this.GRID_UNIT,this.MIN_BLOCK_WIDTH=2*this.GRID_UNIT,this.MIN_BLOCK_HEIGHT=12*this.GRID_UNIT,this.EMPTY_STATEMENT_INPUT_HEIGHT=6*this.GRID_UNIT,this.TOP_ROW_MIN_HEIGHT=this.CORNER_RADIUS,this.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING,this.BOTTOM_ROW_MIN_HEIGHT=this.CORNER_RADIUS,this.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT=6*this.GRID_UNIT,this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT,this.STATEMENT_INPUT_SPACER_MIN_WIDTH=40*this.GRID_UNIT,this.STATEMENT_INPUT_PADDING_LEFT=4*this.GRID_UNIT,this.EMPTY_INLINE_INPUT_PADDING=4*this.GRID_UNIT,this.EMPTY_INLINE_INPUT_HEIGHT=8*this.GRID_UNIT,this.DUMMY_INPUT_MIN_HEIGHT=8*this.GRID_UNIT,this.DUMMY_INPUT_SHADOW_MIN_HEIGHT=6*this.GRID_UNIT,this.CURSOR_WS_WIDTH=20*this.GRID_UNIT,this.FIELD_TEXT_FONTSIZE=3*this.GRID_UNIT,this.FIELD_BORDER_RECT_RADIUS=this.CORNER_RADIUS,this.FIELD_BORDER_RECT_X_PADDING=2*this.GRID_UNIT,this.FIELD_BORDER_RECT_Y_PADDING=1.625*this.GRID_UNIT,this.FIELD_BORDER_RECT_HEIGHT=8*this.GRID_UNIT,this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=8*this.GRID_UNIT,this.FIELD_DROPDOWN_SVG_ARROW_PADDING=this.FIELD_BORDER_RECT_X_PADDING,this.FIELD_COLOUR_DEFAULT_WIDTH=6*this.GRID_UNIT,this.FIELD_COLOUR_DEFAULT_HEIGHT=8*this.GRID_UNIT,this.FIELD_CHECKBOX_X_OFFSET=1*this.GRID_UNIT,this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH=12*this.GRID_UNIT}setFontConstants_(e){super.setFontConstants_(e),this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT=this.FIELD_TEXT_HEIGHT+2*this.FIELD_BORDER_RECT_Y_PADDING}init(){super.init(),this.HEXAGONAL=this.makeHexagonal(),this.ROUNDED=this.makeRounded(),this.SQUARED=this.makeSquared(),this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT+this.INSIDE_CORNERS.rightWidth}setDynamicProperties_(e){super.setDynamicProperties_(e),this.SELECTED_GLOW_COLOUR=e.getComponentStyle("selectedGlowColour")||this.SELECTED_GLOW_COLOUR;const t=Number(e.getComponentStyle("selectedGlowSize"));this.SELECTED_GLOW_SIZE=t&&!isNaN(t)?t:this.SELECTED_GLOW_SIZE,this.REPLACEMENT_GLOW_COLOUR=e.getComponentStyle("replacementGlowColour")||this.REPLACEMENT_GLOW_COLOUR,this.REPLACEMENT_GLOW_SIZE=(e=Number(e.getComponentStyle("replacementGlowSize")))&&!isNaN(e)?e:this.REPLACEMENT_GLOW_SIZE}dispose(){super.dispose(),this.selectedGlowFilter&&Ke(this.selectedGlowFilter),this.replacementGlowFilter&&Ke(this.replacementGlowFilter)}makeStartHat(){const e=this.START_HAT_HEIGHT,t=this.START_HAT_WIDTH,o=Yt("c",[ue(25,-e),ue(71,-e),ue(t,0)]);return{height:e,width:t,path:o}}makeHexagonal(){function e(o,n,c){var h=o/2;return h=h>t?t:h,c=c?-1:1,o=(n?-1:1)*o/2,Bs(-c*h,o)+Bs(c*h,o)}const t=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH;return{type:this.SHAPES.HEXAGONAL,isDynamic:!0,width(o){return o/=2,o>t?t:o},height(o){return o},connectionOffsetY(o){return o/2},connectionOffsetX(o){return-o},pathDown(o){return e(o,!1,!1)},pathUp(o){return e(o,!0,!1)},pathRightDown(o){return e(o,!1,!0)},pathRightUp(o){return e(o,!1,!0)}}}makeRounded(){function e(n,c,h){const $=n>o?n-o:0;n=(n>o?o:n)/2;const T=h===c?"0":"1";return gt("a","0 0,"+T,n,ue((h?1:-1)*n,(c?-1:1)*n))+ne("v",(c?-1:1)*$)+gt("a","0 0,"+T,n,ue((h?-1:1)*n,(c?-1:1)*n))}const t=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH,o=2*t;return{type:this.SHAPES.ROUND,isDynamic:!0,width(n){return n/=2,n>t?t:n},height(n){return n},connectionOffsetY(n){return n/2},connectionOffsetX(n){return-n},pathDown(n){return e(n,!1,!1)},pathUp(n){return e(n,!0,!1)},pathRightDown(n){return e(n,!1,!0)},pathRightUp(n){return e(n,!1,!0)}}}makeSquared(){function e(o,n,c){o-=2*t;const h=c===n?"0":"1";return gt("a","0 0,"+h,t,ue((c?1:-1)*t,(n?-1:1)*t))+ne("v",(n?-1:1)*o)+gt("a","0 0,"+h,t,ue((c?-1:1)*t,(n?-1:1)*t))}const t=this.CORNER_RADIUS;return{type:this.SHAPES.SQUARE,isDynamic:!0,width(o){return t},height(o){return o},connectionOffsetY(o){return o/2},connectionOffsetX(o){return-o},pathDown(o){return e(o,!1,!1)},pathUp(o){return e(o,!0,!1)},pathRightDown(o){return e(o,!1,!0)},pathRightUp(o){return e(o,!1,!0)}}}shapeFor(e){let t=e.getCheck();switch(!t&&e.targetConnection&&(t=e.targetConnection.getCheck()),e.type){case oe.INPUT_VALUE:case oe.OUTPUT_VALUE:if(e=e.getSourceBlock().getOutputShape(),e!==null)switch(e){case this.SHAPES.HEXAGONAL:return this.HEXAGONAL;case this.SHAPES.ROUND:return this.ROUNDED;case this.SHAPES.SQUARE:return this.SQUARED}return t&&t.includes("Boolean")?this.HEXAGONAL:t&&t.includes("Number")?this.ROUNDED:(t&&t.includes("String"),this.ROUNDED);case oe.PREVIOUS_STATEMENT:case oe.NEXT_STATEMENT:return this.NOTCH;default:throw Error("Unknown type")}}makeNotch(){function e(te){return Yt("c",[ue(te*c/2,0),ue(te*c*3/4,$/2),ue(te*c,$)])+Fi([ue(te*c,h)])+Yt("c",[ue(te*c/4,$/2),ue(te*c/2,$),ue(te*c,$)])+ne("h",te*n)+Yt("c",[ue(te*c/2,0),ue(te*c*3/4,-($/2)),ue(te*c,-$)])+Fi([ue(te*c,-h)])+Yt("c",[ue(te*c/4,-($/2)),ue(te*c/2,-$),ue(te*c,-$)])}const t=this.NOTCH_WIDTH,o=this.NOTCH_HEIGHT,n=t/3,c=n/3,h=o/2,$=h/2,T=e(1),L=e(-1);return{type:this.SHAPES.NOTCH,width:t,height:o,pathLeft:T,pathRight:L}}makeInsideCorners(){const e=this.CORNER_RADIUS,t=gt("a","0 0,0",e,ue(-e,e)),o=gt("a","0 0,1",e,ue(-e,e)),n=gt("a","0 0,0",e,ue(e,e)),c=gt("a","0 0,1",e,ue(e,e));return{width:e,height:e,pathTop:t,pathBottom:n,rightWidth:e,rightHeight:e,pathTopRight:o,pathBottomRight:c}}generateSecondaryColour_(e){return Ko("#000",e,.15)||e}generateTertiaryColour_(e){return Ko("#000",e,.25)||e}createDom(e,t,o){super.createDom(e,t,o),e=N(x.DEFS,{},e),t=N(x.FILTER,{id:"blocklySelectedGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},e),N(x.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.SELECTED_GLOW_SIZE},t),o=N(x.FECOMPONENTTRANSFER,{result:"outBlur"},t),N(x.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},o),N(x.FEFLOOD,{"flood-color":this.SELECTED_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},t),N(x.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},t),this.selectedGlowFilterId=t.id,this.selectedGlowFilter=t,e=N(x.FILTER,{id:"blocklyReplacementGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},e),N(x.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.REPLACEMENT_GLOW_SIZE},e),t=N(x.FECOMPONENTTRANSFER,{result:"outBlur"},e),N(x.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},t),N(x.FEFLOOD,{"flood-color":this.REPLACEMENT_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},e),N(x.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},e),N(x.FECOMPOSITE,{in:"SourceGraphic",in2:"outGlow",operator:"over"},e),this.replacementGlowFilterId=e.id,this.replacementGlowFilter=e}getCSS_(e){return[`${e} .blocklyText,`,`${e} .blocklyFlyoutLabelText {`,`font: ${this.FIELD_TEXT_FONTWEIGHT} ${this.FIELD_TEXT_FONTSIZE}pt ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${e} .blocklyTextInputBubble textarea {`,"font-weight: normal;","}",`${e} .blocklyText {`,"fill: #fff;","}",`${e} .blocklyNonEditableText>rect:not(.blocklyDropdownRect),`,`${e} .blocklyEditableText>rect:not(.blocklyDropdownRect) {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"}",`${e} .blocklyNonEditableText>text,`,`${e} .blocklyEditableText>text,`,`${e} .blocklyNonEditableText>g>text,`,`${e} .blocklyEditableText>g>text {`,"fill: #575E75;","}",`${e} .blocklyFlyoutLabelText {`,"fill: #575E75;","}",`${e} .blocklyText.blocklyBubbleText {`,"fill: #575E75;","}",`${e} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableText:not(.editing):hover>rect,",`${e} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableText:not(.editing):hover>.blocklyPath {","stroke: #fff;","stroke-width: 2;","}",`${e} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,"color: #575E75;","}",`${e} .blocklyDropdownText {`,"fill: #fff !important;","}",`${e}.blocklyWidgetDiv .blocklyMenuItem,`,`${e}.blocklyDropDownDiv .blocklyMenuItem {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${e}.blocklyDropDownDiv .blocklyMenuItemContent {`,"color: #fff;","}",`${e} .blocklyHighlightedConnectionPath {`,`stroke: ${this.SELECTED_GLOW_COLOUR};`,"}",`${e} .blocklyDisabled > .blocklyOutlinePath {`,`fill: url(#blocklyDisabledPattern${this.randomIdentifier})`,"}",`${e} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"]}},Jv=class extends Nl{constructor(e,t){super(e,t)}draw(){const e=this.block_.pathObject;e.beginDrawing(),this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights(),e.setPath(this.outlinePath_+` -`+this.inlinePath_),this.info_.RTL&&e.flipRTL(),this.recordSizeOnBlock_(),this.info_.outputConnection&&(e.outputShapeType=this.info_.outputConnection.shape.type),e.endDrawing()}drawOutline_(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape&&!this.info_.hasStatementInput&&!this.info_.bottomRow.hasNextConnection?(this.drawFlatTop_(),this.drawRightDynamicConnection_(),this.drawFlatBottom_(),this.drawLeftDynamicConnection_()):super.drawOutline_()}drawLeft_(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape?this.drawLeftDynamicConnection_():super.drawLeft_()}drawRightSideRow_(e){if(!(0>=e.height)){if(S.isSpacer(e)){const n=e.precedesStatement;var t=e.followsStatement;if(n||t){const c=this.constants_.INSIDE_CORNERS;var o=c.rightHeight;o=e.height-(n?o:0),t=t?c.pathBottomRight:"",e=0=o||0>=t)throw Error("Height and width values of an image field must be greater than 0.");this.size_=new Le(t,o+mi.Y_PADDING),this.imageHeight=o,typeof c=="function"&&(this.clickHandler=c),e!==Qe.SKIP_SETUP&&($?this.configure_($):(this.flipRtl=!!h,this.altText=pt(n)||""),this.setValue(pt(e)))}configure_(e){super.configure_(e),e.flipRtl&&(this.flipRtl=e.flipRtl),e.alt&&(this.altText=pt(e.alt))}initView(){this.imageElement=N(x.IMAGE,{height:this.imageHeight+"px",width:this.size_.width+"px",alt:this.altText},this.fieldGroup_),this.imageElement.setAttributeNS(es,"xlink:href",this.value_),this.clickHandler&&(this.imageElement.style.cursor="pointer")}updateSize_(){}doClassValidation_(e){return typeof e!="string"?null:e}doValueUpdate_(e){this.value_=e,this.imageElement&&this.imageElement.setAttributeNS(es,"xlink:href",this.value_)}getFlipRtl(){return this.flipRtl}setAlt(e){e!==this.altText&&(this.altText=e||"",this.imageElement&&this.imageElement.setAttribute("alt",this.altText))}showEditor_(){this.clickHandler&&this.clickHandler(this)}setOnClickHandler(e){this.clickHandler=e}getText_(){return this.altText}static fromJson(e){if(!e.src||!e.width||!e.height)throw Error("src, width, and height values for an image field arerequired. The width and height must be non-zero.");return new this(e.src,e.width,e.height,void 0,void 0,void 0,e)}};mi.Y_PADDING=1,Ps("field_image",mi),mi.prototype.DEFAULT_VALUE="";var Hl=class extends Qe{constructor(e,t,o){super(Qe.SKIP_SETUP),this.spellcheck_=!0,this.htmlInput_=null,this.isTextValid_=this.isBeingEdited_=!1,this.onKeyInputWrapper=this.onKeyDownWrapper=this.valueWhenEditorWasOpened_=null,this.fullBlockClickTarget_=!1,this.workspace_=null,this.SERIALIZABLE=!0,this.CURSOR="text",e!==Qe.SKIP_SETUP&&(o&&this.configure_(o),this.setValue(e),t&&this.setValidator(t))}configure_(e){super.configure_(e),e.spellcheck!==void 0&&(this.spellcheck_=e.spellcheck)}initView(){if(!this.getSourceBlock())throw new ft;super.initView(),this.isFullBlockField()&&(this.clickTarget_=this.sourceBlock_.getSvgRoot())}isFullBlockField(){const e=this.getSourceBlock();if(!e)throw new ft;let t;return this.fullBlockClickTarget_=!((t=this.getConstants())==null||!t.FULL_BLOCK_FIELDS)&&e.isSimpleReporter()}doValueInvalid_(e,t=!0){this.isBeingEdited_&&(this.isDirty_=!0,this.isTextValid_=!1,e=this.value_,this.value_=this.valueWhenEditorWasOpened_,this.sourceBlock_&&K()&&this.value_!==e&&t&&z(new(V(O.BLOCK_CHANGE))(this.sourceBlock_,"field",this.name||null,e,this.value_)))}doValueUpdate_(e){this.isTextValid_=this.isDirty_=!0,this.value_=e}applyColour(){const e=this.getSourceBlock();if(!e)throw new ft;this.getConstants().FULL_BLOCK_FIELDS&&this.fieldGroup_&&(!this.isFullBlockField()&&this.borderRect_?(this.borderRect_.style.display="block",this.borderRect_.setAttribute("stroke",e.getColourTertiary())):(this.borderRect_.style.display="none",e.pathObject.svgPath.setAttribute("fill",this.getConstants().FIELD_BORDER_RECT_COLOUR)))}getSize(){let e;return(e=this.getConstants())!=null&&e.FULL_BLOCK_FIELDS&&(this.render_(),this.isDirty_=!1),super.getSize()}onLocationChange(){this.isBeingEdited_&&this.resizeEditor_()}render_(){if(super.render_(),this.isBeingEdited_){var e=this.htmlInput_;this.isTextValid_?(ot(e,"blocklyInvalidInput"),It(e,Ct.INVALID,!1)):(ge(e,"blocklyInvalidInput"),It(e,Ct.INVALID,!0))}if(e=this.getSourceBlock(),!e)throw new ft;this.getConstants().FULL_BLOCK_FIELDS&&e.applyColour()}setSpellcheck(e){e!==this.spellcheck_&&(this.spellcheck_=e,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))}showEditor_(e,t=!1){this.workspace_=this.sourceBlock_.workspace,!t&&this.workspace_.options.modalInputs&&(Db||yh||nl)?this.showPromptEditor():this.showInlineEditor(t)}showPromptEditor(){Ta(i.Msg$$module$build$src$core$msg.CHANGE_VALUE_TITLE,this.getText(),e=>{e!==null&&this.setValue(this.getValueFromEditorText_(e)),this.onFinishEditing_(this.value_)})}showInlineEditor(e){const t=this.getSourceBlock();if(!t)throw new ft;Pa(this,t.RTL,this.widgetDispose_.bind(this),this.workspace_),this.htmlInput_=this.widgetCreate_(),this.isBeingEdited_=!0,this.valueWhenEditorWasOpened_=this.value_,e||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())}widgetCreate_(){var e=this.getSourceBlock();if(!e)throw new ft;i.setGroup$$module$build$src$core$events$utils(!0);const t=Yo();var o=this.getClickTarget_();if(!o)throw Error("A click target has not been set.");ge(o,"editing"),o=document.createElement("input"),o.className="blocklyHtmlInput",o.setAttribute("spellcheck",this.spellcheck_);const n=this.workspace_.getScale();var c=this.getConstants().FIELD_TEXT_FONTSIZE*n+"pt";return t.style.fontSize=c,o.style.fontSize=c,c=Hl.BORDERRADIUS*n+"px",this.isFullBlockField()&&(c=this.getScaledBBox(),c=(c.bottom-c.top)/2+"px",e=e.getParent()?e.getParent().getColourTertiary():this.sourceBlock_.getColourTertiary(),o.style.border=1*n+"px solid "+e,t.style.borderRadius=c,t.style.transition="box-shadow 0.25s ease 0s",this.getConstants().FIELD_TEXTINPUT_BOX_SHADOW&&(t.style.boxShadow="rgba(255, 255, 255, 0.3) 0 0 0 "+4*n+"px")),o.style.borderRadius=c,t.appendChild(o),o.value=o.defaultValue=this.getEditorText_(this.value_),o.setAttribute("data-untyped-default-value",String(this.value_)),this.resizeEditor_(),this.bindInputEvents_(o),o}widgetDispose_(){this.isBeingEdited_=!1,this.isTextValid_=!0,this.forceRerender(),this.onFinishEditing_(this.value_),this.sourceBlock_&&K()&&this.valueWhenEditorWasOpened_!==null&&this.valueWhenEditorWasOpened_!==this.value_&&(z(new(V(O.BLOCK_CHANGE))(this.sourceBlock_,"field",this.name||null,this.valueWhenEditorWasOpened_,this.value_)),this.valueWhenEditorWasOpened_=null),i.setGroup$$module$build$src$core$events$utils(!1),this.unbindInputEvents_();var e=Yo().style;if(e.width="auto",e.height="auto",e.fontSize="",e.transition="",e.boxShadow="",this.htmlInput_=null,e=this.getClickTarget_(),!e)throw Error("A click target has not been set.");ot(e,"editing")}onFinishEditing_(e){}bindInputEvents_(e){this.onKeyDownWrapper=X(e,"keydown",this,this.onHtmlInputKeyDown_),this.onKeyInputWrapper=X(e,"input",this,this.onHtmlInputChange)}unbindInputEvents_(){this.onKeyDownWrapper&&(ze(this.onKeyDownWrapper),this.onKeyDownWrapper=null),this.onKeyInputWrapper&&(ze(this.onKeyInputWrapper),this.onKeyInputWrapper=null)}onHtmlInputKeyDown_(e){e.key==="Enter"?(Jo(this),Ns()):e.key==="Escape"?(this.setValue(this.htmlInput_.getAttribute("data-untyped-default-value"),!1),Jo(this),Ns()):e.key==="Tab"&&(Jo(this),Ns(),this.sourceBlock_.tab(this,!e.shiftKey),e.preventDefault())}onHtmlInputChange(e){e=this.value_,this.setValue(this.getValueFromEditorText_(this.htmlInput_.value),!1),this.sourceBlock_&&K()&&this.value_!==e&&z(new(V(O.BLOCK_FIELD_INTERMEDIATE_CHANGE))(this.sourceBlock_,this.name||null,e,this.value_))}setEditorValue_(e,t=!0){this.isDirty_=!0,this.isBeingEdited_&&(this.htmlInput_.value=this.getEditorText_(e)),this.setValue(e,t)}resizeEditor_(){ws().then(()=>{const e=this.getSourceBlock();if(!e)throw new ft;const t=Yo(),o=this.getScaledBBox();t.style.width=o.right-o.left+"px",t.style.height=o.bottom-o.top+"px";const n=o.top;t.style.left=`${e.RTL?o.right-t.offsetWidth:o.left}px`,t.style.top=`${n}px`})}repositionForWindowResize(){let e;const t=(e=this.getSourceBlock())==null?void 0:e.getRootBlock();return t instanceof gs?(zi(this.workspace_,this.workspace_.getMetricsManager().getViewMetrics(!0),t)||this.resizeEditor_(),!0):!1}isTabNavigable(){return!0}getText_(){return this.isBeingEdited_&&this.htmlInput_?this.htmlInput_.value:null}getEditorText_(e){return`${e}`}getValueFromEditorText_(e){return e}};Hl.BORDERRADIUS=4;var Wl=class extends Hl{constructor(e,t,o){super(e,t,o)}doClassValidation_(e){return e===void 0?null:`${e}`}static fromJson(e){return new this(pt(e.text),void 0,e)}};Ps("field_input",Wl),Wl.prototype.DEFAULT_VALUE="";var qv=class extends ip{constructor(e){super(e)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(e){return!!e.outputConnection}hasRightSquareCorner(e){return!!e.outputConnection&&!e.statementInputCount&&!e.nextConnection}},Gl=class extends wr{constructor(e,t){if(super(e,t),this.connectedBottomNextConnection=!1,this.connectedBlock){for(e=this.connectedBlock;t=e.getNextBlock();)e=t;e.nextConnection||(this.height=this.connectedBlockHeight,this.connectedBottomNextConnection=!0)}}},Xv=class extends zs{constructor(e){super(e),this.width=this.height=0,this.type|=S.getType("RIGHT_CONNECTION")}},Zv=class extends cp{constructor(e){super(e)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(e){const t=(e.hat?e.hat==="cap":this.constants_.ADD_START_HATS)&&!e.outputConnection&&!e.previousConnection;return!!e.outputConnection||t}hasRightSquareCorner(e){return!!e.outputConnection&&!e.statementInputCount&&!e.nextConnection}},Qv=class extends kr{constructor(e,t){super(e,t),this.isInline=!0,this.renderer_=e,this.constants_=this.renderer_.getConstants(),this.topRow=new Zv(this.constants_),this.bottomRow=new qv(this.constants_),this.isMultiRow=!t.getInputsInline()||t.isCollapsed(),this.hasStatementInput=0=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!n.precedesStatement,S.isInputRow(h)&&h.hasStatement){h.measure();let $,T;t=h.width-((T=($=h.getLastInput())==null?void 0:$.width)!=null?T:0)+e}else if(o&&(c===2||n)&&S.isInputRow(h)&&!h.hasStatement){n=h.xPos,o=null;for(let $=0;$o?o:this.height/2,t-o*(1-Math.sin(Math.acos((o-this.constants_.SMALL_PADDING)/o)))):0;if(S.isInlineInput(e)&&e instanceof Ro){const c=e.connectedBlock;return e=c?c.pathObject.outputShapeType:e.shape.type,e==null||c&&c.outputConnection&&(c.statementInputCount||c.nextConnection)||o===n.SHAPES.HEXAGONAL&&o!==e?0:t-this.constants_.SHAPE_IN_SHAPE_PADDING[o][e]}return S.isField(e)&&e instanceof on?o===n.SHAPES.ROUND&&e.field instanceof Wl?t-2.75*n.GRID_UNIT:t-this.constants_.SHAPE_IN_SHAPE_PADDING[o][0]:S.isIcon(e)?this.constants_.SMALL_PADDING:0}finalizeVerticalAlignment_(){if(!this.outputConnection)for(let n=2;n=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!$.precedesStatement;if(e?this.topRow.hasPreviousConnection:c.followsStatement){var o=h.elements[1];if(o=h.elements.length===3&&o instanceof on&&(o.field instanceof hi||o.field instanceof mi),!e&&o)c.height-=this.constants_.SMALL_PADDING,$.height-=this.constants_.SMALL_PADDING,h.height-=this.constants_.MEDIUM_PADDING;else if(!e&&!t)c.height+=this.constants_.SMALL_PADDING;else if(t){for(e=!1,t=0;t{if(!n.isDeadOrDying()){i.disable$$module$build$src$core$events$utils();try{n==null||n.positionNearConnection(c,h,$),n==null||n.getSvgRoot().setAttribute("visibility","visible")}finally{i.enable$$module$build$src$core$events$utils()}}}),c}createInsertionMarker(e){const t=Qt(e,{addCoordinates:!1,addInputBlocks:!1,addNextBlocks:!1,doFullSerialization:!1});if(!t)throw Error(`Failed to serialize source block. ${e.toDevString()}`);e=eo(t,this.workspace);for(const o of e.getDescendants(!1))o.setInsertionMarker(!0);return e.initSvg(),e.getSvgRoot().setAttribute("visibility","hidden"),e}getMatchingConnection(e,t,o){if(e=e.getConnections_(!0),t=t.getConnections_(!0),e.length!==t.length)return null;for(let n=0;n{this.targetWorkspace.isDragging()||t.addSelect()})),this.listeners.push(ct(e,"pointerleave",t,()=>{this.targetWorkspace.isDragging()||t.removeSelect()})),this.listeners.push(ct(o,"pointerenter",t,()=>{this.targetWorkspace.isDragging()||t.addSelect()})),this.listeners.push(ct(o,"pointerleave",t,()=>{this.targetWorkspace.isDragging()||t.removeSelect()}))}blockMouseDown(e){return t=>{const o=this.targetWorkspace.getGesture(t);o&&(o.setStartBlock(e),o.handleFlyoutStart(t,this))}}onMouseDown(e){const t=this.targetWorkspace.getGesture(e);t&&t.handleFlyoutStart(e,this)}isBlockCreatable(e){return e.isEnabled()}createBlock(e){let t=null;i.disable$$module$build$src$core$events$utils();var o=this.targetWorkspace.getAllVariables();this.targetWorkspace.setResizesEnabled(!1);try{t=this.placeNewBlock(e)}finally{i.enable$$module$build$src$core$events$utils()}if(this.targetWorkspace.hideChaff(),e=Hn(this.targetWorkspace,o),K()){for(i.setGroup$$module$build$src$core$events$utils(!0),o=0;o-t||e<-180+t||e>180-t}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const e=this.svgGroup_.getBoundingClientRect(),t=e.left;return this.toolboxPosition_===Ee.LEFT?new qe(-1e9,1e9,-1e9,t+e.width):new qe(-1e9,1e9,t,1e9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let e=0;var t=this.workspace_.getTopBlocks(!1);for(let n=0,c;c=t[n];n++){var o=c.getHeightWidth().width;c.outputConnection&&(o-=this.tabWidth_),e=Math.max(e,o)}for(let n=0,c;c=this.buttons_[n];n++)e=Math.max(e,c.width);if(e+=1.5*this.MARGIN+this.tabWidth_,e*=this.workspace_.scale,e+=mt.scrollbarThickness,this.width_!==e){for(let n=0,c;c=t[n];n++){if(this.RTL){o=c.getRelativeToSurfaceXY().x;let h=e/this.workspace_.scale-this.MARGIN;c.outputConnection||(h-=this.tabWidth_),c.moveBy(h-o,0)}this.rectMap_.has(c)&&this.moveRectToBlock_(this.rectMap_.get(c),c)}if(this.RTL)for(let n=0,c;c=this.buttons_[n];n++)t=c.getPosition().y,c.moveTo(e/this.workspace_.scale-c.width-this.MARGIN-this.tabWidth_,t);this.targetWorkspace.scrollbar||this.autoClose||this.targetWorkspace.getFlyout()!==this||this.toolboxPosition_!==Ee.LEFT||this.targetWorkspace.translate(this.targetWorkspace.scrollX+e,this.targetWorkspace.scrollY),this.width_=e,this.position(),this.targetWorkspace.resizeContents(),this.targetWorkspace.recordDragTargets()}}};Dp.registryName="verticalFlyout",r(F.FLYOUTS_VERTICAL_TOOLBOX,js,Dp);var ry=class extends Vl{constructor(e){super(e),this.horizontalLayout=!0}setMetrics_(e){if(this.isVisible()){var t=this.workspace_.getMetricsManager(),o=t.getScrollMetrics(),n=t.getViewMetrics();t=t.getAbsoluteMetrics(),typeof e.x=="number"&&(this.workspace_.scrollX=-(o.left+(o.width-n.width)*e.x)),this.workspace_.translate(this.workspace_.scrollX+t.left,this.workspace_.scrollY+t.top)}}getX(){return 0}getY(){if(!this.isVisible())return 0;var e=this.targetWorkspace.getMetricsManager();const t=e.getAbsoluteMetrics(),o=e.getViewMetrics();e=e.getToolboxMetrics();const n=this.toolboxPosition_===Ee.TOP;return this.targetWorkspace.toolboxPosition===this.toolboxPosition_?this.targetWorkspace.getToolbox()?n?e.height:o.height-this.height_:n?0:o.height:n?0:o.height+t.top-this.height_}position(){if(this.isVisible()&&this.targetWorkspace.isVisible()){var e=this.targetWorkspace.getMetricsManager().getViewMetrics();this.width_=e.width,this.setBackgroundPath(e.width-2*this.CORNER_RADIUS,this.height_-this.CORNER_RADIUS),e=this.getX();var t=this.getY();this.positionAt_(this.width_,this.height_,e,t)}}setBackgroundPath(e,t){const o=this.toolboxPosition_===Ee.TOP,n=["M 0,"+(o?0:this.CORNER_RADIUS)];o?(n.push("h",e+2*this.CORNER_RADIUS),n.push("v",t),n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,-this.CORNER_RADIUS,this.CORNER_RADIUS),n.push("h",-e),n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,-this.CORNER_RADIUS,-this.CORNER_RADIUS)):(n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,this.CORNER_RADIUS,-this.CORNER_RADIUS),n.push("h",e),n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,this.CORNER_RADIUS,this.CORNER_RADIUS),n.push("v",t),n.push("h",-e-2*this.CORNER_RADIUS)),n.push("z"),this.svgBackground_.setAttribute("d",n.join(" "))}scrollToStart(){let e;(e=this.workspace_.scrollbar)==null||e.setX(this.RTL?1/0:0)}wheel_(e){var t=Zs(e);if(t=t.x||t.y){const o=this.workspace_.getMetricsManager(),n=o.getScrollMetrics();t=o.getViewMetrics().left-n.left+t;let c;(c=this.workspace_.scrollbar)==null||c.setX(t),Yn(this.workspace_),Ns()}e.preventDefault(),e.stopPropagation()}layout_(e,t){this.workspace_.scale=this.targetWorkspace.scale;const o=this.MARGIN;let n=o+this.tabWidth_;this.RTL&&(e=e.reverse());for(let T=0,L;L=e[T];T++)if(L.type==="block"){var c=L.block;if(c==null)continue;var h=c.getDescendants(!1);for(let nt=0,it;it=h[nt];nt++)it.isInFlyout=!0;h=c.getSvgRoot();const te=c.getHeightWidth();var $=c.outputConnection?this.tabWidth_:0;$=this.RTL?n+te.width:n-$,c.moveBy($,o),$=this.createRect_(c,$,o,te,T),n+=te.width+t[T],this.addBlockListeners_(h,c,$)}else L.type==="button"&&(c=L.button,this.initFlyoutButton_(c,n,o),n+=c.width+t[T])}isDragTowardWorkspace(e){e=Math.atan2(e.y,e.x)/Math.PI*180;const t=this.dragAngleRange_;return e<90+t&&e>90-t||e>-90-t&&e<-90+t}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const e=this.svgGroup_.getBoundingClientRect(),t=e.top;return this.toolboxPosition_===Ee.TOP?new qe(-1e9,t+e.height,-1e9,1e9):new qe(t,1e9,-1e9,1e9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let e=0;const t=this.workspace_.getTopBlocks(!1);for(let n=0,c;c=t[n];n++)e=Math.max(e,c.getHeightWidth().height);const o=this.buttons_;for(let n=0,c;c=o[n];n++)e=Math.max(e,c.height);if(e+=1.5*this.MARGIN,e*=this.workspace_.scale,e+=mt.scrollbarThickness,this.height_!==e){for(let n=0,c;c=t[n];n++)this.rectMap_.has(c)&&this.moveRectToBlock_(this.rectMap_.get(c),c);this.targetWorkspace.scrollbar||this.autoClose||this.targetWorkspace.getFlyout()!==this||this.toolboxPosition_!==Ee.TOP||this.targetWorkspace.translate(this.targetWorkspace.scrollX,this.targetWorkspace.scrollY+e),this.height_=e,this.position(),this.targetWorkspace.resizeContents(),this.targetWorkspace.recordDragTargets()}}};r(F.FLYOUTS_HORIZONTAL_TOOLBOX,js,ry);var xr=class extends qt{constructor(e,t,o,n,c){super(Qe.SKIP_SETUP),this.defaultType="",this.variableTypes=[],this.variable=null,this.SERIALIZABLE=!0,this.menuGenerator_=xr.dropdownCreate,this.defaultVariableName=typeof e=="string"?e:"",this.size_=new Le(0,0),e!==Qe.SKIP_SETUP&&(c?this.configure_(c):this.setTypes(o,n),t&&this.setValidator(t))}configure_(e){super.configure_(e),this.setTypes(e.variableTypes,e.defaultType)}initModel(){var e=this.getSourceBlock();if(!e)throw new ft;this.variable||(e=i.getOrCreateVariablePackage$$module$build$src$core$variables(e.workspace,null,this.defaultVariableName,this.defaultType),this.doValueUpdate_(e.getId()))}shouldAddBorderRect_(){const e=this.getSourceBlock();if(!e)throw new ft;return super.shouldAddBorderRect_()&&(!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||e.type!=="variables_get")}fromXml(e){var t=this.getSourceBlock();if(!t)throw new ft;const o=e.getAttribute("id"),n=e.textContent,c=e.getAttribute("variabletype")||e.getAttribute("variableType")||"";if(t=i.getOrCreateVariablePackage$$module$build$src$core$variables(t.workspace,o,n,c),c!==null&&c!==t.type)throw Error("Serialized variable type with id '"+t.getId()+"' had type "+t.type+", and does not match variable field that references it: "+Ls(e)+".");this.setValue(t.getId())}toXml(e){return this.initModel(),e.id=this.variable.getId(),e.textContent=this.variable.name,this.variable.type&&e.setAttribute("variabletype",this.variable.type),e}saveState(e){var t=this.saveLegacyState(xr);return t!==null||(this.initModel(),t={id:this.variable.getId()},e&&(t.name=this.variable.name,t.type=this.variable.type)),t}loadState(e){const t=this.getSourceBlock();if(!t)throw new ft;this.loadLegacyState(xr,e)||(e=i.getOrCreateVariablePackage$$module$build$src$core$variables(t.workspace,e.id||null,e.name,e.type||""),this.setValue(e.getId()))}setSourceBlock(e){if(e.isShadow())throw Error("Variable fields are not allowed to exist on shadow blocks.");super.setSourceBlock(e)}getValue(){return this.variable?this.variable.getId():null}getText(){return this.variable?this.variable.name:""}getVariable(){return this.variable}getValidator(){return this.variable?this.validator_:null}doClassValidation_(e){if(e===null)return null;var t=this.getSourceBlock();if(!t)throw new ft;return t=i.getVariable$$module$build$src$core$variables(t.workspace,e),t?(t=t.type,this.typeIsAllowed(t)?e:(console.warn("Variable type doesn't match this field! Type was "+t),null)):(console.warn("Variable id doesn't point to a real variable! ID was "+e),null)}doValueUpdate_(e){const t=this.getSourceBlock();if(!t)throw new ft;this.variable=i.getVariable$$module$build$src$core$variables(t.workspace,e),super.doValueUpdate_(e)}typeIsAllowed(e){const t=this.getVariableTypes();if(!t)return!0;for(let o=0;othis.max_&&(e.max=`${this.max_}`,It(e,Ct.VALUEMAX,this.max_)),e}static fromJson(e){return new this(e.value,void 0,void 0,void 0,void 0,e)}};Ps("field_number",Ap),Ap.prototype.DEFAULT_VALUE=0;var ay=class extends hi{constructor(e,t,o){super(String(e??""),t,o),this.EDITABLE=!1,this.SERIALIZABLE=!0}static fromJson(e){return new this(pt(e.text),void 0,e)}};Ps("field_label_serializable",ay);var fi=class extends Qe{constructor(e,t,o){super(Qe.SKIP_SETUP),this.SERIALIZABLE=!0,this.CURSOR="default",this.value_=this.value_,this.checkChar=fi.CHECK_CHAR,e!==Qe.SKIP_SETUP&&(o&&this.configure_(o),this.setValue(e),t&&this.setValidator(t))}configure_(e){super.configure_(e),e.checkCharacter&&(this.checkChar=e.checkCharacter)}saveState(){const e=this.saveLegacyState(fi);return e!==null?e:this.getValueBoolean()}initView(){super.initView();const e=this.getTextElement();ge(e,"blocklyCheckbox"),e.style.display=this.value_?"block":"none"}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_(this.getConstants().FIELD_CHECKBOX_X_OFFSET)}getDisplayText_(){return this.checkChar}setCheckCharacter(e){this.checkChar=e||fi.CHECK_CHAR,this.forceRerender()}showEditor_(){this.setValue(!this.value_)}doClassValidation_(e){return e===!0||e==="TRUE"?"TRUE":e===!1||e==="FALSE"?"FALSE":null}doValueUpdate_(e){this.value_=this.convertValueToBool(e),this.textElement_&&(this.textElement_.style.display=this.value_?"block":"none")}getValue(){return this.value_?"TRUE":"FALSE"}getValueBoolean(){return this.value_}getText(){return String(this.convertValueToBool(this.value_))}convertValueToBool(e){return typeof e=="string"?e==="TRUE":!!e}static fromJson(e){return new this(e.checked,void 0,e)}};fi.CHECK_CHAR="✓",Ps("field_checkbox",fi),fi.prototype.DEFAULT_VALUE=!1;var ly=class{constructor(e,t){this.draggable=e,this.workspace=t,this.dragTarget=null,this.startLoc=e.getRelativeToSurfaceXY()}onDragStart(e){this.draggable.startDrag(e)}onDrag(e,t){this.moveDraggable(e,t),t=this.getRoot(this.draggable),ls(t)&&t.setDeleteStyle(this.wouldDeleteDraggable(e,t)),this.updateDragTarget(e)}updateDragTarget(e){e=this.workspace.getDragTarget(e);const t=this.getRoot(this.draggable);if(this.dragTarget!==e){let o;(o=this.dragTarget)==null||o.onDragExit(t),e==null||e.onDragEnter(t)}e==null||e.onDragOver(t),this.dragTarget=e}moveDraggable(e,t){t=this.pixelsToWorkspaceUnits(t),t=G.sum(this.startLoc,t),this.draggable.drag(t,e)}wouldDeleteDraggable(e,t){return(e=this.workspace.getDragTarget(e))&&this.workspace.getComponentManager().hasCapability(e.id,lt.Capability.DELETE_AREA)?e.wouldDelete(t):!1}onDragEnd(e){const t=i.getGroup$$module$build$src$core$events$utils();var o=this.workspace.getDragTarget(e);const n=this.getRoot(this.draggable);if(o){let c;(c=this.dragTarget)==null||c.onDrop(n)}this.shouldReturnToStart(e,n)&&this.draggable.revertDrag(),(o=ls(n)&&this.wouldDeleteDraggable(e,n))&&this.draggable instanceof gs&&za(this.draggable.getRootBlock()),this.draggable.endDrag(e),o&&ls(n)&&(e=i.getGroup$$module$build$src$core$events$utils(),i.setGroup$$module$build$src$core$events$utils(t),n.dispose(),i.setGroup$$module$build$src$core$events$utils(e))}getRoot(e){return e instanceof gs?e.getRootBlock():e}shouldReturnToStart(e,t){return(e=this.workspace.getDragTarget(e))?e.shouldPreventMove(t):!1}pixelsToWorkspaceUnits(e){return e=new G(e.x/this.workspace.scale,e.y/this.workspace.scale),this.workspace.isMutator&&e.scale(1/this.workspace.options.parentWorkspace.scale),e}};r(F.BLOCK_DRAGGER,js,ly);var Dr={};Dr.BlockDragStrategy=Pv,Dr.BubbleDragStrategy=vv,Dr.CommentDragStrategy=pv,Dr.Dragger=ly;var Rp=class extends Cs{constructor(e,t,o){super(e?e.workspace.id:void 0),this.type=O.BLOCK_DRAG,e&&(this.blockId=e.id,this.isStart=t,this.blocks=o)}toJson(){const e=super.toJson();if(this.isStart===void 0)throw Error("Whether this event is the start of a drag is undefined. Either pass the value to the constructor, or call fromJson");if(this.blockId===void 0)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");return e.isStart=this.isStart,e.blockId=this.blockId,e.blocks=this.blocks,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Rp),t.isStart=e.isStart,t.blockId=e.blockId,t.blocks=e.blocks,t}};r(F.EVENT,O.BLOCK_DRAG,Rp);var Op=class extends ni{constructor(e,t,o,n){super(e),this.type=O.BLOCK_FIELD_INTERMEDIATE_CHANGE,this.recordUndo=!1,e&&(this.name=t,this.oldValue=o,this.newValue=n)}toJson(){const e=super.toJson();if(!this.name)throw Error("The changed field name is undefined. Either pass a name to the constructor, or call fromJson.");return e.name=this.name,e.oldValue=this.oldValue,e.newValue=this.newValue,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Op),t.name=e.name,t.oldValue=e.oldValue,t.newValue=e.newValue,t}isNull(){return this.oldValue===this.newValue}run(e){var t=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");if(t=t.getBlockById(this.blockId),!t)throw Error("The associated block is undefined. Either pass a block to the constructor, or call fromJson");e=e?this.newValue:this.oldValue,(t=t.getField(this.name))?t.setValue(e):console.warn("Can't set non-existent field: "+this.name)}};r(F.EVENT,O.BLOCK_FIELD_INTERMEDIATE_CHANGE,Op);var Mp=class extends ni{constructor(e){super(e),this.type=O.BLOCK_MOVE,e&&(e.isShadow()&&(this.recordUndo=!1),e=this.currentLocation(),this.oldParentId=e.parentId,this.oldInputName=e.inputName,this.oldCoordinate=e.coordinate)}toJson(){const e=super.toJson();return e.oldParentId=this.oldParentId,e.oldInputName=this.oldInputName,this.oldCoordinate&&(e.oldCoordinate=`${Math.round(this.oldCoordinate.x)}, ${Math.round(this.oldCoordinate.y)}`),e.newParentId=this.newParentId,e.newInputName=this.newInputName,this.newCoordinate&&(e.newCoordinate=`${Math.round(this.newCoordinate.x)}, ${Math.round(this.newCoordinate.y)}`),this.reason&&(e.reason=this.reason),this.recordUndo||(e.recordUndo=this.recordUndo),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Mp),t.oldParentId=e.oldParentId,t.oldInputName=e.oldInputName,e.oldCoordinate&&(o=e.oldCoordinate.split(","),t.oldCoordinate=new G(Number(o[0]),Number(o[1]))),t.newParentId=e.newParentId,t.newInputName=e.newInputName,e.newCoordinate&&(o=e.newCoordinate.split(","),t.newCoordinate=new G(Number(o[0]),Number(o[1]))),e.reason!==void 0&&(t.reason=e.reason),e.recordUndo!==void 0&&(t.recordUndo=e.recordUndo),t}recordNew(){const e=this.currentLocation();this.newParentId=e.parentId,this.newInputName=e.inputName,this.newCoordinate=e.coordinate}setReason(e){this.reason=e}currentLocation(){var e=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");var t=e.getBlockById(this.blockId);if(!t)throw Error("The block associated with the block move event could not be found");e={};const o=t.getParent();return o?(e.parentId=o.id,(t=o.getInputWithBlock(t))&&(e.inputName=t.name)):e.coordinate=t.getRelativeToSurfaceXY(),e}isNull(){return this.oldParentId===this.newParentId&&this.oldInputName===this.newInputName&&G.equals(this.oldCoordinate,this.newCoordinate)}run(e){var t=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");var o=t.getBlockById(this.blockId);if(o){var n=e?this.newParentId:this.oldParentId,c=e?this.newInputName:this.oldInputName;if(e=e?this.newCoordinate:this.oldCoordinate,n){var h=t.getBlockById(n);if(!h){console.warn("Can't connect to non-existent block: "+n);return}}if(o.getParent()&&o.unplug(),e)c=o.getRelativeToSurfaceXY(),o.moveBy(e.x-c.x,e.y-c.y,this.reason);else{t=o.outputConnection,(!t||o.previousConnection&&o.previousConnection.isConnected())&&(t=o.previousConnection);let $,T;o=(T=t)==null?void 0:T.type,c?(o=h.getInput(c))&&($=o.connection):o===oe.PREVIOUS_STATEMENT&&($=h.nextConnection),$&&t?t.connect($):console.warn("Can't connect to non-existent input: "+c)}}else console.warn("Can't move non-existent block: "+this.blockId)}};r(F.EVENT,O.BLOCK_MOVE,Mp);var Np=class extends Cs{constructor(e,t,o){super(e?e.workspace.id:void 0),this.type=O.BUBBLE_OPEN,e&&(this.blockId=e.id,this.isOpen=t,this.bubbleType=o)}toJson(){const e=super.toJson();if(this.isOpen===void 0)throw Error("Whether this event is for opening the bubble is undefined. Either pass the value to the constructor, or call fromJson");if(!this.bubbleType)throw Error("The type of bubble is undefined. Either pass the value to the constructor, or call fromJson");return e.isOpen=this.isOpen,e.bubbleType=this.bubbleType,e.blockId=this.blockId||"",e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Np),t.isOpen=e.isOpen,t.bubbleType=e.bubbleType,t.blockId=e.blockId,t}},Lp;(function(e){e.MUTATOR="mutator",e.COMMENT="comment",e.WARNING="warning"})(Lp||(Lp={})),r(F.EVENT,O.BUBBLE_OPEN,Np);var Gs=class extends Ui{constructor(e){super(),this.isBlank=!e,e&&(this.commentId=e.id,this.workspaceId=e.workspace.id,this.group=i.getGroup$$module$build$src$core$events$utils(),this.recordUndo=me())}toJson(){const e=super.toJson();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");return e.commentId=this.commentId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Gs),t.commentId=e.commentId,t}static CommentCreateDeleteHelper(e,t){const o=e.getEventWorkspace_();if(t){if(!e.json)throw Error("Encountered a comment event without proper json");Fn(e.json,o)}else{if(!e.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");(t=o.getCommentById(e.commentId))?t.dispose():console.warn("Can't delete non-existent comment: "+e.commentId)}}},Pp=class extends Gs{constructor(e,t,o){super(e),this.type=O.COMMENT_CHANGE,e&&(this.oldContents_=typeof t>"u"?"":t,this.newContents_=typeof o>"u"?"":o)}toJson(){const e=super.toJson();if(!this.oldContents_)throw Error("The old contents is undefined. Either pass a value to the constructor, or call fromJson");if(!this.newContents_)throw Error("The new contents is undefined. Either pass a value to the constructor, or call fromJson");return e.oldContents=this.oldContents_,e.newContents=this.newContents_,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Pp),t.oldContents_=e.oldContents,t.newContents_=e.newContents,t}isNull(){return this.oldContents_===this.newContents_}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(t=t.getCommentById(this.commentId)){var o=e?this.newContents_:this.oldContents_;if(o===void 0)throw Error(e?"The new contents is undefined. Either pass a value to the constructor, or call fromJson":"The old contents is undefined. Either pass a value to the constructor, or call fromJson");t.setText(o)}else console.warn("Can't change non-existent comment: "+this.commentId)}};r(F.EVENT,O.COMMENT_CHANGE,Pp);var Bp=class extends Gs{constructor(e,t){super(e),this.newCollapsed=t,this.type=O.COMMENT_COLLAPSE}toJson(){const e=super.toJson();if(this.newCollapsed===void 0)throw Error("The new collapse value undefined. Either call recordNew, or call fromJson");return e.newCollapsed=this.newCollapsed,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Bp),t.newCollapsed=e.newCollapsed,t}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");(t=t.getCommentById(this.commentId))?t.setCollapsed(e?!!this.newCollapsed:!this.newCollapsed):console.warn("Can't collapse or uncollapse non-existent comment: "+this.commentId)}};r(F.EVENT,O.COMMENT_COLLAPSE,Bp);var jp=class extends Gs{constructor(e){super(e),this.type=O.COMMENT_CREATE,e&&(this.xml=Xn(e),this.json=xi(e,{addCoordinates:!0}))}toJson(){const e=super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.json)throw Error("The comment JSON is undefined. Either pass a block to the constructor, or call fromJson");return e.xml=Ls(this.xml),e.json=this.json,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new jp),t.xml=i.textToDom$$module$build$src$core$utils$xml(e.xml),t.json=e.json,t}run(e){Gs.CommentCreateDeleteHelper(this,e)}};r(F.EVENT,O.COMMENT_CREATE,jp);var Fp=class extends Gs{constructor(e){super(e),this.type=O.COMMENT_DELETE,e&&(this.xml=Xn(e),this.json=xi(e,{addCoordinates:!0}))}run(e){Gs.CommentCreateDeleteHelper(this,!e)}toJson(){const e=super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.json)throw Error("The comment JSON is undefined. Either pass a block to the constructor, or call fromJson");return e.xml=Ls(this.xml),e.json=this.json,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Fp),t.xml=i.textToDom$$module$build$src$core$utils$xml(e.xml),t.json=e.json,t}};r(F.EVENT,O.COMMENT_DELETE,Fp);var zp=class extends Cs{constructor(e,t){super(e?e.workspace.id:void 0),this.type=O.COMMENT_DRAG,e&&(this.commentId=e.id,this.isStart=t)}toJson(){const e=super.toJson();if(this.isStart===void 0)throw Error("Whether this event is the start of a drag is undefined. Either pass the value to the constructor, or call fromJson");if(this.commentId===void 0)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");return e.isStart=this.isStart,e.commentId=this.commentId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new zp),t.isStart=e.isStart,t.commentId=e.commentId,t}};r(F.EVENT,O.COMMENT_DRAG,zp);var Up=class extends Gs{constructor(e){super(e),this.type=O.COMMENT_MOVE,e&&(this.comment_=e,this.oldCoordinate_=e.getRelativeToSurfaceXY())}recordNew(){if(this.newCoordinate_)throw Error("Tried to record the new position of a comment on the same event twice.");if(!this.comment_)throw Error("The comment is undefined. Pass a comment to the constructor if you want to use the record functionality");this.newCoordinate_=this.comment_.getRelativeToSurfaceXY()}setReason(e){this.reason=e}setOldCoordinate(e){this.oldCoordinate_=e}toJson(){const e=super.toJson();if(!this.oldCoordinate_)throw Error("The old comment position is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.newCoordinate_)throw Error("The new comment position is undefined. Either call recordNew, or call fromJson");return e.oldCoordinate=`${Math.round(this.oldCoordinate_.x)}, ${Math.round(this.oldCoordinate_.y)}`,e.newCoordinate=Math.round(this.newCoordinate_.x)+","+Math.round(this.newCoordinate_.y),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Up),o=e.oldCoordinate.split(","),t.oldCoordinate_=new G(Number(o[0]),Number(o[1])),o=e.newCoordinate.split(","),t.newCoordinate_=new G(Number(o[0]),Number(o[1])),t}isNull(){return G.equals(this.oldCoordinate_,this.newCoordinate_)}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(t=t.getCommentById(this.commentId)){if(e=e?this.newCoordinate_:this.oldCoordinate_,!e)throw Error("Either oldCoordinate_ or newCoordinate_ is undefined. Either pass a comment to the constructor and call recordNew, or call fromJson");t.moveTo(e)}else console.warn("Can't move non-existent comment: "+this.commentId)}};r(F.EVENT,O.COMMENT_MOVE,Up);var Hp=class extends Gs{constructor(e){super(e),this.type=O.COMMENT_RESIZE,e&&(this.oldSize=e.getSize())}recordCurrentSizeAsNewSize(){if(this.newSize)throw Error("Tried to record the new size of a comment on the same event twice.");var e=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(e=e.getCommentById(this.commentId),!e)throw Error("The comment associated with the comment resize event could not be found");this.newSize=e.getSize()}toJson(){const e=super.toJson();if(!this.oldSize)throw Error("The old comment size is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.newSize)throw Error("The new comment size is undefined. Either call recordCurrentSizeAsNewSize, or call fromJson");return e.oldWidth=Math.round(this.oldSize.width),e.oldHeight=Math.round(this.oldSize.height),e.newWidth=Math.round(this.newSize.width),e.newHeight=Math.round(this.newSize.height),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Hp),t.oldSize=new Le(e.oldWidth,e.oldHeight),t.newSize=new Le(e.newWidth,e.newHeight),t}isNull(){return Le.equals(this.oldSize,this.newSize)}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(t=t.getCommentById(this.commentId)){if(e=e?this.newSize:this.oldSize,!e)throw Error("Either oldSize or newSize is undefined. Either pass a comment to the constructor and call recordCurrentSizeAsNewSize, or call fromJson");t.setSize(e)}else console.warn("Can't resize non-existent comment: "+this.commentId)}};r(F.EVENT,O.COMMENT_RESIZE,Hp);var Wp=class extends Cs{constructor(e,t,o){super(o),this.type=O.TOOLBOX_ITEM_SELECT,this.oldItem=e??void 0,this.newItem=t??void 0}toJson(){const e=super.toJson();return e.oldItem=this.oldItem,e.newItem=this.newItem,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Wp),t.oldItem=e.oldItem,t.newItem=e.newItem,t}};r(F.EVENT,O.TOOLBOX_ITEM_SELECT,Wp);var cy=class extends Ui{constructor(e){super(),this.isBlank=!0,this.recordUndo=!1,this.type=O.FINISHED_LOADING,this.isBlank=!!e,e&&(this.workspaceId=e.id)}};r(F.EVENT,O.FINISHED_LOADING,cy);var uy,dy,hy,py,gy,my,fy,$y,by,vy,yy,_y,wy,Cy,Ty,ky,Sy,Ey,Iy,xy,Dy,Ay,Ry,Oy,My,Q;i.BLOCK_CHANGE$$module$build$src$core$events$events=O.BLOCK_CHANGE,i.BLOCK_CREATE$$module$build$src$core$events$events=O.BLOCK_CREATE,i.BLOCK_DELETE$$module$build$src$core$events$events=O.BLOCK_DELETE,uy=O.BLOCK_DRAG,i.BLOCK_MOVE$$module$build$src$core$events$events=O.BLOCK_MOVE,dy=O.BLOCK_FIELD_INTERMEDIATE_CHANGE,hy=O.BUBBLE_OPEN,py=O.BLOCK_CHANGE,gy=O.CLICK,my=O.COMMENT_CHANGE,fy=O.COMMENT_CREATE,$y=O.COMMENT_DELETE,by=O.COMMENT_MOVE,vy=O.COMMENT_RESIZE,yy=O.COMMENT_DRAG,_y=O.BLOCK_CREATE,wy=O.BLOCK_DELETE,Cy=O.FINISHED_LOADING,Ty=O.MARKER_MOVE,ky=O.BLOCK_MOVE,Sy=O.SELECTED,Ey=O.THEME_CHANGE,Iy=O.TOOLBOX_ITEM_SELECT,xy=O.TRASHCAN_OPEN,Dy=O.UI,Ay=O.VAR_CREATE,Ry=O.VAR_DELETE,Oy=O.VAR_RENAME,My=O.VIEWPORT_CHANGE,Q={},Q.Abstract=Ui,Q.BLOCK_CHANGE=i.BLOCK_CHANGE$$module$build$src$core$events$events,Q.BLOCK_CREATE=i.BLOCK_CREATE$$module$build$src$core$events$events,Q.BLOCK_DELETE=i.BLOCK_DELETE$$module$build$src$core$events$events,Q.BLOCK_DRAG=uy,Q.BLOCK_FIELD_INTERMEDIATE_CHANGE=dy,Q.BLOCK_MOVE=i.BLOCK_MOVE$$module$build$src$core$events$events,Q.BUBBLE_OPEN=hy,Q.BUMP_EVENTS=ub,Q.BlockBase=ni,Q.BlockChange=ri,Q.BlockCreate=Xh,Q.BlockDelete=up,Q.BlockDrag=Rp,Q.BlockFieldIntermediateChange=Op,Q.BlockMove=Mp,Q.BubbleOpen=Np,Q.BubbleType=Lp,Q.CHANGE=py,Q.CLICK=gy,Q.COMMENT_CHANGE=my,Q.COMMENT_CREATE=fy,Q.COMMENT_DELETE=$y,Q.COMMENT_DRAG=yy,Q.COMMENT_MOVE=by,Q.COMMENT_RESIZE=vy,Q.CREATE=_y,Q.Click=fh,Q.ClickTarget=$h,Q.CommentBase=Gs,Q.CommentChange=Pp,Q.CommentCollapse=Bp,Q.CommentCreate=jp,Q.CommentDelete=Fp,Q.CommentDrag=zp,Q.CommentMove=Up,Q.CommentResize=Hp,Q.DELETE=wy,Q.FINISHED_LOADING=Cy,Q.FinishedLoading=cy,Q.MARKER_MOVE=Ty,Q.MOVE=ky,Q.MarkerMove=dp,Q.SELECTED=Sy,Q.Selected=vp,Q.THEME_CHANGE=Ey,Q.TOOLBOX_ITEM_SELECT=Iy,Q.TRASHCAN_OPEN=xy,Q.ThemeChange=Zh,Q.ToolboxItemSelect=Wp,Q.TrashcanOpen=_p,Q.UI=Dy,Q.UiBase=Cs,Q.VAR_CREATE=Ay,Q.VAR_DELETE=Ry,Q.VAR_RENAME=Oy,Q.VIEWPORT_CHANGE=My,Q.VarBase=dr,Q.VarCreate=Ph,Q.VarDelete=fp,Q.VarRename=$p,Q.ViewportChange=Qh,Q.clearPendingUndo=ce,Q.disable=i.disable$$module$build$src$core$events$utils,Q.disableOrphans=tt,Q.enable=i.enable$$module$build$src$core$events$utils,Q.filter=ae,Q.fire=z,Q.fromJson=je,Q.get=V,Q.getDescendantIds=he,Q.getGroup=i.getGroup$$module$build$src$core$events$utils,Q.getRecordUndo=me,Q.isEnabled=K,Q.setGroup=i.setGroup$$module$build$src$core$events$utils,Q.setRecordUndo=i.setRecordUndo$$module$build$src$core$events$utils;var xs={};xs.BottomRow=qv,xs.ConstantProvider=Yv,xs.Drawer=Jv,xs.MarkerSvg=ey,xs.PathObject=ty,xs.RenderInfo=Qv,xs.Renderer=xp,xs.RightConnectionShape=Xv,xs.StatementInput=Gl,xs.TopRow=Zv,hh();var Tt={};Tt.registerCleanup=qd,Tt.registerCollapse=Zd,Tt.registerCollapseExpandBlock=nh,Tt.registerComment=oh,Tt.registerCommentCreate=dh,Tt.registerCommentDelete=ch,Tt.registerCommentDuplicate=uh,Tt.registerCommentOptions=ib,Tt.registerDefaultOptions=hh,Tt.registerDelete=ah,Tt.registerDeleteAll=th,Tt.registerDisable=rh,Tt.registerDuplicate=sh,Tt.registerExpand=Qd,Tt.registerHelp=lh,Tt.registerInline=ih,Tt.registerRedo=Jd,Tt.registerUndo=Yd;var Kl={};Kl.CommentView=mv,Kl.RenderedWorkspaceComment=kl,Kl.WorkspaceComment=Tl;var Ar={};Ar.Bubble=Ye,Ar.MiniWorkspaceBubble=uo,Ar.TextBubble=kv,Ar.TextInputBubble=yv;var Ny=class extends Ml{constructor(){super(),this.FIELD_TEXT_BASELINE_CENTER=!1,this.DARK_PATH_OFFSET=1,this.MAX_BOTTOM_WIDTH=30,this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT/2}getCSS_(e){return super.getCSS_(e).concat([`${e} .blocklyInsertionMarker>.blocklyPathLight,`,`${e} .blocklyInsertionMarker>.blocklyPathDark {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"])}},Ly=class{constructor(e){this.inlineSteps_=this.steps_="",this.info_=e,this.RTL_=this.info_.RTL,e=e.getRenderer(),this.constants_=e.getConstants(),this.highlightConstants_=e.getHighlightConstants(),this.highlightOffset=this.highlightConstants_.OFFSET,this.outsideCornerPaths_=this.highlightConstants_.OUTSIDE_CORNER,this.insideCornerPaths_=this.highlightConstants_.INSIDE_CORNER,this.puzzleTabPaths_=this.highlightConstants_.PUZZLE_TAB,this.notchPaths_=this.highlightConstants_.NOTCH,this.startPaths_=this.highlightConstants_.START_HAT,this.jaggedTeethPaths_=this.highlightConstants_.JAGGED_TEETH}getPath(){return this.steps_+` -`+this.inlineSteps_}drawTopCorner(e){this.steps_+=at(e.xPos,this.info_.startY);for(let t=0,o;o=e.elements[t];t++)S.isLeftSquareCorner(o)?this.steps_+=this.highlightConstants_.START_POINT:S.isLeftRoundedCorner(o)?this.steps_+=this.outsideCornerPaths_.topLeft(this.RTL_):S.isPreviousConnection(o)?this.steps_+=this.notchPaths_.pathLeft:S.isHat(o)?this.steps_+=this.startPaths_.path(this.RTL_):S.isSpacer(o)&&o.width!==0&&(this.steps_+=ne("H",o.xPos+o.width-this.highlightOffset));this.steps_+=ne("H",e.xPos+e.width-this.highlightOffset)}drawJaggedEdge_(e){this.info_.RTL&&(this.steps_+=this.jaggedTeethPaths_.pathLeft+ne("v",e.height-this.jaggedTeethPaths_.height-this.highlightOffset))}drawValueInput(e){const t=e.getLastInput();if(this.RTL_){const o=e.height-t.connectionHeight;this.steps_+=wt(t.xPos+t.width-this.highlightOffset,e.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)+ne("v",o)}else this.steps_+=wt(t.xPos+t.width,e.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)}drawStatementInput(e){const t=e.getLastInput();if(t)if(this.RTL_){const o=e.height-2*this.insideCornerPaths_.height;this.steps_+=wt(t.xPos,e.yPos)+this.insideCornerPaths_.pathTop(this.RTL_)+ne("v",o)+this.insideCornerPaths_.pathBottom(this.RTL_)+Bs(e.width-t.xPos-this.insideCornerPaths_.width,0)}else this.steps_+=wt(t.xPos,e.yPos+e.height)+this.insideCornerPaths_.pathBottom(this.RTL_)+Bs(e.width-t.xPos-this.insideCornerPaths_.width,0)}drawRightSideRow(e){const t=e.xPos+e.width-this.highlightOffset;e instanceof lp&&e.followsStatement&&(this.steps_+=ne("H",t)),this.RTL_&&(this.steps_+=ne("H",t),e.height>this.highlightOffset&&(this.steps_+=ne("V",e.yPos+e.height-this.highlightOffset)))}drawBottomRow(e){if(this.RTL_)this.steps_+=ne("V",e.baseline-this.highlightOffset);else{const t=this.info_.bottomRow.elements[0];S.isLeftSquareCorner(t)?this.steps_+=wt(e.xPos+this.highlightOffset,e.baseline-this.highlightOffset):S.isLeftRoundedCorner(t)&&(this.steps_+=wt(e.xPos,e.baseline),this.steps_+=this.outsideCornerPaths_.bottomLeft())}}drawLeft(){var e=this.info_.outputConnection;e&&(e=e.connectionOffsetY+e.height,this.RTL_?this.steps_+=wt(this.info_.startX,e):(this.steps_+=wt(this.info_.startX+this.highlightOffset,this.info_.bottomRow.baseline-this.highlightOffset),this.steps_+=ne("V",e)),this.steps_+=this.puzzleTabPaths_.pathUp(this.RTL_)),this.RTL_||(e=this.info_.topRow,S.isLeftRoundedCorner(e.elements[0])?this.steps_+=ne("V",this.outsideCornerPaths_.height):this.steps_+=ne("V",e.capline+this.highlightOffset))}drawInlineInput(e){const t=this.highlightOffset,o=e.xPos+e.connectionWidth;var n=e.centerline-e.height/2;const c=e.width-e.connectionWidth,h=n+t;this.RTL_?(n=e.connectionOffsetY-t,e=e.height-(e.connectionOffsetY+e.connectionHeight)+t,this.inlineSteps_+=wt(o-t,h)+ne("v",n)+this.puzzleTabPaths_.pathDown(this.RTL_)+ne("v",e)+ne("h",c)):this.inlineSteps_+=wt(e.xPos+e.width+t,h)+ne("v",e.height)+ne("h",-c)+wt(o,n+e.connectionOffsetY)+this.puzzleTabPaths_.pathDown(this.RTL_)}},Py=class extends Nl{constructor(e,t){super(e,t),this.highlighter_=new Ly(t)}draw(){this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights();const e=this.block_.pathObject;e.setPath(this.outlinePath_+` -`+this.inlinePath_),e.setHighlightPath(this.highlighter_.getPath()),this.info_.RTL&&e.flipRTL(),this.recordSizeOnBlock_()}drawTop_(){this.highlighter_.drawTopCorner(this.info_.topRow),this.highlighter_.drawRightSideRow(this.info_.topRow),super.drawTop_()}drawJaggedEdge_(e){this.highlighter_.drawJaggedEdge_(e),super.drawJaggedEdge_(e)}drawValueInput_(e){this.highlighter_.drawValueInput(e),super.drawValueInput_(e)}drawStatementInput_(e){this.highlighter_.drawStatementInput(e),super.drawStatementInput_(e)}drawRightSideRow_(e){this.highlighter_.drawRightSideRow(e),this.outlinePath_+=ne("H",e.xPos+e.width)+ne("V",e.yPos+e.height)}drawBottom_(){this.highlighter_.drawBottomRow(this.info_.bottomRow),super.drawBottom_()}drawLeft_(){this.highlighter_.drawLeft(),super.drawLeft_()}drawInlineInput_(e){this.highlighter_.drawInlineInput(e),super.drawInlineInput_(e)}positionInlineInputConnection_(e){const t=e.centerline-e.height/2;if(e.connectionModel){let o=e.xPos+e.connectionWidth+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(o*=-1),e.connectionModel.setOffsetInBlock(o,t+e.connectionOffsetY+this.constants_.DARK_PATH_OFFSET)}}positionStatementInputConnection_(e){const t=e.getLastInput();if(t!=null&&t.connectionModel){let o=e.xPos+e.statementEdge+t.notchOffset;o=this.info_.RTL?-1*o:o+this.constants_.DARK_PATH_OFFSET,t.connectionModel.setOffsetInBlock(o,e.yPos+this.constants_.DARK_PATH_OFFSET)}}positionExternalValueConnection_(e){const t=e.getLastInput();if(t&&t.connectionModel){let o=e.xPos+e.width+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(o*=-1),t.connectionModel.setOffsetInBlock(o,e.yPos)}}positionNextConnection_(){const e=this.info_.bottomRow;if(e.connection){const t=e.connection,o=t.xPos;t.connectionModel.setOffsetInBlock((this.info_.RTL?-o:o)+this.constants_.DARK_PATH_OFFSET/2,e.baseline+this.constants_.DARK_PATH_OFFSET)}}},By=class{constructor(e){this.OFFSET=.5,this.constantProvider=e,this.START_POINT=at(this.OFFSET,this.OFFSET)}init(){this.INSIDE_CORNER=this.makeInsideCorner(),this.OUTSIDE_CORNER=this.makeOutsideCorner(),this.PUZZLE_TAB=this.makePuzzleTab(),this.NOTCH=this.makeNotch(),this.JAGGED_TEETH=this.makeJaggedTeeth(),this.START_HAT=this.makeStartHat()}makeInsideCorner(){const e=this.constantProvider.CORNER_RADIUS,t=this.OFFSET,o=(1-Math.SQRT1_2)*(e+t)-t,n=at(o,o)+gt("a","0 0,0",e,ue(-o-t,e-o)),c=gt("a","0 0,0",e+t,ue(e+t,e+t)),h=at(o,-o)+gt("a","0 0,0",e+t,ue(e-o,o+t));return{width:e+t,height:e,pathTop($){return $?n:""},pathBottom($){return $?c:h}}}makeOutsideCorner(){const e=this.constantProvider.CORNER_RADIUS,t=this.OFFSET,o=(1-Math.SQRT1_2)*(e-t)+t,n=at(o,o)+gt("a","0 0,1",e-t,ue(e-o,-o+t)),c=at(t,e)+gt("a","0 0,1",e-t,ue(e,-e+t)),h=-o,$=at(o,h)+gt("a","0 0,1",e-t,ue(-o+t,-h-e));return{height:e,topLeft(T){return T?n:c},bottomLeft(){return $}}}makePuzzleTab(){const e=this.constantProvider.TAB_WIDTH,t=this.constantProvider.TAB_HEIGHT,o=at(-2,-t+3.4)+Bs(-.45*e,-2.1),n=ne("v",2.5)+at(.97*-e,2.5)+Yt("q",[ue(.05*-e,10),ue(.3*e,9.5)])+at(.67*e,-1.9)+ne("v",2.5),c=ne("v",-1.5)+at(-.92*e,-.5)+Yt("q",[ue(-.19*e,-5.5),ue(0,-11)])+at(.92*e,1),h=at(-5,t-.7)+Bs(.46*e,-2.1);return{width:e,height:t,pathUp($){return $?o:c},pathDown($){return $?n:h}}}makeNotch(){return{pathLeft:ne("h",this.OFFSET)+this.constantProvider.NOTCH.pathLeft}}makeJaggedTeeth(){return{pathLeft:Bs(5.1,2.6)+at(-10.2,6.8)+Bs(5.1,2.6),height:12,width:10.2}}makeStartHat(){const e=this.constantProvider.START_HAT.height,t=at(25,-8.7)+Yt("c",[ue(29.7,-6.2),ue(57.2,-.5),ue(75,8.7)]),o=Yt("c",[ue(17.8,-9.2),ue(45.3,-14.9),ue(75,-8.7)])+wt(100.5,e+.5);return{path(n){return n?t:o}}}},jy=class extends rp{constructor(e,t){super(e,t),this.constants_=e,this.connectedBlock&&(this.width+=this.constants_.DARK_PATH_OFFSET,this.height+=this.constants_.DARK_PATH_OFFSET)}},Fy=class extends wr{constructor(e,t){super(e,t),this.constants_=e,this.connectedBlock&&(this.height+=this.constants_.DARK_PATH_OFFSET)}},zy=class extends kr{constructor(e,t){super(e,t),this.renderer_=e}getRenderer(){return this.renderer_}populateBottomRow_(){super.populateBottomRow_(),this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1]instanceof is||(this.bottomRow.minHeight=this.constants_.MEDIUM_PADDING-this.constants_.DARK_PATH_OFFSET)}addInput_(e,t){this.isInline&&e instanceof i.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new jy(this.constants_,e)),t.hasInlineInput=!0):e instanceof is?(t.elements.push(new Fy(this.constants_,e)),t.hasStatement=!0):e instanceof i.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new Ol(this.constants_,e)),t.hasExternalInput=!0):(e instanceof Us||e instanceof fo)&&(t.minHeight=Math.max(t.minHeight,this.constants_.DUMMY_INPUT_MIN_HEIGHT),t.hasDummyInput=!0),this.isInline||t.align!==null||(t.align=e.align)}addElemSpacing_(){let e=!1;for(let o=0,n;n=this.rows[o];o++)n.hasExternalInput&&(e=!0);for(let o=0,n;n=this.rows[o];o++){var t=n.elements;if(n.elements=[],n.startsWithElemSpacer()&&n.elements.push(new os(this.constants_,this.getInRowSpacing_(null,t[0]))),t.length){for(let c=0;c>>/sprites.png); - height: 16px; - vertical-align: middle; - visibility: hidden; - width: 16px; -} - -.blocklyTreeIconClosed { - background-position: -32px -1px; -} - -.blocklyToolboxDiv[dir="RTL"] .blocklyTreeIconClosed { - background-position: 0 -1px; -} - -.blocklyTreeSelected>.blocklyTreeIconClosed { - background-position: -32px -17px; -} - -.blocklyToolboxDiv[dir="RTL"] .blocklyTreeSelected>.blocklyTreeIconClosed { - background-position: 0 -17px; -} - -.blocklyTreeIconOpen { - background-position: -16px -1px; -} - -.blocklyTreeSelected>.blocklyTreeIconOpen { - background-position: -16px -17px; -} - -.blocklyTreeLabel { - cursor: default; - font: 16px sans-serif; - padding: 0 3px; - vertical-align: middle; -} - -.blocklyToolboxDelete .blocklyTreeLabel { - cursor: url("<<>>/handdelete.cur"), auto; -} - -.blocklyTreeSelected .blocklyTreeLabel { - color: #fff; -} -`),r(F.TOOLBOX_ITEM,Ds.registrationName,Ds);var Rr=class extends Vp{constructor(e,t){super(e,t),this.cssConfig_={container:"blocklyTreeSeparator"},this.htmlDiv=null,Object.assign(this.cssConfig_,e.cssconfig||e.cssConfig)}init(){this.createDom_()}createDom_(){const e=document.createElement("div"),t=this.cssConfig_.container;return t&&ge(e,t),this.htmlDiv=e}getDiv(){return this.htmlDiv}dispose(){Ke(this.htmlDiv)}};Rr.registrationName="sep",Et(` -.blocklyTreeSeparator { - border-bottom: solid #e5e5e5 1px; - height: 0; - margin: 5px 0; -} - -.blocklyToolboxDiv[layout="h"] .blocklyTreeSeparator { - border-right: solid #e5e5e5 1px; - border-bottom: none; - height: auto; - margin: 0 5px 0 5px; - padding: 5px 0; - width: 0; -} -`),r(F.TOOLBOX_ITEM,Rr.registrationName,Rr);var dn=class extends Ds{constructor(e,t,o){super(e,t,o),this.subcategoriesDiv_=null,this.expanded_=!1,this.toolboxItems_=[]}makeDefaultCssConfig_(){const e=super.makeDefaultCssConfig_();return e.contents="blocklyToolboxContents",e}parseContents_(e){if("custom"in e)this.flyoutItems_=e.custom;else{const t=e.contents;if(t){this.flyoutItems_=[],e=!0;for(let o=0;o>>/handdelete.cur"), auto; -} - -.blocklyToolboxGrab { - cursor: url("<<>>/handclosed.cur"), auto; - cursor: grabbing; - cursor: -webkit-grabbing; -} - -/* Category tree in Toolbox. */ -.blocklyToolboxDiv { - background-color: #ddd; - overflow-x: visible; - overflow-y: auto; - padding: 4px 0 4px 0; - position: absolute; - z-index: 70; /* so blocks go under toolbox when dragging */ - -webkit-tap-highlight-color: transparent; /* issue #1345 */ -} - -.blocklyToolboxContents { - display: flex; - flex-wrap: wrap; - flex-direction: column; -} - -.blocklyToolboxContents:focus { - outline: none; -} -`),r(F.TOOLBOX,js,Vy);var fk="11.2.2",$k=oe.INPUT_VALUE,bk=oe.OUTPUT_VALUE,vk=oe.NEXT_STATEMENT,yk=oe.PREVIOUS_STATEMENT,_k=Ee.TOP,wk=Ee.BOTTOM,Ck=Ee.LEFT,Tk=Ee.RIGHT;rn.prototype.newBlock=function(e,t){return new Oo(this,e,t)},ns.prototype.newBlock=function(e,t){return new gs(this,e,t)},rn.prototype.newComment=function(e){return new Tl(this,e)},ns.prototype.newComment=function(e){return new kl(this,e)},ns.newTrashcan=function(e){return new Uv(e)},uo.prototype.newWorkspaceSvg=function(e){return new ns(e)},i.Names$$module$build$src$core$names.prototype.populateProcedures=function(e){e=Ka(e),e=e[0].concat(e[1]);for(let t=0;t{this.setState({popper:b.I18n.t("Copied"),anchorEl:i}),setTimeout(()=>this.setState({popper:"",anchorEl:null}),1e3)},50)}render(){const s=new Blob([this.props.text],{type:"application/xml"}),i=`${this.props.scriptId.substring(10)}.xml`;return g.jsxs(Gt,{onClose:()=>!1,maxWidth:"lg",sx:{"& .MuiDialog-paper":Pr.dialog},fullWidth:!0,open:!0,"aria-labelledby":"export-dialog-title",children:[g.jsx(as,{id:"export-dialog-title",children:b.I18n.t("Export selected blocks")}),g.jsx(Vt,{style:Pr.overflowY,children:g.jsx("pre",{id:"export-text",style:{...Pr.textArea,...this.props.themeType==="dark"?void 0:Pr.textAreaLight},children:this.props.text})}),g.jsxs(Kt,{children:[g.jsx(De,{variant:"contained",color:"secondary",startIcon:g.jsx(vc,{}),children:g.jsx("a",{download:i,target:"_blank",rel:"noreferrer",href:URL.createObjectURL(s),style:{textDecoration:"inherit",color:"inherit"},children:b.I18n.t("Download as file")})}),g.jsx(De,{variant:"contained",onClick:r=>this.onCopy(r),color:"secondary",startIcon:g.jsx(rx,{}),children:b.I18n.t("Copy to clipboard")}),g.jsx(De,{variant:"contained",onClick:()=>this.handleCancel(),color:"primary",startIcon:g.jsx(qs,{}),children:b.I18n.t("Close")}),g.jsx(Gk,{id:"popper",style:{zIndex:1e4},open:!!this.state.popper,placement:"top",anchorEl:this.state.anchorEl,transition:!0,children:({TransitionProps:r})=>g.jsx(Vk,{...r,timeout:350,children:g.jsx(Dw,{children:g.jsx("p",{style:Pr.typography,children:this.state.popper})})})}),g.jsx("textarea",{id:"copy_input",readOnly:!0,style:{position:"absolute",left:-9999},tabIndex:-1,"aria-hidden":!0,value:this.props.text})]})]},"export-dialog")}}const Ot={textArea:{width:"calc(100% - 10px)",height:"calc(80% - 20px)",resize:"none",fontFamily:"monospace",fontSize:"1em",backgroundColor:"transparent",borderRadius:4,outline:"none"},dropzone:{marginTop:20,width:"100%",borderWidth:5,borderStyle:"dashed",borderColor:"#d0cccc",textAlign:"center",boxSizing:"border-box",paddingTop:45,borderRadius:10,height:"calc(100% - 10px)"},dropzoneDiv:{width:"100%",height:"20%",position:"relative"},dropzoneRejected:{borderColor:"#970000"},dropzoneAccepted:{borderColor:"#17cd02"},icon:{height:"80%",width:"80%",opacity:.3,color:"#eeeeee",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",zIndex:0},iconError:{color:"#ffc3c6"},iconOk:{color:"#aaeebc"},text:{top:"50%",left:"50%",transform:"translate(-50%,-50%)",color:"#868686",position:"absolute",zIndex:1},dialog:{height:"95%"},fullHeight:{height:"100%",overflow:"hidden"}};class zm extends Y.Component{constructor(s){super(s),this.state={text:"",imageStatus:"",error:""}}componentDidMount(){setTimeout(()=>{var s;try{(s=window.document.getElementById("import-text-area"))==null||s.focus()}catch{}},100)}static readFileDataUrl(s,i){const r=new FileReader;r.onload=()=>{i(null,{data:r.result,name:s.name})},r.onabort=()=>{console.error("file reading was aborted"),i(b.I18n.t("file reading was aborted"))},r.onerror=l=>{console.error("file reading has failed"),i(b.I18n.t("file reading has failed: %s",l))},r.readAsText(s)}handleDropFile(s){if(!(s!=null&&s.length))return;const i=s[s.length-1];i&&zm.readFileDataUrl(i,(r,l)=>{var u;r||!l?this.setState({error:r||"No data"}):this.setState({text:((u=l.data)==null?void 0:u.toString())||""})})}handleCancel(){this.props.onClose()}handleOk(){this.props.onClose(this.state.text)}onChange(s){this.setState({text:s.target.value})}render(){const s={...Ot.dropzone,...this.state.imageStatus==="accepted"?Ot.dropzoneAccepted:this.state.imageStatus==="rejected"?Ot.dropzoneRejected:void 0};return g.jsxs(Gt,{onClose:()=>!1,maxWidth:"lg",sx:{"& .MuiDialog-paper":Ot.dialog},fullWidth:!0,open:!0,"aria-labelledby":"import-dialog-title",children:[g.jsx(as,{id:"import-dialog-title",children:b.I18n.t("Import blocks")}),g.jsxs(Vt,{style:Ot.fullHeight,children:[g.jsx("textarea",{autoFocus:!0,id:"import-text-area",placeholder:b.I18n.t("Paste your blocks here"),style:{...Ot.textArea,color:this.props.themeType==="dark"?"#ffffff":"#000000"},onChange:i=>this.onChange(i),value:this.state.text}),g.jsx(Mw,{maxSize:5e7,onDrop:(i,r)=>{var l,u,d;i.length?this.handleDropFile(i):window.alert(((d=(u=(l=r==null?void 0:r[0])==null?void 0:l.errors)==null?void 0:u[0])==null?void 0:d.message)||b.I18n.t("ra_Cannot upload"))},multiple:!1,accept:{"text/plain":[],"text/xml":[],"application/xml":[]},children:({getRootProps:i,getInputProps:r,isDragActive:l,isDragReject:u})=>u?(this.state.imageStatus!=="rejected"&&this.setState({imageStatus:"rejected"}),g.jsxs("div",{style:{...s,...Ot.dropzoneDiv},...i(),children:[g.jsx("input",{...r()}),g.jsx("span",{style:Ot.text,children:b.I18n.t("Some files will be rejected")},"text"),g.jsx(Wc,{style:{...Ot.icon,...Ot.iconError}},"icon")]})):l?(this.state.imageStatus!=="accepted"&&this.setState({imageStatus:"accepted"}),g.jsxs("div",{style:{...s,...Ot.dropzoneDiv},...i(),children:[g.jsx("input",{...r()}),g.jsx("span",{style:Ot.text,children:b.I18n.t("All files will be accepted")},"text"),g.jsx(Nw,{style:{...Ot.icon,...Ot.iconOk}},"icon")]})):(this.state.imageStatus!=="wait"&&this.setState({imageStatus:"wait"}),g.jsxs("div",{style:{...s,...Ot.dropzoneDiv},...i(),children:[g.jsx("input",{...r()}),g.jsx("span",{style:Ot.text,children:b.I18n.t("Drop some files here or click...")},"text"),g.jsx(Lw,{style:Ot.icon},"icon")]}))})]}),g.jsxs(Kt,{children:[g.jsx(De,{variant:"contained",disabled:!this.state.text,onClick:()=>this.handleOk(),color:"primary",startIcon:g.jsx(zo,{}),children:b.I18n.t("Import")}),g.jsx(De,{color:"grey",variant:"contained",onClick:()=>this.handleCancel(),startIcon:g.jsx(qs,{}),children:b.I18n.t("Close")})]})]})}}const we=window.Blockly;class mg extends Error{constructor(){super("The field has not yet been attached to its input. Call appendField to attach it.")}}class Ic extends we.Field{textGroup=null;borderRect_=null;maxLines_=1/0;isOverflowedY_=!1;constructor(s,i,r){super(s),s!==Symbol("SKIP_SETUP")&&(r&&this.configure_(r),this.SERIALIZABLE=!0,this.setValue((s==null?void 0:s.toString())||""),i&&this.setValidator(i))}configure_(s){super.configure_(s),s.maxLines&&this.setMaxLines(s.maxLines)}toXml(s){return s.textContent=this.getValue().replace(/\n/g," "),s}fromXml(s){this.setValue(s.textContent.replace(/ /g,` -`))}saveState(){const s=this.saveLegacyState(Ic);return s!==null?s:this.getValue()}loadState(s){this.loadLegacyState(we.Field,s)||this.setValue(s)}initView(){this.createBorderRect_(),this.textGroup=we.utils.dom.createSvgElement(we.utils.Svg.G,{class:"blocklyEditableText"},this.fieldGroup_)}onHtmlInputKeyDownSuper_(s){s.key==="Enter"?(we.WidgetDiv.hideIfOwner(this),we.dropDownDiv.hideWithoutAnimation()):s.key==="Escape"?(this.setValue(this.htmlInput_.getAttribute("data-untyped-default-value"),!1),we.WidgetDiv.hideIfOwner(this),we.dropDownDiv.hideWithoutAnimation()):s.key==="Tab"&&(we.WidgetDiv.hideIfOwner(this),we.dropDownDiv.hideWithoutAnimation(),this.sourceBlock_.tab(this,!s.shiftKey),s.preventDefault())}onHtmlInputChange_(s){const i=this.value_;this.setValue(this.getValueFromEditorText_(this.htmlInput_.value),!1),this.sourceBlock_&&we.Events.isEnabled()&&this.value_!==i&&we.Events.fire(new(we.Events.get("block_field_intermediate_change"))(this.sourceBlock_,this.name||null,i,this.value_))}onFinishEditing_(s){}getValueFromEditorText_(s){return s}bindInputEvents_(s){this.onKeyDownWrapper_=we.browserEvents.conditionalBind(s,"keydown",this,this.onHtmlInputKeyDown_),this.onKeyInputWrapper_=we.browserEvents.conditionalBind(s,"input",this,this.onHtmlInputChange_)}getDisplayText_(){const s=this.getSourceBlock();if(!s)throw new Error("The field has not yet been attached to its input. Call appendField to attach it.");let i=this.getText();if(!i)return we.Field.NBSP;const r=i.split(` -`);i="";const l=this.isOverflowedY_?this.maxLines_:r.length;for(let u=0;uthis.maxDisplayLength?d=`${d.substring(0,this.maxDisplayLength-4)}...`:this.isOverflowedY_&&u===l-1&&(d=`${d.substring(0,d.length-3)}...`),d=d.replace(/\s/g,we.Field.NBSP),i+=d,u!==l-1&&(i+=` -`)}return s.RTL&&(i+="‏"),i}doValueUpdate_(s){super.doValueUpdate_(s),this.value_!==null&&(this.isOverflowedY_=this.value_.split(` -`).length>this.maxLines_)}render_(){const s=this.getSourceBlock();if(!s)throw new Error("The field has not yet been attached to its input. Call appendField to attach it.");let i;const r=this.textGroup;for(;i=r.firstChild;)r.removeChild(i);const l=this.getConstants();if(!l)throw Error("Constants not found");const u=this.getDisplayText_().split(` -`);let d=0;for(let p=0;pd&&(d=v),p+=s.FIELD_TEXT_HEIGHT+(m>0?s.FIELD_BORDER_RECT_Y_PADDING:0)}if(this.isBeingEdited_){const m=String(this.value_).split(` -`),f=we.utils.dom.createSvgElement(we.utils.Svg.TEXT,{class:"blocklyText blocklyMultilineText"});for(let y=0;ythis.maxDisplayLength&&(m[y]=m[y].substring(0,this.maxDisplayLength)),f.textContent=m[y];const k=we.utils.dom.getFastTextWidth(f,r,l,u);k>d&&(d=k)}const v=this.htmlInput_,_=v.offsetWidth-v.clientWidth;d+=_}this.borderRect_&&(p+=s.FIELD_BORDER_RECT_Y_PADDING*2,d+=s.FIELD_BORDER_RECT_X_PADDING*2+1,this.borderRect_.setAttribute("width",`${d}`),this.borderRect_.setAttribute("height",`${p}`)),this.size_.width=d,this.size_.height=p,this.positionBorderRect_()}showInlineEditor_(s){const i=this.getSourceBlock();if(!i)throw new mg;we.WidgetDiv.show(this,i.RTL,this.widgetDispose_.bind(this),this.workspace_),this.htmlInput_=this.widgetCreate_(),this.isBeingEdited_=!0,this.valueWhenEditorWasOpened_=this.value_,s||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())}getEditorText_(s){return`${s}`}getScaledBBox(){let s,i,r;const l=this.getSourceBlock();if(!l)throw new mg;if(this.isFullBlockField()){const u=this.sourceBlock_.getHeightWidth(),d=l.workspace.scale;r=this.getAbsoluteXY_(),s=(u.width+1)*d,i=(u.height+1)*d,we.utils.userAgent.GECKO?(r.x+=1.5*d,r.y+=1.5*d):(r.x-=.5*d,r.y-=.5*d)}else{const u=this.borderRect_.getBoundingClientRect();r=we.utils.style.getPageOffset(this.borderRect_),s=u.width,i=u.height}return new we.utils.Rect(r.y,r.y+i,r.x,r.x+s)}resizeEditor_(){we.renderManagement.finishQueuedRenders().then(()=>{const s=this.getSourceBlock();if(!s)throw new mg;const i=we.WidgetDiv.getDiv(),r=this.getScaledBBox();i.style.width=`${r.right-r.left}px`,i.style.height=`${r.bottom-r.top}px`;const l=s.RTL?r.right-i.offsetWidth:r.left,u=r.top;i.style.left=`${l}px`,i.style.top=`${u}px`})}unbindInputEvents_(){this.onKeyDownWrapper_&&(we.browserEvents.unbind(this.onKeyDownWrapper_),this.onKeyDownWrapper_=null),this.onKeyInputWrapper_&&(we.browserEvents.unbind(this.onKeyInputWrapper_),this.onKeyInputWrapper_=null)}getClickTarget_(){return this.clickTarget_||this.getSvgRoot()}widgetDispose_(){this.isBeingEdited_=!1,this.isTextValid_=!0,this.forceRerender(),this.onFinishEditing_(this.value_),this.sourceBlock_&&we.Events.isEnabled()&&this.valueWhenEditorWasOpened_!==null&&this.valueWhenEditorWasOpened_!==this.value_&&(we.Events.fire(new(we.Events.get("change"))(this.sourceBlock_,"field",this.name||null,this.valueWhenEditorWasOpened_,this.value_)),this.valueWhenEditorWasOpened_=null),we.Events.setGroup(!1),this.unbindInputEvents_();const s=we.WidgetDiv.getDiv().style;s.width="auto",s.height="auto",s.fontSize="",s.transition="",s.boxShadow="",this.htmlInput_=null;const i=this.getClickTarget_();if(!i)throw new Error("A click target has not been set.");we.utils.dom.removeClass(i,"editing")}showEditor_(s,i){this.workspace_=this.sourceBlock_.workspace,!i&&this.workspace_.options.modalInputs&&(we.utils.userAgent.MOBILE||we.utils.userAgent.ANDROID||we.utils.userAgent.IPAD)?this.showPromptEditor_():this.showInlineEditor_(!!i),this.forceRerender()}widgetCreate_(){const s=we.WidgetDiv.getDiv(),i=this.workspace_.getScale(),r=this.getConstants();if(!r)throw Error("Constants not found");const l=document.createElement("textarea");l.className="blocklyHtmlInput blocklyHtmlTextAreaInput",l.setAttribute("spellcheck",String(this.spellcheck_));const u=`${r.FIELD_TEXT_FONTSIZE*i}pt`;s.style.fontSize=u,l.style.fontSize=u;const d=`${we.FieldTextInput.BORDERRADIUS*i}px`;l.style.borderRadius=d;const p=r.FIELD_BORDER_RECT_X_PADDING*i,m=r.FIELD_BORDER_RECT_Y_PADDING*i/2;l.style.padding=`${m}px ${p}px ${m}px ${p}px`;const f=r.FIELD_TEXT_HEIGHT+r.FIELD_BORDER_RECT_Y_PADDING;return l.style.lineHeight=`${f*i}px`,s.appendChild(l),l.value=l.defaultValue=this.getEditorText_(this.value_),l.setAttribute("data-untyped-default-value",String(this.value_)),l.setAttribute("data-old-value",""),we.utils.userAgent.GECKO?setTimeout(this.resizeEditor_.bind(this),0):this.resizeEditor_(),this.bindInputEvents_(l),l}setMaxLines(s){typeof s=="number"&&s>0&&s!==this.maxLines_&&(this.maxLines_=s,this.forceRerender())}getMaxLines(){return this.maxLines_}onHtmlInputKeyDown_(s){s.key!=="Enter"&&this.onHtmlInputKeyDownSuper_(s)}static fromJson(s){const i=we.utils.parsing.replaceMessageReferences(s.text);return new this(i,void 0,s)}}we.Css.register(` -.blocklyHtmlTextAreaInput { - font-family: monospace; - resize: none; - overflow: hidden; - height: 100%; - text-align: left; -} - -.blocklyHtmlTextAreaInputOverflowedY { - overflow-y: scroll; -} -`);const bT="text_multiline",eR={type:bT,message0:"%1 %2",args0:[{type:"field_image",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAARCAYAAADpPU2iAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAdhgAAHYYBXaITgQAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS42/U4J6AAAAP1JREFUOE+Vks0KQUEYhjmRIja4ABtZ2dm5A3t3Ia6AUm7CylYuQRaUhZSlLZJiQbFAyRnPN33y01HOW08z8873zpwzM4F3GWOCruvGIE4/rLaV+Nq1hVGMBqzhqlxgCys4wJA65xnogMHsQ5lujnYHTejBBCK2mE4abjCgMGhNxHgDFWjDSG07kdfVa2pZMf4ZyMAdWmpZMfYOsLiDMYMjlMB+K613QISRhTnITnsYg5yUd0DETmEoMlkFOeIT/A58iyK5E18BuTBfgYXfwNJv4P9/oEBerLylOnRhygmGdPpTTBZAPkde61lbQe4moWUvYUZYLfUNftIY4zwA5X2Z9AYnQrEAAAAASUVORK5CYII=",width:12,height:17,alt:"¶"},{type:"field_multilinetext",name:"TEXT",text:""}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_TEXT_HELPURL}",tooltip:"%{BKY_TEXT_TEXT_TOOLTIP}",extensions:["parent_tooltip_when_inline"]};function tR(a,s){const i=s.multiline_quote_(a.getFieldValue("TEXT")),r=i.indexOf("+")!==-1?6.2:0;return[i,r]}const sR=window.Blockly.common.createBlockDefinitionsFromJsonArray([eR]);sR[bT];const Re=window.Blockly;class im extends Re.Field{picker=null;highlightedIndex=null;boundEvents=[];SERIALIZABLE=!0;CURSOR="default";isDirty_=!1;colours=["#ffffff","#cccccc","#c0c0c0","#999999","#666666","#333333","#000000","#ffcccc","#ff6666","#ff0000","#cc0000","#990000","#660000","#330000","#ffcc99","#ff9966","#ff9900","#ff6600","#cc6600","#993300","#663300","#ffff99","#ffff66","#ffcc66","#ffcc33","#cc9933","#996633","#663333","#ffffcc","#ffff33","#ffff00","#ffcc00","#999900","#666600","#333300","#99ff99","#66ff99","#33ff33","#33cc00","#009900","#006600","#003300","#99ffff","#33ffff","#66cccc","#00cccc","#339999","#336666","#003333","#ccffff","#66ffff","#33ccff","#3366ff","#3333ff","#000099","#000066","#ccccff","#9999ff","#6666cc","#6633ff","#6600cc","#333399","#330099","#ffccff","#ff99ff","#cc66cc","#cc33cc","#993399","#663366","#330033"];titles=[];columns=7;constructor(s,i,r){super(s),s!==Symbol("SKIP_SETUP")&&(r&&this.configure_(r),this.setValue(s),i&&this.setValidator(i))}configure_(s){super.configure_(s),s.colourOptions&&(this.colours=s.colourOptions),s.colourTitles&&(this.titles=s.colourTitles),s.columns&&(this.columns=s.columns)}initView(){const s=this.getConstants();if(!s)throw Error("Constants not found");this.size_=new Re.utils.Size(s.FIELD_COLOUR_DEFAULT_WIDTH,s.FIELD_COLOUR_DEFAULT_HEIGHT),this.createBorderRect_(),this.getBorderRect().style.fillOpacity="1",this.getBorderRect().setAttribute("stroke","#fff"),this.isFullBlockField()&&(this.clickTarget_=this.sourceBlock_.getSvgRoot())}isFullBlockField(){if(!this.getSourceBlock())throw new Re.UnattachedFieldError;const i=this.getConstants();return this.blockIsSimpleReporter()&&!!(i!=null&&i.FIELD_COLOUR_FULL_BLOCK)}blockIsSimpleReporter(){const s=this.getSourceBlock();if(!s)throw new Re.UnattachedFieldError;if(!s.outputConnection)return!1;for(const i of s.inputList)if(i.connection||i.fieldRow.length>1)return!1;return!0}applyColour(){const s=this.getSourceBlock();if(!s)throw new Re.UnattachedFieldError;if(!this.fieldGroup_)return;const i=this.borderRect_;if(!i)throw new Error("The border rect has not been initialized");this.isFullBlockField()?(i.style.display="none",s.pathObject.svgPath.setAttribute("fill",this.getValue()),s.pathObject.svgPath.setAttribute("stroke","#fff")):(i.style.display="block",i.style.fill=this.getValue())}getSize(){var s;return(s=this.getConstants())!=null&&s.FIELD_COLOUR_FULL_BLOCK&&(this.render_(),this.isDirty_=!1),super.getSize()}render_(){super.render_();const s=this.getSourceBlock();if(!s)throw new Re.UnattachedFieldError;s.applyColour()}updateSize_(s){const i=this.getConstants();if(!i)return;let r,l;this.isFullBlockField()?(r=(s??0)*2,l=i.FIELD_TEXT_HEIGHT):(r=i.FIELD_COLOUR_DEFAULT_WIDTH,l=i.FIELD_COLOUR_DEFAULT_HEIGHT),this.size_.height=l,this.size_.width=r,this.positionBorderRect_()}doClassValidation_(s){return typeof s!="string"?null:Re.utils.colour.parse(s)}getText(){let s=this.value_;return/^#(.)\1(.)\2(.)\3$/.test(s)&&(s=`#${s[1]}${s[3]}${s[5]}`),s}setColours(s,i){return this.colours=s,i&&(this.titles=i),this}setColumns(s){return this.columns=s,this}showEditor_(){if(this.dropdownCreate(),!this.picker)throw Error("Picker not found");Re.DropDownDiv.getContentDiv().appendChild(this.picker),Re.DropDownDiv.showPositionedByField(this,this.dropdownDispose.bind(this)),this.picker.focus({preventScroll:!0})}onClick(s){const i=s.target,r=i==null?void 0:i.getAttribute("data-colour");r!==null&&(this.setValue(r),Re.DropDownDiv.hideIfOwner(this))}onKeyDown(s){let i=!0,r;switch(s.key){case"ArrowUp":this.moveHighlightBy(0,-1);break;case"ArrowDown":this.moveHighlightBy(0,1);break;case"ArrowLeft":this.moveHighlightBy(-1,0);break;case"ArrowRight":this.moveHighlightBy(1,0);break;case"Enter":if(r=this.getHighlighted(),r){const l=r.getAttribute("data-colour");l!==null&&this.setValue(l)}Re.DropDownDiv.hideWithoutAnimation();break;default:i=!1}i&&s.stopPropagation()}moveHighlightBy(s,i){if(!this.highlightedIndex)return;const r=this.colours,l=this.columns;let u=this.highlightedIndex%l,d=Math.floor(this.highlightedIndex/l);u+=s,d+=i,s<0?u<0&&d>0?(u=l-1,d--):u<0&&(u=0):s>0?u>l-1&&dl-1&&u--:i<0?d<0&&(d=0):i>0&&d>Math.floor(r.length/l)-1&&(d=Math.floor(r.length/l)-1);const p=this.picker.childNodes[d].childNodes[u],m=d*l+u;this.setHighlightedCell(p,m)}onMouseMove(s){const i=s.target,r=i&&Number(i.getAttribute("data-index"));r!==null&&r!==this.highlightedIndex&&this.setHighlightedCell(i,r)}onMouseEnter(){var s;(s=this.picker)==null||s.focus({preventScroll:!0})}onMouseLeave(){var i;(i=this.picker)==null||i.blur();const s=this.getHighlighted();s&&Re.utils.dom.removeClass(s,"blocklyColourHighlighted")}getHighlighted(){var l;if(!this.highlightedIndex)return null;const s=this.highlightedIndex%this.columns,i=Math.floor(this.highlightedIndex/this.columns),r=(l=this.picker)==null?void 0:l.childNodes[i];return r?r.childNodes[s]:null}setHighlightedCell(s,i){const r=this.getHighlighted();r&&Re.utils.dom.removeClass(r,"blocklyColourHighlighted"),Re.utils.dom.addClass(s,"blocklyColourHighlighted"),this.highlightedIndex=i;const l=s.getAttribute("id");l&&this.picker&&Re.utils.aria.setState(this.picker,Re.utils.aria.State.ACTIVEDESCENDANT,l)}dropdownCreate(){const s=this.columns,i=this.colours,r=this.getValue(),l=document.createElement("table");l.className="blocklyColourTable",l.tabIndex=0,l.dir="ltr",Re.utils.aria.setRole(l,Re.utils.aria.Role.GRID),Re.utils.aria.setState(l,Re.utils.aria.State.EXPANDED,!0),Re.utils.aria.setState(l,Re.utils.aria.State.ROWCOUNT,Math.floor(i.length/s)),Re.utils.aria.setState(l,Re.utils.aria.State.COLCOUNT,s);let u=null;for(let d=0;dtr>td { - border: 0.5px solid #888; - box-sizing: border-box; - cursor: pointer; - display: inline-block; - height: 20px; - padding: 0; - width: 20px; -} - -.blocklyColourTable>tr>td.blocklyColourHighlighted { - border-color: #eee; - box-shadow: 2px 2px 7px 2px rgba(0, 0, 0, 0.3); - position: relative; -} - -.blocklyColourSelected, .blocklyColourSelected:hover { - border-color: #eee !important; - outline: 1px solid #333; - position: relative; -} -`);const vT="colour_picker",oR={type:vT,message0:"%1",args0:[{type:"field_colour",name:"COLOUR",colour:"#ff0000"}],output:"Colour",helpUrl:"%{BKY_COLOUR_PICKER_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_PICKER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]};function iR(a,s){return[s.quote_(a.getFieldValue("COLOUR")),0]}const nR=window.Blockly.common.createBlockDefinitionsFromJsonArray([oR]);nR[vT];const yT="colour_random",rR={type:yT,message0:"%{BKY_COLOUR_RANDOM_TITLE}",output:"Colour",helpUrl:"%{BKY_COLOUR_RANDOM_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_RANDOM_TOOLTIP}"};function aR(a,s){return[`${s.provideFunction_("colourRandom",` -function ${s.FUNCTION_NAME_PLACEHOLDER_}() { - var num = Math.floor(Math.random() * 0x1000000); - return '#' + ('00000' + num.toString(16)).substr(-6); -} -`)}()`,2]}const lR=window.Blockly.common.createBlockDefinitionsFromJsonArray([rR]);lR[yT];const _T="colour_rgb",cR={type:_T,message0:"%{BKY_COLOUR_RGB_TITLE} %{BKY_COLOUR_RGB_RED} %1 %{BKY_COLOUR_RGB_GREEN} %2 %{BKY_COLOUR_RGB_BLUE} %3",args0:[{type:"input_value",name:"RED",check:"Number",align:"RIGHT"},{type:"input_value",name:"GREEN",check:"Number",align:"RIGHT"},{type:"input_value",name:"BLUE",check:"Number",align:"RIGHT"}],output:"Colour",helpUrl:"%{BKY_COLOUR_RGB_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_RGB_TOOLTIP}"};function uR(a,s){const i=s.valueToCode(a,"RED",99)||0,r=s.valueToCode(a,"GREEN",99)||0,l=s.valueToCode(a,"BLUE",99)||0;return[`${s.provideFunction_("colourRgb",` -function ${s.FUNCTION_NAME_PLACEHOLDER_}(r, g, b) { - r = Math.max(Math.min(Number(r), 100), 0) * 2.55; - g = Math.max(Math.min(Number(g), 100), 0) * 2.55; - b = Math.max(Math.min(Number(b), 100), 0) * 2.55; - r = ('0' + (Math.round(r) || 0).toString(16)).slice(-2); - g = ('0' + (Math.round(g) || 0).toString(16)).slice(-2); - b = ('0' + (Math.round(b) || 0).toString(16)).slice(-2); - return '#' + r + g + b; -} -`)}(${i}, ${r}, ${l})`,2]}const dR=window.Blockly.common.createBlockDefinitionsFromJsonArray([cR]);dR[_T];const wT="colour_blend",hR={type:wT,message0:"%{BKY_COLOUR_BLEND_TITLE} %{BKY_COLOUR_BLEND_COLOUR1} %1 %{BKY_COLOUR_BLEND_COLOUR2} %2 %{BKY_COLOUR_BLEND_RATIO} %3",args0:[{type:"input_value",name:"COLOUR1",check:"Colour",align:"RIGHT"},{type:"input_value",name:"COLOUR2",check:"Colour",align:"RIGHT"},{type:"input_value",name:"RATIO",check:"Number",align:"RIGHT"}],output:"Colour",helpUrl:"%{BKY_COLOUR_BLEND_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_BLEND_TOOLTIP}"};function pR(a,s){const i=s.valueToCode(a,"COLOUR1",99)||"'#000000'",r=s.valueToCode(a,"COLOUR2",99)||"'#000000'",l=s.valueToCode(a,"RATIO",99)||.5;return[`${s.provideFunction_("colourBlend",` -function ${s.FUNCTION_NAME_PLACEHOLDER_}(c1, c2, ratio) { - ratio = Math.max(Math.min(Number(ratio), 1), 0); - var r1 = parseInt(c1.substring(1, 3), 16); - var g1 = parseInt(c1.substring(3, 5), 16); - var b1 = parseInt(c1.substring(5, 7), 16); - var r2 = parseInt(c2.substring(1, 3), 16); - var g2 = parseInt(c2.substring(3, 5), 16); - var b2 = parseInt(c2.substring(5, 7), 16); - var r = Math.round(r1 * (1 - ratio) + r2 * ratio); - var g = Math.round(g1 * (1 - ratio) + g2 * ratio); - var b = Math.round(b1 * (1 - ratio) + b2 * ratio); - r = ('0' + (r || 0).toString(16)).slice(-2); - g = ('0' + (g || 0).toString(16)).slice(-2); - b = ('0' + (b || 0).toString(16)).slice(-2); - return '#' + r + g + b; -} -`)}(${i}, ${r}, ${l})`,2]}const gR=window.Blockly.common.createBlockDefinitionsFromJsonArray([hR]);gR[wT];function mR(){window.Blockly.FieldMultilineInput||(window.Blockly.fieldRegistry.register("field_multilinetext",Ic),window.Blockly.JavaScript.forBlock.text_multiline=tR,window.Blockly.FieldMultilineInput=Ic,Object.assign(window.Blockly.Blocks,window.Blockly.common.createBlockDefinitionsFromJsonArray([{type:"text_multiline",message0:"%1 %2",args0:[{type:"field_image",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAARCAYAAADpPU2iAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAdhgAAHYYBXaITgQAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS42/U4J6AAAAP1JREFUOE+Vks0KQUEYhjmRIja4ABtZ2dm5A3t3Ia6AUm7CylYuQRaUhZSlLZJiQbFAyRnPN33y01HOW08z8873zpwzM4F3GWOCruvGIE4/rLaV+Nq1hVGMBqzhqlxgCys4wJA65xnogMHsQ5lujnYHTejBBCK2mE4abjCgMGhNxHgDFWjDSG07kdfVa2pZMf4ZyMAdWmpZMfYOsLiDMYMjlMB+K613QISRhTnITnsYg5yUd0DETmEoMlkFOeIT/A58iyK5E18BuTBfgYXfwNJv4P9/oEBerLylOnRhygmGdPpTTBZAPkde61lbQe4moWUvYUZYLfUNftIY4zwA5X2Z9AYnQrEAAAAASUVORK5CYII=",width:12,height:17,alt:"¶"},{type:"field_multilinetext",name:"TEXT",text:""}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_TEXT_HELPURL}",tooltip:"%{BKY_TEXT_TEXT_TOOLTIP}",extensions:["parent_tooltip_when_inline"]}]))),window.Blockly.FieldColour||(window.Blockly.fieldRegistry.register("field_colour",im),window.Blockly.JavaScript.forBlock.colour_picker=iR,window.Blockly.JavaScript.forBlock.colour_blend=pR,window.Blockly.JavaScript.forBlock.colour_random=aR,window.Blockly.JavaScript.forBlock.colour_rgb=uR,window.Blockly.FieldColour=im,Object.assign(window.Blockly.Blocks,window.Blockly.common.createBlockDefinitionsFromJsonArray([{type:"colour_picker",message0:"%1",args0:[{type:"field_colour",name:"COLOUR",colour:"#ff0000"}],output:"Colour",helpUrl:"%{BKY_COLOUR_PICKER_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_PICKER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]}])),Object.assign(window.Blockly.Blocks,window.Blockly.common.createBlockDefinitionsFromJsonArray([{type:"colour_random",message0:"%{BKY_COLOUR_RANDOM_TITLE}",output:"Colour",helpUrl:"%{BKY_COLOUR_RANDOM_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_RANDOM_TOOLTIP}"}])),Object.assign(window.Blockly.Blocks,window.Blockly.common.createBlockDefinitionsFromJsonArray([{type:"colour_rgb",message0:"%{BKY_COLOUR_RGB_TITLE} %{BKY_COLOUR_RGB_RED} %1 %{BKY_COLOUR_RGB_GREEN} %2 %{BKY_COLOUR_RGB_BLUE} %3",args0:[{type:"input_value",name:"RED",check:"Number",align:"RIGHT"},{type:"input_value",name:"GREEN",check:"Number",align:"RIGHT"},{type:"input_value",name:"BLUE",check:"Number",align:"RIGHT"}],output:"Colour",helpUrl:"%{BKY_COLOUR_RGB_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_RGB_TOOLTIP}"}])),Object.assign(window.Blockly.Blocks,window.Blockly.common.createBlockDefinitionsFromJsonArray([{type:"colour_blend",message0:"%{BKY_COLOUR_BLEND_TITLE} %{BKY_COLOUR_BLEND_COLOUR1} %1 %{BKY_COLOUR_BLEND_COLOUR2} %2 %{BKY_COLOUR_BLEND_RATIO} %3",args0:[{type:"input_value",name:"COLOUR1",check:"Colour",align:"RIGHT"},{type:"input_value",name:"COLOUR2",check:"Colour",align:"RIGHT"},{type:"input_value",name:"RATIO",check:"Number",align:"RIGHT"}],output:"Colour",helpUrl:"%{BKY_COLOUR_BLEND_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_BLEND_TOOLTIP}"}])));const a=window.Blockly.JavaScript;a.forBlock&&Object.keys(a).forEach(s=>{typeof a[s]=="function"&&(a.forBlock[s]||(console.log(`Migrating Blockly.JavaScript.${s} to Blockly.JavaScript.forBlock.${s}`),a.forBlock[s]=a[s],delete a[s]))})}let rc=!1,ac=!1,fg=null,$g=null;const dw=[];function CT(a,s,i,r){var l;if(r=r||[],(a.tagName==="BLOCK"||a.tagName==="block")&&(i=a.id),a.tagName==="FIELD"||a.tagName==="field")for(let u=0;uCT(u,s,i,r)),r}class Fe extends Y.Component{blockly=null;blocklyWorkspace=null;originalCode;someSelected=null;changeTimer=null;someSelectedTime=0;ignoreChanges=!1;blinkBlock;onResizeBind;didUpdate=null;lastCommand="";lastSearch;static Blockly=window.Blockly;constructor(s){super(s),this.state={languageOwnLoaded:ac,languageBlocklyLoaded:rc,changed:!1,message:"",error:"",themeType:this.props.themeType,exportText:"",importText:!1,searchText:this.props.searchText||"",showInputPrompt:null},this.originalCode=s.code||"",this.someSelected=null,this.onResizeBind=this.onResize.bind(this),this.lastSearch=this.props.searchText||"",this.blinkBlock=null,mR(),Fe.Blockly.dialog.setPrompt(this.onShowNameDialog),this.loadLanguages()}onShowNameDialog=(s,i,r)=>{this.setState({showInputPrompt:{promptText:s,defaultText:i,callback:r,value:i}})};static loadJS(s,i,r){const l=document.createElement("script");try{l.src=s,l.onload=i,l.onerror=i,(r||window.document.body).appendChild(l)}catch(u){console.error(`Cannot load ${s}: ${u}`),i&&i()}}static loadScripts(s,i){if(!(s!=null&&s.length)){i&&i();return}const r=s.pop();r&&!dw.includes(r)?(dw.push(r),Fe.loadJS(`../../adapter/${r}/blockly.js`,()=>setTimeout(()=>Fe.loadScripts(s,i),0))):setTimeout(()=>Fe.loadScripts(s,i),0)}static loadCustomBlockly(s,i){var l;const r=[];for(const u in s)!Object.prototype.hasOwnProperty.call(s,u)||!s[u]||!u.match(/^system\.adapter\./)||s[u].type!=="adapter"||(l=s[u].common)!=null&&l.blockly&&(console.log(`Detected custom blockly: ${s[u].common.name}`),r.push(s[u].common.name));Fe.loadScripts(r,i)}static loadXMLDoc(s){let i;return window.DOMParser?i=r=>new window.DOMParser().parseFromString(r,"text/xml"):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("Microsoft.XMLDOM")?i=r=>{const l=new window.ActiveXObject("Microsoft.XMLDOM");return l.async="false",l.loadXML(r),l}:i=()=>null,i(s)}searchBlocks(s){if(this.blocklyWorkspace){const i=Fe.Blockly.Xml.workspaceToDom(this.blocklyWorkspace),r=CT(i,s.toLowerCase());return console.log(`Search "${s}" found blocks: ${r.length?JSON.stringify(r):"none"}`),r}return[]}searchId(){const s=this.lastSearch?this.searchBlocks(this.lastSearch):null;s!=null&&s.length?(this.someSelected=s,this.someSelected.forEach(i=>{var r;return(r=this.blocklyWorkspace)==null?void 0:r.highlightBlock(i,!0)}),this.someSelectedTime=Date.now()):this.someSelected&&(this.someSelected.forEach(i=>{var r;return(r=this.blocklyWorkspace)==null?void 0:r.highlightBlock(i,!1)}),this.someSelected=null)}UNSAFE_componentWillReceiveProps(s){s.command&&this.lastCommand!==s.command&&(this.lastCommand=s.command,setTimeout(()=>this.lastCommand="",300),this.lastCommand==="check"?this.blocklyCheckBlocks((i,r)=>{i?(r&&Fe.blocklyBlinkBlock(r),this.setState({error:{text:b.I18n.t(i),title:b.I18n.t("Error was found")}}),this.blinkBlock=r):this.setState({message:b.I18n.t("Ok")})}):this.lastCommand==="export"?this.exportBlocks():this.lastCommand==="import"&&this.importBlocks()),s.searchText!==this.lastSearch&&(this.lastSearch=s.searchText,this.searchId()),this.state.themeType!==s.themeType&&this.setState({themeType:s.themeType},()=>this.updateBackground()),this.originalCode!==s.code&&(this.originalCode=s.code||"",this.loadCode(),this.searchId())}loadLanguages(){if(!rc){const s=window.document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("src",`google-blockly/msg/js/${b.I18n.getLanguage()}.js`),s.onload=()=>{rc=!0,this.setState({languageBlocklyLoaded:rc})},window.document.getElementsByTagName("head")[0].appendChild(s)}if(!ac){const s=window.document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("src",`google-blockly/own/msg/${b.I18n.getLanguage()}.js`),s.onload=()=>{ac=!0,this.setState({languageOwnLoaded:ac})},window.document.getElementsByTagName("head")[0].appendChild(s)}}onResize(){this.blocklyWorkspace&&Fe.Blockly.svgResize(this.blocklyWorkspace)}static jsCode2Blockly(s){s=s||"";const i=s.split(/[\r\n]+|\r|\n/g);let r="";for(let u=i.length-1;u>=0;u--)if(i[u].substring(0,2)==="//"){r=i[u].substring(2);break}if(r.substring(0,4)==="s.select(),i),setTimeout(()=>s.unselect(),i+150)}blocklyRemoveOrphanedShadows(){if(this.blocklyWorkspace){const s=this.blocklyWorkspace.getAllBlocks();let i;for(let r=0;i=s[r];r++)if(i.isShadow()){const l=i.getConnections_(!0);let u;for(let d=0;u=l[d];d++)if(!u.targetConnection){i.dispose();break}}}}blocklyCheckBlocks(s){let i;if(!this.blocklyWorkspace||this.blocklyWorkspace.getAllBlocks().length===0)return s&&s("no blocks found"),!1;let r=this.blocklyGetUnconnectedBlock();return r?i="not properly connected":(r=this.blocklyGetBlockWithWarning(),r&&(i="warning on this block")),r?(s?s(i,r):Fe.blocklyBlinkBlock(r),!1):(s(),!0)}blocklyGetUnconnectedBlock(){var r;const s=(r=this.blocklyWorkspace)==null?void 0:r.getAllBlocks();let i;if(s)for(let l=0;i=s[l];l++){const u=i.getConnections_(!0);let d;for(let p=0;d=u[p];p++)if(!d.sourceBlock_||(d.type===Fe.Blockly.INPUT_VALUE||d.type===Fe.Blockly.OUTPUT_VALUE)&&!d.targetConnection&&!d._optional)return i}return null}blocklyGetBlockWithWarning(){var r;const s=(r=this.blocklyWorkspace)==null?void 0:r.getAllBlocks();let i;if(s){for(let l=0;i=s[l];l++)if(i.warning)return i}return null}blocklyCode2JSCode(s){if(!this.blocklyWorkspace)return"";let i=Fe.Blockly.JavaScript.workspaceToCode(this.blocklyWorkspace);if(!s){i+=` -`;const r=Fe.Blockly.Xml.workspaceToDom(this.blocklyWorkspace),l=Fe.Blockly.Xml.domToText(r);i+=`//${btoa(encodeURIComponent(l))}`}return i}exportBlocks(){if(!this.blocklyWorkspace)return;let s;const i=Fe.Blockly.getSelected();if(i){const r=Fe.Blockly.Xml.blockToDom(i),l=i.getRelativeToSurfaceXY();r.setAttribute("x",(i.RTL?-l.x:l.x).toString()),r.setAttribute("y",l.y.toString()),s=Fe.Blockly.Xml.domToPrettyText(r)}else{const r=Fe.Blockly.Xml.workspaceToDom(this.blocklyWorkspace);s=Fe.Blockly.Xml.domToPrettyText(r)}this.setState({exportText:s})}importBlocks(){this.setState({importText:!0})}onImportBlocks(s){if(this.blocklyWorkspace&&(s=(s||"").trim(),s))try{s.startsWith("${s}`),s=s.replace(/[\n\r]/g,"").replace(/.*<\/variables>/g,""),window.scripts.loading=!0;const i=Fe.Blockly.utils.xml.textToDom(s);Fe.Blockly.Xml.appendDomToWorkspace(i,this.blocklyWorkspace),window.scripts.loading=!1,this.onBlocklyChanged()}catch(i){this.setState({error:{text:i.toString(),title:b.I18n.t("Import error")}})}}loadCode(){if(this.blocklyWorkspace){this.ignoreChanges=!0,this.blocklyWorkspace.clear();try{const s=Fe.jsCode2Blockly(this.originalCode)||'';window.scripts.loading=!0;const i=Fe.Blockly.utils.xml.textToDom(s);Fe.Blockly.Xml.domToWorkspace(i,this.blocklyWorkspace),window.scripts.loading=!1}catch(s){console.error(s),setTimeout(()=>this.setState({error:b.I18n.t("Cannot extract Blockly code!")}))}setTimeout(()=>this.ignoreChanges=!1,100)}}onBlocklyChanged(){this.blocklyRemoveOrphanedShadows(),this.setState({changed:!0}),this.onChange()}async componentDidUpdate(){if(!this.blockly||(this.didUpdate&&(clearTimeout(this.didUpdate),this.didUpdate=null),this.blocklyWorkspace))return;window.addEventListener("resize",this.onResizeBind,!1),fg=fg||await this.getToolbox(),$g=$g||Fe.Blockly.utils.xml.textToDom(fg),this.blocklyWorkspace=Fe.Blockly.inject(this.blockly,{renderer:"thrasos",theme:this.state.themeType==="dark"?uw:"classic",media:"google-blockly/media/",toolbox:$g,zoom:{controls:!0,wheel:!1,startScale:1,maxScale:3,minScale:.3,scaleSpeed:1.2,pinch:!0},move:{scrollbars:{horizontal:!0,vertical:!0},drag:!0,wheel:!0},trashcan:!0,grid:{spacing:25,length:1,snap:!0},sounds:!1}),window.scripts={blocklyWorkspace:this.blocklyWorkspace},this.blocklyWorkspace.registerToolboxCategoryCallback("PROCEDURE",window.Blockly.Procedures.flyoutCategoryNew),this.blocklyWorkspace.addChangeListener(i=>{var r;if(this.someSelected&&Date.now()-this.someSelectedTime>500){const l=(r=this.blocklyWorkspace)==null?void 0:r.getAllBlocks();this.someSelected=null,l==null||l.forEach(u=>u.removeSelect())}[Fe.Blockly.Events.UI,Fe.Blockly.Events.CREATE,Fe.Blockly.Events.VIEWPORT_CHANGE].includes(i.type)||this.ignoreChanges||(this.changeTimer&&clearTimeout(this.changeTimer),this.changeTimer=setTimeout(()=>{this.changeTimer=null,this.onBlocklyChanged()},200))}),this.loadCode(),this.onResize();const s=document.getElementsByClassName("blocklyToolboxDiv")[0];this.blockly.appendChild(s),this.updateBackground(),setTimeout(()=>this.searchId(),200)}updateBackground(){var s;this.state.themeType==="dark"?(s=this.blocklyWorkspace)==null||s.setTheme(uw):this.blocklyWorkspace&&(this.blocklyWorkspace.getThemeManager(),this.blocklyWorkspace.setTheme(Fe.Blockly.Themes.Classic))}componentWillUnmount(){this.blocklyWorkspace&&(this.blocklyWorkspace.dispose(),this.blocklyWorkspace=null,this.changeTimer&&clearTimeout(this.changeTimer),this.changeTimer=null,window.removeEventListener("resize",this.onResizeBind))}onChange(){this.originalCode=this.blocklyCode2JSCode(),this.props.onChange&&this.props.onChange(this.originalCode)}async getToolbox(s){const i=window.document.getElementById("toolbox");let r=i==null?void 0:i.outerHTML;if(!r)return s?(console.error("Cannot load blocks!"),""):new Promise(l=>{setTimeout(()=>l(this.getToolbox(!0)),500)});if(r=r.replace(/{(\w+)}/g,(l,u)=>window.MSG[u]),window.Blockly.CustomBlocks){let l="";const u=b.I18n.getLanguage();for(let d=0;d`;for(const f in m.blocks)Object.prototype.hasOwnProperty.call(m.blocks,f)&&(l+=m.blocks[f]);l+=""}r=r.replace("%%CUSTOM_BLOCKS%%",l)}return r}renderMessageDialog(){return this.state.message?g.jsx(b.Message,{text:typeof this.state.message=="object"?this.state.message.text:this.state.message,title:typeof this.state.message=="object"?this.state.message.title:"",onClose:()=>this.setState({message:""})},"dialogMessage"):null}renderErrorDialog(){return this.state.error?g.jsx(Zc,{text:typeof this.state.error=="object"?this.state.error.text.toString():this.state.error,title:typeof this.state.error=="object"?this.state.error.title:"",onClose:()=>{this.blinkBlock&&(Fe.blocklyBlinkBlock(this.blinkBlock),this.blinkBlock=null),this.setState({error:""})}},"dialogError"):null}renderExportDialog(){return this.state.exportText?g.jsx(Q0,{themeType:this.state.themeType,onClose:()=>this.setState({exportText:""}),text:this.state.exportText,scriptId:this.props.scriptId},"dialogExport"):null}renderImportDialog(){return this.state.importText?g.jsx(zm,{themeType:this.props.themeType,onClose:s=>{this.setState({importText:!1}),this.onImportBlocks(s)}},"dialogImport"):null}renderDialogPrompt(){return this.state.showInputPrompt?g.jsxs(Gt,{onClose:()=>{var i;const s=(i=this.state.showInputPrompt)==null?void 0:i.callback;s&&s(null),this.setState({showInputPrompt:null})},maxWidth:"sm",fullWidth:!0,open:!0,children:[g.jsx(as,{children:this.state.showInputPrompt.promptText}),g.jsx(Vt,{children:g.jsx(vo,{variant:"standard",fullWidth:!0,autoFocus:!0,value:this.state.showInputPrompt.value,onKeyUp:s=>{var i,r;if(s.key==="Enter"){const l=(i=this.state.showInputPrompt)==null?void 0:i.callback,u=(r=this.state.showInputPrompt)==null?void 0:r.value;l&&l(u===void 0?null:u),this.setState({showInputPrompt:null})}},onChange:s=>{var r,l;const i={...this.state.showInputPrompt};(r=this.state.showInputPrompt)!=null&&r.callback&&(i.callback=(l=this.state.showInputPrompt)==null?void 0:l.callback),i.value=s.target.value,this.setState({showInputPrompt:i})}})}),g.jsxs(Kt,{children:[g.jsx(De,{variant:"contained",disabled:!this.state.showInputPrompt.value,onClick:()=>{var r,l;const s=(r=this.state.showInputPrompt)==null?void 0:r.callback,i=(l=this.state.showInputPrompt)==null?void 0:l.value;s&&s(i===void 0?null:i),this.setState({showInputPrompt:null})},color:"primary",startIcon:g.jsx(zo,{}),children:b.I18n.t("Apply")}),g.jsx(De,{color:"grey",variant:"contained",onClick:()=>{var i;const s=(i=this.state.showInputPrompt)==null?void 0:i.callback;s&&s(null),this.setState({showInputPrompt:null})},startIcon:g.jsx(qs,{}),children:b.I18n.t("Close")})]})]},"inputDialog"):null}render(){return this.state.languageBlocklyLoaded&&this.state.languageOwnLoaded?(this.didUpdate=setTimeout(()=>{this.didUpdate=null,this.componentDidUpdate()},100),[g.jsx("div",{ref:s=>this.blockly=s,style:{width:"100%",height:"100%",position:"relative"}},"blocklyDOM"),this.renderDialogPrompt(),this.renderMessageDialog(),this.renderErrorDialog(),this.renderExportDialog(),this.renderImportDialog()]):null}}const fR=Object.freeze(Object.defineProperty({__proto__:null,default:Fe},Symbol.toStringTag,{value:"Module"})),$R="_nameCard_15el3_28",bR="_iconThemCard_15el3_40",vR="_iconThemCardSelectable_15el3_49",yR="_iconHelp_15el3_53",_R="_blockName_15el3_64",wR="_controlMenuTop_15el3_123",CR="_debugInfo_15el3_132",TR="_tagCard_15el3_142",kR="_displayFlex_15el3_161",SR="_blockMarginTop_15el3_166",ER="_nameBlock_15el3_167",IR="_frontText_15el3_171",xR="_backText_15el3_177",DR="_iconTag_15el3_181",AR="_displayItalic_15el3_191",le={nameCard:$R,iconThemCard:bR,iconThemCardSelectable:vR,iconHelp:yR,blockName:_R,controlMenuTop:wR,debugInfo:CR,tagCard:TR,displayFlex:kR,blockMarginTop:SR,nameBlock:ER,frontText:IR,backText:xR,iconTag:DR,displayItalic:AR},RR="_root_1dr6a_1",OR="_square_1dr6a_11",MR="_icon_1dr6a_16",bg={root:RR,square:OR,icon:MR},Ur=({fullWidth:a,size:s,onClick:i,style:r,className:l,value:u,square:d,icon:p})=>g.jsx(De,{variant:"outlined",color:"primary",onClick:i,fullWidth:a,style:r,className:b.Utils.clsx(bg.root,l,d?bg.square:""),size:s||"medium",children:p?g.jsx(b.Icon,{className:bg.icon,src:p}):u}),NR="_root_1ucda_1",LR={root:NR},PR=({size:a,value:s,title:i,onChange:r,className:l,customValue:u,disabled:d})=>{const[p,m]=vt(!1);return g.jsxs(g.Fragment,{children:[g.jsx(bc,{disabled:d,checked:!!(u?s:p),className:b.Utils.clsx(LR.root,l),onChange:f=>{u&&m(f.target.checked),r&&r(f.target.checked)},size:a||"medium"}),i||null]})},TT=am(PR),BR="_root_19roy_1",hw={root:BR},bi=a=>{const[s,i]=vt(""),{value:r,type:l,error:u,className:d,icon:p,label:m,style:f,onChange:v,fullWidth:_,autoComplete:y,customValue:k,autoFocus:C,rows:w,size:E,variant:R,multiline:D,disabled:A}=Object.assign({value:"",type:"text",error:"",className:null,table:!1,native:{},variant:"standard",size:"medium",component:null,styleComponentBlock:null,fullWidth:!1,autoComplete:"",customValue:!1,autoFocus:!1,rows:1},a);return g.jsx(vo,{error:!!u,autoFocus:C,fullWidth:_,label:m,disabled:A,variant:R,multiline:D,rows:w,value:k?r:s,type:l,helperText:u,style:f,className:b.Utils.clsx(hw.root,d),autoComplete:y,onChange:J=>{!k&&i(J.target.value),v&&v(J.target.value)},slotProps:{input:{endAdornment:p?g.jsx(xw,{position:"end",children:g.jsx(b.Icon,{className:hw.icon,src:p})}):null}},margin:"normal",size:E})},jR={formControl:{m:"10px 0","& .MuiFormControl-marginNormal":{mt:0,mb:0},"& > *":{color:"#2d0440 !important"},"& .MuiSelect-icon":{color:"#81688c"},"& label.Mui-focused":{color:"#81688c"},"& .MuiInput-underline:after":{borderBottomColor:"#510573"},"& .MuiInput-underline:before":{borderBottomColor:"#81688c"},"& .MuiInput-underline:hover:before":{borderBottomColor:"#81688c"}}},FR=({multiple:a,value:s,customValue:i,socket:r,title:l,attr:u,adapter:d,style:p,onChange:m,onInstanceHide:f})=>{const[v,_]=vt(s||"test1"),[y,k]=vt([]);return Mt(()=>{r==null||r.getAdapterInstances(d).then(C=>{const w=C.map(E=>({value:E._id.replace("system.adapter.",""),title:E._id.replace("system.adapter.","")}));w.length===1?f(w[0].value):w.unshift({value:d,title:b.I18n.t("All")}),k(w)})},[r,d,f]),g.jsxs(_i,{sx:jR.formControl,fullWidth:!0,style:p,children:[g.jsx(wi,{variant:"standard",value:(i?s:v)||"_",fullWidth:!0,multiple:a,renderValue:C=>a&&Array.isArray(C)?C.join(", "):C,onChange:C=>{!i&&_(C.target.value),m(C.target.value)},input:u?g.jsx(Dn,{name:u,id:`${u}-helper`}):g.jsx(Dn,{name:u}),children:y.map(C=>g.jsx(Ge,{style:{placeContent:"space-between"},value:C.value||"_",children:b.I18n.t(C.title)},`key-${C.value}`))}),l?g.jsx(Aw,{children:b.I18n.t(l)}):null]})},zR="_modalWrapper_587ci_33",UR="_modalDialog_587ci_40",pw={modalWrapper:zR,modalDialog:UR},nm=({onClose:a,children:s,titleButtonApply:i,titleButtonClose:r,onApply:l,className:u,textInput:d,defaultValue:p,disabled:m})=>{const[f,v]=vt(p||""),[_]=vt(p||"");return g.jsxs(Gt,{open:!0,maxWidth:"md",disableEscapeKeyDown:!1,onClose:a,classes:{paper:pw.modalDialog},className:pw.modalWrapper,children:[g.jsxs(Vt,{children:[d&&g.jsx(bi,{className:u,autoComplete:"off",fullWidth:!0,variant:"outlined",size:"medium",rows:10,multiline:!0,value:f,onChange:v,customValue:!0}),!d&&s]}),g.jsxs(Kt,{children:[g.jsx(De,{disabled:m===void 0?_===f:m,onClick:()=>l(d?f:null),variant:"contained",color:"primary",children:b.I18n.t(i||"Ok")}),g.jsx(De,{color:"grey",onClick:a,variant:"contained",children:b.I18n.t(r||"Cancel")})]})]})},HR="_root_15mo1_1",WR={root:HR},GR=({multiple:a,value:s,customValue:i,title:r,attr:l,options:u,style:d,onChange:p,className:m,doNotTranslate:f,doNotTranslate2:v})=>{const[_,y]=vt(s===void 0?u[0].value:s),k=i?s:_,C=k===""||k===null||k===void 0?"_":k;return g.jsxs(_i,{variant:"standard",className:b.Utils.clsx(WR.root,m),fullWidth:!0,style:d,children:[g.jsxs(wi,{variant:"standard",value:C,fullWidth:!0,multiple:a,renderValue:w=>{if(a&&Array.isArray(w)){w.sort();let R=w.indexOf("0");R!==-1&&(w.splice(R,1),w.push("0")),R=w.indexOf("_"),R!==-1&&(w.splice(R,1),w.unshift("_"));const D=u.find(J=>J.only);return D&&w.includes(D.value)?D.titleShort?f?D.titleShort:b.I18n.t(D.titleShort):f?D.title:b.I18n.t(D.title):w.map(J=>u.find(ie=>ie.value===J||J==="_"&&ie.value==="")||J).map(J=>typeof J=="object"?J.titleShort?f?J.titleShort:b.I18n.t(J.titleShort):f?J.title:b.I18n.t(J.title):f?J:b.I18n.t(J)).join(", ")}const E=u?u.find(R=>R.value===w||w==="_"&&R.value===""):null;return E!=null&&E.title?f?E==null?void 0:E.title:b.I18n.t(E==null?void 0:E.title):w},onChange:w=>{if(i||y(w.target.value),a){const E=w.target.value,R=u.find(D=>D.only);if(R){const D=R.value;if(E.length===u.length-1&&E.includes(D))return p(E.filter(A=>A!==D),l);if(E.includes(D))return p(u.map(A=>A.value),l)}}p(w.target.value,l)},input:l?g.jsx(Dn,{name:l,id:`${l}-helper`}):g.jsx(Dn,{name:l}),children:[!a&&(u==null?void 0:u.map(w=>g.jsxs(Ge,{style:{placeContent:"space-between"},value:w.value===""||w.value===null||w.value===void 0?"_":w.value,children:[f?w.title:b.I18n.t(w.title),w.title2&&g.jsx("div",{children:v?w.title2:b.I18n.t(w.title2)})]},`key-${w.value}`))),a&&(u==null?void 0:u.map(w=>g.jsxs(Ge,{style:{placeContent:"space-between"},value:w.value||"_",children:[f?w.title:b.I18n.t(w.title)," ",g.jsx(TT,{customValue:!0,value:s==null?void 0:s.includes(w.value)})]},`key-${w.value}`)))]}),r?g.jsx(Aw,{children:b.I18n.t(r)}):null]})},VR="_root_1gt4d_1",KR="_mark_1gt4d_27",gw={root:VR,mark:KR},YR=({size:a,value:s,style:i,onChange:r,className:l,customValue:u,min:d,max:p,step:m,unit:f})=>{const[v,_]=vt(0);d=d!==void 0?d:0,p=p!==void 0?p:0,m=m!==void 0?m:(p-d)/100;const y=[{value:d,label:d+(f||"")},{value:p,label:p+(f||"")}];return g.jsx(Kk,{defaultValue:u?s:v,"aria-labelledby":"discrete-slider",valueLabelDisplay:"auto",classes:{mark:gw.mark},marks:y,step:m,min:d,max:p,value:u?s:v,style:i,className:b.Utils.clsx(gw.root,l),onChange:(k,C)=>{Array.isArray(C)?(!u&&_(C[0]),r(C[0])):(!u&&_(C),r(C))},size:a||"medium"})},JR="_root_rzul6_1",qR={root:JR},XR=({label:a,size:s,value:i,style:r,onChange:l,className:u,customValue:d})=>{const[p,m]=vt(!1);return g.jsx(Ag,{className:qR.root,control:g.jsx(Rw,{checked:d?i:p,style:r,className:u,onChange:f=>{d||m(f.target.checked),l(f.target.checked)},size:s||"medium"}),label:a??"all"})},ZR=am(XR),QR="_root_135pm_1",eO={root:QR},tO=({value:a,style:s,onChange:i,className:r})=>g.jsx(vo,{variant:"standard",id:"time",type:"time",onChange:l=>i(l.currentTarget.value),value:a,className:b.Utils.clsx(eO.root,r),fullWidth:!0,style:s,slotProps:{htmlInput:{step:300},inputLabel:{shrink:!0}}}),sO="_root_135pm_1",lc={root:sO},vg=[31,29,31,30,31,30,31,31,30,31,30,31],oO=({value:a,onChange:s,className:i,style:r})=>{const[l,u]=(a||"01.01").toString().split(".");let d=parseInt(u,10)||0,p=parseInt(l,10)||0;p>12?p=12:p<0&&(p=0),d>vg[p]?d=vg[p]:d<0&&(d=0);const m=[];for(let f=0;fs(`${f.target.value.toString().padStart(2,"0")}.${d.toString().padStart(2,"0")}`),value:p,children:[g.jsx(Ge,{style:{placeContent:"space-between"},value:0,children:b.I18n.t("Any month")},0),g.jsx(Ge,{style:{placeContent:"space-between"},value:1,children:b.I18n.t("January")},1),g.jsx(Ge,{style:{placeContent:"space-between"},value:2,children:b.I18n.t("February")},2),g.jsx(Ge,{style:{placeContent:"space-between"},value:3,children:b.I18n.t("March")},3),g.jsx(Ge,{style:{placeContent:"space-between"},value:4,children:b.I18n.t("April")},4),g.jsx(Ge,{style:{placeContent:"space-between"},value:5,children:b.I18n.t("May")},5),g.jsx(Ge,{style:{placeContent:"space-between"},value:6,children:b.I18n.t("June")},6),g.jsx(Ge,{style:{placeContent:"space-between"},value:7,children:b.I18n.t("July")},7),g.jsx(Ge,{style:{placeContent:"space-between"},value:8,children:b.I18n.t("August")},8),g.jsx(Ge,{style:{placeContent:"space-between"},value:9,children:b.I18n.t("September")},9),g.jsx(Ge,{style:{placeContent:"space-between"},value:10,children:b.I18n.t("October")},10),g.jsx(Ge,{style:{placeContent:"space-between"},value:11,children:b.I18n.t("November")},11),g.jsx(Ge,{style:{placeContent:"space-between"},value:12,children:b.I18n.t("December")},12)]})}),g.jsx(_i,{variant:"standard",className:b.Utils.clsx(lc.root,i),style:r,children:g.jsxs(wi,{variant:"standard",className:b.Utils.clsx(lc.root,i),margin:"dense",label:b.I18n.t("Date"),onChange:f=>s(`${p.toString().padStart(2,"0")}.${f.target.value.toString().padStart(2,"0")}`),value:d,children:[g.jsx(Ge,{style:{placeContent:"space-between"},value:0,children:b.I18n.t("Any")},"A"),m.map(f=>g.jsx(Ge,{style:{placeContent:"space-between"},value:f,children:f},f))]})})]})},yg={},iO={Shuffle:mx,Apps:ox,Functions:cx,Language:yS,AddBox:sx,Pause:gc,Subject:$x,PlayForWork:px,Brightness3:ix,HelpOutline:dC,Storage:fx,AccessTime:tx,PlayArrow:Fg,FlashOn:ax};function mw({iconName:a,className:s,adapter:i,socket:r,onClick:l,style:u}){const[d,p]=vt("");if(Mt(()=>{i&&r&&(yg[i]instanceof Promise||(yg[i]=r.getObject(`system.adapter.${i}`)),yg[i].then(f=>{var v;return((v=f==null?void 0:f.common)==null?void 0:v.icon)&&p(`../../adapter/${i}/${f.common.icon}`)}))},[i,r]),i)return g.jsx("img",{onClick:f=>l&&l(f),src:d||"",className:s,style:u,alt:""});const m=a&&iO[a]||_S;return g.jsx(m,{className:s,style:u,onClick:f=>l&&l(f)})}let _g;function nO(a){return _g=_g||b.I18n.getLanguage(),a&&typeof a=="object"?a[_g]||a.en:a||""}function xn(a){return a===null?"null":a===void 0?"undefined":Array.isArray(a)?a.join(", "):typeof a=="object"?JSON.stringify(a):a.toString()}class Xe extends Ew{debugHideTimeout=null;lastObjectIdChange=0;enableSimulationProcessing=!1;lastDebugMessage=0;debugMessageTimeout=null;static getStaticData(){return{acceptedBy:"actions",name:"Not found",id:"ActionEmpty",icon:"Shuffle"}}static compile(s,i){return""}constructor(s,i){super(s),i||={};const r=s.settings||{tagCard:i.tagCardArray?typeof i.tagCardArray[0]!="string"?i.tagCardArray[0].title:i.tagCardArray[0]:""};!r.tagCard&&i.tagCardArray&&(r.tagCard=typeof i.tagCardArray[0]!="string"?i.tagCardArray[0].title:i.tagCardArray[0]),this.state={inputs:i.inputs||s.inputs||[],name:i.name||s.name||"",icon:i.icon||s.icon||"",adapter:i.adapter||s.adapter||"",helpDialog:i.helpDialog||s.helpDialog||"",tagCardArray:i.tagCardArray||[],openTagMenu:!1,openModal:!1,iconTag:!1,error:"",helpText:"",instanceSelectionOptions:[],instanceSelectionDef:"",hideAttributes:[],settings:r,debugMessage:null,enableSimulation:this.props.enableSimulation}}componentWillUnmount(){this.debugMessageTimeout&&(clearTimeout(this.debugMessageTimeout),this.debugMessageTimeout=null),this.debugHideTimeout&&(clearTimeout(this.debugHideTimeout),this.debugHideTimeout=null)}onTagChange(s,i,r,l,u){let d=!1;const p=JSON.parse(JSON.stringify(this.state.settings));this.state.inputs.forEach(m=>{const f=m.attr,v=m.defaultValue;f&&v!==void 0&&p[f]===void 0&&(d=!0,p[f]=v)}),d?(this.setState({settings:p},()=>i==null?void 0:i()),this.props.onChange(p)):i&&i()}onUpdate(){}onValueChanged(s,i){}renderText(s,i,r){const{className:l}=this.props,{attr:u,frontText:d,backText:p,nameBlock:m,name:f,doNotTranslate:v,doNotTranslateBack:_}=s;return g.jsxs(Sg,{children:[g.jsxs("div",{className:b.Utils.clsx(le.displayFlex,le.blockMarginTop),children:[d&&g.jsx("div",{className:le.frontText,children:v?d:b.I18n.t(d)}),g.jsx(bi,{className:l,autoComplete:"off",label:nO(f),variant:"outlined",size:"small",fullWidth:!0,value:i,onChange:r,customValue:!0}),p&&g.jsx("div",{className:le.backText,children:_?p:b.I18n.t(p)})]}),m&&g.jsx("div",{className:le.nameBlock,children:b.I18n.t(m)})]},u)}renderSwitch(s,i,r){const{className:l}=this.props,{attr:u,frontText:d,backText:p,nameBlock:m,doNotTranslate:f,doNotTranslateBack:v}=s;return g.jsxs("div",{children:[g.jsxs("div",{className:b.Utils.clsx(le.displayFlex,le.blockMarginTop),children:[d&&g.jsx("div",{className:le.frontText,children:f?d:b.I18n.t(d)}),g.jsx(ZR,{className:l,label:"",customValue:!0,value:i,onChange:r}),p&&g.jsx("div",{className:le.backText,children:v?p:b.I18n.t(p)})]}),m&&g.jsx("div",{className:le.nameBlock,children:b.I18n.t(m)})]},u)}renderNameText({attr:s,signature:i,doNotTranslate:r,defaultValue:l},u){return g.jsx("div",{className:b.Utils.clsx(i?le.displayItalic:le.displayFlex,le.blockMarginTop),children:u?r?u:b.I18n.t(u):r?l:b.I18n.t(l)},s)}renderNumber(s,i,r){const{className:l}=this.props,{settings:u}=this.state,{attr:d,backText:p,frontText:m,openCheckbox:f,doNotTranslate:v,doNotTranslateBack:_}=s;let y=!0;return f&&(y=typeof u.offset=="boolean"?u.offset:!0),y?g.jsxs("div",{className:b.Utils.clsx(le.displayFlex,le.blockMarginTop),children:[m&&g.jsx("div",{className:le.frontText,children:v?m:b.I18n.t(m)}),g.jsx(bi,{className:b.Utils.clsx(l,s.className),fullWidth:!0,autoComplete:"off",label:s.noHelperText?"":"number",variant:"outlined",size:"small",type:"number",value:i,onChange:r,customValue:!0}),p&&g.jsx("div",{className:le.backText,children:_?p:b.I18n.t(p)})]},d):null}renderColor(s,i,r){const{className:l}=this.props,{attr:u,backText:d,frontText:p,doNotTranslate:m,doNotTranslateBack:f}=s;return g.jsxs("div",{className:b.Utils.clsx(le.displayFlex,le.blockMarginTop),children:[p&&g.jsx("div",{className:le.frontText,children:m?p:b.I18n.t(p)}),g.jsx(bi,{className:l,autoComplete:"off",fullWidth:!0,variant:"outlined",size:"small",type:"color",value:i,onChange:r}),d&&g.jsx("div",{className:le.backText,children:f?d:b.I18n.t(d)})]},u)}renderCheckbox(s,i,r){const{className:l}=this.props,{settings:u}=this.state,{attr:d,backText:p,frontText:m,defaultValue:f,doNotTranslate:v,doNotTranslateBack:_}=s;return g.jsxs("div",{className:le.displayFlex,children:[m&&g.jsx("div",{className:le.frontText,children:v?m:b.I18n.t(m)}),g.jsx(TT,{className:l,size:"small",value:typeof u[d]=="boolean"?!!u[d]:!!f,customValue:!0,onChange:r}),p&&g.jsx("div",{onClick:()=>r(typeof u[d]=="boolean"?!u[d]:!f),className:le.backText,children:_?p:b.I18n.t(p)})]},d)}renderSlider(s,i,r){const{className:l}=this.props,{attr:u,frontText:d,backText:p,nameBlock:m,min:f,max:v,step:_,unit:y,doNotTranslate:k,doNotTranslateBack:C}=s;return g.jsxs("div",{children:[g.jsxs("div",{className:le.displayFlex,style:{marginRight:20},children:[d&&g.jsx("div",{className:le.frontText,children:k?d:b.I18n.t(d)}),g.jsx(YR,{customValue:!0,min:f,max:v,step:_,unit:y,className:l,autoComplete:"off",label:"number",variant:"outlined",size:"small",value:i,onChange:w=>{console.log(w),r(w)}}),p&&g.jsx("div",{style:{marginLeft:20},className:le.backText,children:C?p:b.I18n.t(p)})]}),m&&g.jsx("div",{className:le.nameBlock,children:b.I18n.t(m)})]},u)}renderButton(s,i,r){const{className:l}=this.props,{attr:u,frontText:d,backText:p,doNotTranslate:m,doNotTranslateBack:f}=s;return g.jsxs("div",{className:b.Utils.clsx(le.displayFlex,le.blockMarginTop),children:[d&&g.jsx("div",{className:le.frontText,children:m?d:b.I18n.t(d)}),g.jsx(Ur,{fullWidth:!0,value:i.toString(),className:l,onClick:()=>r(i)}),p&&g.jsx("div",{className:le.backText,children:f?p:b.I18n.t(p)})]},u)}async findIcon(s){var i;if(!s)return null;if((i=s.common)!=null&&i.icon)return b.getSelectIdIcon(s,"../..");if(s.type==="state"||s.type==="channel"){const r=s._id.split(".");r.pop();const l=r.join(".");try{const u=await this.props.socket.getObject(l);return await this.findIcon(u)}catch{return null}}return null}renderObjectID(s,i,r){const{attr:l,openCheckbox:u,checkReadOnly:d}=s,{settings:p}=this.state,m=this.state[`showSelectId${l}`],{className:f,socket:v,style:_}=this.props;let y=!0;u&&(y=typeof p.offset=="boolean"?p.offset:!0);const k=p[l],C=k?this.state[k]:void 0;return k&&!C&&C!==!1&&setTimeout(async w=>{var A;const E=await v.getObject(i),R=await this.findIcon(E),D={[w]:E||!1,[`${w}___icon`]:R,error:d&&this.lastObjectIdChange&&Date.now()-this.lastObjectIdChange<1e3&&((A=E==null?void 0:E.common)==null?void 0:A.write)===!1?b.I18n.t("Read only ID selected: %s",p[w]):""};this.setState(D)},0,k),y?g.jsxs("div",{className:le.blockMarginTop,children:[g.jsxs("div",{className:le.displayFlex,children:[s.title?g.jsx("div",{children:b.I18n.t(s.title)}):null,g.jsx(bi,{className:f,style:_,autoComplete:"off",fullWidth:!0,disabled:!0,variant:"outlined",size:"small",value:i,customValue:!0}),g.jsx(Ur,{icon:this.state[`${k}___icon`],square:!0,style:{..._||void 0,marginLeft:7},value:"...",className:f,onClick:()=>{const w={};w[`showSelectId${l}`]=!0,this.setState(w)}})]}),C?g.jsx("div",{className:b.Utils.clsx(le.nameBlock,le.displayItalic),children:b.Utils.getObjectNameFromObj(C,b.I18n.getLanguage())}):null,m?g.jsx(b.DialogSelectID,{theme:this.props.theme,imagePrefix:"../..",dialogName:"javascript",themeType:b.Utils.getThemeName(),socket:v,selected:i,onClose:()=>{const w={};w[`showSelectId${l}`]=!1,this.setState(w)},onOk:(w,E)=>{const R={};R[`showSelectId${l}`]=!1;const D=Array.isArray(w)?w[0]:w;this.setState(R,async()=>{var J,ie,se,me,z,Oe,Ne,Ze,ae,ce;const A=D?await v.getObject(D):void 0;this.lastObjectIdChange=Date.now(),r({[l]:w,[`${l}Role`]:(J=A==null?void 0:A.common)==null?void 0:J.role,[`${l}Type`]:(ie=A==null?void 0:A.common)==null?void 0:ie.type,[`${l}Unit`]:(se=A==null?void 0:A.common)==null?void 0:se.unit,[`${l}States`]:(me=A==null?void 0:A.common)==null?void 0:me.states,[`${l}Min`]:(z=A==null?void 0:A.common)==null?void 0:z.min,[`${l}Max`]:(Oe=A==null?void 0:A.common)==null?void 0:Oe.max,[`${l}Step`]:(Ne=A==null?void 0:A.common)==null?void 0:Ne.step,[`${l}Def`]:(Ze=A==null?void 0:A.common)==null?void 0:Ze.def,[`${l}Write`]:(ae=A==null?void 0:A.common)==null?void 0:ae.write,[`${l}Read`]:(ce=A==null?void 0:A.common)==null?void 0:ce.read},()=>this.props.setOnUpdate&&this.props.setOnUpdate(!0))})}}):null]},l):null}renderIconTag(){return g.jsx("div",{className:le.iconTag,onClick:s=>{this.state.settings.tagCard&&(this.state.tagCardArray.length<3?this.onChangeTag():this.setState({openTagMenu:s.currentTarget}))},children:this.state.settings.tagCard})}renderTime(s,i,r){const{attr:l,backText:u,frontText:d,doNotTranslate:p,doNotTranslateBack:m}=s;return g.jsxs("div",{className:le.displayFlex,style:{whiteSpace:"nowrap"},children:[d&&g.jsx("div",{className:le.frontText,children:p?d:b.I18n.t(d)}),g.jsx(tO,{value:i,onChange:r}),u&&g.jsx("div",{className:le.backText,children:m?u:b.I18n.t(u)})]},l)}renderSelect(s,i,r){const{className:l,style:u}=this.props,{name:d,options:p,frontText:m,backText:f,attr:v,multiple:_,doNotTranslate:y,doNotTranslate2:k,doNotTranslateBack:C}=s;return g.jsxs("div",{className:b.Utils.clsx(le.displayFlex,le.blockMarginTop),style:{whiteSpace:"nowrap"},children:[m&&g.jsx("div",{className:le.frontText,children:b.I18n.t(m)}),g.jsx(GR,{attr:v,doNotTranslate:y,doNotTranslate2:k,title:d,className:l,style:u,options:p,value:i,onChange:r,multiple:_,customValue:!0}),f&&g.jsx("div",{className:le.backText,children:C?f:b.I18n.t(f)})]},v)}renderInstance(s,i,r){const{socket:l}=this.props,{name:u,frontText:d,backText:p,attr:m,adapter:f,doNotTranslate:v,doNotTranslateBack:_}=s;return this.state.hideAttributes.includes(m)?null:g.jsxs("div",{className:b.Utils.clsx(le.displayFlex,le.blockMarginTop),style:{whiteSpace:"nowrap"},children:[d&&g.jsx("div",{className:le.frontText,children:v?d:b.I18n.t(d)}),g.jsx(FR,{attr:m,socket:l,adapter:f,title:u,value:i,onChange:y=>{r(Array.isArray(y)?y[0]:y)},customValue:!0,onInstanceHide:y=>this.setState({hideAttributes:[...this.state.hideAttributes,m]},()=>r(y))}),p&&g.jsx("div",{className:le.backText,children:_?p:b.I18n.t(p)})]},m)}renderDialog(s){const{onShowDialog:i,frontText:r,backText:l,attr:u,icon:d,doNotTranslate:p,doNotTranslateBack:m}=s;return g.jsxs("div",{className:b.Utils.clsx(le.displayFlex,le.blockMarginTop),style:{whiteSpace:"nowrap"},children:[r&&g.jsx("div",{className:le.frontText,children:p?r:b.I18n.t(r)}),g.jsx(mw,{iconName:d,className:b.Utils.clsx(le.iconDialog),onClick:()=>i&&i()}),l&&g.jsx("div",{className:le.backText,children:m?l:b.I18n.t(l)})]},u)}renderModalInput(s,i,r){const{openModal:l}=this.state,{className:u}=this.props,{attr:d,nameBlock:p,frontText:m,backText:f,noTextEdit:v,doNotTranslate:_,doNotTranslateBack:y}=s;return g.jsxs("div",{children:[g.jsxs("div",{className:b.Utils.clsx(le.displayFlex,le.blockMarginTop),children:[m&&g.jsx("div",{className:le.frontText,children:_?m:b.I18n.t(m)}),g.jsx(bi,{disabled:!!v,className:u,autoComplete:"off",fullWidth:!0,variant:"outlined",size:"small",value:i,onChange:r,customValue:!0}),g.jsx(Ur,{square:!0,style:{marginLeft:5},value:"...",className:u,onClick:()=>this.setState({openModal:!0})}),f&&g.jsx("div",{className:le.backText,children:y?f:b.I18n.t(f)})]}),l?g.jsx(nm,{onApply:k=>this.setState({openModal:!1},()=>k!=null&&r(k)),onClose:()=>this.setState({openModal:!1}),defaultValue:i,textInput:!0}):null,p&&g.jsx("div",{className:le.nameBlock,children:b.I18n.t(p)})]},d)}renderDate(s,i,r){const{attr:l,backText:u,frontText:d,doNotTranslate:p,doNotTranslateBack:m}=s;return g.jsxs("div",{className:le.displayFlex,style:{whiteSpace:"nowrap"},children:[d&&g.jsx("div",{className:le.frontText,children:p?d:b.I18n.t(d)}),g.jsx(oO,{value:i,onChange:r}),u&&g.jsx("div",{className:le.backText,children:m?u:b.I18n.t(u)})]},l)}static getReplacesInText(s){var r;let i="";return(r=s.trigger)!=null&&r.oidType?i=".replace(/%s/g, obj.state.val).replace(/%id/g, obj.id).replace(/%name/g, obj.common && obj.common.name).replace(/%old/g, obj.oldState.val)":s.conditionsStates.length&&(i=`.replace(/%s/g, ${s.conditionsStates[0].name}).replace(/%id/g, "${s.conditionsStates[0].id}")`),i}renderTags(){const{tagCardArray:s,openTagMenu:i}=this.state,{tagCard:r}=this.state.settings;let l=r!=="="&&r!=="<>"&&r!==">="&&r!=="()"&&r!=="."&&r!=="<="&&r!=="<"&&r!==">"&&r?b.I18n.t(r):r;return s.length>=3&&(l=g.jsxs("div",{children:[g.jsx("div",{"aria-controls":"simple-menu","aria-haspopup":"true",onClick:u=>{this.setState({openTagMenu:u.currentTarget},()=>{this.props.isTourOpen&&this.props.tourStep===As.openTagsMenu&&setTimeout(()=>this.props.setTourStep&&this.props.setTourStep(As.selectIntervalTag),300)})},children:l}),g.jsx(cm,{id:"simple-menu",anchorEl:i,keepMounted:!0,open:!!i,onClose:()=>this.setState({openTagMenu:null}),children:s.map((u,d)=>{let p;return typeof u!="string"?p=u.title:p=u,g.jsxs(Ge,{selected:p===r,className:`tag-card-${p}`,style:{placeContent:"space-between"},onClick:m=>{m.stopPropagation(),this.props.isTourOpen&&(this.props.tourStep===As.openTagsMenu||this.props.tourStep===As.selectIntervalTag)&&p==="interval"&&setTimeout(()=>{var v,_;return(_=(v=this.props).setTourStep)==null?void 0:_.call(v,As.selectActions)},500);const f=JSON.parse(JSON.stringify(this.state.settings));f.tagCard=p,this.setState({openTagMenu:null,settings:f},()=>{this.props.onChange(this.state.settings),this.onTagChange(this.state.settings.tagCard)})},children:[p.search(/>|<|<>|<=|>=|=/)!==-1?p:b.I18n.t(p),typeof u!="string"&&u.title2&&g.jsx("div",{style:{marginLeft:4},children:b.I18n.t(u.title2)})]},`${p}_${d}`)})})]})),l}getData(){return{acceptedBy:"triggers",name:"",id:""}}onChangeTag(){const{tagCardArray:s,settings:i,settings:{tagCard:r}}=this.state;let l;if(typeof s[0]!="string"?l=s.map(u=>u.title):l=[...s],r&&l.length<3){const u={...i},d=l[(l.indexOf(r)+1)%l.length];u.tagCard=d,this.setState({settings:u},()=>{this.props.onChange(u),this.onTagChange(d)})}}componentDidMount(){this.onTagChange()}componentDidUpdate(){this.props.acceptedBy!=="triggers"&&this.props.onUpdate&&setTimeout(()=>this.onUpdate(),0)}onChangeInput(s){return(i,r,l)=>{const u=JSON.parse(JSON.stringify(this.state.settings));typeof i=="object"&&(!r||typeof r=="function")?(Object.keys(i).forEach(d=>u[d]=i[d]),typeof r=="function"&&(l=r,r=void 0)):u[r||s]=i,u.id=this.getData().id,u._id=this.props._id,this.setState({settings:u},()=>{this.onValueChanged(i,r||s),this.props.onChange(u),l==null||l()})}}renderSpecific(){return null}renderDebug(s){return""}renderDebugInfo(){return this.state.debugMessage?g.jsx("div",{className:le.debugInfo,style:{opacity:1,height:22,bottom:-22},children:this.renderDebug?this.renderDebug(this.state.debugMessage):b.I18n.t("executed")},this.state.debugMessage.ts):null}renderCron(s,i,r){return null}renderWizard(s,i,r){return null}renderWriteState(){return null}renderInputElement(s,i){const{nameRender:r,defaultValue:l,attr:u}=s,{settings:d}=this.state;let p=u?d[u]:void 0;switch(p===void 0&&(p=l),r){case"renderTime":return u?this.renderTime(s,p,this.onChangeInput(u)):g.jsx("div",{children:b.I18n.t("Invalid renderTime")},`invalid_${i}`);case"renderNameText":return this.renderNameText(s,l);case"renderSelect":return u?this.renderSelect(s,p,this.onChangeInput(u)):g.jsx("div",{children:b.I18n.t("Invalid renderSelect")},`invalid_${i}`);case"renderModalInput":return u?this.renderModalInput(s,p,this.onChangeInput(u)):g.jsx("div",{children:b.I18n.t("Invalid renderModalInput")},`invalid_${i}`);case"renderObjectID":return u?this.renderObjectID(s,p,this.onChangeInput(u)):g.jsx("div",{children:b.I18n.t("Invalid renderObjectID")},`invalid_${i}`);case"renderDialog":return u?this.renderDialog(s):g.jsx("div",{children:b.I18n.t("Invalid renderDialog")},`invalid_${i}`);case"renderInstance":return u?this.renderInstance(s,p,this.onChangeInput(u)):g.jsx("div",{children:b.I18n.t("Invalid renderInstance")},`invalid_${i}`);case"renderText":return u?this.renderText(s,p,this.onChangeInput(u)):g.jsx("div",{children:b.I18n.t("Invalid renderText")},`invalid_${i}`);case"renderSlider":return u?this.renderSlider(s,p,this.onChangeInput(u)):g.jsx("div",{children:b.I18n.t("Invalid renderSlider")},`invalid_${i}`);case"renderCheckbox":return u?this.renderCheckbox(s,p,this.onChangeInput(u)):g.jsx("div",{children:b.I18n.t("Invalid renderCheckbox")},`invalid_${i}`);case"renderButton":return u?this.renderButton(s,p,this.onChangeInput(u)):g.jsx("div",{children:b.I18n.t("Invalid renderButton")},`invalid_${i}`);case"renderColor":return u?this.renderColor(s,p,this.onChangeInput(u)):g.jsx("div",{children:b.I18n.t("Invalid renderColor")},`invalid_${i}`);case"renderSwitch":return u?this.renderSwitch(s,p,this.onChangeInput(u)):g.jsx("div",{children:b.I18n.t("Invalid renderSwitch")},`invalid_${i}`);case"renderDate":return u?this.renderDate(s,p,this.onChangeInput(u)):g.jsx("div",{children:b.I18n.t("Invalid renderDate")},`invalid_${i}`);case"renderCron":return u?this.renderCron(s,p,this.onChangeInput(u)):g.jsx("div",{children:b.I18n.t("Invalid renderCron")},`invalid_${i}`);case"renderWizard":return u?this.renderWizard(s,p,this.onChangeInput(u)):g.jsx("div",{children:b.I18n.t("Invalid renderWizard")},`invalid_${i}`);case"renderWriteState":return this.renderWriteState();case"renderNumber":return u?this.renderNumber(s,p,this.onChangeInput(u)):g.jsx("div",{children:b.I18n.t("Invalid renderNumber")},`invalid_${i}`);default:return this[r]?this[r](s,p,u?this.onChangeInput(u):null):g.jsx("div",{children:b.I18n.t("Invalid input type: %s",r)},`invalid_${i}`)}}render(){var y;const{inputs:s,name:i,icon:r,iconTag:l,settings:u,adapter:d,settings:{tagCard:p},helpDialog:m}=this.state,{socket:f,notFound:v}=this.props;this.state.settings&&!this.state.settings.tagCard&&((y=this.state.tagCardArray)!=null&&y.length)&&setTimeout(()=>{const k=JSON.parse(JSON.stringify(this.state.settings));k.tagCard=typeof this.state.tagCardArray[0]!="string"?this.state.tagCardArray[0].title:this.state.tagCardArray[0],this.setState({settings:k})},50),this.state.enableSimulation!==this.props.enableSimulation&&!this.enableSimulationProcessing&&(this.enableSimulationProcessing=!0,setTimeout(()=>{this.setState({enableSimulation:this.props.enableSimulation},()=>{this.enableSimulationProcessing=!1})},50));let _;if(this.props.onDebugMessage)for(let k=this.props.onDebugMessage.length-1;k>=0;k--){const C=this.props.onDebugMessage[k];if(C.blockId===this.props._id&&C.ts>this.lastDebugMessage&&C.ts>Date.now()-1e3){_=C;break}}return _&&(this.lastDebugMessage=_.ts,this.debugMessageTimeout&&clearTimeout(this.debugMessageTimeout),this.debugHideTimeout&&(clearTimeout(this.debugHideTimeout),this.debugHideTimeout=null),this.debugMessageTimeout=setTimeout(k=>{const C=JSON.parse(k),w=C.hideTimeout||5e3;this.debugMessageTimeout=null,this.setState({debugMessage:C},()=>{this.debugHideTimeout&&clearTimeout(this.debugHideTimeout),this.debugHideTimeout=setTimeout(()=>{this.debugHideTimeout=null,this.setState({debugMessage:null})},w)})},50,JSON.stringify(_))),g.jsxs(Sg,{children:[l?this.renderIconTag():g.jsx(mw,{iconName:r,className:b.Utils.clsx(le.iconThemCard,p&&this.state.tagCardArray.length&&le.iconThemCardSelectable),adapter:d,socket:f,onClick:k=>{p&&(this.state.tagCardArray.length<3?this.onChangeTag():this.setState({openTagMenu:k.currentTarget}))}}),g.jsxs("div",{className:le.blockName,children:[g.jsxs("span",{className:le.nameCard,children:[b.I18n.t(i),v?b.I18n.t("%s not found",u.id):"",m?g.jsx(Me,{className:le.iconHelp,size:"small",onClick:()=>this.setState({helpText:b.I18n.t(m)}),children:g.jsx(dC,{})}):null]}),s.map((k,C)=>this.renderInputElement(k,C))]}),p&&g.jsx("div",{className:le.controlMenuTop,style:{opacity:1,height:22,top:-22},children:g.jsx("div",{onClick:()=>this.onChangeTag(),className:b.Utils.clsx(le.tagCard,"tag-card"),children:this.renderTags()})}),this.renderDebugInfo(),this.state.error?g.jsx(b.DialogError,{title:b.I18n.t("Warning"),text:this.state.error,onClose:()=>this.setState({error:""})}):null,this.state.helpText?g.jsx(b.DialogMessage,{title:b.I18n.t("Instructions"),text:this.state.helpText,onClose:()=>this.setState({helpText:""})}):null,this.renderSpecific()]})}}const fw={en:{name:"Google - English",engine:"google",params:[]},de:{name:"Google - Deutsch",engine:"google",params:[]},ru:{name:"Google - Русский",engine:"google",params:[]},it:{name:"Google - Italiano",engine:"google",params:[]},es:{name:"Google - Espaniol",engine:"google",params:[]},fr:{name:"Google - Français",engine:"google",params:[]},ru_YA:{name:"Yandex - Русский",engine:"yandex",params:["key","voice","emotion","ill","drunk","robot"],voice:["jane","zahar"],emotion:["none","good","neutral","evil","mixed"]},ru_YA_CLOUD:{name:"Yandex Cloud - Русский",engine:"yandexCloud",params:["key","folderID","voice","emotion"],voice:["alyss","oksana","jane","zahar"],emotion:["good","neutral","evil"]},"en-US":{name:"PicoTTS - Englisch US",engine:"PicoTTS",params:[]},"en-GB":{name:"PicoTTS - Englisch GB",engine:"PicoTTS",params:[]},"de-DE":{name:"PicoTTS - Deutsch",engine:"PicoTTS",params:[]},"it-IT":{name:"PicoTTS - Italiano",engine:"PicoTTS",params:[]},"es-ES":{name:"PicoTTS - Espaniol",engine:"PicoTTS",params:[]},"fr-FR":{name:"PicoTTS - Français",engine:"PicoTTS",params:[]},"ru-RU_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"ru-RU",ename:"Tatyana",ssml:!0,name:"Cloud - Русский - Татьяна"},"ru-RU_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"ru-RU",ename:"Maxim",ssml:!0,name:"Cloud - Русский - Максим"},"de-DE_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"de-DE",ename:"Marlene",ssml:!0,name:"Cloud - Deutsch - Marlene"},"de-DE_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"de-DE",ename:"Hans",ssml:!0,name:"Cloud - Deutsch - Hans"},"en-US_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Salli",ssml:!0,name:"Cloud - en-US - Female - Salli"},"en-US_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-US",ename:"Joey",ssml:!0,name:"Cloud - en-US - Male - Joey"},"da-DK_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"da-DK",ename:"Naja",ssml:!0,name:"Cloud - da-DK - Female - Naja"},"da-DK_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"da-DK",ename:"Mads",ssml:!0,name:"Cloud - da-DK - Male - Mads"},"en-AU_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-AU",ename:"Nicole",ssml:!0,name:"Cloud - en-AU - Female - Nicole"},"en-AU_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-AU",ename:"Russell",ssml:!0,name:"Cloud - en-AU - Male - Russell"},"en-GB_CLOUD_Female_Amy":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-GB",ename:"Amy",ssml:!0,name:"Cloud - en-GB - Female - Amy"},"en-GB_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-GB",ename:"Brian",ssml:!0,name:"Cloud - en-GB - Male - Brian"},"en-GB_CLOUD_Female_Emma":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-GB",ename:"Emma",ssml:!0,name:"Cloud - en-GB - Female - Emma"},"en-GB-WLS_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-GB-WLS",ename:"Gwyneth",ssml:!0,name:"Cloud - en-GB-WLS - Female - Gwyneth"},"en-GB-WLS_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-GB-WLS",ename:"Geraint",ssml:!0,name:"Cloud - en-GB-WLS - Male - Geraint"},"cy-GB_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"cy-GB",ename:"Gwyneth",ssml:!0,name:"Cloud - cy-GB - Female - Gwyneth"},"cy-GB_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"cy-GB",ename:"Geraint",ssml:!0,name:"Cloud - cy-GB - Male - Geraint"},"en-IN_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-IN",ename:"Raveena",ssml:!0,name:"Cloud - en-IN - Female - Raveena"},"en-US_CLOUD_Male_Chipmunk":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-US",ename:"Chipmunk",ssml:!0,name:"Cloud - en-US - Male - Chipmunk"},"en-US_CLOUD_Male_Eric":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-US",ename:"Eric",ssml:!0,name:"Cloud - en-US - Male - Eric"},"en-US_CLOUD_Female_Ivy":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Ivy",ssml:!0,name:"Cloud - en-US - Female - Ivy"},"en-US_CLOUD_Female_Jennifer":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Jennifer",ssml:!0,name:"Cloud - en-US - Female - Jennifer"},"en-US_CLOUD_Male_Justin":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-US",ename:"Justin",ssml:!0,name:"Cloud - en-US - Male - Justin"},"en-US_CLOUD_Female_Kendra":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Kendra",ssml:!0,name:"Cloud - en-US - Female - Kendra"},"en-US_CLOUD_Female_Kimberly":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Kimberly",ssml:!0,name:"Cloud - en-US - Female - Kimberly"},"es-ES_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"es-ES",ename:"Conchita",ssml:!0,name:"Cloud - es-ES - Female - Conchita"},"es-ES_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"es-ES",ename:"Enrique",ssml:!0,name:"Cloud - es-ES - Male - Enrique"},"es-US_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"es-US",ename:"Penelope",ssml:!0,name:"Cloud - es-US - Female - Penelope"},"es-US_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"es-US",ename:"Miguel",ssml:!0,name:"Cloud - es-US - Male - Miguel"},"fr-CA_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"fr-CA",ename:"Chantal",ssml:!0,name:"Cloud - fr-CA - Female - Chantal"},"fr-FR_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"fr-FR",ename:"Celine",ssml:!0,name:"Cloud - fr-FR - Female - Celine"},"fr-FR_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"fr-FR",ename:"Mathieu",ssml:!0,name:"Cloud - fr-FR - Male - Mathieu"},"is-IS_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"is-IS",ename:"Dora",ssml:!0,name:"Cloud - is-IS - Female - Dora"},"is-IS_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"is-IS",ename:"Karl",ssml:!0,name:"Cloud - is-IS - Male - Karl"},"it-IT_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"it-IT",ename:"Carla",ssml:!0,name:"Cloud - it-IT - Female - Carla"},"it-IT_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"it-IT",ename:"Giorgio",ssml:!0,name:"Cloud - it-IT - Male - Giorgio"},"nb-NO_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"nb-NO",ename:"Liv",ssml:!0,name:"Cloud - nb-NO - Female - Liv"},"nl-NL_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"nl-NL",ename:"Lotte",ssml:!0,name:"Cloud - nl-NL - Female - Lotte"},"nl-NL_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"nl-NL",ename:"Ruben",ssml:!0,name:"Cloud - nl-NL - Male - Ruben"},"pl-PL_CLOUD_Female_Agnieszka":{gender:"Female",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Agnieszka",ssml:!0,name:"Cloud - pl-PL - Female - Agnieszka"},"pl-PL_CLOUD_Male_Jacek":{gender:"Male",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Jacek",ssml:!0,name:"Cloud - pl-PL - Male - Jacek"},"pl-PL_CLOUD_Female_Ewa":{gender:"Female",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Ewa",ssml:!0,name:"Cloud - pl-PL - Female - Ewa"},"pl-PL_CLOUD_Male_Jan":{gender:"Male",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Jan",ssml:!0,name:"Cloud - pl-PL - Male - Jan"},"pl-PL_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Maja",ssml:!0,name:"Cloud - pl-PL - Female - Maja"},"pt-BR_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"pt-BR",ename:"Vitoria",ssml:!0,name:"Cloud - pt-BR - Female - Vitoria"},"pt-BR_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"pt-BR",ename:"Ricardo",ssml:!0,name:"Cloud - pt-BR - Male - Ricardo"},"pt-PT_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"pt-PT",ename:"Cristiano",ssml:!0,name:"Cloud - pt-PT - Male - Cristiano"},"pt-PT_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"pt-PT",ename:"Ines",ssml:!0,name:"Cloud - pt-PT - Female - Ines"},"ro-RO_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"ro-RO",ename:"Carmen",ssml:!0,name:"Cloud - ro-RO - Female - Carmen"},"sv-SE_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"sv-SE",ename:"Astrid",ssml:!0,name:"Cloud - sv-SE - Female - Astrid"},"tr-TR_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"tr-TR",ename:"Filiz",ssml:!0,name:"Cloud - tr-TR - Female - Filiz"},"ru-RU_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"ru-RU",ename:"Tatyana",ssml:!0,name:"AWS Polly - Русский - Татьяна"},"ru-RU_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"ru-RU",ename:"Maxim",ssml:!0,name:"AWS Polly - Русский - Максим"},"de-DE_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"de-DE",ename:"Marlene",ssml:!0,name:"AWS Polly - Deutsch - Marlene"},"de-DE_AP_Female_Vicky":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"de-DE",ename:"Vicky",ssml:!0,name:"AWS Polly - Deutsch - Vicky"},"de-DE_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"de-DE",ename:"Hans",ssml:!0,name:"AWS Polly - Deutsch - Hans"},"en-US_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Salli",ssml:!0,name:"AWS Polly - en-US - Female - Salli"},"en-US_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Joey",ssml:!0,name:"AWS Polly - en-US - Male - Joey"},"da-DK_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"da-DK",ename:"Naja",ssml:!0,name:"AWS Polly - da-DK - Female - Naja"},"da-DK_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"da-DK",ename:"Mads",ssml:!0,name:"AWS Polly - da-DK - Male - Mads"},"en-AU_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-AU",ename:"Nicole",ssml:!0,name:"AWS Polly - en-AU - Female - Nicole"},"en-AU_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-AU",ename:"Russell",ssml:!0,name:"AWS Polly - en-AU - Male - Russell"},"en-GB_AP_Female_Amy":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB",ename:"Amy",ssml:!0,name:"AWS Polly - en-GB - Female - Amy"},"en-GB_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB",ename:"Brian",ssml:!0,name:"AWS Polly - en-GB - Male - Brian"},"en-GB_AP_Female_Emma":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB",ename:"Emma",ssml:!0,name:"AWS Polly - en-GB - Female - Emma"},"en-GB-WLS_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB-WLS",ename:"Gwyneth",ssml:!0,name:"AWS Polly - en-GB-WLS - Female - Gwyneth"},"en-GB-WLS_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB-WLS",ename:"Geraint",ssml:!0,name:"AWS Polly - en-GB-WLS - Male - Geraint"},"cy-GB_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"cy-GB",ename:"Gwyneth",ssml:!0,name:"AWS Polly - cy-GB - Female - Gwyneth"},"cy-GB_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"cy-GB",ename:"Geraint",ssml:!0,name:"AWS Polly - cy-GB - Male - Geraint"},"en-IN_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-IN",ename:"Raveena",ssml:!0,name:"AWS Polly - en-IN - Female - Raveena"},"en-US_AP_Male_Chipmunk":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Chipmunk",ssml:!0,name:"AWS Polly - en-US - Male - Chipmunk"},"en-US_AP_Male_Eric":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Eric",ssml:!0,name:"AWS Polly - en-US - Male - Eric"},"en-US_AP_Female_Ivy":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Ivy",ssml:!0,name:"AWS Polly - en-US - Female - Ivy"},"en-US_AP_Female_Jennifer":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Jennifer",ssml:!0,name:"AWS Polly - en-US - Female - Jennifer"},"en-US_AP_Male_Justin":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Justin",ssml:!0,name:"AWS Polly - en-US - Male - Justin"},"en-US_AP_Female_Kendra":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Kendra",ssml:!0,name:"AWS Polly - en-US - Female - Kendra"},"en-US_AP_Female_Kimberly":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Kimberly",ssml:!0,name:"AWS Polly - en-US - Female - Kimberly"},"es-ES_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"es-ES",ename:"Conchita",ssml:!0,name:"AWS Polly - es-ES - Female - Conchita"},"es-ES_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"es-ES",ename:"Enrique",ssml:!0,name:"AWS Polly - es-ES - Male - Enrique"},"es-US_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"es-US",ename:"Penelope",ssml:!0,name:"AWS Polly - es-US - Female - Penelope"},"es-US_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"es-US",ename:"Miguel",ssml:!0,name:"AWS Polly - es-US - Male - Miguel"},"fr-CA_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"fr-CA",ename:"Chantal",ssml:!0,name:"AWS Polly - fr-CA - Female - Chantal"},"fr-FR_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"fr-FR",ename:"Celine",ssml:!0,name:"AWS Polly - fr-FR - Female - Celine"},"fr-FR_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"fr-FR",ename:"Mathieu",ssml:!0,name:"AWS Polly - fr-FR - Male - Mathieu"},"is-IS_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"is-IS",ename:"Dora",ssml:!0,name:"AWS Polly - is-IS - Female - Dora"},"is-IS_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"is-IS",ename:"Karl",ssml:!0,name:"AWS Polly - is-IS - Male - Karl"},"it-IT_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"it-IT",ename:"Carla",ssml:!0,name:"AWS Polly - it-IT - Female - Carla"},"it-IT_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"it-IT",ename:"Giorgio",ssml:!0,name:"AWS Polly - it-IT - Male - Giorgio"},"nb-NO_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"nb-NO",ename:"Liv",ssml:!0,name:"AWS Polly - nb-NO - Female - Liv"},"nl-NL_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"nl-NL",ename:"Lotte",ssml:!0,name:"AWS Polly - nl-NL - Female - Lotte"},"nl-NL_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"nl-NL",ename:"Ruben",ssml:!0,name:"AWS Polly - nl-NL - Male - Ruben"},"pl-PL_AP_Female_Agnieszka":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Agnieszka",ssml:!0,name:"AWS Polly - pl-PL - Female - Agnieszka"},"pl-PL_AP_Male_Jacek":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Jacek",ssml:!0,name:"AWS Polly - pl-PL - Male - Jacek"},"pl-PL_AP_Female_Ewa":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Ewa",ssml:!0,name:"AWS Polly - pl-PL - Female - Ewa"},"pl-PL_AP_Male_Jan":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Jan",ssml:!0,name:"AWS Polly - pl-PL - Male - Jan"},"pl-PL_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Maja",ssml:!0,name:"AWS Polly - pl-PL - Female - Maja"},"pt-BR_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pt-BR",ename:"Vitoria",ssml:!0,name:"AWS Polly - pt-BR - Female - Vitoria"},"pt-BR_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"pt-BR",ename:"Ricardo",ssml:!0,name:"AWS Polly - pt-BR - Male - Ricardo"},"pt-PT_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"pt-PT",ename:"Cristiano",ssml:!0,name:"AWS Polly - pt-PT - Male - Cristiano"},"pt-PT_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pt-PT",ename:"Ines",ssml:!0,name:"AWS Polly - pt-PT - Female - Ines"},"ro-RO_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"ro-RO",ename:"Carmen",ssml:!0,name:"AWS Polly - ro-RO - Female - Carmen"},"sv-SE_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"sv-SE",ename:"Astrid",ssml:!0,name:"AWS Polly - sv-SE - Female - Astrid"},"tr-TR_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"tr-TR",ename:"Filiz",ssml:!0,name:"AWS Polly - tr-TR - Female - Filiz"}};class xc extends Xe{constructor(s){super(s,xc.getStaticData())}static compile(s,i){return s.text?`// Sayit ${s.text||""} - const subActionVar${s._id} = "${s.language&&s.language!=="_"?`${s.language};`:""}${s.volume?`${s.volume};`:""}${(s.text||"").replace(/"/g,'\\"')}"${Xe.getReplacesInText(i)}; - _sendToFrontEnd(${s._id}, {text: subActionVar${s._id}}); - await setStateAsync("${s.instance}.tts.text", subActionVar${s._id});`:`// no text defined -_sendToFrontEnd(${s._id}, {text: 'No text defined'});`}renderDebug(s){return`${b.I18n.t("Say:")} ${s.data.text}`}onTagChange(){const s=b.I18n.getLanguage(),r=Object.keys(fw).filter(l=>l.startsWith(s)).map(l=>({title:fw[l].name,value:l}));r.unshift({title:"Default",value:"_"}),this.setState({inputs:[{attr:"instance",nameRender:"renderInstance",adapter:"sayit",defaultValue:"sayit.0",frontText:"Instance:"},{nameRender:"renderSelect",frontText:"Language:",options:r,defaultValue:"_",attr:"language"},{nameRender:"renderNameText",defaultValue:"Volume",attr:"textVol"},{nameRender:"renderSlider",attr:"volume",defaultValue:100,min:0,max:100},{attr:"text",nameRender:"renderModalInput",defaultValue:"Hallo",nameBlock:"",frontText:"Text:"}]},()=>super.onTagChange())}static getStaticData(){return{acceptedBy:"actions",name:"Say It",id:"ActionSayText",adapter:"sayit",title:"Say some text via sayit adapter",helpDialog:"You can use %s in the text to display current trigger value or %id to display the triggered object ID"}}getData(){return xc.getStaticData()}}class Dc extends Xe{constructor(s){super(s,Dc.getStaticData())}static compile(s,i){const r=(s.text||"").replace(/"/g,'\\"');return r?`// Pushover ${s.text||""} - const subActionVar${s._id} = "${r}"${Xe.getReplacesInText(i)}; - _sendToFrontEnd(${s._id}, {text: subActionVar${s._id}}); - sendTo("${s.instance}", "send", { - message: subActionVar${s._id}, - title: "${(s.title||"").replace(/"/g,'\\"')}"${Xe.getReplacesInText(i)}, - sound: "${s.sound}", - priority: ${s.priority} - });`:`// no text defined -_sendToFrontEnd(${s._id}, {text: 'No text defined'});`}renderDebug(s){return`Sent: ${s.data.text}`}onTagChange(){this.setState({inputs:[{nameRender:"renderInstance",adapter:"pushover",frontText:"Instance:",defaultValue:"pushover.0",attr:"instance"},{nameRender:"renderModalInput",attr:"text",defaultValue:"Hello",nameBlock:"",frontText:"Text:"},{nameRender:"renderText",attr:"title",defaultValue:"ioBroker",frontText:"Title:"},{nameRender:"renderSelect",attr:"sound",defaultValue:"magic",frontText:"Sound:",doNotTranslate:!0,options:[{value:"pushover",title:"pushover"},{value:"bike",title:"bike"},{value:"bugle",title:"bugle"},{value:"cashregister",title:"cashregister"},{value:"classical",title:"classical"},{value:"cosmic",title:"cosmic"},{value:"falling",title:"falling"},{value:"gamelan",title:"gamelan"},{value:"incoming",title:"incoming"},{value:"intermission",title:"intermission"},{value:"magic",title:"magic"},{value:"mechanical",title:"mechanical"},{value:"pianobar",title:"pianobar"},{value:"siren",title:"siren"},{value:"spacealarm",title:"spacealarm"},{value:"tugboat",title:"tugboat"},{value:"alien",title:"alien"},{value:"climb",title:"climb"},{value:"persistent",title:"persistent"},{value:"echo",title:"echo"},{value:"updown",title:"updown"},{value:"none",title:"none"}]},{nameRender:"renderSelect",attr:"priority",defaultValue:-1,frontText:"Priority:",options:[{value:-1,title:"quiet"},{value:0,title:"normal"},{value:1,title:"high-priority"},{value:2,title:"acknowledgment"}]}]},()=>super.onTagChange())}static getStaticData(){return{acceptedBy:"actions",name:"Pushover",id:"ActionPushover",adapter:"pushover",title:"Sends message via pushover",helpDialog:"You can use %s in the text to display current trigger value or %id to display the triggered object ID"}}getData(){return Dc.getStaticData()}}class Ac extends Xe{constructor(s){super(s,Ac.getStaticData())}static compile(s,i){const r=(s.text||"").replace(/"/g,'\\"');return r?`// whatsapp ${r||""} - const subActionVar${s._id} = "${(r||"").replace(/"/g,'\\"')}"${Xe.getReplacesInText(i)}; - _sendToFrontEnd(${s._id}, {text: subActionVar${s._id}}); - sendTo("${s.instance}", "send", {text: subActionVar${s._id}${s.phone?`, phone: "${s.phone.replace(/"/g,'\\"')}"`:""}});`:`// no text defined -_sendToFrontEnd(${s._id}, {text: 'No text defined'});`}renderDebug(s){return`${b.I18n.t("Sent:")} ${s.data.text}`}onTagChange(){this.setState({inputs:[{nameRender:"renderInstance",adapter:"whatsapp-cmb",frontText:"Instance:",defaultValue:"whatsapp-cmb.0",attr:"instance"},{nameRender:"renderModalInput",attr:"text",defaultValue:"Hello",nameBlock:"",frontText:"Text:"},{nameRender:"renderText",attr:"phone",defaultValue:"",frontText:"Phone:",backText:"(optional)"}]},()=>super.onTagChange())}static getStaticData(){return{acceptedBy:"actions",name:"Whatsapp-cmb",id:"ActionWhatsappcmb",adapter:"whatsapp-cmb",title:"Sends message via whatsapp-cmb",helpDialog:"You can use %s in the text to display current trigger value or %id to display the triggered object ID"}}getData(){return Ac.getStaticData()}}class Rc extends Xe{constructor(s){super(s,Rc.getStaticData())}static compile(s,i){const r=(s.text||"").replace(/"/g,'\\"');return r?`// Pushsafer ${s.text||""} - const subActionVar${s._id} = "${r}"${Xe.getReplacesInText(i)}; - _sendToFrontEnd(${s._id}, {text: subActionVar${s._id}}); - sendTo("${s.instance}", "send", { - message: subActionVar${s._id}, - title: "${(s.title||"").replace(/"/g,'\\"')}"${Xe.getReplacesInText(i)}, - ${s.sound&&s.sound!=="_"?`sound: "${s.sound}",`:""} - priority: ${s.priority}, - ${s.vibration&&s.vibration!=="_"?`vibration: ${s.vibration},`:""} - });`:`// no text defined -_sendToFrontEnd(${s._id}, {text: 'No text defined'});`}renderDebug(s){return`Sent: ${s.data.text}`}onTagChange(){this.setState({inputs:[{nameRender:"renderInstance",adapter:"pushsafer",frontText:"Instance:",defaultValue:"pushsafer.0",attr:"instance"},{nameRender:"renderModalInput",attr:"text",defaultValue:"Hello",nameBlock:"",frontText:"Text:"},{nameRender:"renderText",attr:"title",defaultValue:"ioBroker",frontText:"Title:"},{nameRender:"renderSelect",attr:"sound",defaultValue:"magic",frontText:"Sound:",doNotTranslate:!0,options:[{value:"_",title:"Device Default"},{value:"0",title:"Silent"},{value:"1",title:"Ahem (IM)"},{value:"2",title:"Applause (Mail)"},{value:"3",title:"Arrow (Reminder)"},{value:"4",title:"Baby (SMS)"},{value:"5",title:"Bell (Alarm)"},{value:"6",title:"Bicycle (Alarm2)"},{value:"7",title:"Boing (Alarm3)"},{value:"8",title:"Buzzer (Alarm4)"},{value:"9",title:"Camera (Alarm5)"},{value:"10",title:"Car Horn (Alarm6)"},{value:"11",title:"Cash Register (Alarm7)"},{value:"12",title:"Chime (Alarm8)"},{value:"13",title:"Creaky Door (Alarm9)"},{value:"14",title:"Cuckoo Clock (Alarm10)"},{value:"15",title:"Disconnect (Call)"},{value:"16",title:"Dog (Call2)"},{value:"17",title:"Doorbell (Call3)"},{value:"18",title:"Fanfare (Call4)"},{value:"19",title:"Gun Shot (Call5)"},{value:"20",title:"Honk (Call6)"},{value:"21",title:"Jaw Harp (Call7)"},{value:"22",title:"Morse (Call8)"},{value:"23",title:"Electricity (Call9)"},{value:"24",title:"Radio Tuner (Call10)"},{value:"25",title:"Sirens"},{value:"26",title:"Military Trumpets"},{value:"27",title:"Ufo"},{value:"28",title:"Whah Whah Whah"},{value:"29",title:"Man Saying Goodbye"},{value:"30",title:"Man Saying Hello"},{value:"31",title:"Man Saying No"},{value:"32",title:"Man Saying Ok"},{value:"33",title:"Man Saying Ooohhhweee"},{value:"34",title:"Man Saying Warning"},{value:"35",title:"Man Saying Welcome"},{value:"36",title:"Man Saying Yeah"},{value:"37",title:"Man Saying Yes"},{value:"38",title:"Beep short"},{value:"39",title:"Weeeee short"},{value:"40",title:"Cut in and out short"},{value:"41",title:"Finger flicking glas short"},{value:"42",title:"Wa Wa Waaaa short"},{value:"43",title:"Laser short"},{value:"44",title:"Wind Chime short"},{value:"45",title:"Echo short"},{value:"46",title:"Zipper short"},{value:"47",title:"HiHat short"},{value:"48",title:"Beep 2 short"},{value:"49",title:"Beep 3 short"},{value:"50",title:"Beep 4 short"},{value:"51",title:"The Alarm is armed"},{value:"52",title:"The Alarm is disarmed"},{value:"53",title:"The Backup is ready"},{value:"54",title:"The Door is closed"},{value:"55",title:"The Door is opend"},{value:"56",title:"The Window is closed"},{value:"57",title:"The Window is open"},{value:"58",title:"The Light is off"},{value:"59",title:"The Light is on"},{value:"60",title:"The Doorbell rings"},{value:"61",title:"Pager short"},{value:"62",title:"Pager long"}]},{nameRender:"renderSelect",attr:"priority",defaultValue:0,frontText:"Priority:",options:[{value:-2,title:"lowest priority"},{value:-1,title:"lower priority"},{value:0,title:"normal priority"},{value:1,title:"high priority"},{value:2,title:"highest priority"}]},{nameRender:"renderSelect",attr:"vibration",defaultValue:0,frontText:"Vibration:",options:[{value:"_",title:"default"},{value:1,title:"1"},{value:2,title:"2"},{value:3,title:"3"}]}]},()=>super.onTagChange())}static getStaticData(){return{acceptedBy:"actions",name:"Pushsafer",id:"ActionPushsafer",adapter:"pushsafer",title:"Sends message via Pushsafer",helpDialog:"You can use %s in the text to display current trigger value or %id to display the triggered object ID"}}getData(){return Rc.getStaticData()}}const kT=`async function (obj) { - "__%%DEBUG_TRIGGER%%__"; - __%%CONDITIONS_VARS%%__ - const _cond = __%%CONDITION%%__; - - "__%%DEBUG_CONDITIONS%%__"; - - if (_cond) { -__%%THEN%%__ - } else { -__%%ELSE%%__ - } -}`,ST=`async function (obj) { - "__%%DEBUG_TRIGGER%%__"; - __%%CONDITIONS_VARS%%__ - const _cond = __%%CONDITION%%__; - - "__%%DEBUG_CONDITIONS%%__"; - - if (__%%STATE%%__ === false && _cond) { - __%%STATE%%__ = true; -__%%THEN%%__ - } else if (__%%STATE%%__ === true && !_cond) { - __%%STATE%%__ = false; -__%%ELSE%%__ - } -}`,rO=`"__%%DEBUG_TRIGGER%%__"; -__%%CONDITIONS_VARS%%__ -const _cond = __%%CONDITION%%__; - -"__%%DEBUG_CONDITIONS%%__"; - -if (_cond) { -__%%THEN%%__ -} else { -__%%ELSE%%__ -}`,wg={triggers:[],conditions:[[]],justCheck:!1,actions:{then:[],else:[]}};function aO(a,s,i){const r=[];let l=a.triggers;l.length||(l=[{id:"TriggerScriptSave"}]);const u=[],d=[],p=a.conditions.find(f=>f.find(v=>v.tagCard==="()"));l.forEach((f,v)=>{var y;const _=Um(f.id,i);if(_){const k={trigger:f,condition:{index:0},justCheck:p?!1:a.justCheck||!a.conditions.length||!a.conditions[0].length,conditionsDebug:[],conditionsVars:[],conditionsStates:[]},C=_.compile(f,k),w=lO(a.conditions,k,i),E=$w(a.actions.then,k,i),R=$w(a.actions.else,k,i);u.push(`cond${v}`),(y=k.prelines)!=null&&y.length&&k.prelines.forEach(D=>d.push(D)),C.includes(" __%%CONDITIONS_VARS%%__")&&(k.conditionsVars=k.conditionsVars.map((D,A)=>A?` ${D}`:D),k.conditionsDebug=k.conditionsDebug.map((D,A)=>A?` ${D}`:D)),r.push(C.replace("__%%CONDITIONS_VARS%%__",k.conditionsVars.join(` -`)).replace('"__%%DEBUG_CONDITIONS%%__";',k.conditionsDebug.join(` -`)).replace("__%%CONDITION%%__",w).replace("__%%THEN%%__",E||"// ignore").replace("__%%ELSE%%__",R||"// ignore").replace(/__%%STATE%%__/g,`cond${v}`))}});let m=r.join(` - -`);return(!a.justCheck||p)&&(m=`${u.map(f=>`let ${f} = false;`).join(` -`)} - -${m}`),d&&(m=`${d.join(` -`)} - -${m}`),m}function Um(a,s){return s.find(i=>i.getStaticData&&i.getStaticData().id===a)}function $w(a,s,i){const r=[];return a==null||a.forEach(l=>{const u=Um(l.id,i);u&&r.push(u.compile(l,s))}),` ${r.join(` - - `)}`}function lO(a,s,i){const r=[];let l=0;return a==null||a.forEach(u=>{const d=[];u!=null&&u.length&&(u.forEach(p=>{const m=Um(p.id,i);m&&(s.condition.index=l++,d.push(m.compile(p,s)))}),r.push(`(${d.join(`) && - (`)})`))}),r.length?r.length===1?r[0]||"true":`(${r.join(") || (")})`:"true"}function cO(a,s){return aO(a,null,s)}function cne(a){if(!a)return wg;const s=a.split(` -`);try{const i=(s.pop()||"").replace(/^\/\//,"");let r=JSON.parse(i);return r.triggers||(r=wg),r}catch{return wg}}function une(a,s){let i="";const r=cO(a,s);return i+=r,i+=` -/* -const demo = ${JSON.stringify(a,null,2).replace(/\*\//g,"* /")}; -*/ -`,`${i} -//${JSON.stringify(a)}`}class Oc extends Xe{constructor(s){super(s,Oc.getStaticData())}static compile(s,i){return rO.replace('"__%%DEBUG_TRIGGER%%__"',`_sendToFrontEnd(${s._id}, {trigger: true})`)}renderDebug(){return b.I18n.t("Triggered")}onTagChange(s){this.setState({inputs:[{nameRender:"renderNameText",defaultValue:"On script save or adapter start",attr:"script"}]},()=>super.onTagChange())}static getStaticData(){return{acceptedBy:"triggers",name:"Start script",id:"TriggerScriptSave",icon:"PlayArrow",title:"Triggers the on script saving or the javascript instance restart"}}getData(){return Oc.getStaticData()}}var ET={exports:{}};(function(a,s){(function(){var i=Math.PI,r=Math.sin,l=Math.cos,u=Math.tan,d=Math.asin,p=Math.atan2,m=Math.acos,f=i/180,v=1e3*60*60*24,_=2440588,y=2451545;function k(q){return q.valueOf()/v-.5+_}function C(q){return new Date((q+.5-_)*v)}function w(q){return k(q)-y}var E=f*23.4397;function R(q,ee){return p(r(q)*l(E)-u(ee)*r(E),l(q))}function D(q,ee){return d(r(ee)*l(E)+l(ee)*r(E)*r(q))}function A(q,ee,B){return p(r(q),l(q)*r(ee)-u(B)*l(ee))}function J(q,ee,B){return d(r(ee)*r(B)+l(ee)*l(B)*l(q))}function ie(q,ee){return f*(280.16+360.9856235*q)-ee}function se(q){return q<0&&(q=0),2967e-7/Math.tan(q+.00312536/(q+.08901179))}function me(q){return f*(357.5291+.98560028*q)}function z(q){var ee=f*(1.9148*r(q)+.02*r(2*q)+3e-4*r(3*q)),B=f*102.9372;return q+ee+B+i}function Oe(q){var ee=me(q),B=z(ee);return{dec:D(B,0),ra:R(B,0)}}var Ne={};Ne.getPosition=function(q,ee,B){var H=f*-B,U=f*ee,re=w(q),I=Oe(re),de=ie(re,H)-I.ra;return{azimuth:A(de,U,I.dec),altitude:J(de,U,I.dec)}};var Ze=Ne.times=[[-.833,"sunrise","sunset"],[-.3,"sunriseEnd","sunsetStart"],[-6,"dawn","dusk"],[-12,"nauticalDawn","nauticalDusk"],[-18,"nightEnd","night"],[6,"goldenHourEnd","goldenHour"]];Ne.addTime=function(q,ee,B){Ze.push([q,ee,B])};var ae=9e-4;function ce(q,ee){return Math.round(q-ae-ee/(2*i))}function K(q,ee,B){return ae+(q+ee)/(2*i)+B}function ye(q,ee,B){return y+q+.0053*r(ee)-.0069*r(2*B)}function he(q,ee,B){return m((r(q)-r(ee)*r(B))/(l(ee)*l(B)))}function je(q,ee,B,H,U,re,I){var de=he(q,B,H),W=K(de,ee,U);return ye(W,re,I)}Ne.getTimes=function(q,ee,B){var H=f*-B,U=f*ee,re=w(q),I=ce(re,H),de=K(0,H,I),W=me(de),Ce=z(W),be=D(Ce,0),Se=ye(de,W,Ce),pe,Ve,Je,_e,ke,$e={solarNoon:C(Se),nadir:C(Se+.5)};for(pe=0,Ve=Ze.length;pe=0&&(bt=Math.sqrt(_e)/(Math.abs(Se)*2),$e=Ve-bt,Pe=Ve+bt,Math.abs($e)<=1&&ke++,Math.abs(Pe)<=1&&ke++,$e<-1&&($e=Pe)),ke===1?I<0?Ce=X+$e:be=X+$e:ke===2&&(Ce=X+(Je<0?Pe:$e),be=X+(Je<0?$e:Pe)),!(Ce&&be));X+=2)I=W;var ct={};return Ce&&(ct.rise=tt(U,Ce)),be&&(ct.set=tt(U,be)),!Ce&&!be&&(ct[Je>0?"alwaysUp":"alwaysDown"]=!0),ct},a.exports=Ne})()})(ET);var uO=ET.exports;const IT=Si(uO),dO='{"time":{"start":"00:00","end":"24:00","mode":"hours","interval":1},"period":{"days":1}}';class vi extends Xe{coordinates=null;constructor(s){super(s,vi.getStaticData())}static compile(s,i){var u;let r="",l=i.justCheck?kT:ST;if(l=l.replace('"__%%DEBUG_TRIGGER%%__"',`_sendToFrontEnd(${s._id}, {trigger: true})`),s.tagCard==="interval")r=`setInterval(${l}, ${s.interval||1} * ${s.unit==="s"?1e3:s.unit==="m"?6e4:36e5});`;else if(s.tagCard==="cron")r=`schedule("${s.cron}", ${l});`;else if(s.tagCard==="at"){const[d,p]=(s.at||"").split(":");let m="*";if((u=s==null?void 0:s.dow)!=null&&u.length&&!s.dow.includes("_")){const f=[...s.dow].map(k=>parseInt(k,10));f.sort();const v=[];let _=f[0],y=1;for(;y1?(_===f[y-1]?v.push(_.toString()):f[y-1]-_===1?v.push(`${_},${f[y-1]}`):v.push(`${_}-${f[y-1]}`),_=f[y]):y===f.length-1&&(_===f[y-1]||f[y]-_===1?v.push(`${_},${f[y]}`):v.push(`${_}-${f[y]}`));m=v.join(",")}r=`schedule("${p||"0"} ${d||"0"} * * ${m}", ${l});`}else s.tagCard==="astro"?r=`schedule({astro: "${s.astro}", shift: ${s.offset?s.offsetValue:0}}, ${l});`:s.tagCard==="wizard"&&(r=`schedule('${s.wizard}', ${l});`);return r}static _time2String(s){return s?`${s.getHours().toString().padStart(2,"0")}:${s.getMinutes().toString().padStart(2,"0")}`:"--:--"}async _setAstro(s,i,r){var m,f;if(s||=this.state.settings.astro||"solarNoon",i??=this.state.settings.offset,r??=this.state.settings.offsetValue,r=parseInt(r,10)||0,!this.coordinates){const v=await this.props.socket.getObject("system.adapter.javascript.0"),_=(m=v==null?void 0:v.native)==null?void 0:m.latitude,y=(f=v==null?void 0:v.native)==null?void 0:f.longitude;if(!_&&!y){const k=await this.props.socket.getObject("system.config");k!=null&&k.common&&(k.common.latitude||k.common.longitude)?this.coordinates={latitude:parseFloat(k.common.latitude),longitude:parseFloat(k.common.longitude)}:this.coordinates=null}else this.coordinates={latitude:parseFloat(_),longitude:parseFloat(y)}}const l=this.coordinates&&IT.getTimes(new Date,this.coordinates.latitude,this.coordinates.longitude),u=l?Object.keys(l).map(v=>({value:v,title:v,title2:`[${vi._time2String(l[v])}]`,order:l?vi._time2String(l[v]):"??:??"})):[];u.sort((v,_)=>v.order>_.order?1:v.order<_.order?-1:0);let d="--:--";if(s&&l&&l[s]){const v=new Date(l[s]);i&&v.setMinutes(v.getMinutes()+parseInt(r,10)),d=b.I18n.t("(at %s)",vi._time2String(v))}let p;i?p=[{frontText:"at",attr:"astro",nameRender:"renderSelect",options:u,defaultValue:"solarNoon",doNotTranslate2:!0},{backText:"with offset",nameRender:"renderCheckbox",attr:"offset"},{backText:r===1?"minute":"minutes",frontText:"offset",nameRender:"renderNumber",defaultValue:0,attr:"offsetValue",noHelperText:!0},{nameRender:"renderNameText",attr:"textTime",defaultValue:d,doNotTranslate:!0}]:p=[{frontText:"at",attr:"astro",nameRender:"renderSelect",options:u,doNotTranslate2:!0,defaultValue:"solarNoon"},{backText:"with offset",nameRender:"renderCheckbox",attr:"offset"},{nameRender:"renderNameText",attr:"textTime1",defaultValue:d,doNotTranslate:!0}],this.setState({inputs:p},()=>super.onTagChange())}_setInterval(s){s=parseInt(s||this.state.settings.interval,10)||30;let i;s===1?i=[{value:"s",title:"second"},{value:"m",title:"minute"},{value:"h",title:"hour"}]:i=[{value:"s",title:"seconds"},{value:"m",title:"minutes"},{value:"h",title:"hours"}],this.setState({inputs:[{nameRender:"renderNumber",attr:"interval",frontText:"every",defaultValue:30,className:"block-input-interval"},{nameRender:"renderSelect",attr:"unit",defaultValue:"s",options:i}]},()=>super.onTagChange())}renderDebug(s){return b.I18n.t("Triggered")}onValueChanged(s,i){this.state.settings.tagCard==="astro"?i==="astro"?this._setAstro(s):i==="offset"?this._setAstro(void 0,s):i==="offsetValue"&&this._setAstro(void 0,void 0,s):this.state.settings.tagCard==="interval"&&i==="interval"&&this._setInterval(s)}renderCron(s,i,r){const{className:l}=this.props;return g.jsxs("div",{children:[g.jsxs("div",{style:{display:"flex",alignItems:"baseline"},children:[g.jsx("div",{style:{width:"100%"},children:this.renderText({nameRender:"renderText",attr:"cron",defaultValue:i},this.state.settings.cron||i,r)}),g.jsx(Ur,{square:!0,style:{marginLeft:7},value:"...",className:l,onClick:()=>this.setState({openDialog:!0,textCron:this.state.settings.cron})})]}),this.state.openDialog?g.jsx(nm,{disabled:this.state.settings.cron===this.state.textCron,onApply:()=>{const u=this.state.textCron;r(u,"cron",()=>{r(b.convertCronToText(u,b.I18n.getLanguage()),"addText"),this.setState({openDialog:!1})})},onClose:()=>this.setState({openDialog:!1,textCron:""}),children:g.jsx(b.ComplexCron,{cronExpression:this.state.settings.cron,onChange:u=>this.setState({textCron:u}),language:b.I18n.getLanguage()})}):null,this.renderNameText({nameRender:"renderNameText",defaultValue:b.I18n.t("every hour at 0 minutes"),attr:"addText",signature:!0,doNotTranslate:!0},this.state.settings.addText||b.I18n.t("every hour at 0 minutes"))]},"cron")}renderWizard(s,i,r){const{className:l}=this.props;return g.jsxs("div",{children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:7},children:[g.jsx(bi,{className:l,autoComplete:"off",fullWidth:!0,variant:"outlined",size:"small",multiline:!0,rows:2,value:this.state.settings.wizardText,onChange:u=>r(u),customValue:!0}),g.jsx(Ur,{square:!0,style:{marginLeft:7},value:"...",className:l,onClick:()=>this.setState({openDialog:!0,wizard:this.state.settings.wizard,wizardText:b.Schedule.state2text(this.state.settings.wizard)})})]}),this.state.openDialog?g.jsx(nm,{disabled:this.state.settings.wizard===this.state.wizard,onApply:()=>this.setState({openDialog:!1},()=>{const u=JSON.parse(this.state.wizard);u.valid||={from:b.Schedule.now2string()},u.valid.from||=b.Schedule.now2string(),r({wizardText:this.state.wizardText,wizard:JSON.stringify(u)})}),onClose:()=>this.setState({openDialog:!1}),children:g.jsx(b.Schedule,{theme:this.props.theme,schedule:i,onChange:(u,d)=>this.setState({wizardText:d||"",wizard:u})})}):null]},"wizard")}onTagChange(s){switch(s||=this.state.settings.tagCard,s){case"interval":this._setInterval();break;case"cron":this.setState({inputs:[{nameRender:"renderCron",attr:"cron",defaultValue:"0 * * * *"}]},()=>super.onTagChange());break;case"wizard":{const i=JSON.parse(dO);i.valid||={from:b.Schedule.now2string()},i.valid.from||=b.Schedule.now2string(),this.setState({inputs:[{nameRender:"renderWizard",attr:"wizard",defaultValue:JSON.stringify(i)}]},()=>super.onTagChange(null,()=>{const r=b.Schedule.state2text(this.state.settings.wizard||i);if(this.state.settings.wizard!==r){const l=JSON.parse(JSON.stringify(this.state.settings));l.wizardText=r,this.setState({settings:l}),this.props.onChange(l)}}));break}case"at":this.setState({inputs:[{nameRender:"renderTime",prefix:"at",attr:"at",defaultValue:"07:30"},{nameRender:"renderSelect",attr:"dow",default:"",multiple:!0,defaultValue:["_","1","2","3","4","5","6","0"],options:[{value:"_",title:"Every day",only:!0},{value:"1",title:"Monday",titleShort:"Mo"},{value:"2",title:"Tuesday",titleShort:"Tu"},{value:"3",title:"Wednesday",titleShort:"We"},{value:"4",title:"Thursday",titleShort:"Th"},{value:"5",title:"Friday",titleShort:"Fr"},{value:"6",title:"Saturday",titleShort:"Sa"},{value:"0",title:"Sunday",titleShort:"Su"}]}]},()=>super.onTagChange());break;case"astro":this._setAstro();break}}static getStaticData(){return{acceptedBy:"triggers",name:"Schedule",id:"TriggerScheduleBlock",icon:"AccessTime",tagCardArray:["cron","wizard","interval","at","astro"],title:"Triggers the rule periodically or on some specific time"}}getData(){return vi.getStaticData()}}const yn={valueAck:{color:"#b02323"},valueNotAck:{color:"#12ac15"}},xT=Y.forwardRef((a,s)=>g.jsx(Yk,{direction:"up",ref:s,...a}));xT.displayName="Transition";class Mc extends Xe{inputRef;constructor(s){super(s,Mc.getStaticData()),this.inputRef=Y.createRef()}static compile(s,i){let r=i.justCheck?kT:ST;return r=r.replace('"__%%DEBUG_TRIGGER%%__"',`_sendToFrontEnd(${s._id}, {val: obj.state.val, ack: obj.state.ack, valOld: obj.oldState && obj.oldState.val, ackOld: obj.oldState && obj.oldState.ack})`),`on({id: "${s.oid||""}", change: "${s.tagCard==="on update"?"any":"ne"}"}, ${r});`}renderDebug(s){return s.data.valOld!==void 0?g.jsxs("span",{children:[b.I18n.t("Triggered")," ",g.jsx("span",{style:s.data.ackOld?yn.valueAck:yn.valueNotAck,children:xn(s.data.valOld)})," ","→"," ",g.jsx("span",{style:s.data.ack?yn.valueAck:yn.valueNotAck,children:xn(s.data.val)})]}):g.jsxs("span",{children:[b.I18n.t("Triggered")," ",g.jsx("span",{style:s.data.ack?yn.valueAck:yn.valueNotAck,children:xn(s.data.val)})]})}onWriteValue(){this.setState({openSimulate:!1});let s=this.state.simulateValue;window.localStorage.setItem(`javascript.app.${this.state.settings.oid}_ack`,this.state.simulateAck?"true":"false"),this.state.settings.oidType==="boolean"?(s=s===!0||s==="true"||s==="1",window.localStorage.setItem(`javascript.app.${this.state.settings.oid}`,s?"true":"false")):this.state.settings.oidType==="number"?(s=parseFloat(s)||0,window.localStorage.setItem(`javascript.app.${this.state.settings.oid}`,s.toString())):window.localStorage.setItem(`javascript.app.${this.state.settings.oid}`,(s==null?void 0:s.toString())||""),this.props.socket.setState(this.state.settings.oid,{val:s,ack:!!this.state.simulateAck})}renderWriteState(){return[g.jsx(De,{disabled:!this.state.settings.oid||!this.state.enableSimulation,variant:"contained",color:"primary",onClick:()=>{this.setState({openSimulate:!0,simulateValue:this.state.settings.oidType==="boolean"?window.localStorage.getItem(`javascript.app.${this.state.settings.oid}`)==="true":window.localStorage.getItem(`javascript.app.${this.state.settings.oid}`)||"",simulateAck:window.localStorage.getItem(`javascript.app.${this.state.settings.oid}_ack`)==="true"}),setTimeout(()=>{var s;return(s=this.inputRef.current)==null?void 0:s.focus()},200)},children:b.I18n.t("Simulate")},"buttonWrite"),g.jsxs(Gt,{open:!!this.state.openSimulate,TransitionComponent:xT,keepMounted:!0,onClose:()=>this.setState({openSimulate:!1}),"aria-labelledby":"simulate-dialog-slide-title","aria-describedby":"simulate-dialog-slide-description",children:[g.jsx(as,{id:"simulate-dialog-slide-title",children:b.I18n.t("Trigger with value")}),g.jsxs(Vt,{children:[this.state.settings.oidType==="boolean"?g.jsx(Ag,{control:g.jsx(Rw,{inputRef:this.inputRef,onKeyUp:s=>s.key==="Enter"&&this.onWriteValue(),value:!!this.state.simulateValue,onChange:s=>this.setState({simulateValue:s.target.checked})}),label:b.I18n.t("Value")}):g.jsx(vo,{variant:"standard",inputRef:this.inputRef,label:b.I18n.t("Value"),fullWidth:!0,onKeyUp:s=>s.key==="Enter"&&this.onWriteValue(),value:!this.state.simulateValue&&this.state.simulateValue!==0?"":this.state.simulateValue,onChange:s=>this.setState({simulateValue:s.target.value})}),g.jsx("br",{}),g.jsx(Ag,{control:g.jsx(bc,{checked:!!this.state.simulateAck,onChange:s=>this.setState({simulateAck:s.target.checked}),color:"primary"}),label:b.I18n.t("Ack")})]}),g.jsxs(Kt,{children:[g.jsxs(De,{variant:"contained",onClick:()=>this.onWriteValue(),color:"primary",children:[g.jsx(wS,{}),b.I18n.t("Write")]}),g.jsxs(De,{color:"grey",variant:"contained",onClick:()=>this.setState({openSimulate:!1}),children:[g.jsx(Wc,{}),b.I18n.t("Close")]})]})]},"dialogWrite")]}onTagChange(s){this.setState({inputs:[{nameRender:"renderObjectID",attr:"oid",defaultValue:""},{nameRender:"renderWriteState"}]},()=>{super.onTagChange()})}static getStaticData(){return{acceptedBy:"triggers",name:"State",id:"TriggerState",icon:"FlashOn",tagCardArray:["on change","on update"],title:"Triggers the rule on update or change of some state"}}getData(){return Mc.getStaticData()}}const hO=""+new URL("hysteresis-CLhhemcG.png",import.meta.url).href,bw=`function __hysteresis(val, limit, state, hist, comp) { - let cond1, cond2; - if (comp === '>') { - cond1 = val > limit + hist; - cond2 = val <= limit - hist; - } else if (comp === '<') { - cond1 = val < limit - hist; - cond2 = val >= limit + hist; - } else if (comp === '>=') { - cond1 = val >= limit + hist; - cond2 = val < limit - hist; - } else if (comp === '<=') { - cond1 = val <= limit - hist; - cond2 = val > limit + hist; - } else if (comp === '=') { - cond1 = val <= limit + hist && val > limit - hist; - cond2 = val > limit + hist || val <= limit - hist; - } else if (comp === '<>') { - cond1 = val > limit + hist || val <= limit - hist; - cond2 = val <= limit + hist && val > limit - hist; - } - - if (!state && cond1) { - return true; - } else if (state && cond2) { - return false; - } else { - return state; - } -}`;class Hr extends Xe{constructor(s){super(s,Hr.getStaticData())}isAllTriggersOnState(){var s,i,r,l;return!!((i=(s=this.props.userRules)==null?void 0:s.triggers)!=null&&i.find(u=>u.id==="TriggerState"))&&!((l=(r=this.props.userRules)==null?void 0:r.triggers)!=null&&l.find(u=>u.id!=="TriggerState"))}static compile(s,i){var d,p;let r=s.value;r==null&&(r=!1);let l,u;if(s.tagCard==="()")i.prelines||=[],i.prelines.find(m=>m!==bw)||i.prelines.push(bw),s.useTrigger?(l="obj.state.val",r===""&&(r=0),u=`__hysteresis(subCondVar${s._id}, ${r}, __%%STATE%%__, ${s.hist}, "${s.histComp}")`):(l=`(await getStateAsync("${s.oid}")).val`,r===""&&(r=0),typeof r=="string"&&parseFloat(r.trim()).toString()!==r.trim()&&(r=`"${r}"`),u=`__hysteresis(subCondVar${s._id}, ${r}, __%%STATE%%__, ${s.hist}, "${s.histComp}")`);else if(s.tagCard!=="includes"){const m=s.tagCard==="="?"==":s.tagCard==="<>"?"!=":s.tagCard;s.useTrigger?(l="obj.state.val",((d=i==null?void 0:i.trigger)==null?void 0:d.oidType)==="string"?(r=r.replace(/"/g,'\\"'),u=`subCondVar${s._id} ${m} "${r}"`):(r===""&&(r=0),typeof r=="string"&&parseFloat(r.trim()).toString()!==r.trim()&&(r=`"${r}"`),u=`subCondVar${s._id} ${m} ${r}`)):(l=`(await getStateAsync("${s.oid}")).val`,s.oidType==="string"?(r=r.replace(/"/g,'\\"'),u=`subCondVar${s._id} ${m} "${r}"`):(r===""&&(r=0),typeof r=="string"&&parseFloat(r.trim()).toString()!==r.trim()&&(r=`"${r}"`),u=`subCondVar${s._id} ${m} ${r}`))}else s.useTrigger?(l="obj.state.val",((p=i==null?void 0:i.trigger)==null?void 0:p.oidType)==="string"?(r=r.replace(/"/g,'\\"'),u=`obj.state.val.includes("${r}")`):u="false"):(l=`(await getStateAsync("${s.oid}")).val`,s.oidType==="string"?(r=r.replace(/"/g,'\\"'),u=`subCondVar${s._id}.includes("${r}")`):u="false");return i.conditionsStates.push({name:`subCondVar${s._id}`,id:s.oid}),i.conditionsVars.push(`const subCondVar${s._id} = ${l};`),i.conditionsVars.push(`const subCond${s._id} = ${u};`),i.conditionsDebug.push(`_sendToFrontEnd(${s._id}, {result: subCond${s._id}, value: subCondVar${s._id}, compareWith: "${r}"});`),`subCond${s._id}`}renderDebug(s){const i=this.state.settings.tagCard;return i!=="()"?`${s.data.result.toString().toUpperCase()} [${s.data.value} ${i} ${s.data.compareWith}]`:b.I18n.t("Triggered")}onShowHelp=()=>this.setState({showHysteresisHelp:!0});_setInputs(s,i,r,l,u){var w,E;const d=this.isAllTriggersOnState();i=i||this.state.settings.tagCard,r=r||this.state.settings.oidType,l=l||this.state.settings.oidUnit,u=u||this.state.settings.oidStates,s===void 0&&(s=this.state.settings.useTrigger),d&&s&&((E=(w=this.props.userRules)==null?void 0:w.triggers)==null?void 0:E.length)===1&&(r=this.props.userRules.triggers[0].oidType,l=this.props.userRules.triggers[0].oidUnit,u=this.props.userRules.triggers[0].oidStates);const p=Hr.getStaticData().tagCardArray,m=p.find(R=>R.title===i)||p[0];let f,v=null;r==="number"?(f=[{title:"=",title2:"[equal]",text:"equal to"},{title:">=",title2:"[greater or equal]",text:"greater or equal"},{title:">",title2:"[greater]",text:"greater than"},{title:"<=",title2:"[less or equal]",text:"less or equal"},{title:"<",title2:"[less]",text:"less than"},{title:"<>",title2:"[not equal]",text:"not equal to"},{title:"()",title2:"[hysteresis]",text:"hysteresis"}],u&&(v=Object.keys(u).map(R=>u?{value:R,title:u[R]}:null).filter(R=>R))):r==="boolean"?(f=[{title:"=",title2:"[equal]",text:"equal to"},{title:"<>",title2:"[not equal]",text:"not equal to"}],v=[{title:"false",value:!1},{title:"true",value:!0}]):(f=[{title:"=",title2:"[equal]",text:"equal to"},{title:">=",title2:"[greater or equal]",text:"greater or equal"},{title:">",title2:"[greater]",text:"greater than"},{title:"<=",title2:"[less or equal]",text:"less or equal"},{title:"<",title2:"[less]",text:"less than"},{title:"<>",title2:"[not equal]",text:"not equal to"},{title:".",title2:"[includes]",text:"includes"}],u&&(v=Object.keys(u).map(R=>({value:R,title:u?u[R]:R.toString()}))));let _=null;f.find(R=>R.title===i)||(i=f[0].title,_=_||{...this.state.settings},_.tagCard=i);let y,k={nameRender:"renderText",defaultValue:"",attr:"value",frontText:i==="()"?"Limit":(m==null?void 0:m.text)||"compare with",doNotTranslateBack:!0,backText:l};v&&(k={nameRender:"renderSelect",defaultValue:v[0].value,options:v,attr:"value",frontText:(m==null?void 0:m.text)||"compare with",doNotTranslateBack:!0,backText:l},v.find(R=>R.value===this.state.settings.value)||(_=_||{...this.state.settings},_.value=v[0].value),v.length<=2&&(f=[{title:"=",title2:"[equal]",text:"equal to"},{title:"<>",title2:"[not equal]",text:"not equal to"}])),d&&s?y=[{backText:"use trigger value",nameRender:"renderCheckbox",attr:"useTrigger",defaultValue:!1},k]:d?y=[{backText:"use trigger value",nameRender:"renderCheckbox",attr:"useTrigger"},{nameRender:"renderObjectID",attr:"oid",defaultValue:""},k]:y=[{nameRender:"renderObjectID",attr:"oid",defaultValue:""},k],i==="()"&&(y.splice(1,0,{nameRender:"renderDialog",icon:"HelpOutline",frontText:"Explanation",onShowDialog:this.onShowHelp}),y.splice(2,0,{nameRender:"renderSelect",attr:"histComp",defaultValue:">",frontText:"Condition",doNotTranslate:!0,options:[{title:">",value:">"},{title:">=",value:">="},{title:"<",value:"<"},{title:"<=",value:"<="},{title:"=",value:"="},{title:"<>",value:"<>"}]}),y.push({frontText:"Δ",doNotTranslate:!0,nameRender:"renderNumber",noHelperText:!0,attr:"hist",defaultValue:1,doNotTranslateBack:!0,backText:l}));const C={iconTag:!0,tagCardArray:f,inputs:y};this.setState(C,()=>super.onTagChange(null,()=>{_&&(this.setState({settings:_}),this.props.onChange(_))}))}onValueChanged(s,i){typeof s=="object"?this._setInputs(s.useTrigger,s.tagCard,s.oidType,s.states):i==="useTrigger"?this._setInputs(s):i==="oidType"?this._setInputs(void 0,void 0,s):i==="oidUnit"?this._setInputs(void 0,void 0,void 0,s):i==="oidStates"&&this._setInputs(void 0,void 0,void 0,void 0,s)}onUpdate(){this._setInputs(this.state.settings.useTrigger)}onTagChange(s){this._setInputs(this.state.settings.useTrigger,s)}static getStaticData(){return{acceptedBy:"conditions",name:"State condition",id:"ConditionState",icon:"Shuffle",tagCardArray:[{title:"=",title2:"[equal]",text:"equal to"},{title:">=",title2:"[greater or equal]",text:"greater or equal"},{title:">",title2:"[greater]",text:"greater than"},{title:"<=",title2:"[less or equal]",text:"less or equal"},{title:"<",title2:"[less]",text:"less than"},{title:"<>",title2:"[not equal]",text:"not equal to"},{title:".",title2:"[includes]",text:"includes"},{title:"()",title2:"[hysteresis]",text:"hysteresis"}],title:"Compares the state value with user defined value"}}getData(){return Hr.getStaticData()}renderSpecific(){return this.state.showHysteresisHelp?g.jsxs(Gt,{open:!0,maxWidth:"md",onClose:()=>this.setState({showHysteresisHelp:!1}),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[g.jsx(Vt,{children:g.jsx(Iw,{id:"alert-dialog-description",children:g.jsx("img",{src:hO,alt:"Hysteresis"})})}),g.jsx(Kt,{children:g.jsx(De,{onClick:()=>this.setState({showHysteresisHelp:!1}),color:"primary",autoFocus:!0,children:b.I18n.t("OK")})})]}):null}}const vw=[31,29,31,30,31,30,31,31,30,31,30,31];class Wr extends Xe{constructor(s){super(s,Wr.getStaticData())}static compile(s,i){const r=s.tagCard==="="?"===":s.tagCard==="<>"?"!==":s.tagCard;let l;if(s.withDate){const[u,d]=(s.date||"01.01").toString().split(".");let p=parseInt(d,10)||0,m=parseInt(u,10)||0;m>12?m=12:m<0&&(m=0),p>vw[m]?p=vw[m]:p<0&&(p=0),p&&m?l=`formatDate(Date.now(), 'MM.DD-hh:mm') ${r} "${s.date}-${s.time}"`:p===0&&m?l=`formatDate(Date.now(), 'MM-hh:mm') ${r} "${m.toString().padStart(2,"0")}-${s.time}"`:m===0&&p?l=`formatDate(Date.now(), 'DD-hh:mm') ${r} "${p.toString().padStart(2,"0")}-${s.time}"`:l=`formatDate(Date.now(), 'hh:mm') ${r} "${s.time}"`}else l=`formatDate(Date.now(), 'hh:mm') ${r} "${s.time}"`;return i.conditionsVars.push(`const subCond${s._id} = ${l};`),i.conditionsDebug.push(`_sendToFrontEnd(${s._id}, {result: subCond${s._id}});`),`subCond${s._id}`}_setInputs(s,i){i=i===void 0?this.state.settings.withDate:i,s=s||this.state.settings.tagCard;const r=Wr.getStaticData().tagCardArray,l=r==null?void 0:r.find(d=>d.title===s),u=[{nameRender:"renderNameText",attr:"interval",defaultValue:"Actual time of day"},{frontText:(l==null?void 0:l.text)||s,nameRender:"renderTime",attr:"time",defaultValue:"12:00"},{frontText:"with date",nameRender:"renderCheckbox",attr:"withDate",defaultValue:!1}];i&&u.push({nameRender:"renderDate",attr:"date",defaultValue:"01.01"}),this.setState({inputs:u,iconTag:!0},()=>super.onTagChange())}onValueChanged(s,i){i==="withDate"&&this._setInputs(void 0,s)}onTagChange(s){this._setInputs(s)}static getStaticData(){return{acceptedBy:"conditions",name:"Time condition",id:"ConditionTime",icon:"Shuffle",tagCardArray:[{title:"=",title2:"[equal]",text:"equal to"},{title:">=",title2:"[greater or equal]",text:"greater or equal"},{title:">",title2:"[greater]",text:"greater than"},{title:"<=",title2:"[less or equal]",text:"less or equal"},{title:"<",title2:"[less]",text:"less than"},{title:"<>",title2:"[not equal]",text:"not equal to"}],title:"Compares current time with the user specific time"}}getData(){return Wr.getStaticData()}}class Po extends Xe{coordinates=null;constructor(s){super(s,Po.getStaticData())}static compile(s,i){const r=s.tagCard==="="?"===":s.tagCard==="<>"?"!==":s.tagCard;let l;s.offset&&(l=parseInt(s.offsetValue,10)||0);const u=`formatDate(Date.now(), 'hh:mm') ${r} formatDate(getAstroDate("${s.astro}"${l?`, undefined, ${l}`:""}), 'hh:mm')`;return i.conditionsVars.push(`const subCond${s._id} = ${u};`),i.conditionsDebug.push(`_sendToFrontEnd(${s._id}, {result: ${u}});`),u}static _time2String(s){return s?`${s.getHours().toString().padStart(2,"0")}:${s.getMinutes().toString().padStart(2,"0")}`:"--:--"}onValueChanged(s,i){i==="astro"?this._setAstro(s):i==="offset"?this._setAstro(void 0,s):i==="offsetValue"&&this._setAstro(void 0,void 0,s)}async _setAstro(s,i,r){if(s=s||this.state.settings.astro||"solarNoon",i=i===void 0?this.state.settings.offset:i,r=r===void 0?this.state.settings.offsetValue:r,r=parseInt(r,10)||0,!this.coordinates){const v=await this.props.socket.getObject("system.adapter.javascript.0");if(!(v!=null&&v.native.latitude)&&!(v!=null&&v.native.longitude)){const _=await this.props.socket.getObject("system.config");_&&(_.common.latitude||_.common.longitude)?this.coordinates={latitude:_.common.latitude,longitude:_.common.longitude}:this.coordinates=null}else this.coordinates={latitude:v==null?void 0:v.native.latitude,longitude:v==null?void 0:v.native.longitude}}const l=this.coordinates?IT.getTimes(new Date,this.coordinates.latitude,this.coordinates.longitude):null,u=l?Object.keys(l).map(v=>({value:v,title:v,title2:`[${Po._time2String(l[v])}]`,order:Po._time2String(l[v])})):[];u.sort((v,_)=>v.order>_.order?1:v.order<_.order?-1:0);const d=Po.getStaticData().tagCardArray,p=d.find(v=>v.title===this.state.settings.tagCard)||d[0];let m="--:--";if(s&&l&&l[s]){const v=new Date(l[s]);i&&v.setMinutes(v.getMinutes()+parseInt(r,10)),m=`(${b.I18n.t(p.text)} ${Po._time2String(v)})`}let f;i?f=[{nameRender:"renderNameText",defaultValue:"Actual time of day",attr:"text"},{frontText:p.text,attr:"astro",nameRender:"renderSelect",options:u,doNotTranslate2:!0,defaultValue:"solarNoon"},{backText:"with offset",nameRender:"renderCheckbox",attr:"offset"},{backText:r===1?"minute":"minutes",frontText:"offset",nameRender:"renderNumber",defaultValue:0,attr:"offsetValue",noHelperText:!0},{nameRender:"renderNameText",attr:"textTime",doNotTranslate:!0,defaultValue:m}]:f=[{nameRender:"renderNameText",defaultValue:"Actual time of day",attr:"text"},{frontText:p.text,attr:"astro",nameRender:"renderSelect",options:u,doNotTranslate2:!0,defaultValue:"solarNoon"},{backText:"with offset",nameRender:"renderCheckbox",attr:"offset"},{nameRender:"renderNameText",attr:"textTime",doNotTranslate:!0,defaultValue:m}],this.setState({inputs:f},()=>super.onTagChange())}onTagChange(){this._setAstro()}static getStaticData(){return{acceptedBy:"conditions",name:"Astronomical",id:"ConditionAstronomical",icon:"Brightness3",tagCardArray:[{title:"=",title2:"[equal]",text:"equal to"},{title:">=",title2:"[greater or equal]",text:"greater or equal to"},{title:">",title2:"[greater]",text:"greater than"},{title:"<=",title2:"[less or equal]",text:"less or equal to"},{title:"<",title2:"[less]",text:"less than"},{title:"<>",title2:"[not equal]",text:"not equal to"}],title:"Compares current time with astronomical event"}}getData(){return Po.getStaticData()}}const yw={valueAck:{color:"#b02323"},valueNotAck:{color:"#12ac15"}};class Nc extends Xe{constructor(s){super(s,Nc.getStaticData())}isAllTriggersOnState(){var s,i,r,l;return!!((i=(s=this.props.userRules)==null?void 0:s.triggers)!=null&&i.find(u=>u.id==="TriggerState"))&&!((l=(r=this.props.userRules)==null?void 0:r.triggers)!=null&&l.find(u=>u.id!=="TriggerState"))}static compile(s,i){let r=s.value;s.useTrigger?r=s.toggle?"!obj.state.val":"obj.state.val":(r==null&&(r=""),typeof s.value=="string"&&parseFloat(s.value).toString()!==s.value&&s.value!=="true"&&s.value!=="false"&&(r=`"${r.replace(/"/g,'\\"')}"${Xe.getReplacesInText(i)}`));let l;return s.toggle&&!s.useTrigger?l=`const subActionVar${s._id} = !(await getStateAsync("${s.oid}")).val`:l=`const subActionVar${s._id} = ${r}`,`// set state ${s.oid} to ${s.toggle&&!s.useTrigger?"toggle":r} - ${l}; - _sendToFrontEnd(${s._id}, {val: subActionVar${s._id}, ack: ${s.tagCard==="update"}}); - await setStateAsync("${s.oid}", subActionVar${s._id}, ${s.tagCard==="update"});`}renderDebug(s){return g.jsxs("span",{children:[b.I18n.t("Set:")," ",g.jsx("span",{style:s.data.ack?yw.valueAck:yw.valueNotAck,children:xn(s.data.val)})]})}_setInputs(s,i){const r=this.isAllTriggersOnState();i=i===void 0?this.state.settings.toggle:i,s=s===void 0?this.state.settings.useTrigger:s;let l="",u;const{oidType:d,oidUnit:p,oidStates:m,oidMax:f,oidMin:v,oidRole:_,oidWrite:y,oidStep:k}=this.state.settings;let C;d&&(d==="number"?(l="number",f!==void 0&&v!==void 0&&(l="slider")):d==="boolean"?(l="boolean",_&&_.includes("button")&&y&&(l="button")):(l="",_&&_.includes("color")&&(l="color")),m&&(u=Object.keys(m).map(E=>({value:E,title:m[E]})),l="select"));let w;if(r&&s)w=[{backText:"use trigger value",nameRender:"renderCheckbox",attr:"useTrigger",defaultValue:!1}],l==="boolean"&&w.push({backText:"toggle value",attr:"toggle",nameRender:"renderCheckbox",defaultValue:!1});else{switch(l){case"number":w=[{backText:p||"",frontText:"with",nameRender:"renderNumber",defaultValue:f===void 0?0:f,attr:"value"}],this.state.settings.value!==void 0&&isNaN(parseFloat(this.state.settings.value))&&(C={value:f===void 0?0:f});break;case"slider":{w=[{nameRender:"renderSlider",defaultValue:f,min:v,max:f,unit:p,step:k,attr:"value"}];const E=parseFloat(this.state.settings.value);this.state.settings.value!==void 0&&(isNaN(E)||Ef)&&(C={value:f});break}case"select":w=[{nameRender:"renderSelect",frontText:"with",options:u,defaultValue:(u==null?void 0:u[0].value)||"",attr:"value"}],this.state.settings.value!==void 0&&!(u!=null&&u.find(E=>E.value===this.state.settings.value))&&(C={value:(u==null?void 0:u[0].value)||""});break;case"boolean":w=[{backText:"toggle value",attr:"toggle",nameRender:"renderCheckbox",defaultValue:!1}],i||w.push({backText:"true",frontText:"false",nameRender:"renderSwitch",defaultValue:!1,attr:"value"}),this.state.settings.value!==void 0&&this.state.settings.value!==!1&&this.state.settings.value!==!0&&(C={value:!1});break;case"button":w=[{nameRender:"renderButton",defaultValue:!0,attr:"value"}],this.state.settings.value!==void 0&&this.state.settings.value!==!0&&(C={value:!0});break;case"color":w=[{nameRender:"renderColor",frontText:"with",defaultValue:"#FFFFFF",attr:"value"}],this.state.settings.value!==void 0&&(typeof this.state.settings.value!="string"||!this.state.settings.value.startsWith("#")&&!this.state.settings.value.startsWith("rgb"))&&(C={value:"#FFFFFF"});break;default:w=[{backText:p||"",frontText:"with",nameRender:"renderText",defaultValue:"",attr:"value"}];break}r&&w.unshift({backText:"use trigger value",nameRender:"renderCheckbox",attr:"useTrigger"})}return{inputs:w,newSettings:C}}onTagChange(s,i,r,l,u){u=u===void 0?this.state.settings.useTrigger:u;const{inputs:d,newSettings:p}=this._setInputs(u,l);d.unshift({nameRender:"renderObjectID",attr:"oid",defaultValue:"",checkReadOnly:!0}),this.setState({inputs:d},()=>super.onTagChange(null,()=>{if(p){const m=JSON.parse(JSON.stringify(this.state.settings));Object.assign(m,p),this.setState(m),this.props.onChange(m)}}))}onValueChanged(s,i){this.onTagChange(void 0,void 0,void 0,i==="toggle"?s:void 0,i==="useTrigger"?s:void 0)}onUpdate(){this.onTagChange()}static getStaticData(){return{acceptedBy:"actions",name:"Set state action",id:"ActionSetState",icon:"PlayForWork",tagCardArray:["control","update"],title:"Control or update some state",helpDialog:"You can use %s in the value to use the current trigger value or %id to display the triggered object ID"}}getData(){return Nc.getStaticData()}}class Lc extends Xe{constructor(s){super(s,Lc.getStaticData())}static compile(s,i){return`// exec "${s.exec}" - const subActionVar${s._id} = "${(s.exec||"").replace(/"/g,'\\"')}"${Xe.getReplacesInText(i)}; - _sendToFrontEnd(${s._id}, {exec: subActionVar${s._id}}); - console.log(subActionVar${s._id});`}renderDebug(s){return`Exec: ${s.data.exec}`}onTagChange(s){this.setState({inputs:[{nameRender:"renderModalInput",attr:"exec",defaultValue:"ls /opt/iobroker",nameBlock:"Shell command"}]},()=>super.onTagChange(s))}static getStaticData(){return{acceptedBy:"actions",name:"Exec",id:"ActionExec",icon:"Apps",title:"Executes some shell command",helpDialog:"You can use %s in the command to use current trigger value or %id to use the triggered object ID"}}getData(){return Lc.getStaticData()}}class Pc extends Xe{constructor(s){super(s,Pc.getStaticData())}static compile(s,i){return`// HTTP request ${s.url} - const subActionVar${s._id} = "${(s.url||"").replace(/"/g,'\\"')}"${Xe.getReplacesInText(i)}; - _sendToFrontEnd(${s._id}, {url: subActionVar${s._id}}); - request(subActionVar${s._id});`}renderDebug(s){return`URL: ${s.data.url}`}onTagChange(s){this.setState({inputs:[{nameRender:"renderModalInput",attr:"url",defaultValue:"http://mydevice.com?...",nameBlock:"URL"}]},()=>super.onTagChange(s))}static getStaticData(){return{acceptedBy:"actions",name:"HTTP Call",id:"ActionHTTPCall",icon:"Language",title:"Make a HTTP get request",helpDialog:"You can use %s in the URL to use current trigger value or %id to use the triggered object ID"}}getData(){return Pc.getStaticData()}}class Bc extends Xe{constructor(s){super(s,Bc.getStaticData())}static compile(s,i){return`// Log ${s.text} - const subActionVar${s._id} = "${(s.text||"").replace(/"/g,'\\"')}"${Xe.getReplacesInText(i)}; - _sendToFrontEnd(${s._id}, {text: subActionVar${s._id}}); - console.log(subActionVar${s._id});`}renderDebug(s){return b.I18n.t("Log: %s",s.data.text)}onTagChange(){this.setState({inputs:[{nameRender:"renderModalInput",attr:"text",defaultValue:"My device triggered",nameBlock:"Log text"}]},()=>super.onTagChange())}static getStaticData(){return{acceptedBy:"actions",name:"Log text",id:"ActionPrintText",icon:"Subject",title:"Print some text in log",helpDialog:"You can use %s in the text to display current trigger value or %id to display the triggered object ID"}}getData(){return Bc.getStaticData()}}class jc extends Xe{constructor(s){super(s,jc.getStaticData())}static compile(s){const i=s.unit==="ms"?1:s.unit==="s"?1e3:s.unit==="m"?6e4:36e5;return`// pause for ${i}ms - _sendToFrontEnd(${s._id}, {paused: true}); - - await wait(${s.pause} * ${i}); - - _sendToFrontEnd(${s._id}, {paused: false});`}renderDebug(s){return b.I18n.t("Paused: %s",s.data.paused)}_getOptions(s){return s=s===void 0?this.state.settings.pause:s,s===1||s==="1"?[{value:"ms",title:"millisecond"},{value:"s",title:"second"},{value:"m",title:"minute"},{value:"h",title:"hour"}]:[{value:"ms",title:"milliseconds"},{value:"s",title:"seconds"},{value:"m",title:"minutes"},{value:"h",title:"hours"}]}_setInputs(s){this.setState({inputs:[{nameRender:"renderNumber",attr:"pause",defaultValue:100,noHelperText:!0},{nameRender:"renderSelect",attr:"unit",defaultValue:"ms",options:this._getOptions(s)}]},()=>super.onTagChange())}onValueChanged(s,i){i==="pause"&&this._setInputs(s)}onTagChange(){this._setInputs()}static getStaticData(){return{acceptedBy:"actions",name:"Pause",id:"ActionPause",icon:"Pause",title:"Make a pause between actions"}}getData(){return jc.getStaticData()}}class Fc extends Xe{constructor(s){super(s,Fc.getStaticData())}static compile(s){const i=(s.func||"").split(` -`).map(r=>` ${r}`);return i.unshift(` _sendToFrontEnd(${s._id}, {func: 'executed'});`),i.unshift("// user function"),i.join(` -`)}renderDebug(){return b.I18n.t("Function: executed")}onTagChange(s){this.setState({inputs:[{nameRender:"renderModalInput",attr:"func",noTextEdit:!0,defaultValue:'console.log("Test")',nameBlock:"Function"}]},()=>super.onTagChange(s))}static getStaticData(){return{acceptedBy:"actions",name:"User function",id:"ActionFunction",icon:"Functions",title:"Write your own code",helpDialog:"This is advances option. You can write your own code here and it will be executed on trigger"}}getData(){return Fc.getStaticData()}}class zc extends Xe{constructor(s){super(s,zc.getStaticData())}isAllTriggersOnState(){var s,i,r,l;return!!((i=(s=this.props.userRules)==null?void 0:s.triggers)!=null&&i.find(u=>u.id==="TriggerState"))&&!((l=(r=this.props.userRules)==null?void 0:r.triggers)!=null&&l.find(u=>u.id!=="TriggerState"))}static compile(s,i){let r=s.value;s.useTrigger?r=s.toggle?"!obj.state.val":"obj.state.val":(r==null&&(r=""),typeof s.value=="string"&&parseFloat(s.value).toString()!==s.value&&s.value!=="true"&&s.value!=="false"&&(r=`"${r.replace(/"/g,'\\"')}"${Xe.getReplacesInText(i)}`));let l;return s.toggle&&!s.useTrigger?l=`const subActionVar${s._id} = !(await getStateAsync("${s.oid}")).val`:l=`const subActionVar${s._id} = ${r}`,`// set delayed state ${s.oid} to ${s.toggle&&!s.useTrigger?"toggle":r} with delay of ${s.delay}ms - ${l}; - _sendToFrontEnd(${s._id}, {val: subActionVar${s._id}, ack: ${s.tagCard==="update"}}); - setStateDelayed("${s.oid}", subActionVar${s._id}, ${s.tagCard==="update"}, ${parseInt(s.delay,10)}, ${s.clearRunning?"true":"false"});`}renderDebug(s){var i,r;return g.jsxs("span",{children:[b.I18n.t("Set:")," ",g.jsx("span",{className:s.data.ack?(i=this.props.classes)==null?void 0:i.valueAck:(r=this.props.classes)==null?void 0:r.valueNotAck,children:xn(s.data.val)})]})}_setInputs(s,i){const r=this.isAllTriggersOnState();i=i===void 0?this.state.settings.toggle:i,s=s===void 0?this.state.settings.useTrigger:s;let l="",u;const{oidType:d,oidUnit:p,oidStates:m,oidMax:f,oidMin:v,oidRole:_,oidWrite:y,oidStep:k}=this.state.settings;let C;d&&(d==="number"?(l="number",f!==void 0&&v!==void 0&&(l="slider")):d==="boolean"?(l="boolean",_&&_.includes("button")&&y&&(l="button")):(l="",_&&_.includes("color")&&(l="color")),m&&(u=Object.keys(m).map(E=>({value:E,title:m[E]})),l="select"));let w;if(r&&s)w=[{backText:"use trigger value",nameRender:"renderCheckbox",attr:"useTrigger",defaultValue:!1}],l==="boolean"&&w.push({backText:"toggle value",attr:"toggle",nameRender:"renderCheckbox",defaultValue:!1});else{switch(l){case"number":w=[{backText:p||"",frontText:"with",nameRender:"renderNumber",defaultValue:f===void 0?0:f,attr:"value"}],this.state.settings.value!==void 0&&isNaN(parseFloat(this.state.settings.value))&&(C={value:f===void 0?0:f});break;case"slider":{w=[{nameRender:"renderSlider",defaultValue:f,min:v,max:f,unit:p,step:k,attr:"value"}];const E=parseFloat(this.state.settings.value);this.state.settings.value!==void 0&&(isNaN(E)||Ef)&&(C={value:f});break}case"select":w=[{nameRender:"renderSelect",frontText:"with",options:u,defaultValue:(u==null?void 0:u[0].value)||"",attr:"value"}],this.state.settings.value!==void 0&&!(u!=null&&u.find(E=>E.value===this.state.settings.value))&&(C={value:(u==null?void 0:u[0].value)||""});break;case"boolean":w=[{backText:"toggle value",attr:"toggle",nameRender:"renderCheckbox",defaultValue:!1}],i||w.push({backText:"true",frontText:"false",nameRender:"renderSwitch",defaultValue:!1,attr:"value"}),this.state.settings.value!==void 0&&this.state.settings.value!==!1&&this.state.settings.value!==!0&&(C={value:!1});break;case"button":w=[{nameRender:"renderButton",defaultValue:!0,attr:"value"}],this.state.settings.value!==void 0&&this.state.settings.value!==!0&&(C={value:!0});break;case"color":w=[{nameRender:"renderColor",frontText:"with",defaultValue:"#FFFFFF",attr:"value"}],this.state.settings.value!==void 0&&(typeof this.state.settings.value!="string"||!this.state.settings.value.startsWith("#")&&!this.state.settings.value.startsWith("rgb"))&&(C={value:"#FFFFFF"});break;default:w=[{backText:p||"",frontText:"with",nameRender:"renderText",defaultValue:"",attr:"value"}];break}r&&w.unshift({backText:"use trigger value",nameRender:"renderCheckbox",attr:"useTrigger"})}return w.push({backText:"ms",frontText:"Delay",nameRender:"renderNumber",defaultValue:1e3,noHelperText:!0,attr:"delay"}),w.push({backText:"clear running",nameRender:"renderCheckbox",defaultValue:!0,attr:"clearRunning"}),{inputs:w,newSettings:C}}onTagChange(s,i,r,l,u){u=u===void 0?this.state.settings.useTrigger:u;const{inputs:d,newSettings:p}=this._setInputs(u,l);d.unshift({nameRender:"renderObjectID",attr:"oid",defaultValue:"",checkReadOnly:!0}),this.setState({inputs:d},()=>super.onTagChange(null,()=>{if(p){const m=JSON.parse(JSON.stringify(this.state.settings));Object.assign(m,p),this.setState(m),this.props.onChange(m)}}))}onValueChanged(s,i){this.onTagChange(void 0,void 0,void 0,i==="toggle"?s:void 0,i==="useTrigger"?s:void 0)}onUpdate(){this.onTagChange()}static getStaticData(){return{acceptedBy:"actions",name:"Set with delay",id:"ActionSetStateDelayed",icon:"PlayForWork",tagCardArray:["control","update"],title:"Control or update some state with delay",helpDialog:"You can use %s in the value to use the current trigger value or %id to display the triggered object ID"}}getData(){return zc.getStaticData()}}class Uc extends Xe{constructor(s){super(s,Uc.getStaticData())}isAllTriggersOnState(){var s,i,r,l;return!!((i=(s=this.props.userRules)==null?void 0:s.triggers)!=null&&i.find(u=>u.id==="TriggerState"))&&!((l=(r=this.props.userRules)==null?void 0:r.triggers)!=null&&l.find(u=>u.id!=="TriggerState"))}static compile(s){const i=`const val2_${s._id} = (await getStateAsync("${s.oid1}")).val;`,r=`const val1_${s._id} = (await getStateAsync("${s.oid2}")).val;`;return`// ${s.oid1} ${s.operation} ${s.oid2} => ${s.oidResult} - ${i} - ${r} - _sendToFrontEnd(${s._id}, {val: val1_${s._id} ${s.operation} val2_${s._id}, ack: ${s.tagCard==="update"}}); - await setStateAsync("${s.oidResult}", val1_${s._id} ${s.operation} val2_${s._id}, ${s.tagCard==="update"});`}renderDebug(s){var i,r;return g.jsxs("span",{children:[b.I18n.t("Set:")," ",g.jsx("span",{className:s.data.ack?(i=this.props.classes)==null?void 0:i.valueAck:(r=this.props.classes)==null?void 0:r.valueNotAck,children:xn(s.data.val)})]})}onTagChange(){const s=[];s.push({nameRender:"renderObjectID",title:"ID1",attr:"oid1",defaultValue:"",checkReadOnly:!1}),s.push({nameRender:"renderSelect",options:[{value:"+",title:"+"},{value:"-",title:"-"},{value:"*",title:"*"},{value:"/",title:"/"}],doNotTranslate:!0,defaultValue:"+",attr:"operation"}),s.push({nameRender:"renderObjectID",title:"ID2",attr:"oid2",defaultValue:"",checkReadOnly:!1}),s.push({nameRender:"renderNameText",defaultValue:"store in",attr:"textEqual"}),s.push({nameRender:"renderObjectID",attr:"oidResult",defaultValue:"",checkReadOnly:!0}),this.setState({inputs:s},()=>super.onTagChange(null,()=>{const i=JSON.parse(JSON.stringify(this.state.settings));this.props.onChange(i)}))}onValueChanged(s,i){this.onTagChange()}onUpdate(){this.onTagChange()}static getStaticData(){return{acceptedBy:"actions",name:"Operate two states",id:"ActionOperateStates",icon:"AddBox",tagCardArray:["control","update"],title:"Operations with two states"}}getData(){return Uc.getStaticData()}}const pO=[vi,Oc,Mc,Hr,Wr,Po,Nc,Lc,Pc,Bc,jc,Fc,zc,Uc],cc={sayit:xc,pushover:Dc,"whatsapp-cmb":Ac,pushsafer:Rc},gO=rm({blocks:null,socket:null,onUpdate:!1,setOnUpdate:a=>{},setOnDebugMessage:a=>{},onDebugMessage:[],enableSimulation:!1,setEnableSimulation:a=>{},changedScripts:{},setChangedScripts:a=>{}}),mO=({children:a,socket:s})=>{const[i,r]=vt(null),[l,u]=vt(!1),[d,p]=vt([]),[m,f]=vt(!1),[v,_]=vt({});return Mt(()=>{l&&u(!1)},[l]),Mt(()=>{(async()=>{const y=await s.getAdapterInstances(),k=Object.keys(cc).filter(D=>y.find(A=>{var J;return((J=A==null?void 0:A.common)==null?void 0:J.name)===D})),C=[],w=y.filter(D=>D.common.javascriptRules),E=[];for(const D of w){if(E.includes(D.common.name)||!D.common.javascriptRules)continue;let A;if(D.common.javascriptRules.url.startsWith("http:")||D.common.javascriptRules.url.startsWith("https:")?A=D.common.javascriptRules.url:D.common.javascriptRules.url.startsWith("./")?A=`${window.location.protocol}//${window.location.host}${D.common.javascriptRules.url.replace(/^\./,"")}`:A=`${window.location.protocol}//${window.location.host}/adapter/${D.common.name}/${D.common.javascriptRules.url}`,D.common.javascriptRules.i18n===!0){const J=A.lastIndexOf("/");let ie;J!==-1?ie=A.substring(0,J):ie=A;const se=b.I18n.getLanguage(),me=`${ie}/i18n/${se}.json`;await fetch(me).then(z=>z.json()).then(z=>b.I18n.extendTranslations(z,se)).catch(z=>{if(se!=="en")return fetch(`${ie}/i18n/en.json`).then(Oe=>Oe.json()).then(Oe=>b.I18n.extendTranslations(Oe,se)).catch(Oe=>console.error(`Cannot load i18n "${me}": ${Oe}`));console.log(`Cannot load i18n "${me}": ${z}`)})}else if(D.common.javascriptRules.i18n&&typeof D.common.javascriptRules.i18n=="object")try{b.I18n.extendTranslations(D.common.javascriptRules.i18n)}catch(J){console.error(`Cannot import i18n for "${D.common.javascriptRules.name}": ${J}`)}try{Xy.registerRemotes([{name:D.common.javascriptRules.name,entry:A,type:D.common.javascriptRules.type}]);const J=(await Xy.loadRemote(`${D.common.javascriptRules.name}/${D.common.javascriptRules.name}`)).default;J&&(C.push(J),E.push(D.common.name),cc[D.common.name]=null)}catch(J){console.error(`Cannot load component "${D.common.javascriptRules.name}": ${J}`)}}const R=k.filter(D=>cc[D]).map(D=>cc[D]);r([...pO,...R,...C])})()},[]),g.jsx(gO.Provider,{value:{blocks:i,socket:s,onUpdate:l,setOnUpdate:u,onDebugMessage:d,setOnDebugMessage:p,enableSimulation:m,setEnableSimulation:f,changedScripts:v,setChangedScripts:_},children:a})},fO="Acknowledged",$O="Actions",bO="Add",vO="All",yO="Any",_O="Apply",wO="April",CO="Ask",TO="Astronomical",kO="August",SO="Cancel",EO="Close",IO="Condition",xO="Conditions",DO="Console",AO="Copied",RO="December",OO="Default",MO="Delay",NO="Delete",LO="Description",PO="Done",BO="Exec shell",jO="Explanation",FO="Export",zO="Februar",UO="February",HO="Filter",WO="Folder",GO="Fr",VO="Friday",KO="ID",YO="ID1",JO="ID2",qO="Import",XO="Instance",ZO="Instances",QO="Instructions",eM="Januar",tM="January",sM="July",oM="June",iM="Limit",nM="March",rM="May",aM="Menu",lM="Message",cM="Mo",uM="Model",dM="Monday",hM="Month",pM="More",gM="Name",mM="November",fM="OK",$M="October",bM="Ok",vM="Pause",yM="Pushover",_M="Pushsafer",wM="Rename",CM="Repeat",TM="Restart",kM="Result",SM="Sa",EM="Saturday",IM="Save",xM="Schedule",DM="Script",AM="September",RM="Simulate",OM="Stack",MM="Start",NM="State",LM="Su",PM="Sunday",BM="Telegram",jM="Th",FM="Thursday",zM="Time",UM="Triggered",HM="Triggers",WM="Tu",GM="Tuesday",VM="URL",KM="Value",YM="Volume",JM="We",qM="Wednesday",XM="Write",ZM="Yes",QM="acknowledgment",eN="all",tN="and",sN="Astro",oN="at",iN="control",nN="copy",rN="CRON",aN="Dawn",lN="This is a special mode in which states and objects will not change. But only information about each planned change will be displayed in the protocol.",cN="Debug",uN="Dusk",dN="easy",hN="every",pN="Function",gN="ID",mN="Name",fN="Role",$N="Room",bN="Golden hour",vN="End of golden hour",yN='The code will be executed only every time when condition is true. E.g. if triggering on the temperature sensor value and the condition is "if temperature is greater than 20°C", the "then" actions will be executed every time when sensor sends the temperature and it is over 20°C. By 21°C, by 22°C and so on.',_N='The code will be executed only if the condition result changes. E.g. if triggering on the temperature sensor value and the condition is "if temperature is greater than 20°C", the "then" actions will be executed once when temperature is over 20. Next time the "then" actions will be executed when the temperature fails under 20 and then rises over 20 again.',wN="hours",CN="includes",TN="interval",kN="magic",SN="milliseconds",EN="minutes",IN="ms",xN="Nadir",DN="Nautical dawn",AN="Nautical dusk",RN="Next Sunrise",ON="Next sunset",MN="Night",NN="Night end",LN="normal",PN="offset",BN="one",jN="or",FN="quiet",zN="search",UN="seconds",HN="Solar noon",WN="sunrise",GN="Sunrise end",VN="Sunset",KN="Sunset start",YN="then",JN="Acknowledge",qN="From",XN="Last changed",ZN="Quality",QN="Timestamp",eL="User",tL="Value",sL="two",oL="update",iL="Adds debug output to the log for many system commands",nL="Verbose log outputs",rL="when",aL="Wizard",lL="Retry",cL={"%s not found":"%s not found","()":"()","(at %s)":"(at %s)","(optional)":"(optional)","-":"-",".":".","AI code generator":"AI code generator",Ack:fO,Actions:$O,"Actual time of day":"Actual time of day",Add:bO,"Add new script":"Add new script",All:vO,"All files will be accepted":"All files will be accepted",Any:yO,"Any month":"Any month",Apply:_O,April:wO,"Are you sure?":"Are you sure?",Ask:CO,Astronomical:TO,"Astronomical events today":"Astronomical events today",August:kO,"Blockly description":"Creating rules by graphic blocks","Body:":"Body:",Cancel:SO,"Cannot delete non empty item!":"Cannot delete non empty item!","Change layout":"Change layout",'Change theme (actual "%s")':'Change theme (now - "%s")',"Check blocks":"Check blocks","Check is not active, because javascript adapter is disabled":"Check is not active, because Javascript adapter is disabled","Clear search input":"Clear search input","Click on this icon":"Click on this icon",Close:EO,"Close all but current":"Close all but current","Collapse all":"Collapse all","Compares current time with astronomical event":"Compares current time with astronomical event","Compares current time with the user specific time":"Compares current time with the user specific time","Compares the state value with user defined value":"Compares the state value with user defined value",Condition:IO,Conditions:xO,"Configuration not saved.":"Configuration not saved.",Console:DO,"Control or update some state":"Control or update some state","Control or update some state with delay":"Control or update some state with delay","Convert blockly to javascript for ever.":"Permanently convert Blockly to Javascript.",Copied:AO,"Copy script":"Copy script","Copy to clipboard":"Copy to clipboard","Create new":"Create new","Create new folder":"Create new folder","Create new script":"Create new script","Create or edit CRON or time wizard":"Create or edit CRON or time wizard","Dark Theme":"Dark theme","Dark style":"Dark style",Date:"Date","Debug instance":"Debug instance","Debug options":"Debug options",December:RO,Default:OO,"Define cron...":"Define cron...","Define schedule...":"Define schedule...",Delay:MO,Delete:NO,"Delete %s":"Delete %s...","Delete folder":"Delete folder","Delete script":"Delete script",Description:LO,"Deselect all":"Deselect all","Discard changes for %s":"Discard changes for %s",Done:PO,"Double click to write value":"Double click to write value","Download as file":"Download as file","Drop some files here or click...":"Drop some files here or click...","Duplicate name":"Duplicate name","Edit script or just double click":"Edit script or just double click","Empty name is not allowed":"Empty name is not allowed","End search mode":"End search mode","Enter your question":"Enter your request",Error:"Error","Error formatting code":"Error formatting code","Error was found":"Error was found","Every day":"Every day",Exec:BO,"Executes some shell command":"Executes some shell command","Existing scripts will be overwritten.":"Existing scripts will be overwritten.","Expand all":"Expand all","Expert mode":"Expert mode",Explanation:jO,Export:FO,"Export all scripts":"Export all scripts","Export blocks":"Export blocks","Export selected blocks":"Export selected blocks",Februar:zO,February:UO,Filter:HO,Folder:WO,Fr:GO,Friday:VO,Function:"Function","Function editor":"Function editor","Function: executed":"Function: executed","Go to next line":"Go to next line","HTTP Call":"HTTP Call","Hide logs":"Hide logs",ID:KO,ID1:YO,ID2:JO,Import:qO,"Import blocks":"Import blocks","Import error":"Import error","Import scripts":"Import scripts","Insert object ID":"Insert object ID",Instance:XO,"Instance is disabled":"Instance is disabled","Instance:":"Instance:",Instances:ZO,Instructions:QO,"Invalid CRON":"Invalid CRON","It will not be possible to revert this operation.":"It will not be possible to revert this operation.","JS description":"Creating rules by writing Javascript",Januar:eM,January:tM,July:sM,June:oM,"Just check":"Just check","Language:":"Language:","Learn More":"Learn More","Light style":"Light style",Limit:iM,"Local time":"Local time","Locate file":"Locate file","Log outputs":"Log outputs","Log text":"Log text","Log: %s":"Log: %s","Make a HTTP get request":"Make a HTTP get request","Make a pause between actions":"Make a pause between actions",March:nM,"March ":"March ",May:rM,Menu:aM,Message:lM,Mo:cM,Model:uM,Monday:dM,Month:hM,More:pM,Name:gM,"No API key found":"No API key found","No Chat GPT Key found":"No Chat GPT Key found","No active host found":"No active host found","Nothing found":"Nothing found",November:mM,OK:fM,October:$M,Ok:bM,"On condition change":"On condition result change","On script save or adapter start":"On script save or adapter start","On weekdays":"On weekdays","Open configuration":"Open configuration","Operate two states":"Operate two states","Operations with two states":"Operations with two states","Paste your blocks here":"Paste your blocks here",Pause:vM,"Pause execution":"Pause execution","Pause script":"Pause script","Phone:":"Phone:","Please select object ID...":"Please select object ID...","Press Ctrl+Enter to get the answer":"Press Ctrl+Enter to get the answer","Prettify the script":"Prettify the script","Print some text in log":"Print some text in log","Priority:":"Priority:",Pushover:yM,Pushsafer:_M,"Read only ID selected: %s":"Read only ID selected: %s",Rename:wM,"Reorder scripts in folders":"Reorder scripts in folders",Repeat:CM,Restart:TM,Result:kM,"Resume execution":"Resume execution","Root folder":"Root folder","Rules description":"Create rules with IF, THEN, ELSE blocks","Run script":"Run script",Sa:SM,Saturday:EM,Save:IM,"Save all":"Save all","Say It":"Say It","Say some text via sayit adapter":"Say some text via sayit adapter",Schedule:xM,Script:DM,"Script %s was modified on disk":"Script %s was modified on disk","Script is not running":"Script is not running","Search in scripts":"Search in scripts","Search...":"Search...","Select all":"Select all","Send email":"Send email","Sends an email":"Sends an email","Sends message via Pushsafer":"Sends message via Pushsafer","Sends message via pushover":"Sends message via pushover","Sends message via telegram":"Sends message via telegram","Sends message via whatsapp-cmb":"Sends message via whatsapp-cmb",September:AM,"Server time":"Server time","Set state action":"Set state action","Set with delay":"Set with delay","Shell command":"Shell command","Show astronomical events":"Show astronomical events","Show javascript code":"Show Javascript code","Show logs":"Show logs","Show only paused scripts":"Show only paused scripts","Show only running scripts":"Show only running scripts","Show only scripts with problems":"Show only scripts with problems",Simulate:RM,"Some files will be rejected":"Some files will be rejected","Sound:":"Sound:",Stack:OM,Start:MM,"Start script":"Start script",State:NM,"State condition":"State condition","Step into function":"Step into function","Step out from function":"Step out from function","Stop on exception":"Stop on exception",Su:LM,"Subject:":"Subject:",Sunday:PM,"TS description":"Creating rules by writing Typescript",Telegram:BM,"Text:":"Text:",Th:jM,"The script will be stopped and must be activated manually after debugging. Continue?":"The script will be stopped and must be activated manually after debugging. Continue?","This is advances option. You can write your own code here and it will be executed on trigger":"This is advances option. You can write your own code here and it will be executed on trigger",Thursday:FM,Time:zM,"Time condition":"Time condition","Title:":"Title:","To:":"To:","Trigger with value":"Trigger with value",Triggered:UM,Triggers:HM,"Triggers the on script saving or the javascript instance restart":"Triggers the on script saving or the javascript instance restart","Triggers the rule on update or change of some state":"Triggers the rule on update or change of some state","Triggers the rule periodically or on some specific time":"Triggers the rule periodically or on some specific time",Tu:WM,Tuesday:GM,URL:VM,"Unknown error":"Unknown error","Unknown error!":"Unknown error!","Use generated code":"Use generated code","User function":"User function","User:":"User:",Value:KM,"Vibration:":"Vibration:",Volume:YM,We:JM,Wednesday:qM,"Whatsapp-cmb":"Whatsapp-cmb",Write:XM,"Write your own code":"Write your own code",Yes:ZM,"Yet exists!":"Yet exists!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"You can use %s in the URL to use current trigger value, %id to use the triggered object ID, %name to show triggered object ID name or %old to use old trigger value","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"You can use %s in the command to use current trigger value, %id to use the triggered object ID, %name to show triggered object ID name or %old to use old trigger value","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"You can use %s in the text to display current trigger value, %id to use the triggered object ID, %name to show triggered object ID name or %old to use old trigger value","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"You can use %s in the value to use the current trigger value, %id to use the triggered object ID, %name to show triggered object ID name or %old to use old trigger value","You have to enter OpenAI API key in the configuration of javascript adapter.":"You have to enter OpenAI API key in the configuration of javascript adapter.","You have to enter at least one API key in the configuration of javascript adapter.":"You have to enter at least one API key (OpenAI, Anthropic or Gemini) in the configuration of javascript adapter.","Please select a valid model":"Please select a valid model","[equal]":"[equal]","[greater or equal]":"[greater or equal]","[greater]":"[greater]","[hysteresis]":"[hysteresis]","[includes]":"[includes]","[less or equal]":"[less or equal]","[less]":"[less]","[not equal]":"[not equal]",acknowledgment:QM,all:eN,and:tN,astro:sN,at:oN,"clear running":"clear running",control:iN,copy:nN,cron:rN,dawn:aN,debug_help:lN,debug_label:cN,default:"default",dusk:uN,easy:dN,else:"else","equal to":"equal to",every:hN,"every hour at 0 minutes":"every hour at 0 minutes",false:"false","file reading has failed: %s":"file reading has failed: %s","file reading was aborted":"file reading was aborted",filter_func:pN,filter_id:gN,filter_name:mN,filter_role:fN,filter_room:$N,"for edit or create script":"for edit or create a new script","for professionals":"for professionals","for programmers":"for programmers",goldenHour:bN,goldenHourEnd:vN,"greater or equal":"greater or equal","greater or equal to":"greater or equal to","greater than":"greater than",help_just_check:yN,help_on_change:_N,"high priority":"high priority","high-priority":"high-priority","highest priority":"highest priority",hours:wN,includes:CN,interval:TN,"just check":"just check","less or equal":"less or equal","less or equal to":"less or equal to","less than":"less than","lower priority":"lower priority","lowest priority":"lowest priority",magic:kN,milliseconds:SN,minutes:EN,ms:IN,nadir:xN,nauticalDawn:DN,nauticalDusk:AN,nextSunrise:RN,nextSunset:ON,night:MN,nightEnd:NN,"no blocks found":"No blocks found","no group":"NO GROUP",normal:LN,"normal priority":"normal priority","not equal to":"not equal to","not properly connected":"This block is not properly connected to other blocks.",offset:PN,"on change":"on change","on condition change":"on condition change","on update":"on update",one:BN,or:jN,quiet:FN,"reset search":"reset search",search:zN,seconds:UN,solarNoon:HN,"store in":"store in",sunrise:WN,sunriseEnd:GN,sunset:VN,sunsetStart:KN,then:YN,"toggle value":"toggle value",tooltip_ack:JN,tooltip_from:qN,tooltip_lc:XN,tooltip_quality:ZN,tooltip_ts:QN,tooltip_user:eL,tooltip_value:tL,true:"true",two:sL,undefined:"undefined",update:oL,"use seconds":"use seconds","use trigger value":"use trigger value",verbose_help:iL,verbose_label:nL,when:rL,with:"with","with date":"with date","with offset":"with offset",wizard:aL,"Loading models...":"Loading models...","Could not connect to API at %s":"Could not connect to API at %s","Invalid API key":"Invalid API key","Access denied by API":"Access denied by API","API error: %s":"API error: %s",'Model "%s" not found':'Model "%s" not found',"Request failed: %s":"Request failed: %s",Retry:lL,"No running javascript instance found":"No running javascript instance found"},uL="Bestätigt",dL="Aktionen",hL="Hinzufügen",pL="Alle",gL="Egal",mL="Anwenden",fL="April",$L="Fragen",bL="Astronomisch",vL="August",yL="Abbrechen",_L="Schließen",wL="Bedingung",CL="Bedingungen",TL="Konsole",kL="Kopiert",SL="Dezember",EL="Standard",IL="Verzögerung",xL="Löschen",DL="Beschreibung",AL="Fertig",RL="Exec shell",OL="Erläuterung",ML="Export",NL="Februar",LL="Februar",PL="Filter",BL="Ordner",jL="Fr",FL="Freitag",zL="ID",UL="ID1",HL="ID2",WL="Import",GL="Instanz",VL="Instanzen",KL="Anleitung",YL="Januar",JL="Januar",qL="Juli",XL="Juni",ZL="Grenze",QL="März",e1="Mai",t1="Menü",s1="Nachricht",o1="Mo",i1="Modell",n1="Montag",r1="Monat",a1="Mehr",l1="Name",c1="November",u1="OK",d1="Oktober",h1="Ok",p1="Pause",g1="Pushover",m1="Pushsafer",f1="Umbenennen",$1="Wiederholen",b1="Neustart",v1="Ergebnis",y1="Sa",_1="Samstag",w1="Speichern",C1="Zeitplan",T1="Skript",k1="September",S1="Simulieren",E1="Stack",I1="Start",x1="Zustand",D1="So",A1="Sonntag",R1="Telegram",O1="Do",M1="Donnerstag",N1="Zeit",L1="Ausgelöst",P1="Löst aus",B1="Di",j1="Dienstag",F1="URL",z1="Wert",U1="Volumen",H1="Mi",W1="Mittwoch",G1="Schreiben",V1="Ja",K1="Wissen",Y1="alle",J1="und",q1="Astro",X1="um",Z1="Steuerung",Q1="Kopie",eP="CRON",tP="Morgendämmerung",sP="Dies ist ein spezieller Modus, in dem sich Zustände und Objekte nicht ändern. Im Protokoll werden jedoch nur Informationen zu jeder geplanten Änderung angezeigt.",oP="Debuggen",iP="Abenddämmerung",nP="einfach",rP="jeder",aP="Funktion",lP="ID",cP="Name",uP="Rolle",dP="Raum",hP="Goldene Abendstunde",pP="Vormittag",gP='Der Code wird jedes Mal ausgeführt, wenn die Bedingung erfüllt ist. z.B. wenn der Temperatur wert sich ändert und die Bedingung "Wenn die Temperatur größer als 20°C ist" lautet, werden die "Dann" -Aktionen jedes Mal ausgeführt, wenn der Sensor die Temperatur sendet und diese über 20°C liegt. Bei 21°C, bei 22°C und so weiter.',mP='Der Code wird nur ausgeführt, wenn sich das Ergebnis der Bedingung ändert. z.B. wenn sich der Temperatur wert ändert und die Bedingung "Wenn die Temperatur größer als 20°C ist" lautet, werden die "Dann" -Aktionen einmal ausgeführt, wenn die Temperatur über 20°C liegt. Das nächste Mal werden die "Dann" -Aktionen ausgeführt, wenn die Temperatur unter 20°C gefallen ist und dann wieder über 20°C ansteigt.',fP="Stunden",$P="beinhaltet",bP="Intervall",vP="Magie",yP="Millisekunden",_P="Minuten",wP="ms",CP="Nadir",TP="nautische Morgendämmerung",kP="nautische Abenddämmerung",SP="Nächster Sonnenaufgang",EP="Nächster Sonnenuntergang",IP="Nacht",xP="astronomische Morgendämmerung",DP="Normal",AP="Versatz",RP="einer",OP="oder",MP="ruhig",NP="Suche",LP="Sekunden",PP="(Nach-)Mittag",BP="Sonnenaufgang",jP="Goldene Morgenstunde",FP="Sonnenuntergang",zP="Sonnenuntergang (Anfang)",UP="dann",HP="Bestätigen",WP="Von",GP="Zuletzt geändert",VP="Qualität",KP="Zeitstempel",YP="Benutzer",JP="Wert",qP="zwei",XP="Aktualisieren",ZP="Fügt Debug-Ausgaben für viele Systembefehle zum Protokoll hinzu",QP="Ausführliche Protokollausgaben",eB="falls",tB="Assistent",sB="Erneut versuchen",oB={"%s not found":"%s nicht gefunden","()":"()","(at %s)":"(um %s)","(optional)":"(optional)","-":"-",".":".","AI code generator":"KI-Codegenerator",Ack:uL,Actions:dL,"Actual time of day":"Tatsächliche Tageszeit",Add:hL,"Add new script":"Neues Skript hinzufügen",All:pL,"All files will be accepted":"Alle Dateien werden akzeptiert",Any:gL,"Any month":"Jeden Monat",Apply:mL,April:fL,"Are you sure?":"Wirklich sicher?",Ask:$L,Astronomical:bL,"Astronomical events today":"Astronomische Ereignisse heute",August:vL,"Blockly description":"Erstellen von Regeln durch Grafikblöcke","Body:":"Körper:",Cancel:yL,"Cannot delete non empty item!":"Kann nicht gelöscht werden, weil noch einige Elementen darin sind!","Change layout":"Layout ändern",'Change theme (actual "%s")':'Thema ändern (jetzt - "%s")',"Check blocks":"Blöcke prüfen","Check is not active, because javascript adapter is disabled":"Syntax-Check ist nicht aktiv, weil der Javascript Adapter nicht aktiv ist.","Clear search input":"Sucheingabe löschen","Click on this icon":"Auf dieses Symbol klicken",Close:_L,"Close all but current":"Alle anderen außer dem Aktiven schließen","Collapse all":"Alles einklappen","Compares current time with astronomical event":"Vergleicht die aktuelle Zeit mit einem astronomischen Ereignis","Compares current time with the user specific time":"Vergleicht die aktuelle Zeit mit der benutzerspezifischen Zeit","Compares the state value with user defined value":"Vergleicht den Zustandswert mit dem benutzerdefinierten Wert",Condition:wL,Conditions:CL,"Configuration not saved.":"Die Konfiguration ist nicht gespeichert.",Console:TL,"Control or update some state":"Zustand steuern oder aktualisieren","Control or update some state with delay":"Zustand mit Verzögerung steuern oder aktualisieren","Convert blockly to javascript for ever.":"Blockly dauerhaft in Javascript konvertieren.",Copied:kL,"Copy script":"Skript kopieren","Copy to clipboard":"In die Zwischenablage kopieren","Create new":"Neu erstellen","Create new folder":"Neuen Ordner erstellen","Create new script":"Neues Skript erstellen","Create or edit CRON or time wizard":"CRON- oder Zeit-Assistenten erstellen oder bearbeiten","Dark Theme":"Dunkles Thema","Dark style":"Dunkler Stil",Date:"Datum","Debug instance":"Debug-Instanz","Debug options":"Debug-Optionen",December:SL,Default:EL,"Define cron...":"Cron definieren ...","Define schedule...":"Zeitplan definieren ...",Delay:IL,Delete:xL,"Delete %s":"Löschen %s...","Delete folder":"Ordner löschen","Delete script":"Skript löschen",Description:DL,"Deselect all":"Alles abwählen","Discard changes for %s":"Änderungen für %s verwerfen",Done:AL,"Double click to write value":"Doppelklick zum Schreiben des Wertes","Download as file":"Download als Datei","Drop some files here or click...":"Dateien hier ablegen oder klicken ...","Duplicate name":"Doppelter Name","Edit script or just double click":"Skript bearbeiten oder einfach doppelklicken","Empty name is not allowed":"Leerer Name ist nicht zulässig","End search mode":"Suchmodus beenden","Enter your question":"Anfrage eingeben",Error:"Fehler","Error formatting code":"Fehler beim Formatieren des Codes","Error was found":"Fehler wurde gefunden","Every day":"Täglich",Exec:RL,"Executes some shell command":"Führt einen Shell-Befehl aus","Existing scripts will be overwritten.":"Vorhandene Skripte werden überschrieben.","Expand all":"Alle erweitern","Expert mode":"Expertenmodus",Explanation:OL,Export:ML,"Export all scripts":"Alle Skripte exportieren","Export blocks":"Blöcke exportieren","Export selected blocks":"Ausgewählte Blöcke exportieren",Februar:NL,February:LL,Filter:PL,Folder:BL,Fr:jL,Friday:FL,Function:"Funktion","Function editor":"Funktions-Editor","Function: executed":"Funktion: ausgeführt","Go to next line":"Gehe zur nächsten Zeile","HTTP Call":"HTTP-Aufruf","Hide logs":"Protokoll ausblenden",ID:zL,ID1:UL,ID2:HL,Import:WL,"Import blocks":"Blöcke importieren","Import error":"Fehler beim Importieren","Import scripts":"Skripte importieren","Insert object ID":"Objekt-ID einfügen",Instance:GL,"Instance is disabled":"Instanz ist deaktiviert","Instance:":"Instanz:",Instances:VL,Instructions:KL,"Invalid CRON":"Ungültiger CRON","It will not be possible to revert this operation.":"Dieser Vorgang kann nicht rückgängig gemacht werden.","JS description":"Regeln erstellen mit JavaScript",Januar:YL,January:JL,July:qL,June:XL,"Just check":"Einfach überprüfen","Language:":"Sprache:","Learn More":"Mehr erfahren","Light style":"Heller Stil",Limit:ZL,"Local time":"Lokale Zeit","Locate file":"Datei zeigen","Log outputs":"Protokoll","Log text":"Protokolltext","Log: %s":"Log: %s","Make a HTTP get request":"Eine HTTP-Abrufanforderung stellen","Make a pause between actions":"Eine Pause zwischen den Aktionen machen",March:QL,"March ":"März ",May:e1,Menu:t1,Message:s1,Mo:o1,Model:i1,Monday:n1,Month:r1,More:a1,Name:l1,"No API key found":"Kein API-Schlüssel gefunden","No Chat GPT Key found":"Kein Chat-GPT-Schlüssel gefunden","No active host found":"Kein aktiver Host gefunden","Nothing found":"Nichts gefunden",November:c1,OK:u1,October:d1,Ok:h1,"On condition change":"Bei Änderung des Ergebnis der Bedingung","On script save or adapter start":"Beim Speichern des Skripts oder beim Starten des Adapters","On weekdays":"An Wochentagen","Open configuration":"Konfiguration öffnen","Operate two states":"Zwei Zustände operieren","Operations with two states":"Operationen mit zwei Zuständen","Paste your blocks here":"Fügen Sie Ihre Blöcke hier ein",Pause:p1,"Pause execution":"Ausführung pausieren","Pause script":"Skript anhalten","Phone:":"Telefon:","Please select object ID...":"Objekt-ID auswählen ...","Press Ctrl+Enter to get the answer":"Strg+Eingabetaste, um die Antwort zu erhalten","Prettify the script":"Verschönern Sie das Skript","Print some text in log":"Einen Text im Protokoll ausdrucken","Priority:":"Priorität:",Pushover:g1,Pushsafer:m1,"Read only ID selected: %s":"Schreibgeschützte ID ausgewählt: %s",Rename:f1,"Reorder scripts in folders":"Skripte in Ordnern neu ordnen",Repeat:$1,Restart:b1,Result:v1,"Resume execution":"Ausführung fortsetzen","Root folder":"Root-Verzeichnis","Rules description":"Regeln erstellen mit WENN-, DANN- und SONST-Blöcken","Run script":"Skript ausführen",Sa:y1,Saturday:_1,Save:w1,"Save all":"Alle speichern","Say It":"Say It","Say some text via sayit adapter":"Einen Text über den Sayit-Adapter sagen",Schedule:C1,Script:T1,"Script %s was modified on disk":'Skript "%s" wurde auf der Festplatte geändert',"Script is not running":"Skript läuft nicht","Search in scripts":"Suche in Skripten","Search...":"Suche...","Select all":"Alles auswählen","Send email":"E-Mail senden","Sends an email":"Sendet eine E-Mail","Sends message via Pushsafer":"Sendet eine Nachricht über Pushsafer","Sends message via pushover":"Sendet eine Nachricht per Pushover","Sends message via telegram":"Sendet eine Nachricht per telegram","Sends message via whatsapp-cmb":"Sendet eine Nachricht über WhatsApp-Cmb",September:k1,"Server time":"Server-Zeit","Set state action":"Zustand setzten","Set with delay":"Setzen mit Verzögerung","Shell command":"Shell-Befehl","Show astronomical events":"Astronomische Ereignisse anzeigen","Show javascript code":"Javascript-Code zeigen","Show logs":"Protokoll anzeigen","Show only paused scripts":"Nur angehaltene Skripte zeigen","Show only running scripts":"Nur laufende Skripte zeigen","Show only scripts with problems":"Nur Skripte mit Problemen zeigen",Simulate:S1,"Some files will be rejected":"Einige Dateien werden abgelehnt","Sound:":"Klang:",Stack:E1,Start:I1,"Start script":"Skript starten",State:x1,"State condition":"Zustandsbedingung","Step into function":"Schritt in die Funktion","Step out from function":"Raus aus der Funktion","Stop on exception":"Bei Ausnahme anhalten",Su:D1,"Subject:":"Gegenstand:",Sunday:A1,"TS description":"Regeln erstellen mit TypeScript",Telegram:R1,"Text:":"Text:",Th:O1,"The script will be stopped and must be activated manually after debugging. Continue?":"Das Skript wird gestoppt und muss nach dem Debuggen manuell aktiviert werden. Fortsetzen?","This is advances option. You can write your own code here and it will be executed on trigger":"Dies ist eine erweiterte Option. Sie können hier Ihren eigenen Code schreiben, der beim Auslösen ausgeführt wird",Thursday:M1,Time:N1,"Time condition":"Zeitbedingung","Title:":"Titel:","To:":"Zu:","Trigger with value":"Trigger mit Wert",Triggered:L1,Triggers:P1,"Triggers the on script saving or the javascript instance restart":"Löst das Speichern des Skripts oder den Neustart der Javascript-Instanz aus","Triggers the rule on update or change of some state":"Löst die Regel beim Aktualisieren oder Ändern eines Zustands aus","Triggers the rule periodically or on some specific time":"Löst periodisch oder zu einem bestimmten Zeitpunkt aus",Tu:B1,Tuesday:j1,URL:F1,"Unknown error":"Unbekannter Fehler","Unknown error!":"Unbekannter Fehler!","Use generated code":"Code verwenden","User function":"Benutzerfunktion","User:":"Benutzer:",Value:z1,"Vibration:":"Vibration:",Volume:U1,We:H1,Wednesday:W1,"Whatsapp-cmb":"WhatsApp-cmb",Write:G1,"Write your own code":"Eigenen Code schreiben",Yes:V1,"Yet exists!":"Existiert schon!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Sie können %s in der URL verwenden, um den aktuellen Triggerwert zu verwenden, %id, um die ausgelöste Objekt-ID zu verwenden, %name, um den ID-Namen des ausgelösten Objekts anzuzeigen, oder %old, um den alten Triggerwert zu verwenden","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Sie können %s im Befehl verwenden, um den aktuellen Triggerwert zu verwenden, %id, um die ausgelöste Objekt-ID zu verwenden, %name, um den ID-Namen des ausgelösten Objekts anzuzeigen, oder %old, um den alten Triggerwert zu verwenden","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Sie können %s im Text verwenden, um den aktuellen Triggerwert anzuzeigen, %id, um die ausgelöste Objekt-ID zu verwenden, %name, um den ID-Namen des ausgelösten Objekts anzuzeigen, oder %old, um den alten Triggerwert zu verwenden","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Sie können %s im Wert verwenden, um den aktuellen Triggerwert zu verwenden, %id, um die ID des ausgelösten Objekts zu verwenden, %name, um den ID-Namen des ausgelösten Objekts anzuzeigen, oder %old, um den alten Triggerwert zu verwenden","You have to enter OpenAI API key in the configuration of javascript adapter.":"Sie müssen den OpenAI-API-Schlüssel in der Konfiguration des Javascript-Adapters eingeben.","You have to enter at least one API key in the configuration of javascript adapter.":"Sie müssen mindestens einen API-Schlüssel (OpenAI, Anthropic oder Gemini) in der Konfiguration des Javascript-Adapters eingeben.","Please select a valid model":"Bitte wählen Sie ein gültiges Modell aus","[equal]":"[gleich]","[greater or equal]":"[größer oder gleich]","[greater]":"[größer]","[hysteresis]":"[Hysterese]","[includes]":"[enthält]","[less or equal]":"[kleiner oder gleich]","[less]":"[kleiner]","[not equal]":"[ungleich]",acknowledgment:K1,all:Y1,and:J1,astro:q1,at:X1,"clear running":"laufende abbrechen",control:Z1,copy:Q1,cron:eP,dawn:tP,debug_help:sP,debug_label:oP,default:"Standard",dusk:iP,easy:nP,else:"sonst","equal to":"gleich",every:rP,"every hour at 0 minutes":"jede Stunde bei 0 Minuten",false:"falsch","file reading has failed: %s":"Das Lesen der Datei ist fehlgeschlagen: %s","file reading was aborted":"Das Lesen der Datei wurde abgebrochen",filter_func:aP,filter_id:lP,filter_name:cP,filter_role:uP,filter_room:dP,"for edit or create script":"zum Bearbeiten oder zum Erstellen eines neues Skripts","for professionals":"für Profis","for programmers":"für Programmierer",goldenHour:hP,goldenHourEnd:pP,"greater or equal":"größer oder gleich","greater or equal to":"größer oder gleich","greater than":"größer als",help_just_check:gP,help_on_change:mP,"high priority":"hohe Priorität","high-priority":"hohe Priorität","highest priority":"höchste Priorität",hours:fP,includes:$P,interval:bP,"just check":"einfach prüfen","less or equal":"kleiner oder gleich","less or equal to":"kleiner oder gleich","less than":"kleiner als","lower priority":"geringere Priorität","lowest priority":"niedrigste Priorität",magic:vP,milliseconds:yP,minutes:_P,ms:wP,nadir:CP,nauticalDawn:TP,nauticalDusk:kP,nextSunrise:SP,nextSunset:EP,night:IP,nightEnd:xP,"no blocks found":"Keine Blöcke gefunden","no group":"KEINE GRUPPE",normal:DP,"normal priority":"normale Priorität","not equal to":"ungleich","not properly connected":"Dieser Block ist mit anderen nicht richtig verbunden.",offset:AP,"on change":"bei Änderung","on condition change":"bei Zustandsänderung","on update":"beim Aktualisieren",one:RP,or:OP,quiet:MP,"reset search":"Suche zurücksetzen",search:NP,seconds:LP,solarNoon:PP,"store in":"speichern in",sunrise:BP,sunriseEnd:jP,sunset:FP,sunsetStart:zP,then:UP,"toggle value":"Wert umschalten",tooltip_ack:HP,tooltip_from:WP,tooltip_lc:GP,tooltip_quality:VP,tooltip_ts:KP,tooltip_user:YP,tooltip_value:JP,true:"wahr",two:qP,undefined:"nicht definiert",update:XP,"use seconds":"Sekunden verwenden","use trigger value":"Triggerwert benutzen",verbose_help:ZP,verbose_label:QP,when:eB,with:"mit","with date":"mit Datum","with offset":"mit Versatz",wizard:tB,"Loading models...":"Modelle werden geladen...","Could not connect to API at %s":"Verbindung zur API unter %s nicht möglich","Invalid API key":"Ungültiger API-Schlüssel","Access denied by API":"Zugriff von der API verweigert","API error: %s":"API-Fehler: %s",'Model "%s" not found':'Modell "%s" nicht gefunden',"Request failed: %s":"Anfrage fehlgeschlagen: %s",Retry:sB,"No running javascript instance found":"Keine laufende JavaScript-Instanz gefunden"},iB="Admitido",nB="Comportamiento",rB="Añadir",aB="Todos",lB="Alguna",cB="Apply",uB="abril",dB="Preguntar",hB="Astronómico",pB="agosto",gB="Cancelar",mB="Cerrar",fB="Condición",$B="Condiciones",bB="Consola",vB="Copiado",yB="diciembre",_B="Defecto",wB="Demora",CB="Eliminar",TB="Descripción",kB="Hecho",SB="Ejecutivo shell",EB="Explicación",IB="Exportar",xB="Februar",DB="febrero",AB="Filtrar",RB="Carpeta",OB="P.",MB="viernes",NB="CARNÉ DE IDENTIDAD",LB="ID1",PB="ID2",BB="Importar",jB="Ejemplo",FB="Instancias",zB="Instrucciones",UB="Enero",HB="enero",WB="julio",GB="junio",VB="Límite",KB="marzo",YB="Mayo",JB="Menú",qB="Mensaje",XB="Mes",ZB="Modelo",QB="lunes",ej="Mes",tj="Más",sj="Nombre",oj="noviembre",ij="OK",nj="octubre",rj="Okay",aj="Pausa",lj="Persona fácil de convencer",cj="Pushsafer",uj="Rebautizar",dj="Repetir",hj="Reiniciar",pj="Resultado",gj="Sa",mj="sábado",fj="Salvar",$j="Calendario",bj="Guión",vj="septiembre",yj="Simular",_j="Stack",wj="Comienzo",Cj="Expresar",Tj="Su",kj="domingo",Sj="Telegrama",Ej="4",Ij="jueves",xj="Tiempo",Dj="Motivado",Aj="Disparadores",Rj="Tu",Oj="martes",Mj="URL",Nj="Valor",Lj="Volumen",Pj="3",Bj="miércoles",jj="Escribir",Fj="sí",zj="Reconocimiento",Uj="todos",Hj="y",Wj="astro",Gj="a",Vj="control",Kj="Copiar",Yj="CRON",Jj="Amanecer",qj="Este es un modo especial en el que los estados y los objetos no cambiarán. Pero solo se mostrará información sobre cada cambio planificado en el protocolo.",Xj="Depurar",Zj="Oscuridad",Qj="fácil",eF="cada",tF="Función",sF="CARNÉ DE IDENTIDAD",oF="Nombre",iF="Papel",nF="Habitación",rF="hora dorada",aF="Fin de la hora dorada",lF='El código se ejecutará solo cada vez que la condición sea verdadera. P.ej. si se activa en el valor del sensor de temperatura y la condición es "si la temperatura es superior a 20 ° C", las acciones "entonces" se ejecutarán cada vez que el sensor envíe la temperatura y supere los 20 ° C. Por 21 ° C, por 22 ° C y así sucesivamente.',cF='El código se ejecutará solo si cambia el resultado de la condición. P.ej. si se activa en el valor del sensor de temperatura y la condición es "si la temperatura es superior a 20 ° C", las acciones "entonces" se ejecutarán una vez cuando la temperatura sea superior a 20. La próxima vez, las acciones "entonces" se ejecutarán cuando la temperatura falla por debajo de 20 y luego sube por encima de 20 nuevamente.',uF="horas",dF="incluye",hF="intervalo",pF="magia",gF="milisegundos",mF="minutos",fF="ms",$F="nadir",bF="Amanecer náutico",vF="Atardecer náutico",yF="próximo amanecer",_F="Próxima puesta de sol",wF="Noche",CF="Fin de la noche",TF="normal",kF="compensar",SF="uno",EF="o",IF="tranquilo",xF="buscar",DF="segundos",AF="Mediodía solar",RF="amanecer",OF="Final del amanecer",MF="puesta de sol",NF="Inicio al atardecer",LF="entonces",PF="Reconocer",BF="De",jF="Último cambio",FF="Calidad",zF="Marca de tiempo",UF="Usuario",HF="Valor",WF="dos",GF="actualizar",VF="Agrega salida de depuración al registro para muchos comandos del sistema",KF="Salidas de registro detalladas",YF="cuando",JF="Wizard",qF="Reintentar",XF={"%s not found":"%s no encontrado","()":"()","(at %s)":"(en %s)","(optional)":"(Opcional)","-":"-",".":".","AI code generator":"Generador de código de IA",Ack:iB,Actions:nB,"Actual time of day":"Hora real del día",Add:rB,"Add new script":"Agregar nuevo script",All:aB,"All files will be accepted":"Todos los archivos serán aceptados.",Any:lB,"Any month":"Cualquier mes",Apply:cB,April:uB,"Are you sure?":"¿Estás seguro?",Ask:dB,Astronomical:hB,"Astronomical events today":"Eventos astronómicos hoy",August:pB,"Blockly description":"Crear reglas por bloques gráficos","Body:":"Cuerpo:",Cancel:gB,"Cannot delete non empty item!":"¡No se puede eliminar un elemento no vacío!","Change layout":"Cambia el diseño",'Change theme (actual "%s")':'Cambiar tema (ahora - "%s")',"Check blocks":"Comprobar bloques","Check is not active, because javascript adapter is disabled":"La comprobación no está activa porque el adaptador Javascript está desactivado","Clear search input":"Borrar entrada de búsqueda","Click on this icon":"Haga clic en este ícono",Close:mB,"Close all but current":"Cerrar todo menos el actual","Collapse all":"Desplegar todo","Compares current time with astronomical event":"Compara la hora actual con un evento astronómico","Compares current time with the user specific time":"Compara la hora actual con la hora específica del usuario","Compares the state value with user defined value":"Compara el valor del estado con el valor definido por el usuario",Condition:fB,Conditions:$B,"Configuration not saved.":"Configuración no guardada.",Console:bB,"Control or update some state":"Controlar o actualizar algún estado","Control or update some state with delay":"Controlar o actualizar algún estado con retraso","Convert blockly to javascript for ever.":"Convierta instantáneamente en bloque a Javascript.",Copied:vB,"Copy script":"Copiar guion","Copy to clipboard":"Copiar al portapapeles","Create new":"Crear nuevo","Create new folder":"Crear nueva carpeta","Create new script":"Crear nuevo script","Create or edit CRON or time wizard":"Crear o editar CRON o asistente de tiempo","Dark Theme":"Tema oscuro","Dark style":"Estilo oscuro",Date:"Fecha","Debug instance":"Instancia de depuración","Debug options":"Opciones de depuración",December:yB,Default:_B,"Define cron...":"Definir cron ...","Define schedule...":"Definir horario ...",Delay:wB,Delete:CB,"Delete %s":"Eliminar %s ...","Delete folder":"Eliminar carpeta","Delete script":"Eliminar guión",Description:TB,"Deselect all":"Deseleccionar todo","Discard changes for %s":"Descartar cambios para %s",Done:kB,"Double click to write value":"Doble clic para escribir el valor","Download as file":"Descargar como archivo","Drop some files here or click...":"Suelta algunos archivos aquí o haz clic ...","Duplicate name":"Nombre duplicado","Edit script or just double click":"Editar guión o simplemente hacer doble clic","Empty name is not allowed":"No se permite el nombre vacío","End search mode":"Fin del modo de búsqueda","Enter your question":"Ingrese su solicitud",Error:"Error","Error formatting code":"Código de formato de error","Error was found":"Error encontrado","Every day":"Diario",Exec:SB,"Executes some shell command":"Ejecuta algún comando de shell","Existing scripts will be overwritten.":"Los guiones existentes se sobrescribirán.","Expand all":"Expandir todo","Expert mode":"Modo experto",Explanation:EB,Export:IB,"Export all scripts":"Exportar todos los scripts","Export blocks":"Exportar bloques","Export selected blocks":"Exportar bloques seleccionados",Februar:xB,February:DB,Filter:AB,Folder:RB,Fr:OB,Friday:MB,Function:"Función","Function editor":"Editor de funciones","Function: executed":"Función: ejecutada","Go to next line":"Ir a la siguiente línea","HTTP Call":"Llamada HTTP","Hide logs":"Ocultar registros",ID:NB,ID1:LB,ID2:PB,Import:BB,"Import blocks":"Importar bloques","Import error":"Error de importación","Import scripts":"Importar guiones","Insert object ID":"Insertar ID de objeto",Instance:jB,"Instance is disabled":"La instancia está deshabilitada","Instance:":"Ejemplo:",Instances:FB,Instructions:zB,"Invalid CRON":"CRON inválido","It will not be possible to revert this operation.":"No será posible revertir esta operación.","JS description":"Crear reglas escribiendo Javascript",Januar:UB,January:HB,July:WB,June:GB,"Just check":"Sólo revisa","Language:":"Idioma:","Learn More":"Aprende más","Light style":"Estilo ligero",Limit:VB,"Local time":"Hora local","Locate file":"Localizar el archivo","Log outputs":"Salidas de registro","Log text":"Texto de registro","Log: %s":"Log: %s","Make a HTTP get request":"Realizar una solicitud de obtención HTTP","Make a pause between actions":"Hacer una pausa entre acciones",March:KB,"March ":"marzo",May:YB,Menu:JB,Message:qB,Mo:XB,Model:ZB,Monday:QB,Month:ej,More:tj,Name:sj,"No API key found":"No se encontró ninguna clave API","No Chat GPT Key found":"No se ha encontrado ninguna clave GPT de chat","No active host found":"No se encontró un host activo","Nothing found":"Nada Encontrado",November:oj,OK:ij,October:nj,Ok:rj,"On condition change":"En condición de cambio","On script save or adapter start":"Al guardar el script o al iniciar el adaptador","On weekdays":"De lunes a viernes","Open configuration":"Configuración abierta","Operate two states":"Operar dos estados","Operations with two states":"Operaciones con dos estados","Paste your blocks here":"Pega tus bloques aquí",Pause:aj,"Pause execution":"Pausar ejecución","Pause script":"Pausar guion","Phone:":"Teléfono:","Please select object ID...":"Por favor, seleccione la ID del objeto ...","Press Ctrl+Enter to get the answer":"Presiona Ctrl+Enter para obtener la respuesta","Prettify the script":"Embellecer el guión","Print some text in log":"Imprime texto en el registro","Priority:":"Prioridad:",Pushover:lj,Pushsafer:cj,"Read only ID selected: %s":"ID de solo lectura seleccionado: %s",Rename:uj,"Reorder scripts in folders":"Reordenar guiones en carpetas",Repeat:dj,Restart:hj,Result:pj,"Resume execution":"Reanudar ejecución","Root folder":"Carpeta raíz","Rules description":"Crea reglas con bloques IF, THEN, ELSE","Run script":"Ejecutar guión",Sa:gj,Saturday:mj,Save:fj,"Save all":"Salvar a todos","Say It":"Say It","Say some text via sayit adapter":"Di un mensaje de texto a través del adaptador sayit",Schedule:$j,Script:bj,"Script %s was modified on disk":"El script %s fue modificado en el disco","Script is not running":"El script no se está ejecutando","Search in scripts":"Buscar en guiones","Search...":"Buscar...","Select all":"Seleccionar todo","Send email":"Enviar correo electrónico","Sends an email":"Envía un correo electrónico","Sends message via Pushsafer":"Envía mensaje a través de Pushsafer","Sends message via pushover":"Envía un mensaje a través de un pushover","Sends message via telegram":"Envía mensaje por telegrama","Sends message via whatsapp-cmb":"Envía mensaje vía whatsapp-cmb",September:vj,"Server time":"Tiempo del servidor","Set state action":"Establecer acción estatal","Set with delay":"Establecer con retraso","Shell command":"Comando de Shell","Show astronomical events":"Mostrar eventos astronómicos","Show javascript code":"Mostrar código Javascript","Show logs":"Mostrar registros","Show only paused scripts":"Mostrar solo secuencias de comandos pausadas","Show only running scripts":"Mostrar solo scripts en ejecución","Show only scripts with problems":"Mostrar solo guiones con problemas",Simulate:yj,"Some files will be rejected":"Algunos archivos serán rechazados","Sound:":"Sonido:",Stack:_j,Start:wj,"Start script":"Iniciar guion",State:Cj,"State condition":"Condición del estado","Step into function":"Entra en función","Step out from function":"Sal de la función","Stop on exception":"Deténgase en excepción",Su:Tj,"Subject:":"Sujeto:",Sunday:kj,"TS description":"Crear reglas escribiendo el mecanografiado",Telegram:Sj,"Text:":"Texto:",Th:Ej,"The script will be stopped and must be activated manually after debugging. Continue?":"El script se detendrá y deberá activarse manualmente después de la depuración. ¿Continuar?","This is advances option. You can write your own code here and it will be executed on trigger":"Esta es la opción de avances. Puede escribir su propio código aquí y se ejecutará en el disparador",Thursday:Ij,Time:xj,"Time condition":"Condición de tiempo","Title:":"Título:","To:":"A:","Trigger with value":"Activar con valor",Triggered:Dj,Triggers:Aj,"Triggers the on script saving or the javascript instance restart":"Activa el guardado de la secuencia de comandos o el reinicio de la instancia de JavaScript","Triggers the rule on update or change of some state":"Activa la regla de actualización o cambio de algún estado","Triggers the rule periodically or on some specific time":"Activa la regla periódicamente o en un momento específico",Tu:Rj,Tuesday:Oj,URL:Mj,"Unknown error":"Error desconocido","Unknown error!":"¡Error desconocido!","Use generated code":"Usar código generado","User function":"Función de usuario","User:":"Usuario:",Value:Nj,"Vibration:":"Vibración:",Volume:Lj,We:Pj,Wednesday:Bj,"Whatsapp-cmb":"Whatsapp-cmb",Write:jj,"Write your own code":"Escribe tu propio código",Yes:Fj,"Yet exists!":"¡Sin embargo existe!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Puede usar %s en la URL para usar el valor de activación actual, %id para usar el ID de objeto activado, %name para mostrar el nombre de ID de objeto activado o %old para usar el valor de activación antiguo","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Puede usar %s en el comando para usar el valor de activación actual, %id para usar el ID de objeto activado, %name para mostrar el nombre de ID de objeto activado o %old para usar el valor de activación anterior","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Puede usar %s en el texto para mostrar el valor de activación actual, %id para usar el ID de objeto activado, %name para mostrar el nombre de ID de objeto activado o %old para usar el valor de activación antiguo","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Puede usar %s en el valor para usar el valor de activación actual, %id para usar el ID de objeto activado, %name para mostrar el nombre de ID de objeto activado o %old para usar el valor de activación antiguo","You have to enter OpenAI API key in the configuration of javascript adapter.":"Debe ingresar la clave API de OpenAI en la configuración del adaptador de JavaScript.","You have to enter at least one API key in the configuration of javascript adapter.":"Debe ingresar al menos una clave API (OpenAI, Anthropic o Gemini) en la configuración del adaptador de JavaScript.","Please select a valid model":"Seleccione un modelo válido","[equal]":"[igual]","[greater or equal]":"[mayor o igual]","[greater]":"[mayor que]","[hysteresis]":"[histéresis]","[includes]":"[incluye]","[less or equal]":"[menor o igual]","[less]":"[menos]","[not equal]":"[no es igual]",acknowledgment:zj,all:Uj,and:Hj,astro:Wj,at:Gj,"clear running":"carrera clara",control:Vj,copy:Kj,cron:Yj,dawn:Jj,debug_help:qj,debug_label:Xj,default:"defecto",dusk:Zj,easy:Qj,else:"demás","equal to":"igual a",every:eF,"every hour at 0 minutes":"cada hora a los 0 minutos",false:"falso","file reading has failed: %s":"la lectura del archivo ha fallado: %s","file reading was aborted":"la lectura del archivo fue abortada",filter_func:tF,filter_id:sF,filter_name:oF,filter_role:iF,filter_room:nF,"for edit or create script":"para editar o crear un nuevo script","for professionals":"para profesionales","for programmers":"para programadores",goldenHour:rF,goldenHourEnd:aF,"greater or equal":"mayor o igual","greater or equal to":"mayor o igual a","greater than":"mas grande que",help_just_check:lF,help_on_change:cF,"high priority":"alta prioridad","high-priority":"alta prioridad","highest priority":"más alta prioridad",hours:uF,includes:dF,interval:hF,"just check":"Sólo revisa","less or equal":"menor o igual","less or equal to":"menor o igual a","less than":"menos que","lower priority":"prioridad más baja","lowest priority":"prioridad más baja",magic:pF,milliseconds:gF,minutes:mF,ms:fF,nadir:$F,nauticalDawn:bF,nauticalDusk:vF,nextSunrise:yF,nextSunset:_F,night:wF,nightEnd:CF,"no blocks found":"No se encontraron bloques","no group":"NO GRUPO",normal:TF,"normal priority":"prioridad normal","not equal to":"no igual a","not properly connected":"Este bloque no está conectado correctamente a otros bloques.",offset:kF,"on change":"en el cambio","on condition change":"con cambio de condición","on update":"en actualización",one:SF,or:EF,quiet:IF,"reset search":"restablecer la búsqueda",search:xF,seconds:DF,solarNoon:AF,"store in":"almacenar en",sunrise:RF,sunriseEnd:OF,sunset:MF,sunsetStart:NF,then:LF,"toggle value":"alternar valor",tooltip_ack:PF,tooltip_from:BF,tooltip_lc:jF,tooltip_quality:FF,tooltip_ts:zF,tooltip_user:UF,tooltip_value:HF,true:"cierto",two:WF,undefined:"indefinido",update:GF,"use seconds":"usar segundos","use trigger value":"usar valor de activación",verbose_help:VF,verbose_label:KF,when:YF,with:"con","with date":"con fecha","with offset":"con desplazamiento",wizard:JF,"Loading models...":"Cargando modelos...","Could not connect to API at %s":"No se pudo conectar a la API en %s","Invalid API key":"Clave API no válida","Access denied by API":"Acceso denegado por la API","API error: %s":"Error de API: %s",'Model "%s" not found':'Modelo "%s" no encontrado',"Request failed: %s":"Solicitud fallida: %s",Retry:qF,"No running javascript instance found":"No se encontró ninguna instancia de JavaScript en ejecución"},ZF="Reconnu",QF="Actions",e2="Ajouter",t2="Tout",s2="Tout",o2="Postuler",i2="avril",n2="Demander",r2="Astronomique",a2="août",l2="Annuler",c2="proche",u2="État",d2="Conditions",h2="Console",p2="Copié",g2="décembre",m2="Défaut",f2="Retard",$2="Effacer",b2="Description",v2="Terminé",y2="Exec shell",_2="Explication",w2="Exportation",C2="Février",T2="février",k2="Filtre",S2="Dossier",E2="Fr",I2="Vendredi",x2="ID",D2="ID1",A2="ID2",R2="Importation",O2="Exemple",M2="Instances",N2="Instructions",L2="Janvier",P2="janvier",B2="juillet",j2="juin",F2="Limite",z2="Mars",U2="Mai",H2="M e n u",W2="Message",G2="Mo",V2="Modèle",K2="Lundi",Y2="Mois",J2="Plus",q2="Nom",X2="novembre",Z2="OK",Q2="octobre",ez="D'accord",tz="Pause",sz="Pushover",oz="Pushsafer",iz="Renommer",nz="Répéter",rz="Redémarrer",az="Résultat",lz="Sa",cz="samedi",uz="sauver",dz="Horaire",hz="Scénario",pz="septembre",gz="Simuler",mz="Stack",fz="Début",$z="État",bz="Su",vz="dimanche",yz="Télégramme",_z="4",wz="Jeudi",Cz="Temps",Tz="Déclenché",kz="Déclencheurs",Sz="Tu",Ez="Mardi",Iz="URL",xz="Valeur",Dz="Le volume",Az="3",Rz="Mercredi",Oz="Écrivez",Mz="Oui",Nz="reconnaissance",Lz="tout",Pz="et",Bz="astro",jz="à",Fz="contrôler",zz="copie",Uz="CRON",Hz="Aube",Wz="Il s'agit d'un mode spécial dans lequel les états et les objets ne changeront pas. Mais seules les informations sur chaque changement prévu seront affichées dans le protocole.",Gz="Déboguer",Vz="Crépuscule",Kz="facile",Yz="chaque",Jz="Une fonction",qz="ID",Xz="Nom",Zz="Rôle",Qz="Pièce",eU="Heure d'or",tU="Fin de l'heure d'or",sU="Le code ne sera exécuté que chaque fois que la condition est vraie. Par exemple. si déclenchement sur la valeur du capteur de température et que la condition est «si la température est supérieure à 20 ° C», les actions «alors» seront exécutées à chaque fois que le capteur envoie la température et qu'elle est supérieure à 20 ° C. À 21 ° C, à 22 ° C et ainsi de suite.",oU="Le code ne sera exécuté que si le résultat de la condition change. Par exemple. si le déclenchement sur la valeur du capteur de température et que la condition est «si la température est supérieure à 20 ° C», les actions «alors» seront exécutées une fois lorsque la température est supérieure à 20. La prochaine fois, les actions «alors» seront exécutées lorsque la température échoue sous 20 puis remonte au-dessus de 20.",iU="les heures",nU="comprend",rU="intervalle",aU="la magie",lU="millisecondes",cU="minutes",uU="ms",dU="nadir",hU="Aube nautique",pU="Crépuscule nautique",gU="Prochain lever de soleil",mU="Prochain coucher de soleil",fU="Nuit",$U="Fin de nuit",bU="Ordinaire",vU="décalage",yU="une",_U="ou",wU="calmer",CU="chercher",TU="secondes",kU="Midi solaire",SU="lever du soleil",EU="Fin du lever du soleil",IU="le coucher du soleil",xU="Début du coucher du soleil",DU="alors",AU="Reconnaître",RU="De",OU="Dernière modification",MU="Qualité",NU="Horodatage",LU="Utilisateur",PU="Valeur",BU="deux",jU="mettre à jour",FU="Ajoute une sortie de débogage au journal pour de nombreuses commandes système",zU="Sorties de journal détaillées",UU="lorsque",HU="Wizard",WU="Réessayer",GU={"%s not found":"%s non trouvé","()":"()","(at %s)":"(à %s)","(optional)":"(optionnel)","-":"-",".":".","AI code generator":"Générateur de code IA",Ack:ZF,Actions:QF,"Actual time of day":"Heure réelle de la journée",Add:e2,"Add new script":"Ajouter un nouveau script",All:t2,"All files will be accepted":"Tous les fichiers seront acceptés",Any:s2,"Any month":"N'importe quel mois",Apply:o2,April:i2,"Are you sure?":"Êtes-vous sûr?",Ask:n2,Astronomical:r2,"Astronomical events today":"Événements astronomiques aujourd'hui",August:a2,"Blockly description":"Création de règles par blocs graphiques","Body:":"Corps:",Cancel:l2,"Cannot delete non empty item!":"Impossible de supprimer un élément non vide!","Change layout":"Changer la disposition",'Change theme (actual "%s")':'Changer de thème (maintenant - "%s")',"Check blocks":"Vérifier les blocs","Check is not active, because javascript adapter is disabled":"La vérification n'est pas active, car l'adaptateur Javascript est désactivé","Clear search input":"Effacer la recherche","Click on this icon":"Cliquez sur cette icône",Close:c2,"Close all but current":"Ferme tout sauf courant","Collapse all":"Réduire tout","Compares current time with astronomical event":"Compare l'heure actuelle avec un événement astronomique","Compares current time with the user specific time":"Compare l'heure actuelle avec l'heure spécifique de l'utilisateur","Compares the state value with user defined value":"Compare la valeur d'état avec la valeur définie par l'utilisateur",Condition:u2,Conditions:d2,"Configuration not saved.":"Configuration non enregistrée.",Console:h2,"Control or update some state":"Contrôler ou mettre à jour un état","Control or update some state with delay":"Contrôler ou mettre à jour un état avec un délai","Convert blockly to javascript for ever.":"Convertissez instantanément en Javascript.",Copied:p2,"Copy script":"Copier le script","Copy to clipboard":"Copier dans le presse-papier","Create new":"Créer un nouveau","Create new folder":"Créer un nouveau dossier","Create new script":"Créer un nouveau script","Create or edit CRON or time wizard":"Créer ou éditer CRON ou un assistant de temps","Dark Theme":"Thème sombre","Dark style":"Style sombre",Date:"Date","Debug instance":"Instance de débogage","Debug options":"Options de débogage",December:g2,Default:m2,"Define cron...":"Définir le cron ...","Define schedule...":"Définir le calendrier ...",Delay:f2,Delete:$2,"Delete %s":"Supprimer %s ...","Delete folder":"Supprimer le dossier","Delete script":"Supprimer le script",Description:b2,"Deselect all":"Tout déselectionner","Discard changes for %s":"Ignorer les modifications pour %s",Done:v2,"Double click to write value":"Double clic pour écrire la valeur","Download as file":"Télécharger le fichier","Drop some files here or click...":"Déposer des fichiers ici ou cliquez sur ...","Duplicate name":"Nom en double","Edit script or just double click":"Modifiez le script ou double-cliquez simplement sur","Empty name is not allowed":"Le nom vide n'est pas autorisé","End search mode":"Fin du mode de recherche","Enter your question":"Entrez votre demande",Error:"Erreur","Error formatting code":"Erreur lors du formatage du code","Error was found":"Une erreur a été trouvée","Every day":"Tous les jours",Exec:y2,"Executes some shell command":"Exécute une commande shell","Existing scripts will be overwritten.":"Les scripts existants seront écrasés.","Expand all":"Développer tout","Expert mode":"Mode expert",Explanation:_2,Export:w2,"Export all scripts":"Exporter tous les scripts","Export blocks":"Blocs d'exportation","Export selected blocks":"Exporter les blocs sélectionnés",Februar:C2,February:T2,Filter:k2,Folder:S2,Fr:E2,Friday:I2,Function:"Fonction","Function editor":"Éditeur de fonction","Function: executed":"Fonction : exécutée","Go to next line":"Aller à la ligne suivante","HTTP Call":"Appel HTTP","Hide logs":"Masquer les journaux",ID:x2,ID1:D2,ID2:A2,Import:R2,"Import blocks":"Blocs d'importation","Import error":"Erreur d'importation","Import scripts":"Importer des scripts","Insert object ID":"Insérer un identifiant d'objet",Instance:O2,"Instance is disabled":"L'instance est désactivée","Instance:":"Exemple:",Instances:M2,Instructions:N2,"Invalid CRON":"CRON invalide","It will not be possible to revert this operation.":"Il ne sera pas possible de revenir sur cette opération.","JS description":"Créer des règles en écrivant du Javascript",Januar:L2,January:P2,July:B2,June:j2,"Just check":"Vérifiez simplement","Language:":"Langue:","Learn More":"Apprendre encore plus","Light style":"Style de lumière",Limit:F2,"Local time":"Heure locale","Locate file":"Localiser le fichier","Log outputs":"Journal des sorties","Log text":"Texte du journal","Log: %s":"Log : %s","Make a HTTP get request":"Faire une requête HTTP Get","Make a pause between actions":"Faites une pause entre les actions",March:z2,"March ":"mars",May:U2,Menu:H2,Message:W2,Mo:G2,Model:V2,Monday:K2,Month:Y2,More:J2,Name:q2,"No API key found":"Aucune clé API trouvée","No Chat GPT Key found":"Aucune clé GPT de chat trouvée","No active host found":"Aucun hôte actif trouvé","Nothing found":"Rien n'a été trouvé",November:X2,OK:Z2,October:Q2,Ok:ez,"On condition change":"En cas de changement de condition","On script save or adapter start":"Lors de l'enregistrement du script ou du démarrage de l'adaptateur","On weekdays":"En semaine","Open configuration":"Configuration ouverte","Operate two states":"Opérer deux états","Operations with two states":"Opérations à deux états","Paste your blocks here":"Collez vos blocs ici",Pause:tz,"Pause execution":"Suspendre l'exécution","Pause script":"Script de pause","Phone:":"Téléphone:","Please select object ID...":"Veuillez sélectionner l'ID d'objet ...","Press Ctrl+Enter to get the answer":"Appuyez sur Ctrl+Entrée pour obtenir la réponse","Prettify the script":"Embellir le scénario","Print some text in log":"Imprimer du texte dans le journal","Priority:":"Priorité:",Pushover:sz,Pushsafer:oz,"Read only ID selected: %s":"ID en lecture seule sélectionné: %s",Rename:iz,"Reorder scripts in folders":"Réorganiser les scripts dans des dossiers",Repeat:nz,Restart:rz,Result:az,"Resume execution":"Reprendre l'exécution","Root folder":"Dossier racine","Rules description":"Créer des règles avec des blocs IF, THEN, ELSE","Run script":"Script de lancement",Sa:lz,Saturday:cz,Save:uz,"Save all":"Sauver tous","Say It":"Say It","Say some text via sayit adapter":"Dites du texte via l'adaptateur sayit",Schedule:dz,Script:hz,"Script %s was modified on disk":"Le script %s a été modifié sur le disque","Script is not running":"Le script n'est pas en cours d'exécution","Search in scripts":"Rechercher dans les scripts","Search...":"Chercher...","Select all":"Tout sélectionner","Send email":"Envoyer un e-mail","Sends an email":"Envoie un e-mail","Sends message via Pushsafer":"Envoie un message via Pushsafer","Sends message via pushover":"Envoie un message via pushover","Sends message via telegram":"Envoie un message par télégramme","Sends message via whatsapp-cmb":"Envoie un message via whatsapp-cmb",September:pz,"Server time":"Heure du serveur","Set state action":"Définir l'action de l'état","Set with delay":"Set avec retard","Shell command":"Commande Shell","Show astronomical events":"Afficher les événements astronomiques","Show javascript code":"Afficher le code Javascript","Show logs":"Afficher les journaux","Show only paused scripts":"Afficher uniquement les scripts en pause","Show only running scripts":"Afficher uniquement les scripts en cours d'exécution","Show only scripts with problems":"Afficher uniquement les scripts avec des problèmes",Simulate:gz,"Some files will be rejected":"Certains fichiers seront rejetés","Sound:":"Sonner:",Stack:mz,Start:fz,"Start script":"Lancer le script",State:$z,"State condition":"État condition","Step into function":"Entrez dans la fonction","Step out from function":"Sortez de la fonction","Stop on exception":"Arrêt sur exception",Su:bz,"Subject:":"Sujet:",Sunday:vz,"TS description":"Créer des règles en écrivant des caractères dactylographiés",Telegram:yz,"Text:":"Texte:",Th:_z,"The script will be stopped and must be activated manually after debugging. Continue?":"Le script sera arrêté et doit être activé manuellement après le débogage. Continuez?","This is advances option. You can write your own code here and it will be executed on trigger":"C'est une option avancée. Vous pouvez écrire votre propre code ici et il sera exécuté au déclenchement",Thursday:wz,Time:Cz,"Time condition":"Condition de temps","Title:":"Titre:","To:":"À:","Trigger with value":"Déclencheur avec valeur",Triggered:Tz,Triggers:kz,"Triggers the on script saving or the javascript instance restart":"Déclenche l'enregistrement du script ou le redémarrage de l'instance javascript","Triggers the rule on update or change of some state":"Déclenche la règle sur la mise à jour ou le changement d'un état","Triggers the rule periodically or on some specific time":"Déclenche la règle périodiquement ou à une heure précise",Tu:Sz,Tuesday:Ez,URL:Iz,"Unknown error":"Erreur inconnue","Unknown error!":"Erreur inconnue!","Use generated code":"Utiliser le code généré","User function":"Fonction utilisateur","User:":"Utilisateur:",Value:xz,"Vibration:":"Vibration:",Volume:Dz,We:Az,Wednesday:Rz,"Whatsapp-cmb":"Whatsapp-cmb",Write:Oz,"Write your own code":"Écrivez votre propre code",Yes:Mz,"Yet exists!":"Pourtant existe!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Vous pouvez utiliser %s dans l'URL pour utiliser la valeur de déclenchement actuelle, %id pour utiliser l'ID de l'objet déclenché, %name pour afficher le nom de l'ID de l'objet déclenché ou %old pour utiliser l'ancienne valeur de déclenchement","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Vous pouvez utiliser %s dans la commande pour utiliser la valeur de déclenchement actuelle, %id pour utiliser l'ID de l'objet déclenché, %name pour afficher le nom de l'ID de l'objet déclenché ou %old pour utiliser l'ancienne valeur de déclenchement","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Vous pouvez utiliser %s dans le texte pour afficher la valeur de déclenchement actuelle, %id pour utiliser l'ID de l'objet déclenché, %name pour afficher le nom de l'ID de l'objet déclenché ou %old pour utiliser l'ancienne valeur de déclenchement","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Vous pouvez utiliser %s dans la valeur pour utiliser la valeur de déclenchement actuelle, %id pour utiliser l'ID de l'objet déclenché, %name pour afficher le nom de l'ID de l'objet déclenché ou %old pour utiliser l'ancienne valeur de déclenchement","You have to enter OpenAI API key in the configuration of javascript adapter.":"Vous devez entrer la clé API OpenAI dans la configuration de l'adaptateur javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Vous devez entrer au moins une clé API (OpenAI, Anthropic ou Gemini) dans la configuration de l'adaptateur javascript.","Please select a valid model":"Veuillez sélectionner un modèle valide","[equal]":"[égal]","[greater or equal]":"[supérieur ou égal]","[greater]":"[plus grand]","[hysteresis]":"[hystérèse]","[includes]":"[comprend]","[less or equal]":"[inférieur ou égal]","[less]":"[moins]","[not equal]":"[inégal]",acknowledgment:Nz,all:Lz,and:Pz,astro:Bz,at:jz,"clear running":"course claire",control:Fz,copy:zz,cron:Uz,dawn:Hz,debug_help:Wz,debug_label:Gz,default:"défaut",dusk:Vz,easy:Kz,else:"autre","equal to":"égal à",every:Yz,"every hour at 0 minutes":"toutes les heures à 0 minute",false:"faux","file reading has failed: %s":"La lecture du fichier a échoué: %s","file reading was aborted":"la lecture du fichier a été abandonnée",filter_func:Jz,filter_id:qz,filter_name:Xz,filter_role:Zz,filter_room:Qz,"for edit or create script":"pour éditer ou créer un nouveau script","for professionals":"pour les professionnels","for programmers":"pour les programmeurs",goldenHour:eU,goldenHourEnd:tU,"greater or equal":"supérieur ou égal","greater or equal to":"supérieur ou égal à","greater than":"plus grand que",help_just_check:sU,help_on_change:oU,"high priority":"haute priorité","high-priority":"haute priorité","highest priority":"priorité la plus élevée",hours:iU,includes:nU,interval:rU,"just check":"Vérifiez simplement","less or equal":"inférieur ou égal","less or equal to":"inférieur ou égal à","less than":"moins que","lower priority":"priorité inférieure","lowest priority":"priorité la plus basse",magic:aU,milliseconds:lU,minutes:cU,ms:uU,nadir:dU,nauticalDawn:hU,nauticalDusk:pU,nextSunrise:gU,nextSunset:mU,night:fU,nightEnd:$U,"no blocks found":"Aucun bloc trouvé","no group":"PAS DE GROUPE",normal:bU,"normal priority":"priorité normale","not equal to":"pas égal à","not properly connected":"Ce bloc n'est pas correctement connecté à d'autres blocs.",offset:vU,"on change":"sur le changement","on condition change":"sur changement de condition","on update":"sur mise à jour",one:yU,or:_U,quiet:wU,"reset search":"Réinitialiser la recherche",search:CU,seconds:TU,solarNoon:kU,"store in":"stocker dans",sunrise:SU,sunriseEnd:EU,sunset:IU,sunsetStart:xU,then:DU,"toggle value":"valeur de bascule",tooltip_ack:AU,tooltip_from:RU,tooltip_lc:OU,tooltip_quality:MU,tooltip_ts:NU,tooltip_user:LU,tooltip_value:PU,true:"vrai",two:BU,undefined:"indéfini",update:jU,"use seconds":"utiliser les secondes","use trigger value":"use trigger value",verbose_help:FU,verbose_label:zU,when:UU,with:"avec","with date":"avec date","with offset":"avec offset",wizard:HU,"Loading models...":"Chargement des modèles...","Could not connect to API at %s":"Impossible de se connecter à l'API sur %s","Invalid API key":"Clé API invalide","Access denied by API":"Accès refusé par l'API","API error: %s":"Erreur API : %s",'Model "%s" not found':'Modèle "%s" introuvable',"Request failed: %s":"Requête échouée : %s",Retry:WU,"No running javascript instance found":"Aucune instance JavaScript en cours d'exécution trouvée"},VU="Riconosciuto",KU="Azioni",YU="Inserisci",JU="Tutti",qU="Qualunque",XU="Applica",ZU="aprile",QU="Chiedere",eH="Astronomico",tH="agosto",sH="Annulla",oH="Vicino",iH="Condizione",nH="Condizioni",rH="Console",aH="Copiato",lH="dicembre",cH="Predefinito",uH="Ritardo",dH="Elimina",hH="Descrizione",pH="Fatto",gH="Execshell",mH="Spiegazione",fH="Esportare",$H="Februar",bH="febbraio",vH="Filtro",yH="Cartella",_H="P",wH="Venerdì",CH="ID",TH="ID1",kH="ID2",SH="Importare",EH="Esempio",IH="istanze",xH="Istruzioni",DH="Januar",AH="gennaio",RH="luglio",OH="giugno",MH="Limite",NH="marzo",LH="Maggio",PH="Menu",BH="Messaggio",jH="Mo",FH="Modello",zH="Lunedi",UH="Mese",HH="Di più",WH="Nome",GH="novembre",VH="OK",KH="ottobre",YH="Ok",JH="Pausa",qH="Pushover",XH="Pushsafer",ZH="Rinominare",QH="Ripetere",eW="Ricomincia",tW="Risultato",sW="Sa",oW="Sabato",iW="Salva",nW="Programma",rW="copione",aW="settembre",lW="Simulare",cW="Stack",uW="Cominciare",dW="Stato",hW="Su",pW="Domenica",gW="Telegramma",mW="4",fW="giovedi",$W="Tempo",bW="Innescato",vW="Trigger",yW="Tu",_W="martedì",wW="URL",CW="Valore",TW="Volume",kW="3",SW="mercoledì",EW="Scrivi",IW="sì",xW="riconoscimento",DW="tutti",AW="e",RW="astro",OW="a",MW="controllo",NW="copia",LW="CRON",PW="alba",BW="Questa è una modalità speciale in cui gli stati e gli oggetti non cambieranno. Ma nel protocollo verranno visualizzate solo le informazioni su ogni modifica pianificata.",jW="Debug",FW="crepuscolo",zW="facile",UW="ogni",HW="Funzione",WW="ID",GW="Nome",VW="Ruolo",KW="Camera",YW="Ora d'oro",JW="Fine dell'ora d'oro",qW='Il codice verrà eseguito solo ogni volta che la condizione è vera. Per esempio. se si attiva il valore del sensore di temperatura e la condizione è "se la temperatura è maggiore di 20 ° C", le azioni "allora" verranno eseguite ogni volta che il sensore invia la temperatura e questa è superiore a 20 ° C. Di 21 ° C, di 22 ° C e così via.',XW='Il codice verrà eseguito solo se il risultato della condizione cambia. Per esempio. se si attiva il valore del sensore di temperatura e la condizione è "se la temperatura è maggiore di 20 ° C", le azioni "allora" verranno eseguite una volta quando la temperatura è superiore a 20. La prossima volta le azioni "allora" verranno eseguite quando la temperatura fallisce sotto 20 e poi sale di nuovo oltre 20.',ZW="ore",QW="include",eG="intervallo",tG="Magia",sG="millisecondi",oG="minuti",iG="ms",nG="nadir",rG="Alba nautica",aG="Crepuscolo nautico",lG="Prossima alba",cG="Prossimo tramonto",uG="Notte",dG="Fine della notte",hG="normale",pG="compensare",gG="uno",mG="o",fG="silenzioso",$G="ricerca",bG="secondi",vG="Mezzogiorno solare",yG="Alba",_G="Fine dell'alba",wG="tramonto",CG="Inizio del tramonto",TG="poi",kG="Riconoscere",SG="A partire dal",EG="Ultima modifica",IG="Qualità",xG="timestamp",DG="Utente",AG="Valore",RG="Due",OG="aggiornare",MG="Aggiunge l'output di debug al registro per molti comandi di sistema",NG="Output di log dettagliati",LG="quando",PG="procedura guidata",BG="Riprova",jG={"%s not found":"%s non trovato","()":"()","(at %s)":"(a %s)","(optional)":"(opzionale)","-":"-",".":".","AI code generator":"Generatore di codice AI",Ack:VU,Actions:KU,"Actual time of day":"Ora effettiva della giornata",Add:YU,"Add new script":"Aggiungi nuovo script",All:JU,"All files will be accepted":"Tutti i file saranno accettati",Any:qU,"Any month":"Ogni mese",Apply:XU,April:ZU,"Are you sure?":"Sei sicuro?",Ask:QU,Astronomical:eH,"Astronomical events today":"Eventi astronomici oggi",August:tH,"Blockly description":"Creazione di regole tramite blocchi grafici","Body:":"Corpo:",Cancel:sH,"Cannot delete non empty item!":"Impossibile eliminare l'elemento non vuoto!","Change layout":"Cambia layout",'Change theme (actual "%s")':'Cambia tema (ora - "%s")',"Check blocks":"Controlla i blocchi","Check is not active, because javascript adapter is disabled":"Il controllo non è attivo perché l'adattatore Javascript è disabilitato","Clear search input":"Cancella input di ricerca","Click on this icon":"Clicca su questa icona",Close:oH,"Close all but current":"Chiudi tutto tranne corrente","Collapse all":"Comprimi tutto","Compares current time with astronomical event":"Confronta l'ora corrente con l'evento astronomico","Compares current time with the user specific time":"Confronta l'ora corrente con l'ora specifica dell'utente","Compares the state value with user defined value":"Confronta il valore dello stato con il valore definito dall'utente",Condition:iH,Conditions:nH,"Configuration not saved.":"Configurazione non salvata.",Console:rH,"Control or update some state":"Controlla o aggiorna uno stato","Control or update some state with delay":"Controlla o aggiorna uno stato con ritardo","Convert blockly to javascript for ever.":"Converti istantaneamente a blocchi in Javascript.",Copied:aH,"Copy script":"Copia script","Copy to clipboard":"Copia negli appunti","Create new":"Creare nuovo","Create new folder":"Crea una nuova cartella","Create new script":"Crea nuovo script","Create or edit CRON or time wizard":"Crea o modifica la procedura guidata CRON o time","Dark Theme":"Tema scuro","Dark style":"Stile scuro",Date:"Data","Debug instance":"Istanza di debug","Debug options":"Opzioni di debug",December:lH,Default:cH,"Define cron...":"Definisci cron ...","Define schedule...":"Definisci programma ...",Delay:uH,Delete:dH,"Delete %s":"Elimina %s ...","Delete folder":"Elimina cartella","Delete script":"Elimina script",Description:hH,"Deselect all":"Deselezionare tutto","Discard changes for %s":"Annulla modifiche per %s",Done:pH,"Double click to write value":"Doppio clic per scrivere il valore","Download as file":"Scarica come file","Drop some files here or click...":"Trascina alcuni file qui o fai clic su ...","Duplicate name":"Nome duplicato","Edit script or just double click":"Modifica lo script o fai doppio clic","Empty name is not allowed":"Il nome vuoto non è consentito","End search mode":"Termina la modalità di ricerca","Enter your question":"Inserisci la tua richiesta",Error:"Errore","Error formatting code":"Errore di formattazione del codice","Error was found":"Errore trovato","Every day":"Ogni giorno",Exec:gH,"Executes some shell command":"Esegue alcuni comandi della shell","Existing scripts will be overwritten.":"Gli script esistenti verranno sovrascritti.","Expand all":"Espandi tutto","Expert mode":"Modalità esperto",Explanation:mH,Export:fH,"Export all scripts":"Esporta tutti gli script","Export blocks":"Esporta blocchi","Export selected blocks":"Esporta i blocchi selezionati",Februar:$H,February:bH,Filter:vH,Folder:yH,Fr:_H,Friday:wH,Function:"Funzione","Function editor":"Editor di funzioni","Function: executed":"Funzione: eseguita","Go to next line":"Vai alla riga successiva","HTTP Call":"Chiamata HTTP","Hide logs":"Nascondi i registri",ID:CH,ID1:TH,ID2:kH,Import:SH,"Import blocks":"Importa blocchi","Import error":"Errore di importazione","Import scripts":"Importa script","Insert object ID":"Inserisci l'ID oggetto",Instance:EH,"Instance is disabled":"L'istanza è disabilitata","Instance:":"Esempio:",Instances:IH,Instructions:xH,"Invalid CRON":"CRON non valido","It will not be possible to revert this operation.":"Non sarà possibile ripristinare questa operazione.","JS description":"Creare regole scrivendo Javascript",Januar:DH,January:AH,July:RH,June:OH,"Just check":"Controlla solamente","Language:":"Linguaggio:","Learn More":"Per saperne di più","Light style":"Stile leggero",Limit:MH,"Local time":"Ora locale","Locate file":"Localizza file","Log outputs":"Registra le uscite","Log text":"Testo del registro","Log: %s":"Log: %s","Make a HTTP get request":"Effettua una richiesta get HTTP","Make a pause between actions":"Fai una pausa tra le azioni",March:NH,"March ":"marzo",May:LH,Menu:PH,Message:BH,Mo:jH,Model:FH,Monday:zH,Month:UH,More:HH,Name:WH,"No API key found":"Nessuna chiave API trovata","No Chat GPT Key found":"Nessuna chiave GPT chat trovata","No active host found":"Nessun host attivo trovato","Nothing found":"Non abbiamo trovato nulla",November:GH,OK:VH,October:KH,Ok:YH,"On condition change":"A condizione che cambino","On script save or adapter start":"Al salvataggio dello script o all'avvio dell'adattatore","On weekdays":"Nei giorni della settimana","Open configuration":"Configurazione aperta","Operate two states":"Gestisci due stati","Operations with two states":"Operazioni con due stati","Paste your blocks here":"Incolla qui i tuoi blocchi",Pause:JH,"Pause execution":"Metti in pausa l'esecuzione","Pause script":"Metti in pausa lo script","Phone:":"Telefono:","Please select object ID...":"Seleziona l'ID oggetto ...","Press Ctrl+Enter to get the answer":"Premi Ctrl+Invio per ottenere la risposta","Prettify the script":"Abbellire la sceneggiatura","Print some text in log":"Stampa del testo nel registro","Priority:":"Priorità:",Pushover:qH,Pushsafer:XH,"Read only ID selected: %s":"ID di sola lettura selezionato: %s",Rename:ZH,"Reorder scripts in folders":"Riordina gli script nelle cartelle",Repeat:QH,Restart:eW,Result:tW,"Resume execution":"Riprendi esecuzione","Root folder":"Cartella root","Rules description":"Crea regole con i blocchi IF, THEN, ELSE","Run script":"Esegui script",Sa:sW,Saturday:oW,Save:iW,"Save all":"Salva tutto","Say It":"Say It","Say some text via sayit adapter":"Pronuncia del testo tramite l'adattatore sayit",Schedule:nW,Script:rW,"Script %s was modified on disk":"Lo script %s è stato modificato sul disco","Script is not running":"Lo script non è in esecuzione","Search in scripts":"Cerca negli script","Search...":"Ricerca...","Select all":"Seleziona tutto","Send email":"Invia una email","Sends an email":"Invia un'e-mail","Sends message via Pushsafer":"Invia messaggio tramite Pushsafer","Sends message via pushover":"Invia messaggio tramite pushover","Sends message via telegram":"Invia messaggio tramite telegramma","Sends message via whatsapp-cmb":"Invia messaggio tramite whatsapp-cmb",September:aW,"Server time":"Ora del server","Set state action":"Imposta l'azione dello stato","Set with delay":"Impostato con ritardo","Shell command":"Comando Shell","Show astronomical events":"Mostra eventi astronomici","Show javascript code":"Mostra codice Javascript","Show logs":"Mostra i log","Show only paused scripts":"Mostra solo script in pausa","Show only running scripts":"Mostra solo gli script in esecuzione","Show only scripts with problems":"Mostra solo script con problemi",Simulate:lW,"Some files will be rejected":"Alcuni file verranno rifiutati","Sound:":"Suono:",Stack:cW,Start:uW,"Start script":"Avvia script",State:dW,"State condition":"Condizione dello stato","Step into function":"Entra in funzione","Step out from function":"Esci dalla funzione","Stop on exception":"Ferma in caso di eccezione",Su:hW,"Subject:":"Soggetto:",Sunday:pW,"TS description":"Creare regole scrivendo dattiloscritto",Telegram:gW,"Text:":"Testo:",Th:mW,"The script will be stopped and must be activated manually after debugging. Continue?":"Lo script verrà interrotto e dovrà essere attivato manualmente dopo il debug. Continua?","This is advances option. You can write your own code here and it will be executed on trigger":"Questa è un'opzione anticipata. Puoi scrivere il tuo codice qui e verrà eseguito al trigger",Thursday:fW,Time:$W,"Time condition":"Condizione temporale","Title:":"Titolo:","To:":"Per:","Trigger with value":"Trigger con valore",Triggered:bW,Triggers:vW,"Triggers the on script saving or the javascript instance restart":"Attiva il salvataggio dello script o il riavvio dell'istanza javascript","Triggers the rule on update or change of some state":"Attiva la regola in caso di aggiornamento o modifica di uno stato","Triggers the rule periodically or on some specific time":"Attiva la regola periodicamente o in un momento specifico",Tu:yW,Tuesday:_W,URL:wW,"Unknown error":"Errore sconosciuto","Unknown error!":"Errore sconosciuto!","Use generated code":"Usa il codice generato","User function":"Funzione utente","User:":"Utente:",Value:CW,"Vibration:":"Vibrazione:",Volume:TW,We:kW,Wednesday:SW,"Whatsapp-cmb":"Whatsapp-cmb",Write:EW,"Write your own code":"Scrivi il tuo codice",Yes:IW,"Yet exists!":"Esiste ancora!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"È possibile utilizzare %s nell'URL per utilizzare il valore di trigger corrente, %id per utilizzare l'ID dell'oggetto attivato, %name per mostrare il nome dell'ID dell'oggetto attivato o %old per utilizzare il vecchio valore di trigger","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"È possibile utilizzare %s nel comando per utilizzare il valore di trigger corrente, %id per utilizzare l'ID dell'oggetto attivato, %name per mostrare il nome dell'ID dell'oggetto attivato o %old per utilizzare il vecchio valore di trigger","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"È possibile utilizzare %s nel testo per visualizzare il valore di trigger corrente, %id per utilizzare l'ID dell'oggetto attivato, %name per mostrare il nome dell'ID dell'oggetto attivato o %old per utilizzare il vecchio valore di trigger","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"È possibile utilizzare %s nel valore per utilizzare il valore di trigger corrente, %id per utilizzare l'ID dell'oggetto attivato, %name per mostrare il nome dell'ID dell'oggetto attivato o %old per utilizzare il vecchio valore di trigger","You have to enter OpenAI API key in the configuration of javascript adapter.":"Devi inserire la chiave API OpenAI nella configurazione dell'adattatore javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Devi inserire almeno una chiave API (OpenAI, Anthropic o Gemini) nella configurazione dell'adattatore javascript.","Please select a valid model":"Seleziona un modello valido","[equal]":"[pari]","[greater or equal]":"[maggiore o uguale]","[greater]":"[maggiore]","[hysteresis]":"[isteresi]","[includes]":"[include]","[less or equal]":"[minore o uguale]","[less]":"[Di meno]","[not equal]":"[non uguale]",acknowledgment:xW,all:DW,and:AW,astro:RW,at:OW,"clear running":"chiara esecuzione",control:MW,copy:NW,cron:LW,dawn:PW,debug_help:BW,debug_label:jW,default:"predefinito",dusk:FW,easy:zW,else:"altro","equal to":"uguale a",every:UW,"every hour at 0 minutes":"ogni ora a 0 minuti",false:"falso","file reading has failed: %s":"lettura file non riuscita: %s","file reading was aborted":"la lettura del file è stata interrotta",filter_func:HW,filter_id:WW,filter_name:GW,filter_role:VW,filter_room:KW,"for edit or create script":"per modificare o creare un nuovo script","for professionals":"per i professionisti","for programmers":"per i programmatori",goldenHour:YW,goldenHourEnd:JW,"greater or equal":"maggiore o uguale","greater or equal to":"maggiore o uguale a","greater than":"più grande di",help_just_check:qW,help_on_change:XW,"high priority":"priorità alta","high-priority":"priorità alta","highest priority":"massima priorità",hours:ZW,includes:QW,interval:eG,"just check":"controlla solamente","less or equal":"inferiore o uguale","less or equal to":"minore o uguale a","less than":"meno di","lower priority":"priorità inferiore","lowest priority":"priorità più bassa",magic:tG,milliseconds:sG,minutes:oG,ms:iG,nadir:nG,nauticalDawn:rG,nauticalDusk:aG,nextSunrise:lG,nextSunset:cG,night:uG,nightEnd:dG,"no blocks found":"Nessun blocco trovato","no group":"NESSUN GRUPPO",normal:hG,"normal priority":"priorità normale","not equal to":"non uguale a","not properly connected":"Questo blocco non è correttamente collegato ad altri blocchi.",offset:pG,"on change":"sul cambiamento","on condition change":"a cambio di condizione","on update":"in aggiornamento",one:gG,or:mG,quiet:fG,"reset search":"resetta la ricerca",search:$G,seconds:bG,solarNoon:vG,"store in":"conservare in",sunrise:yG,sunriseEnd:_G,sunset:wG,sunsetStart:CG,then:TG,"toggle value":"alterna valore",tooltip_ack:kG,tooltip_from:SG,tooltip_lc:EG,tooltip_quality:IG,tooltip_ts:xG,tooltip_user:DG,tooltip_value:AG,true:"vero",two:RG,undefined:"non definito",update:OG,"use seconds":"usa i secondi","use trigger value":"usa il trigger",verbose_help:MG,verbose_label:NG,when:LG,with:"con","with date":"con data","with offset":"con offset",wizard:PG,"Loading models...":"Caricamento modelli...","Could not connect to API at %s":"Impossibile connettersi all'API su %s","Invalid API key":"Chiave API non valida","Access denied by API":"Accesso negato dall'API","API error: %s":"Errore API: %s",'Model "%s" not found':'Modello "%s" non trovato',"Request failed: %s":"Richiesta fallita: %s",Retry:BG,"No running javascript instance found":"Nessuna istanza JavaScript in esecuzione trovata"},FG="Erkend",zG="Acties",UG="Toevoegen",HG="Alle",WG="Ieder",GG="Solliciteer",VG="april",KG="Vragen",YG="Astronomisch",JG="augustus",qG="annuleren",XG="Dichtbij",ZG="Staat",QG="Voorwaarden",eV="Troosten",tV="Gekopieerd",sV="december",oV="Standaard",iV="Vertraging",nV="Verwijder",rV="Beschrijving",aV="Gedaan",lV="Exec shell",cV="Uitleg",uV="Exporteren",dV="Februari",hV="februari",pV="Filter",gV="Map",mV="Vr",fV="vrijdag",$V="ID kaart",bV="ID1",vV="ID2",yV="Importeren",_V="Voorbeeld",wV="Instanties",CV="Instructies",TV="Januar",kV="januari",SV="juli",EV="juni",IV="Begrenzing",xV="maart",DV="mei",AV="Menu",RV="Bericht",OV="Ma",MV="Model",NV="maandag",LV="Maand",PV="Meer",BV="Naam",jV="november",FV="OK",zV="oktober",UV="OK",HV="Pauze",WV="Pushover",GV="Duwijzer",VV="andere naam geven",KV="Herhaling",YV="Herstarten",JV="Resultaat",qV="Za",XV="zaterdag",ZV="Opslaan",QV="Schema",e5="Script",t5="september",s5="Simuleren",o5="Stack",i5="Begin",n5="Staat",r5="Zo",a5="zondag",l5="Telegram",c5="4",u5="donderdag",d5="Tijd",h5="Veroorzaakt",p5="Triggers",g5="Di",m5="dinsdag",f5="URL",$5="Waarde",b5="Volume",v5="3",y5="woensdag",_5="Schrijven",w5="Ja",C5="erkenning",T5="alle",k5="en",S5="astro",E5="Bij",I5="controle",x5="kopiëren",D5="cron",A5="dageraad",R5="Dit is een speciale modus waarin toestanden en objecten niet veranderen. Maar alleen informatie over elke geplande wijziging wordt in het protocol weergegeven.",O5="Debuggen",M5="schemer",N5="eenvoudig",L5="elke",P5="Functie",B5="ID kaart",j5="Naam",F5="Rol",z5="Kamer",U5="gouden uur",H5="Einde van gouden uur",W5='De code wordt alleen uitgevoerd als de voorwaarde waar is. Bijv. als het triggeren op de temperatuursensorwaarde en de conditie is "als de temperatuur hoger is dan 20 ° C", zullen de "dan" acties worden uitgevoerd elke keer dat de sensor de temperatuur verzendt en deze hoger is dan 20 ° C. Bij 21 ° C, bij 22 ° C enzovoort.',G5='De code wordt alleen uitgevoerd als het conditieresultaat verandert. Bijv. als de temperatuursensor wordt geactiveerd en de conditie is "als de temperatuur hoger is dan 20 ° C", worden de "dan" -acties eenmaal uitgevoerd wanneer de temperatuur hoger is dan 20. De volgende keer worden de "dan" -acties uitgevoerd wanneer de temperatuur faalt onder de 20 en stijgt dan weer boven de 20.',V5="uren",K5="omvat",Y5="interval",J5="magie",q5="milliseconden",X5="minuten",Z5="ms",Q5="nadir",e3="Nautische dageraad",t3="Nautische schemering",s3="Volgende zonsopgang",o3="Volgende zonsondergang",i3="nacht",n3="Einde van de nacht",r3="normaal",a3="compensatie",l3="een",c3="of",u3="stil",d3="zoeken",h3="seconden",p3="Zonne-middag",g3="zonsopkomst",m3="Einde zonsopgang",f3="zonsondergang",$3="Begin van de zonsondergang",b3="vervolgens",v3="Erkennen",y3="Van",_3="Laatst gewijzigd",w3="Kwaliteit",C3="tijdstempel",T3="Gebruiker",k3="Waarde",S3="twee",E3="bijwerken",I3="Voegt foutopsporingsuitvoer toe aan het logboek voor veel systeemopdrachten",x3="Uitgebreide log-uitgangen",D3="wanneer",A3="tovenaar",R3="Opnieuw proberen",O3={"%s not found":"%s niet gevonden","()":"()","(at %s)":"(op %s)","(optional)":"(optioneel)","-":"-",".":".","AI code generator":"AI-codegenerator",Ack:FG,Actions:zG,"Actual time of day":"Werkelijke tijd van de dag",Add:UG,"Add new script":"Nieuw script toevoegen",All:HG,"All files will be accepted":"Alle bestanden worden geaccepteerd",Any:WG,"Any month":"Elke maand",Apply:GG,April:VG,"Are you sure?":"Weet je zeker dat?",Ask:KG,Astronomical:YG,"Astronomical events today":"Astronomische gebeurtenissen vandaag",August:JG,"Blockly description":"Regels maken door grafische blokken","Body:":"Lichaam:",Cancel:qG,"Cannot delete non empty item!":"Kan niet leeg item niet verwijderen!","Change layout":"Opmaak veranderen",'Change theme (actual "%s")':'Thema wijzigen (nu - "%s")',"Check blocks":"Controleer blokken","Check is not active, because javascript adapter is disabled":"Controle is niet actief, omdat Javascript-adapter is uitgeschakeld","Clear search input":"Zoekopdracht wissen","Click on this icon":"Klik op dit pictogram",Close:XG,"Close all but current":"Alles sluiten behalve huidig","Collapse all":"Alles inklappen","Compares current time with astronomical event":"Vergelijkt huidige tijd met astronomische gebeurtenis","Compares current time with the user specific time":"Vergelijkt de huidige tijd met de gebruikerspecifieke tijd","Compares the state value with user defined value":"Vergelijkt de statuswaarde met de door de gebruiker gedefinieerde waarde",Condition:ZG,Conditions:QG,"Configuration not saved.":"Configuratie niet opgeslagen.",Console:eV,"Control or update some state":"Beheer of update een bepaalde staat","Control or update some state with delay":"Beheer of update een bepaalde staat met vertraging","Convert blockly to javascript for ever.":"Converteer direct blockly naar Javascript.",Copied:tV,"Copy script":"Kopieer script","Copy to clipboard":"Kopieer naar klembord","Create new":"Maak nieuw","Create new folder":"Maak een nieuwe map","Create new script":"Maak een nieuw script","Create or edit CRON or time wizard":"Creëer of bewerk CRON of tijdwizard","Dark Theme":"Donker thema","Dark style":"Donkere stijl",Date:"Datum","Debug instance":"Debug-instantie","Debug options":"Foutopsporingsopties",December:sV,Default:oV,"Define cron...":"Definieer cron ...","Define schedule...":"Definieer schema ...",Delay:iV,Delete:nV,"Delete %s":"%s verwijderen ...","Delete folder":"Verwijder map","Delete script":"Script verwijderen",Description:rV,"Deselect all":"Deselecteer alles","Discard changes for %s":"Wijzigingen voor %s annuleren",Done:aV,"Double click to write value":"Dubbelklikken om waarde te schrijven","Download as file":"Download","Drop some files here or click...":"Zet hier enkele bestanden neer of klik op ...","Duplicate name":"Dubbele naam","Edit script or just double click":"Bewerk het script of dubbelklik erop","Empty name is not allowed":"Lege naam is niet toegestaan","End search mode":"Zoekmodus beëindigen","Enter your question":"Voer uw verzoek in",Error:"Fout","Error formatting code":"Fout bij het opmaken van de code","Error was found":"Er is een fout gevonden","Every day":"Elke dag",Exec:lV,"Executes some shell command":"Voert een shell-commando uit","Existing scripts will be overwritten.":"Bestaande scripts worden overschreven.","Expand all":"Alles uitvouwen","Expert mode":"Expert modus",Explanation:cV,Export:uV,"Export all scripts":"Exporteer alle scripts","Export blocks":"Blokken exporteren","Export selected blocks":"Exporteer geselecteerde blokken",Februar:dV,February:hV,Filter:pV,Folder:gV,Fr:mV,Friday:fV,Function:"Functie","Function editor":"Functie-editor","Function: executed":"Functie: uitgevoerd","Go to next line":"Ga naar de volgende regel","HTTP Call":"HTTP-oproep","Hide logs":"Verberg logboeken",ID:$V,ID1:bV,ID2:vV,Import:yV,"Import blocks":"Blokken importeren","Import error":"Importfout","Import scripts":"Scripts importeren","Insert object ID":"Object-ID invoegen",Instance:_V,"Instance is disabled":"Exemplaar is uitgeschakeld","Instance:":"Voorbeeld:",Instances:wV,Instructions:CV,"Invalid CRON":"Ongeldige CRON","It will not be possible to revert this operation.":"Het is niet mogelijk om deze bewerking terug te zetten.","JS description":"Regels maken door Javascript te schrijven",Januar:TV,January:kV,July:SV,June:EV,"Just check":"Kijk maar","Language:":"Taal:","Learn More":"Leer meer","Light style":"Lichte stijl",Limit:IV,"Local time":"Lokale tijd","Locate file":"Vind het bestand","Log outputs":"Log uitgangen","Log text":"Log tekst","Log: %s":"Logboek: %s","Make a HTTP get request":"Maak een HTTP-ophaalverzoek","Make a pause between actions":"Pauzeer tussen acties",March:xV,"March ":"maart",May:DV,Menu:AV,Message:RV,Mo:OV,Model:MV,Monday:NV,Month:LV,More:PV,Name:BV,"No API key found":"Geen API-sleutel gevonden","No Chat GPT Key found":"Geen Chat GPT-sleutel gevonden","No active host found":"Geen actieve host gevonden","Nothing found":"Niets gevonden",November:jV,OK:FV,October:zV,Ok:UV,"On condition change":"Op voorwaarde verandering","On script save or adapter start":"Bij het opslaan van het script of het starten van de adapter","On weekdays":"Op weekdagen","Open configuration":"Configuratie openen","Operate two states":"Bedien twee toestanden:","Operations with two states":"Bewerkingen met twee toestanden","Paste your blocks here":"Plak hier je blokken",Pause:HV,"Pause execution":"Uitvoering pauzeren","Pause script":"Pauzeer script","Phone:":"Telefoon:","Please select object ID...":"Selecteer object-ID ...","Press Ctrl+Enter to get the answer":"Druk op Ctrl+Enter om het antwoord te krijgen","Prettify the script":"Maak het script mooier","Print some text in log":"Druk wat tekst af in het logboek","Priority:":"Prioriteit:",Pushover:WV,Pushsafer:GV,"Read only ID selected: %s":"Alleen-lezen ID geselecteerd: %s",Rename:VV,"Reorder scripts in folders":"Sorteer scripts in mappen opnieuw",Repeat:KV,Restart:YV,Result:JV,"Resume execution":"Uitvoering hervatten","Root folder":"Hoofdmap","Rules description":"Maak regels met IF, THEN, ELSE blokken","Run script":"Voer script uit",Sa:qV,Saturday:XV,Save:ZV,"Save all":"Sla alles op","Say It":"Say It","Say some text via sayit adapter":"Zeg wat tekst via de sayit-adapter",Schedule:QV,Script:e5,"Script %s was modified on disk":"Script %s is gewijzigd op schijf","Script is not running":"Script is niet actief","Search in scripts":"Zoeken in scripts","Search...":"Zoeken...","Select all":"Selecteer alles","Send email":"E-mail verzenden","Sends an email":"Stuurt een e-mail","Sends message via Pushsafer":"Stuurt bericht via Pushsafer","Sends message via pushover":"Stuurt bericht via pushover","Sends message via telegram":"Verzendt bericht via telegram","Sends message via whatsapp-cmb":"Stuurt bericht via whatsapp-cmb",September:t5,"Server time":"Servertijd","Set state action":"Stel statusactie in","Set with delay":"Met vertraging ingesteld","Shell command":"Shell-opdracht","Show astronomical events":"Laat astronomische gebeurtenissen zien","Show javascript code":"Javascript-code weergeven","Show logs":"Toon logboeken","Show only paused scripts":"Toon alleen onderbroken scripts","Show only running scripts":"Toon alleen actieve scripts","Show only scripts with problems":"Toon alleen scripts met problemen",Simulate:s5,"Some files will be rejected":"Sommige bestanden worden geweigerd","Sound:":"Geluid:",Stack:o5,Start:i5,"Start script":"Start het script",State:n5,"State condition":"Staat staat","Step into function":"Stap in functie","Step out from function":"Stap uit de functie","Stop on exception":"Stop bij uitzondering",Su:r5,"Subject:":"Onderwerpen:",Sunday:a5,"TS description":"Regels maken door Typescript te schrijven",Telegram:l5,"Text:":"Tekst:",Th:c5,"The script will be stopped and must be activated manually after debugging. Continue?":"Het script wordt gestopt en moet na het debuggen handmatig worden geactiveerd. Doorgaan met?","This is advances option. You can write your own code here and it will be executed on trigger":"Dit is een voorschotoptie. U kunt hier uw eigen code schrijven en deze wordt bij een trigger uitgevoerd",Thursday:u5,Time:d5,"Time condition":"Tijdsvoorwaarde","Title:":"Titel:","To:":"Naar:","Trigger with value":"Trigger met waarde",Triggered:h5,Triggers:p5,"Triggers the on script saving or the javascript instance restart":"Activeert het opslaan van het script of het opnieuw opstarten van de JavaScript-instantie","Triggers the rule on update or change of some state":"Activeert de regel voor het bijwerken of wijzigen van een bepaalde staat","Triggers the rule periodically or on some specific time":"Activeert de regel periodiek of op een specifieke tijd",Tu:g5,Tuesday:m5,URL:f5,"Unknown error":"Onbekende fout","Unknown error!":"Onbekende fout!","Use generated code":"Gebruik gegenereerde code","User function":"Gebruikersfunctie","User:":"Gebruiker:",Value:$5,"Vibration:":"Trilling:",Volume:b5,We:v5,Wednesday:y5,"Whatsapp-cmb":"Whatsapp-cmb",Write:_5,"Write your own code":"Schrijf je eigen code",Yes:w5,"Yet exists!":"Toch bestaat!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"U kunt %s in de URL gebruiken om de huidige triggerwaarde te gebruiken, %id om de geactiveerde object-ID te gebruiken, %name om de geactiveerde object-ID-naam te tonen of %old om de oude triggerwaarde te gebruiken","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"U kunt %s in de opdracht gebruiken om de huidige triggerwaarde te gebruiken, %id om de getriggerde object-ID te gebruiken, %name om de getriggerde object-ID-naam te tonen of %old om de oude triggerwaarde te gebruiken","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"U kunt %s in de tekst gebruiken om de huidige triggerwaarde weer te geven, %id om de geactiveerde object-ID te gebruiken, %name om de geactiveerde object-ID-naam weer te geven of %old om de oude triggerwaarde te gebruiken","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"U kunt %s in de waarde gebruiken om de huidige triggerwaarde te gebruiken, %id om de geactiveerde object-ID te gebruiken, %name om de geactiveerde object-ID-naam te tonen of %old om de oude triggerwaarde te gebruiken","You have to enter OpenAI API key in the configuration of javascript adapter.":"U moet de OpenAI API-sleutel invoeren in de configuratie van de javascript-adapter.","You have to enter at least one API key in the configuration of javascript adapter.":"U moet ten minste één API-sleutel (OpenAI, Anthropic of Gemini) invoeren in de configuratie van de javascript-adapter.","Please select a valid model":"Selecteer een geldig model","[equal]":"[Gelijk]","[greater or equal]":"[groter of gelijk]","[greater]":"[groter]","[hysteresis]":"[hysterese]","[includes]":"[inclusief]","[less or equal]":"[minder of gelijk]","[less]":"[minder]","[not equal]":"[niet gelijk]",acknowledgment:C5,all:T5,and:k5,astro:S5,at:E5,"clear running":"duidelijk rennen",control:I5,copy:x5,cron:D5,dawn:A5,debug_help:R5,debug_label:O5,default:"standaard",dusk:M5,easy:N5,else:"anders","equal to":"gelijk aan",every:L5,"every hour at 0 minutes":"elk uur op 0 minuten",false:"false","file reading has failed: %s":"bestands lezen is mislukt: %s","file reading was aborted":"bestands lezen is afgebroken",filter_func:P5,filter_id:B5,filter_name:j5,filter_role:F5,filter_room:z5,"for edit or create script":"voor bewerken of een nieuw script maken","for professionals":"voor professionals","for programmers":"voor programmeurs",goldenHour:U5,goldenHourEnd:H5,"greater or equal":"groter of gelijk","greater or equal to":"groter of gelijk aan","greater than":"groter dan",help_just_check:W5,help_on_change:G5,"high priority":"hoge prioriteit","high-priority":"hoge prioriteit","highest priority":"hoogste prioriteit",hours:V5,includes:K5,interval:Y5,"just check":"kijk maar","less or equal":"minder of gelijk","less or equal to":"minder of gelijk aan","less than":"minder dan","lower priority":"lagere prioriteit","lowest priority":"laagste prioriteit",magic:J5,milliseconds:q5,minutes:X5,ms:Z5,nadir:Q5,nauticalDawn:e3,nauticalDusk:t3,nextSunrise:s3,nextSunset:o3,night:i3,nightEnd:n3,"no blocks found":"Geen blokken gevonden","no group":"GEEN GROEP",normal:r3,"normal priority":"normale prioriteit","not equal to":"niet gelijk aan","not properly connected":"Dit blok is niet correct verbonden met andere blokken.",offset:a3,"on change":"bij verandering","on condition change":"op voorwaarde verandering","on update":"bij update",one:l3,or:c3,quiet:u3,"reset search":"reset zoeken",search:d3,seconds:h3,solarNoon:p3,"store in":"opslaan in",sunrise:g3,sunriseEnd:m3,sunset:f3,sunsetStart:$3,then:b3,"toggle value":"schakelwaarde",tooltip_ack:v3,tooltip_from:y3,tooltip_lc:_3,tooltip_quality:w3,tooltip_ts:C3,tooltip_user:T3,tooltip_value:k3,true:"waar",two:S3,undefined:"ongedefinieerd",update:E3,"use seconds":"gebruik seconden","use trigger value":"triggerwaarde gebruiken",verbose_help:I3,verbose_label:x3,when:D3,with:"met","with date":"met datum","with offset":"met offset",wizard:A3,"Loading models...":"Modellen laden...","Could not connect to API at %s":"Kan geen verbinding maken met API op %s","Invalid API key":"Ongeldige API-sleutel","Access denied by API":"Toegang geweigerd door API","API error: %s":"API-fout: %s",'Model "%s" not found':'Model "%s" niet gevonden',"Request failed: %s":"Verzoek mislukt: %s",Retry:R3,"No running javascript instance found":"Geen draaiende JavaScript-instantie gevonden"},M3="Potwierdzony",N3="Działania",L3="Dodaj",P3="Wszystko",B3="Każdy",j3="Zastosuj",F3="Kwiecień",z3="Zapytać",U3="Astronomiczny",H3="Sierpień",W3="Odwołaj",G3="Zamknij",V3="Stan",K3="Warunki",Y3="Konsola",J3="Skopiowano",q3="Grudzień",X3="Domyślna",Z3="Opóźnienie",Q3="Usuń",e4="Opis",t4="Gotowe",s4="Uruchom shell",o4="Wyjaśnienie",i4="Eksport",n4="Luty",r4="Luty",a4="Filtr",l4="Folder",c4="Pt",u4="Piątek",d4="ID",h4="ID1",p4="ID2",g4="Import",m4="Instancja",f4="Instancje",$4="Instrukcje",b4="Styczeń",v4="Styczeń",y4="Lipiec",_4="Czerwiec",w4="Limit",C4="Marzec",T4="Maj",k4="Menu",S4="Wiadomość",E4="Po",I4="Model",x4="Poniedziałek",D4="Miesiąc",A4="Więcej",R4="Nazwa",O4="Listopad",M4="OK",N4="Październik",L4="Ok",P4="Pauza",B4="Pushover",j4="Pushsafer",F4="Przemianuj",z4="Powtórz",U4="Uruchom ponownie",H4="Wynik",W4="So",G4="Sobota",V4="Zapisz",K4="Harmonogram",Y4="Skrypt",J4="Wrzesień",q4="Symulacja",X4="Stos",Z4="Początek",Q4="Stan",e8="Nd",t8="Niedziela",s8="Telegram",o8="Cz",i8="Czwartek",n8="Czas",r8="Wyzwolony",a8="Wyzwalacze",l8="Wt",c8="Wtorek",u8="URL",d8="Wartość",h8="Wolumen",p8="Śr",g8="Środa",m8="Pisać",f8="Tak",$8="potwierdzenie",b8="wszystko",v8="i",y8="Astro",_8="w",w8="kontrola",C8="Kopiuj",T8="CRON",k8="Świt",S8="Jest to specjalny tryb, w którym stany i obiekty się nie zmieniają. Jednak w protokole będą wyświetlane tylko informacje o każdej planowanej zmianie.",E8="Odpluskwić",I8="Zmierzch",x8="łatwy",D8="każdy",A8="Funkcja",R8="ID",O8="Nazwa",M8="Rola",N8="Pokój",L8="Złota godzina",P8="Koniec złotej godziny",B8="Kod zostanie wykonany tylko za każdym razem, gdy warunek będzie spełniony. Na przykład. jeśli wyzwalanie na wartość czujnika temperatury i warunek to „jeśli temperatura jest wyższa niż 20 ° C”, to działania „następnie” będą wykonywane za każdym razem, gdy czujnik wyśle temperaturę i jest powyżej 20 ° C. O 21 ° C, o 22 ° C i tak dalej.",j8="Kod zostanie wykonany tylko wtedy, gdy wynik warunku ulegnie zmianie. Na przykład. jeśli wyzwalanie na wartość czujnika temperatury i warunek „jeśli temperatura jest wyższa niż 20 ° C”, to akcje „następnie” zostaną wykonane raz, gdy temperatura przekroczy 20. Następnym razem działania „następnie” zostaną wykonane, gdy temperatura nie udaje się poniżej 20, a następnie ponownie wzrasta powyżej 20.",F8="godziny",z8="zawiera",U8="interwał",H8="magia",W8="milisekund",G8="minuty",V8="ms",K8="Północ słoneczna",Y8="Żeglarski świt",J8="Żeglarski zmierzch",q8="Następny wschód słońca",X8="Następny zachód słońca",Z8="Noc",Q8="Koniec nocy",e6="normalny",t6="przesunięcie",s6="jeden",o6="lub",i6="cisza",n6="Szukaj",r6="sekundy",a6="Południe słoneczne",l6="Wschód słońca",c6="Koniec wschodu słońca",u6="Zachód słońca",d6="Początek zachodu słońca",h6="następnie",p6="Akceptuj",g6="Od",m6="Ostatnia zmiana",f6="Jakość",$6="Znacznik czasu",b6="Użytkownik",v6="Wartość",y6="dwa",_6="aktualizacja",w6="Dodaje wyniki debugowania do dziennika dla wielu poleceń systemowych",C6="Pełne dane wyjściowe dziennika",T6="gdy",k6="Wizard",S6="Ponów próbę",E6={"%s not found":"%s nie znaleziono","()":"()","(at %s)":"(w %s)","(optional)":"(opcjonalny)","-":"-",".":".","AI code generator":"Generator kodu AI",Ack:M3,Actions:N3,"Actual time of day":"Aktualna pora dnia",Add:L3,"Add new script":"Dodaj nowy skrypt",All:P3,"All files will be accepted":"Wszystkie pliki zostaną zaakceptowane",Any:B3,"Any month":"Dowolny miesiąc",Apply:j3,April:F3,"Are you sure?":"Jesteś pewny?",Ask:z3,Astronomical:U3,"Astronomical events today":"Wydarzenia astronomiczne dzisiaj",August:H3,"Blockly description":"Tworzenie reguł za pomocą bloków graficznych","Body:":"Treść:",Cancel:W3,"Cannot delete non empty item!":"Nie można usunąć niepustego elementu!","Change layout":"Zmiana układu",'Change theme (actual "%s")':"Zmień motyw (obecnie - „%s”)","Check blocks":"Sprawdź bloki","Check is not active, because javascript adapter is disabled":"Sprawdzanie nie jest aktywne, ponieważ adapter Javascript jest wyłączony","Clear search input":"Wyczyść dane wyszukiwania","Click on this icon":"Kliknij tę ikonę",Close:G3,"Close all but current":"Zamknij wszystkie oprócz bieżących","Collapse all":"Zwinąć wszystkie","Compares current time with astronomical event":"Porównuje aktualny czas z wydarzeniem astronomicznym","Compares current time with the user specific time":"Porównuje aktualny czas z czasem określonym przez użytkownika","Compares the state value with user defined value":"Porównuje wartość stanu z wartością zdefiniowaną przez użytkownika",Condition:V3,Conditions:K3,"Configuration not saved.":"Konfiguracja nie została zapisana.",Console:Y3,"Control or update some state":"Kontroluj lub aktualizuj stan","Control or update some state with delay":"Kontroluj lub aktualizuj jakiś stan z opóźnieniem","Convert blockly to javascript for ever.":"Bezpowrotna konwersja Blockly na Javascript.",Copied:J3,"Copy script":"Skopiuj skrypt","Copy to clipboard":"Skopiuj do schowka","Create new":"Utwórz nowy","Create new folder":"Utwórz nowy folder","Create new script":"Utwórz nowy skrypt","Create or edit CRON or time wizard":"Utwórz lub edytuj CRON lub kreator czasu","Dark Theme":"Ciemny schemat","Dark style":"Ciemny styl",Date:"Data","Debug instance":"Debuguj instancję","Debug options":"Opcje debugowania",December:q3,Default:X3,"Define cron...":"Zdefiniuj CRON ...","Define schedule...":"Zdefiniuj harmonogram ...",Delay:Z3,Delete:Q3,"Delete %s":"Usuń %s ...","Delete folder":"Usuń folder","Delete script":"Usuń skrypt",Description:e4,"Deselect all":"Odznacz wszystkie","Discard changes for %s":"Odrzuć zmiany dla %s",Done:t4,"Double click to write value":"Kliknij dwukrotnie, aby zapisać wartość","Download as file":"Download jako plik plik","Drop some files here or click...":"Upuść niektóre pliki tutaj lub kliknij ...","Duplicate name":"Duplikat nazwy","Edit script or just double click":"Edytuj skrypt lub po prostu kliknij dwukrotnie","Empty name is not allowed":"Pusta nazwa jest niedozwolona","End search mode":"Zakończ tryb wyszukiwania","Enter your question":"Wpisz swoją prośbę",Error:"Błąd","Error formatting code":"Błąd formatowania kodu","Error was found":"Błąd został znaleziony","Every day":"Codziennie",Exec:s4,"Executes some shell command":"Wykonuje polecenie powłoki","Existing scripts will be overwritten.":"Istniejące skrypty zostaną zastąpione.","Expand all":"Rozwiń wszystkie","Expert mode":"Tryb ekspercki",Explanation:o4,Export:i4,"Export all scripts":"Wyeksportuj wszystkie skrypty","Export blocks":"Eksportuj bloki","Export selected blocks":"Eksportuj wybrane bloki",Februar:n4,February:r4,Filter:a4,Folder:l4,Fr:c4,Friday:u4,Function:"Funkcja","Function editor":"Edytor funkcji","Function: executed":"Funkcja: wykonywana","Go to next line":"Przejdź do następnej linii","HTTP Call":"Połączenie HTTP","Hide logs":"Ukryj dzienniki",ID:d4,ID1:h4,ID2:p4,Import:g4,"Import blocks":"Importuj bloki","Import error":"Błąd importowania","Import scripts":"Importuj skrypty","Insert object ID":"Wstaw identyfikator obiektu",Instance:m4,"Instance is disabled":"Instancja jest wyłączona","Instance:":"Instancja:",Instances:f4,Instructions:$4,"Invalid CRON":"Nieprawidłowy CRON","It will not be possible to revert this operation.":"Cofnięcie tej operacji nie będzie możliwe.","JS description":"Tworzenie reguł w Javascript",Januar:b4,January:v4,July:y4,June:_4,"Just check":"Po prostu sprawdź","Language:":"Język:","Learn More":"Ucz się więcej","Light style":"Lekki styl",Limit:w4,"Local time":"Czas lokalny","Locate file":"Znajdź plik","Log outputs":"Log dziennika","Log text":"Tekst dziennika","Log: %s":"Dziennik: %s","Make a HTTP get request":"Złóż żądanie HTTP get","Make a pause between actions":"Zrób przerwę między czynnościami",March:C4,"March ":"Marzec ",May:T4,Menu:k4,Message:S4,Mo:E4,Model:I4,Monday:x4,Month:D4,More:A4,Name:R4,"No API key found":"Nie znaleziono klucza API","No Chat GPT Key found":"Nie znaleziono klucza GPT czatu","No active host found":"Nie znaleziono aktywnego hosta","Nothing found":"Nic nie znaleziono",November:O4,OK:M4,October:N4,Ok:L4,"On condition change":"W przypadku zmiany warunków","On script save or adapter start":"Podczas zapisywania skryptu lub uruchamiania adaptera","On weekdays":"W dni powszednie","Open configuration":"Otwarta konfiguracja","Operate two states":"Obsługuj dwa stany","Operations with two states":"Operacje z dwoma stanami","Paste your blocks here":"Wklej tutaj swoje bloki",Pause:P4,"Pause execution":"Wstrzymaj wykonanie","Pause script":"Wstrzymaj skrypt","Phone:":"Telefon:","Please select object ID...":"Wybierz identyfikator obiektu ...","Press Ctrl+Enter to get the answer":"Naciśnij klawisze Ctrl+Enter, aby uzyskać odpowiedź","Prettify the script":"Upiększ skrypt","Print some text in log":"Wydrukuj tekst w dzienniku","Priority:":"Priorytet:",Pushover:B4,Pushsafer:j4,"Read only ID selected: %s":"Wybrano identyfikator tylko do odczytu: %s",Rename:F4,"Reorder scripts in folders":"Zmień kolejność skryptów w folderach",Repeat:z4,Restart:U4,Result:H4,"Resume execution":"Wznów wykonanie","Root folder":"Folder główny","Rules description":"Twórz reguły z blokami IF, THEN, ELSE","Run script":"Uruchom skrypt",Sa:W4,Saturday:G4,Save:V4,"Save all":"Zapisz wszystko","Say It":"Wypowiedz","Say some text via sayit adapter":"Powiedz tekst przez adapter sayit",Schedule:K4,Script:Y4,"Script %s was modified on disk":"Skrypt %s został zmodyfikowany na dysku","Script is not running":"Skrypt nie działa","Search in scripts":"Szukaj w skryptach","Search...":"Szukaj...","Select all":"Zaznacz wszystko","Send email":"Wysłać email","Sends an email":"Wysyła e-mail","Sends message via Pushsafer":"Wysyła wiadomość przez Pushsafer","Sends message via pushover":"Wysyła wiadomość przez pushover","Sends message via telegram":"Wysyła wiadomość telegramem","Sends message via whatsapp-cmb":"Wysyła wiadomość przez WhatsApp-cmb",September:J4,"Server time":"Czas serwera","Set state action":"Ustaw stan działania","Set with delay":"Ustaw z opóźnieniem","Shell command":"Polecenie powłoki","Show astronomical events":"Pokaż wydarzenia astronomiczne","Show javascript code":"Pokaż kod JavaScript","Show logs":"Pokaż dzienniki","Show only paused scripts":"Pokaż tylko wstrzymane skrypty","Show only running scripts":"Pokaż tylko działające skrypty","Show only scripts with problems":"Pokaż tylko skrypty z problemami",Simulate:q4,"Some files will be rejected":"Niektóre pliki zostaną odrzucone","Sound:":"Dźwięk:",Stack:X4,Start:Z4,"Start script":"Uruchom skrypt",State:Q4,"State condition":"Warunek stanu","Step into function":"Wejdź do funkcji","Step out from function":"Wyjdź z funkcji","Stop on exception":"Zatrzymaj się na wyjątku",Su:e8,"Subject:":"Temat:",Sunday:t8,"TS description":"Tworzenie reguł w Typescript",Telegram:s8,"Text:":"Tekst:",Th:o8,"The script will be stopped and must be activated manually after debugging. Continue?":"Skrypt zostanie zatrzymany i należy go aktywować ręcznie po debugowaniu. Kontyntynuj?","This is advances option. You can write your own code here and it will be executed on trigger":"To jest opcja zaawansowana. Możesz tutaj napisać własny kod, który zostanie wykonany po wyzwoleniu",Thursday:i8,Time:n8,"Time condition":"Warunek czasowy","Title:":"Tytuł:","To:":"Do:","Trigger with value":"Wyzwalacz z wartością",Triggered:r8,Triggers:a8,"Triggers the on script saving or the javascript instance restart":"Uruchamia zapisywanie skryptu lub restart instancji javascript","Triggers the rule on update or change of some state":"Uruchamia regułę przy aktualizacji lub zmianie jakiegoś stanu","Triggers the rule periodically or on some specific time":"Uruchamia regułę okresowo lub w określonym czasie",Tu:l8,Tuesday:c8,URL:u8,"Unknown error":"Nieznany błąd","Unknown error!":"Nieznany błąd!","Use generated code":"Użyj wygenerowanego kodu","User function":"Funkcja użytkownika","User:":"Użytkownik:",Value:d8,"Vibration:":"Wibracja:",Volume:h8,We:p8,Wednesday:g8,"Whatsapp-cmb":"Whatsapp-cmb",Write:m8,"Write your own code":"Napisz swój własny kod",Yes:f8,"Yet exists!":"A jednak istnieje!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Możesz użyć %s w adresie URL, aby użyć bieżącej wartości wyzwalacza, %id, aby użyć wyzwalanego identyfikatora obiektu, %name, aby wyświetlić nazwę identyfikatora wyzwalanego obiektu, lub %old, aby użyć starej wartości wyzwalacza","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Możesz użyć %s w poleceniu, aby użyć bieżącej wartości wyzwalającej, %id, aby użyć identyfikatora wyzwalanego obiektu, %name, aby wyświetlić nazwę identyfikatora wyzwalanego obiektu, lub %old, aby użyć starej wartości wyzwalającej","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Możesz użyć %s w tekście, aby wyświetlić aktualną wartość wyzwalającą, %id, aby użyć identyfikatora wyzwolonego obiektu, %name, aby wyświetlić nazwę identyfikatora wyzwolonego obiektu lub %old, aby użyć starej wartości wyzwalającej","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Możesz użyć %s w wartości, aby użyć bieżącej wartości wyzwalacza, %id, aby użyć identyfikatora wyzwalanego obiektu, %name, aby wyświetlić nazwę identyfikatora wyzwalanego obiektu, lub %old, aby użyć starej wartości wyzwalacza","You have to enter OpenAI API key in the configuration of javascript adapter.":"Należy wprowadzić klucz OpenAI API w konfiguracji adaptera javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Musisz wprowadzić co najmniej jeden klucz API (OpenAI, Anthropic lub Gemini) w konfiguracji adaptera javascript.","Please select a valid model":"Wybierz prawidłowy model","[equal]":"[równy]","[greater or equal]":"[większe lub równe]","[greater]":"[większe]","[hysteresis]":"[histereza]","[includes]":"[obejmuje]","[less or equal]":"[mniejsze lub równe]","[less]":"[mniejsze]","[not equal]":"[nie równe]",acknowledgment:$8,all:b8,and:v8,astro:y8,at:_8,"clear running":"czyste uruchomienie",control:w8,copy:C8,cron:T8,dawn:k8,debug_help:S8,debug_label:E8,default:"domyślna",dusk:I8,easy:x8,else:"inaczej","equal to":"równy",every:D8,"every hour at 0 minutes":"co godzinę po 0 minutach",false:"fałsz","file reading has failed: %s":"odczyt pliku nie powiódł się: %s","file reading was aborted":"odczyt pliku został przerwany",filter_func:A8,filter_id:R8,filter_name:O8,filter_role:M8,filter_room:N8,"for edit or create script":"do edycji lub utwórz nowy skrypt","for professionals":"dla profesjonalistów","for programmers":"dla programistów",goldenHour:L8,goldenHourEnd:P8,"greater or equal":"większe lub równe","greater or equal to":"więcej lub równo","greater than":"więcej niż",help_just_check:B8,help_on_change:j8,"high priority":"wysoki priorytet","high-priority":"wysoki priorytet","highest priority":"najwyższy priorytet",hours:F8,includes:z8,interval:U8,"just check":"po prostu sprawdź","less or equal":"mniejsze lub równe","less or equal to":"mniej lub równo","less than":"mniej niż","lower priority":"niższy priorytet","lowest priority":"najniższy priorytet",magic:H8,milliseconds:W8,minutes:G8,ms:V8,nadir:K8,nauticalDawn:Y8,nauticalDusk:J8,nextSunrise:q8,nextSunset:X8,night:Z8,nightEnd:Q8,"no blocks found":"Nie znaleziono bloków","no group":"BRAK GRUPY",normal:e6,"normal priority":"normalny priorytet","not equal to":"nie równa się","not properly connected":"Ten blok nie jest poprawnie podłączony do innych bloków.",offset:t6,"on change":"na zmianę","on condition change":"pod warunkiem zmiany warunków","on update":"po aktualizacji",one:s6,or:o6,quiet:i6,"reset search":"zresetuj wyszukiwanie",search:n6,seconds:r6,solarNoon:a6,"store in":"przechowaj w",sunrise:l6,sunriseEnd:c6,sunset:u6,sunsetStart:d6,then:h6,"toggle value":"wartość przełączania",tooltip_ack:p6,tooltip_from:g6,tooltip_lc:m6,tooltip_quality:f6,tooltip_ts:$6,tooltip_user:b6,tooltip_value:v6,true:"prawda",two:y6,undefined:"nieokreślony",update:_6,"use seconds":"użyj sekund","use trigger value":"użyj wartości wyzwalającej",verbose_help:w6,verbose_label:C6,when:T6,with:"z","with date":"z datą","with offset":"z przesunięciem",wizard:k6,"Loading models...":"Ładowanie modeli...","Could not connect to API at %s":"Nie można połączyć się z API pod adresem %s","Invalid API key":"Nieprawidłowy klucz API","Access denied by API":"Odmowa dostępu przez API","API error: %s":"Błąd API: %s",'Model "%s" not found':'Model "%s" nie znaleziony',"Request failed: %s":"Żądanie nie powiodło się: %s",Retry:S6,"No running javascript instance found":"Nie znaleziono uruchomionej instancji JavaScript"},I6="Reconhecido",x6="Ações",D6="Adicionar",A6="Todos",R6="Nenhum",O6="Aplique",M6="abril",N6="Perguntar",L6="Astronômico",P6="agosto",B6="Cancelar",j6="Fechar",F6="Doença",z6="Condições",U6="Console",H6="Copiado",W6="dezembro",G6="Predefinição",V6="Atraso",K6="Deletar",Y6="Descrição",J6="Pronto",q6="Exec shell",X6="Explicação",Z6="Exportação",Q6="Februar",e9="fevereiro",t9="Filtro",s9="Pasta",o9="Fr",i9="Sexta-feira",n9="ID",r9="ID1",a9="ID2",l9="Importar",c9="Instância",u9="Instâncias",d9="Instruções",h9="Januar",p9="janeiro",g9="julho",m9="junho",f9="Limite",$9="março",b9="maio",v9="Menu",y9="mensagem",_9="Mo",w9="Modelo",C9="Segunda-feira",T9="Mês",k9="Mais",S9="Nome",E9="novembro",I9="OK",x9="outubro",D9="Ok",A9="Pausa",R9="Pushover",O9="Pushsafer",M9="Renomear",N9="Repetir",L9="Reiniciar",P9="Resultado",B9="Sá",j9="Sábado",F9="Salve",z9="Cronograma",U9="Script",H9="setembro",W9="Simular",G9="Pilha",V9="Começar",K9="Estado",Y9="Su",J9="Domingo",q9="Telegrama",X9="4",Z9="Quinta-feira",Q9="Tempo",eK="Provocado",tK="Gatilhos",sK="Tu",oK="terça",iK="URL",nK="Valor",rK="Volume",aK="3",lK="quarta",cK="Escrever",uK="sim",dK="reconhecimento",hK="todos",pK="e",gK="astro",mK="no",fK="ao controle",$K="copiar",bK="CRON",vK="alvorecer",yK="Este é um modo especial no qual estados e objetos não serão alterados. Mas apenas as informações sobre cada mudança planejada serão exibidas no protocolo.",_K="Depurar",wK="Crepúsculo",CK="fácil",TK="cada",kK="Função",SK="ID",EK="Nome",IK="Tipo",xK="Quarto",DK="Hora dourada",AK="Fim da hora de ouro",RK='O código será executado apenas sempre que a condição for verdadeira. Por exemplo. se disparar no valor do sensor de temperatura e a condição for "se a temperatura for maior que 20 ° C", as ações "então" serão executadas toda vez que o sensor enviar a temperatura e ela estiver acima de 20 ° C. Por 21 ° C, por 22 ° C e assim por diante.',OK='O código será executado apenas se o resultado da condição mudar. Por exemplo. se disparar no valor do sensor de temperatura e a condição for "se a temperatura for maior que 20 ° C", as ações "então" serão executadas uma vez quando a temperatura estiver acima de 20. Na próxima vez, as ações "então" serão executadas quando a temperatura falha abaixo de 20 e sobe acima de 20 novamente.',MK="horas",NK="inclui",LK="intervalo",PK="Magia",BK="milissegundos",jK="minutos",FK="ms",zK="nadir",UK="Madrugada náutica",HK="Crepúsculo náutico",WK="próximo nascer do sol",GK="Próximo pôr do sol",VK="Noite",KK="Fim de noite",YK="normal",JK="Deslocamento",qK="1",XK="ou",ZK="quieto",QK="procurar",eY="segundos",tY="Meio-dia solar",sY="nascer do sol",oY="Fim do nascer do sol",iY="pôr do sol",nY="Começo do pôr do sol",rY="então",aY="reconhecer",lY="de",cY="Última alteração",uY="Qualidade",dY="timestamp",hY="usuário",pY="valor",gY="dois",mY="atualizar",fY="Adiciona saída de depuração ao log para muitos comandos do sistema",$Y="Saídas de log detalhadas",bY="quando",vY="Wizard",yY="Tentar novamente",_Y={"%s not found":"%s não encontrado","()":"()","(at %s)":"(em %s)","(optional)":"(opcional)","-":"-",".":".","AI code generator":"Gerador de código de IA",Ack:I6,Actions:x6,"Actual time of day":"Hora real do dia",Add:D6,"Add new script":"Adicionar novo script",All:A6,"All files will be accepted":"Todos os arquivos serão aceitos",Any:R6,"Any month":"Qualquer mês",Apply:O6,April:M6,"Are you sure?":"Você tem certeza?",Ask:N6,Astronomical:L6,"Astronomical events today":"Eventos astronômicos hoje",August:P6,"Blockly description":"Criando regras por blocos gráficos","Body:":"Corpo:",Cancel:B6,"Cannot delete non empty item!":"Não pode ser deletar, porque não está vazio!","Change layout":"Alterar layout",'Change theme (actual "%s")':'Alterar tema (agora - "%s")',"Check blocks":"Verificar blocos","Check is not active, because javascript adapter is disabled":"A verificação de sintaxe não está ativa porque o adaptador javascript não está rodando.","Clear search input":"Limpar entrada de pesquisa","Click on this icon":"Clique neste ícone",Close:j6,"Close all but current":"Fechar tudo, menos atual","Collapse all":"Recolher todos","Compares current time with astronomical event":"Compara o tempo atual com o evento astronômico","Compares current time with the user specific time":"Compara a hora atual com a hora específica do usuário","Compares the state value with user defined value":"Compara o valor do estado com o valor definido pelo usuário",Condition:F6,Conditions:z6,"Configuration not saved.":"Configuração não esta salva.",Console:U6,"Control or update some state":"Controlar ou atualizar algum estado","Control or update some state with delay":"Controlar ou atualizar algum estado com atraso","Convert blockly to javascript for ever.":"Converter Blockly em Javascript permanentemente.",Copied:H6,"Copy script":"Copiar script","Copy to clipboard":"Copiar para área de transferência","Create new":"Crie um novo","Create new folder":"Criar nova pasta","Create new script":"Criar novo script","Create or edit CRON or time wizard":"Criar ou editar o assistente cron ou o assistente de horário","Dark Theme":"Layout escuro","Dark style":"Estilo escuro",Date:"Encontro","Debug instance":"Instância de depuração","Debug options":"Opções de depuração",December:W6,Default:G6,"Define cron...":"Definir cron...","Define schedule...":"Definir agendamento ...",Delay:V6,Delete:K6,"Delete %s":"Deletar %s...","Delete folder":"Deletar pasta","Delete script":"Deletar script",Description:Y6,"Deselect all":"Desmarcar todos","Discard changes for %s":"Descartar alterações para %s",Done:J6,"Double click to write value":"Clique duas vezes para escrever o valor","Download as file":"Baixar como arquivo","Drop some files here or click...":"Solte alguns arquivos aqui ou clique em...","Duplicate name":"Nome duplicado","Edit script or just double click":"Edite o script ou clique duas vezes","Empty name is not allowed":"Nome vazio não é permitido","End search mode":"Finalizar modo de pesquisa","Enter your question":"Digite sua solicitação",Error:"Erro","Error formatting code":"Erro de formatação de código","Error was found":"Erro foi encontrado","Every day":"Todos os dias",Exec:q6,"Executes some shell command":"Executa algum comando shell","Existing scripts will be overwritten.":"Os scripts existentes serão substituídos.","Expand all":"Expandir todos","Expert mode":"Modo de especialista",Explanation:X6,Export:Z6,"Export all scripts":"Exportar todos os scripts","Export blocks":"Exportar blocos","Export selected blocks":"Exportar blocos selecionados",Februar:Q6,February:e9,Filter:t9,Folder:s9,Fr:o9,Friday:i9,Function:"Função","Function editor":"Editor de funções","Function: executed":"Função: executado","Go to next line":"Vá para a próxima linha","HTTP Call":"Chamada HTTP","Hide logs":"Ocultar logs",ID:n9,ID1:r9,ID2:a9,Import:l9,"Import blocks":"Importar blocos","Import error":"Erro de importação","Import scripts":"Importar script","Insert object ID":"Inserir ID do objeto",Instance:c9,"Instance is disabled":"Instância está desativada","Instance:":"Instância:",Instances:u9,Instructions:d9,"Invalid CRON":"CRON inválido","It will not be possible to revert this operation.":"Não será possível reverter esta operação.","JS description":"Criando regras escrevendo Javascript",Januar:h9,January:p9,July:g9,June:m9,"Just check":"Apenas verifique","Language:":"Língua:","Learn More":"Aprender mais","Light style":"Estilo claro",Limit:f9,"Local time":"Hora local","Locate file":"Localize o arquivo","Log outputs":"Saídas de log","Log text":"Texto de registro","Log: %s":"Log: %s","Make a HTTP get request":"Faça uma solicitação HTTP get","Make a pause between actions":"Faça uma pausa entre as ações",March:$9,"March ":"Março",May:b9,Menu:v9,Message:y9,Mo:_9,Model:w9,Monday:C9,Month:T9,More:k9,Name:S9,"No API key found":"Nenhuma chave API encontrada","No Chat GPT Key found":"Nenhuma chave GPT de bate-papo encontrada","No active host found":"Nenhum host ativo encontrado","Nothing found":"Nada encontrado",November:E9,OK:I9,October:x9,Ok:D9,"On condition change":"Na mudança de condição","On script save or adapter start":"Ao salvar o script ou iniciar o adaptador","On weekdays":"Nos dias úteis","Open configuration":"Configuração aberta","Operate two states":"Operar dois estados","Operations with two states":"Operações com dois estados","Paste your blocks here":"Cole seus blocos aqui",Pause:A9,"Pause execution":"Pausar a execução","Pause script":"Pausar script","Phone:":"Telefone:","Please select object ID...":"Selecione o ID do objeto...","Press Ctrl+Enter to get the answer":"Pressione Ctrl+Enter para obter a resposta","Prettify the script":"Embeleze o roteiro","Print some text in log":"Imprimir algum texto no log","Priority:":"Prioridade:",Pushover:R9,Pushsafer:O9,"Read only ID selected: %s":"ID somente leitura selecionada: %s",Rename:M9,"Reorder scripts in folders":"Reordenar scripts em pastas",Repeat:N9,Restart:L9,Result:P9,"Resume execution":"Retomar execução","Root folder":"Pasta principal","Rules description":"Crie regras com blocos IF, THEN, ELSE","Run script":"Executar script",Sa:B9,Saturday:j9,Save:F9,"Save all":"Salvar tudo","Say It":"Say It","Say some text via sayit adapter":"Diga algum texto através do adaptador sayit",Schedule:z9,Script:U9,"Script %s was modified on disk":'O script "%s" foi modificado no disco rígido',"Script is not running":"Script não está sendo executado","Search in scripts":"Pesquisa em scripts","Search...":"Procurar...","Select all":"Selecionar tudo","Send email":"Enviar email","Sends an email":"Envia um email","Sends message via Pushsafer":"Envia mensagem via Pushsafer","Sends message via pushover":"Envia mensagem via pushover","Sends message via telegram":"Envia mensagem via telegrama","Sends message via whatsapp-cmb":"Envia mensagem via whatsapp-cmb",September:H9,"Server time":"Tempo de servidor","Set state action":"Definir ação de estado","Set with delay":"Definido com atraso","Shell command":"Comando shell","Show astronomical events":"Mostrar eventos astronômicos","Show javascript code":"Mostrar código Javascript","Show logs":"Mostrar logs","Show only paused scripts":"Mostrar apenas scripts pausados","Show only running scripts":"Mostrar apenas scripts em execução","Show only scripts with problems":"Mostrar apenas scripts com problemas",Simulate:W9,"Some files will be rejected":"Alguns arquivos serão rejeitados","Sound:":"Som:",Stack:G9,Start:V9,"Start script":"Iniciar script",State:K9,"State condition":"Condição de estado","Step into function":"Entre na função","Step out from function":"Saia da função","Stop on exception":"Pare na exceção",Su:Y9,"Subject:":"Sujeito:",Sunday:J9,"TS description":"Criando regras escrevendo Typecript",Telegram:q9,"Text:":"Texto:",Th:X9,"The script will be stopped and must be activated manually after debugging. Continue?":"O script será interrompido e deve ser ativado manualmente após a depuração. Continuar?","This is advances option. You can write your own code here and it will be executed on trigger":"Esta é a opção de avanços. Você pode escrever seu próprio código aqui e ele será executado no gatilho",Thursday:Z9,Time:Q9,"Time condition":"Condição de tempo","Title:":"Título:","To:":"Para:","Trigger with value":"Trigger com valor",Triggered:eK,Triggers:tK,"Triggers the on script saving or the javascript instance restart":"Aciona o salvamento do script ou a reinicialização da instância javascript","Triggers the rule on update or change of some state":"Aciona a regra na atualização ou mudança de algum estado","Triggers the rule periodically or on some specific time":"Aciona a regra periodicamente ou em algum momento específico",Tu:sK,Tuesday:oK,URL:iK,"Unknown error":"Erro desconhecido","Unknown error!":"Erro desconhecido!","Use generated code":"Usar código gerado","User function":"Função do usuário","User:":"Do utilizador:",Value:nK,"Vibration:":"Vibração:",Volume:rK,We:aK,Wednesday:lK,"Whatsapp-cmb":"Whatsapp-cmb",Write:cK,"Write your own code":"Escreva seu próprio código",Yes:uK,"Yet exists!":"Ainda existe!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Você pode usar %s na URL para usar o valor do gatilho atual, %id para usar o ID do objeto acionado, %name para mostrar o nome do ID do objeto acionado ou %old para usar o valor do gatilho antigo","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Você pode usar %s no comando para usar o valor do acionador atual, %id para usar o ID do objeto acionado, %name para mostrar o nome do ID do objeto acionado ou %old para usar o valor do acionador antigo","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Você pode usar %s no texto para exibir o valor do acionador atual, %id para usar o ID do objeto acionado, %name para mostrar o nome do ID do objeto acionado ou %old para usar o valor do acionador antigo","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Você pode usar %s no valor para usar o valor do acionador atual, %id para usar o ID do objeto acionado, %name para mostrar o nome do ID do objeto acionado ou %old para usar o valor do acionador antigo","You have to enter OpenAI API key in the configuration of javascript adapter.":"Você deve inserir a chave da API OpenAI na configuração do adaptador javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Você deve inserir pelo menos uma chave API (OpenAI, Anthropic ou Gemini) na configuração do adaptador javascript.","Please select a valid model":"Selecione um modelo válido","[equal]":"[igual]","[greater or equal]":"[maior ou igual]","[greater]":"[maior]","[hysteresis]":"[histerese]","[includes]":"[inclui]","[less or equal]":"[menor ou igual]","[less]":"[menos]","[not equal]":"[não igual]",acknowledgment:dK,all:hK,and:pK,astro:gK,at:mK,"clear running":"corrida limpa",control:fK,copy:$K,cron:bK,dawn:vK,debug_help:yK,debug_label:_K,default:"predefinição",dusk:wK,easy:CK,else:"outro","equal to":"igual a",every:TK,"every hour at 0 minutes":"a cada hora em 0 minutos",false:"falso","file reading has failed: %s":"a leitura do arquivo falhou: %s","file reading was aborted":"a leitura do arquivo foi abortada",filter_func:kK,filter_id:SK,filter_name:EK,filter_role:IK,filter_room:xK,"for edit or create script":"para editar ou criar um novo script","for professionals":"para profissionais","for programmers":"para programadores",goldenHour:DK,goldenHourEnd:AK,"greater or equal":"maior ou igual","greater or equal to":"maior ou igual a","greater than":"Maior que",help_just_check:RK,help_on_change:OK,"high priority":"prioridade máxima","high-priority":"prioridade máxima","highest priority":"Prioridade máxima",hours:MK,includes:NK,interval:LK,"just check":"Apenas verifique","less or equal":"menor ou igual","less or equal to":"menor ou igual a","less than":"Menor que","lower priority":"prioridade mais baixa","lowest priority":"prioridade mais baixa",magic:PK,milliseconds:BK,minutes:jK,ms:FK,nadir:zK,nauticalDawn:UK,nauticalDusk:HK,nextSunrise:WK,nextSunset:GK,night:VK,nightEnd:KK,"no blocks found":"Nenhum bloco encontrado","no group":"SEM GRUPO",normal:YK,"normal priority":"prioridade normal","not equal to":"não é igual a","not properly connected":"Este bloco não está conectado corretamente com outros blocos.",offset:JK,"on change":"em mudança","on condition change":"na mudança de condição","on update":"em atualização",one:qK,or:XK,quiet:ZK,"reset search":"redefinir pesquisa",search:QK,seconds:eY,solarNoon:tY,"store in":"armazenar em",sunrise:sY,sunriseEnd:oY,sunset:iY,sunsetStart:nY,then:rY,"toggle value":"valor de alternância",tooltip_ack:aY,tooltip_from:lY,tooltip_lc:cY,tooltip_quality:uY,tooltip_ts:dY,tooltip_user:hY,tooltip_value:pY,true:"verdade",two:gY,undefined:"Indefinido",update:mY,"use seconds":"use segundos","use trigger value":"use o gatilho",verbose_help:fY,verbose_label:$Y,when:bY,with:"com","with date":"com data","with offset":"com deslocamento",wizard:vY,"Loading models...":"Carregando modelos...","Could not connect to API at %s":"Não foi possível conectar à API em %s","Invalid API key":"Chave API inválida","Access denied by API":"Acesso negado pela API","API error: %s":"Erro de API: %s",'Model "%s" not found':'Modelo "%s" não encontrado',"Request failed: %s":"Solicitação falhou: %s",Retry:yY,"No running javascript instance found":"Nenhuma instância JavaScript em execução encontrada"},wY="Подтверждение",CY="Действия",TY="Добавить",kY="Все",SY="Любая",EY="Применить",IY="Апрель",xY="Спросить",DY="Aстрономический",AY="Август",RY="Отмена",OY="Закрыть",MY="Условие",NY="Условия",LY="Приставка",PY="Скопировано",BY="Декабрь",jY="Дефолт",FY="Задержка",zY="Удалить",UY="Описание",HY="Готово",WY="Исполнить shell",GY="Объяснение",VY="Экспорт",KY="Февраль",YY="Февраль",JY="Фильтр",qY="Папка",XY="Пт",ZY="пятница",QY="ID",eJ="ID1",tJ="ID2",sJ="Импорт",oJ="Экземпляр",iJ="Экземпляры",nJ="Инструкции",rJ="Январь",aJ="Январь",lJ="Июль",cJ="Июнь",uJ="Предел",dJ="Март",hJ="Май",pJ="Меню",gJ="Сообщение",mJ="Пн",fJ="Модель",$J="понедельник",bJ="Месяц",vJ="Более",yJ="Имя",_J="Ноябрь",wJ="Ок",CJ="Октябрь",TJ="Ok",kJ="Пауза",SJ="Pushover",EJ="Pushsafer",IJ="Переименовать",xJ="Повторение",DJ="Перезапустить",AJ="Результат",RJ="Сб",OJ="суббота",MJ="Сохранить",NJ="Расписание",LJ="скрипт",PJ="Сентябрь",BJ="Симулировать",jJ="Stack",FJ="Начинать",zJ="Состояние",UJ="Вс",HJ="Воскресенье",WJ="Telegram",GJ="Чт",VJ="Четверг",KJ="Время",YJ="Срабатывает",JJ="Триггеры",qJ="Вт",XJ="вторник",ZJ="URL",QJ="Значение",e7="Громкость",t7="Ср",s7="среда",o7="Напишите",i7="Да",n7="подтверждение",r7="все",a7="и",l7="Астро",c7="в",u7="контроль",d7="копия",h7="CRON",p7="Рассвет",g7="Это особый режим, в котором состояния и объекты не будут меняться. Но в протоколе будет отображаться только информация о каждом планируемом изменении.",m7="Отлаживать",f7="Сумерки",$7="легкий",b7="каждые(ый)",v7="Функция",y7="ID",_7="Название",w7="Роль",C7="Комната",T7="Золотой час",k7="Конец золотого часа",S7="Код будет выполняться только каждый раз, когда условие истинно. Например. при срабатывании по значению датчика температуры и условию «если температура выше 20°C», действия «затем» будут выполняться каждый раз, когда датчик отправляет значение температуры, и оно превышает 20°C. На 21°С, на 22°С и так далее.",E7="Код будет выполнен только в случае изменения результата условия. Например, при срабатывании по значению датчика температуры и условию «если температура больше 20°C», действия «затем» будут выполнены один раз, когда температура превысит 20°C. В следующий раз действия «затем» будут выполнены, когда температура опустится ниже 20°C, а затем снова поднимается выше 20°C.",I7="час(ов)",x7="содержит",D7="интервал",A7="магия",R7="миллисекунды",O7="минут(у)",M7="мс",N7="Надир",L7="Морской рассвет",P7="Морские сумерки",B7="Следующий восход",j7="Следующий закат",F7="Ночь",z7="Конец ночи",U7="нормальный",H7="сдвиг",W7="один",G7="или",V7="тихий",K7="поиск",Y7="секунд",J7="Солнечный полдень",q7="Восход солнца",X7="Конец восхода",Z7="Закат солнца",Q7="Начало заката",eq="тогда",tq="Подтверждено",sq="От",oq="Последнее изменение",iq="Качественный",nq="Время",rq="Пользователь",aq="Значение",lq="два",cq="обновить",uq="Добавляет вывод отладки в журнал для многих системных команд.",dq="Подробный протокол",hq="если",pq="Мастер",gq="Повторить",mq={"%s not found":"%s не найден","()":"()","(at %s)":"(в %s)","(optional)":"(необязательный)","-":"-",".":".","AI code generator":"ИИ Генератор кода",Ack:wY,Actions:CY,"Actual time of day":"Фактическое время суток",Add:TY,"Add new script":"Добавить новый скрипт",All:kY,"All files will be accepted":"Все файлы будут приняты",Any:SY,"Any month":"В любой месяц",Apply:EY,April:IY,"Are you sure?":"Вы уверены?",Ask:xY,Astronomical:DY,"Astronomical events today":"Астрономические события сегодня",August:AY,"Blockly description":"Создание правил графическими блоками","Body:":"Тело:",Cancel:RY,"Cannot delete non empty item!":"Не удается удалить непустой элемент!","Change layout":"Изменить макет",'Change theme (actual "%s")':'Сменить тему (сейчас - "%s")',"Check blocks":"Проверить блоки","Check is not active, because javascript adapter is disabled":"Проверка неактивна, потому что адаптер Javascript отключен","Clear search input":"Очистить ввод","Click on this icon":"Нажмите на этот значок",Close:OY,"Close all but current":"Закрыть все кроме текущего","Collapse all":"Свернуть все","Compares current time with astronomical event":"Сравнивает текущее время с астрономическим событием","Compares current time with the user specific time":"Сравнивает текущее время с конкретным временем пользователя","Compares the state value with user defined value":"Сравнивает значение состояния с пользовательским значением",Condition:MY,Conditions:NY,"Configuration not saved.":"Конфигурация не сохранена.",Console:LY,"Control or update some state":"Контролировать или обновлять какое-то состояние","Control or update some state with delay":"Контролировать или обновлять какое-либо состояние с задержкой","Convert blockly to javascript for ever.":"Преобразовать blockly в Javascript навсегда.",Copied:PY,"Copy script":"Скопировать скрипт","Copy to clipboard":"Скопировать в буфер обмена","Create new":"Создать новый","Create new folder":"Создать новую папку","Create new script":"Создать новый скрипт","Create or edit CRON or time wizard":"Создание или редактирование CRON или мастера времени","Dark Theme":"Тёмная тема","Dark style":"Темный стиль",Date:"Дата","Debug instance":"Экземпляр отладки","Debug options":"Варианты отладки",December:BY,Default:jY,"Define cron...":"Задать правило ...","Define schedule...":"Задать расписание...",Delay:FY,Delete:zY,"Delete %s":"Удалить %s...","Delete folder":"Удалить папку","Delete script":"Удалить скрипт",Description:UY,"Deselect all":"Снять выбор со всех","Discard changes for %s":"Отменить изменения для %s",Done:HY,"Double click to write value":"Двойной щелчок для записи значения","Download as file":"Скачать как файл","Drop some files here or click...":"Перетыщите сюда файлы или нажмите ...","Duplicate name":"Повторяющееся имя","Edit script or just double click":"Редактировать скрипт или просто дважды щелкнуть","Empty name is not allowed":"Пустое имя не допускается","End search mode":"Закончить поиск","Enter your question":"Введи свою просьбу",Error:"Ошибка","Error formatting code":"Ошибка форматирования кода","Error was found":"Ошибка была найдена","Every day":"Каждый день",Exec:WY,"Executes some shell command":"Выполняет некоторую команду оболочки","Existing scripts will be overwritten.":"Существующие скрипты будут перезаписаны.","Expand all":"Открыть все","Expert mode":"Экспертный режим",Explanation:GY,Export:VY,"Export all scripts":"Экспорт всех скриптов","Export blocks":"Экспортировать блоки","Export selected blocks":"Экспортировать выбранные блоки",Februar:KY,February:YY,Filter:JY,Folder:qY,Fr:XY,Friday:ZY,Function:"Функция","Function editor":"Редактор функции","Function: executed":"Функция: выполнено","Go to next line":"Перейти к следующей строке","HTTP Call":"HTTP-вызов","Hide logs":"Скрыть журналы",ID:QY,ID1:eJ,ID2:tJ,Import:sJ,"Import blocks":"Импортировать блоки","Import error":"Ошибка импорта","Import scripts":"Импорт скриптов","Insert object ID":"Вставить ID объекта",Instance:oJ,"Instance is disabled":"Экземпляр отключен","Instance:":"Пример:",Instances:iJ,Instructions:nJ,"Invalid CRON":"Неправильный CRON","It will not be possible to revert this operation.":"Невозможно вернуть эту операцию.","JS description":"Создание правил путём написания Javascript",Januar:rJ,January:aJ,July:lJ,June:cJ,"Just check":"Просто проверить","Language:":"Язык:","Learn More":"Узнать больше","Light style":"Светлый стиль",Limit:uJ,"Local time":"Местное время","Locate file":"Показать файл в дереве","Log outputs":"Журнал","Log text":"Текст журнала","Log: %s":"Журнал: %s","Make a HTTP get request":"Сделайте HTTP-запрос на получение","Make a pause between actions":"Сделайте паузу между действиями",March:dJ,"March ":"Март ",May:hJ,Menu:pJ,Message:gJ,Mo:mJ,Model:fJ,Monday:$J,Month:bJ,More:vJ,Name:yJ,"No API key found":"API-ключ не найден","No Chat GPT Key found":"Ключ GPT для чата не найден","No active host found":"Активный host не найден","Nothing found":"Ничего не найдено",November:_J,OK:wJ,October:CJ,Ok:TJ,"On condition change":"При изменении реузльтата условий","On script save or adapter start":"При сохранении скрипта или запуске адаптера","On weekdays":"По дням недели","Open configuration":"Открыть настройки","Operate two states":"Операции над двумя состояниями","Operations with two states":"Операции с двумя состояниями","Paste your blocks here":"Вставьте свои блоки сюда",Pause:kJ,"Pause execution":"Приостановить выполнение","Pause script":"Остановить скрипт","Phone:":"Телефон:","Please select object ID...":"Пожалуйста, выберите ID объекта ...","Press Ctrl+Enter to get the answer":"Нажмите Ctrl+Enter, чтобы получить ответ","Prettify the script":"Украсьте сценарий","Print some text in log":"Напечатать текст в журнале","Priority:":"Приоритет:",Pushover:SJ,Pushsafer:EJ,"Read only ID selected: %s":"Выбран идентификатор только для чтения: %s",Rename:IJ,"Reorder scripts in folders":"Сортировать скрипты в папках",Repeat:xJ,Restart:DJ,Result:AJ,"Resume execution":"Возобновить выполнение","Root folder":"Корневая папка","Rules description":"Создавайте правила с блоками ЕСЛИ, ТО, ИНАЧЕ","Run script":"Запустить скрипт",Sa:RJ,Saturday:OJ,Save:MJ,"Save all":"Сохранить все","Say It":"Say It","Say some text via sayit adapter":"Произнесите текст через адаптер Sayit",Schedule:NJ,Script:LJ,"Script %s was modified on disk":'Скрипт "%s" был изменен на диске',"Script is not running":"Сценарий не запущен","Search in scripts":"Поиск в скриптах","Search...":"Поиск...","Select all":"Выбрать все","Send email":"Отправить email","Sends an email":"Отправляет электронное письмо","Sends message via Pushsafer":"Отправляет сообщение через Pushsafer","Sends message via pushover":"Отправляет сообщение через пустышку","Sends message via telegram":"Отправляет сообщение в телеграмме","Sends message via whatsapp-cmb":"Отправляет сообщение через whatsapp-cmb",September:PJ,"Server time":"Время сервера","Set state action":"Установить состояние","Set with delay":"Установить с задержкой","Shell command":"Команда оболочки","Show astronomical events":"Показать астрономические события","Show javascript code":"Показать код Javascript","Show logs":"Показать журналы","Show only paused scripts":"Показывать только приостановленные сценарии","Show only running scripts":"Показывать только запущенные скрипты","Show only scripts with problems":"Показывать только скрипты с проблемами",Simulate:BJ,"Some files will be rejected":"Некоторые файлы будут отклонены","Sound:":"Звук:",Stack:jJ,Start:FJ,"Start script":"Старт скрипта",State:zJ,"State condition":"Сравнение состояния","Step into function":"Шаг в функционирование","Step out from function":"Выйти из функции","Stop on exception":"Остановить при исключении",Su:UJ,"Subject:":"Предмет:",Sunday:HJ,"TS description":"Создание правил путём написания Typescript",Telegram:WJ,"Text:":"Текст:",Th:GJ,"The script will be stopped and must be activated manually after debugging. Continue?":"Cкрипт будет остановлен и должен быть активирован вручную после отладки. Продолжать?","This is advances option. You can write your own code here and it will be executed on trigger":"Это расширеный вариант. Вы можете написать здесь свой код и он будет выполняться по триггеру",Thursday:VJ,Time:KJ,"Time condition":"Условие времени","Title:":"Заголовок:","To:":"К:","Trigger with value":"Триггер со значением",Triggered:YJ,Triggers:JJ,"Triggers the on script saving or the javascript instance restart":"Запускает при сохранении скрипта или перезапуске экземпляра javascript","Triggers the rule on update or change of some state":"Запускает правило при обновлении или изменении какого-либо состояния","Triggers the rule periodically or on some specific time":"Срабатывает правило периодически или в определенное время",Tu:qJ,Tuesday:XJ,URL:ZJ,"Unknown error":"Неизвестная ошибка","Unknown error!":"Неизвестная ошибка!","Use generated code":"Использовать сгенерированный код","User function":"Функция пользователя","User:":"Пользователь:",Value:QJ,"Vibration:":"Вибрация:",Volume:e7,We:t7,Wednesday:s7,"Whatsapp-cmb":"Whatsapp-cmb",Write:o7,"Write your own code":"Напишите свой код",Yes:i7,"Yet exists!":"Имя уже существует!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Вы можете использовать %s в URL-адресе, чтобы использовать текущее значение триггера, %id, чтобы использовать идентификатор инициированного объекта, %name, чтобы показать имя идентификатора инициированного объекта, или %old, чтобы использовать старое значение триггера.","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Вы можете использовать %s в команде, чтобы использовать текущее значение триггера, %id, чтобы использовать идентификатор сработавшего объекта, %name, чтобы показать имя сработавшего идентификатора объекта, или %old, чтобы использовать старое значение триггера.","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Вы можете использовать %s в тексте для отображения текущего значения триггера, %id для использования идентификатора сработавшего объекта, %name для отображения имени сработавшего идентификатора объекта или %old для использования старого значения триггера.","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Вы можете использовать %s в значении, чтобы использовать текущее значение триггера, %id, чтобы использовать идентификатор инициированного объекта, %name, чтобы показать имя идентификатора инициированного объекта, или %old, чтобы использовать старое значение триггера.","You have to enter OpenAI API key in the configuration of javascript adapter.":"Вы должны ввести ключ OpenAI API в конфигурации адаптера javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Необходимо ввести хотя бы один API-ключ (OpenAI, Anthropic или Gemini) в конфигурации адаптера javascript.","Please select a valid model":"Пожалуйста, выберите допустимую модель","[equal]":"[равно]","[greater or equal]":"[больше или равно]","[greater]":"[больше]","[hysteresis]":"[гистерезис]","[includes]":"[содержит]","[less or equal]":"[меньше или равно]","[less]":"[меньше]","[not equal]":"[не равно]",acknowledgment:n7,all:r7,and:a7,astro:l7,at:c7,"clear running":"остановить уже бегущие",control:u7,copy:d7,cron:h7,dawn:p7,debug_help:g7,debug_label:m7,default:"дефолт",dusk:f7,easy:$7,else:"иначе","equal to":"равно",every:b7,"every hour at 0 minutes":"каждый час через 0 минут",false:"false","file reading has failed: %s":"Ошибка чтения файла: %s","file reading was aborted":"Чтение файла было прервано",filter_func:v7,filter_id:y7,filter_name:_7,filter_role:w7,filter_room:C7,"for edit or create script":"для редактирования или создайте новый скрипт","for professionals":"для профессионалов","for programmers":"для программистов",goldenHour:T7,goldenHourEnd:k7,"greater or equal":"больше или равно","greater or equal to":"больше или равно","greater than":"больше чем",help_just_check:S7,help_on_change:E7,"high priority":"высокий приоритет","high-priority":"высокий-приоритет","highest priority":"высший приоритет",hours:I7,includes:x7,interval:D7,"just check":"просто проверить","less or equal":"меньше или равно","less or equal to":"меньше или равно","less than":"меньше, чем","lower priority":"более низкий приоритет","lowest priority":"самый низкий приоритет",magic:A7,milliseconds:R7,minutes:O7,ms:M7,nadir:N7,nauticalDawn:L7,nauticalDusk:P7,nextSunrise:B7,nextSunset:j7,night:F7,nightEnd:z7,"no blocks found":"Блоков нет","no group":"Нет группы",normal:U7,"normal priority":"нормальный приоритет","not equal to":"не равно","not properly connected":"Этот блок неправильно соединён или не соединён с другими блоками.",offset:H7,"on change":"по изменению","on condition change":"при изменении результата условия","on update":"при обновлении",one:W7,or:G7,quiet:V7,"reset search":"Cбросить поиск",search:K7,seconds:Y7,solarNoon:J7,"store in":"сохранить в",sunrise:q7,sunriseEnd:X7,sunset:Z7,sunsetStart:Q7,then:eq,"toggle value":"инвертировать текщее значение",tooltip_ack:tq,tooltip_from:sq,tooltip_lc:oq,tooltip_quality:iq,tooltip_ts:nq,tooltip_user:rq,tooltip_value:aq,true:"true",two:lq,undefined:"неопределенный",update:cq,"use seconds":"использовать секунды","use trigger value":"использовать значение триггера",verbose_help:uq,verbose_label:dq,when:hq,with:"с","with date":"с датой","with offset":"со сдвигом",wizard:pq,"Loading models...":"Загрузка моделей...","Could not connect to API at %s":"Не удалось подключиться к API по адресу %s","Invalid API key":"Недействительный ключ API","Access denied by API":"Доступ запрещён API","API error: %s":"Ошибка API: %s",'Model "%s" not found':'Модель "%s" не найдена',"Request failed: %s":"Запрос не удался: %s",Retry:gq,"No running javascript instance found":"Не найден работающий экземпляр JavaScript"},fq="Визнано",$q="Дії",bq="додати",vq="все",yq="Будь-який",_q="Застосувати",wq="квітень",Cq="Запитуйте",Tq="Астрономічний",kq="серпень",Sq="Скасувати",Eq="Закрити",Iq="Хвороба",xq="Умови",Dq="Консоль",Aq="Скопійовано",Rq="Грудень",Oq="За замовчуванням",Mq="Затримка",Nq="Видалити",Lq="опис",Pq="Готово",Bq="Виконавча оболонка",jq="Пояснення",Fq="Експорт",zq="Лютий",Uq="Лютий",Hq="фільтр",Wq="Папка",Gq="О",Vq="П'ятниця",Kq="ID",Yq="ID1",Jq="ID2",qq="Імпорт",Xq="Екземпляр",Zq="Примірники",Qq="Інструкції",eX="січень",tX="січня",sX="липень",oX="червень",iX="Ліміт",nX="березень",rX="Може",aX="Меню",lX="повідомлення",cX="пн",uX="Модель",dX="понеділок",hX="місяць",pX="Більше",gX="Ім'я",mX="Листопад",fX="в порядку",$X="жовтень",bX="В порядку",vX="Пауза",yX="Pushover",_X="Pushsafer",wX="Перейменувати",CX="Повторіть",TX="Перезапустіть",kX="Результат",SX="Sa",EX="Субота",IX="зберегти",xX="розклад",DX="Сценарій",AX="Вересень",RX="Симулювати",OX="Стек",MX="старт",NX="Держава",LX="Нд",PX="неділя",BX="Телеграма",jX="чт",FX="четвер",zX="час",UX="Спрацьовує",HX="Тригери",WX="вт",GX="вівторок",VX="URL",KX="Значення",YX="Обсяг",JX="ми",qX="Середа",XX="Напишіть",ZX="Так",QX="підтвердження",eZ="все",tZ="і",sZ="Астро",oZ="в",iZ="КОНТРОЛЬ",nZ="копія",rZ="CRON",aZ="Світанок",lZ="Це особливий режим, в якому стану та об'єкти не змінюватимуться. Але в протоколі відображатиметься лише інформація про кожну заплановану зміну.",cZ="Відлагоджувати",uZ="Сутінки",dZ="легко",hZ="кожен",pZ="функція",gZ="ID",mZ="Ім'я",fZ="Роль",$Z="Кімната",bZ="Золота година",vZ="Кінець золотої години",yZ="Код буде виконуватися лише щоразу, коли умова виконується. наприклад якщо спрацьовує значення датчика температури та умова «якщо температура перевищує 20°C», дії «тоді» виконуватимуться щоразу, коли датчик надсилає температуру, і вона перевищує 20°C. На 21°C, на 22°C і так далі.",_Z="Код буде виконано лише у разі зміни результату умови. наприклад якщо спрацьовує значення датчика температури та умова «якщо температура перевищує 20°C», дії «тоді» будуть виконані один раз, коли температура буде вище 20. Наступного разу дії «тоді» буде виконано, коли температура падає нижче 20, а потім знову піднімається вище 20.",wZ="години",CZ="включає в себе",TZ="інтервал",kZ="магія",SZ="мілісекунд",EZ="хвилин",IZ="РС",xZ="Надір",DZ="Морський світанок",AZ="Морські сутінки",RZ="Наступний схід сонця",OZ="Наступний захід сонця",MZ="ніч",NZ="Кінець ночі",LZ="нормально",PZ="зсув",BZ="один",jZ="або",FZ="тихо",zZ="пошук",UZ="секунд",HZ="Сонячний полудень",WZ="схід сонця",GZ="Кінець сходу сонця",VZ="Захід сонця",KZ="Початок заходу сонця",YZ="потім",JZ="Визнати",qZ="Від",XZ="Востаннє змінено",ZZ="якість",QZ="Мітка часу",eQ="Користувач",tQ="Значення",sQ="два",oQ="оновлення",iQ="Додає вихідні дані налагодження до журналу для багатьох системних команд",nQ="Докладні результати журналу",rQ="коли",aQ="майстер",lQ="Повторити",cQ={"%s not found":"%s не знайдено","()":"()","(at %s)":"(у %s)","(optional)":"(необов'язково)","-":"-",".":".","AI code generator":"Генератор коду ШІ",Ack:fq,Actions:$q,"Actual time of day":"Фактичний час доби",Add:bq,"Add new script":"Додати новий сценарій",All:vq,"All files will be accepted":"Усі файли будуть прийняті",Any:yq,"Any month":"Будь-який місяць",Apply:_q,April:wq,"Are you sure?":"Ти впевнений?",Ask:Cq,Astronomical:Tq,"Astronomical events today":"Астрономічні події сьогодні",August:kq,"Blockly description":"Створення правил за графічними блоками","Body:":"Тіло:",Cancel:Sq,"Cannot delete non empty item!":"Неможливо видалити непорожній елемент!","Change layout":"Змінити макет",'Change theme (actual "%s")':'Змінити тему (тепер - "%s")',"Check blocks":"Перевірте блоки","Check is not active, because javascript adapter is disabled":"Перевірка не активна, оскільки адаптер Javascript вимкнено","Clear search input":"Очистити пошуковий запит","Click on this icon":"Натисніть на цей значок",Close:Eq,"Close all but current":"Закрити всі, крім поточних","Collapse all":"Закрити всі","Compares current time with astronomical event":"Порівнює поточний час з астрономічною подією","Compares current time with the user specific time":"Порівнює поточний час із конкретним часом користувача","Compares the state value with user defined value":"Порівнює значення стану з визначеним користувачем значенням",Condition:Iq,Conditions:xq,"Configuration not saved.":"Конфігурація не збережена.",Console:Dq,"Control or update some state":"Контролюйте або оновлюйте певний стан","Control or update some state with delay":"Контролюйте або оновлюйте деякий стан із затримкою","Convert blockly to javascript for ever.":"Назавжди конвертуйте Blockly у Javascript.",Copied:Aq,"Copy script":"Копіювати сценарій","Copy to clipboard":"Копіювати в буфер обміну","Create new":"Створити новий","Create new folder":"Створити нову папку","Create new script":"Створіть новий сценарій","Create or edit CRON or time wizard":"Створення або редагування CRON або майстра часу","Dark Theme":"Темна тема","Dark style":"Темний стиль",Date:"Дата","Debug instance":"Екземпляр налагодження","Debug options":"Параметри налагодження",December:Rq,Default:Oq,"Define cron...":"Визначити cron...","Define schedule...":"Визначити розклад...",Delay:Mq,Delete:Nq,"Delete %s":"Видалити %s...","Delete folder":"Видалити папку","Delete script":"Видалити сценарій",Description:Lq,"Deselect all":"Зняти вибір із усіх","Discard changes for %s":"Скасувати зміни для %s",Done:Pq,"Double click to write value":"Двічі клацніть, щоб записати значення","Download as file":"Завантажити файл","Drop some files here or click...":"Перетягніть кілька файлів сюди або натисніть...","Duplicate name":"Повторюване ім'я","Edit script or just double click":"Відредагуйте сценарій або просто двічі клацніть","Empty name is not allowed":"Порожнє ім'я не допускається","End search mode":"Завершити режим пошуку","Enter your question":"Введи своє прохання",Error:"Помилка","Error formatting code":"Помилка форматування коду","Error was found":"Виявлено помилку","Every day":"Кожен день",Exec:Bq,"Executes some shell command":"Виконує певну команду оболонки","Existing scripts will be overwritten.":"Існуючі сценарії буде перезаписано.","Expand all":"Розгорнути все","Expert mode":"Експертний режим",Explanation:jq,Export:Fq,"Export all scripts":"Експортувати всі сценарії","Export blocks":"Експорт блоків","Export selected blocks":"Експортувати вибрані блоки",Februar:zq,February:Uq,Filter:Hq,Folder:Wq,Fr:Gq,Friday:Vq,Function:"функція","Function editor":"Редактор функцій","Function: executed":"Функція: виконано","Go to next line":"Перейти до наступного рядка","HTTP Call":"Виклик HTTP","Hide logs":"Приховати журнали",ID:Kq,ID1:Yq,ID2:Jq,Import:qq,"Import blocks":"Імпорт блоків","Import error":"Помилка імпорту","Import scripts":"Імпорт скриптів","Insert object ID":"Вставте ID об'єкта",Instance:Xq,"Instance is disabled":"Примірник вимкнено","Instance:":"екземпляр:",Instances:Zq,Instructions:Qq,"Invalid CRON":"Недійсний CRON","It will not be possible to revert this operation.":"Скасувати цю операцію буде неможливо.","JS description":"Створення правил шляхом написання Javascript",Januar:eX,January:tX,July:sX,June:oX,"Just check":"Просто перевірте","Language:":"Мову:","Learn More":"Вивчайте більше","Light style":"Легкий стиль",Limit:iX,"Local time":"Місцевий час","Locate file":"Знайти файл","Log outputs":"Виходи журналу","Log text":"Текст журналу","Log: %s":"Журнал: %s","Make a HTTP get request":"Зробіть HTTP-запит на отримання","Make a pause between actions":"Між діями робіть паузу",March:nX,"March ":"березень",May:rX,Menu:aX,Message:lX,Mo:cX,Model:uX,Monday:dX,Month:hX,More:pX,Name:gX,"No API key found":"API-ключ не знайдено","No Chat GPT Key found":"Ключ GPT для чату не знайдено","No active host found":"Активний хост не знайдено","Nothing found":"Нічого не знайдено",November:mX,OK:fX,October:$X,Ok:bX,"On condition change":"За умови зміни результату","On script save or adapter start":"Під час збереження сценарію або запуску адаптера","On weekdays":"В будні дні","Open configuration":"Відкрита конфігурація","Operate two states":"Керуйте двома станами","Operations with two states":"Операції з двома станами","Paste your blocks here":"Вставте сюди свої блоки",Pause:vX,"Pause execution":"Призупинити виконання","Pause script":"Призупинити сценарій","Phone:":"телефон:","Please select object ID...":"Виберіть ідентифікатор об'єкта...","Press Ctrl+Enter to get the answer":"Натисніть Ctrl+Enter, щоб отримати відповідь","Prettify the script":"Прикрасьте сценарій","Print some text in log":"Надрукувати текст у журналі","Priority:":"Пріоритет:",Pushover:yX,Pushsafer:_X,"Read only ID selected: %s":"Вибрано ідентифікатор лише для читання: %s",Rename:wX,"Reorder scripts in folders":"Зміна порядку сценаріїв у папках",Repeat:CX,Restart:TX,Result:kX,"Resume execution":"Відновити виконання","Root folder":"Коренева папка","Rules description":"Створюйте правила з блоками IF, THEN, ELSE","Run script":"Запустіть сценарій",Sa:SX,Saturday:EX,Save:IX,"Save all":"Зберегти все","Say It":"Скажи це","Say some text via sayit adapter":"Скажіть текст через адаптер sayit",Schedule:xX,Script:DX,"Script %s was modified on disk":"Сценарій %s змінено на диску","Script is not running":"Сценарій не працює","Search in scripts":"Пошук у скриптах","Search...":"пошук...","Select all":"Вибрати все","Send email":"Відправити лист","Sends an email":"Надсилає електронний лист","Sends message via Pushsafer":"Надсилає повідомлення через Pushsafer","Sends message via pushover":"Надсилає повідомлення через pushover","Sends message via telegram":"Надсилає повідомлення через телеграм","Sends message via whatsapp-cmb":"Надсилає повідомлення через whatsapp-cmb",September:AX,"Server time":"Час сервера","Set state action":"Встановити дію стану","Set with delay":"Встановити із затримкою","Shell command":"Команда оболонки","Show astronomical events":"Показати астрономічні події","Show javascript code":"Показати код Javascript","Show logs":"Показати журнали","Show only paused scripts":"Показувати лише призупинені сценарії","Show only running scripts":"Показувати лише запущені сценарії","Show only scripts with problems":"Показувати лише сценарії з проблемами",Simulate:RX,"Some files will be rejected":"Деякі файли буде відхилено","Sound:":"звук:",Stack:OX,Start:MX,"Start script":"Запустити сценарій",State:NX,"State condition":"Стан стану","Step into function":"Крок у функції","Step out from function":"Вийти з функції","Stop on exception":"Зупинка на винятках",Su:LX,"Subject:":"Тема:",Sunday:PX,"TS description":"Створення правил шляхом написання Typescript",Telegram:BX,"Text:":"Текст:",Th:jX,"The script will be stopped and must be activated manually after debugging. Continue?":"Сценарій буде зупинено, і його необхідно активувати вручну після налагодження. Продовжити?","This is advances option. You can write your own code here and it will be executed on trigger":"Це авансовий варіант. Ви можете написати тут свій власний код, і він буде виконано на тригері",Thursday:FX,Time:zX,"Time condition":"Умова часу","Title:":"Назва:","To:":"до:","Trigger with value":"Тригер зі значенням",Triggered:UX,Triggers:HX,"Triggers the on script saving or the javascript instance restart":"Ініціює збереження сценарію або перезапуск екземпляра JavaScript","Triggers the rule on update or change of some state":"Запускає правило при оновленні або зміні якогось стану","Triggers the rule periodically or on some specific time":"Спрацьовує правило періодично або в певний час",Tu:WX,Tuesday:GX,URL:VX,"Unknown error":"Невідома помилка","Unknown error!":"Невідома помилка!","Use generated code":"Використовуйте згенерований код","User function":"Функція користувача","User:":"Користувач:",Value:KX,"Vibration:":"Вібрація:",Volume:YX,We:JX,Wednesday:qX,"Whatsapp-cmb":"Whatsapp-cmb",Write:XX,"Write your own code":"Напишіть власний код",Yes:ZX,"Yet exists!":"Все ж існує!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Ви можете використовувати %s в URL-адресі, щоб використовувати поточне значення тригера, %id, щоб використовувати ідентифікатор активованого об’єкта, %name, щоб показати назву ідентифікатора активованого об’єкта, або %old, щоб використовувати старе значення тригера","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Ви можете використовувати %s у команді, щоб використовувати поточне значення тригера, %id, щоб використовувати ідентифікатор активованого об’єкта, %name, щоб показати назву ідентифікатора активованого об’єкта, або %old, щоб використовувати старе значення тригера","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Ви можете використовувати %s у тексті для відображення поточного значення тригера, %id для використання ідентифікатора активованого об’єкта, %name для відображення імені ідентифікатора активованого об’єкта або %old для використання старого значення тригера","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Ви можете використовувати %s у значенні, щоб використовувати поточне значення тригера, %id, щоб використовувати ідентифікатор активованого об’єкта, %name, щоб показати назву ідентифікатора активованого об’єкта, або %old, щоб використовувати старе значення тригера","You have to enter OpenAI API key in the configuration of javascript adapter.":"Ви повинні ввести ключ OpenAI API у конфігурації адаптера JavaScript.","You have to enter at least one API key in the configuration of javascript adapter.":"Необхідно ввести хоча б один API-ключ (OpenAI, Anthropic або Gemini) у конфігурації адаптера JavaScript.","Please select a valid model":"Будь ласка, виберіть дійсну модель","[equal]":"[рівний]","[greater or equal]":"[більше або дорівнює]","[greater]":"[більший]","[hysteresis]":"[гістерезис]","[includes]":"[включає]","[less or equal]":"[менше або рівно]","[less]":"[менше]","[not equal]":"[не дорівнює]",acknowledgment:QX,all:eZ,and:tZ,astro:sZ,at:oZ,"clear running":"чіткий біг",control:iZ,copy:nZ,cron:rZ,dawn:aZ,debug_help:lZ,debug_label:cZ,default:"за замовчуванням",dusk:uZ,easy:dZ,else:"інше","equal to":"дорівнює",every:hZ,"every hour at 0 minutes":"щогодини о 0 хвилин",false:"помилковий","file reading has failed: %s":"не вдалося прочитати файл: %s","file reading was aborted":"читання файлу було перервано",filter_func:pZ,filter_id:gZ,filter_name:mZ,filter_role:fZ,filter_room:$Z,"for edit or create script":"для редагування або створення нового сценарію","for professionals":"для професіоналів","for programmers":"для програмістів",goldenHour:bZ,goldenHourEnd:vZ,"greater or equal":"більший або рівний","greater or equal to":"більше або дорівнює","greater than":"більше, ніж, величніше ніж, крутіший за",help_just_check:yZ,help_on_change:_Z,"high priority":"високий пріоритет","high-priority":"високий пріоритет","highest priority":"найвищий пріоритет",hours:wZ,includes:CZ,interval:TZ,"just check":"просто перевірте","less or equal":"менше або дорівнює","less or equal to":"менше або дорівнює","less than":"менше ніж","lower priority":"нижчий пріоритет","lowest priority":"найнижчий пріоритет",magic:kZ,milliseconds:SZ,minutes:EZ,ms:IZ,nadir:xZ,nauticalDawn:DZ,nauticalDusk:AZ,nextSunrise:RZ,nextSunset:OZ,night:MZ,nightEnd:NZ,"no blocks found":"Блоків не знайдено","no group":"НЕМАЄ ГРУПИ",normal:LZ,"normal priority":"нормальний пріоритет","not equal to":"не дорівнює","not properly connected":"Цей блок неправильно з’єднаний з іншими блоками.",offset:PZ,"on change":"на зміну","on condition change":"про зміну умов","on update":"на оновлення",one:BZ,or:jZ,quiet:FZ,"reset search":"скинути пошук",search:zZ,seconds:UZ,solarNoon:HZ,"store in":"зберігати в",sunrise:WZ,sunriseEnd:GZ,sunset:VZ,sunsetStart:KZ,then:YZ,"toggle value":"значення перемикання",tooltip_ack:JZ,tooltip_from:qZ,tooltip_lc:XZ,tooltip_quality:ZZ,tooltip_ts:QZ,tooltip_user:eQ,tooltip_value:tQ,true:"правда",two:sQ,undefined:"невизначений",update:oQ,"use seconds":"використовуйте секунди","use trigger value":"використовувати значення тригера",verbose_help:iQ,verbose_label:nQ,when:rQ,with:"з","with date":"з датою","with offset":"зі зміщенням",wizard:aQ,"Loading models...":"Завантаження моделей...","Could not connect to API at %s":"Не вдалося підключитися до API за адресою %s","Invalid API key":"Недійсний ключ API","Access denied by API":"Доступ заборонено API","API error: %s":"Помилка API: %s",'Model "%s" not found':'Модель "%s" не знайдено',"Request failed: %s":"Запит не вдався: %s",Retry:lQ,"No running javascript instance found":"Не знайдено запущеного екземпляра JavaScript"},uQ="确认",dQ="动作",hQ="添加",pQ="所有",gQ="任何",mQ="申请",fQ="四月",$Q="问",bQ="天文",vQ="八月",yQ="取消",_Q="关闭",wQ="健康)状况",CQ="情况",TQ="安慰",kQ="复制的",SQ="十二月",EQ="默认",IQ="延迟",xQ="删除",DQ="描述",AQ="完成",RQ="执行力",OQ="解释",MQ="导出",NQ="二月",LQ="二月",PQ="筛选",BQ="文件夹",jQ="r",FQ="星期五",zQ="ID",UQ="ID1",HQ="ID2",WQ="导入",GQ="实例",VQ="实例",KQ="指示",YQ="亚努尔",JQ="一月",qQ="七月",XQ="六月",ZQ="限制",QQ="三月",eee="五月",tee="菜单",see="信息",oee="莫",iee="模型",nee="星期一",ree="月",aee="更多的",lee="名称",cee="十一月",uee="好的",dee="十月",hee="确定",pee="暂停",gee="俯卧撑",mee="推安全",fee="重命名",$ee="重复",bee="重启",vee="结果",yee="萨",_ee="星期六",wee="保存",Cee="日程",Tee="脚本",kee="九月",See="模拟",Eee="堆",Iee="开始",xee="状态",Dee="苏",Aee="星期日",Ree="电报",Oee="4",Mee="星期四",Nee="时间",Lee="触发",Pee="扳机",Bee="涂",jee="星期二",Fee="网址",zee="价值",Uee="体积",Hee="3",Wee="星期三",Gee="写",Vee="是的",Kee="致谢",Yee="全部",Jee="和",qee="天文",Xee="在",Zee="控制",Qee="复制",ete="克朗",tte="黎明",ste="这是一种特殊模式,其中状态和对象不会改变。但只有有关每个计划更改的信息才会显示在协议中。",ote="调试",ite="黄昏",nte="简单的",rte="每一个",ate="功能",lte="ID",cte="名字",ute="角色",dte="房间",hte="黄金时段",pte="黄金时段结束",gte="仅在条件为真时才执行代码。例如。如果触发温度传感器值并且条件为“如果温度大于20°C”,则每次传感器发送温度且温度超过20°C时,将执行“然后”动作。 21°C,22°C等。",mte="仅当条件结果更改时,代码才会执行。例如。如果触发温度传感器值且条件为“如果温度大于20°C”,则温度超过20时将执行一次“则”动作,下一次,当温度超过20时将执行“则”动作低于20失败,然后再次超过20。",fte="小时",$te="包括",bte="间隔",vte="魔法",yte="毫秒",_te="分钟",wte="毫秒",Cte="最低点",Tte="航海黎明",kte="航海黄昏",Ste="下一个日出",Ete="下一个日落",Ite="夜晚",xte="夜晚结束",Dte="普通的",Ate="抵消",Rte="一",Ote="或",Mte="安静的",Nte="搜索",Lte="秒",Pte="星期日正午",Bte="日出",jte="日出结束",Fte="日落",zte="日落开始",Ute="然后",Hte="确认",Wte="从",Gte="上一次改变",Vte="质量",Kte="时间戳",Yte="用户",Jte="值",qte="二",Xte="更新",Zte="将调试输出添加到许多系统命令的日志中",Qte="详细日志输出",ese="什么时候",tse="巫师",sse="重试",ose={"%s not found":"%s 未找到","()":"()","(at %s)":"(在 %s)","(optional)":"(选修的)","-":"-",".":".","AI code generator":"AI代码生成器",Ack:uQ,Actions:dQ,"Actual time of day":"一天中的实际时间",Add:hQ,"Add new script":"添加新脚本",All:pQ,"All files will be accepted":"所有文件都将被接受",Any:gQ,"Any month":"任何月份",Apply:mQ,April:fQ,"Are you sure?":"你确定吗?",Ask:$Q,Astronomical:bQ,"Astronomical events today":"今天的天文事件",August:vQ,"Blockly description":"按图形块创建规则","Body:":"身体:",Cancel:yQ,"Cannot delete non empty item!":"无法删除非空项目!","Change layout":"变更版面",'Change theme (actual "%s")':"更改主题(现在为“%s”)","Check blocks":"检查块","Check is not active, because javascript adapter is disabled":"检查未激活,因为禁用了Javascript适配器","Clear search input":"清除搜索输入","Click on this icon":"单击此图标",Close:_Q,"Close all but current":"关闭所有(当前除外)","Collapse all":"全部收缩","Compares current time with astronomical event":"将当前时间与天文事件进行比较","Compares current time with the user specific time":"将当前时间与用户特定时间进行比较","Compares the state value with user defined value":"比较状态值和用户定义的值",Condition:wQ,Conditions:CQ,"Configuration not saved.":"配置未保存。",Console:TQ,"Control or update some state":"控制或更新某些状态","Control or update some state with delay":"延迟控制或更新某些状态","Convert blockly to javascript for ever.":"立即将blockly转换为Javascript。",Copied:kQ,"Copy script":"复制脚本","Copy to clipboard":"复制到剪贴板","Create new":"创建新的","Create new folder":"创建新文件夹","Create new script":"创建新脚本","Create or edit CRON or time wizard":"创建或编辑周期任务或时间向导","Dark Theme":"深色调主题","Dark style":"深色调风格",Date:"日期","Debug instance":"调试实例","Debug options":"调试选项",December:SQ,Default:EQ,"Define cron...":"定义周期任务...","Define schedule...":"定义调度器......",Delay:IQ,Delete:xQ,"Delete %s":"删除%s...","Delete folder":"删除文件夹","Delete script":"删除脚本",Description:DQ,"Deselect all":"取消全选","Discard changes for %s":"放弃%s的更改",Done:AQ,"Double click to write value":"Double click to write value","Download as file":"档案","Drop some files here or click...":"将文件拖拽到这里或单击......","Duplicate name":"重名","Edit script or just double click":"双击编辑脚本","Empty name is not allowed":"不允许使用空名称","End search mode":"结束搜索模式","Enter your question":"输入您的要求",Error:"错误","Error formatting code":"代码格式错误","Error was found":"发现错误","Every day":"每天",Exec:RQ,"Executes some shell command":"执行一些shell命令","Existing scripts will be overwritten.":"现有脚本将被覆盖。","Expand all":"展开全部","Expert mode":"专家模式",Explanation:OQ,Export:MQ,"Export all scripts":"导出所有脚本","Export blocks":"导出块","Export selected blocks":"导出选定的块",Februar:NQ,February:LQ,Filter:PQ,Folder:BQ,Fr:jQ,Friday:FQ,Function:"功能","Function editor":"功能编辑器","Function: executed":"功能:执行","Go to next line":"转到下一行","HTTP Call":"HTTP呼叫","Hide logs":"隐藏日志",ID:zQ,ID1:UQ,ID2:HQ,Import:WQ,"Import blocks":"导入块","Import error":"导入错误","Import scripts":"导入脚本","Insert object ID":"插入对象ID",Instance:GQ,"Instance is disabled":"实例已禁用","Instance:":"实例:",Instances:VQ,Instructions:KQ,"Invalid CRON":"无效的周期任务","It will not be possible to revert this operation.":"无法恢复此操作。","JS description":"通过编写Javascript来创建规则",Januar:YQ,January:JQ,July:qQ,June:XQ,"Just check":"只是检查","Language:":"语言:","Learn More":"了解更多","Light style":"浅色调风格",Limit:ZQ,"Local time":"当地时间","Locate file":"定位文件","Log outputs":"记录输出","Log text":"记录文字","Log: %s":"日志:%s","Make a HTTP get request":"发出HTTP获取请求","Make a pause between actions":"在动作之间暂停",March:QQ,"March ":"行进",May:eee,Menu:tee,Message:see,Mo:oee,Model:iee,Monday:nee,Month:ree,More:aee,Name:lee,"No API key found":"未找到 API 密钥","No Chat GPT Key found":"找不到聊天 GPT 密钥","No active host found":"找不到活动主机","Nothing found":"没有发现",November:cee,OK:uee,October:dee,Ok:hee,"On condition change":"条件变化时","On script save or adapter start":"在脚本保存或适配器启动时","On weekdays":"在工作日","Open configuration":"开放配置","Operate two states":"操作两种状态","Operations with two states":"具有两种状态的操作","Paste your blocks here":"在此处粘贴您的区块",Pause:pee,"Pause execution":"暂停执行","Pause script":"暂停脚本","Phone:":"电话:","Please select object ID...":"请选择对象ID...","Press Ctrl+Enter to get the answer":"按 Ctrl+Enter 即可得到答案","Prettify the script":"美化脚本","Print some text in log":"在日志中打印一些文本","Priority:":"优先:",Pushover:gee,Pushsafer:mee,"Read only ID selected: %s":"选择的只读ID:%s",Rename:fee,"Reorder scripts in folders":"重新排序文件夹中的脚本",Repeat:$ee,Restart:bee,Result:vee,"Resume execution":"恢复执行","Root folder":"根文件夹","Rules description":"使用IF,THEN,ELSE块创建规则","Run script":"运行脚本",Sa:yee,Saturday:_ee,Save:wee,"Save all":"保存全部","Say It":"Say It","Say some text via sayit adapter":"通过sayit适配器说一些文字",Schedule:Cee,Script:Tee,"Script %s was modified on disk":"脚本%s已在磁盘上修改","Script is not running":"脚本没有运行","Search in scripts":"在脚本中搜索","Search...":"搜索...","Select all":"全选","Send email":"发送电子邮件","Sends an email":"发送邮件","Sends message via Pushsafer":"通过Pushsafer发送消息","Sends message via pushover":"通过推播发送消息","Sends message via telegram":"通过电报发送消息","Sends message via whatsapp-cmb":"通过whatsapp-cmb发送消息",September:kee,"Server time":"服务器时间","Set state action":"设定状态动作","Set with delay":"延迟设置","Shell command":"Shell命令","Show astronomical events":"显示天文事件","Show javascript code":"显示Javascript代码","Show logs":"显示记录","Show only paused scripts":"仅显示暂停的脚本","Show only running scripts":"仅显示正在运行的脚本","Show only scripts with problems":"仅显示有问题的脚本",Simulate:See,"Some files will be rejected":"有些文件将被拒绝","Sound:":"声音:",Stack:Eee,Start:Iee,"Start script":"启动脚本",State:xee,"State condition":"状态条件","Step into function":"进入功能","Step out from function":"退出函数","Stop on exception":"异常停止",Su:Dee,"Subject:":"学科:",Sunday:Aee,"TS description":"通过编写Typescript来创建规则",Telegram:Ree,"Text:":"文本:",Th:Oee,"The script will be stopped and must be activated manually after debugging. Continue?":"该脚本将停止,并且必须在调试后手动激活。继续?","This is advances option. You can write your own code here and it will be executed on trigger":"这是高级选项。您可以在此处编写自己的代码,它将在触发器上执行",Thursday:Mee,Time:Nee,"Time condition":"时间条件","Title:":"标题:","To:":"到:","Trigger with value":"用值触发",Triggered:Lee,Triggers:Pee,"Triggers the on script saving or the javascript instance restart":"触发脚本保存或javascript实例重启","Triggers the rule on update or change of some state":"在某些状态的更新或更改时触发规则","Triggers the rule periodically or on some specific time":"定期或在特定时间触发规则",Tu:Bee,Tuesday:jee,URL:Fee,"Unknown error":"未知错误","Unknown error!":"未知错误!","Use generated code":"使用生成的代码","User function":"用户功能","User:":"用户:",Value:zee,"Vibration:":"振动:",Volume:Uee,We:Hee,Wednesday:Wee,"Whatsapp-cmb":"Whatsapp的cmb",Write:Gee,"Write your own code":"编写自己的代码",Yes:Vee,"Yet exists!":"不存在!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"您可以在 URL 中使用 %s 以使用当前触发值,%id 以使用触发对象 ID,%name 以显示触发对象 ID 名称或 %old 以使用旧触发值","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"您可以在命令中使用 %s 以使用当前触发值,%id 使用触发对象 ID,%name 显示触发对象 ID 名称或 %old 使用旧触发值","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"您可以在文本中使用 %s 显示当前触发值,%id 使用触发对象 ID,%name 显示触发对象 ID 名称或 %old 使用旧触发值","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"您可以在值中使用 %s 以使用当前触发器值,%id 使用触发对象 ID,%name 显示触发对象 ID 名称或 %old 使用旧触发器值","You have to enter OpenAI API key in the configuration of javascript adapter.":"您必须在 javascript 适配器的配置中输入 OpenAI API 密钥。","You have to enter at least one API key in the configuration of javascript adapter.":"您必须在 javascript 适配器的配置中输入至少一个 API 密钥(OpenAI、Anthropic 或 Gemini)。","Please select a valid model":"请选择一个有效的模型","[equal]":"[平等的]","[greater or equal]":"[大于等于]","[greater]":"[更大]","[hysteresis]":"[磁滞]","[includes]":"[包括]","[less or equal]":"[小于或等于]","[less]":"[较少的]","[not equal]":"[不相等]",acknowledgment:Kee,all:Yee,and:Jee,astro:qee,at:Xee,"clear running":"畅通无阻",control:Zee,copy:Qee,cron:ete,dawn:tte,debug_help:ste,debug_label:ote,default:"默认",dusk:ite,easy:nte,else:"别的","equal to":"等于",every:rte,"every hour at 0 minutes":"每小时0分钟",false:"错误的","file reading has failed: %s":"文件读取失败:%s","file reading was aborted":"文件读取中止",filter_func:ate,filter_id:lte,filter_name:cte,filter_role:ute,filter_room:dte,"for edit or create script":"用于编辑或创建脚本","for professionals":"对于专业人士","for programmers":"对于程序员",goldenHour:hte,goldenHourEnd:pte,"greater or equal":"大于或等于","greater or equal to":"大于或等于","greater than":"比...更棒",help_just_check:gte,help_on_change:mte,"high priority":"高优先级","high-priority":"高优先级","highest priority":"最高优先级",hours:fte,includes:$te,interval:bte,"just check":"只是检查","less or equal":"小于或等于","less or equal to":"小于或等于","less than":"少于","lower priority":"低优先级","lowest priority":"最低优先级",magic:vte,milliseconds:yte,minutes:_te,ms:wte,nadir:Cte,nauticalDawn:Tte,nauticalDusk:kte,nextSunrise:Ste,nextSunset:Ete,night:Ite,nightEnd:xte,"no blocks found":"找不到块","no group":"没有组",normal:Dte,"normal priority":"正常优先","not equal to":"不等于","not properly connected":"此块未正确连接到其他块。",offset:Ate,"on change":"在变化","on condition change":"在条件变化时","on update":"更新时",one:Rte,or:Ote,quiet:Mte,"reset search":"重置搜索",search:Nte,seconds:Lte,solarNoon:Pte,"store in":"存放在",sunrise:Bte,sunriseEnd:jte,sunset:Fte,sunsetStart:zte,then:Ute,"toggle value":"切换值",tooltip_ack:Hte,tooltip_from:Wte,tooltip_lc:Gte,tooltip_quality:Vte,tooltip_ts:Kte,tooltip_user:Yte,tooltip_value:Jte,true:"真的",two:qte,undefined:"不明确的",update:Xte,"use seconds":"精确到秒","use trigger value":"使用触发值",verbose_help:Zte,verbose_label:Qte,when:ese,with:"和","with date":"有日期","with offset":"带偏移",wizard:tse,"Loading models...":"加载模型...","Could not connect to API at %s":"无法连接到 %s 的 API","Invalid API key":"无效的 API 密钥","Access denied by API":"API 拒绝访问","API error: %s":"API 错误:%s",'Model "%s" not found':'未找到模型 "%s"',"Request failed: %s":"请求失败:%s",Retry:sse,"No running javascript instance found":"未找到正在运行的 JavaScript 实例"};function ise(a){const[s,i]=Y.useState(""),[r,l]=Y.useState("");return Mt(()=>{a.socket.decrypt(a.systemConfig.native.javascriptPassword).then(u=>l(u))},[a.systemConfig,a.socket]),g.jsxs(Gt,{open:!0,onClose:()=>a.onEntered(null),fullWidth:!0,maxWidth:"sm",children:[g.jsx(as,{children:b.I18n.t("Please enter a password for expert mode")}),g.jsx(Vt,{children:g.jsx(vo,{autoFocus:!0,margin:"dense",variant:"standard",label:b.I18n.t("Password"),type:"password",fullWidth:!0,value:s,onKeyDown:u=>{u.key==="Enter"&&s&&(u.preventDefault(),u.stopPropagation(),r===s?a.onEntered(s):a.onEntered(""))},onChange:u=>i(u.target.value)})}),g.jsxs(Kt,{children:[g.jsx(De,{variant:"contained",disabled:!s,onClick:()=>{r===s?a.onEntered(s):a.onEntered("")},startIcon:g.jsx(zo,{}),children:b.I18n.t("Ok")}),g.jsx(De,{color:"grey",variant:"contained",onClick:()=>a.onEntered(null),startIcon:g.jsx(qs,{}),children:b.I18n.t("Cancel")})]})]})}const Br={root:{flexGrow:1,display:"flex",width:"100%",height:"100%"},mainDiv:{width:"100%",height:"100%",overflow:"hidden"},content:a=>({width:"100%",height:"100%",backgroundColor:a.palette.background&&a.palette.background.default,position:"relative"}),menuOpenCloseButton:a=>({position:"absolute",left:0,borderRadius:"0 5px 5px 0",top:6,pt:1,cursor:"pointer",zIndex:1,height:25,width:20,background:a.palette.secondary.main,color:a.palette.primary.main,pl:"3px","&:hover":{color:"white"}}),showLogButton:a=>({position:"absolute",right:3,borderRadius:"5px 5px 0 0",bottom:0,pt:"3px",cursor:"pointer",zIndex:10,height:20,width:25,background:a.palette.secondary.main,color:a.palette.primary.main,pl:1,"&:hover":{color:"white"}})};class nse extends b.GenericApp{hosts=[];importFile=null;scripts={};confirmCallback=null;changedScripts={};javascriptPassword="";constructor(s){super(s,{Connection:b.AdminConnection,translations:{en:cL,de:oB,es:XF,fr:GU,it:jG,nl:O3,pl:E6,pt:_Y,ru:mq,uk:cQ,"zh-cn":ose},bottomButtons:!1,socket:{autoSubscribeLog:!0},sentryDSN:window.sentryDSN});const i=window.localStorage.getItem("JS.logSizes");let r=[80,20];if(i)try{r=JSON.parse(i)}catch{}const l=window.localStorage.getItem("JS.splitSizes");let u=[20,80];if(l)try{u=JSON.parse(l)}catch{}this.state={...this.state,splitSizes:u,logSizes:r},window.alert=d=>{console.error(d),this.showJsError(d.toString())}}onScriptsChanged=(s,i)=>{if(!s)return;let r=!1;const l={};s.startsWith("script.js.")&&(i?JSON.stringify(this.scripts[s])!==JSON.stringify(i)&&(this.scripts[s]=i,r=!0,l.scriptsHash=this.state.scriptsHash+1):this.scripts[s]&&(delete this.scripts[s],r=!0,l.scriptsHash=this.state.scriptsHash+1)),r&&this.setState(l)};onInstanceChanged=(s,i)=>{var u;if(!s)return;let r=!1;const l={};if(s.match(/^system\.adapter\.[-_\w\d]+\$/)){if(s.startsWith(`system.adapter.${this.adapterName}.`)){const d=parseInt(s.split(".").pop()||"0",10)||0;if((i==null?void 0:i.type)==="instance")this.state.instances.includes(d)||(l.instances=[...this.state.instances],l.instances.push(d),l.instances.sort(),r=!0,this.socket.subscribeState(`${i._id}.alive`,this.onInstanceAliveChange));else if(!i&&this.state.instances.includes(d)){this.socket.unsubscribeState(`${s}.alive`,this.onInstanceAliveChange),l.instances=[...this.state.instances];const p=l.instances.indexOf(d);l.instances.splice(p,1),r=!0}}(u=i==null?void 0:i.common)!=null&&u.blockly&&(this.confirmCallback=d=>d&&window.location.reload(),l.confirm=b.I18n.t("Some blocks were updated. Reload admin?"),r=!0)}r&&this.setState(l)};onHostChanged=(s,i)=>{if(s&&s.startsWith("system.host.")){if((i==null?void 0:i.type)==="host")this.hosts.includes(s)||(this.hosts.push(s),this.hosts.sort());else if(!i&&this.hosts.includes(s)){const r=this.hosts.indexOf(s);this.hosts.splice(r,1)}}};onConnectionReady(){window.systemLang=this.socket.systemLang,this.setState({ready:!1,scriptsHash:0,instances:[],updating:!1,resizing:!1,selected:null,logMessage:{},editing:[],menuOpened:window.localStorage.getItem("App.menuOpened")!=="false",menuSelectId:"",expertMode:window.localStorage.getItem("App.expertMode")==="true",logHorzLayout:window.localStorage.getItem("App.logHorzLayout")==="true",runningInstances:{},confirm:"",importFile:!1,message:"",searchText:"",hideLog:window.localStorage.getItem("App.hideLog")==="true",debugMode:!1,debugInstance:null,splitSizes:[20,80],password:""},async()=>{var d;const s={},i=await this.subscribeOnInstances();s.instances=i.instances,s.runningInstances=i.runningInstances,this.javascriptPassword=((d=this.socket.systemConfig)==null?void 0:d.native.javascriptPassword)||"",await this.readAdaptersWithBlockly();const r=await this.socket.getHosts();this.hosts=r.map(p=>p._id);const l=await this.readAllScripts();window.localStorage.getItem("App.expertMode")!=="true"&&window.localStorage.getItem("App.expertMode")!=="false"&&!this.javascriptPassword?Object.keys(l).find(p=>p.startsWith("script.js.global.")&&l[p].type==="script")&&(s.expertMode=!0):this.javascriptPassword&&(s.expertMode=!1),this.scripts=l;let u=this.state.scriptsHash;this.compareScripts(l)&&u++,s.scriptsHash=u,s.ready=!0,this.setState(s),await this.socket.subscribeObject("script.*",this.onScriptsChanged),await this.socket.subscribeObject("system.adapter.*",this.onInstanceChanged),await this.socket.subscribeObject("system.host.*",this.onHostChanged)})}async subscribeOnInstances(){const i=(await this.socket.getAdapterInstances(this.adapterName)).map(l=>parseInt(l._id.split(".").pop()||"0")).sort(),r={};i.forEach(l=>r[`system.adapter.${this.adapterName}.${l}`]=!1);for(let l=0;ls[r]=i[r]),s}async readAdaptersWithBlockly(){const s=await this.socket.getObjectViewSystem("adapter","system.adapter.","system.adapter.香");return new Promise(i=>Fe.loadCustomBlockly(s,()=>i()))}onInstanceAliveChange=(s,i)=>{if(s&&(s=s?s.substring(0,s.length-6):"",this.state.runningInstances[s]!==(i?i.val:!1))){const r=JSON.parse(JSON.stringify(this.state.runningInstances));r[s]=i?!!i.val:!1,this.setState({runningInstances:r})}};compareScripts(s){const i=Object.keys(this.scripts),r=Object.keys(s);if(i.length!==r.length)return this.scripts=s,!0;if(JSON.stringify(i)!==JSON.stringify(r))return this.scripts=s,!0;for(let l=0;l ${i}`),this.setState({updating:!0});try{if(((u=this.scripts[s])==null?void 0:u.type)==="script"){const d=JSON.parse(JSON.stringify(this.scripts[s].common));d.name=r||d.name,l!==void 0&&(d.engine=`system.adapter.javascript.${l}`);const p=i.split(".");p.pop();const m=p.join(".");this.scripts[m]&&this.scripts[m].type==="script"&&(p.pop(),i=`${p.join(".")}.${i.split(".").pop()}`),await this.updateScript(s,i,d)}else await this.renameGroup(s,i,r)}catch(d){d.toString().includes("canceled")||this.showJsError(d)}this.setState({updating:!1})}async renameGroup(s,i,r,l){if(l){if(l.length){let u=l.pop();if(u){const d=await this.socket.getObject(u);if(d){try{await this.socket.delObject(u)}catch{}u=i+u.substring(s.length),d._id=u,d.common=d.common||{},d.common.expert=!0,await this.socket.setObject(u,d),await this.renameGroup(s,i,r,l)}}}}else{l=[],l=Object.keys(this.scripts).filter(d=>d.startsWith(`${s}.`));let u=await this.socket.getObject(s);u=u||{common:{},type:"channel"},u.common.name=r||u.common.name||s.split(".").pop()||"",u._id=i;try{await this.socket.delObject(s)}catch{}try{await this.socket.setObject(i,u),await this.renameGroup(s,i,r,l)}catch(d){console.log(d);const p={_id:i,type:"channel",common:{name:r||s.split(".").pop()||"",expert:!0},native:{}};await this.socket.setObject(i,p),await this.renameGroup(s,i,r,l)}}}async onUpdateScript(s,i){var r;if(((r=this.scripts[s])==null?void 0:r.type)==="script")try{await this.updateScript(s,s,i)}catch(l){l.toString().includes("canceled")||this.showJsError(l)}}onSelect(s){this.scripts[s]&&this.scripts[s].common&&this.scripts[s].type==="script"&&this.setState({selected:s,menuSelectId:s},()=>setTimeout(()=>this.setState({menuSelectId:""}),300))}renderPasswordDialog(){return this.state.showPasswordDialog?g.jsx(ise,{socket:this.socket,systemConfig:this.socket.systemConfig,onEntered:s=>{s===null?this.setState({showPasswordDialog:!1,expertMode:!1,password:""}):s?this.setState({expertMode:!0,showPasswordDialog:!1,password:s}):this.setState({showPasswordDialog:!1,expertMode:!1,message:b.I18n.t("Wrong password"),password:""})}},"passwordDialog"):null}onExpertModeChange(s){var i;if(this.state.expertMode!==s)if(s&&this.javascriptPassword)this.setState({showPasswordDialog:!0});else{let r=this.state.selected;r&&!s&&((i=this.scripts[r].native)!=null&&i.protected)&&(r=this.state.editing.find(l=>{var u;return this.scripts[l]&&!((u=this.scripts[l].native)!=null&&u.protected)})||null),window.localStorage.setItem("App.expertMode",s?"true":"false"),this.setState({expertMode:s,password:"",selected:r})}}showJsError(s){this.setState({errorText:s?s.toString():""})}showMessage(s){this.setState({message:s?s.toString():""})}onDelete(s){this.socket.delObject(s).catch(i=>this.showJsError(i))}onEdit(s){this.state.selected!==s&&this.setState({selected:s})}onAddNew(s,i,r,l,u,d){const p=new RegExp(`^${s}\\.`);if(Object.keys(this.scripts).find(m=>s===m||p.test(s)))return this.showJsError(b.I18n.t("Yet exists!"));r?this.socket.setObject(s,{_id:s,type:"channel",common:{name:i,expert:!0},native:{}}).then(()=>setTimeout(()=>this.setState({menuSelectId:s},()=>setTimeout(()=>this.setState({menuSelectId:""}),300)),1e3)).catch(m=>this.showJsError(m)):(u==="Blockly"&&!d&&(d=` -//${btoa(encodeURIComponent(''))}`),this.socket.setObject(s,{_id:s,type:"script",common:{name:i,expert:!0,engineType:u||"Javascript/js",enabled:!1,engine:`system.adapter.javascript.${l||0}`,source:d||"",debug:!1,verbose:!1},native:{}}).then(()=>setTimeout(()=>this.onSelect(s),1e3)).catch(m=>this.showJsError(m)))}async updateScript(s,i,r){let l=await this.socket.getObject(s);const u={common:{}};if(r.engine!==void 0&&(u.common.engine=r.engine),r.enabled!==void 0&&(u.common.enabled=r.enabled),r.source!==void 0&&(u.common.source=r.source),r.debug!==void 0&&(u.common.debug=r.debug),r.verbose!==void 0&&(u.common.verbose=r.verbose),u.from="system.adapter.admin.0",s===i&&(l!=null&&l.common)&&r.name===l.common.name){(!r.engineType||r.engineType!==l.common.engineType)&&r.engineType!==void 0&&(u.common.engineType=r.engineType||"Javascript/js"),u.type="script",await this.socket.extendObject(s,u);return}if(l!=null&&l.common){l.common.engineType=r.engineType||l.common.engineType||"Javascript/js",await this.socket.delObject(s),u.common.engine!==void 0&&(l.common.engine=u.common.engine),u.common.enabled!==void 0&&(l.common.enabled=u.common.enabled),u.common.source!==void 0&&(l.common.source=u.common.source),u.common.name!==void 0&&(l.common.name=u.common.name),u.common.debug!==void 0&&(l.common.debug=u.common.debug),u.common.verbose!==void 0&&(l.common.verbose=u.common.verbose),l._rev!==void 0&&delete l._rev,l.common.name=r.name,l.common.expert=!0,l.type="script",l._id=i,await this.socket.setObject(i,l);return}l=u,l.common.name=r.name,l.common.expert=!0,l.type="script",l._id=i,await this.socket.setObject(i,l)}onEnableDisable(s,i){var r;if(((r=this.scripts[s])==null?void 0:r.type)==="script"){const l=this.scripts[s].common;l.enabled=i,l.expert=!0,this.updateScript(s,s,l).catch(u=>u!=="canceled"&&this.showJsError(u))}}async getLiveHost(){for(let s=0;s{if(typeof u=="string"){const d=document.createElement("a");d.href=`../../files/${u}`,document.body.appendChild(d),d.click(),d.remove()}else if(u.error&&this.showJsError(u.error),u.data){const d=document.createElement("a");d.href=`data: application/zip;base64,${u.data}`,d.download=`${r}scripts.zip`,document.body.appendChild(d),d.click(),d.remove()}})}onImport(s){this.importFile=s||null,s?(this.confirmCallback=this.onImportConfirmed.bind(this),this.setState({importFile:!1,confirm:b.I18n.t("Existing scripts will be overwritten.")})):this.setState({importFile:!1})}async onImportConfirmed(s){let i=this.importFile;if(this.importFile=null,s&&i){i=i.split(",")[1];const r=await this.getLiveHost();if(!r){this.showJsError(b.I18n.t("No active host found"));return}this.socket.getRawSocket().emit("sendToHost",r,"writeObjectsAsZip",{data:i,adapter:"javascript",id:"script.js"},l=>{l==="permissionError"?this.showJsError(b.I18n.t(l)):!l||l.error?this.showJsError(l?b.I18n.t(l.error||""):b.I18n.t("Unknown error")):this.showMessage(b.I18n.t("Done"))})}}toggleLogLayout(){window.localStorage.setItem("App.logHorzLayout",this.state.logHorzLayout?"false":"true"),this.setState({logHorzLayout:!this.state.logHorzLayout})}renderEditor(){var i;const s=Object.keys(this.scripts).reduce((r,l)=>r+(this.scripts[l].common.engineType==="Rules"?1:0),0);return g.jsx(kn,{scriptsHash:this.state.scriptsHash,debugMode:this.state.debugMode,onDebugModeChange:r=>{r?this.setState({debugMode:!0}):this.setState({debugMode:!1,debugInstance:null})},visible:!this.state.resizing,socket:this.socket,adapterName:this.adapterName,onLocate:r=>this.setState({menuSelectId:r}),password:this.state.password,runningInstances:this.state.runningInstances,menuOpened:this.state.menuOpened,searchText:this.state.searchText,themeType:this.state.themeType,themeName:this.state.themeName,theme:this.state.theme,expertMode:this.state.expertMode,onChange:(r,l)=>this.onUpdateScript(r,l),isAnyRulesExists:s,debugInstance:this.state.debugInstance,onSelectedChange:(r,l)=>{const u={};let d=!1;r!==this.state.selected&&(d=!0,u.selected=r),JSON.stringify(l)!==JSON.stringify(this.state.editing)&&(d=!0,u.editing=[...l]),d&&this.setState(u)},onRestart:r=>this.socket.extendObject(r,{common:{enabled:!0}}),selected:this.state.selected&&((i=this.scripts[this.state.selected])==null?void 0:i.type)==="script"?this.state.selected:"",objects:this.scripts,resizing:this.state.resizing,onChangedChanged:r=>this.changedScripts=r},"editor")}showLogButton(){return g.jsx($t,{title:b.I18n.t("Show logs"),sx:Br.showLogButton,onClick:()=>{window.localStorage.setItem("App.hideLog","false"),this.setState({hideLog:!1,resizing:!0}),setTimeout(()=>this.setState({resizing:!1}),300)},children:g.jsx(CS,{})},"showLog")}renderErrorDialog(){return this.state.errorText?g.jsx(Zc,{onClose:()=>this.setState({errorText:""}),text:this.state.errorText},"dialogError"):null}renderMain(){let s;return this.state.debugMode||this.state.hideLog?s=g.jsxs(g.Fragment,{children:[!this.state.debugMode&&this.state.hideLog?this.showLogButton():void 0,this.renderEditor()]}):s=g.jsxs(l_,{direction:this.state.logHorzLayout?dt.Horizontal:dt.Vertical,initialSizes:this.state.logSizes,minWidths:[500,100],minHeights:[150,50],onResizeStarted:()=>this.setState({resizing:!0}),onResizeFinished:(i,r)=>{this.setState({logSizes:r,resizing:!1}),window.localStorage.setItem("JS.logSizes",JSON.stringify(r))},gutterClassName:this.state.themeType==="dark"?"Dark visGutter":"Light visGutter",children:[this.renderEditor(),g.jsx(bm,{verticalLayout:!this.state.logHorzLayout,onLayoutChange:()=>this.toggleLogLayout(),editing:this.state.editing,socket:this.socket,selected:this.state.selected,onHideLog:()=>{window.localStorage.setItem("App.hideLog","true"),this.setState({hideLog:!0,resizing:!0}),setTimeout(()=>this.setState({resizing:!1}),300)}},"log")]}),g.jsxs($t,{sx:Br.content,className:"iobVerticalSplitter",children:[g.jsx($t,{sx:Br.menuOpenCloseButton,onClick:()=>{window.localStorage.setItem("App.menuOpened",this.state.menuOpened?"false":"true"),this.setState({menuOpened:!this.state.menuOpened,resizing:!0}),setTimeout(()=>this.setState({resizing:!1}),300)},children:this.state.menuOpened?g.jsx(TS,{}):g.jsx(kS,{})},"closeMenu"),this.state.message?g.jsx(b.Message,{onClose:()=>this.setState({message:""}),text:this.state.message},"dialogMessage"):null,this.renderErrorDialog(),this.state.importFile?g.jsx(jm,{onClose:i=>this.onImport(i)},"dialogImportFile"):null,this.state.confirm?g.jsx(b.Confirm,{onClose:i=>{this.state.confirm&&this.setState({confirm:""}),this.confirmCallback&&this.confirmCallback(i),this.confirmCallback=null},text:this.state.confirm},"dialogConfirm"):null,this.renderPasswordDialog(),s]},"main")}render(){if(!this.state.ready)return g.jsx(i_,{injectFirst:!0,children:g.jsx(n_,{theme:this.state.theme,children:g.jsx(b.Loader,{themeType:this.state.themeType})})});let s;return this.state.menuOpened?s=g.jsxs(l_,{direction:dt.Horizontal,initialSizes:this.state.splitSizes,minWidths:[270,400],onResizeFinished:(i,r)=>{this.setState({splitSizes:r}),window.localStorage.setItem("JS.splitSizes",JSON.stringify(r))},gutterClassName:this.state.themeType==="dark"?"Dark visGutter":"Light visGutter",children:[g.jsx("div",{style:Br.mainDiv,children:g.jsx(bo,{password:this.state.password,debugMode:this.state.debugMode,onDebugInstance:i=>this.setState({debugInstance:i,debugMode:!!i}),scripts:this.scripts,scriptsHash:this.state.scriptsHash,instances:this.state.instances,onRename:this.onRename.bind(this),socket:this.socket,selectId:this.state.menuSelectId,onEdit:this.onEdit.bind(this),expertMode:this.state.expertMode,themeName:this.state.themeName,onThemeChange:i=>{b.Utils.setThemeName(i);const r=b.Utils.getThemeType(i);this.setState({themeName:i,themeType:r},()=>this.toggleTheme(i))},runningInstances:this.state.runningInstances,onExpertModeChange:i=>this.onExpertModeChange(i),onDelete:this.onDelete.bind(this),onAddNew:this.onAddNew.bind(this),onEnableDisable:this.onEnableDisable.bind(this),onExport:this.onExport.bind(this),width:500,onImport:()=>this.setState({importFile:!0}),onSearch:i=>this.setState({searchText:i}),version:this.props.version,changedScripts:this.changedScripts},"sidemenu")},"menu"),this.renderMain()]}):s=this.renderMain(),g.jsx(i_,{injectFirst:!0,children:g.jsx(n_,{theme:this.state.theme,children:g.jsx("div",{style:Br.root,children:g.jsx(mO,{socket:this.socket,children:s})})})})}}window.location.hostname==="localhost"||window.location.hostname==="[::1]"||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/);function rse(){"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(a=>{a.unregister()})}const ase="9.1.0",DT={version:ase};var Fo;(function(a){a.mouse="mouse",a.touch="touch",a.keyboard="keyboard"})(Fo||(Fo={}));class lse{get delay(){var s;return(s=this.args.delay)!==null&&s!==void 0?s:0}get scrollAngleRanges(){return this.args.scrollAngleRanges}get getDropTargetElementsAtPoint(){return this.args.getDropTargetElementsAtPoint}get ignoreContextMenu(){var s;return(s=this.args.ignoreContextMenu)!==null&&s!==void 0?s:!1}get enableHoverOutsideTarget(){var s;return(s=this.args.enableHoverOutsideTarget)!==null&&s!==void 0?s:!1}get enableKeyboardEvents(){var s;return(s=this.args.enableKeyboardEvents)!==null&&s!==void 0?s:!1}get enableMouseEvents(){var s;return(s=this.args.enableMouseEvents)!==null&&s!==void 0?s:!1}get enableTouchEvents(){var s;return(s=this.args.enableTouchEvents)!==null&&s!==void 0?s:!0}get touchSlop(){return this.args.touchSlop||0}get delayTouchStart(){var s,i,r,l;return(l=(r=(s=this.args)===null||s===void 0?void 0:s.delayTouchStart)!==null&&r!==void 0?r:(i=this.args)===null||i===void 0?void 0:i.delay)!==null&&l!==void 0?l:0}get delayMouseStart(){var s,i,r,l;return(l=(r=(s=this.args)===null||s===void 0?void 0:s.delayMouseStart)!==null&&r!==void 0?r:(i=this.args)===null||i===void 0?void 0:i.delay)!==null&&l!==void 0?l:0}get window(){if(this.context&&this.context.window)return this.context.window;if(typeof window<"u")return window}get document(){var s;if(!((s=this.context)===null||s===void 0)&&s.document)return this.context.document;if(this.window)return this.window.document}get rootElement(){var s;return((s=this.args)===null||s===void 0?void 0:s.rootElement)||this.document}constructor(s,i){this.args=s,this.context=i}}function cse(a,s,i,r){return Math.sqrt(Math.pow(Math.abs(i-a),2)+Math.pow(Math.abs(r-s),2))}function use(a,s,i,r,l){if(!l)return!1;const u=Math.atan2(r-s,i-a)*180/Math.PI+180;for(let d=0;d=p.start)&&(p.end==null||u<=p.end))return!0}return!1}const dse={Left:1},hse={Left:0};function Cg(a){return a.button===void 0||a.button===hse.Left}function pse(a){return a.buttons===void 0||(a.buttons&dse.Left)===0}function AT(a){return!!a.targetTouches}const gse=1;function mse(a){const s=a.nodeType===gse?a:a.parentElement;if(!s)return;const{top:i,left:r}=s.getBoundingClientRect();return{x:r,y:i}}function fse(a,s){if(a.targetTouches.length===1)return Hc(a.targetTouches[0]);if(s&&a.touches.length===1&&a.touches[0].target===s.target)return Hc(a.touches[0])}function Hc(a,s){return AT(a)?fse(a,s):{x:a.clientX,y:a.clientY}}const _w=(()=>{let a=!1;try{addEventListener("test",()=>{},Object.defineProperty({},"passive",{get(){return a=!0,!0}}))}catch{}return a})(),jr={[Fo.mouse]:{start:"mousedown",move:"mousemove",end:"mouseup",contextmenu:"contextmenu"},[Fo.touch]:{start:"touchstart",move:"touchmove",end:"touchend"},[Fo.keyboard]:{keydown:"keydown"}};class Gr{profile(){var s;return{sourceNodes:this.sourceNodes.size,sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,targetNodes:this.targetNodes.size,dragOverTargetIds:((s=this.dragOverTargetIds)===null||s===void 0?void 0:s.length)||0}}get document(){return this.options.document}setup(){const s=this.options.rootElement;s&&(Ie(!Gr.isSetUp,"Cannot have two Touch backends at the same time."),Gr.isSetUp=!0,this.addEventListener(s,"start",this.getTopMoveStartHandler()),this.addEventListener(s,"start",this.handleTopMoveStartCapture,!0),this.addEventListener(s,"move",this.handleTopMove),this.addEventListener(s,"move",this.handleTopMoveCapture,!0),this.addEventListener(s,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.addEventListener(s,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.addEventListener(s,"keydown",this.handleCancelOnEscape,!0))}teardown(){const s=this.options.rootElement;s&&(Gr.isSetUp=!1,this._mouseClientOffset={},this.removeEventListener(s,"start",this.handleTopMoveStartCapture,!0),this.removeEventListener(s,"start",this.handleTopMoveStart),this.removeEventListener(s,"move",this.handleTopMoveCapture,!0),this.removeEventListener(s,"move",this.handleTopMove),this.removeEventListener(s,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.removeEventListener(s,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.removeEventListener(s,"keydown",this.handleCancelOnEscape,!0),this.uninstallSourceNodeRemovalObserver())}addEventListener(s,i,r,l=!1){const u=_w?{capture:l,passive:!1}:l;this.listenerTypes.forEach(function(d){const p=jr[d][i];p&&s.addEventListener(p,r,u)})}removeEventListener(s,i,r,l=!1){const u=_w?{capture:l,passive:!1}:l;this.listenerTypes.forEach(function(d){const p=jr[d][i];p&&s.removeEventListener(p,r,u)})}connectDragSource(s,i){const r=this.handleMoveStart.bind(this,s);return this.sourceNodes.set(s,i),this.addEventListener(i,"start",r),()=>{this.sourceNodes.delete(s),this.removeEventListener(i,"start",r)}}connectDragPreview(s,i,r){return this.sourcePreviewNodeOptions.set(s,r),this.sourcePreviewNodes.set(s,i),()=>{this.sourcePreviewNodes.delete(s),this.sourcePreviewNodeOptions.delete(s)}}connectDropTarget(s,i){const r=this.options.rootElement;if(!this.document||!r)return()=>{};const l=u=>{if(!this.document||!r||!this.monitor.isDragging())return;let d;switch(u.type){case jr.mouse.move:d={x:u.clientX,y:u.clientY};break;case jr.touch.move:var p,m;d={x:((p=u.touches[0])===null||p===void 0?void 0:p.clientX)||0,y:((m=u.touches[0])===null||m===void 0?void 0:m.clientY)||0};break}const f=d!=null?this.document.elementFromPoint(d.x,d.y):void 0,v=f&&i.contains(f);if(f===i||v)return this.handleMove(u,s)};return this.addEventListener(this.document.body,"move",l),this.targetNodes.set(s,i),()=>{this.document&&(this.targetNodes.delete(s),this.removeEventListener(this.document.body,"move",l))}}getTopMoveStartHandler(){return!this.options.delayTouchStart&&!this.options.delayMouseStart?this.handleTopMoveStart:this.handleTopMoveStartDelay}installSourceNodeRemovalObserver(s){this.uninstallSourceNodeRemovalObserver(),this.draggedSourceNode=s,this.draggedSourceNodeRemovalObserver=new MutationObserver(()=>{s&&!s.parentElement&&(this.resurrectSourceNode(),this.uninstallSourceNodeRemovalObserver())}),!(!s||!s.parentElement)&&this.draggedSourceNodeRemovalObserver.observe(s.parentElement,{childList:!0})}resurrectSourceNode(){this.document&&this.draggedSourceNode&&(this.draggedSourceNode.style.display="none",this.draggedSourceNode.removeAttribute("data-reactid"),this.document.body.appendChild(this.draggedSourceNode))}uninstallSourceNodeRemovalObserver(){this.draggedSourceNodeRemovalObserver&&this.draggedSourceNodeRemovalObserver.disconnect(),this.draggedSourceNodeRemovalObserver=void 0,this.draggedSourceNode=void 0}constructor(s,i,r){this.getSourceClientOffset=l=>{const u=this.sourceNodes.get(l);return u&&mse(u)},this.handleTopMoveStartCapture=l=>{Cg(l)&&(this.moveStartSourceIds=[])},this.handleMoveStart=l=>{Array.isArray(this.moveStartSourceIds)&&this.moveStartSourceIds.unshift(l)},this.handleTopMoveStart=l=>{if(!Cg(l))return;const u=Hc(l);u&&(AT(l)&&(this.lastTargetTouchFallback=l.targetTouches[0]),this._mouseClientOffset=u),this.waitingForDelay=!1},this.handleTopMoveStartDelay=l=>{if(!Cg(l))return;const u=l.type===jr.touch.start?this.options.delayTouchStart:this.options.delayMouseStart;this.timeout=setTimeout(this.handleTopMoveStart.bind(this,l),u),this.waitingForDelay=!0},this.handleTopMoveCapture=()=>{this.dragOverTargetIds=[]},this.handleMove=(l,u)=>{this.dragOverTargetIds&&this.dragOverTargetIds.unshift(u)},this.handleTopMove=l=>{if(this.timeout&&clearTimeout(this.timeout),!this.document||this.waitingForDelay)return;const{moveStartSourceIds:u,dragOverTargetIds:d}=this,p=this.options.enableHoverOutsideTarget,m=Hc(l,this.lastTargetTouchFallback);if(!m)return;if(this._isScrolling||!this.monitor.isDragging()&&use(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,m.x,m.y,this.options.scrollAngleRanges)){this._isScrolling=!0;return}if(!this.monitor.isDragging()&&this._mouseClientOffset.hasOwnProperty("x")&&u&&cse(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,m.x,m.y)>(this.options.touchSlop?this.options.touchSlop:0)&&(this.moveStartSourceIds=void 0,this.actions.beginDrag(u,{clientOffset:this._mouseClientOffset,getSourceClientOffset:this.getSourceClientOffset,publishSource:!1})),!this.monitor.isDragging())return;const f=this.sourceNodes.get(this.monitor.getSourceId());this.installSourceNodeRemovalObserver(f),this.actions.publishDragSource(),l.cancelable&&l.preventDefault();const v=(d||[]).map(C=>this.targetNodes.get(C)).filter(C=>!!C),_=this.options.getDropTargetElementsAtPoint?this.options.getDropTargetElementsAtPoint(m.x,m.y,v):this.document.elementsFromPoint(m.x,m.y),y=[];for(const C in _){if(!_.hasOwnProperty(C))continue;let w=_[C];for(w!=null&&y.push(w);w;)w=w.parentElement,w&&y.indexOf(w)===-1&&y.push(w)}const k=y.filter(C=>v.indexOf(C)>-1).map(C=>this._getDropTargetId(C)).filter(C=>!!C).filter((C,w,E)=>E.indexOf(C)===w);if(p)for(const C in this.targetNodes){const w=this.targetNodes.get(C);if(f&&w&&w.contains(f)&&k.indexOf(C)===-1){k.unshift(C);break}}k.reverse(),this.actions.hover(k,{clientOffset:m})},this._getDropTargetId=l=>{const u=this.targetNodes.keys();let d=u.next();for(;d.done===!1;){const p=d.value;if(l===this.targetNodes.get(p))return p;d=u.next()}},this.handleTopMoveEndCapture=l=>{if(this._isScrolling=!1,this.lastTargetTouchFallback=void 0,!!pse(l)){if(!this.monitor.isDragging()||this.monitor.didDrop()){this.moveStartSourceIds=void 0;return}l.cancelable&&l.preventDefault(),this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.drop(),this.actions.endDrag()}},this.handleCancelOnEscape=l=>{l.key==="Escape"&&this.monitor.isDragging()&&(this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.endDrag())},this.options=new lse(r,i),this.actions=s.getActions(),this.monitor=s.getMonitor(),this.sourceNodes=new Map,this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.targetNodes=new Map,this.listenerTypes=[],this._mouseClientOffset={},this._isScrolling=!1,this.options.enableMouseEvents&&this.listenerTypes.push(Fo.mouse),this.options.enableTouchEvents&&this.listenerTypes.push(Fo.touch),this.options.enableKeyboardEvents&&this.listenerTypes.push(Fo.keyboard)}}const $se=function(s,i={},r={}){return new Gr(s,i,r)};window.GenericBlock=Xe;window.adapterName="javascript";window.sentryDSN="https://504499a725eb4898930d3b9e9da95740@sentry.iobroker.net/56";console.log(`iobroker.${window.adapterName}@${DT.version}`);const bse=window.innerWidth<600,ww=document.getElementById("root");ww&&Pw(ww).render(g.jsx(Zw,{backend:bse?$se:uC,children:g.jsx(nse,{version:DT.version})}));rse();const uc=window.loadDynamicScript;uc&&uc(window.location.port==="3000"?`${window.location.protocol}//${window.location.hostname}:8081/lib/js/socket.io.js`:"./../../lib/js/socket.io.js",()=>uc("vs/loader.js",()=>uc("vs/configure.js",()=>typeof window.socketLoadedHandler=="function"&&window.socketLoadedHandler())));export{gO as C,Q0 as D,Xe as G,dC as I,mw as M,As as S,gI as a,OI as b,zI as c,bi as d,cne as e,zm as f,Zc as g,rx as h,une as j,l_ as m,Mn as u,dt as z}; diff --git a/admin/assets/index-CTvnL3j4.js b/admin/assets/index-DnqTM0A3.js similarity index 99% rename from admin/assets/index-CTvnL3j4.js rename to admin/assets/index-DnqTM0A3.js index 44594f82d..c169b4807 100644 --- a/admin/assets/index-CTvnL3j4.js +++ b/admin/assets/index-DnqTM0A3.js @@ -1,4 +1,4 @@ -import{j as M}from"./createSvgIcon-DPvF8xqu.js";import{a as ft}from"./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js";import{m as Rt,z as Bt,g as Ut}from"./index-BT3MfKxA.js";import{z as Ze,o as Te,v as Nt,w as Mt,s as Lt,u as Vt,r as zt,_ as Ht,a as Gt,C as Pt,D as _t,F as Yt,G as wt,H as Qt}from"./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js";import{M as Zt,k as Xt,l as ea,O as Tt,S as ta,J as aa,n as ra,t as na,v as sa,u as oa,T as ia,U as la,V as ca,W as ua}from"./index-C49cpVll.js";import{_ as we}from"./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js";import pa from"./ScriptEditorVanillaMonaco-DSYvOslZ.js";import{r as fa}from"./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js";function da(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}import"./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js";import"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js";import"./preload-helper-BDBacUwf.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js";import"./inheritsLoose-B0Ba5G9z.js";const ba={editorDiv:{height:"100%",width:"100%",overflow:"hidden",position:"relative"}};class ha extends ft.Component{constructor(v){super(v),this.state={lines:(this.props.script||"").split(/\r\n|\n/)}}render(){return M.jsx("div",{style:ba.editorDiv,children:M.jsx(pa,{triggerPrettier:1,name:this.props.scriptName,adapterName:this.props.adapterName,readOnly:!0,code:this.props.script||"",isDark:this.props.themeType==="dark",socket:this.props.socket,runningInstances:this.props.runningInstances,language:"javascript",breakpoints:this.props.breakpoints,location:this.props.paused?this.props.location:null,onToggleBreakpoint:v=>this.props.onToggleBreakpoint(v)},"scriptEditor2")},"scriptEditorDiv2")}}const Dt=34,Ke={logBox:{width:"100%",height:"100%",position:"relative",overflow:"hidden"},logBoxInner:Z=>({display:"inline-block",color:Z.palette.mode==="dark"?"white":"black",width:`calc(100% - ${Dt}px)`,height:"100%",overflow:"auto",position:"relative",verticalAlign:"top"}),info:Z=>({background:Z.palette.mode==="dark"?"darkgrey":"lightgrey",color:(Z.palette.mode==="dark","black")}),error:Z=>({background:"#FF0000",color:Z.palette.mode==="dark"?"black":"white"}),warn:Z=>({background:"#FF8000",color:Z.palette.mode==="dark"?"black":"white"}),debug:Z=>({background:"gray",opacity:.8,color:Z.palette.mode==="dark"?"black":"white"}),silly:Z=>({background:"gray",opacity:.6,color:Z.palette.mode==="dark"?"black":"white"}),table:{fontFamily:"monospace",width:"100%"},toolbox:{width:Dt,height:"100%",boxShadow:"2px 0px 4px -1px rgba(0, 0, 0, 0.2), 4px 0px 5px 0px rgba(0, 0, 0, 0.14), 1px 0px 10px 0px rgba(0, 0, 0, 0.12)",display:"inline-block",verticalAlign:"top",overflow:"hidden"},trTime:{width:90},trSeverity:{width:40,fontWeight:"bold"},iconButtons:{width:32,height:32,padding:4}};function ma(Z){let v,g=Z.getHours();return g<10&&(g=`0${g.toString()}`),v=`${g}:`,g=Z.getMinutes(),g<10&&(g=`0${g.toString()}`),v+=`${g}:`,g=Z.getSeconds(),g<10&&(g=`0${g.toString()}`),v+=`${g}.`,g=Z.getMilliseconds(),g<10?g=`00${g.toString()}`:g<100&&(g=`0${g.toString()}`),v+=g,v}class Ct extends ft.Component{messagesEnd;constructor(v){super(v),this.state={goBottom:!0},this.messagesEnd=ft.createRef()}static generateLine(v){return M.jsxs(Ze,{component:"tr",sx:Ke[v.severity],children:[M.jsx("td",{style:Ke.trTime,children:ma(new Date(v.ts))}),M.jsx("td",{style:Ke.trSeverity,children:v.severity}),M.jsx("td",{children:v.text})]},`tr_${v.ts}_${v.text.substring(v.text.length-10,v.text.length)}`)}renderLogList(v){return v!=null&&v.length?M.jsxs(Ze,{sx:Ke.logBoxInner,children:[M.jsx("table",{style:Ke.table,children:M.jsx("tbody",{children:v.map(g=>Ct.generateLine(g))})},"logTable"),M.jsx("div",{ref:this.messagesEnd,style:{float:"left",clear:"both"}},"logScrollPoint")]},"logList"):M.jsx(Ze,{sx:Ke.logBoxInner,style:{paddingLeft:10},children:we.I18n.t("Log outputs")},"logList")}onCopy(){we.Utils.copyToClipboard(this.props.console.join(` +import{j as M}from"./createSvgIcon-DPvF8xqu.js";import{a as ft}from"./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js";import{m as Rt,z as Bt,g as Ut}from"./index-_UYoIw1I.js";import{z as Ze,o as Te,v as Nt,w as Mt,s as Lt,u as Vt,r as zt,_ as Ht,a as Gt,C as Pt,D as _t,F as Yt,G as wt,H as Qt}from"./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js";import{M as Zt,k as Xt,l as ea,O as Tt,S as ta,J as aa,n as ra,t as na,v as sa,u as oa,T as ia,U as la,V as ca,W as ua}from"./index-C49cpVll.js";import{_ as we}from"./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js";import pa from"./ScriptEditorVanillaMonaco-DSYvOslZ.js";import{r as fa}from"./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js";function da(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}import"./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js";import"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js";import"./preload-helper-BDBacUwf.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js";import"./inheritsLoose-B0Ba5G9z.js";const ba={editorDiv:{height:"100%",width:"100%",overflow:"hidden",position:"relative"}};class ha extends ft.Component{constructor(v){super(v),this.state={lines:(this.props.script||"").split(/\r\n|\n/)}}render(){return M.jsx("div",{style:ba.editorDiv,children:M.jsx(pa,{triggerPrettier:1,name:this.props.scriptName,adapterName:this.props.adapterName,readOnly:!0,code:this.props.script||"",isDark:this.props.themeType==="dark",socket:this.props.socket,runningInstances:this.props.runningInstances,language:"javascript",breakpoints:this.props.breakpoints,location:this.props.paused?this.props.location:null,onToggleBreakpoint:v=>this.props.onToggleBreakpoint(v)},"scriptEditor2")},"scriptEditorDiv2")}}const Dt=34,Ke={logBox:{width:"100%",height:"100%",position:"relative",overflow:"hidden"},logBoxInner:Z=>({display:"inline-block",color:Z.palette.mode==="dark"?"white":"black",width:`calc(100% - ${Dt}px)`,height:"100%",overflow:"auto",position:"relative",verticalAlign:"top"}),info:Z=>({background:Z.palette.mode==="dark"?"darkgrey":"lightgrey",color:(Z.palette.mode==="dark","black")}),error:Z=>({background:"#FF0000",color:Z.palette.mode==="dark"?"black":"white"}),warn:Z=>({background:"#FF8000",color:Z.palette.mode==="dark"?"black":"white"}),debug:Z=>({background:"gray",opacity:.8,color:Z.palette.mode==="dark"?"black":"white"}),silly:Z=>({background:"gray",opacity:.6,color:Z.palette.mode==="dark"?"black":"white"}),table:{fontFamily:"monospace",width:"100%"},toolbox:{width:Dt,height:"100%",boxShadow:"2px 0px 4px -1px rgba(0, 0, 0, 0.2), 4px 0px 5px 0px rgba(0, 0, 0, 0.14), 1px 0px 10px 0px rgba(0, 0, 0, 0.12)",display:"inline-block",verticalAlign:"top",overflow:"hidden"},trTime:{width:90},trSeverity:{width:40,fontWeight:"bold"},iconButtons:{width:32,height:32,padding:4}};function ma(Z){let v,g=Z.getHours();return g<10&&(g=`0${g.toString()}`),v=`${g}:`,g=Z.getMinutes(),g<10&&(g=`0${g.toString()}`),v+=`${g}:`,g=Z.getSeconds(),g<10&&(g=`0${g.toString()}`),v+=`${g}.`,g=Z.getMilliseconds(),g<10?g=`00${g.toString()}`:g<100&&(g=`0${g.toString()}`),v+=g,v}class Ct extends ft.Component{messagesEnd;constructor(v){super(v),this.state={goBottom:!0},this.messagesEnd=ft.createRef()}static generateLine(v){return M.jsxs(Ze,{component:"tr",sx:Ke[v.severity],children:[M.jsx("td",{style:Ke.trTime,children:ma(new Date(v.ts))}),M.jsx("td",{style:Ke.trSeverity,children:v.severity}),M.jsx("td",{children:v.text})]},`tr_${v.ts}_${v.text.substring(v.text.length-10,v.text.length)}`)}renderLogList(v){return v!=null&&v.length?M.jsxs(Ze,{sx:Ke.logBoxInner,children:[M.jsx("table",{style:Ke.table,children:M.jsx("tbody",{children:v.map(g=>Ct.generateLine(g))})},"logTable"),M.jsx("div",{ref:this.messagesEnd,style:{float:"left",clear:"both"}},"logScrollPoint")]},"logList"):M.jsx(Ze,{sx:Ke.logBoxInner,style:{paddingLeft:10},children:we.I18n.t("Log outputs")},"logList")}onCopy(){we.Utils.copyToClipboard(this.props.console.join(` `))}scrollToBottom(){var v,g;(g=(v=this.messagesEnd)==null?void 0:v.current)==null||g.scrollIntoView({behavior:"smooth"})}componentDidUpdate(){this.state.goBottom&&this.scrollToBottom()}render(){const v=this.props.console;return M.jsxs("div",{style:Ke.logBox,children:[M.jsxs("div",{style:Ke.toolbox,children:[M.jsx(Te,{style:Ke.iconButtons,onClick:()=>this.setState({goBottom:!this.state.goBottom}),color:this.state.goBottom?"secondary":void 0,size:"medium",children:M.jsx(Zt,{})}),v!=null&&v.length?M.jsx(Te,{style:Ke.iconButtons,onClick:()=>this.props.onClearAllLogs(),size:"medium",children:M.jsx(Xt,{})}):null,v!=null&&v.length?M.jsx(Te,{style:Ke.iconButtons,onClick:()=>this.onCopy(),size:"medium",children:M.jsx(ea,{})}):null]},"toolbox"),this.renderLogList(v)]})}}var It={exports:{}},va=It.exports;(function(Z,v){(function(g,a){Z.exports=a(fa)})(va,(function(g){return(function(a){var t={};function e(s){if(t[s])return t[s].exports;var c=t[s]={i:s,l:!1,exports:{}};return a[s].call(c.exports,c,c.exports,e),c.l=!0,c.exports}return e.m=a,e.c=t,e.d=function(s,c,d){e.o(s,c)||Object.defineProperty(s,c,{enumerable:!0,get:d})},e.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},e.t=function(s,c){if(1&c&&(s=e(s)),8&c||4&c&&typeof s=="object"&&s&&s.__esModule)return s;var d=Object.create(null);if(e.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:s}),2&c&&typeof s!="string")for(var p in s)e.d(d,p,function(f){return s[f]}.bind(null,p));return d},e.n=function(s){var c=s&&s.__esModule?function(){return s.default}:function(){return s};return e.d(c,"a",c),c},e.o=function(s,c){return Object.prototype.hasOwnProperty.call(s,c)},e.p="",e(e.s=48)})([function(a,t){a.exports=g},function(a,t){var e=a.exports={version:"2.6.12"};typeof __e=="number"&&(__e=e)},function(a,t,e){var s=e(26)("wks"),c=e(17),d=e(3).Symbol,p=typeof d=="function";(a.exports=function(f){return s[f]||(s[f]=p&&d[f]||(p?d:c)("Symbol."+f))}).store=s},function(a,t){var e=a.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=e)},function(a,t,e){a.exports=!e(8)((function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7}))},function(a,t){var e={}.hasOwnProperty;a.exports=function(s,c){return e.call(s,c)}},function(a,t,e){var s=e(7),c=e(16);a.exports=e(4)?function(d,p,f){return s.f(d,p,c(1,f))}:function(d,p,f){return d[p]=f,d}},function(a,t,e){var s=e(10),c=e(35),d=e(23),p=Object.defineProperty;t.f=e(4)?Object.defineProperty:function(f,h,S){if(s(f),h=d(h,!0),s(S),c)try{return p(f,h,S)}catch{}if("get"in S||"set"in S)throw TypeError("Accessors not supported!");return"value"in S&&(f[h]=S.value),f}},function(a,t){a.exports=function(e){try{return!!e()}catch{return!0}}},function(a,t,e){var s=e(40),c=e(22);a.exports=function(d){return s(c(d))}},function(a,t,e){var s=e(11);a.exports=function(c){if(!s(c))throw TypeError(c+" is not an object!");return c}},function(a,t){a.exports=function(e){return typeof e=="object"?e!==null:typeof e=="function"}},function(a,t){a.exports={}},function(a,t,e){var s=e(39),c=e(27);a.exports=Object.keys||function(d){return s(d,c)}},function(a,t){a.exports=!0},function(a,t,e){var s=e(3),c=e(1),d=e(53),p=e(6),f=e(5),h=function(S,b,w){var I,R,H,L=S&h.F,X=S&h.G,r=S&h.S,D=S&h.P,V=S&h.B,z=S&h.W,q=X?c:c[b]||(c[b]={}),k=q.prototype,A=X?s:r?s[b]:(s[b]||{}).prototype;for(I in X&&(w=b),w)(R=!L&&A&&A[I]!==void 0)&&f(q,I)||(H=R?A[I]:w[I],q[I]=X&&typeof A[I]!="function"?w[I]:V&&R?d(H,s):z&&A[I]==H?(function(T){var W=function(E,ee,J){if(this instanceof T){switch(arguments.length){case 0:return new T;case 1:return new T(E);case 2:return new T(E,ee)}return new T(E,ee,J)}return T.apply(this,arguments)};return W.prototype=T.prototype,W})(H):D&&typeof H=="function"?d(Function.call,H):H,D&&((q.virtual||(q.virtual={}))[I]=H,S&h.R&&k&&!k[I]&&p(k,I,H)))};h.F=1,h.G=2,h.S=4,h.P=8,h.B=16,h.W=32,h.U=64,h.R=128,a.exports=h},function(a,t){a.exports=function(e,s){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:s}}},function(a,t){var e=0,s=Math.random();a.exports=function(c){return"Symbol(".concat(c===void 0?"":c,")_",(++e+s).toString(36))}},function(a,t,e){var s=e(22);a.exports=function(c){return Object(s(c))}},function(a,t){t.f={}.propertyIsEnumerable},function(a,t,e){var s=e(52)(!0);e(34)(String,"String",(function(c){this._t=String(c),this._i=0}),(function(){var c,d=this._t,p=this._i;return p>=d.length?{value:void 0,done:!0}:(c=s(d,p),this._i+=c.length,{value:c,done:!1})}))},function(a,t){var e=Math.ceil,s=Math.floor;a.exports=function(c){return isNaN(c=+c)?0:(c>0?s:e)(c)}},function(a,t){a.exports=function(e){if(e==null)throw TypeError("Can't call method on "+e);return e}},function(a,t,e){var s=e(11);a.exports=function(c,d){if(!s(c))return c;var p,f;if(d&&typeof(p=c.toString)=="function"&&!s(f=p.call(c))||typeof(p=c.valueOf)=="function"&&!s(f=p.call(c))||!d&&typeof(p=c.toString)=="function"&&!s(f=p.call(c)))return f;throw TypeError("Can't convert object to primitive value")}},function(a,t){var e={}.toString;a.exports=function(s){return e.call(s).slice(8,-1)}},function(a,t,e){var s=e(26)("keys"),c=e(17);a.exports=function(d){return s[d]||(s[d]=c(d))}},function(a,t,e){var s=e(1),c=e(3),d=c["__core-js_shared__"]||(c["__core-js_shared__"]={});(a.exports=function(p,f){return d[p]||(d[p]=f!==void 0?f:{})})("versions",[]).push({version:s.version,mode:e(14)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(a,t){a.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(a,t,e){var s=e(7).f,c=e(5),d=e(2)("toStringTag");a.exports=function(p,f,h){p&&!c(p=h?p:p.prototype,d)&&s(p,d,{configurable:!0,value:f})}},function(a,t,e){e(62);for(var s=e(3),c=e(6),d=e(12),p=e(2)("toStringTag"),f="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),h=0;hdocument.F=Object<\/script>"),S.close(),h=S.F;w--;)delete h.prototype[d[w]];return h()};a.exports=Object.create||function(S,b){var w;return S!==null?(f.prototype=s(S),w=new f,f.prototype=null,w[p]=S):w=h(),b===void 0?w:c(w,b)}},function(a,t,e){var s=e(5),c=e(9),d=e(57)(!1),p=e(25)("IE_PROTO");a.exports=function(f,h){var S,b=c(f),w=0,I=[];for(S in b)S!=p&&s(b,S)&&I.push(S);for(;h.length>w;)s(b,S=h[w++])&&(~d(I,S)||I.push(S));return I}},function(a,t,e){var s=e(24);a.exports=Object("z").propertyIsEnumerable(0)?Object:function(c){return s(c)=="String"?c.split(""):Object(c)}},function(a,t,e){var s=e(39),c=e(27).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(d){return s(d,c)}},function(a,t,e){var s=e(24),c=e(2)("toStringTag"),d=s((function(){return arguments})())=="Arguments";a.exports=function(p){var f,h,S;return p===void 0?"Undefined":p===null?"Null":typeof(h=(function(b,w){try{return b[w]}catch{}})(f=Object(p),c))=="string"?h:d?s(f):(S=s(f))=="Object"&&typeof f.callee=="function"?"Arguments":S}},function(a,t){var e;e=(function(){return this})();try{e=e||new Function("return this")()}catch{typeof window=="object"&&(e=window)}a.exports=e},function(a,t){var e=/-?\d+(\.\d+)?%?/g;a.exports=function(s){return s.match(e)}},function(a,t,e){Object.defineProperty(t,"__esModule",{value:!0}),t.getBase16Theme=t.createStyling=t.invertTheme=void 0;var s=R(e(49)),c=R(e(76)),d=R(e(81)),p=R(e(89)),f=R(e(93)),h=(function(k){if(k&&k.__esModule)return k;var A={};if(k!=null)for(var T in k)Object.prototype.hasOwnProperty.call(k,T)&&(A[T]=k[T]);return A.default=k,A})(e(94)),S=R(e(132)),b=R(e(133)),w=R(e(138)),I=e(139);function R(k){return k&&k.__esModule?k:{default:k}}var H=h.default,L=(0,p.default)(H),X=(0,w.default)(b.default,I.rgb2yuv,(function(k){var A,T=(0,d.default)(k,3),W=T[0],E=T[1],ee=T[2];return[(A=W,A<.25?1:A<.5?.9-A:1.1-A),E,ee]}),I.yuv2rgb,S.default),r=function(k){return function(A){return{className:[A.className,k.className].filter(Boolean).join(" "),style:(0,c.default)({},A.style||{},k.style||{})}}},D=function(k,A){var T=(0,p.default)(A);for(var W in k)T.indexOf(W)===-1&&T.push(W);return T.reduce((function(E,ee){return E[ee]=(function(J,C){if(J===void 0)return C;if(C===void 0)return J;var Y=J===void 0?"undefined":(0,s.default)(J),be=C===void 0?"undefined":(0,s.default)(C);switch(Y){case"string":switch(be){case"string":return[C,J].filter(Boolean).join(" ");case"object":return r({className:J,style:C});case"function":return function(ce){for(var U=arguments.length,le=Array(U>1?U-1:0),Q=1;Q1?U-1:0),Q=1;Q1?U-1:0),Q=1;Q1?U-1:0),Q=1;Q1?U-1:0),Q=1;Q2?T-2:0),E=2;E3?A-3:0),W=3;W1&&arguments[1]!==void 0?arguments[1]:{},ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},J=E.defaultBase16,C=J===void 0?H:J,Y=E.base16Themes,be=Y===void 0?null:Y,ce=q(ee,be);ce&&(ee=(0,c.default)({},ce,ee));var U=L.reduce((function(ve,Ne){return ve[Ne]=ee[Ne]||C[Ne],ve}),{}),le=(0,p.default)(ee).reduce((function(ve,Ne){return L.indexOf(Ne)===-1&&(ve[Ne]=ee[Ne]),ve}),{}),Q=k(U),he=D(le,Q);return(0,f.default)(V,2).apply(void 0,[he].concat(T))}),3),t.getBase16Theme=function(k,A){if(k&&k.extend&&(k=k.extend),typeof k=="string"){var T=k.split(":"),W=(0,d.default)(T,2),E=W[0],ee=W[1];k=(A||{})[E]||h[E],ee==="inverted"&&(k=z(k))}return k&&k.hasOwnProperty("base00")?k:void 0})},function(a,t,e){var s,c=typeof Reflect=="object"?Reflect:null,d=c&&typeof c.apply=="function"?c.apply:function(r,D,V){return Function.prototype.apply.call(r,D,V)};s=c&&typeof c.ownKeys=="function"?c.ownKeys:Object.getOwnPropertySymbols?function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:function(r){return Object.getOwnPropertyNames(r)};var p=Number.isNaN||function(r){return r!=r};function f(){f.init.call(this)}a.exports=f,a.exports.once=function(r,D){return new Promise((function(V,z){function q(){k!==void 0&&r.removeListener("error",k),V([].slice.call(arguments))}var k;D!=="error"&&(k=function(A){r.removeListener(D,q),z(A)},r.once("error",k)),r.once(D,q)}))},f.EventEmitter=f,f.prototype._events=void 0,f.prototype._eventsCount=0,f.prototype._maxListeners=void 0;var h=10;function S(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}function b(r){return r._maxListeners===void 0?f.defaultMaxListeners:r._maxListeners}function w(r,D,V,z){var q,k,A,T;if(S(V),(k=r._events)===void 0?(k=r._events=Object.create(null),r._eventsCount=0):(k.newListener!==void 0&&(r.emit("newListener",D,V.listener?V.listener:V),k=r._events),A=k[D]),A===void 0)A=k[D]=V,++r._eventsCount;else if(typeof A=="function"?A=k[D]=z?[V,A]:[A,V]:z?A.unshift(V):A.push(V),(q=b(r))>0&&A.length>q&&!A.warned){A.warned=!0;var W=new Error("Possible EventEmitter memory leak detected. "+A.length+" "+String(D)+" listeners added. Use emitter.setMaxListeners() to increase limit");W.name="MaxListenersExceededWarning",W.emitter=r,W.type=D,W.count=A.length,T=W,console&&console.warn&&console.warn(T)}return r}function I(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function R(r,D,V){var z={fired:!1,wrapFn:void 0,target:r,type:D,listener:V},q=I.bind(z);return q.listener=V,z.wrapFn=q,q}function H(r,D,V){var z=r._events;if(z===void 0)return[];var q=z[D];return q===void 0?[]:typeof q=="function"?V?[q.listener||q]:[q]:V?(function(k){for(var A=new Array(k.length),T=0;T0&&(k=D[0]),k instanceof Error)throw k;var A=new Error("Unhandled error."+(k?" ("+k.message+")":""));throw A.context=k,A}var T=q[r];if(T===void 0)return!1;if(typeof T=="function")d(T,this,D);else{var W=T.length,E=X(T,W);for(V=0;V=0;k--)if(V[k]===D||V[k].listener===D){A=V[k].listener,q=k;break}if(q<0)return this;q===0?V.shift():(function(T,W){for(;W+1=0;z--)this.removeListener(r,D[z]);return this},f.prototype.listeners=function(r){return H(this,r,!0)},f.prototype.rawListeners=function(r){return H(this,r,!1)},f.listenerCount=function(r,D){return typeof r.listenerCount=="function"?r.listenerCount(D):L.call(r,D)},f.prototype.listenerCount=L,f.prototype.eventNames=function(){return this._eventsCount>0?s(this._events):[]}},function(a,t,e){a.exports.Dispatcher=e(140)},function(a,t,e){a.exports=e(142)},function(a,t,e){t.__esModule=!0;var s=p(e(50)),c=p(e(65)),d=typeof c.default=="function"&&typeof s.default=="symbol"?function(f){return typeof f}:function(f){return f&&typeof c.default=="function"&&f.constructor===c.default&&f!==c.default.prototype?"symbol":typeof f};function p(f){return f&&f.__esModule?f:{default:f}}t.default=typeof c.default=="function"&&d(s.default)==="symbol"?function(f){return f===void 0?"undefined":d(f)}:function(f){return f&&typeof c.default=="function"&&f.constructor===c.default&&f!==c.default.prototype?"symbol":f===void 0?"undefined":d(f)}},function(a,t,e){a.exports={default:e(51),__esModule:!0}},function(a,t,e){e(20),e(29),a.exports=e(30).f("iterator")},function(a,t,e){var s=e(21),c=e(22);a.exports=function(d){return function(p,f){var h,S,b=String(c(p)),w=s(f),I=b.length;return w<0||w>=I?d?"":void 0:(h=b.charCodeAt(w))<55296||h>56319||w+1===I||(S=b.charCodeAt(w+1))<56320||S>57343?d?b.charAt(w):h:d?b.slice(w,w+2):S-56320+(h-55296<<10)+65536}}},function(a,t,e){var s=e(54);a.exports=function(c,d,p){if(s(c),d===void 0)return c;switch(p){case 1:return function(f){return c.call(d,f)};case 2:return function(f,h){return c.call(d,f,h)};case 3:return function(f,h,S){return c.call(d,f,h,S)}}return function(){return c.apply(d,arguments)}}},function(a,t){a.exports=function(e){if(typeof e!="function")throw TypeError(e+" is not a function!");return e}},function(a,t,e){var s=e(38),c=e(16),d=e(28),p={};e(6)(p,e(2)("iterator"),(function(){return this})),a.exports=function(f,h,S){f.prototype=s(p,{next:c(1,S)}),d(f,h+" Iterator")}},function(a,t,e){var s=e(7),c=e(10),d=e(13);a.exports=e(4)?Object.defineProperties:function(p,f){c(p);for(var h,S=d(f),b=S.length,w=0;b>w;)s.f(p,h=S[w++],f[h]);return p}},function(a,t,e){var s=e(9),c=e(58),d=e(59);a.exports=function(p){return function(f,h,S){var b,w=s(f),I=c(w.length),R=d(S,I);if(p&&h!=h){for(;I>R;)if((b=w[R++])!=b)return!0}else for(;I>R;R++)if((p||R in w)&&w[R]===h)return p||R||0;return!p&&-1}}},function(a,t,e){var s=e(21),c=Math.min;a.exports=function(d){return d>0?c(s(d),9007199254740991):0}},function(a,t,e){var s=e(21),c=Math.max,d=Math.min;a.exports=function(p,f){return(p=s(p))<0?c(p+f,0):d(p,f)}},function(a,t,e){var s=e(3).document;a.exports=s&&s.documentElement},function(a,t,e){var s=e(5),c=e(18),d=e(25)("IE_PROTO"),p=Object.prototype;a.exports=Object.getPrototypeOf||function(f){return f=c(f),s(f,d)?f[d]:typeof f.constructor=="function"&&f instanceof f.constructor?f.constructor.prototype:f instanceof Object?p:null}},function(a,t,e){var s=e(63),c=e(64),d=e(12),p=e(9);a.exports=e(34)(Array,"Array",(function(f,h){this._t=p(f),this._i=0,this._k=h}),(function(){var f=this._t,h=this._k,S=this._i++;return!f||S>=f.length?(this._t=void 0,c(1)):c(0,h=="keys"?S:h=="values"?f[S]:[S,f[S]])}),"values"),d.Arguments=d.Array,s("keys"),s("values"),s("entries")},function(a,t){a.exports=function(){}},function(a,t){a.exports=function(e,s){return{value:s,done:!!e}}},function(a,t,e){a.exports={default:e(66),__esModule:!0}},function(a,t,e){e(67),e(73),e(74),e(75),a.exports=e(1).Symbol},function(a,t,e){var s=e(3),c=e(5),d=e(4),p=e(15),f=e(37),h=e(68).KEY,S=e(8),b=e(26),w=e(28),I=e(17),R=e(2),H=e(30),L=e(31),X=e(69),r=e(70),D=e(10),V=e(11),z=e(18),q=e(9),k=e(23),A=e(16),T=e(38),W=e(71),E=e(72),ee=e(32),J=e(7),C=e(13),Y=E.f,be=J.f,ce=W.f,U=s.Symbol,le=s.JSON,Q=le&&le.stringify,he=R("_hidden"),ve=R("toPrimitive"),Ne={}.propertyIsEnumerable,Ee=b("symbol-registry"),Oe=b("symbols"),fe=b("op-symbols"),ge=Object.prototype,De=typeof U=="function"&&!!ee.f,Ue=s.QObject,Xe=!Ue||!Ue.prototype||!Ue.prototype.findChild,et=d&&S((function(){return T(be({},"a",{get:function(){return be(this,"a",{value:7}).a}})).a!=7}))?function(j,N,B){var K=Y(ge,N);K&&delete ge[N],be(j,N,B),K&&j!==ge&&be(ge,N,K)}:be,tt=function(j){var N=Oe[j]=T(U.prototype);return N._k=j,N},at=De&&typeof U.iterator=="symbol"?function(j){return typeof j=="symbol"}:function(j){return j instanceof U},He=function(j,N,B){return j===ge&&He(fe,N,B),D(j),N=k(N,!0),D(B),c(Oe,N)?(B.enumerable?(c(j,he)&&j[he][N]&&(j[he][N]=!1),B=T(B,{enumerable:A(0,!1)})):(c(j,he)||be(j,he,A(1,{})),j[he][N]=!0),et(j,N,B)):be(j,N,B)},st=function(j,N){D(j);for(var B,K=X(N=q(N)),re=0,te=K.length;te>re;)He(j,B=K[re++],N[B]);return j},ot=function(j){var N=Ne.call(this,j=k(j,!0));return!(this===ge&&c(Oe,j)&&!c(fe,j))&&(!(N||!c(this,j)||!c(Oe,j)||c(this,he)&&this[he][j])||N)},rt=function(j,N){if(j=q(j),N=k(N,!0),j!==ge||!c(Oe,N)||c(fe,N)){var B=Y(j,N);return!B||!c(Oe,N)||c(j,he)&&j[he][N]||(B.enumerable=!0),B}},it=function(j){for(var N,B=ce(q(j)),K=[],re=0;B.length>re;)c(Oe,N=B[re++])||N==he||N==h||K.push(N);return K},Ge=function(j){for(var N,B=j===ge,K=ce(B?fe:q(j)),re=[],te=0;K.length>te;)!c(Oe,N=K[te++])||B&&!c(ge,N)||re.push(Oe[N]);return re};De||(f((U=function(){if(this instanceof U)throw TypeError("Symbol is not a constructor!");var j=I(arguments.length>0?arguments[0]:void 0),N=function(B){this===ge&&N.call(fe,B),c(this,he)&&c(this[he],j)&&(this[he][j]=!1),et(this,j,A(1,B))};return d&&Xe&&et(ge,j,{configurable:!0,set:N}),tt(j)}).prototype,"toString",(function(){return this._k})),E.f=rt,J.f=He,e(41).f=W.f=it,e(19).f=ot,ee.f=Ge,d&&!e(14)&&f(ge,"propertyIsEnumerable",ot,!0),H.f=function(j){return tt(R(j))}),p(p.G+p.W+p.F*!De,{Symbol:U});for(var Ve="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),Ce=0;Ve.length>Ce;)R(Ve[Ce++]);for(var nt=C(R.store),F=0;nt.length>F;)L(nt[F++]);p(p.S+p.F*!De,"Symbol",{for:function(j){return c(Ee,j+="")?Ee[j]:Ee[j]=U(j)},keyFor:function(j){if(!at(j))throw TypeError(j+" is not a symbol!");for(var N in Ee)if(Ee[N]===j)return N},useSetter:function(){Xe=!0},useSimple:function(){Xe=!1}}),p(p.S+p.F*!De,"Object",{create:function(j,N){return N===void 0?T(j):st(T(j),N)},defineProperty:He,defineProperties:st,getOwnPropertyDescriptor:rt,getOwnPropertyNames:it,getOwnPropertySymbols:Ge});var x=S((function(){ee.f(1)}));p(p.S+p.F*x,"Object",{getOwnPropertySymbols:function(j){return ee.f(z(j))}}),le&&p(p.S+p.F*(!De||S((function(){var j=U();return Q([j])!="[null]"||Q({a:j})!="{}"||Q(Object(j))!="{}"}))),"JSON",{stringify:function(j){for(var N,B,K=[j],re=1;arguments.length>re;)K.push(arguments[re++]);if(B=N=K[1],(V(N)||j!==void 0)&&!at(j))return r(N)||(N=function(te,ue){if(typeof B=="function"&&(ue=B.call(this,te,ue)),!at(ue))return ue}),K[1]=N,Q.apply(le,K)}}),U.prototype[ve]||e(6)(U.prototype,ve,U.prototype.valueOf),w(U,"Symbol"),w(Math,"Math",!0),w(s.JSON,"JSON",!0)},function(a,t,e){var s=e(17)("meta"),c=e(11),d=e(5),p=e(7).f,f=0,h=Object.isExtensible||function(){return!0},S=!e(8)((function(){return h(Object.preventExtensions({}))})),b=function(I){p(I,s,{value:{i:"O"+ ++f,w:{}}})},w=a.exports={KEY:s,NEED:!1,fastKey:function(I,R){if(!c(I))return typeof I=="symbol"?I:(typeof I=="string"?"S":"P")+I;if(!d(I,s)){if(!h(I))return"F";if(!R)return"E";b(I)}return I[s].i},getWeak:function(I,R){if(!d(I,s)){if(!h(I))return!0;if(!R)return!1;b(I)}return I[s].w},onFreeze:function(I){return S&&w.NEED&&h(I)&&!d(I,s)&&b(I),I}}},function(a,t,e){var s=e(13),c=e(32),d=e(19);a.exports=function(p){var f=s(p),h=c.f;if(h)for(var S,b=h(p),w=d.f,I=0;b.length>I;)w.call(p,S=b[I++])&&f.push(S);return f}},function(a,t,e){var s=e(24);a.exports=Array.isArray||function(c){return s(c)=="Array"}},function(a,t,e){var s=e(9),c=e(41).f,d={}.toString,p=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];a.exports.f=function(f){return p&&d.call(f)=="[object Window]"?(function(h){try{return c(h)}catch{return p.slice()}})(f):c(s(f))}},function(a,t,e){var s=e(19),c=e(16),d=e(9),p=e(23),f=e(5),h=e(35),S=Object.getOwnPropertyDescriptor;t.f=e(4)?S:function(b,w){if(b=d(b),w=p(w,!0),h)try{return S(b,w)}catch{}if(f(b,w))return c(!s.f.call(b,w),b[w])}},function(a,t){},function(a,t,e){e(31)("asyncIterator")},function(a,t,e){e(31)("observable")},function(a,t,e){t.__esModule=!0;var s,c=e(77),d=(s=c)&&s.__esModule?s:{default:s};t.default=d.default||function(p){for(var f=1;fH;)for(var r,D=h(arguments[H++]),V=L?c(D).concat(L(D)):c(D),z=V.length,q=0;z>q;)r=V[q++],s&&!X.call(D,r)||(I[r]=D[r]);return I}:S},function(a,t,e){t.__esModule=!0;var s=d(e(82)),c=d(e(85));function d(p){return p&&p.__esModule?p:{default:p}}t.default=function(p,f){if(Array.isArray(p))return p;if((0,s.default)(Object(p)))return(function(h,S){var b=[],w=!0,I=!1,R=void 0;try{for(var H,L=(0,c.default)(h);!(w=(H=L.next()).done)&&(b.push(H.value),!S||b.length!==S);w=!0);}catch(X){I=!0,R=X}finally{try{!w&&L.return&&L.return()}finally{if(I)throw R}}return b})(p,f);throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(a,t,e){a.exports={default:e(83),__esModule:!0}},function(a,t,e){e(29),e(20),a.exports=e(84)},function(a,t,e){var s=e(42),c=e(2)("iterator"),d=e(12);a.exports=e(1).isIterable=function(p){var f=Object(p);return f[c]!==void 0||"@@iterator"in f||d.hasOwnProperty(s(f))}},function(a,t,e){a.exports={default:e(86),__esModule:!0}},function(a,t,e){e(29),e(20),a.exports=e(87)},function(a,t,e){var s=e(10),c=e(88);a.exports=e(1).getIterator=function(d){var p=c(d);if(typeof p!="function")throw TypeError(d+" is not iterable!");return s(p.call(d))}},function(a,t,e){var s=e(42),c=e(2)("iterator"),d=e(12);a.exports=e(1).getIteratorMethod=function(p){if(p!=null)return p[c]||p["@@iterator"]||d[s(p)]}},function(a,t,e){a.exports={default:e(90),__esModule:!0}},function(a,t,e){e(91),a.exports=e(1).Object.keys},function(a,t,e){var s=e(18),c=e(13);e(92)("keys",(function(){return function(d){return c(s(d))}}))},function(a,t,e){var s=e(15),c=e(1),d=e(8);a.exports=function(p,f){var h=(c.Object||{})[p]||Object[p],S={};S[p]=f(h),s(s.S+s.F*d((function(){h(1)})),"Object",S)}},function(a,t,e){(function(s){var c=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],d=/^\s+|\s+$/g,p=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,f=/\{\n\/\* \[wrapped with (.+)\] \*/,h=/,? & /,S=/^[-+]0x[0-9a-f]+$/i,b=/^0b[01]+$/i,w=/^\[object .+?Constructor\]$/,I=/^0o[0-7]+$/i,R=/^(?:0|[1-9]\d*)$/,H=parseInt,L=typeof s=="object"&&s&&s.Object===Object&&s,X=typeof self=="object"&&self&&self.Object===Object&&self,r=L||X||Function("return this")();function D(F,x,j){switch(j.length){case 0:return F.call(x);case 1:return F.call(x,j[0]);case 2:return F.call(x,j[0],j[1]);case 3:return F.call(x,j[0],j[1],j[2])}return F.apply(x,j)}function V(F,x){return!!(F&&F.length)&&(function(j,N,B){if(N!=N)return(function(te,ue,ye,xe){for(var Ie=te.length,me=ye+-1;++me-1}function z(F){return F!=F}function q(F,x){for(var j=F.length,N=0;j--;)F[j]===x&&N++;return N}function k(F,x){for(var j=-1,N=F.length,B=0,K=[];++j2?T:void 0);function Ne(F){return Ve(F)?le(F):{}}function Ee(F){return!(!Ve(F)||(function(x){return!!C&&C in x})(F))&&((function(x){var j=Ve(x)?ce.call(x):"";return j=="[object Function]"||j=="[object GeneratorFunction]"})(F)||(function(x){var j=!1;if(x!=null&&typeof x.toString!="function")try{j=!!(x+"")}catch{}return j})(F)?U:w).test((function(x){if(x!=null){try{return Y.call(x)}catch{}try{return x+""}catch{}}return""})(F))}function Oe(F,x,j,N){for(var B=-1,K=F.length,re=j.length,te=-1,ue=x.length,ye=Q(K-re,0),xe=Array(ue+ye),Ie=!N;++te1&&se.reverse(),xe&&ue1?"& ":"")+x[N],x=x.join(j>2?", ":" "),F.replace(p,`{ /* [wrapped with `+x+`] */ `)}function st(F,x){return!!(x=x??9007199254740991)&&(typeof F=="number"||R.test(F))&&F>-1&&F%1==0&&F1&&d--,f=6*d<1?s+6*(c-s)*d:2*d<1?c:3*d<2?s+(c-s)*(2/3-d)*6:s,p[w]=255*f;return p}},function(a,t,e){(function(s){var c=typeof s=="object"&&s&&s.Object===Object&&s,d=typeof self=="object"&&self&&self.Object===Object&&self,p=c||d||Function("return this")();function f(k,A,T){switch(T.length){case 0:return k.call(A);case 1:return k.call(A,T[0]);case 2:return k.call(A,T[0],T[1]);case 3:return k.call(A,T[0],T[1],T[2])}return k.apply(A,T)}function h(k,A){for(var T=-1,W=A.length,E=k.length;++T-1&&E%1==0&&E<=9007199254740991})(W.length)&&!(function(E){var ee=(function(J){var C=typeof J;return!!J&&(C=="object"||C=="function")})(E)?w.call(E):"";return ee=="[object Function]"||ee=="[object GeneratorFunction]"})(W)})(T)})(A)&&b.call(A,"callee")&&(!R.call(A,"callee")||w.call(A)=="[object Arguments]")})(k)||!!(H&&k&&k[H])}var r=Array.isArray,D,V,z,q=(V=function(k){var A=(k=(function(E,ee,J,C,Y){var be=-1,ce=E.length;for(J||(J=X),Y||(Y=[]);++be2?d-2:0),f=2;f"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch{return!1}})();return function(){var n,o=w(l);if(u){var i=w(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return H(this,n)}}e.r(t);var X=e(0),r=e.n(X);function D(){var l=this.constructor.getDerivedStateFromProps(this.props,this.state);l!=null&&this.setState(l)}function V(l){this.setState(function(u){var n=this.constructor.getDerivedStateFromProps(l,u);return n??null}.bind(this))}function z(l,u){try{var n=this.props,o=this.state;this.props=l,this.state=u,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,o)}finally{this.props=n,this.state=o}}function q(l){var u=l.prototype;if(!u||!u.isReactComponent)throw new Error("Can only polyfill class components");if(typeof l.getDerivedStateFromProps!="function"&&typeof u.getSnapshotBeforeUpdate!="function")return l;var n=null,o=null,i=null;if(typeof u.componentWillMount=="function"?n="componentWillMount":typeof u.UNSAFE_componentWillMount=="function"&&(n="UNSAFE_componentWillMount"),typeof u.componentWillReceiveProps=="function"?o="componentWillReceiveProps":typeof u.UNSAFE_componentWillReceiveProps=="function"&&(o="UNSAFE_componentWillReceiveProps"),typeof u.componentWillUpdate=="function"?i="componentWillUpdate":typeof u.UNSAFE_componentWillUpdate=="function"&&(i="UNSAFE_componentWillUpdate"),n!==null||o!==null||i!==null){var y=l.displayName||l.name,O=typeof l.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs. diff --git a/admin/assets/index-_UYoIw1I.js b/admin/assets/index-_UYoIw1I.js new file mode 100644 index 000000000..a144af44f --- /dev/null +++ b/admin/assets/index-_UYoIw1I.js @@ -0,0 +1,1234 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-vgcfJH38.js","./createSvgIcon-DPvF8xqu.js","./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js","./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js","./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js","./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js","./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js","./index-C49cpVll.js","./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js","./preload-helper-BDBacUwf.js","./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js","./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js","./inheritsLoose-B0Ba5G9z.js","./index-BCK6q-N6.css","./index-DnqTM0A3.js","./ScriptEditorVanillaMonaco-DSYvOslZ.js","./ScriptEditor-C-fO5h68.js","./Save-Cld9qv9i.js","./OpenAiDialog-DibIpG1Q.js","./index-gIA8x-8f.js"])))=>i.map(i=>d[i]); +import{d as Zy}from"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js";import{j as m,c as $t,g as Tw,r as Sw,_ as Sg,i as Qy}from"./createSvgIcon-DPvF8xqu.js";import{r as DT}from"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js";import{a as _e,_ as AT,b as Ko,c as Lt,d as OT,e as Ew,f as Eg,g as lm,h as cm,i as um,j as kt,k as xn,l as us,m as ia,n as Iw,o as Ig,p as RT,q as NT,r as xw,s as MT,t as _n}from"./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js";import{_ as Ut,a as ss,b as qt,c as Eo,d as Di,e as xg,f as Ai,g as it,h as Ht,i as He,j as Xl,k as Zl,l as Ql,m as ec,n as tc,o as qe,p as Dw,q as Si,r as Dg,s as e_,t as Ag,u as Og,v as Pn,w as Aw,x as LT,y as dm,z as wt,A as PT,B as t_,C as BT,D as qp,E as wc,F as FT,G as jT,H as zT,I as UT,J as Ow,K as HT,L as WT,M as s_,N as wn,O as GT,P as VT,Q as KT,R as YT,S as JT,T as Rw,U as qT,V as Rg,W as Nw,X as XT}from"./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js";import{_ as x}from"./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js";import{I as qo,a as so,b as mc,C as ZT,c as Mw,F as QT,d as eS,e as kc,f as Ng,g as tS,h as sS,i as oS,j as iS,M as nS,k as rS,l as aS,m as lS,_ as cS,n as sc,o as uS,p as dS,q as oc,r as o_,s as hS,t as pS,u as gS,v as mS,w as i_,x as Yc,y as fS,z as $S,A as bS,B as vS,D as yS,E as _S,G as wS,H as Lw,J as Pw,K as Bw,L as kS,N as CS,O as TS,P as SS,Q as ES,R as IS}from"./index-C49cpVll.js";import{y as xS,_ as DS,a as AS,m as OS,S as n_,T as r_}from"./inheritsLoose-B0Ba5G9z.js";import{c as eo}from"./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js";function Xo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}import{_ as jn}from"./preload-helper-BDBacUwf.js";import{P as ke}from"./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js";import{_ as RS}from"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();var Fw,a_=DT;Fw=a_.createRoot,a_.hydrateRoot;var jw={exports:{}},ht={};var Jc=60103,qc=60106,na=60107,ra=60108,aa=60114,la=60109,ca=60110,ua=60112,da=60113,hm=60120,ha=60115,pa=60116,zw=60121,Uw=60122,Hw=60117,Ww=60129,Gw=60131;if(typeof Symbol=="function"&&Symbol.for){var Nt=Symbol.for;Jc=Nt("react.element"),qc=Nt("react.portal"),na=Nt("react.fragment"),ra=Nt("react.strict_mode"),aa=Nt("react.profiler"),la=Nt("react.provider"),ca=Nt("react.context"),ua=Nt("react.forward_ref"),da=Nt("react.suspense"),hm=Nt("react.suspense_list"),ha=Nt("react.memo"),pa=Nt("react.lazy"),zw=Nt("react.block"),Uw=Nt("react.server.block"),Hw=Nt("react.fundamental"),Ww=Nt("react.debug_trace_mode"),Gw=Nt("react.legacy_hidden")}function Ms(a){if(typeof a=="object"&&a!==null){var s=a.$$typeof;switch(s){case Jc:switch(a=a.type,a){case na:case aa:case ra:case da:case hm:return a;default:switch(a=a&&a.$$typeof,a){case ca:case ua:case pa:case ha:case la:return a;default:return s}}case qc:return s}}}var NS=la,MS=Jc,LS=ua,PS=na,BS=pa,FS=ha,jS=qc,zS=aa,US=ra,HS=da;ht.ContextConsumer=ca;ht.ContextProvider=NS;ht.Element=MS;ht.ForwardRef=LS;ht.Fragment=PS;ht.Lazy=BS;ht.Memo=FS;ht.Portal=jS;ht.Profiler=zS;ht.StrictMode=US;ht.Suspense=HS;ht.isAsyncMode=function(){return!1};ht.isConcurrentMode=function(){return!1};ht.isContextConsumer=function(a){return Ms(a)===ca};ht.isContextProvider=function(a){return Ms(a)===la};ht.isElement=function(a){return typeof a=="object"&&a!==null&&a.$$typeof===Jc};ht.isForwardRef=function(a){return Ms(a)===ua};ht.isFragment=function(a){return Ms(a)===na};ht.isLazy=function(a){return Ms(a)===pa};ht.isMemo=function(a){return Ms(a)===ha};ht.isPortal=function(a){return Ms(a)===qc};ht.isProfiler=function(a){return Ms(a)===aa};ht.isStrictMode=function(a){return Ms(a)===ra};ht.isSuspense=function(a){return Ms(a)===da};ht.isValidElementType=function(a){return typeof a=="string"||typeof a=="function"||a===na||a===aa||a===Ww||a===ra||a===da||a===hm||a===Gw||typeof a=="object"&&a!==null&&(a.$$typeof===pa||a.$$typeof===ha||a.$$typeof===la||a.$$typeof===ca||a.$$typeof===ua||a.$$typeof===Hw||a.$$typeof===zw||a[0]===Uw)};ht.typeOf=Ms;jw.exports=ht;var WS=jw.exports;function Cc(a,s){const i=getComputedStyle(s);if(!i)return;let r=a===ft.Horizontal?s.clientWidth:s.clientHeight;return r!==0?(a===ft.Horizontal?r-=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight):r-=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom),r):void 0}function ic(a,s,i=[],r={condition:!0}){const{condition:l}=r,c=(function(d,h){var p={};for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&h.indexOf(f)<0&&(p[f]=d[f]);if(d!=null&&typeof Object.getOwnPropertySymbols=="function"){var b=0;for(f=Object.getOwnPropertySymbols(d);b(l&&window.addEventListener(a,s,c),()=>{l&&window.removeEventListener(a,s)})),[a,s,l,...i])}(function(a,s){s===void 0&&(s={});var i=s.insertAt;if(typeof document<"u"){var r=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css",i==="top"&&r.firstChild?r.insertBefore(l,r.firstChild):r.appendChild(l),l.styleSheet?l.styleSheet.cssText=a:l.appendChild(document.createTextNode(a))}})(`/* === Main Container === */ +.__dbk__container { + height: 100%; + width: 100%; + + display: flex; + overflow: hidden; +} + +.__dbk__container.Horizontal { + flex-direction: row; +} + +.__dbk__container.Vertical { + flex-direction: column; +} +/* ====== */ + +/* === Wrapper for each child element === */ +.__dbk__child-wrapper { + height: 100%; + width: 100%; +} +/* ====== */ + +/* === Gutter === */ +.__dbk__gutter { + display: flex; + align-items: center; + justify-content: center; +} +/* .__dbk__gutter > div { + background: red; +} */ +.__dbk__gutter.Horizontal { + height: 100%; + padding: 0 2px; + flex-direction: column; +} +.__dbk__gutter.Horizontal:hover { + cursor: col-resize; +} + +.__dbk__gutter.Vertical { + width: 100%; + padding: 2px 0; + flex-direction: row; +} +.__dbk__gutter.Vertical:hover { + cursor: row-resize; +} + +.__dbk__gutter.Light { + background: #EDF0EF; +} +.__dbk__gutter.Light:hover > .__dbk__dragger { + background: #76747B; +} + +.__dbk__gutter.Dark { + background: #020203; +} +.__dbk__gutter.Dark:hover > .__dbk__dragger { + background: #9995A3; +} +/* ====== */ + +/* === Gutter's Dragger === */ +.__dbk__dragger { + border-radius: 2px; +} + +.__dbk__dragger.Horizontal { + width: 4px; + height: 24px; +} + +.__dbk__dragger.Vertical { + width: 24px; + height: 4px; +} + +.__dbk__dragger.Light { + background: #A6ACB5; +} + +.__dbk__dragger.Dark { + background: #434252; +} +/* ====== */`);const GS=_e.forwardRef((({className:a,theme:s,draggerClassName:i,direction:r=ft.Vertical,onDragging:l},c)=>{const d=`__dbk__gutter ${r} ${a||s}`,h=`__dbk__dragger ${r} ${i||s}`;return m.jsx("div",Object.assign({className:d,ref:c,dir:r,onMouseDown:l,onTouchStart:fc?l:void 0},{children:m.jsx("div",{className:h},void 0)}),void 0)}));var ws;function Mg(a,s,i){let r,l;return s?(r=a/2,l=a):i?(r=a,l=a/2):(r=a,l=a),{aGutterSize:r,bGutterSize:l}}function VS(a,s){switch(s.type){case ws.SetIsReadyToCompute:return Object.assign(Object.assign({},a),{isReady:s.payload.isReady});case ws.CreatePairs:{const{direction:i,children:r,gutters:l}=s.payload,c=r[0].parentNode;if(!c)throw new Error("Cannot create pairs - parent is undefined.");const d=Cc(i,c);if(d===void 0)throw new Error(`Cannot create pairs - parent has undefined or zero size: ${d}.`);const h=[];return r.forEach(((p,f)=>{if(f>0){const b=r[f-1],y=r[f],w=l[f-1],v=i===ft.Horizontal?b.getBoundingClientRect().left:b.getBoundingClientRect().top,_=i===ft.Horizontal?y.getBoundingClientRect().right:y.getBoundingClientRect().bottom,$=i===ft.Horizontal?b.getBoundingClientRect().width+w.getBoundingClientRect().width+y.getBoundingClientRect().width:b.getBoundingClientRect().height+w.getBoundingClientRect().height+y.getBoundingClientRect().height,S=i===ft.Horizontal?w.getBoundingClientRect().width:w.getBoundingClientRect().height,T={idx:f-1,a:b,b:y,gutter:w,parent:c,start:v,end:_,size:$,gutterSize:S,aSizePct:100/r.length,bSizePct:100/r.length};h.push(T)}})),Object.assign(Object.assign({},a),{pairs:h})}case ws.StartDragging:{const{gutterIdx:i}=s.payload;return Object.assign(Object.assign({},a),{isDragging:!0,draggingIdx:i})}case ws.StopDragging:return Object.assign(Object.assign({},a),{isDragging:!1});case ws.CalculateSizes:{const{direction:i,gutterIdx:r}=s.payload,l=a.pairs[r],c=Cc(i,l.parent);if(!c)throw new Error("Cannot calculate sizes - 'pair.parent' has undefined or zero size.");const d=l.gutter[i===ft.Horizontal?"clientWidth":"clientHeight"],h=r===0,p=r===a.pairs.length-1,{aGutterSize:f,bGutterSize:b}=Mg(d,h,p);let y,w,v,_,$;return i===ft.Horizontal?(y=l.a.getBoundingClientRect().left,w=l.b.getBoundingClientRect().right,_=(l.a.getBoundingClientRect().width+f)/c*100,$=(l.b.getBoundingClientRect().width+b)/c*100,v=l.a.getBoundingClientRect().width+f+b+l.b.getBoundingClientRect().width):(y=l.a.getBoundingClientRect().top,w=l.b.getBoundingClientRect().bottom,_=(l.a.getBoundingClientRect().height+f)/c*100,$=(l.b.getBoundingClientRect().height+b)/c*100,v=l.a.getBoundingClientRect().height+f+b+l.b.getBoundingClientRect().height),a.pairs[r]=Object.assign(Object.assign({},l),{start:y,end:w,size:v,aSizePct:_,bSizePct:$,gutterSize:d}),Object.assign({},a)}default:return a}}function Vw(a,s=0,i=[]){return OT.toArray(a).reduce(((r,l,c)=>(WS.isFragment(l)?r.push.apply(r,Vw(l.props.children,s+1,i.concat(l.key||c))):Ew(l)?r.push(Eg(l,{key:i.concat(String(l.key)).join(".")})):typeof l!="string"&&typeof l!="number"||r.push(l),r)),[])}(function(a){a[a.SetIsReadyToCompute=0]="SetIsReadyToCompute",a[a.CreatePairs=1]="CreatePairs",a[a.CalculateSizes=2]="CalculateSizes",a[a.StartDragging=3]="StartDragging",a[a.StopDragging=4]="StopDragging"})(ws||(ws={}));const l_=a=>"changedTouches"in a;var ft,Lg;(function(a){a.Horizontal="Horizontal",a.Vertical="Vertical"})(ft||(ft={})),(function(a){a.Light="Light",a.Dark="Dark"})(Lg||(Lg={}));const fc=typeof window<"u"&&"ontouchstart"in window;function Xp(a){return a===ft.Horizontal?"col-resize":"row-resize"}const KS={isReady:!1,isDragging:!1,pairs:[]};function c_({direction:a=ft.Horizontal,minWidths:s=[],minHeights:i=[],initialSizes:r,gutterTheme:l=Lg.Dark,gutterClassName:c,draggerClassName:d,children:h,onResizeStarted:p,onResizeFinished:f,classes:b=[]}){const y=Vw(h),[w,v]=AT(VS,KS),_=Ko(null),$=Ko([]),S=Ko([]);$.current=[],S.current=[];const T=_e.useCallback((R=>{v({type:ws.SetIsReadyToCompute,payload:{isReady:R}})}),[]),E=_e.useCallback(((R,K)=>{v({type:ws.StartDragging,payload:{gutterIdx:K}});const C=w.pairs[K];p==null||p(C.idx),C.a.style.userSelect="none",C.b.style.userSelect="none",C.gutter.style.cursor=Xp(R),C.parent.style.cursor=Xp(R),document.body.style.cursor=Xp(R)}),[w.pairs]),D=_e.useCallback((()=>{v({type:ws.StopDragging});const R=[];for(let C=0;C{v({type:ws.CalculateSizes,payload:{direction:R,gutterIdx:K}})}),[]),P=_e.useCallback(((R,K,C)=>{v({type:ws.CreatePairs,payload:{direction:R,children:K,gutters:C}})}),[]),W=_e.useCallback(((R,K,C,Q)=>{const ve=K[0].parentNode;if(!ve)throw new Error("Cannot set initial sizes - parent is undefined");if(Cc(R,ve)===void 0)throw new Error("Cannot set initial sizes - parent has undefined size");K.forEach(((ce,ne)=>{const me=ne===0,re=ne===K.length-1;let B,N=0;K.length>1&&(N=C[re?ne-1:ne].getBoundingClientRect()[R===ft.Horizontal?"width":"height"],N=me||re?N/2:N),B=Q&&ne{if(w.draggingIdx===void 0)throw new Error("Cannot adjust size - 'draggingIdx' is undefined");const C=w.pairs[w.draggingIdx];if(C.size===void 0)throw new Error("Cannot adjust size - 'pair.size' is undefined");if(C.gutterSize===void 0)throw new Error("Cannot adjust size - 'pair.gutterSize' is undefined");const Q=C.aSizePct+C.bSizePct,ve=K/C.size*Q,ce=Q-K/C.size*Q,ne=w.draggingIdx===0,me=w.draggingIdx===w.pairs.length-1,{aGutterSize:re,bGutterSize:B}=Mg(C.gutterSize,ne,me),N=`calc(${ve}% - ${re}px)`,te=`calc(${ce}% - ${B}px)`;R===ft.Horizontal?(C.a.style.width=N,C.b.style.width=te):(C.a.style.height=N,C.b.style.height=te)}),[w.draggingIdx,w.pairs,a]),z=_e.useCallback(((R,K,C)=>{if(!w.isDragging)return;if(w.draggingIdx===void 0)throw new Error("Cannot drag - 'draggingIdx' is undefined");const Q=w.pairs[w.draggingIdx];if(Q.start===void 0)throw new Error("Cannot drag - 'pair.start' is undefined");if(Q.size===void 0)throw new Error("Cannot drag - 'pair.size' is undefined");if(Q.gutterSize===void 0)throw new Error("Cannot drag - 'pair.gutterSize' is undefined");let ve=(function(me,re){const B=l_(re)?re.changedTouches[0]:re;return me===ft.Horizontal?B.clientX:B.clientY})(K,R)-Q.start,ce=16,ne=16;C.length>w.draggingIdx&&(ce=C[w.draggingIdx]),C.length>=w.draggingIdx+1&&(ne=C[w.draggingIdx+1]),ve=Q.size-(Q.gutterSize+ne)&&(ve=Q.size-(Q.gutterSize+ne)),G(K,ve)}),[w.isDragging,w.draggingIdx,w.pairs,G]),Z=()=>{if(w.isDragging){if(w.draggingIdx===void 0)throw new Error("Cannot calculate sizes after dragging = 'state.draggingIdx' is undefined");M(a,w.draggingIdx),D()}},he=R=>{w.isDragging&&(l_(R)&&R.preventDefault(),z(R,a,a===ft.Horizontal?s:i))};function Ce(R,K){if(!R.current)throw new Error("Can't add element to ref object - ref isn't initialized");K&&!R.current.includes(K)&&R.current.push(K)}return ic("mouseup",Z,[w.isDragging,D]),ic("mousemove",he,[a,w.isDragging,z,s,i]),ic("touchend",Z,[w.isDragging,D],{condition:fc}),ic("touchmove",he,[a,w.isDragging,z,s,i],{condition:fc,passive:!fc}),Lt((function(){if(!_.current)return;const R=_.current.parentElement;if(!R)return;const K=new ResizeObserver((()=>{const C=getComputedStyle(R),Q=a===ft.Horizontal?R.clientWidth:R.clientHeight;T(!!C&&!!Q)}));return K.observe(R),()=>{K.disconnect()}}),[_.current,a]),Lt((function(){if(w.isReady&&(!$.current||$.current[0].offsetParent)){if(!$.current||!S.current)throw new Error("Cannot create pairs - either variable 'childRefs' or 'gutterRefs' is undefined");y.length<=1?W(a,$.current,S.current,r):(W(a,$.current,S.current,r),P(a,$.current,S.current))}}),[h,w.isReady,a,W,P,r]),m.jsx("div",Object.assign({className:`__dbk__container ${a}`,ref:_},{children:w.isReady&&y.map(((R,K)=>m.jsxs(_e.Fragment,{children:[m.jsx("div",Object.assign({ref:C=>Ce($,C),className:"__dbk__child-wrapper "+(KCe(S,C),className:c,theme:l,draggerClassName:d,direction:a,onDragging:()=>{return M(a,C=K),void E(a,C);var C}},void 0)]},K)))}),void 0)}const Kw=lm({dragDropManager:void 0});function Qr(a){"@babel/helpers - typeof";return Qr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},Qr(a)}function YS(a,s){if(Qr(a)!="object"||!a)return a;var i=a[Symbol.toPrimitive];if(i!==void 0){var r=i.call(a,s);if(Qr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(a)}function JS(a){var s=YS(a,"string");return Qr(s)=="symbol"?s:s+""}function qS(a,s,i){return(s=JS(s))in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function bs(a){return"Minified Redux error #"+a+"; visit https://redux.js.org/Errors?code="+a+" for the full message or use the non-minified dev environment for full errors. "}var u_=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),d_=function(){return Math.random().toString(36).substring(7).split("").join(".")},h_={INIT:"@@redux/INIT"+d_(),REPLACE:"@@redux/REPLACE"+d_()};function XS(a){if(typeof a!="object"||a===null)return!1;for(var s=a;Object.getPrototypeOf(s)!==null;)s=Object.getPrototypeOf(s);return Object.getPrototypeOf(a)===s}function Yw(a,s,i){var r;if(typeof s=="function"&&typeof i=="function"||typeof i=="function"&&typeof arguments[3]=="function")throw new Error(bs(0));if(typeof s=="function"&&typeof i>"u"&&(i=s,s=void 0),typeof i<"u"){if(typeof i!="function")throw new Error(bs(1));return i(Yw)(a,s)}if(typeof a!="function")throw new Error(bs(2));var l=a,c=s,d=[],h=d,p=!1;function f(){h===d&&(h=d.slice())}function b(){if(p)throw new Error(bs(3));return c}function y($){if(typeof $!="function")throw new Error(bs(4));if(p)throw new Error(bs(5));var S=!0;return f(),h.push($),function(){if(S){if(p)throw new Error(bs(6));S=!1,f();var E=h.indexOf($);h.splice(E,1),d=null}}}function w($){if(!XS($))throw new Error(bs(7));if(typeof $.type>"u")throw new Error(bs(8));if(p)throw new Error(bs(9));try{p=!0,c=l(c,$)}finally{p=!1}for(var S=d=h,T=0;Tr&&r[l]?r[l]:i||null,a)}function eE(a,s){return a.filter(i=>i!==s)}function Jw(a){return typeof a=="object"}function tE(a,s){const i=new Map,r=c=>{i.set(c,i.has(c)?i.get(c)+1:1)};a.forEach(r),s.forEach(r);const l=[];return i.forEach((c,d)=>{c===1&&l.push(d)}),l}function sE(a,s){return a.filter(i=>s.indexOf(i)>-1)}const pm="dnd-core/INIT_COORDS",Xc="dnd-core/BEGIN_DRAG",gm="dnd-core/PUBLISH_DRAG_SOURCE",Zc="dnd-core/HOVER",Qc="dnd-core/DROP",eu="dnd-core/END_DRAG";function p_(a,s){return{type:pm,payload:{sourceClientOffset:s||null,clientOffset:a||null}}}const oE={type:pm,payload:{clientOffset:null,sourceClientOffset:null}};function iE(a){return function(i=[],r={publishSource:!0}){const{publishSource:l=!0,clientOffset:c,getSourceClientOffset:d}=r,h=a.getMonitor(),p=a.getRegistry();a.dispatch(p_(c)),nE(i,h,p);const f=lE(i,h);if(f==null){a.dispatch(oE);return}let b=null;if(c){if(!d)throw new Error("getSourceClientOffset must be defined");rE(d),b=d(f)}a.dispatch(p_(c,b));const w=p.getSource(f).beginDrag(h,f);if(w==null)return;aE(w),p.pinSource(f);const v=p.getSourceType(f);return{type:Xc,payload:{itemType:v,item:w,sourceId:f,clientOffset:c||null,sourceClientOffset:b||null,isSourcePublic:!!l}}}}function nE(a,s,i){Ve(!s.isDragging(),"Cannot call beginDrag while dragging."),a.forEach(function(r){Ve(i.getSource(r),"Expected sourceIds to be registered.")})}function rE(a){Ve(typeof a=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function aE(a){Ve(Jw(a),"Item must be an object.")}function lE(a,s){let i=null;for(let r=a.length-1;r>=0;r--)if(s.canDragSource(a[r])){i=a[r];break}return i}function cE(a,s,i){return s in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function uE(a){for(var s=1;s{const p=pE(d,h,l,r),f={type:Qc,payload:{dropResult:uE({},i,p)}};a.dispatch(f)})}}function hE(a){Ve(a.isDragging(),"Cannot call drop while not dragging."),Ve(!a.didDrop(),"Cannot call drop twice during one drag operation.")}function pE(a,s,i,r){const l=i.getTarget(a);let c=l?l.drop(r,a):void 0;return gE(c),typeof c>"u"&&(c=s===0?{}:r.getDropResult()),c}function gE(a){Ve(typeof a>"u"||Jw(a),"Drop result must either be an object or undefined.")}function mE(a){const s=a.getTargetIds().filter(a.canDropOnTarget,a);return s.reverse(),s}function fE(a){return function(){const i=a.getMonitor(),r=a.getRegistry();$E(i);const l=i.getSourceId();return l!=null&&(r.getSource(l,!0).endDrag(i,l),r.unpinSource()),{type:eu}}}function $E(a){Ve(a.isDragging(),"Cannot call endDrag while not dragging.")}function Pg(a,s){return s===null?a===null:Array.isArray(a)?a.some(i=>i===s):a===s}function bE(a){return function(i,{clientOffset:r}={}){vE(i);const l=i.slice(0),c=a.getMonitor(),d=a.getRegistry(),h=c.getItemType();return _E(l,d,h),yE(l,c,d),wE(l,c,d),{type:Zc,payload:{targetIds:l,clientOffset:r||null}}}}function vE(a){Ve(Array.isArray(a),"Expected targetIds to be an array.")}function yE(a,s,i){Ve(s.isDragging(),"Cannot call hover while not dragging."),Ve(!s.didDrop(),"Cannot call hover after drop.");for(let r=0;r=0;r--){const l=a[r],c=s.getTargetType(l);Pg(c,i)||a.splice(r,1)}}function wE(a,s,i){a.forEach(function(r){i.getTarget(r).hover(s,r)})}function kE(a){return function(){if(a.getMonitor().isDragging())return{type:gm}}}function CE(a){return{beginDrag:iE(a),publishDragSource:kE(a),hover:bE(a),drop:dE(a),endDrag:fE(a)}}class TE{receiveBackend(s){this.backend=s}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const s=this,{dispatch:i}=this.store;function r(c){return(...d)=>{const h=c.apply(s,d);typeof h<"u"&&i(h)}}const l=CE(this);return Object.keys(l).reduce((c,d)=>{const h=l[d];return c[d]=r(h),c},{})}dispatch(s){this.store.dispatch(s)}constructor(s,i){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=s,this.monitor=i,s.subscribe(this.handleRefCountChange)}}function SE(a,s){return{x:a.x+s.x,y:a.y+s.y}}function qw(a,s){return{x:a.x-s.x,y:a.y-s.y}}function EE(a){const{clientOffset:s,initialClientOffset:i,initialSourceClientOffset:r}=a;return!s||!i||!r?null:qw(SE(s,r),i)}function IE(a){const{clientOffset:s,initialClientOffset:i}=a;return!s||!i?null:qw(s,i)}const Kr=[],mm=[];Kr.__IS_NONE__=!0;mm.__IS_ALL__=!0;function xE(a,s){return a===Kr?!1:a===mm||typeof s>"u"?!0:sE(s,a).length>0}class DE{subscribeToStateChange(s,i={}){const{handlerIds:r}=i;Ve(typeof s=="function","listener must be a function."),Ve(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let l=this.store.getState().stateId;const c=()=>{const d=this.store.getState(),h=d.stateId;try{h===l||h===l+1&&!xE(d.dirtyHandlerIds,r)||s()}finally{l=h}};return this.store.subscribe(c)}subscribeToOffsetChange(s){Ve(typeof s=="function","listener must be a function.");let i=this.store.getState().dragOffset;const r=()=>{const l=this.store.getState().dragOffset;l!==i&&(i=l,s())};return this.store.subscribe(r)}canDragSource(s){if(!s)return!1;const i=this.registry.getSource(s);return Ve(i,`Expected to find a valid source. sourceId=${s}`),this.isDragging()?!1:i.canDrag(this,s)}canDropOnTarget(s){if(!s)return!1;const i=this.registry.getTarget(s);if(Ve(i,`Expected to find a valid target. targetId=${s}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(s),l=this.getItemType();return Pg(r,l)&&i.canDrop(this,s)}isDragging(){return!!this.getItemType()}isDraggingSource(s){if(!s)return!1;const i=this.registry.getSource(s,!0);if(Ve(i,`Expected to find a valid source. sourceId=${s}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(s),l=this.getItemType();return r!==l?!1:i.isDragging(this,s)}isOverTarget(s,i={shallow:!1}){if(!s)return!1;const{shallow:r}=i;if(!this.isDragging())return!1;const l=this.registry.getTargetType(s),c=this.getItemType();if(c&&!Pg(l,c))return!1;const d=this.getTargetIds();if(!d.length)return!1;const h=d.indexOf(s);return r?h===d.length-1:h>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return EE(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return IE(this.store.getState().dragOffset)}constructor(s,i){this.store=s,this.registry=i}}const g_=typeof global<"u"?global:self,Xw=g_.MutationObserver||g_.WebKitMutationObserver;function Zw(a){return function(){const i=setTimeout(l,0),r=setInterval(l,50);function l(){clearTimeout(i),clearInterval(r),a()}}}function AE(a){let s=1;const i=new Xw(a),r=document.createTextNode("");return i.observe(r,{characterData:!0}),function(){s=-s,r.data=s}}const OE=typeof Xw=="function"?AE:Zw;class RE{enqueueTask(s){const{queue:i,requestFlush:r}=this;i.length||(r(),this.flushing=!0),i[i.length]=s}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:s}=this;for(;this.indexthis.capacity){for(let r=0,l=s.length-this.index;r{this.pendingErrors.push(s),this.requestErrorThrow()},this.requestFlush=OE(this.flush),this.requestErrorThrow=Zw(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class NE{call(){try{this.task&&this.task()}catch(s){this.onError(s)}finally{this.task=null,this.release(this)}}constructor(s,i){this.onError=s,this.release=i,this.task=null}}class ME{create(s){const i=this.freeTasks,r=i.length?i.pop():new NE(this.onError,l=>i[i.length]=l);return r.task=s,r}constructor(s){this.onError=s,this.freeTasks=[]}}const Qw=new RE,LE=new ME(Qw.registerPendingError);function PE(a){Qw.enqueueTask(LE.create(a))}const fm="dnd-core/ADD_SOURCE",$m="dnd-core/ADD_TARGET",bm="dnd-core/REMOVE_SOURCE",tu="dnd-core/REMOVE_TARGET";function BE(a){return{type:fm,payload:{sourceId:a}}}function FE(a){return{type:$m,payload:{targetId:a}}}function jE(a){return{type:bm,payload:{sourceId:a}}}function zE(a){return{type:tu,payload:{targetId:a}}}function UE(a){Ve(typeof a.canDrag=="function","Expected canDrag to be a function."),Ve(typeof a.beginDrag=="function","Expected beginDrag to be a function."),Ve(typeof a.endDrag=="function","Expected endDrag to be a function.")}function HE(a){Ve(typeof a.canDrop=="function","Expected canDrop to be a function."),Ve(typeof a.hover=="function","Expected hover to be a function."),Ve(typeof a.drop=="function","Expected beginDrag to be a function.")}function Bg(a,s){if(s&&Array.isArray(a)){a.forEach(i=>Bg(i,!1));return}Ve(typeof a=="string"||typeof a=="symbol",s?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var _s;(function(a){a.SOURCE="SOURCE",a.TARGET="TARGET"})(_s||(_s={}));let WE=0;function GE(){return WE++}function VE(a){const s=GE().toString();switch(a){case _s.SOURCE:return`S${s}`;case _s.TARGET:return`T${s}`;default:throw new Error(`Unknown Handler Role: ${a}`)}}function m_(a){switch(a[0]){case"S":return _s.SOURCE;case"T":return _s.TARGET;default:throw new Error(`Cannot parse handler ID: ${a}`)}}function f_(a,s){const i=a.entries();let r=!1;do{const{done:l,value:[,c]}=i.next();if(c===s)return!0;r=!!l}while(!r);return!1}class KE{addSource(s,i){Bg(s),UE(i);const r=this.addHandler(_s.SOURCE,s,i);return this.store.dispatch(BE(r)),r}addTarget(s,i){Bg(s,!0),HE(i);const r=this.addHandler(_s.TARGET,s,i);return this.store.dispatch(FE(r)),r}containsHandler(s){return f_(this.dragSources,s)||f_(this.dropTargets,s)}getSource(s,i=!1){return Ve(this.isSourceId(s),"Expected a valid source ID."),i&&s===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(s)}getTarget(s){return Ve(this.isTargetId(s),"Expected a valid target ID."),this.dropTargets.get(s)}getSourceType(s){return Ve(this.isSourceId(s),"Expected a valid source ID."),this.types.get(s)}getTargetType(s){return Ve(this.isTargetId(s),"Expected a valid target ID."),this.types.get(s)}isSourceId(s){return m_(s)===_s.SOURCE}isTargetId(s){return m_(s)===_s.TARGET}removeSource(s){Ve(this.getSource(s),"Expected an existing source."),this.store.dispatch(jE(s)),PE(()=>{this.dragSources.delete(s),this.types.delete(s)})}removeTarget(s){Ve(this.getTarget(s),"Expected an existing target."),this.store.dispatch(zE(s)),this.dropTargets.delete(s),this.types.delete(s)}pinSource(s){const i=this.getSource(s);Ve(i,"Expected an existing source."),this.pinnedSourceId=s,this.pinnedSource=i}unpinSource(){Ve(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(s,i,r){const l=VE(s);return this.types.set(l,i),s===_s.SOURCE?this.dragSources.set(l,r):s===_s.TARGET&&this.dropTargets.set(l,r),l}constructor(s){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=s}}const YE=(a,s)=>a===s;function JE(a,s){return!a&&!s?!0:!a||!s?!1:a.x===s.x&&a.y===s.y}function qE(a,s,i=YE){if(a.length!==s.length)return!1;for(let r=0;r0||!qE(i,r)))return Kr;const d=r[r.length-1],h=i[i.length-1];return d!==h&&(d&&l.push(d),h&&l.push(h)),l}function ZE(a,s,i){return s in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function QE(a){for(var s=1;s=0)&&Object.prototype.propertyIsEnumerable.call(a,r)&&(i[r]=a[r])}return i}function hI(a,s){if(a==null)return{};var i={},r=Object.keys(a),l,c;for(c=0;c=0)&&(i[l]=a[l]);return i}let b_=0;const $c=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var ek=cm(function(s){var{children:i}=s,r=dI(s,["children"]);const[l,c]=pI(r);return Lt(()=>{if(c){const d=tk();return++b_,()=>{--b_===0&&(d[$c]=null)}}},[]),m.jsx(Kw.Provider,{value:l,children:i})});function pI(a){if("manager"in a)return[{dragDropManager:a.manager},!1];const s=gI(a.backend,a.context,a.options,a.debugMode),i=!a.context;return[s,i]}function gI(a,s=tk(),i,r){const l=s;return l[$c]||(l[$c]={dragDropManager:cI(a,s,i,r)}),l[$c]}function tk(){return typeof global<"u"?global:window}var mI=function a(s,i){if(s===i)return!0;if(s&&i&&typeof s=="object"&&typeof i=="object"){if(s.constructor!==i.constructor)return!1;var r,l,c;if(Array.isArray(s)){if(r=s.length,r!=i.length)return!1;for(l=r;l--!==0;)if(!a(s[l],i[l]))return!1;return!0}if(s.constructor===RegExp)return s.source===i.source&&s.flags===i.flags;if(s.valueOf!==Object.prototype.valueOf)return s.valueOf()===i.valueOf();if(s.toString!==Object.prototype.toString)return s.toString()===i.toString();if(c=Object.keys(s),r=c.length,r!==Object.keys(i).length)return!1;for(l=r;l--!==0;)if(!Object.prototype.hasOwnProperty.call(i,c[l]))return!1;for(l=r;l--!==0;){var d=c[l];if(!a(s[d],i[d]))return!1}return!0}return s!==s&&i!==i};const fI=Xo(mI),Oi=typeof window<"u"?um:Lt;function $I(a,s,i){const[r,l]=kt(()=>s(a)),c=xn(()=>{const d=s(a);fI(r,d)||(l(d),i&&i())},[r,a,i]);return Oi(c),[r,c]}function bI(a,s,i){const[r,l]=$I(a,s,i);return Oi(function(){const d=a.getHandlerId();if(d!=null)return a.subscribeToStateChange(l,{handlerIds:[d]})},[a,l]),r}function sk(a,s,i){return bI(s,a||(()=>({})),()=>i.reconnect())}function ok(a,s){const i=[];return typeof a!="function"&&i.push(a),us(()=>typeof a=="function"?a():a,i)}function vI(a){return us(()=>a.hooks.dragSource(),[a])}function yI(a){return us(()=>a.hooks.dragPreview(),[a])}let Zp=!1,Qp=!1;class _I{receiveHandlerId(s){this.sourceId=s}getHandlerId(){return this.sourceId}canDrag(){Ve(!Zp,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Zp=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Zp=!1}}isDragging(){if(!this.sourceId)return!1;Ve(!Qp,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Qp=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Qp=!1}}subscribeToStateChange(s,i){return this.internalMonitor.subscribeToStateChange(s,i)}isDraggingSource(s){return this.internalMonitor.isDraggingSource(s)}isOverTarget(s,i){return this.internalMonitor.isOverTarget(s,i)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(s){return this.internalMonitor.subscribeToOffsetChange(s)}canDragSource(s){return this.internalMonitor.canDragSource(s)}canDropOnTarget(s){return this.internalMonitor.canDropOnTarget(s)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(s){this.sourceId=null,this.internalMonitor=s.getMonitor()}}let eg=!1;class wI{receiveHandlerId(s){this.targetId=s}getHandlerId(){return this.targetId}subscribeToStateChange(s,i){return this.internalMonitor.subscribeToStateChange(s,i)}canDrop(){if(!this.targetId)return!1;Ve(!eg,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return eg=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{eg=!1}}isOver(s){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,s):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(s){this.targetId=null,this.internalMonitor=s.getMonitor()}}function kI(a,s,i){const r=i.getRegistry(),l=r.addTarget(a,s);return[l,()=>r.removeTarget(l)]}function CI(a,s,i){const r=i.getRegistry(),l=r.addSource(a,s);return[l,()=>r.removeSource(l)]}function Fg(a,s,i,r){let l;if(l!==void 0)return!!l;if(a===s)return!0;if(typeof a!="object"||!a||typeof s!="object"||!s)return!1;const c=Object.keys(a),d=Object.keys(s);if(c.length!==d.length)return!1;const h=Object.prototype.hasOwnProperty.bind(s);for(let p=0;p, or turn it into a drag source or a drop target itself.`)}function SI(a){return(s=null,i=null)=>{if(!Ew(s)){const c=s;return a(c,i),c}const r=s;return TI(r),EI(r,i?c=>a(c,i):a)}}function ik(a){const s={};return Object.keys(a).forEach(i=>{const r=a[i];if(i.endsWith("Ref"))s[i]=a[i];else{const l=SI(r);s[i]=()=>l}}),s}function v_(a,s){typeof a=="function"?a(s):a.current=s}function EI(a,s){const i=a.ref;return Ve(typeof i!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a or
. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),i?Eg(a,{ref:r=>{v_(i,r),v_(s,r)}}):Eg(a,{ref:s})}class II{receiveHandlerId(s){this.handlerId!==s&&(this.handlerId=s,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(s){this.dragSourceOptionsInternal=s}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(s){this.dragPreviewOptionsInternal=s}reconnect(){const s=this.reconnectDragSource();this.reconnectDragPreview(s)}reconnectDragSource(){const s=this.dragSource,i=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return i&&this.disconnectDragSource(),this.handlerId?s?(i&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=s,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,s,this.dragSourceOptions)),i):(this.lastConnectedDragSource=s,i):i}reconnectDragPreview(s=!1){const i=this.dragPreview,r=s||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!i){this.lastConnectedDragPreview=i;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=i,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,i,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Fg(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Fg(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(s){this.hooks=ik({dragSource:(i,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,jg(i)?this.dragSourceRef=i:this.dragSourceNode=i,this.reconnectDragSource()},dragPreview:(i,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,jg(i)?this.dragPreviewRef=i:this.dragPreviewNode=i,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=s}}class xI{get connectTarget(){return this.dropTarget}reconnect(){const s=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();s&&this.disconnectDropTarget();const i=this.dropTarget;if(this.handlerId){if(!i){this.lastConnectedDropTarget=i;return}s&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=i,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,i,this.dropTargetOptions))}}receiveHandlerId(s){s!==this.handlerId&&(this.handlerId=s,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(s){this.dropTargetOptionsInternal=s}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Fg(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(s){this.hooks=ik({dropTarget:(i,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,jg(i)?this.dropTargetRef=i:this.dropTargetNode=i,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=s}}function zn(){const{dragDropManager:a}=ia(Kw);return Ve(a!=null,"Expected drag drop context"),a}function DI(a,s){const i=zn(),r=us(()=>new II(i.getBackend()),[i]);return Oi(()=>(r.dragSourceOptions=a||null,r.reconnect(),()=>r.disconnectDragSource()),[r,a]),Oi(()=>(r.dragPreviewOptions=s||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,s]),r}function AI(){const a=zn();return us(()=>new _I(a),[a])}class OI{beginDrag(){const s=this.spec,i=this.monitor;let r=null;return typeof s.item=="object"?r=s.item:typeof s.item=="function"?r=s.item(i):r={},r??null}canDrag(){const s=this.spec,i=this.monitor;return typeof s.canDrag=="boolean"?s.canDrag:typeof s.canDrag=="function"?s.canDrag(i):!0}isDragging(s,i){const r=this.spec,l=this.monitor,{isDragging:c}=r;return c?c(l):i===s.getSourceId()}endDrag(){const s=this.spec,i=this.monitor,r=this.connector,{end:l}=s;l&&l(i.getItem(),i),r.reconnect()}constructor(s,i,r){this.spec=s,this.monitor=i,this.connector=r}}function RI(a,s,i){const r=us(()=>new OI(a,s,i),[s,i]);return Lt(()=>{r.spec=a},[a]),r}function NI(a){return us(()=>{const s=a.type;return Ve(s!=null,"spec.type must be defined"),s},[a])}function MI(a,s,i){const r=zn(),l=RI(a,s,i),c=NI(a);Oi(function(){if(c!=null){const[h,p]=CI(c,l,r);return s.receiveHandlerId(h),i.receiveHandlerId(h),p}},[r,s,i,l,c])}function LI(a,s){const i=ok(a);Ve(!i.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=AI(),l=DI(i.options,i.previewOptions);return MI(i,r,l),[sk(i.collect,r,l),vI(l),yI(l)]}function PI(a){return us(()=>a.hooks.dropTarget(),[a])}function BI(a){const s=zn(),i=us(()=>new xI(s.getBackend()),[s]);return Oi(()=>(i.dropTargetOptions=a||null,i.reconnect(),()=>i.disconnectDropTarget()),[a]),i}function FI(){const a=zn();return us(()=>new wI(a),[a])}function jI(a){const{accept:s}=a;return us(()=>(Ve(a.accept!=null,"accept must be defined"),Array.isArray(s)?s:[s]),[s])}class zI{canDrop(){const s=this.spec,i=this.monitor;return s.canDrop?s.canDrop(i.getItem(),i):!0}hover(){const s=this.spec,i=this.monitor;s.hover&&s.hover(i.getItem(),i)}drop(){const s=this.spec,i=this.monitor;if(s.drop)return s.drop(i.getItem(),i)}constructor(s,i){this.spec=s,this.monitor=i}}function UI(a,s){const i=us(()=>new zI(a,s),[s]);return Lt(()=>{i.spec=a},[a]),i}function HI(a,s,i){const r=zn(),l=UI(a,s),c=jI(a);Oi(function(){const[h,p]=kI(c,l,r);return s.receiveHandlerId(h),i.receiveHandlerId(h),p},[r,s,l,i,c.map(d=>d.toString()).join("|")])}function WI(a,s){const i=ok(a),r=FI(),l=BI(i.options);return HI(i,r,l),[sk(i.collect,r,l),PI(l)]}function nk(a){let s=null;return()=>(s==null&&(s=a()),s)}function GI(a,s){return a.filter(i=>i!==s)}function VI(a,s){const i=new Set,r=c=>i.add(c);a.forEach(r),s.forEach(r);const l=[];return i.forEach(c=>l.push(c)),l}class KI{enter(s){const i=this.entered.length,r=l=>this.isNodeInDocument(l)&&(!l.contains||l.contains(s));return this.entered=VI(this.entered.filter(r),[s]),i===0&&this.entered.length>0}leave(s){const i=this.entered.length;return this.entered=GI(this.entered.filter(this.isNodeInDocument),s),i>0&&this.entered.length===0}reset(){this.entered=[]}constructor(s){this.entered=[],this.isNodeInDocument=s}}class YI{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(s=>{Object.defineProperty(this.item,s,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${s}" until the drop event.`),null}})})}loadDataTransfer(s){if(s){const i={};Object.keys(this.config.exposeProperties).forEach(r=>{const l=this.config.exposeProperties[r];l!=null&&(i[r]={value:l(s,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,i)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(s,i){return i===s.getSourceId()}endDrag(){}constructor(s){this.config=s,this.item={},this.initializeExposedProperties()}}const rk="__NATIVE_FILE__",ak="__NATIVE_URL__",lk="__NATIVE_TEXT__",ck="__NATIVE_HTML__",y_=Object.freeze(Object.defineProperty({__proto__:null,FILE:rk,HTML:ck,TEXT:lk,URL:ak},Symbol.toStringTag,{value:"Module"}));function tg(a,s,i){const r=s.reduce((l,c)=>l||a.getData(c),"");return r??i}const zg={[rk]:{exposeProperties:{files:a=>Array.prototype.slice.call(a.files),items:a=>a.items,dataTransfer:a=>a},matchesTypes:["Files"]},[ck]:{exposeProperties:{html:(a,s)=>tg(a,s,""),dataTransfer:a=>a},matchesTypes:["Html","text/html"]},[ak]:{exposeProperties:{urls:(a,s)=>tg(a,s,"").split(` +`),dataTransfer:a=>a},matchesTypes:["Url","text/uri-list"]},[lk]:{exposeProperties:{text:(a,s)=>tg(a,s,""),dataTransfer:a=>a},matchesTypes:["Text","text/plain"]}};function JI(a,s){const i=zg[a];if(!i)throw new Error(`native type ${a} has no configuration`);const r=new YI(i);return r.loadDataTransfer(s),r}function sg(a){if(!a)return null;const s=Array.prototype.slice.call(a.types||[]);return Object.keys(zg).filter(i=>{const r=zg[i];return r!=null&&r.matchesTypes?r.matchesTypes.some(l=>s.indexOf(l)>-1):!1})[0]||null}const qI=nk(()=>/firefox/i.test(navigator.userAgent)),uk=nk(()=>!!window.safari);class __{interpolate(s){const{xs:i,ys:r,c1s:l,c2s:c,c3s:d}=this;let h=i.length-1;if(s===i[h])return r[h];let p=0,f=d.length-1,b;for(;p<=f;){b=Math.floor(.5*(p+f));const v=i[b];if(vs)f=b-1;else return r[b]}h=Math.max(0,f);const y=s-i[h],w=y*y;return r[h]+l[h]*y+c[h]*w+d[h]*y*w}constructor(s,i){const{length:r}=s,l=[];for(let v=0;vs[v]{let W=new __([0,.5,1],[p.y,p.y/b*_,p.y+_-b]).interpolate(w);return uk()&&c&&(W+=(window.devicePixelRatio-1)*_),W},S=()=>new __([0,.5,1],[p.x,p.x/f*v,p.x+v-f]).interpolate(y),{offsetX:T,offsetY:E}=l,D=T===0||T,M=E===0||E;return{x:D?T:S(),y:M?E:$()}}let tx=class{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var s;return!((s=this.globalContext)===null||s===void 0)&&s.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var s;return((s=this.optionsArgs)===null||s===void 0?void 0:s.rootElement)||this.window}constructor(s,i){this.ownerDocument=null,this.globalContext=s,this.optionsArgs=i}};function sx(a,s,i){return s in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function w_(a){for(var s=1;s{this.sourcePreviewNodes.delete(s),this.sourcePreviewNodeOptions.delete(s)}}connectDragSource(s,i,r){this.sourceNodes.set(s,i),this.sourceNodeOptions.set(s,r);const l=d=>this.handleDragStart(d,s),c=d=>this.handleSelectStart(d);return i.setAttribute("draggable","true"),i.addEventListener("dragstart",l),i.addEventListener("selectstart",c),()=>{this.sourceNodes.delete(s),this.sourceNodeOptions.delete(s),i.removeEventListener("dragstart",l),i.removeEventListener("selectstart",c),i.setAttribute("draggable","false")}}connectDropTarget(s,i){const r=d=>this.handleDragEnter(d,s),l=d=>this.handleDragOver(d,s),c=d=>this.handleDrop(d,s);return i.addEventListener("dragenter",r),i.addEventListener("dragover",l),i.addEventListener("drop",c),()=>{i.removeEventListener("dragenter",r),i.removeEventListener("dragover",l),i.removeEventListener("drop",c)}}addEventListeners(s){s.addEventListener&&(s.addEventListener("dragstart",this.handleTopDragStart),s.addEventListener("dragstart",this.handleTopDragStartCapture,!0),s.addEventListener("dragend",this.handleTopDragEndCapture,!0),s.addEventListener("dragenter",this.handleTopDragEnter),s.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),s.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),s.addEventListener("dragover",this.handleTopDragOver),s.addEventListener("dragover",this.handleTopDragOverCapture,!0),s.addEventListener("drop",this.handleTopDrop),s.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(s){s.removeEventListener&&(s.removeEventListener("dragstart",this.handleTopDragStart),s.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),s.removeEventListener("dragend",this.handleTopDragEndCapture,!0),s.removeEventListener("dragenter",this.handleTopDragEnter),s.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),s.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),s.removeEventListener("dragover",this.handleTopDragOver),s.removeEventListener("dragover",this.handleTopDragOverCapture,!0),s.removeEventListener("drop",this.handleTopDrop),s.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const s=this.monitor.getSourceId(),i=this.sourceNodeOptions.get(s);return w_({dropEffect:this.altKeyPressed?"copy":"move"},i||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const s=this.monitor.getSourceId(),i=this.sourcePreviewNodeOptions.get(s);return w_({anchorX:.5,anchorY:.5,captureDraggingState:!1},i||{})}isDraggingNativeItem(){const s=this.monitor.getItemType();return Object.keys(y_).some(i=>y_[i]===s)}beginDragNativeItem(s,i){this.clearCurrentDragSourceNode(),this.currentNativeSource=JI(s,i),this.currentNativeHandle=this.registry.addSource(s,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(s){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=s;const i=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},i)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var s;(s=this.window)===null||s===void 0||s.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(s,i){s.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(i))}handleDragEnter(s,i){this.dragEnterTargetIds.unshift(i)}handleDragOver(s,i){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(i)}handleDrop(s,i){this.dropTargetIds.unshift(i)}constructor(s,i,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=l=>{const c=this.sourceNodes.get(l);return c&&dk(c)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=l=>!!(l&&this.document&&this.document.body&&this.document.body.contains(l)),this.endDragIfSourceWasRemovedFromDOM=()=>{const l=this.currentDragSourceNode;l==null||this.isNodeInDocument(l)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=l=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(l||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=l=>{if(l.defaultPrevented)return;const{dragStartSourceIds:c}=this;this.dragStartSourceIds=null;const d=nc(l);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(c||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:d});const{dataTransfer:h}=l,p=sg(h);if(this.monitor.isDragging()){if(h&&typeof h.setDragImage=="function"){const b=this.monitor.getSourceId(),y=this.sourceNodes.get(b),w=this.sourcePreviewNodes.get(b)||y;if(w){const{anchorX:v,anchorY:_,offsetX:$,offsetY:S}=this.getCurrentSourcePreviewNodeOptions(),D=ex(y,w,d,{anchorX:v,anchorY:_},{offsetX:$,offsetY:S});h.setDragImage(w,D.x,D.y)}}try{h==null||h.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(l.target);const{captureDraggingState:f}=this.getCurrentSourcePreviewNodeOptions();f?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(p)this.beginDragNativeItem(p);else{if(h&&!h.types&&(l.target&&!l.target.hasAttribute||!l.target.hasAttribute("draggable")))return;l.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=l=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var c;(c=this.currentNativeSource)===null||c===void 0||c.loadDataTransfer(l.dataTransfer)}if(!this.enterLeaveCounter.enter(l.target)||this.monitor.isDragging())return;const{dataTransfer:h}=l,p=sg(h);p&&this.beginDragNativeItem(p,h)},this.handleTopDragEnter=l=>{const{dragEnterTargetIds:c}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=l.altKey,c.length>0&&this.actions.hover(c,{clientOffset:nc(l)}),c.some(h=>this.monitor.canDropOnTarget(h))&&(l.preventDefault(),l.dataTransfer&&(l.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=l=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var c;(c=this.currentNativeSource)===null||c===void 0||c.loadDataTransfer(l.dataTransfer)}},this.handleTopDragOver=l=>{const{dragOverTargetIds:c}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){l.preventDefault(),l.dataTransfer&&(l.dataTransfer.dropEffect="none");return}this.altKeyPressed=l.altKey,this.lastClientOffset=nc(l),this.scheduleHover(c),(c||[]).some(h=>this.monitor.canDropOnTarget(h))?(l.preventDefault(),l.dataTransfer&&(l.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?l.preventDefault():(l.preventDefault(),l.dataTransfer&&(l.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=l=>{this.isDraggingNativeItem()&&l.preventDefault(),this.enterLeaveCounter.leave(l.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=l=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var c;l.preventDefault(),(c=this.currentNativeSource)===null||c===void 0||c.loadDataTransfer(l.dataTransfer)}else sg(l.dataTransfer)&&l.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=l=>{const{dropTargetIds:c}=this;this.dropTargetIds=[],this.actions.hover(c,{clientOffset:nc(l)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=l=>{const c=l.target;typeof c.dragDrop=="function"&&(c.tagName==="INPUT"||c.tagName==="SELECT"||c.tagName==="TEXTAREA"||c.isContentEditable||(l.preventDefault(),c.dragDrop()))},this.options=new tx(i,r),this.actions=s.getActions(),this.monitor=s.getMonitor(),this.registry=s.getRegistry(),this.enterLeaveCounter=new KI(this.isNodeInDocument)}}const hk=function(s,i,r){return new ox(s,i,r)},ix=$t([m.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),m.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"AccessTime"),nx=$t(m.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox"),rx=$t(m.jsx("path",{d:"M4 8h4V4H4zm6 12h4v-4h-4zm-6 0h4v-4H4zm0-6h4v-4H4zm6 0h4v-4h-4zm6-10v4h4V4zm-6 4h4V4h-4zm6 6h4v-4h-4zm0 6h4v-4h-4z"}),"Apps"),ax=$t(m.jsx("path",{d:"M9 2c-1.05 0-2.05.16-3 .46 4.06 1.27 7 5.06 7 9.54s-2.94 8.27-7 9.54c.95.3 1.95.46 3 .46 5.52 0 10-4.48 10-10S14.52 2 9 2"}),"Brightness3"),lx=$t(m.jsx("path",{d:"M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5s-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20zm-6 8h-4v-2h4zm0-4h-4v-2h4z"}),"BugReport"),cx=$t(m.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm-1 4 6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2zm-1 7h5.5L14 6.5z"}),"FileCopy"),ux=$t(m.jsx("path",{d:"M7 2v11h3v9l7-12h-4l4-8z"}),"FlashOn"),dx=$t(m.jsx("path",{d:"M3.27 5 2 6.27l6.97 6.97L6.5 19h3l1.57-3.66L16.73 21 18 19.73 3.55 5.27zM6 5v.18L8.82 8h2.4l-.72 1.68 2.1 2.1L14.21 8H20V5z"}),"FormatClear"),hx=$t(m.jsx("path",{d:"M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z"}),"Functions"),pk=$t(m.jsx("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutline"),px=$t(m.jsx("path",{d:"M21 3.01H3c-1.1 0-2 .9-2 2V9h2V4.99h18v14.03H3V15H1v4.01c0 1.1.9 1.98 2 1.98h18c1.1 0 2-.88 2-1.98v-14c0-1.11-.9-2-2-2M11 16l4-4-4-4v3H1v2h10z"}),"Input"),k_=$t(m.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"}),"Lock"),gx=$t(m.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert"),mx=$t(m.jsx("path",{d:"M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10c1.38 0 2.5-1.12 2.5-2.5 0-.61-.23-1.2-.64-1.67-.08-.1-.13-.21-.13-.33 0-.28.22-.5.5-.5H16c3.31 0 6-2.69 6-6 0-4.96-4.49-9-10-9m5.5 11c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m-3-4c-.83 0-1.5-.67-1.5-1.5S13.67 6 14.5 6s1.5.67 1.5 1.5S15.33 9 14.5 9M5 11.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5S7.33 13 6.5 13 5 12.33 5 11.5m6-4c0 .83-.67 1.5-1.5 1.5S8 8.33 8 7.5 8.67 6 9.5 6s1.5.67 1.5 1.5"}),"Palette"),bc=$t(m.jsx("path",{d:"M6 19h4V5H6zm8-14v14h4V5z"}),"Pause"),Ug=$t(m.jsx("path",{d:"M8 5v14l11-7z"}),"PlayArrow"),fx=$t(m.jsx("path",{d:"M11 5v5.59H7.5l4.5 4.5 4.5-4.5H13V5zm-5 9c0 3.31 2.69 6 6 6s6-2.69 6-6h-2c0 2.21-1.79 4-4 4s-4-1.79-4-4z"}),"PlayForWork"),$x=$t(m.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search"),bx=$t(m.jsx("path",{d:"M10.59 9.17 5.41 4 4 5.41l5.17 5.17zM14.5 4l2.04 2.04L4 18.59 5.41 20 17.96 7.46 20 9.5V4zm.33 9.41-1.41 1.41 3.13 3.13L14.5 20H20v-5.5l-2.04 2.04z"}),"Shuffle"),vx=$t(m.jsx("path",{d:"M2 20h20v-4H2zm2-3h2v2H4zM2 4v4h20V4zm4 3H4V5h2zm-4 7h20v-4H2zm2-3h2v2H4z"}),"Storage"),yx=$t(m.jsx("path",{d:"M14 17H4v2h10zm6-8H4v2h16zM4 15h16v-2H4zM4 5v2h16V5z"}),"Subject"),_x=$t(m.jsx("path",{d:"M16 17.01V10h-2v7.01h-3L15 21l4-3.99zM9 3 5 6.99h3V14h2V6.99h3z"}),"SwapVert"),wx=$t(m.jsx("path",{d:"M7.41 18.59 8.83 20 12 16.83 15.17 20l1.41-1.41L12 14zm9.18-13.18L15.17 4 12 7.17 8.83 4 7.41 5.41 12 10z"}),"UnfoldLess"),kx=$t(m.jsx("path",{d:"M12 5.83 15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15z"}),"UnfoldMore"),Tc="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='512'%20height='512'%20shape-rendering='geometricPrecision'%20image-rendering='optimizeQuality'%20fill-rule='evenodd'%20xmlns:v='https://vecta.io/nano'%3e%3cpath%20fill='%23efda4e'%20d='M-.5-.5h512v512H-.5V-.5z'/%3e%3cpath%20fill='%23020100'%20d='M308.5%20287.5c1.777-3.005%202.777-6.338%203-10%209.147-21.963%2025.48-35.463%2049-40.5%2021.999-4.173%2043.666-2.84%2065%204%2014.575%205.411%2025.575%2014.911%2033%2028.5l-1%202c-12.413%205.624-24.58%2011.624-36.5%2018-5.321-8.25-12.821-13.417-22.5-15.5-13.957-3.122-27.29-1.455-40%205-8.125%205.36-10.958%2012.86-8.5%2022.5%203.223%206.223%208.057%2010.723%2014.5%2013.5l64%2020c38.459%2016.085%2052.626%2044.585%2042.5%2085.5-7.572%2026.208-24.738%2042.041-51.5%2047.5-25.102%205.733-49.768%204.4-74-4-19.291-8.625-32.291-22.958-39-43%2011.266-8.887%2023.433-16.387%2036.5-22.5%203.117%206.896%206.784%2013.563%2011%2020%2012.705%2012.307%2027.872%2016.807%2045.5%2013.5%2022.189-3.504%2032.355-16.338%2030.5-38.5-2.833-6.833-7.667-11.667-14.5-14.5l-57-17c-36.004-11.84-52.67-36.673-50-74.5z'/%3e%3cpath%20fill='%23020200'%20d='M222.5%20238.5h43l-.5%20159c-2.688%2052.355-30.188%2076.855-82.5%2073.5-24.871-3.543-41.204-17.21-49-41l.5-2.5a12.14%2012.14%200%200%200%204.5-3.5c10.653-5.825%2021.32-11.325%2032-16.5%204.763%2021.72%2017.763%2028.887%2039%2021.5%204.616-2.618%207.783-6.451%209.5-11.5%201.163-5.968%202.163-11.968%203-18l.5-161z'/%3e%3cpath%20fill='%23615820'%20d='M311.5%20277.5c-.223%203.662-1.223%206.995-3%2010%20.223-3.662%201.223-6.995%203-10z'/%3e%3c/svg%3e",gk="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20500%20500'%3e%3cpath%20fill='%234285f4'%20d='M44.271%2027.275l206.5%201v170l-58.5-36.5c-7.005-.916-12.505%201.584-16.5%207.5v147c4.625%204.412%2010.125%206.245%2016.5%205.5l57.5-35.5c.833%2054.003%201.356%20108.003.189%20162-1.272.546-45.599-.242-48.689%201.121-3.674%207.844-4.79%2011.207-13%2023.879-4.372%205.527-2.19%204.097-10.689%2012.258-5.166%202.748-4.191%203.45-14.311%206.242-17.67%201.983-35.336%201.983-53%200-9.535-3.774-10.879-4.163-18.526-11.22-5.562-4.39-11.131-11.803-11.974-15.28-4.068-7.881-3.42-9.116-5.5-13.5-3.672-1.503-35.798.203-40.746-1.335-5.823-2.314-2.946-.422-7.954-3.689-2.888-2.668-2.255-3.221-2.421-9.904L20.771%2050.275c.36-2.108-.41-5.806%202.522-11.615%204.343-5.852%205.374-7%2010.061-9.146%206.083-2.73%208.677-1.475%2010.917-2.239z'/%3e%3cpath%20d='M258.271%2030.275l154.63.407c5.654.559%2010.783%203.17%2014.37%207.093%204.907%204.408%206.204%208.723%207.5%2013.5v373c-.208%205.716-.297%207.982-4.848%2015.404-7.078%206.393-9.879%206.39-15.652%206.692-24.804%201.296-50.079%201.189-74.96%201.041-24.516-.014-68.46.89-81.5.391l-2.512-172.528c-20.083%2012.625-42.777%2025.125-63.028%2037.5-4.127%201.292-7.294.125-9.5-3.5l1-137c1.864-2.707%204.364-3.541%207.5-2.5%2020.366%2013.427%2064.35%2038.947%2065.581%2038.339l1.419-177.839z'%20fill='%23DDD'/%3e%3c/svg%3e",mk="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20512%20512'%20width='32'%20height='32'%3e%3cpath%20fill='%23007acc'%20d='M-.5-.5h503l-1%20179h10v333h-421v-7h-91V-.5z'/%3e%3cpath%20fill='%230f81cf'%20d='M502.5-.5h9v179h-10l1-179z'/%3e%3cpath%20fill='%23fdfefe'%20d='M470.5%20227.5c.33%2017.508-.003%2034.841-1%2052-23.486-15.709-48.82-19.875-76-12.5-15.89%208.078-19.39%2019.911-10.5%2035.5%204.673%205.577%2010.173%2010.077%2016.5%2013.5l38%2019c17.945%209.278%2031.112%2023.112%2039.5%2041.5%201.352%203.22%202.186%206.553%202.5%2010a305.16%20305.16%200%200%201%201%2026c-3.553%2033.726-21.886%2054.559-55%2062.5-34.769%207.363-68.435%204.196-101-9.5-.167-19.003%200-38.003.5-57%2022.903%2021.314%2049.736%2029.147%2080.5%2023.5%2019.435-5.701%2025.268-17.868%2017.5-36.5-4.718-6.44-10.552-11.606-17.5-15.5a1552.42%201552.42%200%200%201-47-24c-27.679-19.331-38.846-45.831-33.5-79.5%206.43-26.433%2022.597-43.933%2048.5-52.5%2026.131-6.625%2052.464-7.292%2079-2a565.56%20565.56%200%200%201%2018%205.5z'/%3e%3cpath%20fill='%23fefefe'%20d='M122.5%20222.5h182v46h-65v206h-52v-206h-65v-46z'/%3e%3cpath%20fill='%2370b3e1'%20d='M470.5%20227.5c1.327%2017.505%201.327%2035.171%200%2053-.607-.124-.94-.457-1-1%20.997-17.159%201.33-34.492%201-52z'/%3e%3cpath%20fill='%236cafe0'%20d='M479.5%20386.5c1.465%205.09%202.132%2010.423%202%2016-.002%203.518-.335%206.851-1%2010a305.16%20305.16%200%200%200-1-26z'/%3e%3cpath%20fill='%231283cf'%20d='M-.5%20504.5h91v7h-91v-7z'/%3e%3c/svg%3e",fk="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIj4KICAgIDxyYWRpYWxHcmFkaWVudCBpZD0ibXlHcmFkaWVudCI+CiAgICAgICAgPHN0b3Agb2Zmc2V0PSIxMCUiIHN0b3AtY29sb3I9IiMxQzJENUYiIC8+CiAgICAgICAgPHN0b3Agb2Zmc2V0PSI5NSUiIHN0b3AtY29sb3I9IiMwQjFENTMiIC8+CiAgICA8L3JhZGlhbEdyYWRpZW50PgogICAgPHBhdGggZmlsbD0idXJsKCcjbXlHcmFkaWVudCcpIiBkPSJNLS4xLS4xaDUxMnY1MTJILS4xVi0uMXoiLz4KICAgIDxwYXRoIGZpbGw9IiNmOGY4ZmEiCiAgICAgICAgICBkPSJNNDgyLjUgMjMxLjV2NmgtMjVjL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oNDV2MThoLTQ1YzE0LjQ5LS45OTYgMjkuMTU3LTEuMzI5IDQ0LTF2LTE2Yy0xNC44NDMuMzI5LTI5LjUxLS4wMDQtNDQtMXoiLz4KICAgIDxwYXRoIGZpbGw9IiNhMmE5YmUiIGQ9Ik00MjguNSAyNzUuNWgtMjV2OGMtLjk3Ny0yLjc4Ny0xLjMxLTUuNzg3LTEtOSA4Ljg0OS0uMzI2IDE3LjUxNi4wMDcgMjYgMXoiLz4KICAgIDxwYXRoIGZpbGw9IiNhNWFjYmYiCiAgICAgICAgICBkPSJNMTEzLjUgMzAxLjVjLjk3OC4zMTEgMS42NDUuOTc4IDIgMmwtMTYgMWMtNS43MTEtLjAwNS0xMS4wNDQtLjY3Mi0xNi0yYTEyOC4xOSAxMjguMTkgMCAwIDAgMTUuNSAxYzUuMjE2LS4wMDYgMTAuMDQ5LS42NzMgMTQuNS0yeiIvPgogICAgPHBhdGggZmlsbD0iI2E1YWNjMCIgZD0iTTIzMy41IDIwOS41djk0aDY5di0xN2MtMTMuNTEuMzI5LTI2Ljg0NC0uMDA0LTQwLTFoNDF2MTloLTcxYTIyNTYuNDEgMjI1Ni40MSAwIDAgMSAxLTk1eiIvPgogICAgPHBhdGggZmlsbD0iI2E2YWNjMCIKICAgICAgICAgIGQ9Ik0zMTYuNSAyMDkuNWMtLjk5OCAzMS4xNjItMS4zMzIgNjIuNDk2LTEgOTRoNzN2LTE3Yy0xNC44NDMuMzI5LTI5LjUxLS4wMDQtNDQtMWg0NXYxOWgtNzVhMjMwNC45NSAyMzA0Ljk1IDAgMCAxIDEtOTZjLjYwNy4xMjQuOTQuNDU3IDEgMXoiLz4KPC9zdmc+";class vm extends _e.Component{isShowInstance;oldId;constructor(s){super(s),this.state={name:s.name,id:s.id,instance:s.instance||0,prefix:vm.getPrefix(s.id)},this.isShowInstance=!s.folder&&!!s.instances&&(!!s.instance||!!s.instances[0]||s.instances.length>1),this.oldId=s.id}static getPrefix(s){const i=(s||"").split(".");return i.pop(),i.join(".")}getId(s){return s=(s||"").replace(/[\\/\][*,;'"`<>?\s]/g,"_"),`${this.state.prefix}.${s}`}handleCancel=()=>{this.props.onClose()};handleOk=()=>{this.props.onRename(this.oldId,this.state.id,this.state.name,this.state.instance===0?0:this.state.instance||void 0),this.props.onClose()};handleChange=s=>{this.setState({name:s,id:this.getId(s)})};render(){return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"md",fullWidth:!0,open:!0,"aria-labelledby":"confirmation-dialog-title",children:[m.jsx(ss,{id:"confirmation-dialog-title",children:x.I18n.t("Rename")}),m.jsx(qt,{children:m.jsxs("form",{noValidate:!0,autoComplete:"off",children:[m.jsx(Eo,{variant:"standard",style:{width:"100%"},id:"standard-name",autoFocus:!0,label:x.I18n.t("Name"),value:this.state.name,onKeyUp:s=>{s.key==="Enter"&&(s.preventDefault(),setTimeout(()=>this.handleOk(),200))},onChange:s=>this.handleChange(s.target.value),margin:"normal"}),m.jsx(Eo,{variant:"standard",id:"standard-name-id",style:{width:"100%"},label:x.I18n.t("ID"),value:this.state.id,disabled:!0,margin:"normal"}),this.isShowInstance&&m.jsxs(Di,{variant:"standard",children:[m.jsx(xg,{htmlFor:"instance",children:x.I18n.t("Instance")}),m.jsx(Ai,{variant:"standard",value:this.state.instance,onChange:s=>this.setState({instance:parseInt(s.target.value,10)}),inputProps:{name:"instance",id:"instance"},children:this.props.instances.map(s=>m.jsx(it,{value:s,children:s||"0"},s))})]})]})}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",onClick:this.handleOk,color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Ok")}),m.jsx(He,{color:"grey",variant:"contained",onClick:this.handleCancel,startIcon:m.jsx(so,{}),children:x.I18n.t("Cancel")})]})]})}}class Cx extends _e.Component{constructor(s){super(s),this.state={name:s.name,id:s.id}}handleCancel=()=>{this.props.onClose()};handleOk=()=>{this.props.onDelete(this.state.id),this.props.onClose()};render(){return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"md",open:!0,"aria-labelledby":"confirmation-dialog-title",children:[m.jsx(ss,{id:"confirmation-dialog-title",children:x.I18n.t("Are you sure?")}),m.jsxs(qt,{children:[m.jsx(mc,{}),m.jsx("span",{style:{fontSize:14,fontWeight:"bold"},children:x.I18n.t("Delete %s",this.state.name)})]}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",onClick:this.handleOk,color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Ok")}),m.jsx(He,{color:"grey",variant:"contained",onClick:this.handleCancel,startIcon:m.jsx(so,{}),children:x.I18n.t("Cancel")})]})]})}}const Tx=""+new URL("tileJS-C48gYbHw.png",import.meta.url).href,Sx=""+new URL("tileTS-CsXmgy4B.png",import.meta.url).href,Ex=""+new URL("tileBlockly-BMpdinN3.png",import.meta.url).href,Ix=""+new URL("tileRules-BkbaFIhs.png",import.meta.url).href,jt={card:{maxWidth:345,minWidth:250,display:"inline-block",margin:"0 10px 0 10px"},media:{height:122},text:{maxWidth:218,minHeight:30},complexity:{fontWeight:"bold",fontStyle:"italic",marginBottom:8}};class Dn extends _e.Component{handleCancel=()=>{this.props.onClose()};static openHtml(s){const i=x.I18n.getLanguage();!s.includes("javascript.md")&&(i==="de"||i==="ru")&&(s=s.replace(/\/en\//,`/${i}/`));const r=window.open(s,"_blank");r==null||r.focus()}getJSCard(){return m.jsxs(Xl,{style:jt.card,children:[m.jsxs(Zl,{onClick:()=>this.props.onClose&&this.props.onClose("Javascript/js"),children:[m.jsx(Ql,{style:jt.media,image:Tx,title:"JavaScript"}),m.jsxs(ec,{children:[m.jsx("h2",{children:"JavaScript"}),m.jsx("div",{style:jt.complexity,children:x.I18n.t("for programmers")}),m.jsx("div",{style:jt.text,children:x.I18n.t("JS description")})]})]}),m.jsxs(tc,{children:[m.jsx(He,{size:"small",color:"primary",variant:"contained",onClick:()=>this.props.onClose&&this.props.onClose("Javascript/js"),children:x.I18n.t("Add")}),m.jsx(He,{size:"small",color:"secondary",onClick:()=>Dn.openHtml("https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/javascript.md"),children:x.I18n.t("Learn More")})]})]})}getTSCard(){return m.jsxs(Xl,{style:jt.card,children:[m.jsxs(Zl,{onClick:()=>this.props.onClose&&this.props.onClose("TypeScript/ts"),children:[m.jsx(Ql,{style:jt.media,image:Sx,title:"TypeScript"}),m.jsxs(ec,{children:[m.jsx("h2",{children:"TypeScript"}),m.jsx("div",{style:jt.complexity,children:x.I18n.t("for professionals")}),m.jsx("div",{style:jt.text,children:x.I18n.t("TS description")})]})]}),m.jsxs(tc,{children:[m.jsx(He,{size:"small",color:"primary",variant:"contained",onClick:()=>this.props.onClose&&this.props.onClose("TypeScript/ts"),children:x.I18n.t("Add")}),m.jsx(He,{size:"small",color:"secondary",onClick:()=>Dn.openHtml("https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/javascript.md"),children:x.I18n.t("Learn More")})]})]})}getBlocklyCard(){return m.jsxs(Xl,{style:jt.card,children:[m.jsxs(Zl,{onClick:()=>this.props.onClose&&this.props.onClose("Blockly"),children:[m.jsx(Ql,{style:jt.media,image:Ex,title:"Blockly"}),m.jsxs(ec,{children:[m.jsx("h2",{children:"Blockly"}),m.jsx("div",{style:jt.complexity,children:x.I18n.t("normal")}),m.jsx("div",{style:jt.text,children:x.I18n.t("Blockly description")})]})]}),m.jsxs(tc,{children:[m.jsx(He,{size:"small",color:"primary",variant:"contained",onClick:()=>this.props.onClose&&this.props.onClose("Blockly"),children:x.I18n.t("Add")}),m.jsx(He,{size:"small",color:"secondary",onClick:()=>Dn.openHtml("https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/blockly.md"),children:x.I18n.t("Learn More")})]})]})}getRulesCard(){return m.jsxs(Xl,{style:jt.card,children:[m.jsxs(Zl,{onClick:()=>this.props.onClose&&this.props.onClose("Rules"),children:[m.jsx(Ql,{style:jt.media,image:Ix,title:"Rules"}),m.jsxs(ec,{children:[m.jsx("h2",{children:"Rules"}),m.jsx("div",{style:jt.complexity,children:x.I18n.t("easy")}),m.jsx("div",{style:jt.text,children:x.I18n.t("Rules description")})]})]}),m.jsxs(tc,{children:[m.jsx(He,{size:"small",color:"primary",variant:"contained",onClick:()=>this.props.onClose&&this.props.onClose("Rules"),children:x.I18n.t("Add")}),m.jsx(He,{size:"small",color:"secondary",onClick:()=>Dn.openHtml("https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/javascript.md"),children:x.I18n.t("Learn More")})]})]})}render(){return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"lg",fullWidth:!0,open:!0,"aria-labelledby":"confirmation-dialog-title",children:[m.jsx(ss,{id:"confirmation-dialog-title",children:x.I18n.t("Add new script")}),m.jsxs(qt,{style:{textAlign:"center"},children:[this.getRulesCard(),this.getBlocklyCard(),this.getJSCard(),this.getTSCard()]}),m.jsx(Ht,{children:m.jsx(He,{color:"grey",onClick:this.handleCancel,startIcon:m.jsx(so,{}),children:x.I18n.t("Cancel")})})]})}}class og extends _e.Component{isShowInstance;constructor(s){super(s),this.state={name:s.name||"Script",instance:s.instance||0,parent:s.parent,error:"",id:""},this.isShowInstance=!s.folder&&!!s.instances&&(!!s.instance||!!s.instances[0]||s.instances.length>1)}getId(s){return s=s||this.state.name||"",s=s.replace(/[\\/\][.*,;'"`<>?\s]/g,"_").trim().replace(/\.$/,"_"),`${this.state?this.state.parent:this.props.parent}.${s}`}handleOk=()=>{this.props.onAdd(this.getId(this.state.name),this.state.name,this.state.instance,this.props.type),this.props.onClose()};render(){var s;return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"md",fullWidth:!0,open:!0,"aria-labelledby":"confirmation-dialog-title",children:[m.jsx(ss,{id:"confirmation-dialog-title",children:this.props.title||x.I18n.t("Create new")}),m.jsx(qt,{children:m.jsxs("form",{noValidate:!0,autoComplete:"off",children:[m.jsx(Eo,{variant:"standard",style:{width:"100%"},id:"standard-name",autoFocus:!0,error:!!this.state.error,label:x.I18n.t("Name"),value:this.state.name||"",helperText:this.state.error,slotProps:{input:{endAdornment:this.state.name?m.jsx(qe,{size:"small",onClick:()=>this.setState({name:""}),children:m.jsx(ZT,{})}):void 0}},onKeyUp:i=>{i.preventDefault(),i.key==="Enter"&&!this.state.error&&setTimeout(()=>this.handleOk(),200)},onChange:i=>{var c;const r=i.target.value,l=this.getId(r);r?(c=this.props.existingItems)!=null&&c.includes(l)?this.setState({name:r,id:l,error:x.I18n.t("Duplicate name")}):this.setState({name:r,id:l,error:""}):this.setState({name:r,id:l,error:x.I18n.t("Empty name is not allowed")})},margin:"normal"}),m.jsxs(Di,{variant:"standard",style:{width:"100%"},children:[m.jsx(xg,{htmlFor:"parent",children:x.I18n.t("Folder")}),m.jsx(Ai,{variant:"standard",style:{width:"100%"},value:this.state.parent,onChange:i=>this.setState({parent:i.target.value}),inputProps:{name:"parent",id:"parent"},children:this.props.parents.map(i=>{const r=i.id.split(".");r.splice(0,2);const l=[];let c="script.js";return r.forEach(d=>{c+=`.${d}`;const h=this.props.parents.find(p=>p.id===c);h?l.push(h.name):l.push(d)}),l.length||l.push(i.name),m.jsx(it,{value:i.id,children:l.join(" / ")},i.id)})})]}),m.jsx(Eo,{variant:"standard",id:"standard-name-id",style:{width:"100%"},label:x.I18n.t("ID"),value:this.getId(),disabled:!0,margin:"normal"}),this.isShowInstance&&m.jsxs(Di,{variant:"standard",children:[m.jsx(xg,{htmlFor:"instance",children:x.I18n.t("Instance")}),m.jsx(Ai,{variant:"standard",value:this.state.instance,onChange:i=>this.setState({instance:parseInt(i.target.value,10)}),inputProps:{name:"instance",id:"instance"},children:(s=this.props.instances)==null?void 0:s.map(i=>m.jsx(it,{value:i,children:i||"0"},`instance${i}`))})]})]})}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",onClick:this.handleOk,disabled:!!this.state.error,color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Ok")}),m.jsx(He,{color:"grey",variant:"contained",onClick:()=>this.props.onClose(),startIcon:m.jsx(so,{}),children:x.I18n.t("Cancel")})]})]})}}const xx={title:a=>({background:a.palette.error.main,color:a.palette.error.contrastText,"&>h2":{color:a.palette.error.contrastText}})};class su extends _e.Component{handleOk=()=>{this.props.onClose()};render(){return m.jsxs(Ut,{open:!0,maxWidth:"sm",fullWidth:!0,onClose:()=>this.handleOk(),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[m.jsx(ss,{sx:xx.title,id:"alert-dialog-title",children:this.props.title||x.I18n.t("Error")}),m.jsx(qt,{children:m.jsx(Dw,{id:"alert-dialog-description",children:this.props.text||x.I18n.t("Unknown error!")})}),m.jsx(Ht,{children:m.jsx(He,{variant:"contained",onClick:()=>this.handleOk(),color:"primary",autoFocus:!0,startIcon:m.jsx(qo,{}),children:x.I18n.t("Ok")})})]})}}const zr={icon:{width:24,height:24},filterWithButton:{width:"100%"},title:{fontWeight:"bold",marginTop:16}};class Dx extends _e.Component{constructor(s){super(s),this.state={instances:[],filter:window.localStorage.getItem("javascript.debug.filter")||"",showAskForStop:!1,jsInstance:window.localStorage.getItem("javascript.debug.instance")||"",jsInstanceHost:"",adapterToDebug:window.localStorage.getItem("javascript.debug.adapter")||""}}componentDidMount(){this.props.socket.getAdapterInstances().then(s=>{const i=s.filter(h=>{var p;return h&&!((p=h.common)!=null&&p.onlyWWW)}).map(h=>{var b,y,w;const p=h._id.replace(/^system\.adapter\./,""),[f]=p.split(".");return{id:p,enabled:(b=h.common)==null?void 0:b.enabled,host:(y=h.common)==null?void 0:y.host,icon:(w=h.common)!=null&&w.icon?`../../adapter/${f}/${h.common.icon}`:""}});i.sort((h,p)=>h.id>p.id?1:h.idh.id===this.state.jsInstance):null;let c;if(!this.state.jsInstance||!l){const h=i.find(p=>p.id.startsWith("javascript."));c=(h==null?void 0:h.host)||"",r=(h==null?void 0:h.id)||""}else c=(l==null?void 0:l.host)||"";let d=this.state.adapterToDebug||"";d&&!i.find(h=>h.id===d)&&(d=""),this.setState({instances:i,jsInstance:r,adapterToDebug:d,jsInstanceHost:c})})}handleOk=()=>{var s;if((s=this.state.instances.find(i=>i.id===this.state.adapterToDebug))!=null&&s.enabled){this.props.socket.getObject(`system.adapter.${this.state.adapterToDebug}`).then(i=>{i&&(i.common.enabled=!1,this.props.socket.setObject(i._id,i).then(()=>this.props.onDebug(this.state.jsInstance,this.state.adapterToDebug)))});return}this.props.onDebug(this.state.jsInstance,this.state.adapterToDebug)};renderJavascriptList(){const s=this.state.instances.filter(i=>i.id.startsWith("javascript."));return s.length<2?null:m.jsxs(Si,{children:[m.jsx("div",{style:zr.title,children:x.I18n.t("Host")}),m.jsx(Dg,{component:"nav",children:s.map(i=>m.jsxs(e_,{component:"div",selected:this.state.jsInstance===i.id,onClick:()=>this.setState({jsInstance:i.id,jsInstanceHost:i.host}),children:[m.jsx(Ag,{children:m.jsx("img",{src:i.icon,alt:i.id,style:zr.icon})}),m.jsx(Og,{primary:i.id})]},i.id))})]})}renderInstances(){if(!this.state.jsInstance)return m.jsx(Si,{});const s=this.state.instances.filter(i=>i.id!==this.state.jsInstance&&i.host===this.state.jsInstanceHost&&(!this.state.filter||i.id.includes(this.state.filter.toLowerCase())));return m.jsxs(Si,{children:[m.jsx("div",{style:zr.title,children:x.I18n.t("Instances")}),m.jsx(Dg,{component:"nav",children:s.map(i=>m.jsxs(e_,{selected:this.state.adapterToDebug===i.id,onDoubleClick:()=>this.setState({adapterToDebug:i.id},()=>this.handleOk()),onClick:()=>this.setState({adapterToDebug:i.id}),children:[m.jsx(Ag,{children:m.jsx("img",{src:i.icon,alt:i.id,style:zr.icon})}),m.jsx(Og,{primary:i.id})]},i.id))})]})}render(){return m.jsxs(Ut,{maxWidth:"md",fullWidth:!1,open:!0,onClose:()=>!1,"aria-labelledby":"confirmation-dialog-title",children:[m.jsx(ss,{id:"confirmation-dialog-title",children:this.props.title||x.I18n.t("Debug instance")}),m.jsx(qt,{children:m.jsxs(Si,{container:!0,direction:"column",children:[m.jsx(Si,{children:m.jsx(Pn,{style:zr.filterWithButton,value:this.state.filter,placeholder:x.I18n.t("Filter"),onChange:s=>{this.setState({filter:s.target.value}),window.localStorage.setItem("javascript.debug.filter",s.target.value)},endAdornment:m.jsx(Aw,{position:"end",children:this.state.filter?m.jsx(qe,{size:"small","aria-label":"toggle password visibility",onClick:()=>this.setState({filter:""}),children:m.jsx(Mw,{})}):""})})}),m.jsx(Si,{children:m.jsxs(Si,{container:!0,children:[this.renderJavascriptList(),this.renderInstances()]})})]})}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",onClick:this.handleOk,disabled:!this.state.jsInstance||!this.state.adapterToDebug,color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Start")}),m.jsx(He,{color:"grey",variant:"contained",onClick:()=>this.props.onClose(),startIcon:m.jsx(so,{}),children:x.I18n.t("Close")})]})]})}}function $k(a){if(!a)throw new Error("Password must be a non-empty string.")}function Hg(a){return new TextEncoder().encode(a)}function Ax(a){return new TextDecoder().decode(a)}function Ox(a){let s="";for(let i=0;i({height:a.toolbar.height}),toolbarButtons:a=>({color:a.palette.mode==="dark"?"white !important":"black !important"}),iconButtonsDisabled:{filter:"grayscale(100%)",opacity:.5},toolbarSearch:{width:"calc(100% - 105px)",lineHeight:"34px",marginLeft:5},iconButtons:{width:32,height:32,padding:2},iconDropdownMenu:{paddingRight:5},menu:{width:"100%",height:"100%"},innerMenu:{width:"100%",height:"calc(100% - 76px)",overflowX:"hidden",overflowY:"auto"},listItemIcon:{minWidth:32},scriptIcon:{width:18,height:18,borderRadius:2,marginTop:4,marginBottom:4,marginLeft:8,marginRight:4},folder:{cursor:"pointer",padding:0,userSelect:"none"},folderReorder:{opacity:.3,transitionDuration:"0.5s",transitionProperty:"opacity"},folderIcon:{width:20,height:20},folderIconReorder:{paddingTop:4,paddingBottom:4,paddingLeft:8,paddingRight:4},folderIconNoReorder:{cursor:"pointer",paddingTop:4,paddingBottom:4,paddingLeft:8,paddingRight:4},script:{cursor:"pointer",padding:0,userSelect:"none"},scriptReorder:{opacity:1,transitionDuration:"0.5s",transitionProperty:"opacity"},reorder:{},selected:window.vendorPrefix?a=>({backgroundColor:a.palette.primary.main,color:a.palette.text.primary}):{backgroundColor:"#164477",color:"white"},instances:{color:"gray",fontSize:"smaller"},childrenCount:{fontSize:10,opacity:.4},footer:{height:24,display:"flex"},footerButtons:a=>({"& img":{color:a.palette.mode==="dark"?"#ffffff":"#111111",cursor:"pointer",mt:"1px",mr:"2px",height:22,width:22,"&:hover":{backgroundColor:"#dbdbdb"}},"& svg":{color:a.palette.mode==="dark"?"#ffffff":"#111111",cursor:"pointer",mt:"1px",mr:"2px",height:22,width:22,"&:hover":{backgroundColor:"#dbdbdb"}}}),footerButtonsRight:{float:"right"}},Tn={Blockly:gk,"Javascript/js":Tc,def:Tc,Rules:fk,"TypeScript/ts":mk};function Gg(a,s,i){var r;return i=i||x.I18n.getLanguage(),(r=s==null?void 0:s.common)!=null&&r.name?typeof s.common.name=="object"?(s.common.name[i]||s.common.name.en||a.replace(/^script\.js./,"")).toString():s.common.name.toString():a.replace(/^script\.js./,"")}function E_(a){var l;const s=[{id:Jt,depth:0,index:0,parent:null,title:"root",type:"folder",parentIndex:null}],i=Object.keys(a);for(let c=0;c1?h.join("."):null,instance:d.common.engine?parseInt(d.common.engine.split(".").pop(),10)||0:null,index:0,parentIndex:0}):s.push({id:i[c],title:Gg(i[c],d),depth:h.length-1,type:"folder",parent:h.length>1?h.join("."):null,index:0,parentIndex:null})}let r;do r=!1,s.forEach(c=>{if(c.parent&&!s.find(h=>h.id===c.parent)){const h=c.parent.split(".");h.pop(),s.push({id:c.parent,title:c.parent.split(".").pop()||"",depth:h.length-1,type:"folder",parent:h.length>1?h.join("."):null,index:0,parentIndex:null}),r=!0}});while(r);return s.sort((c,d)=>{const h=c.id.toLowerCase(),p=d.id.toLowerCase();return c.type==="folder"&&d.type!=="folder"?-1:d.type==="folder"&&c.type!=="folder"||h>p?1:hc.index=d),s.forEach(c=>{if(c.parent){const d=s.find(h=>h.id===c.parent);d&&(c.parentIndex=d.index)}}),s}function Lx(a){const{onDrop:s}=a,[{isOver:i,isOverAny:r},l]=WI({accept:"script",drop:c=>i?s(c):void 0,collect:c=>({isOver:c.isOver({shallow:!0}),isOverAny:c.isOver()})});return m.jsx("div",{ref:l,style:{background:i?"#40adff":void 0,opacity:r?.7:void 0},children:a.children},a.folderName)}function I_(a){const{name:s}=a,[{opacity:i},r]=LI({type:"script",item:()=>({name:s}),collect:l=>({opacity:l.isDragging()?.3:1})});return m.jsx("div",{ref:r,style:{opacity:i,transform:"translate3d(0, 0, 0)"},children:a.children},s)}class So extends _e.Component{inputRef;filterTimer;problems;problemsTimer;onProblemUpdatedBound;parent=null;constructor(s){super(s);const i=window.localStorage?window.localStorage.getItem("SideMenu.expanded"):"[]";let r;try{r=JSON.parse(i||"[]")||[]}catch{r=[]}this.inputRef=_e.createRef(),this.state={listItems:E_(s.scripts||{}),expanded:r,problems:[],reorder:!1,themeName:this.props.themeName,selected:window.localStorage&&window.localStorage.getItem("SideMenu.selected")||null,creatingScript:null,creatingFolder:!1,copingScript:"",renaming:null,deleting:null,choosingType:!1,errorText:"",instances:s.instances||[],menuOpened:!1,menuAnchorEl:null,menuAnchorFilterEl:null,searchMode:!1,expertMode:this.props.expertMode,searchText:"",width:this.props.width||300,typeFilter:window.localStorage&&window.localStorage.getItem("SideMenu.typeFilter")||"",statusFilter:window.localStorage&&window.localStorage.getItem("SideMenu.statusFilter")||"",runningInstances:this.props.runningInstances||{},scriptsHash:s.scriptsHash,showAdapterDebug:!1,isAllZeroInstances:!1,showExportDialog:!1};const l=this.ensureSelectedIsVisible();l&&Object.assign(this.state,{expanded:l}),this.filterTimer=null,Object.assign(this.state,{isAllZeroInstances:this.getIsAllZeroInstances()}),this.problems=null,this.problemsTimer=null,this.onProblemUpdatedBound=this.onProblemUpdated.bind(this)}readProblems(s,i){var r,l;if(i||(i=Object.keys(this.props.scripts)),!i||!i.length)s&&s();else{const c=i.shift(),d=this.props.scripts[c];if(((r=this.props.scripts)==null?void 0:r[c].type)==="script"&&((l=d.common)!=null&&l.enabled)&&!c.match(/^script\.js\.global\./)){const h=d.common.engine.split(".").pop(),p=this,f=`javascript.${h}.scriptProblem.${c.substring(Jt.length+1)}`;this.props.socket.getState(f).then(b=>{p.onProblemUpdated(f,b),setTimeout(()=>p.readProblems(s,i),0)})}else setTimeout(()=>this.readProblems(s,i),0)}}componentDidMount(){this.readProblems(()=>{this.props.instances.forEach(s=>{this.props.socket.subscribeState(`javascript.${s}.scriptProblem.*`,this.onProblemUpdatedBound)})})}componentWillUnmount(){this.props.instances.forEach(s=>{this.props.socket.unsubscribeState(`javascript.${s}.scriptProblem.*`,this.onProblemUpdatedBound)})}onProblemUpdated(s,i){if(!i||!s)return;s=`${Jt}.${s.replace(/^javascript\.\d+\.scriptProblem\./,"")}`,this.problems||(this.problems=JSON.parse(JSON.stringify(this.state.problems))||[]);let r=!1;if(i.val)this.problems.includes(s)||(this.problems.push(s),r=!0);else{const l=this.problems.indexOf(s);l!==-1&&(this.problems.splice(l,1),r=!0)}r&&!this.problemsTimer&&(this.problemsTimer=setTimeout(()=>{this.problemsTimer=null,this.setState({problems:this.problems}),this.problems=null},300))}static filterListStatic(s,i,r,l,c){i=JSON.parse(JSON.stringify(i));let d=!1;const h={listItems:i};if(s&&r&&l){const p=l.toLowerCase();if(i.forEach(f=>{var v;const b=f.title.toLowerCase();f.filteredPartly=!1;let y=b.includes(p);const w=(v=c==null?void 0:c[f.id])==null?void 0:v.common;if(!y&&(w!=null&&w.source))if(w.engineType==="Blockly"){const _=w.source.lastIndexOf("//");y=w.source.substring(0,_).toLowerCase().includes(p)}else y=w.source.toLowerCase().includes(p);y?f.filtered&&(f.filtered=!1,d=!0):f.filtered||(f.filtered=!0,d=!0)}),d)for(let f=i.length-1;f>=0;f--){const b=i[f];if(!b.filtered||b.filteredPartly){let y=b;do y!=null&&y.parent&&i[y.parentIndex]&&(d=!0,i[y.parentIndex].filteredPartly=!0),y=y!=null&&y.parent&&i[y.parentIndex]?i[y.parentIndex]:null;while(y)}}}else i.forEach(p=>{(p.filtered||p.filteredPartly)&&(p.filtered=!1,p.filteredPartly=!1,d=!0)}),s||(h.searchText="",h.searchMode=!1,d=!0);return d?h:null}filterList(s,i){const r=So.filterListStatic(s,this.state.listItems,this.state.searchMode,this.state.searchText,this.props.scripts);r?this.setState(r,()=>i&&i()):i&&i()}static ensureSelectedIsVisibleStatic(s,i,r){i=JSON.parse(JSON.stringify(i));let l=!1,c=typeof s=="object"?s:r.find(d=>d.id===s);do{if(c!=null&&c.parent){const d=c.parent;c=r.find(h=>h.id===d)}else c=void 0;c&&(i.includes(c.id)||(i.push(c.id),l=!0))}while(c);return l?i:null}ensureSelectedIsVisible(s,i){return So.ensureSelectedIsVisibleStatic(s||this.state.selected,i||this.state.expanded,this.state.listItems)}static getDerivedStateFromProps(s,i){const r={};let l=!1;if(i.expertMode!==s.expertMode&&(l=!0,r.expertMode=s.expertMode),i.scriptsHash!==s.scriptsHash&&s.scripts){const c=E_(s.scripts||{});if(r.listItems=c,i.searchText){const p=So.filterListStatic(!0,c,i.searchMode,i.searchText,s.scripts);p&&Object.assign(r,p)}const d=So.getIsAllZeroInstancesStatic(c,s.instances||[]),h=So.ensureSelectedIsVisibleStatic(i.selected,i.expanded,i.listItems);r.isAllZeroInstances=d,h&&(r.expanded=h),l=!0}if(i.width!==s.width&&(l=!0,r.width=s.width),i.themeName!==s.themeName&&(l=!0,r.themeName=s.themeName),s.selectId&&i.selected!==s.selectId){const c=i.listItems.find(d=>d.id===s.selectId);if(!i.reorder&&c){const d=So.ensureSelectedIsVisibleStatic(c,i.expanded,i.listItems);r.selected=c.id,d&&(r.expanded=d),l=!0,window.localStorage&&window.localStorage.setItem("SideMenu.selected",c.id)}}return l?r:null}static getIsAllZeroInstancesStatic(s,i){let r=!i[0]&&i.length<=1;return r&&s.forEach(l=>{l.type!=="folder"&&l.instance!==0&&(r=!1)}),r}getIsAllZeroInstances(s,i){return s=s||this.state.listItems,i=i||this.state.instances,So.getIsAllZeroInstancesStatic(s||this.state.listItems,i||this.state.instances)}saveExpanded(s){window.localStorage.setItem("SideMenu.expanded",JSON.stringify(s||this.state.expanded))}showError(s){this.setState({errorText:s})}onToggle(s,i){if(i==null||i.stopPropagation(),s===Jt)return;const r=[...this.state.expanded],l=r.indexOf(s);l!==-1?(r.splice(l,1),this.state.selected&&this.state.selected.startsWith(`${s}.`)&&window.localStorage&&window.localStorage.setItem("SideMenu.selected",s)):(r.push(s),r.sort()),this.setState({expanded:r}),this.saveExpanded(r)}renderItemButtonsOnEnd(s,i){if(this.state.reorder)return null;if(s.type!=="folder"){let r=s.enabled?C_:S_;return s.enabled&&this.state.problems.includes(s.id)&&(r=T_),[m.jsx(qe,{onClick:l=>{l.stopPropagation(),this.props.onEnableDisable&&this.props.onEnableDisable(s.id,!s.enabled)},title:s.enabled?x.I18n.t("Pause script"):x.I18n.t("Run script"),disabled:this.props.debugMode,style:{...Pe.iconButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0,color:r},size:"medium",children:s.enabled?m.jsx(bc,{}):m.jsx(Ug,{})},"startStop"),this.state.width>Ur?m.jsx(qe,{style:this.props.debugMode?Pe.iconButtonsDisabled:void 0,title:x.I18n.t("Delete script"),disabled:s.id===To||s.id===Cn||this.props.debugMode,onClick:l=>this.onDelete(s,l),size:"medium",children:m.jsx(mc,{})},"delete"):null,m.jsx(qe,{style:this.props.debugMode?Pe.iconButtonsDisabled:void 0,disabled:this.props.debugMode,title:x.I18n.t("Edit script or just double click"),onClick:l=>this.onEdit(s,l),size:"medium",children:m.jsx(px,{})},"openInEdit")]}return this.state.width>Ur&&s.id!==Jt&&s.id!==Cn&&s.id!==To&&!(i!=null&&i.length)?m.jsx(qe,{style:this.props.debugMode?Pe.iconButtonsDisabled:void 0,title:x.I18n.t("Delete folder"),disabled:s.id===To||s.id===Cn||this.props.debugMode,onClick:r=>this.onDelete(s,r),size:"medium",children:m.jsx(mc,{})},"delete"):null}onDelete(s,i){return i==null||i.stopPropagation(),new Promise(r=>{if(!s){r();return}typeof s!="object"?this.setState({deleting:s},()=>r()):this.setState({deleting:s.id},()=>r())})}onEdit(s,i){this.onClick(s,i),this.props.onEdit&&this.props.onEdit(s.id)}getTextStyle(s){return!this.state.reorder&&s.type!=="folder"?{width:`calc(100% - ${this.state.width>Ur?185:137}px)`,overflow:"hidden",whiteSpace:"nowrap",flex:"none",padding:"0 16px 0 0"}:{whiteSpace:"nowrap",padding:"0 16px 0 0"}}onClick(s,i){if(i==null||i.stopPropagation(),!this.state.reorder&&s){const r=this.ensureSelectedIsVisible(s),l={selected:s.id};r&&(l.expanded=r),this.setState(l),window.localStorage&&window.localStorage.setItem("SideMenu.selected",s.id)}}onDblClick(s,i){i==null||i.stopPropagation(),!this.state.reorder&&(s.type==="folder"?this.onToggle(s.id):this.onEdit(s))}isFilteredOut(s){var i,r;return s.filtered&&!s.filteredPartly||this.state.typeFilter&&s.type!=="folder"&&s.type.toLowerCase()!==this.state.typeFilter.toLowerCase()||!this.state.expertMode&&((r=(i=this.props.scripts[s.id])==null?void 0:i.native)!=null&&r.protected)||this.state.statusFilter&&s.type!=="folder"&&(this.state.statusFilter==="running"&&!s.enabled||this.state.statusFilter==="paused"&&s.enabled||this.state.statusFilter==="problems"&&(!s.enabled||this.state.problems.indexOf(s.id)===-1))?!0:s.id===To&&!this.state.expertMode}renderListItem(s,i,r){var w,v;if(s.id===Jt&&!this.state.reorder)return null;const l=(this.state.reorder?s.depth:s.depth-1)*Mx;let c=s.title;if(this.state.searchText){const _=c.toLowerCase().indexOf(this.state.searchText.toLowerCase());_!==-1&&(c=[m.jsx("span",{children:c.substring(0,_)},"first"),m.jsx("span",{style:{color:"orange"},children:c.substring(_,_+this.state.searchText.length)},"second"),m.jsx("span",{children:c.substring(_+this.state.searchText.length)},"third")])}!this.state.isAllZeroInstances&&s.type!=="folder"&&(c=[m.jsx("span",{children:c},"title"),m.jsxs("span",{title:x.I18n.t("Instance"),style:Pe.instances,children:["[",s.instance,"]"]},"instance")]);const d=this.state.reorder&&!this.props.debugMode,h={marginLeft:l,cursor:s.type==="folder"&&d?"default":"inherit",width:`calc(100% - ${l}px)`};d||(h.opacity=s.filteredPartly?.5:1),s.id===To&&s.id!==this.state.selected&&(h.color="#00a200");let p=s.id===Jt;!p&&i&&(p=this.state.expanded.includes(s.id));let f;s.type==="folder"?f={...Pe.folderIcon,...d?Pe.folderIconReorder:Pe.folderIconNoReorder}:f={...Pe.scriptIcon},s.id===To?f.color="#356956":s.id===Cn&&(f.color="#4899e1");let b=null;(r&&r.length||i&&i.length)&&(b=m.jsx("span",{style:Pe.childrenCount,children:r&&r.length!==i.length?`${r.length}(${i.length})`:i.length}));const y={...s.type==="folder"?Pe.folder:Pe.script,...d?Pe.reorder:void 0,...d&&s.type!=="folder"?Pe.scriptReorder:void 0,...d&&s.type==="folder"?Pe.folderReorder:void 0,...h};return m.jsxs(LT,{style:y,sx:s.id===this.state.selected&&!d?Pe.selected:void 0,className:x.Utils.clsx(d&&s.type==="folder"&&"folder-reorder",d&&s.type!=="folder"&&"script-reorder"),onClick:_=>this.onClick(s,_),onDoubleClick:_=>this.onDblClick(s,_),secondaryAction:this.renderItemButtonsOnEnd(s,i),children:[(v=(w=this.props.scripts[s.id])==null?void 0:w.native)!=null&&v.protected?m.jsx(k_,{style:{color:"orange",position:"absolute",right:5,width:10,height:10}}):null,m.jsx(Ag,{style:Pe.listItemIcon,children:s.type==="folder"?d||p?m.jsx(QT,{style:f,onClick:_=>!d&&this.onToggle(s.id,_)}):m.jsx(eS,{style:f,onClick:_=>!d&&this.onToggle(s.id,_)}):m.jsx("img",{style:f,alt:s.type,src:Tn[s.type]||Tn.def})}),m.jsx(Og,{sx:{"& .MuiListItemText-primary":s.id===this.state.selected&&!d?Pe.selected:void 0},style:this.getTextStyle(s),primary:m.jsxs("span",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[c,b]})})]},s.id)}onDragFinish(s,i){let r=`${i}.${s.split(".").pop()}`;r!==s&&(this.state.listItems.find(l=>l.id===r)&&(r+=`_${x.I18n.t("copy")}`),this.props.onRename&&this.props.onRename(s,r))}renderOneItem(s,i){const r=this.state.statusFilter||this.state.typeFilter?s.filter(f=>f.parent===i.id?!this.isFilteredOut(f):!1):[],l=s.filter(f=>f.parent===i.id);if(this.isFilteredOut(i)||i.type==="folder"&&(this.state.statusFilter||this.state.typeFilter)&&!r.length)return null;const c=this.state.reorder&&!this.props.debugMode,d=this.renderListItem(i,l,r),h=[];let p;return l&&(c||this.state.expanded.includes(i.id)||i.id===Jt)&&(p=l.map(f=>this.renderOneItem(s,f))),c?i.type==="folder"?h.push(m.jsxs(Lx,{onDrop:f=>this.onDragFinish(f.name,i.id),folderName:i.id,children:[m.jsx(I_,{name:i.id,children:d},`draggable_${i.id}`),p||null]},`droppable_${i.id}`)):h.push(m.jsxs(I_,{name:i.id,children:[d,p||null]},`draggable_${i.id}`)):(h.push(d),p==null||p.forEach(f=>h.push(f))),h}renderAllItems(s){const i=s.filter(r=>!r.parent).map(r=>this.renderOneItem(s,r));return m.jsx(Dg,{dense:!0,disablePadding:!0,sx:Pe.mainList,children:i})}onAddNew(s){s==null||s.stopPropagation();let i=this.state.listItems.find(l=>l.id===this.state.selected),r=Jt;for(;i&&i.type!=="folder";)i=this.state.listItems[i.parentIndex];i&&(r=i.id),this.parent=r,this.setState({choosingType:!0})}onCopy(s,i){s==null||s.stopPropagation();let r=this.state.listItems.find(c=>c.id===i),l=Jt;for(;r&&r.type!=="folder";)r=this.state.listItems[r.parentIndex];r&&(l=r.id),this.parent=l,this.setState({copingScript:i||""})}onAddNewFolder(s){s==null||s.stopPropagation();let i=this.state.listItems.find(l=>l.id===this.state.selected),r=Jt;for(;i&&i.type!=="folder";)i=this.state.listItems[i.parentIndex];i&&(r=i.id),this.parent=r,this.setState({creatingFolder:!0})}onRename(s){s==null||s.stopPropagation(),this.setState({renaming:this.state.selected})}getUniqueName(s){let i=1,r=`${x.I18n.t("Script")} `;if(s){const l=Gg(s,this.props.scripts[s]),c=l.match(/\d+$/);c?(r=l.replace(/\d+$/,""),i=parseInt(c[0],10)+1):r=l}for(;this.state.listItems.find(l=>l.id===`${this.parent}.${r.replace(/\.\s/g,"_")}${i}`);)i++;return r+i}getUniqueFolderName(){let s=1;for(;this.state.listItems.find(i=>i.id===`${this.parent}.${x.I18n.t("Folder")}_${s}`);)s++;return`${x.I18n.t("Folder")} ${s}`}onCloseMenu(s){this.setState({menuOpened:!1,menuAnchorEl:null,menuAnchorFilterEl:null},s)}getMainMenu(s,i){var l,c,d,h;const r=this.state.expertMode&&!!Object.keys(this.props.changedScripts).find(p=>{var f,b;return this.props.changedScripts[p]&&((b=(f=this.props.scripts[p])==null?void 0:f.native)==null?void 0:b.protected)});return m.jsxs(dm,{id:"long-menu",anchorEl:this.state.menuAnchorEl,open:this.state.menuOpened,onClose:()=>this.setState({menuOpened:!1,menuAnchorEl:null}),slotProps:{paper:{style:{maxHeight:Nx*7.5}}},children:[this.state.width<=Ur?m.jsxs(it,{disabled:this.props.debugMode||!this.state.selected||this.state.selected===To||this.state.selected===Cn||!!(s!=null&&s.length),onClick:p=>{if(p.stopPropagation(),p.preventDefault(),this.state.listItems.find(f=>f.parent===this.state.selected)){this.showError(x.I18n.t("Cannot delete non empty item!"));return}this.setState({menuOpened:!1,menuAnchorEl:null},()=>this.onDelete(this.state.selected).then(()=>{}))},children:[m.jsx(mc,{style:{...Pe.iconDropdownMenu,color:"red"}}),x.I18n.t("Delete")]},"delete"):null,m.jsxs(it,{disabled:this.props.debugMode||r,selected:this.state.expertMode,onClick:p=>{p.stopPropagation(),p.preventDefault(),this.onCloseMenu(()=>this.props.onExpertModeChange&&this.props.onExpertModeChange(!this.state.expertMode))},children:[m.jsx(x.IconExpert,{style:{...Pe.iconDropdownMenu,color:this.state.expertMode?"orange":"inherit"}}),x.I18n.t("Expert mode")]},"expertMode"),this.props.onExport&&m.jsxs(it,{onClick:p=>{p.stopPropagation(),p.preventDefault(),this.onCloseMenu(()=>this.setState({showExportDialog:!0}))},children:[m.jsx(kc,{style:Pe.iconDropdownMenu}),x.I18n.t("Export all scripts")]},"exportAll"),this.props.onImport&&m.jsxs(it,{disabled:this.props.debugMode,onClick:p=>{p.stopPropagation(),p.preventDefault(),this.onCloseMenu(()=>this.props.onImport())},children:[m.jsx(Ng,{style:Pe.iconDropdownMenu}),x.I18n.t("Import scripts")]},"import"),this.props.onThemeChange&&m.jsxs(it,{onClick:()=>this.onCloseMenu(()=>{this.props.onThemeChange&&this.props.onThemeChange(x.Utils.toggleTheme(this.state.themeName))}),children:[m.jsx(mx,{style:Pe.iconDropdownMenu}),x.I18n.t('Change theme (actual "%s")',this.state.themeName)]},"dark"),this.props.onAddNew&&m.jsxs(it,{disabled:!this.state.selected||!i||i.type==="folder",onClick:p=>{const f=this.state.selected;this.onCloseMenu(()=>this.onCopy(p,f))},children:[m.jsx(tS,{style:Pe.iconDropdownMenu}),x.I18n.t("Copy script")]},"copy"),this.state.expertMode&&m.jsxs(it,{disabled:this.props.debugMode,onClick:p=>{p.stopPropagation(),p.preventDefault(),this.onCloseMenu(()=>this.setState({showAdapterDebug:!0}))},children:[m.jsx(lx,{style:Pe.iconDropdownMenu}),x.I18n.t("Debug instance")]},"debugInstance"),this.state.selected&&this.props.password&&this.props.scripts[this.state.selected].type==="script"?m.jsxs(it,{disabled:this.props.debugMode||this.props.changedScripts[this.state.selected],onClick:p=>{p.stopPropagation(),p.preventDefault(),this.onCloseMenu(async()=>{var b;const f=await this.props.socket.getObject(this.state.selected);f&&((b=f.native)!=null&&b.protected?(delete f.native.protected,f.common.source=Wg(this.props.password,f.common.source||"")):(f.native||={},f.native.protected=!0,f.common.source=vc(this.props.password,f.common.source||"")),await this.props.socket.setObject(f._id,f))})},children:[m.jsx(k_,{style:{...Pe.iconDropdownMenu,color:"orange"}}),(c=(l=this.props.scripts[this.state.selected])==null?void 0:l.native)!=null&&c.protected?m.jsx("span",{style:{color:(h=(d=this.props.scripts[this.state.selected])==null?void 0:d.native)!=null&&h.protected?"orange":void 0},children:x.I18n.t("Unprotect script")}):x.I18n.t("Protect script")]},"encrypt"):null]},"menu")}getToolbarButtons(){const s=[],i=this.state.reorder&&!this.props.debugMode;if(this.state.searchMode&&!this.props.debugMode)s.push(m.jsx(Pn,{value:this.state.searchText,style:Pe.toolbarSearch,ref:this.inputRef,autoFocus:!0,placeholder:x.I18n.t("Search..."),onChange:r=>{this.setState({searchText:r.target.value}),this.filterTimer&&clearTimeout(this.filterTimer),this.filterTimer=setTimeout(()=>{this.filterTimer=null,this.filterList(!0),this.props.onSearch&&this.props.onSearch(this.state.searchText)},400)}},"searchInput")),s.push(m.jsx(qe,{sx:Pe.toolbarButtons,style:{float:"right"},title:x.I18n.t("End search mode"),onClick:r=>{r.stopPropagation(),this.filterList(!1,()=>this.props.onSearch&&this.props.onSearch(this.state.searchText))},size:"medium",children:m.jsx(dx,{})},"disableSearch")),this.state.searchText&&s.push(m.jsx(qe,{title:x.I18n.t("Clear search input"),sx:Pe.toolbarButtons,style:{marginTop:7,float:"right"},onClick:r=>{r.stopPropagation(),this.setState({searchText:""},()=>{this.filterList(!0),this.props.onSearch&&this.props.onSearch(this.state.searchText)})},size:"medium",children:m.jsx(Mw,{fontSize:"small"})},"cleanSearch"));else{if(!i){s.push(m.jsx(qe,{"aria-label":"More","aria-owns":this.state.menuOpened?"long-menu":void 0,title:x.I18n.t("Menu"),"aria-haspopup":"true",onClick:c=>{c.stopPropagation(),c.preventDefault(),this.setState({menuOpened:!0,menuAnchorEl:c.currentTarget})},size:"medium",children:m.jsx(gx,{})},"menuButton"));const r=this.state.listItems.find(c=>c.id===this.state.selected);let l;r&&this.state.width<=Ur&&r.type==="folder"&&(l=this.state.listItems.filter(c=>c.parent===this.state.selected)),s.push(this.getMainMenu(l,r)),s.push(m.jsx(qe,{disabled:this.props.debugMode,title:x.I18n.t("Create new script"),sx:{...Pe.toolbarButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0},style:{color:i?"red":"inherit"},onClick:c=>this.onAddNew(c),size:"medium",children:m.jsx(sS,{})},"new-script")),s.push(m.jsx(qe,{disabled:this.props.debugMode,title:x.I18n.t("Create new folder"),sx:{...Pe.toolbarButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0},style:{color:i?"red":"inherit"},onClick:c=>this.onAddNewFolder(c),size:"medium",children:m.jsx(oS,{})},"new-folder"))}s.push(m.jsx(qe,{disabled:i||this.props.debugMode,sx:{...Pe.toolbarButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0},title:x.I18n.t("Search in scripts"),style:{float:"right",opacity:this.props.debugMode?.5:i?0:1},onClick:r=>{r.stopPropagation(),this.setState({searchMode:!0})},size:"medium",children:m.jsx($x,{})},"search")),s.push(m.jsx(qe,{disabled:this.props.debugMode,title:x.I18n.t("Reorder scripts in folders"),sx:{...Pe.toolbarButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0},style:{color:i?"red":"inherit",float:"right"},onClick:r=>{r.stopPropagation(),this.setState({reorder:!this.state.reorder})},size:"medium",children:m.jsx(_x,{})},"reorder")),!i&&this.state.selected&&this.state.selected!==To&&this.state.selected!==Cn&&s.push(m.jsx(qe,{sx:{...Pe.toolbarButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0},disabled:this.props.debugMode,title:x.I18n.t("Rename"),onClick:r=>this.onRename(r),size:"medium",children:m.jsx(iS,{})},"rename")),s.push(m.jsxs("span",{style:{opacity:.5,fontSize:10},children:["v",this.props.version]},"version"))}return s}getFolders(){const s=[{id:Jt,name:x.I18n.t("Root folder")}];return this.state.listItems.forEach(i=>{i.type==="folder"&&i.id!==Jt&&(!i.id.startsWith(To)||this.state.expertMode)&&s.push({id:i.id,name:i.title})}),s}onCollapseAll(){this.setState({expanded:[]}),this.saveExpanded([])}onExpandAll(){const s=[];this.state.listItems.forEach(i=>this.state.listItems.find(r=>r.parent===i.id)&&s.push(i.id)),this.setState({expanded:s}),this.saveExpanded(s)}getBottomButtons(){return this.state.reorder||this.props.debugMode?null:[m.jsx(wt,{sx:Pe.footerButtons,title:x.I18n.t("Show only running scripts"),onClick:s=>{s.stopPropagation(),s.preventDefault();const i=this.state.statusFilter==="running"?"":"running";window.localStorage&&window.localStorage.setItem("SideMenu.statusFilter",i),this.setState({statusFilter:i})},children:m.jsx(bc,{style:{color:C_,opacity:this.state.statusFilter==="running"?1:.3,background:this.state.statusFilter==="running"?"gray":"inherit"}})},"filterByRunning"),m.jsx(wt,{sx:Pe.footerButtons,title:x.I18n.t("Show only paused scripts"),onClick:()=>{const s=this.state.statusFilter==="paused"?"":"paused";window.localStorage&&window.localStorage.setItem("SideMenu.statusFilter",s),this.setState({statusFilter:s})},children:m.jsx(Ug,{style:{color:S_,opacity:this.state.statusFilter==="paused"?1:.3,background:this.state.statusFilter==="paused"?"gray":"inherit"}})},"filterByPaused"),m.jsx(wt,{sx:Pe.footerButtons,style:{marginRight:16},title:x.I18n.t("Show only scripts with problems"),onClick:()=>{const s=this.state.statusFilter==="problems"?"":"problems";window.localStorage&&window.localStorage.setItem("SideMenu.statusFilter",s),this.setState({statusFilter:s})},children:m.jsx(bc,{style:{color:T_,opacity:this.state.statusFilter==="problems"?1:.3,background:this.state.statusFilter==="problems"?"gray":"inherit"}})},"filterByProblem"),m.jsx(wt,{sx:Pe.footerButtons,children:m.jsx("img",{alt:"Blockly",style:{opacity:this.state.typeFilter==="Blockly"?1:.3,background:this.state.typeFilter==="Blockly"?"gray":"inherit"},src:Tn.Blockly,onClick:()=>{const s=this.state.typeFilter==="Blockly"?"":"Blockly";window.localStorage&&window.localStorage.setItem("SideMenu.typeFilter",s),this.setState({typeFilter:s})}})},"filterBlockly"),m.jsx(wt,{sx:Pe.footerButtons,children:m.jsx("img",{alt:"Javascript",style:{opacity:this.state.typeFilter==="Javascript/js"?1:.3,background:this.state.typeFilter==="Javascript/js"?"gray":"inherit"},src:Tn["Javascript/js"],onClick:()=>{const s=this.state.typeFilter==="Javascript/js"?"":"Javascript/js";window.localStorage&&window.localStorage.setItem("SideMenu.typeFilter",s),this.setState({typeFilter:s})}})},"filterJS"),m.jsx(wt,{sx:Pe.footerButtons,children:m.jsx("img",{alt:"TypeScript",style:{opacity:this.state.typeFilter==="TypeScript/ts"?1:.3,background:this.state.typeFilter==="TypeScript/ts"?"gray":"inherit"},src:Tn["TypeScript/ts"],onClick:()=>{const s=this.state.typeFilter==="TypeScript/ts"?"":"TypeScript/ts";window.localStorage&&window.localStorage.setItem("SideMenu.typeFilter",s),this.setState({typeFilter:s})}})},"filterTS"),m.jsx(wt,{sx:Pe.footerButtons,children:m.jsx("img",{alt:"Rules",style:{opacity:this.state.typeFilter==="Rules"?1:.3,background:this.state.typeFilter==="Rules"?"gray":"inherit"},src:Tn.Rules,onClick:()=>{const s=this.state.typeFilter==="Rules"?"":"Rules";window.localStorage&&window.localStorage.setItem("SideMenu.typeFilter",s),this.setState({typeFilter:s})}})},"filterRules"),m.jsx("div",{style:{flexGrow:1}},"padding"),m.jsx(wt,{sx:Pe.footerButtons,onClick:()=>this.onExpandAll(),title:x.I18n.t("Expand all"),children:m.jsx(kx,{style:Pe.footerButtonsRight})},"expandAll"),this.state.expanded.length?m.jsx(wt,{sx:Pe.footerButtons,onClick:()=>this.onCollapseAll(),title:x.I18n.t("Collapse all"),children:m.jsx(wx,{style:Pe.footerButtonsRight})},"collapseAll"):m.jsx("div",{style:{height:22,width:24}})]}getAdapterDebugDialog(){return this.state.showAdapterDebug?m.jsx(Dx,{socket:this.props.socket,onClose:()=>this.setState({showAdapterDebug:!1}),onDebug:(s,i)=>this.setState({showAdapterDebug:!1},()=>this.props.onDebugInstance({instance:s,adapter:i}))},"debug"):null}render(){var r,l,c;const s=this.state.renaming?this.state.listItems.find(d=>d.id===this.state.renaming):void 0,i=this.state.copingScript&&this.props.scripts[this.state.copingScript].type==="script"?this.props.scripts[this.state.copingScript]:void 0;return[m.jsxs(PT,{variant:"permanent",style:Pe.menu,sx:{"& .MuiDrawer-paper":Pe.drawerPaper},anchor:"left",onClick:()=>this.onClick({id:""}),children:[m.jsx(wt,{sx:Pe.toolbar,children:this.getToolbarButtons()}),m.jsx(t_,{}),m.jsx(ek,{backend:hk,children:m.jsx("div",{style:Pe.innerMenu,children:this.renderAllItems(this.state.listItems)})}),m.jsx(t_,{}),m.jsx("div",{style:Pe.footer,children:this.getBottomButtons()})]},"drawer"),s?m.jsx(vm,{name:s.title,id:this.state.renaming||"",folder:s.type==="folder",instance:s.instance,instances:this.props.instances,onClose:()=>this.setState({renaming:null}),onRename:(d,h,p,f)=>this.props.onRename&&this.props.onRename(d,h,p,f)},"dialog-rename"):null,this.state.deleting?m.jsx(Cx,{name:this.state.listItems.find(d=>d.id===this.state.deleting).title,id:this.state.deleting,onClose:()=>this.setState({deleting:null}),onDelete:d=>this.props.onDelete&&this.props.onDelete(d)},"dialog-delete"):null,this.state.choosingType?m.jsx(Dn,{onClose:d=>{const h={choosingType:!1};d&&(h.creatingScript=d),this.setState(h)}},"dialog-script-type"):null,this.state.creatingScript?m.jsx(og,{onClose:()=>this.setState({creatingScript:null}),title:x.I18n.t("Create new script"),name:this.getUniqueName(),parents:this.getFolders(),folder:!1,existingItems:this.state.listItems.map(d=>d.id),instance:this.props.instances[0]||0,instances:this.props.instances,type:this.state.creatingScript,parent:this.parent,onAdd:(d,h,p,f)=>this.props.onAddNew&&this.props.onAddNew(d,h,!1,p,f)},"dialog-new-script"):null,this.state.copingScript?m.jsx(og,{onClose:()=>this.setState({copingScript:""}),title:x.I18n.t("Copy script"),name:this.getUniqueName(this.state.copingScript),parents:this.getFolders(),folder:!1,instance:parseInt((l=(r=i==null?void 0:i.common)==null?void 0:r.engine)==null?void 0:l.split(".").pop(),10)||0,instances:this.props.instances,type:((c=i==null?void 0:i.common)==null?void 0:c.engineType)||"Javascript/js",parent:this.parent,onAdd:(d,h,p,f)=>{var y;const b=this.state.copingScript&&this.props.scripts[this.state.copingScript].type==="script"?this.props.scripts[this.state.copingScript]:void 0;b!=null&&b.common&&(b.common.enabled=!1),this.props.onAddNew&&this.props.onAddNew(d,h,!1,p,f,(y=b==null?void 0:b.common)==null?void 0:y.source)}},"dialog-copy-script"):null,this.state.creatingFolder?m.jsx(og,{onClose:()=>this.setState({creatingFolder:!1}),title:x.I18n.t("Create new folder"),parents:this.getFolders(),name:this.getUniqueFolderName(),parent:this.parent,onAdd:(d,h)=>this.props.onAddNew&&this.props.onAddNew(d,h,!0)},"dialog-new-folder"):null,this.state.errorText?m.jsx(su,{onClose:()=>this.setState({errorText:""}),text:this.state.errorText},"error"):null,this.getAdapterDebugDialog(),this.state.showExportDialog?m.jsxs(Ut,{open:!0,onClose:()=>this.setState({showExportDialog:!1}),children:[m.jsx(ss,{children:x.I18n.t("Export all scripts")}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",onClick:()=>{this.setState({showExportDialog:!1}),this.props.onExport(!0)},color:"primary",children:x.I18n.t("as JSON")}),m.jsx(He,{variant:"contained",onClick:()=>{this.setState({showExportDialog:!1}),this.props.onExport(!1)},color:"grey",children:x.I18n.t("as plain text")}),m.jsx(He,{variant:"contained",onClick:()=>this.setState({showExportDialog:!1}),color:"primary",children:x.I18n.t("Cancel")})]})]},"dialog-export-format"):null]}}const Px="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgAQMAAADYVuV7AAAABlBMVEUAAAAzMzPI8eYgAAAAAXRSTlMAQObYZgAAACFJREFUeAFjAIJRwP////8PYIKWHCigNQdKj/pn1D+jAABTG16wVQqVpQAAAABJRU5ErkJggg==",Bx="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgAQMAAADYVuV7AAAABlBMVEUAAAAzMzPI8eYgAAAAAXRSTlMAQObYZgAAABtJREFUeAFjAIJRwP8fCj7QkENn/4z6Z5QzCgBjbWaoyx1PqQAAAABJRU5ErkJggg==";function Fx(a){let s,i=a.getHours();return i<10&&(i=`0${i.toString()}`),s=`${i}:`,i=a.getMinutes(),i<10&&(i=`0${i.toString()}`),s+=`${i}:`,i=a.getSeconds(),i<10&&(i=`0${i.toString()}`),s+=`${i}.`,i=a.getMilliseconds(),i<10?i=`00${i.toString()}`:i<100&&(i=`0${i.toString()}`),s+=i,s}const x_=34,zt={logBox:{width:"100%",height:"100%",position:"relative",overflow:"hidden"},logBoxInner:a=>({display:"inline-block",color:a.palette.mode==="dark"?"white":"black",width:`calc(100% - ${x_}px)`,height:"100%",overflow:"auto",position:"relative",verticalAlign:"top"}),info:a=>({background:a.palette.mode==="dark"?"darkgrey":"lightgrey",color:(a.palette.mode==="dark","black")}),error:a=>({background:"#FF0000",color:a.palette.mode==="dark"?"black":"white"}),warn:a=>({background:"#FF8000",color:a.palette.mode==="dark"?"black":"white"}),debug:a=>({background:"gray",opacity:.8,color:a.palette.mode==="dark"?"black":"white"}),silly:a=>({background:"gray",opacity:.6,color:a.palette.mode==="dark"?"black":"white"}),table:{fontFamily:"monospace",width:"100%"},toolbox:{width:x_,height:"100%",boxShadow:"2px 0px 4px -1px rgba(0, 0, 0, 0.2), 4px 0px 5px 0px rgba(0, 0, 0, 0.14), 1px 0px 10px 0px rgba(0, 0, 0, 0.12)",display:"inline-block",verticalAlign:"top",overflow:"hidden"},trFrom:{width:90},trTime:{width:90},trSeverity:{width:40,fontWeight:"bold"},trPreMessage:{padding:0,margin:0},iconButtons:{width:32,height:32,padding:4},layoutIcon:a=>({"& img":{width:24,height:24,background:a.palette.mode==="dark"?"#9d9d9d":void 0,borderRadius:a.palette.mode==="dark"?"30px":void 0}})};function jx(a){return a<10?`00${a}`:a<100?`0${a}`:a.toString()}const Zs={};class ym extends _e.Component{messagesEnd;constructor(s){super(s),this.state={lines:{},goBottom:!0,selected:null,editing:this.props.editing||[]},this.messagesEnd=_e.createRef()}static generateLine(s,i){let r=s.message||"";if(typeof r!="object"){const l=new RegExp(`${s.from.replace(".","\\.").replace(")","\\)").replace("(","\\(")} \\(\\d+\\) `,"g"),c=r.match(l);c?r=r.replace(c[0],""):r=r.replace(`${s.from} `,"")}return r.startsWith(`${i}: `)&&(r=r.substring(i.length+2)),m.jsxs(wt,{component:"tr",sx:zt[s.severity],children:[m.jsx("td",{style:zt.trFrom,children:s.from}),m.jsx("td",{style:zt.trTime,children:Fx(new Date(s.ts))}),m.jsx("td",{style:zt.trSeverity,children:s.severity}),m.jsx("td",{children:m.jsx("pre",{style:zt.trPreMessage,children:r})})]},`tr_${s.ts}_${s.message.substring(s.message.length-10)}`)}scrollToBottom(){var s,i;(i=(s=this.messagesEnd)==null?void 0:s.current)==null||i.scrollIntoView({behavior:"smooth"})}logHandler=s=>{const i=this.state.lines,r=this.state.editing.filter(f=>s.message.includes(f));let l=null;if(!r.length||(r.length===1?l=r[0]:(r.sort(),l=r[r.length-1]),!l))return;const c=i[l]||[],d=Zs[l]||[];c.push(ym.generateLine(s,l));let h=s.severity;(h==="info"||h==="warn")&&(h+=" ");const p=new Date(s.ts);d.push(`${p.toLocaleString()}.${jx(p.getMilliseconds())} [${h}]: ${s.message}`),c.length>300&&(c.splice(0,c.length-300),d.splice(0,c.length-300)),Zs[l]=d,i[l]=c,this.setState({lines:i})};componentDidMount(){this.props.socket.registerLogHandler(this.logHandler)}componentWillUnmount(){this.props.socket.unregisterLogHandler(this.logHandler)}componentDidUpdate(){this.state.goBottom&&this.scrollToBottom()}static getDerivedStateFromProps(s,i){let r=!1;const l={};if(s.selected!==i.selected){const c=s.selected,d=i.lines;c&&(d[c]=d[c]||[],Zs[c]=Zs[c]||[]),l.selected=c,r=!0}if(JSON.stringify(s.editing)!==JSON.stringify(i.editing)){const c=JSON.parse(JSON.stringify(s.editing));r=!0;const d=i.lines;for(const h in Zs)Object.prototype.hasOwnProperty.call(Zs,h)&&(c.includes(h)||(delete Zs[h],delete d[h]));l.editing=c}return r?l:null}onCopy(){x.Utils.copyToClipboard((Zs[this.state.selected]||[]).join(` +`))}clearLog(){const s=this.state.lines;s[this.state.selected]&&(s[this.state.selected]=[]),Zs[this.state.selected]&&(Zs[this.state.selected]=[]),this.setState({lines:s})}renderLogList(s){return this.state.selected&&(s!=null&&s.length)?m.jsxs(wt,{sx:zt.logBoxInner,children:[m.jsx("table",{style:zt.table,children:m.jsx("tbody",{children:s})},"logTable"),m.jsx("div",{ref:this.messagesEnd,style:{float:"left",clear:"both"}},"logScrollPoint")]},"logList"):m.jsx(wt,{sx:zt.logBoxInner,style:{paddingLeft:10},children:x.I18n.t("Log outputs")},"logList")}render(){const s=this.state.selected?this.state.lines[this.state.selected]:null;return m.jsxs("div",{style:zt.logBox,children:[m.jsxs("div",{style:zt.toolbox,children:[m.jsx(qe,{style:zt.iconButtons,onClick:()=>this.setState({goBottom:!this.state.goBottom}),color:this.state.goBottom?"secondary":void 0,size:"medium",children:m.jsx(nS,{})}),s!=null&&s.length?m.jsx(qe,{style:zt.iconButtons,onClick:()=>this.clearLog(),size:"medium",children:m.jsx(rS,{})}):null,s!=null&&s.length?m.jsx(qe,{style:zt.iconButtons,onClick:()=>this.onCopy(),size:"medium",children:m.jsx(aS,{})}):null,this.props.onLayoutChange?m.jsx(qe,{style:zt.iconButtons,onClick:()=>this.props.onLayoutChange&&this.props.onLayoutChange(),title:x.I18n.t("Change layout"),size:"medium",sx:zt.layoutIcon,children:m.jsx("img",{alt:"split",src:this.props.verticalLayout?Px:Bx})}):null,m.jsx(qe,{style:zt.iconButtons,onClick:()=>this.props.onHideLog(),title:x.I18n.t("Hide logs"),size:"medium",children:m.jsx(lS,{})})]},"toolbox"),this.renderLogList(s)]})}}var D_="focus-outline-hidden";function vk(){var a=this;document.addEventListener("keydown",function(s){a.focusByKeyboard=!0},!0),document.addEventListener("mousedown",function(s){a.focusByKeyboard=!1},!0),document.addEventListener("focus",function(s){a.updateVisibility()},!0),document.addEventListener("focusout",function(s){window.setTimeout(function(){document.hasFocus()||(a.focusByKeyboard=!0,a.updateVisibility())},0)}),this.updateVisibility()}vk.prototype={focusByKeyboard:!0,updateVisibility:function(){this.hidden=!this.focusByKeyboard},set hidden(a){document.documentElement.classList.toggle(D_,a)},get hidden(){return document.documentElement.classList.contains(D_)}};new vk;var yk={exports:{}};(function(a){(function(){var s={}.hasOwnProperty;function i(){for(var r=[],l=0;l4&&arguments[4]!==void 0?arguments[4]:"easeInOutCubic";return r>l?i:s+(i-s)*Ux[c](r/l)};Mi.calcEndPoint=function(s){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(Hx(s))return parseInt(s)+r;var l=i===window||i===document.documentElement?window.pageYOffset:i.scrollTop-i.getBoundingClientRect().top,c=s.nodeName.toLowerCase()==="html"?-l:s.getBoundingClientRect().top+l;return c+r};(function(a,s){Object.defineProperty(s,"__esModule",{value:!0});var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},r=Mi;s.default=function(l){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d=c.duration,h=d===void 0?500:d,p=c.context,f=p===void 0?window:p,b=c.offset,y=b===void 0?0:b,w=c.ease,v=w===void 0?"easeInOutCubic":w,_=c.callback;if((typeof window>"u"?"undefined":i(window))==="object"){var $=f.scrollTop!==null&&f.scrollTop!==void 0?f.scrollTop:window.pageYOffset,S=(0,r.calcEndPoint)(l,f,y),T=performance.now(),E=window.requestAnimationFrame,D=function M(){var P=performance.now()-T,W=(0,r.setPosition)($,S,P,h,v);f!==window?f.scrollTop=W:window.scroll(0,W),P>h?typeof _=="function"&&_(l):E(M)};D()}},a.exports=s.default})(Kg,Kg.exports);var _k=Kg.exports,Yg={exports:{}};(function(a,s){Object.defineProperty(s,"__esModule",{value:!0});var i=Object.assign||function(d){for(var h=1;h0&&arguments[0]!==void 0?arguments[0]:{},h=d.query,p=h===void 0?'[href^="#"]:not([href="#"]':h,f=d.match,b=f===void 0?function(S){return document.getElementById(S.hash.substring(1))}:f,y=d.hashChange,w=y===void 0?!0:y,v=d.scrollSmoothConfig,_=document.querySelectorAll(p),$=function(T){T.preventDefault();var E=b(T.target);E&&(w&&history.replaceState(null,null,"#"+E.id),(0,l.default)(E,i({},v)))};Array.from(_).map(function(S){S.addEventListener("click",$,!1)})},a.exports=s.default})(Yg,Yg.exports);var Wx=Yg.exports,Jg={exports:{}};(function(a,s){Object.defineProperty(s,"__esModule",{value:!0});function i(r){if(Array.isArray(r)){for(var l=0,c=Array(r.length);l0&&arguments[0]!==void 0?arguments[0]:{},l=r.activeClass,c=l===void 0?"active":l,d=r.query,h=d===void 0?'[href^="#"]:not([href="#"]):not([href="#0"])':d,p=r.threshold,f=p===void 0?[.25,.5,.75]:p,b=r.detectType,y=b===void 0?"max":b,w={threshold:f},v=function(W){return W.classList.remove(c)},_=function(W){return W.classList.add(c)},$=function(){document.querySelectorAll("."+c).forEach(v)},S=function(W){$(),_(document.querySelector('a[href="#'+W.id+'"]'))},T=function(W){W.forEach(function(G){G.intersectionRatio>=Math[y].apply(Math,i(f))&&S(G.target)})},E=document.querySelectorAll(h),D=new IntersectionObserver(T,w),M=function(W){var G=document.querySelector("#"+W.hash.slice(1));D.observe(G)};E.forEach(M)},a.exports=s.default})(Jg,Jg.exports);var Gx=Jg.exports;(function(a,s){Object.defineProperty(s,"__esModule",{value:!0});var i=_k,r=f(i),l=Mi,c=Wx,d=f(c),h=Gx,p=f(h);function f(b){return b&&b.__esModule?b:{default:b}}s.default={to:r.default,calcEndPoint:l.calcEndPoint,anchorScroll:d.default,observe:p.default},a.exports=s.default})(Vg,Vg.exports);var Vx=Vg.exports;const Kx=Xo(Vx);var _m={exports:{}},Yx=_m.exports;(function(a){(function(s,i){a.exports?a.exports=i():s.Scrollparent=i()})(Yx,function(){var s=/(auto|scroll)/,i=function(h,p){return h.parentNode===null?p:i(h.parentNode,p.concat([h]))},r=function(h,p){return getComputedStyle(h,null).getPropertyValue(p)},l=function(h){return r(h,"overflow")+r(h,"overflow-y")+r(h,"overflow-x")},c=function(h){return s.test(l(h))},d=function(h){if(h instanceof HTMLElement||h instanceof SVGElement){for(var p=i(h.parentNode,[]),f=0;f=s||G<0||y&&z>=c}function T(){var W=ig();if(S(W))return E(W);h=setTimeout(T,$(W))}function E(W){return h=void 0,w&&r?v(W):(r=l=void 0,d)}function D(){h!==void 0&&clearTimeout(h),f=0,r=p=l=h=void 0}function M(){return h===void 0?d:E(ig())}function P(){var W=ig(),G=S(W);if(r=arguments,l=this,p=W,G){if(h===void 0)return _(p);if(y)return h=setTimeout(T,s),v(p)}return h===void 0&&(h=setTimeout(T,s)),d}return P.cancel=D,P.flush=M,P}function qg(a){var s=typeof a;return!!a&&(s=="object"||s=="function")}function h0(a){return!!a&&typeof a=="object"}function p0(a){return typeof a=="symbol"||h0(a)&&l0.call(a)==Zx}function R_(a){if(typeof a=="number")return a;if(p0(a))return O_;if(qg(a)){var s=typeof a.valueOf=="function"?a.valueOf():a;a=qg(s)?s+"":s}if(typeof a!="string")return a===0?a:+a;a=a.replace(Qx,"");var i=t0.test(a);return i||s0.test(a)?o0(a.slice(2),i?2:8):e0.test(a)?O_:+a}var g0=d0;const m0=Xo(g0);var Xg="data-focus-lock",wk="data-focus-lock-disabled",f0="data-no-focus-lock",$0="data-autofocus-inside",b0="data-no-autofocus";function ng(a,s){return typeof a=="function"?a(s):a&&(a.current=s),a}function v0(a,s){var i=kt(function(){return{value:a,callback:s,facade:{get current(){return i.value},set current(r){var l=i.value;l!==r&&(i.value=r,i.callback(r,l))}}}})[0];return i.callback=s,i.facade}var y0=typeof window<"u"?um:Lt,N_=new WeakMap;function _0(a,s){var i=v0(null,function(r){return a.forEach(function(l){return ng(l,r)})});return y0(function(){var r=N_.get(i);if(r){var l=new Set(r),c=new Set(a),d=i.current;l.forEach(function(h){c.has(h)||ng(h,null)}),c.forEach(function(h){l.has(h)||ng(h,d)})}N_.set(i,a)},[a]),i}var rg={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"};function kk(a){return a}function Ck(a,s){s===void 0&&(s=kk);var i=[],r=!1,l={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:a},useMedium:function(c){var d=s(c,r);return i.push(d),function(){i=i.filter(function(h){return h!==d})}},assignSyncMedium:function(c){for(r=!0;i.length;){var d=i;i=[],d.forEach(c)}i={push:function(h){return c(h)},filter:function(){return i}}},assignMedium:function(c){r=!0;var d=[];if(i.length){var h=i;i=[],h.forEach(c),d=i}var p=function(){var b=d;d=[],b.forEach(c)},f=function(){return Promise.resolve().then(p)};f(),i={push:function(b){d.push(b),f()},filter:function(b){return d=d.filter(b),i}}}};return l}function wm(a,s){return s===void 0&&(s=kk),Ck(a,s)}function w0(a){a===void 0&&(a={});var s=Ck(null);return s.options=cS({async:!0,ssr:!1},a),s}var Tk=wm({},function(a){var s=a.target,i=a.currentTarget;return{target:s,currentTarget:i}}),Sk=wm(),k0=wm(),C0=w0({async:!0,ssr:typeof document<"u"}),T0=lm(void 0),S0=[],km=Iw(function(s,i){var r,l=kt(),c=l[0],d=l[1],h=Ko(),p=Ko(!1),f=Ko(null),b=kt({}),y=b[1],w=s.children,v=s.disabled,_=v===void 0?!1:v,$=s.noFocusGuards,S=$===void 0?!1:$,T=s.persistentFocus,E=T===void 0?!1:T,D=s.crossFrame,M=D===void 0?!0:D,P=s.autoFocus,W=P===void 0?!0:P;s.allowTextSelection;var G=s.group,z=s.className,Z=s.whiteList,he=s.hasPositiveIndices,Ce=s.shards,R=Ce===void 0?S0:Ce,K=s.as,C=K===void 0?"div":K,Q=s.lockProps,ve=Q===void 0?{}:Q,ce=s.sideCar,ne=s.returnFocus,me=ne===void 0?!1:ne,re=s.focusOptions,B=s.onActivation,N=s.onDeactivation,te=kt({}),q=te[0],se=xn(function(Y){var O=Y.captureFocusRestore;if(!f.current){var A,U=(A=document)==null?void 0:A.activeElement;f.current=U,U!==document.body&&(f.current=O(U))}h.current&&B&&B(h.current),p.current=!0,y()},[B]),j=xn(function(){p.current=!1,N&&N(h.current),y()},[N]),Te=xn(function(Y){var O=f.current;if(O){var A=(typeof O=="function"?O():O)||document.body,U=typeof me=="function"?me(A):me;if(U){var H=typeof U=="object"?U:void 0;f.current=null,Y?Promise.resolve().then(function(){return A.focus(H)}):A.focus(H)}}},[me]),ae=xn(function(Y){p.current&&Tk.useMedium(Y)},[]),we=Sk.useMedium,Ie=xn(function(Y){h.current!==Y&&(h.current=Y,d(Y))},[]),Ne=Sg((r={},r[wk]=_&&"disabled",r[Xg]=G,r),ve),Ae=S!==!0,We=Ae&&S!=="tail",k=_0([i,Ie]),X=us(function(){return{observed:h,shards:R,enabled:!_,active:p.current}},[_,p.current,R,c]);return _e.createElement(Ig,null,Ae&&[_e.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:_?-1:0,style:rg}),he?_e.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:_?-1:1,style:rg}):null],!_&&_e.createElement(ce,{id:q,sideCar:C0,observed:c,disabled:_,persistentFocus:E,crossFrame:M,autoFocus:W,whiteList:Z,shards:R,onActivation:se,onDeactivation:j,returnFocus:Te,focusOptions:re,noFocusGuards:S}),_e.createElement(C,Sg({ref:k},Ne,{className:z,onBlur:we,onFocus:ae}),_e.createElement(T0.Provider,{value:X},w)),We&&_e.createElement("div",{"data-focus-guard":!0,tabIndex:_?-1:0,style:rg}))});km.propTypes={};function E0(a,s){function i(r){return r.displayName||r.name||"Component"}return function(l){var c=[],d;function h(){d=a(c.map(function(f){return f.props})),s(d)}var p=(function(f){DS(b,f);function b(){return f.apply(this,arguments)||this}b.peek=function(){return d};var y=b.prototype;return y.componentDidMount=function(){c.push(this),h()},y.componentDidUpdate=function(){h()},y.componentWillUnmount=function(){var v=c.indexOf(this);c.splice(v,1),h()},y.render=function(){return _e.createElement(l,this.props)},b})(RT);return qS(p,"displayName","SideEffect("+i(l)+")"),p}}var oo=function(a){for(var s=Array(a.length),i=0;i=0}).sort(L0)},B0=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],Sm=B0.join(","),F0="".concat(Sm,", [data-focus-guard]"),Mk=function(a,s){return oo((a.shadowRoot||a).children).reduce(function(i,r){return i.concat(r.matches(s?F0:Sm)?[r]:[],Mk(r))},[])},j0=function(a,s){var i;return a instanceof HTMLIFrameElement&&(!((i=a.contentDocument)===null||i===void 0)&&i.body)?Bn([a.contentDocument.body],s):[a]},Bn=function(a,s){return a.reduce(function(i,r){var l,c=Mk(r,s),d=(l=[]).concat.apply(l,c.map(function(h){return j0(h,s)}));return i.concat(d,r.parentNode?oo(r.parentNode.querySelectorAll(Sm)).filter(function(h){return h===r}):[])},[])},z0=function(a){var s=a.querySelectorAll("[".concat($0,"]"));return oo(s).map(function(i){return Bn([i])}).reduce(function(i,r){return i.concat(r)},[])},Em=function(a,s){return oo(a).filter(function(i){return Dk(s,i)}).filter(function(i){return R0(i)})},M_=function(a,s){return s===void 0&&(s=new Map),oo(a).filter(function(i){return Ak(s,i)})},Im=function(a,s,i){return Tm(Em(Bn(a,i),s),!0,i)},ea=function(a,s){return Tm(Em(Bn(a),s),!1)},U0=function(a,s){return Em(z0(a),s)},xi=function(a,s){return a.shadowRoot?xi(a.shadowRoot,s):Object.getPrototypeOf(a).contains!==void 0&&Object.getPrototypeOf(a).contains.call(a,s)?!0:oo(a.children).some(function(i){var r;if(i instanceof HTMLIFrameElement){var l=(r=i.contentDocument)===null||r===void 0?void 0:r.body;return l?xi(l,s):!1}return xi(i,s)})},H0=function(a){for(var s=new Set,i=a.length,r=0;r0&&s.add(l),(c&Node.DOCUMENT_POSITION_CONTAINS)>0&&s.add(r)}return a.filter(function(d,h){return!s.has(h)})},Lk=function(a){return a.parentNode?Lk(a.parentNode):a},xm=function(a){var s=Ri(a);return s.filter(Boolean).reduce(function(i,r){var l=r.getAttribute(Xg);return i.push.apply(i,l?H0(oo(Lk(r).querySelectorAll("[".concat(Xg,'="').concat(l,'"]:not([').concat(wk,'="disabled"])')))):[r]),i},[])},W0=function(a){try{return a()}catch{return}},ta=function(a){if(a===void 0&&(a=document),!(!a||!a.activeElement)){var s=a.activeElement;return s.shadowRoot?ta(s.shadowRoot):s instanceof HTMLIFrameElement&&W0(function(){return s.contentWindow.document})?ta(s.contentWindow.document):s}},G0=function(a,s){return a===s},V0=function(a,s){return!!oo(a.querySelectorAll("iframe")).some(function(i){return G0(i,s)})},Pk=function(a,s){return s===void 0&&(s=ta(Ek(a).ownerDocument)),!s||s.dataset&&s.dataset.focusGuard?!1:xm(a).some(function(i){return xi(i,s)||V0(i,s)})},K0=function(a){a===void 0&&(a=document);var s=ta(a);return s?oo(a.querySelectorAll("[".concat(f0,"]"))).some(function(i){return xi(i,s)}):!1},Y0=function(a,s){return s.filter(Nk).filter(function(i){return i.name===a.name}).filter(function(i){return i.checked})[0]||a},Dm=function(a,s){return Nk(a)&&a.name?Y0(a,s):a},J0=function(a){var s=new Set;return a.forEach(function(i){return s.add(Dm(i,a))}),a.filter(function(i){return s.has(i)})},L_=function(a){return a[0]&&a.length>1?Dm(a[0],a):a[0]},P_=function(a,s){return a.indexOf(Dm(s,a))},Qg="NEW_FOCUS",q0=function(a,s,i,r,l){var c=a.length,d=a[0],h=a[c-1],p=Cm(r);if(!(r&&a.indexOf(r)>=0)){var f=r!==void 0?i.indexOf(r):-1,b=l?i.indexOf(l):f,y=l?a.indexOf(l):-1;if(f===-1)return y!==-1?y:Qg;if(y===-1)return Qg;var w=f-b,v=i.indexOf(d),_=i.indexOf(h),$=J0(i),S=r!==void 0?$.indexOf(r):-1,T=l?$.indexOf(l):S,E=$.filter(function(z){return z.tabIndex>=0}),D=r!==void 0?E.indexOf(r):-1,M=l?E.indexOf(l):D,P=D>=0&&M>=0?M-D:T-S;if(!w&&y>=0||s.length===0)return y;var W=P_(a,s[0]),G=P_(a,s[s.length-1]);if(f<=v&&p&&Math.abs(w)>1)return G;if(f>=_&&p&&Math.abs(w)>1)return W;if(w&&Math.abs(P)>1)return y;if(f<=v)return G;if(f>_)return W;if(w)return Math.abs(w)>1?y:(c+y+w)%c}},X0=function(a){return function(s){var i,r=(i=Ok(s))===null||i===void 0?void 0:i.autofocus;return s.autofocus||r!==void 0&&r!=="false"||a.indexOf(s)>=0}},B_=function(a,s,i){var r=a.map(function(c){var d=c.node;return d}),l=M_(r.filter(X0(i)));return l&&l.length?L_(l):L_(M_(s))},em=function(a,s){return s===void 0&&(s=[]),s.push(a),a.parentNode&&em(a.parentNode.host||a.parentNode,s),s},ag=function(a,s){for(var i=em(a),r=em(s),l=0;l=0)return c}return!1},Bk=function(a,s,i){var r=Ri(a),l=Ri(s),c=r[0],d=!1;return l.filter(Boolean).forEach(function(h){d=ag(d||h,h)||d,i.filter(Boolean).forEach(function(p){var f=ag(c,p);f&&(!d||xi(f,d)?d=f:d=ag(f,d))})}),d},F_=function(a,s){return a.reduce(function(i,r){return i.concat(U0(r,s))},[])},Z0=function(a,s){var i=new Map;return s.forEach(function(r){return i.set(r.node,r)}),a.map(function(r){return i.get(r)}).filter(M0)},Q0=function(a,s){var i=ta(Ri(a).length>0?document:Ek(a).ownerDocument),r=xm(a).filter(Zg),l=Bk(i||a,a,r),c=new Map,d=ea(r,c),h=d.filter(function(_){var $=_.node;return Zg($)});if(h[0]){var p=ea([l],c).map(function(_){var $=_.node;return $}),f=Z0(p,h),b=f.map(function(_){var $=_.node;return $}),y=f.filter(function(_){var $=_.tabIndex;return $>=0}).map(function(_){var $=_.node;return $}),w=q0(b,y,p,i,s);if(w===Qg){var v=B_(d,y,F_(r,c))||B_(d,b,F_(r,c));if(v)return{node:v};console.warn("focus-lock: cannot find any node to move focus into");return}return w===void 0?w:f[w]}},eD=function(a){var s=xm(a).filter(Zg),i=Bk(a,a,s),r=Tm(Bn([i],!0),!0,!0),l=Bn(s,!1);return r.map(function(c){var d=c.node,h=c.index;return{node:d,index:h,lockItem:l.indexOf(d)>=0,guard:Cm(d)}})},Am=function(a,s){a&&("focus"in a&&a.focus(s),"contentWindow"in a&&a.contentWindow&&a.contentWindow.focus())},lg=0,cg=!1,Fk=function(a,s,i){i===void 0&&(i={});var r=Q0(a,s);if(!cg&&r){if(lg>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),cg=!0,setTimeout(function(){cg=!1},1);return}lg++,Am(r.node,i.focusOptions),lg--}};function Hr(a){if(!a)return null;if(typeof WeakRef>"u")return function(){return a||null};var s=a?new WeakRef(a):null;return function(){return(s==null?void 0:s.deref())||null}}var tD=function(a){if(!a)return null;for(var s=[],i=a;i&&i!==document.body;)s.push({current:Hr(i),parent:Hr(i.parentElement),left:Hr(i.previousElementSibling),right:Hr(i.nextElementSibling)}),i=i.parentElement;return{element:Hr(a),stack:s,ownerDocument:a.ownerDocument}},sD=function(a){var s,i,r,l,c;if(a)for(var d=a.stack,h=a.ownerDocument,p=new Map,f=0,b=d;f-1&&(S.filter(function(E){var D=E.guard,M=E.node;return D&&M.dataset.focusAutoGuard}).forEach(function(E){var D=E.node;return D.removeAttribute("tabIndex")}),z_(T,S.length,1,S),z_(T,-1,-1,S))}}}return s},Gk=function(s){Sc()&&s&&(s.stopPropagation(),s.preventDefault())},Nm=function(){return Om(Sc)},yD=function(s){var i=s.target,r=s.currentTarget;r.contains(i)||gD(r,i)},_D=function(){return null},Vk=function(){Rm=!0},Kk=function(){Rm=!1,sa="just",Om(function(){sa="meanwhile"})},wD=function(){document.addEventListener("focusin",Gk),document.addEventListener("focusout",Nm),window.addEventListener("focus",Vk),window.addEventListener("blur",Kk)},kD=function(){document.removeEventListener("focusin",Gk),document.removeEventListener("focusout",Nm),window.removeEventListener("focus",Vk),window.removeEventListener("blur",Kk)};function CD(a){return a.filter(function(s){var i=s.disabled;return!i})}var Yk={moveFocusInside:Fk,focusInside:Pk,focusNextElement:rD,focusPrevElement:aD,focusFirstElement:lD,focusLastElement:cD,captureFocusRestore:jk};function TD(a){var s=a.slice(-1)[0];s&&!Rn&&wD();var i=Rn,r=i&&s&&s.id===i.id;Rn=s,i&&!r&&(i.onDeactivation(),a.filter(function(l){var c=l.id;return c===i.id}).length||i.returnFocus(!s)),s?(ts=null,(!r||i.observed!==s.observed)&&s.onActivation(Yk),Sc(),Om(Sc)):(kD(),ts=null)}Tk.assignSyncMedium(yD);Sk.assignMedium(Nm);k0.assignMedium(function(a){return a(Yk)});const SD=E0(CD,TD)(_D);var Jk=Iw(function(s,i){return _e.createElement(km,Sg({sideCar:SD,ref:i},s))}),qk=km.propTypes||{};qk.sideCar;AS(qk,["sideCar"]);Jk.propTypes={};var Xk={exports:{}},ct={};var Mm=Symbol.for("react.element"),Lm=Symbol.for("react.portal"),ou=Symbol.for("react.fragment"),iu=Symbol.for("react.strict_mode"),nu=Symbol.for("react.profiler"),ru=Symbol.for("react.provider"),au=Symbol.for("react.context"),ED=Symbol.for("react.server_context"),lu=Symbol.for("react.forward_ref"),cu=Symbol.for("react.suspense"),uu=Symbol.for("react.suspense_list"),du=Symbol.for("react.memo"),hu=Symbol.for("react.lazy"),ID=Symbol.for("react.offscreen"),Zk;Zk=Symbol.for("react.module.reference");function Cs(a){if(typeof a=="object"&&a!==null){var s=a.$$typeof;switch(s){case Mm:switch(a=a.type,a){case ou:case nu:case iu:case cu:case uu:return a;default:switch(a=a&&a.$$typeof,a){case ED:case au:case lu:case hu:case du:case ru:return a;default:return s}}case Lm:return s}}}ct.ContextConsumer=au;ct.ContextProvider=ru;ct.Element=Mm;ct.ForwardRef=lu;ct.Fragment=ou;ct.Lazy=hu;ct.Memo=du;ct.Portal=Lm;ct.Profiler=nu;ct.StrictMode=iu;ct.Suspense=cu;ct.SuspenseList=uu;ct.isAsyncMode=function(){return!1};ct.isConcurrentMode=function(){return!1};ct.isContextConsumer=function(a){return Cs(a)===au};ct.isContextProvider=function(a){return Cs(a)===ru};ct.isElement=function(a){return typeof a=="object"&&a!==null&&a.$$typeof===Mm};ct.isForwardRef=function(a){return Cs(a)===lu};ct.isFragment=function(a){return Cs(a)===ou};ct.isLazy=function(a){return Cs(a)===hu};ct.isMemo=function(a){return Cs(a)===du};ct.isPortal=function(a){return Cs(a)===Lm};ct.isProfiler=function(a){return Cs(a)===nu};ct.isStrictMode=function(a){return Cs(a)===iu};ct.isSuspense=function(a){return Cs(a)===cu};ct.isSuspenseList=function(a){return Cs(a)===uu};ct.isValidElementType=function(a){return typeof a=="string"||typeof a=="function"||a===ou||a===nu||a===iu||a===cu||a===uu||a===ID||typeof a=="object"&&a!==null&&(a.$$typeof===hu||a.$$typeof===du||a.$$typeof===ru||a.$$typeof===au||a.$$typeof===lu||a.$$typeof===Zk||a.getModuleId!==void 0)};ct.typeOf=Cs;Xk.exports=ct;var Qk=Xk.exports;function xD(a){function s(N,te,q,se,j){for(var Te=0,ae=0,we=0,Ie=0,Ne,Ae,We=0,k=0,X,Y=X=Ne=0,O=0,A=0,U=0,H=0,ue=q.length,V=ue-1,be,pe="",fe="",Le="",Ue="",Be;ONe)&&(H=(pe=pe.replace(" ",":")).length),0se&&(se=(te=te.trim()).charCodeAt(0)),se){case 38:return te.replace(T,"$1"+N.trim());case 58:return N.trim()+te.replace(T,"$1"+N.trim());default:if(0<1*q&&0ae.charCodeAt(8))break;case 115:j=j.replace(ae,"-webkit-"+ae)+";"+j;break;case 207:case 102:j=j.replace(ae,"-webkit-"+(102q.charCodeAt(0)&&(q=q.trim()),B=q,q=[B],01?s-1:0),r=1;r0?" Args: "+i.join(", "):""))}var RD=(function(){function a(i){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=i}var s=a.prototype;return s.indexOfGroup=function(i){for(var r=0,l=0;l=this.groupSizes.length){for(var l=this.groupSizes,c=l.length,d=c;i>=d;)(d<<=1)<0&&ga(16,""+i);this.groupSizes=new Uint32Array(d),this.groupSizes.set(l),this.length=d;for(var h=c;h=this.length||this.groupSizes[i]===0)return r;for(var l=this.groupSizes[i],c=this.indexOfGroup(i),d=c+l,h=c;h=Yr&&(Yr=s+1),yc.set(a,s),Ic.set(s,a)},LD="style["+Fn+'][data-styled-version="5.3.11"]',PD=new RegExp("^"+Fn+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),BD=function(a,s,i){for(var r,l=i.split(","),c=0,d=l.length;c=0;f--){var b=p[f];if(b&&b.nodeType===1&&b.hasAttribute(Fn))return b}})(i),c=l!==void 0?l.nextSibling:null;r.setAttribute(Fn,"active"),r.setAttribute("data-styled-version","5.3.11");var d=jD();return d&&r.setAttribute("nonce",d),i.insertBefore(r,c),r},zD=(function(){function a(i){var r=this.element=eC(i);r.appendChild(document.createTextNode("")),this.sheet=(function(l){if(l.sheet)return l.sheet;for(var c=document.styleSheets,d=0,h=c.length;d=0){var l=document.createTextNode(r),c=this.nodes[i];return this.element.insertBefore(l,c||null),this.length++,!0}return!1},s.deleteRule=function(i){this.element.removeChild(this.nodes[i]),this.length--},s.getRule=function(i){return i0&&(y+=w+",")})),c+=""+f+b+'{content:"'+y+`"}/*!sc*/ +`}}}return c})(this)},a})(),GD=/(a)(d)/gi,G_=function(a){return String.fromCharCode(a+(a>25?39:97))};function sm(a){var s,i="";for(s=Math.abs(a);s>52;s=s/52|0)i=G_(s%52)+i;return(G_(s%52)+i).replace(GD,"$1-$2")}var An=function(a,s){for(var i=s.length;i;)a=33*a^s.charCodeAt(--i);return a},tC=function(a){return An(5381,a)};function sC(a){for(var s=0;s>>0);if(!i.hasNameForId(l,h)){var p=r(d,"."+h,void 0,l);i.insertRules(l,h,p)}c.push(h),this.staticRulesId=h}else{for(var f=this.rules.length,b=An(this.baseHash,r.hash),y="",w=0;w>>0);if(!i.hasNameForId(l,S)){var T=r(y,"."+S,void 0,l);i.insertRules(l,S,T)}c.push(S)}}return c.join(" ")},a})(),YD=/^\s*\/\/.*$/gm,JD=[":","[",".","#"];function qD(a){var s,i,r,l,c=Yo,d=c.options,h=d===void 0?Yo:d,p=c.plugins,f=p===void 0?Ec:p,b=new xD(h),y=[],w=(function($){function S(T){if(T)try{$(T+"}")}catch{}}return function(T,E,D,M,P,W,G,z,Z,he){switch(T){case 1:if(Z===0&&E.charCodeAt(0)===64)return $(E+";"),"";break;case 2:if(z===0)return E+"/*|*/";break;case 3:switch(z){case 102:case 112:return $(D[0]+E),"";default:return E+(he===0?"/*|*/":"")}case-2:E.split("/*|*/}").forEach(S)}}})((function($){y.push($)})),v=function($,S,T){return S===0&&JD.indexOf(T[i.length])!==-1||T.match(l)?$:"."+s};function _($,S,T,E){E===void 0&&(E="&");var D=$.replace(YD,""),M=S&&T?T+" "+S+" { "+D+" }":D;return s=E,i=S,r=new RegExp("\\"+i+"\\b","g"),l=new RegExp("(\\"+i+"\\b){2,}"),b(T||!S?"":S,M)}return b.use([].concat(f,[function($,S,T){$===2&&T.length&&T[0].lastIndexOf(i)>0&&(T[0]=T[0].replace(r,v))},w,function($){if($===-2){var S=y;return y=[],S}}])),_.hash=f.length?f.reduce((function($,S){return S.name||ga(15),An($,S.name)}),5381).toString():"",_}var oC=_e.createContext();oC.Consumer;var iC=_e.createContext(),XD=(iC.Consumer,new xc),om=qD();function nC(){return ia(oC)||XD}function rC(){return ia(iC)||om}var ZD=(function(){function a(s,i){var r=this;this.inject=function(l,c){c===void 0&&(c=om);var d=r.name+c.hash;l.hasNameForId(r.id,d)||l.insertRules(r.id,d,c(r.rules,d,"@keyframes"))},this.toString=function(){return ga(12,String(r.name))},this.name=s,this.id="sc-keyframes-"+s,this.rules=i}return a.prototype.getName=function(s){return s===void 0&&(s=om),this.name+s.hash},a})(),QD=/([A-Z])/,eA=/([A-Z])/g,tA=/^ms-/,sA=function(a){return"-"+a.toLowerCase()};function V_(a){return QD.test(a)?a.replace(eA,sA).replace(tA,"-ms-"):a}var K_=function(a){return a==null||a===!1||a===""};function Ni(a,s,i,r){if(Array.isArray(a)){for(var l,c=[],d=0,h=a.length;d1?s-1:0),r=1;r?@[\\\]^`{|}~-]+/g,iA=/(^-|-$)/g;function ug(a){return a.replace(oA,"-").replace(iA,"")}var cC=function(a){return sm(tC(a)>>>0)};function ac(a){return typeof a=="string"&&!0}var im=function(a){return typeof a=="function"||typeof a=="object"&&a!==null&&!Array.isArray(a)},nA=function(a){return a!=="__proto__"&&a!=="constructor"&&a!=="prototype"};function rA(a,s,i){var r=a[i];im(s)&&im(r)?uC(r,s):a[i]=s}function uC(a){for(var s=arguments.length,i=new Array(s>1?s-1:0),r=1;r=0||(he[z]=W[z]);return he})(s,["componentId"]),P=D&&D+"-"+(ac(E)?E:ug(H_(E)));return dC(E,to({},M,{attrs:w,componentId:P}),i)},Object.defineProperty(_,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(E){this._foldedDefaultProps=r?uC({},a.defaultProps,E):E}}),Object.defineProperty(_,"toString",{value:function(){return"."+_.styledComponentId}}),l&&OS(_,a,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),_}var ks=function(a){return(function s(i,r,l){if(l===void 0&&(l=Yo),!Qk.isValidElementType(r))return ga(1,String(r));var c=function(){return i(r,l,aC.apply(void 0,arguments))};return c.withConfig=function(d){return s(i,r,to({},l,{},d))},c.attrs=function(d){return s(i,r,to({},l,{attrs:Array.prototype.concat(l.attrs,d).filter(Boolean)}))},c})(dC,a)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(a){ks[a]=ks(a)}));var aA=(function(){function a(i,r){this.rules=i,this.componentId=r,this.isStatic=sC(i),xc.registerId(this.componentId+1)}var s=a.prototype;return s.createStyles=function(i,r,l,c){var d=c(Ni(this.rules,r,l,c).join(""),""),h=this.componentId+i;l.insertRules(h,h,d)},s.removeStyles=function(i,r){r.clearRules(this.componentId+i)},s.renderStyles=function(i,r,l,c){i>2&&xc.registerId(this.componentId+i),this.removeStyles(i,l),this.createStyles(i,r,l,c)},a})();function lA(a){for(var s=arguments.length,i=new Array(s>1?s-1:0),r=1;ra.length)&&(s=a.length);for(var i=0,r=Array(s);i=a.length?{done:!0}:{done:!1,value:a[r++]}},e:function(p){throw p},f:l}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var c,d=!0,h=!1;return{s:function(){i=i.call(a)},n:function(){var p=i.next();return d=p.done,p},e:function(p){h=!0,c=p},f:function(){try{d||i.return==null||i.return()}finally{if(h)throw c}}}}function vs(a,s,i){return(s=pC(s))in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function Dc(a){return Dc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(s){return s.__proto__||Object.getPrototypeOf(s)},Dc(a)}function mA(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(s&&s.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),s&&nm(a,s)}function hC(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(hC=function(){return!!a})()}function fA(a,s){var i=a==null?null:typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(i!=null){var r,l,c,d,h=[],p=!0,f=!1;try{if(c=(i=i.call(a)).next,s!==0)for(;!(p=(r=c.call(i)).done)&&(h.push(r.value),h.length!==s);p=!0);}catch(b){f=!0,l=b}finally{try{if(!p&&i.return!=null&&(d=i.return(),Object(d)!==d))return}finally{if(f)throw l}}return h}}function $A(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q_(a,s){var i=Object.keys(a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(a);s&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(a,l).enumerable})),i.push.apply(i,r)}return i}function Ac(a){for(var s=1;si.right&&(i.right=h.right),h.bottom>i.bottom&&(i.bottom=h.bottom),h.left=0+p&&l>=0+p&&r<=d-p&&i<=c-p}function TA(a){return a===document.querySelector("body")||a===document.querySelector("html")}var SA=function(s){return/(left|right)/.test(s)},hg=function(s,i){return s>i},pg=function(s,i){return s>i},Qs=function(s){return s<0?0:s};function EA(a){return Object.keys(a).map(function(s){return{position:s,value:a[s]}}).sort(function(s,i){return i.value-s.value}).map(function(s){return s.position})}var ow,IA=ks.div(ow||(ow=Ls([` + --reactour-accent: `,`; + `,` + position: fixed; + transition: transform 0.3s; + top: 0; + left: 0; + z-index: 1000000; + + transform: `,`; +`])),function(a){return a.accentColor},function(a){return a.defaultStyles?` + max-width: 331px; + min-width: 150px; + padding-right: 40px; + border-radius: `.concat(a.rounded,`px; + background-color: #fff; + padding: 24px 30px; + box-shadow: 0 0.5em 3em rgba(0, 0, 0, 0.3); + color: inherit; + `):""},function(a){var s=a.targetTop,i=a.targetRight,r=a.targetBottom,l=a.targetLeft,c=a.windowWidth,d=a.windowHeight,h=a.helperWidth,p=a.helperHeight,f=a.helperPosition,b=a.padding,y={left:l,right:c-i,top:s,bottom:d-r},w=function(T){return y[T]>(SA(T)?h+b*2:p+b*2)},v=function(T){for(var E=EA(y),D=0;Db?P:b,G=pg(s+p,d)?pg(r+b,d)?r-p:r-p+b:s-b,z=G>b?G:b,Z={top:[W,s-p-b*2],right:[i+b*2,z],bottom:[W,r+b*2],left:[l-h-b*2,z],center:[c/2-h/2,d/2-p/2]};return T==="center"||w(T)?Z[T]:v(Z)},$=_(f);return"translate(".concat(Math.round($[0]),"px, ").concat(Math.round($[1]),"px)")}),iw,xA=ks.span(iw||(iw=Ls([` + position: absolute; + font-family: monospace; + background: var(--reactour-accent); + background: `,`; + height: 1.875em; + line-height: 2; + padding-left: 0.8125em; + padding-right: 0.8125em; + font-size: 1em; + border-radius: 1.625em; + color: white; + text-align: center; + box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.3); + top: -0.8125em; + left: -0.8125em; +`])),function(a){return a.accentColor}),nw,DA=ks.div(nw||(nw=Ls([` + display: flex; + margin-top: 24px; + align-items: center; + justify-content: center; +`]))),rw,AA=ks.nav(rw||(rw=Ls([` + counter-reset: dot; + display: flex; + justify-content: center; + align-items: center; + flex-wrap: wrap; +`]))),aw,OA=ks.button(aw||(aw=Ls([` + counter-increment: dot; + width: 8px; + height: 8px; + border: `,`; + + border-radius: 100%; + padding: 0; + display: block; + margin: 4px; + transition: opacity 0.3s, transform 0.3s; + cursor: `,`; + transform: scale(`,`); + + color: `,`; + background: `,`; + + color: `,`; + background: `,`; + + &:before { + content: counter(dot); + position: absolute; + bottom: calc(100% + 0.25em); + left: 50%; + opacity: 0; + transform: translate(-50%, 1em); + transition: 0.3s; + display: `,`; + } + + &:hover { + background-color: currentColor; + + &:before { + opacity: 0.5; + transform: translate(-50%, -2px); + } + } +`])),function(a){return a.current===a.index?"0":"1px solid #caccce"},function(a){return a.disabled?"not-allowed":"pointer"},function(a){return a.current===a.index?1.25:1},function(a){return a.current===a.index?"var(--reactour-accent)":"#caccce"},function(a){return a.current===a.index?"var(--reactour-accent)":"none"},function(a){return a.current===a.index?a.accentColor:"#caccce"},function(a){return a.current===a.index?a.accentColor:"none"},function(a){return a.showNumber?"block":"none"}),lw,RA=ks.div(lw||(lw=Ls([` + opacity: `,`; + color: `,`; + width: 100%; + left: 0; + top: 0; + height: 100%; + position: fixed; + z-index: 99999; + pointer-events: none; +`])),function(a){return!a.maskClassName&&.7},function(a){return!a.maskClassName&&"#000"});function vC(a){var s=a.windowWidth,i=a.windowHeight,r=a.targetWidth,l=a.targetHeight,c=a.targetTop,d=a.targetLeft,h=a.padding,p=a.rounded,f=a.roundedStep,b=a.disableInteraction,y=a.disableInteractionClassName,w=a.className,v=a.onClick,_=a.highlightedBorder,$=Qs(r+h*2),S=Qs(l+h*2),T=Qs(c-h),E=Qs(d-h),D=f?Math.min($/2,S/2):p;return _e.createElement(RA,{onClick:v,maskClassName:w},_e.createElement("svg",{width:s,height:i,xmlns:"http://www.w3.org/2000/svg",className:w},_e.createElement("defs",null,_e.createElement("mask",{id:"mask-main"},_e.createElement("rect",{x:0,y:0,width:s,height:i,fill:"white"}),_e.createElement("rect",{x:E,y:T,width:$,height:S,fill:"black"}),_e.createElement("rect",{x:E-1,y:T-1,width:D,height:D,fill:"white"}),_e.createElement("circle",{cx:E+D,cy:T+D,r:D,fill:"black"}),_e.createElement("rect",{x:E+$-D+1,y:T-1,width:D,height:D,fill:"white"}),_e.createElement("circle",{cx:E+$-D,cy:T+D,r:D,fill:"black"}),_e.createElement("rect",{x:E-1,y:T+S-D+1,width:D,height:D,fill:"white"}),_e.createElement("circle",{cx:E+D,cy:T+S-D,r:D,fill:"black"}),_e.createElement("rect",{x:E+$-D+1,y:T+S-D+1,width:D,height:D,fill:"white"}),_e.createElement("circle",{cx:E+$-D,cy:T+S-D,r:D,fill:"black "})),_e.createElement("clipPath",{id:"clip-path"},_e.createElement("rect",{x:0,y:0,width:s,height:T}),_e.createElement("rect",{x:0,y:T,width:E,height:S}),_e.createElement("rect",{x:d+r+h,y:T,width:Qs(s-r-E),height:S}),_e.createElement("rect",{x:0,y:c+l+h,width:s,height:Qs(i-l-T)}))),_e.createElement("rect",{x:0,y:0,width:s,height:i,fill:"currentColor",mask:"url(#mask-main)"}),_e.createElement("rect",{x:0,y:0,width:s,height:i,fill:"currentColor",clipPath:"url(#clip-path)",pointerEvents:"auto"}),_e.createElement("rect",{x:E,y:T,width:$,height:S,pointerEvents:"auto",fill:"transparent",display:b?"block":"none",className:y}),_&&_e.createElement("rect",{x:Qs(E+_.width/2),y:Qs(T+_.width/2),width:Qs($-_.width),height:Qs(S-_.width),pointerEvents:"auto",fill:"none",strokeWidth:_.width,stroke:_.color,rx:D-2})))}vC.propTypes={windowWidth:ke.number.isRequired,windowHeight:ke.number.isRequired,targetWidth:ke.number.isRequired,targetHeight:ke.number.isRequired,targetTop:ke.number.isRequired,targetLeft:ke.number.isRequired,padding:ke.number.isRequired,rounded:ke.number.isRequired,roundedStep:ke.bool,disableInteraction:ke.bool.isRequired,disableInteractionClassName:ke.string.isRequired,highlightedBorder:ke.shape({color:ke.string.isRequired,width:ke.number.isRequired})};var NA=(function(a){var s=a.step,i=a.refresh,r=kt(0),l=vA(r,2),c=l[0],d=l[1];return Lt(function(){if(s.resizeObservables){var h=function(w){var v=Mn(w),_;try{var $=function(){var T=_.value;if(!T.attributes)return 1;var E=s.resizeObservables.find(function(D){return T.matches(D)||T.querySelector(D)!=null});E&&d(c+1)};for(v.s();!(_=v.n()).done;)$()}catch(S){v.e(S)}finally{v.f()}},p=new MutationObserver(function(y){var w=Mn(y),v;try{for(w.s();!(v=w.n()).done;){var _=v.value;_.addedNodes.length!==0&&h(_.addedNodes),_.removedNodes.length!==0&&h(_.removedNodes)}}catch($){w.e($)}finally{w.f()}}),f=document.documentElement||document.body,b={childList:!0,subtree:!0};return p.observe(f,b),function(){p.disconnect()}}},[s,c]),Lt(function(){if(s.resizeObservables){var h=new ResizeObserver(function(w){i()}),p=Mn(s.resizeObservables),f;try{for(p.s();!(f=p.n()).done;){var b=f.value,y=document.querySelector(b);y&&h.observe(y)}}catch(w){p.e(w)}finally{p.f()}return function(){h.disconnect()}}},[s,c]),null}),MA=(function(a){var s=a.step,i=a.refresh;return Lt(function(){if(s.mutationObservables){var r=function(p){var f=Mn(p),b;try{var y=function(){var v=b.value;if(!v.attributes)return 1;var _=s.mutationObservables.find(function($){return v.matches($)||v.querySelector($)!=null});_&&i()};for(f.s();!(b=f.n()).done;)y()}catch(w){f.e(w)}finally{f.f()}},l=new MutationObserver(function(h){var p=Mn(h),f;try{for(p.s();!(f=p.n()).done;){var b=f.value;b.addedNodes.length!==0&&r(b.addedNodes),b.removedNodes.length!==0&&r(b.removedNodes)}}catch(y){p.e(y)}finally{p.f()}}),c=document.documentElement||document.body,d={childList:!0,subtree:!0};return l.observe(c,d),function(){l.disconnect()}}},[s]),null});function LA(a){var s=a.children,i=Ko(null);return i.current===null&&(i.current=document.createElement("div"),i.current.setAttribute("id","___reactour")),Lt(function(){return document.body.appendChild(i.current),function(){document.body.removeChild(i.current)}},[i]),RS(s,i.current)}var PA={disableFocusLock:ke.bool,badgeContent:ke.func,highlightedMaskClassName:ke.string,children:ke.oneOfType([ke.node,ke.element]),className:ke.string,closeButtonAriaLabel:ke.string,closeWithMask:ke.bool,inViewThreshold:ke.number,isOpen:ke.bool.isRequired,lastStepNextButton:ke.node,maskClassName:ke.string,maskSpace:ke.number,nextButton:ke.node,onAfterOpen:ke.func,onBeforeClose:ke.func,onRequestClose:ke.func,prevButton:ke.node,scrollDuration:ke.number,scrollOffset:ke.number,showButtons:ke.bool,showCloseButton:ke.bool,showNavigation:ke.bool,showNavigationNumber:ke.bool,showNumber:ke.bool,startAt:ke.number,goToStep:ke.number,getCurrentStep:ke.func,nextStep:ke.func,prevStep:ke.func,steps:ke.arrayOf(ke.shape({selector:ke.string,content:ke.oneOfType([ke.node,ke.element,ke.func]).isRequired,position:ke.oneOfType([ke.arrayOf(ke.number),ke.oneOf(["top","right","bottom","left","center"])]),action:ke.func,style:ke.object,stepInteraction:ke.bool,navDotAriaLabel:ke.string,roundedStep:ke.bool})),update:ke.string,updateDelay:ke.number,disableInteraction:ke.bool,disableDotsNavigation:ke.bool,disableKeyboardNavigation:ke.oneOfType([ke.arrayOf(ke.oneOf(["esc","right","left"])),ke.bool]),rounded:ke.number,accentColor:ke.string,highlightedBorder:ke.shape({color:ke.string.isRequired,width:ke.number.isRequired})},BA={disableFocusLock:!1,showNavigation:!0,showNavigationNumber:!0,showButtons:!0,showCloseButton:!0,closeButtonAriaLabel:"Close",showNumber:!0,scrollDuration:1,maskSpace:10,updateDelay:1,disableInteraction:!1,rounded:0,accentColor:"#007aff",closeWithMask:!0},Sn={mask:{disableInteraction:"reactour__mask--disable-interaction"},helper:{base:"reactour__helper",isOpen:"reactour__helper--is-open"},dot:{base:"reactour__dot",active:"reactour__dot--is-active"}},jm=(function(a){function s(){var i;return hA(this,s),i=dA(this,s),vs(i,"unlockFocus",function(r){i.setState({focusUnlocked:!0},r())}),vs(i,"showStep",function(){if(!(!i.helper||!i.helper.current)){var r=i.props.steps,l=i.state,c=l.current,d=l.focusUnlocked;d&&i.setState({focusUnlocked:!1});var h=r[c],p=h.selector?document.querySelector(h.selector):null,f=function(_){h.action&&typeof h.action=="function"&&i.unlockFocus(function(){return h.action(_)})};if(h.observe){var b=document.querySelector(h.observe),y={attributes:!0,childList:!0,characterData:!0};i.setState(function(v){return v.observer&&setTimeout(function(){v.observer.disconnect()},0),{observer:new MutationObserver(function(_){_.forEach(function($){if($.type==="childList"&&$.addedNodes.length>0){var S=function(){return f($.addedNodes[0])};setTimeout(function(){return i.calculateNode($.addedNodes[0],h,S)},100)}else if($.type==="childList"&&$.removedNodes.length>0){var T=function(){return f(p)};i.calculateNode(p,h,T)}})})}},function(){return i.state.observer.observe(b,y)})}else i.state.observer&&(i.state.observer.disconnect(),i.setState({observer:null}));if(p){var w=function(){return f(p)};i.calculateNode(p,h,w)}else i.setState(gg(null,h,i.helper.current),f),h.selector&&console.warn("Doesn't find a DOM node '".concat(h.selector,"'. Please check the 'steps' Tour prop Array at position ").concat(c,"."))}}),vs(i,"calculateNode",function(r,l,c){var d=i.props,h=d.scrollDuration,p=d.inViewThreshold,f=d.scrollOffset,b=bC(r,l),y=Math.max(document.documentElement.clientWidth,window.innerWidth||0),w=Math.max(document.documentElement.clientHeight,window.innerHeight||0);if(CA(Ac(Ac({},b),{},{w:y,h:w,threshold:p})))i.setState(gg(r,l,i.helper.current),c);else{var v=qx(r),_=f||(b.height>w?-25:-(w/2)+b.height/2);Kx.to(r,{context:TA(v)?window:v,duration:h,offset:_,callback:function(S){i.setState(gg(S,l,i.helper.current),c)}})}}),vs(i,"recalculateNode",function(r){var l=document.querySelector(r.selector),c=function(h){r.action&&typeof r.action=="function"&&i.unlockFocus(function(){return r.action(h)})};i.calculateNode(l,r,function(){return c(l)})}),vs(i,"maskClickHandler",function(r){var l=i.props,c=l.closeWithMask,d=l.onRequestClose;c&&!r.target.classList.contains(Sn.mask.disableInteraction)&&d(r)}),vs(i,"nextStep",function(){var r=i.props,l=r.steps,c=r.getCurrentStep;i.setState(function(d){var h=d.current0?l.current-1:l.current;return typeof r=="function"&&r(c),{current:c}},i.showStep)}),vs(i,"gotoStep",function(r){var l=i.props,c=l.steps,d=l.getCurrentStep;i.setState(function(h){var p=c[r]?r:h.current;return typeof d=="function"&&d(p),{current:p}},i.showStep)}),vs(i,"keyDownHandler",function(r){var l=i.props,c=l.onRequestClose,d=l.nextStep,h=l.prevStep,p=l.disableKeyboardNavigation;if(r.stopPropagation(),p!==!0){var f,b,y;p&&(f=p.includes("esc"),b=p.includes("right"),y=p.includes("left")),r.keyCode===27&&!f&&(r.preventDefault(),c()),r.keyCode===39&&!b&&(r.preventDefault(),typeof d=="function"?d():i.nextStep()),r.keyCode===37&&!y&&(r.preventDefault(),typeof h=="function"?h():i.prevStep())}}),i.state={isOpen:!1,current:0,top:0,right:0,bottom:0,left:0,width:0,height:0,w:0,h:0,inDOM:!1,observer:null,focusUnlocked:!1},i.helper=MT(),i.helperElement=null,i.debouncedShowStep=m0(i.showStep,70),i}return mA(s,a),gA(s,[{key:"componentDidMount",value:function(){var r=this.props,l=r.isOpen,c=r.startAt;l&&this.open(c)}},{key:"UNSAFE_componentWillReceiveProps",value:function(r){var l=this.props,c=l.isOpen,d=l.update,h=l.updateDelay;!c&&r.isOpen?this.open(r.startAt):c&&!r.isOpen&&this.close(),c&&d!==r.update&&(r.steps[this.state.current]?setTimeout(this.showStep,h):this.props.onRequestClose()),c&&r.isOpen&&this.state.current!==r.goToStep&&this.gotoStep(r.goToStep)}},{key:"componentWillUnmount",value:function(){var r=this.props.isOpen;r&&this.close(),this.state.observer&&this.state.observer.disconnect()}},{key:"open",value:function(r){var l=this,c=this.props.onAfterOpen;this.setState(function(d){return{isOpen:!0,current:r!==void 0?r:d.current}},function(){setTimeout(l.showStep,1),l.helperElement=l.helper.current,l.props.disableFocusLock||l.helper.current.focus(),c&&c(l.helperElement)}),window.addEventListener("resize",this.debouncedShowStep,!1),window.addEventListener("keydown",this.keyDownHandler,!1)}},{key:"close",value:function(){this.setState(function(r){return r.observer&&r.observer.disconnect(),{isOpen:!1,observer:null}},this.onBeforeClose),window.removeEventListener("resize",this.debouncedShowStep),window.removeEventListener("keydown",this.keyDownHandler)}},{key:"onBeforeClose",value:function(){var r=this.props.onBeforeClose;r&&r(this.helperElement)}},{key:"render",value:function(){var r=this,l=this.props,c=l.className,d=l.steps,h=l.maskClassName,p=l.showButtons,f=l.showCloseButton,b=l.closeButtonAriaLabel,y=l.showNavigation,w=l.showNavigationNumber,v=l.showNumber,_=l.onRequestClose,$=l.maskSpace,S=l.lastStepNextButton,T=l.nextButton,E=l.prevButton,D=l.badgeContent,M=l.highlightedMaskClassName,P=l.disableInteraction,W=l.disableDotsNavigation,G=l.nextStep,z=l.prevStep,Z=l.rounded,he=l.accentColor,Ce=l.CustomHelper,R=l.disableFocusLock,K=l.highlightedBorder,C=this.state,Q=C.isOpen,ve=C.current,ce=C.inDOM,ne=C.top,me=C.right,re=C.bottom,B=C.left,N=C.width,te=C.height,q=C.w,se=C.h,j=C.helperWidth,Te=C.helperHeight,ae=C.helperPosition;return Q?_e.createElement(LA,null,_e.createElement(_A,null),_e.createElement(NA,{step:d[ve],refresh:function(){return r.recalculateNode(d[ve])}}),_e.createElement(MA,{step:d[ve],refresh:function(){return r.recalculateNode(d[ve])}}),_e.createElement(vC,{onClick:this.maskClickHandler,forwardRef:function(Ie){return r.mask=Ie},windowWidth:q,windowHeight:se,targetWidth:N,targetHeight:te,targetTop:ne,targetLeft:B,padding:$,rounded:Z,roundedStep:d[ve].roundedStep,className:h,disableInteraction:d[ve].stepInteraction===!1||P?!d[ve].stepInteraction:P,disableInteractionClassName:"".concat(Sn.mask.disableInteraction," ").concat(M),highlightedBorder:K}),_e.createElement(Jk,{disabled:R,autoFocus:!1},_e.createElement(IA,{ref:this.helper,targetHeight:te,targetWidth:N,targetTop:ne,targetRight:me,targetBottom:re,targetLeft:B,windowWidth:q,windowHeight:se,helperWidth:j,helperHeight:Te,helperPosition:ae,padding:$,tabIndex:-1,current:ve,style:d[ve].style?d[ve].style:{},rounded:Z,className:A_(Sn.helper.base,c,vs({},Sn.helper.isOpen,Q)),accentColor:he,defaultStyles:!Ce,role:"dialog"},Ce?_e.createElement(Ce,{current:ve,totalSteps:d.length,gotoStep:this.gotoStep,close:_,content:d[ve]&&(typeof d[ve].content=="function"?d[ve].content({close:_,goTo:this.gotoStep,inDOM:ce,step:ve+1}):d[ve].content)},this.props.children):_e.createElement(_e.Fragment,null,this.props.children,d[ve]&&(typeof d[ve].content=="function"?d[ve].content({close:_,goTo:this.gotoStep,inDOM:ce,step:ve+1}):d[ve].content),v&&_e.createElement(xA,{"data-tour-elem":"badge",accentColor:he},typeof D=="function"?D(ve+1,d.length):ve+1),(p||y)&&_e.createElement(DA,{"data-tour-elem":"controls"},p&&_e.createElement(tw,{onClick:typeof z=="function"?z:this.prevStep,disabled:ve===0,label:E||null}),y&&_e.createElement(AA,{"data-tour-elem":"navigation"},d.map(function(we,Ie){return _e.createElement(OA,{key:"".concat(we.selector?we.selector:"undef","_").concat(Ie),onClick:function(){return r.gotoStep(Ie)},current:ve,index:Ie,accentColor:he,disabled:ve===Ie||W,showNumber:w,"data-tour-elem":"dot",className:A_(Sn.dot.base,vs({},Sn.dot.active,ve===Ie)),"aria-label":we.navDotAriaLabel})})),p&&_e.createElement(tw,{onClick:ve===d.length-1?S?_:function(){}:typeof G=="function"?G:this.nextStep,disabled:!S&&ve===d.length-1,inverted:!0,label:S&&ve===d.length-1?S:T||null})),f&&_e.createElement(kA,{onClick:_,className:"reactour__close",ariaLabel:b}))))):null}}])})(xw),gg=function(s,i,r){if(r){var l=Math.max(document.documentElement.clientWidth,window.innerWidth||0),c=Math.max(document.documentElement.clientHeight,window.innerHeight||0),d=_c(r),h=d.width,p=d.height,f={top:c+10,right:l/2+9,bottom:c/2+9,left:l/2-h/2,width:0,height:0,w:l,h:c,helperPosition:"center"};return s&&(f=bC(s,i)),function(){return Ac(Ac({w:l,h:c,helperWidth:h,helperHeight:p,helperPosition:i.position},f),{},{inDOM:!!s})}}};jm.propTypes=PA;jm.defaultProps=BA;const FA=""+new URL("blockly2js-B3Jxf2e-.svg",import.meta.url).href,jA=""+new URL("rules2js-DnYyR8mI.svg",import.meta.url).href,Ns={selectTriggers:0,addScheduleByDoubleClick:1,openTagsMenu:2,selectIntervalTag:3,selectActions:4,addActionPrintText:5,showJavascript:6,switchBackToRules:7,saveTheScript:8},zA=[{selector:".blocks-triggers",content:"Select triggers"},{selector:".block-TriggerScheduleBlock",content:"Double click to add the block"},{selector:".tag-card",content:"Open drop down menu"},{selector:".tag-card-interval",content:"Select interval"},{selector:".blocks-actions",content:"Select action blocks"},{selector:".block-ActionPrintText",content:"Double click to add the block"},{selector:".button-js-code",content:"Check the script"},{selector:".button-js-code",content:"Switch back to rules"},{selector:".button-save",content:"Save the script"}],mg=187,lc={root:{left:0,top:0,width:"100%",height:"100%",position:"fixed",background:"rgba(0, 0, 0, .3)",zIndex:2e4},connecting:{left:"40%",top:"40%",width:"20%",height:"20%",position:"absolute"},spinner:{animation:"admin-connecting-rotator 1.4s linear infinite"},path:{strokeDasharray:187,strokeDashoffset:0,transformOrigin:"center",animation:"admin-connecting-dash 1.4s ease-in-out infinite, $colors 5.6s ease-in-out infinite"}};function En(){return m.jsxs("div",{style:lc.root,children:[m.jsx("style",{children:` +' @keyframes admin-connecting-colors { + 0% { + stroke: #4285F4; + } + 25% { + stroke: #DE3E35; + } + 50% { + stroke: #F7C223; + } + 75% { + stroke: #1B9A59; + } + 100% { + stroke: #4285F4; + } + } + @keyframes admin-connecting-dash { + 0% { + stroke-dashoffset: ${mg}; + } + 50% { + stroke-dashoffset: ${mg/4}; + transform: rotate(135deg); + } + 100% { + stroke-dashoffset: ${mg}; + transform: 'rotate(450deg); + } + } + @keyframes admin-connecting-rotator { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(270deg); + } + } +`}),m.jsx("div",{style:lc.connecting,children:m.jsx("svg",{style:lc.spinner,width:"100%",height:"100%",viewBox:"0 0 66 66",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("circle",{style:lc.path,fill:"none",strokeWidth:"6",strokeLinecap:"round",cx:"33",cy:"33",r:"30"})})})]})}const UA=_e.lazy(()=>jn(()=>Promise.resolve().then(()=>vO),void 0,import.meta.url)),HA=_e.lazy(()=>jn(()=>import("./index-vgcfJH38.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url)),WA=_e.lazy(()=>jn(()=>import("./index-DnqTM0A3.js"),__vite__mapDeps([14,1,2,3,4,6,7,5,15,8,9,10,11,12]),import.meta.url)),GA=_e.lazy(()=>jn(()=>import("./ScriptEditorVanillaMonaco-DSYvOslZ.js"),__vite__mapDeps([15,1,2,3,4,6,7,5]),import.meta.url)),VA=_e.lazy(()=>jn(()=>import("./ScriptEditor-C-fO5h68.js"),__vite__mapDeps([16,1,2,3,4,6,5,15,7,17]),import.meta.url)),KA=_e.lazy(()=>jn(()=>import("./OpenAiDialog-DibIpG1Q.js"),__vite__mapDeps([18,1,2,3,4,6,5,9,19,15,7,8,10,11,12]),import.meta.url)),cw={Blockly:gk,"Javascript/js":Tc,Rules:fk,def:Tc,"TypeScript/ts":mk},YA=48,uw="#02a102",fg="#70aae9",JA=Tw[400],qA=Sw[400],je={toolbar:a=>({minHeight:38,boxShadow:"0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12)",backgroundColor:a.palette.mode==="dark"?"#1e1e1e":"#E2E2E2"}),toolbarButtons:{padding:4,marginLeft:4},toolbarButtonsDisabled:{filter:"grayscale(100%)",opacity:.5},editorDiv:a=>({height:`calc(100% - ${(parseInt(a.toolbar.height,10)||48)+38+10}px)`,width:"100%",overflow:"hidden",position:"relative"}),textButton:{marginRight:10,minHeight:24,padding:"6px 16px",height:32},saveButton:{background:"#ff9900"},tabIcon:{width:24,height:24,verticalAlign:"middle",marginBottom:2,marginRight:2,borderRadius:3},hintIcon:{padding:"0 8px 0 8px"},hintButton:{marginTop:8,marginLeft:20},tabMenuButton:{position:"absolute",top:0,right:0},tabChanged:a=>({color:a.palette.secondary.main}),tabText:{maxWidth:130,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",display:"inline-block",verticalAlign:"middle"},tabChangedIcon:{color:"#FF0000",fontSize:16,marginLeft:5},closeButton:{marginLeft:5},notRunning:{color:"#ffbc00",marginRight:8,marginLeft:8},tabButton:{minHeight:48},tabButtonWrapper:{display:"inline-block"},menuIcon:{width:18,height:18,borderRadius:2,marginRight:5}};class On extends _e.Component{getSelect=null;changedMirror={};cron={initValue:null,callback:null};scriptDialog={initValue:null,callback:null,args:null,isReturn:!1};objects;scripts;selectId={initValue:null,callback:null};confirmCallback=null;constructor(s){var c,d;super(s);let i=window.localStorage.getItem("Editor.selected")||"";const r=window.localStorage.getItem("Editor.editing")||"[]";let l;try{l=JSON.parse(r)}catch{l=[]}i&&!l.includes(i)&&l.push(i),i&&!this.props.password&&((d=(c=this.props.objects[i])==null?void 0:c.native)!=null&&d.protected)&&(i=l.find(h=>{var p,f;return!((f=(p=this.props.objects[h])==null?void 0:p.native)!=null&&f.protected)})||""),!i&&l.length&&(this.props.password?i=l[0]:i=l.find(h=>{var p,f;return!((f=(p=this.props.objects[h])==null?void 0:p.native)!=null&&f.protected)})||""),this.state={askAboutDebug:!1,astroEvents:null,blockly:null,changed:{},cmdToBlockly:"",cmdToRules:"",confirm:"",debugEnabled:!1,editing:l,insert:"",instancesLoaded:!1,isTourOpen:window.localStorage.getItem("tour")!=="true",menuDebugAnchorEl:null,menuOpened:!!this.props.menuOpened,menuTabsOpened:!1,openAiDialog:!1,triggerPrettier:1,rules:null,runningInstances:this.props.runningInstances||{},searchText:"",selected:i,showAdapterDebug:!1,showAstro:!1,showCompiledCode:!1,showCron:!1,showDebugMenu:!1,showScript:!1,showSelectId:!1,themeType:this.props.themeType,toast:"",tourStep:Ns.selectTriggers,verboseEnabled:!1,visible:s.visible},this.setChangedInAdmin(),window.systemLang=x.I18n.getLanguage(),window.main={objects:{},getObject:(h,p)=>this.props.socket.getObject(h).then(f=>p==null?void 0:p(null,f)).catch(f=>p==null?void 0:p(f)),instances:[],selectIdDialog:(h,p,f)=>{typeof p=="function"&&(f=p,p=null),this.selectId.callback=f,this.selectId.initValue=h,this.selectId.type=p,this.setState({showSelectId:!0})},cronDialog:(h,p)=>{this.cron.callback=p,this.cron.initValue=h,this.setState({showCron:!0})},showScriptDialog:(h,p,f,b)=>{this.scriptDialog.callback=b,this.scriptDialog.initValue=h,this.scriptDialog.args=p,this.scriptDialog.isReturn=f||!1,this.setState({showScript:!0})}},this.objects=s.objects,this.scripts={},this.getAllAdapterInstances().then(()=>{this.props.onSelectedChange&&this.state.selected&&setTimeout(()=>this.props.onSelectedChange(this.state.selected,this.state.editing),100)})}async getAllAdapterInstances(){const s=await this.props.socket.getAdapterInstances(!0),i={},r=s.map(l=>(i[l._id]=l,l._id));window.main.objects=i,window.main.instances=r,this.setState({instancesLoaded:!0})}static onInstanceChanged(s,i){if(s)if(!i&&window.main.instances.includes(s)){delete window.main.objects[s];const r=window.main.instances.indexOf(s);window.main.instances.splice(r,1)}else(i==null?void 0:i.type)==="instance"&&(window.main.instances.includes(s)||(window.main.instances.push(s),window.main.instances.sort()),window.main.objects[s]=i)}setChangedInAdmin(){const s=Object.keys(this.state.changed).find(i=>this.state.changed[i]);Object.keys(this.state.changed).forEach(i=>{this.changedMirror[i]=this.state.changed[i]}),Object.keys(this.changedMirror).forEach(i=>{this.state.changed[i]===void 0&&delete this.changedMirror[i]}),this.props.onChangedChanged(this.changedMirror),typeof window.parent<"u"&&window.parent&&(window.parent.configNotSaved=!!s)}componentDidMount(){window.addEventListener("beforeunload",this.onBrowserClose,!1),this.props.socket.subscribeObject("system.adapter.*",On.onInstanceChanged)}componentWillUnmount(){window.removeEventListener("beforeunload",this.onBrowserClose),this.props.socket.unsubscribeObject("system.adapter.*",On.onInstanceChanged)}onBrowserClose=s=>{const i=Object.keys(this.scripts).find(r=>JSON.stringify(this.scripts[r])!==JSON.stringify(this.getScriptFromObject(r)));if(i){console.log(`Script ${JSON.stringify(this.scripts[i])}`);const r=x.I18n.t("Configuration not saved.");return s=s||window.event,s&&(s.returnValue=r),r}};removeNonExistingScripts(s,i){s=s||this.props,i=i||{};let r=!1;if(this.state.editing&&this.state.editing.find(c=>s&&!s.objects[c])){const c=[...this.state.editing];for(let d=c.length-1;d>=0;d--)this.objects[c[d]]||(r=!0,c.splice(d,1));r&&(i.editing=c),this.state.selected&&!this.objects[this.state.selected]&&(r=!0,i.selected=c[0]||"",i.selected&&this.scripts[i.selected]&&(this.state.blockly!==(this.scripts[i.selected].engineType==="Blockly")&&(i.blockly=this.scripts[i.selected].engineType==="Blockly",r=!0),this.state.rules!==(this.scripts[i.selected].engineType==="Rules")&&(i.rules=this.scripts[i.selected].engineType==="Rules",r=!0),this.state.verboseEnabled!==this.scripts[i.selected].verbose&&(i.verboseEnabled=this.scripts[i.selected].verbose,r=!0),this.state.debugEnabled!==this.scripts[i.selected].debug&&(i.debugEnabled=this.scripts[i.selected].debug,r=!0)))}return r}UNSAFE_componentWillReceiveProps(s){var l,c,d;const i={};let r=!1;if(JSON.stringify(s.runningInstances)!==JSON.stringify(this.state.runningInstances)&&(r=!0,i.runningInstances=s.runningInstances),this.state.menuOpened!==s.menuOpened&&(i.menuOpened=s.menuOpened,r=!0),this.state.themeType!==s.themeType&&(i.themeType=s.themeType,r=!0),this.removeNonExistingScripts(s,i)&&(r=!0),this.state.searchText!==s.searchText&&(i.searchText=s.searchText,r=!0),this.objects!==s.objects){this.objects=s.objects,window.main.objects=s.objects,Object.keys(this.scripts).forEach(p=>{const f=this.scripts[p].source;this.scripts[p]=JSON.parse(JSON.stringify(this.objects[p].common)),this.scripts[p].source=f}),this.state.selected&&this.objects[this.state.selected]&&(this.scripts[this.state.selected]||=JSON.parse(JSON.stringify(this.objects[this.state.selected].common)),this.state.blockly!==(this.scripts[this.state.selected].engineType==="Blockly")&&(i.blockly=this.scripts[this.state.selected].engineType==="Blockly",r=!0),this.state.rules!==(this.scripts[this.state.selected].engineType==="Rules")&&(i.rules=this.scripts[this.state.selected].engineType==="Rules",r=!0),this.state.verboseEnabled!==this.scripts[this.state.selected].verbose&&(i.verboseEnabled=this.scripts[this.state.selected].verbose,r=!0),this.state.debugEnabled!==this.scripts[this.state.selected].debug&&(i.debugEnabled=this.scripts[this.state.selected].debug,r=!0));const h=[...this.state.editing];for(let p=h.length-1;p>=0;p--)this.objects[h[p]]||(r=!0,h.splice(p,1),this.state.changed[h[p]]!==void 0&&(i.changed||={...this.state.changed},i.changed&&delete i.changed[h[p]]));this.state.selected&&!this.objects[this.state.selected]&&(i.selected=h[0]||""),r&&(i.editing=h)}else for(const h in this.scripts)if(Object.prototype.hasOwnProperty.call(this.scripts,h)){if((l=this.objects[h])!=null&&l.common){if(this.objects[h].type==="script"){const p=this.scripts[h].source,f=JSON.parse(JSON.stringify(this.scripts[h]));f.source=this.objects[h].common.source,JSON.stringify(f)!==JSON.stringify(this.objects[h].common)&&(this.scripts[h]=JSON.parse(JSON.stringify(this.objects[h].common)),this.scripts[h].source=p),p!==this.objects[h].common.source?this.state.changed[h]?(d=this.objects[h].from)!=null&&d.startsWith("system.adapter.javascript.")&&(this.objects[h].from="system.adapter.admin.0",this.setState({toast:x.I18n.t("Script %s was modified on disk.",h.split(".").pop())})):this.props.password&&((c=this.objects[h].native)!=null&&c.protected)?this.scripts[h].source=Wg(this.props.password,this.objects[h].common.source):this.scripts[h].source=this.objects[h].common.source:this.state.changed[h]&&(i.changed||={...this.state.changed},i.changed&&(i.changed[h]=!1),r=!0)}}else if(this.scripts[h]&&(delete this.scripts[h],this.state.selected===h)){if(this.state.editing.indexOf(h)!==-1){const p=[...this.state.editing],f=p.indexOf(h);f!==-1&&(p.splice(f,1),i.editing=p,r=!0)}i.selected=this.state.editing[0]||"",r=!0}}if(s.selected&&this.state.selected!==s.selected){const h=this.getScriptFromObject(s.selected);this.scripts[s.selected]||=h;const p=h&&JSON.stringify(this.scripts[s.selected])!==JSON.stringify(h),f=[...this.state.editing];s.selected&&!f.includes(s.selected)&&(f.push(s.selected),this.props.onSelectedChange(s.selected,f),window.localStorage.setItem("Editor.editing",JSON.stringify(f))),r=!0,i.changed||={...this.state.changed},i.changed[s.selected]=!!p,i.editing=f,i.selected=s.selected,i.blockly=this.scripts[s.selected].engineType==="Blockly",i.rules=this.scripts[s.selected].engineType==="Rules",i.verboseEnabled=this.scripts[s.selected].verbose,i.debugEnabled=this.scripts[s.selected].debug,i.showCompiledCode=!1}this.state.visible!==s.visible&&(r=!0,i.visible=s.visible),r&&this.setState(i,()=>this.setChangedInAdmin())}onRestart(){var s,i;(i=(s=this.props).onRestart)==null||i.call(s,this.state.selected)}onStartStop(){var i,r,l;const s=JSON.parse(JSON.stringify(this.scripts[this.state.selected]));s.enabled=!s.enabled,this.props.password&&((i=this.props.objects[this.state.selected].native)!=null&&i.protected)&&(s.source=vc(this.props.password,s.source)),(l=(r=this.props).onChange)==null||l.call(r,this.state.selected,s)}onSave(){if(this.state.isTourOpen&&this.state.tourStep===Ns.saveTheScript&&(this.setState({isTourOpen:!1}),window.localStorage.setItem("tour","true")),this.state.changed[this.state.selected]){const s={...this.state.changed};s[this.state.selected]=!1,this.setState({changed:s},()=>{var r,l,c;this.setChangedInAdmin();const i=JSON.parse(JSON.stringify(this.scripts[this.state.selected]));this.props.password&&((r=this.props.objects[this.state.selected].native)!=null&&r.protected)&&(i.source=vc(this.props.password,i.source)),(c=(l=this.props).onChange)==null||c.call(l,this.state.selected,i)})}}onSaveAll(){const s={...this.state.changed};Object.keys(s).forEach(i=>{var r,l,c;if(s[i]){s[i]=!1;const d=JSON.parse(JSON.stringify(this.scripts[i]));this.props.password&&((r=this.props.objects[i].native)!=null&&r.protected)&&(d.source=vc(this.props.password,d.source)),(c=(l=this.props).onChange)==null||c.call(l,i,d)}}),this.setState({changed:s},()=>this.setChangedInAdmin())}onCancel(){this.scripts[this.state.selected]=this.getScriptFromObject(this.state.selected);const s={...this.state.changed};s[this.state.selected]=!1,this.setState({changed:s},()=>this.setChangedInAdmin())}onRegisterSelect(s){this.getSelect=s}onConvertBlockly2JS(){this.showConfirmDialog(x.I18n.t("It will not be possible to revert this operation."),s=>{if(s){this.scripts[this.state.selected].engineType="Javascript/js";const r=this.scripts[this.state.selected].source.split(` +`);r.pop(),this.scripts[this.state.selected].source=r.join(` +`);const l=this.state.selected,c={...this.state.changed};c[this.state.selected]=!0,this.setState({changed:c,blockly:!1,selected:""},()=>{this.setChangedInAdmin(),setTimeout(()=>this.setState({selected:l}),100)})}})}onChange(s){if(s.script!==void 0){if(s.script===this.scripts[this.state.selected].source)return;this.scripts[this.state.selected].source=s.script}s.debug!==void 0&&(this.scripts[this.state.selected].debug=s.debug),s.verbose!==void 0&&(this.scripts[this.state.selected].verbose=s.verbose);const i=JSON.stringify(this.scripts[this.state.selected])!==JSON.stringify(this.getScriptFromObject(this.state.selected));if(i!==!!this.state.changed[this.state.selected]){const r={...this.state.changed};r[this.state.selected]=i,this.objects[this.state.selected].from="system.adapter.admin.0",this.setState({changed:r},()=>this.setChangedInAdmin())}}onTabChange(s){var r,l;if(this.props.debugMode)return;window.localStorage.setItem("Editor.selected",s);const i=this.scripts[s]||this.getScriptFromObject(s);this.setState({selected:s,rules:i.engineType==="Rules",blockly:i.engineType==="Blockly",showCompiledCode:!1,verboseEnabled:i.verbose,debugEnabled:i.debug}),(l=(r=this.props).onSelectedChange)==null||l.call(r,s,this.state.editing)}isScriptChanged(s){return!!(this.scripts[s]&&this.props.objects[s]&&JSON.stringify(this.scripts[s])!==JSON.stringify(this.getScriptFromObject(s)))}onTabClose(s,i){i==null||i.stopPropagation();const r=this.state.editing.indexOf(s);if(this.state.editing.includes(s))if(this.isScriptChanged(s))this.showConfirmDialog(x.I18n.t("Discard changes for %s",this.props.objects[s].common.name),l=>{l&&(delete this.scripts[s],this.onTabClose(s))});else{const l=[...this.state.editing];l.splice(r,1);const c={editing:l};if(s===this.state.selected?l.length?r===0||l.length===1?c.selected=l[0]:c.selected=l[r-1]:c.selected="":this.state.selected&&!l.length&&(c.selected=""),window.localStorage.setItem("Editor.editing",JSON.stringify(l)),c.selected!==void 0){c.changed||={...this.state.changed},c.changed[c.selected]=this.isScriptChanged(c.selected);const d=c.selected?this.scripts[c.selected]||this.getScriptFromObject(c.selected):void 0;c.blockly=(d==null?void 0:d.engineType)==="Blockly",c.rules=(d==null?void 0:d.engineType)==="Rules",c.verboseEnabled=!!(d!=null&&d.verbose),c.debugEnabled=!!(d!=null&&d.debug),c.showCompiledCode=!1}this.setState(c,()=>{var d,h,p,f;this.setChangedInAdmin(),c.selected!==void 0?((h=(d=this.props).onSelectedChange)==null||h.call(d,c.selected,this.state.editing),window.localStorage.setItem("Editor.selected",c.selected)):(f=(p=this.props).onSelectedChange)==null||f.call(p,this.state.selected,this.state.editing)})}}showConfirmDialog(s,i){this.confirmCallback=i,this.setState({confirm:s})}sendCommandToBlockly(s){this.setState({cmdToBlockly:s},()=>setTimeout(()=>this.setState({cmdToBlockly:""}),200))}sendCommandToRules(s){this.setState({cmdToRules:s},()=>setTimeout(()=>this.setState({cmdToRules:""}),200))}static getText(s){return typeof s=="object"?s[x.I18n.getLanguage()]||s.en:s}getScriptFullName(s){var c;const i=s.split(".");i.shift(),i.shift();const r=[];let l="script.js";for(let d=0;dthis.onTabChange(i),indicatorColor:"primary",style:{position:"relative",marginLeft:10,width:this.state.editing.length>1?"calc(100% - 50px)":"100%",display:"inline-block"},textColor:"primary",variant:"scrollable",scrollButtons:"auto",allowScrollButtonsMobile:!0,children:[this.state.editing.map(s=>{var h,p;if(!this.props.objects[s]){const f=[m.jsx(wt,{sx:this.isScriptChanged(s)?je.tabChanged:void 0,style:je.tabText,children:s.split(".").pop()},"text"),m.jsx(qe,{onClick:b=>this.onTabClose(s,b),style:je.closeButton,size:"small",component:"span",children:m.jsx(sc,{})},"icon")];return m.jsx(qp,{wrapped:!0,href:`#${s}`,label:f,value:s,sx:{"& .MuiTab-wrapper":je.tabButtonWrapper}},s)}if(!this.props.password&&((h=this.props.objects[s].native)!=null&&h.protected))return null;let i=On.getText(this.props.objects[s].common.name)||"";const r=this.getScriptFullName(s);i.length>18&&(i=`${i.substring(0,15)}...`);const l=(p=this.getScriptFromObject(s))==null?void 0:p.source,c=this.scripts[s]&&l!==this.scripts[s].source,d=[m.jsx(wt,{sx:this.isScriptChanged(s)?je.tabChanged:void 0,style:je.tabText,children:i},"text"),c?m.jsx("span",{style:je.tabChangedIcon,children:"▣"},"changedSign"):null,!this.props.debugInstance&&(!this.props.debugMode||this.state.selected!==s)&&m.jsx(qe,{onClick:f=>this.onTabClose(s,f),style:je.closeButton,size:"small",component:"span",children:m.jsx(sc,{})},"icon")];return m.jsx(qp,{disabled:!!this.props.debugInstance||this.state.selected!==s&&this.props.debugMode,wrapped:!0,iconPosition:"start",icon:m.jsx("img",{alt:"",src:cw[this.props.objects[s].common.engineType]||cw.def,style:je.tabIcon},"icon"),href:`#${s}`,label:d,style:je.tabButton,value:s,title:r,sx:{"& .MuiTab-wrapper":je.tabButtonWrapper}},s)}),this.props.debugInstance?m.jsx(qp,{disabled:!1,wrapped:!0,href:`#${this.props.debugInstance.adapter}`,label:this.props.debugInstance.adapter,style:je.tabButton,value:this.props.debugInstance.adapter,title:this.props.debugInstance.adapter,sx:{"& .MuiTab-wrapper":je.tabButtonWrapper}},this.props.debugInstance.adapter):""]},"tabs1"),this.state.editing.length>1?m.jsx(qe,{href:"#","aria-label":"Close all but current",style:je.tabMenuButton,title:x.I18n.t("Close all but current"),"aria-haspopup":"false",onClick:s=>{const i=[this.state.selected];Object.keys(this.scripts).forEach(r=>r!==this.state.selected&&JSON.stringify(this.scripts[r])!==JSON.stringify(this.getScriptFromObject(r))&&i.push(r)),window.localStorage.setItem("Editor.editing",JSON.stringify(i)),this.setState({menuTabsOpened:!1,editing:i})},size:"medium",children:m.jsx(uS,{})},"menuButton"):null]:m.jsx(wt,{sx:je.toolbar,children:m.jsxs(He,{color:"grey",disabled:!0,style:je.hintButton,href:"",children:[m.jsx("span",{children:x.I18n.t("Click on this icon")},"select2"),m.jsx(dS,{style:je.hintIcon},"select3"),m.jsx("span",{children:x.I18n.t("for edit or create script")},"select4")]},"select1")},"tabs2")}getDebugMenu(){return this.state.showDebugMenu?m.jsxs(dm,{id:"menu-debug",anchorEl:this.state.menuDebugAnchorEl,open:this.state.showDebugMenu,onClose:()=>this.setState({showDebugMenu:!1,menuDebugAnchorEl:null}),slotProps:{root:{style:{maxHeight:YA*7.5}}},children:[m.jsxs(it,{title:x.I18n.t("debug_help"),onClick:s=>{s.stopPropagation(),s.preventDefault(),this.setState({showDebugMenu:!1,menuDebugAnchorEl:null,debugEnabled:!this.state.debugEnabled},()=>this.onChange({debug:this.state.debugEnabled}))},children:[m.jsx(wc,{checked:this.state.debugEnabled}),m.jsx(oc,{style:{...je.menuIcon,color:uw}}),x.I18n.t("debug_label")]},"debugEnabled"),m.jsxs(it,{title:x.I18n.t("verbose_help"),onClick:s=>{s.stopPropagation(),s.preventDefault(),this.setState({showDebugMenu:!1,menuDebugAnchorEl:null,verboseEnabled:!this.state.verboseEnabled},()=>this.onChange({verbose:this.state.verboseEnabled}))},children:[m.jsx(wc,{checked:this.state.verboseEnabled}),m.jsx(o_,{style:{...je.menuIcon,color:fg}}),x.I18n.t("verbose_label")]},"verboseEnabled")]},"menuDebug"):null}getDebugBadge(){return[this.state.debugEnabled&&this.state.verboseEnabled?m.jsx(oc,{style:{...je.menuIcon,color:fg}},"DebugVerbose"):null,this.state.debugEnabled&&!this.state.verboseEnabled?m.jsx(oc,{style:{...je.menuIcon,color:uw}},"DebugNoVerbose"):null,!this.state.debugEnabled&&this.state.verboseEnabled?m.jsx(o_,{style:{...je.menuIcon,color:fg}},"noDebugVerbose"):null]}getAskAboutDebug(){return this.state.askAboutDebug?m.jsx(x.DialogConfirm,{onClose:()=>{this.setState({askAboutDebug:!1},()=>this.props.onDebugModeChange(!0))},ok:x.I18n.t("Yes"),cancel:x.I18n.t("Cancel"),text:x.I18n.t("The script will be stopped and must be activated manually after debugging. Continue?")}):null}renderOpenAiDialog(){return this.state.openAiDialog?m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(KA,{adapterName:this.props.adapterName,socket:this.props.socket,runningInstances:this.state.runningInstances,themeType:this.state.themeType,onClose:()=>this.setState({openAiDialog:!1}),language:this.scripts[this.state.selected].engineType==="TypeScript/ts"?"typescript":"javascript",onAddCode:s=>this.setState({insert:s})})}):null}getToolbar(){var r,l;const s=!!(this.state.selected&&((r=this.scripts[this.state.selected])!=null&&r.engine)&&this.state.runningInstances[this.scripts[this.state.selected].engine]),i=!!(this.state.selected&&((l=this.scripts[this.state.selected])!=null&&l.enabled));if(this.state.selected){const c=Object.keys(this.state.changed).filter(h=>this.state.changed[h]).length,d=this.state.changed[this.state.selected];return m.jsxs(FT,{variant:"dense",sx:je.toolbar,children:[!this.props.debugInstance&&this.state.menuOpened&&this.props.onLocate&&m.jsx(qe,{style:je.toolbarButtons,title:x.I18n.t("Locate file"),onClick:()=>this.props.onLocate(this.state.selected),size:"medium",children:m.jsx(hS,{})},"locate"),!this.props.debugInstance&&!d&&s?m.jsx(qe,{disabled:this.props.debugMode,style:je.toolbarButtons,onClick:()=>this.onRestart(),title:x.I18n.t("Restart"),size:"medium",children:m.jsx(pS,{})},"restart"):null,!this.props.debugInstance&&!d?m.jsx(qe,{disabled:this.props.debugMode,onClick:()=>this.onStartStop(),title:i?x.I18n.t("Pause script"):x.I18n.t("Run script"),size:"medium",style:{...je.toolbarButtons,color:i?JA:qA},children:i?m.jsx(gS,{}):m.jsx(mS,{})},"start-stop"):null,!this.props.debugInstance&&!d&&!i?m.jsx("span",{style:je.notRunning,children:x.I18n.t("Script is not running")}):null,!d&&i&&!s?m.jsx("span",{style:je.notRunning,children:x.I18n.t("Instance is disabled")}):null,d?m.jsx(He,{color:"grey",variant:"contained",style:{...je.textButton,...je.saveButton},className:"button-save",onClick:()=>this.onSave(),endIcon:m.jsx(i_,{}),children:x.I18n.t("Save")},"save"):null,c>1||c===1&&!d?m.jsx(He,{color:"grey",variant:"contained",style:je.textButton,onClick:()=>this.onSaveAll(),endIcon:m.jsx(i_,{}),children:x.I18n.t("Save all")},"saveall"):null,d?m.jsx(He,{color:"grey",variant:"contained",style:je.textButton,onClick:()=>this.onCancel(),endIcon:m.jsx(Yc,{}),children:x.I18n.t("Cancel")},"cancel"):null,m.jsx("div",{style:{flex:2}}),!this.props.debugInstance&&!this.state.showCompiledCode&&m.jsx(qe,{style:je.toolbarButtons,title:x.I18n.t("Prettify the script"),onClick:()=>this.setState({triggerPrettier:this.state.triggerPrettier+1}),size:"medium",children:m.jsx(fS,{})},"prettier"),this.state.blockly&&!this.state.showCompiledCode?m.jsx(qe,{"aria-label":"Export Blocks",title:x.I18n.t("Export blocks"),style:je.toolbarButtons,onClick:()=>this.sendCommandToBlockly("export"),size:"medium",children:m.jsx(kc,{})},"export"):null,this.state.blockly&&!this.state.showCompiledCode&&m.jsx(qe,{"aria-label":"Import Blocks",title:x.I18n.t("Import blocks"),style:je.toolbarButtons,onClick:()=>this.sendCommandToBlockly("import"),size:"medium",children:m.jsx(Ng,{})},"import"),this.state.blockly&&!this.state.showCompiledCode&&m.jsx(qe,{"aria-label":"Check code",title:x.I18n.t("Check blocks"),style:je.toolbarButtons,onClick:()=>this.sendCommandToBlockly("check"),size:"medium",children:m.jsx($S,{})},"check"),!this.props.debugMode&&!this.state.blockly&&!this.state.rules&&!this.state.showCompiledCode?m.jsx(qe,{"aria-label":"create CRON",title:x.I18n.t("Create or edit CRON or time wizard"),style:je.toolbarButtons,onClick:()=>this.setState({showCron:!0}),size:"medium",children:m.jsx(bS,{})},"select-cron"):null,this.scripts[this.state.selected]&&this.scripts[this.state.selected].engineType!=="Blockly"&&this.scripts[this.state.selected].engineType!=="Rules"?m.jsx(qe,{"aria-label":"AI",title:x.I18n.t("AI code generator"),style:je.toolbarButtons,size:"medium",onClick:()=>this.setState({openAiDialog:!0}),children:m.jsx(vS,{})},"ai"):null,m.jsx(qe,{"aria-label":"Show astronomical events",title:x.I18n.t("Show astronomical events"),style:je.toolbarButtons,disabled:!s,onClick:()=>{this.setState({showAstro:!0,astroEvents:null}),this.props.socket.sendTo(this.scripts[this.state.selected].engine.replace("system.adapter.",""),"calcAstroAll",{}).then(h=>this.setState({astroEvents:h}))},size:"medium",children:m.jsx(yS,{})},"show-astro"),!this.props.debugMode&&!this.state.blockly&&!this.state.rules&&!this.state.showCompiledCode&&m.jsx(qe,{"aria-label":"select ID",title:x.I18n.t("Insert object ID"),style:je.toolbarButtons,onClick:()=>this.setState({showSelectId:!0}),size:"medium",children:m.jsx(_S,{})},"select-id"),this.state.blockly&&!this.state.rules&&this.state.showCompiledCode&&m.jsx(He,{color:"grey","aria-label":"convert to javascript",title:x.I18n.t("Convert blockly to javascript for ever."),onClick:()=>this.onConvertBlockly2JS(),children:"Blockly=>JS"},"convert2js"),this.state.rules&&!this.state.showCompiledCode&&m.jsx(qe,{"aria-label":"Export Blocks",title:x.I18n.t("Export blocks"),style:je.toolbarButtons,onClick:()=>this.sendCommandToRules("export"),size:"medium",children:m.jsx(kc,{})},"export"),this.state.rules&&!this.state.showCompiledCode&&m.jsx(qe,{"aria-label":"Import Blocks",title:x.I18n.t("Import blocks"),style:je.toolbarButtons,onClick:()=>this.sendCommandToRules("import"),size:"medium",children:m.jsx(Ng,{})},"import"),this.props.expertMode&&!d&&(this.props.debugMode||!this.state.blockly&&!this.state.rules||(this.state.blockly||this.state.rules)&&this.state.showCompiledCode)&&m.jsx(qe,{style:je.toolbarButtons,color:this.props.debugMode?"primary":"default",disabled:!this.props.debugMode&&!s,onClick:()=>{!this.props.debugMode&&i?this.setState({askAboutDebug:!0}):this.props.onDebugModeChange(!this.props.debugMode)},size:"medium",children:m.jsx(oc,{style:{fontSize:32}})}),(this.state.blockly||this.state.rules)&&m.jsx(He,{"aria-label":"blockly",title:x.I18n.t("Show javascript code"),className:"button-js-code",color:this.state.showCompiledCode?"secondary":"inherit",disabled:this.props.debugMode,style:{...je.toolbarButtons,...this.props.debugMode?je.toolbarButtonsDisabled:void 0,padding:"0 5px"},onClick:()=>{this.props.debugMode||(this.setState({showCompiledCode:!this.state.showCompiledCode}),this.state.isTourOpen&&this.state.tourStep===Ns.showJavascript&&this.setState({tourStep:Ns.switchBackToRules}),this.state.isTourOpen&&this.state.tourStep===Ns.switchBackToRules&&this.setState({tourStep:Ns.saveTheScript}))},children:m.jsx("img",{alt:this.state.blockly?"blockly2js":"rules2js",src:this.state.blockly?FA:jA})},"blockly-code"),m.jsx(qe,{disabled:this.props.debugMode,"aria-label":"Debug menu",title:x.I18n.t("Debug options"),style:je.toolbarButtons,onClick:h=>this.setState({showDebugMenu:!0,menuDebugAnchorEl:h.currentTarget}),size:"medium",children:m.jsx(jT,{style:je.badgeMargin,badgeContent:this.getDebugBadge(),children:m.jsx(wS,{})})},"debug")]},"toolbar1")}return null}getScriptEditor(){return!this.props.debugMode&&this.state.selected&&this.props.objects[this.state.selected]&&this.state.blockly!==null&&(!this.state.blockly||this.state.showCompiledCode)&&(!this.state.rules||this.state.showCompiledCode)?(this.scripts[this.state.selected]||=this.getScriptFromObject(this.state.selected),m.jsx(wt,{sx:je.editorDiv,children:m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(GA,{name:this.state.selected,adapterName:this.props.adapterName,insert:this.state.insert,onInserted:()=>this.setState({insert:""}),onForceSave:()=>this.onSave(),searchText:this.state.searchText,onRegisterSelect:s=>this.onRegisterSelect(s),readOnly:this.state.showCompiledCode,changed:this.state.changed[this.state.selected],code:this.scripts[this.state.selected].source||"",isDark:this.state.themeType==="dark",socket:this.props.socket,runningInstances:this.state.runningInstances,triggerPrettier:this.state.triggerPrettier,onChange:s=>this.onChange({script:s}),language:this.scripts[this.state.selected].engineType==="TypeScript/ts"?"typescript":"javascript"},"scriptEditor1")})},"scriptEditorDiv")):null}getBlocklyEditor(){return!this.props.debugMode&&this.state.instancesLoaded&&this.state.selected&&this.props.objects[this.state.selected]&&this.state.blockly&&!this.state.showCompiledCode&&this.state.visible?(this.scripts[this.state.selected]||=this.getScriptFromObject(this.state.selected),m.jsx(wt,{sx:je.editorDiv,children:m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(UA,{command:this.state.cmdToBlockly,themeType:this.state.themeType,searchText:this.state.searchText,code:this.scripts[this.state.selected].source||"",scriptId:this.state.selected,onChange:s=>this.onChange({script:s})},"BlocklyEditor")})},"blocklyEditorDiv")):null}getRulesEditor(){var s,i;if(!this.props.debugMode&&this.state.instancesLoaded&&this.state.selected&&this.props.objects[this.state.selected]&&this.state.rules&&!this.state.showCompiledCode&&this.state.visible){this.scripts[this.state.selected]||=this.getScriptFromObject(this.state.selected);const r=!!this.state.selected&&!!((s=this.scripts[this.state.selected])!=null&&s.engine)&&this.state.runningInstances[this.scripts[this.state.selected].engine],l=!!this.state.selected&&((i=this.scripts[this.state.selected])==null?void 0:i.enabled);return m.jsx(wt,{sx:je.editorDiv,children:m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(HA,{scriptId:this.state.selected,setTourStep:this.setTourStep,tourStep:this.state.tourStep,isTourOpen:this.state.isTourOpen,changed:this.state.changed[this.state.selected],running:r&&l,command:this.state.cmdToRules,themeType:this.state.themeType,themeName:this.props.themeName,theme:this.props.theme,searchText:this.state.searchText,resizing:this.props.resizing,code:this.scripts[this.state.selected].source||"",onChange:c=>this.onChange({script:c})},"flowEditor")})},"flowEditorDiv")}return null}getConfirmDialog(){return this.state.confirm?m.jsx(x.DialogConfirm,{text:this.state.confirm,onClose:s=>{if(this.confirmCallback){const i=this.confirmCallback;this.confirmCallback=null,i(s)}this.setState({confirm:""})}},"dialogConfirm1"):null}getSelectIdDialog(){var s;if(this.state.showSelectId){const i=["state","channel","device","adapter","instance","enum","host","config","script","user","group"],r=["adapter","instance","enum","host","config","script","user","group"];let l=this.selectId.callback?this.selectId.initValue||"":this.getSelect&&this.getSelect()||"",c=l.indexOf("/*");c!==-1&&(l=l.substring(0,c)),c=l.indexOf("//"),c!==-1&&(l=l.substring(0,c));let d=l.match(/"([^"]+)"/);return d&&(l=d[1]),d=l.match(/'([^']+)'/),d&&(l=d[1]),m.jsx(x.DialogSelectID,{theme:this.props.theme,imagePrefix:"../..",themeName:this.props.themeName,themeType:this.state.themeType,socket:this.props.socket,selected:l,expertMode:this.selectId.type&&this.selectId.type!=="all"&&r.includes(this.selectId.type)?!0:void 0,types:((s=this.selectId)==null?void 0:s.type)==="all"?i:[this.selectId.type||"state"],onClose:()=>{this.setState({showSelectId:!1}),this.selectId.callback&&(this.selectId.callback=null)},onOk:(h,p)=>{this.selectId.initValue=null,this.selectId.callback?(this.selectId.callback(h),this.selectId.callback=null):this.setState({insert:`'${h}'/*${p}*/`})}},"dialogSelectID1")}return null}getCronDialog(){return this.state.showCron?m.jsx(x.DialogCron,{theme:this.props.theme,cron:this.cron.callback?this.cron.initValue||"":this.getSelect?this.getSelect():"* * * * *",onClose:()=>this.setState({showCron:!1}),onOk:s=>{this.cron.initValue=null,this.cron.callback?(this.cron.callback(s),this.cron.callback=null):this.setState({insert:`'${s}'`})}},"dialogCron1"):null}getAstroDialog(){return this.state.showAstro?m.jsxs(Ut,{open:!0,onClose:()=>this.setState({showAstro:!1}),children:[m.jsx(ss,{children:x.I18n.t("Astronomical events today")}),m.jsx(qt,{children:this.state.astroEvents?m.jsx(UT,{component:Ow,children:m.jsxs(HT,{size:"small",children:[m.jsx(WT,{children:m.jsxs(s_,{children:[m.jsx(wn,{children:x.I18n.t("Name")}),m.jsx(wn,{children:x.I18n.t("Server time")}),m.jsx(wn,{children:x.I18n.t("Description")})]})}),m.jsx(GT,{children:Object.keys(this.state.astroEvents).map(s=>{var i,r,l,c;return m.jsxs(s_,{children:[m.jsx(wn,{component:"th",scope:"row",children:s.startsWith("next")?"":s}),m.jsx(VT,{title:`${x.I18n.t("Local time")}: ${(i=this.state.astroEvents)!=null&&i[s].isValidDate?new Date((r=this.state.astroEvents)==null?void 0:r[s].date).toLocaleTimeString():"n/a"}`,children:m.jsx(wn,{align:"right",children:(l=this.state.astroEvents)!=null&&l[s].isValidDate?(c=this.state.astroEvents)==null?void 0:c[s].serverTime:"n/a"})}),m.jsx(wn,{children:x.I18n.t(s)})]},s)})})]})}):m.jsx(zT,{})}),m.jsx(Ht,{children:m.jsx(He,{variant:"contained",onClick:()=>this.setState({showAstro:!1}),color:"primary",startIcon:m.jsx(sc,{}),children:x.I18n.t("Close")})})]},"dialogAstro"):null}getEditorDialog(){return this.state.showScript?m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(VA,{adapterName:this.props.adapterName,source:this.scriptDialog.initValue||"",args:this.scriptDialog.args?this.scriptDialog.args.join(", "):"",isReturn:this.scriptDialog.isReturn,socket:this.props.socket,runningInstances:this.state.runningInstances,themeType:this.state.themeType,onClose:s=>{this.scriptDialog.initValue=null,this.scriptDialog.callback&&(s!==!1&&this.scriptDialog.callback(s||""),this.scriptDialog.callback=null),this.setState({showScript:!1})}},"scriptEditorDialog")}):null}getToast(){return m.jsx(KT,{anchorOrigin:{vertical:"bottom",horizontal:"left"},open:!!this.state.toast,autoHideDuration:6e3,onClose:()=>this.setState({toast:""}),slotProps:{content:{"aria-describedby":"message-id"}},message:m.jsx("span",{id:"message-id",children:this.state.toast}),action:[m.jsx(qe,{"aria-label":"close",color:"inherit",style:je.closeToast,onClick:()=>this.setState({toast:""}),size:"medium",children:m.jsx(sc,{})},"close")]},"toast")}setTourStep=s=>this.setState({tourStep:s});getTour(){return this.state.instancesLoaded&&this.state.selected&&this.props.isAnyRulesExists===1&&this.props.objects[this.state.selected]&&this.state.rules&&this.state.visible?m.jsx(jm,{steps:zA,isOpen:this.state.isTourOpen,onRequestClose:()=>{this.setState({isTourOpen:!1}),window.localStorage.setItem("tour","true"),this.props.socket.setState("javascript.0.variables.rulesTour",{val:!0,ack:!0})},goToStep:this.state.tourStep},"tour"):null}getDebug(){return this.props.debugMode?this.state.selected&&this.scripts[this.state.selected]&&this.scripts[this.state.selected].engine&&this.state.runningInstances[this.scripts[this.state.selected].engine]?m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(WA,{runningInstances:this.state.runningInstances,adapterName:this.props.adapterName,socket:this.props.socket,themeName:this.props.themeName,themeType:this.props.themeType,src:this.props.debugInstance?this.props.debugInstance.adapter:this.state.selected,debugInstance:this.props.debugInstance},"debugger")}):(setTimeout(()=>this.props.onDebugModeChange(!1)),null):null}getScriptFromObject(s){var r,l;if(!((r=this.props.objects[s])!=null&&r.common))return;const i=JSON.parse(JSON.stringify(this.props.objects[s].common));return(l=this.props.objects[s].native)!=null&&l.protected&&this.props.password&&(i.source=Wg(this.props.password,i.source)),i}render(){var s,i;return this.state.selected&&this.props.objects[this.state.selected]&&this.state.blockly===null&&this.state.rules===null&&(this.scripts[this.state.selected]||=this.getScriptFromObject(this.state.selected),setTimeout(()=>{const r={blockly:this.scripts[this.state.selected].engineType==="Blockly",rules:this.scripts[this.state.selected].engineType==="Rules",showCompiledCode:!1,debugEnabled:this.scripts[this.state.selected].debug,verboseEnabled:this.scripts[this.state.selected].verbose};this.removeNonExistingScripts(null,r),this.setState(r)},100)),this.state.selected&&!this.props.password&&((i=(s=this.props.objects[this.state.selected])==null?void 0:s.native)!=null&&i.protected)&&setTimeout(()=>{const r=this.state.editing.find(l=>{var c,d;return!((d=(c=this.props.objects[l])==null?void 0:c.native)!=null&&d.protected)})||"";Object.keys(this.scripts).forEach(l=>{var c,d;(d=(c=this.props.objects[l])==null?void 0:c.native)!=null&&d.protected&&delete this.scripts[l]}),this.setState({selected:r},()=>{var l,c;(c=(l=this.props).onSelectedChange)==null||c.call(l,r,this.state.editing),this.state.selected?window.localStorage.setItem("Editor.selected",this.state.selected):window.localStorage.removeItem("Editor.selected")})},50),!this.state.selected&&this.props.password&&this.state.editing.length&&setTimeout(()=>{const r=this.state.editing[0];this.setState({selected:r},()=>{var l,c;(c=(l=this.props).onSelectedChange)==null||c.call(l,r,this.state.editing),window.localStorage.setItem("Editor.selected",this.state.selected)})},50),[this.getTabs(),this.getToolbar(),this.getScriptEditor(),this.getAskAboutDebug(),this.getBlocklyEditor(),this.getRulesEditor(),this.getDebug(),this.getConfirmDialog(),this.getSelectIdDialog(),this.getCronDialog(),this.getEditorDialog(),this.getAstroDialog(),this.getDebugMenu(),this.renderOpenAiDialog(),this.getToast(),this.getTour()]}}const Yt={dialog:{height:"95%"},dropzone:{marginTop:20,width:"100%",borderWidth:5,borderStyle:"dashed",borderColor:"#d0cccc",textAlign:"center",boxSizing:"border-box",paddingTop:45,borderRadius:10,height:"calc(100% - 10px)"},dropzoneDiv:{width:"100%",height:"100%"},dropzoneRejected:{borderColor:"#970000"},dropzoneAccepted:{borderColor:"#17cd02"},icon:{height:"30%",width:"30%",color:"#eeeeee",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",zIndex:0},iconError:{color:"#ffc3c6"},iconOk:{color:"#aaeebc"},text:{top:"50%",left:"50%",transform:"translate(-50%,-50%)",color:"#868686",position:"absolute",zIndex:1}};class zm extends _e.Component{constructor(s){super(s),this.state={error:"",imageStatus:""}}componentDidMount(){setTimeout(()=>{var s;try{(s=window.document.getElementById("import-text-area"))==null||s.focus()}catch{}},100)}handleCancel(){this.props.onClose()}static readFileDataUrl(s,i){const r=new FileReader;r.onload=()=>{i(null,{data:r.result,name:s.name})},r.onabort=()=>{console.error("file reading was aborted"),i(x.I18n.t("file reading was aborted"))},r.onerror=l=>{console.error("file reading has failed"),i(x.I18n.t("file reading has failed: %s",l))},r.readAsDataURL(s)}handleDropFile(s){if(!(s!=null&&s.length))return;const i=s[s.length-1];i&&zm.readFileDataUrl(i,(r,l)=>{var c;r||!l?this.setState({error:r||"No data"}):this.props.onClose(((c=l.data)==null?void 0:c.toString())||"",l.name)})}render(){const s={...Yt.dropzone,...this.state.imageStatus==="accepted"?Yt.dropzoneAccepted:this.state.imageStatus==="rejected"?Yt.dropzoneRejected:void 0};return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"lg",sx:{"& .MuiDialog-paper":Yt.dialog},fullWidth:!0,open:!0,"aria-labelledby":"import-dialog-title",PaperProps:{style:{minHeight:"90%",maxHeight:"90%"}},children:[m.jsx(ss,{id:"import-dialog-title",children:x.I18n.t("Import scripts")}),m.jsxs(qt,{children:[m.jsx(Lw,{maxSize:5e7,onDrop:(i,r)=>{var l,c,d;i.length?this.handleDropFile(i):window.alert(((d=(c=(l=r==null?void 0:r[0])==null?void 0:l.errors)==null?void 0:c[0])==null?void 0:d.message)||x.I18n.t("ra_Cannot upload"))},multiple:!1,accept:{"application/zip":[],"application/x-zip-compressed":[]},children:({getRootProps:i,getInputProps:r,isDragActive:l,isDragReject:c})=>c?(this.state.imageStatus!=="rejected"&&this.setState({imageStatus:"rejected"}),m.jsxs("div",{style:{...s,...Yt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Yt.text,children:x.I18n.t("Some files will be rejected")},"text"),m.jsx(Yc,{style:{...Yt.icon,...Yt.iconError}},"icon")]})):l?(this.state.imageStatus!=="accepted"&&this.setState({imageStatus:"accepted"}),m.jsxs("div",{style:{...s,...Yt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Yt.text,children:x.I18n.t("All files will be accepted")},"text"),m.jsx(Pw,{style:{...Yt.icon,...Yt.iconOk}},"icon")]})):(this.state.imageStatus!=="wait"&&this.setState({imageStatus:"wait"}),m.jsxs("div",{style:{...s,...Yt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Yt.text,children:x.I18n.t("Drop some files here or click...")},"text"),m.jsx(Bw,{style:Yt.icon},"icon")]}))},"image-drop"),this.state.error?m.jsx(su,{text:this.state.error,onClose:()=>this.setState({error:""})}):null]}),m.jsx(Ht,{children:m.jsx(He,{color:"grey",variant:"contained",onClick:()=>this.handleCancel(),startIcon:m.jsx(so,{}),children:x.I18n.t("Close")})})]})}}var Um={exports:{}},XA=Um.exports;(function(a,s){(function(i,r){a.exports=r()})(XA,function(){var i={},r,l,c,d,h,p,f,b,y,w,v,_,$,S,T,E,D,M,P,W,G,z,Z,he,Ce,R,K,C,Q,ve,ce,ne,me,re,B,N,te,q,se,j,Te,ae,we,Ie,Ne,Ae,We,k,X,Y,O,A,U,H,ue,V,be,pe,fe,Le,Ue,Be,Pt,ie,Oe,Ps,ze,Zo,Ze,At,Qo,io,no,Un,Io,Bs,ro,Hn,Gm,pu,Fs,xo,gu,mu,ma,fu,Wn,fa,$u,bu,Vm,Km,Ym,Li,Jm,$a,qm,Gn,ba,Xm,va,Zm,ya,vu,yu,_a,wa,ka,Vn,Qm,Pi,Kn,Ca,ef,tf,sf,Do,xt,Yn,_u,Ts,ao,of,wu,Ta,ku,nf,Cu,Jn,rf,Sa,af,lf,Ea,cf,Bi,uf,Tu,Ia,Su,Eu,df,xa,Fi,Da,hf,Iu,xu,pf,gf,ei,mf,qn,os,ff,$f,bf,vf,yf,_f,wf,Du,lo,ji,Au,kf,Cf,Tf,Sf,Ef,If,xf,Df,Af,Ou,Of,zi,Aa,Rf,Ui,Ru,Nu,Mu,Xn,Oa,Lu,Nf,Pu,Bu,Fu,ju,zu,Uu,Hu,Mf,Zn,Wu,Ra,Na,js,Gu,Vu,Qn,Ku,Yu,Lf,Ma,Ju,Pf,Bf,Ff,jf,zf,Hi,qu,Xu,Wi,La,Uf,Hf,Zu,Qu,co,ed,td,Wf,Gf,Vf,Kf,sd,Yf,od,Jf,ti,er,Pa,Ba,si,id,Fa,nd,bt,qf,Gi,oi,Xf,rd,ja,Vi,ad,ii,tr,ld,cd,Zf,Qf,e$,ud,t$,dd,sr,s$,o$,i$,n$,or,hd,pd,za,Ua,r$,ir,gd,nr,a$,l$,Ao,md,zs,c$,u$,fd,d$,ni,$d,h$,p$,g$,m$,f$,bd,$$,b$,Ha,v$,y$,vd,Wa,yd,Ga,_d,wd,Ki,ri,uo,Us,_$,w$,k$,kd,Va,C$,T$,S$,Cd,Ka,Td,Ya,E$,I$,x$,D$,Me,Xt,St,pt,Hs,Yi,De,vt,Sd,A$,Oo,Ja,qa,Ed,O$,Id,Xa,xd,Dd,R$,Ad,N$,Za,M$,L$,P$,B$,F$,Od,j$,rr,ar,z$,Rd,Nd,Md,Ld,Qa,Pd,U$,H$,W$,Ji,Bd,G$,el,ds,V$,Ro,Fd,K$,lr,jd,zd,Ud,Hd,Wd,Gd,Vd,Kd,Yd,Jd,Y$,J$,q$,X$,Z$,Q$,tl,eb,tb,qd,Xd,Zd,Qd,eh,th,sh,sl,cr,oh,sb,ih,nh,rh,ah,lh,ch,uh,dh,hh,ph,ob,ib,nb,gh,rb,ab,lb,cb,ub,ge;r=function(e,t,o,n){if(!(e instanceof $e)&&typeof e!="string"||`${e}`.trim()==="")throw Error('Invalid type "'+e+'". The type must be a non-empty string or a Blockly.registry.Type.');if(e=`${e}`.toLowerCase(),typeof t!="string"||t.trim()==="")throw Error('Invalid name "'+t+'". The name must be a non-empty string.');const u=t.toLowerCase();if(!o)throw Error("Can not register a null value");let g=No[e],I=ol[e];if(g||(g=No[e]=Object.create(null),I=ol[e]=Object.create(null)),l(e,o),!n&&g[u]&&g[u]!==o)throw Error('Name "'+u+'" with type "'+e+'" already registered.');g[u]=o,I[u]=t},l=function(e,t){switch(e){case String($e.FIELD):if(typeof t.fromJson!="function")throw Error('Type "'+e+'" must have a fromJson function')}},c=function(e,t){e=`${e}`.toLowerCase(),t=t.toLowerCase();const o=No[e];o&&o[t]?(delete No[e][t],delete ol[e][t]):console.warn("Unable to unregister ["+t+"]["+e+"] from the registry.")},d=function(e,t,o){e=`${e}`.toLowerCase(),t=t.toLowerCase();const n=No[e];if(!n||!n[t]){if(t="Unable to find ["+t+"]["+e+"] in the registry.",o)throw Error(t+" You must require or register a "+e+" plugin.");return console.warn(t),null}return n[t]},h=function(e,t){return e=`${e}`.toLowerCase(),t=t.toLowerCase(),(e=No[e])?!!e[t]:!1},p=function(e,t,o){return d(e,t,o)},f=function(e,t,o){return d(e,t,o)},b=function(e,t,o){e=`${e}`.toLowerCase();var n=No[e];if(!n){if(n=`Unable to find [${e}] in the registry.`,o)throw Error(`${n} You must require or register a ${e} plugin.`);return console.warn(n),null}if(!t)return n;e=ol[e],o=Object.create(null);for(const u of Object.keys(n))o[e[u]]=n[u];return o},y=function(e,t,o){return t=t.plugins[String(e)]||Ws,typeof t=="function"?t:p(e,t,o)},w=function(e,t,o,n){e=e+" was deprecated in "+t+" and will be deleted in "+o+".",n&&(e+=` +Use `+n+" instead."),hb.has(e)||(hb.add(e),console.warn(e))},v=function(){return"blockly-"+(LC++).toString(36)},_=function(){return mb.genUid()},$=function(e){return e.type===ee.BLOCK_CREATE},S=function(e){return e.type===ee.BLOCK_DELETE},T=function(e){return e.type===ee.BLOCK_CHANGE},E=function(e){return e.type===ee.BLOCK_FIELD_INTERMEDIATE_CHANGE},D=function(e){return e.type===ee.BLOCK_MOVE},M=function(e){return e.type===ee.CLICK},P=function(e){return e.type===ee.BUBBLE_OPEN},W=function(e){return e.type===ee.VIEWPORT_CHANGE},i.setRecordUndo$$module$build$src$core$events$utils=function(e){ur=e},G=function(){return ur},z=function(e){$b.fireInternal(e)},Z=function(e){if(C()){if(!po.length)try{requestAnimationFrame(()=>{setTimeout(he,0)})}catch{setTimeout(he,0)}Ce(e)}},he=function(){const e=R(po,!0);po.length=0;for(const t of e){if(!t.workspaceId)continue;let o;(o=re(t.workspaceId))==null||o.fireChangeListener(t)}},Ce=function(e){if(T(e)&&e.element==="mutation"){let t;for(t=po.length;0!n.isNull()),t||e.reverse(),e},K=function(){for(let e=0,t;t=po[e];e++)t.recordUndo=!1},i.disable$$module$build$src$core$events$utils=function(){fh++},i.enable$$module$build$src$core$events$utils=function(){fh--},C=function(){return fh===0},i.getGroup$$module$build$src$core$events$utils=function(){return fb},i.setGroup$$module$build$src$core$events$utils=function(e){$b.setGroupInternal(e)},Q=function(e){fb=typeof e=="boolean"?e?_():"":e},ve=function(e){const t=[];e=e.getDescendants(!1);for(let o=0,n;n=e[o];o++)t[o]=n.id;return t},ce=function(e,t){const o=ne(e.type);if(!o)throw Error("Unknown event type.");return o.fromJson(e,t)},ne=function(e){const t=p($e.EVENT,e);if(!t)throw Error(`Event type ${e} not found in registry.`);return t},me=function(e){if((D(e)||$(e))&&e.workspaceId){var t=re(e.workspaceId);if(!e.blockId)throw Error("Encountered a blockEvent without a proper blockId");if(e=t.getBlockById(e.blockId)){const o=ur;try{ur=!1;const n=e.getParent();if(n&&!n.hasDisabledReason($h)){const u=e.getDescendants(!1);for(let g=0,I;I=u[g];g++)I.setDisabledReason(!1,$h)}else if((e.outputConnection||e.previousConnection)&&!t.isDragging())do e.setDisabledReason(!0,$h),e=e.getNextBlock();while(e)}finally{ur=o}}}},re=function(e){return dr[e]||null},B=function(){const e=[];for(const t in dr)e.push(dr[t]);return e},N=function(e){dr[e.id]=e},te=function(e){delete dr[e.id]},q=function(){return bb},se=function(e){bb=e},j=function(){return ai},i.setSelected$$module$build$src$core$common=function(e){if(ai!==e){var t,o,n,u,g,I,L=new(ne(ee.SELECTED))((n=(t=ai)==null?void 0:t.id)!=null?n:null,(u=e==null?void 0:e.id)!=null?u:null,(I=(g=e==null?void 0:e.workspace.id)!=null?g:(o=ai)==null?void 0:o.workspace.id)!=null?I:"");z(L);var le;(le=ai)==null||le.unselect(),ai=e;var Ee;(Ee=ai)==null||Ee.select()}},Te=function(){return vb},ae=function(e){vb=e},we=function(e){for(;e.options.parentWorkspace;)e=e.options.parentWorkspace;const t=e.getParentSvg(),o=e.getCachedParentSvgSize();var n=t.parentElement;if(n instanceof HTMLElement){var u=n.offsetWidth;n=n.offsetHeight,o.width!==u&&(t.setAttribute("width",u+"px"),e.setCachedParentSvgSize(u,null)),o.height!==n&&(t.setAttribute("height",n+"px"),e.setCachedParentSvgSize(null,n)),e.resize()}},Ie=function(e,t){const o=Object.create(null),n=e.getDescendants(!0);t&&(e=e.getNextBlock())&&(e=n.indexOf(e),n.splice(e,n.length-e));for(let u=0,g;g=n[u];u++)o[g.type]?o[g.type]++:o[g.type]=1;return o},Ne=function(e){return function(){this.jsonInit(e)}},Ae=function(e){yb.defineBlocksWithJsonArrayInternal(e)},We=function(e){i.defineBlocks$$module$build$src$core$common(i.createBlockDefinitionsFromJsonArray$$module$build$src$core$common(e))},i.createBlockDefinitionsFromJsonArray$$module$build$src$core$common=function(e){const t={};for(let o=0;o>>/g,e),Th="",e=document.createElement("style"),e.id="blockly-common-style",t=document.createTextNode(t),e.appendChild(t),document.head.insertBefore(e,document.head.firstChild)))},ie=function(e,t,o){e=document.createElementNS(pr,`${e}`);for(const n in t)e.setAttribute(n,`${t[n]}`);return o&&o.appendChild(e),e},Oe=function(e,t){return t=t.split(" "),t.every(o=>e.classList.contains(o))?!1:(e.classList.add(...t),!0)},Ps=function(e,t){e.classList.remove(...t.split(" "))},ze=function(e,t){return t=t.split(" "),t.every(o=>!e.classList.contains(o))?!1:(e.classList.remove(...t),!0)},Zo=function(e,t){return e.classList.contains(t)},Ze=function(e){return e&&e.parentNode?e.parentNode.removeChild(e):null},At=function(e,t){const o=t.nextSibling;if(t=t.parentNode,!t)throw Error("Reference node has no parent.");o?t.insertBefore(e,o):t.appendChild(e)},Qo=function(e,t){e.style.transform=t,e.style["-webkit-transform"]=t},io=function(){Eh++,Es||(Es=Object.create(null))},no=function(){Eh--,Eh||(Es=null)},Un=function(e){const t=e.textContent+` +`+e.className.baseVal;let o;if(Es&&(o=Es[t]))return o;try{o=e.getComputedTextLength()}catch{return 8*e.textContent.length}return Es&&(Es[t]=o),o},Io=function(e,t,o,n){return Bs(e,t+"pt",o,n)},Bs=function(e,t,o,n){const u=e.textContent;e=u+` +`+e.className.baseVal;var g;return Es&&(g=Es[e])||(cl||(g=document.createElement("canvas"),g.className="blocklyComputeCanvas",document.body.appendChild(g),cl=g.getContext("2d")),cl.font=o+" "+t+" "+n,g=u?cl.measureText(u).width:0,Es&&(Es[e]=g)),g},ro=function(e,t,o,n){const u=document.createElement("span");u.style.font=o+" "+t+" "+n,u.textContent=e,e=document.createElement("div"),e.style.width="1px",e.style.height="0",t=document.createElement("div"),t.style.display="flex",t.style.position="fixed",t.style.top="0",t.style.left="0",t.appendChild(u),t.appendChild(e),document.body.appendChild(t),o={height:0,baseline:0};try{t.style.alignItems="baseline",o.baseline=e.offsetTop-u.offsetTop,t.style.alignItems="flex-end",o.height=e.offsetTop-u.offsetTop}finally{document.body.removeChild(t)}return o},Hn=function(e){return Mb.getSizeInternal(e)},Gm=function(e){if(Fs(e,"display")!=="none")return pu(e);const t=e.style,o=t.display,n=t.visibility,u=t.position;t.visibility="hidden",t.position="absolute",t.display="inline";const g=e.offsetWidth;return e=e.offsetHeight,t.display=o,t.position=u,t.visibility=n,new Xe(g,e)},pu=function(e){return new Xe(e.offsetWidth,e.offsetHeight)},Fs=function(e,t){return e=window.getComputedStyle(e),e[t]||e.getPropertyValue(t)},xo=function(e){const t=new ye(0,0);e=e.getBoundingClientRect();var o=document.documentElement;return o=new ye(window.pageXOffset||o.scrollLeft,window.pageYOffset||o.scrollTop),t.x=e.left+o.x,t.y=e.top+o.y,t},gu=function(){const e=document.body,t=document.documentElement;return new ye(e.scrollLeft||t.scrollLeft,e.scrollTop||t.scrollTop)},mu=function(e){const t=parseFloat(Fs(e,"borderLeftWidth")),o=parseFloat(Fs(e,"borderRightWidth")),n=parseFloat(Fs(e,"borderTopWidth"));return e=parseFloat(Fs(e,"borderBottomWidth")),new rt(n,e,t,o)},ma=function(e,t,o){e=fu(e,t,o),t.scrollLeft=e.x,t.scrollTop=e.y},fu=function(e,t,o){var n=xo(e),u=xo(t),g=mu(t);const I=n.x-u.x-g.left;return n=n.y-u.y-g.top,u=pu(e),e=t.clientWidth-u.width,u=t.clientHeight-u.height,g=t.scrollLeft,t=t.scrollTop,o?(g+=I-e/2,t+=n-u/2):(g+=Math.min(I,Math.max(I-e,0)),t+=Math.min(n,Math.max(n-u,0))),new ye(g,t)},Wn=function(e){const t=new ye(0,0);var o=e.x&&e.getAttribute("x");const n=e.y&&e.getAttribute("y");return o&&(t.x=parseInt(o)),n&&(t.y=parseInt(n)),(o=(o=e.getAttribute("transform"))&&o.match(Lb))&&(t.x+=Number(o[1]),o[3]&&(t.y+=Number(o[3]))),(e=e.getAttribute("style"))&&e.includes("translate")&&(e=e.match(Pb))&&(t.x+=Number(e[1]),e[3]&&(t.y+=Number(e[3]))),t},fa=function(e){let t=0,o=0;for(;e;){const n=Wn(e);if(t+=n.x,o+=n.y,(" "+(e.getAttribute("class")||"")+" ").includes(" injectionDiv "))break;e=e.parentNode}return new ye(t,o)},$u=function(){const e=gu();return new rt(e.y,document.documentElement.clientHeight+e.y,e.x,document.documentElement.clientWidth+e.x)},bu=function(){const e=document.documentElement,t=window;return new ye(t.pageXOffset||e.scrollLeft,t.pageYOffset||e.scrollTop)},Vm=function(e,t){var o=t.x;t=t.y;const n=e.getInjectionDiv().getBoundingClientRect();return o=new ye(o-n.left,t-n.top),t=e.getOriginOffsetInPixels(),ye.difference(o,t).scale(1/e.scale)},Km=function(e,t){var o=t.scale(e.scale);t=o.x,o=o.y;const n=e.getInjectionDiv().getBoundingClientRect();return e=e.getOriginOffsetInPixels(),new ye(t+n.left+e.x,o+n.top+e.y)},Ym=function(e){({document:dl=dl,DOMParser:gr=gr,XMLSerializer:mr=mr}=e),ul=new gr,Ih=new mr},i.createElement$$module$build$src$core$utils$xml=function(e){return dl.createElementNS(Bb,e)},i.createTextNode$$module$build$src$core$utils$xml=function(e){return dl.createTextNode(e)},i.textToDom$$module$build$src$core$utils$xml=function(e){let t=ul.parseFromString(e,"text/xml");if(t&&t.documentElement&&!t.getElementsByTagName("parsererror").length)return t.documentElement;if((t=ul.parseFromString(e,"text/html"))&&t.body.firstChild&&t.body.firstChild.nodeName.toLowerCase()==="xml")return t.body.firstChild;throw Error(`DOMParser was unable to parse: ${e}`)},Li=function(e){return Jm(Ih.serializeToString(e))},Jm=function(e){return e.replace(zC,t=>`&#${t.charCodeAt(0)};`)},$a=function(e){return e?((e instanceof Element||typeof e=="string")&&(e=yu(e),e=Zm(e)),qm(e),e):null},qm=function(e){const t=e.kind;if(e=e.contents,t&&t!==Fb&&t!==xh)throw Error("Invalid toolbox kind "+t+". Please supply either "+Fb+" or "+xh);if(!e)throw Error("Toolbox must have a contents attribute.")},Gn=function(e){return e?e.contents?e.contents:Array.isArray(e)&&0o.kind.toUpperCase()==="CATEGORY").length},va=function(e){return e&&e.contents?!!e.contents.filter(function(t){return t.kind.toUpperCase()==="CATEGORY"}).length:!1},Zm=function(e){const t={contents:ya(e)};return e instanceof Node&&vu(e,t),t},ya=function(e){const t=[];let o=e.childNodes;o||(o=e);for(let n=0,u;u=o[n];n++){if(!u.tagName)continue;e={};const g=u.tagName.toUpperCase();e.kind=g,g==="BLOCK"?e.blockxml=u:u.childNodes&&0 document.")}else e instanceof Element&&(t=e);return t},_a=function(e,t,o,n,u,g){const I=g.scrollbar&&g.scrollbar.canScrollVertically();return e.horizontal===Zi.LEFT?(o=u.absoluteMetrics.left+o,I&&g.RTL&&(o+=yt.scrollbarThickness)):(o=u.absoluteMetrics.left+u.viewMetrics.width-t.width-o,I&&!g.RTL&&(o-=yt.scrollbarThickness)),e.vertical===$o.TOP?e=u.absoluteMetrics.top+n:(e=u.absoluteMetrics.top+u.viewMetrics.height-t.height-n,g.scrollbar&&g.scrollbar.canScrollHorizontally()&&(e-=yt.scrollbarThickness)),new rt(e,e+t.height,o,o+t.width)},wa=function(e,t){return{horizontal:t.toolboxMetrics.position===Ge.LEFT||e.horizontalLayout&&!e.RTL?Zi.RIGHT:Zi.LEFT,vertical:t.toolboxMetrics.position===Ge.BOTTOM?$o.TOP:$o.BOTTOM}},ka=function(e,t,o,n){const u=e.left,g=e.right-e.left,I=e.bottom-e.top;for(let L=0;Lg.id!==e.id).map(g=>g.getRelativeToSurfaceXY());for(;sf(ye.sum(o,n),u);)n.translate(t.RTL?-30:30,30);e.moveTo(ye.sum(o,n))},sf=function(e,t){return t.some(o=>1>=Math.abs(o.x-e.x)&&1>=Math.abs(o.y-e.y))},Do=function(e,t){e.setAttribute(WC,t)},xt=function(e,t,o){Array.isArray(o)&&(o=o.join(" ")),e.setAttribute(HC+t,`${o}`)},Yn=function(e){return e.saveState!==void 0&&e.loadState!==void 0},_u=function(e){return wu(e),of()?(Ta(),Promise.resolve()):(Qi||(Qi=new Promise(t=>{Ph=t,Kb=window.requestAnimationFrame(()=>{Ta(),t()})})),Qi)},Ts=function(){return Qi||Promise.resolve()},ao=function(e){e||window.cancelAnimationFrame(Kb),Ta(e),!e&&Ph&&Ph()},of=function(){return Ib},wu=function(e){Mh.add(e),Lh.set(e,i.getGroup$$module$build$src$core$events$utils());const t=e.getParent();t?wu(t):ml.add(e)},Ta=function(e){const t=e?new Set([e]):new Set([...ml].map(g=>g.workspace)),o=[...ml].filter(nf).filter(g=>t.has(g.workspace));for(var n of o)Cu(n);for(const g of t)g.resizeContents();for(var u of o)n=u.getRelativeToSurfaceXY(),u.updateComponentLocations(n);for(const g of o)u=i.getGroup$$module$build$src$core$events$utils(),(n=Lh.get(g))&&i.setGroup$$module$build$src$core$events$utils(n),g.bumpNeighbours(),i.setGroup$$module$build$src$core$events$utils(u);for(const g of o)ku(g);e||(Qi=null)},ku=function(e){ml.delete(e),Mh.delete(e),Lh.delete(e);for(const t of e.getChildren(!1))ku(t)},nf=function(e){return!e.isDisposed()&&!e.getParent()},Cu=function(e){if(Mh.has(e)&&e.initialized){for(const t of e.getChildren(!1))Cu(t);e.renderEfficiently()}},Jn=function(e,t){Yb(e,t)},rf=function(e){Yb=e},Sa=function(e,t){Xb.confirmInternal(e,t)},af=function(e,t){Jb(e,t)},lf=function(e){Jb=e},Ea=function(e,t,o){qb(e,t,o)},cf=function(e){qb=e},Bi=function(e){return e.getProcedureDef!==void 0},uf=function(e){return e.getProcedureCall!==void 0&&e.renameProcedure!==void 0},Tu=function(e){return e.getVariableModel!==void 0},i.allUsedVarModels$$module$build$src$core$variables=function(e){e=e.getAllBlocks(!1);const t=new Set;for(let o=0;o1'),n.appendChild(o),t.push(n)),Zt.variables_get){e.sort(vr.compareByName);for(let u=0,g;g=e[u];u++)o=i.createElement$$module$build$src$core$utils$xml("block"),o.setAttribute("type","variables_get"),o.setAttribute("gap","8"),o.appendChild(ei(g)),t.push(o)}}return t},Eu=function(e){return Qb.generateUniqueNameInternal(e)},df=function(e){return xa(zh.charAt(0),e.getAllVariableNames())},xa=function(e,t){if(!t.length)return e;const o=zh;let n="",u=o.indexOf(e);for(;;){let g=!1;for(let I=0;Ig.getVariableModel().name);if(n&&(o=n.some(g=>g.toLowerCase()===e),n=n.some(g=>g.toLowerCase()===t),o&&n))return u.getName()}return null},gf=function(e,t,o){e=e.toLowerCase(),t=t.toLowerCase(),o=o.getAllBlocks(!1);for(const u of o){if(!Bi(u))continue;o=u.getProcedureDef();var n=o[1];const g=n.some(I=>I.toLowerCase()===e);if(n=n.some(I=>I.toLowerCase()===t),g&&n)return o[0]}return null},ei=function(e){const t=i.createElement$$module$build$src$core$utils$xml("field");return t.setAttribute("name","VAR"),t.setAttribute("id",e.getId()),t.setAttribute("variabletype",e.type),e=i.createTextNode$$module$build$src$core$utils$xml(e.name),t.appendChild(e),t},i.getOrCreateVariablePackage$$module$build$src$core$variables=function(e,t,o,n){let u=i.getVariable$$module$build$src$core$variables(e,t,o,n);return u||(u=mf(e,t,o,n)),u},i.getVariable$$module$build$src$core$variables=function(e,t,o,n){const u=e.getPotentialVariableMap();let g=null;if(t&&(g=e.getVariableById(t),!g&&u&&(g=u.getVariableById(t)),g))return g;if(o){if(n===void 0)throw Error("Tried to look up a variable by name without a type");g=e.getVariable(o,n),!g&&u&&(g=u.getVariable(o,n))}return g},mf=function(e,t,o,n){const u=e.getPotentialVariableMap();return o||(o=Eu(e.isFlyout?e.targetWorkspace:e)),u?u.createVariable(o,n,t):e.createVariable(o,n,t)},qn=function(e,t){e=e.getAllVariables();const o=[];if(t.length!==e.length)for(let n=0;n{le.disposed||le.setConnectionTracking(!0)},1)}return L},Au=function(e,t,{parentConnection:o,isShadow:n=!1}={}){if(!e.type)throw new ev(e);const u=t.newBlock(e.type,e.id);return u.setShadow(n),Cf(u,e),Tf(u,e),Sf(u,e),Ef(o,u,e),If(u,e),xf(u,e),Df(u,e),Af(u,e),Of(u,t.rendered),u},kf=function(e,t){if(C())for(e=qn(e,t),t=0;tt&&(t=o[n].length);var u=-1/0;let g,I=1;do{n=u,g=e,e=[],u=o.length/I;let L=1;for(let le=0;len);return g},Ma=function(e,t,o){const n=[0],u=[];for(var g=0;gn&&(n=L,u=I)}return u?Ju(e,u,o):t},Pf=function(e,t){const o=[];for(let n=0;nuv&&co()}else Cr!==hs&&(clearTimeout(bi),Vh=e.pageX,Kh=e.pageY,bi=setTimeout(Kf,dv))},Qu=function(){Cr=hs=null,co()},co=function(){kr&&(kr=!1,Tt&&(Tt.style.display="none")),bi&&(clearTimeout(bi),bi=0)},ed=function(){co(),rn=!0},td=function(){rn=!1},Wf=function(){Tt&&hs&&(typeof yl=="function"?yl(Tt,hs):Gf())},Gf=function(){var e=Hi(hs);e=i.wrap$$module$build$src$core$utils$string(e,lv),e=e.split(` +`);for(let t=0;to+window.scrollY&&(u-=Tt.offsetHeight+2*Jh),e?n=Math.max(_l-window.scrollX,n):n+Tt.offsetWidth>t+window.scrollX-2*_l&&(n=t-Tt.offsetWidth-2*_l),{x:n,y:u}},Kf=function(){if(!rn&&(Cr=hs,Tt)){Tt.textContent="",Wf();var e=hs.RTL;Tt.style.direction=e?"rtl":"ltr",Tt.style.display="block",kr=!0;var{x:t,y:o}=Vf(e);Tt.style.left=t+"px",Tt.style.top=o+"px"}},sd=function(){return qh},Yf=function(e){qh=e},od=function(){return Xh},Jf=function(e){Xh=e},ti=function(e){e=`${e}`.toLowerCase().trim();var t=hv[e];if(t||(t=e.substring(0,2)==="0x"?"#"+e.substring(2):e,t=t[0]==="#"?t:"#"+t,/^#[0-9a-f]{6}$/.test(t)))return t;if(/^#[0-9a-f]{3}$/.test(t))return["#",t[1],t[1],t[2],t[2],t[3],t[3]].join("");var o=e.match(/^(?:rgb)?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);return o&&(e=Number(o[1]),t=Number(o[2]),o=Number(o[3]),0<=e&&256>e&&0<=t&&256>t&&0<=o&&256>o)?er(e,t,o):null},er=function(e,t,o){return t=e<<16|t<<8|o,16>e?"#"+(16777216|t).toString(16).substr(1):"#"+t.toString(16)},Pa=function(e){return e=ti(e),e?(e=parseInt(e.substr(1),16),[e>>16,e>>8&255,e&255]):[0,0,0]},Ba=function(e,t,o){let n=0,u=0,g=0;if(t===0)g=u=n=o;else{const I=Math.floor(e/60),L=e/60-I;e=o*(1-t);const le=o*(1-t*L);switch(t=o*(1-t*(1-L)),I){case 1:n=le,u=o,g=e;break;case 2:n=e,u=o,g=t;break;case 3:n=e,u=le,g=o;break;case 4:n=t,u=e,g=o;break;case 5:n=o,u=e,g=le;break;case 6:case 0:n=o,u=t,g=e}}return er(Math.floor(n),Math.floor(u),Math.floor(g))},si=function(e,t,o){return e=ti(e),!e||(t=ti(t),!t)?null:(e=Pa(e),t=Pa(t),er(Math.round(t[0]+o*(e[0]-t[0])),Math.round(t[1]+o*(e[1]-t[1])),Math.round(t[2]+o*(e[2]-t[2]))))},id=function(e){return Ba(e,qh,255*Xh)},Fa=function(e,t,o){const n=[];var u=e.split("");u.push("");var g=0;e=[];let I=null;for(let Ee=0;Ee=L?(g=2,I=L,(L=e.join(""))&&n.push(L),e.length=0):L==="{"?g=3:(e.push("%",L),g=0);else if(g===2)if("0"<=L&&"9">=L)I+=L;else{var le=void 0;n.push(parseInt((le=I)!=null?le:"",10)),Ee--,g=0}else g===3&&(L===""?(e.splice(0,0,"%{"),Ee--,g=0):L!=="}"?e.push(L):(g=e.join(""),/[A-Z]\w*/i.test(g)?(L=g.toUpperCase(),(L=L.startsWith("BKY_")?L.substring(4):null)&&L in i.Msg$$module$build$src$core$msg?(g=i.Msg$$module$build$src$core$msg[L],typeof g=="string"?Array.prototype.push.apply(n,Fa(g,t,o)):t?n.push(`${g}`):n.push(g)):n.push("%{"+g+"}")):n.push("%{"+g+"}"),g=e.length=0))}for((t=e.join(""))&&n.push(t),le=[],e.length=0,u=0;u=o)return{hue:o,hex:Ba(o,sd(),255*od())};if(o=ti(t))return{hue:null,hex:o};throw o='Invalid colour: "'+t+'"',e!==t&&(o+=' (from "'+e+'")'),Error(o)},oi=function(){return xs},Xf=function(e){if(xs=e,e===null){let t;(t=document.querySelector("."+kl))==null||t.remove()}},rd=function(){const e=Te()||document.body;document.querySelector("."+kl)?xs=document.querySelector("."+kl):(xs=document.createElement("div"),xs.className=kl),e.appendChild(xs)},ja=function(e,t,o,n){if(Vi(),an=e,wl=o,o=xs){if(o.style.direction=t?"rtl":"ltr",o.style.display="block",!n&&e instanceof lt){let I;n=(I=e.getSourceBlock())==null?void 0:I.workspace}var u;Zh=(u=n)!=null?u:null;var g;e=(g=n)!=null?g:q(),ln=e.getRenderer().getClassName(),cn=e.getTheme().getClassName(),ln&&Oe(o,ln),cn&&Oe(o,cn)}},Vi=function(){if(ad()){an=null;var e=xs;e&&(e.style.display="none",e.style.left="",e.style.top="",wl&&wl(),wl=null,e.textContent="",ln&&(ze(e,ln),ln=""),cn&&(ze(e,cn),cn=""),q().markFocused())}},ad=function(){return!!an},ii=function(e){an===e&&Vi()},tr=function(e){Zh!==null&&Zh!==e||Vi()},ld=function(e,t,o){xs.style.left=e+"px",xs.style.top=t+"px",xs.style.height=o+"px"},cd=function(e,t,o,n){const u=Qf(e,t,o);e=Zf(e,t,o,n),0>u?ld(e,0,o.height+u):ld(e,u,o.height)},Zf=function(e,t,o,n){return n?Math.min(Math.max(t.right-o.width,e.left),e.right-o.width):Math.max(Math.min(t.left,e.right-o.width),e.left)},Qf=function(e,t,o){return t.bottom+o.height>=e.bottom?t.top-o.height:t.bottom},e$=function(e){return!(e==null||!e.repositionForWindowResize)},ud=function(){e$(an)&&an.repositionForWindowResize()||Vi()},t$=function(){return Cl},dd=function(e){Cl=e},sr=function(e,t,o,n){if(ja(pv,o,hd,n),t.length){var u=s$(t,o,e);Tl=u,o$(u,e,o),setTimeout(function(){u.focus()},1),Cl=null}else or()},s$=function(e,t,o){const n=new Rh;n.setRole(Is.MENU);for(let u=0;u{setTimeout(()=>{g.callback(g.scope,o)},0)})},{})}return n},o$=function(e,t,o){const n=$u();t=new rt(t.clientY+n.top,t.clientY+n.top,t.clientX+n.left,t.clientX+n.left),i$(e);const u=e.getSize();o&&(t.left+=u.width,t.right+=u.width,n.left+=u.width,n.right+=u.width),cd(n,t,u,o),e.focus()},i$=function(e){var t=oi();if(!t)throw Error("Attempting to create a context menu when widget div is null");t=e.render(t),Oe(t,"blocklyContextMenu"),H(t,"contextmenu",null,n$),e.focus()},n$=function(e){e.preventDefault(),e.stopPropagation()},or=function(){ii(pv),Cl=null},hd=function(){Tl&&(Tl.dispose(),Tl=null)},i.callbackFactory$$module$build$src$core$contextmenu=function(e,t){return()=>{i.disable$$module$build$src$core$events$utils();let o;try{o=t instanceof Element?ni(t,e.workspace):ji(t,e.workspace);const n=e.getRelativeToSurfaceXY();n.x=e.RTL?n.x-i.config$$module$build$src$core$config.snapRadius:n.x+i.config$$module$build$src$core$config.snapRadius,n.y+=2*i.config$$module$build$src$core$config.snapRadius,o.moveBy(n.x,n.y)}finally{i.enable$$module$build$src$core$events$utils()}return C()&&!o.isShadow()&&z(new(ne(ee.BLOCK_CREATE))(o)),i.setSelected$$module$build$src$core$common(o),o}},pd=function(e,t){return t=fe(t,e.getParentSvg(),e.getInverseScreenCTM()),t.x/=e.scale,t.y/=e.scale,t},za=function(e,t,o){t=pd(e,t),mv.set(e,ye.difference(o,t))},Ua=function(e,t){if(t=pd(e,t),e=mv.get(e),!e)throw Error("Drag not initialized");return ye.sum(e,t)},r$=function(e,t=!1){const o=i.createElement$$module$build$src$core$utils$xml("xml");var n=gd(i.allUsedVarModels$$module$build$src$core$variables(e));n.hasChildNodes()&&o.appendChild(n);for(const u of e.getTopComments())o.appendChild(ir(u,t));for(e=e.getTopBlocks(!0),n=0;n/g,"<$1$2>")},c$=function(e){e=zs(e).split("<");let t="";for(let o=1;o"&&(t+=" ")}return e=e.join(` +`),e=e.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1"),e.replace(/^\n/,"")},u$=function(e,t){return t.setResizesEnabled(!1),t.clear(),e=i.domToWorkspace$$module$build$src$core$xml(e,t),t.setResizesEnabled(!0),e},i.domToWorkspace$$module$build$src$core$xml=function(e,t){let o=0;t.RTL&&(o=t.getWidth());const n=[];io();const u=i.getGroup$$module$build$src$core$events$utils();u||i.setGroup$$module$build$src$core$events$utils(!0),t.setResizesEnabled&&t.setResizesEnabled(!1);let g=!0;try{for(let I=0,L;L=e.childNodes[I];I++){const le=L.nodeName.toLowerCase(),Ee=L;if(le==="block"||le==="shadow"&&!G()){const dt=ni(Ee,t);n.push(dt.id);let ut;const es=parseInt((ut=Ee.getAttribute("x"))!=null?ut:"10",10);let yn;const jr=parseInt((yn=Ee.getAttribute("y"))!=null?yn:"10",10);isNaN(es)||isNaN(jr)||dt.moveBy(t.RTL?o-es:es,jr,["create"]),g=!1}else{if(le==="shadow")throw TypeError("Shadow block cannot be a top-level block.");if(le==="comment")fd(Ee,t);else if(le==="variables"){if(g)$d(Ee,t);else throw Error("'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location.");g=!1}}}}finally{i.setGroup$$module$build$src$core$events$utils(u),t.setResizesEnabled&&t.setResizesEnabled(!0),t.rendered&&ao(),no()}return z(new(ne(ee.FINISHED_LOADING))(t)),n},fd=function(e,t){var o;const n=(o=e.getAttribute("id"))!=null?o:void 0;o=t.rendered?new Il(t,n):new El(t,n);var u;o.setText((u=e.textContent)!=null?u:"");var g;u=parseInt((g=e.getAttribute("x"))!=null?g:"",10);let I;g=parseInt((I=e.getAttribute("y"))!=null?I:"",10),isNaN(u)||isNaN(g)||(u=t.RTL?t.getWidth()-u:u,o.moveTo(new ye(u,g)));var L;t=parseInt((L=e.getAttribute("w"))!=null?L:"",10);let le;return L=parseInt((le=e.getAttribute("h"))!=null?le:"",10),isNaN(t)||isNaN(L)||o.setSize(new Xe(t,L)),e.getAttribute("collapsed")==="true"&&o.setCollapsed(!0),e.getAttribute("editable")==="false"&&o.setEditable(!1),e.getAttribute("movable")==="false"&&o.setMovable(!1),e.getAttribute("deletable")==="false"&&o.setDeletable(!1),o},d$=function(e,t){if(!t.getBlocksBoundingBox)return i.domToWorkspace$$module$build$src$core$xml(e,t);var o=t.getBlocksBoundingBox();if(e=i.domToWorkspace$$module$build$src$core$xml(e,t),o&&o.top!==o.bottom){var n=o.bottom;o=t.RTL?o.right:o.left;var u=1/0;let g=-1/0,I=1/0;for(let L=0;Lg&&(g=le.x)}for(n=n-I+10,o=t.RTL?o-g:o-u,u=0;uEe.setBubbleVisible(g),1)}},m$=function(e,t){for(let o=0;ou}),yd(u,{x:n.x,y:n.y,width:e.width,height:e.height},t.RTL,new Date)}},yd=function(e,t,o,n){const u=(new Date().getTime()-n.getTime())/150;1o)){var n=t.getSvgXY(e.getSvgRoot());e.outputConnection?(n.x+=(e.RTL?3:-3)*o,n.y+=13*o):e.previousConnection&&(n.x+=(e.RTL?-23:23)*o,n.y+=3*o);var u=ie(J.CIRCLE,{cx:n.x,cy:n.y,r:0,fill:"none",stroke:"#888","stroke-width":10},t.getParentSvg());e=ie(J.ANIMATE,{id:"animationCircle",begin:"indefinite",attributeName:"r",dur:"150ms",from:0,to:25*o},u),t=ie(J.ANIMATE,{id:"animationOpacity",begin:"indefinite",attributeName:"opacity",dur:"150ms",from:1,to:0},u),e.beginElement(),t.beginElement(),setTimeout(()=>{Ze(u)},150)}},_d=function(e){if(Ki(),e.workspace.getAudioManager().play("disconnect"),!(1>e.workspace.scale)){var t=e.getHeightWidth().height;t=Math.atan(10/t)/Math.PI*180,e.RTL||(t*=-1),Sr=e,wd(e,t,new Date,0)}},wd=function(e,t,o,n){const u=[.66,1,.66,0,-.66,-1,-.66,0];let g="";o.getTime()+200>new Date().getTime()&&(g=`skewX(${Math.round(u[n%u.length]*t)})`,xl=setTimeout(wd,15,e,t,o,n+1)),e.getSvgRoot().setAttribute("transform",`${e.getTranslation()} ${g}`)},Ki=function(){Sr&&(xl&&(clearTimeout(xl),xl=null),Sr.getSvgRoot().setAttribute("transform",Sr.getTranslation()),Sr=null)},ri=function(e){return e.getRelativeToSurfaceXY!==void 0&&e.isMovable!==void 0&&e.startDrag!==void 0&&e.drag!==void 0&&e.endDrag!==void 0&&e.revertDrag!==void 0},uo=function(e,t){for(const o in t)e[o]=t[o]!==null&&typeof t[o]=="object"?uo(e[o]||Object.create(null),t[o]):t[o];return e},Us=function(e,t){r($e.FIELD,e,t)},_$=function(e){c($e.FIELD,e)},i.fromJson$$module$build$src$core$field_registry=function(e){return vv.fromJsonInternal(e)},w$=function(e){const t=f($e.FIELD,e.type);return t?t.fromJson(e):(console.warn("Blockly could not create a field of type "+e.type+". The field is probably not being registered. This could be because the file is not loaded, the field does not register itself (Issue #1584), or the registration is not being reached."),null)},i.register$$module$build$src$core$extensions=function(e,t){if(typeof e!="string"||e.trim()==="")throw Error('Error: Invalid extension name "'+e+'"');if(dn[e])throw Error('Error: Extension "'+e+'" is already registered.');if(typeof t!="function")throw Error('Error: Extension "'+e+'" must be a function');dn[e]=t},i.registerMixin$$module$build$src$core$extensions=function(e,t){if(!t||typeof t!="object")throw Error('Error: Mixin "'+e+'" must be a object');i.register$$module$build$src$core$extensions(e,function(){this.mixin(t)})},i.registerMutator$$module$build$src$core$extensions=function(e,t,o,n){const u='Error when registering mutator "'+e+'": ';Td(u,t);const g=Cd(t,u);if(o&&typeof o!="function")throw Error(u+'Extension "'+e+'" is not a function');i.register$$module$build$src$core$extensions(e,function(){g&&this.setMutator(new i.MutatorIcon$$module$build$src$core$icons$mutator_icon(n||[],this)),this.mixin(t),o&&o.apply(this)})},k$=function(e){kd(e)?delete dn[e]:console.warn('No extension mapping for name "'+e+'" found to unregister')},kd=function(e){return!!dn[e]},Va=function(e,t,o){const n=dn[e];if(typeof n!="function")throw Error('Error: Extension "'+e+'" not found.');let u;if(o?C$(e,t):u=Ya(t),n.apply(t),o)Td('Error after applying mutator "'+e+'": ',t);else if(!E$(u,t))throw Error('Error when applying extension "'+e+'": mutation properties changed when applying a non-mutator extension.')},C$=function(e,t){if(Ya(t).length)throw Error('Error: tried to apply mutation "'+e+'" to a block that already has mutator functions. Block id: '+t.id)},T$=function(e,t){return Ka(e.mutationToDom,e.domToMutation,t+" mutationToDom/domToMutation")},S$=function(e,t){return Ka(e.saveExtraState,e.loadExtraState,t+" saveExtraState/loadExtraState")},Cd=function(e,t){return Ka(e.compose,e.decompose,t+" compose/decompose")},Ka=function(e,t,o){if(e&&t){if(typeof e!="function"||typeof t!="function")throw Error(o+" must be a function");return!0}if(!e&&!t)return!1;throw Error(o+"Must have both or neither functions")},Td=function(e,t){const o=T$(t,e),n=S$(t,e);if(!o&&!n)throw Error(e+"Mutations must contain either XML hooks, or JSON hooks, or both");Cd(t,e)},Ya=function(e){const t=[];return e.domToMutation!==void 0&&t.push(e.domToMutation),e.mutationToDom!==void 0&&t.push(e.mutationToDom),e.saveExtraState!==void 0&&t.push(e.saveExtraState),e.loadExtraState!==void 0&&t.push(e.loadExtraState),e.compose!==void 0&&t.push(e.compose),e.decompose!==void 0&&t.push(e.decompose),t},E$=function(e,t){if(t=Ya(t),t.length!==e.length)return!1;for(let o=0;o!n.getReturnTypes()).map(n=>[n.getName(),n.getParameters().map(u=>u.getName()),!1]);e.getBlocksByType("procedures_defnoreturn",!1).forEach(n=>{!Oo(n)&&Bi(n)&&t.push(n.getProcedureDef())});const o=e.getProcedureMap().getProcedures().filter(n=>!!n.getReturnTypes()).map(n=>[n.getName(),n.getParameters().map(u=>u.getName()),!0]);return e.getBlocksByType("procedures_defreturn",!1).forEach(n=>{!Oo(n)&&Bi(n)&&o.push(n.getProcedureDef())}),t.sort(Ed),o.sort(Ed),[t,o]},Ed=function(e,t){return e[0].localeCompare(t[0],void 0,{sensitivity:"base"})},i.findLegalName$$module$build$src$core$procedures=function(e,t){if(t.isInFlyout)return e;for(e=e||i.Msg$$module$build$src$core$msg.UNNAMED_KEY||"unnamed";!O$(e,t.workspace,t);){const o=e.match(/^(.*?)(\d+)$/);e=o?o[1]+(parseInt(o[2])+1):e+"2"}return e},O$=function(e,t,o){return!Id(e,t,o)},Id=function(e,t,o){for(const n of t.getAllBlocks(!1))if(n!==o&&Bi(n)&&i.Names$$module$build$src$core$names.equals(n.getProcedureDef()[0],e))return!0;o=o&&Oo(o)?o==null?void 0:o.getProcedureModel():void 0;for(const n of t.getProcedureMap().getProcedures())if(n!==o&&i.Names$$module$build$src$core$names.equals(n.getName(),e))return!0;return!1},i.rename$$module$build$src$core$procedures=function(e){var t=this.getSourceBlock();if(!t)throw new _t;e=e.trim();const o=i.findLegalName$$module$build$src$core$procedures(e,t);Oo(t)&&!t.isInsertionMarker()&&t.getProcedureModel().setName(o);const n=this.getValue();if(n!==e&&n!==o)for(e=t.workspace.getAllBlocks(!1),t=0;tN$(o,e)||uf(o)&&i.Names$$module$build$src$core$names.equals(o.getProcedureCall(),e))},N$=function(e,t){return Oo(e)&&!e.isProcedureDef()&&e.getProcedureModel()&&i.Names$$module$build$src$core$names.equals(e.getProcedureModel().getName(),t)},i.mutateCallers$$module$build$src$core$procedures=function(e){const t=G();var o=e.getProcedureDef()[0];const n=e.mutationToDom(!0);e=Ad(o,e.workspace);for(let g=0,I;I=e[g];g++){o=(o=I.mutationToDom())&&Li(o),I.domToMutation&&I.domToMutation(n);var u=I.mutationToDom();u=u&&Li(u),o!==u&&(i.setRecordUndo$$module$build$src$core$events$utils(!1),z(new(ne(ee.BLOCK_CHANGE))(I,"mutation",null,o,u)),i.setRecordUndo$$module$build$src$core$events$utils(t))}},i.getDefinition$$module$build$src$core$procedures=function(e,t){for(const o of t.getAllBlocks(!1))if(Oo(o)&&o.isProcedureDef()&&i.Names$$module$build$src$core$names.equals(o.getProcedureModel().getName(),e)||Bi(o)&&i.Names$$module$build$src$core$names.equals(o.getProcedureDef()[0],e))return o;return null},Za=function(e){return e.isDynamic},M$=function(e){return e.pathDown!==void 0&&e.pathUp!==void 0},L$=function(e){return e.pathLeft!==void 0&&e.pathRight!==void 0},P$=function(e,t){if(!e||!t)throw Error("Cannot connect null connections.");e.targetConnection=t,t.targetConnection=e},B$=function(e,t){let o=null;t=t.outputConnection;const n=t==null?void 0:t.getConnectionChecker();for(let u=0,g;g=e.inputList[u];u++){const I=g.connection;let L;if(I&&((L=n)!=null&&L.canConnect(t,I,!1))){if(o)return null;o=I}}return o},F$=function(e,t){let o;for(;o=B$(e,t);)if(e=o.targetBlock(),!e||e.isShadow())return o;return null},Od=function(e){return e.getType!==void 0&&e.initView!==void 0&&e.dispose!==void 0&&e.getWeight!==void 0&&e.getSize!==void 0&&e.applyColour!==void 0&&e.hideForInsertionMarker!==void 0&&e.updateEditable!==void 0&&e.updateCollapsed!==void 0&&e.isShownWhenCollapsed!==void 0&&e.setOffsetInBlock!==void 0&&e.onLocationChange!==void 0&&e.onClick!==void 0},j$=function(e){return Od(e)&&zi(e)&&Yn(e)&&e.setText!==void 0&&e.getText!==void 0&&e.setBubbleSize!==void 0&&e.getBubbleSize!==void 0&&e.getType()===Ct.COMMENT},rr=function(e){let t=e.outputConnection;return(!t||e.previousConnection&&e.previousConnection.isConnected())&&(t=e.previousConnection),t},ar=function(e,t){r($e.RENDERER,e,t)},z$=function(e){c($e.RENDERER,e)},Rd=function(e,t,o){return e=new(p($e.RENDERER,e))(e),e.init(t,o),e},Nd=function(e){Fi(e.getTargetWorkspace(),void 0,"String")},Md=function(e){Fi(e.getTargetWorkspace(),void 0,"Number")},Ld=function(e){Fi(e.getTargetWorkspace(),void 0,"Colour")},Qa=function(e){let t=[],o=document.createElement("button");return o.setAttribute("text",i.Msg$$module$build$src$core$msg.NEW_STRING_VARIABLE),o.setAttribute("callbackKey","CREATE_VARIABLE_STRING"),t.push(o),o=document.createElement("button"),o.setAttribute("text",i.Msg$$module$build$src$core$msg.NEW_NUMBER_VARIABLE),o.setAttribute("callbackKey","CREATE_VARIABLE_NUMBER"),t.push(o),o=document.createElement("button"),o.setAttribute("text",i.Msg$$module$build$src$core$msg.NEW_COLOUR_VARIABLE),o.setAttribute("callbackKey","CREATE_VARIABLE_COLOUR"),t.push(o),e.registerButtonCallback("CREATE_VARIABLE_STRING",Nd),e.registerButtonCallback("CREATE_VARIABLE_NUMBER",Md),e.registerButtonCallback("CREATE_VARIABLE_COLOUR",Ld),e=Pd(e),t=t.concat(e)},Pd=function(e){e=e.getAllVariables();const t=[];if(0L.id!=e.id).map(L=>L.getRelativeToSurfaceXY());for(;H$(ye.sum(t,g),I)||W$(e,ye.sum(u,g),n);)o.RTL?g.translate(-n,2*n):g.translate(n,2*n);e.moveTo(ye.sum(t,g))},H$=function(e,t){return t.some(o=>1>=Math.abs(o.x-e.x)&&1>=Math.abs(o.y-e.y))},W$=function(e,t,o){return e.getConnections_(!1).some(n=>!!n.closest(o,t).connection)},Ji=function(e,t,o){const n=o.getBoundingRectangle(),u=n.right-n.left,g=Ui(t.top,n.top,t.top+t.height-(n.bottom-n.top))-n.top;let I=t.left;return t=t.left+t.width-u,e.RTL?I=Math.min(t,I):t=Math.max(I,t),(e=Ui(I,n.left,t)-n.left)||g?(o.moveBy(e,g,["inbounds"]),!0):!1},Bd=function(e){return t=>{var o=e.getMetricsManager();if(o.hasFixedEdges()&&!e.isDragging()){var n;if(db.includes((n=t.type)!=null?n:"")){n=o.getScrollMetrics(!0);const u=G$(e,t);u&&(o=i.getGroup$$module$build$src$core$events$utils()||!1,i.setGroup$$module$build$src$core$events$utils(t.group),Ji(e,n,u)&&!t.group&&console.warn("Moved object in bounds but there was no event group. This may break undo."),i.setGroup$$module$build$src$core$events$utils(o))}else W(t)&&t.scale&&t.oldScale&&t.scale>t.oldScale&&el(e)}}},G$=function(e,t){let o=null;switch(t.type){case ee.BLOCK_CREATE:case ee.BLOCK_MOVE:(o=e.getBlockById(t.blockId))&&(o=o.getRootBlock());break;case ee.COMMENT_CREATE:case ee.COMMENT_MOVE:case ee.COMMENT_RESIZE:o=e.getCommentById(t.commentId)}return o},el=function(e){var t=e.getMetricsManager();if(t.hasFixedEdges()&&!e.isDragging()){t=t.getScrollMetrics(!0);var o=e.getTopBoundedElements();for(let n=0,u;u=o[n];n++)Ji(e,t,u)}},ds=function(e){return e.isDeletable!==void 0&&e.dispose!==void 0&&e.setDeleteStyle!==void 0},V$=function(e){const t=e.toCopyData();Sp=t;let o;return Ep=(o=e.workspace)!=null?o:null,t},Ro=function(e,t,o){return e&&t?Fd(e,t,o):Sp&&Ep?Fd(Sp,Ep):null},Fd=function(e,t,o){let n;t=t.isMutator?t:(n=t.getRootWorkspace())!=null?n:t;let u,g;return(g=(u=f($e.PASTER,e.paster,!1))==null?void 0:u.paste(e,t,o))!=null?g:null},K$=function(e){const t=e.toCopyData();return t?Ro(t,e.workspace):null},lr=function(e){return e.toCopyData!==void 0},jd=function(){st.registry.register({name:Ys.ESCAPE,preconditionFn(e){return!e.options.readOnly},callback(e){return e.hideChaff(),!0},keyCodes:[Ye.ESC]})},zd=function(){st.registry.register({name:Ys.DELETE,preconditionFn(e){const t=j();return!e.options.readOnly&&t!=null&&ds(t)&&t.isDeletable()&&!bo.inProgress()},callback(e,t){return t.preventDefault(),e=j(),e instanceof $s?e.checkAndDelete():ds(e)&&e.isDeletable()&&(i.setGroup$$module$build$src$core$events$utils(!0),e.dispose(),i.setGroup$$module$build$src$core$events$utils(!1)),!0},keyCodes:[Ye.DELETE,Ye.BACKSPACE]})},Ud=function(){const e=st.registry.createSerializedKey(Ye.C,[Ye.CTRL]),t=st.registry.createSerializedKey(Ye.C,[Ye.ALT]),o=st.registry.createSerializedKey(Ye.C,[Ye.META]);st.registry.register({name:Ys.COPY,preconditionFn(n){const u=j();return!n.options.readOnly&&!bo.inProgress()&&u!=null&&ds(u)&&u.isDeletable()&&ri(u)&&u.isMovable()&&lr(u)},callback(n,u){return u.preventDefault(),n.hideChaff(),u=j(),!u||!lr(u)?!1:(Ho=u.toCopyData(),Wo=u.workspace instanceof cs?u.workspace:n,$n=ri(u)?u.getRelativeToSurfaceXY():null,!!Ho)},keyCodes:[e,t,o]})},Hd=function(){const e=st.registry.createSerializedKey(Ye.X,[Ye.CTRL]),t=st.registry.createSerializedKey(Ye.X,[Ye.ALT]),o=st.registry.createSerializedKey(Ye.X,[Ye.META]);st.registry.register({name:Ys.CUT,preconditionFn(n){const u=j();return!n.options.readOnly&&!bo.inProgress()&&u!=null&&ds(u)&&u.isDeletable()&&ri(u)&&u.isMovable()&&!u.workspace.isFlyout},callback(n){const u=j();return u instanceof $s?(Ho=u.toCopyData(),Wo=n,$n=u.getRelativeToSurfaceXY(),u.checkAndDelete(),!0):ds(u)&&u.isDeletable()&&lr(u)?(Ho=u.toCopyData(),Wo=n,$n=ri(u)?u.getRelativeToSurfaceXY():null,u.dispose(),!0):!1},keyCodes:[e,t,o]})},Wd=function(){const e=st.registry.createSerializedKey(Ye.V,[Ye.CTRL]),t=st.registry.createSerializedKey(Ye.V,[Ye.ALT]),o=st.registry.createSerializedKey(Ye.V,[Ye.META]);st.registry.register({name:Ys.PASTE,preconditionFn(n){return!n.options.readOnly&&!bo.inProgress()},callback(){if(!Ho||!Wo)return!1;if(!$n)return!!Ro(Ho,Wo);const{left:n,top:u,width:g,height:I}=Wo.getMetricsManager().getViewMetrics(!0);if(new rt(u,u+I,n,n+g).contains($n.x,$n.y))return!!Ro(Ho,Wo);const L=new ye(n+g/2,u+I/2);return!!Ro(Ho,Wo,L)},keyCodes:[e,t,o]})},Gd=function(){const e=st.registry.createSerializedKey(Ye.Z,[Ye.CTRL]),t=st.registry.createSerializedKey(Ye.Z,[Ye.ALT]),o=st.registry.createSerializedKey(Ye.Z,[Ye.META]);st.registry.register({name:Ys.UNDO,preconditionFn(n){return!n.options.readOnly&&!bo.inProgress()},callback(n,u){return n.hideChaff(),n.undo(!1),u.preventDefault(),!0},keyCodes:[e,t,o]})},Vd=function(){const e=st.registry.createSerializedKey(Ye.Z,[Ye.SHIFT,Ye.CTRL]),t=st.registry.createSerializedKey(Ye.Z,[Ye.SHIFT,Ye.ALT]),o=st.registry.createSerializedKey(Ye.Z,[Ye.SHIFT,Ye.META]),n=st.registry.createSerializedKey(Ye.Y,[Ye.CTRL]);st.registry.register({name:Ys.REDO,preconditionFn(u){return!bo.inProgress()&&!u.options.readOnly},callback(u,g){return u.hideChaff(),u.undo(!0),g.preventDefault(),!0},keyCodes:[e,t,o,n]})},Kd=function(){jd(),zd(),Ud(),Hd(),Wd(),Gd(),Vd()},Yd=function(e){const t=e.saveState();return e.getParameters().length&&(t.parameters=e.getParameters().map(o=>o.saveState())),t},Jd=function(e,t,o,n){if(e=e.loadState(o,n),!o.parameters)return e;for(const[u,g]of o.parameters.entries())e.insertParameter(t.loadState(g,n),u);return e},Y$=function(e){const t=Object.create(null),o=b($e.SERIALIZER,!0);for(const n in o){let u;const g=(u=o[n])==null?void 0:u.save(e);g&&(t[n]=g)}return t},J$=function(e,t,{recordUndo:o=!1}={}){var n=b($e.SERIALIZER,!0);if(n){n=Object.entries(n).sort((g,I)=>I[1].priority-g[1].priority);var u=G();i.setRecordUndo$$module$build$src$core$events$utils(o),(o=i.getGroup$$module$build$src$core$events$utils())||i.setGroup$$module$build$src$core$events$utils(!0),io(),t instanceof cs&&t.setResizesEnabled(!1);for(const[,g]of n.reverse()){let I;(I=g)==null||I.clear(t)}for(const[g,I]of n.reverse())if(e[g]){let L;(L=I)==null||L.load(e[g],t)}t instanceof cs&&t.setResizesEnabled(!0),no(),z(new(ne(ee.FINISHED_LOADING))(t)),i.setGroup$$module$build$src$core$events$utils(o),i.setRecordUndo$$module$build$src$core$events$utils(u)}},q$=function(e,t){let o=null;o=typeof e=="string"?document.getElementById(e)||document.querySelector(e):e;var n;if(!document.contains(o)&&document!==((n=o)==null?void 0:n.ownerDocument))throw Error("Error: container is not in current document");e=new gs(t||{}),n=document.createElement("div"),Oe(n,"injectionDiv"),t!=null&&t.rtl&&Oe(n,"blocklyRTL"),n.tabIndex=0,xt(n,Et.LABEL,i.Msg$$module$build$src$core$msg.WORKSPACE_ARIA_LABEL),o.appendChild(n),t=X$(n,e);const u=Z$(n,t,e);return Q$(u),se(u),we(u),n.addEventListener("focusin",function(){se(u)}),H(n,"keydown",null,tl),H(Xn(),"keydown",null,tl),(t=oi())&&H(t,"keydown",null,tl),u},X$=function(e,t){e.setAttribute("dir","LTR"),Pt(t.hasCss,t.pathToMedia),e=ie(J.SVG,{xmlns:pr,"xmlns:html":Gs,"xmlns:xlink":is,version:"1.1",class:"blocklySvg",tabindex:"0"},e);const o=ie(J.DEFS,{},e),n=String(Math.random()).substring(2);return t.gridPattern=sp.createDom(n,t.gridOptions,o),e},Z$=function(e,t,o){o.parentWorkspace=null,o=new cs(o);const n=o.options;o.scale=n.zoomOptions.startScale,t.appendChild(o.createDom("blocklyMainBackground",e));var u=o.getRenderer().getClassName();return u&&Oe(e,u),(u=o.getTheme().getClassName())&&Oe(e,u),!n.hasCategories&&n.languageTree&&(e=o.addFlyout(J.SVG),At(e,t)),n.hasTrashcan&&o.addTrashcan(),n.zoomOptions&&n.zoomOptions.controls&&o.addZoomControls(),o.getThemeManager().subscribe(t,"workspaceBackgroundColour","background-color"),o.translate(0,0),o.addChangeListener(Bd(o)),we(o),rd(),Ru(),Xu(),o},Q$=function(e){const t=e.options;var o=e.getParentSvg();if(H(o.parentNode,"contextmenu",null,function(n){be(n)||n.preventDefault()}),o=H(window,"resize",null,function(){co(),e.hideComponents(!0),Vu(),ud(),we(e),el(e)}),e.setResizeHandlerWrapper(o),eb(),t.languageTree){o=e.getToolbox();const n=e.getFlyout(!0);o?o.init():n&&(n.init(e),n.show(t.languageTree),typeof n.scrollToStart=="function"&&n.scrollToStart())}t.hasTrashcan&&e.trashcan.init(),t.zoomOptions&&t.zoomOptions.controls&&e.zoomControls_.init(),t.moveOptions&&t.moveOptions.scrollbars?(e.scrollbar=new xp(e,t.moveOptions.scrollbars===!0||!!t.moveOptions.scrollbars.horizontal,t.moveOptions.scrollbars===!0||!!t.moveOptions.scrollbars.vertical,"blocklyMainWorkspaceScrollbar"),e.scrollbar.resize()):e.setMetrics({x:.5,y:.5}),t.hasSounds&&tb(t.pathToMedia,e)},tl=function(e){const t=q();t&&!(be(e)||t.rendered&&!t.isVisible())&&st.registry.onKeyDown(t,e)},eb=function(){iy||(H(document,"scroll",null,function(){const e=B();for(let t=0,o;o=e[t];t++)o instanceof cs&&o.updateInverseScreenCTM()}),ue(document,"touchend",null,X),ue(document,"touchcancel",null,X)),iy=!0},tb=function(e,t){function o(){for(;u.length;){const g=u.pop();g&&V(g)}n.preload()}const n=t.getAudioManager();n.load([e+"click.mp3",e+"click.wav",e+"click.ogg"],"click"),n.load([e+"disconnect.wav",e+"disconnect.mp3",e+"disconnect.ogg"],"disconnect"),n.load([e+"delete.mp3",e+"delete.ogg",e+"delete.wav"],"delete");const u=[];u.push(H(document,"pointermove",null,o,!0)),u.push(H(document,"touchstart",null,o,!0))},qd=function(){Ke.registry.register({displayText(){return i.Msg$$module$build$src$core$msg.UNDO},preconditionFn(e){return 0t.length?cr(t):Sa(i.Msg$$module$build$src$core$msg.DELETE_ALL_BLOCKS.replace("%1",String(t.length)),function(o){o&&cr(t)})}},scopeType:Ke.ScopeType.WORKSPACE,id:"workspaceDelete",weight:6})},sb=function(){qd(),Xd(),Zd(),eh(),th(),oh()},ih=function(){Ke.registry.register({displayText(){return i.Msg$$module$build$src$core$msg.DUPLICATE_BLOCK},preconditionFn(e){return e=e.block,!e.isInFlyout&&e.isDeletable()&&e.isMovable()?e.isDuplicatable()?"enabled":"disabled":"hidden"},callback(e){if(e.block){var t=e.block.toCopyData();t&&Ro(t,e.block.workspace)}},scopeType:Ke.ScopeType.BLOCK,id:"blockDuplicate",weight:1})},nh=function(){Ke.registry.register({displayText(e){return e.block.hasIcon(_o.TYPE)?i.Msg$$module$build$src$core$msg.REMOVE_COMMENT:i.Msg$$module$build$src$core$msg.ADD_COMMENT},preconditionFn(e){return e=e.block,!e.isInFlyout&&e.workspace.options.comments&&!e.isCollapsed()&&e.isEditable()?"enabled":"hidden"},callback(e){e=e.block,e.hasIcon(_o.TYPE)?e.setCommentText(null):e.setCommentText("")},scopeType:Ke.ScopeType.BLOCK,id:"blockComment",weight:2})},rh=function(){Ke.registry.register({displayText(e){return e.block.getInputsInline()?i.Msg$$module$build$src$core$msg.EXTERNAL_INPUTS:i.Msg$$module$build$src$core$msg.INLINE_INPUTS},preconditionFn(e){if(e=e.block,!e.isInFlyout&&e.isMovable()&&!e.isCollapsed()){for(let t=1;t(t.has(Gt)?1:0),e.getInheritedDisabled()||t?"disabled":"enabled"}return"hidden"},callback(e){e=e.block;const t=i.getGroup$$module$build$src$core$events$utils();t||i.setGroup$$module$build$src$core$events$utils(!0),e.setDisabledReason(!e.hasDisabledReason(Gt),Gt),i.setGroup$$module$build$src$core$events$utils(t)},scopeType:Ke.ScopeType.BLOCK,id:"blockDisable",weight:5})},ch=function(){Ke.registry.register({displayText(e){var t=e.block;return e=t.getDescendants(!1).length,(t=t.getNextBlock())&&(e-=t.getDescendants(!1).length),e===1?i.Msg$$module$build$src$core$msg.DELETE_BLOCK:i.Msg$$module$build$src$core$msg.DELETE_X_BLOCKS.replace("%1",`${e}`)},preconditionFn(e){return!e.block.isInFlyout&&e.block.isDeletable()?"enabled":"hidden"},callback(e){e.block&&e.block.checkAndDelete()},scopeType:Ke.ScopeType.BLOCK,id:"blockDelete",weight:6})},uh=function(){Ke.registry.register({displayText(){return i.Msg$$module$build$src$core$msg.HELP},preconditionFn(e){return e=e.block,(typeof e.helpUrl=="function"?e.helpUrl():e.helpUrl)?"enabled":"hidden"},callback(e){e.block.showHelp()},scopeType:Ke.ScopeType.BLOCK,id:"blockHelp",weight:7})},dh=function(){Ke.registry.register({displayText:()=>i.Msg$$module$build$src$core$msg.REMOVE_COMMENT,preconditionFn(e){let t;return(t=e.comment)!=null&&t.isDeletable()?"enabled":"hidden"},callback(e){i.setGroup$$module$build$src$core$events$utils(!0);let t;(t=e.comment)==null||t.dispose(),i.setGroup$$module$build$src$core$events$utils(!1)},scopeType:Ke.ScopeType.COMMENT,id:"commentDelete",weight:6})},hh=function(){Ke.registry.register({displayText:()=>i.Msg$$module$build$src$core$msg.DUPLICATE_COMMENT,preconditionFn(e){let t;return(t=e.comment)!=null&&t.isMovable()?"enabled":"hidden"},callback(e){if(e.comment){var t=e.comment.toCopyData();t&&Ro(t,e.comment.workspace)}},scopeType:Ke.ScopeType.COMMENT,id:"commentDuplicate",weight:1})},ph=function(){Ke.registry.register({displayText:()=>i.Msg$$module$build$src$core$msg.ADD_COMMENT,preconditionFn:e=>{let t;return(t=e.workspace)!=null&&t.isMutator?"hidden":"enabled"},callback:(e,t)=>{if(e=e.workspace){i.setGroup$$module$build$src$core$events$utils(!0);var o=new Il(e);o.setText(i.Msg$$module$build$src$core$msg.WORKSPACE_COMMENT_DEFAULT_TEXT),o.moveTo(ob(new ye(t.clientX,t.clientY),e)),i.setSelected$$module$build$src$core$common(o),i.setGroup$$module$build$src$core$events$utils(!1)}},scopeType:Ke.ScopeType.WORKSPACE,id:"commentCreate",weight:8})},ob=function(e,t){var o=t.getInjectionDiv().getBoundingClientRect();return e=new ye(e.x-o.left,e.y-o.top),o=t.getOriginOffsetInPixels(),e=ye.difference(e,o),e.scale(1/t.scale),e},ib=function(){ih(),nh(),rh(),ah(),lh(),ch(),uh()},nb=function(){hh(),dh(),ph()},gh=function(){sb(),ib()},rb=function(e){return e.paste!==void 0},ab=function(e){return e.getSvgRoot!==void 0},lb=function(e){return typeof e.id=="string"&&e.workspace!==void 0&&e.select!==void 0&&e.unselect!==void 0},cb=function(e){return e.isSelectable()},ub=function(e){q().hideChaff(e)},ge=ge||{},ge.scope={},ge.ASSUME_ES5=!1,ge.ASSUME_NO_NATIVE_MAP=!1,ge.ASSUME_NO_NATIVE_SET=!1,ge.SIMPLE_FROUND_POLYFILL=!1,ge.ISOLATE_POLYFILLS=!1,ge.FORCE_POLYFILL_PROMISE=!1,ge.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1,ge.defineProperty=ge.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(e,t,o){return e==Array.prototype||e==Object.prototype||(e[t]=o.value),e},ge.getGlobal=function(e){e=[typeof globalThis=="object"&&globalThis,e,typeof window=="object"&&window,typeof self=="object"&&self,typeof eo=="object"&&eo];for(var t=0;t>>0,ge.propertyToPolyfillSymbol[u]=ge.IS_SYMBOL_NATIVE?ge.global.Symbol(u):ge.POLYFILL_PREFIX+o+"$"+u),ge.defineProperty(n,ge.propertyToPolyfillSymbol[u],{configurable:!0,writable:!0,value:t})))},ge.underscoreProtoCanBeSet=function(){var e={a:!0},t={};try{return t.__proto__=e,t.a}catch{}return!1},ge.setPrototypeOf=ge.TRUST_ES6_POLYFILLS&&typeof Object.setPrototypeOf=="function"?Object.setPrototypeOf:ge.underscoreProtoCanBeSet()?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null,ge.arrayIteratorImpl=function(e){var t=0;return function(){return to&&(o=Math.max(o+u,0));o{const e=gb.length,t=[];for(let o=0;20>o;o++)t[o]=gb.charAt(Math.random()*e);return t.join("")}},LC=0,mh={TEST_ONLY:mb};mh.genUid=_,mh.getNextUniqueId=v;var fb="",ur=!0,fh=0,$h="ORPHANED_BLOCK",po=[],$b={FIRE_QUEUE:po,enqueueEvent:Ce,fireNow:he,fireInternal:Z,setGroupInternal:Q};i.disable$$module$build$src$core$events$utils,i.enable$$module$build$src$core$events$utils,i.getGroup$$module$build$src$core$events$utils,i.setGroup$$module$build$src$core$events$utils,i.setRecordUndo$$module$build$src$core$events$utils;var dr=Object.create(null),bb,ai=null,vb,hr=[],yb={defineBlocksWithJsonArrayInternal:We},Ot={TEST_ONLY:yb};Ot.createBlockDefinitionsFromJsonArray=i.createBlockDefinitionsFromJsonArray$$module$build$src$core$common,Ot.defineBlocks=i.defineBlocks$$module$build$src$core$common,Ot.defineBlocksWithJsonArray=Ae,Ot.draggingConnections=hr,Ot.getAllWorkspaces=B,Ot.getBlockTypeCounts=Ie,Ot.getMainWorkspace=q,Ot.getParentContainer=Te,Ot.getSelected=j,Ot.getWorkspaceById=re,Ot.registerWorkspace=N,Ot.setMainWorkspace=se,Ot.setParentContainer=ae,Ot.setSelected=i.setSelected$$module$build$src$core$common,Ot.svgResize=we,Ot.unregisterWorkpace=te;var qi=class{constructor(){this.workspaceId=void 0,this.isUiEvent=!1,this.type="",this.group=i.getGroup$$module$build$src$core$events$utils(),this.recordUndo=G()}toJson(){return{type:this.type,group:this.group}}static fromJson(e,t,o){return o.isBlank=!1,o.group=e.group||"",o.workspaceId=t.id,o}isNull(){return!1}run(e){}getEventWorkspace_(){let e;if(this.workspaceId&&(e=re(this.workspaceId)),!e)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return e}},Ss=class extends qi{constructor(e){super(),this.recordUndo=!1,this.isUiEvent=!0,this.isBlank=typeof e>"u",this.workspaceId=e||""}},bh=class extends Ss{constructor(e,t,o){t=e?e.workspace.id:t,t===null&&(t=void 0),super(t),this.type=ee.CLICK,this.blockId=e?e.id:void 0,this.targetType=o}toJson(){const e=super.toJson();if(!this.targetType)throw Error("The click target type is undefined. Either pass a block to the constructor, or call fromJson");return e.targetType=this.targetType,e.blockId=this.blockId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new bh),t.targetType=e.targetType,t.blockId=e.blockId,t}},vh;(function(e){e.BLOCK="block",e.WORKSPACE="workspace",e.ZOOM_CONTROLS="zoom_controls"})(vh||(vh={})),r($e.EVENT,ee.CLICK,bh);var PC=750,_b="ontouchstart"in globalThis||!!(globalThis.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!globalThis.navigator||!globalThis.navigator.maxTouchPoints&&!globalThis.navigator.msMaxTouchPoints),il=null,li={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"],mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]},nl=0,ci={TOUCH_ENABLED:_b,TOUCH_MAP:li};ci.checkTouchIdentifier=U,ci.clearTouchIdentifier=Y,ci.getTouchIdentifierFromEvent=A,ci.longStart=k,ci.longStop=X,ci.shouldHandleEvent=O;var yh,wb,kb,Cb,rl,al,_h,Tb,Sb,Eb;(function(e){function t(n){return o.includes(n.toUpperCase())}yh=e;const o=yh.toUpperCase();wb=t("JavaFX"),kb=t("WebKit"),Cb=t("Gecko")&&!kb,rl=t("Android"),e=globalThis.navigator&&globalThis.navigator.maxTouchPoints,al=t("iPad")||t("Macintosh")&&0{n.push(this.componentData.get(u))}),n.sort(function(u,g){return u.weight-g.weight}),n.forEach(function(u){o.push(u.component)})}else e.forEach(n=>{o.push(this.componentData.get(n).component)});return o}};gt.Capability=mo,(function(e){e=e.ComponentWeight||(e.ComponentWeight={}),e[e.TOOLBOX_WEIGHT=0]="TOOLBOX_WEIGHT",e[e.FLYOUT_WEIGHT=1]="FLYOUT_WEIGHT",e[e.TRASHCAN_WEIGHT=2]="TRASHCAN_WEIGHT",e[e.ZOOM_CONTROLS_WEIGHT=3]="ZOOM_CONTROLS_WEIGHT"})(gt||(gt={})),gt.ComponentWeight;var Ch=!1,Th=` +.blocklySvg { + background-color: #fff; + outline: none; + overflow: hidden; /* IE overflows by default. */ + position: absolute; + display: block; +} + +.blocklyWidgetDiv { + display: none; + position: absolute; + z-index: 99999; /* big value for bootstrap3 compatibility */ +} + +.injectionDiv { + height: 100%; + position: relative; + overflow: hidden; /* So blocks in drag surface disappear at edges */ + touch-action: none; + user-select: none; + -webkit-user-select: none; +} + +.blocklyNonSelectable { + user-select: none; + -ms-user-select: none; + -webkit-user-select: none; +} + +.blocklyBlockCanvas.blocklyCanvasTransitioning, +.blocklyBubbleCanvas.blocklyCanvasTransitioning { + transition: transform .5s; +} + +.blocklyTooltipDiv { + background-color: #ffffc7; + border: 1px solid #ddc; + box-shadow: 4px 4px 20px 1px rgba(0,0,0,.15); + color: #000; + display: none; + font: 9pt sans-serif; + opacity: .9; + padding: 2px; + position: absolute; + z-index: 100000; /* big value for bootstrap3 compatibility */ +} + +.blocklyDropDownDiv { + position: absolute; + left: 0; + top: 0; + z-index: 1000; + display: none; + border: 1px solid; + border-color: #dadce0; + background-color: #fff; + border-radius: 2px; + padding: 4px; + box-shadow: 0 0 3px 1px rgba(0,0,0,.3); +} + +.blocklyDropDownDiv.blocklyFocused { + box-shadow: 0 0 6px 1px rgba(0,0,0,.3); +} + +.blocklyDropDownContent { + max-height: 300px; /* @todo: spec for maximum height. */ + overflow: auto; + overflow-x: hidden; + position: relative; +} + +.blocklyDropDownArrow { + position: absolute; + left: 0; + top: 0; + width: 16px; + height: 16px; + z-index: -1; + background-color: inherit; + border-color: inherit; +} + +.blocklyDropDownButton { + display: inline-block; + float: left; + padding: 0; + margin: 4px; + border-radius: 4px; + outline: none; + border: 1px solid; + transition: box-shadow .1s; + cursor: pointer; +} + +.blocklyArrowTop { + border-top: 1px solid; + border-left: 1px solid; + border-top-left-radius: 4px; + border-color: inherit; +} + +.blocklyArrowBottom { + border-bottom: 1px solid; + border-right: 1px solid; + border-bottom-right-radius: 4px; + border-color: inherit; +} + +.blocklyResizeSE { + cursor: se-resize; + fill: #aaa; +} + +.blocklyResizeSW { + cursor: sw-resize; + fill: #aaa; +} + +.blocklyResizeLine { + stroke: #515A5A; + stroke-width: 1; +} + +.blocklyHighlightedConnectionPath { + fill: none; + stroke: #fc3; + stroke-width: 4px; +} + +.blocklyPathLight { + fill: none; + stroke-linecap: round; + stroke-width: 1; +} + +.blocklySelected>.blocklyPathLight { + display: none; +} + +.blocklyDraggable { + cursor: grab; + cursor: -webkit-grab; +} + +.blocklyDragging { + cursor: grabbing; + cursor: -webkit-grabbing; + /* Drag surface disables events to not block the toolbox, so we have to + * reenable them here for the cursor values to work. */ + pointer-events: auto; +} + + /* Changes cursor on mouse down. Not effective in Firefox because of + https://bugzilla.mozilla.org/show_bug.cgi?id=771241 */ +.blocklyDraggable:active { + cursor: grabbing; + cursor: -webkit-grabbing; +} + +.blocklyDragging.blocklyDraggingDelete { + cursor: url("<<>>/handdelete.cur"), auto; +} + +.blocklyDragging>.blocklyPath, +.blocklyDragging>.blocklyPathLight { + fill-opacity: .8; + stroke-opacity: .8; +} + +.blocklyDragging>.blocklyPathDark { + display: none; +} + +.blocklyDisabled>.blocklyPath { + fill-opacity: .5; + stroke-opacity: .5; +} + +.blocklyDisabled>.blocklyPathLight, +.blocklyDisabled>.blocklyPathDark { + display: none; +} + +.blocklyInsertionMarker>.blocklyPath, +.blocklyInsertionMarker>.blocklyPathLight, +.blocklyInsertionMarker>.blocklyPathDark { + fill-opacity: .2; + stroke: none; +} + +.blocklyNonEditableText>text { + pointer-events: none; +} + +.blocklyFlyout { + position: absolute; + z-index: 20; +} + +.blocklyText text { + cursor: default; +} + +.blocklyHidden { + display: none; +} + +.blocklyFieldDropdown:not(.blocklyHidden) { + display: block; +} + +.blocklyIconGroup { + cursor: default; +} + +.blocklyIconGroup:not(:hover), +.blocklyIconGroupReadonly { + opacity: .6; +} + +.blocklyIconShape { + fill: #00f; + stroke: #fff; + stroke-width: 1px; +} + +.blocklyIconSymbol { + fill: #fff; +} + +.blocklyMinimalBody { + margin: 0; + padding: 0; + height: 100%; +} + +.blocklyHtmlInput { + border: none; + border-radius: 4px; + height: 100%; + margin: 0; + outline: none; + padding: 0; + width: 100%; + text-align: center; + display: block; + box-sizing: border-box; +} + +/* Remove the increase and decrease arrows on the field number editor */ +input.blocklyHtmlInput[type=number]::-webkit-inner-spin-button, +input.blocklyHtmlInput[type=number]::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0; +} + +input[type=number] { + -moz-appearance: textfield; +} + +.blocklyMainBackground { + stroke-width: 1; + stroke: #c6c6c6; /* Equates to #ddd due to border being off-pixel. */ +} + +.blocklyMutatorBackground { + fill: #fff; + stroke: #ddd; + stroke-width: 1; +} + +.blocklyFlyoutBackground { + fill: #ddd; + fill-opacity: .8; +} + +.blocklyMainWorkspaceScrollbar { + z-index: 20; +} + +.blocklyFlyoutScrollbar { + z-index: 30; +} + +.blocklyScrollbarHorizontal, +.blocklyScrollbarVertical { + position: absolute; + outline: none; +} + +.blocklyScrollbarBackground { + opacity: 0; + pointer-events: none; +} + +.blocklyScrollbarHandle { + fill: #ccc; +} + +.blocklyScrollbarBackground:hover+.blocklyScrollbarHandle, +.blocklyScrollbarHandle:hover { + fill: #bbb; +} + +/* Darken flyout scrollbars due to being on a grey background. */ +/* By contrast, workspace scrollbars are on a white background. */ +.blocklyFlyout .blocklyScrollbarHandle { + fill: #bbb; +} + +.blocklyFlyout .blocklyScrollbarBackground:hover+.blocklyScrollbarHandle, +.blocklyFlyout .blocklyScrollbarHandle:hover { + fill: #aaa; +} + +.blocklyInvalidInput { + background: #faa; +} + +.blocklyVerticalMarker { + stroke-width: 3px; + fill: rgba(255,255,255,.5); + pointer-events: none; +} + +.blocklyComputeCanvas { + position: absolute; + width: 0; + height: 0; +} + +.blocklyNoPointerEvents { + pointer-events: none; +} + +.blocklyContextMenu { + border-radius: 4px; + max-height: 100%; +} + +.blocklyDropdownMenu { + border-radius: 2px; + padding: 0 !important; +} + +.blocklyDropdownMenu .blocklyMenuItem { + /* 28px on the left for icon or checkbox. */ + padding-left: 28px; +} + +/* BiDi override for the resting state. */ +.blocklyDropdownMenu .blocklyMenuItemRtl { + /* Flip left/right padding for BiDi. */ + padding-left: 5px; + padding-right: 28px; +} + +.blocklyWidgetDiv .blocklyMenu { + background: #fff; + border: 1px solid transparent; + box-shadow: 0 0 3px 1px rgba(0,0,0,.3); + font: normal 13px Arial, sans-serif; + margin: 0; + outline: none; + padding: 4px 0; + position: absolute; + overflow-y: auto; + overflow-x: hidden; + max-height: 100%; + z-index: 20000; /* Arbitrary, but some apps depend on it... */ +} + +.blocklyWidgetDiv .blocklyMenu.blocklyFocused { + box-shadow: 0 0 6px 1px rgba(0,0,0,.3); +} + +.blocklyDropDownDiv .blocklyMenu { + background: inherit; /* Compatibility with gapi, reset from goog-menu */ + border: inherit; /* Compatibility with gapi, reset from goog-menu */ + font: normal 13px "Helvetica Neue", Helvetica, sans-serif; + outline: none; + position: relative; /* Compatibility with gapi, reset from goog-menu */ + z-index: 20000; /* Arbitrary, but some apps depend on it... */ +} + +/* State: resting. */ +.blocklyMenuItem { + border: none; + color: #000; + cursor: pointer; + list-style: none; + margin: 0; + /* 7em on the right for shortcut. */ + min-width: 7em; + padding: 6px 15px; + white-space: nowrap; +} + +/* State: disabled. */ +.blocklyMenuItemDisabled { + color: #ccc; + cursor: inherit; +} + +/* State: hover. */ +.blocklyMenuItemHighlight { + background-color: rgba(0,0,0,.1); +} + +/* State: selected/checked. */ +.blocklyMenuItemCheckbox { + height: 16px; + position: absolute; + width: 16px; +} + +.blocklyMenuItemSelected .blocklyMenuItemCheckbox { + background: url(<<>>/sprites.png) no-repeat -48px -16px; + float: left; + margin-left: -24px; + position: static; /* Scroll with the menu. */ +} + +.blocklyMenuItemRtl .blocklyMenuItemCheckbox { + float: right; + margin-right: -24px; +} + +.blocklyBlockDragSurface, .blocklyAnimationLayer { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + overflow: visible !important; + z-index: 80; + pointer-events: none; +} +`,Sh={};Sh.inject=Pt,Sh.register=Be;var ye=class{constructor(e,t){this.x=e,this.y=t}clone(){return new ye(this.x,this.y)}scale(e){return this.x*=e,this.y*=e,this}translate(e,t){return this.x+=e,this.y+=t,this}static equals(e,t){return e===t?!0:e&&t?e.x===t.x&&e.y===t.y:!1}static distance(e,t){const o=e.x-t.x;return e=e.y-t.y,Math.sqrt(o*o+e*e)}static magnitude(e){return Math.sqrt(e.x*e.x+e.y*e.y)}static difference(e,t){return new ye(e.x-t.x,e.y-t.y)}static sum(e,t){return new ye(e.x+t.x,e.y+t.y)}},pr="http://www.w3.org/2000/svg",Gs="http://www.w3.org/1999/xhtml",is="http://www.w3.org/1999/xlink",fo;(function(e){e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE"})(fo||(fo={}));var Es=null,Eh=0,cl=null,Dt={HTML_NS:Gs};Dt.NodeType=fo,Dt.SVG_NS=pr,Dt.XLINK_NS=is,Dt.addClass=Oe,Dt.createSvgElement=ie,Dt.getFastTextWidth=Io,Dt.getFastTextWidthWithSizeString=Bs,Dt.getTextWidth=Un,Dt.hasClass=Zo,Dt.insertAfter=At,Dt.measureFontMetrics=ro,Dt.removeClass=ze,Dt.removeClasses=Ps,Dt.removeNode=Ze,Dt.setCssTransform=Qo,Dt.startTextWidthCache=io,Dt.stopTextWidthCache=no;var J=class{constructor(e){this.tagName=e}toString(){return this.tagName}};J.ANIMATE=new J("animate"),J.CIRCLE=new J("circle"),J.CLIPPATH=new J("clipPath"),J.DEFS=new J("defs"),J.FECOMPOSITE=new J("feComposite"),J.FECOMPONENTTRANSFER=new J("feComponentTransfer"),J.FEFLOOD=new J("feFlood"),J.FEFUNCA=new J("feFuncA"),J.FEGAUSSIANBLUR=new J("feGaussianBlur"),J.FEPOINTLIGHT=new J("fePointLight"),J.FESPECULARLIGHTING=new J("feSpecularLighting"),J.FILTER=new J("filter"),J.FOREIGNOBJECT=new J("foreignObject"),J.G=new J("g"),J.IMAGE=new J("image"),J.LINE=new J("line"),J.PATH=new J("path"),J.PATTERN=new J("pattern"),J.POLYGON=new J("polygon"),J.RECT=new J("rect"),J.SVG=new J("svg"),J.TEXT=new J("text"),J.TSPAN=new J("tspan");var rt=class{constructor(e,t,o,n){this.top=e,this.bottom=t,this.left=o,this.right=n}clone(){return new rt(this.top,this.bottom,this.left,this.right)}getHeight(){return this.bottom-this.top}getWidth(){return this.right-this.left}contains(e,t){return e>=this.left&&e<=this.right&&t>=this.top&&t<=this.bottom}intersects(e){return this.left<=e.right&&this.right>=e.left&&this.bottom>=e.top&&this.top<=e.bottom}static equals(e,t){return e===t?!0:e&&t?e.top===t.top&&e.bottom===t.bottom&&e.left===t.left&&e.right===t.right:!1}static createFromPoint(e,t,o){const n=e.x;return e=e.y,new rt(e,e+o,n,n+t)}},Xe=class{constructor(e,t){this.width=e,this.height=t}static equals(e,t){return e===t?!0:e&&t?e.width===t.width&&e.height===t.height:!1}static max(e,t){return new Xe(Math.max(e.width,t.width),Math.max(e.height,t.height))}static min(e,t){return new Xe(Math.min(e.width,t.width),Math.min(e.height,t.height))}},Mb={getSizeInternal:Gm},Mo={TEST_ONLY:Mb};Mo.getBorderBox=mu,Mo.getComputedStyle=Fs,Mo.getContainerOffsetToScrollInto=fu,Mo.getPageOffset=xo,Mo.getSize=Hn,Mo.getViewportPageOffset=gu,Mo.scrollIntoContainerView=ma;var Lb=/translate\(\s*([-+\d.e]+)([ ,]\s*([-+\d.e]+)\s*)?/,Pb=/transform:\s*translate(?:3d)?\(\s*([-+\d.e]+)\s*px([ ,]\s*([-+\d.e]+)\s*px)?/,jC={XY_REGEX:Lb,XY_STYLE_REGEX:Pb},ui={TEST_ONLY:jC};ui.getDocumentScroll=bu,ui.getInjectionDivXY=fa,ui.getRelativeXY=Wn,ui.getViewportBBox=$u,ui.screenToWsCoordinates=Vm,ui.wsToScreenCoordinates=Km;var yt=class{constructor(e,t,o,n,u){this.workspace=e,this.horizontal=t,this.oldHostMetrics=null,this.ratio=1,this.origin=new ye(0,0),this.startDragHandle=this.handlePosition=this.handleLength=this.scrollbarLength=this.startDragMouse=0,this.containerVisible=this.isHandleVisible=!0,this.position=new ye(0,0),this.onMouseMoveWrapper_=this.onMouseUpWrapper_=null,this.pair=o||!1,this.margin=u!==void 0?u:yt.DEFAULT_SCROLLBAR_MARGIN,e="blocklyScrollbar"+(this.horizontal?"Horizontal":"Vertical"),n&&(e+=" "+n),this.outerSvg=ie(J.SVG,{class:e}),n=ie(J.G,{},this.outerSvg),this.svgBackground=ie(J.RECT,{class:"blocklyScrollbarBackground"},n),e=Math.floor((yt.scrollbarThickness-5)/2),this.svgHandle=ie(J.RECT,{class:"blocklyScrollbarHandle",rx:e,ry:e},n),this.workspace.getThemeManager().subscribe(this.svgHandle,"scrollbarColour","fill"),this.workspace.getThemeManager().subscribe(this.svgHandle,"scrollbarOpacity","fill-opacity"),At(this.outerSvg,this.workspace.getParentSvg()),this.setInitialThickness(),t?(this.lengthAttribute_="width",this.positionAttribute_="x"):(this.lengthAttribute_="height",this.positionAttribute_="y"),this.onMouseDownBarWrapper_=H(this.svgBackground,"pointerdown",this,this.onMouseDownBar),this.onMouseDownHandleWrapper_=H(this.svgHandle,"pointerdown",this,this.onMouseDownHandle)}setInitialThickness(){const e=yt.scrollbarThickness;this.horizontal?(this.svgBackground.setAttribute("height",String(e)),this.outerSvg.setAttribute("height",String(e)),this.svgHandle.setAttribute("height",String(e-5)),this.svgHandle.setAttribute("y","2.5")):(this.svgBackground.setAttribute("width",String(e)),this.outerSvg.setAttribute("width",String(e)),this.svgHandle.setAttribute("width",String(e-5)),this.svgHandle.setAttribute("x","2.5"))}dispose(){this.cleanUp(),V(this.onMouseDownBarWrapper_),V(this.onMouseDownHandleWrapper_),Ze(this.outerSvg),this.workspace.getThemeManager().unsubscribe(this.svgHandle)}constrainHandleLength(e){return e=0>=e||isNaN(e)?0:Math.min(e,this.scrollbarLength)}setHandleLength(e){this.handleLength=e,this.svgHandle.setAttribute(this.lengthAttribute_,String(this.handleLength))}constrainHandlePosition(e){return e=0>=e||isNaN(e)?0:Math.min(e,this.scrollbarLength-this.handleLength)}setHandlePosition(e){this.handlePosition=e,this.svgHandle.setAttribute(this.positionAttribute_,String(this.handlePosition))}setScrollbarLength(e){this.scrollbarLength=e,this.outerSvg.setAttribute(this.lengthAttribute_,String(this.scrollbarLength)),this.svgBackground.setAttribute(this.lengthAttribute_,String(this.scrollbarLength))}setPosition(e,t){this.position.x=e,this.position.y=t,Qo(this.outerSvg,"translate("+(this.position.x+this.origin.x)+"px,"+(this.position.y+this.origin.y)+"px)")}resize(e){!e&&(e=this.workspace.getMetrics(),!e)||this.oldHostMetrics&&yt.metricsAreEquivalent(e,this.oldHostMetrics)||(this.horizontal?this.resizeHorizontal(e):this.resizeVertical(e),this.oldHostMetrics=e,this.updateMetrics())}requiresViewResize(e){return this.oldHostMetrics?this.oldHostMetrics.viewWidth!==e.viewWidth||this.oldHostMetrics.viewHeight!==e.viewHeight||this.oldHostMetrics.absoluteLeft!==e.absoluteLeft||this.oldHostMetrics.absoluteTop!==e.absoluteTop:!0}resizeHorizontal(e){this.requiresViewResize(e)?this.resizeViewHorizontal(e):this.resizeContentHorizontal(e)}resizeViewHorizontal(e){var t=e.viewWidth-2*this.margin;this.pair&&(t-=yt.scrollbarThickness),this.setScrollbarLength(Math.max(0,t)),t=e.absoluteLeft+this.margin,this.pair&&this.workspace.RTL&&(t+=yt.scrollbarThickness),this.setPosition(t,e.absoluteTop+e.viewHeight-yt.scrollbarThickness-this.margin),this.resizeContentHorizontal(e)}resizeContentHorizontal(e){if(e.viewWidth>=e.scrollWidth)this.setHandleLength(this.scrollbarLength),this.setHandlePosition(0),this.pair||this.setVisible(!1);else{this.pair||this.setVisible(!0);var t=this.scrollbarLength*e.viewWidth/e.scrollWidth;t=this.constrainHandleLength(t),this.setHandleLength(t),t=e.scrollWidth-e.viewWidth;var o=this.scrollbarLength-this.handleLength;e=(e.viewLeft-e.scrollLeft)/t*o,e=this.constrainHandlePosition(e),this.setHandlePosition(e),this.ratio=o/t}}resizeVertical(e){this.requiresViewResize(e)?this.resizeViewVertical(e):this.resizeContentVertical(e)}resizeViewVertical(e){let t=e.viewHeight-2*this.margin;this.pair&&(t-=yt.scrollbarThickness),this.setScrollbarLength(Math.max(0,t)),this.setPosition(this.workspace.RTL?e.absoluteLeft+this.margin:e.absoluteLeft+e.viewWidth-yt.scrollbarThickness-this.margin,e.absoluteTop+this.margin),this.resizeContentVertical(e)}resizeContentVertical(e){if(e.viewHeight>=e.scrollHeight)this.setHandleLength(this.scrollbarLength),this.setHandlePosition(0),this.pair||this.setVisible(!1);else{this.pair||this.setVisible(!0);var t=this.scrollbarLength*e.viewHeight/e.scrollHeight;t=this.constrainHandleLength(t),this.setHandleLength(t),t=e.scrollHeight-e.viewHeight;var o=this.scrollbarLength-this.handleLength;e=(e.viewTop-e.scrollTop)/t*o,e=this.constrainHandlePosition(e),this.setHandlePosition(e),this.ratio=o/t}}isVisible(){return this.isHandleVisible}setContainerVisible(e){const t=e!==this.containerVisible;this.containerVisible=e,t&&this.updateDisplay_()}setVisible(e){if(this.pair)throw Error("Unable to toggle visibility of paired scrollbars.");this.setVisibleInternal(e)}setVisibleInternal(e){const t=e!==this.isVisible();this.isHandleVisible=e,t&&this.updateDisplay_()}updateDisplay_(){this.containerVisible&&this.isVisible()?this.outerSvg.setAttribute("display","block"):this.outerSvg.setAttribute("display","none")}onMouseDownBar(e){if(this.workspace.markFocused(),Y(),this.cleanUp(),pe(e))e.stopPropagation();else{var t=fe(e,this.workspace.getParentSvg(),this.workspace.getInverseScreenCTM());t=this.horizontal?t.x:t.y;var o=fa(this.svgHandle);o=this.horizontal?o.x:o.y;var n=this.handlePosition,u=.95*this.handleLength;t<=o?n-=u:t>=o+this.handleLength&&(n+=u),this.setHandlePosition(this.constrainHandlePosition(n)),this.updateMetrics(),e.stopPropagation(),e.preventDefault()}}onMouseDownHandle(e){this.workspace.markFocused(),this.cleanUp(),pe(e)?e.stopPropagation():(this.startDragHandle=this.handlePosition,this.startDragMouse=this.horizontal?e.clientX:e.clientY,this.onMouseUpWrapper_=H(document,"pointerup",this,this.onMouseUpHandle),this.onMouseMoveWrapper_=H(document,"pointermove",this,this.onMouseMoveHandle),e.stopPropagation(),e.preventDefault())}onMouseMoveHandle(e){this.setHandlePosition(this.constrainHandlePosition(this.startDragHandle+((this.horizontal?e.clientX:e.clientY)-this.startDragMouse))),this.updateMetrics()}onMouseUpHandle(){Y(),this.cleanUp()}cleanUp(){this.workspace.hideChaff(!0),this.onMouseUpWrapper_&&(V(this.onMouseUpWrapper_),this.onMouseUpWrapper_=null),this.onMouseMoveWrapper_&&(V(this.onMouseMoveWrapper_),this.onMouseMoveWrapper_=null)}getRatio_(){let e=this.handlePosition/(this.scrollbarLength-this.handleLength);return isNaN(e)&&(e=0),e}updateMetrics(){const e=this.getRatio_();this.horizontal?this.workspace.setMetrics({x:e}):this.workspace.setMetrics({y:e})}set(e,t){this.setHandlePosition(this.constrainHandlePosition(e*this.ratio)),(t||t===void 0)&&this.updateMetrics()}setOrigin(e,t){this.origin=new ye(e,t)}static metricsAreEquivalent(e,t){return e.viewWidth===t.viewWidth&&e.viewHeight===t.viewHeight&&e.viewLeft===t.viewLeft&&e.viewTop===t.viewTop&&e.absoluteTop===t.absoluteTop&&e.absoluteLeft===t.absoluteLeft&&e.scrollWidth===t.scrollWidth&&e.scrollHeight===t.scrollHeight&&e.scrollLeft===t.scrollLeft&&e.scrollTop===t.scrollTop}};yt.scrollbarThickness=_b?25:15,yt.DEFAULT_SCROLLBAR_MARGIN=.5;var ul={parseFromString:function(){throw Error("DOMParser was not found in the global scope and was not properly injected using injectDependencies")}},Ih={serializeToString:function(){throw Error("XMLSerializer was not foundin the global scope and was not properly injected using injectDependencies")}},{document:dl,DOMParser:gr,XMLSerializer:mr}=globalThis;gr&&(ul=new gr),mr&&(Ih=new mr);var Bb="https://developers.google.com/blockly/xml",zC=/[\x00-\x09\x0B\x0C\x0E-\x1F]/g,Xi={NAME_SPACE:Bb};Xi.createElement=i.createElement$$module$build$src$core$utils$xml,Xi.createTextNode=i.createTextNode$$module$build$src$core$utils$xml,Xi.domToText=Li,Xi.injectDependencies=Ym,Xi.textToDom=i.textToDom$$module$build$src$core$utils$xml;var xh="categoryToolbox",Fb="flyoutToolbox",Ge;(function(e){e[e.TOP=0]="TOP",e[e.BOTTOM=1]="BOTTOM",e[e.LEFT=2]="LEFT",e[e.RIGHT=3]="RIGHT"})(Ge||(Ge={}));var jb={hasCategoriesInternal:Xm},Lo={};Lo.Position=Ge,Lo.TEST_ONLY=jb,Lo.convertFlyoutDefToJsonArray=Gn,Lo.convertToolboxDefToJson=$a,Lo.hasCategories=ba,Lo.isCategoryCollapsible=va,Lo.parseToolboxTree=yu;var $o;(function(e){e[e.TOP=0]="TOP",e[e.BOTTOM=1]="BOTTOM"})($o||($o={}));var Zi;(function(e){e[e.LEFT=0]="LEFT",e[e.RIGHT=1]="RIGHT"})(Zi||(Zi={}));var Po;(function(e){e[e.UP=0]="UP",e[e.DOWN=1]="DOWN"})(Po||(Po={}));var di={};di.bumpDirection=Po,di.bumpPositionRect=ka,di.getCornerOppositeToolbox=wa,di.getStartPositionRect=_a,di.horizontalPosition=Zi,di.verticalPosition=$o;var Wt={width:96,height:124,url:"sprites.png"},zb=class{constructor(e){this.workspace=e,this.id="zoomControls",this.boundEvents=[],this.zoomResetGroup=this.zoomOutGroup=this.zoomInGroup=null,this.HEIGHT=this.WIDTH=32,this.SMALL_SPACING=2,this.LARGE_SPACING=11,this.MARGIN_HORIZONTAL=this.MARGIN_VERTICAL=20,this.svgGroup=null,this.top=this.left=0,this.initialized=!1}createDom(){this.svgGroup=ie(J.G,{});const e=String(Math.random()).substring(2);return this.createZoomOutSvg(e),this.createZoomInSvg(e),this.workspace.isMovable()&&this.createZoomResetSvg(e),this.svgGroup}init(){this.workspace.getComponentManager().addComponent({component:this,weight:gt.ComponentWeight.ZOOM_CONTROLS_WEIGHT,capabilities:[gt.Capability.POSITIONABLE]}),this.initialized=!0}dispose(){this.workspace.getComponentManager().removeComponent("zoomControls"),this.svgGroup&&Ze(this.svgGroup);for(const e of this.boundEvents)V(e);this.boundEvents.length=0}getBoundingRectangle(){let e=this.SMALL_SPACING+2*this.HEIGHT;return this.zoomResetGroup&&(e+=this.LARGE_SPACING+this.HEIGHT),new rt(this.top,this.top+e,this.left,this.left+this.WIDTH)}position(e,t){if(this.initialized){var o=wa(this.workspace,e),n=this.SMALL_SPACING+2*this.HEIGHT;if(this.zoomResetGroup&&(n+=this.LARGE_SPACING+this.HEIGHT),e=_a(o,new Xe(this.WIDTH,n),this.MARGIN_HORIZONTAL,this.MARGIN_VERTICAL,e,this.workspace),o=o.vertical,t=ka(e,this.MARGIN_VERTICAL,o===$o.TOP?Po.DOWN:Po.UP,t),o===$o.TOP){var u=this.SMALL_SPACING+this.HEIGHT,g;(g=this.zoomInGroup)==null||g.setAttribute("transform","translate(0, "+u+")"),this.zoomResetGroup&&this.zoomResetGroup.setAttribute("transform","translate(0, "+(u+this.LARGE_SPACING+this.HEIGHT)+")")}else{g=this.zoomResetGroup?this.LARGE_SPACING+this.HEIGHT:0;let L;(L=this.zoomInGroup)==null||L.setAttribute("transform","translate(0, "+g+")"),g=g+this.SMALL_SPACING+this.HEIGHT,(u=this.zoomOutGroup)==null||u.setAttribute("transform","translate(0, "+g+")")}this.top=t.top,this.left=t.left;var I;(I=this.svgGroup)==null||I.setAttribute("transform","translate("+this.left+","+this.top+")")}}createZoomOutSvg(e){this.zoomOutGroup=ie(J.G,{class:"blocklyZoom blocklyZoomOut"},this.svgGroup);const t=ie(J.CLIPPATH,{id:"blocklyZoomoutClipPath"+e},this.zoomOutGroup);ie(J.RECT,{width:32,height:32},t),ie(J.IMAGE,{width:Wt.width,height:Wt.height,x:-64,y:-92,"clip-path":"url(#blocklyZoomoutClipPath"+e+")"},this.zoomOutGroup).setAttributeNS(is,"xlink:href",this.workspace.options.pathToMedia+Wt.url),this.boundEvents.push(H(this.zoomOutGroup,"pointerdown",null,this.zoom.bind(this,-1)))}createZoomInSvg(e){this.zoomInGroup=ie(J.G,{class:"blocklyZoom blocklyZoomIn"},this.svgGroup);const t=ie(J.CLIPPATH,{id:"blocklyZoominClipPath"+e},this.zoomInGroup);ie(J.RECT,{width:32,height:32},t),ie(J.IMAGE,{width:Wt.width,height:Wt.height,x:-32,y:-92,"clip-path":"url(#blocklyZoominClipPath"+e+")"},this.zoomInGroup).setAttributeNS(is,"xlink:href",this.workspace.options.pathToMedia+Wt.url),this.boundEvents.push(H(this.zoomInGroup,"pointerdown",null,this.zoom.bind(this,1)))}zoom(e,t){this.workspace.markFocused(),this.workspace.zoomCenter(e),this.fireZoomEvent(),Y(),t.stopPropagation(),t.preventDefault()}createZoomResetSvg(e){this.zoomResetGroup=ie(J.G,{class:"blocklyZoom blocklyZoomReset"},this.svgGroup);const t=ie(J.CLIPPATH,{id:"blocklyZoomresetClipPath"+e},this.zoomResetGroup);ie(J.RECT,{width:32,height:32},t),ie(J.IMAGE,{width:Wt.width,height:Wt.height,y:-92,"clip-path":"url(#blocklyZoomresetClipPath"+e+")"},this.zoomResetGroup).setAttributeNS(is,"xlink:href",this.workspace.options.pathToMedia+Wt.url),this.boundEvents.push(H(this.zoomResetGroup,"pointerdown",null,this.resetZoom.bind(this)))}resetZoom(e){this.workspace.markFocused();const t=Math.log(this.workspace.options.zoomOptions.startScale/this.workspace.scale)/Math.log(this.workspace.options.zoomOptions.scaleSpeed);this.workspace.beginCanvasTransition(),this.workspace.zoomCenter(t),this.workspace.scrollCenter(),setTimeout(this.workspace.endCanvasTransition.bind(this.workspace),500),this.fireZoomEvent(),Y(),e.stopPropagation(),e.preventDefault()}fireZoomEvent(){const e=new(ne(ee.CLICK))(null,this.workspace.id,"zoom_controls");z(e)}};Be(` +.blocklyZoom>image, .blocklyZoom>svg>image { + opacity: .4; +} + +.blocklyZoom>image:hover, .blocklyZoom>svg>image:hover { + opacity: .6; +} + +.blocklyZoom>image:active, .blocklyZoom>svg>image:active { + opacity: .8; +} +`);var Ub=100,Hb=75,Wb=50,Gb=25,UC={BLOCKS:Wb,PROCEDURES:Hb,VARIABLES:Ub,WORKSPACE_COMMENTS:Gb},Dh={};Dh.register=Vn,Dh.unregister=Qm;var Vb=class{constructor(){this.priority=Gb}save(e){const t=[];for(const o of e.getTopComments())(e=Pi(o,{addCoordinates:!0,saveIds:!0}))&&t.push(e);return t.length?t:null}load(e,t){for(const o of e)Kn(o,t,{recordUndo:G()})}clear(e){for(const t of e.getTopComments())t.dispose()}};Vn("workspaceComments",new Vb);var hl={};hl.WorkspaceCommentSerializer=Vb,hl.append=Kn,hl.save=Pi;var Ah={};Ah.register=Ca,Ah.unregister=ef;var pl=class{paste(e,t,o){e=e.commentState,o&&(e.x=o.x,e.y=o.y),i.disable$$module$build$src$core$events$utils();let n;try{n=Kn(e,t),tf(n)}finally{i.enable$$module$build$src$core$events$utils()}return n?(C()&&z(new(ne(ee.COMMENT_CREATE))(n)),i.setSelected$$module$build$src$core$common(n),n):null}};pl.TYPE="workspace-comment",Ca(pl.TYPE,new pl);var Oh;Oh=28,i.config$$module$build$src$core$config={dragRadius:5,flyoutDragRadius:10,snapRadius:Oh,connectingSnapRadius:Oh,currentConnectionPreference:8,bumpDelay:250},i.config$$module$build$src$core$config;var HC="aria-",WC="role",Is;(function(e){e.GRID="grid",e.GRIDCELL="gridcell",e.GROUP="group",e.LISTBOX="listbox",e.MENU="menu",e.MENUITEM="menuitem",e.MENUITEMCHECKBOX="menuitemcheckbox",e.OPTION="option",e.PRESENTATION="presentation",e.ROW="row",e.TREE="tree",e.TREEITEM="treeitem"})(Is||(Is={}));var Et;(function(e){e.ACTIVEDESCENDANT="activedescendant",e.COLCOUNT="colcount",e.DISABLED="disabled",e.EXPANDED="expanded",e.INVALID="invalid",e.LABEL="label",e.LABELLEDBY="labelledby",e.LEVEL="level",e.ORIENTATION="orientation",e.POSINSET="posinset",e.ROWCOUNT="rowcount",e.SELECTED="selected",e.SETSIZE="setsize",e.VALUEMAX="valuemax",e.VALUEMIN="valuemin"})(Et||(Et={}));var fr={};fr.Role=Is,fr.State=Et,fr.setRole=Do,fr.setState=xt;var Rh=class{constructor(){this.menuItems=[],this.roleName=this.element=this.onKeyDownHandler=this.pointerLeaveHandler=this.pointerEnterHandler=this.clickHandler=this.pointerMoveHandler=this.highlightedItem=this.openingCoords=null}addChild(e){this.menuItems.push(e)}render(e){const t=document.createElement("div");t.className="blocklyMenu goog-menu blocklyNonSelectable",t.tabIndex=0,this.roleName&&Do(t,this.roleName),this.element=t;for(let o=0,n;n=this.menuItems[o];o++)t.appendChild(n.createDom());return this.pointerMoveHandler=H(t,"pointermove",this,this.handlePointerMove,!0),this.clickHandler=H(t,"pointerup",this,this.handleClick,!0),this.pointerEnterHandler=H(t,"pointerenter",this,this.handlePointerEnter,!0),this.pointerLeaveHandler=H(t,"pointerleave",this,this.handlePointerLeave,!0),this.onKeyDownHandler=H(t,"keydown",this,this.handleKeyEvent),e.appendChild(t),t}getElement(){return this.element}focus(){const e=this.getElement();e&&(e.focus({preventScroll:!0}),Oe(e,"blocklyFocused"))}blur(){const e=this.getElement();e&&(e.blur(),ze(e,"blocklyFocused"))}setRole(e){this.roleName=e}dispose(){this.pointerMoveHandler&&(V(this.pointerMoveHandler),this.pointerMoveHandler=null),this.clickHandler&&(V(this.clickHandler),this.clickHandler=null),this.pointerEnterHandler&&(V(this.pointerEnterHandler),this.pointerEnterHandler=null),this.pointerLeaveHandler&&(V(this.pointerLeaveHandler),this.pointerLeaveHandler=null),this.onKeyDownHandler&&(V(this.onKeyDownHandler),this.onKeyDownHandler=null);for(let e=0,t;t=this.menuItems[e];e++)t.dispose();this.element=null}getMenuItem(e){const t=this.getElement();for(;e&&e!==t;){if(e.classList.contains("blocklyMenuItem")){for(let o=0,n;n=this.menuItems[o];o++)if(n.getElement()===e)return n}e=e.parentElement}return null}setHighlighted(e){var t=this.highlightedItem;if(t&&(t.setHighlighted(!1),this.highlightedItem=null),e){e.setHighlighted(!0),this.highlightedItem=e,t=this.getElement();const o=t==null?void 0:t.parentElement,n=e.getElement();o&&n&&(ma(n,o),xt(t,Et.ACTIVEDESCENDANT,e.getId()))}}highlightNext(){const e=this.highlightedItem?this.menuItems.indexOf(this.highlightedItem):-1;this.highlightHelper(e,1)}highlightPrevious(){const e=this.highlightedItem?this.menuItems.indexOf(this.highlightedItem):-1;this.highlightHelper(0>e?this.menuItems.length:e,-1)}highlightFirst(){this.highlightHelper(-1,1)}highlightLast(){this.highlightHelper(this.menuItems.length,-1)}highlightHelper(e,t){e+=t;let o;for(;o=this.menuItems[e];){if(o.isEnabled()){this.setHighlighted(o);break}e+=t}}handlePointerMove(e){Math.max(Math.abs(e.movementX),Math.abs(e.movementY))!==0&&(e=this.getMenuItem(e.target))&&(e.isEnabled()?this.highlightedItem!==e&&this.setHighlighted(e):this.setHighlighted(null))}handleClick(e){const t=this.openingCoords;if(this.openingCoords=null,t&&typeof e.clientX=="number"){const o=new ye(e.clientX,e.clientY);if(1>ye.distance(t,o))return}(e=this.getMenuItem(e.target))&&e.performAction()}handlePointerEnter(e){this.focus()}handlePointerLeave(e){this.getElement()&&this.setHighlighted(null)}handleKeyEvent(e){if(this.menuItems.length&&!(e.shiftKey||e.ctrlKey||e.metaKey||e.altKey)){var t=this.highlightedItem;switch(e.key){case"Enter":case" ":t&&t.performAction();break;case"ArrowUp":this.highlightPrevious();break;case"ArrowDown":this.highlightNext();break;case"PageUp":case"Home":this.highlightFirst();break;case"PageDown":case"End":this.highlightLast();break;default:return}e.preventDefault(),e.stopPropagation()}}getSize(){const e=this.getElement(),t=Hn(e);return t.height=e.scrollHeight,t}},Nh=class{constructor(e,t){this.content=e,this.opt_value=t,this.enabled=!0,this.element=null,this.rightToLeft=!1,this.roleName=null,this.highlight=this.checked=this.checkable=!1,this.actionHandler=null}createDom(){const e=document.createElement("div");e.id=v(),this.element=e,e.className="blocklyMenuItem goog-menuitem "+(this.enabled?"":"blocklyMenuItemDisabled goog-menuitem-disabled ")+(this.checked?"blocklyMenuItemSelected goog-option-selected ":"")+(this.highlight?"blocklyMenuItemHighlight goog-menuitem-highlight ":"")+(this.rightToLeft?"blocklyMenuItemRtl goog-menuitem-rtl ":"");const t=document.createElement("div");if(t.className="blocklyMenuItemContent goog-menuitem-content",this.checkable){var o=document.createElement("div");o.className="blocklyMenuItemCheckbox goog-menuitem-checkbox",t.appendChild(o)}return o=this.content,typeof this.content=="string"&&(o=document.createTextNode(this.content)),t.appendChild(o),e.appendChild(t),this.roleName&&Do(e,this.roleName),xt(e,Et.SELECTED,this.checkable&&this.checked||!1),xt(e,Et.DISABLED,!this.enabled),e}dispose(){this.element=null}getElement(){return this.element}getId(){return this.element.id}getValue(){let e;return(e=this.opt_value)!=null?e:null}setRightToLeft(e){this.rightToLeft=e}setRole(e){this.roleName=e}setCheckable(e){this.checkable=e}setChecked(e){this.checked=e}setHighlighted(e){this.highlight=e;const t=this.getElement();t&&this.isEnabled()&&(e?(Oe(t,"blocklyMenuItemHighlight"),Oe(t,"goog-menuitem-highlight")):(ze(t,"blocklyMenuItemHighlight"),ze(t,"goog-menuitem-highlight")))}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}performAction(){this.isEnabled()&&this.actionHandler&&this.actionHandler(this)}onAction(e,t){this.actionHandler=e.bind(t)}},$r="_TEMP_COLLAPSED_INPUT",gl="_TEMP_COLLAPSED_FIELD",Gt="MANUALLY_DISABLED",GC={COLLAPSED_FIELD_NAME:gl,COLLAPSED_INPUT_NAME:$r,MANUALLY_DISABLED:Gt};(function(e){e[e.VALUE=1]="VALUE",e[e.STATEMENT=3]="STATEMENT",e[e.DUMMY=5]="DUMMY",e[e.CUSTOM=6]="CUSTOM",e[e.END_ROW=7]="END_ROW"})(i.inputTypes$$module$build$src$core$inputs$input_types||(i.inputTypes$$module$build$src$core$inputs$input_types={})),i.inputTypes$$module$build$src$core$inputs$input_types;var ml=new Set,Mh=new WeakSet,Lh=new WeakMap,Qi=null,Ph=null,Kb=0,fl={};fl.finishQueuedRenders=Ts,fl.queueRender=_u,fl.triggerQueuedRenders=ao;var Yb=function(e,t){window.alert(e),t&&t()},Jb=function(e,t){t(window.confirm(e))},qb=function(e,t,o){o(window.prompt(e,t))},Xb={confirmInternal:af},hi={TEST_ONLY:Xb};hi.alert=Jn,hi.confirm=Sa,hi.prompt=Ea,hi.setAlert=rf,hi.setConfirm=lf,hi.setPrompt=cf;var Bh,Zb;i.Msg$$module$build$src$core$msg=Object.create(null),Bh=function(e){Object.keys(e).forEach(function(t){i.Msg$$module$build$src$core$msg[t]=e[t]})},Zb={Msg:i.Msg$$module$build$src$core$msg,setLocale:Bh};var br=class extends qi{constructor(e){super(),this.isBlank=typeof e>"u",e&&(this.varId=e.getId(),this.workspaceId=e.workspace.id)}toJson(){const e=super.toJson();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");return e.varId=this.varId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new br),t.varId=e.varId,t}},Fh=class extends br{constructor(e){super(e),this.type=ee.VAR_CREATE,e&&(this.varType=e.type,this.varName=e.name)}toJson(){const e=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");return e.varType=this.varType,e.varName=this.varName,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Fh),t.varType=e.varType,t.varName=e.varName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");e?t.createVariable(this.varName,this.varType,this.varId):t.deleteVariableById(this.varId)}};r($e.EVENT,ee.VAR_CREATE,Fh);var vr=class{constructor(e,t,o,n){this.workspace=e,this.name=t,this.type=o||"",this.id=n||_()}getId(){return this.id}static compareByName(e,t){return e.name.localeCompare(t.name,void 0,{sensitivity:"base"})}},jh="VARIABLE",zh="ijkmnopqrstuvwxyzabcdefgh",Qb={generateUniqueNameInternal:df},Rt={CATEGORY_NAME:jh,TEST_ONLY:Qb,VAR_LETTER_OPTIONS:zh};Rt.allDeveloperVariables=i.allDeveloperVariables$$module$build$src$core$variables,Rt.allUsedVarModels=i.allUsedVarModels$$module$build$src$core$variables,Rt.createVariableButtonHandler=Fi,Rt.flyoutCategory=Ia,Rt.flyoutCategoryBlocks=Su,Rt.generateUniqueName=Eu,Rt.generateUniqueNameFromOptions=xa,Rt.generateVariableFieldDom=ei,Rt.getAddedVariables=qn,Rt.getOrCreateVariablePackage=i.getOrCreateVariablePackage$$module$build$src$core$variables,Rt.getVariable=i.getVariable$$module$build$src$core$variables,Rt.nameUsedWithAnyType=Iu,Rt.nameUsedWithConflictingParam=xu,Rt.promptName=Da,Rt.renameVariable=i.renameVariable$$module$build$src$core$variables;var en=class extends Error{},ev=class extends en{constructor(e){super("Expected to find a 'type' property, defining the block type"),this.state=e}},yr=class extends en{constructor(e,t,o){super(`The block ${t.toDevString()} is missing a(n) ${e} +connection`),this.block=t,this.state=o}},tv=class extends en{constructor(e,t,o,n){super(`The block ${o.toDevString()} could not connect its +${t} to its parent, because: ${e}`),this.childBlock=o,this.childState=n}},sv=class extends en{constructor(e){super(`Encountered a real block which is defined as a child of a shadow +block. It is an invariant of Blockly that shadow blocks only have shadow +children`),this.state=e}},ov=class extends en{constructor(e,t,o){super(`Cannot add an icon of type '${e}' to the block ${t.toDevString()}, because there is no icon registered with type '${e}'. Make sure that all of your icons have been registered.`),this.block=t,this.state=o}},pi={};pi.BadConnectionCheck=tv,pi.DeserializationError=en,pi.MissingBlockType=ev,pi.MissingConnection=yr,pi.RealChildOfShadow=sv,pi.UnregisteredIcon=ov;var iv=class{constructor(){this.priority=Wb}save(e){const t=[];for(const o of e.getTopBlocks(!1))(e=os(o,{addCoordinates:!0,doFullSerialization:!1}))&&t.push(e);return t.length?{languageVersion:0,blocks:t}:null}load(e,t){e=e.blocks;for(const o of e)lo(o,t,{recordUndo:G()})}clear(e){for(const t of e.getTopBlocks(!1))t.dispose(!1)}};Vn("blocks",new iv);var _r={};_r.BlockSerializer=iv,_r.append=lo,_r.appendInternal=ji,_r.save=os;var Ct=class{constructor(e){this.name=e}toString(){return this.name}equals(e){return this.name===e.toString()}};Ct.MUTATOR=new Ct("mutator"),Ct.WARNING=new Ct("warning"),Ct.COMMENT=new Ct("comment");var gi=class extends qi{constructor(e){super(),this.isBlank=!e,e&&(this.blockId=e.id,this.workspaceId=e.workspace.id)}toJson(){const e=super.toJson();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");return e.blockId=this.blockId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new gi),t.blockId=e.blockId,t}},mi=class extends gi{constructor(e,t,o,n,u){super(e),this.type=ee.BLOCK_CHANGE,e&&(this.element=t,this.name=o||void 0,this.oldValue=n,this.newValue=u)}toJson(){const e=super.toJson();if(!this.element)throw Error("The changed element is undefined. Either pass an element to the constructor, or call fromJson");return e.element=this.element,e.name=this.name,e.oldValue=this.oldValue,e.newValue=this.newValue,this.disabledReason&&(e.disabledReason=this.disabledReason),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new mi),t.element=e.element,t.name=e.name,t.oldValue=e.oldValue,t.newValue=e.newValue,e.disabledReason!==void 0&&(t.disabledReason=e.disabledReason),t}setDisabledReason(e){if(this.element!=="disabled")throw Error('Cannot set the disabled reason for a BlockChange event if the element is not "disabled".');this.disabledReason=e}isNull(){return this.oldValue===this.newValue}run(e){var t=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");if(t=t.getBlockById(this.blockId),!t)throw Error("The associated block is undefined. Either pass a block to the constructor, or call fromJson");const o=t.getIcon(Ct.MUTATOR);switch(o&&zi(o)&&o.bubbleIsVisible()&&o.setBubbleVisible(!1),e=e?this.newValue:this.oldValue,this.element){case"field":(t=t.getField(this.name))?t.setValue(e):console.warn("Can't set non-existent field: "+this.name);break;case"comment":t.setCommentText(e||null);break;case"collapsed":t.setCollapsed(!!e);break;case"disabled":var n;t.setDisabledReason(!!e,(n=this.disabledReason)!=null?n:Gt);break;case"inline":t.setInputsInline(!!e);break;case"mutation":n=mi.getExtraBlockState_(t),t.loadExtraState?t.loadExtraState(JSON.parse(e||"{}")):t.domToMutation&&t.domToMutation(i.textToDom$$module$build$src$core$utils$xml(e||"")),z(new mi(t,"mutation",null,n,e));break;default:console.warn("Unknown change type: "+this.element)}}static getExtraBlockState_(e){return e.saveExtraState?(e=e.saveExtraState(!0))?JSON.stringify(e):"":e.mutationToDom&&(e=e.mutationToDom())?zs(e):""}};r($e.EVENT,ee.BLOCK_CHANGE,mi);var $l={};$l.clamp=Ui,$l.toDegrees=Rf,$l.toRadians=Aa;var bl=16,nv=1,rv=12,Uh=16,vl=.25,Hh=null,fi=null,tn="",sn="",tt,on,$i,Wh=null,Bo=null,av=null,Gh={getBoundsInfo:function(){const e=xo(Wh),t=Hn(Wh);return{left:e.x,right:e.x+t.width,top:e.y,bottom:e.y+t.height,width:t.width,height:t.height}},getPositionMetrics:function(e,t,o,n){const u=Gh.getBoundsInfo(),g=Hn(tt);return t+g.heightu.top?Hu(o,n,u,g):t+g.heightdocument.documentElement.clientTop?Hu(o,n,u,g):Mf(e,u,g)}},Bt={ANIMATION_TIME:vl,ARROW_HORIZONTAL_PADDING:rv,ARROW_SIZE:bl,BORDER_SIZE:nv,PADDING_Y:Uh,TEST_ONLY:Gh};Bt.clearContent=Oa,Bt.createDom=Ru,Bt.getContentDiv=Xn,Bt.getOwner=Mu,Bt.getPositionX=Zn,Bt.hide=Na,Bt.hideIfOwner=Ra,Bt.hideWithoutAnimation=js,Bt.isVisible=Wu,Bt.repositionForWindowResize=Vu,Bt.setBoundsElement=Nu,Bt.setColour=Lu,Bt.show=zu,Bt.showPositionedByBlock=Nf,Bt.showPositionedByField=Pu;var wr=class{constructor(e){this.workspace=e,this.cursorSvg=this.cursor=null,this.markers=new Map,this.markerSvg=null}registerMarker(e,t){this.markers.has(e)&&this.unregisterMarker(e),t.setDrawer(this.workspace.getRenderer().makeMarkerDrawer(this.workspace,t)),this.setMarkerSvg(t.getDrawer().createDom()),this.markers.set(e,t)}unregisterMarker(e){const t=this.markers.get(e);if(t)t.dispose(),this.markers.delete(e);else throw Error("Marker with ID "+e+" does not exist. Can only unregister markers that exist.")}getCursor(){return this.cursor}getMarker(e){return this.markers.get(e)||null}setCursor(e){this.cursor&&this.cursor.getDrawer()&&this.cursor.getDrawer().dispose(),(this.cursor=e)&&(e=this.workspace.getRenderer().makeMarkerDrawer(this.workspace,this.cursor),this.cursor.setDrawer(e),this.setCursorSvg(this.cursor.getDrawer().createDom()))}setCursorSvg(e){e?(this.workspace.getBlockCanvas().appendChild(e),this.cursorSvg=e):this.cursorSvg=null}setMarkerSvg(e){e?this.workspace.getBlockCanvas()&&(this.cursorSvg?this.workspace.getBlockCanvas().insertBefore(e,this.cursorSvg):this.workspace.getBlockCanvas().appendChild(e)):this.markerSvg=null}updateMarkers(){this.workspace.keyboardAccessibilityMode&&this.cursorSvg&&this.workspace.getCursor().draw()}dispose(){const e=Object.keys(this.markers);for(let t=0,o;o=e[t];t++)this.unregisterMarker(o);this.markers.clear(),this.cursor&&(this.cursor.dispose(),this.cursor=null)}};wr.LOCAL_MARKER="local_marker_1";var nn={};nn.commonWordPrefix=Ku,nn.commonWordSuffix=Yu,nn.isNumber=i.isNumber$$module$build$src$core$utils$string,nn.shortestStringLength=Qn,nn.wrap=i.wrap$$module$build$src$core$utils$string;var yl=void 0,kr=!1,rn=!1,lv=50,cv=0,bi=0,Vh=0,Kh=0,hs=null,Cr=null,Yh=0,Jh=10,uv=10,dv=750,_l=5,Tt=null,ns={HOVER_MS:dv,LIMIT:lv,MARGINS:_l,OFFSET_X:Yh,OFFSET_Y:Jh,RADIUS_OK:uv};ns.bindMouseEvents=Wi,ns.block=ed,ns.createDom=Xu,ns.dispose=Qu,ns.getCustomTooltip=Ff,ns.getDiv=zf,ns.getTooltipOfObject=Hi,ns.hide=co,ns.isVisible=jf,ns.setCustomTooltip=Bf,ns.unbindMouseEvents=La,ns.unblock=td;var qh=.45,Xh=.65,hv={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00"},ps={};ps.blend=si,ps.getHsvSaturation=sd,ps.getHsvValue=od,ps.hexToRgb=Pa,ps.hsvToHex=Ba,ps.hueToHex=id,ps.names=hv,ps.parse=ti,ps.rgbToHex=er,ps.setHsvSaturation=Yf,ps.setHsvValue=Jf;var Tr={};Tr.checkMessageReferences=qf,Tr.parseBlockColour=Gi,Tr.replaceMessageReferences=bt,Tr.tokenizeInterpolation=nd;var lt=class{constructor(e,t,o){this.DEFAULT_VALUE=null,this.name=void 0,this.constants_=this.mouseDownWrapper=this.textContent_=this.textElement_=this.borderRect_=this.fieldGroup_=this.markerSvg=this.cursorSvg=this.tooltip=this.validator_=null,this.disposed=!1,this.maxDisplayLength=50,this.sourceBlock_=null,this.enabled_=this.visible_=this.isDirty_=!0,this.suffixField=this.prefixField=this.clickTarget_=null,this.EDITABLE=!0,this.SERIALIZABLE=!1,this.CURSOR="",this.value_="DEFAULT_VALUE"in new.target.prototype?new.target.prototype.DEFAULT_VALUE:this.DEFAULT_VALUE,this.size_=new Xe(0,0),e!==lt.SKIP_SETUP&&(o&&this.configure_(o),this.setValue(e),t&&this.setValidator(t))}configure_(e){e.tooltip&&this.setTooltip(bt(e.tooltip))}setSourceBlock(e){if(this.sourceBlock_)throw Error("Field already bound to a block");this.sourceBlock_=e}getConstants(){return!this.constants_&&this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&this.sourceBlock_.workspace.rendered&&(this.constants_=this.sourceBlock_.workspace.getRenderer().getConstants()),this.constants_}getSourceBlock(){return this.sourceBlock_}init(){this.fieldGroup_||(this.fieldGroup_=ie(J.G,{}),this.isVisible()||(this.fieldGroup_.style.display="none"),this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_),this.initView(),this.updateEditable(),this.setTooltip(this.tooltip),this.bindEvents_(),this.initModel(),this.applyColour())}initView(){this.createBorderRect_(),this.createTextElement_()}initModel(){}isFullBlockField(){return!this.borderRect_}createBorderRect_(){this.borderRect_=ie(J.RECT,{rx:this.getConstants().FIELD_BORDER_RECT_RADIUS,ry:this.getConstants().FIELD_BORDER_RECT_RADIUS,x:0,y:0,height:this.size_.height,width:this.size_.width,class:"blocklyFieldRect"},this.fieldGroup_)}createTextElement_(){this.textElement_=ie(J.TEXT,{class:"blocklyText"},this.fieldGroup_),this.getConstants().FIELD_TEXT_BASELINE_CENTER&&this.textElement_.setAttribute("dominant-baseline","central"),this.textContent_=document.createTextNode(""),this.textElement_.appendChild(this.textContent_)}bindEvents_(){const e=this.getClickTarget_();if(!e)throw Error("A click target has not been set.");Wi(e),this.mouseDownWrapper=H(e,"pointerdown",this,this.onMouseDown_)}fromXml(e){this.setValue(e.textContent)}toXml(e){return e.textContent=this.getValue(),e}saveState(e){return e=this.saveLegacyState(lt),e!==null?e:this.getValue()}loadState(e){this.loadLegacyState(lt,e)||this.setValue(e)}saveLegacyState(e){return e.prototype.saveState===this.saveState&&e.prototype.toXml!==this.toXml?(e=i.createElement$$module$build$src$core$utils$xml("field"),e.setAttribute("name",this.name||""),Li(this.toXml(e)).replace(' xmlns="https://developers.google.com/blockly/xml"',"")):null}loadLegacyState(e,t){return e.prototype.loadState===this.loadState&&e.prototype.fromXml!==this.fromXml?(this.fromXml(i.textToDom$$module$build$src$core$utils$xml(t)),!0):!1}dispose(){Ra(this),ii(this);let e;(e=this.getSourceBlock())!=null&&e.isDeadOrDying()||Ze(this.fieldGroup_),this.disposed=!0}updateEditable(){const e=this.fieldGroup_,t=this.getSourceBlock();this.EDITABLE&&e&&t&&(this.enabled_&&t.isEditable()?(Oe(e,"blocklyEditableText"),ze(e,"blocklyNonEditableText"),e.style.cursor=this.CURSOR):(Oe(e,"blocklyNonEditableText"),ze(e,"blocklyEditableText"),e.style.cursor=""))}setEnabled(e){this.enabled_=e,this.updateEditable()}isEnabled(){return this.enabled_}isClickable(){return this.enabled_&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()&&this.showEditor_!==lt.prototype.showEditor_}isClickableInFlyout(e){return!e}isCurrentlyEditable(){return this.enabled_&&this.EDITABLE&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()}isSerializable(){let e=!1;return this.name&&(this.SERIALIZABLE?e=!0:this.EDITABLE&&(console.warn("Detected an editable field that was not serializable. Please define SERIALIZABLE property as true on all editable custom fields. Proceeding with serialization."),e=!0)),e}isVisible(){return this.visible_}setVisible(e){if(this.visible_!==e){this.visible_=e;var t=this.fieldGroup_;t&&(t.style.display=e?"block":"none")}}setValidator(e){this.validator_=e}getValidator(){return this.validator_}getSvgRoot(){return this.fieldGroup_}getBorderRect(){if(!this.borderRect_)throw Error(`The border rectangle is ${this.borderRect_}.`);return this.borderRect_}getTextElement(){if(!this.textElement_)throw Error(`The text element is ${this.textElement_}.`);return this.textElement_}getTextContent(){if(!this.textContent_)throw Error(`The text content is ${this.textContent_}.`);return this.textContent_}applyColour(){}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_()}showEditor(e){this.isClickable()&&this.showEditor_(e)}showEditor_(e){}repositionForWindowResize(){return!1}updateSize_(e){const t=this.getConstants();e=e!==void 0?e:this.isFullBlockField()?0:this.getConstants().FIELD_BORDER_RECT_X_PADDING;let o=2*e,n=t.FIELD_TEXT_HEIGHT,u=0;this.textElement_&&(u=Io(this.textElement_,t.FIELD_TEXT_FONTSIZE,t.FIELD_TEXT_FONTWEIGHT,t.FIELD_TEXT_FONTFAMILY),o+=u),this.isFullBlockField()||(n=Math.max(n,t.FIELD_BORDER_RECT_HEIGHT)),this.size_.height=n,this.size_.width=o,this.positionTextElement_(e,u),this.positionBorderRect_()}positionTextElement_(e,t){if(this.textElement_){var o=this.getConstants(),n=this.size_.height/2,u;this.textElement_.setAttribute("x",String((u=this.getSourceBlock())!=null&&u.RTL?this.size_.width-t-e:e)),this.textElement_.setAttribute("y",String(o.FIELD_TEXT_BASELINE_CENTER?n:n-o.FIELD_TEXT_HEIGHT/2+o.FIELD_TEXT_BASELINE))}}positionBorderRect_(){this.borderRect_&&(this.borderRect_.setAttribute("width",String(this.size_.width)),this.borderRect_.setAttribute("height",String(this.size_.height)),this.borderRect_.setAttribute("rx",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)),this.borderRect_.setAttribute("ry",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)))}getSize(){return this.isVisible()?(this.isDirty_?(this.render_(),this.isDirty_=!1):this.visible_&&this.size_.width===0&&(this.render_(),this.size_.width!==0&&console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead.")),this.size_):new Xe(0,0)}getScaledBBox(){let e;var t=this.getSourceBlock();if(!t)throw new _t;if(this.isFullBlockField()){var o=this.sourceBlock_.getHeightWidth();const n=t.workspace.scale;e=this.getAbsoluteXY_(),t=(o.width+1)*n,o=(o.height+1)*n,xb?(e.x+=1.5*n,e.y+=1.5*n):(e.x-=.5*n,e.y-=.5*n)}else o=this.borderRect_.getBoundingClientRect(),e=xo(this.borderRect_),t=o.width,o=o.height;return new rt(e.y,e.y+o,e.x,e.x+t)}onLocationChange(e){}getDisplayText_(){let e=this.getText();return e?(e.length>this.maxDisplayLength&&(e=e.substring(0,this.maxDisplayLength-2)+"…"),e=e.replace(/\s/g,lt.NBSP),this.sourceBlock_&&this.sourceBlock_.RTL&&(e+="‏"),e):lt.NBSP}getText(){const e=this.getText_();return String(e!==null?e:this.getValue())}getText_(){return null}markDirty(){this.isDirty_=!0,this.constants_=null}forceRerender(){this.isDirty_=!0,this.sourceBlock_&&this.sourceBlock_.rendered&&this.sourceBlock_.queueRender()}setValue(e,t=!0){if(e!==null){var o=i.getGroup$$module$build$src$core$events$utils();o||i.setGroup$$module$build$src$core$events$utils(!0);try{const le=this.doClassValidation_(e),Ee=this.processValidation(e,le,t);if(!(Ee instanceof Error)){var n,u=(n=this.getValidator())==null?void 0:n.call(this,Ee),g=this.processValidation(Ee,u,t);if(!(g instanceof Error)){var I=this.sourceBlock_;if(!I||!I.disposed){var L=this.getValue();L===g?this.doValueUpdate_(g):(this.doValueUpdate_(g),t&&I&&C()&&z(new(ne(ee.BLOCK_CHANGE))(I,"field",this.name||null,L,g)),this.isDirty_&&this.forceRerender())}}}}finally{i.setGroup$$module$build$src$core$events$utils(o)}}}processValidation(e,t,o){return t===null?(this.doValueInvalid_(e,o),this.isDirty_&&this.forceRerender(),Error()):t===void 0?e:t}getValue(){return this.value_}doClassValidation_(e){return e??null}doValueUpdate_(e){this.value_=e,this.isDirty_=!0}doValueInvalid_(e,t){}onMouseDown_(e){this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&(e=this.sourceBlock_.workspace.getGesture(e))&&e.setStartField(this)}setTooltip(e){e||e===""||(e=this.sourceBlock_);const t=this.getClickTarget_();t?t.tooltip=e:this.tooltip=e}getTooltip(){const e=this.getClickTarget_();return Hi(e||{tooltip:this.tooltip})}getClickTarget_(){return this.clickTarget_||this.getSvgRoot()}getAbsoluteXY_(){return xo(this.getClickTarget_())}referencesVariables(){return!1}refreshVariableName(){}getParentInput(){let e=null;const t=this.getSourceBlock();if(!t)throw new _t;const o=t.inputList;for(let n=0;n{o.stopPropagation()})}addModelUpdateBindings(){this.view.addTextChangeListener((e,t)=>{super.setText(t)}),this.view.addSizeChangeListener((e,t)=>{super.setSize(t)}),this.view.addOnCollapseListener(()=>{super.setCollapsed(this.view.isCollapsed())}),this.view.addDisposeListener(()=>{this.isDeadOrDying()||this.dispose()})}setText(e){this.view.setText(e)}setSize(e){this.view.setSize(e)}setCollapsed(e){this.view.setCollapsed(e)}setEditable(e){super.setEditable(e),this.view.setEditable(this.isEditable())}getSvgRoot(){return this.view.getSvgRoot()}getSize(){return super.getSize()}getBoundingRectangle(){const e=this.getRelativeToSurfaceXY();var t,o;const n=(o=(t=this.view)==null?void 0:t.getSize())!=null?o:this.getSize();return this.workspace.RTL?(t=e.x-n.width,o=e.x):(t=e.x,o=e.x+n.width),new rt(e.y,e.y+n.height,t,o)}moveBy(e,t,o){const n=this.getRelativeToSurfaceXY();e=new ye(n.x+e,n.y+t),this.moveTo(e,o)}moveTo(e,t){super.moveTo(e,t),this.view.moveTo(e)}moveDuringDrag(e){this.location=e,this.view.moveTo(e)}setDragging(e){e?Oe(this.getSvgRoot(),"blocklyDragging"):ze(this.getSvgRoot(),"blocklyDragging")}dispose(){this.disposing=!0,this.view.isDeadOrDying()||this.view.dispose(),super.dispose()}startGesture(e){const t=this.workspace.getGesture(e);if(t){if(be(e))e.stopPropagation();else{t.handleCommentStart(e,this);let o;(o=this.workspace.getLayerManager())==null||o.append(this,Fo)}i.setSelected$$module$build$src$core$common(this)}}setDeleteStyle(e){e?Oe(this.getSvgRoot(),"blocklyDraggingDelete"):ze(this.getSvgRoot(),"blocklyDraggingDelete")}isMovable(){return this.dragStrategy.isMovable()}startDrag(){this.dragStrategy.startDrag()}drag(e){this.dragStrategy.drag(e)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){Oe(this.getSvgRoot(),"blocklySelected")}unselect(){ze(this.getSvgRoot(),"blocklySelected")}toCopyData(){return{paster:pl.TYPE,commentState:Pi(this,{addCoordinates:!0})}}showContextMenu(e){const t=Ke.registry.getContextMenuOptions(Ke.ScopeType.COMMENT,{comment:this});sr(e,t,this.workspace.RTL,this.workspace)}snapToGrid(){if(!this.isDeadOrDying()){var e=this.workspace.getGrid();if(e!=null&&e.shouldSnap()){var t=this.getRelativeToSurfaceXY();e=e.alignXY(t),e!==t&&this.moveTo(e,["snap"])}}}},Ft={};Ft.appendDomToWorkspace=d$,Ft.blockToDom=Ao,Ft.blockToDomWithXY=nr,Ft.clearWorkspaceAndLoadFromXml=u$,Ft.deleteNext=y$,Ft.domToBlock=i.domToBlock$$module$build$src$core$xml,Ft.domToBlockInternal=ni,Ft.domToPrettyText=c$,Ft.domToText=zs,Ft.domToVariables=$d,Ft.domToWorkspace=i.domToWorkspace$$module$build$src$core$xml,Ft.loadWorkspaceComment=fd,Ft.saveWorkspaceComment=ir,Ft.variablesToDom=gd,Ft.workspaceToDom=r$;var Qh=class extends gi{constructor(e){super(e),this.type=ee.BLOCK_CREATE,e&&(e.isShadow()&&(this.recordUndo=!1),this.xml=nr(e),this.ids=ve(e),this.json=os(e,{addCoordinates:!0}))}toJson(){const e=super.toJson();if(!this.xml)throw Error("The block XML is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");return e.xml=zs(this.xml),e.ids=this.ids,e.json=this.json,this.recordUndo||(e.recordUndo=this.recordUndo),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Qh),t.xml=i.textToDom$$module$build$src$core$utils$xml(e.xml),t.ids=e.ids,t.json=e.json,e.recordUndo!==void 0&&(t.recordUndo=e.recordUndo),t}run(e){const t=this.getEventWorkspace_();if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!KC(t,this.ids))if(e)lo(this.json,t);else for(e=0;ee.getBlockById(o)).filter(o=>o&&o.isShadow()).length===t.length};r($e.EVENT,ee.BLOCK_CREATE,Qh);var ep=class extends Ss{constructor(e,t){super(t),this.type=ee.THEME_CHANGE,this.themeName=e}toJson(){const e=super.toJson();if(!this.themeName)throw Error("The theme name is undefined. Either pass a theme name to the constructor, or call fromJson");return e.themeName=this.themeName,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new ep),t.themeName=e.themeName,t}};r($e.EVENT,ee.THEME_CHANGE,ep);var tp=class extends Ss{constructor(e,t,o,n,u){super(n),this.type=ee.VIEWPORT_CHANGE,this.viewTop=e,this.viewLeft=t,this.scale=o,this.oldScale=u}toJson(){const e=super.toJson();if(this.viewTop===void 0)throw Error("The view top is undefined. Either pass a value to the constructor, or call fromJson");if(this.viewLeft===void 0)throw Error("The view left is undefined. Either pass a value to the constructor, or call fromJson");if(this.scale===void 0)throw Error("The scale is undefined. Either pass a value to the constructor, or call fromJson");if(this.oldScale===void 0)throw Error("The old scale is undefined. Either pass a value to the constructor, or call fromJson");return e.viewTop=this.viewTop,e.viewLeft=this.viewLeft,e.scale=this.scale,e.oldScale=this.oldScale,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new tp),t.viewTop=e.viewTop,t.viewLeft=e.viewLeft,t.scale=e.scale,t.oldScale=e.oldScale,t}};r($e.EVENT,ee.VIEWPORT_CHANGE,tp);var xe;(function(e){e[e.INPUT_VALUE=1]="INPUT_VALUE",e[e.OUTPUT_VALUE=2]="OUTPUT_VALUE",e[e.NEXT_STATEMENT=3]="NEXT_STATEMENT",e[e.PREVIOUS_STATEMENT=4]="PREVIOUS_STATEMENT"})(xe||(xe={}));var un=class{constructor(e){this.connectionChecker=e,this.connections=[]}addConnection(e,t){t=this.calculateIndexForYPos(t),this.connections.splice(t,0,e)}findIndexOfConnection(e,t){if(!this.connections.length)return-1;const o=this.calculateIndexForYPos(t);if(o>=this.connections.length)return-1;t=e.y;let n=o;for(;0<=n&&this.connections[n].y===t;){if(this.connections[n]===e)return n;n--}for(n=o;ne)o=n;else{t=n;break}}return t}removeConnection(e,t){if(e=this.findIndexOfConnection(e,t),e===-1)throw Error("Unable to find connection in connectionDB.");this.connections.splice(e,1)}getNeighbours(e,t){function o(Ee){const dt=u-n[Ee].x,ut=g-n[Ee].y;return Math.sqrt(dt*dt+ut*ut)<=t&&le.push(n[Ee]),ut(this.flyout?i.config$$module$build$src$core$config.flyoutDragRadius:i.config$$module$build$src$core$config.dragRadius)}updateIsDraggingFromFlyout(){let e;if(!this.targetBlock||(e=this.flyout)==null||!e.isBlockCreatable(this.targetBlock))return!1;if(!this.flyout.targetWorkspace)throw Error(`Cannot update dragging from the flyout because the ' + + 'flyout's target workspace is undefined`);return!this.flyout.isScrollable()||this.flyout.isDragTowardWorkspace(this.currentDragDeltaXY)?(this.startWorkspace_=this.flyout.targetWorkspace,this.startWorkspace_.updateScreenCalculationsIfScrolled(),i.getGroup$$module$build$src$core$events$utils()||i.setGroup$$module$build$src$core$events$utils(!0),this.startBlock=null,this.targetBlock=this.flyout.createBlock(this.targetBlock),i.setSelected$$module$build$src$core$common(this.targetBlock),!0):!1}updateIsDraggingWorkspace(){if(!this.startWorkspace_)throw Error("Cannot update dragging the workspace because the start workspace is undefined");(this.flyout?this.flyout.isScrollable():this.startWorkspace_&&this.startWorkspace_.isDraggable())&&(this.dragging=!0,this.workspaceDragger=new $v(this.startWorkspace_),this.workspaceDragger.startDrag())}updateIsDragging(e){if(!this.startWorkspace_)throw Error("Cannot update dragging because the start workspace is undefined");if(this.calledUpdateIsDragging)throw Error("updateIsDragging_ should only be called once per gesture.");this.calledUpdateIsDragging=!0,this.flyout&&this.updateIsDraggingFromFlyout();const t=j();t&&ri(t)&&t.isMovable()?(this.dragging=!0,this.dragger=this.createDragger(t,this.startWorkspace_),this.dragger.onDragStart(e),this.dragger.onDrag(e,this.currentDragDeltaXY)):this.updateIsDraggingWorkspace()}createDragger(e,t){return new(y($e.BLOCK_DRAGGER,this.creatorWorkspace.options,!0))(e,t)}doStart(e){if(!this.startWorkspace_)throw Error("Cannot start the touch gesture becauase the start workspace is undefined");this.isPinchZoomEnabled=this.startWorkspace_.options.zoomOptions&&this.startWorkspace_.options.zoomOptions.pinch,be(e)?this.cancel():(this.gestureHasStarted=!0,Ki(),this.startWorkspace_.updateScreenCalculationsIfScrolled(),this.startWorkspace_.isMutator&&this.startWorkspace_.resize(),this.currentDropdownOwner=Mu(),this.startWorkspace_.hideChaff(!!this.flyout),this.startWorkspace_.markFocused(),this.mostRecentEvent=e,ed(),pe(e)?this.handleRightClick(e):(e.type.toLowerCase()==="pointerdown"&&e.pointerType!=="mouse"&&k(e,this),this.mouseDownXY=new ye(e.clientX,e.clientY),this.bindMouseEvents(e),this.isEnding_||this.handleTouchStart(e)))}bindMouseEvents(e){this.boundEvents.push(H(document,"pointerdown",null,this.handleStart.bind(this),!0)),this.boundEvents.push(H(document,"pointermove",null,this.handleMove.bind(this),!0)),this.boundEvents.push(H(document,"pointerup",null,this.handleUp.bind(this),!0)),e.preventDefault(),e.stopPropagation()}handleStart(e){this.isDragging()||(this.handleTouchStart(e),this.isMultiTouch()&&X())}handleMove(e){this.isDragging()&&O(e)||!this.isMultiTouch()?(this.updateFromEvent(e),this.workspaceDragger?this.workspaceDragger.drag(this.currentDragDeltaXY):this.dragger&&this.dragger.onDrag(this.mostRecentEvent,this.currentDragDeltaXY),e.preventDefault(),e.stopPropagation()):this.isMultiTouch()&&(this.handleTouchMove(e),X())}handleUp(e){if(this.isDragging()||this.handleTouchEnd(e),!this.isMultiTouch()||this.isDragging()){if(!O(e))return;if(this.updateFromEvent(e),X(),this.isEnding_){console.log("Trying to end a gesture recursively.");return}this.isEnding_=!0,this.dragger?this.dragger.onDragEnd(e,this.currentDragDeltaXY):this.workspaceDragger?this.workspaceDragger.endDrag(this.currentDragDeltaXY):this.isBubbleClick()||this.isCommentClick()||(this.isFieldClick()?this.doFieldClick():this.isIconClick()?this.doIconClick():this.isBlockClick()?this.doBlockClick():this.isWorkspaceClick()&&this.doWorkspaceClick(e))}e.preventDefault(),e.stopPropagation(),this.dispose()}handleTouchStart(e){var t=A(e);this.cachedPoints.set(t,this.getTouchPoint(e));var o=Array.from(this.cachedPoints.keys());o.length===2&&(t=this.cachedPoints.get(o[0]),o=this.cachedPoints.get(o[1]),this.startDistance=ye.distance(t,o),this.multiTouch=!0,e.preventDefault())}handleTouchMove(e){const t=A(e);this.cachedPoints.set(t,this.getTouchPoint(e)),this.isPinchZoomEnabled&&this.cachedPoints.size===2?this.handlePinch(e):(this.updateFromEvent(e),this.workspaceDragger?this.workspaceDragger.drag(this.currentDragDeltaXY):this.dragger&&this.dragger.onDrag(this.mostRecentEvent,this.currentDragDeltaXY),e.preventDefault(),e.stopPropagation())}handlePinch(e){var t=Array.from(this.cachedPoints.keys()),o=this.cachedPoints.get(t[0]);if(t=this.cachedPoints.get(t[1]),o=ye.distance(o,t)/this.startDistance,0this.previousScale){if(t=o-this.previousScale,t=0this.cachedPoints.size&&(this.cachedPoints.clear(),this.previousScale=0)}getTouchPoint(e){return this.startWorkspace_?new ye(e.pageX,e.pageY):null}isMultiTouch(){return this.multiTouch}cancel(){this.isEnding_||(X(),this.dragger?this.dragger.onDragEnd(this.mostRecentEvent,this.currentDragDeltaXY):this.workspaceDragger&&this.workspaceDragger.endDrag(this.currentDragDeltaXY),this.dispose())}handleRightClick(e){this.targetBlock?(this.bringBlockToFront(),this.targetBlock.workspace.hideChaff(!!this.flyout),this.targetBlock.showContextMenu(e)):this.startBubble?this.startBubble.showContextMenu(e):this.startComment?(this.startComment.workspace.hideChaff(),this.startComment.showContextMenu(e)):this.startWorkspace_&&!this.flyout&&(this.startWorkspace_.hideChaff(),this.startWorkspace_.showContextMenu(e)),e.preventDefault(),e.stopPropagation(),this.dispose()}handleWsStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");this.setStartWorkspace(t),this.mostRecentEvent=e,this.startBlock||this.startBubble||this.startComment||i.setSelected$$module$build$src$core$common(null),this.doStart(e)}fireWorkspaceClick(e){z(new(ne(ee.CLICK))(null,e.id,"workspace"))}handleFlyoutStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");this.setStartFlyout(t),this.handleWsStart(e,t.getWorkspace())}handleBlockStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBlockStart, but the gesture had already been started.");this.setStartBlock(t),this.mostRecentEvent=e}handleBubbleStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");this.setStartBubble(t),this.mostRecentEvent=e}handleCommentStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleCommentStart, but the gesture had already been started.");this.setStartComment(t),this.mostRecentEvent=e}doFieldClick(){if(!this.startField)throw Error("Cannot do a field click because the start field is undefined");this.currentDropdownOwner!==this.startField&&this.startField.showEditor(this.mostRecentEvent),this.bringBlockToFront()}doIconClick(){if(!this.startIcon)throw Error("Cannot do an icon click because the start icon is undefined");this.bringBlockToFront(),this.startIcon.onClick()}doBlockClick(){if(this.flyout&&this.flyout.autoClose){if(!this.targetBlock)throw Error("Cannot do a block click because the target block is undefined");if(this.targetBlock.isEnabled()){i.getGroup$$module$build$src$core$events$utils()||i.setGroup$$module$build$src$core$events$utils(!0);var e=this.flyout.createBlock(this.targetBlock);e.snapToGrid(),e.bumpNeighbours()}}else{if(!this.startWorkspace_)throw Error("Cannot do a block click because the start workspace is undefined");e=new(ne(ee.CLICK))(this.startBlock,this.startWorkspace_.id,"block"),z(e)}this.bringBlockToFront(),i.setGroup$$module$build$src$core$events$utils(!1)}doWorkspaceClick(e){e=this.creatorWorkspace,j()&&j().unselect(),this.fireWorkspaceClick(this.startWorkspace_||e)}bringBlockToFront(){this.targetBlock&&!this.flyout&&this.targetBlock.bringToFront()}setStartField(e){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");this.startField||(this.startField=e)}setStartIcon(e){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartIcon, but the gesture had already been started.");this.startIcon||(this.startIcon=e)}setStartBubble(e){this.startBubble||(this.startBubble=e)}setStartComment(e){this.startComment||(this.startComment=e)}setStartBlock(e){this.startBlock||this.startBubble||(this.startBlock=e,i.setSelected$$module$build$src$core$common(this.startBlock),e.isInFlyout&&e!==e.getRootBlock()?this.setTargetBlock(e.getRootBlock()):this.setTargetBlock(e))}setTargetBlock(e){e.isShadow()?this.setTargetBlock(e.getParent()):this.targetBlock=e}setStartWorkspace(e){this.startWorkspace_||(this.startWorkspace_=e)}setStartFlyout(e){this.flyout||(this.flyout=e)}isBubbleClick(){return!!this.startBubble&&!this.hasExceededDragRadius}isCommentClick(){return!!this.startComment&&!this.hasExceededDragRadius}isBlockClick(){return!!this.startBlock&&!this.hasExceededDragRadius&&!this.isFieldClick()&&!this.isIconClick()}isFieldClick(){return this.startField?this.startField.isClickable()&&!this.hasExceededDragRadius&&(!this.flyout||this.startField.isClickableInFlyout(this.flyout.autoClose)):!1}isIconClick(){if(!this.startIcon)return!1;const e=!this.flyout||!this.startIcon.isClickableInFlyout||this.startIcon.isClickableInFlyout(this.flyout.autoClose);return!this.hasExceededDragRadius&&e}isWorkspaceClick(){return!this.startBlock&&!this.startBubble&&!this.startField&&!this.hasExceededDragRadius}getCurrentDragger(){let e,t;return(t=(e=this.workspaceDragger)!=null?e:this.dragger)!=null?t:null}isDragging(){return this.dragging}hasStarted(){return this.gestureHasStarted}static inProgress(){const e=B();for(let t=0,o;o=e[t];t++)if(o.currentGesture_)return!0;return!1}},sp=class{constructor(e,t){this.pattern=e,this.scale=1;let o;this.spacing=(o=t.spacing)!=null?o:0;let n;this.length=(n=t.length)!=null?n:1,this.line2=(this.line1=e.firstChild)&&this.line1.nextSibling;let u;this.snapToGrid=(u=t.snap)!=null?u:!1}setSpacing(e){this.spacing=e,this.update(this.scale)}getSpacing(){return this.spacing}setLength(e){this.length=e,this.update(this.scale)}getLength(){return this.length}setSnapToGrid(e){this.snapToGrid=e}shouldSnap(){return this.snapToGrid}getPatternId(){return this.pattern.id}update(e){this.scale=e;var t=this.spacing*e;this.pattern.setAttribute("width",`${t}`),this.pattern.setAttribute("height",`${t}`),t=Math.floor(this.spacing/2)+.5;let o=t-this.length/2,n=t+this.length/2;t*=e,o*=e,n*=e,this.setLineAttributes(this.line1,e,o,n,t,t),this.setLineAttributes(this.line2,e,t,t,o,n)}setLineAttributes(e,t,o,n,u,g){e&&(e.setAttribute("stroke-width",`${t}`),e.setAttribute("x1",`${o}`),e.setAttribute("y1",`${u}`),e.setAttribute("x2",`${n}`),e.setAttribute("y2",`${g}`))}moveTo(e,t){this.pattern.setAttribute("x",`${e}`),this.pattern.setAttribute("y",`${t}`)}alignXY(e){var t=this.getSpacing();const o=t/2,n=Math.round(Math.round((e.x-o)/t)*t+o);return t=Math.round(Math.round((e.y-o)/t)*t+o),n===e.x&&t===e.y?e:new ye(n,t)}static createDom(e,t,o){e=ie(J.PATTERN,{id:"blocklyGridPattern"+e,patternUnits:"userSpaceOnUse"},o);let n,u;if(0<((n=t.length)!=null?n:1)&&0<((u=t.spacing)!=null?u:0)){ie(J.LINE,{stroke:t.colour},e);let g;(g=t.length)!=null&&g&&ie(J.LINE,{stroke:t.colour},e)}else ie(J.LINE,{},e);return e}},qC=class{constructor(e){this.workspace=e,this.layers=new Map,(e=e.getInjectionDiv())&&(this.dragLayer=this.createDragLayer(e),this.animationLayer=this.createAnimationLayer(e)),e=this.createLayer(Fo),Oe(e,"blocklyBlockCanvas"),e=this.createLayer(Sl),Oe(e,"blocklyBubbleCanvas")}createDragLayer(e){const t=ie(J.SVG,{class:"blocklyBlockDragSurface",xmlns:pr,"xmlns:html":Gs,"xmlns:xlink":is,version:"1.1"});return e.append(t),ie(J.G,{},t)}createAnimationLayer(e){const t=ie(J.SVG,{class:"blocklyAnimationLayer",xmlns:pr,"xmlns:html":Gs,"xmlns:xlink":is,version:"1.1"});return e.append(t),ie(J.G,{},t)}appendToAnimationLayer(e){let t;const o=(t=this.dragLayer)==null?void 0:t.getAttribute("transform");if(o){let u;(u=this.animationLayer)==null||u.setAttribute("transform",o)}let n;(n=this.animationLayer)==null||n.appendChild(e.getSvgRoot())}translateLayers(e,t){e=`translate(${e.x}, ${e.y}) scale(${t})`;let o;(o=this.dragLayer)==null||o.setAttribute("transform",e);for(const[,n]of this.layers)n.setAttribute("transform",e)}moveToDragLayer(e){let t;(t=this.dragLayer)==null||t.appendChild(e.getSvgRoot())}moveOffDragLayer(e,t){this.append(e,t)}append(e,t){this.layers.has(t)||this.createLayer(t);let o;(o=this.layers.get(t))==null||o.appendChild(e.getSvgRoot())}createLayer(e){const t=this.workspace.getSvgGroup(),o=ie(J.G,{});let n=!1;const u=[...this.layers].sort((g,I)=>g[0]-I[0]);for(const[g,I]of u)if(et[1]===e)?e:(this.sourceBlock_&&console.warn("Cannot set the dropdown's value to an unavailable option. Block type: "+this.sourceBlock_.type+", Field name: "+this.name+", Value: "+e),null)}doValueUpdate_(e){super.doValueUpdate_(e),e=this.getOptions(!0);for(let t=0,o;o=e[t];t++)o[1]===this.value_&&(this.selectedOption=o)}applyColour(){const e=this.sourceBlock_;this.borderRect_&&(this.borderRect_.setAttribute("stroke",e.getColourTertiary()),this.menu_?this.borderRect_.setAttribute("fill",e.getColourTertiary()):this.borderRect_.setAttribute("fill","transparent")),e&&this.arrow&&(e.isShadow()?this.arrow.style.fill=e.getColourSecondary():this.arrow.style.fill=e.getColour())}render_(){this.getTextContent().nodeValue="",this.imageElement.style.display="none";const e=this.selectedOption&&this.selectedOption[0];e&&typeof e=="object"?this.renderSelectedImage(e):this.renderSelectedText(),this.positionBorderRect_()}renderSelectedImage(e){const t=this.getSourceBlock();if(!t)throw new _t;this.imageElement.style.display="",this.imageElement.setAttributeNS(is,"xlink:href",e.src),this.imageElement.setAttribute("height",String(e.height)),this.imageElement.setAttribute("width",String(e.width));const o=Number(e.height);e=Number(e.width);var n=!!this.borderRect_;const u=Math.max(n?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,o+Qt.IMAGE_Y_PADDING);n=n?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let g;g=this.svgArrow?this.positionSVGArrow(e+n,u/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2):Io(this.arrow,this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY),this.size_.width=e+g+2*n,this.size_.height=u;let I=0;t.RTL?this.imageElement.setAttribute("x",`${n+g}`):(I=e+g,this.getTextElement().setAttribute("text-anchor","end"),this.imageElement.setAttribute("x",`${n}`)),this.imageElement.setAttribute("y",String(u/2-o/2)),this.positionTextElement_(I+n,e+g)}renderSelectedText(){this.getTextContent().nodeValue=this.getDisplayText_();var e=this.getTextElement();Oe(e,"blocklyDropdownText"),e.setAttribute("text-anchor","start");var t=!!this.borderRect_;e=Math.max(t?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,this.getConstants().FIELD_TEXT_HEIGHT);const o=Io(this.getTextElement(),this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY);t=t?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let n=0;this.svgArrow&&(n=this.positionSVGArrow(o+t,e/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2)),this.size_.width=o+n+2*t,this.size_.height=e,this.positionTextElement_(t,o)}positionSVGArrow(e,t){if(!this.svgArrow)return 0;const o=this.getSourceBlock();if(!o)throw new _t;const n=this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0,u=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_PADDING,g=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE;return this.svgArrow.setAttribute("transform","translate("+(o.RTL?n:e+u)+","+t+")"),g+u}getText_(){if(!this.selectedOption)return null;const e=this.selectedOption[0];return typeof e=="object"?e.alt:e}static fromJson(e){if(!e.options)throw Error("options are required for the dropdown field. The options property must be assigned an array of [humanReadableValue, languageNeutralValue] tuples.");return new this(e.options,void 0,e)}trimOptions(e){let t=!1;const o=e.map(([I,L])=>typeof I=="string"?[bt(I),L]:(t=!0,[I.alt!==null?Object.assign({},I,{alt:bt(I.alt)}):Object.assign({},I),L]));if(t||2>e.length)return{options:o};var n=o.map(([I])=>I),u=Qn(n);e=Ku(n,u);const g=Yu(n,u);return!e&&!g||u<=e+g?{options:o}:(u=e?n[0].substring(0,e-1):void 0,n=g?n[0].substr(1-g):void 0,{options:this.applyTrim(o,e,g),prefix:u,suffix:n})}applyTrim(e,t,o){return e.map(([n,u])=>[n.substring(t,n.length-o),u])}validateOptions(e){if(!Array.isArray(e))throw TypeError("FieldDropdown options must be an array.");if(!e.length)throw TypeError("FieldDropdown options must not be an empty array.");let t=!1;for(let o=0;oe.width)return t;if(e=this.getWorkspaceViewRect(e),this.workspace.RTL){var o=this.anchor.x-t;o-this.size.widthe.right&&(t=-(e.right-this.anchor.x))}else{o=t+this.anchor.x;const n=o+this.size.width;oe.right&&(t=e.right-this.anchor.x-this.size.width)}return t}getOptimalRelativeTop(e){let t=-this.size.height/4;if(this.size.height>e.height)return t;const o=this.anchor.y+t,n=o+this.size.height;return e=this.getWorkspaceViewRect(e),oe.bottom&&(t=e.bottom-this.anchor.y-this.size.height),t}getWorkspaceViewRect(e){const t=e.top;let o=e.top+e.height,n=e.left;return e=e.left+e.width,o-=this.getScrollbarThickness(),this.workspace.RTL?n-=this.getScrollbarThickness():e-=this.getScrollbarThickness(),new rt(t,o,n,e)}getScrollbarThickness(){return yt.scrollbarThickness/this.workspace.scale}renderTail(){const e=[];var t=this.size.width/2,o=this.size.height/2,n=-this.relativeLeft,u=-this.relativeTop;if(t===n&&o===u)e.push("M "+t+","+o);else{u-=o,n-=t,this.workspace.RTL&&(n*=-1);var g=Math.sqrt(u*u+n*n),I=Math.acos(n/g);0>u&&(I=2*Math.PI-I);var L=I+Math.PI/2;L>2*Math.PI&&(L-=2*Math.PI);var le=Math.sin(L);const dt=Math.cos(L);let ut=(this.size.width+this.size.height)/rs.TAIL_THICKNESS;ut=Math.min(ut,this.size.width,this.size.height)/4,L=1-rs.ANCHOR_RADIUS/g,n=t+L*n,u=o+L*u,L=t+ut*dt;const es=o+ut*le;t-=ut*dt,o-=ut*le,le=Aa(this.workspace.RTL?-rs.TAIL_ANGLE:rs.TAIL_ANGLE),le=I+le,le>2*Math.PI&&(le-=2*Math.PI),I=Math.sin(le)*g/rs.TAIL_BEND,g=Math.cos(le)*g/rs.TAIL_BEND,e.push("M"+L+","+es),e.push("C"+(L+g)+","+(es+I)+" "+n+","+u+" "+n+","+u),e.push("C"+n+","+u+" "+(t+g)+","+(o+I)+" "+t+","+o)}e.push("z");let Ee;(Ee=this.tail)==null||Ee.setAttribute("d",e.join(" "))}bringToFront(){let e;const t=(e=this.svgRoot)==null?void 0:e.parentNode;return this.svgRoot&&(t==null?void 0:t.lastChild)!==this.svgRoot?(t==null||t.appendChild(this.svgRoot),!0):!1}getRelativeToSurfaceXY(){return new ye(this.workspace.RTL?-this.relativeLeft+this.anchor.x-this.size.width:this.anchor.x+this.relativeLeft,this.anchor.y+this.relativeTop)}getSvgRoot(){return this.svgRoot}moveDuringDrag(e){this.moveTo(e.x,e.y),this.relativeLeft=this.workspace.RTL?this.anchor.x-e.x-this.size.width:e.x-this.anchor.x,this.relativeTop=e.y-this.anchor.y,this.renderTail()}setDragging(e){}setDeleteStyle(e){}isDeletable(){return!1}showContextMenu(e){}isMovable(){return!0}startDrag(){this.dragStrategy.startDrag()}drag(e){this.dragStrategy.drag(e)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){}unselect(){}};rs=nt,nt.BORDER_WIDTH=6,nt.DOUBLE_BORDER=2*rs.BORDER_WIDTH,nt.MIN_SIZE=rs.DOUBLE_BORDER,nt.TAIL_THICKNESS=1,nt.TAIL_ANGLE=20,nt.TAIL_BEND=4,nt.ANCHOR_RADIUS=8;var vo=class extends nt{constructor(e,t,o,n){super(t,o,n),this.workspace=t,this.anchor=o,this.ownerRect=n,this.autoLayout=!0,t=new gs(e),this.validateWorkspaceOptions(t),this.svgDialog=ie(J.SVG,{x:nt.BORDER_WIDTH,y:nt.BORDER_WIDTH},this.contentContainer),e.parentWorkspace=this.workspace,this.miniWorkspace=this.newWorkspaceSvg(new gs(e)),this.miniWorkspace.internalIsMutator=!0,e=this.miniWorkspace.createDom("blocklyMutatorBackground"),this.svgDialog.appendChild(e),t.languageTree&&(e.insertBefore(this.miniWorkspace.addFlyout(J.G),this.miniWorkspace.getCanvas()),e=this.miniWorkspace.getFlyout(),e==null||e.init(this.miniWorkspace),e==null||e.show(t.languageTree)),this.miniWorkspace.addChangeListener(this.onWorkspaceChange.bind(this));let u,g;(u=this.miniWorkspace.getFlyout())==null||(g=u.getWorkspace())==null||g.addChangeListener(this.onWorkspaceChange.bind(this)),this.updateBubbleSize()}dispose(){this.miniWorkspace.dispose(),super.dispose()}getWorkspace(){return this.miniWorkspace}addWorkspaceChangeListener(e){this.miniWorkspace.addChangeListener(e)}validateWorkspaceOptions(e){if(e.hasCategories)throw Error("The miniworkspace bubble does not support toolboxes with categories");if(e.hasTrashcan)throw Error("The miniworkspace bubble does not support trashcans");if(e.zoomOptions.controls||e.zoomOptions.wheel||e.zoomOptions.pinch)throw Error("The miniworkspace bubble does not support zooming");if(e.moveOptions.scrollbars||e.moveOptions.wheel||e.moveOptions.drag)throw Error("The miniworkspace bubble does not scrolling/moving the workspace");if(e.horizontalLayout)throw Error("The miniworkspace bubble does not support horizontal layouts")}onWorkspaceChange(){this.bumpBlocksIntoBounds(),this.updateBubbleSize()}bumpBlocksIntoBounds(){if(!this.miniWorkspace.isDragging())for(const e of this.miniWorkspace.getTopBlocks(!1)){const t=e.getRelativeToSurfaceXY();if(20>t.y&&e.moveBy(0,20-t.y),e.RTL){let o=-20;const n=this.miniWorkspace.getFlyout();n&&(o-=n.getWidth()),t.x>o&&e.moveBy(o-t.x,0)}else 20>t.x&&e.moveBy(20-t.x,0)}}updateBubbleSize(){if(!this.miniWorkspace.isDragging()){var e=this.getSize(),t=this.calculateWorkspaceSize();Math.abs(e.width-t.width)({kind:"block",type:o}))}),t}getAnchorLocation(){const e=Rl/2;return ye.sum(this.workspaceLocation,new ye(e,e))}getBubbleOwnerRect(){const e=this.sourceBlock.getSvgRoot().getBBox();return new rt(e.y,e.y+e.height,e.x,e.x+e.width)}createRootBlock(){if(!this.sourceBlock.decompose)throw Error("Blocks with mutator icons must include a decompose method");this.rootBlock=this.sourceBlock.decompose(this.miniWorkspaceBubble.getWorkspace());for(var e of this.rootBlock.getDescendants(!1))e.queueRender();this.rootBlock.setMovable(!1),this.rootBlock.setDeletable(!1);let t,o,n,u;e=(u=(t=this.miniWorkspaceBubble)==null||(o=t.getWorkspace())==null||(n=o.getFlyout())==null?void 0:n.getWidth())!=null?u:0,this.rootBlock.moveBy(this.rootBlock.RTL?-(e+Nl):Nl,Nl)}addSaveConnectionsListener(){this.sourceBlock.saveConnections&&this.rootBlock&&(this.saveConnectionsListener=()=>{this.sourceBlock.saveConnections&&this.rootBlock&&this.sourceBlock.saveConnections(this.rootBlock)},this.saveConnectionsListener(),this.sourceBlock.workspace.addChangeListener(this.saveConnectionsListener))}createMiniWorkspaceChangeListener(){return e=>{i.MutatorIcon$$module$build$src$core$icons$mutator_icon.isIgnorableMutatorEvent(e)||this.updateWorkspacePid||(this.updateWorkspacePid=setTimeout(()=>{this.updateWorkspacePid=null,this.recomposeSourceBlock()},0))}}static isIgnorableMutatorEvent(e){return e.isUiEvent||$(e)||T(e)&&e.element==="disabled"}recomposeSourceBlock(){if(this.rootBlock){if(!this.sourceBlock.compose)throw Error("Blocks with mutator icons must include a compose method");var e=i.getGroup$$module$build$src$core$events$utils();e||i.setGroup$$module$build$src$core$events$utils(!0);var t=mi.getExtraBlockState_(this.sourceBlock);this.sourceBlock.compose(this.rootBlock);var o=mi.getExtraBlockState_(this.sourceBlock);t!==o&&z(new(ne(ee.BLOCK_CHANGE))(this.sourceBlock,"mutation",null,t,o)),i.setGroup$$module$build$src$core$events$utils(e)}}getWorkspace(){let e;return(e=this.miniWorkspaceBubble)==null?void 0:e.getWorkspace()}},i.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE=Ct.MUTATOR,i.MutatorIcon$$module$build$src$core$icons$mutator_icon.WEIGHT=1,i.MutatorIcon$$module$build$src$core$icons$mutator_icon;var dn=Object.create(null),QC={allExtensions:dn};i.register$$module$build$src$core$extensions("parent_tooltip_when_inline",D$);var As={TEST_ONLY:QC};As.apply=Va,As.buildTooltipForDropdown=i.buildTooltipForDropdown$$module$build$src$core$extensions,As.buildTooltipWithFieldText=i.buildTooltipWithFieldText$$module$build$src$core$extensions,As.isRegistered=kd,As.register=i.register$$module$build$src$core$extensions,As.registerMixin=i.registerMixin$$module$build$src$core$extensions,As.registerMutator=i.registerMutator$$module$build$src$core$extensions,As.runAfterPageLoad=I$,As.unregister=k$;var Ye;(function(e){e[e.WIN_KEY_FF_LINUX=0]="WIN_KEY_FF_LINUX",e[e.MAC_ENTER=3]="MAC_ENTER",e[e.BACKSPACE=8]="BACKSPACE",e[e.TAB=9]="TAB",e[e.NUM_CENTER=12]="NUM_CENTER",e[e.ENTER=13]="ENTER",e[e.SHIFT=16]="SHIFT",e[e.CTRL=17]="CTRL",e[e.ALT=18]="ALT",e[e.PAUSE=19]="PAUSE",e[e.CAPS_LOCK=20]="CAPS_LOCK",e[e.ESC=27]="ESC",e[e.SPACE=32]="SPACE",e[e.PAGE_UP=33]="PAGE_UP",e[e.PAGE_DOWN=34]="PAGE_DOWN",e[e.END=35]="END",e[e.HOME=36]="HOME",e[e.LEFT=37]="LEFT",e[e.UP=38]="UP",e[e.RIGHT=39]="RIGHT",e[e.DOWN=40]="DOWN",e[e.PLUS_SIGN=43]="PLUS_SIGN",e[e.PRINT_SCREEN=44]="PRINT_SCREEN",e[e.INSERT=45]="INSERT",e[e.DELETE=46]="DELETE",e[e.ZERO=48]="ZERO",e[e.ONE=49]="ONE",e[e.TWO=50]="TWO",e[e.THREE=51]="THREE",e[e.FOUR=52]="FOUR",e[e.FIVE=53]="FIVE",e[e.SIX=54]="SIX",e[e.SEVEN=55]="SEVEN",e[e.EIGHT=56]="EIGHT",e[e.NINE=57]="NINE",e[e.FF_SEMICOLON=59]="FF_SEMICOLON",e[e.FF_EQUALS=61]="FF_EQUALS",e[e.FF_DASH=173]="FF_DASH",e[e.FF_HASH=163]="FF_HASH",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.AT_SIGN=64]="AT_SIGN",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.META=91]="META",e[e.WIN_KEY_RIGHT=92]="WIN_KEY_RIGHT",e[e.CONTEXT_MENU=93]="CONTEXT_MENU",e[e.NUM_ZERO=96]="NUM_ZERO",e[e.NUM_ONE=97]="NUM_ONE",e[e.NUM_TWO=98]="NUM_TWO",e[e.NUM_THREE=99]="NUM_THREE",e[e.NUM_FOUR=100]="NUM_FOUR",e[e.NUM_FIVE=101]="NUM_FIVE",e[e.NUM_SIX=102]="NUM_SIX",e[e.NUM_SEVEN=103]="NUM_SEVEN",e[e.NUM_EIGHT=104]="NUM_EIGHT",e[e.NUM_NINE=105]="NUM_NINE",e[e.NUM_MULTIPLY=106]="NUM_MULTIPLY",e[e.NUM_PLUS=107]="NUM_PLUS",e[e.NUM_MINUS=109]="NUM_MINUS",e[e.NUM_PERIOD=110]="NUM_PERIOD",e[e.NUM_DIVISION=111]="NUM_DIVISION",e[e.F1=112]="F1",e[e.F2=113]="F2",e[e.F3=114]="F3",e[e.F4=115]="F4",e[e.F5=116]="F5",e[e.F6=117]="F6",e[e.F7=118]="F7",e[e.F8=119]="F8",e[e.F9=120]="F9",e[e.F10=121]="F10",e[e.F11=122]="F11",e[e.F12=123]="F12",e[e.NUMLOCK=144]="NUMLOCK",e[e.SCROLL_LOCK=145]="SCROLL_LOCK",e[e.FIRST_MEDIA_KEY=166]="FIRST_MEDIA_KEY",e[e.LAST_MEDIA_KEY=183]="LAST_MEDIA_KEY",e[e.SEMICOLON=186]="SEMICOLON",e[e.DASH=189]="DASH",e[e.EQUALS=187]="EQUALS",e[e.COMMA=188]="COMMA",e[e.PERIOD=190]="PERIOD",e[e.SLASH=191]="SLASH",e[e.APOSTROPHE=192]="APOSTROPHE",e[e.TILDE=192]="TILDE",e[e.SINGLE_QUOTE=222]="SINGLE_QUOTE",e[e.OPEN_SQUARE_BRACKET=219]="OPEN_SQUARE_BRACKET",e[e.BACKSLASH=220]="BACKSLASH",e[e.CLOSE_SQUARE_BRACKET=221]="CLOSE_SQUARE_BRACKET",e[e.WIN_KEY=224]="WIN_KEY",e[e.MAC_FF_META=224]="MAC_FF_META",e[e.MAC_WK_CMD_LEFT=91]="MAC_WK_CMD_LEFT",e[e.MAC_WK_CMD_RIGHT=93]="MAC_WK_CMD_RIGHT",e[e.WIN_IME=229]="WIN_IME",e[e.VK_NONAME=252]="VK_NONAME",e[e.PHANTOM=255]="PHANTOM"})(Ye||(Ye={}));var yo={};yo.arc=vt,yo.curve=Xt,yo.line=Yi,yo.lineOnAxis=De,yo.lineTo=Hs,yo.moveBy=pt,yo.moveTo=St,yo.point=Me;var mt={};mt.Coordinate=ye,mt.KeyCodes=Ye,mt.Rect=rt,mt.Size=Xe,mt.Svg=J,mt.aria=fr,mt.array=Nb,mt.browserEvents=go,mt.colour=ps,mt.deprecation=pb,mt.dom=Dt,mt.extensions=As,mt.idGenerator=mh,mt.math=$l,mt.object=bv,mt.parsing=Tr,mt.string=nn,mt.style=Mo,mt.svgMath=ui,mt.svgPaths=yo,mt.toolbox=Lo,mt.userAgent=FC,mt.xml=Xi;var _v=class extends nt{constructor(e,t,o){super(e,t,o),this.workspace=e,this.anchor=t,this.ownerRect=o,this.resizePointerMoveListener=this.resizePointerUpListener=null,this.textChangeListeners=[],this.sizeChangeListeners=[],this.text="",this.DEFAULT_SIZE=new Xe(160+nt.DOUBLE_BORDER,80+nt.DOUBLE_BORDER),this.MIN_SIZE=new Xe(45+nt.DOUBLE_BORDER,20+nt.DOUBLE_BORDER),this.editable=!0,Oe(this.svgRoot,"blocklyTextInputBubble"),{inputRoot:this.inputRoot,textArea:this.textArea}=this.createEditor(this.contentContainer),this.resizeGroup=this.createResizeHandle(this.svgRoot,e),this.setSize(this.DEFAULT_SIZE,!0)}getText(){return this.text}setText(e){this.text=e,this.textArea.value=e,this.onTextChange()}setEditable(e){(this.editable=e)?this.textArea.removeAttribute("readonly"):this.textArea.setAttribute("readonly","")}isEditable(){return this.editable}addTextChangeListener(e){this.textChangeListeners.push(e)}addSizeChangeListener(e){this.sizeChangeListeners.push(e)}createEditor(e){e=ie(J.FOREIGNOBJECT,{x:nt.BORDER_WIDTH,y:nt.BORDER_WIDTH},e);const t=document.createElementNS(Gs,"body");t.setAttribute("xmlns",Gs),t.className="blocklyMinimalBody";const o=document.createElementNS(Gs,"textarea");return o.className="blocklyTextarea blocklyText",o.setAttribute("dir",this.workspace.RTL?"RTL":"LTR"),t.appendChild(o),e.appendChild(t),this.bindTextAreaEvents(o),setTimeout(()=>{o.focus()},0),{inputRoot:e,textArea:o}}bindTextAreaEvents(e){H(e,"wheel",this,t=>{t.stopPropagation()}),H(e,"focus",this,this.onStartEdit,!0),H(e,"change",this,this.onTextChange)}createResizeHandle(e,t){return e=ie(J.IMAGE,{class:"blocklyResizeHandle",href:`${t.options.pathToMedia}resize-handle.svg`},e),H(e,"pointerdown",this,this.onResizePointerDown),e}setSize(e,t=!1){e.width=Math.max(e.width,this.MIN_SIZE.width),e.height=Math.max(e.height,this.MIN_SIZE.height);const o=e.width-nt.DOUBLE_BORDER,n=e.height-nt.DOUBLE_BORDER;this.inputRoot.setAttribute("width",`${o}`),this.inputRoot.setAttribute("height",`${n}`),this.resizeGroup.setAttribute("y",`${n}`),this.workspace.RTL?this.resizeGroup.setAttribute("x",`${-nt.DOUBLE_BORDER}`):this.resizeGroup.setAttribute("x",`${o}`),super.setSize(e,t),this.onSizeChange()}getSize(){return super.getSize()}onResizePointerDown(e){this.bringToFront(),pe(e)||(za(this.workspace,e,new ye(this.workspace.RTL?-this.getSize().width:this.getSize().width,this.getSize().height)),this.resizePointerUpListener=H(document,"pointerup",this,this.onResizePointerUp),this.resizePointerMoveListener=H(document,"pointermove",this,this.onResizePointerMove),this.workspace.hideChaff()),e.stopPropagation()}onResizePointerUp(e){Y(),this.resizePointerUpListener&&(V(this.resizePointerUpListener),this.resizePointerUpListener=null),this.resizePointerMoveListener&&(V(this.resizePointerMoveListener),this.resizePointerMoveListener=null)}onResizePointerMove(e){e=Ua(this.workspace,e),this.setSize(new Xe(this.workspace.RTL?-e.x:e.x,e.y),!1),this.onSizeChange()}onStartEdit(){this.bringToFront()&&this.textArea.focus()}onTextChange(){this.text=this.textArea.value;for(const e of this.textChangeListeners)e()}onSizeChange(){for(const e of this.sizeChangeListeners)e()}};Be(` +.blocklyTextInputBubble .blocklyTextarea { + background-color: var(--commentFillColour); + border: 0; + box-sizing: border-box; + display: block; + outline: 0; + padding: 5px; + resize: none; + width: 100%; + height: 100%; +} +`);var op={};op.register=Sd,op.unregister=A$;var ip=17,wv=160,kv=80,_o=class extends Ol{constructor(e){super(e),this.sourceBlock=e,this.textInputBubble=null,this.text="",this.bubbleSize=new Xe(wv,kv),this.bubbleVisiblity=!1}getType(){return _o.TYPE}initView(e){this.svgRoot||(super.initView(e),ie(J.CIRCLE,{class:"blocklyIconShape",r:"8",cx:"8",cy:"8"},this.svgRoot),ie(J.PATH,{class:"blocklyIconSymbol",d:"m6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.4050.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25-1.201,0.998 -1.201,1.528 -1.204,2.19z"},this.svgRoot),ie(J.RECT,{class:"blocklyIconSymbol",x:"6.8",y:"10.78",height:"2",width:"2"},this.svgRoot),Oe(this.svgRoot,"blockly-icon-comment"))}dispose(){super.dispose();let e;(e=this.textInputBubble)==null||e.dispose()}getWeight(){return _o.WEIGHT}getSize(){return new Xe(ip,ip)}applyColour(){super.applyColour();const e=this.sourceBlock.getColour();let t;(t=this.textInputBubble)==null||t.setColour(e)}updateEditable(){const e=this,t=()=>super.updateEditable;return ge.asyncExecutePromiseGeneratorFunction(function*(){t().call(e),e.bubbleIsVisible()&&(yield e.setBubbleVisible(!1),yield e.setBubbleVisible(!0))})}onLocationChange(e){super.onLocationChange(e),e=this.getAnchorLocation();let t;(t=this.textInputBubble)==null||t.setAnchorLocation(e)}setText(e){const t=this.text;z(new(ne(ee.BLOCK_CHANGE))(this.sourceBlock,"comment",null,t,e)),this.text=e;let o;(o=this.textInputBubble)==null||o.setText(this.text)}getText(){return this.text}setBubbleSize(e){this.bubbleSize=e;let t;(t=this.textInputBubble)==null||t.setSize(this.bubbleSize,!0)}getBubbleSize(){return this.bubbleSize}saveState(){return this.text?{text:this.text,pinned:this.bubbleIsVisible(),height:this.bubbleSize.height,width:this.bubbleSize.width}:null}loadState(e){let t;this.text=(t=e.text)!=null?t:"";let o,n;this.bubbleSize=new Xe((o=e.width)!=null?o:wv,(n=e.height)!=null?n:kv);let u;this.bubbleVisiblity=(u=e.pinned)!=null?u:!1,this.setBubbleVisible(this.bubbleVisiblity)}onClick(){super.onClick(),this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}onTextChange(){if(this.textInputBubble){var e=this.textInputBubble.getText();this.text!==e&&(z(new(ne(ee.BLOCK_CHANGE))(this.sourceBlock,"comment",null,this.text,e)),this.text=e)}}onSizeChange(){this.textInputBubble&&(this.bubbleSize=this.textInputBubble.getSize())}bubbleIsVisible(){return this.bubbleVisiblity}setBubbleVisible(e){const t=this;return ge.asyncExecutePromiseGeneratorFunction(function*(){t.bubbleVisiblity!==e&&(t.bubbleVisiblity=e,yield Ts(),!t.sourceBlock.rendered||t.sourceBlock.isInFlyout||t.sourceBlock.isInsertionMarker()||(e?(t.sourceBlock.isEditable()?t.showEditableBubble():t.showNonEditableBubble(),t.applyColour()):t.hideBubble(),z(new(ne(ee.BUBBLE_OPEN))(t.sourceBlock,e,"comment"))))})}showEditableBubble(){this.createBubble();let e;(e=this.textInputBubble)==null||e.addTextChangeListener(()=>this.onTextChange());let t;(t=this.textInputBubble)==null||t.addSizeChangeListener(()=>this.onSizeChange())}showNonEditableBubble(){this.createBubble();let e;(e=this.textInputBubble)==null||e.setEditable(!1)}createBubble(){this.textInputBubble=new _v(this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect()),this.textInputBubble.setText(this.getText()),this.textInputBubble.setSize(this.bubbleSize,!0)}hideBubble(){let e;(e=this.textInputBubble)==null||e.dispose(),this.textInputBubble=null}getAnchorLocation(){const e=ip/2;return ye.sum(this.workspaceLocation,new ye(e,e))}getBubbleOwnerRect(){return this.sourceBlock.getBoundingRectangleWithoutChildren()}};_o.TYPE=Ct.COMMENT,_o.WEIGHT=3,Sd(_o.TYPE,_o);var Cv=class extends Error{constructor(e){super(`Tried to append an icon of type ${e.getType()} when an icon of that type already exists on the block. Use getIcon to access the existing icon.`),this.icon=e}},Tv={};Tv.DuplicateIconType=Cv;var Sv=class extends nt{constructor(e,t,o,n){super(t,o,n),this.text=e,this.workspace=t,this.anchor=o,this.ownerRect=n,this.paragraph=this.stringToSvg(e,this.contentContainer),this.updateBubbleSize()}getText(){return this.text}setText(e){this.text=e,Ze(this.paragraph),this.paragraph=this.stringToSvg(e,this.contentContainer),this.updateBubbleSize()}stringToSvg(e,t){return t=this.createParagraph(t),e=this.createTextFragments(t,e),this.workspace.RTL&&this.rightAlignTextFragments(t.getBBox().width,e),t}createParagraph(e){return ie(J.G,{class:"blocklyText blocklyBubbleText blocklyNoPointerEvents",transform:`translate(0,${nt.BORDER_WIDTH})`,style:`direction: ${this.workspace.RTL?"rtl":"ltr"}`},e)}createTextFragments(e,t){let o=1;return t.split(` +`).map(n=>{const u=ie(J.TEXT,{y:`${o}em`,x:nt.BORDER_WIDTH},e);return n=document.createTextNode(n),u.appendChild(n),o+=1,u})}rightAlignTextFragments(e,t){for(const o of t)o.setAttribute("text-anchor","start"),o.setAttribute("x",`${e+nt.BORDER_WIDTH}`)}updateBubbleSize(){const e=this.paragraph.getBBox();this.setSize(new Xe(e.width+2*nt.BORDER_WIDTH,e.height+2*nt.BORDER_WIDTH),!0)}},np=17,wo=class extends Ol{constructor(e){super(e),this.sourceBlock=e,this.textMap=new Map,this.textBubble=null}getType(){return wo.TYPE}initView(e){this.svgRoot||(super.initView(e),ie(J.PATH,{class:"blocklyIconShape",d:"M2,15Q-1,15 0.5,12L6.5,1.7Q8,-1 9.5,1.7L15.5,12Q17,15 14,15z"},this.svgRoot),ie(J.PATH,{class:"blocklyIconSymbol",d:"m7,4.8v3.16l0.27,2.27h1.46l0.27,-2.27v-3.16z"},this.svgRoot),ie(J.RECT,{class:"blocklyIconSymbol",x:"7",y:"11",height:"2",width:"2"},this.svgRoot),Oe(this.svgRoot,"blockly-icon-warning"))}dispose(){super.dispose();let e;(e=this.textBubble)==null||e.dispose()}getWeight(){return wo.WEIGHT}getSize(){return new Xe(np,np)}applyColour(){super.applyColour();let e;(e=this.textBubble)==null||e.setColour(this.sourceBlock.getColour())}updateCollapsed(){}isShownWhenCollapsed(){return!0}onLocationChange(e){super.onLocationChange(e);let t;(t=this.textBubble)==null||t.setAnchorLocation(this.getAnchorLocation())}addMessage(e,t){if(this.textMap.get(t)===e)return this;e?this.textMap.set(t,e):this.textMap.delete(t);let o;return(o=this.textBubble)==null||o.setText(this.getText()),this}getText(){return[...this.textMap.values()].join(` +`)}onClick(){super.onClick(),this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}bubbleIsVisible(){return!!this.textBubble}setBubbleVisible(e){const t=this;return ge.asyncExecutePromiseGeneratorFunction(function*(){if(t.bubbleIsVisible()!==e){if(yield Ts(),e)t.textBubble=new Sv(t.getText(),t.sourceBlock.workspace,t.getAnchorLocation(),t.getBubbleOwnerRect()),t.applyColour();else{let o;(o=t.textBubble)==null||o.dispose(),t.textBubble=null}z(new(ne(ee.BUBBLE_OPEN))(t.sourceBlock,e,"warning"))}})}getAnchorLocation(){const e=np/2;return ye.sum(this.workspaceLocation,new ye(e,e))}getBubbleOwnerRect(){const e=this.sourceBlock.getSvgRoot().getBBox();return new rt(e.y,e.y+e.height,e.x,e.x+e.width)}};wo.TYPE=Ct.WARNING,wo.WEIGHT=2;var jo={};jo.CommentIcon=_o,jo.Icon=Ol,jo.IconType=Ct,jo.MutatorIcon=i.MutatorIcon$$module$build$src$core$icons$mutator_icon,jo.WarningIcon=wo,jo.exceptions=Tv,jo.registry=op,i.Names$$module$build$src$core$names=class{constructor(e,t){this.db=new Map,this.dbReverse=new Set,this.variableMap=null,this.variablePrefix=t||"",this.reservedWords=new Set(e?e.split(","):[])}reset(){this.db.clear(),this.dbReverse.clear(),this.variableMap=null}setVariableMap(e){this.variableMap=e}getNameForUserVariable(e){return this.variableMap?(e=this.variableMap.getVariableById(e))?e.name:null:(console.warn(`Deprecated call to Names.prototype.getName without defining a variable map. To fix, add the following code in your generator's init() function: +Blockly.YourGeneratorName.nameDB_.setVariableMap(workspace.getVariableMap());`),null)}populateVariables(e){e=i.allUsedVarModels$$module$build$src$core$variables(e);for(let t=0;trect,`,`${e} .blocklyEditableText>rect {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"fill-opacity: .6;","stroke: none;","}",`${e} .blocklyNonEditableText>text,`,`${e} .blocklyEditableText>text {`,"fill: #000;","}",`${e} .blocklyFlyoutLabelText {`,"fill: #000;","}",`${e} .blocklyText.blocklyBubbleText {`,"fill: #000;","}",`${e} .blocklyEditableText:not(.editing):hover>rect {`,"stroke: #fff;","stroke-width: 2;","}",`${e} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,"}",`${e} .blocklySelected>.blocklyPath {`,"stroke: #fc3;","stroke-width: 3px;","}",`${e} .blocklyHighlightedConnectionPath {`,"stroke: #fc3;","}",`${e} .blocklyReplaceable .blocklyPath {`,"fill-opacity: .5;","}",`${e} .blocklyReplaceable .blocklyPathLight,`,`${e} .blocklyReplaceable .blocklyPathDark {`,"display: none;","}",`${e} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"]}},Bl=class{constructor(e,t){this.inlinePath_=this.outlinePath_="",this.block_=e,this.info_=t,this.topLeft_=e.getRelativeToSurfaceXY(),this.constants_=t.getRenderer().getConstants()}draw(){this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights(),this.block_.pathObject.setPath(this.outlinePath_+` +`+this.inlinePath_),this.info_.RTL&&this.block_.pathObject.flipRTL(),this.recordSizeOnBlock_()}recordSizeOnBlock_(){this.block_.height=this.info_.height,this.block_.width=this.info_.widthWithChildren,this.block_.childlessWidth=this.info_.width}drawOutline_(){this.drawTop_();for(let e=1;ee||e>this.fieldRow.length)throw Error("index "+e+" out of bounds.");return(t||t===""&&o)&&(typeof t=="string"&&(t=i.fromJson$$module$build$src$core$field_registry({type:"field_label",text:t})),t.setSourceBlock(this.sourceBlock),this.sourceBlock.initialized&&this.initField(t),t.name=o,t.setVisible(this.isVisible()),t.prefixField&&(e=this.insertFieldAt(e,t.prefixField)),this.fieldRow.splice(e,0,t),e++,t.suffixField&&(e=this.insertFieldAt(e,t.suffixField)),this.sourceBlock.rendered&&this.sourceBlock.queueRender()),e}removeField(e,t){for(let o=0,n;n=this.fieldRow[o];o++)if(n.name===e)return n.dispose(),this.fieldRow.splice(o,1),this.sourceBlock.rendered&&this.sourceBlock.queueRender(),!0;if(t)return!1;throw Error('Field "'+e+'" not found.')}isVisible(){return this.visible}setVisible(e){let t=[];if(this.visible===e)return t;this.visible=e;for(let n=0,u;u=this.fieldRow[n];n++)u.setVisible(e);if(this.connection){var o=this.connection;e?t=o.startTrackingAll():o.stopTrackingAll(),(o=o.targetBlock())&&(o.getSvgRoot().style.display=e?"block":"none")}return t}markDirty(){for(let e=0,t;t=this.fieldRow[e];e++)t.markDirty()}setCheck(e){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setCheck(e),this}setAlign(e){return this.align=e,this.sourceBlock.rendered&&this.sourceBlock.queueRender(),this}setShadowDom(e){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setShadowDom(e),this}getShadowDom(){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.getShadowDom()}init(){for(const e of this.fieldRow)e.init()}initModel(){for(const e of this.fieldRow)e.initModel()}initField(e){this.sourceBlock.rendered?e.init():e.initModel()}dispose(){for(let e=0,t;t=this.fieldRow[e];e++)t.dispose();this.connection&&this.connection.dispose()}makeConnection(e){return this.sourceBlock.makeConnection_(e)}},Ks=class extends pn{constructor(e,t){super(e,t),this.name=e,this.type=i.inputTypes$$module$build$src$core$inputs$input_types.DUMMY}},Co=class extends pn{constructor(e,t){super(e,t),this.name=e,this.type=i.inputTypes$$module$build$src$core$inputs$input_types.END_ROW}},ls=class extends pn{constructor(e,t){if(!e)throw Error("Statement inputs must have a non-empty name");super(e,t),this.name=e,this.type=i.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT,this.connection=this.makeConnection(xe.NEXT_STATEMENT)}},Rv;i.ValueInput$$module$build$src$core$inputs$value_input=class extends pn{constructor(e,t){if(!e)throw Error("Value inputs must have a non-empty name");super(e,t),this.name=e,this.type=i.inputTypes$$module$build$src$core$inputs$input_types.VALUE,this.connection=this.makeConnection(xe.INPUT_VALUE)}},Rv={},Rv.ValueInput=i.ValueInput$$module$build$src$core$inputs$value_input;var Or=class{constructor(e,t){this.statementEdge=this.width=this.widthWithChildren=this.height=0,this.rows=[],this.inputRows=[],this.startY=this.startX=0,this.renderer_=e,this.block_=t,this.constants_=this.renderer_.getConstants(),this.outputConnection=t.outputConnection?new Av(this.constants_,t.outputConnection):null,this.isInline=t.getInputsInline()&&!t.isCollapsed(),this.isCollapsed=t.isCollapsed(),this.isInsertionMarker=t.isInsertionMarker(),this.RTL=t.RTL,this.topRow=new dp(this.constants_),this.bottomRow=new rp(this.constants_)}getRenderer(){return this.renderer_}measure(){this.createRows_(),this.addElemSpacing_(),this.addRowSpacing_(),this.computeBounds_(),this.alignRowElements_(),this.finalize_()}createRows_(){this.populateTopRow_(),this.rows.push(this.topRow);let e=new cp(this.constants_);this.inputRows.push(e);var t=this.block_.getIcons();for(let o=0,n;n=t[o];o++){const u=new Iv(this.constants_,n);this.isCollapsed&&!n.isShownWhenCollapsed()||e.elements.push(u)}t=void 0;for(let o=0,n;n=this.block_.inputList[o];o++)if(n.isVisible()){this.shouldStartNewRow_(n,t)&&(this.rows.push(e),e=new cp(this.constants_),this.inputRows.push(e));for(let u=0,g;g=n.fieldRow[u];u++)e.elements.push(new hn(this.constants_,g,n));this.addInput_(n,e),t=n}this.isCollapsed&&(e.hasJaggedEdge=!0,e.elements.push(new xv(this.constants_))),(e.elements.length||e.hasDummyInput)&&this.rows.push(e),this.populateBottomRow_(),this.rows.push(this.bottomRow)}populateTopRow_(){var e=!!this.block_.previousConnection;const t=(this.block_.hat?this.block_.hat==="cap":this.constants_.ADD_START_HATS)&&!this.outputConnection&&!e;let o=this.topRow.hasLeftSquareCorner(this.block_)?Ar:Dr;this.topRow.elements.push(new o(this.constants_)),t?(e=new ap(this.constants_),this.topRow.elements.push(e),this.topRow.capline=e.ascenderHeight):e&&(this.topRow.hasPreviousConnection=!0,this.topRow.connection=new Ov(this.constants_,this.block_.previousConnection),this.topRow.elements.push(this.topRow.connection)),this.block_.inputList.length&&this.block_.inputList[0]instanceof ls&&!this.block_.isCollapsed()?this.topRow.minHeight=this.constants_.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT:this.topRow.minHeight=this.constants_.TOP_ROW_MIN_HEIGHT,o=this.topRow.hasRightSquareCorner(this.block_)?Ar:Dr,this.topRow.elements.push(new o(this.constants_,"right"))}populateBottomRow_(){this.bottomRow.hasNextConnection=!!this.block_.nextConnection,this.bottomRow.minHeight=this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1]instanceof ls?this.constants_.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT:this.constants_.BOTTOM_ROW_MIN_HEIGHT,this.bottomRow.hasLeftSquareCorner(this.block_)?this.bottomRow.elements.push(new Ar(this.constants_)):this.bottomRow.elements.push(new Dr(this.constants_)),this.bottomRow.hasNextConnection&&(this.bottomRow.connection=new Dv(this.constants_,this.block_.nextConnection),this.bottomRow.elements.push(this.bottomRow.connection)),this.bottomRow.hasRightSquareCorner(this.block_)?this.bottomRow.elements.push(new Ar(this.constants_,"right")):this.bottomRow.elements.push(new Dr(this.constants_,"right"))}addInput_(e,t){this.isInline&&e instanceof i.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new lp(this.constants_,e)),t.hasInlineInput=!0):e instanceof ls?(t.elements.push(new xr(this.constants_,e)),t.hasStatement=!0):e instanceof i.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new Ll(this.constants_,e)),t.hasExternalInput=!0):(e instanceof Ks||e instanceof Co)&&(t.minHeight=Math.max(t.minHeight,e.getSourceBlock()&&e.getSourceBlock().isShadow()?this.constants_.DUMMY_INPUT_SHADOW_MIN_HEIGHT:this.constants_.DUMMY_INPUT_MIN_HEIGHT),t.hasDummyInput=!0),t.align===null&&(t.align=e.align)}shouldStartNewRow_(e,t){return t?t instanceof Co||e instanceof ls||t instanceof ls?!0:e instanceof i.ValueInput$$module$build$src$core$inputs$value_input||e instanceof Ks||t instanceof i.ValueInput$$module$build$src$core$inputs$value_input?!this.isInline:!1:!1}addElemSpacing_(){for(let e=0,t;t=this.rows[e];e++){const o=t.elements;if(t.elements=[],t.startsWithElemSpacer()&&t.elements.push(new as(this.constants_,this.getInRowSpacing_(null,o[0]))),o.length){for(let n=0;ne.disposeInternal()),this.inputList.forEach(e=>e.dispose()),this.inputList.length=0,this.getConnections_(!0).forEach(e=>e.dispose()),this.disposed=!0}isDeadOrDying(){return this.disposing||this.disposed}initModel(){if(!this.initialized){for(const e of this.inputList)e.initModel();this.initialized=!0}}unplug(e){this.outputConnection&&this.unplugFromRow(e),this.previousConnection&&this.unplugFromStack(e)}unplugFromRow(e){let t=null,o;(o=this.outputConnection)!=null&&o.isConnected()&&(t=this.outputConnection.targetConnection,this.outputConnection.disconnect()),t&&e&&(e=this.getOnlyValueConnection())&&e.isConnected()&&!e.targetBlock().isShadow()&&(e=e.targetConnection,e==null||e.disconnect(),this.workspace.connectionChecker.canConnect(e,t,!1)?t.connect(e):e==null||e.onFailedConnect(t))}getOnlyValueConnection(){let e=null;for(let t=0;t(n=n+(o==="("||u===")"?"":" ")+u,o=u[u.length-1],n),""),t=t.trim()||"???",e&&t.length>e&&(t=t.substring(0,e-3)+"..."),t}toTokens(e="?"){const t=[];for(const n of this.inputList)if(n.name!=$r){for(const u of n.fieldRow)t.push(u.getText());if(n.connection){const u=n.connection.targetBlock();if(u){var o=n.connection;let g=o.getCheck();!g&&o.targetConnection&&(g=o.targetConnection.getCheck()),(o=!!g&&(g.includes("Boolean")||g.includes("Number")))&&t.push("("),t.push(...u.toTokens(e)),o&&t.push(")")}else t.push(e)}}return t}appendValueInput(e){return this.appendInput(new i.ValueInput$$module$build$src$core$inputs$value_input(e,this))}appendStatementInput(e){return this.statementInputCount++,this.appendInput(new ls(e,this))}appendDummyInput(e=""){return this.appendInput(new Ks(e,this))}appendEndRowInput(e=""){return this.appendInput(new Co(e,this))}appendInput(e){return this.inputList.push(e),e}appendInputFromRegistry(e,t){return(e=p($e.INPUT,e,!1))?this.appendInput(new e(t,this)):null}jsonInit(e){var t=e.type?'Block "'+e.type+'": ':"";if(e.output&&e.previousStatement)throw Error(t+"Must not have both an output and a previousStatement.");for(var o=0;e["args"+o];){if(e["message"+o]===void 0)throw Error(t+`args${o} must have a corresponding message (message${o}).`);o++}if(e.style&&e.style.hat&&(this.hat=e.style.hat,e.style=null),e.style&&e.colour)throw Error(t+"Must not have both a colour and a style.");for(e.style?this.jsonInitStyle(e,t):this.jsonInitColour(e,t),o=0;e["message"+o]!==void 0;)this.interpolate(e["message"+o],e["args"+o]||[],e["implicitAlign"+o]||e["lastDummyAlign"+o],t),o++;if(e.inputsInline!==void 0&&(i.disable$$module$build$src$core$events$utils(),this.setInputsInline(e.inputsInline),i.enable$$module$build$src$core$events$utils()),e.output!==void 0&&this.setOutput(!0,e.output),e.outputShape!==void 0&&this.setOutputShape(e.outputShape),e.previousStatement!==void 0&&this.setPreviousStatement(!0,e.previousStatement),e.nextStatement!==void 0&&this.setNextStatement(!0,e.nextStatement),e.tooltip!==void 0&&(o=bt(e.tooltip),this.setTooltip(o)),e.enableContextMenu!==void 0&&(this.contextMenu=!!e.enableContextMenu),e.suppressPrefixSuffix!==void 0&&(this.suppressPrefixSuffix=!!e.suppressPrefixSuffix),e.helpUrl!==void 0&&(o=bt(e.helpUrl),this.setHelpUrl(o)),typeof e.extensions=="string"&&(console.warn(t+"JSON attribute 'extensions' should be an array of strings. Found raw string in JSON for '"+e.type+"' block."),e.extensions=[e.extensions]),e.mutator!==void 0&&Va(e.mutator,this,!0),e=e.extensions,Array.isArray(e))for(t=0;tg||g>t)throw Error('Block "'+this.type+'": Message index %'+g+" out of range.");if(o[g])throw Error('Block "'+this.type+'": Message index %'+g+" duplicated.");o[g]=!0,n++}}if(n!==t)throw Error('Block "'+this.type+'": Message does not reference all '+t+" arg(s).")}interpolateArguments(e,t,o){const n=[];for(let g=0;g=this.inputList.length)throw RangeError("Input index "+e+" out of bounds.");if(t>this.inputList.length)throw RangeError("Reference input "+t+" out of bounds.");const o=this.inputList[e];this.inputList.splice(e,1),et.getWeight()-o.getWeight()),e}removeIcon(e){if(!this.hasIcon(e))return!1;let t;return(t=this.getIcon(e))==null||t.dispose(),this.icons=this.icons.filter(o=>!o.getType().equals(e)),!0}hasIcon(e){return this.icons.some(t=>t.getType().equals(e))}getIcon(e){return e instanceof Ct?this.icons.find(t=>t.getType().equals(e)):this.icons.find(t=>t.getType().toString()===e)}getIcons(){return[...this.icons]}getRelativeToSurfaceXY(){return this.xy}moveBy(e,t,o){if(this.parentBlock_)throw Error("Block has parent");const n=new(ne(ee.BLOCK_MOVE))(this);o&&n.setReason(o),this.xy.translate(e,t),n.recordNew(),z(n)}makeConnection_(e){return new Qe(this,e)}allInputsFilled(e){if(e===void 0&&(e=!0),!e&&this.isShadow())return!1;for(let o=0,n;n=this.inputList[o];o++)if(n.connection){var t=n.connection.targetBlock();if(!t||!t.allInputsFilled(e))return!1}return(t=this.getNextBlock())?t.allInputsFilled(e):!0}toDevString(){let e=this.type?'"'+this.type+'" block':"Block";return this.id&&(e+=' (id="'+this.id+'")'),e}};Uo.COLLAPSED_INPUT_NAME=$r,Uo.COLLAPSED_FIELD_NAME=gl;var ms=class{constructor(e,t,o,n){this.workspace=e,this.targetWorkspace=t,this.isFlyoutLabel=n,this.onMouseUpWrapper=null,this.height=this.width=0,this.cursorSvg=this.svgText=this.svgGroup=null,this.text=o.text,this.position=new ye(0,0),this.callbackKey=o.callbackKey||o.callbackkey,this.cssClass=o["web-class"]||null,this.info=o}createDom(){var e=this.isFlyoutLabel?"blocklyFlyoutLabel":"blocklyFlyoutButton";this.cssClass&&(e+=" "+this.cssClass),this.svgGroup=ie(J.G,{class:e},this.workspace.getCanvas());let t;this.isFlyoutLabel||(t=ie(J.RECT,{class:"blocklyFlyoutButtonShadow",rx:ms.BORDER_RADIUS,ry:ms.BORDER_RADIUS,x:1,y:1},this.svgGroup)),e=ie(J.RECT,{class:this.isFlyoutLabel?"blocklyFlyoutLabelBackground":"blocklyFlyoutButtonBackground",rx:ms.BORDER_RADIUS,ry:ms.BORDER_RADIUS},this.svgGroup);const o=ie(J.TEXT,{class:this.isFlyoutLabel?"blocklyFlyoutLabelText":"blocklyText",x:0,y:0,"text-anchor":"middle"},this.svgGroup);var n=bt(this.text);this.workspace.RTL&&(n+="‏"),o.textContent=n,this.isFlyoutLabel&&(this.svgText=o,this.workspace.getThemeManager().subscribe(this.svgText,"flyoutForegroundColour","fill"));const u=Fs(o,"fontSize"),g=Fs(o,"fontWeight"),I=Fs(o,"fontFamily");if(this.width=Bs(o,u,g,I),n=ro(n,u,g,I),this.height=n.height,!this.isFlyoutLabel){this.width+=2*ms.TEXT_MARGIN_X,this.height+=2*ms.TEXT_MARGIN_Y;let L;(L=t)==null||L.setAttribute("width",String(this.width));let le;(le=t)==null||le.setAttribute("height",String(this.height))}return e.setAttribute("width",String(this.width)),e.setAttribute("height",String(this.height)),o.setAttribute("x",String(this.width/2)),o.setAttribute("y",String(this.height/2-n.height/2+n.baseline)),this.updateTransform(),this.onMouseUpWrapper=H(this.svgGroup,"pointerup",this,this.onMouseUp),this.svgGroup}show(){this.updateTransform(),this.svgGroup.setAttribute("display","block")}updateTransform(){this.svgGroup.setAttribute("transform","translate("+this.position.x+","+this.position.y+")")}moveTo(e,t){this.position.x=e,this.position.y=t,this.updateTransform()}isLabel(){return this.isFlyoutLabel}getPosition(){return this.position}getButtonText(){return this.text}getTargetWorkspace(){return this.targetWorkspace}getWorkspace(){return this.workspace}dispose(){this.onMouseUpWrapper&&V(this.onMouseUpWrapper),this.svgGroup&&Ze(this.svgGroup),this.svgText&&this.workspace.getThemeManager().unsubscribe(this.svgText)}setCursorSvg(e){e?this.svgGroup&&(this.svgGroup.appendChild(e),this.cursorSvg=e):this.cursorSvg=null}setMarkerSvg(){throw Error("Attempted to set a marker on a button.")}onMouseUp(e){(e=this.targetWorkspace.getGesture(e))&&e.cancel(),this.isFlyoutLabel&&this.callbackKey?console.warn("Labels should not have callbacks. Label text: "+this.text):this.isFlyoutLabel||this.callbackKey&&this.targetWorkspace.getButtonCallback(this.callbackKey)?this.isFlyoutLabel||(e=this.targetWorkspace.getButtonCallback(this.callbackKey))&&e(this):console.warn("Buttons should have callbacks. Button text: "+this.text)}};ms.TEXT_MARGIN_X=5,ms.TEXT_MARGIN_Y=2,ms.BORDER_RADIUS=4,Be(` +.blocklyFlyoutButton { + fill: #888; + cursor: default; +} + +.blocklyFlyoutButtonShadow { + fill: #666; +} + +.blocklyFlyoutButton:hover { + fill: #aaa; +} + +.blocklyFlyoutLabel { + cursor: default; +} + +.blocklyFlyoutLabelBackground { + opacity: 0; +} +`);var de=class{constructor(e,t,o){if(this.wsCoordinate=null,!t)throw Error("Cannot create a node without a location.");this.type=e,this.isConnectionLocation=de.isConnectionType(e),this.location=t,this.processParams(o||null)}processParams(e){e&&e.wsCoordinate&&(this.wsCoordinate=e.wsCoordinate)}getLocation(){return this.location}getType(){return this.type}getWsCoordinate(){return this.wsCoordinate}isConnection(){return this.isConnectionLocation}findNextForInput(){var e=this.location.getParentInput();const t=e.getSourceBlock();for(e=t.inputList.indexOf(e),e+=1;et instanceof Uo&&u.block===t||t instanceof ms&&u.button===t);return 0>n?null:(o=o?n+1:n-1,o===-1||o===e.length?null:e[o])}findTopASTNodeForBlock(e){const t=rr(e);return t?de.createConnectionNode(t):de.createBlockNode(e)}getOutAstNodeForBlock(e){if(!e)return null;e=e.getTopStackBlock();const t=rr(e);return t&&t.targetConnection&&t.targetConnection.getParentInput()?de.createInputNode(t.targetConnection.getParentInput()):de.createStackNode(e)}findFirstFieldOrInput(e){e=e.inputList;for(let t=0;t{Ga(o.getSourceBlock()),setTimeout(()=>{n.bringToFront()},0)})}}update(e,t){const o=this.getCandidate(e);((this.wouldDeleteBlock=this.shouldDelete(!!o,t))||this.shouldUpdatePreviews(o,e))&&(i.disable$$module$build$src$core$events$utils(),this.maybeHidePreview(o),this.maybeShowPreview(o),i.enable$$module$build$src$core$events$utils())}createMarkerBlock(e){i.disable$$module$build$src$core$events$utils();let t;try{const o=os(e,{addCoordinates:!1,addInputBlocks:!1,addNextBlocks:!1,doFullSerialization:!1});if(!o)throw Error(`Failed to serialize source block. ${e.toDevString()}`);t=lo(o,this.workspace);for(const n of t.getDescendants(!1))n.setInsertionMarker(!0);t.initSvg(),t.getSvgRoot().setAttribute("visibility","hidden")}finally{i.enable$$module$build$src$core$events$utils()}return t}initAvailableConnections(){const e=this.topBlock.getConnections_(!1),t=this.topBlock.lastConnectionInStack(!0);return t&&t!==this.topBlock.nextConnection&&(e.push(t),this.lastOnStack=t),e}shouldUpdatePreviews(e,t){if(!e)return!!this.activeCandidate;if(!this.activeCandidate)return!0;const{local:o,closest:n}=this.activeCandidate;if(n===e.closest&&o===e.local)return!1;const u=o.x+t.x-n.x;return t=o.y+t.y-n.y,e.radius{let le;(le=n)==null||le.positionNearConnection(L,g,I);let Ee;(Ee=n)==null||Ee.getSvgRoot().setAttribute("visibility","visible")}),this.markerConnection=u}hideInsertionMarker(){if(this.markerConnection){var e=this.markerConnection,t=e.getSourceBlock(),o=t.outputConnection,n;if((n=t.previousConnection)!=null&&n.targetConnection||o!=null&&o.targetConnection)t.unplug(!0);else{let u;(u=e.targetBlock())==null||u.unplug(!1)}if(e.targetConnection)throw Error("markerConnection still connected at the end of disconnectInsertionMarker");this.markerConnection=null,(e=t.getSvgRoot())&&e.setAttribute("visibility","hidden")}}showInsertionInputOutline(e){e=e.closest,this.highlightedBlock=e.getSourceBlock(),this.highlightedBlock.highlightShapeForInput(e,!0)}hideInsertionInputOutline(){if(this.highlightedBlock){if(!this.activeCandidate)throw Error("Cannot hide the insertion marker outline because there is no active candidate");this.highlightedBlock.highlightShapeForInput(this.activeCandidate.closest,!1),this.highlightedBlock=null}}showReplacementFade(e){if(this.fadedBlock=e.closest.targetBlock(),!this.fadedBlock)throw Error("Cannot show the replacement fade because the closest connection does not have a target block");this.fadedBlock.fadeForReplacement(!0)}hideReplacementFade(){this.fadedBlock&&(this.fadedBlock.fadeForReplacement(!1),this.fadedBlock=null)}getInsertionMarkers(){const e=[];return this.firstMarker&&e.push(this.firstMarker),this.lastMarker&&e.push(this.lastMarker),e}disposeInsertionMarker(e){if(e){i.disable$$module$build$src$core$events$utils();try{e.dispose()}finally{i.enable$$module$build$src$core$events$utils()}}}};(function(e){e=e.PREVIEW_TYPE||(e.PREVIEW_TYPE={}),e[e.INSERTION_MARKER=0]="INSERTION_MARKER",e[e.INPUT_OUTLINE=1]="INPUT_OUTLINE",e[e.REPLACEMENT_FADE=2]="REPLACEMENT_FADE"})(fs||(fs={})),fs.PREVIEW_TYPE;var jl=class{constructor(e){this.overrides=null,this.name=e}getClassName(){return this.name+"-renderer"}init(e,t){this.constants_=this.makeConstants_(),t&&(this.overrides=t,Object.assign(this.constants_,t)),this.constants_.setTheme(e),this.constants_.init()}createDom(e,t){this.constants_.createDom(e,this.name+"-"+t.name,"."+this.getClassName()+"."+t.getClassName())}refreshDom(e,t){const o=this.getConstants();o.dispose(),this.constants_=this.makeConstants_(),this.overrides&&Object.assign(this.constants_,this.overrides),this.constants_.randomIdentifier=o.randomIdentifier,this.constants_.setTheme(t),this.constants_.init(),this.createDom(e,t)}dispose(){this.constants_&&this.constants_.dispose()}makeConstants_(){return new Pl}makeRenderInfo_(e){return new Or(this,e)}makeDrawer_(e,t){return new Bl(e,t)}makeMarkerDrawer(e,t){return new gp(e,this.getConstants(),t)}makePathObject(e,t){return new Fl(e,t,this.constants_)}getConstants(){return this.constants_}shouldHighlightConnection(e){return!0}orphanCanConnectAtEnd(e,t,o){return!!Qe.getConnectionForOrphanedConnection(e,o===xe.OUTPUT_VALUE?t.outputConnection:t.previousConnection)}getConnectionPreviewMethod(e,t,o){return w("getConnectionPreviewMethod","v10","v12","an IConnectionPreviewer, if it fulfills your use case."),t.type===xe.OUTPUT_VALUE||t.type===xe.PREVIOUS_STATEMENT?!e.isConnected()||this.orphanCanConnectAtEnd(o,e.targetBlock(),t.type)?fs.PREVIEW_TYPE.INSERTION_MARKER:fs.PREVIEW_TYPE.REPLACEMENT_FADE:fs.PREVIEW_TYPE.INSERTION_MARKER}render(e){const t=this.makeRenderInfo_(e);t.measure(),this.makeDrawer_(e,t).draw()}},ot={};ot.BottomRow=rp,ot.Connection=ko,ot.ConstantProvider=Pl,ot.Drawer=Bl,ot.ExternalValueInput=Ll,ot.Field=hn,ot.Hat=ap,ot.Icon=Iv,ot.InRowSpacer=as,ot.InlineInput=lp,ot.InputConnection=zo,ot.InputRow=cp,ot.JaggedEdge=xv,ot.MarkerSvg=gp,ot.Measurable=Vs,ot.NextConnection=Dv,ot.OutputConnection=Av,ot.PathObject=Fl,ot.PreviousConnection=Ov,ot.RenderInfo=Or,ot.Renderer=jl,ot.RoundCorner=Dr,ot.Row=Ir,ot.SpacerRow=up,ot.SquareCorner=Ar,ot.StatementInput=xr,ot.TopRow=dp,ot.Types=F,ot.init=Rd,ot.register=ar,ot.unregister=z$;var Nv=class{constructor(e,t){this.workspace=e,this.theme=t,this.subscribedWorkspaces=[],this.componentDB=new Map}getTheme(){return this.theme}setTheme(e){var t=this.theme;this.theme=e,(e=this.workspace.getInjectionDiv())&&(t&&(t=t.getClassName())&&ze(e,t),(t=this.theme.getClassName())&&Oe(e,t));for(let o=0,n;n=this.subscribedWorkspaces[o];o++)n.refreshTheme();for(const[o,n]of this.componentDB)for(const u of n){e=u.element,t=u.propertyName;const g=this.theme&&this.theme.getComponentStyle(o);e.style.setProperty(t,g||"")}for(const o of this.subscribedWorkspaces)o.hideChaff()}subscribeWorkspace(e){this.subscribedWorkspaces.push(e)}unsubscribeWorkspace(e){if(!Ue(this.subscribedWorkspaces,e))throw Error("Cannot unsubscribe a workspace that hasn't been subscribed.")}subscribe(e,t,o){this.componentDB.has(t)||this.componentDB.set(t,[]),this.componentDB.get(t).push({element:e,propertyName:o}),t=this.theme&&this.theme.getComponentStyle(t),e.style.setProperty(o,t||"")}unsubscribe(e){if(e)for(const[t,o]of this.componentDB){for(let n=o.length-1;0<=n;n--)o[n].element===e&&o.splice(n,1);o.length||this.componentDB.delete(t)}}dispose(){this.subscribedWorkspaces.length=0,this.componentDB.clear()}},mp="VARIABLE_DYNAMIC",wi={CATEGORY_NAME:mp};wi.flyoutCategory=Qa,wi.flyoutCategoryBlocks=Pd,wi.onCreateVariableButtonClick_Colour=Ld,wi.onCreateVariableButtonClick_Number=Md,wi.onCreateVariableButtonClick_String=Nd;var Mv=30,ki=[];ki[xe.INPUT_VALUE]=xe.OUTPUT_VALUE,ki[xe.OUTPUT_VALUE]=xe.INPUT_VALUE,ki[xe.NEXT_STATEMENT]=xe.PREVIOUS_STATEMENT,ki[xe.PREVIOUS_STATEMENT]=xe.NEXT_STATEMENT;var fp="RENAME_VARIABLE_ID",$p="DELETE_VARIABLE_ID",Lv=class{canConnect(e,t,o,n){return this.canConnectWithReason(e,t,o,n)===Qe.CAN_CONNECT}canConnectWithReason(e,t,o,n){const u=this.doSafetyChecks(e,t);return u!==Qe.CAN_CONNECT?u:this.doTypeChecks(e,t)?o&&!this.doDragChecks(e,t,n||0)?Qe.REASON_DRAG_CHECKS_FAILED:Qe.CAN_CONNECT:Qe.REASON_CHECKS_FAILED}getErrorMessage(e,t,o){switch(e){case Qe.REASON_SELF_CONNECTION:return"Attempted to connect a block to itself.";case Qe.REASON_DIFFERENT_WORKSPACES:return"Blocks not on same workspace.";case Qe.REASON_WRONG_TYPE:return"Attempt to connect incompatible types.";case Qe.REASON_TARGET_NULL:return"Target connection is null.";case Qe.REASON_CHECKS_FAILED:return"Connection checks failed. "+(t+" expected "+t.getCheck()+", found "+o.getCheck());case Qe.REASON_SHADOW_PARENT:return"Connecting non-shadow to shadow block.";case Qe.REASON_DRAG_CHECKS_FAILED:return"Drag checks failed.";case Qe.REASON_PREVIOUS_AND_OUTPUT:return"Block would have an output and a previous connection.";default:return"Unknown connection failure: this should never happen!"}}doSafetyChecks(e,t){if(!e||!t)return Qe.REASON_TARGET_NULL;let o,n,u;return e.isSuperior()?(o=e.getSourceBlock(),n=t.getSourceBlock(),u=t):(n=e.getSourceBlock(),o=t.getSourceBlock(),u=e,e=t),o===n?Qe.REASON_SELF_CONNECTION:u.type!==ki[e.type]?Qe.REASON_WRONG_TYPE:o.workspace!==n.workspace?Qe.REASON_DIFFERENT_WORKSPACES:o.isShadow()&&!n.isShadow()?Qe.REASON_SHADOW_PARENT:u.type===xe.OUTPUT_VALUE&&n.previousConnection&&n.previousConnection.isConnected()||u.type===xe.PREVIOUS_STATEMENT&&n.outputConnection&&n.outputConnection.isConnected()?Qe.REASON_PREVIOUS_AND_OUTPUT:Qe.CAN_CONNECT}doTypeChecks(e,t){if(e=e.getCheck(),t=t.getCheck(),!e||!t)return!0;for(let o=0;oo||t.getSourceBlock().isInsertionMarker())return!1;switch(t.type){case xe.PREVIOUS_STATEMENT:return this.canConnectToPrevious_(e,t);case xe.OUTPUT_VALUE:if(t.isConnected()&&!t.targetBlock().isInsertionMarker()||e.isConnected())return!1;break;case xe.INPUT_VALUE:if(t.isConnected()&&!t.targetBlock().isMovable()&&!t.targetBlock().isShadow())return!1;break;case xe.NEXT_STATEMENT:if(t.isConnected()&&!e.getSourceBlock().nextConnection&&!t.targetBlock().isShadow()&&t.targetBlock().nextConnection||t.targetBlock()&&!t.targetBlock().isMovable()&&!t.targetBlock().isShadow())return!1;break;default:return!1}return!hr.includes(t)}canConnectToPrevious_(e,t){return e.targetConnection||hr.includes(t)?!1:t.targetConnection?(e=t.targetBlock(),e.isInsertionMarker()?!e.getPreviousBlock():!1):!0}};r($e.CONNECTION_CHECKER,Ws,Lv);var bp=class extends br{constructor(e){super(e),this.type=ee.VAR_DELETE,e&&(this.varType=e.type,this.varName=e.name)}toJson(){const e=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");return e.varType=this.varType,e.varName=this.varName,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new bp),t.varType=e.varType,t.varName=e.varName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");e?t.deleteVariableById(this.varId):t.createVariable(this.varName,this.varType,this.varId)}};r($e.EVENT,ee.VAR_DELETE,bp);var vp=class extends br{constructor(e,t){super(e),this.type=ee.VAR_RENAME,e&&(this.oldName=e.name,this.newName=typeof t>"u"?"":t)}toJson(){const e=super.toJson();if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson");return e.oldName=this.oldName,e.newName=this.newName,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new vp),t.oldName=e.oldName,t.newName=e.newName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson");e?t.renameVariableById(this.varId,this.newName):t.renameVariableById(this.varId,this.oldName)}};r($e.EVENT,ee.VAR_RENAME,vp);var yp=class{constructor(e){this.workspace=e,this.variableMap=new Map}clear(){for(const e of this.variableMap.values())for(;0{u&&t&&this.deleteVariableInternal(t,n)})):this.deleteVariableInternal(t,n)}else console.warn("Can't delete non-existent variable: "+e)}deleteVariableInternal(e,t){const o=i.getGroup$$module$build$src$core$events$utils();o||i.setGroup$$module$build$src$core$events$utils(!0);try{for(let n=0;ne.name)}getVariableUsesById(e){const t=[],o=this.workspace.getAllBlocks(!1);for(let n=0;n!o.isInsertionMarker())):[]}addTopComment(e){this.topComments.push(e),this.commentDB.has(e.id)&&console.warn('Overriding an existing comment on this workspace, with id "'+e.id+'"'),this.commentDB.set(e.id,e)}removeTopComment(e){if(!Ue(this.topComments,e))throw Error("Comment not present in workspace's list of top-most comments.");this.commentDB.delete(e.id)}getTopComments(e=!1){const t=[].concat(this.topComments);return e&&1!o.isInsertionMarker())}clear(){this.isClearing=!0;try{const e=i.getGroup$$module$build$src$core$events$utils();for(e||i.setGroup$$module$build$src$core$events$utils(!0);this.topBlocks.length;)this.topBlocks[0].dispose(!1);for(;this.topComments.length;)this.topComments[this.topComments.length-1].dispose();i.setGroup$$module$build$src$core$events$utils(e),this.variableMap.clear(),this.potentialVariableMap&&this.potentialVariableMap.clear()}finally{this.isClearing=!1}}renameVariableById(e,t){this.variableMap.renameVariableById(e,t)}createVariable(e,t,o){return this.variableMap.createVariable(e,t,o)}getVariableUsesById(e){return this.variableMap.getVariableUsesById(e)}deleteVariableById(e){this.variableMap.deleteVariableById(e)}getVariable(e,t){return this.variableMap.getVariable(e,t)}getVariableById(e){return this.variableMap.getVariableById(e)}getVariablesOfType(e){return this.variableMap.getVariablesOfType(e)}getVariableTypes(){return this.variableMap.getVariableTypes(this)}getAllVariables(){return this.variableMap.getAllVariables()}getAllVariableNames(){return this.variableMap.getAllVariableNames()}getWidth(){return 0}newBlock(e,t){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts")}newComment(e){throw Error("The implementation of newComment should be monkey-patched in by blockly.ts")}remainingCapacity(){return isNaN(this.options.maxBlocks)?1/0:this.options.maxBlocks-this.getAllBlocks(!1).length}remainingCapacityOfType(e){return this.options.maxInstances?(this.options.maxInstances[e]!==void 0?this.options.maxInstances[e]:1/0)-this.getBlocksByType(e,!1).length:1/0}isCapacityAvailable(e){if(!this.hasBlockLimits())return!0;let t=0;for(const o in e){if(e[o]>this.remainingCapacityOfType(o))return!1;t+=e[o]}return!(t>this.remainingCapacity())}hasBlockLimits(){return this.options.maxBlocks!==1/0||!!this.options.maxInstances}getUndoStack(){return this.undoStack_}getRedoStack(){return this.redoStack_}undo(e){var t=e?this.redoStack_:this.undoStack_,o=e?this.undoStack_:this.redoStack_;const n=t.pop();if(n){for(var u=[n];t.length&&n.group&&n.group===t[t.length-1].group;){const g=t.pop();g&&u.push(g)}for(t=0;tthis.MAX_UNDO&&0<=this.MAX_UNDO;)this.undoStack_.shift();for(let t=0;t!!t.getStyleName())),this.refreshToolboxSelection(),this.toolbox&&this.toolbox.refreshTheme(),this.isVisible()&&this.setVisible(!0);const e=new(ne(ee.THEME_CHANGE))(this.getTheme().name,this.id);z(e)}updateBlockStyles(e){for(let t=0,o;o=e[t];t++){const n=o.getStyleName();n&&o.setStyle(n)}}getInverseScreenCTM(){if(this.inverseScreenCTMDirty){const e=this.getParentSvg().getScreenCTM();e&&(this.inverseScreenCTM=e.inverse(),this.inverseScreenCTMDirty=!1)}return this.inverseScreenCTM}updateInverseScreenCTM(){this.inverseScreenCTMDirty=!0}isVisible(){return this.visible}getSvgXY(e){let t=0,o=0,n=1;(this.getCanvas().contains(e)||this.getBubbleCanvas().contains(e))&&(n=this.scale);do{const u=Wn(e);(e===this.getCanvas()||e===this.getBubbleCanvas())&&(n=1),t+=u.x*n,o+=u.y*n,e=e.parentNode}while(e&&e!==this.getParentSvg()&&e!==this.getInjectionDiv());return new ye(t,o)}getCachedParentSvgSize(){const e=this.cachedParentSvgSize;return new Xe(e.width,e.height)}getOriginOffsetInPixels(){return fa(this.getCanvas())}getInjectionDiv(){if(!this.injectionDiv){let e=this.svgGroup_;for(;e;){if((" "+(e.getAttribute("class")||"")+" ").includes(" injectionDiv ")){this.injectionDiv=e;break}e=e.parentNode}}return this.injectionDiv}getSvgGroup(){return this.svgGroup_}getBlockCanvas(){return this.getCanvas()}setResizeHandlerWrapper(e){this.resizeHandlerWrapper=e}createDom(e,t){return this.injectionDiv||(this.injectionDiv=t??null),this.svgGroup_=ie(J.G,{class:"blocklyWorkspace"}),e&&(this.svgBackground_=ie(J.RECT,{height:"100%",width:"100%",class:e},this.svgGroup_),e==="blocklyMainBackground"&&this.grid?this.svgBackground_.style.fill="url(#"+this.grid.getPatternId()+")":this.themeManager_.subscribe(this.svgBackground_,"workspaceBackgroundColour","fill")),this.layerManager=new qC(this),this.svgBlockCanvas_=this.layerManager.getBlockLayer(),this.svgBubbleCanvas_=this.layerManager.getBubbleLayer(),this.isFlyout||(H(this.svgGroup_,"pointerdown",this,this.onMouseDown,!1),this.dummyWheelListener=()=>{},document.body.addEventListener("wheel",this.dummyWheelListener),H(this.svgGroup_,"wheel",this,this.onMouseWheel)),this.options.hasCategories&&(this.toolbox=new(y($e.TOOLBOX,this.options,!0))(this)),this.grid&&this.grid.update(this.scale),this.recordDragTargets(),(e=y($e.CURSOR,this.options))&&this.markerManager.setCursor(new e),this.renderer.createDom(this.svgGroup_,this.getTheme()),this.svgGroup_}dispose(){if(this.rendered=!1,this.currentGesture_&&this.currentGesture_.cancel(),this.svgGroup_&&Ze(this.svgGroup_),this.toolbox&&(this.toolbox.dispose(),this.toolbox=null),this.flyout&&(this.flyout.dispose(),this.flyout=null),this.trashcan&&(this.trashcan.dispose(),this.trashcan=null),this.scrollbar&&(this.scrollbar.dispose(),this.scrollbar=null),this.zoomControls_&&this.zoomControls_.dispose(),this.audioManager&&this.audioManager.dispose(),this.grid&&(this.grid=null),this.renderer.dispose(),this.markerManager&&this.markerManager.dispose(),super.dispose(),this.themeManager_&&(this.themeManager_.unsubscribeWorkspace(this),this.themeManager_.unsubscribe(this.svgBackground_),this.options.parentWorkspace||this.themeManager_.dispose()),this.connectionDBList.length=0,this.toolboxCategoryCallbacks.clear(),this.flyoutButtonCallbacks.clear(),!this.options.parentWorkspace){const e=this.getParentSvg();e&&e.parentNode&&Ze(e.parentNode)}this.resizeHandlerWrapper&&(V(this.resizeHandlerWrapper),this.resizeHandlerWrapper=null),this.dummyWheelListener&&(document.body.removeEventListener("wheel",this.dummyWheelListener),this.dummyWheelListener=null)}addTrashcan(){this.trashcan=cs.newTrashcan(this);const e=this.trashcan.createDom();this.svgGroup_.insertBefore(e,this.getCanvas())}static newTrashcan(e){throw Error("The implementation of newTrashcan should be monkey-patched in by blockly.ts")}addZoomControls(){this.zoomControls_=new zb(this);const e=this.zoomControls_.createDom();this.svgGroup_.appendChild(e)}addFlyout(e){const t=new gs({parentWorkspace:this,rtl:this.RTL,oneBasedIndex:this.options.oneBasedIndex,horizontalLayout:this.horizontalLayout,renderer:this.options.renderer,rendererOverrides:this.options.rendererOverrides,move:{scrollbars:!0}});return t.toolboxPosition=this.options.toolboxPosition,this.flyout=this.horizontalLayout?new(y($e.FLYOUTS_HORIZONTAL_TOOLBOX,this.options,!0))(t):new(y($e.FLYOUTS_VERTICAL_TOOLBOX,this.options,!0))(t),this.flyout.autoClose=!1,this.flyout.getWorkspace().setVisible(!0),this.flyout.createDom(e)}getFlyout(e){return this.flyout||e?this.flyout:this.toolbox?this.toolbox.getFlyout():null}getToolbox(){return this.toolbox}updateScreenCalculations(){this.updateInverseScreenCTM(),this.recordDragTargets()}resizeContents(){this.resizesEnabled&&this.rendered&&(this.scrollbar&&this.scrollbar.resize(),this.updateInverseScreenCTM())}resize(){this.toolbox&&this.toolbox.position(),this.flyout&&this.flyout.position();const e=this.componentManager.getComponents(gt.Capability.POSITIONABLE,!0),t=this.getMetricsManager().getUiMetrics(),o=[];for(let n=0,u;u=e[n];n++){u.position(t,o);const g=u.getBoundingRectangle();g&&o.push(g)}this.scrollbar&&this.scrollbar.resize(),this.updateScreenCalculations()}updateScreenCalculationsIfScrolled(){const e=bu();ye.equals(this.lastRecordedPageScroll,e)||(this.lastRecordedPageScroll=e,this.updateScreenCalculations())}getLayerManager(){return this.layerManager}getCanvas(){return this.layerManager.getBlockLayer()}setCachedParentSvgSize(e,t){const o=this.getParentSvg();e!=null&&(this.cachedParentSvgSize.width=e,o.setAttribute("data-cached-width",`${e}`)),t!=null&&(this.cachedParentSvgSize.height=t,o.setAttribute("data-cached-height",`${t}`))}getBubbleCanvas(){return this.layerManager.getBubbleLayer()}getParentSvg(){if(!this.cachedParentSvg){let e=this.svgGroup_;for(;e;){if(e.tagName==="svg"){this.cachedParentSvg=e;break}e=e.parentNode}}return this.cachedParentSvg}maybeFireViewportChangeEvent(){if(C()){var e=this.scale,t=-this.scrollY,o=-this.scrollX;if(!(e===this.oldScale&&1>Math.abs(t-this.oldTop)&&1>Math.abs(o-this.oldLeft))){var n=new(ne(ee.VIEWPORT_CHANGE))(t,o,e,this.id,this.oldScale);this.oldScale=e,this.oldTop=t,this.oldLeft=o,z(n)}}}translate(e,t){let o;(o=this.layerManager)==null||o.translateLayers(new ye(e,t),this.scale);let n;(n=this.grid)==null||n.moveTo(e,t),this.maybeFireViewportChangeEvent()}getWidth(){const e=this.getMetrics();return e?e.viewWidth/this.scale:0}setVisible(e){this.visible=e,this.svgGroup_&&(this.scrollbar&&this.scrollbar.setContainerVisible(e),this.getFlyout()&&this.getFlyout().setContainerVisible(e),this.getParentSvg().style.display=e?"block":"none",this.toolbox&&this.toolbox.setVisible(e),e||this.hideChaff(!0))}render(){const e=this.getAllBlocks(!1);for(let t=e.length-1;0<=t;t--)e[t].queueRender();this.getTopBlocks().flatMap(t=>t.getDescendants(!1)).filter(t=>t.isInsertionMarker()).forEach(t=>t.queueRender()),Ts().then(()=>{this.markerManager.updateMarkers()})}highlightBlock(e,t){if(t===void 0){for(let o=0,n;n=this.highlightedBlocks[o];o++)n.setHighlighted(!1);this.highlightedBlocks.length=0}(e=e?this.getBlockById(e):null)&&((t=t===void 0||t)?this.highlightedBlocks.includes(e)||this.highlightedBlocks.push(e):Ue(this.highlightedBlocks,e),e.setHighlighted(t))}refreshToolboxSelection(){const e=this.isFlyout?this.targetWorkspace:this;e&&!e.currentGesture_&&e.toolbox&&e.toolbox.getFlyout()&&e.toolbox.refreshSelection()}renameVariableById(e,t){super.renameVariableById(e,t),this.refreshToolboxSelection()}deleteVariableById(e){super.deleteVariableById(e),this.refreshToolboxSelection()}createVariable(e,t,o){return e=super.createVariable(e,t,o),this.refreshToolboxSelection(),e}recordDragTargets(){const e=this.componentManager.getComponents(gt.Capability.DRAG_TARGET,!0);this.dragTargetAreas=[];for(let t=0,o;o=e[t];t++){const n=o.getClientRect();n&&this.dragTargetAreas.push({component:o,clientRect:n})}}newBlock(e,t){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts")}newComment(e){throw Error("The implementation of newComment should be monkey-patched in by blockly.ts")}getDragTarget(e){for(let t=0,o;o=this.dragTargetAreas[t];t++)if(o.clientRect.contains(e.clientX,e.clientY))return o.component;return null}onMouseDown(e){const t=this.getGesture(e);t&&t.handleWsStart(e,this)}startDrag(e,t){za(this,e,t)}moveDrag(e){return Ua(this,e)}isDragging(){return this.currentGesture_!==null&&this.currentGesture_.isDragging()}isDraggable(){return this.options.moveOptions&&this.options.moveOptions.drag}isMovable(){return this.options.moveOptions&&!!this.options.moveOptions.scrollbars||this.options.moveOptions&&this.options.moveOptions.wheel||this.options.moveOptions&&this.options.moveOptions.drag||this.options.zoomOptions&&this.options.zoomOptions.wheel||this.options.zoomOptions&&this.options.zoomOptions.pinch}isMovableHorizontally(){const e=!!this.scrollbar;return this.isMovable()&&(!e||e&&this.scrollbar.canScrollHorizontally())}isMovableVertically(){const e=!!this.scrollbar;return this.isMovable()&&(!e||e&&this.scrollbar.canScrollVertically())}onMouseWheel(e){if(bo.inProgress())e.preventDefault(),e.stopPropagation();else{var t=this.options.zoomOptions&&this.options.zoomOptions.wheel,o=this.options.moveOptions&&this.options.moveOptions.wheel;if(t||o){var n=Le(e);if(kh)var u=e.metaKey;t&&(e.ctrlKey||u||!o)?(n=-n.y/50,t=fe(e,this.getParentSvg(),this.getInverseScreenCTM()),this.zoom(t.x,t.y,n)):(t=this.scrollX-n.x,o=this.scrollY-n.y,e.shiftKey&&!n.x&&(t=this.scrollX-n.y,o=this.scrollY),this.scroll(t,o)),e.preventDefault()}}}getBlocksBoundingBox(){const e=this.getTopBoundedElements();if(!e.length)return new rt(0,0,0,0);const t=e[0].getBoundingRectangle();for(let n=1;nt.bottom&&(t.bottom=o.bottom),o.leftt.right&&(t.right=o.right))}return t}cleanUp(){this.setResizesEnabled(!1),i.setGroup$$module$build$src$core$events$utils(!0);var e=this.getTopBlocks(!0),t=e.filter(g=>g.isMovable());const o=e.filter(g=>!g.isMovable()).map(g=>g.getBoundingRectangle());e=function(g){for(const I of o)if(g.intersects(I))return I;return null};var n=0;const u=this.renderer.getConstants().MIN_BLOCK_HEIGHT;for(const g of t){for(t=g.getBoundingRectangle(),g.moveBy(-t.left,n-t.top,["cleanup"]),g.snapToGrid(),t=g.getBoundingRectangle(),n=e(t);n!=null;)n=n.top+n.getHeight()+u,g.moveBy(0,n-t.top,["cleanup"]),g.snapToGrid(),t=g.getBoundingRectangle(),n=e(t);n=g.getRelativeToSurfaceXY().y+g.getHeightWidth().height+u}i.setGroup$$module$build$src$core$events$utils(!1),this.setResizesEnabled(!0)}showContextMenu(e){if(!this.options.readOnly&&!this.isFlyout){var t=Ke.registry.getContextMenuOptions(Ke.ScopeType.WORKSPACE,{workspace:this});this.configureContextMenu&&this.configureContextMenu(t,e),sr(e,t,this.RTL,this)}}updateToolbox(e){if(e=$a(e)){if(!this.options.languageTree)throw Error("Existing toolbox is null. Can't create new toolbox.");if(ba(e)){if(!this.toolbox)throw Error("Existing toolbox has no categories. Can't change mode.");this.options.languageTree=e,this.toolbox.render(e)}else{if(!this.flyout)throw Error("Existing toolbox has categories. Can't change mode.");this.options.languageTree=e,this.flyout.show(e)}}else if(this.options.languageTree)throw Error("Can't nullify an existing toolbox.")}markFocused(){this.options.parentWorkspace?this.options.parentWorkspace.markFocused():(se(this),this.getParentSvg().focus({preventScroll:!0}))}zoom(e,t,o){o=Math.pow(this.options.zoomOptions.scaleSpeed,o);const n=this.scale*o;if(this.scale!==n){n>this.options.zoomOptions.maxScale?o=this.options.zoomOptions.maxScale/this.scale:nthis.options.zoomOptions.maxScale?e=this.options.zoomOptions.maxScale:this.options.zoomOptions.minScale&&et.autoHide(e))}static setTopLevelWorkspaceMetrics(e){const t=this.getMetrics();typeof e.x=="number"&&(this.scrollX=-(t.scrollLeft+(t.scrollWidth-t.viewWidth)*e.x)),typeof e.y=="number"&&(this.scrollY=-(t.scrollTop+(t.scrollHeight-t.viewHeight)*e.y)),this.translate(this.scrollX+t.absoluteLeft,this.scrollY+t.absoluteTop)}},_p=class extends Ss{constructor(e,t,o){super(o),this.type=ee.SELECTED,this.oldElementId=e??void 0,this.newElementId=t??void 0}toJson(){const e=super.toJson();return e.oldElementId=this.oldElementId,e.newElementId=this.newElementId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new _p),t.oldElementId=e.oldElementId,t.newElementId=e.newElementId,t}};r($e.EVENT,ee.SELECTED,_p);var Rr=class{paste(e,t,o){if(!t.isCapacityAvailable(e.typeCounts))return null;o&&(e.blockState.x=o.x,e.blockState.y=o.y),o=o||new ye(e.blockState.x||0,e.blockState.y||0),i.disable$$module$build$src$core$events$utils();let n;try{n=lo(e.blockState,t),U$(n,o)}finally{i.enable$$module$build$src$core$events$utils()}return n&&(C()&&!n.isShadow()&&z(new(ne(ee.BLOCK_CREATE))(n)),i.setSelected$$module$build$src$core$common(n),n)}};Rr.TYPE="block",Ca(Rr.TYPE,new Rr);var zl={};zl.bumpIntoBounds=Ji,zl.bumpIntoBoundsHandler=Bd,zl.bumpTopObjectsIntoBounds=el;var Bv=class{constructor(e){this.block=e,this.connectionPreviewer=this.connectionCandidate=this.startLoc=this.startChildConn=this.startParentConn=null,this.dragging=!1,this.dragOffset=new ye(0,0),this.inGroup=!1,this.workspace=e.workspace}isMovable(){if(this.block.isShadow()){let e,t;return(t=(e=this.block.getParent())==null?void 0:e.isMovable())!=null?t:!1}return this.block.isOwnMovable()&&!this.block.isDeadOrDying()&&!this.workspace.options.readOnly&&!this.block.isInFlyout}startDrag(e){if(this.block.isShadow())this.startDraggingShadow(e);else{this.dragging=!0,(this.inGroup=!!i.getGroup$$module$build$src$core$events$utils())||i.setGroup$$module$build$src$core$events$utils(!0),this.fireDragStartEvent(),this.startLoc=this.block.getRelativeToSurfaceXY(),this.connectionCandidate=null,this.connectionPreviewer=new(y($e.CONNECTION_PREVIEWER,this.workspace.options))(this.block),io(),this.workspace.setResizesEnabled(!1),Ki(),e=!!e&&(e.altKey||e.ctrlKey||e.metaKey),this.shouldDisconnect(e)&&this.disconnectBlock(e),this.block.setDragging(!0);var t;(t=this.workspace.getLayerManager())==null||t.moveToDragLayer(this.block)}}startDraggingShadow(e){const t=this.block.getParent();if(!t)throw Error("Tried to drag a shadow block with no parent. Shadow blocks should always have parents.");this.dragOffset=ye.difference(t.getRelativeToSurfaceXY(),this.block.getRelativeToSurfaceXY()),t.startDrag(e)}shouldDisconnect(e){return!!(this.block.getParent()||e&&this.block.nextConnection&&this.block.nextConnection.targetBlock())}disconnectBlock(e){let t,o,n;if(this.startParentConn=(n=(t=this.block.outputConnection)==null?void 0:t.targetConnection)!=null?n:(o=this.block.previousConnection)==null?void 0:o.targetConnection,e){let u;this.startChildConn=(u=this.block.nextConnection)==null?void 0:u.targetConnection}this.block.unplug(e),_d(this.block)}fireDragStartEvent(){const e=new(ne(ee.BLOCK_DRAG))(this.block,!0,this.block.getDescendants(!1));z(e)}fireDragEndEvent(){const e=new(ne(ee.BLOCK_DRAG))(this.block,!1,this.block.getDescendants(!1));z(e)}fireMoveEvent(){if(!this.block.isDeadOrDying()){var e=new(ne(ee.BLOCK_MOVE))(this.block);e.setReason(["drag"]),e.oldCoordinate=this.startLoc,e.recordNew(),z(e)}}drag(e){if(this.block.isShadow()){let t;(t=this.block.getParent())==null||t.drag(ye.sum(e,this.dragOffset))}else this.block.moveDuringDrag(e),this.updateConnectionPreview(this.block,ye.difference(e,this.startLoc))}updateConnectionPreview(e,t){var o=this.connectionCandidate;const n=this.getConnectionCandidate(e,t);if(n){this.connectionCandidate=t=o&&this.currCandidateIsBetter(o,t,n)?o:n;var{local:u,neighbour:g}=t;t=u.type===xe.OUTPUT_VALUE||u.type===xe.PREVIOUS_STATEMENT,o=g.isConnected()&&!g.targetBlock().isInsertionMarker(),t&&o&&!this.orphanCanConnectAtEnd(e,g.targetBlock(),u.type)?this.connectionPreviewer.previewReplacement(u,g,g.targetBlock()):this.connectionPreviewer.previewConnection(u,g)}else this.connectionPreviewer.hidePreview(),this.connectionCandidate=null}orphanCanConnectAtEnd(e,t,o){return!!Qe.getConnectionForOrphanedConnection(e,o===xe.OUTPUT_VALUE?t.outputConnection:t.previousConnection)}currCandidateIsBetter(e,t,o){const{local:n,neighbour:u}=e;e=new ye(n.x,n.y);const g=new ye(u.x,u.y);return t=ye.distance(ye.sum(e,t),g),o.distance>t-i.config$$module$build$src$core$config.currentConnectionPreference}getConnectionCandidate(e,t){e=this.getLocalConnections(e);let o=this.connectionCandidate?i.config$$module$build$src$core$config.connectingSnapRadius:i.config$$module$build$src$core$config.snapRadius,n=null;for(const u of e){const{connection:g,radius:I}=u.closest(o,t);g&&(n={local:u,neighbour:g,distance:I},o=I)}return n}getLocalConnections(e){const t=e.getConnections_(!1),o=e.lastConnectionInStack(!0);return o&&o!==e.nextConnection&&t.push(o),t}endDrag(e){if(this.block.isShadow()){let t;(t=this.block.getParent())==null||t.endDrag(e)}else{if(this.fireDragEndEvent(),this.fireMoveEvent(),no(),Ki(),this.connectionPreviewer.hidePreview(),!this.block.isDeadOrDying()&&this.dragging){let t;(t=this.workspace.getLayerManager())==null||t.moveOffDragLayer(this.block,Fo),this.block.setDragging(!1)}this.connectionCandidate?(this.applyConnections(this.connectionCandidate),this.disposeStep()):this.block.queueRender().then(()=>this.disposeStep()),this.inGroup||i.setGroup$$module$build$src$core$events$utils(!1)}}disposeStep(){this.block.snapToGrid(),this.connectionPreviewer.dispose(),this.workspace.setResizesEnabled(!0)}applyConnections(e){const{local:t,neighbour:o}=e;t.connect(o);const n=t.isSuperior()?o:t,u=this.block.getRootBlock();Ts().then(()=>{Ga(n.getSourceBlock()),setTimeout(()=>{u.bringToFront()},0)})}revertDrag(){if(this.block.isShadow()){let t;(t=this.block.getParent())==null||t.revertDrag()}else{var e;if((e=this.startChildConn)==null||e.connect(this.block.nextConnection),this.startParentConn)switch(this.startParentConn.type){case xe.INPUT_VALUE:this.startParentConn.connect(this.block.outputConnection);break;case xe.NEXT_STATEMENT:this.startParentConn.connect(this.block.previousConnection)}else{this.block.moveTo(this.startLoc,["drag"]);let t;(t=this.workspace.getLayerManager())==null||t.moveOffDragLayer(this.block,Fo),Ji(this.workspace,this.workspace.getMetricsManager().getScrollMetrics(!0),this.block)}this.startParentConn=this.startChildConn=null,this.connectionPreviewer.hidePreview(),this.connectionCandidate=null,this.block.setDragging(!1),this.dragging=!1}}},Fv=class{constructor(){this.drawer=this.curNode=this.colour=null,this.type="marker"}setDrawer(e){this.drawer=e}getDrawer(){return this.drawer}getCurNode(){return this.curNode}setCurNode(e){const t=this.curNode;this.curNode=e,this.drawer&&this.drawer.draw(t,this.curNode)}draw(){this.drawer&&this.drawer.draw(this.curNode,this.curNode)}hide(){this.drawer&&this.drawer.hide()}dispose(){this.getDrawer()&&this.getDrawer().dispose()}},wp=class extends Fv{constructor(){super(),this.type="cursor"}next(){var e=this.getCurNode();if(!e)return null;for(e=e.next();e&&e.next()&&(e.getType()===de.types.NEXT||e.getType()===de.types.BLOCK);)e=e.next();return e&&this.setCurNode(e),e}in(){var e=this.getCurNode();if(!e)return null;(e.getType()===de.types.PREVIOUS||e.getType()===de.types.OUTPUT)&&(e=e.next());let t,o;return(e=(o=(t=e)==null?void 0:t.in())!=null?o:null)&&this.setCurNode(e),e}prev(){var e=this.getCurNode();if(!e)return null;for(e=e.prev();e&&e.prev()&&(e.getType()===de.types.NEXT||e.getType()===de.types.BLOCK);)e=e.prev();return e&&this.setCurNode(e),e}out(){var e=this.getCurNode();return e?((e=e.out())&&e.getType()===de.types.BLOCK&&(e=e.prev()||e),e&&this.setCurNode(e),e):null}};r($e.CURSOR,Ws,wp);var Nr=class extends wp{constructor(){super()}next(){var e=this.getCurNode();return e?((e=this.getNextNode_(e,this.validNode_))&&this.setCurNode(e),e):null}in(){return this.next()}prev(){var e=this.getCurNode();return e?((e=this.getPreviousNode_(e,this.validNode_))&&this.setCurNode(e),e):null}out(){return this.prev()}getNextNode_(e,t){if(!e)return null;const o=e.in()||e.next();return t(o)?o:o?this.getNextNode_(o,t):(e=this.findSiblingOrParent(e.out()),t(e)?e:e?this.getNextNode_(e,t):null)}getPreviousNode_(e,t){if(!e)return null;let o=e.prev();return o=o?this.getRightMostChild(o):e.out(),t(o)?o:o?this.getPreviousNode_(o,t):null}validNode_(e){let t=!1;return e=e&&e.getType(),(e===de.types.OUTPUT||e===de.types.INPUT||e===de.types.FIELD||e===de.types.NEXT||e===de.types.PREVIOUS||e===de.types.WORKSPACE)&&(t=!0),t}findSiblingOrParent(e){if(!e)return null;const t=e.next();return t||this.findSiblingOrParent(e.out())}getRightMostChild(e){if(!e.in())return e;for(e=e.in();e&&e.next();)e=e.next();return this.getRightMostChild(e)}};Nr.registrationName="basicCursor",r($e.CURSOR,Nr.registrationName,Nr);var jv=class extends Nr{validNode_(e){let t=!1;const o=e&&e.getType();return e&&(e=e.getLocation(),o===de.types.FIELD&&e&&e.isTabNavigable()&&e.isClickable()&&(t=!0)),t}},zv=10,Kt=class extends Qe{constructor(e,t){super(e,t),this.highlighted=!1,this.targetConnection=null,this.db=e.workspace.connectionDBList[t],this.dbOpposite=e.workspace.connectionDBList[ki[t]],this.offsetInBlock=new ye(0,0),this.trackedState=Kt.TrackedState.WILL_TRACK}dispose(){super.dispose(),this.trackedState===Kt.TrackedState.TRACKED&&this.db.removeConnection(this,this.y);let e,t;(t=(e=this.sourceBlock_.pathObject).removeConnectionHighlight)==null||t.call(e,this)}getSourceBlock(){return super.getSourceBlock()}targetBlock(){return super.targetBlock()}distanceFrom(e){const t=this.x-e.x;return e=this.y-e.y,Math.sqrt(t*t+e*e)}bumpAwayFrom(e,t=!1){if(!this.sourceBlock_.workspace.isDragging()){var o=i.config$$module$build$src$core$config.snapRadius+Math.floor(Math.random()*zv),n=i.config$$module$build$src$core$config.snapRadius+Math.floor(Math.random()*zv),u=e.sourceBlock_.getRootBlock(),g=this.sourceBlock_.getRootBlock();if(!u.isInFlyout&&!g.isInFlyout){var I=!0;if(g.isMovable())u.isMovable()&&t&&(n=-n);else if(u.isMovable())I=!1,o=-o,n=-n;else return;t=I?e:this,e=I?this:e,u=I?g:u,(g=j()===u)||u.addSelect(),u.RTL&&(o=-o),u.moveBy(t.x+o-e.x,t.y+n-e.y,["bump"]),g||u.removeSelect()}}}moveTo(e,t){let o=!1;return this.trackedState===Kt.TrackedState.WILL_TRACK?(this.db.addConnection(this,t),this.trackedState=Kt.TrackedState.TRACKED,o=!0):this.trackedState===Kt.TrackedState.TRACKED&&(this.db.removeConnection(this,this.y),this.db.addConnection(this,t),o=!0),this.x=e,this.y=t,o}moveBy(e,t){return this.moveTo(this.x+e,this.y+t)}moveToOffset(e){return this.moveTo(e.x+this.offsetInBlock.x,e.y+this.offsetInBlock.y)}setOffsetInBlock(e,t){this.offsetInBlock.x=e,this.offsetInBlock.y=t}getOffsetInBlock(){return this.offsetInBlock}tightenEfficiently(){var e=this.targetConnection;const t=this.targetBlock();e&&t&&(e=ye.difference(this.offsetInBlock,e.offsetInBlock),t.translate(e.x,e.y))}closest(e,t){return this.dbOpposite.searchForClosest(this,e,t)}highlight(){this.highlighted=!0,this.getSourceBlock().queueRender()}unhighlight(){this.highlighted=!1,this.getSourceBlock().queueRender()}isHighlighted(){return this.highlighted}setTracking(e){e&&this.trackedState===Kt.TrackedState.TRACKED||!e&&this.trackedState===Kt.TrackedState.UNTRACKED||this.sourceBlock_.isInFlyout||(e?(this.db.addConnection(this,this.y),this.trackedState=Kt.TrackedState.TRACKED):(this.trackedState===Kt.TrackedState.TRACKED&&this.db.removeConnection(this,this.y),this.trackedState=Kt.TrackedState.UNTRACKED))}stopTrackingAll(){if(this.setTracking(!1),this.targetConnection){const e=this.targetBlock().getDescendants(!1);for(let t=0;tclearTimeout(e)),this.warningTextDb.clear(),this.getIcons().forEach(e=>e.dispose())}checkAndDelete(){this.workspace.isFlyout||(i.setGroup$$module$build$src$core$events$utils(!0),this.workspace.hideChaff(),this.outputConnection?this.dispose(!1,!0):this.dispose(!0,!0),i.setGroup$$module$build$src$core$events$utils(!1))}toCopyData(){return this.isInsertionMarker_?null:{paster:Rr.TYPE,blockState:os(this,{addCoordinates:!0,addNextBlocks:!1}),typeCounts:Ie(this,!0)}}applyColour(){this.pathObject.applyColour(this);const e=this.getIcons();for(let t=0;t{this.isDeadOrDying()||(this.warningTextDb.delete(t),this.setWarningText(e,t))},100));else if(this.isInFlyout&&(e=null),o=this.getIcon(wo.TYPE),e){let n=this.getSurroundParent(),u=null;for(;n;)n.isCollapsed()&&(u=n),n=n.getSurroundParent();u&&u.setWarningText(i.Msg$$module$build$src$core$msg.COLLAPSED_WARNINGS_WARNING,$s.COLLAPSED_WARNING_ID),o?o.addMessage(e,t):this.addIcon(new wo(this).addMessage(e,t))}else o&&(t?(o.addMessage("",t),o.getText()||this.removeIcon(wo.TYPE)):this.removeIcon(wo.TYPE))}setMutator(e){this.removeIcon(i.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE),e&&this.addIcon(e)}addIcon(e){return super.addIcon(e),e instanceof i.MutatorIcon$$module$build$src$core$icons$mutator_icon&&(this.mutator=e),e.initView(this.createIconPointerDownListener(e)),e.applyColour(),e.updateEditable(),this.queueRender(),e}createIconPointerDownListener(e){return t=>{this.isDeadOrDying()||(t=this.workspace.getGesture(t))&&t.setStartIcon(e)}}removeIcon(e){const t=super.removeIcon(e);return e.equals(i.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE)&&(this.mutator=null),this.queueRender(),t}setEnabled(e){w("setEnabled","v11","v12","the setDisabledReason method of BlockSvg");const t=this.isEnabled();super.setEnabled(e),this.isEnabled()===t||this.getInheritedDisabled()||this.updateDisabled()}setDisabledReason(e,t){const o=this.isEnabled();super.setDisabledReason(e,t),this.isEnabled()===o||this.getInheritedDisabled()||this.updateDisabled()}setHighlighted(e){this.pathObject.updateHighlighted(e)}addSelect(){this.pathObject.updateSelected(!0)}removeSelect(){this.pathObject.updateSelected(!1)}setDeleteStyle(e){this.pathObject.updateDraggingDelete(e)}getColour(){return this.style.colourPrimary}setColour(e){super.setColour(e),e=this.workspace.getRenderer().getConstants().getBlockStyleForColour(this.colour_),this.pathObject.setStyle(e.style),this.style=e.style,this.styleName_=e.name,this.applyColour()}setStyle(e){const t=this.workspace.getRenderer().getConstants().getBlockStyle(e);if(this.styleName_=e,t)this.hat=t.hat,this.pathObject.setStyle(t),this.colour_=t.colourPrimary,this.style=t,this.applyColour();else throw Error("Invalid style name: "+e)}getStyle(){return this.style}bringToFront(e=!1){let t=this;if(!t.isDeadOrDying())do{const o=t.getSvgRoot(),n=o.parentNode,u=n.childNodes;if(u[u.length-1]!==o&&n.appendChild(o),e)break;t=t.getParent()}while(t)}setPreviousStatement(e,t){super.setPreviousStatement(e,t),this.queueRender()}setNextStatement(e,t){super.setNextStatement(e,t),this.queueRender()}setOutput(e,t){super.setOutput(e,t),this.queueRender()}setInputsInline(e){super.setInputsInline(e),this.queueRender()}removeInput(e,t){return e=super.removeInput(e,t),this.queueRender(),e}moveNumberedInputBefore(e,t){super.moveNumberedInputBefore(e,t),this.queueRender()}appendInput(e){return super.appendInput(e),this.queueRender(),e}setConnectionTracking(e){if(this.previousConnection&&this.previousConnection.setTracking(e),this.outputConnection&&this.outputConnection.setTracking(e),this.nextConnection){this.nextConnection.setTracking(e);var t=this.nextConnection.targetBlock();t&&t.setConnectionTracking(e)}if(!this.collapsed_)for(t=0;t=this.workspace.options.maxTrashcanContents||(e=new gs({scrollbars:!0,parentWorkspace:this.workspace,rtl:this.workspace.RTL,oneBasedIndex:this.workspace.options.oneBasedIndex,renderer:this.workspace.options.renderer,rendererOverrides:this.workspace.options.rendererOverrides,move:{scrollbars:!0}}),this.workspace.horizontalLayout?(e.toolboxPosition=this.workspace.toolboxPosition===Ge.TOP?Ge.BOTTOM:Ge.TOP,this.flyout=new(y($e.FLYOUTS_HORIZONTAL_TOOLBOX,this.workspace.options,!0))(e)):(e.toolboxPosition=this.workspace.toolboxPosition===Ge.RIGHT?Ge.LEFT:Ge.RIGHT,this.flyout=new(y($e.FLYOUTS_VERTICAL_TOOLBOX,this.workspace.options,!0))(e)),this.workspace.addChangeListener(this.onDelete.bind(this)))}createDom(){this.svgGroup=ie(J.G,{class:"blocklyTrash"});let e;const t=String(Math.random()).substring(2);e=ie(J.CLIPPATH,{id:"blocklyTrashBodyClipPath"+t},this.svgGroup),ie(J.RECT,{width:mn,height:Hl,y:fn},e);const o=ie(J.IMAGE,{width:Wt.width,x:-Cp,height:Wt.height,y:-Tp,"clip-path":"url(#blocklyTrashBodyClipPath"+t+")"},this.svgGroup);return o.setAttributeNS(is,"xlink:href",this.workspace.options.pathToMedia+Wt.url),e=ie(J.CLIPPATH,{id:"blocklyTrashLidClipPath"+t},this.svgGroup),ie(J.RECT,{width:mn,height:fn},e),this.svgLid=ie(J.IMAGE,{width:Wt.width,x:-Cp,height:Wt.height,y:-Tp,"clip-path":"url(#blocklyTrashLidClipPath"+t+")"},this.svgGroup),this.svgLid.setAttributeNS(is,"xlink:href",this.workspace.options.pathToMedia+Wt.url),ue(this.svgGroup,"pointerdown",this,this.blockMouseDownWhenOpenable),ue(this.svgGroup,"pointerup",this,this.click),ue(o,"pointerover",this,this.mouseOver),ue(o,"pointerout",this,this.mouseOut),this.animateLid(),this.svgGroup}init(){0{let o;(o=this.flyout)==null||o.show(e),t.cursor="";let n;(n=this.workspace.scrollbar)==null||n.setVisible(!1)},10),this.fireUiEvent(!0)}}closeFlyout(){if(this.contentsIsOpen()){var e;(e=this.flyout)==null||e.hide();var t;(t=this.workspace.scrollbar)==null||t.setVisible(!0),this.fireUiEvent(!1),this.workspace.recordDragTargets()}}autoHide(e){!e&&this.flyout&&this.closeFlyout()}emptyContents(){this.hasContents()&&(this.contents.length=0,this.setMinOpenness(0),this.closeFlyout())}position(e,t){if(this.initialized){var o=wa(this.workspace,e);e=_a(o,new Xe(mn,Hl+fn),rT,Wv,e,this.workspace),t=ka(e,Wv,o.vertical===$o.TOP?Po.DOWN:Po.UP,t),this.top=t.top,this.left=t.left;var n;(n=this.svgGroup)==null||n.setAttribute("transform","translate("+this.left+","+this.top+")");var u;(u=this.flyout)==null||u.position()}}getBoundingRectangle(){return new rt(this.top,this.top+Hl+fn,this.left,this.left+mn)}getClientRect(){if(!this.svgGroup)return null;var e=this.svgGroup.getBoundingClientRect();const t=e.top+Tp-Wl;return e=e.left+Cp-Wl,new rt(t,t+fn+Hl+2*Wl,e,e+mn+2*Wl)}onDragOver(e){this.setLidOpen(this.wouldDelete_)}onDragExit(e){this.setLidOpen(!1)}onDrop(e){setTimeout(this.setLidOpen.bind(this,!1),100)}setLidOpen(e){this.isLidOpen!==e&&(this.lidTask&&clearTimeout(this.lidTask),this.isLidOpen=e,this.animateLid())}animateLid(){const e=cT;var t=1/(e+1);this.lidOpen+=this.isLidOpen?t:-t,this.lidOpen=Math.min(Math.max(this.lidOpen,this.minOpenness),1),this.setLidAngle(this.lidOpen*Vv),t=Gv+this.lidOpen*(uT-Gv),this.svgGroup&&(this.svgGroup.style.opacity=`${t}`),this.lidOpen>this.minOpenness&&1>this.lidOpen&&(this.lidTask=setTimeout(this.animateLid.bind(this),lT/e))}setLidAngle(e){const t=this.workspace.toolboxPosition===Ge.RIGHT||this.workspace.horizontalLayout&&this.workspace.RTL;let o;(o=this.svgLid)==null||o.setAttribute("transform","rotate("+(t?-e:e)+","+(t?4:mn-4)+","+(fn-2)+")")}setMinOpenness(e){this.minOpenness=e,this.isLidOpen||this.setLidAngle(e*Vv)}closeLid(){this.setLidOpen(!1)}click(){this.hasContents()&&!this.workspace.isDragging()&&this.openFlyout()}fireUiEvent(e){e=new(ne(ee.TRASHCAN_OPEN))(e,this.workspace.id),z(e)}blockMouseDownWhenOpenable(e){!this.contentsIsOpen()&&this.hasContents()&&e.stopPropagation()}mouseOver(){this.hasContents()&&this.setLidOpen(!0)}mouseOut(){this.setLidOpen(!1)}onDelete(e){if(!(0>=this.workspace.options.maxTrashcanContents||!S(e)||e.wasShadow)){if(!e.oldJson)throw Error("Encountered a delete event without proper oldJson");if(e=JSON.stringify(this.cleanBlockJson(e.oldJson)),!this.contents.includes(e)){for(this.contents.unshift(e);this.contents.length>this.workspace.options.maxTrashcanContents;)this.contents.pop();this.setMinOpenness(aT)}}}cleanBlockJson(e){function t(o){if(o){if(delete o.id,delete o.x,delete o.y,delete o.enabled,delete o.disabledReasons,o.icons&&o.icons.comment){var n=o.icons.comment;delete n.height,delete n.width,delete n.pinned}n=o.inputs;for(var u in n){var g=n[u];const I=g.block;g=g.shadow,I&&t(I),g&&t(g)}o.next&&(u=o.next,o=u.block,u=u.shadow,o&&t(o),u&&t(u))}}return e=JSON.parse(JSON.stringify(e)),t(e),Object.assign({},{kind:"BLOCK"},e)}},mn=47,Hl=44,fn=16,Wv=20,rT=20,Wl=10,Cp=0,Tp=32,aT=.1,lT=80,cT=4,Gv=.4,uT=.8,Vv=45,st=class{constructor(){this.shortcuts=new Map,this.keyMap=new Map,this.reset()}reset(){this.shortcuts.clear(),this.keyMap.clear()}register(e,t){if(this.shortcuts.get(e.name)&&!t)throw Error(`Shortcut named "${e.name}" already exists.`);if(this.shortcuts.set(e.name,e),t=e.keyCodes,t!=null&&t.length)for(const o of t)this.addKeyMapping(o,e.name,!!e.allowCollision)}unregister(e){return this.shortcuts.get(e)?(this.removeAllKeyMappings(e),this.shortcuts.delete(e),!0):(console.warn(`Keyboard shortcut named "${e}" not found.`),!1)}addKeyMapping(e,t,o){e=`${e}`;const n=this.keyMap.get(e);if(n&&!o)throw Error(`Shortcut named "${t}" collides with shortcuts "${n}"`);n&&o?n.unshift(t):this.keyMap.set(e,[t])}removeKeyMapping(e,t,o){const n=this.keyMap.get(e);if(!n)return o||console.warn(`No keyboard shortcut named "${t}" registered with key code "${e}"`),!1;const u=n.indexOf(t);return-1Yd(t)),e.length?e:null}load(e,t){const o=t.getProcedureMap();for(const n of e)o.add(Jd(this.procedureModelClass,this.parameterModelClass,n,t))}clear(e){e.getProcedureMap().clear()}},Gl={};Gl.ProcedureSerializer=hT,Gl.loadProcedure=Jd,Gl.saveProcedure=Yd;var Kv=class{constructor(){this.priority=Ub}save(e){const t=[];for(const o of e.getAllVariables())e={name:o.name,id:o.getId()},o.type&&(e.type=o.type),t.push(e);return t.length?t:null}load(e,t){for(const o of e)t.createVariable(o.name,o.type,o.id)}clear(e){e.getVariableMap().clear()}};Vn("variables",new Kv);var Yv={};Yv.VariableSerializer=Kv;var Ip={};Ip.load=J$,Ip.save=Y$;var pT={blocks:_r,exceptions:pi,priorities:UC,procedures:Gl,registry:Dh,variables:Yv,workspaceComments:hl,workspaces:Ip},xp=class{constructor(e,t,o,n,u){this.workspace=e,this.oldHostMetrics=this.corner_=this.vScroll=this.hScroll=null,t=t===void 0?!0:t,o=o===void 0?!0:o;const g=t&&o;t&&(this.hScroll=new yt(e,!0,g,n,u)),o&&(this.vScroll=new yt(e,!1,g,n,u)),g&&(this.corner_=ie(J.RECT,{height:yt.scrollbarThickness,width:yt.scrollbarThickness,class:"blocklyScrollbarBackground"}),At(this.corner_,e.getBubbleCanvas()))}dispose(){Ze(this.corner_),this.oldHostMetrics=this.corner_=null,this.hScroll&&(this.hScroll.dispose(),this.hScroll=null),this.vScroll&&(this.vScroll.dispose(),this.vScroll=null)}resize(){const e=this.workspace.getMetrics();if(e){var t=!1,o=!1;if(this.oldHostMetrics&&this.oldHostMetrics.viewWidth===e.viewWidth&&this.oldHostMetrics.viewHeight===e.viewHeight&&this.oldHostMetrics.absoluteTop===e.absoluteTop&&this.oldHostMetrics.absoluteLeft===e.absoluteLeft?(this.oldHostMetrics&&this.oldHostMetrics.scrollWidth===e.scrollWidth&&this.oldHostMetrics.viewLeft===e.viewLeft&&this.oldHostMetrics.scrollLeft===e.scrollLeft||(t=!0),this.oldHostMetrics&&this.oldHostMetrics.scrollHeight===e.scrollHeight&&this.oldHostMetrics.viewTop===e.viewTop&&this.oldHostMetrics.scrollTop===e.scrollTop||(o=!0)):o=t=!0,t||o){try{i.disable$$module$build$src$core$events$utils(),this.hScroll&&t&&this.hScroll.resize(e),this.vScroll&&o&&this.vScroll.resize(e)}finally{i.enable$$module$build$src$core$events$utils()}this.workspace.maybeFireViewportChangeEvent()}if(this.hScroll&&this.vScroll){if(!this.oldHostMetrics||this.oldHostMetrics.viewWidth!==e.viewWidth||this.oldHostMetrics.absoluteLeft!==e.absoluteLeft){let n;(n=this.corner_)==null||n.setAttribute("x",String(this.vScroll.position.x))}if(!this.oldHostMetrics||this.oldHostMetrics.viewHeight!==e.viewHeight||this.oldHostMetrics.absoluteTop!==e.absoluteTop){let n;(n=this.corner_)==null||n.setAttribute("y",String(this.hScroll.position.y))}}this.oldHostMetrics=e}}canScrollHorizontally(){return!!this.hScroll}canScrollVertically(){return!!this.vScroll}setOrigin(e,t){this.hScroll&&this.hScroll.setOrigin(e,t),this.vScroll&&this.vScroll.setOrigin(e,t)}set(e,t,o){this.hScroll&&this.hScroll.set(e,!1),this.vScroll&&this.vScroll.set(t,!1),(o||o===void 0)&&(e={},this.hScroll&&(e.x=this.hScroll.getRatio_()),this.vScroll&&(e.y=this.vScroll.getRatio_()),this.workspace.setMetrics(e))}setX(e){this.hScroll&&this.hScroll.set(e,!0)}setY(e){this.vScroll&&this.vScroll.set(e,!0)}setContainerVisible(e){this.hScroll&&this.hScroll.setContainerVisible(e),this.vScroll&&this.vScroll.setContainerVisible(e)}isVisible(){let e=!1;return this.hScroll&&(e=this.hScroll.isVisible()),this.vScroll&&(e=e||this.vScroll.isVisible()),e}setVisible(e){this.hScroll&&this.hScroll.setVisibleInternal(e),this.vScroll&&this.vScroll.setVisibleInternal(e)}resizeContent(e){this.hScroll&&this.hScroll.resizeContentHorizontal(e),this.vScroll&&this.vScroll.resizeContentVertical(e)}resizeView(e){this.hScroll&&this.hScroll.resizeViewHorizontal(e),this.vScroll&&this.vScroll.resizeViewVertical(e)}},Dp=class{constructor(e){this.workspace_=e}getDimensionsPx_(e){let t=0,o=0;return e&&(t=e.getWidth(),o=e.getHeight()),new Xe(t,o)}getFlyoutMetrics(e){return e=this.getDimensionsPx_(this.workspace_.getFlyout(e)),{width:e.width,height:e.height,position:this.workspace_.toolboxPosition}}getToolboxMetrics(){const e=this.getDimensionsPx_(this.workspace_.getToolbox());return{width:e.width,height:e.height,position:this.workspace_.toolboxPosition}}getSvgMetrics(){return this.workspace_.getCachedParentSvgSize()}getAbsoluteMetrics(){let e=0,t=0;const o=this.getToolboxMetrics(),n=this.getFlyoutMetrics(),u=!!this.workspace_.getToolbox();var g;const I=!((g=this.workspace_.getFlyout())!=null&&g.autoClose);g=u?o.position:n.position;const L=g===Ge.TOP;return g===Ge.LEFT&&(u&&(e+=o.width),I&&(e+=n.width)),L&&(u&&(t+=o.height),I&&(t+=n.height)),{top:t,left:e}}getViewMetrics(e){e=e?this.workspace_.scale:1;const t=this.getSvgMetrics(),o=this.getToolboxMetrics(),n=this.getFlyoutMetrics(),u=!!this.workspace_.getToolbox();var g;const I=!((g=this.workspace_.getFlyout())!=null&&g.autoClose);g=u?o.position:n.position;const L=g===Ge.LEFT||g===Ge.RIGHT;return(g===Ge.TOP||g===Ge.BOTTOM)&&(u&&(t.height-=o.height),I&&(t.height-=n.height)),L&&(u&&(t.width-=o.width),I&&(t.width-=n.width)),{height:t.height/e,width:t.width/e,top:-this.workspace_.scrollY/e,left:-this.workspace_.scrollX/e}}getContentMetrics(e){e=e?1:this.workspace_.scale;const t=this.workspace_.getBlocksBoundingBox();return{height:(t.bottom-t.top)*e,width:(t.right-t.left)*e,top:t.top*e,left:t.left*e}}hasFixedEdges(){return!this.workspace_.isMovableHorizontally()||!this.workspace_.isMovableVertically()}getComputedFixedEdges_(e){if(!this.hasFixedEdges())return{};const t=this.workspace_.isMovableHorizontally(),o=this.workspace_.isMovableVertically();e=e||this.getViewMetrics(!1);const n={};return o||(n.top=e.top,n.bottom=e.top+e.height),t||(n.left=e.left,n.right=e.left+e.width),n}getPaddedContent_(e,t){const o=t.top+t.height,n=t.left+t.width,u=e.width;e=e.height;const g=u/2,I=e/2;return{top:Math.min(t.top-I,o-e),bottom:Math.max(o+I,t.top+e),left:Math.min(t.left-g,n-u),right:Math.max(n+g,t.left+u)}}getScrollMetrics(e,t,o){e=e?this.workspace_.scale:1,t=t||this.getViewMetrics(!1);var n=o||this.getContentMetrics();o=this.getComputedFixedEdges_(t),t=this.getPaddedContent_(t,n),n=o.top!==void 0?o.top:t.top;const u=o.left!==void 0?o.left:t.left;return{top:n/e,left:u/e,width:((o.right!==void 0?o.right:t.right)-u)/e,height:((o.bottom!==void 0?o.bottom:t.bottom)-n)/e}}getUiMetrics(){return{viewMetrics:this.getViewMetrics(),absoluteMetrics:this.getAbsoluteMetrics(),toolboxMetrics:this.getToolboxMetrics()}}getMetrics(){const e=this.getToolboxMetrics(),t=this.getFlyoutMetrics(!0),o=this.getSvgMetrics(),n=this.getAbsoluteMetrics(),u=this.getViewMetrics(),g=this.getContentMetrics(),I=this.getScrollMetrics(!1,u,g);return{contentHeight:g.height,contentWidth:g.width,contentTop:g.top,contentLeft:g.left,scrollHeight:I.height,scrollWidth:I.width,scrollTop:I.top,scrollLeft:I.left,viewHeight:u.height,viewWidth:u.width,viewTop:u.top,viewLeft:u.left,absoluteTop:n.top,absoluteLeft:n.left,svgHeight:o.height,svgWidth:o.width,toolboxWidth:e.width,toolboxHeight:e.height,toolboxPosition:e.position,flyoutWidth:t.width,flyoutHeight:t.height}}};r($e.METRICS_MANAGER,Ws,Dp),"Blockly"in globalThis||(globalThis.Blockly={Msg:Zb});var Jv=class extends Pl{constructor(){super(),this.GRID_UNIT=4,this.CURSOR_COLOUR="#ffa200",this.CURSOR_RADIUS=5,this.JAGGED_TEETH_WIDTH=this.JAGGED_TEETH_HEIGHT=0,this.START_HAT_HEIGHT=22,this.START_HAT_WIDTH=96,this.SHAPES={HEXAGONAL:1,ROUND:2,SQUARE:3,PUZZLE:4,NOTCH:5},this.SHAPE_IN_SHAPE_PADDING={1:{0:5*this.GRID_UNIT,1:2*this.GRID_UNIT,2:5*this.GRID_UNIT,3:5*this.GRID_UNIT},2:{0:3*this.GRID_UNIT,1:3*this.GRID_UNIT,2:1*this.GRID_UNIT,3:2*this.GRID_UNIT},3:{0:2*this.GRID_UNIT,1:2*this.GRID_UNIT,2:2*this.GRID_UNIT,3:2*this.GRID_UNIT}},this.FULL_BLOCK_FIELDS=!0,this.FIELD_TEXT_FONTWEIGHT="bold",this.FIELD_TEXT_FONTFAMILY='"Helvetica Neue", "Segoe UI", Helvetica, sans-serif',this.FIELD_COLOUR_FULL_BLOCK=this.FIELD_TEXTINPUT_BOX_SHADOW=this.FIELD_DROPDOWN_SVG_ARROW=this.FIELD_DROPDOWN_COLOURED_DIV=this.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW=!0,this.SELECTED_GLOW_COLOUR="#fff200",this.SELECTED_GLOW_SIZE=.5,this.REPLACEMENT_GLOW_COLOUR="#fff200",this.REPLACEMENT_GLOW_SIZE=2,this.selectedGlowFilterId="",this.selectedGlowFilter=null,this.replacementGlowFilterId="",this.SQUARED=this.ROUNDED=this.HEXAGONAL=this.replacementGlowFilter=null,this.SMALL_PADDING=this.GRID_UNIT,this.MEDIUM_PADDING=2*this.GRID_UNIT,this.MEDIUM_LARGE_PADDING=3*this.GRID_UNIT,this.LARGE_PADDING=4*this.GRID_UNIT,this.CORNER_RADIUS=1*this.GRID_UNIT,this.NOTCH_WIDTH=9*this.GRID_UNIT,this.NOTCH_HEIGHT=2*this.GRID_UNIT,this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT=3*this.GRID_UNIT,this.MIN_BLOCK_WIDTH=2*this.GRID_UNIT,this.MIN_BLOCK_HEIGHT=12*this.GRID_UNIT,this.EMPTY_STATEMENT_INPUT_HEIGHT=6*this.GRID_UNIT,this.TOP_ROW_MIN_HEIGHT=this.CORNER_RADIUS,this.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING,this.BOTTOM_ROW_MIN_HEIGHT=this.CORNER_RADIUS,this.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT=6*this.GRID_UNIT,this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT,this.STATEMENT_INPUT_SPACER_MIN_WIDTH=40*this.GRID_UNIT,this.STATEMENT_INPUT_PADDING_LEFT=4*this.GRID_UNIT,this.EMPTY_INLINE_INPUT_PADDING=4*this.GRID_UNIT,this.EMPTY_INLINE_INPUT_HEIGHT=8*this.GRID_UNIT,this.DUMMY_INPUT_MIN_HEIGHT=8*this.GRID_UNIT,this.DUMMY_INPUT_SHADOW_MIN_HEIGHT=6*this.GRID_UNIT,this.CURSOR_WS_WIDTH=20*this.GRID_UNIT,this.FIELD_TEXT_FONTSIZE=3*this.GRID_UNIT,this.FIELD_BORDER_RECT_RADIUS=this.CORNER_RADIUS,this.FIELD_BORDER_RECT_X_PADDING=2*this.GRID_UNIT,this.FIELD_BORDER_RECT_Y_PADDING=1.625*this.GRID_UNIT,this.FIELD_BORDER_RECT_HEIGHT=8*this.GRID_UNIT,this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=8*this.GRID_UNIT,this.FIELD_DROPDOWN_SVG_ARROW_PADDING=this.FIELD_BORDER_RECT_X_PADDING,this.FIELD_COLOUR_DEFAULT_WIDTH=6*this.GRID_UNIT,this.FIELD_COLOUR_DEFAULT_HEIGHT=8*this.GRID_UNIT,this.FIELD_CHECKBOX_X_OFFSET=1*this.GRID_UNIT,this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH=12*this.GRID_UNIT}setFontConstants_(e){super.setFontConstants_(e),this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT=this.FIELD_TEXT_HEIGHT+2*this.FIELD_BORDER_RECT_Y_PADDING}init(){super.init(),this.HEXAGONAL=this.makeHexagonal(),this.ROUNDED=this.makeRounded(),this.SQUARED=this.makeSquared(),this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT+this.INSIDE_CORNERS.rightWidth}setDynamicProperties_(e){super.setDynamicProperties_(e),this.SELECTED_GLOW_COLOUR=e.getComponentStyle("selectedGlowColour")||this.SELECTED_GLOW_COLOUR;const t=Number(e.getComponentStyle("selectedGlowSize"));this.SELECTED_GLOW_SIZE=t&&!isNaN(t)?t:this.SELECTED_GLOW_SIZE,this.REPLACEMENT_GLOW_COLOUR=e.getComponentStyle("replacementGlowColour")||this.REPLACEMENT_GLOW_COLOUR,this.REPLACEMENT_GLOW_SIZE=(e=Number(e.getComponentStyle("replacementGlowSize")))&&!isNaN(e)?e:this.REPLACEMENT_GLOW_SIZE}dispose(){super.dispose(),this.selectedGlowFilter&&Ze(this.selectedGlowFilter),this.replacementGlowFilter&&Ze(this.replacementGlowFilter)}makeStartHat(){const e=this.START_HAT_HEIGHT,t=this.START_HAT_WIDTH,o=Xt("c",[Me(25,-e),Me(71,-e),Me(t,0)]);return{height:e,width:t,path:o}}makeHexagonal(){function e(o,n,u){var g=o/2;return g=g>t?t:g,u=u?-1:1,o=(n?-1:1)*o/2,Hs(-u*g,o)+Hs(u*g,o)}const t=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH;return{type:this.SHAPES.HEXAGONAL,isDynamic:!0,width(o){return o/=2,o>t?t:o},height(o){return o},connectionOffsetY(o){return o/2},connectionOffsetX(o){return-o},pathDown(o){return e(o,!1,!1)},pathUp(o){return e(o,!0,!1)},pathRightDown(o){return e(o,!1,!0)},pathRightUp(o){return e(o,!1,!0)}}}makeRounded(){function e(n,u,g){const I=n>o?n-o:0;n=(n>o?o:n)/2;const L=g===u?"0":"1";return vt("a","0 0,"+L,n,Me((g?1:-1)*n,(u?-1:1)*n))+De("v",(u?-1:1)*I)+vt("a","0 0,"+L,n,Me((g?-1:1)*n,(u?-1:1)*n))}const t=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH,o=2*t;return{type:this.SHAPES.ROUND,isDynamic:!0,width(n){return n/=2,n>t?t:n},height(n){return n},connectionOffsetY(n){return n/2},connectionOffsetX(n){return-n},pathDown(n){return e(n,!1,!1)},pathUp(n){return e(n,!0,!1)},pathRightDown(n){return e(n,!1,!0)},pathRightUp(n){return e(n,!1,!0)}}}makeSquared(){function e(o,n,u){o-=2*t;const g=u===n?"0":"1";return vt("a","0 0,"+g,t,Me((u?1:-1)*t,(n?-1:1)*t))+De("v",(n?-1:1)*o)+vt("a","0 0,"+g,t,Me((u?-1:1)*t,(n?-1:1)*t))}const t=this.CORNER_RADIUS;return{type:this.SHAPES.SQUARE,isDynamic:!0,width(o){return t},height(o){return o},connectionOffsetY(o){return o/2},connectionOffsetX(o){return-o},pathDown(o){return e(o,!1,!1)},pathUp(o){return e(o,!0,!1)},pathRightDown(o){return e(o,!1,!0)},pathRightUp(o){return e(o,!1,!0)}}}shapeFor(e){let t=e.getCheck();switch(!t&&e.targetConnection&&(t=e.targetConnection.getCheck()),e.type){case xe.INPUT_VALUE:case xe.OUTPUT_VALUE:if(e=e.getSourceBlock().getOutputShape(),e!==null)switch(e){case this.SHAPES.HEXAGONAL:return this.HEXAGONAL;case this.SHAPES.ROUND:return this.ROUNDED;case this.SHAPES.SQUARE:return this.SQUARED}return t&&t.includes("Boolean")?this.HEXAGONAL:t&&t.includes("Number")?this.ROUNDED:(t&&t.includes("String"),this.ROUNDED);case xe.PREVIOUS_STATEMENT:case xe.NEXT_STATEMENT:return this.NOTCH;default:throw Error("Unknown type")}}makeNotch(){function e(Ee){return Xt("c",[Me(Ee*u/2,0),Me(Ee*u*3/4,I/2),Me(Ee*u,I)])+Yi([Me(Ee*u,g)])+Xt("c",[Me(Ee*u/4,I/2),Me(Ee*u/2,I),Me(Ee*u,I)])+De("h",Ee*n)+Xt("c",[Me(Ee*u/2,0),Me(Ee*u*3/4,-(I/2)),Me(Ee*u,-I)])+Yi([Me(Ee*u,-g)])+Xt("c",[Me(Ee*u/4,-(I/2)),Me(Ee*u/2,-I),Me(Ee*u,-I)])}const t=this.NOTCH_WIDTH,o=this.NOTCH_HEIGHT,n=t/3,u=n/3,g=o/2,I=g/2,L=e(1),le=e(-1);return{type:this.SHAPES.NOTCH,width:t,height:o,pathLeft:L,pathRight:le}}makeInsideCorners(){const e=this.CORNER_RADIUS,t=vt("a","0 0,0",e,Me(-e,e)),o=vt("a","0 0,1",e,Me(-e,e)),n=vt("a","0 0,0",e,Me(e,e)),u=vt("a","0 0,1",e,Me(e,e));return{width:e,height:e,pathTop:t,pathBottom:n,rightWidth:e,rightHeight:e,pathTopRight:o,pathBottomRight:u}}generateSecondaryColour_(e){return si("#000",e,.15)||e}generateTertiaryColour_(e){return si("#000",e,.25)||e}createDom(e,t,o){super.createDom(e,t,o),e=ie(J.DEFS,{},e),t=ie(J.FILTER,{id:"blocklySelectedGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},e),ie(J.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.SELECTED_GLOW_SIZE},t),o=ie(J.FECOMPONENTTRANSFER,{result:"outBlur"},t),ie(J.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},o),ie(J.FEFLOOD,{"flood-color":this.SELECTED_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},t),ie(J.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},t),this.selectedGlowFilterId=t.id,this.selectedGlowFilter=t,e=ie(J.FILTER,{id:"blocklyReplacementGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},e),ie(J.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.REPLACEMENT_GLOW_SIZE},e),t=ie(J.FECOMPONENTTRANSFER,{result:"outBlur"},e),ie(J.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},t),ie(J.FEFLOOD,{"flood-color":this.REPLACEMENT_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},e),ie(J.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},e),ie(J.FECOMPOSITE,{in:"SourceGraphic",in2:"outGlow",operator:"over"},e),this.replacementGlowFilterId=e.id,this.replacementGlowFilter=e}getCSS_(e){return[`${e} .blocklyText,`,`${e} .blocklyFlyoutLabelText {`,`font: ${this.FIELD_TEXT_FONTWEIGHT} ${this.FIELD_TEXT_FONTSIZE}pt ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${e} .blocklyTextInputBubble textarea {`,"font-weight: normal;","}",`${e} .blocklyText {`,"fill: #fff;","}",`${e} .blocklyNonEditableText>rect:not(.blocklyDropdownRect),`,`${e} .blocklyEditableText>rect:not(.blocklyDropdownRect) {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"}",`${e} .blocklyNonEditableText>text,`,`${e} .blocklyEditableText>text,`,`${e} .blocklyNonEditableText>g>text,`,`${e} .blocklyEditableText>g>text {`,"fill: #575E75;","}",`${e} .blocklyFlyoutLabelText {`,"fill: #575E75;","}",`${e} .blocklyText.blocklyBubbleText {`,"fill: #575E75;","}",`${e} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableText:not(.editing):hover>rect,",`${e} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableText:not(.editing):hover>.blocklyPath {","stroke: #fff;","stroke-width: 2;","}",`${e} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,"color: #575E75;","}",`${e} .blocklyDropdownText {`,"fill: #fff !important;","}",`${e}.blocklyWidgetDiv .blocklyMenuItem,`,`${e}.blocklyDropDownDiv .blocklyMenuItem {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${e}.blocklyDropDownDiv .blocklyMenuItemContent {`,"color: #fff;","}",`${e} .blocklyHighlightedConnectionPath {`,`stroke: ${this.SELECTED_GLOW_COLOUR};`,"}",`${e} .blocklyDisabled > .blocklyOutlinePath {`,`fill: url(#blocklyDisabledPattern${this.randomIdentifier})`,"}",`${e} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"]}},qv=class extends Bl{constructor(e,t){super(e,t)}draw(){const e=this.block_.pathObject;e.beginDrawing(),this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights(),e.setPath(this.outlinePath_+` +`+this.inlinePath_),this.info_.RTL&&e.flipRTL(),this.recordSizeOnBlock_(),this.info_.outputConnection&&(e.outputShapeType=this.info_.outputConnection.shape.type),e.endDrawing()}drawOutline_(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape&&!this.info_.hasStatementInput&&!this.info_.bottomRow.hasNextConnection?(this.drawFlatTop_(),this.drawRightDynamicConnection_(),this.drawFlatBottom_(),this.drawLeftDynamicConnection_()):super.drawOutline_()}drawLeft_(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape?this.drawLeftDynamicConnection_():super.drawLeft_()}drawRightSideRow_(e){if(!(0>=e.height)){if(F.isSpacer(e)){const n=e.precedesStatement;var t=e.followsStatement;if(n||t){const u=this.constants_.INSIDE_CORNERS;var o=u.rightHeight;o=e.height-(n?o:0),t=t?u.pathBottomRight:"",e=0=o||0>=t)throw Error("Height and width values of an image field must be greater than 0.");this.size_=new Xe(t,o+Ci.Y_PADDING),this.imageHeight=o,typeof u=="function"&&(this.clickHandler=u),e!==lt.SKIP_SETUP&&(I?this.configure_(I):(this.flipRtl=!!g,this.altText=bt(n)||""),this.setValue(bt(e)))}configure_(e){super.configure_(e),e.flipRtl&&(this.flipRtl=e.flipRtl),e.alt&&(this.altText=bt(e.alt))}initView(){this.imageElement=ie(J.IMAGE,{height:this.imageHeight+"px",width:this.size_.width+"px",alt:this.altText},this.fieldGroup_),this.imageElement.setAttributeNS(is,"xlink:href",this.value_),this.clickHandler&&(this.imageElement.style.cursor="pointer")}updateSize_(){}doClassValidation_(e){return typeof e!="string"?null:e}doValueUpdate_(e){this.value_=e,this.imageElement&&this.imageElement.setAttributeNS(is,"xlink:href",this.value_)}getFlipRtl(){return this.flipRtl}setAlt(e){e!==this.altText&&(this.altText=e||"",this.imageElement&&this.imageElement.setAttribute("alt",this.altText))}showEditor_(){this.clickHandler&&this.clickHandler(this)}setOnClickHandler(e){this.clickHandler=e}getText_(){return this.altText}static fromJson(e){if(!e.src||!e.width||!e.height)throw Error("src, width, and height values for an image field arerequired. The width and height must be non-zero.");return new this(e.src,e.width,e.height,void 0,void 0,void 0,e)}};Ci.Y_PADDING=1,Us("field_image",Ci),Ci.prototype.DEFAULT_VALUE="";var Vl=class extends lt{constructor(e,t,o){super(lt.SKIP_SETUP),this.spellcheck_=!0,this.htmlInput_=null,this.isTextValid_=this.isBeingEdited_=!1,this.onKeyInputWrapper=this.onKeyDownWrapper=this.valueWhenEditorWasOpened_=null,this.fullBlockClickTarget_=!1,this.workspace_=null,this.SERIALIZABLE=!0,this.CURSOR="text",e!==lt.SKIP_SETUP&&(o&&this.configure_(o),this.setValue(e),t&&this.setValidator(t))}configure_(e){super.configure_(e),e.spellcheck!==void 0&&(this.spellcheck_=e.spellcheck)}initView(){if(!this.getSourceBlock())throw new _t;super.initView(),this.isFullBlockField()&&(this.clickTarget_=this.sourceBlock_.getSvgRoot())}isFullBlockField(){const e=this.getSourceBlock();if(!e)throw new _t;let t;return this.fullBlockClickTarget_=!((t=this.getConstants())==null||!t.FULL_BLOCK_FIELDS)&&e.isSimpleReporter()}doValueInvalid_(e,t=!0){this.isBeingEdited_&&(this.isDirty_=!0,this.isTextValid_=!1,e=this.value_,this.value_=this.valueWhenEditorWasOpened_,this.sourceBlock_&&C()&&this.value_!==e&&t&&z(new(ne(ee.BLOCK_CHANGE))(this.sourceBlock_,"field",this.name||null,e,this.value_)))}doValueUpdate_(e){this.isTextValid_=this.isDirty_=!0,this.value_=e}applyColour(){const e=this.getSourceBlock();if(!e)throw new _t;this.getConstants().FULL_BLOCK_FIELDS&&this.fieldGroup_&&(!this.isFullBlockField()&&this.borderRect_?(this.borderRect_.style.display="block",this.borderRect_.setAttribute("stroke",e.getColourTertiary())):(this.borderRect_.style.display="none",e.pathObject.svgPath.setAttribute("fill",this.getConstants().FIELD_BORDER_RECT_COLOUR)))}getSize(){let e;return(e=this.getConstants())!=null&&e.FULL_BLOCK_FIELDS&&(this.render_(),this.isDirty_=!1),super.getSize()}onLocationChange(){this.isBeingEdited_&&this.resizeEditor_()}render_(){if(super.render_(),this.isBeingEdited_){var e=this.htmlInput_;this.isTextValid_?(ze(e,"blocklyInvalidInput"),xt(e,Et.INVALID,!1)):(Oe(e,"blocklyInvalidInput"),xt(e,Et.INVALID,!0))}if(e=this.getSourceBlock(),!e)throw new _t;this.getConstants().FULL_BLOCK_FIELDS&&e.applyColour()}setSpellcheck(e){e!==this.spellcheck_&&(this.spellcheck_=e,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))}showEditor_(e,t=!1){this.workspace_=this.sourceBlock_.workspace,!t&&this.workspace_.options.modalInputs&&(Ab||wh||ll)?this.showPromptEditor():this.showInlineEditor(t)}showPromptEditor(){Ea(i.Msg$$module$build$src$core$msg.CHANGE_VALUE_TITLE,this.getText(),e=>{e!==null&&this.setValue(this.getValueFromEditorText_(e)),this.onFinishEditing_(this.value_)})}showInlineEditor(e){const t=this.getSourceBlock();if(!t)throw new _t;ja(this,t.RTL,this.widgetDispose_.bind(this),this.workspace_),this.htmlInput_=this.widgetCreate_(),this.isBeingEdited_=!0,this.valueWhenEditorWasOpened_=this.value_,e||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())}widgetCreate_(){var e=this.getSourceBlock();if(!e)throw new _t;i.setGroup$$module$build$src$core$events$utils(!0);const t=oi();var o=this.getClickTarget_();if(!o)throw Error("A click target has not been set.");Oe(o,"editing"),o=document.createElement("input"),o.className="blocklyHtmlInput",o.setAttribute("spellcheck",this.spellcheck_);const n=this.workspace_.getScale();var u=this.getConstants().FIELD_TEXT_FONTSIZE*n+"pt";return t.style.fontSize=u,o.style.fontSize=u,u=Vl.BORDERRADIUS*n+"px",this.isFullBlockField()&&(u=this.getScaledBBox(),u=(u.bottom-u.top)/2+"px",e=e.getParent()?e.getParent().getColourTertiary():this.sourceBlock_.getColourTertiary(),o.style.border=1*n+"px solid "+e,t.style.borderRadius=u,t.style.transition="box-shadow 0.25s ease 0s",this.getConstants().FIELD_TEXTINPUT_BOX_SHADOW&&(t.style.boxShadow="rgba(255, 255, 255, 0.3) 0 0 0 "+4*n+"px")),o.style.borderRadius=u,t.appendChild(o),o.value=o.defaultValue=this.getEditorText_(this.value_),o.setAttribute("data-untyped-default-value",String(this.value_)),this.resizeEditor_(),this.bindInputEvents_(o),o}widgetDispose_(){this.isBeingEdited_=!1,this.isTextValid_=!0,this.forceRerender(),this.onFinishEditing_(this.value_),this.sourceBlock_&&C()&&this.valueWhenEditorWasOpened_!==null&&this.valueWhenEditorWasOpened_!==this.value_&&(z(new(ne(ee.BLOCK_CHANGE))(this.sourceBlock_,"field",this.name||null,this.valueWhenEditorWasOpened_,this.value_)),this.valueWhenEditorWasOpened_=null),i.setGroup$$module$build$src$core$events$utils(!1),this.unbindInputEvents_();var e=oi().style;if(e.width="auto",e.height="auto",e.fontSize="",e.transition="",e.boxShadow="",this.htmlInput_=null,e=this.getClickTarget_(),!e)throw Error("A click target has not been set.");ze(e,"editing")}onFinishEditing_(e){}bindInputEvents_(e){this.onKeyDownWrapper=H(e,"keydown",this,this.onHtmlInputKeyDown_),this.onKeyInputWrapper=H(e,"input",this,this.onHtmlInputChange)}unbindInputEvents_(){this.onKeyDownWrapper&&(V(this.onKeyDownWrapper),this.onKeyDownWrapper=null),this.onKeyInputWrapper&&(V(this.onKeyInputWrapper),this.onKeyInputWrapper=null)}onHtmlInputKeyDown_(e){e.key==="Enter"?(ii(this),js()):e.key==="Escape"?(this.setValue(this.htmlInput_.getAttribute("data-untyped-default-value"),!1),ii(this),js()):e.key==="Tab"&&(ii(this),js(),this.sourceBlock_.tab(this,!e.shiftKey),e.preventDefault())}onHtmlInputChange(e){e=this.value_,this.setValue(this.getValueFromEditorText_(this.htmlInput_.value),!1),this.sourceBlock_&&C()&&this.value_!==e&&z(new(ne(ee.BLOCK_FIELD_INTERMEDIATE_CHANGE))(this.sourceBlock_,this.name||null,e,this.value_))}setEditorValue_(e,t=!0){this.isDirty_=!0,this.isBeingEdited_&&(this.htmlInput_.value=this.getEditorText_(e)),this.setValue(e,t)}resizeEditor_(){Ts().then(()=>{const e=this.getSourceBlock();if(!e)throw new _t;const t=oi(),o=this.getScaledBBox();t.style.width=o.right-o.left+"px",t.style.height=o.bottom-o.top+"px";const n=o.top;t.style.left=`${e.RTL?o.right-t.offsetWidth:o.left}px`,t.style.top=`${n}px`})}repositionForWindowResize(){let e;const t=(e=this.getSourceBlock())==null?void 0:e.getRootBlock();return t instanceof $s?(Ji(this.workspace_,this.workspace_.getMetricsManager().getViewMetrics(!0),t)||this.resizeEditor_(),!0):!1}isTabNavigable(){return!0}getText_(){return this.isBeingEdited_&&this.htmlInput_?this.htmlInput_.value:null}getEditorText_(e){return`${e}`}getValueFromEditorText_(e){return e}};Vl.BORDERRADIUS=4;var Kl=class extends Vl{constructor(e,t,o){super(e,t,o)}doClassValidation_(e){return e===void 0?null:`${e}`}static fromJson(e){return new this(bt(e.text),void 0,e)}};Us("field_input",Kl),Kl.prototype.DEFAULT_VALUE="";var Xv=class extends rp{constructor(e){super(e)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(e){return!!e.outputConnection}hasRightSquareCorner(e){return!!e.outputConnection&&!e.statementInputCount&&!e.nextConnection}},Yl=class extends xr{constructor(e,t){if(super(e,t),this.connectedBottomNextConnection=!1,this.connectedBlock){for(e=this.connectedBlock;t=e.getNextBlock();)e=t;e.nextConnection||(this.height=this.connectedBlockHeight,this.connectedBottomNextConnection=!0)}}},Zv=class extends Vs{constructor(e){super(e),this.width=this.height=0,this.type|=F.getType("RIGHT_CONNECTION")}},Qv=class extends dp{constructor(e){super(e)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(e){const t=(e.hat?e.hat==="cap":this.constants_.ADD_START_HATS)&&!e.outputConnection&&!e.previousConnection;return!!e.outputConnection||t}hasRightSquareCorner(e){return!!e.outputConnection&&!e.statementInputCount&&!e.nextConnection}},ey=class extends Or{constructor(e,t){super(e,t),this.isInline=!0,this.renderer_=e,this.constants_=this.renderer_.getConstants(),this.topRow=new Qv(this.constants_),this.bottomRow=new Xv(this.constants_),this.isMultiRow=!t.getInputsInline()||t.isCollapsed(),this.hasStatementInput=0=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!n.precedesStatement,F.isInputRow(g)&&g.hasStatement){g.measure();let I,L;t=g.width-((L=(I=g.getLastInput())==null?void 0:I.width)!=null?L:0)+e}else if(o&&(u===2||n)&&F.isInputRow(g)&&!g.hasStatement){n=g.xPos,o=null;for(let I=0;Io?o:this.height/2,t-o*(1-Math.sin(Math.acos((o-this.constants_.SMALL_PADDING)/o)))):0;if(F.isInlineInput(e)&&e instanceof zo){const u=e.connectedBlock;return e=u?u.pathObject.outputShapeType:e.shape.type,e==null||u&&u.outputConnection&&(u.statementInputCount||u.nextConnection)||o===n.SHAPES.HEXAGONAL&&o!==e?0:t-this.constants_.SHAPE_IN_SHAPE_PADDING[o][e]}return F.isField(e)&&e instanceof hn?o===n.SHAPES.ROUND&&e.field instanceof Kl?t-2.75*n.GRID_UNIT:t-this.constants_.SHAPE_IN_SHAPE_PADDING[o][0]:F.isIcon(e)?this.constants_.SMALL_PADDING:0}finalizeVerticalAlignment_(){if(!this.outputConnection)for(let n=2;n=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!I.precedesStatement;if(e?this.topRow.hasPreviousConnection:u.followsStatement){var o=g.elements[1];if(o=g.elements.length===3&&o instanceof hn&&(o.field instanceof _i||o.field instanceof Ci),!e&&o)u.height-=this.constants_.SMALL_PADDING,I.height-=this.constants_.SMALL_PADDING,g.height-=this.constants_.MEDIUM_PADDING;else if(!e&&!t)u.height+=this.constants_.SMALL_PADDING;else if(t){for(e=!1,t=0;t{if(!n.isDeadOrDying()){i.disable$$module$build$src$core$events$utils();try{n==null||n.positionNearConnection(u,g,I),n==null||n.getSvgRoot().setAttribute("visibility","visible")}finally{i.enable$$module$build$src$core$events$utils()}}}),u}createInsertionMarker(e){const t=os(e,{addCoordinates:!1,addInputBlocks:!1,addNextBlocks:!1,doFullSerialization:!1});if(!t)throw Error(`Failed to serialize source block. ${e.toDevString()}`);e=lo(t,this.workspace);for(const o of e.getDescendants(!1))o.setInsertionMarker(!0);return e.initSvg(),e.getSvgRoot().setAttribute("visibility","hidden"),e}getMatchingConnection(e,t,o){if(e=e.getConnections_(!0),t=t.getConnections_(!0),e.length!==t.length)return null;for(let n=0;n{this.targetWorkspace.isDragging()||t.addSelect()})),this.listeners.push(ue(e,"pointerleave",t,()=>{this.targetWorkspace.isDragging()||t.removeSelect()})),this.listeners.push(ue(o,"pointerenter",t,()=>{this.targetWorkspace.isDragging()||t.addSelect()})),this.listeners.push(ue(o,"pointerleave",t,()=>{this.targetWorkspace.isDragging()||t.removeSelect()}))}blockMouseDown(e){return t=>{const o=this.targetWorkspace.getGesture(t);o&&(o.setStartBlock(e),o.handleFlyoutStart(t,this))}}onMouseDown(e){const t=this.targetWorkspace.getGesture(e);t&&t.handleFlyoutStart(e,this)}isBlockCreatable(e){return e.isEnabled()}createBlock(e){let t=null;i.disable$$module$build$src$core$events$utils();var o=this.targetWorkspace.getAllVariables();this.targetWorkspace.setResizesEnabled(!1);try{t=this.placeNewBlock(e)}finally{i.enable$$module$build$src$core$events$utils()}if(this.targetWorkspace.hideChaff(),e=qn(this.targetWorkspace,o),C()){for(i.setGroup$$module$build$src$core$events$utils(!0),o=0;o-t||e<-180+t||e>180-t}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const e=this.svgGroup_.getBoundingClientRect(),t=e.left;return this.toolboxPosition_===Ge.LEFT?new rt(-1e9,1e9,-1e9,t+e.width):new rt(-1e9,1e9,t,1e9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let e=0;var t=this.workspace_.getTopBlocks(!1);for(let n=0,u;u=t[n];n++){var o=u.getHeightWidth().width;u.outputConnection&&(o-=this.tabWidth_),e=Math.max(e,o)}for(let n=0,u;u=this.buttons_[n];n++)e=Math.max(e,u.width);if(e+=1.5*this.MARGIN+this.tabWidth_,e*=this.workspace_.scale,e+=yt.scrollbarThickness,this.width_!==e){for(let n=0,u;u=t[n];n++){if(this.RTL){o=u.getRelativeToSurfaceXY().x;let g=e/this.workspace_.scale-this.MARGIN;u.outputConnection||(g-=this.tabWidth_),u.moveBy(g-o,0)}this.rectMap_.has(u)&&this.moveRectToBlock_(this.rectMap_.get(u),u)}if(this.RTL)for(let n=0,u;u=this.buttons_[n];n++)t=u.getPosition().y,u.moveTo(e/this.workspace_.scale-u.width-this.MARGIN-this.tabWidth_,t);this.targetWorkspace.scrollbar||this.autoClose||this.targetWorkspace.getFlyout()!==this||this.toolboxPosition_!==Ge.LEFT||this.targetWorkspace.translate(this.targetWorkspace.scrollX+e,this.targetWorkspace.scrollY),this.width_=e,this.position(),this.targetWorkspace.resizeContents(),this.targetWorkspace.recordDragTargets()}}};Op.registryName="verticalFlyout",r($e.FLYOUTS_VERTICAL_TOOLBOX,Ws,Op);var ay=class extends Jl{constructor(e){super(e),this.horizontalLayout=!0}setMetrics_(e){if(this.isVisible()){var t=this.workspace_.getMetricsManager(),o=t.getScrollMetrics(),n=t.getViewMetrics();t=t.getAbsoluteMetrics(),typeof e.x=="number"&&(this.workspace_.scrollX=-(o.left+(o.width-n.width)*e.x)),this.workspace_.translate(this.workspace_.scrollX+t.left,this.workspace_.scrollY+t.top)}}getX(){return 0}getY(){if(!this.isVisible())return 0;var e=this.targetWorkspace.getMetricsManager();const t=e.getAbsoluteMetrics(),o=e.getViewMetrics();e=e.getToolboxMetrics();const n=this.toolboxPosition_===Ge.TOP;return this.targetWorkspace.toolboxPosition===this.toolboxPosition_?this.targetWorkspace.getToolbox()?n?e.height:o.height-this.height_:n?0:o.height:n?0:o.height+t.top-this.height_}position(){if(this.isVisible()&&this.targetWorkspace.isVisible()){var e=this.targetWorkspace.getMetricsManager().getViewMetrics();this.width_=e.width,this.setBackgroundPath(e.width-2*this.CORNER_RADIUS,this.height_-this.CORNER_RADIUS),e=this.getX();var t=this.getY();this.positionAt_(this.width_,this.height_,e,t)}}setBackgroundPath(e,t){const o=this.toolboxPosition_===Ge.TOP,n=["M 0,"+(o?0:this.CORNER_RADIUS)];o?(n.push("h",e+2*this.CORNER_RADIUS),n.push("v",t),n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,-this.CORNER_RADIUS,this.CORNER_RADIUS),n.push("h",-e),n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,-this.CORNER_RADIUS,-this.CORNER_RADIUS)):(n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,this.CORNER_RADIUS,-this.CORNER_RADIUS),n.push("h",e),n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,this.CORNER_RADIUS,this.CORNER_RADIUS),n.push("v",t),n.push("h",-e-2*this.CORNER_RADIUS)),n.push("z"),this.svgBackground_.setAttribute("d",n.join(" "))}scrollToStart(){let e;(e=this.workspace_.scrollbar)==null||e.setX(this.RTL?1/0:0)}wheel_(e){var t=Le(e);if(t=t.x||t.y){const o=this.workspace_.getMetricsManager(),n=o.getScrollMetrics();t=o.getViewMetrics().left-n.left+t;let u;(u=this.workspace_.scrollbar)==null||u.setX(t),tr(this.workspace_),js()}e.preventDefault(),e.stopPropagation()}layout_(e,t){this.workspace_.scale=this.targetWorkspace.scale;const o=this.MARGIN;let n=o+this.tabWidth_;this.RTL&&(e=e.reverse());for(let L=0,le;le=e[L];L++)if(le.type==="block"){var u=le.block;if(u==null)continue;var g=u.getDescendants(!1);for(let dt=0,ut;ut=g[dt];dt++)ut.isInFlyout=!0;g=u.getSvgRoot();const Ee=u.getHeightWidth();var I=u.outputConnection?this.tabWidth_:0;I=this.RTL?n+Ee.width:n-I,u.moveBy(I,o),I=this.createRect_(u,I,o,Ee,L),n+=Ee.width+t[L],this.addBlockListeners_(g,u,I)}else le.type==="button"&&(u=le.button,this.initFlyoutButton_(u,n,o),n+=u.width+t[L])}isDragTowardWorkspace(e){e=Math.atan2(e.y,e.x)/Math.PI*180;const t=this.dragAngleRange_;return e<90+t&&e>90-t||e>-90-t&&e<-90+t}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const e=this.svgGroup_.getBoundingClientRect(),t=e.top;return this.toolboxPosition_===Ge.TOP?new rt(-1e9,t+e.height,-1e9,1e9):new rt(t,1e9,-1e9,1e9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let e=0;const t=this.workspace_.getTopBlocks(!1);for(let n=0,u;u=t[n];n++)e=Math.max(e,u.getHeightWidth().height);const o=this.buttons_;for(let n=0,u;u=o[n];n++)e=Math.max(e,u.height);if(e+=1.5*this.MARGIN,e*=this.workspace_.scale,e+=yt.scrollbarThickness,this.height_!==e){for(let n=0,u;u=t[n];n++)this.rectMap_.has(u)&&this.moveRectToBlock_(this.rectMap_.get(u),u);this.targetWorkspace.scrollbar||this.autoClose||this.targetWorkspace.getFlyout()!==this||this.toolboxPosition_!==Ge.TOP||this.targetWorkspace.translate(this.targetWorkspace.scrollX,this.targetWorkspace.scrollY+e),this.height_=e,this.position(),this.targetWorkspace.resizeContents(),this.targetWorkspace.recordDragTargets()}}};r($e.FLYOUTS_HORIZONTAL_TOOLBOX,Ws,ay);var Lr=class extends Qt{constructor(e,t,o,n,u){super(lt.SKIP_SETUP),this.defaultType="",this.variableTypes=[],this.variable=null,this.SERIALIZABLE=!0,this.menuGenerator_=Lr.dropdownCreate,this.defaultVariableName=typeof e=="string"?e:"",this.size_=new Xe(0,0),e!==lt.SKIP_SETUP&&(u?this.configure_(u):this.setTypes(o,n),t&&this.setValidator(t))}configure_(e){super.configure_(e),this.setTypes(e.variableTypes,e.defaultType)}initModel(){var e=this.getSourceBlock();if(!e)throw new _t;this.variable||(e=i.getOrCreateVariablePackage$$module$build$src$core$variables(e.workspace,null,this.defaultVariableName,this.defaultType),this.doValueUpdate_(e.getId()))}shouldAddBorderRect_(){const e=this.getSourceBlock();if(!e)throw new _t;return super.shouldAddBorderRect_()&&(!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||e.type!=="variables_get")}fromXml(e){var t=this.getSourceBlock();if(!t)throw new _t;const o=e.getAttribute("id"),n=e.textContent,u=e.getAttribute("variabletype")||e.getAttribute("variableType")||"";if(t=i.getOrCreateVariablePackage$$module$build$src$core$variables(t.workspace,o,n,u),u!==null&&u!==t.type)throw Error("Serialized variable type with id '"+t.getId()+"' had type "+t.type+", and does not match variable field that references it: "+zs(e)+".");this.setValue(t.getId())}toXml(e){return this.initModel(),e.id=this.variable.getId(),e.textContent=this.variable.name,this.variable.type&&e.setAttribute("variabletype",this.variable.type),e}saveState(e){var t=this.saveLegacyState(Lr);return t!==null||(this.initModel(),t={id:this.variable.getId()},e&&(t.name=this.variable.name,t.type=this.variable.type)),t}loadState(e){const t=this.getSourceBlock();if(!t)throw new _t;this.loadLegacyState(Lr,e)||(e=i.getOrCreateVariablePackage$$module$build$src$core$variables(t.workspace,e.id||null,e.name,e.type||""),this.setValue(e.getId()))}setSourceBlock(e){if(e.isShadow())throw Error("Variable fields are not allowed to exist on shadow blocks.");super.setSourceBlock(e)}getValue(){return this.variable?this.variable.getId():null}getText(){return this.variable?this.variable.name:""}getVariable(){return this.variable}getValidator(){return this.variable?this.validator_:null}doClassValidation_(e){if(e===null)return null;var t=this.getSourceBlock();if(!t)throw new _t;return t=i.getVariable$$module$build$src$core$variables(t.workspace,e),t?(t=t.type,this.typeIsAllowed(t)?e:(console.warn("Variable type doesn't match this field! Type was "+t),null)):(console.warn("Variable id doesn't point to a real variable! ID was "+e),null)}doValueUpdate_(e){const t=this.getSourceBlock();if(!t)throw new _t;this.variable=i.getVariable$$module$build$src$core$variables(t.workspace,e),super.doValueUpdate_(e)}typeIsAllowed(e){const t=this.getVariableTypes();if(!t)return!0;for(let o=0;othis.max_&&(e.max=`${this.max_}`,xt(e,Et.VALUEMAX,this.max_)),e}static fromJson(e){return new this(e.value,void 0,void 0,void 0,void 0,e)}};Us("field_number",Rp),Rp.prototype.DEFAULT_VALUE=0;var ly=class extends _i{constructor(e,t,o){super(String(e??""),t,o),this.EDITABLE=!1,this.SERIALIZABLE=!0}static fromJson(e){return new this(bt(e.text),void 0,e)}};Us("field_label_serializable",ly);var Ti=class extends lt{constructor(e,t,o){super(lt.SKIP_SETUP),this.SERIALIZABLE=!0,this.CURSOR="default",this.value_=this.value_,this.checkChar=Ti.CHECK_CHAR,e!==lt.SKIP_SETUP&&(o&&this.configure_(o),this.setValue(e),t&&this.setValidator(t))}configure_(e){super.configure_(e),e.checkCharacter&&(this.checkChar=e.checkCharacter)}saveState(){const e=this.saveLegacyState(Ti);return e!==null?e:this.getValueBoolean()}initView(){super.initView();const e=this.getTextElement();Oe(e,"blocklyCheckbox"),e.style.display=this.value_?"block":"none"}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_(this.getConstants().FIELD_CHECKBOX_X_OFFSET)}getDisplayText_(){return this.checkChar}setCheckCharacter(e){this.checkChar=e||Ti.CHECK_CHAR,this.forceRerender()}showEditor_(){this.setValue(!this.value_)}doClassValidation_(e){return e===!0||e==="TRUE"?"TRUE":e===!1||e==="FALSE"?"FALSE":null}doValueUpdate_(e){this.value_=this.convertValueToBool(e),this.textElement_&&(this.textElement_.style.display=this.value_?"block":"none")}getValue(){return this.value_?"TRUE":"FALSE"}getValueBoolean(){return this.value_}getText(){return String(this.convertValueToBool(this.value_))}convertValueToBool(e){return typeof e=="string"?e==="TRUE":!!e}static fromJson(e){return new this(e.checked,void 0,e)}};Ti.CHECK_CHAR="✓",Us("field_checkbox",Ti),Ti.prototype.DEFAULT_VALUE=!1;var cy=class{constructor(e,t){this.draggable=e,this.workspace=t,this.dragTarget=null,this.startLoc=e.getRelativeToSurfaceXY()}onDragStart(e){this.draggable.startDrag(e)}onDrag(e,t){this.moveDraggable(e,t),t=this.getRoot(this.draggable),ds(t)&&t.setDeleteStyle(this.wouldDeleteDraggable(e,t)),this.updateDragTarget(e)}updateDragTarget(e){e=this.workspace.getDragTarget(e);const t=this.getRoot(this.draggable);if(this.dragTarget!==e){let o;(o=this.dragTarget)==null||o.onDragExit(t),e==null||e.onDragEnter(t)}e==null||e.onDragOver(t),this.dragTarget=e}moveDraggable(e,t){t=this.pixelsToWorkspaceUnits(t),t=ye.sum(this.startLoc,t),this.draggable.drag(t,e)}wouldDeleteDraggable(e,t){return(e=this.workspace.getDragTarget(e))&&this.workspace.getComponentManager().hasCapability(e.id,gt.Capability.DELETE_AREA)?e.wouldDelete(t):!1}onDragEnd(e){const t=i.getGroup$$module$build$src$core$events$utils();var o=this.workspace.getDragTarget(e);const n=this.getRoot(this.draggable);if(o){let u;(u=this.dragTarget)==null||u.onDrop(n)}this.shouldReturnToStart(e,n)&&this.draggable.revertDrag(),(o=ds(n)&&this.wouldDeleteDraggable(e,n))&&this.draggable instanceof $s&&Wa(this.draggable.getRootBlock()),this.draggable.endDrag(e),o&&ds(n)&&(e=i.getGroup$$module$build$src$core$events$utils(),i.setGroup$$module$build$src$core$events$utils(t),n.dispose(),i.setGroup$$module$build$src$core$events$utils(e))}getRoot(e){return e instanceof $s?e.getRootBlock():e}shouldReturnToStart(e,t){return(e=this.workspace.getDragTarget(e))?e.shouldPreventMove(t):!1}pixelsToWorkspaceUnits(e){return e=new ye(e.x/this.workspace.scale,e.y/this.workspace.scale),this.workspace.isMutator&&e.scale(1/this.workspace.options.parentWorkspace.scale),e}};r($e.BLOCK_DRAGGER,Ws,cy);var Pr={};Pr.BlockDragStrategy=Bv,Pr.BubbleDragStrategy=yv,Pr.CommentDragStrategy=gv,Pr.Dragger=cy;var Np=class extends Ss{constructor(e,t,o){super(e?e.workspace.id:void 0),this.type=ee.BLOCK_DRAG,e&&(this.blockId=e.id,this.isStart=t,this.blocks=o)}toJson(){const e=super.toJson();if(this.isStart===void 0)throw Error("Whether this event is the start of a drag is undefined. Either pass the value to the constructor, or call fromJson");if(this.blockId===void 0)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");return e.isStart=this.isStart,e.blockId=this.blockId,e.blocks=this.blocks,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Np),t.isStart=e.isStart,t.blockId=e.blockId,t.blocks=e.blocks,t}};r($e.EVENT,ee.BLOCK_DRAG,Np);var Mp=class extends gi{constructor(e,t,o,n){super(e),this.type=ee.BLOCK_FIELD_INTERMEDIATE_CHANGE,this.recordUndo=!1,e&&(this.name=t,this.oldValue=o,this.newValue=n)}toJson(){const e=super.toJson();if(!this.name)throw Error("The changed field name is undefined. Either pass a name to the constructor, or call fromJson.");return e.name=this.name,e.oldValue=this.oldValue,e.newValue=this.newValue,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Mp),t.name=e.name,t.oldValue=e.oldValue,t.newValue=e.newValue,t}isNull(){return this.oldValue===this.newValue}run(e){var t=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");if(t=t.getBlockById(this.blockId),!t)throw Error("The associated block is undefined. Either pass a block to the constructor, or call fromJson");e=e?this.newValue:this.oldValue,(t=t.getField(this.name))?t.setValue(e):console.warn("Can't set non-existent field: "+this.name)}};r($e.EVENT,ee.BLOCK_FIELD_INTERMEDIATE_CHANGE,Mp);var Lp=class extends gi{constructor(e){super(e),this.type=ee.BLOCK_MOVE,e&&(e.isShadow()&&(this.recordUndo=!1),e=this.currentLocation(),this.oldParentId=e.parentId,this.oldInputName=e.inputName,this.oldCoordinate=e.coordinate)}toJson(){const e=super.toJson();return e.oldParentId=this.oldParentId,e.oldInputName=this.oldInputName,this.oldCoordinate&&(e.oldCoordinate=`${Math.round(this.oldCoordinate.x)}, ${Math.round(this.oldCoordinate.y)}`),e.newParentId=this.newParentId,e.newInputName=this.newInputName,this.newCoordinate&&(e.newCoordinate=`${Math.round(this.newCoordinate.x)}, ${Math.round(this.newCoordinate.y)}`),this.reason&&(e.reason=this.reason),this.recordUndo||(e.recordUndo=this.recordUndo),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Lp),t.oldParentId=e.oldParentId,t.oldInputName=e.oldInputName,e.oldCoordinate&&(o=e.oldCoordinate.split(","),t.oldCoordinate=new ye(Number(o[0]),Number(o[1]))),t.newParentId=e.newParentId,t.newInputName=e.newInputName,e.newCoordinate&&(o=e.newCoordinate.split(","),t.newCoordinate=new ye(Number(o[0]),Number(o[1]))),e.reason!==void 0&&(t.reason=e.reason),e.recordUndo!==void 0&&(t.recordUndo=e.recordUndo),t}recordNew(){const e=this.currentLocation();this.newParentId=e.parentId,this.newInputName=e.inputName,this.newCoordinate=e.coordinate}setReason(e){this.reason=e}currentLocation(){var e=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");var t=e.getBlockById(this.blockId);if(!t)throw Error("The block associated with the block move event could not be found");e={};const o=t.getParent();return o?(e.parentId=o.id,(t=o.getInputWithBlock(t))&&(e.inputName=t.name)):e.coordinate=t.getRelativeToSurfaceXY(),e}isNull(){return this.oldParentId===this.newParentId&&this.oldInputName===this.newInputName&&ye.equals(this.oldCoordinate,this.newCoordinate)}run(e){var t=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");var o=t.getBlockById(this.blockId);if(o){var n=e?this.newParentId:this.oldParentId,u=e?this.newInputName:this.oldInputName;if(e=e?this.newCoordinate:this.oldCoordinate,n){var g=t.getBlockById(n);if(!g){console.warn("Can't connect to non-existent block: "+n);return}}if(o.getParent()&&o.unplug(),e)u=o.getRelativeToSurfaceXY(),o.moveBy(e.x-u.x,e.y-u.y,this.reason);else{t=o.outputConnection,(!t||o.previousConnection&&o.previousConnection.isConnected())&&(t=o.previousConnection);let I,L;o=(L=t)==null?void 0:L.type,u?(o=g.getInput(u))&&(I=o.connection):o===xe.PREVIOUS_STATEMENT&&(I=g.nextConnection),I&&t?t.connect(I):console.warn("Can't connect to non-existent input: "+u)}}else console.warn("Can't move non-existent block: "+this.blockId)}};r($e.EVENT,ee.BLOCK_MOVE,Lp);var Pp=class extends Ss{constructor(e,t,o){super(e?e.workspace.id:void 0),this.type=ee.BUBBLE_OPEN,e&&(this.blockId=e.id,this.isOpen=t,this.bubbleType=o)}toJson(){const e=super.toJson();if(this.isOpen===void 0)throw Error("Whether this event is for opening the bubble is undefined. Either pass the value to the constructor, or call fromJson");if(!this.bubbleType)throw Error("The type of bubble is undefined. Either pass the value to the constructor, or call fromJson");return e.isOpen=this.isOpen,e.bubbleType=this.bubbleType,e.blockId=this.blockId||"",e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Pp),t.isOpen=e.isOpen,t.bubbleType=e.bubbleType,t.blockId=e.blockId,t}},Bp;(function(e){e.MUTATOR="mutator",e.COMMENT="comment",e.WARNING="warning"})(Bp||(Bp={})),r($e.EVENT,ee.BUBBLE_OPEN,Pp);var qs=class extends qi{constructor(e){super(),this.isBlank=!e,e&&(this.commentId=e.id,this.workspaceId=e.workspace.id,this.group=i.getGroup$$module$build$src$core$events$utils(),this.recordUndo=G())}toJson(){const e=super.toJson();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");return e.commentId=this.commentId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new qs),t.commentId=e.commentId,t}static CommentCreateDeleteHelper(e,t){const o=e.getEventWorkspace_();if(t){if(!e.json)throw Error("Encountered a comment event without proper json");Kn(e.json,o)}else{if(!e.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");(t=o.getCommentById(e.commentId))?t.dispose():console.warn("Can't delete non-existent comment: "+e.commentId)}}},Fp=class extends qs{constructor(e,t,o){super(e),this.type=ee.COMMENT_CHANGE,e&&(this.oldContents_=typeof t>"u"?"":t,this.newContents_=typeof o>"u"?"":o)}toJson(){const e=super.toJson();if(!this.oldContents_)throw Error("The old contents is undefined. Either pass a value to the constructor, or call fromJson");if(!this.newContents_)throw Error("The new contents is undefined. Either pass a value to the constructor, or call fromJson");return e.oldContents=this.oldContents_,e.newContents=this.newContents_,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Fp),t.oldContents_=e.oldContents,t.newContents_=e.newContents,t}isNull(){return this.oldContents_===this.newContents_}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(t=t.getCommentById(this.commentId)){var o=e?this.newContents_:this.oldContents_;if(o===void 0)throw Error(e?"The new contents is undefined. Either pass a value to the constructor, or call fromJson":"The old contents is undefined. Either pass a value to the constructor, or call fromJson");t.setText(o)}else console.warn("Can't change non-existent comment: "+this.commentId)}};r($e.EVENT,ee.COMMENT_CHANGE,Fp);var jp=class extends qs{constructor(e,t){super(e),this.newCollapsed=t,this.type=ee.COMMENT_COLLAPSE}toJson(){const e=super.toJson();if(this.newCollapsed===void 0)throw Error("The new collapse value undefined. Either call recordNew, or call fromJson");return e.newCollapsed=this.newCollapsed,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new jp),t.newCollapsed=e.newCollapsed,t}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");(t=t.getCommentById(this.commentId))?t.setCollapsed(e?!!this.newCollapsed:!this.newCollapsed):console.warn("Can't collapse or uncollapse non-existent comment: "+this.commentId)}};r($e.EVENT,ee.COMMENT_COLLAPSE,jp);var zp=class extends qs{constructor(e){super(e),this.type=ee.COMMENT_CREATE,e&&(this.xml=ir(e),this.json=Pi(e,{addCoordinates:!0}))}toJson(){const e=super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.json)throw Error("The comment JSON is undefined. Either pass a block to the constructor, or call fromJson");return e.xml=zs(this.xml),e.json=this.json,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new zp),t.xml=i.textToDom$$module$build$src$core$utils$xml(e.xml),t.json=e.json,t}run(e){qs.CommentCreateDeleteHelper(this,e)}};r($e.EVENT,ee.COMMENT_CREATE,zp);var Up=class extends qs{constructor(e){super(e),this.type=ee.COMMENT_DELETE,e&&(this.xml=ir(e),this.json=Pi(e,{addCoordinates:!0}))}run(e){qs.CommentCreateDeleteHelper(this,!e)}toJson(){const e=super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.json)throw Error("The comment JSON is undefined. Either pass a block to the constructor, or call fromJson");return e.xml=zs(this.xml),e.json=this.json,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Up),t.xml=i.textToDom$$module$build$src$core$utils$xml(e.xml),t.json=e.json,t}};r($e.EVENT,ee.COMMENT_DELETE,Up);var Hp=class extends Ss{constructor(e,t){super(e?e.workspace.id:void 0),this.type=ee.COMMENT_DRAG,e&&(this.commentId=e.id,this.isStart=t)}toJson(){const e=super.toJson();if(this.isStart===void 0)throw Error("Whether this event is the start of a drag is undefined. Either pass the value to the constructor, or call fromJson");if(this.commentId===void 0)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");return e.isStart=this.isStart,e.commentId=this.commentId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Hp),t.isStart=e.isStart,t.commentId=e.commentId,t}};r($e.EVENT,ee.COMMENT_DRAG,Hp);var Wp=class extends qs{constructor(e){super(e),this.type=ee.COMMENT_MOVE,e&&(this.comment_=e,this.oldCoordinate_=e.getRelativeToSurfaceXY())}recordNew(){if(this.newCoordinate_)throw Error("Tried to record the new position of a comment on the same event twice.");if(!this.comment_)throw Error("The comment is undefined. Pass a comment to the constructor if you want to use the record functionality");this.newCoordinate_=this.comment_.getRelativeToSurfaceXY()}setReason(e){this.reason=e}setOldCoordinate(e){this.oldCoordinate_=e}toJson(){const e=super.toJson();if(!this.oldCoordinate_)throw Error("The old comment position is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.newCoordinate_)throw Error("The new comment position is undefined. Either call recordNew, or call fromJson");return e.oldCoordinate=`${Math.round(this.oldCoordinate_.x)}, ${Math.round(this.oldCoordinate_.y)}`,e.newCoordinate=Math.round(this.newCoordinate_.x)+","+Math.round(this.newCoordinate_.y),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Wp),o=e.oldCoordinate.split(","),t.oldCoordinate_=new ye(Number(o[0]),Number(o[1])),o=e.newCoordinate.split(","),t.newCoordinate_=new ye(Number(o[0]),Number(o[1])),t}isNull(){return ye.equals(this.oldCoordinate_,this.newCoordinate_)}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(t=t.getCommentById(this.commentId)){if(e=e?this.newCoordinate_:this.oldCoordinate_,!e)throw Error("Either oldCoordinate_ or newCoordinate_ is undefined. Either pass a comment to the constructor and call recordNew, or call fromJson");t.moveTo(e)}else console.warn("Can't move non-existent comment: "+this.commentId)}};r($e.EVENT,ee.COMMENT_MOVE,Wp);var Gp=class extends qs{constructor(e){super(e),this.type=ee.COMMENT_RESIZE,e&&(this.oldSize=e.getSize())}recordCurrentSizeAsNewSize(){if(this.newSize)throw Error("Tried to record the new size of a comment on the same event twice.");var e=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(e=e.getCommentById(this.commentId),!e)throw Error("The comment associated with the comment resize event could not be found");this.newSize=e.getSize()}toJson(){const e=super.toJson();if(!this.oldSize)throw Error("The old comment size is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.newSize)throw Error("The new comment size is undefined. Either call recordCurrentSizeAsNewSize, or call fromJson");return e.oldWidth=Math.round(this.oldSize.width),e.oldHeight=Math.round(this.oldSize.height),e.newWidth=Math.round(this.newSize.width),e.newHeight=Math.round(this.newSize.height),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Gp),t.oldSize=new Xe(e.oldWidth,e.oldHeight),t.newSize=new Xe(e.newWidth,e.newHeight),t}isNull(){return Xe.equals(this.oldSize,this.newSize)}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(t=t.getCommentById(this.commentId)){if(e=e?this.newSize:this.oldSize,!e)throw Error("Either oldSize or newSize is undefined. Either pass a comment to the constructor and call recordCurrentSizeAsNewSize, or call fromJson");t.setSize(e)}else console.warn("Can't resize non-existent comment: "+this.commentId)}};r($e.EVENT,ee.COMMENT_RESIZE,Gp);var Vp=class extends Ss{constructor(e,t,o){super(o),this.type=ee.TOOLBOX_ITEM_SELECT,this.oldItem=e??void 0,this.newItem=t??void 0}toJson(){const e=super.toJson();return e.oldItem=this.oldItem,e.newItem=this.newItem,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Vp),t.oldItem=e.oldItem,t.newItem=e.newItem,t}};r($e.EVENT,ee.TOOLBOX_ITEM_SELECT,Vp);var uy=class extends qi{constructor(e){super(),this.isBlank=!0,this.recordUndo=!1,this.type=ee.FINISHED_LOADING,this.isBlank=!!e,e&&(this.workspaceId=e.id)}};r($e.EVENT,ee.FINISHED_LOADING,uy);var dy,hy,py,gy,my,fy,$y,by,vy,yy,_y,wy,ky,Cy,Ty,Sy,Ey,Iy,xy,Dy,Ay,Oy,Ry,Ny,My,Se;i.BLOCK_CHANGE$$module$build$src$core$events$events=ee.BLOCK_CHANGE,i.BLOCK_CREATE$$module$build$src$core$events$events=ee.BLOCK_CREATE,i.BLOCK_DELETE$$module$build$src$core$events$events=ee.BLOCK_DELETE,dy=ee.BLOCK_DRAG,i.BLOCK_MOVE$$module$build$src$core$events$events=ee.BLOCK_MOVE,hy=ee.BLOCK_FIELD_INTERMEDIATE_CHANGE,py=ee.BUBBLE_OPEN,gy=ee.BLOCK_CHANGE,my=ee.CLICK,fy=ee.COMMENT_CHANGE,$y=ee.COMMENT_CREATE,by=ee.COMMENT_DELETE,vy=ee.COMMENT_MOVE,yy=ee.COMMENT_RESIZE,_y=ee.COMMENT_DRAG,wy=ee.BLOCK_CREATE,ky=ee.BLOCK_DELETE,Cy=ee.FINISHED_LOADING,Ty=ee.MARKER_MOVE,Sy=ee.BLOCK_MOVE,Ey=ee.SELECTED,Iy=ee.THEME_CHANGE,xy=ee.TOOLBOX_ITEM_SELECT,Dy=ee.TRASHCAN_OPEN,Ay=ee.UI,Oy=ee.VAR_CREATE,Ry=ee.VAR_DELETE,Ny=ee.VAR_RENAME,My=ee.VIEWPORT_CHANGE,Se={},Se.Abstract=qi,Se.BLOCK_CHANGE=i.BLOCK_CHANGE$$module$build$src$core$events$events,Se.BLOCK_CREATE=i.BLOCK_CREATE$$module$build$src$core$events$events,Se.BLOCK_DELETE=i.BLOCK_DELETE$$module$build$src$core$events$events,Se.BLOCK_DRAG=dy,Se.BLOCK_FIELD_INTERMEDIATE_CHANGE=hy,Se.BLOCK_MOVE=i.BLOCK_MOVE$$module$build$src$core$events$events,Se.BUBBLE_OPEN=py,Se.BUMP_EVENTS=db,Se.BlockBase=gi,Se.BlockChange=mi,Se.BlockCreate=Qh,Se.BlockDelete=hp,Se.BlockDrag=Np,Se.BlockFieldIntermediateChange=Mp,Se.BlockMove=Lp,Se.BubbleOpen=Pp,Se.BubbleType=Bp,Se.CHANGE=gy,Se.CLICK=my,Se.COMMENT_CHANGE=fy,Se.COMMENT_CREATE=$y,Se.COMMENT_DELETE=by,Se.COMMENT_DRAG=_y,Se.COMMENT_MOVE=vy,Se.COMMENT_RESIZE=yy,Se.CREATE=wy,Se.Click=bh,Se.ClickTarget=vh,Se.CommentBase=qs,Se.CommentChange=Fp,Se.CommentCollapse=jp,Se.CommentCreate=zp,Se.CommentDelete=Up,Se.CommentDrag=Hp,Se.CommentMove=Wp,Se.CommentResize=Gp,Se.DELETE=ky,Se.FINISHED_LOADING=Cy,Se.FinishedLoading=uy,Se.MARKER_MOVE=Ty,Se.MOVE=Sy,Se.MarkerMove=pp,Se.SELECTED=Ey,Se.Selected=_p,Se.THEME_CHANGE=Iy,Se.TOOLBOX_ITEM_SELECT=xy,Se.TRASHCAN_OPEN=Dy,Se.ThemeChange=ep,Se.ToolboxItemSelect=Vp,Se.TrashcanOpen=kp,Se.UI=Ay,Se.UiBase=Ss,Se.VAR_CREATE=Oy,Se.VAR_DELETE=Ry,Se.VAR_RENAME=Ny,Se.VIEWPORT_CHANGE=My,Se.VarBase=br,Se.VarCreate=Fh,Se.VarDelete=bp,Se.VarRename=vp,Se.ViewportChange=tp,Se.clearPendingUndo=K,Se.disable=i.disable$$module$build$src$core$events$utils,Se.disableOrphans=me,Se.enable=i.enable$$module$build$src$core$events$utils,Se.filter=R,Se.fire=z,Se.fromJson=ce,Se.get=ne,Se.getDescendantIds=ve,Se.getGroup=i.getGroup$$module$build$src$core$events$utils,Se.getRecordUndo=G,Se.isEnabled=C,Se.setGroup=i.setGroup$$module$build$src$core$events$utils,Se.setRecordUndo=i.setRecordUndo$$module$build$src$core$events$utils;var Os={};Os.BottomRow=Xv,Os.ConstantProvider=Jv,Os.Drawer=qv,Os.MarkerSvg=ty,Os.PathObject=sy,Os.RenderInfo=ey,Os.Renderer=Ap,Os.RightConnectionShape=Zv,Os.StatementInput=Yl,Os.TopRow=Qv,gh();var It={};It.registerCleanup=Zd,It.registerCollapse=eh,It.registerCollapseExpandBlock=ah,It.registerComment=nh,It.registerCommentCreate=ph,It.registerCommentDelete=dh,It.registerCommentDuplicate=hh,It.registerCommentOptions=nb,It.registerDefaultOptions=gh,It.registerDelete=ch,It.registerDeleteAll=oh,It.registerDisable=lh,It.registerDuplicate=ih,It.registerExpand=th,It.registerHelp=uh,It.registerInline=rh,It.registerRedo=Xd,It.registerUndo=qd;var ql={};ql.CommentView=fv,ql.RenderedWorkspaceComment=Il,ql.WorkspaceComment=El;var Br={};Br.Bubble=nt,Br.MiniWorkspaceBubble=vo,Br.TextBubble=Sv,Br.TextInputBubble=_v;var Ly=class extends Pl{constructor(){super(),this.FIELD_TEXT_BASELINE_CENTER=!1,this.DARK_PATH_OFFSET=1,this.MAX_BOTTOM_WIDTH=30,this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT/2}getCSS_(e){return super.getCSS_(e).concat([`${e} .blocklyInsertionMarker>.blocklyPathLight,`,`${e} .blocklyInsertionMarker>.blocklyPathDark {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"])}},Py=class{constructor(e){this.inlineSteps_=this.steps_="",this.info_=e,this.RTL_=this.info_.RTL,e=e.getRenderer(),this.constants_=e.getConstants(),this.highlightConstants_=e.getHighlightConstants(),this.highlightOffset=this.highlightConstants_.OFFSET,this.outsideCornerPaths_=this.highlightConstants_.OUTSIDE_CORNER,this.insideCornerPaths_=this.highlightConstants_.INSIDE_CORNER,this.puzzleTabPaths_=this.highlightConstants_.PUZZLE_TAB,this.notchPaths_=this.highlightConstants_.NOTCH,this.startPaths_=this.highlightConstants_.START_HAT,this.jaggedTeethPaths_=this.highlightConstants_.JAGGED_TEETH}getPath(){return this.steps_+` +`+this.inlineSteps_}drawTopCorner(e){this.steps_+=pt(e.xPos,this.info_.startY);for(let t=0,o;o=e.elements[t];t++)F.isLeftSquareCorner(o)?this.steps_+=this.highlightConstants_.START_POINT:F.isLeftRoundedCorner(o)?this.steps_+=this.outsideCornerPaths_.topLeft(this.RTL_):F.isPreviousConnection(o)?this.steps_+=this.notchPaths_.pathLeft:F.isHat(o)?this.steps_+=this.startPaths_.path(this.RTL_):F.isSpacer(o)&&o.width!==0&&(this.steps_+=De("H",o.xPos+o.width-this.highlightOffset));this.steps_+=De("H",e.xPos+e.width-this.highlightOffset)}drawJaggedEdge_(e){this.info_.RTL&&(this.steps_+=this.jaggedTeethPaths_.pathLeft+De("v",e.height-this.jaggedTeethPaths_.height-this.highlightOffset))}drawValueInput(e){const t=e.getLastInput();if(this.RTL_){const o=e.height-t.connectionHeight;this.steps_+=St(t.xPos+t.width-this.highlightOffset,e.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)+De("v",o)}else this.steps_+=St(t.xPos+t.width,e.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)}drawStatementInput(e){const t=e.getLastInput();if(t)if(this.RTL_){const o=e.height-2*this.insideCornerPaths_.height;this.steps_+=St(t.xPos,e.yPos)+this.insideCornerPaths_.pathTop(this.RTL_)+De("v",o)+this.insideCornerPaths_.pathBottom(this.RTL_)+Hs(e.width-t.xPos-this.insideCornerPaths_.width,0)}else this.steps_+=St(t.xPos,e.yPos+e.height)+this.insideCornerPaths_.pathBottom(this.RTL_)+Hs(e.width-t.xPos-this.insideCornerPaths_.width,0)}drawRightSideRow(e){const t=e.xPos+e.width-this.highlightOffset;e instanceof up&&e.followsStatement&&(this.steps_+=De("H",t)),this.RTL_&&(this.steps_+=De("H",t),e.height>this.highlightOffset&&(this.steps_+=De("V",e.yPos+e.height-this.highlightOffset)))}drawBottomRow(e){if(this.RTL_)this.steps_+=De("V",e.baseline-this.highlightOffset);else{const t=this.info_.bottomRow.elements[0];F.isLeftSquareCorner(t)?this.steps_+=St(e.xPos+this.highlightOffset,e.baseline-this.highlightOffset):F.isLeftRoundedCorner(t)&&(this.steps_+=St(e.xPos,e.baseline),this.steps_+=this.outsideCornerPaths_.bottomLeft())}}drawLeft(){var e=this.info_.outputConnection;e&&(e=e.connectionOffsetY+e.height,this.RTL_?this.steps_+=St(this.info_.startX,e):(this.steps_+=St(this.info_.startX+this.highlightOffset,this.info_.bottomRow.baseline-this.highlightOffset),this.steps_+=De("V",e)),this.steps_+=this.puzzleTabPaths_.pathUp(this.RTL_)),this.RTL_||(e=this.info_.topRow,F.isLeftRoundedCorner(e.elements[0])?this.steps_+=De("V",this.outsideCornerPaths_.height):this.steps_+=De("V",e.capline+this.highlightOffset))}drawInlineInput(e){const t=this.highlightOffset,o=e.xPos+e.connectionWidth;var n=e.centerline-e.height/2;const u=e.width-e.connectionWidth,g=n+t;this.RTL_?(n=e.connectionOffsetY-t,e=e.height-(e.connectionOffsetY+e.connectionHeight)+t,this.inlineSteps_+=St(o-t,g)+De("v",n)+this.puzzleTabPaths_.pathDown(this.RTL_)+De("v",e)+De("h",u)):this.inlineSteps_+=St(e.xPos+e.width+t,g)+De("v",e.height)+De("h",-u)+St(o,n+e.connectionOffsetY)+this.puzzleTabPaths_.pathDown(this.RTL_)}},By=class extends Bl{constructor(e,t){super(e,t),this.highlighter_=new Py(t)}draw(){this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights();const e=this.block_.pathObject;e.setPath(this.outlinePath_+` +`+this.inlinePath_),e.setHighlightPath(this.highlighter_.getPath()),this.info_.RTL&&e.flipRTL(),this.recordSizeOnBlock_()}drawTop_(){this.highlighter_.drawTopCorner(this.info_.topRow),this.highlighter_.drawRightSideRow(this.info_.topRow),super.drawTop_()}drawJaggedEdge_(e){this.highlighter_.drawJaggedEdge_(e),super.drawJaggedEdge_(e)}drawValueInput_(e){this.highlighter_.drawValueInput(e),super.drawValueInput_(e)}drawStatementInput_(e){this.highlighter_.drawStatementInput(e),super.drawStatementInput_(e)}drawRightSideRow_(e){this.highlighter_.drawRightSideRow(e),this.outlinePath_+=De("H",e.xPos+e.width)+De("V",e.yPos+e.height)}drawBottom_(){this.highlighter_.drawBottomRow(this.info_.bottomRow),super.drawBottom_()}drawLeft_(){this.highlighter_.drawLeft(),super.drawLeft_()}drawInlineInput_(e){this.highlighter_.drawInlineInput(e),super.drawInlineInput_(e)}positionInlineInputConnection_(e){const t=e.centerline-e.height/2;if(e.connectionModel){let o=e.xPos+e.connectionWidth+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(o*=-1),e.connectionModel.setOffsetInBlock(o,t+e.connectionOffsetY+this.constants_.DARK_PATH_OFFSET)}}positionStatementInputConnection_(e){const t=e.getLastInput();if(t!=null&&t.connectionModel){let o=e.xPos+e.statementEdge+t.notchOffset;o=this.info_.RTL?-1*o:o+this.constants_.DARK_PATH_OFFSET,t.connectionModel.setOffsetInBlock(o,e.yPos+this.constants_.DARK_PATH_OFFSET)}}positionExternalValueConnection_(e){const t=e.getLastInput();if(t&&t.connectionModel){let o=e.xPos+e.width+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(o*=-1),t.connectionModel.setOffsetInBlock(o,e.yPos)}}positionNextConnection_(){const e=this.info_.bottomRow;if(e.connection){const t=e.connection,o=t.xPos;t.connectionModel.setOffsetInBlock((this.info_.RTL?-o:o)+this.constants_.DARK_PATH_OFFSET/2,e.baseline+this.constants_.DARK_PATH_OFFSET)}}},Fy=class{constructor(e){this.OFFSET=.5,this.constantProvider=e,this.START_POINT=pt(this.OFFSET,this.OFFSET)}init(){this.INSIDE_CORNER=this.makeInsideCorner(),this.OUTSIDE_CORNER=this.makeOutsideCorner(),this.PUZZLE_TAB=this.makePuzzleTab(),this.NOTCH=this.makeNotch(),this.JAGGED_TEETH=this.makeJaggedTeeth(),this.START_HAT=this.makeStartHat()}makeInsideCorner(){const e=this.constantProvider.CORNER_RADIUS,t=this.OFFSET,o=(1-Math.SQRT1_2)*(e+t)-t,n=pt(o,o)+vt("a","0 0,0",e,Me(-o-t,e-o)),u=vt("a","0 0,0",e+t,Me(e+t,e+t)),g=pt(o,-o)+vt("a","0 0,0",e+t,Me(e-o,o+t));return{width:e+t,height:e,pathTop(I){return I?n:""},pathBottom(I){return I?u:g}}}makeOutsideCorner(){const e=this.constantProvider.CORNER_RADIUS,t=this.OFFSET,o=(1-Math.SQRT1_2)*(e-t)+t,n=pt(o,o)+vt("a","0 0,1",e-t,Me(e-o,-o+t)),u=pt(t,e)+vt("a","0 0,1",e-t,Me(e,-e+t)),g=-o,I=pt(o,g)+vt("a","0 0,1",e-t,Me(-o+t,-g-e));return{height:e,topLeft(L){return L?n:u},bottomLeft(){return I}}}makePuzzleTab(){const e=this.constantProvider.TAB_WIDTH,t=this.constantProvider.TAB_HEIGHT,o=pt(-2,-t+3.4)+Hs(-.45*e,-2.1),n=De("v",2.5)+pt(.97*-e,2.5)+Xt("q",[Me(.05*-e,10),Me(.3*e,9.5)])+pt(.67*e,-1.9)+De("v",2.5),u=De("v",-1.5)+pt(-.92*e,-.5)+Xt("q",[Me(-.19*e,-5.5),Me(0,-11)])+pt(.92*e,1),g=pt(-5,t-.7)+Hs(.46*e,-2.1);return{width:e,height:t,pathUp(I){return I?o:u},pathDown(I){return I?n:g}}}makeNotch(){return{pathLeft:De("h",this.OFFSET)+this.constantProvider.NOTCH.pathLeft}}makeJaggedTeeth(){return{pathLeft:Hs(5.1,2.6)+pt(-10.2,6.8)+Hs(5.1,2.6),height:12,width:10.2}}makeStartHat(){const e=this.constantProvider.START_HAT.height,t=pt(25,-8.7)+Xt("c",[Me(29.7,-6.2),Me(57.2,-.5),Me(75,8.7)]),o=Xt("c",[Me(17.8,-9.2),Me(45.3,-14.9),Me(75,-8.7)])+St(100.5,e+.5);return{path(n){return n?t:o}}}},jy=class extends lp{constructor(e,t){super(e,t),this.constants_=e,this.connectedBlock&&(this.width+=this.constants_.DARK_PATH_OFFSET,this.height+=this.constants_.DARK_PATH_OFFSET)}},zy=class extends xr{constructor(e,t){super(e,t),this.constants_=e,this.connectedBlock&&(this.height+=this.constants_.DARK_PATH_OFFSET)}},Uy=class extends Or{constructor(e,t){super(e,t),this.renderer_=e}getRenderer(){return this.renderer_}populateBottomRow_(){super.populateBottomRow_(),this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1]instanceof ls||(this.bottomRow.minHeight=this.constants_.MEDIUM_PADDING-this.constants_.DARK_PATH_OFFSET)}addInput_(e,t){this.isInline&&e instanceof i.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new jy(this.constants_,e)),t.hasInlineInput=!0):e instanceof ls?(t.elements.push(new zy(this.constants_,e)),t.hasStatement=!0):e instanceof i.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new Ll(this.constants_,e)),t.hasExternalInput=!0):(e instanceof Ks||e instanceof Co)&&(t.minHeight=Math.max(t.minHeight,this.constants_.DUMMY_INPUT_MIN_HEIGHT),t.hasDummyInput=!0),this.isInline||t.align!==null||(t.align=e.align)}addElemSpacing_(){let e=!1;for(let o=0,n;n=this.rows[o];o++)n.hasExternalInput&&(e=!0);for(let o=0,n;n=this.rows[o];o++){var t=n.elements;if(n.elements=[],n.startsWithElemSpacer()&&n.elements.push(new as(this.constants_,this.getInRowSpacing_(null,t[0]))),t.length){for(let u=0;u>>/sprites.png); + height: 16px; + vertical-align: middle; + visibility: hidden; + width: 16px; +} + +.blocklyTreeIconClosed { + background-position: -32px -1px; +} + +.blocklyToolboxDiv[dir="RTL"] .blocklyTreeIconClosed { + background-position: 0 -1px; +} + +.blocklyTreeSelected>.blocklyTreeIconClosed { + background-position: -32px -17px; +} + +.blocklyToolboxDiv[dir="RTL"] .blocklyTreeSelected>.blocklyTreeIconClosed { + background-position: 0 -17px; +} + +.blocklyTreeIconOpen { + background-position: -16px -1px; +} + +.blocklyTreeSelected>.blocklyTreeIconOpen { + background-position: -16px -17px; +} + +.blocklyTreeLabel { + cursor: default; + font: 16px sans-serif; + padding: 0 3px; + vertical-align: middle; +} + +.blocklyToolboxDelete .blocklyTreeLabel { + cursor: url("<<>>/handdelete.cur"), auto; +} + +.blocklyTreeSelected .blocklyTreeLabel { + color: #fff; +} +`),r($e.TOOLBOX_ITEM,Rs.registrationName,Rs);var Fr=class extends Yp{constructor(e,t){super(e,t),this.cssConfig_={container:"blocklyTreeSeparator"},this.htmlDiv=null,Object.assign(this.cssConfig_,e.cssconfig||e.cssConfig)}init(){this.createDom_()}createDom_(){const e=document.createElement("div"),t=this.cssConfig_.container;return t&&Oe(e,t),this.htmlDiv=e}getDiv(){return this.htmlDiv}dispose(){Ze(this.htmlDiv)}};Fr.registrationName="sep",Be(` +.blocklyTreeSeparator { + border-bottom: solid #e5e5e5 1px; + height: 0; + margin: 5px 0; +} + +.blocklyToolboxDiv[layout="h"] .blocklyTreeSeparator { + border-right: solid #e5e5e5 1px; + border-bottom: none; + height: auto; + margin: 0 5px 0 5px; + padding: 5px 0; + width: 0; +} +`),r($e.TOOLBOX_ITEM,Fr.registrationName,Fr);var vn=class extends Rs{constructor(e,t,o){super(e,t,o),this.subcategoriesDiv_=null,this.expanded_=!1,this.toolboxItems_=[]}makeDefaultCssConfig_(){const e=super.makeDefaultCssConfig_();return e.contents="blocklyToolboxContents",e}parseContents_(e){if("custom"in e)this.flyoutItems_=e.custom;else{const t=e.contents;if(t){this.flyoutItems_=[],e=!0;for(let o=0;o>>/handdelete.cur"), auto; +} + +.blocklyToolboxGrab { + cursor: url("<<>>/handclosed.cur"), auto; + cursor: grabbing; + cursor: -webkit-grabbing; +} + +/* Category tree in Toolbox. */ +.blocklyToolboxDiv { + background-color: #ddd; + overflow-x: visible; + overflow-y: auto; + padding: 4px 0 4px 0; + position: absolute; + z-index: 70; /* so blocks go under toolbox when dragging */ + -webkit-tap-highlight-color: transparent; /* issue #1345 */ +} + +.blocklyToolboxContents { + display: flex; + flex-wrap: wrap; + flex-direction: column; +} + +.blocklyToolboxContents:focus { + outline: none; +} +`),r($e.TOOLBOX,Ws,Ky);var vT="11.2.2",yT=xe.INPUT_VALUE,_T=xe.OUTPUT_VALUE,wT=xe.NEXT_STATEMENT,kT=xe.PREVIOUS_STATEMENT,CT=Ge.TOP,TT=Ge.BOTTOM,ST=Ge.LEFT,ET=Ge.RIGHT;gn.prototype.newBlock=function(e,t){return new Uo(this,e,t)},cs.prototype.newBlock=function(e,t){return new $s(this,e,t)},gn.prototype.newComment=function(e){return new El(this,e)},cs.prototype.newComment=function(e){return new Il(this,e)},cs.newTrashcan=function(e){return new Hv(e)},vo.prototype.newWorkspaceSvg=function(e){return new cs(e)},i.Names$$module$build$src$core$names.prototype.populateProcedures=function(e){e=qa(e),e=e[0].concat(e[1]);for(let t=0;t{this.setState({popper:x.I18n.t("Copied"),anchorEl:i}),setTimeout(()=>this.setState({popper:"",anchorEl:null}),1e3)},50)}render(){const s=new Blob([this.props.text],{type:"application/xml"}),i=`${this.props.scriptId.substring(10)}.xml`;return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"lg",sx:{"& .MuiDialog-paper":Wr.dialog},fullWidth:!0,open:!0,"aria-labelledby":"export-dialog-title",children:[m.jsx(ss,{id:"export-dialog-title",children:x.I18n.t("Export selected blocks")}),m.jsx(qt,{style:Wr.overflowY,children:m.jsx("pre",{id:"export-text",style:{...Wr.textArea,...this.props.themeType==="dark"?void 0:Wr.textAreaLight},children:this.props.text})}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",color:"secondary",startIcon:m.jsx(kc,{}),children:m.jsx("a",{download:i,target:"_blank",rel:"noreferrer",href:URL.createObjectURL(s),style:{textDecoration:"inherit",color:"inherit"},children:x.I18n.t("Download as file")})}),m.jsx(He,{variant:"contained",onClick:r=>this.onCopy(r),color:"secondary",startIcon:m.jsx(cx,{}),children:x.I18n.t("Copy to clipboard")}),m.jsx(He,{variant:"contained",onClick:()=>this.handleCancel(),color:"primary",startIcon:m.jsx(so,{}),children:x.I18n.t("Close")}),m.jsx(YT,{id:"popper",style:{zIndex:1e4},open:!!this.state.popper,placement:"top",anchorEl:this.state.anchorEl,transition:!0,children:({TransitionProps:r})=>m.jsx(JT,{...r,timeout:350,children:m.jsx(Ow,{children:m.jsx("p",{style:Wr.typography,children:this.state.popper})})})}),m.jsx("textarea",{id:"copy_input",readOnly:!0,style:{position:"absolute",left:-9999},tabIndex:-1,"aria-hidden":!0,value:this.props.text})]})]},"export-dialog")}}const Mt={textArea:{width:"calc(100% - 10px)",height:"calc(80% - 20px)",resize:"none",fontFamily:"monospace",fontSize:"1em",backgroundColor:"transparent",borderRadius:4,outline:"none"},dropzone:{marginTop:20,width:"100%",borderWidth:5,borderStyle:"dashed",borderColor:"#d0cccc",textAlign:"center",boxSizing:"border-box",paddingTop:45,borderRadius:10,height:"calc(100% - 10px)"},dropzoneDiv:{width:"100%",height:"20%",position:"relative"},dropzoneRejected:{borderColor:"#970000"},dropzoneAccepted:{borderColor:"#17cd02"},icon:{height:"80%",width:"80%",opacity:.3,color:"#eeeeee",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",zIndex:0},iconError:{color:"#ffc3c6"},iconOk:{color:"#aaeebc"},text:{top:"50%",left:"50%",transform:"translate(-50%,-50%)",color:"#868686",position:"absolute",zIndex:1},dialog:{height:"95%"},fullHeight:{height:"100%",overflow:"hidden"}};class Hm extends _e.Component{constructor(s){super(s),this.state={text:"",imageStatus:"",error:""}}componentDidMount(){setTimeout(()=>{var s;try{(s=window.document.getElementById("import-text-area"))==null||s.focus()}catch{}},100)}static readFileDataUrl(s,i){const r=new FileReader;r.onload=()=>{i(null,{data:r.result,name:s.name})},r.onabort=()=>{console.error("file reading was aborted"),i(x.I18n.t("file reading was aborted"))},r.onerror=l=>{console.error("file reading has failed"),i(x.I18n.t("file reading has failed: %s",l))},r.readAsText(s)}handleDropFile(s){if(!(s!=null&&s.length))return;const i=s[s.length-1];i&&Hm.readFileDataUrl(i,(r,l)=>{var c;r||!l?this.setState({error:r||"No data"}):this.setState({text:((c=l.data)==null?void 0:c.toString())||""})})}handleCancel(){this.props.onClose()}handleOk(){this.props.onClose(this.state.text)}onChange(s){this.setState({text:s.target.value})}render(){const s={...Mt.dropzone,...this.state.imageStatus==="accepted"?Mt.dropzoneAccepted:this.state.imageStatus==="rejected"?Mt.dropzoneRejected:void 0};return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"lg",sx:{"& .MuiDialog-paper":Mt.dialog},fullWidth:!0,open:!0,"aria-labelledby":"import-dialog-title",children:[m.jsx(ss,{id:"import-dialog-title",children:x.I18n.t("Import blocks")}),m.jsxs(qt,{style:Mt.fullHeight,children:[m.jsx("textarea",{autoFocus:!0,id:"import-text-area",placeholder:x.I18n.t("Paste your blocks here"),style:{...Mt.textArea,color:this.props.themeType==="dark"?"#ffffff":"#000000"},onChange:i=>this.onChange(i),value:this.state.text}),m.jsx(Lw,{maxSize:5e7,onDrop:(i,r)=>{var l,c,d;i.length?this.handleDropFile(i):window.alert(((d=(c=(l=r==null?void 0:r[0])==null?void 0:l.errors)==null?void 0:c[0])==null?void 0:d.message)||x.I18n.t("ra_Cannot upload"))},multiple:!1,accept:{"text/plain":[],"text/xml":[],"application/xml":[]},children:({getRootProps:i,getInputProps:r,isDragActive:l,isDragReject:c})=>c?(this.state.imageStatus!=="rejected"&&this.setState({imageStatus:"rejected"}),m.jsxs("div",{style:{...s,...Mt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Mt.text,children:x.I18n.t("Some files will be rejected")},"text"),m.jsx(Yc,{style:{...Mt.icon,...Mt.iconError}},"icon")]})):l?(this.state.imageStatus!=="accepted"&&this.setState({imageStatus:"accepted"}),m.jsxs("div",{style:{...s,...Mt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Mt.text,children:x.I18n.t("All files will be accepted")},"text"),m.jsx(Pw,{style:{...Mt.icon,...Mt.iconOk}},"icon")]})):(this.state.imageStatus!=="wait"&&this.setState({imageStatus:"wait"}),m.jsxs("div",{style:{...s,...Mt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Mt.text,children:x.I18n.t("Drop some files here or click...")},"text"),m.jsx(Bw,{style:Mt.icon},"icon")]}))})]}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",disabled:!this.state.text,onClick:()=>this.handleOk(),color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Import")}),m.jsx(He,{color:"grey",variant:"contained",onClick:()=>this.handleCancel(),startIcon:m.jsx(so,{}),children:x.I18n.t("Close")})]})]})}}const Fe=window.Blockly;class $g extends Error{constructor(){super("The field has not yet been attached to its input. Call appendField to attach it.")}}class Oc extends Fe.Field{textGroup=null;borderRect_=null;maxLines_=1/0;isOverflowedY_=!1;constructor(s,i,r){super(s),s!==Symbol("SKIP_SETUP")&&(r&&this.configure_(r),this.SERIALIZABLE=!0,this.setValue((s==null?void 0:s.toString())||""),i&&this.setValidator(i))}configure_(s){super.configure_(s),s.maxLines&&this.setMaxLines(s.maxLines)}toXml(s){return s.textContent=this.getValue().replace(/\n/g," "),s}fromXml(s){this.setValue(s.textContent.replace(/ /g,` +`))}saveState(){const s=this.saveLegacyState(Oc);return s!==null?s:this.getValue()}loadState(s){this.loadLegacyState(Fe.Field,s)||this.setValue(s)}initView(){this.createBorderRect_(),this.textGroup=Fe.utils.dom.createSvgElement(Fe.utils.Svg.G,{class:"blocklyEditableText"},this.fieldGroup_)}onHtmlInputKeyDownSuper_(s){s.key==="Enter"?(Fe.WidgetDiv.hideIfOwner(this),Fe.dropDownDiv.hideWithoutAnimation()):s.key==="Escape"?(this.setValue(this.htmlInput_.getAttribute("data-untyped-default-value"),!1),Fe.WidgetDiv.hideIfOwner(this),Fe.dropDownDiv.hideWithoutAnimation()):s.key==="Tab"&&(Fe.WidgetDiv.hideIfOwner(this),Fe.dropDownDiv.hideWithoutAnimation(),this.sourceBlock_.tab(this,!s.shiftKey),s.preventDefault())}onHtmlInputChange_(s){const i=this.value_;this.setValue(this.getValueFromEditorText_(this.htmlInput_.value),!1),this.sourceBlock_&&Fe.Events.isEnabled()&&this.value_!==i&&Fe.Events.fire(new(Fe.Events.get("block_field_intermediate_change"))(this.sourceBlock_,this.name||null,i,this.value_))}onFinishEditing_(s){}getValueFromEditorText_(s){return s}bindInputEvents_(s){this.onKeyDownWrapper_=Fe.browserEvents.conditionalBind(s,"keydown",this,this.onHtmlInputKeyDown_),this.onKeyInputWrapper_=Fe.browserEvents.conditionalBind(s,"input",this,this.onHtmlInputChange_)}getDisplayText_(){const s=this.getSourceBlock();if(!s)throw new Error("The field has not yet been attached to its input. Call appendField to attach it.");let i=this.getText();if(!i)return Fe.Field.NBSP;const r=i.split(` +`);i="";const l=this.isOverflowedY_?this.maxLines_:r.length;for(let c=0;cthis.maxDisplayLength?d=`${d.substring(0,this.maxDisplayLength-4)}...`:this.isOverflowedY_&&c===l-1&&(d=`${d.substring(0,d.length-3)}...`),d=d.replace(/\s/g,Fe.Field.NBSP),i+=d,c!==l-1&&(i+=` +`)}return s.RTL&&(i+="‏"),i}doValueUpdate_(s){super.doValueUpdate_(s),this.value_!==null&&(this.isOverflowedY_=this.value_.split(` +`).length>this.maxLines_)}render_(){const s=this.getSourceBlock();if(!s)throw new Error("The field has not yet been attached to its input. Call appendField to attach it.");let i;const r=this.textGroup;for(;i=r.firstChild;)r.removeChild(i);const l=this.getConstants();if(!l)throw Error("Constants not found");const c=this.getDisplayText_().split(` +`);let d=0;for(let h=0;hd&&(d=b),h+=s.FIELD_TEXT_HEIGHT+(p>0?s.FIELD_BORDER_RECT_Y_PADDING:0)}if(this.isBeingEdited_){const p=String(this.value_).split(` +`),f=Fe.utils.dom.createSvgElement(Fe.utils.Svg.TEXT,{class:"blocklyText blocklyMultilineText"});for(let w=0;wthis.maxDisplayLength&&(p[w]=p[w].substring(0,this.maxDisplayLength)),f.textContent=p[w];const v=Fe.utils.dom.getFastTextWidth(f,r,l,c);v>d&&(d=v)}const b=this.htmlInput_,y=b.offsetWidth-b.clientWidth;d+=y}this.borderRect_&&(h+=s.FIELD_BORDER_RECT_Y_PADDING*2,d+=s.FIELD_BORDER_RECT_X_PADDING*2+1,this.borderRect_.setAttribute("width",`${d}`),this.borderRect_.setAttribute("height",`${h}`)),this.size_.width=d,this.size_.height=h,this.positionBorderRect_()}showInlineEditor_(s){const i=this.getSourceBlock();if(!i)throw new $g;Fe.WidgetDiv.show(this,i.RTL,this.widgetDispose_.bind(this),this.workspace_),this.htmlInput_=this.widgetCreate_(),this.isBeingEdited_=!0,this.valueWhenEditorWasOpened_=this.value_,s||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())}getEditorText_(s){return`${s}`}getScaledBBox(){let s,i,r;const l=this.getSourceBlock();if(!l)throw new $g;if(this.isFullBlockField()){const c=this.sourceBlock_.getHeightWidth(),d=l.workspace.scale;r=this.getAbsoluteXY_(),s=(c.width+1)*d,i=(c.height+1)*d,Fe.utils.userAgent.GECKO?(r.x+=1.5*d,r.y+=1.5*d):(r.x-=.5*d,r.y-=.5*d)}else{const c=this.borderRect_.getBoundingClientRect();r=Fe.utils.style.getPageOffset(this.borderRect_),s=c.width,i=c.height}return new Fe.utils.Rect(r.y,r.y+i,r.x,r.x+s)}resizeEditor_(){Fe.renderManagement.finishQueuedRenders().then(()=>{const s=this.getSourceBlock();if(!s)throw new $g;const i=Fe.WidgetDiv.getDiv(),r=this.getScaledBBox();i.style.width=`${r.right-r.left}px`,i.style.height=`${r.bottom-r.top}px`;const l=s.RTL?r.right-i.offsetWidth:r.left,c=r.top;i.style.left=`${l}px`,i.style.top=`${c}px`})}unbindInputEvents_(){this.onKeyDownWrapper_&&(Fe.browserEvents.unbind(this.onKeyDownWrapper_),this.onKeyDownWrapper_=null),this.onKeyInputWrapper_&&(Fe.browserEvents.unbind(this.onKeyInputWrapper_),this.onKeyInputWrapper_=null)}getClickTarget_(){return this.clickTarget_||this.getSvgRoot()}widgetDispose_(){this.isBeingEdited_=!1,this.isTextValid_=!0,this.forceRerender(),this.onFinishEditing_(this.value_),this.sourceBlock_&&Fe.Events.isEnabled()&&this.valueWhenEditorWasOpened_!==null&&this.valueWhenEditorWasOpened_!==this.value_&&(Fe.Events.fire(new(Fe.Events.get("change"))(this.sourceBlock_,"field",this.name||null,this.valueWhenEditorWasOpened_,this.value_)),this.valueWhenEditorWasOpened_=null),Fe.Events.setGroup(!1),this.unbindInputEvents_();const s=Fe.WidgetDiv.getDiv().style;s.width="auto",s.height="auto",s.fontSize="",s.transition="",s.boxShadow="",this.htmlInput_=null;const i=this.getClickTarget_();if(!i)throw new Error("A click target has not been set.");Fe.utils.dom.removeClass(i,"editing")}showEditor_(s,i){this.workspace_=this.sourceBlock_.workspace,!i&&this.workspace_.options.modalInputs&&(Fe.utils.userAgent.MOBILE||Fe.utils.userAgent.ANDROID||Fe.utils.userAgent.IPAD)?this.showPromptEditor_():this.showInlineEditor_(!!i),this.forceRerender()}widgetCreate_(){const s=Fe.WidgetDiv.getDiv(),i=this.workspace_.getScale(),r=this.getConstants();if(!r)throw Error("Constants not found");const l=document.createElement("textarea");l.className="blocklyHtmlInput blocklyHtmlTextAreaInput",l.setAttribute("spellcheck",String(this.spellcheck_));const c=`${r.FIELD_TEXT_FONTSIZE*i}pt`;s.style.fontSize=c,l.style.fontSize=c;const d=`${Fe.FieldTextInput.BORDERRADIUS*i}px`;l.style.borderRadius=d;const h=r.FIELD_BORDER_RECT_X_PADDING*i,p=r.FIELD_BORDER_RECT_Y_PADDING*i/2;l.style.padding=`${p}px ${h}px ${p}px ${h}px`;const f=r.FIELD_TEXT_HEIGHT+r.FIELD_BORDER_RECT_Y_PADDING;return l.style.lineHeight=`${f*i}px`,s.appendChild(l),l.value=l.defaultValue=this.getEditorText_(this.value_),l.setAttribute("data-untyped-default-value",String(this.value_)),l.setAttribute("data-old-value",""),Fe.utils.userAgent.GECKO?setTimeout(this.resizeEditor_.bind(this),0):this.resizeEditor_(),this.bindInputEvents_(l),l}setMaxLines(s){typeof s=="number"&&s>0&&s!==this.maxLines_&&(this.maxLines_=s,this.forceRerender())}getMaxLines(){return this.maxLines_}onHtmlInputKeyDown_(s){s.key!=="Enter"&&this.onHtmlInputKeyDownSuper_(s)}static fromJson(s){const i=Fe.utils.parsing.replaceMessageReferences(s.text);return new this(i,void 0,s)}}Fe.Css.register(` +.blocklyHtmlTextAreaInput { + font-family: monospace; + resize: none; + overflow: hidden; + height: 100%; + text-align: left; +} + +.blocklyHtmlTextAreaInputOverflowedY { + overflow-y: scroll; +} +`);const yC="text_multiline",oO={type:yC,message0:"%1 %2",args0:[{type:"field_image",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAARCAYAAADpPU2iAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAdhgAAHYYBXaITgQAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS42/U4J6AAAAP1JREFUOE+Vks0KQUEYhjmRIja4ABtZ2dm5A3t3Ia6AUm7CylYuQRaUhZSlLZJiQbFAyRnPN33y01HOW08z8873zpwzM4F3GWOCruvGIE4/rLaV+Nq1hVGMBqzhqlxgCys4wJA65xnogMHsQ5lujnYHTejBBCK2mE4abjCgMGhNxHgDFWjDSG07kdfVa2pZMf4ZyMAdWmpZMfYOsLiDMYMjlMB+K613QISRhTnITnsYg5yUd0DETmEoMlkFOeIT/A58iyK5E18BuTBfgYXfwNJv4P9/oEBerLylOnRhygmGdPpTTBZAPkde61lbQe4moWUvYUZYLfUNftIY4zwA5X2Z9AYnQrEAAAAASUVORK5CYII=",width:12,height:17,alt:"¶"},{type:"field_multilinetext",name:"TEXT",text:""}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_TEXT_HELPURL}",tooltip:"%{BKY_TEXT_TEXT_TOOLTIP}",extensions:["parent_tooltip_when_inline"]};function iO(a,s){const i=s.multiline_quote_(a.getFieldValue("TEXT")),r=i.indexOf("+")!==-1?6.2:0;return[i,r]}const nO=window.Blockly.common.createBlockDefinitionsFromJsonArray([oO]);nO[yC];const Je=window.Blockly;class rm extends Je.Field{picker=null;highlightedIndex=null;boundEvents=[];SERIALIZABLE=!0;CURSOR="default";isDirty_=!1;colours=["#ffffff","#cccccc","#c0c0c0","#999999","#666666","#333333","#000000","#ffcccc","#ff6666","#ff0000","#cc0000","#990000","#660000","#330000","#ffcc99","#ff9966","#ff9900","#ff6600","#cc6600","#993300","#663300","#ffff99","#ffff66","#ffcc66","#ffcc33","#cc9933","#996633","#663333","#ffffcc","#ffff33","#ffff00","#ffcc00","#999900","#666600","#333300","#99ff99","#66ff99","#33ff33","#33cc00","#009900","#006600","#003300","#99ffff","#33ffff","#66cccc","#00cccc","#339999","#336666","#003333","#ccffff","#66ffff","#33ccff","#3366ff","#3333ff","#000099","#000066","#ccccff","#9999ff","#6666cc","#6633ff","#6600cc","#333399","#330099","#ffccff","#ff99ff","#cc66cc","#cc33cc","#993399","#663366","#330033"];titles=[];columns=7;constructor(s,i,r){super(s),s!==Symbol("SKIP_SETUP")&&(r&&this.configure_(r),this.setValue(s),i&&this.setValidator(i))}configure_(s){super.configure_(s),s.colourOptions&&(this.colours=s.colourOptions),s.colourTitles&&(this.titles=s.colourTitles),s.columns&&(this.columns=s.columns)}initView(){const s=this.getConstants();if(!s)throw Error("Constants not found");this.size_=new Je.utils.Size(s.FIELD_COLOUR_DEFAULT_WIDTH,s.FIELD_COLOUR_DEFAULT_HEIGHT),this.createBorderRect_(),this.getBorderRect().style.fillOpacity="1",this.getBorderRect().setAttribute("stroke","#fff"),this.isFullBlockField()&&(this.clickTarget_=this.sourceBlock_.getSvgRoot())}isFullBlockField(){if(!this.getSourceBlock())throw new Je.UnattachedFieldError;const i=this.getConstants();return this.blockIsSimpleReporter()&&!!(i!=null&&i.FIELD_COLOUR_FULL_BLOCK)}blockIsSimpleReporter(){const s=this.getSourceBlock();if(!s)throw new Je.UnattachedFieldError;if(!s.outputConnection)return!1;for(const i of s.inputList)if(i.connection||i.fieldRow.length>1)return!1;return!0}applyColour(){const s=this.getSourceBlock();if(!s)throw new Je.UnattachedFieldError;if(!this.fieldGroup_)return;const i=this.borderRect_;if(!i)throw new Error("The border rect has not been initialized");this.isFullBlockField()?(i.style.display="none",s.pathObject.svgPath.setAttribute("fill",this.getValue()),s.pathObject.svgPath.setAttribute("stroke","#fff")):(i.style.display="block",i.style.fill=this.getValue())}getSize(){var s;return(s=this.getConstants())!=null&&s.FIELD_COLOUR_FULL_BLOCK&&(this.render_(),this.isDirty_=!1),super.getSize()}render_(){super.render_();const s=this.getSourceBlock();if(!s)throw new Je.UnattachedFieldError;s.applyColour()}updateSize_(s){const i=this.getConstants();if(!i)return;let r,l;this.isFullBlockField()?(r=(s??0)*2,l=i.FIELD_TEXT_HEIGHT):(r=i.FIELD_COLOUR_DEFAULT_WIDTH,l=i.FIELD_COLOUR_DEFAULT_HEIGHT),this.size_.height=l,this.size_.width=r,this.positionBorderRect_()}doClassValidation_(s){return typeof s!="string"?null:Je.utils.colour.parse(s)}getText(){let s=this.value_;return/^#(.)\1(.)\2(.)\3$/.test(s)&&(s=`#${s[1]}${s[3]}${s[5]}`),s}setColours(s,i){return this.colours=s,i&&(this.titles=i),this}setColumns(s){return this.columns=s,this}showEditor_(){if(this.dropdownCreate(),!this.picker)throw Error("Picker not found");Je.DropDownDiv.getContentDiv().appendChild(this.picker),Je.DropDownDiv.showPositionedByField(this,this.dropdownDispose.bind(this)),this.picker.focus({preventScroll:!0})}onClick(s){const i=s.target,r=i==null?void 0:i.getAttribute("data-colour");r!==null&&(this.setValue(r),Je.DropDownDiv.hideIfOwner(this))}onKeyDown(s){let i=!0,r;switch(s.key){case"ArrowUp":this.moveHighlightBy(0,-1);break;case"ArrowDown":this.moveHighlightBy(0,1);break;case"ArrowLeft":this.moveHighlightBy(-1,0);break;case"ArrowRight":this.moveHighlightBy(1,0);break;case"Enter":if(r=this.getHighlighted(),r){const l=r.getAttribute("data-colour");l!==null&&this.setValue(l)}Je.DropDownDiv.hideWithoutAnimation();break;default:i=!1}i&&s.stopPropagation()}moveHighlightBy(s,i){if(!this.highlightedIndex)return;const r=this.colours,l=this.columns;let c=this.highlightedIndex%l,d=Math.floor(this.highlightedIndex/l);c+=s,d+=i,s<0?c<0&&d>0?(c=l-1,d--):c<0&&(c=0):s>0?c>l-1&&dl-1&&c--:i<0?d<0&&(d=0):i>0&&d>Math.floor(r.length/l)-1&&(d=Math.floor(r.length/l)-1);const h=this.picker.childNodes[d].childNodes[c],p=d*l+c;this.setHighlightedCell(h,p)}onMouseMove(s){const i=s.target,r=i&&Number(i.getAttribute("data-index"));r!==null&&r!==this.highlightedIndex&&this.setHighlightedCell(i,r)}onMouseEnter(){var s;(s=this.picker)==null||s.focus({preventScroll:!0})}onMouseLeave(){var i;(i=this.picker)==null||i.blur();const s=this.getHighlighted();s&&Je.utils.dom.removeClass(s,"blocklyColourHighlighted")}getHighlighted(){var l;if(!this.highlightedIndex)return null;const s=this.highlightedIndex%this.columns,i=Math.floor(this.highlightedIndex/this.columns),r=(l=this.picker)==null?void 0:l.childNodes[i];return r?r.childNodes[s]:null}setHighlightedCell(s,i){const r=this.getHighlighted();r&&Je.utils.dom.removeClass(r,"blocklyColourHighlighted"),Je.utils.dom.addClass(s,"blocklyColourHighlighted"),this.highlightedIndex=i;const l=s.getAttribute("id");l&&this.picker&&Je.utils.aria.setState(this.picker,Je.utils.aria.State.ACTIVEDESCENDANT,l)}dropdownCreate(){const s=this.columns,i=this.colours,r=this.getValue(),l=document.createElement("table");l.className="blocklyColourTable",l.tabIndex=0,l.dir="ltr",Je.utils.aria.setRole(l,Je.utils.aria.Role.GRID),Je.utils.aria.setState(l,Je.utils.aria.State.EXPANDED,!0),Je.utils.aria.setState(l,Je.utils.aria.State.ROWCOUNT,Math.floor(i.length/s)),Je.utils.aria.setState(l,Je.utils.aria.State.COLCOUNT,s);let c=null;for(let d=0;dtr>td { + border: 0.5px solid #888; + box-sizing: border-box; + cursor: pointer; + display: inline-block; + height: 20px; + padding: 0; + width: 20px; +} + +.blocklyColourTable>tr>td.blocklyColourHighlighted { + border-color: #eee; + box-shadow: 2px 2px 7px 2px rgba(0, 0, 0, 0.3); + position: relative; +} + +.blocklyColourSelected, .blocklyColourSelected:hover { + border-color: #eee !important; + outline: 1px solid #333; + position: relative; +} +`);const _C="colour_picker",rO={type:_C,message0:"%1",args0:[{type:"field_colour",name:"COLOUR",colour:"#ff0000"}],output:"Colour",helpUrl:"%{BKY_COLOUR_PICKER_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_PICKER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]};function aO(a,s){return[s.quote_(a.getFieldValue("COLOUR")),0]}const lO=window.Blockly.common.createBlockDefinitionsFromJsonArray([rO]);lO[_C];const wC="colour_random",cO={type:wC,message0:"%{BKY_COLOUR_RANDOM_TITLE}",output:"Colour",helpUrl:"%{BKY_COLOUR_RANDOM_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_RANDOM_TOOLTIP}"};function uO(a,s){return[`${s.provideFunction_("colourRandom",` +function ${s.FUNCTION_NAME_PLACEHOLDER_}() { + var num = Math.floor(Math.random() * 0x1000000); + return '#' + ('00000' + num.toString(16)).substr(-6); +} +`)}()`,2]}const dO=window.Blockly.common.createBlockDefinitionsFromJsonArray([cO]);dO[wC];const kC="colour_rgb",hO={type:kC,message0:"%{BKY_COLOUR_RGB_TITLE} %{BKY_COLOUR_RGB_RED} %1 %{BKY_COLOUR_RGB_GREEN} %2 %{BKY_COLOUR_RGB_BLUE} %3",args0:[{type:"input_value",name:"RED",check:"Number",align:"RIGHT"},{type:"input_value",name:"GREEN",check:"Number",align:"RIGHT"},{type:"input_value",name:"BLUE",check:"Number",align:"RIGHT"}],output:"Colour",helpUrl:"%{BKY_COLOUR_RGB_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_RGB_TOOLTIP}"};function pO(a,s){const i=s.valueToCode(a,"RED",99)||0,r=s.valueToCode(a,"GREEN",99)||0,l=s.valueToCode(a,"BLUE",99)||0;return[`${s.provideFunction_("colourRgb",` +function ${s.FUNCTION_NAME_PLACEHOLDER_}(r, g, b) { + r = Math.max(Math.min(Number(r), 100), 0) * 2.55; + g = Math.max(Math.min(Number(g), 100), 0) * 2.55; + b = Math.max(Math.min(Number(b), 100), 0) * 2.55; + r = ('0' + (Math.round(r) || 0).toString(16)).slice(-2); + g = ('0' + (Math.round(g) || 0).toString(16)).slice(-2); + b = ('0' + (Math.round(b) || 0).toString(16)).slice(-2); + return '#' + r + g + b; +} +`)}(${i}, ${r}, ${l})`,2]}const gO=window.Blockly.common.createBlockDefinitionsFromJsonArray([hO]);gO[kC];const CC="colour_blend",mO={type:CC,message0:"%{BKY_COLOUR_BLEND_TITLE} %{BKY_COLOUR_BLEND_COLOUR1} %1 %{BKY_COLOUR_BLEND_COLOUR2} %2 %{BKY_COLOUR_BLEND_RATIO} %3",args0:[{type:"input_value",name:"COLOUR1",check:"Colour",align:"RIGHT"},{type:"input_value",name:"COLOUR2",check:"Colour",align:"RIGHT"},{type:"input_value",name:"RATIO",check:"Number",align:"RIGHT"}],output:"Colour",helpUrl:"%{BKY_COLOUR_BLEND_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_BLEND_TOOLTIP}"};function fO(a,s){const i=s.valueToCode(a,"COLOUR1",99)||"'#000000'",r=s.valueToCode(a,"COLOUR2",99)||"'#000000'",l=s.valueToCode(a,"RATIO",99)||.5;return[`${s.provideFunction_("colourBlend",` +function ${s.FUNCTION_NAME_PLACEHOLDER_}(c1, c2, ratio) { + ratio = Math.max(Math.min(Number(ratio), 1), 0); + var r1 = parseInt(c1.substring(1, 3), 16); + var g1 = parseInt(c1.substring(3, 5), 16); + var b1 = parseInt(c1.substring(5, 7), 16); + var r2 = parseInt(c2.substring(1, 3), 16); + var g2 = parseInt(c2.substring(3, 5), 16); + var b2 = parseInt(c2.substring(5, 7), 16); + var r = Math.round(r1 * (1 - ratio) + r2 * ratio); + var g = Math.round(g1 * (1 - ratio) + g2 * ratio); + var b = Math.round(b1 * (1 - ratio) + b2 * ratio); + r = ('0' + (r || 0).toString(16)).slice(-2); + g = ('0' + (g || 0).toString(16)).slice(-2); + b = ('0' + (b || 0).toString(16)).slice(-2); + return '#' + r + g + b; +} +`)}(${i}, ${r}, ${l})`,2]}const $O=window.Blockly.common.createBlockDefinitionsFromJsonArray([mO]);$O[CC];function bO(){window.Blockly.FieldMultilineInput||(window.Blockly.fieldRegistry.register("field_multilinetext",Oc),window.Blockly.JavaScript.forBlock.text_multiline=iO,window.Blockly.FieldMultilineInput=Oc,Object.assign(window.Blockly.Blocks,window.Blockly.common.createBlockDefinitionsFromJsonArray([{type:"text_multiline",message0:"%1 %2",args0:[{type:"field_image",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAARCAYAAADpPU2iAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAdhgAAHYYBXaITgQAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS42/U4J6AAAAP1JREFUOE+Vks0KQUEYhjmRIja4ABtZ2dm5A3t3Ia6AUm7CylYuQRaUhZSlLZJiQbFAyRnPN33y01HOW08z8873zpwzM4F3GWOCruvGIE4/rLaV+Nq1hVGMBqzhqlxgCys4wJA65xnogMHsQ5lujnYHTejBBCK2mE4abjCgMGhNxHgDFWjDSG07kdfVa2pZMf4ZyMAdWmpZMfYOsLiDMYMjlMB+K613QISRhTnITnsYg5yUd0DETmEoMlkFOeIT/A58iyK5E18BuTBfgYXfwNJv4P9/oEBerLylOnRhygmGdPpTTBZAPkde61lbQe4moWUvYUZYLfUNftIY4zwA5X2Z9AYnQrEAAAAASUVORK5CYII=",width:12,height:17,alt:"¶"},{type:"field_multilinetext",name:"TEXT",text:""}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_TEXT_HELPURL}",tooltip:"%{BKY_TEXT_TEXT_TOOLTIP}",extensions:["parent_tooltip_when_inline"]}]))),window.Blockly.FieldColour||(window.Blockly.fieldRegistry.register("field_colour",rm),window.Blockly.JavaScript.forBlock.colour_picker=aO,window.Blockly.JavaScript.forBlock.colour_blend=fO,window.Blockly.JavaScript.forBlock.colour_random=uO,window.Blockly.JavaScript.forBlock.colour_rgb=pO,window.Blockly.FieldColour=rm,Object.assign(window.Blockly.Blocks,window.Blockly.common.createBlockDefinitionsFromJsonArray([{type:"colour_picker",message0:"%1",args0:[{type:"field_colour",name:"COLOUR",colour:"#ff0000"}],output:"Colour",helpUrl:"%{BKY_COLOUR_PICKER_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_PICKER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]}])),Object.assign(window.Blockly.Blocks,window.Blockly.common.createBlockDefinitionsFromJsonArray([{type:"colour_random",message0:"%{BKY_COLOUR_RANDOM_TITLE}",output:"Colour",helpUrl:"%{BKY_COLOUR_RANDOM_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_RANDOM_TOOLTIP}"}])),Object.assign(window.Blockly.Blocks,window.Blockly.common.createBlockDefinitionsFromJsonArray([{type:"colour_rgb",message0:"%{BKY_COLOUR_RGB_TITLE} %{BKY_COLOUR_RGB_RED} %1 %{BKY_COLOUR_RGB_GREEN} %2 %{BKY_COLOUR_RGB_BLUE} %3",args0:[{type:"input_value",name:"RED",check:"Number",align:"RIGHT"},{type:"input_value",name:"GREEN",check:"Number",align:"RIGHT"},{type:"input_value",name:"BLUE",check:"Number",align:"RIGHT"}],output:"Colour",helpUrl:"%{BKY_COLOUR_RGB_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_RGB_TOOLTIP}"}])),Object.assign(window.Blockly.Blocks,window.Blockly.common.createBlockDefinitionsFromJsonArray([{type:"colour_blend",message0:"%{BKY_COLOUR_BLEND_TITLE} %{BKY_COLOUR_BLEND_COLOUR1} %1 %{BKY_COLOUR_BLEND_COLOUR2} %2 %{BKY_COLOUR_BLEND_RATIO} %3",args0:[{type:"input_value",name:"COLOUR1",check:"Colour",align:"RIGHT"},{type:"input_value",name:"COLOUR2",check:"Colour",align:"RIGHT"},{type:"input_value",name:"RATIO",check:"Number",align:"RIGHT"}],output:"Colour",helpUrl:"%{BKY_COLOUR_BLEND_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_BLEND_TOOLTIP}"}])));const a=window.Blockly.JavaScript;a.forBlock&&Object.keys(a).forEach(s=>{typeof a[s]=="function"&&(a.forBlock[s]||(console.log(`Migrating Blockly.JavaScript.${s} to Blockly.JavaScript.forBlock.${s}`),a.forBlock[s]=a[s],delete a[s]))})}let cc=!1,uc=!1,bg=null,vg=null;const hw=[];function TC(a,s,i,r){var l;if(r=r||[],(a.tagName==="BLOCK"||a.tagName==="block")&&(i=a.id),a.tagName==="FIELD"||a.tagName==="field")for(let c=0;cTC(c,s,i,r)),r}class et extends _e.Component{blockly=null;blocklyWorkspace=null;originalCode;someSelected=null;changeTimer=null;someSelectedTime=0;ignoreChanges=!1;blinkBlock;onResizeBind;didUpdate=null;lastCommand="";lastSearch;static Blockly=window.Blockly;constructor(s){super(s),this.state={languageOwnLoaded:uc,languageBlocklyLoaded:cc,changed:!1,message:"",error:"",themeType:this.props.themeType,exportText:"",importText:!1,searchText:this.props.searchText||"",showInputPrompt:null},this.originalCode=s.code||"",this.someSelected=null,this.onResizeBind=this.onResize.bind(this),this.lastSearch=this.props.searchText||"",this.blinkBlock=null,bO(),et.Blockly.dialog.setPrompt(this.onShowNameDialog),this.loadLanguages()}onShowNameDialog=(s,i,r)=>{this.setState({showInputPrompt:{promptText:s,defaultText:i,callback:r,value:i}})};static loadJS(s,i,r){const l=document.createElement("script");try{l.src=s,l.onload=i,l.onerror=i,(r||window.document.body).appendChild(l)}catch(c){console.error(`Cannot load ${s}: ${c}`),i&&i()}}static loadScripts(s,i){if(!(s!=null&&s.length)){i&&i();return}const r=s.pop();r&&!hw.includes(r)?(hw.push(r),et.loadJS(`../../adapter/${r}/blockly.js`,()=>setTimeout(()=>et.loadScripts(s,i),0))):setTimeout(()=>et.loadScripts(s,i),0)}static loadCustomBlockly(s,i){var l;const r=[];for(const c in s)!Object.prototype.hasOwnProperty.call(s,c)||!s[c]||!c.match(/^system\.adapter\./)||s[c].type!=="adapter"||(l=s[c].common)!=null&&l.blockly&&(console.log(`Detected custom blockly: ${s[c].common.name}`),r.push(s[c].common.name));et.loadScripts(r,i)}static loadXMLDoc(s){let i;return window.DOMParser?i=r=>new window.DOMParser().parseFromString(r,"text/xml"):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("Microsoft.XMLDOM")?i=r=>{const l=new window.ActiveXObject("Microsoft.XMLDOM");return l.async="false",l.loadXML(r),l}:i=()=>null,i(s)}searchBlocks(s){if(this.blocklyWorkspace){const i=et.Blockly.Xml.workspaceToDom(this.blocklyWorkspace),r=TC(i,s.toLowerCase());return console.log(`Search "${s}" found blocks: ${r.length?JSON.stringify(r):"none"}`),r}return[]}searchId(){const s=this.lastSearch?this.searchBlocks(this.lastSearch):null;s!=null&&s.length?(this.someSelected=s,this.someSelected.forEach(i=>{var r;return(r=this.blocklyWorkspace)==null?void 0:r.highlightBlock(i,!0)}),this.someSelectedTime=Date.now()):this.someSelected&&(this.someSelected.forEach(i=>{var r;return(r=this.blocklyWorkspace)==null?void 0:r.highlightBlock(i,!1)}),this.someSelected=null)}UNSAFE_componentWillReceiveProps(s){s.command&&this.lastCommand!==s.command&&(this.lastCommand=s.command,setTimeout(()=>this.lastCommand="",300),this.lastCommand==="check"?this.blocklyCheckBlocks((i,r)=>{i?(r&&et.blocklyBlinkBlock(r),this.setState({error:{text:x.I18n.t(i),title:x.I18n.t("Error was found")}}),this.blinkBlock=r):this.setState({message:x.I18n.t("Ok")})}):this.lastCommand==="export"?this.exportBlocks():this.lastCommand==="import"&&this.importBlocks()),s.searchText!==this.lastSearch&&(this.lastSearch=s.searchText,this.searchId()),this.state.themeType!==s.themeType&&this.setState({themeType:s.themeType},()=>this.updateBackground()),this.originalCode!==s.code&&(this.originalCode=s.code||"",this.loadCode(),this.searchId())}loadLanguages(){if(!cc){const s=window.document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("src",`google-blockly/msg/js/${x.I18n.getLanguage()}.js`),s.onload=()=>{cc=!0,this.setState({languageBlocklyLoaded:cc})},window.document.getElementsByTagName("head")[0].appendChild(s)}if(!uc){const s=window.document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("src",`google-blockly/own/msg/${x.I18n.getLanguage()}.js`),s.onload=()=>{uc=!0,this.setState({languageOwnLoaded:uc})},window.document.getElementsByTagName("head")[0].appendChild(s)}}onResize(){this.blocklyWorkspace&&et.Blockly.svgResize(this.blocklyWorkspace)}static jsCode2Blockly(s){s=s||"";const i=s.split(/[\r\n]+|\r|\n/g);let r="";for(let c=i.length-1;c>=0;c--)if(i[c].substring(0,2)==="//"){r=i[c].substring(2);break}if(r.substring(0,4)==="s.select(),i),setTimeout(()=>s.unselect(),i+150)}blocklyRemoveOrphanedShadows(){if(this.blocklyWorkspace){const s=this.blocklyWorkspace.getAllBlocks();let i;for(let r=0;i=s[r];r++)if(i.isShadow()){const l=i.getConnections_(!0);let c;for(let d=0;c=l[d];d++)if(!c.targetConnection){i.dispose();break}}}}blocklyCheckBlocks(s){let i;if(!this.blocklyWorkspace||this.blocklyWorkspace.getAllBlocks().length===0)return s&&s("no blocks found"),!1;let r=this.blocklyGetUnconnectedBlock();return r?i="not properly connected":(r=this.blocklyGetBlockWithWarning(),r&&(i="warning on this block")),r?(s?s(i,r):et.blocklyBlinkBlock(r),!1):(s(),!0)}blocklyGetUnconnectedBlock(){var r;const s=(r=this.blocklyWorkspace)==null?void 0:r.getAllBlocks();let i;if(s)for(let l=0;i=s[l];l++){const c=i.getConnections_(!0);let d;for(let h=0;d=c[h];h++)if(!d.sourceBlock_||(d.type===et.Blockly.INPUT_VALUE||d.type===et.Blockly.OUTPUT_VALUE)&&!d.targetConnection&&!d._optional)return i}return null}blocklyGetBlockWithWarning(){var r;const s=(r=this.blocklyWorkspace)==null?void 0:r.getAllBlocks();let i;if(s){for(let l=0;i=s[l];l++)if(i.warning)return i}return null}blocklyCode2JSCode(s){if(!this.blocklyWorkspace)return"";let i=et.Blockly.JavaScript.workspaceToCode(this.blocklyWorkspace);if(!s){i+=` +`;const r=et.Blockly.Xml.workspaceToDom(this.blocklyWorkspace),l=et.Blockly.Xml.domToText(r);i+=`//${btoa(encodeURIComponent(l))}`}return i}exportBlocks(){if(!this.blocklyWorkspace)return;let s;const i=et.Blockly.getSelected();if(i){const r=et.Blockly.Xml.blockToDom(i),l=i.getRelativeToSurfaceXY();r.setAttribute("x",(i.RTL?-l.x:l.x).toString()),r.setAttribute("y",l.y.toString()),s=et.Blockly.Xml.domToPrettyText(r)}else{const r=et.Blockly.Xml.workspaceToDom(this.blocklyWorkspace);s=et.Blockly.Xml.domToPrettyText(r)}this.setState({exportText:s})}importBlocks(){this.setState({importText:!0})}onImportBlocks(s){if(this.blocklyWorkspace&&(s=(s||"").trim(),s))try{s.startsWith("${s}`),s=s.replace(/[\n\r]/g,"").replace(/.*<\/variables>/g,""),window.scripts.loading=!0;const i=et.Blockly.utils.xml.textToDom(s);et.Blockly.Xml.appendDomToWorkspace(i,this.blocklyWorkspace),window.scripts.loading=!1,this.onBlocklyChanged()}catch(i){this.setState({error:{text:i.toString(),title:x.I18n.t("Import error")}})}}loadCode(){if(this.blocklyWorkspace){this.ignoreChanges=!0,this.blocklyWorkspace.clear();try{const s=et.jsCode2Blockly(this.originalCode)||'';window.scripts.loading=!0;const i=et.Blockly.utils.xml.textToDom(s);et.Blockly.Xml.domToWorkspace(i,this.blocklyWorkspace),window.scripts.loading=!1}catch(s){console.error(s),setTimeout(()=>this.setState({error:x.I18n.t("Cannot extract Blockly code!")}))}setTimeout(()=>this.ignoreChanges=!1,100)}}onBlocklyChanged(){this.blocklyRemoveOrphanedShadows(),this.setState({changed:!0}),this.onChange()}async componentDidUpdate(){if(!this.blockly||(this.didUpdate&&(clearTimeout(this.didUpdate),this.didUpdate=null),this.blocklyWorkspace))return;window.addEventListener("resize",this.onResizeBind,!1),bg=bg||await this.getToolbox(),vg=vg||et.Blockly.utils.xml.textToDom(bg),this.blocklyWorkspace=et.Blockly.inject(this.blockly,{renderer:"thrasos",theme:this.state.themeType==="dark"?dw:"classic",media:"google-blockly/media/",toolbox:vg,zoom:{controls:!0,wheel:!1,startScale:1,maxScale:3,minScale:.3,scaleSpeed:1.2,pinch:!0},move:{scrollbars:{horizontal:!0,vertical:!0},drag:!0,wheel:!0},trashcan:!0,grid:{spacing:25,length:1,snap:!0},sounds:!1}),window.scripts={blocklyWorkspace:this.blocklyWorkspace},this.blocklyWorkspace.registerToolboxCategoryCallback("PROCEDURE",window.Blockly.Procedures.flyoutCategoryNew),this.blocklyWorkspace.addChangeListener(i=>{var r;if(this.someSelected&&Date.now()-this.someSelectedTime>500){const l=(r=this.blocklyWorkspace)==null?void 0:r.getAllBlocks();this.someSelected=null,l==null||l.forEach(c=>c.removeSelect())}[et.Blockly.Events.UI,et.Blockly.Events.CREATE,et.Blockly.Events.VIEWPORT_CHANGE].includes(i.type)||this.ignoreChanges||(this.changeTimer&&clearTimeout(this.changeTimer),this.changeTimer=setTimeout(()=>{this.changeTimer=null,this.onBlocklyChanged()},200))}),this.loadCode(),this.onResize();const s=document.getElementsByClassName("blocklyToolboxDiv")[0];this.blockly.appendChild(s),this.updateBackground(),setTimeout(()=>this.searchId(),200)}updateBackground(){var s;this.state.themeType==="dark"?(s=this.blocklyWorkspace)==null||s.setTheme(dw):this.blocklyWorkspace&&(this.blocklyWorkspace.getThemeManager(),this.blocklyWorkspace.setTheme(et.Blockly.Themes.Classic))}componentWillUnmount(){this.blocklyWorkspace&&(this.blocklyWorkspace.dispose(),this.blocklyWorkspace=null,this.changeTimer&&clearTimeout(this.changeTimer),this.changeTimer=null,window.removeEventListener("resize",this.onResizeBind))}onChange(){this.originalCode=this.blocklyCode2JSCode(),this.props.onChange&&this.props.onChange(this.originalCode)}async getToolbox(s){const i=window.document.getElementById("toolbox");let r=i==null?void 0:i.outerHTML;if(!r)return s?(console.error("Cannot load blocks!"),""):new Promise(l=>{setTimeout(()=>l(this.getToolbox(!0)),500)});if(r=r.replace(/{(\w+)}/g,(l,c)=>window.MSG[c]),window.Blockly.CustomBlocks){let l="";const c=x.I18n.getLanguage();for(let d=0;d`;for(const f in p.blocks)Object.prototype.hasOwnProperty.call(p.blocks,f)&&(l+=p.blocks[f]);l+=""}r=r.replace("%%CUSTOM_BLOCKS%%",l)}return r}renderMessageDialog(){return this.state.message?m.jsx(x.Message,{text:typeof this.state.message=="object"?this.state.message.text:this.state.message,title:typeof this.state.message=="object"?this.state.message.title:"",onClose:()=>this.setState({message:""})},"dialogMessage"):null}renderErrorDialog(){return this.state.error?m.jsx(su,{text:typeof this.state.error=="object"?this.state.error.text.toString():this.state.error,title:typeof this.state.error=="object"?this.state.error.title:"",onClose:()=>{this.blinkBlock&&(et.blocklyBlinkBlock(this.blinkBlock),this.blinkBlock=null),this.setState({error:""})}},"dialogError"):null}renderExportDialog(){return this.state.exportText?m.jsx(sO,{themeType:this.state.themeType,onClose:()=>this.setState({exportText:""}),text:this.state.exportText,scriptId:this.props.scriptId},"dialogExport"):null}renderImportDialog(){return this.state.importText?m.jsx(Hm,{themeType:this.props.themeType,onClose:s=>{this.setState({importText:!1}),this.onImportBlocks(s)}},"dialogImport"):null}renderDialogPrompt(){return this.state.showInputPrompt?m.jsxs(Ut,{onClose:()=>{var i;const s=(i=this.state.showInputPrompt)==null?void 0:i.callback;s&&s(null),this.setState({showInputPrompt:null})},maxWidth:"sm",fullWidth:!0,open:!0,children:[m.jsx(ss,{children:this.state.showInputPrompt.promptText}),m.jsx(qt,{children:m.jsx(Eo,{variant:"standard",fullWidth:!0,autoFocus:!0,value:this.state.showInputPrompt.value,onKeyUp:s=>{var i,r;if(s.key==="Enter"){const l=(i=this.state.showInputPrompt)==null?void 0:i.callback,c=(r=this.state.showInputPrompt)==null?void 0:r.value;l&&l(c===void 0?null:c),this.setState({showInputPrompt:null})}},onChange:s=>{var r,l;const i={...this.state.showInputPrompt};(r=this.state.showInputPrompt)!=null&&r.callback&&(i.callback=(l=this.state.showInputPrompt)==null?void 0:l.callback),i.value=s.target.value,this.setState({showInputPrompt:i})}})}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",disabled:!this.state.showInputPrompt.value,onClick:()=>{var r,l;const s=(r=this.state.showInputPrompt)==null?void 0:r.callback,i=(l=this.state.showInputPrompt)==null?void 0:l.value;s&&s(i===void 0?null:i),this.setState({showInputPrompt:null})},color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Apply")}),m.jsx(He,{color:"grey",variant:"contained",onClick:()=>{var i;const s=(i=this.state.showInputPrompt)==null?void 0:i.callback;s&&s(null),this.setState({showInputPrompt:null})},startIcon:m.jsx(so,{}),children:x.I18n.t("Close")})]})]},"inputDialog"):null}render(){return this.state.languageBlocklyLoaded&&this.state.languageOwnLoaded?(this.didUpdate=setTimeout(()=>{this.didUpdate=null,this.componentDidUpdate()},100),[m.jsx("div",{ref:s=>this.blockly=s,style:{width:"100%",height:"100%",position:"relative"}},"blocklyDOM"),this.renderDialogPrompt(),this.renderMessageDialog(),this.renderErrorDialog(),this.renderExportDialog(),this.renderImportDialog()]):null}}const vO=Object.freeze(Object.defineProperty({__proto__:null,default:et},Symbol.toStringTag,{value:"Module"})),yO="_nameCard_15el3_28",_O="_iconThemCard_15el3_40",wO="_iconThemCardSelectable_15el3_49",kO="_iconHelp_15el3_53",CO="_blockName_15el3_64",TO="_controlMenuTop_15el3_123",SO="_debugInfo_15el3_132",EO="_tagCard_15el3_142",IO="_displayFlex_15el3_161",xO="_blockMarginTop_15el3_166",DO="_nameBlock_15el3_167",AO="_frontText_15el3_171",OO="_backText_15el3_177",RO="_iconTag_15el3_181",NO="_displayItalic_15el3_191",Re={nameCard:yO,iconThemCard:_O,iconThemCardSelectable:wO,iconHelp:kO,blockName:CO,controlMenuTop:TO,debugInfo:SO,tagCard:EO,displayFlex:IO,blockMarginTop:xO,nameBlock:DO,frontText:AO,backText:OO,iconTag:RO,displayItalic:NO},MO="_root_1dr6a_1",LO="_square_1dr6a_11",PO="_icon_1dr6a_16",yg={root:MO,square:LO,icon:PO},Jr=({fullWidth:a,size:s,onClick:i,style:r,className:l,value:c,square:d,icon:h})=>m.jsx(He,{variant:"outlined",color:"primary",onClick:i,fullWidth:a,style:r,className:x.Utils.clsx(yg.root,l,d?yg.square:""),size:s||"medium",children:h?m.jsx(x.Icon,{className:yg.icon,src:h}):c}),BO="_root_1ucda_1",FO={root:BO},jO=({size:a,value:s,title:i,onChange:r,className:l,customValue:c,disabled:d})=>{const[h,p]=kt(!1);return m.jsxs(m.Fragment,{children:[m.jsx(wc,{disabled:d,checked:!!(c?s:h),className:x.Utils.clsx(FO.root,l),onChange:f=>{c&&p(f.target.checked),r&&r(f.target.checked)},size:a||"medium"}),i||null]})},SC=cm(jO),zO="_root_19roy_1",pw={root:zO},Ei=a=>{const[s,i]=kt(""),{value:r,type:l,error:c,className:d,icon:h,label:p,style:f,onChange:b,fullWidth:y,autoComplete:w,customValue:v,autoFocus:_,rows:$,size:S,variant:T,multiline:E,disabled:D}=Object.assign({value:"",type:"text",error:"",className:null,table:!1,native:{},variant:"standard",size:"medium",component:null,styleComponentBlock:null,fullWidth:!1,autoComplete:"",customValue:!1,autoFocus:!1,rows:1},a);return m.jsx(Eo,{error:!!c,autoFocus:_,fullWidth:y,label:p,disabled:D,variant:T,multiline:E,rows:$,value:v?r:s,type:l,helperText:c,style:f,className:x.Utils.clsx(pw.root,d),autoComplete:w,onChange:M=>{!v&&i(M.target.value),b&&b(M.target.value)},slotProps:{input:{endAdornment:h?m.jsx(Aw,{position:"end",children:m.jsx(x.Icon,{className:pw.icon,src:h})}):null}},margin:"normal",size:S})},UO={formControl:{m:"10px 0","& .MuiFormControl-marginNormal":{mt:0,mb:0},"& > *":{color:"#2d0440 !important"},"& .MuiSelect-icon":{color:"#81688c"},"& label.Mui-focused":{color:"#81688c"},"& .MuiInput-underline:after":{borderBottomColor:"#510573"},"& .MuiInput-underline:before":{borderBottomColor:"#81688c"},"& .MuiInput-underline:hover:before":{borderBottomColor:"#81688c"}}},HO=({multiple:a,value:s,customValue:i,socket:r,title:l,attr:c,adapter:d,style:h,onChange:p,onInstanceHide:f})=>{const[b,y]=kt(s||"test1"),[w,v]=kt([]);return Lt(()=>{r==null||r.getAdapterInstances(d).then(_=>{const $=_.map(S=>({value:S._id.replace("system.adapter.",""),title:S._id.replace("system.adapter.","")}));$.length===1?f($[0].value):$.unshift({value:d,title:x.I18n.t("All")}),v($)})},[r,d,f]),m.jsxs(Di,{sx:UO.formControl,fullWidth:!0,style:h,children:[m.jsx(Ai,{variant:"standard",value:(i?s:b)||"_",fullWidth:!0,multiple:a,renderValue:_=>a&&Array.isArray(_)?_.join(", "):_,onChange:_=>{!i&&y(_.target.value),p(_.target.value)},input:c?m.jsx(Pn,{name:c,id:`${c}-helper`}):m.jsx(Pn,{name:c}),children:w.map(_=>m.jsx(it,{style:{placeContent:"space-between"},value:_.value||"_",children:x.I18n.t(_.title)},`key-${_.value}`))}),l?m.jsx(Rw,{children:x.I18n.t(l)}):null]})},WO="_modalWrapper_587ci_33",GO="_modalDialog_587ci_40",gw={modalWrapper:WO,modalDialog:GO},am=({onClose:a,children:s,titleButtonApply:i,titleButtonClose:r,onApply:l,className:c,textInput:d,defaultValue:h,disabled:p})=>{const[f,b]=kt(h||""),[y]=kt(h||"");return m.jsxs(Ut,{open:!0,maxWidth:"md",disableEscapeKeyDown:!1,onClose:a,classes:{paper:gw.modalDialog},className:gw.modalWrapper,children:[m.jsxs(qt,{children:[d&&m.jsx(Ei,{className:c,autoComplete:"off",fullWidth:!0,variant:"outlined",size:"medium",rows:10,multiline:!0,value:f,onChange:b,customValue:!0}),!d&&s]}),m.jsxs(Ht,{children:[m.jsx(He,{disabled:p===void 0?y===f:p,onClick:()=>l(d?f:null),variant:"contained",color:"primary",children:x.I18n.t(i||"Ok")}),m.jsx(He,{color:"grey",onClick:a,variant:"contained",children:x.I18n.t(r||"Cancel")})]})]})},VO="_root_15mo1_1",KO={root:VO},YO=({multiple:a,value:s,customValue:i,title:r,attr:l,options:c,style:d,onChange:h,className:p,doNotTranslate:f,doNotTranslate2:b})=>{const[y,w]=kt(s===void 0?c[0].value:s),v=i?s:y,_=v===""||v===null||v===void 0?"_":v;return m.jsxs(Di,{variant:"standard",className:x.Utils.clsx(KO.root,p),fullWidth:!0,style:d,children:[m.jsxs(Ai,{variant:"standard",value:_,fullWidth:!0,multiple:a,renderValue:$=>{if(a&&Array.isArray($)){$.sort();let T=$.indexOf("0");T!==-1&&($.splice(T,1),$.push("0")),T=$.indexOf("_"),T!==-1&&($.splice(T,1),$.unshift("_"));const E=c.find(M=>M.only);return E&&$.includes(E.value)?E.titleShort?f?E.titleShort:x.I18n.t(E.titleShort):f?E.title:x.I18n.t(E.title):$.map(M=>c.find(P=>P.value===M||M==="_"&&P.value==="")||M).map(M=>typeof M=="object"?M.titleShort?f?M.titleShort:x.I18n.t(M.titleShort):f?M.title:x.I18n.t(M.title):f?M:x.I18n.t(M)).join(", ")}const S=c?c.find(T=>T.value===$||$==="_"&&T.value===""):null;return S!=null&&S.title?f?S==null?void 0:S.title:x.I18n.t(S==null?void 0:S.title):$},onChange:$=>{if(i||w($.target.value),a){const S=$.target.value,T=c.find(E=>E.only);if(T){const E=T.value;if(S.length===c.length-1&&S.includes(E))return h(S.filter(D=>D!==E),l);if(S.includes(E))return h(c.map(D=>D.value),l)}}h($.target.value,l)},input:l?m.jsx(Pn,{name:l,id:`${l}-helper`}):m.jsx(Pn,{name:l}),children:[!a&&(c==null?void 0:c.map($=>m.jsxs(it,{style:{placeContent:"space-between"},value:$.value===""||$.value===null||$.value===void 0?"_":$.value,children:[f?$.title:x.I18n.t($.title),$.title2&&m.jsx("div",{children:b?$.title2:x.I18n.t($.title2)})]},`key-${$.value}`))),a&&(c==null?void 0:c.map($=>m.jsxs(it,{style:{placeContent:"space-between"},value:$.value||"_",children:[f?$.title:x.I18n.t($.title)," ",m.jsx(SC,{customValue:!0,value:s==null?void 0:s.includes($.value)})]},`key-${$.value}`)))]}),r?m.jsx(Rw,{children:x.I18n.t(r)}):null]})},JO="_root_1gt4d_1",qO="_mark_1gt4d_27",mw={root:JO,mark:qO},XO=({size:a,value:s,style:i,onChange:r,className:l,customValue:c,min:d,max:h,step:p,unit:f})=>{const[b,y]=kt(0);d=d!==void 0?d:0,h=h!==void 0?h:0,p=p!==void 0?p:(h-d)/100;const w=[{value:d,label:d+(f||"")},{value:h,label:h+(f||"")}];return m.jsx(qT,{defaultValue:c?s:b,"aria-labelledby":"discrete-slider",valueLabelDisplay:"auto",classes:{mark:mw.mark},marks:w,step:p,min:d,max:h,value:c?s:b,style:i,className:x.Utils.clsx(mw.root,l),onChange:(v,_)=>{Array.isArray(_)?(!c&&y(_[0]),r(_[0])):(!c&&y(_),r(_))},size:a||"medium"})},ZO="_root_rzul6_1",QO={root:ZO},eR=({label:a,size:s,value:i,style:r,onChange:l,className:c,customValue:d})=>{const[h,p]=kt(!1);return m.jsx(Rg,{className:QO.root,control:m.jsx(Nw,{checked:d?i:h,style:r,className:c,onChange:f=>{d||p(f.target.checked),l(f.target.checked)},size:s||"medium"}),label:a??"all"})},tR=cm(eR),sR="_root_135pm_1",oR={root:sR},iR=({value:a,style:s,onChange:i,className:r})=>m.jsx(Eo,{variant:"standard",id:"time",type:"time",onChange:l=>i(l.currentTarget.value),value:a,className:x.Utils.clsx(oR.root,r),fullWidth:!0,style:s,slotProps:{htmlInput:{step:300},inputLabel:{shrink:!0}}}),nR="_root_135pm_1",dc={root:nR},_g=[31,29,31,30,31,30,31,31,30,31,30,31],rR=({value:a,onChange:s,className:i,style:r})=>{const[l,c]=(a||"01.01").toString().split(".");let d=parseInt(c,10)||0,h=parseInt(l,10)||0;h>12?h=12:h<0&&(h=0),d>_g[h]?d=_g[h]:d<0&&(d=0);const p=[];for(let f=0;f<_g[h];f++)p.push(f+1);return m.jsxs("div",{children:[m.jsx(Di,{variant:"standard",className:x.Utils.clsx(dc.root,i),style:r,children:m.jsxs(Ai,{variant:"standard",className:x.Utils.clsx(dc.root,i),margin:"dense",label:x.I18n.t("Month"),onChange:f=>s(`${f.target.value.toString().padStart(2,"0")}.${d.toString().padStart(2,"0")}`),value:h,children:[m.jsx(it,{style:{placeContent:"space-between"},value:0,children:x.I18n.t("Any month")},0),m.jsx(it,{style:{placeContent:"space-between"},value:1,children:x.I18n.t("January")},1),m.jsx(it,{style:{placeContent:"space-between"},value:2,children:x.I18n.t("February")},2),m.jsx(it,{style:{placeContent:"space-between"},value:3,children:x.I18n.t("March")},3),m.jsx(it,{style:{placeContent:"space-between"},value:4,children:x.I18n.t("April")},4),m.jsx(it,{style:{placeContent:"space-between"},value:5,children:x.I18n.t("May")},5),m.jsx(it,{style:{placeContent:"space-between"},value:6,children:x.I18n.t("June")},6),m.jsx(it,{style:{placeContent:"space-between"},value:7,children:x.I18n.t("July")},7),m.jsx(it,{style:{placeContent:"space-between"},value:8,children:x.I18n.t("August")},8),m.jsx(it,{style:{placeContent:"space-between"},value:9,children:x.I18n.t("September")},9),m.jsx(it,{style:{placeContent:"space-between"},value:10,children:x.I18n.t("October")},10),m.jsx(it,{style:{placeContent:"space-between"},value:11,children:x.I18n.t("November")},11),m.jsx(it,{style:{placeContent:"space-between"},value:12,children:x.I18n.t("December")},12)]})}),m.jsx(Di,{variant:"standard",className:x.Utils.clsx(dc.root,i),style:r,children:m.jsxs(Ai,{variant:"standard",className:x.Utils.clsx(dc.root,i),margin:"dense",label:x.I18n.t("Date"),onChange:f=>s(`${h.toString().padStart(2,"0")}.${f.target.value.toString().padStart(2,"0")}`),value:d,children:[m.jsx(it,{style:{placeContent:"space-between"},value:0,children:x.I18n.t("Any")},"A"),p.map(f=>m.jsx(it,{style:{placeContent:"space-between"},value:f,children:f},f))]})})]})},wg={},aR={Shuffle:bx,Apps:rx,Functions:hx,Language:kS,AddBox:nx,Pause:bc,Subject:yx,PlayForWork:fx,Brightness3:ax,HelpOutline:pk,Storage:vx,AccessTime:ix,PlayArrow:Ug,FlashOn:ux};function fw({iconName:a,className:s,adapter:i,socket:r,onClick:l,style:c}){const[d,h]=kt("");if(Lt(()=>{i&&r&&(wg[i]instanceof Promise||(wg[i]=r.getObject(`system.adapter.${i}`)),wg[i].then(f=>{var b;return((b=f==null?void 0:f.common)==null?void 0:b.icon)&&h(`../../adapter/${i}/${f.common.icon}`)}))},[i,r]),i)return m.jsx("img",{onClick:f=>l&&l(f),src:d||"",className:s,style:c,alt:""});const p=a&&aR[a]||CS;return m.jsx(p,{className:s,style:c,onClick:f=>l&&l(f)})}let kg;function lR(a){return kg=kg||x.I18n.getLanguage(),a&&typeof a=="object"?a[kg]||a.en:a||""}function Ln(a){return a===null?"null":a===void 0?"undefined":Array.isArray(a)?a.join(", "):typeof a=="object"?JSON.stringify(a):a.toString()}class at extends xw{debugHideTimeout=null;lastObjectIdChange=0;enableSimulationProcessing=!1;lastDebugMessage=0;debugMessageTimeout=null;static getStaticData(){return{acceptedBy:"actions",name:"Not found",id:"ActionEmpty",icon:"Shuffle"}}static compile(s,i){return""}constructor(s,i){super(s),i||={};const r=s.settings||{tagCard:i.tagCardArray?typeof i.tagCardArray[0]!="string"?i.tagCardArray[0].title:i.tagCardArray[0]:""};!r.tagCard&&i.tagCardArray&&(r.tagCard=typeof i.tagCardArray[0]!="string"?i.tagCardArray[0].title:i.tagCardArray[0]),this.state={inputs:i.inputs||s.inputs||[],name:i.name||s.name||"",icon:i.icon||s.icon||"",adapter:i.adapter||s.adapter||"",helpDialog:i.helpDialog||s.helpDialog||"",tagCardArray:i.tagCardArray||[],openTagMenu:!1,openModal:!1,iconTag:!1,error:"",helpText:"",instanceSelectionOptions:[],instanceSelectionDef:"",hideAttributes:[],settings:r,debugMessage:null,enableSimulation:this.props.enableSimulation}}componentWillUnmount(){this.debugMessageTimeout&&(clearTimeout(this.debugMessageTimeout),this.debugMessageTimeout=null),this.debugHideTimeout&&(clearTimeout(this.debugHideTimeout),this.debugHideTimeout=null)}onTagChange(s,i,r,l,c){let d=!1;const h=JSON.parse(JSON.stringify(this.state.settings));this.state.inputs.forEach(p=>{const f=p.attr,b=p.defaultValue;f&&b!==void 0&&h[f]===void 0&&(d=!0,h[f]=b)}),d?(this.setState({settings:h},()=>i==null?void 0:i()),this.props.onChange(h)):i&&i()}onUpdate(){}onValueChanged(s,i){}renderText(s,i,r){const{className:l}=this.props,{attr:c,frontText:d,backText:h,nameBlock:p,name:f,doNotTranslate:b,doNotTranslateBack:y}=s;return m.jsxs(Ig,{children:[m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),children:[d&&m.jsx("div",{className:Re.frontText,children:b?d:x.I18n.t(d)}),m.jsx(Ei,{className:l,autoComplete:"off",label:lR(f),variant:"outlined",size:"small",fullWidth:!0,value:i,onChange:r,customValue:!0}),h&&m.jsx("div",{className:Re.backText,children:y?h:x.I18n.t(h)})]}),p&&m.jsx("div",{className:Re.nameBlock,children:x.I18n.t(p)})]},c)}renderSwitch(s,i,r){const{className:l}=this.props,{attr:c,frontText:d,backText:h,nameBlock:p,doNotTranslate:f,doNotTranslateBack:b}=s;return m.jsxs("div",{children:[m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),children:[d&&m.jsx("div",{className:Re.frontText,children:f?d:x.I18n.t(d)}),m.jsx(tR,{className:l,label:"",customValue:!0,value:i,onChange:r}),h&&m.jsx("div",{className:Re.backText,children:b?h:x.I18n.t(h)})]}),p&&m.jsx("div",{className:Re.nameBlock,children:x.I18n.t(p)})]},c)}renderNameText({attr:s,signature:i,doNotTranslate:r,defaultValue:l},c){return m.jsx("div",{className:x.Utils.clsx(i?Re.displayItalic:Re.displayFlex,Re.blockMarginTop),children:c?r?c:x.I18n.t(c):r?l:x.I18n.t(l)},s)}renderNumber(s,i,r){const{className:l}=this.props,{settings:c}=this.state,{attr:d,backText:h,frontText:p,openCheckbox:f,doNotTranslate:b,doNotTranslateBack:y}=s;let w=!0;return f&&(w=typeof c.offset=="boolean"?c.offset:!0),w?m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),children:[p&&m.jsx("div",{className:Re.frontText,children:b?p:x.I18n.t(p)}),m.jsx(Ei,{className:x.Utils.clsx(l,s.className),fullWidth:!0,autoComplete:"off",label:s.noHelperText?"":"number",variant:"outlined",size:"small",type:"number",value:i,onChange:r,customValue:!0}),h&&m.jsx("div",{className:Re.backText,children:y?h:x.I18n.t(h)})]},d):null}renderColor(s,i,r){const{className:l}=this.props,{attr:c,backText:d,frontText:h,doNotTranslate:p,doNotTranslateBack:f}=s;return m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),children:[h&&m.jsx("div",{className:Re.frontText,children:p?h:x.I18n.t(h)}),m.jsx(Ei,{className:l,autoComplete:"off",fullWidth:!0,variant:"outlined",size:"small",type:"color",value:i,onChange:r}),d&&m.jsx("div",{className:Re.backText,children:f?d:x.I18n.t(d)})]},c)}renderCheckbox(s,i,r){const{className:l}=this.props,{settings:c}=this.state,{attr:d,backText:h,frontText:p,defaultValue:f,doNotTranslate:b,doNotTranslateBack:y}=s;return m.jsxs("div",{className:Re.displayFlex,children:[p&&m.jsx("div",{className:Re.frontText,children:b?p:x.I18n.t(p)}),m.jsx(SC,{className:l,size:"small",value:typeof c[d]=="boolean"?!!c[d]:!!f,customValue:!0,onChange:r}),h&&m.jsx("div",{onClick:()=>r(typeof c[d]=="boolean"?!c[d]:!f),className:Re.backText,children:y?h:x.I18n.t(h)})]},d)}renderSlider(s,i,r){const{className:l}=this.props,{attr:c,frontText:d,backText:h,nameBlock:p,min:f,max:b,step:y,unit:w,doNotTranslate:v,doNotTranslateBack:_}=s;return m.jsxs("div",{children:[m.jsxs("div",{className:Re.displayFlex,style:{marginRight:20},children:[d&&m.jsx("div",{className:Re.frontText,children:v?d:x.I18n.t(d)}),m.jsx(XO,{customValue:!0,min:f,max:b,step:y,unit:w,className:l,autoComplete:"off",label:"number",variant:"outlined",size:"small",value:i,onChange:$=>{console.log($),r($)}}),h&&m.jsx("div",{style:{marginLeft:20},className:Re.backText,children:_?h:x.I18n.t(h)})]}),p&&m.jsx("div",{className:Re.nameBlock,children:x.I18n.t(p)})]},c)}renderButton(s,i,r){const{className:l}=this.props,{attr:c,frontText:d,backText:h,doNotTranslate:p,doNotTranslateBack:f}=s;return m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),children:[d&&m.jsx("div",{className:Re.frontText,children:p?d:x.I18n.t(d)}),m.jsx(Jr,{fullWidth:!0,value:i.toString(),className:l,onClick:()=>r(i)}),h&&m.jsx("div",{className:Re.backText,children:f?h:x.I18n.t(h)})]},c)}async findIcon(s){var i;if(!s)return null;if((i=s.common)!=null&&i.icon)return x.getSelectIdIcon(s,"../..");if(s.type==="state"||s.type==="channel"){const r=s._id.split(".");r.pop();const l=r.join(".");try{const c=await this.props.socket.getObject(l);return await this.findIcon(c)}catch{return null}}return null}renderObjectID(s,i,r){const{attr:l,openCheckbox:c,checkReadOnly:d}=s,{settings:h}=this.state,p=this.state[`showSelectId${l}`],{className:f,socket:b,style:y}=this.props;let w=!0;c&&(w=typeof h.offset=="boolean"?h.offset:!0);const v=h[l],_=v?this.state[v]:void 0;return v&&!_&&_!==!1&&setTimeout(async $=>{var D;const S=await b.getObject(i),T=await this.findIcon(S),E={[$]:S||!1,[`${$}___icon`]:T,error:d&&this.lastObjectIdChange&&Date.now()-this.lastObjectIdChange<1e3&&((D=S==null?void 0:S.common)==null?void 0:D.write)===!1?x.I18n.t("Read only ID selected: %s",h[$]):""};this.setState(E)},0,v),w?m.jsxs("div",{className:Re.blockMarginTop,children:[m.jsxs("div",{className:Re.displayFlex,children:[s.title?m.jsx("div",{children:x.I18n.t(s.title)}):null,m.jsx(Ei,{className:f,style:y,autoComplete:"off",fullWidth:!0,disabled:!0,variant:"outlined",size:"small",value:i,customValue:!0}),m.jsx(Jr,{icon:this.state[`${v}___icon`],square:!0,style:{...y||void 0,marginLeft:7},value:"...",className:f,onClick:()=>{const $={};$[`showSelectId${l}`]=!0,this.setState($)}})]}),_?m.jsx("div",{className:x.Utils.clsx(Re.nameBlock,Re.displayItalic),children:x.Utils.getObjectNameFromObj(_,x.I18n.getLanguage())}):null,p?m.jsx(x.DialogSelectID,{theme:this.props.theme,imagePrefix:"../..",dialogName:"javascript",themeType:x.Utils.getThemeName(),socket:b,selected:i,onClose:()=>{const $={};$[`showSelectId${l}`]=!1,this.setState($)},onOk:($,S)=>{const T={};T[`showSelectId${l}`]=!1;const E=Array.isArray($)?$[0]:$;this.setState(T,async()=>{var M,P,W,G,z,Z,he,Ce,R,K;const D=E?await b.getObject(E):void 0;this.lastObjectIdChange=Date.now(),r({[l]:$,[`${l}Role`]:(M=D==null?void 0:D.common)==null?void 0:M.role,[`${l}Type`]:(P=D==null?void 0:D.common)==null?void 0:P.type,[`${l}Unit`]:(W=D==null?void 0:D.common)==null?void 0:W.unit,[`${l}States`]:(G=D==null?void 0:D.common)==null?void 0:G.states,[`${l}Min`]:(z=D==null?void 0:D.common)==null?void 0:z.min,[`${l}Max`]:(Z=D==null?void 0:D.common)==null?void 0:Z.max,[`${l}Step`]:(he=D==null?void 0:D.common)==null?void 0:he.step,[`${l}Def`]:(Ce=D==null?void 0:D.common)==null?void 0:Ce.def,[`${l}Write`]:(R=D==null?void 0:D.common)==null?void 0:R.write,[`${l}Read`]:(K=D==null?void 0:D.common)==null?void 0:K.read},()=>this.props.setOnUpdate&&this.props.setOnUpdate(!0))})}}):null]},l):null}renderIconTag(){return m.jsx("div",{className:Re.iconTag,onClick:s=>{this.state.settings.tagCard&&(this.state.tagCardArray.length<3?this.onChangeTag():this.setState({openTagMenu:s.currentTarget}))},children:this.state.settings.tagCard})}renderTime(s,i,r){const{attr:l,backText:c,frontText:d,doNotTranslate:h,doNotTranslateBack:p}=s;return m.jsxs("div",{className:Re.displayFlex,style:{whiteSpace:"nowrap"},children:[d&&m.jsx("div",{className:Re.frontText,children:h?d:x.I18n.t(d)}),m.jsx(iR,{value:i,onChange:r}),c&&m.jsx("div",{className:Re.backText,children:p?c:x.I18n.t(c)})]},l)}renderSelect(s,i,r){const{className:l,style:c}=this.props,{name:d,options:h,frontText:p,backText:f,attr:b,multiple:y,doNotTranslate:w,doNotTranslate2:v,doNotTranslateBack:_}=s;return m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),style:{whiteSpace:"nowrap"},children:[p&&m.jsx("div",{className:Re.frontText,children:x.I18n.t(p)}),m.jsx(YO,{attr:b,doNotTranslate:w,doNotTranslate2:v,title:d,className:l,style:c,options:h,value:i,onChange:r,multiple:y,customValue:!0}),f&&m.jsx("div",{className:Re.backText,children:_?f:x.I18n.t(f)})]},b)}renderInstance(s,i,r){const{socket:l}=this.props,{name:c,frontText:d,backText:h,attr:p,adapter:f,doNotTranslate:b,doNotTranslateBack:y}=s;return this.state.hideAttributes.includes(p)?null:m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),style:{whiteSpace:"nowrap"},children:[d&&m.jsx("div",{className:Re.frontText,children:b?d:x.I18n.t(d)}),m.jsx(HO,{attr:p,socket:l,adapter:f,title:c,value:i,onChange:w=>{r(Array.isArray(w)?w[0]:w)},customValue:!0,onInstanceHide:w=>this.setState({hideAttributes:[...this.state.hideAttributes,p]},()=>r(w))}),h&&m.jsx("div",{className:Re.backText,children:y?h:x.I18n.t(h)})]},p)}renderDialog(s){const{onShowDialog:i,frontText:r,backText:l,attr:c,icon:d,doNotTranslate:h,doNotTranslateBack:p}=s;return m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),style:{whiteSpace:"nowrap"},children:[r&&m.jsx("div",{className:Re.frontText,children:h?r:x.I18n.t(r)}),m.jsx(fw,{iconName:d,className:x.Utils.clsx(Re.iconDialog),onClick:()=>i&&i()}),l&&m.jsx("div",{className:Re.backText,children:p?l:x.I18n.t(l)})]},c)}renderModalInput(s,i,r){const{openModal:l}=this.state,{className:c}=this.props,{attr:d,nameBlock:h,frontText:p,backText:f,noTextEdit:b,doNotTranslate:y,doNotTranslateBack:w}=s;return m.jsxs("div",{children:[m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),children:[p&&m.jsx("div",{className:Re.frontText,children:y?p:x.I18n.t(p)}),m.jsx(Ei,{disabled:!!b,className:c,autoComplete:"off",fullWidth:!0,variant:"outlined",size:"small",value:i,onChange:r,customValue:!0}),m.jsx(Jr,{square:!0,style:{marginLeft:5},value:"...",className:c,onClick:()=>this.setState({openModal:!0})}),f&&m.jsx("div",{className:Re.backText,children:w?f:x.I18n.t(f)})]}),l?m.jsx(am,{onApply:v=>this.setState({openModal:!1},()=>v!=null&&r(v)),onClose:()=>this.setState({openModal:!1}),defaultValue:i,textInput:!0}):null,h&&m.jsx("div",{className:Re.nameBlock,children:x.I18n.t(h)})]},d)}renderDate(s,i,r){const{attr:l,backText:c,frontText:d,doNotTranslate:h,doNotTranslateBack:p}=s;return m.jsxs("div",{className:Re.displayFlex,style:{whiteSpace:"nowrap"},children:[d&&m.jsx("div",{className:Re.frontText,children:h?d:x.I18n.t(d)}),m.jsx(rR,{value:i,onChange:r}),c&&m.jsx("div",{className:Re.backText,children:p?c:x.I18n.t(c)})]},l)}static getReplacesInText(s){var r;let i="";return(r=s.trigger)!=null&&r.oidType?i=".replace(/%s/g, obj.state.val).replace(/%id/g, obj.id).replace(/%name/g, obj.common && obj.common.name).replace(/%old/g, obj.oldState.val)":s.conditionsStates.length&&(i=`.replace(/%s/g, ${s.conditionsStates[0].name}).replace(/%id/g, "${s.conditionsStates[0].id}")`),i}renderTags(){const{tagCardArray:s,openTagMenu:i}=this.state,{tagCard:r}=this.state.settings;let l=r!=="="&&r!=="<>"&&r!==">="&&r!=="()"&&r!=="."&&r!=="<="&&r!=="<"&&r!==">"&&r?x.I18n.t(r):r;return s.length>=3&&(l=m.jsxs("div",{children:[m.jsx("div",{"aria-controls":"simple-menu","aria-haspopup":"true",onClick:c=>{this.setState({openTagMenu:c.currentTarget},()=>{this.props.isTourOpen&&this.props.tourStep===Ns.openTagsMenu&&setTimeout(()=>this.props.setTourStep&&this.props.setTourStep(Ns.selectIntervalTag),300)})},children:l}),m.jsx(dm,{id:"simple-menu",anchorEl:i,keepMounted:!0,open:!!i,onClose:()=>this.setState({openTagMenu:null}),children:s.map((c,d)=>{let h;return typeof c!="string"?h=c.title:h=c,m.jsxs(it,{selected:h===r,className:`tag-card-${h}`,style:{placeContent:"space-between"},onClick:p=>{p.stopPropagation(),this.props.isTourOpen&&(this.props.tourStep===Ns.openTagsMenu||this.props.tourStep===Ns.selectIntervalTag)&&h==="interval"&&setTimeout(()=>{var b,y;return(y=(b=this.props).setTourStep)==null?void 0:y.call(b,Ns.selectActions)},500);const f=JSON.parse(JSON.stringify(this.state.settings));f.tagCard=h,this.setState({openTagMenu:null,settings:f},()=>{this.props.onChange(this.state.settings),this.onTagChange(this.state.settings.tagCard)})},children:[h.search(/>|<|<>|<=|>=|=/)!==-1?h:x.I18n.t(h),typeof c!="string"&&c.title2&&m.jsx("div",{style:{marginLeft:4},children:x.I18n.t(c.title2)})]},`${h}_${d}`)})})]})),l}getData(){return{acceptedBy:"triggers",name:"",id:""}}onChangeTag(){const{tagCardArray:s,settings:i,settings:{tagCard:r}}=this.state;let l;if(typeof s[0]!="string"?l=s.map(c=>c.title):l=[...s],r&&l.length<3){const c={...i},d=l[(l.indexOf(r)+1)%l.length];c.tagCard=d,this.setState({settings:c},()=>{this.props.onChange(c),this.onTagChange(d)})}}componentDidMount(){this.onTagChange()}componentDidUpdate(){this.props.acceptedBy!=="triggers"&&this.props.onUpdate&&setTimeout(()=>this.onUpdate(),0)}onChangeInput(s){return(i,r,l)=>{const c=JSON.parse(JSON.stringify(this.state.settings));typeof i=="object"&&(!r||typeof r=="function")?(Object.keys(i).forEach(d=>c[d]=i[d]),typeof r=="function"&&(l=r,r=void 0)):c[r||s]=i,c.id=this.getData().id,c._id=this.props._id,this.setState({settings:c},()=>{this.onValueChanged(i,r||s),this.props.onChange(c),l==null||l()})}}renderSpecific(){return null}renderDebug(s){return""}renderDebugInfo(){return this.state.debugMessage?m.jsx("div",{className:Re.debugInfo,style:{opacity:1,height:22,bottom:-22},children:this.renderDebug?this.renderDebug(this.state.debugMessage):x.I18n.t("executed")},this.state.debugMessage.ts):null}renderCron(s,i,r){return null}renderWizard(s,i,r){return null}renderWriteState(){return null}renderInputElement(s,i){const{nameRender:r,defaultValue:l,attr:c}=s,{settings:d}=this.state;let h=c?d[c]:void 0;switch(h===void 0&&(h=l),r){case"renderTime":return c?this.renderTime(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderTime")},`invalid_${i}`);case"renderNameText":return this.renderNameText(s,l);case"renderSelect":return c?this.renderSelect(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderSelect")},`invalid_${i}`);case"renderModalInput":return c?this.renderModalInput(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderModalInput")},`invalid_${i}`);case"renderObjectID":return c?this.renderObjectID(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderObjectID")},`invalid_${i}`);case"renderDialog":return c?this.renderDialog(s):m.jsx("div",{children:x.I18n.t("Invalid renderDialog")},`invalid_${i}`);case"renderInstance":return c?this.renderInstance(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderInstance")},`invalid_${i}`);case"renderText":return c?this.renderText(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderText")},`invalid_${i}`);case"renderSlider":return c?this.renderSlider(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderSlider")},`invalid_${i}`);case"renderCheckbox":return c?this.renderCheckbox(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderCheckbox")},`invalid_${i}`);case"renderButton":return c?this.renderButton(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderButton")},`invalid_${i}`);case"renderColor":return c?this.renderColor(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderColor")},`invalid_${i}`);case"renderSwitch":return c?this.renderSwitch(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderSwitch")},`invalid_${i}`);case"renderDate":return c?this.renderDate(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderDate")},`invalid_${i}`);case"renderCron":return c?this.renderCron(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderCron")},`invalid_${i}`);case"renderWizard":return c?this.renderWizard(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderWizard")},`invalid_${i}`);case"renderWriteState":return this.renderWriteState();case"renderNumber":return c?this.renderNumber(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderNumber")},`invalid_${i}`);default:return this[r]?this[r](s,h,c?this.onChangeInput(c):null):m.jsx("div",{children:x.I18n.t("Invalid input type: %s",r)},`invalid_${i}`)}}render(){var w;const{inputs:s,name:i,icon:r,iconTag:l,settings:c,adapter:d,settings:{tagCard:h},helpDialog:p}=this.state,{socket:f,notFound:b}=this.props;this.state.settings&&!this.state.settings.tagCard&&((w=this.state.tagCardArray)!=null&&w.length)&&setTimeout(()=>{const v=JSON.parse(JSON.stringify(this.state.settings));v.tagCard=typeof this.state.tagCardArray[0]!="string"?this.state.tagCardArray[0].title:this.state.tagCardArray[0],this.setState({settings:v})},50),this.state.enableSimulation!==this.props.enableSimulation&&!this.enableSimulationProcessing&&(this.enableSimulationProcessing=!0,setTimeout(()=>{this.setState({enableSimulation:this.props.enableSimulation},()=>{this.enableSimulationProcessing=!1})},50));let y;if(this.props.onDebugMessage)for(let v=this.props.onDebugMessage.length-1;v>=0;v--){const _=this.props.onDebugMessage[v];if(_.blockId===this.props._id&&_.ts>this.lastDebugMessage&&_.ts>Date.now()-1e3){y=_;break}}return y&&(this.lastDebugMessage=y.ts,this.debugMessageTimeout&&clearTimeout(this.debugMessageTimeout),this.debugHideTimeout&&(clearTimeout(this.debugHideTimeout),this.debugHideTimeout=null),this.debugMessageTimeout=setTimeout(v=>{const _=JSON.parse(v),$=_.hideTimeout||5e3;this.debugMessageTimeout=null,this.setState({debugMessage:_},()=>{this.debugHideTimeout&&clearTimeout(this.debugHideTimeout),this.debugHideTimeout=setTimeout(()=>{this.debugHideTimeout=null,this.setState({debugMessage:null})},$)})},50,JSON.stringify(y))),m.jsxs(Ig,{children:[l?this.renderIconTag():m.jsx(fw,{iconName:r,className:x.Utils.clsx(Re.iconThemCard,h&&this.state.tagCardArray.length&&Re.iconThemCardSelectable),adapter:d,socket:f,onClick:v=>{h&&(this.state.tagCardArray.length<3?this.onChangeTag():this.setState({openTagMenu:v.currentTarget}))}}),m.jsxs("div",{className:Re.blockName,children:[m.jsxs("span",{className:Re.nameCard,children:[x.I18n.t(i),b?x.I18n.t("%s not found",c.id):"",p?m.jsx(qe,{className:Re.iconHelp,size:"small",onClick:()=>this.setState({helpText:x.I18n.t(p)}),children:m.jsx(pk,{})}):null]}),s.map((v,_)=>this.renderInputElement(v,_))]}),h&&m.jsx("div",{className:Re.controlMenuTop,style:{opacity:1,height:22,top:-22},children:m.jsx("div",{onClick:()=>this.onChangeTag(),className:x.Utils.clsx(Re.tagCard,"tag-card"),children:this.renderTags()})}),this.renderDebugInfo(),this.state.error?m.jsx(x.DialogError,{title:x.I18n.t("Warning"),text:this.state.error,onClose:()=>this.setState({error:""})}):null,this.state.helpText?m.jsx(x.DialogMessage,{title:x.I18n.t("Instructions"),text:this.state.helpText,onClose:()=>this.setState({helpText:""})}):null,this.renderSpecific()]})}}const $w={en:{name:"Google - English",engine:"google",params:[]},de:{name:"Google - Deutsch",engine:"google",params:[]},ru:{name:"Google - Русский",engine:"google",params:[]},it:{name:"Google - Italiano",engine:"google",params:[]},es:{name:"Google - Espaniol",engine:"google",params:[]},fr:{name:"Google - Français",engine:"google",params:[]},ru_YA:{name:"Yandex - Русский",engine:"yandex",params:["key","voice","emotion","ill","drunk","robot"],voice:["jane","zahar"],emotion:["none","good","neutral","evil","mixed"]},ru_YA_CLOUD:{name:"Yandex Cloud - Русский",engine:"yandexCloud",params:["key","folderID","voice","emotion"],voice:["alyss","oksana","jane","zahar"],emotion:["good","neutral","evil"]},"en-US":{name:"PicoTTS - Englisch US",engine:"PicoTTS",params:[]},"en-GB":{name:"PicoTTS - Englisch GB",engine:"PicoTTS",params:[]},"de-DE":{name:"PicoTTS - Deutsch",engine:"PicoTTS",params:[]},"it-IT":{name:"PicoTTS - Italiano",engine:"PicoTTS",params:[]},"es-ES":{name:"PicoTTS - Espaniol",engine:"PicoTTS",params:[]},"fr-FR":{name:"PicoTTS - Français",engine:"PicoTTS",params:[]},"ru-RU_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"ru-RU",ename:"Tatyana",ssml:!0,name:"Cloud - Русский - Татьяна"},"ru-RU_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"ru-RU",ename:"Maxim",ssml:!0,name:"Cloud - Русский - Максим"},"de-DE_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"de-DE",ename:"Marlene",ssml:!0,name:"Cloud - Deutsch - Marlene"},"de-DE_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"de-DE",ename:"Hans",ssml:!0,name:"Cloud - Deutsch - Hans"},"en-US_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Salli",ssml:!0,name:"Cloud - en-US - Female - Salli"},"en-US_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-US",ename:"Joey",ssml:!0,name:"Cloud - en-US - Male - Joey"},"da-DK_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"da-DK",ename:"Naja",ssml:!0,name:"Cloud - da-DK - Female - Naja"},"da-DK_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"da-DK",ename:"Mads",ssml:!0,name:"Cloud - da-DK - Male - Mads"},"en-AU_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-AU",ename:"Nicole",ssml:!0,name:"Cloud - en-AU - Female - Nicole"},"en-AU_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-AU",ename:"Russell",ssml:!0,name:"Cloud - en-AU - Male - Russell"},"en-GB_CLOUD_Female_Amy":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-GB",ename:"Amy",ssml:!0,name:"Cloud - en-GB - Female - Amy"},"en-GB_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-GB",ename:"Brian",ssml:!0,name:"Cloud - en-GB - Male - Brian"},"en-GB_CLOUD_Female_Emma":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-GB",ename:"Emma",ssml:!0,name:"Cloud - en-GB - Female - Emma"},"en-GB-WLS_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-GB-WLS",ename:"Gwyneth",ssml:!0,name:"Cloud - en-GB-WLS - Female - Gwyneth"},"en-GB-WLS_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-GB-WLS",ename:"Geraint",ssml:!0,name:"Cloud - en-GB-WLS - Male - Geraint"},"cy-GB_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"cy-GB",ename:"Gwyneth",ssml:!0,name:"Cloud - cy-GB - Female - Gwyneth"},"cy-GB_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"cy-GB",ename:"Geraint",ssml:!0,name:"Cloud - cy-GB - Male - Geraint"},"en-IN_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-IN",ename:"Raveena",ssml:!0,name:"Cloud - en-IN - Female - Raveena"},"en-US_CLOUD_Male_Chipmunk":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-US",ename:"Chipmunk",ssml:!0,name:"Cloud - en-US - Male - Chipmunk"},"en-US_CLOUD_Male_Eric":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-US",ename:"Eric",ssml:!0,name:"Cloud - en-US - Male - Eric"},"en-US_CLOUD_Female_Ivy":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Ivy",ssml:!0,name:"Cloud - en-US - Female - Ivy"},"en-US_CLOUD_Female_Jennifer":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Jennifer",ssml:!0,name:"Cloud - en-US - Female - Jennifer"},"en-US_CLOUD_Male_Justin":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-US",ename:"Justin",ssml:!0,name:"Cloud - en-US - Male - Justin"},"en-US_CLOUD_Female_Kendra":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Kendra",ssml:!0,name:"Cloud - en-US - Female - Kendra"},"en-US_CLOUD_Female_Kimberly":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Kimberly",ssml:!0,name:"Cloud - en-US - Female - Kimberly"},"es-ES_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"es-ES",ename:"Conchita",ssml:!0,name:"Cloud - es-ES - Female - Conchita"},"es-ES_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"es-ES",ename:"Enrique",ssml:!0,name:"Cloud - es-ES - Male - Enrique"},"es-US_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"es-US",ename:"Penelope",ssml:!0,name:"Cloud - es-US - Female - Penelope"},"es-US_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"es-US",ename:"Miguel",ssml:!0,name:"Cloud - es-US - Male - Miguel"},"fr-CA_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"fr-CA",ename:"Chantal",ssml:!0,name:"Cloud - fr-CA - Female - Chantal"},"fr-FR_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"fr-FR",ename:"Celine",ssml:!0,name:"Cloud - fr-FR - Female - Celine"},"fr-FR_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"fr-FR",ename:"Mathieu",ssml:!0,name:"Cloud - fr-FR - Male - Mathieu"},"is-IS_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"is-IS",ename:"Dora",ssml:!0,name:"Cloud - is-IS - Female - Dora"},"is-IS_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"is-IS",ename:"Karl",ssml:!0,name:"Cloud - is-IS - Male - Karl"},"it-IT_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"it-IT",ename:"Carla",ssml:!0,name:"Cloud - it-IT - Female - Carla"},"it-IT_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"it-IT",ename:"Giorgio",ssml:!0,name:"Cloud - it-IT - Male - Giorgio"},"nb-NO_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"nb-NO",ename:"Liv",ssml:!0,name:"Cloud - nb-NO - Female - Liv"},"nl-NL_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"nl-NL",ename:"Lotte",ssml:!0,name:"Cloud - nl-NL - Female - Lotte"},"nl-NL_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"nl-NL",ename:"Ruben",ssml:!0,name:"Cloud - nl-NL - Male - Ruben"},"pl-PL_CLOUD_Female_Agnieszka":{gender:"Female",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Agnieszka",ssml:!0,name:"Cloud - pl-PL - Female - Agnieszka"},"pl-PL_CLOUD_Male_Jacek":{gender:"Male",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Jacek",ssml:!0,name:"Cloud - pl-PL - Male - Jacek"},"pl-PL_CLOUD_Female_Ewa":{gender:"Female",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Ewa",ssml:!0,name:"Cloud - pl-PL - Female - Ewa"},"pl-PL_CLOUD_Male_Jan":{gender:"Male",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Jan",ssml:!0,name:"Cloud - pl-PL - Male - Jan"},"pl-PL_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Maja",ssml:!0,name:"Cloud - pl-PL - Female - Maja"},"pt-BR_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"pt-BR",ename:"Vitoria",ssml:!0,name:"Cloud - pt-BR - Female - Vitoria"},"pt-BR_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"pt-BR",ename:"Ricardo",ssml:!0,name:"Cloud - pt-BR - Male - Ricardo"},"pt-PT_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"pt-PT",ename:"Cristiano",ssml:!0,name:"Cloud - pt-PT - Male - Cristiano"},"pt-PT_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"pt-PT",ename:"Ines",ssml:!0,name:"Cloud - pt-PT - Female - Ines"},"ro-RO_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"ro-RO",ename:"Carmen",ssml:!0,name:"Cloud - ro-RO - Female - Carmen"},"sv-SE_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"sv-SE",ename:"Astrid",ssml:!0,name:"Cloud - sv-SE - Female - Astrid"},"tr-TR_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"tr-TR",ename:"Filiz",ssml:!0,name:"Cloud - tr-TR - Female - Filiz"},"ru-RU_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"ru-RU",ename:"Tatyana",ssml:!0,name:"AWS Polly - Русский - Татьяна"},"ru-RU_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"ru-RU",ename:"Maxim",ssml:!0,name:"AWS Polly - Русский - Максим"},"de-DE_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"de-DE",ename:"Marlene",ssml:!0,name:"AWS Polly - Deutsch - Marlene"},"de-DE_AP_Female_Vicky":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"de-DE",ename:"Vicky",ssml:!0,name:"AWS Polly - Deutsch - Vicky"},"de-DE_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"de-DE",ename:"Hans",ssml:!0,name:"AWS Polly - Deutsch - Hans"},"en-US_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Salli",ssml:!0,name:"AWS Polly - en-US - Female - Salli"},"en-US_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Joey",ssml:!0,name:"AWS Polly - en-US - Male - Joey"},"da-DK_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"da-DK",ename:"Naja",ssml:!0,name:"AWS Polly - da-DK - Female - Naja"},"da-DK_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"da-DK",ename:"Mads",ssml:!0,name:"AWS Polly - da-DK - Male - Mads"},"en-AU_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-AU",ename:"Nicole",ssml:!0,name:"AWS Polly - en-AU - Female - Nicole"},"en-AU_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-AU",ename:"Russell",ssml:!0,name:"AWS Polly - en-AU - Male - Russell"},"en-GB_AP_Female_Amy":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB",ename:"Amy",ssml:!0,name:"AWS Polly - en-GB - Female - Amy"},"en-GB_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB",ename:"Brian",ssml:!0,name:"AWS Polly - en-GB - Male - Brian"},"en-GB_AP_Female_Emma":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB",ename:"Emma",ssml:!0,name:"AWS Polly - en-GB - Female - Emma"},"en-GB-WLS_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB-WLS",ename:"Gwyneth",ssml:!0,name:"AWS Polly - en-GB-WLS - Female - Gwyneth"},"en-GB-WLS_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB-WLS",ename:"Geraint",ssml:!0,name:"AWS Polly - en-GB-WLS - Male - Geraint"},"cy-GB_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"cy-GB",ename:"Gwyneth",ssml:!0,name:"AWS Polly - cy-GB - Female - Gwyneth"},"cy-GB_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"cy-GB",ename:"Geraint",ssml:!0,name:"AWS Polly - cy-GB - Male - Geraint"},"en-IN_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-IN",ename:"Raveena",ssml:!0,name:"AWS Polly - en-IN - Female - Raveena"},"en-US_AP_Male_Chipmunk":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Chipmunk",ssml:!0,name:"AWS Polly - en-US - Male - Chipmunk"},"en-US_AP_Male_Eric":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Eric",ssml:!0,name:"AWS Polly - en-US - Male - Eric"},"en-US_AP_Female_Ivy":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Ivy",ssml:!0,name:"AWS Polly - en-US - Female - Ivy"},"en-US_AP_Female_Jennifer":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Jennifer",ssml:!0,name:"AWS Polly - en-US - Female - Jennifer"},"en-US_AP_Male_Justin":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Justin",ssml:!0,name:"AWS Polly - en-US - Male - Justin"},"en-US_AP_Female_Kendra":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Kendra",ssml:!0,name:"AWS Polly - en-US - Female - Kendra"},"en-US_AP_Female_Kimberly":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Kimberly",ssml:!0,name:"AWS Polly - en-US - Female - Kimberly"},"es-ES_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"es-ES",ename:"Conchita",ssml:!0,name:"AWS Polly - es-ES - Female - Conchita"},"es-ES_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"es-ES",ename:"Enrique",ssml:!0,name:"AWS Polly - es-ES - Male - Enrique"},"es-US_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"es-US",ename:"Penelope",ssml:!0,name:"AWS Polly - es-US - Female - Penelope"},"es-US_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"es-US",ename:"Miguel",ssml:!0,name:"AWS Polly - es-US - Male - Miguel"},"fr-CA_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"fr-CA",ename:"Chantal",ssml:!0,name:"AWS Polly - fr-CA - Female - Chantal"},"fr-FR_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"fr-FR",ename:"Celine",ssml:!0,name:"AWS Polly - fr-FR - Female - Celine"},"fr-FR_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"fr-FR",ename:"Mathieu",ssml:!0,name:"AWS Polly - fr-FR - Male - Mathieu"},"is-IS_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"is-IS",ename:"Dora",ssml:!0,name:"AWS Polly - is-IS - Female - Dora"},"is-IS_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"is-IS",ename:"Karl",ssml:!0,name:"AWS Polly - is-IS - Male - Karl"},"it-IT_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"it-IT",ename:"Carla",ssml:!0,name:"AWS Polly - it-IT - Female - Carla"},"it-IT_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"it-IT",ename:"Giorgio",ssml:!0,name:"AWS Polly - it-IT - Male - Giorgio"},"nb-NO_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"nb-NO",ename:"Liv",ssml:!0,name:"AWS Polly - nb-NO - Female - Liv"},"nl-NL_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"nl-NL",ename:"Lotte",ssml:!0,name:"AWS Polly - nl-NL - Female - Lotte"},"nl-NL_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"nl-NL",ename:"Ruben",ssml:!0,name:"AWS Polly - nl-NL - Male - Ruben"},"pl-PL_AP_Female_Agnieszka":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Agnieszka",ssml:!0,name:"AWS Polly - pl-PL - Female - Agnieszka"},"pl-PL_AP_Male_Jacek":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Jacek",ssml:!0,name:"AWS Polly - pl-PL - Male - Jacek"},"pl-PL_AP_Female_Ewa":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Ewa",ssml:!0,name:"AWS Polly - pl-PL - Female - Ewa"},"pl-PL_AP_Male_Jan":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Jan",ssml:!0,name:"AWS Polly - pl-PL - Male - Jan"},"pl-PL_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Maja",ssml:!0,name:"AWS Polly - pl-PL - Female - Maja"},"pt-BR_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pt-BR",ename:"Vitoria",ssml:!0,name:"AWS Polly - pt-BR - Female - Vitoria"},"pt-BR_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"pt-BR",ename:"Ricardo",ssml:!0,name:"AWS Polly - pt-BR - Male - Ricardo"},"pt-PT_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"pt-PT",ename:"Cristiano",ssml:!0,name:"AWS Polly - pt-PT - Male - Cristiano"},"pt-PT_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pt-PT",ename:"Ines",ssml:!0,name:"AWS Polly - pt-PT - Female - Ines"},"ro-RO_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"ro-RO",ename:"Carmen",ssml:!0,name:"AWS Polly - ro-RO - Female - Carmen"},"sv-SE_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"sv-SE",ename:"Astrid",ssml:!0,name:"AWS Polly - sv-SE - Female - Astrid"},"tr-TR_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"tr-TR",ename:"Filiz",ssml:!0,name:"AWS Polly - tr-TR - Female - Filiz"}};class Rc extends at{constructor(s){super(s,Rc.getStaticData())}static compile(s,i){return s.text?`// Sayit ${s.text||""} + const subActionVar${s._id} = "${s.language&&s.language!=="_"?`${s.language};`:""}${s.volume?`${s.volume};`:""}${(s.text||"").replace(/"/g,'\\"')}"${at.getReplacesInText(i)}; + _sendToFrontEnd(${s._id}, {text: subActionVar${s._id}}); + await setStateAsync("${s.instance}.tts.text", subActionVar${s._id});`:`// no text defined +_sendToFrontEnd(${s._id}, {text: 'No text defined'});`}renderDebug(s){return`${x.I18n.t("Say:")} ${s.data.text}`}onTagChange(){const s=x.I18n.getLanguage(),r=Object.keys($w).filter(l=>l.startsWith(s)).map(l=>({title:$w[l].name,value:l}));r.unshift({title:"Default",value:"_"}),this.setState({inputs:[{attr:"instance",nameRender:"renderInstance",adapter:"sayit",defaultValue:"sayit.0",frontText:"Instance:"},{nameRender:"renderSelect",frontText:"Language:",options:r,defaultValue:"_",attr:"language"},{nameRender:"renderNameText",defaultValue:"Volume",attr:"textVol"},{nameRender:"renderSlider",attr:"volume",defaultValue:100,min:0,max:100},{attr:"text",nameRender:"renderModalInput",defaultValue:"Hallo",nameBlock:"",frontText:"Text:"}]},()=>super.onTagChange())}static getStaticData(){return{acceptedBy:"actions",name:"Say It",id:"ActionSayText",adapter:"sayit",title:"Say some text via sayit adapter",helpDialog:"You can use %s in the text to display current trigger value or %id to display the triggered object ID"}}getData(){return Rc.getStaticData()}}class Nc extends at{constructor(s){super(s,Nc.getStaticData())}static compile(s,i){const r=(s.text||"").replace(/"/g,'\\"');return r?`// Pushover ${s.text||""} + const subActionVar${s._id} = "${r}"${at.getReplacesInText(i)}; + _sendToFrontEnd(${s._id}, {text: subActionVar${s._id}}); + sendTo("${s.instance}", "send", { + message: subActionVar${s._id}, + title: "${(s.title||"").replace(/"/g,'\\"')}"${at.getReplacesInText(i)}, + sound: "${s.sound}", + priority: ${s.priority} + });`:`// no text defined +_sendToFrontEnd(${s._id}, {text: 'No text defined'});`}renderDebug(s){return`Sent: ${s.data.text}`}onTagChange(){this.setState({inputs:[{nameRender:"renderInstance",adapter:"pushover",frontText:"Instance:",defaultValue:"pushover.0",attr:"instance"},{nameRender:"renderModalInput",attr:"text",defaultValue:"Hello",nameBlock:"",frontText:"Text:"},{nameRender:"renderText",attr:"title",defaultValue:"ioBroker",frontText:"Title:"},{nameRender:"renderSelect",attr:"sound",defaultValue:"magic",frontText:"Sound:",doNotTranslate:!0,options:[{value:"pushover",title:"pushover"},{value:"bike",title:"bike"},{value:"bugle",title:"bugle"},{value:"cashregister",title:"cashregister"},{value:"classical",title:"classical"},{value:"cosmic",title:"cosmic"},{value:"falling",title:"falling"},{value:"gamelan",title:"gamelan"},{value:"incoming",title:"incoming"},{value:"intermission",title:"intermission"},{value:"magic",title:"magic"},{value:"mechanical",title:"mechanical"},{value:"pianobar",title:"pianobar"},{value:"siren",title:"siren"},{value:"spacealarm",title:"spacealarm"},{value:"tugboat",title:"tugboat"},{value:"alien",title:"alien"},{value:"climb",title:"climb"},{value:"persistent",title:"persistent"},{value:"echo",title:"echo"},{value:"updown",title:"updown"},{value:"none",title:"none"}]},{nameRender:"renderSelect",attr:"priority",defaultValue:-1,frontText:"Priority:",options:[{value:-1,title:"quiet"},{value:0,title:"normal"},{value:1,title:"high-priority"},{value:2,title:"acknowledgment"}]}]},()=>super.onTagChange())}static getStaticData(){return{acceptedBy:"actions",name:"Pushover",id:"ActionPushover",adapter:"pushover",title:"Sends message via pushover",helpDialog:"You can use %s in the text to display current trigger value or %id to display the triggered object ID"}}getData(){return Nc.getStaticData()}}class Mc extends at{constructor(s){super(s,Mc.getStaticData())}static compile(s,i){const r=(s.text||"").replace(/"/g,'\\"');return r?`// whatsapp ${r||""} + const subActionVar${s._id} = "${(r||"").replace(/"/g,'\\"')}"${at.getReplacesInText(i)}; + _sendToFrontEnd(${s._id}, {text: subActionVar${s._id}}); + sendTo("${s.instance}", "send", {text: subActionVar${s._id}${s.phone?`, phone: "${s.phone.replace(/"/g,'\\"')}"`:""}});`:`// no text defined +_sendToFrontEnd(${s._id}, {text: 'No text defined'});`}renderDebug(s){return`${x.I18n.t("Sent:")} ${s.data.text}`}onTagChange(){this.setState({inputs:[{nameRender:"renderInstance",adapter:"whatsapp-cmb",frontText:"Instance:",defaultValue:"whatsapp-cmb.0",attr:"instance"},{nameRender:"renderModalInput",attr:"text",defaultValue:"Hello",nameBlock:"",frontText:"Text:"},{nameRender:"renderText",attr:"phone",defaultValue:"",frontText:"Phone:",backText:"(optional)"}]},()=>super.onTagChange())}static getStaticData(){return{acceptedBy:"actions",name:"Whatsapp-cmb",id:"ActionWhatsappcmb",adapter:"whatsapp-cmb",title:"Sends message via whatsapp-cmb",helpDialog:"You can use %s in the text to display current trigger value or %id to display the triggered object ID"}}getData(){return Mc.getStaticData()}}class Lc extends at{constructor(s){super(s,Lc.getStaticData())}static compile(s,i){const r=(s.text||"").replace(/"/g,'\\"');return r?`// Pushsafer ${s.text||""} + const subActionVar${s._id} = "${r}"${at.getReplacesInText(i)}; + _sendToFrontEnd(${s._id}, {text: subActionVar${s._id}}); + sendTo("${s.instance}", "send", { + message: subActionVar${s._id}, + title: "${(s.title||"").replace(/"/g,'\\"')}"${at.getReplacesInText(i)}, + ${s.sound&&s.sound!=="_"?`sound: "${s.sound}",`:""} + priority: ${s.priority}, + ${s.vibration&&s.vibration!=="_"?`vibration: ${s.vibration},`:""} + });`:`// no text defined +_sendToFrontEnd(${s._id}, {text: 'No text defined'});`}renderDebug(s){return`Sent: ${s.data.text}`}onTagChange(){this.setState({inputs:[{nameRender:"renderInstance",adapter:"pushsafer",frontText:"Instance:",defaultValue:"pushsafer.0",attr:"instance"},{nameRender:"renderModalInput",attr:"text",defaultValue:"Hello",nameBlock:"",frontText:"Text:"},{nameRender:"renderText",attr:"title",defaultValue:"ioBroker",frontText:"Title:"},{nameRender:"renderSelect",attr:"sound",defaultValue:"magic",frontText:"Sound:",doNotTranslate:!0,options:[{value:"_",title:"Device Default"},{value:"0",title:"Silent"},{value:"1",title:"Ahem (IM)"},{value:"2",title:"Applause (Mail)"},{value:"3",title:"Arrow (Reminder)"},{value:"4",title:"Baby (SMS)"},{value:"5",title:"Bell (Alarm)"},{value:"6",title:"Bicycle (Alarm2)"},{value:"7",title:"Boing (Alarm3)"},{value:"8",title:"Buzzer (Alarm4)"},{value:"9",title:"Camera (Alarm5)"},{value:"10",title:"Car Horn (Alarm6)"},{value:"11",title:"Cash Register (Alarm7)"},{value:"12",title:"Chime (Alarm8)"},{value:"13",title:"Creaky Door (Alarm9)"},{value:"14",title:"Cuckoo Clock (Alarm10)"},{value:"15",title:"Disconnect (Call)"},{value:"16",title:"Dog (Call2)"},{value:"17",title:"Doorbell (Call3)"},{value:"18",title:"Fanfare (Call4)"},{value:"19",title:"Gun Shot (Call5)"},{value:"20",title:"Honk (Call6)"},{value:"21",title:"Jaw Harp (Call7)"},{value:"22",title:"Morse (Call8)"},{value:"23",title:"Electricity (Call9)"},{value:"24",title:"Radio Tuner (Call10)"},{value:"25",title:"Sirens"},{value:"26",title:"Military Trumpets"},{value:"27",title:"Ufo"},{value:"28",title:"Whah Whah Whah"},{value:"29",title:"Man Saying Goodbye"},{value:"30",title:"Man Saying Hello"},{value:"31",title:"Man Saying No"},{value:"32",title:"Man Saying Ok"},{value:"33",title:"Man Saying Ooohhhweee"},{value:"34",title:"Man Saying Warning"},{value:"35",title:"Man Saying Welcome"},{value:"36",title:"Man Saying Yeah"},{value:"37",title:"Man Saying Yes"},{value:"38",title:"Beep short"},{value:"39",title:"Weeeee short"},{value:"40",title:"Cut in and out short"},{value:"41",title:"Finger flicking glas short"},{value:"42",title:"Wa Wa Waaaa short"},{value:"43",title:"Laser short"},{value:"44",title:"Wind Chime short"},{value:"45",title:"Echo short"},{value:"46",title:"Zipper short"},{value:"47",title:"HiHat short"},{value:"48",title:"Beep 2 short"},{value:"49",title:"Beep 3 short"},{value:"50",title:"Beep 4 short"},{value:"51",title:"The Alarm is armed"},{value:"52",title:"The Alarm is disarmed"},{value:"53",title:"The Backup is ready"},{value:"54",title:"The Door is closed"},{value:"55",title:"The Door is opend"},{value:"56",title:"The Window is closed"},{value:"57",title:"The Window is open"},{value:"58",title:"The Light is off"},{value:"59",title:"The Light is on"},{value:"60",title:"The Doorbell rings"},{value:"61",title:"Pager short"},{value:"62",title:"Pager long"}]},{nameRender:"renderSelect",attr:"priority",defaultValue:0,frontText:"Priority:",options:[{value:-2,title:"lowest priority"},{value:-1,title:"lower priority"},{value:0,title:"normal priority"},{value:1,title:"high priority"},{value:2,title:"highest priority"}]},{nameRender:"renderSelect",attr:"vibration",defaultValue:0,frontText:"Vibration:",options:[{value:"_",title:"default"},{value:1,title:"1"},{value:2,title:"2"},{value:3,title:"3"}]}]},()=>super.onTagChange())}static getStaticData(){return{acceptedBy:"actions",name:"Pushsafer",id:"ActionPushsafer",adapter:"pushsafer",title:"Sends message via Pushsafer",helpDialog:"You can use %s in the text to display current trigger value or %id to display the triggered object ID"}}getData(){return Lc.getStaticData()}}const EC=`async function (obj) { + "__%%DEBUG_TRIGGER%%__"; + __%%CONDITIONS_VARS%%__ + const _cond = __%%CONDITION%%__; + + "__%%DEBUG_CONDITIONS%%__"; + + if (_cond) { +__%%THEN%%__ + } else { +__%%ELSE%%__ + } +}`,IC=`async function (obj) { + "__%%DEBUG_TRIGGER%%__"; + __%%CONDITIONS_VARS%%__ + const _cond = __%%CONDITION%%__; + + "__%%DEBUG_CONDITIONS%%__"; + + if (__%%STATE%%__ === false && _cond) { + __%%STATE%%__ = true; +__%%THEN%%__ + } else if (__%%STATE%%__ === true && !_cond) { + __%%STATE%%__ = false; +__%%ELSE%%__ + } +}`,cR=`"__%%DEBUG_TRIGGER%%__"; +__%%CONDITIONS_VARS%%__ +const _cond = __%%CONDITION%%__; + +"__%%DEBUG_CONDITIONS%%__"; + +if (_cond) { +__%%THEN%%__ +} else { +__%%ELSE%%__ +}`,Cg={triggers:[],conditions:[[]],justCheck:!1,actions:{then:[],else:[]}};function uR(a,s,i){const r=[];let l=a.triggers;l.length||(l=[{id:"TriggerScriptSave"}]);const c=[],d=[],h=a.conditions.find(f=>f.find(b=>b.tagCard==="()"));l.forEach((f,b)=>{var w;const y=Wm(f.id,i);if(y){const v={trigger:f,condition:{index:0},justCheck:h?!1:a.justCheck||!a.conditions.length||!a.conditions[0].length,conditionsDebug:[],conditionsVars:[],conditionsStates:[]},_=y.compile(f,v),$=dR(a.conditions,v,i),S=bw(a.actions.then,v,i),T=bw(a.actions.else,v,i);c.push(`cond${b}`),(w=v.prelines)!=null&&w.length&&v.prelines.forEach(E=>d.push(E)),_.includes(" __%%CONDITIONS_VARS%%__")&&(v.conditionsVars=v.conditionsVars.map((E,D)=>D?` ${E}`:E),v.conditionsDebug=v.conditionsDebug.map((E,D)=>D?` ${E}`:E)),r.push(_.replace("__%%CONDITIONS_VARS%%__",v.conditionsVars.join(` +`)).replace('"__%%DEBUG_CONDITIONS%%__";',v.conditionsDebug.join(` +`)).replace("__%%CONDITION%%__",$).replace("__%%THEN%%__",S||"// ignore").replace("__%%ELSE%%__",T||"// ignore").replace(/__%%STATE%%__/g,`cond${b}`))}});let p=r.join(` + +`);return(!a.justCheck||h)&&(p=`${c.map(f=>`let ${f} = false;`).join(` +`)} + +${p}`),d&&(p=`${d.join(` +`)} + +${p}`),p}function Wm(a,s){return s.find(i=>i.getStaticData&&i.getStaticData().id===a)}function bw(a,s,i){const r=[];return a==null||a.forEach(l=>{const c=Wm(l.id,i);c&&r.push(c.compile(l,s))}),` ${r.join(` + + `)}`}function dR(a,s,i){const r=[];let l=0;return a==null||a.forEach(c=>{const d=[];c!=null&&c.length&&(c.forEach(h=>{const p=Wm(h.id,i);p&&(s.condition.index=l++,d.push(p.compile(h,s)))}),r.push(`(${d.join(`) && + (`)})`))}),r.length?r.length===1?r[0]||"true":`(${r.join(") || (")})`:"true"}function hR(a,s){return uR(a,null,s)}function pne(a){if(!a)return Cg;const s=a.split(` +`);try{const i=(s.pop()||"").replace(/^\/\//,"");let r=JSON.parse(i);return r.triggers||(r=Cg),r}catch{return Cg}}function gne(a,s){let i="";const r=hR(a,s);return i+=r,i+=` +/* +const demo = ${JSON.stringify(a,null,2).replace(/\*\//g,"* /")}; +*/ +`,`${i} +//${JSON.stringify(a)}`}class Pc extends at{constructor(s){super(s,Pc.getStaticData())}static compile(s,i){return cR.replace('"__%%DEBUG_TRIGGER%%__"',`_sendToFrontEnd(${s._id}, {trigger: true})`)}renderDebug(){return x.I18n.t("Triggered")}onTagChange(s){this.setState({inputs:[{nameRender:"renderNameText",defaultValue:"On script save or adapter start",attr:"script"}]},()=>super.onTagChange())}static getStaticData(){return{acceptedBy:"triggers",name:"Start script",id:"TriggerScriptSave",icon:"PlayArrow",title:"Triggers the on script saving or the javascript instance restart"}}getData(){return Pc.getStaticData()}}var xC={exports:{}};(function(a,s){(function(){var i=Math.PI,r=Math.sin,l=Math.cos,c=Math.tan,d=Math.asin,h=Math.atan2,p=Math.acos,f=i/180,b=1e3*60*60*24,y=2440588,w=2451545;function v(re){return re.valueOf()/b-.5+y}function _(re){return new Date((re+.5-y)*b)}function $(re){return v(re)-w}var S=f*23.4397;function T(re,B){return h(r(re)*l(S)-c(B)*r(S),l(re))}function E(re,B){return d(r(B)*l(S)+l(B)*r(S)*r(re))}function D(re,B,N){return h(r(re),l(re)*r(B)-c(N)*l(B))}function M(re,B,N){return d(r(B)*r(N)+l(B)*l(N)*l(re))}function P(re,B){return f*(280.16+360.9856235*re)-B}function W(re){return re<0&&(re=0),2967e-7/Math.tan(re+.00312536/(re+.08901179))}function G(re){return f*(357.5291+.98560028*re)}function z(re){var B=f*(1.9148*r(re)+.02*r(2*re)+3e-4*r(3*re)),N=f*102.9372;return re+B+N+i}function Z(re){var B=G(re),N=z(B);return{dec:E(N,0),ra:T(N,0)}}var he={};he.getPosition=function(re,B,N){var te=f*-N,q=f*B,se=$(re),j=Z(se),Te=P(se,te)-j.ra;return{azimuth:D(Te,q,j.dec),altitude:M(Te,q,j.dec)}};var Ce=he.times=[[-.833,"sunrise","sunset"],[-.3,"sunriseEnd","sunsetStart"],[-6,"dawn","dusk"],[-12,"nauticalDawn","nauticalDusk"],[-18,"nightEnd","night"],[6,"goldenHourEnd","goldenHour"]];he.addTime=function(re,B,N){Ce.push([re,B,N])};var R=9e-4;function K(re,B){return Math.round(re-R-B/(2*i))}function C(re,B,N){return R+(re+B)/(2*i)+N}function Q(re,B,N){return w+re+.0053*r(B)-.0069*r(2*N)}function ve(re,B,N){return p((r(re)-r(B)*r(N))/(l(B)*l(N)))}function ce(re,B,N,te,q,se,j){var Te=ve(re,N,te),ae=C(Te,B,q);return Q(ae,se,j)}he.getTimes=function(re,B,N){var te=f*-N,q=f*B,se=$(re),j=K(se,te),Te=C(0,te,j),ae=G(Te),we=z(ae),Ie=E(we,0),Ne=Q(Te,ae,we),Ae,We,k,X,Y,O={solarNoon:_(Ne),nadir:_(Ne+.5)};for(Ae=0,We=Ce.length;Ae=0&&(U=Math.sqrt(X)/(Math.abs(Ne)*2),O=We-U,A=We+U,Math.abs(O)<=1&&Y++,Math.abs(A)<=1&&Y++,O<-1&&(O=A)),Y===1?j<0?we=H+O:Ie=H+O:Y===2&&(we=H+(k<0?A:O),Ie=H+(k<0?O:A)),!(we&&Ie));H+=2)j=ae;var ue={};return we&&(ue.rise=me(q,we)),Ie&&(ue.set=me(q,Ie)),!we&&!Ie&&(ue[k>0?"alwaysUp":"alwaysDown"]=!0),ue},a.exports=he})()})(xC);var pR=xC.exports;const DC=Xo(pR),gR='{"time":{"start":"00:00","end":"24:00","mode":"hours","interval":1},"period":{"days":1}}';class Ii extends at{coordinates=null;constructor(s){super(s,Ii.getStaticData())}static compile(s,i){var c;let r="",l=i.justCheck?EC:IC;if(l=l.replace('"__%%DEBUG_TRIGGER%%__"',`_sendToFrontEnd(${s._id}, {trigger: true})`),s.tagCard==="interval")r=`setInterval(${l}, ${s.interval||1} * ${s.unit==="s"?1e3:s.unit==="m"?6e4:36e5});`;else if(s.tagCard==="cron")r=`schedule("${s.cron}", ${l});`;else if(s.tagCard==="at"){const[d,h]=(s.at||"").split(":");let p="*";if((c=s==null?void 0:s.dow)!=null&&c.length&&!s.dow.includes("_")){const f=[...s.dow].map(v=>parseInt(v,10));f.sort();const b=[];let y=f[0],w=1;for(;w1?(y===f[w-1]?b.push(y.toString()):f[w-1]-y===1?b.push(`${y},${f[w-1]}`):b.push(`${y}-${f[w-1]}`),y=f[w]):w===f.length-1&&(y===f[w-1]||f[w]-y===1?b.push(`${y},${f[w]}`):b.push(`${y}-${f[w]}`));p=b.join(",")}r=`schedule("${h||"0"} ${d||"0"} * * ${p}", ${l});`}else s.tagCard==="astro"?r=`schedule({astro: "${s.astro}", shift: ${s.offset?s.offsetValue:0}}, ${l});`:s.tagCard==="wizard"&&(r=`schedule('${s.wizard}', ${l});`);return r}static _time2String(s){return s?`${s.getHours().toString().padStart(2,"0")}:${s.getMinutes().toString().padStart(2,"0")}`:"--:--"}async _setAstro(s,i,r){var p,f;if(s||=this.state.settings.astro||"solarNoon",i??=this.state.settings.offset,r??=this.state.settings.offsetValue,r=parseInt(r,10)||0,!this.coordinates){const b=await this.props.socket.getObject("system.adapter.javascript.0"),y=(p=b==null?void 0:b.native)==null?void 0:p.latitude,w=(f=b==null?void 0:b.native)==null?void 0:f.longitude;if(!y&&!w){const v=await this.props.socket.getObject("system.config");v!=null&&v.common&&(v.common.latitude||v.common.longitude)?this.coordinates={latitude:parseFloat(v.common.latitude),longitude:parseFloat(v.common.longitude)}:this.coordinates=null}else this.coordinates={latitude:parseFloat(y),longitude:parseFloat(w)}}const l=this.coordinates&&DC.getTimes(new Date,this.coordinates.latitude,this.coordinates.longitude),c=l?Object.keys(l).map(b=>({value:b,title:b,title2:`[${Ii._time2String(l[b])}]`,order:l?Ii._time2String(l[b]):"??:??"})):[];c.sort((b,y)=>b.order>y.order?1:b.ordersuper.onTagChange())}_setInterval(s){s=parseInt(s||this.state.settings.interval,10)||30;let i;s===1?i=[{value:"s",title:"second"},{value:"m",title:"minute"},{value:"h",title:"hour"}]:i=[{value:"s",title:"seconds"},{value:"m",title:"minutes"},{value:"h",title:"hours"}],this.setState({inputs:[{nameRender:"renderNumber",attr:"interval",frontText:"every",defaultValue:30,className:"block-input-interval"},{nameRender:"renderSelect",attr:"unit",defaultValue:"s",options:i}]},()=>super.onTagChange())}renderDebug(s){return x.I18n.t("Triggered")}onValueChanged(s,i){this.state.settings.tagCard==="astro"?i==="astro"?this._setAstro(s):i==="offset"?this._setAstro(void 0,s):i==="offsetValue"&&this._setAstro(void 0,void 0,s):this.state.settings.tagCard==="interval"&&i==="interval"&&this._setInterval(s)}renderCron(s,i,r){const{className:l}=this.props;return m.jsxs("div",{children:[m.jsxs("div",{style:{display:"flex",alignItems:"baseline"},children:[m.jsx("div",{style:{width:"100%"},children:this.renderText({nameRender:"renderText",attr:"cron",defaultValue:i},this.state.settings.cron||i,r)}),m.jsx(Jr,{square:!0,style:{marginLeft:7},value:"...",className:l,onClick:()=>this.setState({openDialog:!0,textCron:this.state.settings.cron})})]}),this.state.openDialog?m.jsx(am,{disabled:this.state.settings.cron===this.state.textCron,onApply:()=>{const c=this.state.textCron;r(c,"cron",()=>{r(x.convertCronToText(c,x.I18n.getLanguage()),"addText"),this.setState({openDialog:!1})})},onClose:()=>this.setState({openDialog:!1,textCron:""}),children:m.jsx(x.ComplexCron,{cronExpression:this.state.settings.cron,onChange:c=>this.setState({textCron:c}),language:x.I18n.getLanguage()})}):null,this.renderNameText({nameRender:"renderNameText",defaultValue:x.I18n.t("every hour at 0 minutes"),attr:"addText",signature:!0,doNotTranslate:!0},this.state.settings.addText||x.I18n.t("every hour at 0 minutes"))]},"cron")}renderWizard(s,i,r){const{className:l}=this.props;return m.jsxs("div",{children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:7},children:[m.jsx(Ei,{className:l,autoComplete:"off",fullWidth:!0,variant:"outlined",size:"small",multiline:!0,rows:2,value:this.state.settings.wizardText,onChange:c=>r(c),customValue:!0}),m.jsx(Jr,{square:!0,style:{marginLeft:7},value:"...",className:l,onClick:()=>this.setState({openDialog:!0,wizard:this.state.settings.wizard,wizardText:x.Schedule.state2text(this.state.settings.wizard)})})]}),this.state.openDialog?m.jsx(am,{disabled:this.state.settings.wizard===this.state.wizard,onApply:()=>this.setState({openDialog:!1},()=>{const c=JSON.parse(this.state.wizard);c.valid||={from:x.Schedule.now2string()},c.valid.from||=x.Schedule.now2string(),r({wizardText:this.state.wizardText,wizard:JSON.stringify(c)})}),onClose:()=>this.setState({openDialog:!1}),children:m.jsx(x.Schedule,{theme:this.props.theme,schedule:i,onChange:(c,d)=>this.setState({wizardText:d||"",wizard:c})})}):null]},"wizard")}onTagChange(s){switch(s||=this.state.settings.tagCard,s){case"interval":this._setInterval();break;case"cron":this.setState({inputs:[{nameRender:"renderCron",attr:"cron",defaultValue:"0 * * * *"}]},()=>super.onTagChange());break;case"wizard":{const i=JSON.parse(gR);i.valid||={from:x.Schedule.now2string()},i.valid.from||=x.Schedule.now2string(),this.setState({inputs:[{nameRender:"renderWizard",attr:"wizard",defaultValue:JSON.stringify(i)}]},()=>super.onTagChange(null,()=>{const r=x.Schedule.state2text(this.state.settings.wizard||i);if(this.state.settings.wizard!==r){const l=JSON.parse(JSON.stringify(this.state.settings));l.wizardText=r,this.setState({settings:l}),this.props.onChange(l)}}));break}case"at":this.setState({inputs:[{nameRender:"renderTime",prefix:"at",attr:"at",defaultValue:"07:30"},{nameRender:"renderSelect",attr:"dow",default:"",multiple:!0,defaultValue:["_","1","2","3","4","5","6","0"],options:[{value:"_",title:"Every day",only:!0},{value:"1",title:"Monday",titleShort:"Mo"},{value:"2",title:"Tuesday",titleShort:"Tu"},{value:"3",title:"Wednesday",titleShort:"We"},{value:"4",title:"Thursday",titleShort:"Th"},{value:"5",title:"Friday",titleShort:"Fr"},{value:"6",title:"Saturday",titleShort:"Sa"},{value:"0",title:"Sunday",titleShort:"Su"}]}]},()=>super.onTagChange());break;case"astro":this._setAstro();break}}static getStaticData(){return{acceptedBy:"triggers",name:"Schedule",id:"TriggerScheduleBlock",icon:"AccessTime",tagCardArray:["cron","wizard","interval","at","astro"],title:"Triggers the rule periodically or on some specific time"}}getData(){return Ii.getStaticData()}}const In={valueAck:{color:"#b02323"},valueNotAck:{color:"#12ac15"}},AC=_e.forwardRef((a,s)=>m.jsx(XT,{direction:"up",ref:s,...a}));AC.displayName="Transition";class Bc extends at{inputRef;constructor(s){super(s,Bc.getStaticData()),this.inputRef=_e.createRef()}static compile(s,i){let r=i.justCheck?EC:IC;return r=r.replace('"__%%DEBUG_TRIGGER%%__"',`_sendToFrontEnd(${s._id}, {val: obj.state.val, ack: obj.state.ack, valOld: obj.oldState && obj.oldState.val, ackOld: obj.oldState && obj.oldState.ack})`),`on({id: "${s.oid||""}", change: "${s.tagCard==="on update"?"any":"ne"}"}, ${r});`}renderDebug(s){return s.data.valOld!==void 0?m.jsxs("span",{children:[x.I18n.t("Triggered")," ",m.jsx("span",{style:s.data.ackOld?In.valueAck:In.valueNotAck,children:Ln(s.data.valOld)})," ","→"," ",m.jsx("span",{style:s.data.ack?In.valueAck:In.valueNotAck,children:Ln(s.data.val)})]}):m.jsxs("span",{children:[x.I18n.t("Triggered")," ",m.jsx("span",{style:s.data.ack?In.valueAck:In.valueNotAck,children:Ln(s.data.val)})]})}onWriteValue(){this.setState({openSimulate:!1});let s=this.state.simulateValue;window.localStorage.setItem(`javascript.app.${this.state.settings.oid}_ack`,this.state.simulateAck?"true":"false"),this.state.settings.oidType==="boolean"?(s=s===!0||s==="true"||s==="1",window.localStorage.setItem(`javascript.app.${this.state.settings.oid}`,s?"true":"false")):this.state.settings.oidType==="number"?(s=parseFloat(s)||0,window.localStorage.setItem(`javascript.app.${this.state.settings.oid}`,s.toString())):window.localStorage.setItem(`javascript.app.${this.state.settings.oid}`,(s==null?void 0:s.toString())||""),this.props.socket.setState(this.state.settings.oid,{val:s,ack:!!this.state.simulateAck})}renderWriteState(){return[m.jsx(He,{disabled:!this.state.settings.oid||!this.state.enableSimulation,variant:"contained",color:"primary",onClick:()=>{this.setState({openSimulate:!0,simulateValue:this.state.settings.oidType==="boolean"?window.localStorage.getItem(`javascript.app.${this.state.settings.oid}`)==="true":window.localStorage.getItem(`javascript.app.${this.state.settings.oid}`)||"",simulateAck:window.localStorage.getItem(`javascript.app.${this.state.settings.oid}_ack`)==="true"}),setTimeout(()=>{var s;return(s=this.inputRef.current)==null?void 0:s.focus()},200)},children:x.I18n.t("Simulate")},"buttonWrite"),m.jsxs(Ut,{open:!!this.state.openSimulate,TransitionComponent:AC,keepMounted:!0,onClose:()=>this.setState({openSimulate:!1}),"aria-labelledby":"simulate-dialog-slide-title","aria-describedby":"simulate-dialog-slide-description",children:[m.jsx(ss,{id:"simulate-dialog-slide-title",children:x.I18n.t("Trigger with value")}),m.jsxs(qt,{children:[this.state.settings.oidType==="boolean"?m.jsx(Rg,{control:m.jsx(Nw,{inputRef:this.inputRef,onKeyUp:s=>s.key==="Enter"&&this.onWriteValue(),value:!!this.state.simulateValue,onChange:s=>this.setState({simulateValue:s.target.checked})}),label:x.I18n.t("Value")}):m.jsx(Eo,{variant:"standard",inputRef:this.inputRef,label:x.I18n.t("Value"),fullWidth:!0,onKeyUp:s=>s.key==="Enter"&&this.onWriteValue(),value:!this.state.simulateValue&&this.state.simulateValue!==0?"":this.state.simulateValue,onChange:s=>this.setState({simulateValue:s.target.value})}),m.jsx("br",{}),m.jsx(Rg,{control:m.jsx(wc,{checked:!!this.state.simulateAck,onChange:s=>this.setState({simulateAck:s.target.checked}),color:"primary"}),label:x.I18n.t("Ack")})]}),m.jsxs(Ht,{children:[m.jsxs(He,{variant:"contained",onClick:()=>this.onWriteValue(),color:"primary",children:[m.jsx(TS,{}),x.I18n.t("Write")]}),m.jsxs(He,{color:"grey",variant:"contained",onClick:()=>this.setState({openSimulate:!1}),children:[m.jsx(Yc,{}),x.I18n.t("Close")]})]})]},"dialogWrite")]}onTagChange(s){this.setState({inputs:[{nameRender:"renderObjectID",attr:"oid",defaultValue:""},{nameRender:"renderWriteState"}]},()=>{super.onTagChange()})}static getStaticData(){return{acceptedBy:"triggers",name:"State",id:"TriggerState",icon:"FlashOn",tagCardArray:["on change","on update"],title:"Triggers the rule on update or change of some state"}}getData(){return Bc.getStaticData()}}const mR=""+new URL("hysteresis-CLhhemcG.png",import.meta.url).href,vw=`function __hysteresis(val, limit, state, hist, comp) { + let cond1, cond2; + if (comp === '>') { + cond1 = val > limit + hist; + cond2 = val <= limit - hist; + } else if (comp === '<') { + cond1 = val < limit - hist; + cond2 = val >= limit + hist; + } else if (comp === '>=') { + cond1 = val >= limit + hist; + cond2 = val < limit - hist; + } else if (comp === '<=') { + cond1 = val <= limit - hist; + cond2 = val > limit + hist; + } else if (comp === '=') { + cond1 = val <= limit + hist && val > limit - hist; + cond2 = val > limit + hist || val <= limit - hist; + } else if (comp === '<>') { + cond1 = val > limit + hist || val <= limit - hist; + cond2 = val <= limit + hist && val > limit - hist; + } + + if (!state && cond1) { + return true; + } else if (state && cond2) { + return false; + } else { + return state; + } +}`;class qr extends at{constructor(s){super(s,qr.getStaticData())}isAllTriggersOnState(){var s,i,r,l;return!!((i=(s=this.props.userRules)==null?void 0:s.triggers)!=null&&i.find(c=>c.id==="TriggerState"))&&!((l=(r=this.props.userRules)==null?void 0:r.triggers)!=null&&l.find(c=>c.id!=="TriggerState"))}static compile(s,i){var d,h;let r=s.value;r==null&&(r=!1);let l,c;if(s.tagCard==="()")i.prelines||=[],i.prelines.find(p=>p!==vw)||i.prelines.push(vw),s.useTrigger?(l="obj.state.val",r===""&&(r=0),c=`__hysteresis(subCondVar${s._id}, ${r}, __%%STATE%%__, ${s.hist}, "${s.histComp}")`):(l=`(await getStateAsync("${s.oid}")).val`,r===""&&(r=0),typeof r=="string"&&parseFloat(r.trim()).toString()!==r.trim()&&(r=`"${r}"`),c=`__hysteresis(subCondVar${s._id}, ${r}, __%%STATE%%__, ${s.hist}, "${s.histComp}")`);else if(s.tagCard!=="includes"){const p=s.tagCard==="="?"==":s.tagCard==="<>"?"!=":s.tagCard;s.useTrigger?(l="obj.state.val",((d=i==null?void 0:i.trigger)==null?void 0:d.oidType)==="string"?(r=r.replace(/"/g,'\\"'),c=`subCondVar${s._id} ${p} "${r}"`):(r===""&&(r=0),typeof r=="string"&&parseFloat(r.trim()).toString()!==r.trim()&&(r=`"${r}"`),c=`subCondVar${s._id} ${p} ${r}`)):(l=`(await getStateAsync("${s.oid}")).val`,s.oidType==="string"?(r=r.replace(/"/g,'\\"'),c=`subCondVar${s._id} ${p} "${r}"`):(r===""&&(r=0),typeof r=="string"&&parseFloat(r.trim()).toString()!==r.trim()&&(r=`"${r}"`),c=`subCondVar${s._id} ${p} ${r}`))}else s.useTrigger?(l="obj.state.val",((h=i==null?void 0:i.trigger)==null?void 0:h.oidType)==="string"?(r=r.replace(/"/g,'\\"'),c=`obj.state.val.includes("${r}")`):c="false"):(l=`(await getStateAsync("${s.oid}")).val`,s.oidType==="string"?(r=r.replace(/"/g,'\\"'),c=`subCondVar${s._id}.includes("${r}")`):c="false");return i.conditionsStates.push({name:`subCondVar${s._id}`,id:s.oid}),i.conditionsVars.push(`const subCondVar${s._id} = ${l};`),i.conditionsVars.push(`const subCond${s._id} = ${c};`),i.conditionsDebug.push(`_sendToFrontEnd(${s._id}, {result: subCond${s._id}, value: subCondVar${s._id}, compareWith: "${r}"});`),`subCond${s._id}`}renderDebug(s){const i=this.state.settings.tagCard;return i!=="()"?`${s.data.result.toString().toUpperCase()} [${s.data.value} ${i} ${s.data.compareWith}]`:x.I18n.t("Triggered")}onShowHelp=()=>this.setState({showHysteresisHelp:!0});_setInputs(s,i,r,l,c){var $,S;const d=this.isAllTriggersOnState();i=i||this.state.settings.tagCard,r=r||this.state.settings.oidType,l=l||this.state.settings.oidUnit,c=c||this.state.settings.oidStates,s===void 0&&(s=this.state.settings.useTrigger),d&&s&&((S=($=this.props.userRules)==null?void 0:$.triggers)==null?void 0:S.length)===1&&(r=this.props.userRules.triggers[0].oidType,l=this.props.userRules.triggers[0].oidUnit,c=this.props.userRules.triggers[0].oidStates);const h=qr.getStaticData().tagCardArray,p=h.find(T=>T.title===i)||h[0];let f,b=null;r==="number"?(f=[{title:"=",title2:"[equal]",text:"equal to"},{title:">=",title2:"[greater or equal]",text:"greater or equal"},{title:">",title2:"[greater]",text:"greater than"},{title:"<=",title2:"[less or equal]",text:"less or equal"},{title:"<",title2:"[less]",text:"less than"},{title:"<>",title2:"[not equal]",text:"not equal to"},{title:"()",title2:"[hysteresis]",text:"hysteresis"}],c&&(b=Object.keys(c).map(T=>c?{value:T,title:c[T]}:null).filter(T=>T))):r==="boolean"?(f=[{title:"=",title2:"[equal]",text:"equal to"},{title:"<>",title2:"[not equal]",text:"not equal to"}],b=[{title:"false",value:!1},{title:"true",value:!0}]):(f=[{title:"=",title2:"[equal]",text:"equal to"},{title:">=",title2:"[greater or equal]",text:"greater or equal"},{title:">",title2:"[greater]",text:"greater than"},{title:"<=",title2:"[less or equal]",text:"less or equal"},{title:"<",title2:"[less]",text:"less than"},{title:"<>",title2:"[not equal]",text:"not equal to"},{title:".",title2:"[includes]",text:"includes"}],c&&(b=Object.keys(c).map(T=>({value:T,title:c?c[T]:T.toString()}))));let y=null;f.find(T=>T.title===i)||(i=f[0].title,y=y||{...this.state.settings},y.tagCard=i);let w,v={nameRender:"renderText",defaultValue:"",attr:"value",frontText:i==="()"?"Limit":(p==null?void 0:p.text)||"compare with",doNotTranslateBack:!0,backText:l};b&&(v={nameRender:"renderSelect",defaultValue:b[0].value,options:b,attr:"value",frontText:(p==null?void 0:p.text)||"compare with",doNotTranslateBack:!0,backText:l},b.find(T=>T.value===this.state.settings.value)||(y=y||{...this.state.settings},y.value=b[0].value),b.length<=2&&(f=[{title:"=",title2:"[equal]",text:"equal to"},{title:"<>",title2:"[not equal]",text:"not equal to"}])),d&&s?w=[{backText:"use trigger value",nameRender:"renderCheckbox",attr:"useTrigger",defaultValue:!1},v]:d?w=[{backText:"use trigger value",nameRender:"renderCheckbox",attr:"useTrigger"},{nameRender:"renderObjectID",attr:"oid",defaultValue:""},v]:w=[{nameRender:"renderObjectID",attr:"oid",defaultValue:""},v],i==="()"&&(w.splice(1,0,{nameRender:"renderDialog",icon:"HelpOutline",frontText:"Explanation",onShowDialog:this.onShowHelp}),w.splice(2,0,{nameRender:"renderSelect",attr:"histComp",defaultValue:">",frontText:"Condition",doNotTranslate:!0,options:[{title:">",value:">"},{title:">=",value:">="},{title:"<",value:"<"},{title:"<=",value:"<="},{title:"=",value:"="},{title:"<>",value:"<>"}]}),w.push({frontText:"Δ",doNotTranslate:!0,nameRender:"renderNumber",noHelperText:!0,attr:"hist",defaultValue:1,doNotTranslateBack:!0,backText:l}));const _={iconTag:!0,tagCardArray:f,inputs:w};this.setState(_,()=>super.onTagChange(null,()=>{y&&(this.setState({settings:y}),this.props.onChange(y))}))}onValueChanged(s,i){typeof s=="object"?this._setInputs(s.useTrigger,s.tagCard,s.oidType,s.states):i==="useTrigger"?this._setInputs(s):i==="oidType"?this._setInputs(void 0,void 0,s):i==="oidUnit"?this._setInputs(void 0,void 0,void 0,s):i==="oidStates"&&this._setInputs(void 0,void 0,void 0,void 0,s)}onUpdate(){this._setInputs(this.state.settings.useTrigger)}onTagChange(s){this._setInputs(this.state.settings.useTrigger,s)}static getStaticData(){return{acceptedBy:"conditions",name:"State condition",id:"ConditionState",icon:"Shuffle",tagCardArray:[{title:"=",title2:"[equal]",text:"equal to"},{title:">=",title2:"[greater or equal]",text:"greater or equal"},{title:">",title2:"[greater]",text:"greater than"},{title:"<=",title2:"[less or equal]",text:"less or equal"},{title:"<",title2:"[less]",text:"less than"},{title:"<>",title2:"[not equal]",text:"not equal to"},{title:".",title2:"[includes]",text:"includes"},{title:"()",title2:"[hysteresis]",text:"hysteresis"}],title:"Compares the state value with user defined value"}}getData(){return qr.getStaticData()}renderSpecific(){return this.state.showHysteresisHelp?m.jsxs(Ut,{open:!0,maxWidth:"md",onClose:()=>this.setState({showHysteresisHelp:!1}),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[m.jsx(qt,{children:m.jsx(Dw,{id:"alert-dialog-description",children:m.jsx("img",{src:mR,alt:"Hysteresis"})})}),m.jsx(Ht,{children:m.jsx(He,{onClick:()=>this.setState({showHysteresisHelp:!1}),color:"primary",autoFocus:!0,children:x.I18n.t("OK")})})]}):null}}const yw=[31,29,31,30,31,30,31,31,30,31,30,31];class Xr extends at{constructor(s){super(s,Xr.getStaticData())}static compile(s,i){const r=s.tagCard==="="?"===":s.tagCard==="<>"?"!==":s.tagCard;let l;if(s.withDate){const[c,d]=(s.date||"01.01").toString().split(".");let h=parseInt(d,10)||0,p=parseInt(c,10)||0;p>12?p=12:p<0&&(p=0),h>yw[p]?h=yw[p]:h<0&&(h=0),h&&p?l=`formatDate(Date.now(), 'MM.DD-hh:mm') ${r} "${s.date}-${s.time}"`:h===0&&p?l=`formatDate(Date.now(), 'MM-hh:mm') ${r} "${p.toString().padStart(2,"0")}-${s.time}"`:p===0&&h?l=`formatDate(Date.now(), 'DD-hh:mm') ${r} "${h.toString().padStart(2,"0")}-${s.time}"`:l=`formatDate(Date.now(), 'hh:mm') ${r} "${s.time}"`}else l=`formatDate(Date.now(), 'hh:mm') ${r} "${s.time}"`;return i.conditionsVars.push(`const subCond${s._id} = ${l};`),i.conditionsDebug.push(`_sendToFrontEnd(${s._id}, {result: subCond${s._id}});`),`subCond${s._id}`}_setInputs(s,i){i=i===void 0?this.state.settings.withDate:i,s=s||this.state.settings.tagCard;const r=Xr.getStaticData().tagCardArray,l=r==null?void 0:r.find(d=>d.title===s),c=[{nameRender:"renderNameText",attr:"interval",defaultValue:"Actual time of day"},{frontText:(l==null?void 0:l.text)||s,nameRender:"renderTime",attr:"time",defaultValue:"12:00"},{frontText:"with date",nameRender:"renderCheckbox",attr:"withDate",defaultValue:!1}];i&&c.push({nameRender:"renderDate",attr:"date",defaultValue:"01.01"}),this.setState({inputs:c,iconTag:!0},()=>super.onTagChange())}onValueChanged(s,i){i==="withDate"&&this._setInputs(void 0,s)}onTagChange(s){this._setInputs(s)}static getStaticData(){return{acceptedBy:"conditions",name:"Time condition",id:"ConditionTime",icon:"Shuffle",tagCardArray:[{title:"=",title2:"[equal]",text:"equal to"},{title:">=",title2:"[greater or equal]",text:"greater or equal"},{title:">",title2:"[greater]",text:"greater than"},{title:"<=",title2:"[less or equal]",text:"less or equal"},{title:"<",title2:"[less]",text:"less than"},{title:"<>",title2:"[not equal]",text:"not equal to"}],title:"Compares current time with the user specific time"}}getData(){return Xr.getStaticData()}}class Vo extends at{coordinates=null;constructor(s){super(s,Vo.getStaticData())}static compile(s,i){const r=s.tagCard==="="?"===":s.tagCard==="<>"?"!==":s.tagCard;let l;s.offset&&(l=parseInt(s.offsetValue,10)||0);const c=`formatDate(Date.now(), 'hh:mm') ${r} formatDate(getAstroDate("${s.astro}"${l?`, undefined, ${l}`:""}), 'hh:mm')`;return i.conditionsVars.push(`const subCond${s._id} = ${c};`),i.conditionsDebug.push(`_sendToFrontEnd(${s._id}, {result: ${c}});`),c}static _time2String(s){return s?`${s.getHours().toString().padStart(2,"0")}:${s.getMinutes().toString().padStart(2,"0")}`:"--:--"}onValueChanged(s,i){i==="astro"?this._setAstro(s):i==="offset"?this._setAstro(void 0,s):i==="offsetValue"&&this._setAstro(void 0,void 0,s)}async _setAstro(s,i,r){if(s=s||this.state.settings.astro||"solarNoon",i=i===void 0?this.state.settings.offset:i,r=r===void 0?this.state.settings.offsetValue:r,r=parseInt(r,10)||0,!this.coordinates){const b=await this.props.socket.getObject("system.adapter.javascript.0");if(!(b!=null&&b.native.latitude)&&!(b!=null&&b.native.longitude)){const y=await this.props.socket.getObject("system.config");y&&(y.common.latitude||y.common.longitude)?this.coordinates={latitude:y.common.latitude,longitude:y.common.longitude}:this.coordinates=null}else this.coordinates={latitude:b==null?void 0:b.native.latitude,longitude:b==null?void 0:b.native.longitude}}const l=this.coordinates?DC.getTimes(new Date,this.coordinates.latitude,this.coordinates.longitude):null,c=l?Object.keys(l).map(b=>({value:b,title:b,title2:`[${Vo._time2String(l[b])}]`,order:Vo._time2String(l[b])})):[];c.sort((b,y)=>b.order>y.order?1:b.orderb.title===this.state.settings.tagCard)||d[0];let p="--:--";if(s&&l&&l[s]){const b=new Date(l[s]);i&&b.setMinutes(b.getMinutes()+parseInt(r,10)),p=`(${x.I18n.t(h.text)} ${Vo._time2String(b)})`}let f;i?f=[{nameRender:"renderNameText",defaultValue:"Actual time of day",attr:"text"},{frontText:h.text,attr:"astro",nameRender:"renderSelect",options:c,doNotTranslate2:!0,defaultValue:"solarNoon"},{backText:"with offset",nameRender:"renderCheckbox",attr:"offset"},{backText:r===1?"minute":"minutes",frontText:"offset",nameRender:"renderNumber",defaultValue:0,attr:"offsetValue",noHelperText:!0},{nameRender:"renderNameText",attr:"textTime",doNotTranslate:!0,defaultValue:p}]:f=[{nameRender:"renderNameText",defaultValue:"Actual time of day",attr:"text"},{frontText:h.text,attr:"astro",nameRender:"renderSelect",options:c,doNotTranslate2:!0,defaultValue:"solarNoon"},{backText:"with offset",nameRender:"renderCheckbox",attr:"offset"},{nameRender:"renderNameText",attr:"textTime",doNotTranslate:!0,defaultValue:p}],this.setState({inputs:f},()=>super.onTagChange())}onTagChange(){this._setAstro()}static getStaticData(){return{acceptedBy:"conditions",name:"Astronomical",id:"ConditionAstronomical",icon:"Brightness3",tagCardArray:[{title:"=",title2:"[equal]",text:"equal to"},{title:">=",title2:"[greater or equal]",text:"greater or equal to"},{title:">",title2:"[greater]",text:"greater than"},{title:"<=",title2:"[less or equal]",text:"less or equal to"},{title:"<",title2:"[less]",text:"less than"},{title:"<>",title2:"[not equal]",text:"not equal to"}],title:"Compares current time with astronomical event"}}getData(){return Vo.getStaticData()}}const _w={valueAck:{color:"#b02323"},valueNotAck:{color:"#12ac15"}};class Fc extends at{constructor(s){super(s,Fc.getStaticData())}isAllTriggersOnState(){var s,i,r,l;return!!((i=(s=this.props.userRules)==null?void 0:s.triggers)!=null&&i.find(c=>c.id==="TriggerState"))&&!((l=(r=this.props.userRules)==null?void 0:r.triggers)!=null&&l.find(c=>c.id!=="TriggerState"))}static compile(s,i){let r=s.value;s.useTrigger?r=s.toggle?"!obj.state.val":"obj.state.val":(r==null&&(r=""),typeof s.value=="string"&&parseFloat(s.value).toString()!==s.value&&s.value!=="true"&&s.value!=="false"&&(r=`"${r.replace(/"/g,'\\"')}"${at.getReplacesInText(i)}`));let l;return s.toggle&&!s.useTrigger?l=`const subActionVar${s._id} = !(await getStateAsync("${s.oid}")).val`:l=`const subActionVar${s._id} = ${r}`,`// set state ${s.oid} to ${s.toggle&&!s.useTrigger?"toggle":r} + ${l}; + _sendToFrontEnd(${s._id}, {val: subActionVar${s._id}, ack: ${s.tagCard==="update"}}); + await setStateAsync("${s.oid}", subActionVar${s._id}, ${s.tagCard==="update"});`}renderDebug(s){return m.jsxs("span",{children:[x.I18n.t("Set:")," ",m.jsx("span",{style:s.data.ack?_w.valueAck:_w.valueNotAck,children:Ln(s.data.val)})]})}_setInputs(s,i){const r=this.isAllTriggersOnState();i=i===void 0?this.state.settings.toggle:i,s=s===void 0?this.state.settings.useTrigger:s;let l="",c;const{oidType:d,oidUnit:h,oidStates:p,oidMax:f,oidMin:b,oidRole:y,oidWrite:w,oidStep:v}=this.state.settings;let _;d&&(d==="number"?(l="number",f!==void 0&&b!==void 0&&(l="slider")):d==="boolean"?(l="boolean",y&&y.includes("button")&&w&&(l="button")):(l="",y&&y.includes("color")&&(l="color")),p&&(c=Object.keys(p).map(S=>({value:S,title:p[S]})),l="select"));let $;if(r&&s)$=[{backText:"use trigger value",nameRender:"renderCheckbox",attr:"useTrigger",defaultValue:!1}],l==="boolean"&&$.push({backText:"toggle value",attr:"toggle",nameRender:"renderCheckbox",defaultValue:!1});else{switch(l){case"number":$=[{backText:h||"",frontText:"with",nameRender:"renderNumber",defaultValue:f===void 0?0:f,attr:"value"}],this.state.settings.value!==void 0&&isNaN(parseFloat(this.state.settings.value))&&(_={value:f===void 0?0:f});break;case"slider":{$=[{nameRender:"renderSlider",defaultValue:f,min:b,max:f,unit:h,step:v,attr:"value"}];const S=parseFloat(this.state.settings.value);this.state.settings.value!==void 0&&(isNaN(S)||Sf)&&(_={value:f});break}case"select":$=[{nameRender:"renderSelect",frontText:"with",options:c,defaultValue:(c==null?void 0:c[0].value)||"",attr:"value"}],this.state.settings.value!==void 0&&!(c!=null&&c.find(S=>S.value===this.state.settings.value))&&(_={value:(c==null?void 0:c[0].value)||""});break;case"boolean":$=[{backText:"toggle value",attr:"toggle",nameRender:"renderCheckbox",defaultValue:!1}],i||$.push({backText:"true",frontText:"false",nameRender:"renderSwitch",defaultValue:!1,attr:"value"}),this.state.settings.value!==void 0&&this.state.settings.value!==!1&&this.state.settings.value!==!0&&(_={value:!1});break;case"button":$=[{nameRender:"renderButton",defaultValue:!0,attr:"value"}],this.state.settings.value!==void 0&&this.state.settings.value!==!0&&(_={value:!0});break;case"color":$=[{nameRender:"renderColor",frontText:"with",defaultValue:"#FFFFFF",attr:"value"}],this.state.settings.value!==void 0&&(typeof this.state.settings.value!="string"||!this.state.settings.value.startsWith("#")&&!this.state.settings.value.startsWith("rgb"))&&(_={value:"#FFFFFF"});break;default:$=[{backText:h||"",frontText:"with",nameRender:"renderText",defaultValue:"",attr:"value"}];break}r&&$.unshift({backText:"use trigger value",nameRender:"renderCheckbox",attr:"useTrigger"})}return{inputs:$,newSettings:_}}onTagChange(s,i,r,l,c){c=c===void 0?this.state.settings.useTrigger:c;const{inputs:d,newSettings:h}=this._setInputs(c,l);d.unshift({nameRender:"renderObjectID",attr:"oid",defaultValue:"",checkReadOnly:!0}),this.setState({inputs:d},()=>super.onTagChange(null,()=>{if(h){const p=JSON.parse(JSON.stringify(this.state.settings));Object.assign(p,h),this.setState(p),this.props.onChange(p)}}))}onValueChanged(s,i){this.onTagChange(void 0,void 0,void 0,i==="toggle"?s:void 0,i==="useTrigger"?s:void 0)}onUpdate(){this.onTagChange()}static getStaticData(){return{acceptedBy:"actions",name:"Set state action",id:"ActionSetState",icon:"PlayForWork",tagCardArray:["control","update"],title:"Control or update some state",helpDialog:"You can use %s in the value to use the current trigger value or %id to display the triggered object ID"}}getData(){return Fc.getStaticData()}}class jc extends at{constructor(s){super(s,jc.getStaticData())}static compile(s,i){return`// exec "${s.exec}" + const subActionVar${s._id} = "${(s.exec||"").replace(/"/g,'\\"')}"${at.getReplacesInText(i)}; + _sendToFrontEnd(${s._id}, {exec: subActionVar${s._id}}); + console.log(subActionVar${s._id});`}renderDebug(s){return`Exec: ${s.data.exec}`}onTagChange(s){this.setState({inputs:[{nameRender:"renderModalInput",attr:"exec",defaultValue:"ls /opt/iobroker",nameBlock:"Shell command"}]},()=>super.onTagChange(s))}static getStaticData(){return{acceptedBy:"actions",name:"Exec",id:"ActionExec",icon:"Apps",title:"Executes some shell command",helpDialog:"You can use %s in the command to use current trigger value or %id to use the triggered object ID"}}getData(){return jc.getStaticData()}}class zc extends at{constructor(s){super(s,zc.getStaticData())}static compile(s,i){return`// HTTP request ${s.url} + const subActionVar${s._id} = "${(s.url||"").replace(/"/g,'\\"')}"${at.getReplacesInText(i)}; + _sendToFrontEnd(${s._id}, {url: subActionVar${s._id}}); + request(subActionVar${s._id});`}renderDebug(s){return`URL: ${s.data.url}`}onTagChange(s){this.setState({inputs:[{nameRender:"renderModalInput",attr:"url",defaultValue:"http://mydevice.com?...",nameBlock:"URL"}]},()=>super.onTagChange(s))}static getStaticData(){return{acceptedBy:"actions",name:"HTTP Call",id:"ActionHTTPCall",icon:"Language",title:"Make a HTTP get request",helpDialog:"You can use %s in the URL to use current trigger value or %id to use the triggered object ID"}}getData(){return zc.getStaticData()}}class Uc extends at{constructor(s){super(s,Uc.getStaticData())}static compile(s,i){return`// Log ${s.text} + const subActionVar${s._id} = "${(s.text||"").replace(/"/g,'\\"')}"${at.getReplacesInText(i)}; + _sendToFrontEnd(${s._id}, {text: subActionVar${s._id}}); + console.log(subActionVar${s._id});`}renderDebug(s){return x.I18n.t("Log: %s",s.data.text)}onTagChange(){this.setState({inputs:[{nameRender:"renderModalInput",attr:"text",defaultValue:"My device triggered",nameBlock:"Log text"}]},()=>super.onTagChange())}static getStaticData(){return{acceptedBy:"actions",name:"Log text",id:"ActionPrintText",icon:"Subject",title:"Print some text in log",helpDialog:"You can use %s in the text to display current trigger value or %id to display the triggered object ID"}}getData(){return Uc.getStaticData()}}class Hc extends at{constructor(s){super(s,Hc.getStaticData())}static compile(s){const i=s.unit==="ms"?1:s.unit==="s"?1e3:s.unit==="m"?6e4:36e5;return`// pause for ${i}ms + _sendToFrontEnd(${s._id}, {paused: true}); + + await wait(${s.pause} * ${i}); + + _sendToFrontEnd(${s._id}, {paused: false});`}renderDebug(s){return x.I18n.t("Paused: %s",s.data.paused)}_getOptions(s){return s=s===void 0?this.state.settings.pause:s,s===1||s==="1"?[{value:"ms",title:"millisecond"},{value:"s",title:"second"},{value:"m",title:"minute"},{value:"h",title:"hour"}]:[{value:"ms",title:"milliseconds"},{value:"s",title:"seconds"},{value:"m",title:"minutes"},{value:"h",title:"hours"}]}_setInputs(s){this.setState({inputs:[{nameRender:"renderNumber",attr:"pause",defaultValue:100,noHelperText:!0},{nameRender:"renderSelect",attr:"unit",defaultValue:"ms",options:this._getOptions(s)}]},()=>super.onTagChange())}onValueChanged(s,i){i==="pause"&&this._setInputs(s)}onTagChange(){this._setInputs()}static getStaticData(){return{acceptedBy:"actions",name:"Pause",id:"ActionPause",icon:"Pause",title:"Make a pause between actions"}}getData(){return Hc.getStaticData()}}class Wc extends at{constructor(s){super(s,Wc.getStaticData())}static compile(s){const i=(s.func||"").split(` +`).map(r=>` ${r}`);return i.unshift(` _sendToFrontEnd(${s._id}, {func: 'executed'});`),i.unshift("// user function"),i.join(` +`)}renderDebug(){return x.I18n.t("Function: executed")}onTagChange(s){this.setState({inputs:[{nameRender:"renderModalInput",attr:"func",noTextEdit:!0,defaultValue:'console.log("Test")',nameBlock:"Function"}]},()=>super.onTagChange(s))}static getStaticData(){return{acceptedBy:"actions",name:"User function",id:"ActionFunction",icon:"Functions",title:"Write your own code",helpDialog:"This is advances option. You can write your own code here and it will be executed on trigger"}}getData(){return Wc.getStaticData()}}class Gc extends at{constructor(s){super(s,Gc.getStaticData())}isAllTriggersOnState(){var s,i,r,l;return!!((i=(s=this.props.userRules)==null?void 0:s.triggers)!=null&&i.find(c=>c.id==="TriggerState"))&&!((l=(r=this.props.userRules)==null?void 0:r.triggers)!=null&&l.find(c=>c.id!=="TriggerState"))}static compile(s,i){let r=s.value;s.useTrigger?r=s.toggle?"!obj.state.val":"obj.state.val":(r==null&&(r=""),typeof s.value=="string"&&parseFloat(s.value).toString()!==s.value&&s.value!=="true"&&s.value!=="false"&&(r=`"${r.replace(/"/g,'\\"')}"${at.getReplacesInText(i)}`));let l;return s.toggle&&!s.useTrigger?l=`const subActionVar${s._id} = !(await getStateAsync("${s.oid}")).val`:l=`const subActionVar${s._id} = ${r}`,`// set delayed state ${s.oid} to ${s.toggle&&!s.useTrigger?"toggle":r} with delay of ${s.delay}ms + ${l}; + _sendToFrontEnd(${s._id}, {val: subActionVar${s._id}, ack: ${s.tagCard==="update"}}); + setStateDelayed("${s.oid}", subActionVar${s._id}, ${s.tagCard==="update"}, ${parseInt(s.delay,10)}, ${s.clearRunning?"true":"false"});`}renderDebug(s){var i,r;return m.jsxs("span",{children:[x.I18n.t("Set:")," ",m.jsx("span",{className:s.data.ack?(i=this.props.classes)==null?void 0:i.valueAck:(r=this.props.classes)==null?void 0:r.valueNotAck,children:Ln(s.data.val)})]})}_setInputs(s,i){const r=this.isAllTriggersOnState();i=i===void 0?this.state.settings.toggle:i,s=s===void 0?this.state.settings.useTrigger:s;let l="",c;const{oidType:d,oidUnit:h,oidStates:p,oidMax:f,oidMin:b,oidRole:y,oidWrite:w,oidStep:v}=this.state.settings;let _;d&&(d==="number"?(l="number",f!==void 0&&b!==void 0&&(l="slider")):d==="boolean"?(l="boolean",y&&y.includes("button")&&w&&(l="button")):(l="",y&&y.includes("color")&&(l="color")),p&&(c=Object.keys(p).map(S=>({value:S,title:p[S]})),l="select"));let $;if(r&&s)$=[{backText:"use trigger value",nameRender:"renderCheckbox",attr:"useTrigger",defaultValue:!1}],l==="boolean"&&$.push({backText:"toggle value",attr:"toggle",nameRender:"renderCheckbox",defaultValue:!1});else{switch(l){case"number":$=[{backText:h||"",frontText:"with",nameRender:"renderNumber",defaultValue:f===void 0?0:f,attr:"value"}],this.state.settings.value!==void 0&&isNaN(parseFloat(this.state.settings.value))&&(_={value:f===void 0?0:f});break;case"slider":{$=[{nameRender:"renderSlider",defaultValue:f,min:b,max:f,unit:h,step:v,attr:"value"}];const S=parseFloat(this.state.settings.value);this.state.settings.value!==void 0&&(isNaN(S)||Sf)&&(_={value:f});break}case"select":$=[{nameRender:"renderSelect",frontText:"with",options:c,defaultValue:(c==null?void 0:c[0].value)||"",attr:"value"}],this.state.settings.value!==void 0&&!(c!=null&&c.find(S=>S.value===this.state.settings.value))&&(_={value:(c==null?void 0:c[0].value)||""});break;case"boolean":$=[{backText:"toggle value",attr:"toggle",nameRender:"renderCheckbox",defaultValue:!1}],i||$.push({backText:"true",frontText:"false",nameRender:"renderSwitch",defaultValue:!1,attr:"value"}),this.state.settings.value!==void 0&&this.state.settings.value!==!1&&this.state.settings.value!==!0&&(_={value:!1});break;case"button":$=[{nameRender:"renderButton",defaultValue:!0,attr:"value"}],this.state.settings.value!==void 0&&this.state.settings.value!==!0&&(_={value:!0});break;case"color":$=[{nameRender:"renderColor",frontText:"with",defaultValue:"#FFFFFF",attr:"value"}],this.state.settings.value!==void 0&&(typeof this.state.settings.value!="string"||!this.state.settings.value.startsWith("#")&&!this.state.settings.value.startsWith("rgb"))&&(_={value:"#FFFFFF"});break;default:$=[{backText:h||"",frontText:"with",nameRender:"renderText",defaultValue:"",attr:"value"}];break}r&&$.unshift({backText:"use trigger value",nameRender:"renderCheckbox",attr:"useTrigger"})}return $.push({backText:"ms",frontText:"Delay",nameRender:"renderNumber",defaultValue:1e3,noHelperText:!0,attr:"delay"}),$.push({backText:"clear running",nameRender:"renderCheckbox",defaultValue:!0,attr:"clearRunning"}),{inputs:$,newSettings:_}}onTagChange(s,i,r,l,c){c=c===void 0?this.state.settings.useTrigger:c;const{inputs:d,newSettings:h}=this._setInputs(c,l);d.unshift({nameRender:"renderObjectID",attr:"oid",defaultValue:"",checkReadOnly:!0}),this.setState({inputs:d},()=>super.onTagChange(null,()=>{if(h){const p=JSON.parse(JSON.stringify(this.state.settings));Object.assign(p,h),this.setState(p),this.props.onChange(p)}}))}onValueChanged(s,i){this.onTagChange(void 0,void 0,void 0,i==="toggle"?s:void 0,i==="useTrigger"?s:void 0)}onUpdate(){this.onTagChange()}static getStaticData(){return{acceptedBy:"actions",name:"Set with delay",id:"ActionSetStateDelayed",icon:"PlayForWork",tagCardArray:["control","update"],title:"Control or update some state with delay",helpDialog:"You can use %s in the value to use the current trigger value or %id to display the triggered object ID"}}getData(){return Gc.getStaticData()}}class Vc extends at{constructor(s){super(s,Vc.getStaticData())}isAllTriggersOnState(){var s,i,r,l;return!!((i=(s=this.props.userRules)==null?void 0:s.triggers)!=null&&i.find(c=>c.id==="TriggerState"))&&!((l=(r=this.props.userRules)==null?void 0:r.triggers)!=null&&l.find(c=>c.id!=="TriggerState"))}static compile(s){const i=`const val2_${s._id} = (await getStateAsync("${s.oid1}")).val;`,r=`const val1_${s._id} = (await getStateAsync("${s.oid2}")).val;`;return`// ${s.oid1} ${s.operation} ${s.oid2} => ${s.oidResult} + ${i} + ${r} + _sendToFrontEnd(${s._id}, {val: val1_${s._id} ${s.operation} val2_${s._id}, ack: ${s.tagCard==="update"}}); + await setStateAsync("${s.oidResult}", val1_${s._id} ${s.operation} val2_${s._id}, ${s.tagCard==="update"});`}renderDebug(s){var i,r;return m.jsxs("span",{children:[x.I18n.t("Set:")," ",m.jsx("span",{className:s.data.ack?(i=this.props.classes)==null?void 0:i.valueAck:(r=this.props.classes)==null?void 0:r.valueNotAck,children:Ln(s.data.val)})]})}onTagChange(){const s=[];s.push({nameRender:"renderObjectID",title:"ID1",attr:"oid1",defaultValue:"",checkReadOnly:!1}),s.push({nameRender:"renderSelect",options:[{value:"+",title:"+"},{value:"-",title:"-"},{value:"*",title:"*"},{value:"/",title:"/"}],doNotTranslate:!0,defaultValue:"+",attr:"operation"}),s.push({nameRender:"renderObjectID",title:"ID2",attr:"oid2",defaultValue:"",checkReadOnly:!1}),s.push({nameRender:"renderNameText",defaultValue:"store in",attr:"textEqual"}),s.push({nameRender:"renderObjectID",attr:"oidResult",defaultValue:"",checkReadOnly:!0}),this.setState({inputs:s},()=>super.onTagChange(null,()=>{const i=JSON.parse(JSON.stringify(this.state.settings));this.props.onChange(i)}))}onValueChanged(s,i){this.onTagChange()}onUpdate(){this.onTagChange()}static getStaticData(){return{acceptedBy:"actions",name:"Operate two states",id:"ActionOperateStates",icon:"AddBox",tagCardArray:["control","update"],title:"Operations with two states"}}getData(){return Vc.getStaticData()}}const fR=[Ii,Pc,Bc,qr,Xr,Vo,Fc,jc,zc,Uc,Hc,Wc,Gc,Vc],hc={sayit:Rc,pushover:Nc,"whatsapp-cmb":Mc,pushsafer:Lc},$R=lm({blocks:null,socket:null,onUpdate:!1,setOnUpdate:a=>{},setOnDebugMessage:a=>{},onDebugMessage:[],enableSimulation:!1,setEnableSimulation:a=>{},changedScripts:{},setChangedScripts:a=>{}}),bR=({children:a,socket:s})=>{const[i,r]=kt(null),[l,c]=kt(!1),[d,h]=kt([]),[p,f]=kt(!1),[b,y]=kt({});return Lt(()=>{l&&c(!1)},[l]),Lt(()=>{(async()=>{const w=await s.getAdapterInstances(),v=Object.keys(hc).filter(E=>w.find(D=>{var M;return((M=D==null?void 0:D.common)==null?void 0:M.name)===E})),_=[],$=w.filter(E=>E.common.javascriptRules),S=[];for(const E of $){if(S.includes(E.common.name)||!E.common.javascriptRules)continue;let D;if(E.common.javascriptRules.url.startsWith("http:")||E.common.javascriptRules.url.startsWith("https:")?D=E.common.javascriptRules.url:E.common.javascriptRules.url.startsWith("./")?D=`${window.location.protocol}//${window.location.host}${E.common.javascriptRules.url.replace(/^\./,"")}`:D=`${window.location.protocol}//${window.location.host}/adapter/${E.common.name}/${E.common.javascriptRules.url}`,E.common.javascriptRules.i18n===!0){const M=D.lastIndexOf("/");let P;M!==-1?P=D.substring(0,M):P=D;const W=x.I18n.getLanguage(),G=`${P}/i18n/${W}.json`;await fetch(G).then(z=>z.json()).then(z=>x.I18n.extendTranslations(z,W)).catch(z=>{if(W!=="en")return fetch(`${P}/i18n/en.json`).then(Z=>Z.json()).then(Z=>x.I18n.extendTranslations(Z,W)).catch(Z=>console.error(`Cannot load i18n "${G}": ${Z}`));console.log(`Cannot load i18n "${G}": ${z}`)})}else if(E.common.javascriptRules.i18n&&typeof E.common.javascriptRules.i18n=="object")try{x.I18n.extendTranslations(E.common.javascriptRules.i18n)}catch(M){console.error(`Cannot import i18n for "${E.common.javascriptRules.name}": ${M}`)}try{Zy.registerRemotes([{name:E.common.javascriptRules.name,entry:D,type:E.common.javascriptRules.type}]);const M=(await Zy.loadRemote(`${E.common.javascriptRules.name}/${E.common.javascriptRules.name}`)).default;M&&(_.push(M),S.push(E.common.name),hc[E.common.name]=null)}catch(M){console.error(`Cannot load component "${E.common.javascriptRules.name}": ${M}`)}}const T=v.filter(E=>hc[E]).map(E=>hc[E]);r([...fR,...T,..._])})()},[]),m.jsx($R.Provider,{value:{blocks:i,socket:s,onUpdate:l,setOnUpdate:c,onDebugMessage:d,setOnDebugMessage:h,enableSimulation:p,setEnableSimulation:f,changedScripts:b,setChangedScripts:y},children:a})},vR="Acknowledged",yR="Actions",_R="Add",wR="All",kR="Any",CR="Apply",TR="April",SR="Ask",ER="Astronomical",IR="August",xR="Cancel",DR="Close",AR="Condition",OR="Conditions",RR="Console",NR="Copied",MR="December",LR="Default",PR="Delay",BR="Delete",FR="Description",jR="Done",zR="Exec shell",UR="Explanation",HR="Export",WR="Februar",GR="February",VR="Filter",KR="Folder",YR="Fr",JR="Friday",qR="ID",XR="ID1",ZR="ID2",QR="Import",e1="Instance",t1="Instances",s1="Instructions",o1="Januar",i1="January",n1="July",r1="June",a1="Limit",l1="March",c1="May",u1="Menu",d1="Message",h1="Mo",p1="Model",g1="Monday",m1="Month",f1="More",$1="Name",b1="November",v1="OK",y1="October",_1="Ok",w1="Pause",k1="Pushover",C1="Pushsafer",T1="Rename",S1="Repeat",E1="Restart",I1="Result",x1="Sa",D1="Saturday",A1="Save",O1="Schedule",R1="Script",N1="September",M1="Simulate",L1="Stack",P1="Start",B1="State",F1="Su",j1="Sunday",z1="Telegram",U1="Th",H1="Thursday",W1="Time",G1="Triggered",V1="Triggers",K1="Tu",Y1="Tuesday",J1="URL",q1="Value",X1="Volume",Z1="We",Q1="Wednesday",eN="Write",tN="Yes",sN="acknowledgment",oN="all",iN="and",nN="Astro",rN="at",aN="control",lN="copy",cN="CRON",uN="Dawn",dN="This is a special mode in which states and objects will not change. But only information about each planned change will be displayed in the protocol.",hN="Debug",pN="Dusk",gN="easy",mN="every",fN="Function",$N="ID",bN="Name",vN="Role",yN="Room",_N="Golden hour",wN="End of golden hour",kN='The code will be executed only every time when condition is true. E.g. if triggering on the temperature sensor value and the condition is "if temperature is greater than 20°C", the "then" actions will be executed every time when sensor sends the temperature and it is over 20°C. By 21°C, by 22°C and so on.',CN='The code will be executed only if the condition result changes. E.g. if triggering on the temperature sensor value and the condition is "if temperature is greater than 20°C", the "then" actions will be executed once when temperature is over 20. Next time the "then" actions will be executed when the temperature fails under 20 and then rises over 20 again.',TN="hours",SN="includes",EN="interval",IN="magic",xN="milliseconds",DN="minutes",AN="ms",ON="Nadir",RN="Nautical dawn",NN="Nautical dusk",MN="Next Sunrise",LN="Next sunset",PN="Night",BN="Night end",FN="normal",jN="offset",zN="one",UN="or",HN="quiet",WN="search",GN="seconds",VN="Solar noon",KN="sunrise",YN="Sunrise end",JN="Sunset",qN="Sunset start",XN="then",ZN="Acknowledge",QN="From",eM="Last changed",tM="Quality",sM="Timestamp",oM="User",iM="Value",nM="two",rM="update",aM="Adds debug output to the log for many system commands",lM="Verbose log outputs",cM="when",uM="Wizard",dM="Retry",hM={"%s not found":"%s not found","()":"()","(at %s)":"(at %s)","(optional)":"(optional)","-":"-",".":".","AI code generator":"AI code generator",Ack:vR,Actions:yR,"Actual time of day":"Actual time of day",Add:_R,"Add new script":"Add new script",All:wR,"All files will be accepted":"All files will be accepted",Any:kR,"Any month":"Any month",Apply:CR,April:TR,"Are you sure?":"Are you sure?",Ask:SR,Astronomical:ER,"Astronomical events today":"Astronomical events today",August:IR,"Blockly description":"Creating rules by graphic blocks","Body:":"Body:",Cancel:xR,"Cannot delete non empty item!":"Cannot delete non empty item!","Change layout":"Change layout",'Change theme (actual "%s")':'Change theme (now - "%s")',"Check blocks":"Check blocks","Check is not active, because javascript adapter is disabled":"Check is not active, because Javascript adapter is disabled","Clear search input":"Clear search input","Click on this icon":"Click on this icon",Close:DR,"Close all but current":"Close all but current","Collapse all":"Collapse all","Compares current time with astronomical event":"Compares current time with astronomical event","Compares current time with the user specific time":"Compares current time with the user specific time","Compares the state value with user defined value":"Compares the state value with user defined value",Condition:AR,Conditions:OR,"Configuration not saved.":"Configuration not saved.",Console:RR,"Control or update some state":"Control or update some state","Control or update some state with delay":"Control or update some state with delay","Convert blockly to javascript for ever.":"Permanently convert Blockly to Javascript.",Copied:NR,"Copy script":"Copy script","Copy to clipboard":"Copy to clipboard","Create new":"Create new","Create new folder":"Create new folder","Create new script":"Create new script","Create or edit CRON or time wizard":"Create or edit CRON or time wizard","Dark Theme":"Dark theme","Dark style":"Dark style",Date:"Date","Debug instance":"Debug instance","Debug options":"Debug options",December:MR,Default:LR,"Define cron...":"Define cron...","Define schedule...":"Define schedule...",Delay:PR,Delete:BR,"Delete %s":"Delete %s...","Delete folder":"Delete folder","Delete script":"Delete script",Description:FR,"Deselect all":"Deselect all","Discard changes for %s":"Discard changes for %s",Done:jR,"Double click to write value":"Double click to write value","Download as file":"Download as file","Drop some files here or click...":"Drop some files here or click...","Duplicate name":"Duplicate name","Edit script or just double click":"Edit script or just double click","Empty name is not allowed":"Empty name is not allowed","End search mode":"End search mode","Enter your question":"Enter your request",Error:"Error","Error formatting code":"Error formatting code","Error was found":"Error was found","Every day":"Every day",Exec:zR,"Executes some shell command":"Executes some shell command","Existing scripts will be overwritten.":"Existing scripts will be overwritten.","Expand all":"Expand all","Expert mode":"Expert mode",Explanation:UR,Export:HR,"Export all scripts":"Export all scripts","Export blocks":"Export blocks","Export selected blocks":"Export selected blocks",Februar:WR,February:GR,Filter:VR,Folder:KR,Fr:YR,Friday:JR,Function:"Function","Function editor":"Function editor","Function: executed":"Function: executed","Go to next line":"Go to next line","HTTP Call":"HTTP Call","Hide logs":"Hide logs",ID:qR,ID1:XR,ID2:ZR,Import:QR,"Import blocks":"Import blocks","Import error":"Import error","Import scripts":"Import scripts","Insert object ID":"Insert object ID",Instance:e1,"Instance is disabled":"Instance is disabled","Instance:":"Instance:",Instances:t1,Instructions:s1,"Invalid CRON":"Invalid CRON","It will not be possible to revert this operation.":"It will not be possible to revert this operation.","JS description":"Creating rules by writing Javascript",Januar:o1,January:i1,July:n1,June:r1,"Just check":"Just check","Language:":"Language:","Learn More":"Learn More","Light style":"Light style",Limit:a1,"Local time":"Local time","Locate file":"Locate file","Log outputs":"Log outputs","Log text":"Log text","Log: %s":"Log: %s","Make a HTTP get request":"Make a HTTP get request","Make a pause between actions":"Make a pause between actions",March:l1,"March ":"March ",May:c1,Menu:u1,Message:d1,Mo:h1,Model:p1,Monday:g1,Month:m1,More:f1,Name:$1,"No API key found":"No API key found","No Chat GPT Key found":"No Chat GPT Key found","No active host found":"No active host found","Nothing found":"Nothing found",November:b1,OK:v1,October:y1,Ok:_1,"On condition change":"On condition result change","On script save or adapter start":"On script save or adapter start","On weekdays":"On weekdays","Open configuration":"Open configuration","Operate two states":"Operate two states","Operations with two states":"Operations with two states","Paste your blocks here":"Paste your blocks here",Pause:w1,"Pause execution":"Pause execution","Pause script":"Pause script","Phone:":"Phone:","Please select object ID...":"Please select object ID...","Press Ctrl+Enter to get the answer":"Press Ctrl+Enter to get the answer","Prettify the script":"Prettify the script","Print some text in log":"Print some text in log","Priority:":"Priority:",Pushover:k1,Pushsafer:C1,"Read only ID selected: %s":"Read only ID selected: %s",Rename:T1,"Reorder scripts in folders":"Reorder scripts in folders",Repeat:S1,Restart:E1,Result:I1,"Resume execution":"Resume execution","Root folder":"Root folder","Rules description":"Create rules with IF, THEN, ELSE blocks","Run script":"Run script",Sa:x1,Saturday:D1,Save:A1,"Save all":"Save all","Say It":"Say It","Say some text via sayit adapter":"Say some text via sayit adapter",Schedule:O1,Script:R1,"Script %s was modified on disk":"Script %s was modified on disk","Script is not running":"Script is not running","Search in scripts":"Search in scripts","Search...":"Search...","Select all":"Select all","Send email":"Send email","Sends an email":"Sends an email","Sends message via Pushsafer":"Sends message via Pushsafer","Sends message via pushover":"Sends message via pushover","Sends message via telegram":"Sends message via telegram","Sends message via whatsapp-cmb":"Sends message via whatsapp-cmb",September:N1,"Server time":"Server time","Set state action":"Set state action","Set with delay":"Set with delay","Shell command":"Shell command","Show astronomical events":"Show astronomical events","Show javascript code":"Show Javascript code","Show logs":"Show logs","Show only paused scripts":"Show only paused scripts","Show only running scripts":"Show only running scripts","Show only scripts with problems":"Show only scripts with problems",Simulate:M1,"Some files will be rejected":"Some files will be rejected","Sound:":"Sound:",Stack:L1,Start:P1,"Start script":"Start script",State:B1,"State condition":"State condition","Step into function":"Step into function","Step out from function":"Step out from function","Stop on exception":"Stop on exception",Su:F1,"Subject:":"Subject:",Sunday:j1,"TS description":"Creating rules by writing Typescript",Telegram:z1,"Text:":"Text:",Th:U1,"The script will be stopped and must be activated manually after debugging. Continue?":"The script will be stopped and must be activated manually after debugging. Continue?","This is advances option. You can write your own code here and it will be executed on trigger":"This is advances option. You can write your own code here and it will be executed on trigger",Thursday:H1,Time:W1,"Time condition":"Time condition","Title:":"Title:","To:":"To:","Trigger with value":"Trigger with value",Triggered:G1,Triggers:V1,"Triggers the on script saving or the javascript instance restart":"Triggers the on script saving or the javascript instance restart","Triggers the rule on update or change of some state":"Triggers the rule on update or change of some state","Triggers the rule periodically or on some specific time":"Triggers the rule periodically or on some specific time",Tu:K1,Tuesday:Y1,URL:J1,"Unknown error":"Unknown error","Unknown error!":"Unknown error!","Use generated code":"Use generated code","User function":"User function","User:":"User:",Value:q1,"Vibration:":"Vibration:",Volume:X1,We:Z1,Wednesday:Q1,"Whatsapp-cmb":"Whatsapp-cmb",Write:eN,"Write your own code":"Write your own code",Yes:tN,"Yet exists!":"Yet exists!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"You can use %s in the URL to use current trigger value, %id to use the triggered object ID, %name to show triggered object ID name or %old to use old trigger value","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"You can use %s in the command to use current trigger value, %id to use the triggered object ID, %name to show triggered object ID name or %old to use old trigger value","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"You can use %s in the text to display current trigger value, %id to use the triggered object ID, %name to show triggered object ID name or %old to use old trigger value","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"You can use %s in the value to use the current trigger value, %id to use the triggered object ID, %name to show triggered object ID name or %old to use old trigger value","You have to enter OpenAI API key in the configuration of javascript adapter.":"You have to enter OpenAI API key in the configuration of javascript adapter.","You have to enter at least one API key in the configuration of javascript adapter.":"You have to enter at least one API key (OpenAI, Anthropic or Gemini) in the configuration of javascript adapter.","Please select a valid model":"Please select a valid model","[equal]":"[equal]","[greater or equal]":"[greater or equal]","[greater]":"[greater]","[hysteresis]":"[hysteresis]","[includes]":"[includes]","[less or equal]":"[less or equal]","[less]":"[less]","[not equal]":"[not equal]",acknowledgment:sN,all:oN,and:iN,"as JSON":"as JSON","as plain text":"as plain text",astro:nN,at:rN,"clear running":"clear running",control:aN,copy:lN,cron:cN,dawn:uN,debug_help:dN,debug_label:hN,default:"default",dusk:pN,easy:gN,else:"else","equal to":"equal to",every:mN,"every hour at 0 minutes":"every hour at 0 minutes",false:"false","file reading has failed: %s":"file reading has failed: %s","file reading was aborted":"file reading was aborted",filter_func:fN,filter_id:$N,filter_name:bN,filter_role:vN,filter_room:yN,"for edit or create script":"for edit or create a new script","for professionals":"for professionals","for programmers":"for programmers",goldenHour:_N,goldenHourEnd:wN,"greater or equal":"greater or equal","greater or equal to":"greater or equal to","greater than":"greater than",help_just_check:kN,help_on_change:CN,"high priority":"high priority","high-priority":"high-priority","highest priority":"highest priority",hours:TN,includes:SN,interval:EN,"just check":"just check","less or equal":"less or equal","less or equal to":"less or equal to","less than":"less than","lower priority":"lower priority","lowest priority":"lowest priority",magic:IN,milliseconds:xN,minutes:DN,ms:AN,nadir:ON,nauticalDawn:RN,nauticalDusk:NN,nextSunrise:MN,nextSunset:LN,night:PN,nightEnd:BN,"no blocks found":"No blocks found","no group":"NO GROUP",normal:FN,"normal priority":"normal priority","not equal to":"not equal to","not properly connected":"This block is not properly connected to other blocks.",offset:jN,"on change":"on change","on condition change":"on condition change","on update":"on update",one:zN,or:UN,quiet:HN,"reset search":"reset search",search:WN,seconds:GN,solarNoon:VN,"store in":"store in",sunrise:KN,sunriseEnd:YN,sunset:JN,sunsetStart:qN,then:XN,"toggle value":"toggle value",tooltip_ack:ZN,tooltip_from:QN,tooltip_lc:eM,tooltip_quality:tM,tooltip_ts:sM,tooltip_user:oM,tooltip_value:iM,true:"true",two:nM,undefined:"undefined",update:rM,"use seconds":"use seconds","use trigger value":"use trigger value",verbose_help:aM,verbose_label:lM,when:cM,with:"with","with date":"with date","with offset":"with offset",wizard:uM,"Loading models...":"Loading models...","Could not connect to API at %s":"Could not connect to API at %s","Invalid API key":"Invalid API key","Access denied by API":"Access denied by API","API error: %s":"API error: %s",'Model "%s" not found':'Model "%s" not found',"Request failed: %s":"Request failed: %s",Retry:dM,"No running javascript instance found":"No running javascript instance found"},pM="Bestätigt",gM="Aktionen",mM="Hinzufügen",fM="Alle",$M="Egal",bM="Anwenden",vM="April",yM="Fragen",_M="Astronomisch",wM="August",kM="Abbrechen",CM="Schließen",TM="Bedingung",SM="Bedingungen",EM="Konsole",IM="Kopiert",xM="Dezember",DM="Standard",AM="Verzögerung",OM="Löschen",RM="Beschreibung",NM="Fertig",MM="Exec shell",LM="Erläuterung",PM="Export",BM="Februar",FM="Februar",jM="Filter",zM="Ordner",UM="Fr",HM="Freitag",WM="ID",GM="ID1",VM="ID2",KM="Import",YM="Instanz",JM="Instanzen",qM="Anleitung",XM="Januar",ZM="Januar",QM="Juli",eL="Juni",tL="Grenze",sL="März",oL="Mai",iL="Menü",nL="Nachricht",rL="Mo",aL="Modell",lL="Montag",cL="Monat",uL="Mehr",dL="Name",hL="November",pL="OK",gL="Oktober",mL="Ok",fL="Pause",$L="Pushover",bL="Pushsafer",vL="Umbenennen",yL="Wiederholen",_L="Neustart",wL="Ergebnis",kL="Sa",CL="Samstag",TL="Speichern",SL="Zeitplan",EL="Skript",IL="September",xL="Simulieren",DL="Stack",AL="Start",OL="Zustand",RL="So",NL="Sonntag",ML="Telegram",LL="Do",PL="Donnerstag",BL="Zeit",FL="Ausgelöst",jL="Löst aus",zL="Di",UL="Dienstag",HL="URL",WL="Wert",GL="Volumen",VL="Mi",KL="Mittwoch",YL="Schreiben",JL="Ja",qL="Wissen",XL="alle",ZL="und",QL="Astro",eP="um",tP="Steuerung",sP="Kopie",oP="CRON",iP="Morgendämmerung",nP="Dies ist ein spezieller Modus, in dem sich Zustände und Objekte nicht ändern. Im Protokoll werden jedoch nur Informationen zu jeder geplanten Änderung angezeigt.",rP="Debuggen",aP="Abenddämmerung",lP="einfach",cP="jeder",uP="Funktion",dP="ID",hP="Name",pP="Rolle",gP="Raum",mP="Goldene Abendstunde",fP="Vormittag",$P='Der Code wird jedes Mal ausgeführt, wenn die Bedingung erfüllt ist. z.B. wenn der Temperatur wert sich ändert und die Bedingung "Wenn die Temperatur größer als 20°C ist" lautet, werden die "Dann" -Aktionen jedes Mal ausgeführt, wenn der Sensor die Temperatur sendet und diese über 20°C liegt. Bei 21°C, bei 22°C und so weiter.',bP='Der Code wird nur ausgeführt, wenn sich das Ergebnis der Bedingung ändert. z.B. wenn sich der Temperatur wert ändert und die Bedingung "Wenn die Temperatur größer als 20°C ist" lautet, werden die "Dann" -Aktionen einmal ausgeführt, wenn die Temperatur über 20°C liegt. Das nächste Mal werden die "Dann" -Aktionen ausgeführt, wenn die Temperatur unter 20°C gefallen ist und dann wieder über 20°C ansteigt.',vP="Stunden",yP="beinhaltet",_P="Intervall",wP="Magie",kP="Millisekunden",CP="Minuten",TP="ms",SP="Nadir",EP="nautische Morgendämmerung",IP="nautische Abenddämmerung",xP="Nächster Sonnenaufgang",DP="Nächster Sonnenuntergang",AP="Nacht",OP="astronomische Morgendämmerung",RP="Normal",NP="Versatz",MP="einer",LP="oder",PP="ruhig",BP="Suche",FP="Sekunden",jP="(Nach-)Mittag",zP="Sonnenaufgang",UP="Goldene Morgenstunde",HP="Sonnenuntergang",WP="Sonnenuntergang (Anfang)",GP="dann",VP="Bestätigen",KP="Von",YP="Zuletzt geändert",JP="Qualität",qP="Zeitstempel",XP="Benutzer",ZP="Wert",QP="zwei",eB="Aktualisieren",tB="Fügt Debug-Ausgaben für viele Systembefehle zum Protokoll hinzu",sB="Ausführliche Protokollausgaben",oB="falls",iB="Assistent",nB="Erneut versuchen",rB={"%s not found":"%s nicht gefunden","()":"()","(at %s)":"(um %s)","(optional)":"(optional)","-":"-",".":".","AI code generator":"KI-Codegenerator",Ack:pM,Actions:gM,"Actual time of day":"Tatsächliche Tageszeit",Add:mM,"Add new script":"Neues Skript hinzufügen",All:fM,"All files will be accepted":"Alle Dateien werden akzeptiert",Any:$M,"Any month":"Jeden Monat",Apply:bM,April:vM,"Are you sure?":"Wirklich sicher?",Ask:yM,Astronomical:_M,"Astronomical events today":"Astronomische Ereignisse heute",August:wM,"Blockly description":"Erstellen von Regeln durch Grafikblöcke","Body:":"Körper:",Cancel:kM,"Cannot delete non empty item!":"Kann nicht gelöscht werden, weil noch einige Elementen darin sind!","Change layout":"Layout ändern",'Change theme (actual "%s")':'Thema ändern (jetzt - "%s")',"Check blocks":"Blöcke prüfen","Check is not active, because javascript adapter is disabled":"Syntax-Check ist nicht aktiv, weil der Javascript Adapter nicht aktiv ist.","Clear search input":"Sucheingabe löschen","Click on this icon":"Auf dieses Symbol klicken",Close:CM,"Close all but current":"Alle anderen außer dem Aktiven schließen","Collapse all":"Alles einklappen","Compares current time with astronomical event":"Vergleicht die aktuelle Zeit mit einem astronomischen Ereignis","Compares current time with the user specific time":"Vergleicht die aktuelle Zeit mit der benutzerspezifischen Zeit","Compares the state value with user defined value":"Vergleicht den Zustandswert mit dem benutzerdefinierten Wert",Condition:TM,Conditions:SM,"Configuration not saved.":"Die Konfiguration ist nicht gespeichert.",Console:EM,"Control or update some state":"Zustand steuern oder aktualisieren","Control or update some state with delay":"Zustand mit Verzögerung steuern oder aktualisieren","Convert blockly to javascript for ever.":"Blockly dauerhaft in Javascript konvertieren.",Copied:IM,"Copy script":"Skript kopieren","Copy to clipboard":"In die Zwischenablage kopieren","Create new":"Neu erstellen","Create new folder":"Neuen Ordner erstellen","Create new script":"Neues Skript erstellen","Create or edit CRON or time wizard":"CRON- oder Zeit-Assistenten erstellen oder bearbeiten","Dark Theme":"Dunkles Thema","Dark style":"Dunkler Stil",Date:"Datum","Debug instance":"Debug-Instanz","Debug options":"Debug-Optionen",December:xM,Default:DM,"Define cron...":"Cron definieren ...","Define schedule...":"Zeitplan definieren ...",Delay:AM,Delete:OM,"Delete %s":"Löschen %s...","Delete folder":"Ordner löschen","Delete script":"Skript löschen",Description:RM,"Deselect all":"Alles abwählen","Discard changes for %s":"Änderungen für %s verwerfen",Done:NM,"Double click to write value":"Doppelklick zum Schreiben des Wertes","Download as file":"Download als Datei","Drop some files here or click...":"Dateien hier ablegen oder klicken ...","Duplicate name":"Doppelter Name","Edit script or just double click":"Skript bearbeiten oder einfach doppelklicken","Empty name is not allowed":"Leerer Name ist nicht zulässig","End search mode":"Suchmodus beenden","Enter your question":"Anfrage eingeben",Error:"Fehler","Error formatting code":"Fehler beim Formatieren des Codes","Error was found":"Fehler wurde gefunden","Every day":"Täglich",Exec:MM,"Executes some shell command":"Führt einen Shell-Befehl aus","Existing scripts will be overwritten.":"Vorhandene Skripte werden überschrieben.","Expand all":"Alle erweitern","Expert mode":"Expertenmodus",Explanation:LM,Export:PM,"Export all scripts":"Alle Skripte exportieren","Export blocks":"Blöcke exportieren","Export selected blocks":"Ausgewählte Blöcke exportieren",Februar:BM,February:FM,Filter:jM,Folder:zM,Fr:UM,Friday:HM,Function:"Funktion","Function editor":"Funktions-Editor","Function: executed":"Funktion: ausgeführt","Go to next line":"Gehe zur nächsten Zeile","HTTP Call":"HTTP-Aufruf","Hide logs":"Protokoll ausblenden",ID:WM,ID1:GM,ID2:VM,Import:KM,"Import blocks":"Blöcke importieren","Import error":"Fehler beim Importieren","Import scripts":"Skripte importieren","Insert object ID":"Objekt-ID einfügen",Instance:YM,"Instance is disabled":"Instanz ist deaktiviert","Instance:":"Instanz:",Instances:JM,Instructions:qM,"Invalid CRON":"Ungültiger CRON","It will not be possible to revert this operation.":"Dieser Vorgang kann nicht rückgängig gemacht werden.","JS description":"Regeln erstellen mit JavaScript",Januar:XM,January:ZM,July:QM,June:eL,"Just check":"Einfach überprüfen","Language:":"Sprache:","Learn More":"Mehr erfahren","Light style":"Heller Stil",Limit:tL,"Local time":"Lokale Zeit","Locate file":"Datei zeigen","Log outputs":"Protokoll","Log text":"Protokolltext","Log: %s":"Log: %s","Make a HTTP get request":"Eine HTTP-Abrufanforderung stellen","Make a pause between actions":"Eine Pause zwischen den Aktionen machen",March:sL,"March ":"März ",May:oL,Menu:iL,Message:nL,Mo:rL,Model:aL,Monday:lL,Month:cL,More:uL,Name:dL,"No API key found":"Kein API-Schlüssel gefunden","No Chat GPT Key found":"Kein Chat-GPT-Schlüssel gefunden","No active host found":"Kein aktiver Host gefunden","Nothing found":"Nichts gefunden",November:hL,OK:pL,October:gL,Ok:mL,"On condition change":"Bei Änderung des Ergebnis der Bedingung","On script save or adapter start":"Beim Speichern des Skripts oder beim Starten des Adapters","On weekdays":"An Wochentagen","Open configuration":"Konfiguration öffnen","Operate two states":"Zwei Zustände operieren","Operations with two states":"Operationen mit zwei Zuständen","Paste your blocks here":"Fügen Sie Ihre Blöcke hier ein",Pause:fL,"Pause execution":"Ausführung pausieren","Pause script":"Skript anhalten","Phone:":"Telefon:","Please select object ID...":"Objekt-ID auswählen ...","Press Ctrl+Enter to get the answer":"Strg+Eingabetaste, um die Antwort zu erhalten","Prettify the script":"Verschönern Sie das Skript","Print some text in log":"Einen Text im Protokoll ausdrucken","Priority:":"Priorität:",Pushover:$L,Pushsafer:bL,"Read only ID selected: %s":"Schreibgeschützte ID ausgewählt: %s",Rename:vL,"Reorder scripts in folders":"Skripte in Ordnern neu ordnen",Repeat:yL,Restart:_L,Result:wL,"Resume execution":"Ausführung fortsetzen","Root folder":"Root-Verzeichnis","Rules description":"Regeln erstellen mit WENN-, DANN- und SONST-Blöcken","Run script":"Skript ausführen",Sa:kL,Saturday:CL,Save:TL,"Save all":"Alle speichern","Say It":"Say It","Say some text via sayit adapter":"Einen Text über den Sayit-Adapter sagen",Schedule:SL,Script:EL,"Script %s was modified on disk":'Skript "%s" wurde auf der Festplatte geändert',"Script is not running":"Skript läuft nicht","Search in scripts":"Suche in Skripten","Search...":"Suche...","Select all":"Alles auswählen","Send email":"E-Mail senden","Sends an email":"Sendet eine E-Mail","Sends message via Pushsafer":"Sendet eine Nachricht über Pushsafer","Sends message via pushover":"Sendet eine Nachricht per Pushover","Sends message via telegram":"Sendet eine Nachricht per telegram","Sends message via whatsapp-cmb":"Sendet eine Nachricht über WhatsApp-Cmb",September:IL,"Server time":"Server-Zeit","Set state action":"Zustand setzten","Set with delay":"Setzen mit Verzögerung","Shell command":"Shell-Befehl","Show astronomical events":"Astronomische Ereignisse anzeigen","Show javascript code":"Javascript-Code zeigen","Show logs":"Protokoll anzeigen","Show only paused scripts":"Nur angehaltene Skripte zeigen","Show only running scripts":"Nur laufende Skripte zeigen","Show only scripts with problems":"Nur Skripte mit Problemen zeigen",Simulate:xL,"Some files will be rejected":"Einige Dateien werden abgelehnt","Sound:":"Klang:",Stack:DL,Start:AL,"Start script":"Skript starten",State:OL,"State condition":"Zustandsbedingung","Step into function":"Schritt in die Funktion","Step out from function":"Raus aus der Funktion","Stop on exception":"Bei Ausnahme anhalten",Su:RL,"Subject:":"Gegenstand:",Sunday:NL,"TS description":"Regeln erstellen mit TypeScript",Telegram:ML,"Text:":"Text:",Th:LL,"The script will be stopped and must be activated manually after debugging. Continue?":"Das Skript wird gestoppt und muss nach dem Debuggen manuell aktiviert werden. Fortsetzen?","This is advances option. You can write your own code here and it will be executed on trigger":"Dies ist eine erweiterte Option. Sie können hier Ihren eigenen Code schreiben, der beim Auslösen ausgeführt wird",Thursday:PL,Time:BL,"Time condition":"Zeitbedingung","Title:":"Titel:","To:":"Zu:","Trigger with value":"Trigger mit Wert",Triggered:FL,Triggers:jL,"Triggers the on script saving or the javascript instance restart":"Löst das Speichern des Skripts oder den Neustart der Javascript-Instanz aus","Triggers the rule on update or change of some state":"Löst die Regel beim Aktualisieren oder Ändern eines Zustands aus","Triggers the rule periodically or on some specific time":"Löst periodisch oder zu einem bestimmten Zeitpunkt aus",Tu:zL,Tuesday:UL,URL:HL,"Unknown error":"Unbekannter Fehler","Unknown error!":"Unbekannter Fehler!","Use generated code":"Code verwenden","User function":"Benutzerfunktion","User:":"Benutzer:",Value:WL,"Vibration:":"Vibration:",Volume:GL,We:VL,Wednesday:KL,"Whatsapp-cmb":"WhatsApp-cmb",Write:YL,"Write your own code":"Eigenen Code schreiben",Yes:JL,"Yet exists!":"Existiert schon!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Sie können %s in der URL verwenden, um den aktuellen Triggerwert zu verwenden, %id, um die ausgelöste Objekt-ID zu verwenden, %name, um den ID-Namen des ausgelösten Objekts anzuzeigen, oder %old, um den alten Triggerwert zu verwenden","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Sie können %s im Befehl verwenden, um den aktuellen Triggerwert zu verwenden, %id, um die ausgelöste Objekt-ID zu verwenden, %name, um den ID-Namen des ausgelösten Objekts anzuzeigen, oder %old, um den alten Triggerwert zu verwenden","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Sie können %s im Text verwenden, um den aktuellen Triggerwert anzuzeigen, %id, um die ausgelöste Objekt-ID zu verwenden, %name, um den ID-Namen des ausgelösten Objekts anzuzeigen, oder %old, um den alten Triggerwert zu verwenden","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Sie können %s im Wert verwenden, um den aktuellen Triggerwert zu verwenden, %id, um die ID des ausgelösten Objekts zu verwenden, %name, um den ID-Namen des ausgelösten Objekts anzuzeigen, oder %old, um den alten Triggerwert zu verwenden","You have to enter OpenAI API key in the configuration of javascript adapter.":"Sie müssen den OpenAI-API-Schlüssel in der Konfiguration des Javascript-Adapters eingeben.","You have to enter at least one API key in the configuration of javascript adapter.":"Sie müssen mindestens einen API-Schlüssel (OpenAI, Anthropic oder Gemini) in der Konfiguration des Javascript-Adapters eingeben.","Please select a valid model":"Bitte wählen Sie ein gültiges Modell aus","[equal]":"[gleich]","[greater or equal]":"[größer oder gleich]","[greater]":"[größer]","[hysteresis]":"[Hysterese]","[includes]":"[enthält]","[less or equal]":"[kleiner oder gleich]","[less]":"[kleiner]","[not equal]":"[ungleich]",acknowledgment:qL,all:XL,and:ZL,"as JSON":"als JSON","as plain text":"als Klartext",astro:QL,at:eP,"clear running":"laufende abbrechen",control:tP,copy:sP,cron:oP,dawn:iP,debug_help:nP,debug_label:rP,default:"Standard",dusk:aP,easy:lP,else:"sonst","equal to":"gleich",every:cP,"every hour at 0 minutes":"jede Stunde bei 0 Minuten",false:"falsch","file reading has failed: %s":"Das Lesen der Datei ist fehlgeschlagen: %s","file reading was aborted":"Das Lesen der Datei wurde abgebrochen",filter_func:uP,filter_id:dP,filter_name:hP,filter_role:pP,filter_room:gP,"for edit or create script":"zum Bearbeiten oder zum Erstellen eines neues Skripts","for professionals":"für Profis","for programmers":"für Programmierer",goldenHour:mP,goldenHourEnd:fP,"greater or equal":"größer oder gleich","greater or equal to":"größer oder gleich","greater than":"größer als",help_just_check:$P,help_on_change:bP,"high priority":"hohe Priorität","high-priority":"hohe Priorität","highest priority":"höchste Priorität",hours:vP,includes:yP,interval:_P,"just check":"einfach prüfen","less or equal":"kleiner oder gleich","less or equal to":"kleiner oder gleich","less than":"kleiner als","lower priority":"geringere Priorität","lowest priority":"niedrigste Priorität",magic:wP,milliseconds:kP,minutes:CP,ms:TP,nadir:SP,nauticalDawn:EP,nauticalDusk:IP,nextSunrise:xP,nextSunset:DP,night:AP,nightEnd:OP,"no blocks found":"Keine Blöcke gefunden","no group":"KEINE GRUPPE",normal:RP,"normal priority":"normale Priorität","not equal to":"ungleich","not properly connected":"Dieser Block ist mit anderen nicht richtig verbunden.",offset:NP,"on change":"bei Änderung","on condition change":"bei Zustandsänderung","on update":"beim Aktualisieren",one:MP,or:LP,quiet:PP,"reset search":"Suche zurücksetzen",search:BP,seconds:FP,solarNoon:jP,"store in":"speichern in",sunrise:zP,sunriseEnd:UP,sunset:HP,sunsetStart:WP,then:GP,"toggle value":"Wert umschalten",tooltip_ack:VP,tooltip_from:KP,tooltip_lc:YP,tooltip_quality:JP,tooltip_ts:qP,tooltip_user:XP,tooltip_value:ZP,true:"wahr",two:QP,undefined:"nicht definiert",update:eB,"use seconds":"Sekunden verwenden","use trigger value":"Triggerwert benutzen",verbose_help:tB,verbose_label:sB,when:oB,with:"mit","with date":"mit Datum","with offset":"mit Versatz",wizard:iB,"Loading models...":"Modelle werden geladen...","Could not connect to API at %s":"Verbindung zur API unter %s nicht möglich","Invalid API key":"Ungültiger API-Schlüssel","Access denied by API":"Zugriff von der API verweigert","API error: %s":"API-Fehler: %s",'Model "%s" not found':'Modell "%s" nicht gefunden',"Request failed: %s":"Anfrage fehlgeschlagen: %s",Retry:nB,"No running javascript instance found":"Keine laufende JavaScript-Instanz gefunden"},aB="Admitido",lB="Comportamiento",cB="Añadir",uB="Todos",dB="Alguna",hB="Apply",pB="abril",gB="Preguntar",mB="Astronómico",fB="agosto",$B="Cancelar",bB="Cerrar",vB="Condición",yB="Condiciones",_B="Consola",wB="Copiado",kB="diciembre",CB="Defecto",TB="Demora",SB="Eliminar",EB="Descripción",IB="Hecho",xB="Ejecutivo shell",DB="Explicación",AB="Exportar",OB="Februar",RB="febrero",NB="Filtrar",MB="Carpeta",LB="P.",PB="viernes",BB="CARNÉ DE IDENTIDAD",FB="ID1",jB="ID2",zB="Importar",UB="Ejemplo",HB="Instancias",WB="Instrucciones",GB="Enero",VB="enero",KB="julio",YB="junio",JB="Límite",qB="marzo",XB="Mayo",ZB="Menú",QB="Mensaje",e2="Mes",t2="Modelo",s2="lunes",o2="Mes",i2="Más",n2="Nombre",r2="noviembre",a2="OK",l2="octubre",c2="Okay",u2="Pausa",d2="Persona fácil de convencer",h2="Pushsafer",p2="Rebautizar",g2="Repetir",m2="Reiniciar",f2="Resultado",$2="Sa",b2="sábado",v2="Salvar",y2="Calendario",_2="Guión",w2="septiembre",k2="Simular",C2="Stack",T2="Comienzo",S2="Expresar",E2="Su",I2="domingo",x2="Telegrama",D2="4",A2="jueves",O2="Tiempo",R2="Motivado",N2="Disparadores",M2="Tu",L2="martes",P2="URL",B2="Valor",F2="Volumen",j2="3",z2="miércoles",U2="Escribir",H2="sí",W2="Reconocimiento",G2="todos",V2="y",K2="astro",Y2="a",J2="control",q2="Copiar",X2="CRON",Z2="Amanecer",Q2="Este es un modo especial en el que los estados y los objetos no cambiarán. Pero solo se mostrará información sobre cada cambio planificado en el protocolo.",eF="Depurar",tF="Oscuridad",sF="fácil",oF="cada",iF="Función",nF="CARNÉ DE IDENTIDAD",rF="Nombre",aF="Papel",lF="Habitación",cF="hora dorada",uF="Fin de la hora dorada",dF='El código se ejecutará solo cada vez que la condición sea verdadera. P.ej. si se activa en el valor del sensor de temperatura y la condición es "si la temperatura es superior a 20 ° C", las acciones "entonces" se ejecutarán cada vez que el sensor envíe la temperatura y supere los 20 ° C. Por 21 ° C, por 22 ° C y así sucesivamente.',hF='El código se ejecutará solo si cambia el resultado de la condición. P.ej. si se activa en el valor del sensor de temperatura y la condición es "si la temperatura es superior a 20 ° C", las acciones "entonces" se ejecutarán una vez cuando la temperatura sea superior a 20. La próxima vez, las acciones "entonces" se ejecutarán cuando la temperatura falla por debajo de 20 y luego sube por encima de 20 nuevamente.',pF="horas",gF="incluye",mF="intervalo",fF="magia",$F="milisegundos",bF="minutos",vF="ms",yF="nadir",_F="Amanecer náutico",wF="Atardecer náutico",kF="próximo amanecer",CF="Próxima puesta de sol",TF="Noche",SF="Fin de la noche",EF="normal",IF="compensar",xF="uno",DF="o",AF="tranquilo",OF="buscar",RF="segundos",NF="Mediodía solar",MF="amanecer",LF="Final del amanecer",PF="puesta de sol",BF="Inicio al atardecer",FF="entonces",jF="Reconocer",zF="De",UF="Último cambio",HF="Calidad",WF="Marca de tiempo",GF="Usuario",VF="Valor",KF="dos",YF="actualizar",JF="Agrega salida de depuración al registro para muchos comandos del sistema",qF="Salidas de registro detalladas",XF="cuando",ZF="Wizard",QF="Reintentar",ej={"%s not found":"%s no encontrado","()":"()","(at %s)":"(en %s)","(optional)":"(Opcional)","-":"-",".":".","AI code generator":"Generador de código de IA",Ack:aB,Actions:lB,"Actual time of day":"Hora real del día",Add:cB,"Add new script":"Agregar nuevo script",All:uB,"All files will be accepted":"Todos los archivos serán aceptados.",Any:dB,"Any month":"Cualquier mes",Apply:hB,April:pB,"Are you sure?":"¿Estás seguro?",Ask:gB,Astronomical:mB,"Astronomical events today":"Eventos astronómicos hoy",August:fB,"Blockly description":"Crear reglas por bloques gráficos","Body:":"Cuerpo:",Cancel:$B,"Cannot delete non empty item!":"¡No se puede eliminar un elemento no vacío!","Change layout":"Cambia el diseño",'Change theme (actual "%s")':'Cambiar tema (ahora - "%s")',"Check blocks":"Comprobar bloques","Check is not active, because javascript adapter is disabled":"La comprobación no está activa porque el adaptador Javascript está desactivado","Clear search input":"Borrar entrada de búsqueda","Click on this icon":"Haga clic en este ícono",Close:bB,"Close all but current":"Cerrar todo menos el actual","Collapse all":"Desplegar todo","Compares current time with astronomical event":"Compara la hora actual con un evento astronómico","Compares current time with the user specific time":"Compara la hora actual con la hora específica del usuario","Compares the state value with user defined value":"Compara el valor del estado con el valor definido por el usuario",Condition:vB,Conditions:yB,"Configuration not saved.":"Configuración no guardada.",Console:_B,"Control or update some state":"Controlar o actualizar algún estado","Control or update some state with delay":"Controlar o actualizar algún estado con retraso","Convert blockly to javascript for ever.":"Convierta instantáneamente en bloque a Javascript.",Copied:wB,"Copy script":"Copiar guion","Copy to clipboard":"Copiar al portapapeles","Create new":"Crear nuevo","Create new folder":"Crear nueva carpeta","Create new script":"Crear nuevo script","Create or edit CRON or time wizard":"Crear o editar CRON o asistente de tiempo","Dark Theme":"Tema oscuro","Dark style":"Estilo oscuro",Date:"Fecha","Debug instance":"Instancia de depuración","Debug options":"Opciones de depuración",December:kB,Default:CB,"Define cron...":"Definir cron ...","Define schedule...":"Definir horario ...",Delay:TB,Delete:SB,"Delete %s":"Eliminar %s ...","Delete folder":"Eliminar carpeta","Delete script":"Eliminar guión",Description:EB,"Deselect all":"Deseleccionar todo","Discard changes for %s":"Descartar cambios para %s",Done:IB,"Double click to write value":"Doble clic para escribir el valor","Download as file":"Descargar como archivo","Drop some files here or click...":"Suelta algunos archivos aquí o haz clic ...","Duplicate name":"Nombre duplicado","Edit script or just double click":"Editar guión o simplemente hacer doble clic","Empty name is not allowed":"No se permite el nombre vacío","End search mode":"Fin del modo de búsqueda","Enter your question":"Ingrese su solicitud",Error:"Error","Error formatting code":"Código de formato de error","Error was found":"Error encontrado","Every day":"Diario",Exec:xB,"Executes some shell command":"Ejecuta algún comando de shell","Existing scripts will be overwritten.":"Los guiones existentes se sobrescribirán.","Expand all":"Expandir todo","Expert mode":"Modo experto",Explanation:DB,Export:AB,"Export all scripts":"Exportar todos los scripts","Export blocks":"Exportar bloques","Export selected blocks":"Exportar bloques seleccionados",Februar:OB,February:RB,Filter:NB,Folder:MB,Fr:LB,Friday:PB,Function:"Función","Function editor":"Editor de funciones","Function: executed":"Función: ejecutada","Go to next line":"Ir a la siguiente línea","HTTP Call":"Llamada HTTP","Hide logs":"Ocultar registros",ID:BB,ID1:FB,ID2:jB,Import:zB,"Import blocks":"Importar bloques","Import error":"Error de importación","Import scripts":"Importar guiones","Insert object ID":"Insertar ID de objeto",Instance:UB,"Instance is disabled":"La instancia está deshabilitada","Instance:":"Ejemplo:",Instances:HB,Instructions:WB,"Invalid CRON":"CRON inválido","It will not be possible to revert this operation.":"No será posible revertir esta operación.","JS description":"Crear reglas escribiendo Javascript",Januar:GB,January:VB,July:KB,June:YB,"Just check":"Sólo revisa","Language:":"Idioma:","Learn More":"Aprende más","Light style":"Estilo ligero",Limit:JB,"Local time":"Hora local","Locate file":"Localizar el archivo","Log outputs":"Salidas de registro","Log text":"Texto de registro","Log: %s":"Log: %s","Make a HTTP get request":"Realizar una solicitud de obtención HTTP","Make a pause between actions":"Hacer una pausa entre acciones",March:qB,"March ":"marzo",May:XB,Menu:ZB,Message:QB,Mo:e2,Model:t2,Monday:s2,Month:o2,More:i2,Name:n2,"No API key found":"No se encontró ninguna clave API","No Chat GPT Key found":"No se ha encontrado ninguna clave GPT de chat","No active host found":"No se encontró un host activo","Nothing found":"Nada Encontrado",November:r2,OK:a2,October:l2,Ok:c2,"On condition change":"En condición de cambio","On script save or adapter start":"Al guardar el script o al iniciar el adaptador","On weekdays":"De lunes a viernes","Open configuration":"Configuración abierta","Operate two states":"Operar dos estados","Operations with two states":"Operaciones con dos estados","Paste your blocks here":"Pega tus bloques aquí",Pause:u2,"Pause execution":"Pausar ejecución","Pause script":"Pausar guion","Phone:":"Teléfono:","Please select object ID...":"Por favor, seleccione la ID del objeto ...","Press Ctrl+Enter to get the answer":"Presiona Ctrl+Enter para obtener la respuesta","Prettify the script":"Embellecer el guión","Print some text in log":"Imprime texto en el registro","Priority:":"Prioridad:",Pushover:d2,Pushsafer:h2,"Read only ID selected: %s":"ID de solo lectura seleccionado: %s",Rename:p2,"Reorder scripts in folders":"Reordenar guiones en carpetas",Repeat:g2,Restart:m2,Result:f2,"Resume execution":"Reanudar ejecución","Root folder":"Carpeta raíz","Rules description":"Crea reglas con bloques IF, THEN, ELSE","Run script":"Ejecutar guión",Sa:$2,Saturday:b2,Save:v2,"Save all":"Salvar a todos","Say It":"Say It","Say some text via sayit adapter":"Di un mensaje de texto a través del adaptador sayit",Schedule:y2,Script:_2,"Script %s was modified on disk":"El script %s fue modificado en el disco","Script is not running":"El script no se está ejecutando","Search in scripts":"Buscar en guiones","Search...":"Buscar...","Select all":"Seleccionar todo","Send email":"Enviar correo electrónico","Sends an email":"Envía un correo electrónico","Sends message via Pushsafer":"Envía mensaje a través de Pushsafer","Sends message via pushover":"Envía un mensaje a través de un pushover","Sends message via telegram":"Envía mensaje por telegrama","Sends message via whatsapp-cmb":"Envía mensaje vía whatsapp-cmb",September:w2,"Server time":"Tiempo del servidor","Set state action":"Establecer acción estatal","Set with delay":"Establecer con retraso","Shell command":"Comando de Shell","Show astronomical events":"Mostrar eventos astronómicos","Show javascript code":"Mostrar código Javascript","Show logs":"Mostrar registros","Show only paused scripts":"Mostrar solo secuencias de comandos pausadas","Show only running scripts":"Mostrar solo scripts en ejecución","Show only scripts with problems":"Mostrar solo guiones con problemas",Simulate:k2,"Some files will be rejected":"Algunos archivos serán rechazados","Sound:":"Sonido:",Stack:C2,Start:T2,"Start script":"Iniciar guion",State:S2,"State condition":"Condición del estado","Step into function":"Entra en función","Step out from function":"Sal de la función","Stop on exception":"Deténgase en excepción",Su:E2,"Subject:":"Sujeto:",Sunday:I2,"TS description":"Crear reglas escribiendo el mecanografiado",Telegram:x2,"Text:":"Texto:",Th:D2,"The script will be stopped and must be activated manually after debugging. Continue?":"El script se detendrá y deberá activarse manualmente después de la depuración. ¿Continuar?","This is advances option. You can write your own code here and it will be executed on trigger":"Esta es la opción de avances. Puede escribir su propio código aquí y se ejecutará en el disparador",Thursday:A2,Time:O2,"Time condition":"Condición de tiempo","Title:":"Título:","To:":"A:","Trigger with value":"Activar con valor",Triggered:R2,Triggers:N2,"Triggers the on script saving or the javascript instance restart":"Activa el guardado de la secuencia de comandos o el reinicio de la instancia de JavaScript","Triggers the rule on update or change of some state":"Activa la regla de actualización o cambio de algún estado","Triggers the rule periodically or on some specific time":"Activa la regla periódicamente o en un momento específico",Tu:M2,Tuesday:L2,URL:P2,"Unknown error":"Error desconocido","Unknown error!":"¡Error desconocido!","Use generated code":"Usar código generado","User function":"Función de usuario","User:":"Usuario:",Value:B2,"Vibration:":"Vibración:",Volume:F2,We:j2,Wednesday:z2,"Whatsapp-cmb":"Whatsapp-cmb",Write:U2,"Write your own code":"Escribe tu propio código",Yes:H2,"Yet exists!":"¡Sin embargo existe!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Puede usar %s en la URL para usar el valor de activación actual, %id para usar el ID de objeto activado, %name para mostrar el nombre de ID de objeto activado o %old para usar el valor de activación antiguo","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Puede usar %s en el comando para usar el valor de activación actual, %id para usar el ID de objeto activado, %name para mostrar el nombre de ID de objeto activado o %old para usar el valor de activación anterior","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Puede usar %s en el texto para mostrar el valor de activación actual, %id para usar el ID de objeto activado, %name para mostrar el nombre de ID de objeto activado o %old para usar el valor de activación antiguo","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Puede usar %s en el valor para usar el valor de activación actual, %id para usar el ID de objeto activado, %name para mostrar el nombre de ID de objeto activado o %old para usar el valor de activación antiguo","You have to enter OpenAI API key in the configuration of javascript adapter.":"Debe ingresar la clave API de OpenAI en la configuración del adaptador de JavaScript.","You have to enter at least one API key in the configuration of javascript adapter.":"Debe ingresar al menos una clave API (OpenAI, Anthropic o Gemini) en la configuración del adaptador de JavaScript.","Please select a valid model":"Seleccione un modelo válido","[equal]":"[igual]","[greater or equal]":"[mayor o igual]","[greater]":"[mayor que]","[hysteresis]":"[histéresis]","[includes]":"[incluye]","[less or equal]":"[menor o igual]","[less]":"[menos]","[not equal]":"[no es igual]",acknowledgment:W2,all:G2,and:V2,"as JSON":"como JSON","as plain text":"como texto plano",astro:K2,at:Y2,"clear running":"carrera clara",control:J2,copy:q2,cron:X2,dawn:Z2,debug_help:Q2,debug_label:eF,default:"defecto",dusk:tF,easy:sF,else:"demás","equal to":"igual a",every:oF,"every hour at 0 minutes":"cada hora a los 0 minutos",false:"falso","file reading has failed: %s":"la lectura del archivo ha fallado: %s","file reading was aborted":"la lectura del archivo fue abortada",filter_func:iF,filter_id:nF,filter_name:rF,filter_role:aF,filter_room:lF,"for edit or create script":"para editar o crear un nuevo script","for professionals":"para profesionales","for programmers":"para programadores",goldenHour:cF,goldenHourEnd:uF,"greater or equal":"mayor o igual","greater or equal to":"mayor o igual a","greater than":"mas grande que",help_just_check:dF,help_on_change:hF,"high priority":"alta prioridad","high-priority":"alta prioridad","highest priority":"más alta prioridad",hours:pF,includes:gF,interval:mF,"just check":"Sólo revisa","less or equal":"menor o igual","less or equal to":"menor o igual a","less than":"menos que","lower priority":"prioridad más baja","lowest priority":"prioridad más baja",magic:fF,milliseconds:$F,minutes:bF,ms:vF,nadir:yF,nauticalDawn:_F,nauticalDusk:wF,nextSunrise:kF,nextSunset:CF,night:TF,nightEnd:SF,"no blocks found":"No se encontraron bloques","no group":"NO GRUPO",normal:EF,"normal priority":"prioridad normal","not equal to":"no igual a","not properly connected":"Este bloque no está conectado correctamente a otros bloques.",offset:IF,"on change":"en el cambio","on condition change":"con cambio de condición","on update":"en actualización",one:xF,or:DF,quiet:AF,"reset search":"restablecer la búsqueda",search:OF,seconds:RF,solarNoon:NF,"store in":"almacenar en",sunrise:MF,sunriseEnd:LF,sunset:PF,sunsetStart:BF,then:FF,"toggle value":"alternar valor",tooltip_ack:jF,tooltip_from:zF,tooltip_lc:UF,tooltip_quality:HF,tooltip_ts:WF,tooltip_user:GF,tooltip_value:VF,true:"cierto",two:KF,undefined:"indefinido",update:YF,"use seconds":"usar segundos","use trigger value":"usar valor de activación",verbose_help:JF,verbose_label:qF,when:XF,with:"con","with date":"con fecha","with offset":"con desplazamiento",wizard:ZF,"Loading models...":"Cargando modelos...","Could not connect to API at %s":"No se pudo conectar a la API en %s","Invalid API key":"Clave API no válida","Access denied by API":"Acceso denegado por la API","API error: %s":"Error de API: %s",'Model "%s" not found':'Modelo "%s" no encontrado',"Request failed: %s":"Solicitud fallida: %s",Retry:QF,"No running javascript instance found":"No se encontró ninguna instancia de JavaScript en ejecución"},tj="Reconnu",sj="Actions",oj="Ajouter",ij="Tout",nj="Tout",rj="Postuler",aj="avril",lj="Demander",cj="Astronomique",uj="août",dj="Annuler",hj="proche",pj="État",gj="Conditions",mj="Console",fj="Copié",$j="décembre",bj="Défaut",vj="Retard",yj="Effacer",_j="Description",wj="Terminé",kj="Exec shell",Cj="Explication",Tj="Exportation",Sj="Février",Ej="février",Ij="Filtre",xj="Dossier",Dj="Fr",Aj="Vendredi",Oj="ID",Rj="ID1",Nj="ID2",Mj="Importation",Lj="Exemple",Pj="Instances",Bj="Instructions",Fj="Janvier",jj="janvier",zj="juillet",Uj="juin",Hj="Limite",Wj="Mars",Gj="Mai",Vj="M e n u",Kj="Message",Yj="Mo",Jj="Modèle",qj="Lundi",Xj="Mois",Zj="Plus",Qj="Nom",ez="novembre",tz="OK",sz="octobre",oz="D'accord",iz="Pause",nz="Pushover",rz="Pushsafer",az="Renommer",lz="Répéter",cz="Redémarrer",uz="Résultat",dz="Sa",hz="samedi",pz="sauver",gz="Horaire",mz="Scénario",fz="septembre",$z="Simuler",bz="Stack",vz="Début",yz="État",_z="Su",wz="dimanche",kz="Télégramme",Cz="4",Tz="Jeudi",Sz="Temps",Ez="Déclenché",Iz="Déclencheurs",xz="Tu",Dz="Mardi",Az="URL",Oz="Valeur",Rz="Le volume",Nz="3",Mz="Mercredi",Lz="Écrivez",Pz="Oui",Bz="reconnaissance",Fz="tout",jz="et",zz="astro",Uz="à",Hz="contrôler",Wz="copie",Gz="CRON",Vz="Aube",Kz="Il s'agit d'un mode spécial dans lequel les états et les objets ne changeront pas. Mais seules les informations sur chaque changement prévu seront affichées dans le protocole.",Yz="Déboguer",Jz="Crépuscule",qz="facile",Xz="chaque",Zz="Une fonction",Qz="ID",eU="Nom",tU="Rôle",sU="Pièce",oU="Heure d'or",iU="Fin de l'heure d'or",nU="Le code ne sera exécuté que chaque fois que la condition est vraie. Par exemple. si déclenchement sur la valeur du capteur de température et que la condition est «si la température est supérieure à 20 ° C», les actions «alors» seront exécutées à chaque fois que le capteur envoie la température et qu'elle est supérieure à 20 ° C. À 21 ° C, à 22 ° C et ainsi de suite.",rU="Le code ne sera exécuté que si le résultat de la condition change. Par exemple. si le déclenchement sur la valeur du capteur de température et que la condition est «si la température est supérieure à 20 ° C», les actions «alors» seront exécutées une fois lorsque la température est supérieure à 20. La prochaine fois, les actions «alors» seront exécutées lorsque la température échoue sous 20 puis remonte au-dessus de 20.",aU="les heures",lU="comprend",cU="intervalle",uU="la magie",dU="millisecondes",hU="minutes",pU="ms",gU="nadir",mU="Aube nautique",fU="Crépuscule nautique",$U="Prochain lever de soleil",bU="Prochain coucher de soleil",vU="Nuit",yU="Fin de nuit",_U="Ordinaire",wU="décalage",kU="une",CU="ou",TU="calmer",SU="chercher",EU="secondes",IU="Midi solaire",xU="lever du soleil",DU="Fin du lever du soleil",AU="le coucher du soleil",OU="Début du coucher du soleil",RU="alors",NU="Reconnaître",MU="De",LU="Dernière modification",PU="Qualité",BU="Horodatage",FU="Utilisateur",jU="Valeur",zU="deux",UU="mettre à jour",HU="Ajoute une sortie de débogage au journal pour de nombreuses commandes système",WU="Sorties de journal détaillées",GU="lorsque",VU="Wizard",KU="Réessayer",YU={"%s not found":"%s non trouvé","()":"()","(at %s)":"(à %s)","(optional)":"(optionnel)","-":"-",".":".","AI code generator":"Générateur de code IA",Ack:tj,Actions:sj,"Actual time of day":"Heure réelle de la journée",Add:oj,"Add new script":"Ajouter un nouveau script",All:ij,"All files will be accepted":"Tous les fichiers seront acceptés",Any:nj,"Any month":"N'importe quel mois",Apply:rj,April:aj,"Are you sure?":"Êtes-vous sûr?",Ask:lj,Astronomical:cj,"Astronomical events today":"Événements astronomiques aujourd'hui",August:uj,"Blockly description":"Création de règles par blocs graphiques","Body:":"Corps:",Cancel:dj,"Cannot delete non empty item!":"Impossible de supprimer un élément non vide!","Change layout":"Changer la disposition",'Change theme (actual "%s")':'Changer de thème (maintenant - "%s")',"Check blocks":"Vérifier les blocs","Check is not active, because javascript adapter is disabled":"La vérification n'est pas active, car l'adaptateur Javascript est désactivé","Clear search input":"Effacer la recherche","Click on this icon":"Cliquez sur cette icône",Close:hj,"Close all but current":"Ferme tout sauf courant","Collapse all":"Réduire tout","Compares current time with astronomical event":"Compare l'heure actuelle avec un événement astronomique","Compares current time with the user specific time":"Compare l'heure actuelle avec l'heure spécifique de l'utilisateur","Compares the state value with user defined value":"Compare la valeur d'état avec la valeur définie par l'utilisateur",Condition:pj,Conditions:gj,"Configuration not saved.":"Configuration non enregistrée.",Console:mj,"Control or update some state":"Contrôler ou mettre à jour un état","Control or update some state with delay":"Contrôler ou mettre à jour un état avec un délai","Convert blockly to javascript for ever.":"Convertissez instantanément en Javascript.",Copied:fj,"Copy script":"Copier le script","Copy to clipboard":"Copier dans le presse-papier","Create new":"Créer un nouveau","Create new folder":"Créer un nouveau dossier","Create new script":"Créer un nouveau script","Create or edit CRON or time wizard":"Créer ou éditer CRON ou un assistant de temps","Dark Theme":"Thème sombre","Dark style":"Style sombre",Date:"Date","Debug instance":"Instance de débogage","Debug options":"Options de débogage",December:$j,Default:bj,"Define cron...":"Définir le cron ...","Define schedule...":"Définir le calendrier ...",Delay:vj,Delete:yj,"Delete %s":"Supprimer %s ...","Delete folder":"Supprimer le dossier","Delete script":"Supprimer le script",Description:_j,"Deselect all":"Tout déselectionner","Discard changes for %s":"Ignorer les modifications pour %s",Done:wj,"Double click to write value":"Double clic pour écrire la valeur","Download as file":"Télécharger le fichier","Drop some files here or click...":"Déposer des fichiers ici ou cliquez sur ...","Duplicate name":"Nom en double","Edit script or just double click":"Modifiez le script ou double-cliquez simplement sur","Empty name is not allowed":"Le nom vide n'est pas autorisé","End search mode":"Fin du mode de recherche","Enter your question":"Entrez votre demande",Error:"Erreur","Error formatting code":"Erreur lors du formatage du code","Error was found":"Une erreur a été trouvée","Every day":"Tous les jours",Exec:kj,"Executes some shell command":"Exécute une commande shell","Existing scripts will be overwritten.":"Les scripts existants seront écrasés.","Expand all":"Développer tout","Expert mode":"Mode expert",Explanation:Cj,Export:Tj,"Export all scripts":"Exporter tous les scripts","Export blocks":"Blocs d'exportation","Export selected blocks":"Exporter les blocs sélectionnés",Februar:Sj,February:Ej,Filter:Ij,Folder:xj,Fr:Dj,Friday:Aj,Function:"Fonction","Function editor":"Éditeur de fonction","Function: executed":"Fonction : exécutée","Go to next line":"Aller à la ligne suivante","HTTP Call":"Appel HTTP","Hide logs":"Masquer les journaux",ID:Oj,ID1:Rj,ID2:Nj,Import:Mj,"Import blocks":"Blocs d'importation","Import error":"Erreur d'importation","Import scripts":"Importer des scripts","Insert object ID":"Insérer un identifiant d'objet",Instance:Lj,"Instance is disabled":"L'instance est désactivée","Instance:":"Exemple:",Instances:Pj,Instructions:Bj,"Invalid CRON":"CRON invalide","It will not be possible to revert this operation.":"Il ne sera pas possible de revenir sur cette opération.","JS description":"Créer des règles en écrivant du Javascript",Januar:Fj,January:jj,July:zj,June:Uj,"Just check":"Vérifiez simplement","Language:":"Langue:","Learn More":"Apprendre encore plus","Light style":"Style de lumière",Limit:Hj,"Local time":"Heure locale","Locate file":"Localiser le fichier","Log outputs":"Journal des sorties","Log text":"Texte du journal","Log: %s":"Log : %s","Make a HTTP get request":"Faire une requête HTTP Get","Make a pause between actions":"Faites une pause entre les actions",March:Wj,"March ":"mars",May:Gj,Menu:Vj,Message:Kj,Mo:Yj,Model:Jj,Monday:qj,Month:Xj,More:Zj,Name:Qj,"No API key found":"Aucune clé API trouvée","No Chat GPT Key found":"Aucune clé GPT de chat trouvée","No active host found":"Aucun hôte actif trouvé","Nothing found":"Rien n'a été trouvé",November:ez,OK:tz,October:sz,Ok:oz,"On condition change":"En cas de changement de condition","On script save or adapter start":"Lors de l'enregistrement du script ou du démarrage de l'adaptateur","On weekdays":"En semaine","Open configuration":"Configuration ouverte","Operate two states":"Opérer deux états","Operations with two states":"Opérations à deux états","Paste your blocks here":"Collez vos blocs ici",Pause:iz,"Pause execution":"Suspendre l'exécution","Pause script":"Script de pause","Phone:":"Téléphone:","Please select object ID...":"Veuillez sélectionner l'ID d'objet ...","Press Ctrl+Enter to get the answer":"Appuyez sur Ctrl+Entrée pour obtenir la réponse","Prettify the script":"Embellir le scénario","Print some text in log":"Imprimer du texte dans le journal","Priority:":"Priorité:",Pushover:nz,Pushsafer:rz,"Read only ID selected: %s":"ID en lecture seule sélectionné: %s",Rename:az,"Reorder scripts in folders":"Réorganiser les scripts dans des dossiers",Repeat:lz,Restart:cz,Result:uz,"Resume execution":"Reprendre l'exécution","Root folder":"Dossier racine","Rules description":"Créer des règles avec des blocs IF, THEN, ELSE","Run script":"Script de lancement",Sa:dz,Saturday:hz,Save:pz,"Save all":"Sauver tous","Say It":"Say It","Say some text via sayit adapter":"Dites du texte via l'adaptateur sayit",Schedule:gz,Script:mz,"Script %s was modified on disk":"Le script %s a été modifié sur le disque","Script is not running":"Le script n'est pas en cours d'exécution","Search in scripts":"Rechercher dans les scripts","Search...":"Chercher...","Select all":"Tout sélectionner","Send email":"Envoyer un e-mail","Sends an email":"Envoie un e-mail","Sends message via Pushsafer":"Envoie un message via Pushsafer","Sends message via pushover":"Envoie un message via pushover","Sends message via telegram":"Envoie un message par télégramme","Sends message via whatsapp-cmb":"Envoie un message via whatsapp-cmb",September:fz,"Server time":"Heure du serveur","Set state action":"Définir l'action de l'état","Set with delay":"Set avec retard","Shell command":"Commande Shell","Show astronomical events":"Afficher les événements astronomiques","Show javascript code":"Afficher le code Javascript","Show logs":"Afficher les journaux","Show only paused scripts":"Afficher uniquement les scripts en pause","Show only running scripts":"Afficher uniquement les scripts en cours d'exécution","Show only scripts with problems":"Afficher uniquement les scripts avec des problèmes",Simulate:$z,"Some files will be rejected":"Certains fichiers seront rejetés","Sound:":"Sonner:",Stack:bz,Start:vz,"Start script":"Lancer le script",State:yz,"State condition":"État condition","Step into function":"Entrez dans la fonction","Step out from function":"Sortez de la fonction","Stop on exception":"Arrêt sur exception",Su:_z,"Subject:":"Sujet:",Sunday:wz,"TS description":"Créer des règles en écrivant des caractères dactylographiés",Telegram:kz,"Text:":"Texte:",Th:Cz,"The script will be stopped and must be activated manually after debugging. Continue?":"Le script sera arrêté et doit être activé manuellement après le débogage. Continuez?","This is advances option. You can write your own code here and it will be executed on trigger":"C'est une option avancée. Vous pouvez écrire votre propre code ici et il sera exécuté au déclenchement",Thursday:Tz,Time:Sz,"Time condition":"Condition de temps","Title:":"Titre:","To:":"À:","Trigger with value":"Déclencheur avec valeur",Triggered:Ez,Triggers:Iz,"Triggers the on script saving or the javascript instance restart":"Déclenche l'enregistrement du script ou le redémarrage de l'instance javascript","Triggers the rule on update or change of some state":"Déclenche la règle sur la mise à jour ou le changement d'un état","Triggers the rule periodically or on some specific time":"Déclenche la règle périodiquement ou à une heure précise",Tu:xz,Tuesday:Dz,URL:Az,"Unknown error":"Erreur inconnue","Unknown error!":"Erreur inconnue!","Use generated code":"Utiliser le code généré","User function":"Fonction utilisateur","User:":"Utilisateur:",Value:Oz,"Vibration:":"Vibration:",Volume:Rz,We:Nz,Wednesday:Mz,"Whatsapp-cmb":"Whatsapp-cmb",Write:Lz,"Write your own code":"Écrivez votre propre code",Yes:Pz,"Yet exists!":"Pourtant existe!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Vous pouvez utiliser %s dans l'URL pour utiliser la valeur de déclenchement actuelle, %id pour utiliser l'ID de l'objet déclenché, %name pour afficher le nom de l'ID de l'objet déclenché ou %old pour utiliser l'ancienne valeur de déclenchement","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Vous pouvez utiliser %s dans la commande pour utiliser la valeur de déclenchement actuelle, %id pour utiliser l'ID de l'objet déclenché, %name pour afficher le nom de l'ID de l'objet déclenché ou %old pour utiliser l'ancienne valeur de déclenchement","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Vous pouvez utiliser %s dans le texte pour afficher la valeur de déclenchement actuelle, %id pour utiliser l'ID de l'objet déclenché, %name pour afficher le nom de l'ID de l'objet déclenché ou %old pour utiliser l'ancienne valeur de déclenchement","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Vous pouvez utiliser %s dans la valeur pour utiliser la valeur de déclenchement actuelle, %id pour utiliser l'ID de l'objet déclenché, %name pour afficher le nom de l'ID de l'objet déclenché ou %old pour utiliser l'ancienne valeur de déclenchement","You have to enter OpenAI API key in the configuration of javascript adapter.":"Vous devez entrer la clé API OpenAI dans la configuration de l'adaptateur javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Vous devez entrer au moins une clé API (OpenAI, Anthropic ou Gemini) dans la configuration de l'adaptateur javascript.","Please select a valid model":"Veuillez sélectionner un modèle valide","[equal]":"[égal]","[greater or equal]":"[supérieur ou égal]","[greater]":"[plus grand]","[hysteresis]":"[hystérèse]","[includes]":"[comprend]","[less or equal]":"[inférieur ou égal]","[less]":"[moins]","[not equal]":"[inégal]",acknowledgment:Bz,all:Fz,and:jz,"as JSON":"en JSON","as plain text":"en texte brut",astro:zz,at:Uz,"clear running":"course claire",control:Hz,copy:Wz,cron:Gz,dawn:Vz,debug_help:Kz,debug_label:Yz,default:"défaut",dusk:Jz,easy:qz,else:"autre","equal to":"égal à",every:Xz,"every hour at 0 minutes":"toutes les heures à 0 minute",false:"faux","file reading has failed: %s":"La lecture du fichier a échoué: %s","file reading was aborted":"la lecture du fichier a été abandonnée",filter_func:Zz,filter_id:Qz,filter_name:eU,filter_role:tU,filter_room:sU,"for edit or create script":"pour éditer ou créer un nouveau script","for professionals":"pour les professionnels","for programmers":"pour les programmeurs",goldenHour:oU,goldenHourEnd:iU,"greater or equal":"supérieur ou égal","greater or equal to":"supérieur ou égal à","greater than":"plus grand que",help_just_check:nU,help_on_change:rU,"high priority":"haute priorité","high-priority":"haute priorité","highest priority":"priorité la plus élevée",hours:aU,includes:lU,interval:cU,"just check":"Vérifiez simplement","less or equal":"inférieur ou égal","less or equal to":"inférieur ou égal à","less than":"moins que","lower priority":"priorité inférieure","lowest priority":"priorité la plus basse",magic:uU,milliseconds:dU,minutes:hU,ms:pU,nadir:gU,nauticalDawn:mU,nauticalDusk:fU,nextSunrise:$U,nextSunset:bU,night:vU,nightEnd:yU,"no blocks found":"Aucun bloc trouvé","no group":"PAS DE GROUPE",normal:_U,"normal priority":"priorité normale","not equal to":"pas égal à","not properly connected":"Ce bloc n'est pas correctement connecté à d'autres blocs.",offset:wU,"on change":"sur le changement","on condition change":"sur changement de condition","on update":"sur mise à jour",one:kU,or:CU,quiet:TU,"reset search":"Réinitialiser la recherche",search:SU,seconds:EU,solarNoon:IU,"store in":"stocker dans",sunrise:xU,sunriseEnd:DU,sunset:AU,sunsetStart:OU,then:RU,"toggle value":"valeur de bascule",tooltip_ack:NU,tooltip_from:MU,tooltip_lc:LU,tooltip_quality:PU,tooltip_ts:BU,tooltip_user:FU,tooltip_value:jU,true:"vrai",two:zU,undefined:"indéfini",update:UU,"use seconds":"utiliser les secondes","use trigger value":"use trigger value",verbose_help:HU,verbose_label:WU,when:GU,with:"avec","with date":"avec date","with offset":"avec offset",wizard:VU,"Loading models...":"Chargement des modèles...","Could not connect to API at %s":"Impossible de se connecter à l'API sur %s","Invalid API key":"Clé API invalide","Access denied by API":"Accès refusé par l'API","API error: %s":"Erreur API : %s",'Model "%s" not found':'Modèle "%s" introuvable',"Request failed: %s":"Requête échouée : %s",Retry:KU,"No running javascript instance found":"Aucune instance JavaScript en cours d'exécution trouvée"},JU="Riconosciuto",qU="Azioni",XU="Inserisci",ZU="Tutti",QU="Qualunque",eH="Applica",tH="aprile",sH="Chiedere",oH="Astronomico",iH="agosto",nH="Annulla",rH="Vicino",aH="Condizione",lH="Condizioni",cH="Console",uH="Copiato",dH="dicembre",hH="Predefinito",pH="Ritardo",gH="Elimina",mH="Descrizione",fH="Fatto",$H="Execshell",bH="Spiegazione",vH="Esportare",yH="Februar",_H="febbraio",wH="Filtro",kH="Cartella",CH="P",TH="Venerdì",SH="ID",EH="ID1",IH="ID2",xH="Importare",DH="Esempio",AH="istanze",OH="Istruzioni",RH="Januar",NH="gennaio",MH="luglio",LH="giugno",PH="Limite",BH="marzo",FH="Maggio",jH="Menu",zH="Messaggio",UH="Mo",HH="Modello",WH="Lunedi",GH="Mese",VH="Di più",KH="Nome",YH="novembre",JH="OK",qH="ottobre",XH="Ok",ZH="Pausa",QH="Pushover",eW="Pushsafer",tW="Rinominare",sW="Ripetere",oW="Ricomincia",iW="Risultato",nW="Sa",rW="Sabato",aW="Salva",lW="Programma",cW="copione",uW="settembre",dW="Simulare",hW="Stack",pW="Cominciare",gW="Stato",mW="Su",fW="Domenica",$W="Telegramma",bW="4",vW="giovedi",yW="Tempo",_W="Innescato",wW="Trigger",kW="Tu",CW="martedì",TW="URL",SW="Valore",EW="Volume",IW="3",xW="mercoledì",DW="Scrivi",AW="sì",OW="riconoscimento",RW="tutti",NW="e",MW="astro",LW="a",PW="controllo",BW="copia",FW="CRON",jW="alba",zW="Questa è una modalità speciale in cui gli stati e gli oggetti non cambieranno. Ma nel protocollo verranno visualizzate solo le informazioni su ogni modifica pianificata.",UW="Debug",HW="crepuscolo",WW="facile",GW="ogni",VW="Funzione",KW="ID",YW="Nome",JW="Ruolo",qW="Camera",XW="Ora d'oro",ZW="Fine dell'ora d'oro",QW='Il codice verrà eseguito solo ogni volta che la condizione è vera. Per esempio. se si attiva il valore del sensore di temperatura e la condizione è "se la temperatura è maggiore di 20 ° C", le azioni "allora" verranno eseguite ogni volta che il sensore invia la temperatura e questa è superiore a 20 ° C. Di 21 ° C, di 22 ° C e così via.',e5='Il codice verrà eseguito solo se il risultato della condizione cambia. Per esempio. se si attiva il valore del sensore di temperatura e la condizione è "se la temperatura è maggiore di 20 ° C", le azioni "allora" verranno eseguite una volta quando la temperatura è superiore a 20. La prossima volta le azioni "allora" verranno eseguite quando la temperatura fallisce sotto 20 e poi sale di nuovo oltre 20.',t5="ore",s5="include",o5="intervallo",i5="Magia",n5="millisecondi",r5="minuti",a5="ms",l5="nadir",c5="Alba nautica",u5="Crepuscolo nautico",d5="Prossima alba",h5="Prossimo tramonto",p5="Notte",g5="Fine della notte",m5="normale",f5="compensare",$5="uno",b5="o",v5="silenzioso",y5="ricerca",_5="secondi",w5="Mezzogiorno solare",k5="Alba",C5="Fine dell'alba",T5="tramonto",S5="Inizio del tramonto",E5="poi",I5="Riconoscere",x5="A partire dal",D5="Ultima modifica",A5="Qualità",O5="timestamp",R5="Utente",N5="Valore",M5="Due",L5="aggiornare",P5="Aggiunge l'output di debug al registro per molti comandi di sistema",B5="Output di log dettagliati",F5="quando",j5="procedura guidata",z5="Riprova",U5={"%s not found":"%s non trovato","()":"()","(at %s)":"(a %s)","(optional)":"(opzionale)","-":"-",".":".","AI code generator":"Generatore di codice AI",Ack:JU,Actions:qU,"Actual time of day":"Ora effettiva della giornata",Add:XU,"Add new script":"Aggiungi nuovo script",All:ZU,"All files will be accepted":"Tutti i file saranno accettati",Any:QU,"Any month":"Ogni mese",Apply:eH,April:tH,"Are you sure?":"Sei sicuro?",Ask:sH,Astronomical:oH,"Astronomical events today":"Eventi astronomici oggi",August:iH,"Blockly description":"Creazione di regole tramite blocchi grafici","Body:":"Corpo:",Cancel:nH,"Cannot delete non empty item!":"Impossibile eliminare l'elemento non vuoto!","Change layout":"Cambia layout",'Change theme (actual "%s")':'Cambia tema (ora - "%s")',"Check blocks":"Controlla i blocchi","Check is not active, because javascript adapter is disabled":"Il controllo non è attivo perché l'adattatore Javascript è disabilitato","Clear search input":"Cancella input di ricerca","Click on this icon":"Clicca su questa icona",Close:rH,"Close all but current":"Chiudi tutto tranne corrente","Collapse all":"Comprimi tutto","Compares current time with astronomical event":"Confronta l'ora corrente con l'evento astronomico","Compares current time with the user specific time":"Confronta l'ora corrente con l'ora specifica dell'utente","Compares the state value with user defined value":"Confronta il valore dello stato con il valore definito dall'utente",Condition:aH,Conditions:lH,"Configuration not saved.":"Configurazione non salvata.",Console:cH,"Control or update some state":"Controlla o aggiorna uno stato","Control or update some state with delay":"Controlla o aggiorna uno stato con ritardo","Convert blockly to javascript for ever.":"Converti istantaneamente a blocchi in Javascript.",Copied:uH,"Copy script":"Copia script","Copy to clipboard":"Copia negli appunti","Create new":"Creare nuovo","Create new folder":"Crea una nuova cartella","Create new script":"Crea nuovo script","Create or edit CRON or time wizard":"Crea o modifica la procedura guidata CRON o time","Dark Theme":"Tema scuro","Dark style":"Stile scuro",Date:"Data","Debug instance":"Istanza di debug","Debug options":"Opzioni di debug",December:dH,Default:hH,"Define cron...":"Definisci cron ...","Define schedule...":"Definisci programma ...",Delay:pH,Delete:gH,"Delete %s":"Elimina %s ...","Delete folder":"Elimina cartella","Delete script":"Elimina script",Description:mH,"Deselect all":"Deselezionare tutto","Discard changes for %s":"Annulla modifiche per %s",Done:fH,"Double click to write value":"Doppio clic per scrivere il valore","Download as file":"Scarica come file","Drop some files here or click...":"Trascina alcuni file qui o fai clic su ...","Duplicate name":"Nome duplicato","Edit script or just double click":"Modifica lo script o fai doppio clic","Empty name is not allowed":"Il nome vuoto non è consentito","End search mode":"Termina la modalità di ricerca","Enter your question":"Inserisci la tua richiesta",Error:"Errore","Error formatting code":"Errore di formattazione del codice","Error was found":"Errore trovato","Every day":"Ogni giorno",Exec:$H,"Executes some shell command":"Esegue alcuni comandi della shell","Existing scripts will be overwritten.":"Gli script esistenti verranno sovrascritti.","Expand all":"Espandi tutto","Expert mode":"Modalità esperto",Explanation:bH,Export:vH,"Export all scripts":"Esporta tutti gli script","Export blocks":"Esporta blocchi","Export selected blocks":"Esporta i blocchi selezionati",Februar:yH,February:_H,Filter:wH,Folder:kH,Fr:CH,Friday:TH,Function:"Funzione","Function editor":"Editor di funzioni","Function: executed":"Funzione: eseguita","Go to next line":"Vai alla riga successiva","HTTP Call":"Chiamata HTTP","Hide logs":"Nascondi i registri",ID:SH,ID1:EH,ID2:IH,Import:xH,"Import blocks":"Importa blocchi","Import error":"Errore di importazione","Import scripts":"Importa script","Insert object ID":"Inserisci l'ID oggetto",Instance:DH,"Instance is disabled":"L'istanza è disabilitata","Instance:":"Esempio:",Instances:AH,Instructions:OH,"Invalid CRON":"CRON non valido","It will not be possible to revert this operation.":"Non sarà possibile ripristinare questa operazione.","JS description":"Creare regole scrivendo Javascript",Januar:RH,January:NH,July:MH,June:LH,"Just check":"Controlla solamente","Language:":"Linguaggio:","Learn More":"Per saperne di più","Light style":"Stile leggero",Limit:PH,"Local time":"Ora locale","Locate file":"Localizza file","Log outputs":"Registra le uscite","Log text":"Testo del registro","Log: %s":"Log: %s","Make a HTTP get request":"Effettua una richiesta get HTTP","Make a pause between actions":"Fai una pausa tra le azioni",March:BH,"March ":"marzo",May:FH,Menu:jH,Message:zH,Mo:UH,Model:HH,Monday:WH,Month:GH,More:VH,Name:KH,"No API key found":"Nessuna chiave API trovata","No Chat GPT Key found":"Nessuna chiave GPT chat trovata","No active host found":"Nessun host attivo trovato","Nothing found":"Non abbiamo trovato nulla",November:YH,OK:JH,October:qH,Ok:XH,"On condition change":"A condizione che cambino","On script save or adapter start":"Al salvataggio dello script o all'avvio dell'adattatore","On weekdays":"Nei giorni della settimana","Open configuration":"Configurazione aperta","Operate two states":"Gestisci due stati","Operations with two states":"Operazioni con due stati","Paste your blocks here":"Incolla qui i tuoi blocchi",Pause:ZH,"Pause execution":"Metti in pausa l'esecuzione","Pause script":"Metti in pausa lo script","Phone:":"Telefono:","Please select object ID...":"Seleziona l'ID oggetto ...","Press Ctrl+Enter to get the answer":"Premi Ctrl+Invio per ottenere la risposta","Prettify the script":"Abbellire la sceneggiatura","Print some text in log":"Stampa del testo nel registro","Priority:":"Priorità:",Pushover:QH,Pushsafer:eW,"Read only ID selected: %s":"ID di sola lettura selezionato: %s",Rename:tW,"Reorder scripts in folders":"Riordina gli script nelle cartelle",Repeat:sW,Restart:oW,Result:iW,"Resume execution":"Riprendi esecuzione","Root folder":"Cartella root","Rules description":"Crea regole con i blocchi IF, THEN, ELSE","Run script":"Esegui script",Sa:nW,Saturday:rW,Save:aW,"Save all":"Salva tutto","Say It":"Say It","Say some text via sayit adapter":"Pronuncia del testo tramite l'adattatore sayit",Schedule:lW,Script:cW,"Script %s was modified on disk":"Lo script %s è stato modificato sul disco","Script is not running":"Lo script non è in esecuzione","Search in scripts":"Cerca negli script","Search...":"Ricerca...","Select all":"Seleziona tutto","Send email":"Invia una email","Sends an email":"Invia un'e-mail","Sends message via Pushsafer":"Invia messaggio tramite Pushsafer","Sends message via pushover":"Invia messaggio tramite pushover","Sends message via telegram":"Invia messaggio tramite telegramma","Sends message via whatsapp-cmb":"Invia messaggio tramite whatsapp-cmb",September:uW,"Server time":"Ora del server","Set state action":"Imposta l'azione dello stato","Set with delay":"Impostato con ritardo","Shell command":"Comando Shell","Show astronomical events":"Mostra eventi astronomici","Show javascript code":"Mostra codice Javascript","Show logs":"Mostra i log","Show only paused scripts":"Mostra solo script in pausa","Show only running scripts":"Mostra solo gli script in esecuzione","Show only scripts with problems":"Mostra solo script con problemi",Simulate:dW,"Some files will be rejected":"Alcuni file verranno rifiutati","Sound:":"Suono:",Stack:hW,Start:pW,"Start script":"Avvia script",State:gW,"State condition":"Condizione dello stato","Step into function":"Entra in funzione","Step out from function":"Esci dalla funzione","Stop on exception":"Ferma in caso di eccezione",Su:mW,"Subject:":"Soggetto:",Sunday:fW,"TS description":"Creare regole scrivendo dattiloscritto",Telegram:$W,"Text:":"Testo:",Th:bW,"The script will be stopped and must be activated manually after debugging. Continue?":"Lo script verrà interrotto e dovrà essere attivato manualmente dopo il debug. Continua?","This is advances option. You can write your own code here and it will be executed on trigger":"Questa è un'opzione anticipata. Puoi scrivere il tuo codice qui e verrà eseguito al trigger",Thursday:vW,Time:yW,"Time condition":"Condizione temporale","Title:":"Titolo:","To:":"Per:","Trigger with value":"Trigger con valore",Triggered:_W,Triggers:wW,"Triggers the on script saving or the javascript instance restart":"Attiva il salvataggio dello script o il riavvio dell'istanza javascript","Triggers the rule on update or change of some state":"Attiva la regola in caso di aggiornamento o modifica di uno stato","Triggers the rule periodically or on some specific time":"Attiva la regola periodicamente o in un momento specifico",Tu:kW,Tuesday:CW,URL:TW,"Unknown error":"Errore sconosciuto","Unknown error!":"Errore sconosciuto!","Use generated code":"Usa il codice generato","User function":"Funzione utente","User:":"Utente:",Value:SW,"Vibration:":"Vibrazione:",Volume:EW,We:IW,Wednesday:xW,"Whatsapp-cmb":"Whatsapp-cmb",Write:DW,"Write your own code":"Scrivi il tuo codice",Yes:AW,"Yet exists!":"Esiste ancora!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"È possibile utilizzare %s nell'URL per utilizzare il valore di trigger corrente, %id per utilizzare l'ID dell'oggetto attivato, %name per mostrare il nome dell'ID dell'oggetto attivato o %old per utilizzare il vecchio valore di trigger","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"È possibile utilizzare %s nel comando per utilizzare il valore di trigger corrente, %id per utilizzare l'ID dell'oggetto attivato, %name per mostrare il nome dell'ID dell'oggetto attivato o %old per utilizzare il vecchio valore di trigger","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"È possibile utilizzare %s nel testo per visualizzare il valore di trigger corrente, %id per utilizzare l'ID dell'oggetto attivato, %name per mostrare il nome dell'ID dell'oggetto attivato o %old per utilizzare il vecchio valore di trigger","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"È possibile utilizzare %s nel valore per utilizzare il valore di trigger corrente, %id per utilizzare l'ID dell'oggetto attivato, %name per mostrare il nome dell'ID dell'oggetto attivato o %old per utilizzare il vecchio valore di trigger","You have to enter OpenAI API key in the configuration of javascript adapter.":"Devi inserire la chiave API OpenAI nella configurazione dell'adattatore javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Devi inserire almeno una chiave API (OpenAI, Anthropic o Gemini) nella configurazione dell'adattatore javascript.","Please select a valid model":"Seleziona un modello valido","[equal]":"[pari]","[greater or equal]":"[maggiore o uguale]","[greater]":"[maggiore]","[hysteresis]":"[isteresi]","[includes]":"[include]","[less or equal]":"[minore o uguale]","[less]":"[Di meno]","[not equal]":"[non uguale]",acknowledgment:OW,all:RW,and:NW,"as JSON":"come JSON","as plain text":"come testo",astro:MW,at:LW,"clear running":"chiara esecuzione",control:PW,copy:BW,cron:FW,dawn:jW,debug_help:zW,debug_label:UW,default:"predefinito",dusk:HW,easy:WW,else:"altro","equal to":"uguale a",every:GW,"every hour at 0 minutes":"ogni ora a 0 minuti",false:"falso","file reading has failed: %s":"lettura file non riuscita: %s","file reading was aborted":"la lettura del file è stata interrotta",filter_func:VW,filter_id:KW,filter_name:YW,filter_role:JW,filter_room:qW,"for edit or create script":"per modificare o creare un nuovo script","for professionals":"per i professionisti","for programmers":"per i programmatori",goldenHour:XW,goldenHourEnd:ZW,"greater or equal":"maggiore o uguale","greater or equal to":"maggiore o uguale a","greater than":"più grande di",help_just_check:QW,help_on_change:e5,"high priority":"priorità alta","high-priority":"priorità alta","highest priority":"massima priorità",hours:t5,includes:s5,interval:o5,"just check":"controlla solamente","less or equal":"inferiore o uguale","less or equal to":"minore o uguale a","less than":"meno di","lower priority":"priorità inferiore","lowest priority":"priorità più bassa",magic:i5,milliseconds:n5,minutes:r5,ms:a5,nadir:l5,nauticalDawn:c5,nauticalDusk:u5,nextSunrise:d5,nextSunset:h5,night:p5,nightEnd:g5,"no blocks found":"Nessun blocco trovato","no group":"NESSUN GRUPPO",normal:m5,"normal priority":"priorità normale","not equal to":"non uguale a","not properly connected":"Questo blocco non è correttamente collegato ad altri blocchi.",offset:f5,"on change":"sul cambiamento","on condition change":"a cambio di condizione","on update":"in aggiornamento",one:$5,or:b5,quiet:v5,"reset search":"resetta la ricerca",search:y5,seconds:_5,solarNoon:w5,"store in":"conservare in",sunrise:k5,sunriseEnd:C5,sunset:T5,sunsetStart:S5,then:E5,"toggle value":"alterna valore",tooltip_ack:I5,tooltip_from:x5,tooltip_lc:D5,tooltip_quality:A5,tooltip_ts:O5,tooltip_user:R5,tooltip_value:N5,true:"vero",two:M5,undefined:"non definito",update:L5,"use seconds":"usa i secondi","use trigger value":"usa il trigger",verbose_help:P5,verbose_label:B5,when:F5,with:"con","with date":"con data","with offset":"con offset",wizard:j5,"Loading models...":"Caricamento modelli...","Could not connect to API at %s":"Impossibile connettersi all'API su %s","Invalid API key":"Chiave API non valida","Access denied by API":"Accesso negato dall'API","API error: %s":"Errore API: %s",'Model "%s" not found':'Modello "%s" non trovato',"Request failed: %s":"Richiesta fallita: %s",Retry:z5,"No running javascript instance found":"Nessuna istanza JavaScript in esecuzione trovata"},H5="Erkend",W5="Acties",G5="Toevoegen",V5="Alle",K5="Ieder",Y5="Solliciteer",J5="april",q5="Vragen",X5="Astronomisch",Z5="augustus",Q5="annuleren",e3="Dichtbij",t3="Staat",s3="Voorwaarden",o3="Troosten",i3="Gekopieerd",n3="december",r3="Standaard",a3="Vertraging",l3="Verwijder",c3="Beschrijving",u3="Gedaan",d3="Exec shell",h3="Uitleg",p3="Exporteren",g3="Februari",m3="februari",f3="Filter",$3="Map",b3="Vr",v3="vrijdag",y3="ID kaart",_3="ID1",w3="ID2",k3="Importeren",C3="Voorbeeld",T3="Instanties",S3="Instructies",E3="Januar",I3="januari",x3="juli",D3="juni",A3="Begrenzing",O3="maart",R3="mei",N3="Menu",M3="Bericht",L3="Ma",P3="Model",B3="maandag",F3="Maand",j3="Meer",z3="Naam",U3="november",H3="OK",W3="oktober",G3="OK",V3="Pauze",K3="Pushover",Y3="Duwijzer",J3="andere naam geven",q3="Herhaling",X3="Herstarten",Z3="Resultaat",Q3="Za",eG="zaterdag",tG="Opslaan",sG="Schema",oG="Script",iG="september",nG="Simuleren",rG="Stack",aG="Begin",lG="Staat",cG="Zo",uG="zondag",dG="Telegram",hG="4",pG="donderdag",gG="Tijd",mG="Veroorzaakt",fG="Triggers",$G="Di",bG="dinsdag",vG="URL",yG="Waarde",_G="Volume",wG="3",kG="woensdag",CG="Schrijven",TG="Ja",SG="erkenning",EG="alle",IG="en",xG="astro",DG="Bij",AG="controle",OG="kopiëren",RG="cron",NG="dageraad",MG="Dit is een speciale modus waarin toestanden en objecten niet veranderen. Maar alleen informatie over elke geplande wijziging wordt in het protocol weergegeven.",LG="Debuggen",PG="schemer",BG="eenvoudig",FG="elke",jG="Functie",zG="ID kaart",UG="Naam",HG="Rol",WG="Kamer",GG="gouden uur",VG="Einde van gouden uur",KG='De code wordt alleen uitgevoerd als de voorwaarde waar is. Bijv. als het triggeren op de temperatuursensorwaarde en de conditie is "als de temperatuur hoger is dan 20 ° C", zullen de "dan" acties worden uitgevoerd elke keer dat de sensor de temperatuur verzendt en deze hoger is dan 20 ° C. Bij 21 ° C, bij 22 ° C enzovoort.',YG='De code wordt alleen uitgevoerd als het conditieresultaat verandert. Bijv. als de temperatuursensor wordt geactiveerd en de conditie is "als de temperatuur hoger is dan 20 ° C", worden de "dan" -acties eenmaal uitgevoerd wanneer de temperatuur hoger is dan 20. De volgende keer worden de "dan" -acties uitgevoerd wanneer de temperatuur faalt onder de 20 en stijgt dan weer boven de 20.',JG="uren",qG="omvat",XG="interval",ZG="magie",QG="milliseconden",eV="minuten",tV="ms",sV="nadir",oV="Nautische dageraad",iV="Nautische schemering",nV="Volgende zonsopgang",rV="Volgende zonsondergang",aV="nacht",lV="Einde van de nacht",cV="normaal",uV="compensatie",dV="een",hV="of",pV="stil",gV="zoeken",mV="seconden",fV="Zonne-middag",$V="zonsopkomst",bV="Einde zonsopgang",vV="zonsondergang",yV="Begin van de zonsondergang",_V="vervolgens",wV="Erkennen",kV="Van",CV="Laatst gewijzigd",TV="Kwaliteit",SV="tijdstempel",EV="Gebruiker",IV="Waarde",xV="twee",DV="bijwerken",AV="Voegt foutopsporingsuitvoer toe aan het logboek voor veel systeemopdrachten",OV="Uitgebreide log-uitgangen",RV="wanneer",NV="tovenaar",MV="Opnieuw proberen",LV={"%s not found":"%s niet gevonden","()":"()","(at %s)":"(op %s)","(optional)":"(optioneel)","-":"-",".":".","AI code generator":"AI-codegenerator",Ack:H5,Actions:W5,"Actual time of day":"Werkelijke tijd van de dag",Add:G5,"Add new script":"Nieuw script toevoegen",All:V5,"All files will be accepted":"Alle bestanden worden geaccepteerd",Any:K5,"Any month":"Elke maand",Apply:Y5,April:J5,"Are you sure?":"Weet je zeker dat?",Ask:q5,Astronomical:X5,"Astronomical events today":"Astronomische gebeurtenissen vandaag",August:Z5,"Blockly description":"Regels maken door grafische blokken","Body:":"Lichaam:",Cancel:Q5,"Cannot delete non empty item!":"Kan niet leeg item niet verwijderen!","Change layout":"Opmaak veranderen",'Change theme (actual "%s")':'Thema wijzigen (nu - "%s")',"Check blocks":"Controleer blokken","Check is not active, because javascript adapter is disabled":"Controle is niet actief, omdat Javascript-adapter is uitgeschakeld","Clear search input":"Zoekopdracht wissen","Click on this icon":"Klik op dit pictogram",Close:e3,"Close all but current":"Alles sluiten behalve huidig","Collapse all":"Alles inklappen","Compares current time with astronomical event":"Vergelijkt huidige tijd met astronomische gebeurtenis","Compares current time with the user specific time":"Vergelijkt de huidige tijd met de gebruikerspecifieke tijd","Compares the state value with user defined value":"Vergelijkt de statuswaarde met de door de gebruiker gedefinieerde waarde",Condition:t3,Conditions:s3,"Configuration not saved.":"Configuratie niet opgeslagen.",Console:o3,"Control or update some state":"Beheer of update een bepaalde staat","Control or update some state with delay":"Beheer of update een bepaalde staat met vertraging","Convert blockly to javascript for ever.":"Converteer direct blockly naar Javascript.",Copied:i3,"Copy script":"Kopieer script","Copy to clipboard":"Kopieer naar klembord","Create new":"Maak nieuw","Create new folder":"Maak een nieuwe map","Create new script":"Maak een nieuw script","Create or edit CRON or time wizard":"Creëer of bewerk CRON of tijdwizard","Dark Theme":"Donker thema","Dark style":"Donkere stijl",Date:"Datum","Debug instance":"Debug-instantie","Debug options":"Foutopsporingsopties",December:n3,Default:r3,"Define cron...":"Definieer cron ...","Define schedule...":"Definieer schema ...",Delay:a3,Delete:l3,"Delete %s":"%s verwijderen ...","Delete folder":"Verwijder map","Delete script":"Script verwijderen",Description:c3,"Deselect all":"Deselecteer alles","Discard changes for %s":"Wijzigingen voor %s annuleren",Done:u3,"Double click to write value":"Dubbelklikken om waarde te schrijven","Download as file":"Download","Drop some files here or click...":"Zet hier enkele bestanden neer of klik op ...","Duplicate name":"Dubbele naam","Edit script or just double click":"Bewerk het script of dubbelklik erop","Empty name is not allowed":"Lege naam is niet toegestaan","End search mode":"Zoekmodus beëindigen","Enter your question":"Voer uw verzoek in",Error:"Fout","Error formatting code":"Fout bij het opmaken van de code","Error was found":"Er is een fout gevonden","Every day":"Elke dag",Exec:d3,"Executes some shell command":"Voert een shell-commando uit","Existing scripts will be overwritten.":"Bestaande scripts worden overschreven.","Expand all":"Alles uitvouwen","Expert mode":"Expert modus",Explanation:h3,Export:p3,"Export all scripts":"Exporteer alle scripts","Export blocks":"Blokken exporteren","Export selected blocks":"Exporteer geselecteerde blokken",Februar:g3,February:m3,Filter:f3,Folder:$3,Fr:b3,Friday:v3,Function:"Functie","Function editor":"Functie-editor","Function: executed":"Functie: uitgevoerd","Go to next line":"Ga naar de volgende regel","HTTP Call":"HTTP-oproep","Hide logs":"Verberg logboeken",ID:y3,ID1:_3,ID2:w3,Import:k3,"Import blocks":"Blokken importeren","Import error":"Importfout","Import scripts":"Scripts importeren","Insert object ID":"Object-ID invoegen",Instance:C3,"Instance is disabled":"Exemplaar is uitgeschakeld","Instance:":"Voorbeeld:",Instances:T3,Instructions:S3,"Invalid CRON":"Ongeldige CRON","It will not be possible to revert this operation.":"Het is niet mogelijk om deze bewerking terug te zetten.","JS description":"Regels maken door Javascript te schrijven",Januar:E3,January:I3,July:x3,June:D3,"Just check":"Kijk maar","Language:":"Taal:","Learn More":"Leer meer","Light style":"Lichte stijl",Limit:A3,"Local time":"Lokale tijd","Locate file":"Vind het bestand","Log outputs":"Log uitgangen","Log text":"Log tekst","Log: %s":"Logboek: %s","Make a HTTP get request":"Maak een HTTP-ophaalverzoek","Make a pause between actions":"Pauzeer tussen acties",March:O3,"March ":"maart",May:R3,Menu:N3,Message:M3,Mo:L3,Model:P3,Monday:B3,Month:F3,More:j3,Name:z3,"No API key found":"Geen API-sleutel gevonden","No Chat GPT Key found":"Geen Chat GPT-sleutel gevonden","No active host found":"Geen actieve host gevonden","Nothing found":"Niets gevonden",November:U3,OK:H3,October:W3,Ok:G3,"On condition change":"Op voorwaarde verandering","On script save or adapter start":"Bij het opslaan van het script of het starten van de adapter","On weekdays":"Op weekdagen","Open configuration":"Configuratie openen","Operate two states":"Bedien twee toestanden:","Operations with two states":"Bewerkingen met twee toestanden","Paste your blocks here":"Plak hier je blokken",Pause:V3,"Pause execution":"Uitvoering pauzeren","Pause script":"Pauzeer script","Phone:":"Telefoon:","Please select object ID...":"Selecteer object-ID ...","Press Ctrl+Enter to get the answer":"Druk op Ctrl+Enter om het antwoord te krijgen","Prettify the script":"Maak het script mooier","Print some text in log":"Druk wat tekst af in het logboek","Priority:":"Prioriteit:",Pushover:K3,Pushsafer:Y3,"Read only ID selected: %s":"Alleen-lezen ID geselecteerd: %s",Rename:J3,"Reorder scripts in folders":"Sorteer scripts in mappen opnieuw",Repeat:q3,Restart:X3,Result:Z3,"Resume execution":"Uitvoering hervatten","Root folder":"Hoofdmap","Rules description":"Maak regels met IF, THEN, ELSE blokken","Run script":"Voer script uit",Sa:Q3,Saturday:eG,Save:tG,"Save all":"Sla alles op","Say It":"Say It","Say some text via sayit adapter":"Zeg wat tekst via de sayit-adapter",Schedule:sG,Script:oG,"Script %s was modified on disk":"Script %s is gewijzigd op schijf","Script is not running":"Script is niet actief","Search in scripts":"Zoeken in scripts","Search...":"Zoeken...","Select all":"Selecteer alles","Send email":"E-mail verzenden","Sends an email":"Stuurt een e-mail","Sends message via Pushsafer":"Stuurt bericht via Pushsafer","Sends message via pushover":"Stuurt bericht via pushover","Sends message via telegram":"Verzendt bericht via telegram","Sends message via whatsapp-cmb":"Stuurt bericht via whatsapp-cmb",September:iG,"Server time":"Servertijd","Set state action":"Stel statusactie in","Set with delay":"Met vertraging ingesteld","Shell command":"Shell-opdracht","Show astronomical events":"Laat astronomische gebeurtenissen zien","Show javascript code":"Javascript-code weergeven","Show logs":"Toon logboeken","Show only paused scripts":"Toon alleen onderbroken scripts","Show only running scripts":"Toon alleen actieve scripts","Show only scripts with problems":"Toon alleen scripts met problemen",Simulate:nG,"Some files will be rejected":"Sommige bestanden worden geweigerd","Sound:":"Geluid:",Stack:rG,Start:aG,"Start script":"Start het script",State:lG,"State condition":"Staat staat","Step into function":"Stap in functie","Step out from function":"Stap uit de functie","Stop on exception":"Stop bij uitzondering",Su:cG,"Subject:":"Onderwerpen:",Sunday:uG,"TS description":"Regels maken door Typescript te schrijven",Telegram:dG,"Text:":"Tekst:",Th:hG,"The script will be stopped and must be activated manually after debugging. Continue?":"Het script wordt gestopt en moet na het debuggen handmatig worden geactiveerd. Doorgaan met?","This is advances option. You can write your own code here and it will be executed on trigger":"Dit is een voorschotoptie. U kunt hier uw eigen code schrijven en deze wordt bij een trigger uitgevoerd",Thursday:pG,Time:gG,"Time condition":"Tijdsvoorwaarde","Title:":"Titel:","To:":"Naar:","Trigger with value":"Trigger met waarde",Triggered:mG,Triggers:fG,"Triggers the on script saving or the javascript instance restart":"Activeert het opslaan van het script of het opnieuw opstarten van de JavaScript-instantie","Triggers the rule on update or change of some state":"Activeert de regel voor het bijwerken of wijzigen van een bepaalde staat","Triggers the rule periodically or on some specific time":"Activeert de regel periodiek of op een specifieke tijd",Tu:$G,Tuesday:bG,URL:vG,"Unknown error":"Onbekende fout","Unknown error!":"Onbekende fout!","Use generated code":"Gebruik gegenereerde code","User function":"Gebruikersfunctie","User:":"Gebruiker:",Value:yG,"Vibration:":"Trilling:",Volume:_G,We:wG,Wednesday:kG,"Whatsapp-cmb":"Whatsapp-cmb",Write:CG,"Write your own code":"Schrijf je eigen code",Yes:TG,"Yet exists!":"Toch bestaat!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"U kunt %s in de URL gebruiken om de huidige triggerwaarde te gebruiken, %id om de geactiveerde object-ID te gebruiken, %name om de geactiveerde object-ID-naam te tonen of %old om de oude triggerwaarde te gebruiken","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"U kunt %s in de opdracht gebruiken om de huidige triggerwaarde te gebruiken, %id om de getriggerde object-ID te gebruiken, %name om de getriggerde object-ID-naam te tonen of %old om de oude triggerwaarde te gebruiken","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"U kunt %s in de tekst gebruiken om de huidige triggerwaarde weer te geven, %id om de geactiveerde object-ID te gebruiken, %name om de geactiveerde object-ID-naam weer te geven of %old om de oude triggerwaarde te gebruiken","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"U kunt %s in de waarde gebruiken om de huidige triggerwaarde te gebruiken, %id om de geactiveerde object-ID te gebruiken, %name om de geactiveerde object-ID-naam te tonen of %old om de oude triggerwaarde te gebruiken","You have to enter OpenAI API key in the configuration of javascript adapter.":"U moet de OpenAI API-sleutel invoeren in de configuratie van de javascript-adapter.","You have to enter at least one API key in the configuration of javascript adapter.":"U moet ten minste één API-sleutel (OpenAI, Anthropic of Gemini) invoeren in de configuratie van de javascript-adapter.","Please select a valid model":"Selecteer een geldig model","[equal]":"[Gelijk]","[greater or equal]":"[groter of gelijk]","[greater]":"[groter]","[hysteresis]":"[hysterese]","[includes]":"[inclusief]","[less or equal]":"[minder of gelijk]","[less]":"[minder]","[not equal]":"[niet gelijk]",acknowledgment:SG,all:EG,and:IG,"as JSON":"als JSON","as plain text":"als platte tekst",astro:xG,at:DG,"clear running":"duidelijk rennen",control:AG,copy:OG,cron:RG,dawn:NG,debug_help:MG,debug_label:LG,default:"standaard",dusk:PG,easy:BG,else:"anders","equal to":"gelijk aan",every:FG,"every hour at 0 minutes":"elk uur op 0 minuten",false:"false","file reading has failed: %s":"bestands lezen is mislukt: %s","file reading was aborted":"bestands lezen is afgebroken",filter_func:jG,filter_id:zG,filter_name:UG,filter_role:HG,filter_room:WG,"for edit or create script":"voor bewerken of een nieuw script maken","for professionals":"voor professionals","for programmers":"voor programmeurs",goldenHour:GG,goldenHourEnd:VG,"greater or equal":"groter of gelijk","greater or equal to":"groter of gelijk aan","greater than":"groter dan",help_just_check:KG,help_on_change:YG,"high priority":"hoge prioriteit","high-priority":"hoge prioriteit","highest priority":"hoogste prioriteit",hours:JG,includes:qG,interval:XG,"just check":"kijk maar","less or equal":"minder of gelijk","less or equal to":"minder of gelijk aan","less than":"minder dan","lower priority":"lagere prioriteit","lowest priority":"laagste prioriteit",magic:ZG,milliseconds:QG,minutes:eV,ms:tV,nadir:sV,nauticalDawn:oV,nauticalDusk:iV,nextSunrise:nV,nextSunset:rV,night:aV,nightEnd:lV,"no blocks found":"Geen blokken gevonden","no group":"GEEN GROEP",normal:cV,"normal priority":"normale prioriteit","not equal to":"niet gelijk aan","not properly connected":"Dit blok is niet correct verbonden met andere blokken.",offset:uV,"on change":"bij verandering","on condition change":"op voorwaarde verandering","on update":"bij update",one:dV,or:hV,quiet:pV,"reset search":"reset zoeken",search:gV,seconds:mV,solarNoon:fV,"store in":"opslaan in",sunrise:$V,sunriseEnd:bV,sunset:vV,sunsetStart:yV,then:_V,"toggle value":"schakelwaarde",tooltip_ack:wV,tooltip_from:kV,tooltip_lc:CV,tooltip_quality:TV,tooltip_ts:SV,tooltip_user:EV,tooltip_value:IV,true:"waar",two:xV,undefined:"ongedefinieerd",update:DV,"use seconds":"gebruik seconden","use trigger value":"triggerwaarde gebruiken",verbose_help:AV,verbose_label:OV,when:RV,with:"met","with date":"met datum","with offset":"met offset",wizard:NV,"Loading models...":"Modellen laden...","Could not connect to API at %s":"Kan geen verbinding maken met API op %s","Invalid API key":"Ongeldige API-sleutel","Access denied by API":"Toegang geweigerd door API","API error: %s":"API-fout: %s",'Model "%s" not found':'Model "%s" niet gevonden',"Request failed: %s":"Verzoek mislukt: %s",Retry:MV,"No running javascript instance found":"Geen draaiende JavaScript-instantie gevonden"},PV="Potwierdzony",BV="Działania",FV="Dodaj",jV="Wszystko",zV="Każdy",UV="Zastosuj",HV="Kwiecień",WV="Zapytać",GV="Astronomiczny",VV="Sierpień",KV="Odwołaj",YV="Zamknij",JV="Stan",qV="Warunki",XV="Konsola",ZV="Skopiowano",QV="Grudzień",e4="Domyślna",t4="Opóźnienie",s4="Usuń",o4="Opis",i4="Gotowe",n4="Uruchom shell",r4="Wyjaśnienie",a4="Eksport",l4="Luty",c4="Luty",u4="Filtr",d4="Folder",h4="Pt",p4="Piątek",g4="ID",m4="ID1",f4="ID2",$4="Import",b4="Instancja",v4="Instancje",y4="Instrukcje",_4="Styczeń",w4="Styczeń",k4="Lipiec",C4="Czerwiec",T4="Limit",S4="Marzec",E4="Maj",I4="Menu",x4="Wiadomość",D4="Po",A4="Model",O4="Poniedziałek",R4="Miesiąc",N4="Więcej",M4="Nazwa",L4="Listopad",P4="OK",B4="Październik",F4="Ok",j4="Pauza",z4="Pushover",U4="Pushsafer",H4="Przemianuj",W4="Powtórz",G4="Uruchom ponownie",V4="Wynik",K4="So",Y4="Sobota",J4="Zapisz",q4="Harmonogram",X4="Skrypt",Z4="Wrzesień",Q4="Symulacja",e8="Stos",t8="Początek",s8="Stan",o8="Nd",i8="Niedziela",n8="Telegram",r8="Cz",a8="Czwartek",l8="Czas",c8="Wyzwolony",u8="Wyzwalacze",d8="Wt",h8="Wtorek",p8="URL",g8="Wartość",m8="Wolumen",f8="Śr",$8="Środa",b8="Pisać",v8="Tak",y8="potwierdzenie",_8="wszystko",w8="i",k8="Astro",C8="w",T8="kontrola",S8="Kopiuj",E8="CRON",I8="Świt",x8="Jest to specjalny tryb, w którym stany i obiekty się nie zmieniają. Jednak w protokole będą wyświetlane tylko informacje o każdej planowanej zmianie.",D8="Odpluskwić",A8="Zmierzch",O8="łatwy",R8="każdy",N8="Funkcja",M8="ID",L8="Nazwa",P8="Rola",B8="Pokój",F8="Złota godzina",j8="Koniec złotej godziny",z8="Kod zostanie wykonany tylko za każdym razem, gdy warunek będzie spełniony. Na przykład. jeśli wyzwalanie na wartość czujnika temperatury i warunek to „jeśli temperatura jest wyższa niż 20 ° C”, to działania „następnie” będą wykonywane za każdym razem, gdy czujnik wyśle temperaturę i jest powyżej 20 ° C. O 21 ° C, o 22 ° C i tak dalej.",U8="Kod zostanie wykonany tylko wtedy, gdy wynik warunku ulegnie zmianie. Na przykład. jeśli wyzwalanie na wartość czujnika temperatury i warunek „jeśli temperatura jest wyższa niż 20 ° C”, to akcje „następnie” zostaną wykonane raz, gdy temperatura przekroczy 20. Następnym razem działania „następnie” zostaną wykonane, gdy temperatura nie udaje się poniżej 20, a następnie ponownie wzrasta powyżej 20.",H8="godziny",W8="zawiera",G8="interwał",V8="magia",K8="milisekund",Y8="minuty",J8="ms",q8="Północ słoneczna",X8="Żeglarski świt",Z8="Żeglarski zmierzch",Q8="Następny wschód słońca",e6="Następny zachód słońca",t6="Noc",s6="Koniec nocy",o6="normalny",i6="przesunięcie",n6="jeden",r6="lub",a6="cisza",l6="Szukaj",c6="sekundy",u6="Południe słoneczne",d6="Wschód słońca",h6="Koniec wschodu słońca",p6="Zachód słońca",g6="Początek zachodu słońca",m6="następnie",f6="Akceptuj",$6="Od",b6="Ostatnia zmiana",v6="Jakość",y6="Znacznik czasu",_6="Użytkownik",w6="Wartość",k6="dwa",C6="aktualizacja",T6="Dodaje wyniki debugowania do dziennika dla wielu poleceń systemowych",S6="Pełne dane wyjściowe dziennika",E6="gdy",I6="Wizard",x6="Ponów próbę",D6={"%s not found":"%s nie znaleziono","()":"()","(at %s)":"(w %s)","(optional)":"(opcjonalny)","-":"-",".":".","AI code generator":"Generator kodu AI",Ack:PV,Actions:BV,"Actual time of day":"Aktualna pora dnia",Add:FV,"Add new script":"Dodaj nowy skrypt",All:jV,"All files will be accepted":"Wszystkie pliki zostaną zaakceptowane",Any:zV,"Any month":"Dowolny miesiąc",Apply:UV,April:HV,"Are you sure?":"Jesteś pewny?",Ask:WV,Astronomical:GV,"Astronomical events today":"Wydarzenia astronomiczne dzisiaj",August:VV,"Blockly description":"Tworzenie reguł za pomocą bloków graficznych","Body:":"Treść:",Cancel:KV,"Cannot delete non empty item!":"Nie można usunąć niepustego elementu!","Change layout":"Zmiana układu",'Change theme (actual "%s")':"Zmień motyw (obecnie - „%s”)","Check blocks":"Sprawdź bloki","Check is not active, because javascript adapter is disabled":"Sprawdzanie nie jest aktywne, ponieważ adapter Javascript jest wyłączony","Clear search input":"Wyczyść dane wyszukiwania","Click on this icon":"Kliknij tę ikonę",Close:YV,"Close all but current":"Zamknij wszystkie oprócz bieżących","Collapse all":"Zwinąć wszystkie","Compares current time with astronomical event":"Porównuje aktualny czas z wydarzeniem astronomicznym","Compares current time with the user specific time":"Porównuje aktualny czas z czasem określonym przez użytkownika","Compares the state value with user defined value":"Porównuje wartość stanu z wartością zdefiniowaną przez użytkownika",Condition:JV,Conditions:qV,"Configuration not saved.":"Konfiguracja nie została zapisana.",Console:XV,"Control or update some state":"Kontroluj lub aktualizuj stan","Control or update some state with delay":"Kontroluj lub aktualizuj jakiś stan z opóźnieniem","Convert blockly to javascript for ever.":"Bezpowrotna konwersja Blockly na Javascript.",Copied:ZV,"Copy script":"Skopiuj skrypt","Copy to clipboard":"Skopiuj do schowka","Create new":"Utwórz nowy","Create new folder":"Utwórz nowy folder","Create new script":"Utwórz nowy skrypt","Create or edit CRON or time wizard":"Utwórz lub edytuj CRON lub kreator czasu","Dark Theme":"Ciemny schemat","Dark style":"Ciemny styl",Date:"Data","Debug instance":"Debuguj instancję","Debug options":"Opcje debugowania",December:QV,Default:e4,"Define cron...":"Zdefiniuj CRON ...","Define schedule...":"Zdefiniuj harmonogram ...",Delay:t4,Delete:s4,"Delete %s":"Usuń %s ...","Delete folder":"Usuń folder","Delete script":"Usuń skrypt",Description:o4,"Deselect all":"Odznacz wszystkie","Discard changes for %s":"Odrzuć zmiany dla %s",Done:i4,"Double click to write value":"Kliknij dwukrotnie, aby zapisać wartość","Download as file":"Download jako plik plik","Drop some files here or click...":"Upuść niektóre pliki tutaj lub kliknij ...","Duplicate name":"Duplikat nazwy","Edit script or just double click":"Edytuj skrypt lub po prostu kliknij dwukrotnie","Empty name is not allowed":"Pusta nazwa jest niedozwolona","End search mode":"Zakończ tryb wyszukiwania","Enter your question":"Wpisz swoją prośbę",Error:"Błąd","Error formatting code":"Błąd formatowania kodu","Error was found":"Błąd został znaleziony","Every day":"Codziennie",Exec:n4,"Executes some shell command":"Wykonuje polecenie powłoki","Existing scripts will be overwritten.":"Istniejące skrypty zostaną zastąpione.","Expand all":"Rozwiń wszystkie","Expert mode":"Tryb ekspercki",Explanation:r4,Export:a4,"Export all scripts":"Wyeksportuj wszystkie skrypty","Export blocks":"Eksportuj bloki","Export selected blocks":"Eksportuj wybrane bloki",Februar:l4,February:c4,Filter:u4,Folder:d4,Fr:h4,Friday:p4,Function:"Funkcja","Function editor":"Edytor funkcji","Function: executed":"Funkcja: wykonywana","Go to next line":"Przejdź do następnej linii","HTTP Call":"Połączenie HTTP","Hide logs":"Ukryj dzienniki",ID:g4,ID1:m4,ID2:f4,Import:$4,"Import blocks":"Importuj bloki","Import error":"Błąd importowania","Import scripts":"Importuj skrypty","Insert object ID":"Wstaw identyfikator obiektu",Instance:b4,"Instance is disabled":"Instancja jest wyłączona","Instance:":"Instancja:",Instances:v4,Instructions:y4,"Invalid CRON":"Nieprawidłowy CRON","It will not be possible to revert this operation.":"Cofnięcie tej operacji nie będzie możliwe.","JS description":"Tworzenie reguł w Javascript",Januar:_4,January:w4,July:k4,June:C4,"Just check":"Po prostu sprawdź","Language:":"Język:","Learn More":"Ucz się więcej","Light style":"Lekki styl",Limit:T4,"Local time":"Czas lokalny","Locate file":"Znajdź plik","Log outputs":"Log dziennika","Log text":"Tekst dziennika","Log: %s":"Dziennik: %s","Make a HTTP get request":"Złóż żądanie HTTP get","Make a pause between actions":"Zrób przerwę między czynnościami",March:S4,"March ":"Marzec ",May:E4,Menu:I4,Message:x4,Mo:D4,Model:A4,Monday:O4,Month:R4,More:N4,Name:M4,"No API key found":"Nie znaleziono klucza API","No Chat GPT Key found":"Nie znaleziono klucza GPT czatu","No active host found":"Nie znaleziono aktywnego hosta","Nothing found":"Nic nie znaleziono",November:L4,OK:P4,October:B4,Ok:F4,"On condition change":"W przypadku zmiany warunków","On script save or adapter start":"Podczas zapisywania skryptu lub uruchamiania adaptera","On weekdays":"W dni powszednie","Open configuration":"Otwarta konfiguracja","Operate two states":"Obsługuj dwa stany","Operations with two states":"Operacje z dwoma stanami","Paste your blocks here":"Wklej tutaj swoje bloki",Pause:j4,"Pause execution":"Wstrzymaj wykonanie","Pause script":"Wstrzymaj skrypt","Phone:":"Telefon:","Please select object ID...":"Wybierz identyfikator obiektu ...","Press Ctrl+Enter to get the answer":"Naciśnij klawisze Ctrl+Enter, aby uzyskać odpowiedź","Prettify the script":"Upiększ skrypt","Print some text in log":"Wydrukuj tekst w dzienniku","Priority:":"Priorytet:",Pushover:z4,Pushsafer:U4,"Read only ID selected: %s":"Wybrano identyfikator tylko do odczytu: %s",Rename:H4,"Reorder scripts in folders":"Zmień kolejność skryptów w folderach",Repeat:W4,Restart:G4,Result:V4,"Resume execution":"Wznów wykonanie","Root folder":"Folder główny","Rules description":"Twórz reguły z blokami IF, THEN, ELSE","Run script":"Uruchom skrypt",Sa:K4,Saturday:Y4,Save:J4,"Save all":"Zapisz wszystko","Say It":"Wypowiedz","Say some text via sayit adapter":"Powiedz tekst przez adapter sayit",Schedule:q4,Script:X4,"Script %s was modified on disk":"Skrypt %s został zmodyfikowany na dysku","Script is not running":"Skrypt nie działa","Search in scripts":"Szukaj w skryptach","Search...":"Szukaj...","Select all":"Zaznacz wszystko","Send email":"Wysłać email","Sends an email":"Wysyła e-mail","Sends message via Pushsafer":"Wysyła wiadomość przez Pushsafer","Sends message via pushover":"Wysyła wiadomość przez pushover","Sends message via telegram":"Wysyła wiadomość telegramem","Sends message via whatsapp-cmb":"Wysyła wiadomość przez WhatsApp-cmb",September:Z4,"Server time":"Czas serwera","Set state action":"Ustaw stan działania","Set with delay":"Ustaw z opóźnieniem","Shell command":"Polecenie powłoki","Show astronomical events":"Pokaż wydarzenia astronomiczne","Show javascript code":"Pokaż kod JavaScript","Show logs":"Pokaż dzienniki","Show only paused scripts":"Pokaż tylko wstrzymane skrypty","Show only running scripts":"Pokaż tylko działające skrypty","Show only scripts with problems":"Pokaż tylko skrypty z problemami",Simulate:Q4,"Some files will be rejected":"Niektóre pliki zostaną odrzucone","Sound:":"Dźwięk:",Stack:e8,Start:t8,"Start script":"Uruchom skrypt",State:s8,"State condition":"Warunek stanu","Step into function":"Wejdź do funkcji","Step out from function":"Wyjdź z funkcji","Stop on exception":"Zatrzymaj się na wyjątku",Su:o8,"Subject:":"Temat:",Sunday:i8,"TS description":"Tworzenie reguł w Typescript",Telegram:n8,"Text:":"Tekst:",Th:r8,"The script will be stopped and must be activated manually after debugging. Continue?":"Skrypt zostanie zatrzymany i należy go aktywować ręcznie po debugowaniu. Kontyntynuj?","This is advances option. You can write your own code here and it will be executed on trigger":"To jest opcja zaawansowana. Możesz tutaj napisać własny kod, który zostanie wykonany po wyzwoleniu",Thursday:a8,Time:l8,"Time condition":"Warunek czasowy","Title:":"Tytuł:","To:":"Do:","Trigger with value":"Wyzwalacz z wartością",Triggered:c8,Triggers:u8,"Triggers the on script saving or the javascript instance restart":"Uruchamia zapisywanie skryptu lub restart instancji javascript","Triggers the rule on update or change of some state":"Uruchamia regułę przy aktualizacji lub zmianie jakiegoś stanu","Triggers the rule periodically or on some specific time":"Uruchamia regułę okresowo lub w określonym czasie",Tu:d8,Tuesday:h8,URL:p8,"Unknown error":"Nieznany błąd","Unknown error!":"Nieznany błąd!","Use generated code":"Użyj wygenerowanego kodu","User function":"Funkcja użytkownika","User:":"Użytkownik:",Value:g8,"Vibration:":"Wibracja:",Volume:m8,We:f8,Wednesday:$8,"Whatsapp-cmb":"Whatsapp-cmb",Write:b8,"Write your own code":"Napisz swój własny kod",Yes:v8,"Yet exists!":"A jednak istnieje!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Możesz użyć %s w adresie URL, aby użyć bieżącej wartości wyzwalacza, %id, aby użyć wyzwalanego identyfikatora obiektu, %name, aby wyświetlić nazwę identyfikatora wyzwalanego obiektu, lub %old, aby użyć starej wartości wyzwalacza","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Możesz użyć %s w poleceniu, aby użyć bieżącej wartości wyzwalającej, %id, aby użyć identyfikatora wyzwalanego obiektu, %name, aby wyświetlić nazwę identyfikatora wyzwalanego obiektu, lub %old, aby użyć starej wartości wyzwalającej","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Możesz użyć %s w tekście, aby wyświetlić aktualną wartość wyzwalającą, %id, aby użyć identyfikatora wyzwolonego obiektu, %name, aby wyświetlić nazwę identyfikatora wyzwolonego obiektu lub %old, aby użyć starej wartości wyzwalającej","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Możesz użyć %s w wartości, aby użyć bieżącej wartości wyzwalacza, %id, aby użyć identyfikatora wyzwalanego obiektu, %name, aby wyświetlić nazwę identyfikatora wyzwalanego obiektu, lub %old, aby użyć starej wartości wyzwalacza","You have to enter OpenAI API key in the configuration of javascript adapter.":"Należy wprowadzić klucz OpenAI API w konfiguracji adaptera javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Musisz wprowadzić co najmniej jeden klucz API (OpenAI, Anthropic lub Gemini) w konfiguracji adaptera javascript.","Please select a valid model":"Wybierz prawidłowy model","[equal]":"[równy]","[greater or equal]":"[większe lub równe]","[greater]":"[większe]","[hysteresis]":"[histereza]","[includes]":"[obejmuje]","[less or equal]":"[mniejsze lub równe]","[less]":"[mniejsze]","[not equal]":"[nie równe]",acknowledgment:y8,all:_8,and:w8,"as JSON":"jako JSON","as plain text":"jako zwykły tekst",astro:k8,at:C8,"clear running":"czyste uruchomienie",control:T8,copy:S8,cron:E8,dawn:I8,debug_help:x8,debug_label:D8,default:"domyślna",dusk:A8,easy:O8,else:"inaczej","equal to":"równy",every:R8,"every hour at 0 minutes":"co godzinę po 0 minutach",false:"fałsz","file reading has failed: %s":"odczyt pliku nie powiódł się: %s","file reading was aborted":"odczyt pliku został przerwany",filter_func:N8,filter_id:M8,filter_name:L8,filter_role:P8,filter_room:B8,"for edit or create script":"do edycji lub utwórz nowy skrypt","for professionals":"dla profesjonalistów","for programmers":"dla programistów",goldenHour:F8,goldenHourEnd:j8,"greater or equal":"większe lub równe","greater or equal to":"więcej lub równo","greater than":"więcej niż",help_just_check:z8,help_on_change:U8,"high priority":"wysoki priorytet","high-priority":"wysoki priorytet","highest priority":"najwyższy priorytet",hours:H8,includes:W8,interval:G8,"just check":"po prostu sprawdź","less or equal":"mniejsze lub równe","less or equal to":"mniej lub równo","less than":"mniej niż","lower priority":"niższy priorytet","lowest priority":"najniższy priorytet",magic:V8,milliseconds:K8,minutes:Y8,ms:J8,nadir:q8,nauticalDawn:X8,nauticalDusk:Z8,nextSunrise:Q8,nextSunset:e6,night:t6,nightEnd:s6,"no blocks found":"Nie znaleziono bloków","no group":"BRAK GRUPY",normal:o6,"normal priority":"normalny priorytet","not equal to":"nie równa się","not properly connected":"Ten blok nie jest poprawnie podłączony do innych bloków.",offset:i6,"on change":"na zmianę","on condition change":"pod warunkiem zmiany warunków","on update":"po aktualizacji",one:n6,or:r6,quiet:a6,"reset search":"zresetuj wyszukiwanie",search:l6,seconds:c6,solarNoon:u6,"store in":"przechowaj w",sunrise:d6,sunriseEnd:h6,sunset:p6,sunsetStart:g6,then:m6,"toggle value":"wartość przełączania",tooltip_ack:f6,tooltip_from:$6,tooltip_lc:b6,tooltip_quality:v6,tooltip_ts:y6,tooltip_user:_6,tooltip_value:w6,true:"prawda",two:k6,undefined:"nieokreślony",update:C6,"use seconds":"użyj sekund","use trigger value":"użyj wartości wyzwalającej",verbose_help:T6,verbose_label:S6,when:E6,with:"z","with date":"z datą","with offset":"z przesunięciem",wizard:I6,"Loading models...":"Ładowanie modeli...","Could not connect to API at %s":"Nie można połączyć się z API pod adresem %s","Invalid API key":"Nieprawidłowy klucz API","Access denied by API":"Odmowa dostępu przez API","API error: %s":"Błąd API: %s",'Model "%s" not found':'Model "%s" nie znaleziony',"Request failed: %s":"Żądanie nie powiodło się: %s",Retry:x6,"No running javascript instance found":"Nie znaleziono uruchomionej instancji JavaScript"},A6="Reconhecido",O6="Ações",R6="Adicionar",N6="Todos",M6="Nenhum",L6="Aplique",P6="abril",B6="Perguntar",F6="Astronômico",j6="agosto",z6="Cancelar",U6="Fechar",H6="Doença",W6="Condições",G6="Console",V6="Copiado",K6="dezembro",Y6="Predefinição",J6="Atraso",q6="Deletar",X6="Descrição",Z6="Pronto",Q6="Exec shell",e9="Explicação",t9="Exportação",s9="Februar",o9="fevereiro",i9="Filtro",n9="Pasta",r9="Fr",a9="Sexta-feira",l9="ID",c9="ID1",u9="ID2",d9="Importar",h9="Instância",p9="Instâncias",g9="Instruções",m9="Januar",f9="janeiro",$9="julho",b9="junho",v9="Limite",y9="março",_9="maio",w9="Menu",k9="mensagem",C9="Mo",T9="Modelo",S9="Segunda-feira",E9="Mês",I9="Mais",x9="Nome",D9="novembro",A9="OK",O9="outubro",R9="Ok",N9="Pausa",M9="Pushover",L9="Pushsafer",P9="Renomear",B9="Repetir",F9="Reiniciar",j9="Resultado",z9="Sá",U9="Sábado",H9="Salve",W9="Cronograma",G9="Script",V9="setembro",K9="Simular",Y9="Pilha",J9="Começar",q9="Estado",X9="Su",Z9="Domingo",Q9="Telegrama",eK="4",tK="Quinta-feira",sK="Tempo",oK="Provocado",iK="Gatilhos",nK="Tu",rK="terça",aK="URL",lK="Valor",cK="Volume",uK="3",dK="quarta",hK="Escrever",pK="sim",gK="reconhecimento",mK="todos",fK="e",$K="astro",bK="no",vK="ao controle",yK="copiar",_K="CRON",wK="alvorecer",kK="Este é um modo especial no qual estados e objetos não serão alterados. Mas apenas as informações sobre cada mudança planejada serão exibidas no protocolo.",CK="Depurar",TK="Crepúsculo",SK="fácil",EK="cada",IK="Função",xK="ID",DK="Nome",AK="Tipo",OK="Quarto",RK="Hora dourada",NK="Fim da hora de ouro",MK='O código será executado apenas sempre que a condição for verdadeira. Por exemplo. se disparar no valor do sensor de temperatura e a condição for "se a temperatura for maior que 20 ° C", as ações "então" serão executadas toda vez que o sensor enviar a temperatura e ela estiver acima de 20 ° C. Por 21 ° C, por 22 ° C e assim por diante.',LK='O código será executado apenas se o resultado da condição mudar. Por exemplo. se disparar no valor do sensor de temperatura e a condição for "se a temperatura for maior que 20 ° C", as ações "então" serão executadas uma vez quando a temperatura estiver acima de 20. Na próxima vez, as ações "então" serão executadas quando a temperatura falha abaixo de 20 e sobe acima de 20 novamente.',PK="horas",BK="inclui",FK="intervalo",jK="Magia",zK="milissegundos",UK="minutos",HK="ms",WK="nadir",GK="Madrugada náutica",VK="Crepúsculo náutico",KK="próximo nascer do sol",YK="Próximo pôr do sol",JK="Noite",qK="Fim de noite",XK="normal",ZK="Deslocamento",QK="1",e7="ou",t7="quieto",s7="procurar",o7="segundos",i7="Meio-dia solar",n7="nascer do sol",r7="Fim do nascer do sol",a7="pôr do sol",l7="Começo do pôr do sol",c7="então",u7="reconhecer",d7="de",h7="Última alteração",p7="Qualidade",g7="timestamp",m7="usuário",f7="valor",$7="dois",b7="atualizar",v7="Adiciona saída de depuração ao log para muitos comandos do sistema",y7="Saídas de log detalhadas",_7="quando",w7="Wizard",k7="Tentar novamente",C7={"%s not found":"%s não encontrado","()":"()","(at %s)":"(em %s)","(optional)":"(opcional)","-":"-",".":".","AI code generator":"Gerador de código de IA",Ack:A6,Actions:O6,"Actual time of day":"Hora real do dia",Add:R6,"Add new script":"Adicionar novo script",All:N6,"All files will be accepted":"Todos os arquivos serão aceitos",Any:M6,"Any month":"Qualquer mês",Apply:L6,April:P6,"Are you sure?":"Você tem certeza?",Ask:B6,Astronomical:F6,"Astronomical events today":"Eventos astronômicos hoje",August:j6,"Blockly description":"Criando regras por blocos gráficos","Body:":"Corpo:",Cancel:z6,"Cannot delete non empty item!":"Não pode ser deletar, porque não está vazio!","Change layout":"Alterar layout",'Change theme (actual "%s")':'Alterar tema (agora - "%s")',"Check blocks":"Verificar blocos","Check is not active, because javascript adapter is disabled":"A verificação de sintaxe não está ativa porque o adaptador javascript não está rodando.","Clear search input":"Limpar entrada de pesquisa","Click on this icon":"Clique neste ícone",Close:U6,"Close all but current":"Fechar tudo, menos atual","Collapse all":"Recolher todos","Compares current time with astronomical event":"Compara o tempo atual com o evento astronômico","Compares current time with the user specific time":"Compara a hora atual com a hora específica do usuário","Compares the state value with user defined value":"Compara o valor do estado com o valor definido pelo usuário",Condition:H6,Conditions:W6,"Configuration not saved.":"Configuração não esta salva.",Console:G6,"Control or update some state":"Controlar ou atualizar algum estado","Control or update some state with delay":"Controlar ou atualizar algum estado com atraso","Convert blockly to javascript for ever.":"Converter Blockly em Javascript permanentemente.",Copied:V6,"Copy script":"Copiar script","Copy to clipboard":"Copiar para área de transferência","Create new":"Crie um novo","Create new folder":"Criar nova pasta","Create new script":"Criar novo script","Create or edit CRON or time wizard":"Criar ou editar o assistente cron ou o assistente de horário","Dark Theme":"Layout escuro","Dark style":"Estilo escuro",Date:"Encontro","Debug instance":"Instância de depuração","Debug options":"Opções de depuração",December:K6,Default:Y6,"Define cron...":"Definir cron...","Define schedule...":"Definir agendamento ...",Delay:J6,Delete:q6,"Delete %s":"Deletar %s...","Delete folder":"Deletar pasta","Delete script":"Deletar script",Description:X6,"Deselect all":"Desmarcar todos","Discard changes for %s":"Descartar alterações para %s",Done:Z6,"Double click to write value":"Clique duas vezes para escrever o valor","Download as file":"Baixar como arquivo","Drop some files here or click...":"Solte alguns arquivos aqui ou clique em...","Duplicate name":"Nome duplicado","Edit script or just double click":"Edite o script ou clique duas vezes","Empty name is not allowed":"Nome vazio não é permitido","End search mode":"Finalizar modo de pesquisa","Enter your question":"Digite sua solicitação",Error:"Erro","Error formatting code":"Erro de formatação de código","Error was found":"Erro foi encontrado","Every day":"Todos os dias",Exec:Q6,"Executes some shell command":"Executa algum comando shell","Existing scripts will be overwritten.":"Os scripts existentes serão substituídos.","Expand all":"Expandir todos","Expert mode":"Modo de especialista",Explanation:e9,Export:t9,"Export all scripts":"Exportar todos os scripts","Export blocks":"Exportar blocos","Export selected blocks":"Exportar blocos selecionados",Februar:s9,February:o9,Filter:i9,Folder:n9,Fr:r9,Friday:a9,Function:"Função","Function editor":"Editor de funções","Function: executed":"Função: executado","Go to next line":"Vá para a próxima linha","HTTP Call":"Chamada HTTP","Hide logs":"Ocultar logs",ID:l9,ID1:c9,ID2:u9,Import:d9,"Import blocks":"Importar blocos","Import error":"Erro de importação","Import scripts":"Importar script","Insert object ID":"Inserir ID do objeto",Instance:h9,"Instance is disabled":"Instância está desativada","Instance:":"Instância:",Instances:p9,Instructions:g9,"Invalid CRON":"CRON inválido","It will not be possible to revert this operation.":"Não será possível reverter esta operação.","JS description":"Criando regras escrevendo Javascript",Januar:m9,January:f9,July:$9,June:b9,"Just check":"Apenas verifique","Language:":"Língua:","Learn More":"Aprender mais","Light style":"Estilo claro",Limit:v9,"Local time":"Hora local","Locate file":"Localize o arquivo","Log outputs":"Saídas de log","Log text":"Texto de registro","Log: %s":"Log: %s","Make a HTTP get request":"Faça uma solicitação HTTP get","Make a pause between actions":"Faça uma pausa entre as ações",March:y9,"March ":"Março",May:_9,Menu:w9,Message:k9,Mo:C9,Model:T9,Monday:S9,Month:E9,More:I9,Name:x9,"No API key found":"Nenhuma chave API encontrada","No Chat GPT Key found":"Nenhuma chave GPT de bate-papo encontrada","No active host found":"Nenhum host ativo encontrado","Nothing found":"Nada encontrado",November:D9,OK:A9,October:O9,Ok:R9,"On condition change":"Na mudança de condição","On script save or adapter start":"Ao salvar o script ou iniciar o adaptador","On weekdays":"Nos dias úteis","Open configuration":"Configuração aberta","Operate two states":"Operar dois estados","Operations with two states":"Operações com dois estados","Paste your blocks here":"Cole seus blocos aqui",Pause:N9,"Pause execution":"Pausar a execução","Pause script":"Pausar script","Phone:":"Telefone:","Please select object ID...":"Selecione o ID do objeto...","Press Ctrl+Enter to get the answer":"Pressione Ctrl+Enter para obter a resposta","Prettify the script":"Embeleze o roteiro","Print some text in log":"Imprimir algum texto no log","Priority:":"Prioridade:",Pushover:M9,Pushsafer:L9,"Read only ID selected: %s":"ID somente leitura selecionada: %s",Rename:P9,"Reorder scripts in folders":"Reordenar scripts em pastas",Repeat:B9,Restart:F9,Result:j9,"Resume execution":"Retomar execução","Root folder":"Pasta principal","Rules description":"Crie regras com blocos IF, THEN, ELSE","Run script":"Executar script",Sa:z9,Saturday:U9,Save:H9,"Save all":"Salvar tudo","Say It":"Say It","Say some text via sayit adapter":"Diga algum texto através do adaptador sayit",Schedule:W9,Script:G9,"Script %s was modified on disk":'O script "%s" foi modificado no disco rígido',"Script is not running":"Script não está sendo executado","Search in scripts":"Pesquisa em scripts","Search...":"Procurar...","Select all":"Selecionar tudo","Send email":"Enviar email","Sends an email":"Envia um email","Sends message via Pushsafer":"Envia mensagem via Pushsafer","Sends message via pushover":"Envia mensagem via pushover","Sends message via telegram":"Envia mensagem via telegrama","Sends message via whatsapp-cmb":"Envia mensagem via whatsapp-cmb",September:V9,"Server time":"Tempo de servidor","Set state action":"Definir ação de estado","Set with delay":"Definido com atraso","Shell command":"Comando shell","Show astronomical events":"Mostrar eventos astronômicos","Show javascript code":"Mostrar código Javascript","Show logs":"Mostrar logs","Show only paused scripts":"Mostrar apenas scripts pausados","Show only running scripts":"Mostrar apenas scripts em execução","Show only scripts with problems":"Mostrar apenas scripts com problemas",Simulate:K9,"Some files will be rejected":"Alguns arquivos serão rejeitados","Sound:":"Som:",Stack:Y9,Start:J9,"Start script":"Iniciar script",State:q9,"State condition":"Condição de estado","Step into function":"Entre na função","Step out from function":"Saia da função","Stop on exception":"Pare na exceção",Su:X9,"Subject:":"Sujeito:",Sunday:Z9,"TS description":"Criando regras escrevendo Typecript",Telegram:Q9,"Text:":"Texto:",Th:eK,"The script will be stopped and must be activated manually after debugging. Continue?":"O script será interrompido e deve ser ativado manualmente após a depuração. Continuar?","This is advances option. You can write your own code here and it will be executed on trigger":"Esta é a opção de avanços. Você pode escrever seu próprio código aqui e ele será executado no gatilho",Thursday:tK,Time:sK,"Time condition":"Condição de tempo","Title:":"Título:","To:":"Para:","Trigger with value":"Trigger com valor",Triggered:oK,Triggers:iK,"Triggers the on script saving or the javascript instance restart":"Aciona o salvamento do script ou a reinicialização da instância javascript","Triggers the rule on update or change of some state":"Aciona a regra na atualização ou mudança de algum estado","Triggers the rule periodically or on some specific time":"Aciona a regra periodicamente ou em algum momento específico",Tu:nK,Tuesday:rK,URL:aK,"Unknown error":"Erro desconhecido","Unknown error!":"Erro desconhecido!","Use generated code":"Usar código gerado","User function":"Função do usuário","User:":"Do utilizador:",Value:lK,"Vibration:":"Vibração:",Volume:cK,We:uK,Wednesday:dK,"Whatsapp-cmb":"Whatsapp-cmb",Write:hK,"Write your own code":"Escreva seu próprio código",Yes:pK,"Yet exists!":"Ainda existe!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Você pode usar %s na URL para usar o valor do gatilho atual, %id para usar o ID do objeto acionado, %name para mostrar o nome do ID do objeto acionado ou %old para usar o valor do gatilho antigo","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Você pode usar %s no comando para usar o valor do acionador atual, %id para usar o ID do objeto acionado, %name para mostrar o nome do ID do objeto acionado ou %old para usar o valor do acionador antigo","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Você pode usar %s no texto para exibir o valor do acionador atual, %id para usar o ID do objeto acionado, %name para mostrar o nome do ID do objeto acionado ou %old para usar o valor do acionador antigo","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Você pode usar %s no valor para usar o valor do acionador atual, %id para usar o ID do objeto acionado, %name para mostrar o nome do ID do objeto acionado ou %old para usar o valor do acionador antigo","You have to enter OpenAI API key in the configuration of javascript adapter.":"Você deve inserir a chave da API OpenAI na configuração do adaptador javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Você deve inserir pelo menos uma chave API (OpenAI, Anthropic ou Gemini) na configuração do adaptador javascript.","Please select a valid model":"Selecione um modelo válido","[equal]":"[igual]","[greater or equal]":"[maior ou igual]","[greater]":"[maior]","[hysteresis]":"[histerese]","[includes]":"[inclui]","[less or equal]":"[menor ou igual]","[less]":"[menos]","[not equal]":"[não igual]",acknowledgment:gK,all:mK,and:fK,"as JSON":"como JSON","as plain text":"como texto simples",astro:$K,at:bK,"clear running":"corrida limpa",control:vK,copy:yK,cron:_K,dawn:wK,debug_help:kK,debug_label:CK,default:"predefinição",dusk:TK,easy:SK,else:"outro","equal to":"igual a",every:EK,"every hour at 0 minutes":"a cada hora em 0 minutos",false:"falso","file reading has failed: %s":"a leitura do arquivo falhou: %s","file reading was aborted":"a leitura do arquivo foi abortada",filter_func:IK,filter_id:xK,filter_name:DK,filter_role:AK,filter_room:OK,"for edit or create script":"para editar ou criar um novo script","for professionals":"para profissionais","for programmers":"para programadores",goldenHour:RK,goldenHourEnd:NK,"greater or equal":"maior ou igual","greater or equal to":"maior ou igual a","greater than":"Maior que",help_just_check:MK,help_on_change:LK,"high priority":"prioridade máxima","high-priority":"prioridade máxima","highest priority":"Prioridade máxima",hours:PK,includes:BK,interval:FK,"just check":"Apenas verifique","less or equal":"menor ou igual","less or equal to":"menor ou igual a","less than":"Menor que","lower priority":"prioridade mais baixa","lowest priority":"prioridade mais baixa",magic:jK,milliseconds:zK,minutes:UK,ms:HK,nadir:WK,nauticalDawn:GK,nauticalDusk:VK,nextSunrise:KK,nextSunset:YK,night:JK,nightEnd:qK,"no blocks found":"Nenhum bloco encontrado","no group":"SEM GRUPO",normal:XK,"normal priority":"prioridade normal","not equal to":"não é igual a","not properly connected":"Este bloco não está conectado corretamente com outros blocos.",offset:ZK,"on change":"em mudança","on condition change":"na mudança de condição","on update":"em atualização",one:QK,or:e7,quiet:t7,"reset search":"redefinir pesquisa",search:s7,seconds:o7,solarNoon:i7,"store in":"armazenar em",sunrise:n7,sunriseEnd:r7,sunset:a7,sunsetStart:l7,then:c7,"toggle value":"valor de alternância",tooltip_ack:u7,tooltip_from:d7,tooltip_lc:h7,tooltip_quality:p7,tooltip_ts:g7,tooltip_user:m7,tooltip_value:f7,true:"verdade",two:$7,undefined:"Indefinido",update:b7,"use seconds":"use segundos","use trigger value":"use o gatilho",verbose_help:v7,verbose_label:y7,when:_7,with:"com","with date":"com data","with offset":"com deslocamento",wizard:w7,"Loading models...":"Carregando modelos...","Could not connect to API at %s":"Não foi possível conectar à API em %s","Invalid API key":"Chave API inválida","Access denied by API":"Acesso negado pela API","API error: %s":"Erro de API: %s",'Model "%s" not found':'Modelo "%s" não encontrado',"Request failed: %s":"Solicitação falhou: %s",Retry:k7,"No running javascript instance found":"Nenhuma instância JavaScript em execução encontrada"},T7="Подтверждение",S7="Действия",E7="Добавить",I7="Все",x7="Любая",D7="Применить",A7="Апрель",O7="Спросить",R7="Aстрономический",N7="Август",M7="Отмена",L7="Закрыть",P7="Условие",B7="Условия",F7="Приставка",j7="Скопировано",z7="Декабрь",U7="Дефолт",H7="Задержка",W7="Удалить",G7="Описание",V7="Готово",K7="Исполнить shell",Y7="Объяснение",J7="Экспорт",q7="Февраль",X7="Февраль",Z7="Фильтр",Q7="Папка",eY="Пт",tY="пятница",sY="ID",oY="ID1",iY="ID2",nY="Импорт",rY="Экземпляр",aY="Экземпляры",lY="Инструкции",cY="Январь",uY="Январь",dY="Июль",hY="Июнь",pY="Предел",gY="Март",mY="Май",fY="Меню",$Y="Сообщение",bY="Пн",vY="Модель",yY="понедельник",_Y="Месяц",wY="Более",kY="Имя",CY="Ноябрь",TY="Ок",SY="Октябрь",EY="Ok",IY="Пауза",xY="Pushover",DY="Pushsafer",AY="Переименовать",OY="Повторение",RY="Перезапустить",NY="Результат",MY="Сб",LY="суббота",PY="Сохранить",BY="Расписание",FY="скрипт",jY="Сентябрь",zY="Симулировать",UY="Stack",HY="Начинать",WY="Состояние",GY="Вс",VY="Воскресенье",KY="Telegram",YY="Чт",JY="Четверг",qY="Время",XY="Срабатывает",ZY="Триггеры",QY="Вт",eJ="вторник",tJ="URL",sJ="Значение",oJ="Громкость",iJ="Ср",nJ="среда",rJ="Напишите",aJ="Да",lJ="подтверждение",cJ="все",uJ="и",dJ="Астро",hJ="в",pJ="контроль",gJ="копия",mJ="CRON",fJ="Рассвет",$J="Это особый режим, в котором состояния и объекты не будут меняться. Но в протоколе будет отображаться только информация о каждом планируемом изменении.",bJ="Отлаживать",vJ="Сумерки",yJ="легкий",_J="каждые(ый)",wJ="Функция",kJ="ID",CJ="Название",TJ="Роль",SJ="Комната",EJ="Золотой час",IJ="Конец золотого часа",xJ="Код будет выполняться только каждый раз, когда условие истинно. Например. при срабатывании по значению датчика температуры и условию «если температура выше 20°C», действия «затем» будут выполняться каждый раз, когда датчик отправляет значение температуры, и оно превышает 20°C. На 21°С, на 22°С и так далее.",DJ="Код будет выполнен только в случае изменения результата условия. Например, при срабатывании по значению датчика температуры и условию «если температура больше 20°C», действия «затем» будут выполнены один раз, когда температура превысит 20°C. В следующий раз действия «затем» будут выполнены, когда температура опустится ниже 20°C, а затем снова поднимается выше 20°C.",AJ="час(ов)",OJ="содержит",RJ="интервал",NJ="магия",MJ="миллисекунды",LJ="минут(у)",PJ="мс",BJ="Надир",FJ="Морской рассвет",jJ="Морские сумерки",zJ="Следующий восход",UJ="Следующий закат",HJ="Ночь",WJ="Конец ночи",GJ="нормальный",VJ="сдвиг",KJ="один",YJ="или",JJ="тихий",qJ="поиск",XJ="секунд",ZJ="Солнечный полдень",QJ="Восход солнца",eq="Конец восхода",tq="Закат солнца",sq="Начало заката",oq="тогда",iq="Подтверждено",nq="От",rq="Последнее изменение",aq="Качественный",lq="Время",cq="Пользователь",uq="Значение",dq="два",hq="обновить",pq="Добавляет вывод отладки в журнал для многих системных команд.",gq="Подробный протокол",mq="если",fq="Мастер",$q="Повторить",bq={"%s not found":"%s не найден","()":"()","(at %s)":"(в %s)","(optional)":"(необязательный)","-":"-",".":".","AI code generator":"ИИ Генератор кода",Ack:T7,Actions:S7,"Actual time of day":"Фактическое время суток",Add:E7,"Add new script":"Добавить новый скрипт",All:I7,"All files will be accepted":"Все файлы будут приняты",Any:x7,"Any month":"В любой месяц",Apply:D7,April:A7,"Are you sure?":"Вы уверены?",Ask:O7,Astronomical:R7,"Astronomical events today":"Астрономические события сегодня",August:N7,"Blockly description":"Создание правил графическими блоками","Body:":"Тело:",Cancel:M7,"Cannot delete non empty item!":"Не удается удалить непустой элемент!","Change layout":"Изменить макет",'Change theme (actual "%s")':'Сменить тему (сейчас - "%s")',"Check blocks":"Проверить блоки","Check is not active, because javascript adapter is disabled":"Проверка неактивна, потому что адаптер Javascript отключен","Clear search input":"Очистить ввод","Click on this icon":"Нажмите на этот значок",Close:L7,"Close all but current":"Закрыть все кроме текущего","Collapse all":"Свернуть все","Compares current time with astronomical event":"Сравнивает текущее время с астрономическим событием","Compares current time with the user specific time":"Сравнивает текущее время с конкретным временем пользователя","Compares the state value with user defined value":"Сравнивает значение состояния с пользовательским значением",Condition:P7,Conditions:B7,"Configuration not saved.":"Конфигурация не сохранена.",Console:F7,"Control or update some state":"Контролировать или обновлять какое-то состояние","Control or update some state with delay":"Контролировать или обновлять какое-либо состояние с задержкой","Convert blockly to javascript for ever.":"Преобразовать blockly в Javascript навсегда.",Copied:j7,"Copy script":"Скопировать скрипт","Copy to clipboard":"Скопировать в буфер обмена","Create new":"Создать новый","Create new folder":"Создать новую папку","Create new script":"Создать новый скрипт","Create or edit CRON or time wizard":"Создание или редактирование CRON или мастера времени","Dark Theme":"Тёмная тема","Dark style":"Темный стиль",Date:"Дата","Debug instance":"Экземпляр отладки","Debug options":"Варианты отладки",December:z7,Default:U7,"Define cron...":"Задать правило ...","Define schedule...":"Задать расписание...",Delay:H7,Delete:W7,"Delete %s":"Удалить %s...","Delete folder":"Удалить папку","Delete script":"Удалить скрипт",Description:G7,"Deselect all":"Снять выбор со всех","Discard changes for %s":"Отменить изменения для %s",Done:V7,"Double click to write value":"Двойной щелчок для записи значения","Download as file":"Скачать как файл","Drop some files here or click...":"Перетыщите сюда файлы или нажмите ...","Duplicate name":"Повторяющееся имя","Edit script or just double click":"Редактировать скрипт или просто дважды щелкнуть","Empty name is not allowed":"Пустое имя не допускается","End search mode":"Закончить поиск","Enter your question":"Введи свою просьбу",Error:"Ошибка","Error formatting code":"Ошибка форматирования кода","Error was found":"Ошибка была найдена","Every day":"Каждый день",Exec:K7,"Executes some shell command":"Выполняет некоторую команду оболочки","Existing scripts will be overwritten.":"Существующие скрипты будут перезаписаны.","Expand all":"Открыть все","Expert mode":"Экспертный режим",Explanation:Y7,Export:J7,"Export all scripts":"Экспорт всех скриптов","Export blocks":"Экспортировать блоки","Export selected blocks":"Экспортировать выбранные блоки",Februar:q7,February:X7,Filter:Z7,Folder:Q7,Fr:eY,Friday:tY,Function:"Функция","Function editor":"Редактор функции","Function: executed":"Функция: выполнено","Go to next line":"Перейти к следующей строке","HTTP Call":"HTTP-вызов","Hide logs":"Скрыть журналы",ID:sY,ID1:oY,ID2:iY,Import:nY,"Import blocks":"Импортировать блоки","Import error":"Ошибка импорта","Import scripts":"Импорт скриптов","Insert object ID":"Вставить ID объекта",Instance:rY,"Instance is disabled":"Экземпляр отключен","Instance:":"Пример:",Instances:aY,Instructions:lY,"Invalid CRON":"Неправильный CRON","It will not be possible to revert this operation.":"Невозможно вернуть эту операцию.","JS description":"Создание правил путём написания Javascript",Januar:cY,January:uY,July:dY,June:hY,"Just check":"Просто проверить","Language:":"Язык:","Learn More":"Узнать больше","Light style":"Светлый стиль",Limit:pY,"Local time":"Местное время","Locate file":"Показать файл в дереве","Log outputs":"Журнал","Log text":"Текст журнала","Log: %s":"Журнал: %s","Make a HTTP get request":"Сделайте HTTP-запрос на получение","Make a pause between actions":"Сделайте паузу между действиями",March:gY,"March ":"Март ",May:mY,Menu:fY,Message:$Y,Mo:bY,Model:vY,Monday:yY,Month:_Y,More:wY,Name:kY,"No API key found":"API-ключ не найден","No Chat GPT Key found":"Ключ GPT для чата не найден","No active host found":"Активный host не найден","Nothing found":"Ничего не найдено",November:CY,OK:TY,October:SY,Ok:EY,"On condition change":"При изменении реузльтата условий","On script save or adapter start":"При сохранении скрипта или запуске адаптера","On weekdays":"По дням недели","Open configuration":"Открыть настройки","Operate two states":"Операции над двумя состояниями","Operations with two states":"Операции с двумя состояниями","Paste your blocks here":"Вставьте свои блоки сюда",Pause:IY,"Pause execution":"Приостановить выполнение","Pause script":"Остановить скрипт","Phone:":"Телефон:","Please select object ID...":"Пожалуйста, выберите ID объекта ...","Press Ctrl+Enter to get the answer":"Нажмите Ctrl+Enter, чтобы получить ответ","Prettify the script":"Украсьте сценарий","Print some text in log":"Напечатать текст в журнале","Priority:":"Приоритет:",Pushover:xY,Pushsafer:DY,"Read only ID selected: %s":"Выбран идентификатор только для чтения: %s",Rename:AY,"Reorder scripts in folders":"Сортировать скрипты в папках",Repeat:OY,Restart:RY,Result:NY,"Resume execution":"Возобновить выполнение","Root folder":"Корневая папка","Rules description":"Создавайте правила с блоками ЕСЛИ, ТО, ИНАЧЕ","Run script":"Запустить скрипт",Sa:MY,Saturday:LY,Save:PY,"Save all":"Сохранить все","Say It":"Say It","Say some text via sayit adapter":"Произнесите текст через адаптер Sayit",Schedule:BY,Script:FY,"Script %s was modified on disk":'Скрипт "%s" был изменен на диске',"Script is not running":"Сценарий не запущен","Search in scripts":"Поиск в скриптах","Search...":"Поиск...","Select all":"Выбрать все","Send email":"Отправить email","Sends an email":"Отправляет электронное письмо","Sends message via Pushsafer":"Отправляет сообщение через Pushsafer","Sends message via pushover":"Отправляет сообщение через пустышку","Sends message via telegram":"Отправляет сообщение в телеграмме","Sends message via whatsapp-cmb":"Отправляет сообщение через whatsapp-cmb",September:jY,"Server time":"Время сервера","Set state action":"Установить состояние","Set with delay":"Установить с задержкой","Shell command":"Команда оболочки","Show astronomical events":"Показать астрономические события","Show javascript code":"Показать код Javascript","Show logs":"Показать журналы","Show only paused scripts":"Показывать только приостановленные сценарии","Show only running scripts":"Показывать только запущенные скрипты","Show only scripts with problems":"Показывать только скрипты с проблемами",Simulate:zY,"Some files will be rejected":"Некоторые файлы будут отклонены","Sound:":"Звук:",Stack:UY,Start:HY,"Start script":"Старт скрипта",State:WY,"State condition":"Сравнение состояния","Step into function":"Шаг в функционирование","Step out from function":"Выйти из функции","Stop on exception":"Остановить при исключении",Su:GY,"Subject:":"Предмет:",Sunday:VY,"TS description":"Создание правил путём написания Typescript",Telegram:KY,"Text:":"Текст:",Th:YY,"The script will be stopped and must be activated manually after debugging. Continue?":"Cкрипт будет остановлен и должен быть активирован вручную после отладки. Продолжать?","This is advances option. You can write your own code here and it will be executed on trigger":"Это расширеный вариант. Вы можете написать здесь свой код и он будет выполняться по триггеру",Thursday:JY,Time:qY,"Time condition":"Условие времени","Title:":"Заголовок:","To:":"К:","Trigger with value":"Триггер со значением",Triggered:XY,Triggers:ZY,"Triggers the on script saving or the javascript instance restart":"Запускает при сохранении скрипта или перезапуске экземпляра javascript","Triggers the rule on update or change of some state":"Запускает правило при обновлении или изменении какого-либо состояния","Triggers the rule periodically or on some specific time":"Срабатывает правило периодически или в определенное время",Tu:QY,Tuesday:eJ,URL:tJ,"Unknown error":"Неизвестная ошибка","Unknown error!":"Неизвестная ошибка!","Use generated code":"Использовать сгенерированный код","User function":"Функция пользователя","User:":"Пользователь:",Value:sJ,"Vibration:":"Вибрация:",Volume:oJ,We:iJ,Wednesday:nJ,"Whatsapp-cmb":"Whatsapp-cmb",Write:rJ,"Write your own code":"Напишите свой код",Yes:aJ,"Yet exists!":"Имя уже существует!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Вы можете использовать %s в URL-адресе, чтобы использовать текущее значение триггера, %id, чтобы использовать идентификатор инициированного объекта, %name, чтобы показать имя идентификатора инициированного объекта, или %old, чтобы использовать старое значение триггера.","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Вы можете использовать %s в команде, чтобы использовать текущее значение триггера, %id, чтобы использовать идентификатор сработавшего объекта, %name, чтобы показать имя сработавшего идентификатора объекта, или %old, чтобы использовать старое значение триггера.","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Вы можете использовать %s в тексте для отображения текущего значения триггера, %id для использования идентификатора сработавшего объекта, %name для отображения имени сработавшего идентификатора объекта или %old для использования старого значения триггера.","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Вы можете использовать %s в значении, чтобы использовать текущее значение триггера, %id, чтобы использовать идентификатор инициированного объекта, %name, чтобы показать имя идентификатора инициированного объекта, или %old, чтобы использовать старое значение триггера.","You have to enter OpenAI API key in the configuration of javascript adapter.":"Вы должны ввести ключ OpenAI API в конфигурации адаптера javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Необходимо ввести хотя бы один API-ключ (OpenAI, Anthropic или Gemini) в конфигурации адаптера javascript.","Please select a valid model":"Пожалуйста, выберите допустимую модель","[equal]":"[равно]","[greater or equal]":"[больше или равно]","[greater]":"[больше]","[hysteresis]":"[гистерезис]","[includes]":"[содержит]","[less or equal]":"[меньше или равно]","[less]":"[меньше]","[not equal]":"[не равно]",acknowledgment:lJ,all:cJ,and:uJ,"as JSON":"как JSON","as plain text":"как текст",astro:dJ,at:hJ,"clear running":"остановить уже бегущие",control:pJ,copy:gJ,cron:mJ,dawn:fJ,debug_help:$J,debug_label:bJ,default:"дефолт",dusk:vJ,easy:yJ,else:"иначе","equal to":"равно",every:_J,"every hour at 0 minutes":"каждый час через 0 минут",false:"false","file reading has failed: %s":"Ошибка чтения файла: %s","file reading was aborted":"Чтение файла было прервано",filter_func:wJ,filter_id:kJ,filter_name:CJ,filter_role:TJ,filter_room:SJ,"for edit or create script":"для редактирования или создайте новый скрипт","for professionals":"для профессионалов","for programmers":"для программистов",goldenHour:EJ,goldenHourEnd:IJ,"greater or equal":"больше или равно","greater or equal to":"больше или равно","greater than":"больше чем",help_just_check:xJ,help_on_change:DJ,"high priority":"высокий приоритет","high-priority":"высокий-приоритет","highest priority":"высший приоритет",hours:AJ,includes:OJ,interval:RJ,"just check":"просто проверить","less or equal":"меньше или равно","less or equal to":"меньше или равно","less than":"меньше, чем","lower priority":"более низкий приоритет","lowest priority":"самый низкий приоритет",magic:NJ,milliseconds:MJ,minutes:LJ,ms:PJ,nadir:BJ,nauticalDawn:FJ,nauticalDusk:jJ,nextSunrise:zJ,nextSunset:UJ,night:HJ,nightEnd:WJ,"no blocks found":"Блоков нет","no group":"Нет группы",normal:GJ,"normal priority":"нормальный приоритет","not equal to":"не равно","not properly connected":"Этот блок неправильно соединён или не соединён с другими блоками.",offset:VJ,"on change":"по изменению","on condition change":"при изменении результата условия","on update":"при обновлении",one:KJ,or:YJ,quiet:JJ,"reset search":"Cбросить поиск",search:qJ,seconds:XJ,solarNoon:ZJ,"store in":"сохранить в",sunrise:QJ,sunriseEnd:eq,sunset:tq,sunsetStart:sq,then:oq,"toggle value":"инвертировать текщее значение",tooltip_ack:iq,tooltip_from:nq,tooltip_lc:rq,tooltip_quality:aq,tooltip_ts:lq,tooltip_user:cq,tooltip_value:uq,true:"true",two:dq,undefined:"неопределенный",update:hq,"use seconds":"использовать секунды","use trigger value":"использовать значение триггера",verbose_help:pq,verbose_label:gq,when:mq,with:"с","with date":"с датой","with offset":"со сдвигом",wizard:fq,"Loading models...":"Загрузка моделей...","Could not connect to API at %s":"Не удалось подключиться к API по адресу %s","Invalid API key":"Недействительный ключ API","Access denied by API":"Доступ запрещён API","API error: %s":"Ошибка API: %s",'Model "%s" not found':'Модель "%s" не найдена',"Request failed: %s":"Запрос не удался: %s",Retry:$q,"No running javascript instance found":"Не найден работающий экземпляр JavaScript"},vq="Визнано",yq="Дії",_q="додати",wq="все",kq="Будь-який",Cq="Застосувати",Tq="квітень",Sq="Запитуйте",Eq="Астрономічний",Iq="серпень",xq="Скасувати",Dq="Закрити",Aq="Хвороба",Oq="Умови",Rq="Консоль",Nq="Скопійовано",Mq="Грудень",Lq="За замовчуванням",Pq="Затримка",Bq="Видалити",Fq="опис",jq="Готово",zq="Виконавча оболонка",Uq="Пояснення",Hq="Експорт",Wq="Лютий",Gq="Лютий",Vq="фільтр",Kq="Папка",Yq="О",Jq="П'ятниця",qq="ID",Xq="ID1",Zq="ID2",Qq="Імпорт",eX="Екземпляр",tX="Примірники",sX="Інструкції",oX="січень",iX="січня",nX="липень",rX="червень",aX="Ліміт",lX="березень",cX="Може",uX="Меню",dX="повідомлення",hX="пн",pX="Модель",gX="понеділок",mX="місяць",fX="Більше",$X="Ім'я",bX="Листопад",vX="в порядку",yX="жовтень",_X="В порядку",wX="Пауза",kX="Pushover",CX="Pushsafer",TX="Перейменувати",SX="Повторіть",EX="Перезапустіть",IX="Результат",xX="Sa",DX="Субота",AX="зберегти",OX="розклад",RX="Сценарій",NX="Вересень",MX="Симулювати",LX="Стек",PX="старт",BX="Держава",FX="Нд",jX="неділя",zX="Телеграма",UX="чт",HX="четвер",WX="час",GX="Спрацьовує",VX="Тригери",KX="вт",YX="вівторок",JX="URL",qX="Значення",XX="Обсяг",ZX="ми",QX="Середа",eZ="Напишіть",tZ="Так",sZ="підтвердження",oZ="все",iZ="і",nZ="Астро",rZ="в",aZ="КОНТРОЛЬ",lZ="копія",cZ="CRON",uZ="Світанок",dZ="Це особливий режим, в якому стану та об'єкти не змінюватимуться. Але в протоколі відображатиметься лише інформація про кожну заплановану зміну.",hZ="Відлагоджувати",pZ="Сутінки",gZ="легко",mZ="кожен",fZ="функція",$Z="ID",bZ="Ім'я",vZ="Роль",yZ="Кімната",_Z="Золота година",wZ="Кінець золотої години",kZ="Код буде виконуватися лише щоразу, коли умова виконується. наприклад якщо спрацьовує значення датчика температури та умова «якщо температура перевищує 20°C», дії «тоді» виконуватимуться щоразу, коли датчик надсилає температуру, і вона перевищує 20°C. На 21°C, на 22°C і так далі.",CZ="Код буде виконано лише у разі зміни результату умови. наприклад якщо спрацьовує значення датчика температури та умова «якщо температура перевищує 20°C», дії «тоді» будуть виконані один раз, коли температура буде вище 20. Наступного разу дії «тоді» буде виконано, коли температура падає нижче 20, а потім знову піднімається вище 20.",TZ="години",SZ="включає в себе",EZ="інтервал",IZ="магія",xZ="мілісекунд",DZ="хвилин",AZ="РС",OZ="Надір",RZ="Морський світанок",NZ="Морські сутінки",MZ="Наступний схід сонця",LZ="Наступний захід сонця",PZ="ніч",BZ="Кінець ночі",FZ="нормально",jZ="зсув",zZ="один",UZ="або",HZ="тихо",WZ="пошук",GZ="секунд",VZ="Сонячний полудень",KZ="схід сонця",YZ="Кінець сходу сонця",JZ="Захід сонця",qZ="Початок заходу сонця",XZ="потім",ZZ="Визнати",QZ="Від",eQ="Востаннє змінено",tQ="якість",sQ="Мітка часу",oQ="Користувач",iQ="Значення",nQ="два",rQ="оновлення",aQ="Додає вихідні дані налагодження до журналу для багатьох системних команд",lQ="Докладні результати журналу",cQ="коли",uQ="майстер",dQ="Повторити",hQ={"%s not found":"%s не знайдено","()":"()","(at %s)":"(у %s)","(optional)":"(необов'язково)","-":"-",".":".","AI code generator":"Генератор коду ШІ",Ack:vq,Actions:yq,"Actual time of day":"Фактичний час доби",Add:_q,"Add new script":"Додати новий сценарій",All:wq,"All files will be accepted":"Усі файли будуть прийняті",Any:kq,"Any month":"Будь-який місяць",Apply:Cq,April:Tq,"Are you sure?":"Ти впевнений?",Ask:Sq,Astronomical:Eq,"Astronomical events today":"Астрономічні події сьогодні",August:Iq,"Blockly description":"Створення правил за графічними блоками","Body:":"Тіло:",Cancel:xq,"Cannot delete non empty item!":"Неможливо видалити непорожній елемент!","Change layout":"Змінити макет",'Change theme (actual "%s")':'Змінити тему (тепер - "%s")',"Check blocks":"Перевірте блоки","Check is not active, because javascript adapter is disabled":"Перевірка не активна, оскільки адаптер Javascript вимкнено","Clear search input":"Очистити пошуковий запит","Click on this icon":"Натисніть на цей значок",Close:Dq,"Close all but current":"Закрити всі, крім поточних","Collapse all":"Закрити всі","Compares current time with astronomical event":"Порівнює поточний час з астрономічною подією","Compares current time with the user specific time":"Порівнює поточний час із конкретним часом користувача","Compares the state value with user defined value":"Порівнює значення стану з визначеним користувачем значенням",Condition:Aq,Conditions:Oq,"Configuration not saved.":"Конфігурація не збережена.",Console:Rq,"Control or update some state":"Контролюйте або оновлюйте певний стан","Control or update some state with delay":"Контролюйте або оновлюйте деякий стан із затримкою","Convert blockly to javascript for ever.":"Назавжди конвертуйте Blockly у Javascript.",Copied:Nq,"Copy script":"Копіювати сценарій","Copy to clipboard":"Копіювати в буфер обміну","Create new":"Створити новий","Create new folder":"Створити нову папку","Create new script":"Створіть новий сценарій","Create or edit CRON or time wizard":"Створення або редагування CRON або майстра часу","Dark Theme":"Темна тема","Dark style":"Темний стиль",Date:"Дата","Debug instance":"Екземпляр налагодження","Debug options":"Параметри налагодження",December:Mq,Default:Lq,"Define cron...":"Визначити cron...","Define schedule...":"Визначити розклад...",Delay:Pq,Delete:Bq,"Delete %s":"Видалити %s...","Delete folder":"Видалити папку","Delete script":"Видалити сценарій",Description:Fq,"Deselect all":"Зняти вибір із усіх","Discard changes for %s":"Скасувати зміни для %s",Done:jq,"Double click to write value":"Двічі клацніть, щоб записати значення","Download as file":"Завантажити файл","Drop some files here or click...":"Перетягніть кілька файлів сюди або натисніть...","Duplicate name":"Повторюване ім'я","Edit script or just double click":"Відредагуйте сценарій або просто двічі клацніть","Empty name is not allowed":"Порожнє ім'я не допускається","End search mode":"Завершити режим пошуку","Enter your question":"Введи своє прохання",Error:"Помилка","Error formatting code":"Помилка форматування коду","Error was found":"Виявлено помилку","Every day":"Кожен день",Exec:zq,"Executes some shell command":"Виконує певну команду оболонки","Existing scripts will be overwritten.":"Існуючі сценарії буде перезаписано.","Expand all":"Розгорнути все","Expert mode":"Експертний режим",Explanation:Uq,Export:Hq,"Export all scripts":"Експортувати всі сценарії","Export blocks":"Експорт блоків","Export selected blocks":"Експортувати вибрані блоки",Februar:Wq,February:Gq,Filter:Vq,Folder:Kq,Fr:Yq,Friday:Jq,Function:"функція","Function editor":"Редактор функцій","Function: executed":"Функція: виконано","Go to next line":"Перейти до наступного рядка","HTTP Call":"Виклик HTTP","Hide logs":"Приховати журнали",ID:qq,ID1:Xq,ID2:Zq,Import:Qq,"Import blocks":"Імпорт блоків","Import error":"Помилка імпорту","Import scripts":"Імпорт скриптів","Insert object ID":"Вставте ID об'єкта",Instance:eX,"Instance is disabled":"Примірник вимкнено","Instance:":"екземпляр:",Instances:tX,Instructions:sX,"Invalid CRON":"Недійсний CRON","It will not be possible to revert this operation.":"Скасувати цю операцію буде неможливо.","JS description":"Створення правил шляхом написання Javascript",Januar:oX,January:iX,July:nX,June:rX,"Just check":"Просто перевірте","Language:":"Мову:","Learn More":"Вивчайте більше","Light style":"Легкий стиль",Limit:aX,"Local time":"Місцевий час","Locate file":"Знайти файл","Log outputs":"Виходи журналу","Log text":"Текст журналу","Log: %s":"Журнал: %s","Make a HTTP get request":"Зробіть HTTP-запит на отримання","Make a pause between actions":"Між діями робіть паузу",March:lX,"March ":"березень",May:cX,Menu:uX,Message:dX,Mo:hX,Model:pX,Monday:gX,Month:mX,More:fX,Name:$X,"No API key found":"API-ключ не знайдено","No Chat GPT Key found":"Ключ GPT для чату не знайдено","No active host found":"Активний хост не знайдено","Nothing found":"Нічого не знайдено",November:bX,OK:vX,October:yX,Ok:_X,"On condition change":"За умови зміни результату","On script save or adapter start":"Під час збереження сценарію або запуску адаптера","On weekdays":"В будні дні","Open configuration":"Відкрита конфігурація","Operate two states":"Керуйте двома станами","Operations with two states":"Операції з двома станами","Paste your blocks here":"Вставте сюди свої блоки",Pause:wX,"Pause execution":"Призупинити виконання","Pause script":"Призупинити сценарій","Phone:":"телефон:","Please select object ID...":"Виберіть ідентифікатор об'єкта...","Press Ctrl+Enter to get the answer":"Натисніть Ctrl+Enter, щоб отримати відповідь","Prettify the script":"Прикрасьте сценарій","Print some text in log":"Надрукувати текст у журналі","Priority:":"Пріоритет:",Pushover:kX,Pushsafer:CX,"Read only ID selected: %s":"Вибрано ідентифікатор лише для читання: %s",Rename:TX,"Reorder scripts in folders":"Зміна порядку сценаріїв у папках",Repeat:SX,Restart:EX,Result:IX,"Resume execution":"Відновити виконання","Root folder":"Коренева папка","Rules description":"Створюйте правила з блоками IF, THEN, ELSE","Run script":"Запустіть сценарій",Sa:xX,Saturday:DX,Save:AX,"Save all":"Зберегти все","Say It":"Скажи це","Say some text via sayit adapter":"Скажіть текст через адаптер sayit",Schedule:OX,Script:RX,"Script %s was modified on disk":"Сценарій %s змінено на диску","Script is not running":"Сценарій не працює","Search in scripts":"Пошук у скриптах","Search...":"пошук...","Select all":"Вибрати все","Send email":"Відправити лист","Sends an email":"Надсилає електронний лист","Sends message via Pushsafer":"Надсилає повідомлення через Pushsafer","Sends message via pushover":"Надсилає повідомлення через pushover","Sends message via telegram":"Надсилає повідомлення через телеграм","Sends message via whatsapp-cmb":"Надсилає повідомлення через whatsapp-cmb",September:NX,"Server time":"Час сервера","Set state action":"Встановити дію стану","Set with delay":"Встановити із затримкою","Shell command":"Команда оболонки","Show astronomical events":"Показати астрономічні події","Show javascript code":"Показати код Javascript","Show logs":"Показати журнали","Show only paused scripts":"Показувати лише призупинені сценарії","Show only running scripts":"Показувати лише запущені сценарії","Show only scripts with problems":"Показувати лише сценарії з проблемами",Simulate:MX,"Some files will be rejected":"Деякі файли буде відхилено","Sound:":"звук:",Stack:LX,Start:PX,"Start script":"Запустити сценарій",State:BX,"State condition":"Стан стану","Step into function":"Крок у функції","Step out from function":"Вийти з функції","Stop on exception":"Зупинка на винятках",Su:FX,"Subject:":"Тема:",Sunday:jX,"TS description":"Створення правил шляхом написання Typescript",Telegram:zX,"Text:":"Текст:",Th:UX,"The script will be stopped and must be activated manually after debugging. Continue?":"Сценарій буде зупинено, і його необхідно активувати вручну після налагодження. Продовжити?","This is advances option. You can write your own code here and it will be executed on trigger":"Це авансовий варіант. Ви можете написати тут свій власний код, і він буде виконано на тригері",Thursday:HX,Time:WX,"Time condition":"Умова часу","Title:":"Назва:","To:":"до:","Trigger with value":"Тригер зі значенням",Triggered:GX,Triggers:VX,"Triggers the on script saving or the javascript instance restart":"Ініціює збереження сценарію або перезапуск екземпляра JavaScript","Triggers the rule on update or change of some state":"Запускає правило при оновленні або зміні якогось стану","Triggers the rule periodically or on some specific time":"Спрацьовує правило періодично або в певний час",Tu:KX,Tuesday:YX,URL:JX,"Unknown error":"Невідома помилка","Unknown error!":"Невідома помилка!","Use generated code":"Використовуйте згенерований код","User function":"Функція користувача","User:":"Користувач:",Value:qX,"Vibration:":"Вібрація:",Volume:XX,We:ZX,Wednesday:QX,"Whatsapp-cmb":"Whatsapp-cmb",Write:eZ,"Write your own code":"Напишіть власний код",Yes:tZ,"Yet exists!":"Все ж існує!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Ви можете використовувати %s в URL-адресі, щоб використовувати поточне значення тригера, %id, щоб використовувати ідентифікатор активованого об’єкта, %name, щоб показати назву ідентифікатора активованого об’єкта, або %old, щоб використовувати старе значення тригера","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Ви можете використовувати %s у команді, щоб використовувати поточне значення тригера, %id, щоб використовувати ідентифікатор активованого об’єкта, %name, щоб показати назву ідентифікатора активованого об’єкта, або %old, щоб використовувати старе значення тригера","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Ви можете використовувати %s у тексті для відображення поточного значення тригера, %id для використання ідентифікатора активованого об’єкта, %name для відображення імені ідентифікатора активованого об’єкта або %old для використання старого значення тригера","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Ви можете використовувати %s у значенні, щоб використовувати поточне значення тригера, %id, щоб використовувати ідентифікатор активованого об’єкта, %name, щоб показати назву ідентифікатора активованого об’єкта, або %old, щоб використовувати старе значення тригера","You have to enter OpenAI API key in the configuration of javascript adapter.":"Ви повинні ввести ключ OpenAI API у конфігурації адаптера JavaScript.","You have to enter at least one API key in the configuration of javascript adapter.":"Необхідно ввести хоча б один API-ключ (OpenAI, Anthropic або Gemini) у конфігурації адаптера JavaScript.","Please select a valid model":"Будь ласка, виберіть дійсну модель","[equal]":"[рівний]","[greater or equal]":"[більше або дорівнює]","[greater]":"[більший]","[hysteresis]":"[гістерезис]","[includes]":"[включає]","[less or equal]":"[менше або рівно]","[less]":"[менше]","[not equal]":"[не дорівнює]",acknowledgment:sZ,all:oZ,and:iZ,"as JSON":"як JSON","as plain text":"як текст",astro:nZ,at:rZ,"clear running":"чіткий біг",control:aZ,copy:lZ,cron:cZ,dawn:uZ,debug_help:dZ,debug_label:hZ,default:"за замовчуванням",dusk:pZ,easy:gZ,else:"інше","equal to":"дорівнює",every:mZ,"every hour at 0 minutes":"щогодини о 0 хвилин",false:"помилковий","file reading has failed: %s":"не вдалося прочитати файл: %s","file reading was aborted":"читання файлу було перервано",filter_func:fZ,filter_id:$Z,filter_name:bZ,filter_role:vZ,filter_room:yZ,"for edit or create script":"для редагування або створення нового сценарію","for professionals":"для професіоналів","for programmers":"для програмістів",goldenHour:_Z,goldenHourEnd:wZ,"greater or equal":"більший або рівний","greater or equal to":"більше або дорівнює","greater than":"більше, ніж, величніше ніж, крутіший за",help_just_check:kZ,help_on_change:CZ,"high priority":"високий пріоритет","high-priority":"високий пріоритет","highest priority":"найвищий пріоритет",hours:TZ,includes:SZ,interval:EZ,"just check":"просто перевірте","less or equal":"менше або дорівнює","less or equal to":"менше або дорівнює","less than":"менше ніж","lower priority":"нижчий пріоритет","lowest priority":"найнижчий пріоритет",magic:IZ,milliseconds:xZ,minutes:DZ,ms:AZ,nadir:OZ,nauticalDawn:RZ,nauticalDusk:NZ,nextSunrise:MZ,nextSunset:LZ,night:PZ,nightEnd:BZ,"no blocks found":"Блоків не знайдено","no group":"НЕМАЄ ГРУПИ",normal:FZ,"normal priority":"нормальний пріоритет","not equal to":"не дорівнює","not properly connected":"Цей блок неправильно з’єднаний з іншими блоками.",offset:jZ,"on change":"на зміну","on condition change":"про зміну умов","on update":"на оновлення",one:zZ,or:UZ,quiet:HZ,"reset search":"скинути пошук",search:WZ,seconds:GZ,solarNoon:VZ,"store in":"зберігати в",sunrise:KZ,sunriseEnd:YZ,sunset:JZ,sunsetStart:qZ,then:XZ,"toggle value":"значення перемикання",tooltip_ack:ZZ,tooltip_from:QZ,tooltip_lc:eQ,tooltip_quality:tQ,tooltip_ts:sQ,tooltip_user:oQ,tooltip_value:iQ,true:"правда",two:nQ,undefined:"невизначений",update:rQ,"use seconds":"використовуйте секунди","use trigger value":"використовувати значення тригера",verbose_help:aQ,verbose_label:lQ,when:cQ,with:"з","with date":"з датою","with offset":"зі зміщенням",wizard:uQ,"Loading models...":"Завантаження моделей...","Could not connect to API at %s":"Не вдалося підключитися до API за адресою %s","Invalid API key":"Недійсний ключ API","Access denied by API":"Доступ заборонено API","API error: %s":"Помилка API: %s",'Model "%s" not found':'Модель "%s" не знайдено',"Request failed: %s":"Запит не вдався: %s",Retry:dQ,"No running javascript instance found":"Не знайдено запущеного екземпляра JavaScript"},pQ="确认",gQ="动作",mQ="添加",fQ="所有",$Q="任何",bQ="申请",vQ="四月",yQ="问",_Q="天文",wQ="八月",kQ="取消",CQ="关闭",TQ="健康)状况",SQ="情况",EQ="安慰",IQ="复制的",xQ="十二月",DQ="默认",AQ="延迟",OQ="删除",RQ="描述",NQ="完成",MQ="执行力",LQ="解释",PQ="导出",BQ="二月",FQ="二月",jQ="筛选",zQ="文件夹",UQ="r",HQ="星期五",WQ="ID",GQ="ID1",VQ="ID2",KQ="导入",YQ="实例",JQ="实例",qQ="指示",XQ="亚努尔",ZQ="一月",QQ="七月",eee="六月",tee="限制",see="三月",oee="五月",iee="菜单",nee="信息",ree="莫",aee="模型",lee="星期一",cee="月",uee="更多的",dee="名称",hee="十一月",pee="好的",gee="十月",mee="确定",fee="暂停",$ee="俯卧撑",bee="推安全",vee="重命名",yee="重复",_ee="重启",wee="结果",kee="萨",Cee="星期六",Tee="保存",See="日程",Eee="脚本",Iee="九月",xee="模拟",Dee="堆",Aee="开始",Oee="状态",Ree="苏",Nee="星期日",Mee="电报",Lee="4",Pee="星期四",Bee="时间",Fee="触发",jee="扳机",zee="涂",Uee="星期二",Hee="网址",Wee="价值",Gee="体积",Vee="3",Kee="星期三",Yee="写",Jee="是的",qee="致谢",Xee="全部",Zee="和",Qee="天文",ete="在",tte="控制",ste="复制",ote="克朗",ite="黎明",nte="这是一种特殊模式,其中状态和对象不会改变。但只有有关每个计划更改的信息才会显示在协议中。",rte="调试",ate="黄昏",lte="简单的",cte="每一个",ute="功能",dte="ID",hte="名字",pte="角色",gte="房间",mte="黄金时段",fte="黄金时段结束",$te="仅在条件为真时才执行代码。例如。如果触发温度传感器值并且条件为“如果温度大于20°C”,则每次传感器发送温度且温度超过20°C时,将执行“然后”动作。 21°C,22°C等。",bte="仅当条件结果更改时,代码才会执行。例如。如果触发温度传感器值且条件为“如果温度大于20°C”,则温度超过20时将执行一次“则”动作,下一次,当温度超过20时将执行“则”动作低于20失败,然后再次超过20。",vte="小时",yte="包括",_te="间隔",wte="魔法",kte="毫秒",Cte="分钟",Tte="毫秒",Ste="最低点",Ete="航海黎明",Ite="航海黄昏",xte="下一个日出",Dte="下一个日落",Ate="夜晚",Ote="夜晚结束",Rte="普通的",Nte="抵消",Mte="一",Lte="或",Pte="安静的",Bte="搜索",Fte="秒",jte="星期日正午",zte="日出",Ute="日出结束",Hte="日落",Wte="日落开始",Gte="然后",Vte="确认",Kte="从",Yte="上一次改变",Jte="质量",qte="时间戳",Xte="用户",Zte="值",Qte="二",ese="更新",tse="将调试输出添加到许多系统命令的日志中",sse="详细日志输出",ose="什么时候",ise="巫师",nse="重试",rse={"%s not found":"%s 未找到","()":"()","(at %s)":"(在 %s)","(optional)":"(选修的)","-":"-",".":".","AI code generator":"AI代码生成器",Ack:pQ,Actions:gQ,"Actual time of day":"一天中的实际时间",Add:mQ,"Add new script":"添加新脚本",All:fQ,"All files will be accepted":"所有文件都将被接受",Any:$Q,"Any month":"任何月份",Apply:bQ,April:vQ,"Are you sure?":"你确定吗?",Ask:yQ,Astronomical:_Q,"Astronomical events today":"今天的天文事件",August:wQ,"Blockly description":"按图形块创建规则","Body:":"身体:",Cancel:kQ,"Cannot delete non empty item!":"无法删除非空项目!","Change layout":"变更版面",'Change theme (actual "%s")':"更改主题(现在为“%s”)","Check blocks":"检查块","Check is not active, because javascript adapter is disabled":"检查未激活,因为禁用了Javascript适配器","Clear search input":"清除搜索输入","Click on this icon":"单击此图标",Close:CQ,"Close all but current":"关闭所有(当前除外)","Collapse all":"全部收缩","Compares current time with astronomical event":"将当前时间与天文事件进行比较","Compares current time with the user specific time":"将当前时间与用户特定时间进行比较","Compares the state value with user defined value":"比较状态值和用户定义的值",Condition:TQ,Conditions:SQ,"Configuration not saved.":"配置未保存。",Console:EQ,"Control or update some state":"控制或更新某些状态","Control or update some state with delay":"延迟控制或更新某些状态","Convert blockly to javascript for ever.":"立即将blockly转换为Javascript。",Copied:IQ,"Copy script":"复制脚本","Copy to clipboard":"复制到剪贴板","Create new":"创建新的","Create new folder":"创建新文件夹","Create new script":"创建新脚本","Create or edit CRON or time wizard":"创建或编辑周期任务或时间向导","Dark Theme":"深色调主题","Dark style":"深色调风格",Date:"日期","Debug instance":"调试实例","Debug options":"调试选项",December:xQ,Default:DQ,"Define cron...":"定义周期任务...","Define schedule...":"定义调度器......",Delay:AQ,Delete:OQ,"Delete %s":"删除%s...","Delete folder":"删除文件夹","Delete script":"删除脚本",Description:RQ,"Deselect all":"取消全选","Discard changes for %s":"放弃%s的更改",Done:NQ,"Double click to write value":"Double click to write value","Download as file":"档案","Drop some files here or click...":"将文件拖拽到这里或单击......","Duplicate name":"重名","Edit script or just double click":"双击编辑脚本","Empty name is not allowed":"不允许使用空名称","End search mode":"结束搜索模式","Enter your question":"输入您的要求",Error:"错误","Error formatting code":"代码格式错误","Error was found":"发现错误","Every day":"每天",Exec:MQ,"Executes some shell command":"执行一些shell命令","Existing scripts will be overwritten.":"现有脚本将被覆盖。","Expand all":"展开全部","Expert mode":"专家模式",Explanation:LQ,Export:PQ,"Export all scripts":"导出所有脚本","Export blocks":"导出块","Export selected blocks":"导出选定的块",Februar:BQ,February:FQ,Filter:jQ,Folder:zQ,Fr:UQ,Friday:HQ,Function:"功能","Function editor":"功能编辑器","Function: executed":"功能:执行","Go to next line":"转到下一行","HTTP Call":"HTTP呼叫","Hide logs":"隐藏日志",ID:WQ,ID1:GQ,ID2:VQ,Import:KQ,"Import blocks":"导入块","Import error":"导入错误","Import scripts":"导入脚本","Insert object ID":"插入对象ID",Instance:YQ,"Instance is disabled":"实例已禁用","Instance:":"实例:",Instances:JQ,Instructions:qQ,"Invalid CRON":"无效的周期任务","It will not be possible to revert this operation.":"无法恢复此操作。","JS description":"通过编写Javascript来创建规则",Januar:XQ,January:ZQ,July:QQ,June:eee,"Just check":"只是检查","Language:":"语言:","Learn More":"了解更多","Light style":"浅色调风格",Limit:tee,"Local time":"当地时间","Locate file":"定位文件","Log outputs":"记录输出","Log text":"记录文字","Log: %s":"日志:%s","Make a HTTP get request":"发出HTTP获取请求","Make a pause between actions":"在动作之间暂停",March:see,"March ":"行进",May:oee,Menu:iee,Message:nee,Mo:ree,Model:aee,Monday:lee,Month:cee,More:uee,Name:dee,"No API key found":"未找到 API 密钥","No Chat GPT Key found":"找不到聊天 GPT 密钥","No active host found":"找不到活动主机","Nothing found":"没有发现",November:hee,OK:pee,October:gee,Ok:mee,"On condition change":"条件变化时","On script save or adapter start":"在脚本保存或适配器启动时","On weekdays":"在工作日","Open configuration":"开放配置","Operate two states":"操作两种状态","Operations with two states":"具有两种状态的操作","Paste your blocks here":"在此处粘贴您的区块",Pause:fee,"Pause execution":"暂停执行","Pause script":"暂停脚本","Phone:":"电话:","Please select object ID...":"请选择对象ID...","Press Ctrl+Enter to get the answer":"按 Ctrl+Enter 即可得到答案","Prettify the script":"美化脚本","Print some text in log":"在日志中打印一些文本","Priority:":"优先:",Pushover:$ee,Pushsafer:bee,"Read only ID selected: %s":"选择的只读ID:%s",Rename:vee,"Reorder scripts in folders":"重新排序文件夹中的脚本",Repeat:yee,Restart:_ee,Result:wee,"Resume execution":"恢复执行","Root folder":"根文件夹","Rules description":"使用IF,THEN,ELSE块创建规则","Run script":"运行脚本",Sa:kee,Saturday:Cee,Save:Tee,"Save all":"保存全部","Say It":"Say It","Say some text via sayit adapter":"通过sayit适配器说一些文字",Schedule:See,Script:Eee,"Script %s was modified on disk":"脚本%s已在磁盘上修改","Script is not running":"脚本没有运行","Search in scripts":"在脚本中搜索","Search...":"搜索...","Select all":"全选","Send email":"发送电子邮件","Sends an email":"发送邮件","Sends message via Pushsafer":"通过Pushsafer发送消息","Sends message via pushover":"通过推播发送消息","Sends message via telegram":"通过电报发送消息","Sends message via whatsapp-cmb":"通过whatsapp-cmb发送消息",September:Iee,"Server time":"服务器时间","Set state action":"设定状态动作","Set with delay":"延迟设置","Shell command":"Shell命令","Show astronomical events":"显示天文事件","Show javascript code":"显示Javascript代码","Show logs":"显示记录","Show only paused scripts":"仅显示暂停的脚本","Show only running scripts":"仅显示正在运行的脚本","Show only scripts with problems":"仅显示有问题的脚本",Simulate:xee,"Some files will be rejected":"有些文件将被拒绝","Sound:":"声音:",Stack:Dee,Start:Aee,"Start script":"启动脚本",State:Oee,"State condition":"状态条件","Step into function":"进入功能","Step out from function":"退出函数","Stop on exception":"异常停止",Su:Ree,"Subject:":"学科:",Sunday:Nee,"TS description":"通过编写Typescript来创建规则",Telegram:Mee,"Text:":"文本:",Th:Lee,"The script will be stopped and must be activated manually after debugging. Continue?":"该脚本将停止,并且必须在调试后手动激活。继续?","This is advances option. You can write your own code here and it will be executed on trigger":"这是高级选项。您可以在此处编写自己的代码,它将在触发器上执行",Thursday:Pee,Time:Bee,"Time condition":"时间条件","Title:":"标题:","To:":"到:","Trigger with value":"用值触发",Triggered:Fee,Triggers:jee,"Triggers the on script saving or the javascript instance restart":"触发脚本保存或javascript实例重启","Triggers the rule on update or change of some state":"在某些状态的更新或更改时触发规则","Triggers the rule periodically or on some specific time":"定期或在特定时间触发规则",Tu:zee,Tuesday:Uee,URL:Hee,"Unknown error":"未知错误","Unknown error!":"未知错误!","Use generated code":"使用生成的代码","User function":"用户功能","User:":"用户:",Value:Wee,"Vibration:":"振动:",Volume:Gee,We:Vee,Wednesday:Kee,"Whatsapp-cmb":"Whatsapp的cmb",Write:Yee,"Write your own code":"编写自己的代码",Yes:Jee,"Yet exists!":"不存在!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"您可以在 URL 中使用 %s 以使用当前触发值,%id 以使用触发对象 ID,%name 以显示触发对象 ID 名称或 %old 以使用旧触发值","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"您可以在命令中使用 %s 以使用当前触发值,%id 使用触发对象 ID,%name 显示触发对象 ID 名称或 %old 使用旧触发值","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"您可以在文本中使用 %s 显示当前触发值,%id 使用触发对象 ID,%name 显示触发对象 ID 名称或 %old 使用旧触发值","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"您可以在值中使用 %s 以使用当前触发器值,%id 使用触发对象 ID,%name 显示触发对象 ID 名称或 %old 使用旧触发器值","You have to enter OpenAI API key in the configuration of javascript adapter.":"您必须在 javascript 适配器的配置中输入 OpenAI API 密钥。","You have to enter at least one API key in the configuration of javascript adapter.":"您必须在 javascript 适配器的配置中输入至少一个 API 密钥(OpenAI、Anthropic 或 Gemini)。","Please select a valid model":"请选择一个有效的模型","[equal]":"[平等的]","[greater or equal]":"[大于等于]","[greater]":"[更大]","[hysteresis]":"[磁滞]","[includes]":"[包括]","[less or equal]":"[小于或等于]","[less]":"[较少的]","[not equal]":"[不相等]",acknowledgment:qee,all:Xee,and:Zee,"as JSON":"为 JSON","as plain text":"为纯文本",astro:Qee,at:ete,"clear running":"畅通无阻",control:tte,copy:ste,cron:ote,dawn:ite,debug_help:nte,debug_label:rte,default:"默认",dusk:ate,easy:lte,else:"别的","equal to":"等于",every:cte,"every hour at 0 minutes":"每小时0分钟",false:"错误的","file reading has failed: %s":"文件读取失败:%s","file reading was aborted":"文件读取中止",filter_func:ute,filter_id:dte,filter_name:hte,filter_role:pte,filter_room:gte,"for edit or create script":"用于编辑或创建脚本","for professionals":"对于专业人士","for programmers":"对于程序员",goldenHour:mte,goldenHourEnd:fte,"greater or equal":"大于或等于","greater or equal to":"大于或等于","greater than":"比...更棒",help_just_check:$te,help_on_change:bte,"high priority":"高优先级","high-priority":"高优先级","highest priority":"最高优先级",hours:vte,includes:yte,interval:_te,"just check":"只是检查","less or equal":"小于或等于","less or equal to":"小于或等于","less than":"少于","lower priority":"低优先级","lowest priority":"最低优先级",magic:wte,milliseconds:kte,minutes:Cte,ms:Tte,nadir:Ste,nauticalDawn:Ete,nauticalDusk:Ite,nextSunrise:xte,nextSunset:Dte,night:Ate,nightEnd:Ote,"no blocks found":"找不到块","no group":"没有组",normal:Rte,"normal priority":"正常优先","not equal to":"不等于","not properly connected":"此块未正确连接到其他块。",offset:Nte,"on change":"在变化","on condition change":"在条件变化时","on update":"更新时",one:Mte,or:Lte,quiet:Pte,"reset search":"重置搜索",search:Bte,seconds:Fte,solarNoon:jte,"store in":"存放在",sunrise:zte,sunriseEnd:Ute,sunset:Hte,sunsetStart:Wte,then:Gte,"toggle value":"切换值",tooltip_ack:Vte,tooltip_from:Kte,tooltip_lc:Yte,tooltip_quality:Jte,tooltip_ts:qte,tooltip_user:Xte,tooltip_value:Zte,true:"真的",two:Qte,undefined:"不明确的",update:ese,"use seconds":"精确到秒","use trigger value":"使用触发值",verbose_help:tse,verbose_label:sse,when:ose,with:"和","with date":"有日期","with offset":"带偏移",wizard:ise,"Loading models...":"加载模型...","Could not connect to API at %s":"无法连接到 %s 的 API","Invalid API key":"无效的 API 密钥","Access denied by API":"API 拒绝访问","API error: %s":"API 错误:%s",'Model "%s" not found':'未找到模型 "%s"',"Request failed: %s":"请求失败:%s",Retry:nse,"No running javascript instance found":"未找到正在运行的 JavaScript 实例"};function pc(a){throw new Error('Could not dynamically require "'+a+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var OC={exports:{}};(function(a,s){(function(i){a.exports=i()})(function(){return(function i(r,l,c){function d(f,b){if(!l[f]){if(!r[f]){var y=typeof pc=="function"&&pc;if(!b&&y)return y(f,!0);if(h)return h(f,!0);var w=new Error("Cannot find module '"+f+"'");throw w.code="MODULE_NOT_FOUND",w}var v=l[f]={exports:{}};r[f][0].call(v.exports,function(_){var $=r[f][1][_];return d($||_)},v,v.exports,i,r,l,c)}return l[f].exports}for(var h=typeof pc=="function"&&pc,p=0;p>2,v=(3&f)<<4|b>>4,_=1>6:64,$=2>4,b=(15&w)<<4|(v=h.indexOf(p.charAt($++)))>>2,y=(3&v)<<6|(_=h.indexOf(p.charAt($++))),E[S++]=f,v!==64&&(E[S++]=b),_!==64&&(E[S++]=y);return E}},{"./support":30,"./utils":32}],2:[function(i,r,l){var c=i("./external"),d=i("./stream/DataWorker"),h=i("./stream/Crc32Probe"),p=i("./stream/DataLengthProbe");function f(b,y,w,v,_){this.compressedSize=b,this.uncompressedSize=y,this.crc32=w,this.compression=v,this.compressedContent=_}f.prototype={getContentWorker:function(){var b=new d(c.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new p("data_length")),y=this;return b.on("end",function(){if(this.streamInfo.data_length!==y.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),b},getCompressedWorker:function(){return new d(c.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},f.createWorkerFrom=function(b,y,w){return b.pipe(new h).pipe(new p("uncompressedSize")).pipe(y.compressWorker(w)).pipe(new p("compressedSize")).withStreamInfo("compression",y)},r.exports=f},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(i,r,l){var c=i("./stream/GenericWorker");l.STORE={magic:"\0\0",compressWorker:function(){return new c("STORE compression")},uncompressWorker:function(){return new c("STORE decompression")}},l.DEFLATE=i("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(i,r,l){var c=i("./utils"),d=(function(){for(var h,p=[],f=0;f<256;f++){h=f;for(var b=0;b<8;b++)h=1&h?3988292384^h>>>1:h>>>1;p[f]=h}return p})();r.exports=function(h,p){return h!==void 0&&h.length?c.getTypeOf(h)!=="string"?(function(f,b,y,w){var v=d,_=w+y;f^=-1;for(var $=w;$<_;$++)f=f>>>8^v[255&(f^b[$])];return-1^f})(0|p,h,h.length,0):(function(f,b,y,w){var v=d,_=w+y;f^=-1;for(var $=w;$<_;$++)f=f>>>8^v[255&(f^b.charCodeAt($))];return-1^f})(0|p,h,h.length,0):0}},{"./utils":32}],5:[function(i,r,l){l.base64=!1,l.binary=!1,l.dir=!1,l.createFolders=!0,l.date=null,l.compression=null,l.compressionOptions=null,l.comment=null,l.unixPermissions=null,l.dosPermissions=null},{}],6:[function(i,r,l){var c=null;c=typeof Promise<"u"?Promise:i("lie"),r.exports={Promise:c}},{lie:37}],7:[function(i,r,l){var c=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",d=i("pako"),h=i("./utils"),p=i("./stream/GenericWorker"),f=c?"uint8array":"array";function b(y,w){p.call(this,"FlateWorker/"+y),this._pako=null,this._pakoAction=y,this._pakoOptions=w,this.meta={}}l.magic="\b\0",h.inherits(b,p),b.prototype.processChunk=function(y){this.meta=y.meta,this._pako===null&&this._createPako(),this._pako.push(h.transformTo(f,y.data),!1)},b.prototype.flush=function(){p.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},b.prototype.cleanUp=function(){p.prototype.cleanUp.call(this),this._pako=null},b.prototype._createPako=function(){this._pako=new d[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var y=this;this._pako.onData=function(w){y.push({data:w,meta:y.meta})}},l.compressWorker=function(y){return new b("Deflate",y)},l.uncompressWorker=function(){return new b("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(i,r,l){function c(v,_){var $,S="";for($=0;$<_;$++)S+=String.fromCharCode(255&v),v>>>=8;return S}function d(v,_,$,S,T,E){var D,M,P=v.file,W=v.compression,G=E!==f.utf8encode,z=h.transformTo("string",E(P.name)),Z=h.transformTo("string",f.utf8encode(P.name)),he=P.comment,Ce=h.transformTo("string",E(he)),R=h.transformTo("string",f.utf8encode(he)),K=Z.length!==P.name.length,C=R.length!==he.length,Q="",ve="",ce="",ne=P.dir,me=P.date,re={crc32:0,compressedSize:0,uncompressedSize:0};_&&!$||(re.crc32=v.crc32,re.compressedSize=v.compressedSize,re.uncompressedSize=v.uncompressedSize);var B=0;_&&(B|=8),G||!K&&!C||(B|=2048);var N=0,te=0;ne&&(N|=16),T==="UNIX"?(te=798,N|=(function(se,j){var Te=se;return se||(Te=j?16893:33204),(65535&Te)<<16})(P.unixPermissions,ne)):(te=20,N|=(function(se){return 63&(se||0)})(P.dosPermissions)),D=me.getUTCHours(),D<<=6,D|=me.getUTCMinutes(),D<<=5,D|=me.getUTCSeconds()/2,M=me.getUTCFullYear()-1980,M<<=4,M|=me.getUTCMonth()+1,M<<=5,M|=me.getUTCDate(),K&&(ve=c(1,1)+c(b(z),4)+Z,Q+="up"+c(ve.length,2)+ve),C&&(ce=c(1,1)+c(b(Ce),4)+R,Q+="uc"+c(ce.length,2)+ce);var q="";return q+=` +\0`,q+=c(B,2),q+=W.magic,q+=c(D,2),q+=c(M,2),q+=c(re.crc32,4),q+=c(re.compressedSize,4),q+=c(re.uncompressedSize,4),q+=c(z.length,2),q+=c(Q.length,2),{fileRecord:y.LOCAL_FILE_HEADER+q+z+Q,dirRecord:y.CENTRAL_FILE_HEADER+c(te,2)+q+c(Ce.length,2)+"\0\0\0\0"+c(N,4)+c(S,4)+z+Q+Ce}}var h=i("../utils"),p=i("../stream/GenericWorker"),f=i("../utf8"),b=i("../crc32"),y=i("../signature");function w(v,_,$,S){p.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=_,this.zipPlatform=$,this.encodeFileName=S,this.streamFiles=v,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}h.inherits(w,p),w.prototype.push=function(v){var _=v.meta.percent||0,$=this.entriesCount,S=this._sources.length;this.accumulate?this.contentBuffer.push(v):(this.bytesWritten+=v.data.length,p.prototype.push.call(this,{data:v.data,meta:{currentFile:this.currentFile,percent:$?(_+100*($-S-1))/$:100}}))},w.prototype.openedSource=function(v){this.currentSourceOffset=this.bytesWritten,this.currentFile=v.file.name;var _=this.streamFiles&&!v.file.dir;if(_){var $=d(v,_,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:$.fileRecord,meta:{percent:0}})}else this.accumulate=!0},w.prototype.closedSource=function(v){this.accumulate=!1;var _=this.streamFiles&&!v.file.dir,$=d(v,_,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push($.dirRecord),_)this.push({data:(function(S){return y.DATA_DESCRIPTOR+c(S.crc32,4)+c(S.compressedSize,4)+c(S.uncompressedSize,4)})(v),meta:{percent:100}});else for(this.push({data:$.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},w.prototype.flush=function(){for(var v=this.bytesWritten,_=0;_=this.index;p--)f=(f<<8)+this.byteAt(p);return this.index+=h,f},readString:function(h){return c.transformTo("string",this.readData(h))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var h=this.readInt(4);return new Date(Date.UTC(1980+(h>>25&127),(h>>21&15)-1,h>>16&31,h>>11&31,h>>5&63,(31&h)<<1))}},r.exports=d},{"../utils":32}],19:[function(i,r,l){var c=i("./Uint8ArrayReader");function d(h){c.call(this,h)}i("../utils").inherits(d,c),d.prototype.readData=function(h){this.checkOffset(h);var p=this.data.slice(this.zero+this.index,this.zero+this.index+h);return this.index+=h,p},r.exports=d},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(i,r,l){var c=i("./DataReader");function d(h){c.call(this,h)}i("../utils").inherits(d,c),d.prototype.byteAt=function(h){return this.data.charCodeAt(this.zero+h)},d.prototype.lastIndexOfSignature=function(h){return this.data.lastIndexOf(h)-this.zero},d.prototype.readAndCheckSignature=function(h){return h===this.readData(4)},d.prototype.readData=function(h){this.checkOffset(h);var p=this.data.slice(this.zero+this.index,this.zero+this.index+h);return this.index+=h,p},r.exports=d},{"../utils":32,"./DataReader":18}],21:[function(i,r,l){var c=i("./ArrayReader");function d(h){c.call(this,h)}i("../utils").inherits(d,c),d.prototype.readData=function(h){if(this.checkOffset(h),h===0)return new Uint8Array(0);var p=this.data.subarray(this.zero+this.index,this.zero+this.index+h);return this.index+=h,p},r.exports=d},{"../utils":32,"./ArrayReader":17}],22:[function(i,r,l){var c=i("../utils"),d=i("../support"),h=i("./ArrayReader"),p=i("./StringReader"),f=i("./NodeBufferReader"),b=i("./Uint8ArrayReader");r.exports=function(y){var w=c.getTypeOf(y);return c.checkSupport(w),w!=="string"||d.uint8array?w==="nodebuffer"?new f(y):d.uint8array?new b(c.transformTo("uint8array",y)):new h(c.transformTo("array",y)):new p(y)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(i,r,l){l.LOCAL_FILE_HEADER="PK",l.CENTRAL_FILE_HEADER="PK",l.CENTRAL_DIRECTORY_END="PK",l.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",l.ZIP64_CENTRAL_DIRECTORY_END="PK",l.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(i,r,l){var c=i("./GenericWorker"),d=i("../utils");function h(p){c.call(this,"ConvertWorker to "+p),this.destType=p}d.inherits(h,c),h.prototype.processChunk=function(p){this.push({data:d.transformTo(this.destType,p.data),meta:p.meta})},r.exports=h},{"../utils":32,"./GenericWorker":28}],25:[function(i,r,l){var c=i("./GenericWorker"),d=i("../crc32");function h(){c.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}i("../utils").inherits(h,c),h.prototype.processChunk=function(p){this.streamInfo.crc32=d(p.data,this.streamInfo.crc32||0),this.push(p)},r.exports=h},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(i,r,l){var c=i("../utils"),d=i("./GenericWorker");function h(p){d.call(this,"DataLengthProbe for "+p),this.propName=p,this.withStreamInfo(p,0)}c.inherits(h,d),h.prototype.processChunk=function(p){if(p){var f=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=f+p.data.length}d.prototype.processChunk.call(this,p)},r.exports=h},{"../utils":32,"./GenericWorker":28}],27:[function(i,r,l){var c=i("../utils"),d=i("./GenericWorker");function h(p){d.call(this,"DataWorker");var f=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,p.then(function(b){f.dataIsReady=!0,f.data=b,f.max=b&&b.length||0,f.type=c.getTypeOf(b),f.isPaused||f._tickAndRepeat()},function(b){f.error(b)})}c.inherits(h,d),h.prototype.cleanUp=function(){d.prototype.cleanUp.call(this),this.data=null},h.prototype.resume=function(){return!!d.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,c.delay(this._tickAndRepeat,[],this)),!0)},h.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(c.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},h.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var p=null,f=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":p=this.data.substring(this.index,f);break;case"uint8array":p=this.data.subarray(this.index,f);break;case"array":case"nodebuffer":p=this.data.slice(this.index,f)}return this.index=f,this.push({data:p,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=h},{"../utils":32,"./GenericWorker":28}],28:[function(i,r,l){function c(d){this.name=d||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}c.prototype={push:function(d){this.emit("data",d)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(d){this.emit("error",d)}return!0},error:function(d){return!this.isFinished&&(this.isPaused?this.generatedError=d:(this.isFinished=!0,this.emit("error",d),this.previous&&this.previous.error(d),this.cleanUp()),!0)},on:function(d,h){return this._listeners[d].push(h),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(d,h){if(this._listeners[d])for(var p=0;p "+d:d}},r.exports=c},{}],29:[function(i,r,l){var c=i("../utils"),d=i("./ConvertWorker"),h=i("./GenericWorker"),p=i("../base64"),f=i("../support"),b=i("../external"),y=null;if(f.nodestream)try{y=i("../nodejs/NodejsStreamOutputAdapter")}catch{}function w(_,$){return new b.Promise(function(S,T){var E=[],D=_._internalType,M=_._outputType,P=_._mimeType;_.on("data",function(W,G){E.push(W),$&&$(G)}).on("error",function(W){E=[],T(W)}).on("end",function(){try{var W=(function(G,z,Z){switch(G){case"blob":return c.newBlob(c.transformTo("arraybuffer",z),Z);case"base64":return p.encode(z);default:return c.transformTo(G,z)}})(M,(function(G,z){var Z,he=0,Ce=null,R=0;for(Z=0;Z"u")l.blob=!1;else{var c=new ArrayBuffer(0);try{l.blob=new Blob([c],{type:"application/zip"}).size===0}catch{try{var d=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);d.append(c),l.blob=d.getBlob("application/zip").size===0}catch{l.blob=!1}}}try{l.nodestream=!!i("readable-stream").Readable}catch{l.nodestream=!1}},{"readable-stream":16}],31:[function(i,r,l){for(var c=i("./utils"),d=i("./support"),h=i("./nodejsUtils"),p=i("./stream/GenericWorker"),f=new Array(256),b=0;b<256;b++)f[b]=252<=b?6:248<=b?5:240<=b?4:224<=b?3:192<=b?2:1;f[254]=f[254]=1;function y(){p.call(this,"utf-8 decode"),this.leftOver=null}function w(){p.call(this,"utf-8 encode")}l.utf8encode=function(v){return d.nodebuffer?h.newBufferFrom(v,"utf-8"):(function(_){var $,S,T,E,D,M=_.length,P=0;for(E=0;E>>6:(S<65536?$[D++]=224|S>>>12:($[D++]=240|S>>>18,$[D++]=128|S>>>12&63),$[D++]=128|S>>>6&63),$[D++]=128|63&S);return $})(v)},l.utf8decode=function(v){return d.nodebuffer?c.transformTo("nodebuffer",v).toString("utf-8"):(function(_){var $,S,T,E,D=_.length,M=new Array(2*D);for($=S=0;$>10&1023,M[S++]=56320|1023&T)}return M.length!==S&&(M.subarray?M=M.subarray(0,S):M.length=S),c.applyFromCharCode(M)})(v=c.transformTo(d.uint8array?"uint8array":"array",v))},c.inherits(y,p),y.prototype.processChunk=function(v){var _=c.transformTo(d.uint8array?"uint8array":"array",v.data);if(this.leftOver&&this.leftOver.length){if(d.uint8array){var $=_;(_=new Uint8Array($.length+this.leftOver.length)).set(this.leftOver,0),_.set($,this.leftOver.length)}else _=this.leftOver.concat(_);this.leftOver=null}var S=(function(E,D){var M;for((D=D||E.length)>E.length&&(D=E.length),M=D-1;0<=M&&(192&E[M])==128;)M--;return M<0||M===0?D:M+f[E[M]]>D?M:D})(_),T=_;S!==_.length&&(d.uint8array?(T=_.subarray(0,S),this.leftOver=_.subarray(S,_.length)):(T=_.slice(0,S),this.leftOver=_.slice(S,_.length))),this.push({data:l.utf8decode(T),meta:v.meta})},y.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:l.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},l.Utf8DecodeWorker=y,c.inherits(w,p),w.prototype.processChunk=function(v){this.push({data:l.utf8encode(v.data),meta:v.meta})},l.Utf8EncodeWorker=w},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(i,r,l){var c=i("./support"),d=i("./base64"),h=i("./nodejsUtils"),p=i("./external");function f($){return $}function b($,S){for(var T=0;T<$.length;++T)S[T]=255&$.charCodeAt(T);return S}i("setimmediate"),l.newBlob=function($,S){l.checkSupport("blob");try{return new Blob([$],{type:S})}catch{try{var T=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return T.append($),T.getBlob(S)}catch{throw new Error("Bug : can't construct the Blob.")}}};var y={stringifyByChunk:function($,S,T){var E=[],D=0,M=$.length;if(M<=T)return String.fromCharCode.apply(null,$);for(;D>8;this.dir=!!(16&this.externalFileAttributes),v==0&&(this.dosPermissions=63&this.externalFileAttributes),v==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var v=c(this.extraFields[1].value);this.uncompressedSize===d.MAX_VALUE_32BITS&&(this.uncompressedSize=v.readInt(8)),this.compressedSize===d.MAX_VALUE_32BITS&&(this.compressedSize=v.readInt(8)),this.localHeaderOffset===d.MAX_VALUE_32BITS&&(this.localHeaderOffset=v.readInt(8)),this.diskNumberStart===d.MAX_VALUE_32BITS&&(this.diskNumberStart=v.readInt(4))}},readExtraFields:function(v){var _,$,S,T=v.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});v.index+4>>6:(v<65536?w[S++]=224|v>>>12:(w[S++]=240|v>>>18,w[S++]=128|v>>>12&63),w[S++]=128|v>>>6&63),w[S++]=128|63&v);return w},l.buf2binstring=function(y){return b(y,y.length)},l.binstring2buf=function(y){for(var w=new c.Buf8(y.length),v=0,_=w.length;v<_;v++)w[v]=y.charCodeAt(v);return w},l.buf2string=function(y,w){var v,_,$,S,T=w||y.length,E=new Array(2*T);for(v=_=0;v>10&1023,E[_++]=56320|1023&$)}return b(E,_)},l.utf8border=function(y,w){var v;for((w=w||y.length)>y.length&&(w=y.length),v=w-1;0<=v&&(192&y[v])==128;)v--;return v<0||v===0?w:v+p[y[v]]>w?v:w}},{"./common":41}],43:[function(i,r,l){r.exports=function(c,d,h,p){for(var f=65535&c|0,b=c>>>16&65535|0,y=0;h!==0;){for(h-=y=2e3>>1:d>>>1;h[p]=d}return h})();r.exports=function(d,h,p,f){var b=c,y=f+p;d^=-1;for(var w=f;w>>8^b[255&(d^h[w])];return-1^d}},{}],46:[function(i,r,l){var c,d=i("../utils/common"),h=i("./trees"),p=i("./adler32"),f=i("./crc32"),b=i("./messages"),y=0,w=4,v=0,_=-2,$=-1,S=4,T=2,E=8,D=9,M=286,P=30,W=19,G=2*M+1,z=15,Z=3,he=258,Ce=he+Z+1,R=42,K=113,C=1,Q=2,ve=3,ce=4;function ne(k,X){return k.msg=b[X],X}function me(k){return(k<<1)-(4k.avail_out&&(Y=k.avail_out),Y!==0&&(d.arraySet(k.output,X.pending_buf,X.pending_out,Y,k.next_out),k.next_out+=Y,X.pending_out+=Y,k.total_out+=Y,k.avail_out-=Y,X.pending-=Y,X.pending===0&&(X.pending_out=0))}function N(k,X){h._tr_flush_block(k,0<=k.block_start?k.block_start:-1,k.strstart-k.block_start,X),k.block_start=k.strstart,B(k.strm)}function te(k,X){k.pending_buf[k.pending++]=X}function q(k,X){k.pending_buf[k.pending++]=X>>>8&255,k.pending_buf[k.pending++]=255&X}function se(k,X){var Y,O,A=k.max_chain_length,U=k.strstart,H=k.prev_length,ue=k.nice_match,V=k.strstart>k.w_size-Ce?k.strstart-(k.w_size-Ce):0,be=k.window,pe=k.w_mask,fe=k.prev,Le=k.strstart+he,Ue=be[U+H-1],Be=be[U+H];k.prev_length>=k.good_match&&(A>>=2),ue>k.lookahead&&(ue=k.lookahead);do if(be[(Y=X)+H]===Be&&be[Y+H-1]===Ue&&be[Y]===be[U]&&be[++Y]===be[U+1]){U+=2,Y++;do;while(be[++U]===be[++Y]&&be[++U]===be[++Y]&&be[++U]===be[++Y]&&be[++U]===be[++Y]&&be[++U]===be[++Y]&&be[++U]===be[++Y]&&be[++U]===be[++Y]&&be[++U]===be[++Y]&&UV&&--A!=0);return H<=k.lookahead?H:k.lookahead}function j(k){var X,Y,O,A,U,H,ue,V,be,pe,fe=k.w_size;do{if(A=k.window_size-k.lookahead-k.strstart,k.strstart>=fe+(fe-Ce)){for(d.arraySet(k.window,k.window,fe,fe,0),k.match_start-=fe,k.strstart-=fe,k.block_start-=fe,X=Y=k.hash_size;O=k.head[--X],k.head[X]=fe<=O?O-fe:0,--Y;);for(X=Y=fe;O=k.prev[--X],k.prev[X]=fe<=O?O-fe:0,--Y;);A+=fe}if(k.strm.avail_in===0)break;if(H=k.strm,ue=k.window,V=k.strstart+k.lookahead,be=A,pe=void 0,pe=H.avail_in,be=Z)for(U=k.strstart-k.insert,k.ins_h=k.window[U],k.ins_h=(k.ins_h<=Z&&(k.ins_h=(k.ins_h<=Z)if(O=h._tr_tally(k,k.strstart-k.match_start,k.match_length-Z),k.lookahead-=k.match_length,k.match_length<=k.max_lazy_match&&k.lookahead>=Z){for(k.match_length--;k.strstart++,k.ins_h=(k.ins_h<=Z&&(k.ins_h=(k.ins_h<=Z&&k.match_length<=k.prev_length){for(A=k.strstart+k.lookahead-Z,O=h._tr_tally(k,k.strstart-1-k.prev_match,k.prev_length-Z),k.lookahead-=k.prev_length-1,k.prev_length-=2;++k.strstart<=A&&(k.ins_h=(k.ins_h<k.pending_buf_size-5&&(Y=k.pending_buf_size-5);;){if(k.lookahead<=1){if(j(k),k.lookahead===0&&X===y)return C;if(k.lookahead===0)break}k.strstart+=k.lookahead,k.lookahead=0;var O=k.block_start+Y;if((k.strstart===0||k.strstart>=O)&&(k.lookahead=k.strstart-O,k.strstart=O,N(k,!1),k.strm.avail_out===0)||k.strstart-k.block_start>=k.w_size-Ce&&(N(k,!1),k.strm.avail_out===0))return C}return k.insert=0,X===w?(N(k,!0),k.strm.avail_out===0?ve:ce):(k.strstart>k.block_start&&(N(k,!1),k.strm.avail_out),C)}),new we(4,4,8,4,Te),new we(4,5,16,8,Te),new we(4,6,32,32,Te),new we(4,4,16,16,ae),new we(8,16,32,32,ae),new we(8,16,128,128,ae),new we(8,32,128,256,ae),new we(32,128,258,1024,ae),new we(32,258,258,4096,ae)],l.deflateInit=function(k,X){return We(k,X,E,15,8,0)},l.deflateInit2=We,l.deflateReset=Ae,l.deflateResetKeep=Ne,l.deflateSetHeader=function(k,X){return k&&k.state?k.state.wrap!==2?_:(k.state.gzhead=X,v):_},l.deflate=function(k,X){var Y,O,A,U;if(!k||!k.state||5>8&255),te(O,O.gzhead.time>>16&255),te(O,O.gzhead.time>>24&255),te(O,O.level===9?2:2<=O.strategy||O.level<2?4:0),te(O,255&O.gzhead.os),O.gzhead.extra&&O.gzhead.extra.length&&(te(O,255&O.gzhead.extra.length),te(O,O.gzhead.extra.length>>8&255)),O.gzhead.hcrc&&(k.adler=f(k.adler,O.pending_buf,O.pending,0)),O.gzindex=0,O.status=69):(te(O,0),te(O,0),te(O,0),te(O,0),te(O,0),te(O,O.level===9?2:2<=O.strategy||O.level<2?4:0),te(O,3),O.status=K);else{var H=E+(O.w_bits-8<<4)<<8;H|=(2<=O.strategy||O.level<2?0:O.level<6?1:O.level===6?2:3)<<6,O.strstart!==0&&(H|=32),H+=31-H%31,O.status=K,q(O,H),O.strstart!==0&&(q(O,k.adler>>>16),q(O,65535&k.adler)),k.adler=1}if(O.status===69)if(O.gzhead.extra){for(A=O.pending;O.gzindex<(65535&O.gzhead.extra.length)&&(O.pending!==O.pending_buf_size||(O.gzhead.hcrc&&O.pending>A&&(k.adler=f(k.adler,O.pending_buf,O.pending-A,A)),B(k),A=O.pending,O.pending!==O.pending_buf_size));)te(O,255&O.gzhead.extra[O.gzindex]),O.gzindex++;O.gzhead.hcrc&&O.pending>A&&(k.adler=f(k.adler,O.pending_buf,O.pending-A,A)),O.gzindex===O.gzhead.extra.length&&(O.gzindex=0,O.status=73)}else O.status=73;if(O.status===73)if(O.gzhead.name){A=O.pending;do{if(O.pending===O.pending_buf_size&&(O.gzhead.hcrc&&O.pending>A&&(k.adler=f(k.adler,O.pending_buf,O.pending-A,A)),B(k),A=O.pending,O.pending===O.pending_buf_size)){U=1;break}U=O.gzindexA&&(k.adler=f(k.adler,O.pending_buf,O.pending-A,A)),U===0&&(O.gzindex=0,O.status=91)}else O.status=91;if(O.status===91)if(O.gzhead.comment){A=O.pending;do{if(O.pending===O.pending_buf_size&&(O.gzhead.hcrc&&O.pending>A&&(k.adler=f(k.adler,O.pending_buf,O.pending-A,A)),B(k),A=O.pending,O.pending===O.pending_buf_size)){U=1;break}U=O.gzindexA&&(k.adler=f(k.adler,O.pending_buf,O.pending-A,A)),U===0&&(O.status=103)}else O.status=103;if(O.status===103&&(O.gzhead.hcrc?(O.pending+2>O.pending_buf_size&&B(k),O.pending+2<=O.pending_buf_size&&(te(O,255&k.adler),te(O,k.adler>>8&255),k.adler=0,O.status=K)):O.status=K),O.pending!==0){if(B(k),k.avail_out===0)return O.last_flush=-1,v}else if(k.avail_in===0&&me(X)<=me(Y)&&X!==w)return ne(k,-5);if(O.status===666&&k.avail_in!==0)return ne(k,-5);if(k.avail_in!==0||O.lookahead!==0||X!==y&&O.status!==666){var ue=O.strategy===2?(function(V,be){for(var pe;;){if(V.lookahead===0&&(j(V),V.lookahead===0)){if(be===y)return C;break}if(V.match_length=0,pe=h._tr_tally(V,0,V.window[V.strstart]),V.lookahead--,V.strstart++,pe&&(N(V,!1),V.strm.avail_out===0))return C}return V.insert=0,be===w?(N(V,!0),V.strm.avail_out===0?ve:ce):V.last_lit&&(N(V,!1),V.strm.avail_out===0)?C:Q})(O,X):O.strategy===3?(function(V,be){for(var pe,fe,Le,Ue,Be=V.window;;){if(V.lookahead<=he){if(j(V),V.lookahead<=he&&be===y)return C;if(V.lookahead===0)break}if(V.match_length=0,V.lookahead>=Z&&0V.lookahead&&(V.match_length=V.lookahead)}if(V.match_length>=Z?(pe=h._tr_tally(V,1,V.match_length-Z),V.lookahead-=V.match_length,V.strstart+=V.match_length,V.match_length=0):(pe=h._tr_tally(V,0,V.window[V.strstart]),V.lookahead--,V.strstart++),pe&&(N(V,!1),V.strm.avail_out===0))return C}return V.insert=0,be===w?(N(V,!0),V.strm.avail_out===0?ve:ce):V.last_lit&&(N(V,!1),V.strm.avail_out===0)?C:Q})(O,X):c[O.level].func(O,X);if(ue!==ve&&ue!==ce||(O.status=666),ue===C||ue===ve)return k.avail_out===0&&(O.last_flush=-1),v;if(ue===Q&&(X===1?h._tr_align(O):X!==5&&(h._tr_stored_block(O,0,0,!1),X===3&&(re(O.head),O.lookahead===0&&(O.strstart=0,O.block_start=0,O.insert=0))),B(k),k.avail_out===0))return O.last_flush=-1,v}return X!==w?v:O.wrap<=0?1:(O.wrap===2?(te(O,255&k.adler),te(O,k.adler>>8&255),te(O,k.adler>>16&255),te(O,k.adler>>24&255),te(O,255&k.total_in),te(O,k.total_in>>8&255),te(O,k.total_in>>16&255),te(O,k.total_in>>24&255)):(q(O,k.adler>>>16),q(O,65535&k.adler)),B(k),0=Y.w_size&&(U===0&&(re(Y.head),Y.strstart=0,Y.block_start=0,Y.insert=0),be=new d.Buf8(Y.w_size),d.arraySet(be,X,pe-Y.w_size,Y.w_size,0),X=be,pe=Y.w_size),H=k.avail_in,ue=k.next_in,V=k.input,k.avail_in=pe,k.next_in=0,k.input=X,j(Y);Y.lookahead>=Z;){for(O=Y.strstart,A=Y.lookahead-(Z-1);Y.ins_h=(Y.ins_h<>>=Z=z>>>24,D-=Z,(Z=z>>>16&255)===0)Q[b++]=65535&z;else{if(!(16&Z)){if((64&Z)==0){z=M[(65535&z)+(E&(1<>>=Z,D-=Z),D<15&&(E+=C[p++]<>>=Z=z>>>24,D-=Z,!(16&(Z=z>>>16&255))){if((64&Z)==0){z=P[(65535&z)+(E&(1<>>=Z,D-=Z,(Z=b-y)>3,E&=(1<<(D-=he<<3))-1,c.next_in=p,c.next_out=b,c.avail_in=p>>24&255)+(R>>>8&65280)+((65280&R)<<8)+((255&R)<<24)}function E(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new c.Buf16(320),this.work=new c.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function D(R){var K;return R&&R.state?(K=R.state,R.total_in=R.total_out=K.total=0,R.msg="",K.wrap&&(R.adler=1&K.wrap),K.mode=_,K.last=0,K.havedict=0,K.dmax=32768,K.head=null,K.hold=0,K.bits=0,K.lencode=K.lendyn=new c.Buf32($),K.distcode=K.distdyn=new c.Buf32(S),K.sane=1,K.back=-1,w):v}function M(R){var K;return R&&R.state?((K=R.state).wsize=0,K.whave=0,K.wnext=0,D(R)):v}function P(R,K){var C,Q;return R&&R.state?(Q=R.state,K<0?(C=0,K=-K):(C=1+(K>>4),K<48&&(K&=15)),K&&(K<8||15=ce.wsize?(c.arraySet(ce.window,K,C-ce.wsize,ce.wsize,0),ce.wnext=0,ce.whave=ce.wsize):(Q<(ve=ce.wsize-ce.wnext)&&(ve=Q),c.arraySet(ce.window,K,C-Q,ve,ce.wnext),(Q-=ve)?(c.arraySet(ce.window,K,C-Q,Q,0),ce.wnext=Q,ce.whave=ce.wsize):(ce.wnext+=ve,ce.wnext===ce.wsize&&(ce.wnext=0),ce.whave>>8&255,C.check=h(C.check,U,2,0),N=B=0,C.mode=2;break}if(C.flags=0,C.head&&(C.head.done=!1),!(1&C.wrap)||(((255&B)<<8)+(B>>8))%31){R.msg="incorrect header check",C.mode=30;break}if((15&B)!=8){R.msg="unknown compression method",C.mode=30;break}if(N-=4,k=8+(15&(B>>>=4)),C.wbits===0)C.wbits=k;else if(k>C.wbits){R.msg="invalid window size",C.mode=30;break}C.dmax=1<>8&1),512&C.flags&&(U[0]=255&B,U[1]=B>>>8&255,C.check=h(C.check,U,2,0)),N=B=0,C.mode=3;case 3:for(;N<32;){if(me===0)break e;me--,B+=Q[ce++]<>>8&255,U[2]=B>>>16&255,U[3]=B>>>24&255,C.check=h(C.check,U,4,0)),N=B=0,C.mode=4;case 4:for(;N<16;){if(me===0)break e;me--,B+=Q[ce++]<>8),512&C.flags&&(U[0]=255&B,U[1]=B>>>8&255,C.check=h(C.check,U,2,0)),N=B=0,C.mode=5;case 5:if(1024&C.flags){for(;N<16;){if(me===0)break e;me--,B+=Q[ce++]<>>8&255,C.check=h(C.check,U,2,0)),N=B=0}else C.head&&(C.head.extra=null);C.mode=6;case 6:if(1024&C.flags&&(me<(se=C.length)&&(se=me),se&&(C.head&&(k=C.head.extra_len-C.length,C.head.extra||(C.head.extra=new Array(C.head.extra_len)),c.arraySet(C.head.extra,Q,ce,se,k)),512&C.flags&&(C.check=h(C.check,Q,se,ce)),me-=se,ce+=se,C.length-=se),C.length))break e;C.length=0,C.mode=7;case 7:if(2048&C.flags){if(me===0)break e;for(se=0;k=Q[ce+se++],C.head&&k&&C.length<65536&&(C.head.name+=String.fromCharCode(k)),k&&se>9&1,C.head.done=!0),R.adler=C.check=0,C.mode=12;break;case 10:for(;N<32;){if(me===0)break e;me--,B+=Q[ce++]<>>=7&N,N-=7&N,C.mode=27;break}for(;N<3;){if(me===0)break e;me--,B+=Q[ce++]<>>=1)){case 0:C.mode=14;break;case 1:if(he(C),C.mode=20,K!==6)break;B>>>=2,N-=2;break e;case 2:C.mode=17;break;case 3:R.msg="invalid block type",C.mode=30}B>>>=2,N-=2;break;case 14:for(B>>>=7&N,N-=7&N;N<32;){if(me===0)break e;me--,B+=Q[ce++]<>>16^65535)){R.msg="invalid stored block lengths",C.mode=30;break}if(C.length=65535&B,N=B=0,C.mode=15,K===6)break e;case 15:C.mode=16;case 16:if(se=C.length){if(me>>=5,N-=5,C.ndist=1+(31&B),B>>>=5,N-=5,C.ncode=4+(15&B),B>>>=4,N-=4,286>>=3,N-=3}for(;C.have<19;)C.lens[H[C.have++]]=0;if(C.lencode=C.lendyn,C.lenbits=7,Y={bits:C.lenbits},X=f(0,C.lens,0,19,C.lencode,0,C.work,Y),C.lenbits=Y.bits,X){R.msg="invalid code lengths set",C.mode=30;break}C.have=0,C.mode=19;case 19:for(;C.have>>16&255,Ie=65535&A,!((ae=A>>>24)<=N);){if(me===0)break e;me--,B+=Q[ce++]<>>=ae,N-=ae,C.lens[C.have++]=Ie;else{if(Ie===16){for(O=ae+2;N>>=ae,N-=ae,C.have===0){R.msg="invalid bit length repeat",C.mode=30;break}k=C.lens[C.have-1],se=3+(3&B),B>>>=2,N-=2}else if(Ie===17){for(O=ae+3;N>>=ae)),B>>>=3,N-=3}else{for(O=ae+7;N>>=ae)),B>>>=7,N-=7}if(C.have+se>C.nlen+C.ndist){R.msg="invalid bit length repeat",C.mode=30;break}for(;se--;)C.lens[C.have++]=k}}if(C.mode===30)break;if(C.lens[256]===0){R.msg="invalid code -- missing end-of-block",C.mode=30;break}if(C.lenbits=9,Y={bits:C.lenbits},X=f(b,C.lens,0,C.nlen,C.lencode,0,C.work,Y),C.lenbits=Y.bits,X){R.msg="invalid literal/lengths set",C.mode=30;break}if(C.distbits=6,C.distcode=C.distdyn,Y={bits:C.distbits},X=f(y,C.lens,C.nlen,C.ndist,C.distcode,0,C.work,Y),C.distbits=Y.bits,X){R.msg="invalid distances set",C.mode=30;break}if(C.mode=20,K===6)break e;case 20:C.mode=21;case 21:if(6<=me&&258<=re){R.next_out=ne,R.avail_out=re,R.next_in=ce,R.avail_in=me,C.hold=B,C.bits=N,p(R,q),ne=R.next_out,ve=R.output,re=R.avail_out,ce=R.next_in,Q=R.input,me=R.avail_in,B=C.hold,N=C.bits,C.mode===12&&(C.back=-1);break}for(C.back=0;we=(A=C.lencode[B&(1<>>16&255,Ie=65535&A,!((ae=A>>>24)<=N);){if(me===0)break e;me--,B+=Q[ce++]<>Ne)])>>>16&255,Ie=65535&A,!(Ne+(ae=A>>>24)<=N);){if(me===0)break e;me--,B+=Q[ce++]<>>=Ne,N-=Ne,C.back+=Ne}if(B>>>=ae,N-=ae,C.back+=ae,C.length=Ie,we===0){C.mode=26;break}if(32&we){C.back=-1,C.mode=12;break}if(64&we){R.msg="invalid literal/length code",C.mode=30;break}C.extra=15&we,C.mode=22;case 22:if(C.extra){for(O=C.extra;N>>=C.extra,N-=C.extra,C.back+=C.extra}C.was=C.length,C.mode=23;case 23:for(;we=(A=C.distcode[B&(1<>>16&255,Ie=65535&A,!((ae=A>>>24)<=N);){if(me===0)break e;me--,B+=Q[ce++]<>Ne)])>>>16&255,Ie=65535&A,!(Ne+(ae=A>>>24)<=N);){if(me===0)break e;me--,B+=Q[ce++]<>>=Ne,N-=Ne,C.back+=Ne}if(B>>>=ae,N-=ae,C.back+=ae,64&we){R.msg="invalid distance code",C.mode=30;break}C.offset=Ie,C.extra=15&we,C.mode=24;case 24:if(C.extra){for(O=C.extra;N>>=C.extra,N-=C.extra,C.back+=C.extra}if(C.offset>C.dmax){R.msg="invalid distance too far back",C.mode=30;break}C.mode=25;case 25:if(re===0)break e;if(se=q-re,C.offset>se){if((se=C.offset-se)>C.whave&&C.sane){R.msg="invalid distance too far back",C.mode=30;break}j=se>C.wnext?(se-=C.wnext,C.wsize-se):C.wnext-se,se>C.length&&(se=C.length),Te=C.window}else Te=ve,j=ne-C.offset,se=C.length;for(reG?(Z=j[Te+S[K]],N[te+S[K]]):(Z=96,0),E=1<>ne)+(D-=E)]=z<<24|Z<<16|he|0,D!==0;);for(E=1<>=1;if(E!==0?(B&=E-1,B+=E):B=0,K++,--q[R]==0){if(R===Q)break;R=y[w+S[K]]}if(ve>>7)]}function te(A,U){A.pending_buf[A.pending++]=255&U,A.pending_buf[A.pending++]=U>>>8&255}function q(A,U,H){A.bi_valid>T-H?(A.bi_buf|=U<>T-A.bi_valid,A.bi_valid+=H-T):(A.bi_buf|=U<>>=1,H<<=1,0<--U;);return H>>>1}function Te(A,U,H){var ue,V,be=new Array(S+1),pe=0;for(ue=1;ue<=S;ue++)be[ue]=pe=pe+H[ue-1]<<1;for(V=0;V<=U;V++){var fe=A[2*V+1];fe!==0&&(A[2*V]=j(be[fe]++,fe))}}function ae(A){var U;for(U=0;U>1;1<=H;H--)Ne(A,be,H);for(V=Le;H=A.heap[1],A.heap[1]=A.heap[A.heap_len--],Ne(A,be,1),ue=A.heap[1],A.heap[--A.heap_max]=H,A.heap[--A.heap_max]=ue,be[2*V]=be[2*H]+be[2*ue],A.depth[V]=(A.depth[H]>=A.depth[ue]?A.depth[H]:A.depth[ue])+1,be[2*H+1]=be[2*ue+1]=V,A.heap[1]=V++,Ne(A,be,1),2<=A.heap_len;);A.heap[--A.heap_max]=A.heap[1],(function(Be,Pt){var ie,Oe,Ps,ze,Zo,Ze,At=Pt.dyn_tree,Qo=Pt.max_code,io=Pt.stat_desc.static_tree,no=Pt.stat_desc.has_stree,Un=Pt.stat_desc.extra_bits,Io=Pt.stat_desc.extra_base,Bs=Pt.stat_desc.max_length,ro=0;for(ze=0;ze<=S;ze++)Be.bl_count[ze]=0;for(At[2*Be.heap[Be.heap_max]+1]=0,ie=Be.heap_max+1;ie<$;ie++)Bs<(ze=At[2*At[2*(Oe=Be.heap[ie])+1]+1]+1)&&(ze=Bs,ro++),At[2*Oe+1]=ze,Qo>=7;V>>=1)if(1&Ue&&fe.dyn_ltree[2*Le]!==0)return d;if(fe.dyn_ltree[18]!==0||fe.dyn_ltree[20]!==0||fe.dyn_ltree[26]!==0)return h;for(Le=32;Le>>3,(be=A.static_len+3+7>>>3)<=V&&(V=be)):V=be=H+5,H+4<=V&&U!==-1?O(A,U,H,ue):A.strategy===4||be===V?(q(A,2+(ue?1:0),3),Ae(A,Ce,R)):(q(A,4+(ue?1:0),3),(function(fe,Le,Ue,Be){var Pt;for(q(fe,Le-257,5),q(fe,Ue-1,5),q(fe,Be-4,4),Pt=0;Pt>>8&255,A.pending_buf[A.d_buf+2*A.last_lit+1]=255&U,A.pending_buf[A.l_buf+A.last_lit]=255&H,A.last_lit++,U===0?A.dyn_ltree[2*H]++:(A.matches++,U--,A.dyn_ltree[2*(C[H]+y+1)]++,A.dyn_dtree[2*N(U)]++),A.last_lit===A.lit_bufsize-1},l._tr_align=function(A){q(A,2,3),se(A,D,Ce),(function(U){U.bi_valid===16?(te(U,U.bi_buf),U.bi_buf=0,U.bi_valid=0):8<=U.bi_valid&&(U.pending_buf[U.pending++]=255&U.bi_buf,U.bi_buf>>=8,U.bi_valid-=8)})(A)}},{"../utils/common":41}],53:[function(i,r,l){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(i,r,l){(function(c){(function(d,h){if(!d.setImmediate){var p,f,b,y,w=1,v={},_=!1,$=d.document,S=Object.getPrototypeOf&&Object.getPrototypeOf(d);S=S&&S.setTimeout?S:d,p={}.toString.call(d.process)==="[object process]"?function(M){process.nextTick(function(){E(M)})}:(function(){if(d.postMessage&&!d.importScripts){var M=!0,P=d.onmessage;return d.onmessage=function(){M=!1},d.postMessage("","*"),d.onmessage=P,M}})()?(y="setImmediate$"+Math.random()+"$",d.addEventListener?d.addEventListener("message",D,!1):d.attachEvent("onmessage",D),function(M){d.postMessage(y+M,"*")}):d.MessageChannel?((b=new MessageChannel).port1.onmessage=function(M){E(M.data)},function(M){b.port2.postMessage(M)}):$&&"onreadystatechange"in $.createElement("script")?(f=$.documentElement,function(M){var P=$.createElement("script");P.onreadystatechange=function(){E(M),P.onreadystatechange=null,f.removeChild(P),P=null},f.appendChild(P)}):function(M){setTimeout(E,0,M)},S.setImmediate=function(M){typeof M!="function"&&(M=new Function(""+M));for(var P=new Array(arguments.length-1),W=0;W"u"?c===void 0?this:c:self)}).call(this,typeof eo<"u"?eo:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(OC);var ase=OC.exports;const ww=Xo(ase);function lse(a){const[s,i]=_e.useState(""),[r,l]=_e.useState("");return Lt(()=>{a.socket.decrypt(a.systemConfig.native.javascriptPassword).then(c=>l(c))},[a.systemConfig,a.socket]),m.jsxs(Ut,{open:!0,onClose:()=>a.onEntered(null),fullWidth:!0,maxWidth:"sm",children:[m.jsx(ss,{children:x.I18n.t("Please enter a password for expert mode")}),m.jsx(qt,{children:m.jsx(Eo,{autoFocus:!0,margin:"dense",variant:"standard",label:x.I18n.t("Password"),type:"password",fullWidth:!0,value:s,onKeyDown:c=>{c.key==="Enter"&&s&&(c.preventDefault(),c.stopPropagation(),r===s?a.onEntered(s):a.onEntered(""))},onChange:c=>i(c.target.value)})}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",disabled:!s,onClick:()=>{r===s?a.onEntered(s):a.onEntered("")},startIcon:m.jsx(qo,{}),children:x.I18n.t("Ok")}),m.jsx(He,{color:"grey",variant:"contained",onClick:()=>a.onEntered(null),startIcon:m.jsx(so,{}),children:x.I18n.t("Cancel")})]})]})}const Gr={root:{flexGrow:1,display:"flex",width:"100%",height:"100%"},mainDiv:{width:"100%",height:"100%",overflow:"hidden"},content:a=>({width:"100%",height:"100%",backgroundColor:a.palette.background&&a.palette.background.default,position:"relative"}),menuOpenCloseButton:a=>({position:"absolute",left:0,borderRadius:"0 5px 5px 0",top:6,pt:1,cursor:"pointer",zIndex:1,height:25,width:20,background:a.palette.secondary.main,color:a.palette.primary.main,pl:"3px","&:hover":{color:"white"}}),showLogButton:a=>({position:"absolute",right:3,borderRadius:"5px 5px 0 0",bottom:0,pt:"3px",cursor:"pointer",zIndex:10,height:20,width:25,background:a.palette.secondary.main,color:a.palette.primary.main,pl:1,"&:hover":{color:"white"}})};class cse extends x.GenericApp{hosts=[];importFile=null;importFileName=null;scripts={};confirmCallback=null;changedScripts={};javascriptPassword="";constructor(s){super(s,{Connection:x.AdminConnection,translations:{en:hM,de:rB,es:ej,fr:YU,it:U5,nl:LV,pl:D6,pt:C7,ru:bq,uk:hQ,"zh-cn":rse},bottomButtons:!1,socket:{autoSubscribeLog:!0},sentryDSN:window.sentryDSN});const i=window.localStorage.getItem("JS.logSizes");let r=[80,20];if(i)try{r=JSON.parse(i)}catch{}const l=window.localStorage.getItem("JS.splitSizes");let c=[20,80];if(l)try{c=JSON.parse(l)}catch{}this.state={...this.state,splitSizes:c,logSizes:r},window.alert=d=>{console.error(d),this.showJsError(d.toString())}}onScriptsChanged=(s,i)=>{if(!s)return;let r=!1;const l={};s.startsWith("script.js.")&&(i?JSON.stringify(this.scripts[s])!==JSON.stringify(i)&&(this.scripts[s]=i,r=!0,l.scriptsHash=this.state.scriptsHash+1):this.scripts[s]&&(delete this.scripts[s],r=!0,l.scriptsHash=this.state.scriptsHash+1)),r&&this.setState(l)};onInstanceChanged=(s,i)=>{var c;if(!s)return;let r=!1;const l={};if(s.match(/^system\.adapter\.[-_\w\d]+\$/)){if(s.startsWith(`system.adapter.${this.adapterName}.`)){const d=parseInt(s.split(".").pop()||"0",10)||0;if((i==null?void 0:i.type)==="instance")this.state.instances.includes(d)||(l.instances=[...this.state.instances],l.instances.push(d),l.instances.sort(),r=!0,this.socket.subscribeState(`${i._id}.alive`,this.onInstanceAliveChange));else if(!i&&this.state.instances.includes(d)){this.socket.unsubscribeState(`${s}.alive`,this.onInstanceAliveChange),l.instances=[...this.state.instances];const h=l.instances.indexOf(d);l.instances.splice(h,1),r=!0}}(c=i==null?void 0:i.common)!=null&&c.blockly&&(this.confirmCallback=d=>d&&window.location.reload(),l.confirm=x.I18n.t("Some blocks were updated. Reload admin?"),r=!0)}r&&this.setState(l)};onHostChanged=(s,i)=>{if(s&&s.startsWith("system.host.")){if((i==null?void 0:i.type)==="host")this.hosts.includes(s)||(this.hosts.push(s),this.hosts.sort());else if(!i&&this.hosts.includes(s)){const r=this.hosts.indexOf(s);this.hosts.splice(r,1)}}};onConnectionReady(){window.systemLang=this.socket.systemLang,this.setState({ready:!1,scriptsHash:0,instances:[],updating:!1,resizing:!1,selected:null,logMessage:{},editing:[],menuOpened:window.localStorage.getItem("App.menuOpened")!=="false",menuSelectId:"",expertMode:window.localStorage.getItem("App.expertMode")==="true",logHorzLayout:window.localStorage.getItem("App.logHorzLayout")==="true",runningInstances:{},confirm:"",importFile:!1,message:"",searchText:"",hideLog:window.localStorage.getItem("App.hideLog")==="true",debugMode:!1,debugInstance:null,splitSizes:[20,80],password:""},async()=>{var d;const s={},i=await this.subscribeOnInstances();s.instances=i.instances,s.runningInstances=i.runningInstances,this.javascriptPassword=((d=this.socket.systemConfig)==null?void 0:d.native.javascriptPassword)||"",await this.readAdaptersWithBlockly();const r=await this.socket.getHosts();this.hosts=r.map(h=>h._id);const l=await this.readAllScripts();window.localStorage.getItem("App.expertMode")!=="true"&&window.localStorage.getItem("App.expertMode")!=="false"&&!this.javascriptPassword?Object.keys(l).find(h=>h.startsWith("script.js.global.")&&l[h].type==="script")&&(s.expertMode=!0):this.javascriptPassword&&(s.expertMode=!1),this.scripts=l;let c=this.state.scriptsHash;this.compareScripts(l)&&c++,s.scriptsHash=c,s.ready=!0,this.setState(s),await this.socket.subscribeObject("script.*",this.onScriptsChanged),await this.socket.subscribeObject("system.adapter.*",this.onInstanceChanged),await this.socket.subscribeObject("system.host.*",this.onHostChanged)})}async subscribeOnInstances(){const i=(await this.socket.getAdapterInstances(this.adapterName)).map(l=>parseInt(l._id.split(".").pop()||"0")).sort(),r={};i.forEach(l=>r[`system.adapter.${this.adapterName}.${l}`]=!1);for(let l=0;ls[r]=i[r]),s}async readAdaptersWithBlockly(){const s=await this.socket.getObjectViewSystem("adapter","system.adapter.","system.adapter.香");return new Promise(i=>et.loadCustomBlockly(s,()=>i()))}onInstanceAliveChange=(s,i)=>{if(s&&(s=s?s.substring(0,s.length-6):"",this.state.runningInstances[s]!==(i?i.val:!1))){const r=JSON.parse(JSON.stringify(this.state.runningInstances));r[s]=i?!!i.val:!1,this.setState({runningInstances:r})}};compareScripts(s){const i=Object.keys(this.scripts),r=Object.keys(s);if(i.length!==r.length)return this.scripts=s,!0;if(JSON.stringify(i)!==JSON.stringify(r))return this.scripts=s,!0;for(let l=0;l ${i}`),this.setState({updating:!0});try{if(((c=this.scripts[s])==null?void 0:c.type)==="script"){const d=JSON.parse(JSON.stringify(this.scripts[s].common));d.name=r||d.name,l!==void 0&&(d.engine=`system.adapter.javascript.${l}`);const h=i.split(".");h.pop();const p=h.join(".");this.scripts[p]&&this.scripts[p].type==="script"&&(h.pop(),i=`${h.join(".")}.${i.split(".").pop()}`),await this.updateScript(s,i,d)}else await this.renameGroup(s,i,r)}catch(d){d.toString().includes("canceled")||this.showJsError(d)}this.setState({updating:!1})}async renameGroup(s,i,r,l){if(l){if(l.length){let c=l.pop();if(c){const d=await this.socket.getObject(c);if(d){try{await this.socket.delObject(c)}catch{}c=i+c.substring(s.length),d._id=c,d.common=d.common||{},d.common.expert=!0,await this.socket.setObject(c,d),await this.renameGroup(s,i,r,l)}}}}else{l=[],l=Object.keys(this.scripts).filter(d=>d.startsWith(`${s}.`));let c=await this.socket.getObject(s);c=c||{common:{},type:"channel"},c.common.name=r||c.common.name||s.split(".").pop()||"",c._id=i;try{await this.socket.delObject(s)}catch{}try{await this.socket.setObject(i,c),await this.renameGroup(s,i,r,l)}catch(d){console.log(d);const h={_id:i,type:"channel",common:{name:r||s.split(".").pop()||"",expert:!0},native:{}};await this.socket.setObject(i,h),await this.renameGroup(s,i,r,l)}}}async onUpdateScript(s,i){var r;if(((r=this.scripts[s])==null?void 0:r.type)==="script")try{await this.updateScript(s,s,i)}catch(l){l.toString().includes("canceled")||this.showJsError(l)}}onSelect(s){this.scripts[s]&&this.scripts[s].common&&this.scripts[s].type==="script"&&this.setState({selected:s,menuSelectId:s},()=>setTimeout(()=>this.setState({menuSelectId:""}),300))}renderPasswordDialog(){return this.state.showPasswordDialog?m.jsx(lse,{socket:this.socket,systemConfig:this.socket.systemConfig,onEntered:s=>{s===null?this.setState({showPasswordDialog:!1,expertMode:!1,password:""}):s?this.setState({expertMode:!0,showPasswordDialog:!1,password:s}):this.setState({showPasswordDialog:!1,expertMode:!1,message:x.I18n.t("Wrong password"),password:""})}},"passwordDialog"):null}onExpertModeChange(s){var i;if(this.state.expertMode!==s)if(s&&this.javascriptPassword)this.setState({showPasswordDialog:!0});else{let r=this.state.selected;r&&!s&&((i=this.scripts[r].native)!=null&&i.protected)&&(r=this.state.editing.find(l=>{var c;return this.scripts[l]&&!((c=this.scripts[l].native)!=null&&c.protected)})||null),window.localStorage.setItem("App.expertMode",s?"true":"false"),this.setState({expertMode:s,password:"",selected:r})}}showJsError(s){this.setState({errorText:s?s.toString():""})}showMessage(s){this.setState({message:s?s.toString():""})}onDelete(s){this.socket.delObject(s).catch(i=>this.showJsError(i))}onEdit(s){this.state.selected!==s&&this.setState({selected:s})}onAddNew(s,i,r,l,c,d){const h=new RegExp(`^${s}\\.`);if(Object.keys(this.scripts).find(p=>s===p||h.test(s)))return this.showJsError(x.I18n.t("Yet exists!"));r?this.socket.setObject(s,{_id:s,type:"channel",common:{name:i,expert:!0},native:{}}).then(()=>setTimeout(()=>this.setState({menuSelectId:s},()=>setTimeout(()=>this.setState({menuSelectId:""}),300)),1e3)).catch(p=>this.showJsError(p)):(c==="Blockly"&&!d&&(d=` +//${btoa(encodeURIComponent(''))}`),this.socket.setObject(s,{_id:s,type:"script",common:{name:i,expert:!0,engineType:c||"Javascript/js",enabled:!1,engine:`system.adapter.javascript.${l||0}`,source:d||"",debug:!1,verbose:!1},native:{}}).then(()=>setTimeout(()=>this.onSelect(s),1e3)).catch(p=>this.showJsError(p)))}async updateScript(s,i,r){let l=await this.socket.getObject(s);const c={common:{}};if(r.engine!==void 0&&(c.common.engine=r.engine),r.enabled!==void 0&&(c.common.enabled=r.enabled),r.source!==void 0&&(c.common.source=r.source),r.debug!==void 0&&(c.common.debug=r.debug),r.verbose!==void 0&&(c.common.verbose=r.verbose),c.from="system.adapter.admin.0",s===i&&(l!=null&&l.common)&&r.name===l.common.name){(!r.engineType||r.engineType!==l.common.engineType)&&r.engineType!==void 0&&(c.common.engineType=r.engineType||"Javascript/js"),c.type="script",await this.socket.extendObject(s,c);return}if(l!=null&&l.common){l.common.engineType=r.engineType||l.common.engineType||"Javascript/js",await this.socket.delObject(s),c.common.engine!==void 0&&(l.common.engine=c.common.engine),c.common.enabled!==void 0&&(l.common.enabled=c.common.enabled),c.common.source!==void 0&&(l.common.source=c.common.source),c.common.name!==void 0&&(l.common.name=c.common.name),c.common.debug!==void 0&&(l.common.debug=c.common.debug),c.common.verbose!==void 0&&(l.common.verbose=c.common.verbose),l._rev!==void 0&&delete l._rev,l.common.name=r.name,l.common.expert=!0,l.type="script",l._id=i,await this.socket.setObject(i,l);return}l=c,l.common.name=r.name,l.common.expert=!0,l.type="script",l._id=i,await this.socket.setObject(i,l)}onEnableDisable(s,i){var r;if(((r=this.scripts[s])==null?void 0:r.type)==="script"){const l=this.scripts[s].common;l.enabled=i,l.expert=!0,this.updateScript(s,s,l).catch(c=>c!=="canceled"&&this.showJsError(c))}}async getLiveHost(){for(let s=0;s{if(typeof d=="string"){const h=document.createElement("a");h.href=`../../files/${d}`,document.body.appendChild(h),h.click(),h.remove()}else if(d.error&&this.showJsError(d.error),d.data){const h=document.createElement("a");h.href=`data: application/zip;base64,${d.data}`,h.download=`${r}scripts.zip`,document.body.appendChild(h),h.click(),h.remove()}})}else{const c=new ww;for(const[d,h]of Object.entries(this.scripts))if(h.type==="script"){const p=h,f=p.common.engineType==="TypeScript/ts"?"ts":p.common.engineType==="Blockly"?"blockly":p.common.engineType==="Rules"?"rules":"js";let b=`/******* (ext=${f}/engine=${p.common.engine}/debug=${p.common.debug}/verbose=${p.common.verbose}/enabled=${p.common.enabled}) *******/ +`;b+=p.common.source||"";const y=`${d.substring(10).replace(/\./g,"/")}.${f}`;c.file(y,b)}c.generateAsync({type:"blob"}).then(d=>{const h=document.createElement("a");h.href=URL.createObjectURL(d),h.download=`${r}scripts_plain.zip`,document.body.appendChild(h),h.click(),h.remove(),URL.revokeObjectURL(h.href)})}}onImport(s,i){this.importFile=s||null,this.importFileName=i||null,s?(this.confirmCallback=this.onImportConfirmed.bind(this),this.setState({importFile:!1,confirm:x.I18n.t("Existing scripts will be overwritten.")})):this.setState({importFile:!1})}async onImportConfirmed(s){let i=this.importFile;const r=this.importFileName;if(this.importFile=null,this.importFileName=null,s&&i)if(r&&/_(plain|text)\.zip$/i.test(r)){i=i.split(",")[1];try{const c=await ww.loadAsync(i,{base64:!0}),d=[];c.forEach((h,p)=>{p.dir||d.push(p.async("string").then(async f=>{const b=f.split(` +`),y=b[0]||"",w=b.slice(1).join(` +`),v=y.match(/\/\*{7}\s*\(ext=(\w+)\/engine=([^/]+)\/debug=(\w+)\/verbose=(\w+)\/enabled=(\w+)\)\s*\*{7}\//);let _="Javascript/js",$="system.adapter.javascript.0",S=!1,T=!1,E=!1;if(v){const G=v[1];$=v[2],S=v[3]==="true",T=v[4]==="true",E=v[5]==="true",G==="ts"?_="TypeScript/ts":G==="blockly"?_="Blockly":G==="rules"&&(_="Rules")}const D=h.replace(/\.\w+$/,"").replace(/\//g,"."),M=`script.js.${D}`,P=D.split(".").pop()||D,W=M.split(".");for(let G=3;G{d==="permissionError"?this.showJsError(x.I18n.t(d)):!d||d.error?this.showJsError(d?x.I18n.t(d.error||""):x.I18n.t("Unknown error")):this.showMessage(x.I18n.t("Done"))})}}toggleLogLayout(){window.localStorage.setItem("App.logHorzLayout",this.state.logHorzLayout?"false":"true"),this.setState({logHorzLayout:!this.state.logHorzLayout})}renderEditor(){var i;const s=Object.keys(this.scripts).reduce((r,l)=>r+(this.scripts[l].common.engineType==="Rules"?1:0),0);return m.jsx(On,{scriptsHash:this.state.scriptsHash,debugMode:this.state.debugMode,onDebugModeChange:r=>{r?this.setState({debugMode:!0}):this.setState({debugMode:!1,debugInstance:null})},visible:!this.state.resizing,socket:this.socket,adapterName:this.adapterName,onLocate:r=>this.setState({menuSelectId:r}),password:this.state.password,runningInstances:this.state.runningInstances,menuOpened:this.state.menuOpened,searchText:this.state.searchText,themeType:this.state.themeType,themeName:this.state.themeName,theme:this.state.theme,expertMode:this.state.expertMode,onChange:(r,l)=>this.onUpdateScript(r,l),isAnyRulesExists:s,debugInstance:this.state.debugInstance,onSelectedChange:(r,l)=>{const c={};let d=!1;r!==this.state.selected&&(d=!0,c.selected=r),JSON.stringify(l)!==JSON.stringify(this.state.editing)&&(d=!0,c.editing=[...l]),d&&this.setState(c)},onRestart:r=>this.socket.extendObject(r,{common:{enabled:!0}}),selected:this.state.selected&&((i=this.scripts[this.state.selected])==null?void 0:i.type)==="script"?this.state.selected:"",objects:this.scripts,resizing:this.state.resizing,onChangedChanged:r=>this.changedScripts=r},"editor")}showLogButton(){return m.jsx(wt,{title:x.I18n.t("Show logs"),sx:Gr.showLogButton,onClick:()=>{window.localStorage.setItem("App.hideLog","false"),this.setState({hideLog:!1,resizing:!0}),setTimeout(()=>this.setState({resizing:!1}),300)},children:m.jsx(SS,{})},"showLog")}renderErrorDialog(){return this.state.errorText?m.jsx(su,{onClose:()=>this.setState({errorText:""}),text:this.state.errorText},"dialogError"):null}renderMain(){let s;return this.state.debugMode||this.state.hideLog?s=m.jsxs(m.Fragment,{children:[!this.state.debugMode&&this.state.hideLog?this.showLogButton():void 0,this.renderEditor()]}):s=m.jsxs(c_,{direction:this.state.logHorzLayout?ft.Horizontal:ft.Vertical,initialSizes:this.state.logSizes,minWidths:[500,100],minHeights:[150,50],onResizeStarted:()=>this.setState({resizing:!0}),onResizeFinished:(i,r)=>{this.setState({logSizes:r,resizing:!1}),window.localStorage.setItem("JS.logSizes",JSON.stringify(r))},gutterClassName:this.state.themeType==="dark"?"Dark visGutter":"Light visGutter",children:[this.renderEditor(),m.jsx(ym,{verticalLayout:!this.state.logHorzLayout,onLayoutChange:()=>this.toggleLogLayout(),editing:this.state.editing,socket:this.socket,selected:this.state.selected,onHideLog:()=>{window.localStorage.setItem("App.hideLog","true"),this.setState({hideLog:!0,resizing:!0}),setTimeout(()=>this.setState({resizing:!1}),300)}},"log")]}),m.jsxs(wt,{sx:Gr.content,className:"iobVerticalSplitter",children:[m.jsx(wt,{sx:Gr.menuOpenCloseButton,onClick:()=>{window.localStorage.setItem("App.menuOpened",this.state.menuOpened?"false":"true"),this.setState({menuOpened:!this.state.menuOpened,resizing:!0}),setTimeout(()=>this.setState({resizing:!1}),300)},children:this.state.menuOpened?m.jsx(ES,{}):m.jsx(IS,{})},"closeMenu"),this.state.message?m.jsx(x.Message,{onClose:()=>this.setState({message:""}),text:this.state.message},"dialogMessage"):null,this.renderErrorDialog(),this.state.importFile?m.jsx(zm,{onClose:(i,r)=>this.onImport(i,r)},"dialogImportFile"):null,this.state.confirm?m.jsx(x.Confirm,{onClose:i=>{this.state.confirm&&this.setState({confirm:""}),this.confirmCallback&&this.confirmCallback(i),this.confirmCallback=null},text:this.state.confirm},"dialogConfirm"):null,this.renderPasswordDialog(),s]},"main")}render(){if(!this.state.ready)return m.jsx(n_,{injectFirst:!0,children:m.jsx(r_,{theme:this.state.theme,children:m.jsx(x.Loader,{themeType:this.state.themeType})})});let s;return this.state.menuOpened?s=m.jsxs(c_,{direction:ft.Horizontal,initialSizes:this.state.splitSizes,minWidths:[270,400],onResizeFinished:(i,r)=>{this.setState({splitSizes:r}),window.localStorage.setItem("JS.splitSizes",JSON.stringify(r))},gutterClassName:this.state.themeType==="dark"?"Dark visGutter":"Light visGutter",children:[m.jsx("div",{style:Gr.mainDiv,children:m.jsx(So,{password:this.state.password,debugMode:this.state.debugMode,onDebugInstance:i=>this.setState({debugInstance:i,debugMode:!!i}),scripts:this.scripts,scriptsHash:this.state.scriptsHash,instances:this.state.instances,onRename:this.onRename.bind(this),socket:this.socket,selectId:this.state.menuSelectId,onEdit:this.onEdit.bind(this),expertMode:this.state.expertMode,themeName:this.state.themeName,onThemeChange:i=>{x.Utils.setThemeName(i);const r=x.Utils.getThemeType(i);this.setState({themeName:i,themeType:r},()=>this.toggleTheme(i))},runningInstances:this.state.runningInstances,onExpertModeChange:i=>this.onExpertModeChange(i),onDelete:this.onDelete.bind(this),onAddNew:this.onAddNew.bind(this),onEnableDisable:this.onEnableDisable.bind(this),onExport:this.onExport.bind(this),width:500,onImport:()=>this.setState({importFile:!0}),onSearch:i=>this.setState({searchText:i}),version:this.props.version,changedScripts:this.changedScripts},"sidemenu")},"menu"),this.renderMain()]}):s=this.renderMain(),m.jsx(n_,{injectFirst:!0,children:m.jsx(r_,{theme:this.state.theme,children:m.jsx("div",{style:Gr.root,children:m.jsx(bR,{socket:this.socket,children:s})})})})}}window.location.hostname==="localhost"||window.location.hostname==="[::1]"||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/);function use(){"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(a=>{a.unregister()})}const dse="9.1.1",RC={version:dse};var Jo;(function(a){a.mouse="mouse",a.touch="touch",a.keyboard="keyboard"})(Jo||(Jo={}));class hse{get delay(){var s;return(s=this.args.delay)!==null&&s!==void 0?s:0}get scrollAngleRanges(){return this.args.scrollAngleRanges}get getDropTargetElementsAtPoint(){return this.args.getDropTargetElementsAtPoint}get ignoreContextMenu(){var s;return(s=this.args.ignoreContextMenu)!==null&&s!==void 0?s:!1}get enableHoverOutsideTarget(){var s;return(s=this.args.enableHoverOutsideTarget)!==null&&s!==void 0?s:!1}get enableKeyboardEvents(){var s;return(s=this.args.enableKeyboardEvents)!==null&&s!==void 0?s:!1}get enableMouseEvents(){var s;return(s=this.args.enableMouseEvents)!==null&&s!==void 0?s:!1}get enableTouchEvents(){var s;return(s=this.args.enableTouchEvents)!==null&&s!==void 0?s:!0}get touchSlop(){return this.args.touchSlop||0}get delayTouchStart(){var s,i,r,l;return(l=(r=(s=this.args)===null||s===void 0?void 0:s.delayTouchStart)!==null&&r!==void 0?r:(i=this.args)===null||i===void 0?void 0:i.delay)!==null&&l!==void 0?l:0}get delayMouseStart(){var s,i,r,l;return(l=(r=(s=this.args)===null||s===void 0?void 0:s.delayMouseStart)!==null&&r!==void 0?r:(i=this.args)===null||i===void 0?void 0:i.delay)!==null&&l!==void 0?l:0}get window(){if(this.context&&this.context.window)return this.context.window;if(typeof window<"u")return window}get document(){var s;if(!((s=this.context)===null||s===void 0)&&s.document)return this.context.document;if(this.window)return this.window.document}get rootElement(){var s;return((s=this.args)===null||s===void 0?void 0:s.rootElement)||this.document}constructor(s,i){this.args=s,this.context=i}}function pse(a,s,i,r){return Math.sqrt(Math.pow(Math.abs(i-a),2)+Math.pow(Math.abs(r-s),2))}function gse(a,s,i,r,l){if(!l)return!1;const c=Math.atan2(r-s,i-a)*180/Math.PI+180;for(let d=0;d=h.start)&&(h.end==null||c<=h.end))return!0}return!1}const mse={Left:1},fse={Left:0};function Tg(a){return a.button===void 0||a.button===fse.Left}function $se(a){return a.buttons===void 0||(a.buttons&mse.Left)===0}function NC(a){return!!a.targetTouches}const bse=1;function vse(a){const s=a.nodeType===bse?a:a.parentElement;if(!s)return;const{top:i,left:r}=s.getBoundingClientRect();return{x:r,y:i}}function yse(a,s){if(a.targetTouches.length===1)return Kc(a.targetTouches[0]);if(s&&a.touches.length===1&&a.touches[0].target===s.target)return Kc(a.touches[0])}function Kc(a,s){return NC(a)?yse(a,s):{x:a.clientX,y:a.clientY}}const kw=(()=>{let a=!1;try{addEventListener("test",()=>{},Object.defineProperty({},"passive",{get(){return a=!0,!0}}))}catch{}return a})(),Vr={[Jo.mouse]:{start:"mousedown",move:"mousemove",end:"mouseup",contextmenu:"contextmenu"},[Jo.touch]:{start:"touchstart",move:"touchmove",end:"touchend"},[Jo.keyboard]:{keydown:"keydown"}};class Zr{profile(){var s;return{sourceNodes:this.sourceNodes.size,sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,targetNodes:this.targetNodes.size,dragOverTargetIds:((s=this.dragOverTargetIds)===null||s===void 0?void 0:s.length)||0}}get document(){return this.options.document}setup(){const s=this.options.rootElement;s&&(Ve(!Zr.isSetUp,"Cannot have two Touch backends at the same time."),Zr.isSetUp=!0,this.addEventListener(s,"start",this.getTopMoveStartHandler()),this.addEventListener(s,"start",this.handleTopMoveStartCapture,!0),this.addEventListener(s,"move",this.handleTopMove),this.addEventListener(s,"move",this.handleTopMoveCapture,!0),this.addEventListener(s,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.addEventListener(s,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.addEventListener(s,"keydown",this.handleCancelOnEscape,!0))}teardown(){const s=this.options.rootElement;s&&(Zr.isSetUp=!1,this._mouseClientOffset={},this.removeEventListener(s,"start",this.handleTopMoveStartCapture,!0),this.removeEventListener(s,"start",this.handleTopMoveStart),this.removeEventListener(s,"move",this.handleTopMoveCapture,!0),this.removeEventListener(s,"move",this.handleTopMove),this.removeEventListener(s,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.removeEventListener(s,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.removeEventListener(s,"keydown",this.handleCancelOnEscape,!0),this.uninstallSourceNodeRemovalObserver())}addEventListener(s,i,r,l=!1){const c=kw?{capture:l,passive:!1}:l;this.listenerTypes.forEach(function(d){const h=Vr[d][i];h&&s.addEventListener(h,r,c)})}removeEventListener(s,i,r,l=!1){const c=kw?{capture:l,passive:!1}:l;this.listenerTypes.forEach(function(d){const h=Vr[d][i];h&&s.removeEventListener(h,r,c)})}connectDragSource(s,i){const r=this.handleMoveStart.bind(this,s);return this.sourceNodes.set(s,i),this.addEventListener(i,"start",r),()=>{this.sourceNodes.delete(s),this.removeEventListener(i,"start",r)}}connectDragPreview(s,i,r){return this.sourcePreviewNodeOptions.set(s,r),this.sourcePreviewNodes.set(s,i),()=>{this.sourcePreviewNodes.delete(s),this.sourcePreviewNodeOptions.delete(s)}}connectDropTarget(s,i){const r=this.options.rootElement;if(!this.document||!r)return()=>{};const l=c=>{if(!this.document||!r||!this.monitor.isDragging())return;let d;switch(c.type){case Vr.mouse.move:d={x:c.clientX,y:c.clientY};break;case Vr.touch.move:var h,p;d={x:((h=c.touches[0])===null||h===void 0?void 0:h.clientX)||0,y:((p=c.touches[0])===null||p===void 0?void 0:p.clientY)||0};break}const f=d!=null?this.document.elementFromPoint(d.x,d.y):void 0,b=f&&i.contains(f);if(f===i||b)return this.handleMove(c,s)};return this.addEventListener(this.document.body,"move",l),this.targetNodes.set(s,i),()=>{this.document&&(this.targetNodes.delete(s),this.removeEventListener(this.document.body,"move",l))}}getTopMoveStartHandler(){return!this.options.delayTouchStart&&!this.options.delayMouseStart?this.handleTopMoveStart:this.handleTopMoveStartDelay}installSourceNodeRemovalObserver(s){this.uninstallSourceNodeRemovalObserver(),this.draggedSourceNode=s,this.draggedSourceNodeRemovalObserver=new MutationObserver(()=>{s&&!s.parentElement&&(this.resurrectSourceNode(),this.uninstallSourceNodeRemovalObserver())}),!(!s||!s.parentElement)&&this.draggedSourceNodeRemovalObserver.observe(s.parentElement,{childList:!0})}resurrectSourceNode(){this.document&&this.draggedSourceNode&&(this.draggedSourceNode.style.display="none",this.draggedSourceNode.removeAttribute("data-reactid"),this.document.body.appendChild(this.draggedSourceNode))}uninstallSourceNodeRemovalObserver(){this.draggedSourceNodeRemovalObserver&&this.draggedSourceNodeRemovalObserver.disconnect(),this.draggedSourceNodeRemovalObserver=void 0,this.draggedSourceNode=void 0}constructor(s,i,r){this.getSourceClientOffset=l=>{const c=this.sourceNodes.get(l);return c&&vse(c)},this.handleTopMoveStartCapture=l=>{Tg(l)&&(this.moveStartSourceIds=[])},this.handleMoveStart=l=>{Array.isArray(this.moveStartSourceIds)&&this.moveStartSourceIds.unshift(l)},this.handleTopMoveStart=l=>{if(!Tg(l))return;const c=Kc(l);c&&(NC(l)&&(this.lastTargetTouchFallback=l.targetTouches[0]),this._mouseClientOffset=c),this.waitingForDelay=!1},this.handleTopMoveStartDelay=l=>{if(!Tg(l))return;const c=l.type===Vr.touch.start?this.options.delayTouchStart:this.options.delayMouseStart;this.timeout=setTimeout(this.handleTopMoveStart.bind(this,l),c),this.waitingForDelay=!0},this.handleTopMoveCapture=()=>{this.dragOverTargetIds=[]},this.handleMove=(l,c)=>{this.dragOverTargetIds&&this.dragOverTargetIds.unshift(c)},this.handleTopMove=l=>{if(this.timeout&&clearTimeout(this.timeout),!this.document||this.waitingForDelay)return;const{moveStartSourceIds:c,dragOverTargetIds:d}=this,h=this.options.enableHoverOutsideTarget,p=Kc(l,this.lastTargetTouchFallback);if(!p)return;if(this._isScrolling||!this.monitor.isDragging()&&gse(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,p.x,p.y,this.options.scrollAngleRanges)){this._isScrolling=!0;return}if(!this.monitor.isDragging()&&this._mouseClientOffset.hasOwnProperty("x")&&c&&pse(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,p.x,p.y)>(this.options.touchSlop?this.options.touchSlop:0)&&(this.moveStartSourceIds=void 0,this.actions.beginDrag(c,{clientOffset:this._mouseClientOffset,getSourceClientOffset:this.getSourceClientOffset,publishSource:!1})),!this.monitor.isDragging())return;const f=this.sourceNodes.get(this.monitor.getSourceId());this.installSourceNodeRemovalObserver(f),this.actions.publishDragSource(),l.cancelable&&l.preventDefault();const b=(d||[]).map(_=>this.targetNodes.get(_)).filter(_=>!!_),y=this.options.getDropTargetElementsAtPoint?this.options.getDropTargetElementsAtPoint(p.x,p.y,b):this.document.elementsFromPoint(p.x,p.y),w=[];for(const _ in y){if(!y.hasOwnProperty(_))continue;let $=y[_];for($!=null&&w.push($);$;)$=$.parentElement,$&&w.indexOf($)===-1&&w.push($)}const v=w.filter(_=>b.indexOf(_)>-1).map(_=>this._getDropTargetId(_)).filter(_=>!!_).filter((_,$,S)=>S.indexOf(_)===$);if(h)for(const _ in this.targetNodes){const $=this.targetNodes.get(_);if(f&&$&&$.contains(f)&&v.indexOf(_)===-1){v.unshift(_);break}}v.reverse(),this.actions.hover(v,{clientOffset:p})},this._getDropTargetId=l=>{const c=this.targetNodes.keys();let d=c.next();for(;d.done===!1;){const h=d.value;if(l===this.targetNodes.get(h))return h;d=c.next()}},this.handleTopMoveEndCapture=l=>{if(this._isScrolling=!1,this.lastTargetTouchFallback=void 0,!!$se(l)){if(!this.monitor.isDragging()||this.monitor.didDrop()){this.moveStartSourceIds=void 0;return}l.cancelable&&l.preventDefault(),this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.drop(),this.actions.endDrag()}},this.handleCancelOnEscape=l=>{l.key==="Escape"&&this.monitor.isDragging()&&(this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.endDrag())},this.options=new hse(r,i),this.actions=s.getActions(),this.monitor=s.getMonitor(),this.sourceNodes=new Map,this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.targetNodes=new Map,this.listenerTypes=[],this._mouseClientOffset={},this._isScrolling=!1,this.options.enableMouseEvents&&this.listenerTypes.push(Jo.mouse),this.options.enableTouchEvents&&this.listenerTypes.push(Jo.touch),this.options.enableKeyboardEvents&&this.listenerTypes.push(Jo.keyboard)}}const _se=function(s,i={},r={}){return new Zr(s,i,r)};window.GenericBlock=at;window.adapterName="javascript";window.sentryDSN="https://504499a725eb4898930d3b9e9da95740@sentry.iobroker.net/56";console.log(`iobroker.${window.adapterName}@${RC.version}`);const wse=window.innerWidth<600,Cw=document.getElementById("root");Cw&&Fw(Cw).render(m.jsx(ek,{backend:wse?_se:hk,children:m.jsx(cse,{version:RC.version})}));use();const gc=window.loadDynamicScript;gc&&gc(window.location.port==="3000"?`${window.location.protocol}//${window.location.hostname}:8081/lib/js/socket.io.js`:"./../../lib/js/socket.io.js",()=>gc("vs/loader.js",()=>gc("vs/configure.js",()=>typeof window.socketLoadedHandler=="function"&&window.socketLoadedHandler())));export{$R as C,sO as D,at as G,pk as I,fw as M,Ns as S,$I as a,LI as b,WI as c,Ei as d,pne as e,Hm as f,su as g,cx as h,gne as j,c_ as m,zn as u,ft as z}; diff --git a/admin/assets/index-CH_9mIwq.js b/admin/assets/index-vgcfJH38.js similarity index 99% rename from admin/assets/index-CH_9mIwq.js rename to admin/assets/index-vgcfJH38.js index 489ee4979..51905dd8c 100644 --- a/admin/assets/index-CH_9mIwq.js +++ b/admin/assets/index-vgcfJH38.js @@ -1 +1 @@ -import{j as n}from"./createSvgIcon-DPvF8xqu.js";import{c as E,h as yt,j as M,m as nt,k as lt,l as Dt,b as ut,o as xt}from"./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js";import{_ as u}from"./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js";import{u as kt,a as St,M as Y,C as et,G as Nt,b as $t,c as bt,I as qt,S as J,d as Bt,e as ft,j as Mt,D as Ht,f as Wt}from"./index-BT3MfKxA.js";import{_ as wt,b as Ct,h as vt,i as jt,p as Tt,f as Et,g as mt,o as Pt,Y as Ut,Z as Ft,C as Jt,D as st}from"./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js";import{I as Lt}from"./index-C49cpVll.js";import"./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js";import"./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js";import"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js";import"./preload-helper-BDBacUwf.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js";import"./inheritsLoose-B0Ba5G9z.js";function zt(e){const s=kt().getMonitor(),[i,a]=St(s,e);return E(()=>s.subscribeToOffsetChange(a)),E(()=>s.subscribeToStateChange(a)),i}let V;function Gt(){return V||(V=new Image,V.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),V}const Kt="_wrapperRules_nnott_1",Qt="_rootWrapper_nnott_9",Yt="_addClass_nnott_14",ot={wrapperRules:Kt,rootWrapper:Qt,addClass:Yt},Zt="_switchesItem_10ls3_1",Xt="_switchesItemActive_10ls3_28",Vt="_iconTheme_10ls3_36",it={switchesItem:Zt,switchesItemActive:Xt,iconTheme:Vt},It=({name:e,id:t,active:s,icon:i,adapter:a,socket:o,onDoubleClick:c,title:l,onTouchMove:d,style:j})=>n.jsxs("div",{onDoubleClick:c,onTouchMove:d,title:l?u.I18n.t(l):void 0,className:u.Utils.clsx(it.switchesItem,s&&it.switchesItemActive,`block-${t}`),children:[n.jsx(Y,{iconName:i,className:it.iconTheme,adapter:a,socket:o,style:j}),n.jsx("span",{children:e?u.I18n.t(e):""})]},t),Rt="_cardStyle_8rq8v_1",tn="_cardStyleActive_8rq8v_17",nn="_controlMenu_8rq8v_22",en="_closeBtn_8rq8v_31",sn="_isDelete_8rq8v_73",on="_drag_mobile_8rq8v_90",G={cardStyle:Rt,cardStyleActive:tn,controlMenu:nn,closeBtn:en,isDelete:sn,drag_mobile:on};function K(e,t,s){let i;switch(e){case"actions":if(s==="else")return i={...t,actions:{...t[e],else:[...t[e].else]}},i;if(s==="then")return i={...t,actions:{...t[e],then:[...t[e].then]}},i;throw console.error(`Unknown additionalParameter: ${s}`),new Error(`Unknown additionalParameter: ${s}`);case"triggers":return i={...t,triggers:[...t.triggers]},i;case"conditions":return i={...t,conditions:[...t.conditions]},i;default:throw new Error(`Unknown name: ${e}`)}}function z(e,t,s,i){var a;switch(e){case"actions":return t.actions[s]=t.actions[s].filter(o=>o._id!==i),t;case"conditions":return t.conditions[s]=(a=t.conditions[s])==null?void 0:a.filter(o=>o._id!==i),t;default:return t.triggers=t.triggers.filter(o=>o._id!==i),t}}function cn(e,t,s){const{_id:i,acceptedBy:a}=e;let o;if(!a||!t[a])return console.warn(`Cannot find ${a}`),t;switch(a){case"actions":if(o=t.actions[s].find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=t.actions[s].indexOf(o);t.actions[s][c]=e}return t;case"conditions":if(o=t.conditions[s].find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=t.conditions[s].indexOf(o);t.conditions[s][c]=e}return t;default:if(o=t.triggers.find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=t.triggers.indexOf(o);t.triggers[c]=e}return t}}const Ot=yt(e=>{var N;const{setUserRules:t,userRules:s,_id:i,id:a,blockValue:o,active:c,acceptedBy:l,isTourOpen:d,setTourStep:j,tourStep:O}=e,[I,_]=M(null),{blocks:r,socket:k,onUpdate:H,setOnUpdate:w,onDebugMessage:f,enableSimulation:x}=nt(et),p=lt(h=>r==null?void 0:r.find(b=>b.getStaticData().id===h),[r]),g=lt(h=>{const b=cn(h,s,o);b&&t(b)},[s]),C=h=>{h.currentTarget!==I&&_(h.currentTarget)},q=()=>_(null),T=Dt(()=>{const h=p(a)||Nt;return n.jsx(h,{...e,notFound:!p(a),isTourOpen:d,setTourStep:j,tourStep:O,onUpdate:H,setOnUpdate:w,enableSimulation:x,onDebugMessage:f,onChange:g,className:void 0,socket:k})},[s,H,f,x]),[S,B]=M(!1);return n.jsxs("div",{onMouseMove:C,onMouseEnter:C,onMouseLeave:q,onMouseDown:h=>{if(h.ctrlKey){let b;const v=K(l,s,o);l==="conditions"?(b=v.conditions[o].find(m=>m._id===i),b&&v.conditions[o].splice(v.conditions[o].indexOf(b),0,{...b,_id:Date.now()})):l==="actions"?(b=v.actions[o].find(m=>m._id===i),b&&v.actions[o].splice(v.actions[o].indexOf(b),0,{...b,_id:Date.now()})):(b=v.triggers.find(m=>m._id===i),b&&v.triggers.splice(v[l].indexOf(b),0,{...b,_id:Date.now()})),t(v)}},id:"height",style:c?{width:(((N=document.getElementById("width"))==null?void 0:N.clientWidth)||0)-70}:void 0,className:`${G.cardStyle} ${c?G.cardStyleActive:null} ${S?G.isDelete:null}`,children:[n.jsx("div",{className:G.drag_mobile}),T,t&&n.jsx("div",{className:G.controlMenu,style:I?{opacity:1}:{opacity:0},children:n.jsx("div",{onClick:()=>{let h=K(l,s,o);h=z(l,h,o,i),B(!0),setTimeout(()=>{l==="triggers"&&w(!0),t(h)},300)},className:G.closeBtn})})]})}),rn={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},an=(e,t,s)=>{if(!e||!t)return{display:"none"};let{x:i,y:a}=t;const o=`translate(${i}px, ${a}px)`;return{transform:o,WebkitTransform:o}},ln=e=>{const{itemType:t,isDragging:s,item:i,initialOffset:a,currentOffset:o,targetIds:c}=zt(d=>({item:d.getItem(),itemType:d.getItemType(),initialOffset:d.getInitialSourceClientOffset(),currentOffset:d.getSourceClientOffset(),isDragging:d.isDragging(),targetIds:d.getTargetIds()})),l=()=>t==="box"?c.length?n.jsx(Ot,{active:!0,...i,allBlocks:e.allBlocks}):n.jsx(It,{active:!0,...i,socket:e.socket}):null;return s?n.jsx("div",{style:rn,children:n.jsx("div",{style:an(a,o),children:l()})}):null},dn="_border_wrpm3_1",fn="_emptyBlockStyle_wrpm3_6",mn="_emptyBlock_wrpm3_6",gn="_selectOnChange_wrpm3_22",hn="_selectOnChangeHelp_wrpm3_28",_n="_selectOnChangeHelpIcon_wrpm3_34",pn="_emptyBlockNone_wrpm3_49",un="_mainBlockItemRules_wrpm3_55",xn="_nameBlockItems_wrpm3_63",bn="_contentBlockItem_wrpm3_73",wn="_wrapperMargin_wrpm3_81",Cn="_contentHeightOn_wrpm3_87",vn="_contentHeightOff_wrpm3_99",jn="_cardAdd_wrpm3_105",In="_blockCardAdd_wrpm3_125",On="_addClassOverflow_wrpm3_136",An="_addClassHeight_wrpm3_140",D={border:dn,emptyBlockStyle:fn,emptyBlock:mn,selectOnChange:gn,selectOnChangeHelp:hn,selectOnChangeHelpIcon:_n,emptyBlockNone:pn,mainBlockItemRules:un,nameBlockItems:xn,contentBlockItem:bn,wrapperMargin:wn,contentHeightOn:Cn,contentHeightOff:vn,cardAdd:jn,blockCardAdd:In,addClassOverflow:On,addClassHeight:An};function dt(e,t){const[s,i]=M(window.localStorage.getItem(t)?JSON.parse(window.localStorage.getItem(t)||""):e);return[s,o=>{window.localStorage.setItem(t,JSON.stringify(o)),i(o)},!!window.localStorage.getItem(t)]}function yn(e,t){let s=0,i=null,a;return function(...o){const c=Date.now();a=o,c-s>=t?(s=c,e.apply(this,o)):i||(i=setTimeout(()=>{s=Date.now(),i=null,e.apply(this,a)},t-(c-s)))}}function tt(e){if(Array.isArray(e))return e.map(t=>tt(t));if(typeof e=="function")return e.bind(null);if(e&&typeof e=="object"){const t={};return Object.keys(e).forEach(s=>{t[s]=tt(e[s])}),t}return e}const ct=yn((e,t)=>e(t),0);function R(e,t){const s=t.find(i=>i._id===e);return{card:s,index:s?t.indexOf(s):-1}}function rt(e,t,s,i,a,o,c,l,d){const{card:j,index:O}=R(e,s);if(!(Ot&&l>d)&&j&&O!==t){const I=tt(s);I.splice(O,1),I.splice(t,0,j);const _=tt(a);switch(o){case"actions":_.actions[c]=I,ct(i,_);return;case"conditions":_.conditions[c]=I,ct(i,_);return;default:_.triggers=I,ct(i,_);return}}}const Dn="_drag_7xfhc_1",kn="_root_7xfhc_11",gt={drag:Dn,root:kn},At=({typeBlock:e,allProperties:t,id:s,isActive:i,setUserRules:a,userRules:o,children:c,_id:l,blockValue:d})=>{const{setOnUpdate:j}=nt(et),[{opacity:O},I,_]=$t({type:"box",item:()=>({...t,id:s,isActive:i,_id:l}),end:(w,f)=>{const{acceptedBy:x}=w,p=f.getDropResult();let g;if(!p)return typeof l=="number"&&!f.getTargetIds().length&&(g=K(x,o,d),g=z(x,g,d,l),a(g)),null;if(p.blockValue!==d){const C=typeof l=="number"?l:Date.now();g=K(x,o,p.blockValue);const q={id:w.id,acceptedBy:w.acceptedBy};switch(x){case"actions":return d&&(g=z("actions",g,d,C)),g=z("actions",g,p.blockValue,C),g.actions[p.blockValue].push({...q,_id:C}),a(g);case"conditions":return typeof d=="number"&&(g=z("conditions",g,d,C)),g=z("conditions",g,p.blockValue,C),g.conditions[p.blockValue].push({...q,_id:C}),a(g);default:return j(!0),g=z("triggers",g,p.blockValue,C),g.triggers.push({...q,_id:C}),a(g)}}},collect:w=>({opacity:w.isDragging()?.4:1,isDragging:w.isDragging()})}),r=ut(null),[,k]=bt({accept:"box",canDrop:()=>!1,hover({_id:w,acceptedBy:f},x){var T;if(!r.current||e!==f)return;const p=(T=r.current)==null?void 0:T.getBoundingClientRect(),g=(p.bottom-p.top)/2,C=x.getClientOffset(),q=((C==null?void 0:C.y)||0)-p.top;if(l&&w!==l)switch(f){case"actions":if(d==="then"||d==="else"){const{index:S}=R(l,o.actions[d]);S!==w&&rt(w,S,o[f][d],a,o,f,d,q,g)}return;case"conditions":if(typeof d=="number"){const{index:S}=R(l,o[f][d]);S!==w&&rt(w,S,o[f][d],a,o,f,d,q,g)}return;default:{const{index:S}=R(l,o[f]);S!==w&&rt(w,S,o[f],a,o,f,void 0,q,g);return}}}});E(()=>{_(Gt(),{captureDraggingState:!0})},[]),I(k(r));const H=window.innerWidth<600;return n.jsxs("div",{ref:H&&l?null:r,className:gt.root,style:{opacity:O},children:[n.jsx("div",{className:l?gt.drag:null,ref:l&&H?r:null}),c]})},Sn=({onClose:e,open:t})=>n.jsxs(wt,{open:t,onClose:e,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[n.jsx(Ct,{children:n.jsxs("div",{style:{fontSize:"1rem",fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif',fontWeight:400,lineHeight:1.5,letterSpacing:"0.00938em"},children:[n.jsx("h3",{children:u.I18n.t("On condition change")}),n.jsx("div",{children:u.I18n.t("help_on_change")}),n.jsx("h3",{children:u.I18n.t("Just check")}),n.jsx("div",{children:u.I18n.t("help_just_check")})]})}),n.jsx(vt,{children:n.jsx(jt,{onClick:e,color:"primary",autoFocus:!0,startIcon:n.jsx(Lt,{}),children:u.I18n.t("OK")})})]}),Nn=({onClose:e,open:t})=>n.jsxs(wt,{open:t,onClose:e,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[n.jsx(Ct,{children:n.jsxs(Tt,{id:"alert-dialog-description",children:[n.jsx("h3",{children:u.I18n.t("On condition change")}),n.jsx("div",{children:u.I18n.t("help_on_change")}),n.jsx("h3",{children:u.I18n.t("Just check")}),n.jsx("div",{children:u.I18n.t("help_just_check")})]})}),n.jsx(vt,{children:n.jsx(jt,{onClick:e,color:"primary",autoFocus:!0,children:u.I18n.t("OK")})})]}),ht=({size:e,blockValue:t,boolean:s,typeBlock:i,userRules:a,setUserRules:o,animation:c,setTourStep:l,tourStep:d,isTourOpen:j,theme:O,themeType:I,themeName:_})=>{var W;const[r,k]=M(!1),[H,w]=M(!1),[f,x]=M(!1),[p,g]=M("");s===void 0&&(s=!0);const C=bt({accept:"box",drop:()=>({blockValue:t}),hover:({acceptedBy:A,_id:L},Z)=>{k(A===i),x(!!L),g(Z.getHandlerId()||"")},canDrop:({acceptedBy:A})=>(w(A===i),A===i),collect:A=>{var L;return{isOver:A.isOver(),canDrop:((L=A.getItem())==null?void 0:L.acceptedBy)===i,offset:A.getClientOffset(),targetId:A.getHandlerId()}}}),q=C[0],{canDrop:T,isOver:S,offset:B,targetId:N}=q,h=C[1];E(()=>{g("")},[B]);const b=T&&S;let v="";b?v=r?"#00fb003d":"#fb00002e":T?v=H?"#00fb003d":"#fb00002e":B&&(v=N===p?"#fb00002e":"");let m;return i==="actions"?m=a.actions[t]:i==="conditions"?m=a.conditions[t]:m=a.triggers,n.jsx("div",{ref:h,style:{backgroundColor:v},className:`${u.Utils.clsx(D.contentBlockItem,e&&D.addClassHeight)} ${s?c?D.contentHeightOn:null:D.contentHeightOff}`,children:n.jsxs("div",{className:D.wrapperMargin,children:[m.map(A=>n.jsx(At,{typeBlock:i,...A,blockValue:t,allProperties:A,userRules:a,setUserRules:o,children:n.jsx(Ot,{...A,isTourOpen:j,setTourStep:l,tourStep:d,settings:A,blockValue:t,userRules:a,setUserRules:o,theme:O,themeType:I,themeName:_})},A._id)),n.jsx("div",{style:b&&r&&!f?{height:((W=document.getElementById("height"))==null?void 0:W.clientHeight)||200}:void 0,className:`${D.emptyBlockStyle} ${b&&r&&!f?D.emptyBlock:D.emptyBlockNone}`})]})})},at=({size:e,typeBlock:t,name:s,nameAdditionally:i,additionally:a,border:o,userRules:c,setUserRules:l,iconName:d,adapter:j,socket:O,setTourStep:I,tourStep:_,isTourOpen:r,theme:k,themeType:H,themeName:w})=>{const[f,x,p]=dt(t==="actions"?!1:[],`additionallyClickItems_${t}`),[g,C]=M(!1),[q,T]=M(!1);E(()=>{if(t==="conditions"&&(f==null?void 0:f.length)!==c.conditions.length-1){const N=[];c.conditions.forEach((h,b)=>{b>0&&N.push({_id:Date.now(),open:!0})}),x([...f,...N])}t==="actions"&&!p&&c.actions.else.length&&x(!0)},[]);const[S,B]=M(!1);return n.jsxs("div",{className:`${u.Utils.clsx(D.mainBlockItemRules,e&&D.addClassOverflow)} ${o&&!e?D.border:null}`,children:[n.jsxs("span",{id:"width",className:D.nameBlockItems,children:[n.jsx(Y,{iconName:d,className:D.iconThemCard,adapter:j,socket:O}),s]}),t==="conditions"?n.jsxs("div",{style:{width:"100%"},children:[n.jsxs(Et,{variant:"standard",className:D.selectOnChange,value:c.justCheck||!1,onChange:N=>{const h=K("conditions",c);h.justCheck=N.target.value==="true",l(h)},children:[n.jsx(mt,{value:"false",children:u.I18n.t("on condition change")}),n.jsx(mt,{value:"true",children:u.I18n.t("just check")})]}),n.jsx(Pt,{size:"small",title:u.I18n.t("Explanation"),className:D.selectOnChangeHelp,onClick:()=>C(!0),children:n.jsx(qt,{className:D.selectOnChangeHelpIcon})})]}):null,n.jsx(ht,{setTourStep:I,tourStep:_,isTourOpen:r,blockValue:t==="actions"?"then":t==="conditions"?0:t,typeBlock:t,setUserRules:l,userRules:c,theme:k,themeName:w,themeType:H,size:e}),a&&[...Array(t==="actions"?1:c.conditions.length-1)].map((N,h)=>{const b=(v=h)=>t==="actions"?!!f:!!f.find((m,W)=>W===v&&m.open);return n.jsxs(xt,{children:[n.jsxs("div",{onClick:()=>{if(t==="actions")return x(!f),null;let v=JSON.parse(JSON.stringify(f));if(c.conditions[h+1].length)return v[h].open=!v[h].open,x(v),null;v=v.filter((m,W)=>W!==h),x(v),B(h),setTimeout(()=>{B(!1),l({...c,conditions:[...c.conditions.filter((m,W)=>W!==h+1)]})},250)},className:D.blockCardAdd,children:[b()?"-":"+",n.jsx("div",{className:D.cardAdd,children:i})]},h),n.jsx(ht,{blockValue:t==="actions"?"else":t==="conditions"?h+1:t,typeBlock:t,setUserRules:l,userRules:c,boolean:b(),animation:S===h,size:e,theme:k,themeName:w,themeType:H})]},`${h}_block_${t}`)}),a&&t==="conditions"&&n.jsxs("div",{onClick:()=>{x([...f,{_id:Date.now(),open:!0}]),l({...c,conditions:[...c.conditions,[]]}),B(c.conditions.length-1),setTimeout(()=>B(!1),1e3)},className:D.blockCardAdd,children:["+",n.jsx("div",{className:D.cardAdd,children:i})]}),n.jsx(Sn,{open:g,onClose:()=>C(!1)}),n.jsx(Nn,{open:q,onClose:()=>T(!1)})]})},$n="_menuRules_1qqcb_1",qn="_switchesRenderWrapper_1qqcb_13",Bn="_menuOff_1qqcb_22",Mn="_menuTitle_1qqcb_28",Hn="_marginAuto_1qqcb_42",Wn="_inputWidth_1qqcb_47",Tn="_menuWrapper_1qqcb_52",En="_hamburgerWrapper_1qqcb_57",Pn="_hamburgerOff_1qqcb_74",Un="_nothingFound_1qqcb_82",Fn="_resetSearch_1qqcb_89",Jn="_controlPanel_1qqcb_101",Ln="_controlPanelAppBar_1qqcb_112",zn="_addClassMenu_1qqcb_126",Gn="_addClassBackground_1qqcb_132",Kn="_addClassPosition_1qqcb_136",$={menuRules:$n,switchesRenderWrapper:qn,menuOff:Bn,menuTitle:Mn,marginAuto:Hn,inputWidth:Wn,menuWrapper:Tn,hamburgerWrapper:En,hamburgerOff:Pn,nothingFound:Un,resetSearch:Fn,controlPanel:Jn,controlPanelAppBar:Ln,addClassMenu:zn,addClassBackground:Gn,addClassPosition:Kn},Qn=e=>{const{allProperties:t,allProperties:{acceptedBy:s,id:i},setUserRules:a,userRules:o,setTourStep:c,tourStep:l,isTourOpen:d,onTouchMove:j,isActive:O}=e;return n.jsx(At,{allProperties:t,id:t.id,isActive:O,setUserRules:a,userRules:o,children:n.jsx(It,{onDoubleClick:()=>{d&&l===J.addScheduleByDoubleClick&&i==="TriggerScheduleBlock"&&c(J.openTagsMenu),d&&l===J.addActionPrintText&&i==="ActionPrintText"&&c(J.showJavascript);const I=Date.now();let _;switch(s){case"actions":_="then";break;case"conditions":_=o[s].length-1;break}const r=K(s,o,_),k={id:i,_id:I,acceptedBy:s};_!==void 0?s==="actions"?r.actions[_].push({...k}):s==="conditions"&&r.conditions[_].push({...k}):r.triggers.push({...k}),a(r)},...e,...t,onTouchMove:j})})},Yn="_hamburgerMenu_hqnsm_8",Zn="_animate_hqnsm_21",_t={hamburgerMenu:Yn,animate:Zn};function Xn({bool:e}){return n.jsx("div",{className:`${_t.hamburgerMenu} ${e?_t.animate:""}`})}const Vn=({addClass:e,setAllBlocks:t,allBlocks:s,userRules:i,onChangeBlocks:a,setTourStep:o,tourStep:c,isTourOpen:l})=>{const{blocks:d,socket:j}=nt(et),[O,I]=dt(!1,"hamburgerOnOff"),[_,r]=dt({text:"",type:"triggers",index:0},"filterControlPanel"),k=(f=_.text,x=_.type)=>{if(!d)return;let p=[...d];p=p.filter(g=>{if(!f)return!0;const{name:C}=g.getStaticData();return C&&u.I18n.t(C).toLowerCase().includes(f.toLowerCase())}),p=p.filter(g=>x===g.getStaticData().acceptedBy),t(p)},H=(f,x)=>{l&&x===0&&c===J.selectTriggers&&o(J.addScheduleByDoubleClick),l&&x===2&&c===J.selectActions&&o(J.addActionPrintText),r({..._,index:x,type:["triggers","conditions","actions"][x]}),k(_.text,["triggers","conditions","actions"][x])},w=f=>({id:`scrollable-force-tab-${f}`,"aria-controls":`scrollable-force-tabpanel-${f}`});return E(()=>{k()},[d]),n.jsx(Ut,{mouseEvent:!1,touchEvent:"onTouchStart",onClickAway:()=>I(!0),children:n.jsxs("div",{className:u.Utils.clsx($.menuWrapper,e[1035]&&$.addClassMenu),children:[n.jsx("div",{className:`${$.hamburgerWrapper} ${O?$.hamburgerOff:null}`,onClick:()=>I(!O),children:n.jsx(Xn,{bool:!O})}),n.jsxs("div",{className:`${u.Utils.clsx($.menuRules,e[1035]&&$.addClassBackground,e[835]&&$.addClassPosition)} ${O?$.menuOff:null}`,children:[n.jsx("div",{className:$.controlPanel,children:n.jsx(Ft,{className:$.controlPanelAppBar,position:"static",children:n.jsxs(Jt,{value:_.index,onChange:H,children:[n.jsx(st,{className:"blocks-triggers",title:u.I18n.t("Triggers"),icon:n.jsx(Y,{iconName:"FlashOn"}),...w(0)}),n.jsx(st,{title:u.I18n.t("Conditions"),className:"blocks-conditions",icon:n.jsx(Y,{iconName:"Help"}),...w(1)}),n.jsx(st,{title:u.I18n.t("Actions"),className:"blocks-actions",icon:n.jsx(Y,{iconName:"PlayForWork"}),...w(2)})]})})}),n.jsx("div",{className:$.switchesRenderWrapper,children:n.jsxs("span",{children:[s.map(f=>{const{name:x,id:p,icon:g,adapter:C}=f.getStaticData();return n.jsx(xt,{children:n.jsx(Qn,{adapter:C,allProperties:f.getStaticData(),icon:g,id:p,isActive:!1,isTourOpen:l,name:x,onTouchMove:()=>I(!0),setTourStep:o,setUserRules:a,socket:j,tourStep:c,userRules:i})},p)}),!s.length&&n.jsxs("div",{className:$.nothingFound,children:[u.I18n.t("Nothing found"),"...",n.jsx("div",{className:$.resetSearch,onClick:()=>{r({..._,text:""}),k("")},children:u.I18n.t("reset search")})]})]})}),n.jsx("div",{className:u.Utils.clsx($.menuTitle,$.marginAuto)}),n.jsx(Bt,{className:$.inputWidth,fullWidth:!0,customValue:!0,value:_.text,size:"small",autoComplete:"off",label:u.I18n.t("search"),variant:"outlined",onChange:f=>{r({..._,text:f}),k(f)}})]})]})})};let pt=[];const me=({code:e,onChange:t,themeName:s,themeType:i,theme:a,setTourStep:o,tourStep:c,isTourOpen:l,command:d,scriptId:j,changed:O,running:I})=>{var v;const{blocks:_,socket:r,setOnUpdate:k,setOnDebugMessage:H,setEnableSimulation:w}=nt(et),[f,x]=M([]),[p,g]=M(ft(e)),[C,q]=M(""),[T,S]=M(!1);E(()=>{let m,W;const A=(P,y)=>{P===`${m}.alive`&&W!==(y==null?void 0:y.val)&&(W=!!(y!=null&&y.val),W&&m&&(r==null||r.sendTo(m.replace(/^system\.adapter\./,""),"rulesOn",j)))},L=(P,y)=>{var U,Q;r&&m!==((U=y==null?void 0:y.common)==null?void 0:U.engine)&&(m&&(r.unsubscribeState(`${m}.alive`,A),W&&r.sendTo(m.replace(/^system\.adapter\./,""),"rulesOn",j)),m=(Q=y==null?void 0:y.common)==null?void 0:Q.engine,m&&m&&r.subscribeState(`${m}.alive`,A))},Z=(P,y)=>{if(y)try{const U=JSON.parse(y.val),Q=Date.now();if(U.ruleId===j&&Q-U.ts<1e3){const F=[...pt,{blockId:U.blockId,data:U.data,ts:U.ts}];F.length>200&&F.splice(0,200-F.length);for(let X=F.length-1;X>=0;X--)if(F[X].ts{var y;m=(y=P==null?void 0:P.common)==null?void 0:y.engine,r.subscribeObject(j,L),m&&(r.subscribeState(`${m}.alive`,A),r.subscribeState(`${m.replace(/^system\.adapter\./,"")}.debug.rules`,Z))}),function(){r==null||r.unsubscribeObject(j,L),m&&(r==null||r.unsubscribeState(`${m}.alive`,A),W&&(r==null||r.sendTo(m.replace(/^system\.adapter\./,""),"rulesOff",j)),r==null||r.unsubscribeState(`${m.replace(/^system\.adapter\./,"")}.debug.rules`,Z))}},[]),E(()=>{w(!O&&I)},[O,I,w]),E(()=>{d&&(q(d),T||S(!0))},[d]),E(()=>{const m=ft(e);JSON.stringify(m)!==JSON.stringify(p)&&(g(m),k(!0))},[e]),E(()=>{document.getElementsByTagName("HTML")[0].className=s||"blue"},[s]);const B=lt(m=>{g(m),_&&t(Mt(m,_))},[_,t]),N=ut(null),[h,b]=M({835:!1,1035:!1});return E(()=>{N.current&&(N.current.clientWidth<=1035&&b({835:!1,1035:!0}),N.current.clientWidth<=835&&b({1035:!0,835:!0}),N.current.clientWidth>1035&&b({835:!1,1035:!1}))},[((v=N.current)==null?void 0:v.clientWidth)||0]),!_||!r?null:n.jsxs("div",{className:ot.wrapperRules,ref:N,children:[n.jsx(ln,{allBlocks:f,socket:r}),T?C==="export"?n.jsx(Ht,{scriptId:j,themeType:i,onClose:()=>S(!1),text:JSON.stringify(p,null,2)}):n.jsx(Wt,{themeType:i,onClose:m=>{S(!1),m&&B(JSON.parse(m))}}):null,n.jsxs("div",{className:u.Utils.clsx(ot.rootWrapper,h[835]&&ot.addClass),children:[n.jsx(Vn,{setAllBlocks:x,allBlocks:f,userRules:p,onChangeBlocks:B,setTourStep:o,tourStep:c,addClass:h,isTourOpen:l}),n.jsx(at,{socket:r,setUserRules:B,userRules:p,isTourOpen:l,setTourStep:o,tourStep:c,name:`${u.I18n.t("when")}...`,typeBlock:"triggers",iconName:"FlashOn",size:h[835],themeType:i,themeName:s,theme:a}),n.jsx(at,{socket:r,setUserRules:B,isTourOpen:l,setTourStep:o,tourStep:c,userRules:p,name:`...${u.I18n.t("and")}...`,typeBlock:"conditions",iconName:"Help",nameAdditionally:u.I18n.t("or"),additionally:!0,border:!0,size:h[835],themeType:i,themeName:s,theme:a}),n.jsx(at,{socket:r,setUserRules:B,isTourOpen:l,setTourStep:o,tourStep:c,userRules:p,name:`...${u.I18n.t("then")}`,typeBlock:"actions",iconName:"PlayForWork",nameAdditionally:u.I18n.t("else"),additionally:!0,size:h[835],themeType:i,themeName:s,theme:a})]})]},"rulesEditor")};export{me as default}; +import{j as n}from"./createSvgIcon-DPvF8xqu.js";import{c as E,h as yt,j as M,m as nt,k as lt,l as Dt,b as ut,o as xt}from"./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js";import{_ as u}from"./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js";import{u as kt,a as St,M as Y,C as et,G as Nt,b as $t,c as bt,I as qt,S as J,d as Bt,e as ft,j as Mt,D as Ht,f as Wt}from"./index-_UYoIw1I.js";import{_ as wt,b as Ct,h as vt,i as jt,p as Tt,f as Et,g as mt,o as Pt,Y as Ut,Z as Ft,C as Jt,D as st}from"./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js";import{I as Lt}from"./index-C49cpVll.js";import"./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js";import"./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js";import"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js";import"./preload-helper-BDBacUwf.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js";import"./inheritsLoose-B0Ba5G9z.js";function zt(e){const s=kt().getMonitor(),[i,a]=St(s,e);return E(()=>s.subscribeToOffsetChange(a)),E(()=>s.subscribeToStateChange(a)),i}let V;function Gt(){return V||(V=new Image,V.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),V}const Kt="_wrapperRules_nnott_1",Qt="_rootWrapper_nnott_9",Yt="_addClass_nnott_14",ot={wrapperRules:Kt,rootWrapper:Qt,addClass:Yt},Zt="_switchesItem_10ls3_1",Xt="_switchesItemActive_10ls3_28",Vt="_iconTheme_10ls3_36",it={switchesItem:Zt,switchesItemActive:Xt,iconTheme:Vt},It=({name:e,id:t,active:s,icon:i,adapter:a,socket:o,onDoubleClick:c,title:l,onTouchMove:d,style:j})=>n.jsxs("div",{onDoubleClick:c,onTouchMove:d,title:l?u.I18n.t(l):void 0,className:u.Utils.clsx(it.switchesItem,s&&it.switchesItemActive,`block-${t}`),children:[n.jsx(Y,{iconName:i,className:it.iconTheme,adapter:a,socket:o,style:j}),n.jsx("span",{children:e?u.I18n.t(e):""})]},t),Rt="_cardStyle_8rq8v_1",tn="_cardStyleActive_8rq8v_17",nn="_controlMenu_8rq8v_22",en="_closeBtn_8rq8v_31",sn="_isDelete_8rq8v_73",on="_drag_mobile_8rq8v_90",G={cardStyle:Rt,cardStyleActive:tn,controlMenu:nn,closeBtn:en,isDelete:sn,drag_mobile:on};function K(e,t,s){let i;switch(e){case"actions":if(s==="else")return i={...t,actions:{...t[e],else:[...t[e].else]}},i;if(s==="then")return i={...t,actions:{...t[e],then:[...t[e].then]}},i;throw console.error(`Unknown additionalParameter: ${s}`),new Error(`Unknown additionalParameter: ${s}`);case"triggers":return i={...t,triggers:[...t.triggers]},i;case"conditions":return i={...t,conditions:[...t.conditions]},i;default:throw new Error(`Unknown name: ${e}`)}}function z(e,t,s,i){var a;switch(e){case"actions":return t.actions[s]=t.actions[s].filter(o=>o._id!==i),t;case"conditions":return t.conditions[s]=(a=t.conditions[s])==null?void 0:a.filter(o=>o._id!==i),t;default:return t.triggers=t.triggers.filter(o=>o._id!==i),t}}function cn(e,t,s){const{_id:i,acceptedBy:a}=e;let o;if(!a||!t[a])return console.warn(`Cannot find ${a}`),t;switch(a){case"actions":if(o=t.actions[s].find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=t.actions[s].indexOf(o);t.actions[s][c]=e}return t;case"conditions":if(o=t.conditions[s].find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=t.conditions[s].indexOf(o);t.conditions[s][c]=e}return t;default:if(o=t.triggers.find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=t.triggers.indexOf(o);t.triggers[c]=e}return t}}const Ot=yt(e=>{var N;const{setUserRules:t,userRules:s,_id:i,id:a,blockValue:o,active:c,acceptedBy:l,isTourOpen:d,setTourStep:j,tourStep:O}=e,[I,_]=M(null),{blocks:r,socket:k,onUpdate:H,setOnUpdate:w,onDebugMessage:f,enableSimulation:x}=nt(et),p=lt(h=>r==null?void 0:r.find(b=>b.getStaticData().id===h),[r]),g=lt(h=>{const b=cn(h,s,o);b&&t(b)},[s]),C=h=>{h.currentTarget!==I&&_(h.currentTarget)},q=()=>_(null),T=Dt(()=>{const h=p(a)||Nt;return n.jsx(h,{...e,notFound:!p(a),isTourOpen:d,setTourStep:j,tourStep:O,onUpdate:H,setOnUpdate:w,enableSimulation:x,onDebugMessage:f,onChange:g,className:void 0,socket:k})},[s,H,f,x]),[S,B]=M(!1);return n.jsxs("div",{onMouseMove:C,onMouseEnter:C,onMouseLeave:q,onMouseDown:h=>{if(h.ctrlKey){let b;const v=K(l,s,o);l==="conditions"?(b=v.conditions[o].find(m=>m._id===i),b&&v.conditions[o].splice(v.conditions[o].indexOf(b),0,{...b,_id:Date.now()})):l==="actions"?(b=v.actions[o].find(m=>m._id===i),b&&v.actions[o].splice(v.actions[o].indexOf(b),0,{...b,_id:Date.now()})):(b=v.triggers.find(m=>m._id===i),b&&v.triggers.splice(v[l].indexOf(b),0,{...b,_id:Date.now()})),t(v)}},id:"height",style:c?{width:(((N=document.getElementById("width"))==null?void 0:N.clientWidth)||0)-70}:void 0,className:`${G.cardStyle} ${c?G.cardStyleActive:null} ${S?G.isDelete:null}`,children:[n.jsx("div",{className:G.drag_mobile}),T,t&&n.jsx("div",{className:G.controlMenu,style:I?{opacity:1}:{opacity:0},children:n.jsx("div",{onClick:()=>{let h=K(l,s,o);h=z(l,h,o,i),B(!0),setTimeout(()=>{l==="triggers"&&w(!0),t(h)},300)},className:G.closeBtn})})]})}),rn={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},an=(e,t,s)=>{if(!e||!t)return{display:"none"};let{x:i,y:a}=t;const o=`translate(${i}px, ${a}px)`;return{transform:o,WebkitTransform:o}},ln=e=>{const{itemType:t,isDragging:s,item:i,initialOffset:a,currentOffset:o,targetIds:c}=zt(d=>({item:d.getItem(),itemType:d.getItemType(),initialOffset:d.getInitialSourceClientOffset(),currentOffset:d.getSourceClientOffset(),isDragging:d.isDragging(),targetIds:d.getTargetIds()})),l=()=>t==="box"?c.length?n.jsx(Ot,{active:!0,...i,allBlocks:e.allBlocks}):n.jsx(It,{active:!0,...i,socket:e.socket}):null;return s?n.jsx("div",{style:rn,children:n.jsx("div",{style:an(a,o),children:l()})}):null},dn="_border_wrpm3_1",fn="_emptyBlockStyle_wrpm3_6",mn="_emptyBlock_wrpm3_6",gn="_selectOnChange_wrpm3_22",hn="_selectOnChangeHelp_wrpm3_28",_n="_selectOnChangeHelpIcon_wrpm3_34",pn="_emptyBlockNone_wrpm3_49",un="_mainBlockItemRules_wrpm3_55",xn="_nameBlockItems_wrpm3_63",bn="_contentBlockItem_wrpm3_73",wn="_wrapperMargin_wrpm3_81",Cn="_contentHeightOn_wrpm3_87",vn="_contentHeightOff_wrpm3_99",jn="_cardAdd_wrpm3_105",In="_blockCardAdd_wrpm3_125",On="_addClassOverflow_wrpm3_136",An="_addClassHeight_wrpm3_140",D={border:dn,emptyBlockStyle:fn,emptyBlock:mn,selectOnChange:gn,selectOnChangeHelp:hn,selectOnChangeHelpIcon:_n,emptyBlockNone:pn,mainBlockItemRules:un,nameBlockItems:xn,contentBlockItem:bn,wrapperMargin:wn,contentHeightOn:Cn,contentHeightOff:vn,cardAdd:jn,blockCardAdd:In,addClassOverflow:On,addClassHeight:An};function dt(e,t){const[s,i]=M(window.localStorage.getItem(t)?JSON.parse(window.localStorage.getItem(t)||""):e);return[s,o=>{window.localStorage.setItem(t,JSON.stringify(o)),i(o)},!!window.localStorage.getItem(t)]}function yn(e,t){let s=0,i=null,a;return function(...o){const c=Date.now();a=o,c-s>=t?(s=c,e.apply(this,o)):i||(i=setTimeout(()=>{s=Date.now(),i=null,e.apply(this,a)},t-(c-s)))}}function tt(e){if(Array.isArray(e))return e.map(t=>tt(t));if(typeof e=="function")return e.bind(null);if(e&&typeof e=="object"){const t={};return Object.keys(e).forEach(s=>{t[s]=tt(e[s])}),t}return e}const ct=yn((e,t)=>e(t),0);function R(e,t){const s=t.find(i=>i._id===e);return{card:s,index:s?t.indexOf(s):-1}}function rt(e,t,s,i,a,o,c,l,d){const{card:j,index:O}=R(e,s);if(!(Ot&&l>d)&&j&&O!==t){const I=tt(s);I.splice(O,1),I.splice(t,0,j);const _=tt(a);switch(o){case"actions":_.actions[c]=I,ct(i,_);return;case"conditions":_.conditions[c]=I,ct(i,_);return;default:_.triggers=I,ct(i,_);return}}}const Dn="_drag_7xfhc_1",kn="_root_7xfhc_11",gt={drag:Dn,root:kn},At=({typeBlock:e,allProperties:t,id:s,isActive:i,setUserRules:a,userRules:o,children:c,_id:l,blockValue:d})=>{const{setOnUpdate:j}=nt(et),[{opacity:O},I,_]=$t({type:"box",item:()=>({...t,id:s,isActive:i,_id:l}),end:(w,f)=>{const{acceptedBy:x}=w,p=f.getDropResult();let g;if(!p)return typeof l=="number"&&!f.getTargetIds().length&&(g=K(x,o,d),g=z(x,g,d,l),a(g)),null;if(p.blockValue!==d){const C=typeof l=="number"?l:Date.now();g=K(x,o,p.blockValue);const q={id:w.id,acceptedBy:w.acceptedBy};switch(x){case"actions":return d&&(g=z("actions",g,d,C)),g=z("actions",g,p.blockValue,C),g.actions[p.blockValue].push({...q,_id:C}),a(g);case"conditions":return typeof d=="number"&&(g=z("conditions",g,d,C)),g=z("conditions",g,p.blockValue,C),g.conditions[p.blockValue].push({...q,_id:C}),a(g);default:return j(!0),g=z("triggers",g,p.blockValue,C),g.triggers.push({...q,_id:C}),a(g)}}},collect:w=>({opacity:w.isDragging()?.4:1,isDragging:w.isDragging()})}),r=ut(null),[,k]=bt({accept:"box",canDrop:()=>!1,hover({_id:w,acceptedBy:f},x){var T;if(!r.current||e!==f)return;const p=(T=r.current)==null?void 0:T.getBoundingClientRect(),g=(p.bottom-p.top)/2,C=x.getClientOffset(),q=((C==null?void 0:C.y)||0)-p.top;if(l&&w!==l)switch(f){case"actions":if(d==="then"||d==="else"){const{index:S}=R(l,o.actions[d]);S!==w&&rt(w,S,o[f][d],a,o,f,d,q,g)}return;case"conditions":if(typeof d=="number"){const{index:S}=R(l,o[f][d]);S!==w&&rt(w,S,o[f][d],a,o,f,d,q,g)}return;default:{const{index:S}=R(l,o[f]);S!==w&&rt(w,S,o[f],a,o,f,void 0,q,g);return}}}});E(()=>{_(Gt(),{captureDraggingState:!0})},[]),I(k(r));const H=window.innerWidth<600;return n.jsxs("div",{ref:H&&l?null:r,className:gt.root,style:{opacity:O},children:[n.jsx("div",{className:l?gt.drag:null,ref:l&&H?r:null}),c]})},Sn=({onClose:e,open:t})=>n.jsxs(wt,{open:t,onClose:e,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[n.jsx(Ct,{children:n.jsxs("div",{style:{fontSize:"1rem",fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif',fontWeight:400,lineHeight:1.5,letterSpacing:"0.00938em"},children:[n.jsx("h3",{children:u.I18n.t("On condition change")}),n.jsx("div",{children:u.I18n.t("help_on_change")}),n.jsx("h3",{children:u.I18n.t("Just check")}),n.jsx("div",{children:u.I18n.t("help_just_check")})]})}),n.jsx(vt,{children:n.jsx(jt,{onClick:e,color:"primary",autoFocus:!0,startIcon:n.jsx(Lt,{}),children:u.I18n.t("OK")})})]}),Nn=({onClose:e,open:t})=>n.jsxs(wt,{open:t,onClose:e,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[n.jsx(Ct,{children:n.jsxs(Tt,{id:"alert-dialog-description",children:[n.jsx("h3",{children:u.I18n.t("On condition change")}),n.jsx("div",{children:u.I18n.t("help_on_change")}),n.jsx("h3",{children:u.I18n.t("Just check")}),n.jsx("div",{children:u.I18n.t("help_just_check")})]})}),n.jsx(vt,{children:n.jsx(jt,{onClick:e,color:"primary",autoFocus:!0,children:u.I18n.t("OK")})})]}),ht=({size:e,blockValue:t,boolean:s,typeBlock:i,userRules:a,setUserRules:o,animation:c,setTourStep:l,tourStep:d,isTourOpen:j,theme:O,themeType:I,themeName:_})=>{var W;const[r,k]=M(!1),[H,w]=M(!1),[f,x]=M(!1),[p,g]=M("");s===void 0&&(s=!0);const C=bt({accept:"box",drop:()=>({blockValue:t}),hover:({acceptedBy:A,_id:L},Z)=>{k(A===i),x(!!L),g(Z.getHandlerId()||"")},canDrop:({acceptedBy:A})=>(w(A===i),A===i),collect:A=>{var L;return{isOver:A.isOver(),canDrop:((L=A.getItem())==null?void 0:L.acceptedBy)===i,offset:A.getClientOffset(),targetId:A.getHandlerId()}}}),q=C[0],{canDrop:T,isOver:S,offset:B,targetId:N}=q,h=C[1];E(()=>{g("")},[B]);const b=T&&S;let v="";b?v=r?"#00fb003d":"#fb00002e":T?v=H?"#00fb003d":"#fb00002e":B&&(v=N===p?"#fb00002e":"");let m;return i==="actions"?m=a.actions[t]:i==="conditions"?m=a.conditions[t]:m=a.triggers,n.jsx("div",{ref:h,style:{backgroundColor:v},className:`${u.Utils.clsx(D.contentBlockItem,e&&D.addClassHeight)} ${s?c?D.contentHeightOn:null:D.contentHeightOff}`,children:n.jsxs("div",{className:D.wrapperMargin,children:[m.map(A=>n.jsx(At,{typeBlock:i,...A,blockValue:t,allProperties:A,userRules:a,setUserRules:o,children:n.jsx(Ot,{...A,isTourOpen:j,setTourStep:l,tourStep:d,settings:A,blockValue:t,userRules:a,setUserRules:o,theme:O,themeType:I,themeName:_})},A._id)),n.jsx("div",{style:b&&r&&!f?{height:((W=document.getElementById("height"))==null?void 0:W.clientHeight)||200}:void 0,className:`${D.emptyBlockStyle} ${b&&r&&!f?D.emptyBlock:D.emptyBlockNone}`})]})})},at=({size:e,typeBlock:t,name:s,nameAdditionally:i,additionally:a,border:o,userRules:c,setUserRules:l,iconName:d,adapter:j,socket:O,setTourStep:I,tourStep:_,isTourOpen:r,theme:k,themeType:H,themeName:w})=>{const[f,x,p]=dt(t==="actions"?!1:[],`additionallyClickItems_${t}`),[g,C]=M(!1),[q,T]=M(!1);E(()=>{if(t==="conditions"&&(f==null?void 0:f.length)!==c.conditions.length-1){const N=[];c.conditions.forEach((h,b)=>{b>0&&N.push({_id:Date.now(),open:!0})}),x([...f,...N])}t==="actions"&&!p&&c.actions.else.length&&x(!0)},[]);const[S,B]=M(!1);return n.jsxs("div",{className:`${u.Utils.clsx(D.mainBlockItemRules,e&&D.addClassOverflow)} ${o&&!e?D.border:null}`,children:[n.jsxs("span",{id:"width",className:D.nameBlockItems,children:[n.jsx(Y,{iconName:d,className:D.iconThemCard,adapter:j,socket:O}),s]}),t==="conditions"?n.jsxs("div",{style:{width:"100%"},children:[n.jsxs(Et,{variant:"standard",className:D.selectOnChange,value:c.justCheck||!1,onChange:N=>{const h=K("conditions",c);h.justCheck=N.target.value==="true",l(h)},children:[n.jsx(mt,{value:"false",children:u.I18n.t("on condition change")}),n.jsx(mt,{value:"true",children:u.I18n.t("just check")})]}),n.jsx(Pt,{size:"small",title:u.I18n.t("Explanation"),className:D.selectOnChangeHelp,onClick:()=>C(!0),children:n.jsx(qt,{className:D.selectOnChangeHelpIcon})})]}):null,n.jsx(ht,{setTourStep:I,tourStep:_,isTourOpen:r,blockValue:t==="actions"?"then":t==="conditions"?0:t,typeBlock:t,setUserRules:l,userRules:c,theme:k,themeName:w,themeType:H,size:e}),a&&[...Array(t==="actions"?1:c.conditions.length-1)].map((N,h)=>{const b=(v=h)=>t==="actions"?!!f:!!f.find((m,W)=>W===v&&m.open);return n.jsxs(xt,{children:[n.jsxs("div",{onClick:()=>{if(t==="actions")return x(!f),null;let v=JSON.parse(JSON.stringify(f));if(c.conditions[h+1].length)return v[h].open=!v[h].open,x(v),null;v=v.filter((m,W)=>W!==h),x(v),B(h),setTimeout(()=>{B(!1),l({...c,conditions:[...c.conditions.filter((m,W)=>W!==h+1)]})},250)},className:D.blockCardAdd,children:[b()?"-":"+",n.jsx("div",{className:D.cardAdd,children:i})]},h),n.jsx(ht,{blockValue:t==="actions"?"else":t==="conditions"?h+1:t,typeBlock:t,setUserRules:l,userRules:c,boolean:b(),animation:S===h,size:e,theme:k,themeName:w,themeType:H})]},`${h}_block_${t}`)}),a&&t==="conditions"&&n.jsxs("div",{onClick:()=>{x([...f,{_id:Date.now(),open:!0}]),l({...c,conditions:[...c.conditions,[]]}),B(c.conditions.length-1),setTimeout(()=>B(!1),1e3)},className:D.blockCardAdd,children:["+",n.jsx("div",{className:D.cardAdd,children:i})]}),n.jsx(Sn,{open:g,onClose:()=>C(!1)}),n.jsx(Nn,{open:q,onClose:()=>T(!1)})]})},$n="_menuRules_1qqcb_1",qn="_switchesRenderWrapper_1qqcb_13",Bn="_menuOff_1qqcb_22",Mn="_menuTitle_1qqcb_28",Hn="_marginAuto_1qqcb_42",Wn="_inputWidth_1qqcb_47",Tn="_menuWrapper_1qqcb_52",En="_hamburgerWrapper_1qqcb_57",Pn="_hamburgerOff_1qqcb_74",Un="_nothingFound_1qqcb_82",Fn="_resetSearch_1qqcb_89",Jn="_controlPanel_1qqcb_101",Ln="_controlPanelAppBar_1qqcb_112",zn="_addClassMenu_1qqcb_126",Gn="_addClassBackground_1qqcb_132",Kn="_addClassPosition_1qqcb_136",$={menuRules:$n,switchesRenderWrapper:qn,menuOff:Bn,menuTitle:Mn,marginAuto:Hn,inputWidth:Wn,menuWrapper:Tn,hamburgerWrapper:En,hamburgerOff:Pn,nothingFound:Un,resetSearch:Fn,controlPanel:Jn,controlPanelAppBar:Ln,addClassMenu:zn,addClassBackground:Gn,addClassPosition:Kn},Qn=e=>{const{allProperties:t,allProperties:{acceptedBy:s,id:i},setUserRules:a,userRules:o,setTourStep:c,tourStep:l,isTourOpen:d,onTouchMove:j,isActive:O}=e;return n.jsx(At,{allProperties:t,id:t.id,isActive:O,setUserRules:a,userRules:o,children:n.jsx(It,{onDoubleClick:()=>{d&&l===J.addScheduleByDoubleClick&&i==="TriggerScheduleBlock"&&c(J.openTagsMenu),d&&l===J.addActionPrintText&&i==="ActionPrintText"&&c(J.showJavascript);const I=Date.now();let _;switch(s){case"actions":_="then";break;case"conditions":_=o[s].length-1;break}const r=K(s,o,_),k={id:i,_id:I,acceptedBy:s};_!==void 0?s==="actions"?r.actions[_].push({...k}):s==="conditions"&&r.conditions[_].push({...k}):r.triggers.push({...k}),a(r)},...e,...t,onTouchMove:j})})},Yn="_hamburgerMenu_hqnsm_8",Zn="_animate_hqnsm_21",_t={hamburgerMenu:Yn,animate:Zn};function Xn({bool:e}){return n.jsx("div",{className:`${_t.hamburgerMenu} ${e?_t.animate:""}`})}const Vn=({addClass:e,setAllBlocks:t,allBlocks:s,userRules:i,onChangeBlocks:a,setTourStep:o,tourStep:c,isTourOpen:l})=>{const{blocks:d,socket:j}=nt(et),[O,I]=dt(!1,"hamburgerOnOff"),[_,r]=dt({text:"",type:"triggers",index:0},"filterControlPanel"),k=(f=_.text,x=_.type)=>{if(!d)return;let p=[...d];p=p.filter(g=>{if(!f)return!0;const{name:C}=g.getStaticData();return C&&u.I18n.t(C).toLowerCase().includes(f.toLowerCase())}),p=p.filter(g=>x===g.getStaticData().acceptedBy),t(p)},H=(f,x)=>{l&&x===0&&c===J.selectTriggers&&o(J.addScheduleByDoubleClick),l&&x===2&&c===J.selectActions&&o(J.addActionPrintText),r({..._,index:x,type:["triggers","conditions","actions"][x]}),k(_.text,["triggers","conditions","actions"][x])},w=f=>({id:`scrollable-force-tab-${f}`,"aria-controls":`scrollable-force-tabpanel-${f}`});return E(()=>{k()},[d]),n.jsx(Ut,{mouseEvent:!1,touchEvent:"onTouchStart",onClickAway:()=>I(!0),children:n.jsxs("div",{className:u.Utils.clsx($.menuWrapper,e[1035]&&$.addClassMenu),children:[n.jsx("div",{className:`${$.hamburgerWrapper} ${O?$.hamburgerOff:null}`,onClick:()=>I(!O),children:n.jsx(Xn,{bool:!O})}),n.jsxs("div",{className:`${u.Utils.clsx($.menuRules,e[1035]&&$.addClassBackground,e[835]&&$.addClassPosition)} ${O?$.menuOff:null}`,children:[n.jsx("div",{className:$.controlPanel,children:n.jsx(Ft,{className:$.controlPanelAppBar,position:"static",children:n.jsxs(Jt,{value:_.index,onChange:H,children:[n.jsx(st,{className:"blocks-triggers",title:u.I18n.t("Triggers"),icon:n.jsx(Y,{iconName:"FlashOn"}),...w(0)}),n.jsx(st,{title:u.I18n.t("Conditions"),className:"blocks-conditions",icon:n.jsx(Y,{iconName:"Help"}),...w(1)}),n.jsx(st,{title:u.I18n.t("Actions"),className:"blocks-actions",icon:n.jsx(Y,{iconName:"PlayForWork"}),...w(2)})]})})}),n.jsx("div",{className:$.switchesRenderWrapper,children:n.jsxs("span",{children:[s.map(f=>{const{name:x,id:p,icon:g,adapter:C}=f.getStaticData();return n.jsx(xt,{children:n.jsx(Qn,{adapter:C,allProperties:f.getStaticData(),icon:g,id:p,isActive:!1,isTourOpen:l,name:x,onTouchMove:()=>I(!0),setTourStep:o,setUserRules:a,socket:j,tourStep:c,userRules:i})},p)}),!s.length&&n.jsxs("div",{className:$.nothingFound,children:[u.I18n.t("Nothing found"),"...",n.jsx("div",{className:$.resetSearch,onClick:()=>{r({..._,text:""}),k("")},children:u.I18n.t("reset search")})]})]})}),n.jsx("div",{className:u.Utils.clsx($.menuTitle,$.marginAuto)}),n.jsx(Bt,{className:$.inputWidth,fullWidth:!0,customValue:!0,value:_.text,size:"small",autoComplete:"off",label:u.I18n.t("search"),variant:"outlined",onChange:f=>{r({..._,text:f}),k(f)}})]})]})})};let pt=[];const me=({code:e,onChange:t,themeName:s,themeType:i,theme:a,setTourStep:o,tourStep:c,isTourOpen:l,command:d,scriptId:j,changed:O,running:I})=>{var v;const{blocks:_,socket:r,setOnUpdate:k,setOnDebugMessage:H,setEnableSimulation:w}=nt(et),[f,x]=M([]),[p,g]=M(ft(e)),[C,q]=M(""),[T,S]=M(!1);E(()=>{let m,W;const A=(P,y)=>{P===`${m}.alive`&&W!==(y==null?void 0:y.val)&&(W=!!(y!=null&&y.val),W&&m&&(r==null||r.sendTo(m.replace(/^system\.adapter\./,""),"rulesOn",j)))},L=(P,y)=>{var U,Q;r&&m!==((U=y==null?void 0:y.common)==null?void 0:U.engine)&&(m&&(r.unsubscribeState(`${m}.alive`,A),W&&r.sendTo(m.replace(/^system\.adapter\./,""),"rulesOn",j)),m=(Q=y==null?void 0:y.common)==null?void 0:Q.engine,m&&m&&r.subscribeState(`${m}.alive`,A))},Z=(P,y)=>{if(y)try{const U=JSON.parse(y.val),Q=Date.now();if(U.ruleId===j&&Q-U.ts<1e3){const F=[...pt,{blockId:U.blockId,data:U.data,ts:U.ts}];F.length>200&&F.splice(0,200-F.length);for(let X=F.length-1;X>=0;X--)if(F[X].ts{var y;m=(y=P==null?void 0:P.common)==null?void 0:y.engine,r.subscribeObject(j,L),m&&(r.subscribeState(`${m}.alive`,A),r.subscribeState(`${m.replace(/^system\.adapter\./,"")}.debug.rules`,Z))}),function(){r==null||r.unsubscribeObject(j,L),m&&(r==null||r.unsubscribeState(`${m}.alive`,A),W&&(r==null||r.sendTo(m.replace(/^system\.adapter\./,""),"rulesOff",j)),r==null||r.unsubscribeState(`${m.replace(/^system\.adapter\./,"")}.debug.rules`,Z))}},[]),E(()=>{w(!O&&I)},[O,I,w]),E(()=>{d&&(q(d),T||S(!0))},[d]),E(()=>{const m=ft(e);JSON.stringify(m)!==JSON.stringify(p)&&(g(m),k(!0))},[e]),E(()=>{document.getElementsByTagName("HTML")[0].className=s||"blue"},[s]);const B=lt(m=>{g(m),_&&t(Mt(m,_))},[_,t]),N=ut(null),[h,b]=M({835:!1,1035:!1});return E(()=>{N.current&&(N.current.clientWidth<=1035&&b({835:!1,1035:!0}),N.current.clientWidth<=835&&b({1035:!0,835:!0}),N.current.clientWidth>1035&&b({835:!1,1035:!1}))},[((v=N.current)==null?void 0:v.clientWidth)||0]),!_||!r?null:n.jsxs("div",{className:ot.wrapperRules,ref:N,children:[n.jsx(ln,{allBlocks:f,socket:r}),T?C==="export"?n.jsx(Ht,{scriptId:j,themeType:i,onClose:()=>S(!1),text:JSON.stringify(p,null,2)}):n.jsx(Wt,{themeType:i,onClose:m=>{S(!1),m&&B(JSON.parse(m))}}):null,n.jsxs("div",{className:u.Utils.clsx(ot.rootWrapper,h[835]&&ot.addClass),children:[n.jsx(Vn,{setAllBlocks:x,allBlocks:f,userRules:p,onChangeBlocks:B,setTourStep:o,tourStep:c,addClass:h,isTourOpen:l}),n.jsx(at,{socket:r,setUserRules:B,userRules:p,isTourOpen:l,setTourStep:o,tourStep:c,name:`${u.I18n.t("when")}...`,typeBlock:"triggers",iconName:"FlashOn",size:h[835],themeType:i,themeName:s,theme:a}),n.jsx(at,{socket:r,setUserRules:B,isTourOpen:l,setTourStep:o,tourStep:c,userRules:p,name:`...${u.I18n.t("and")}...`,typeBlock:"conditions",iconName:"Help",nameAdditionally:u.I18n.t("or"),additionally:!0,border:!0,size:h[835],themeType:i,themeName:s,theme:a}),n.jsx(at,{socket:r,setUserRules:B,isTourOpen:l,setTourStep:o,tourStep:c,userRules:p,name:`...${u.I18n.t("then")}`,typeBlock:"actions",iconName:"PlayForWork",nameAdditionally:u.I18n.t("else"),additionally:!0,size:h[835],themeType:i,themeName:s,theme:a})]})]},"rulesEditor")};export{me as default}; diff --git a/admin/tab.html b/admin/tab.html index 10f69d875..c4c4f9c51 100644 --- a/admin/tab.html +++ b/admin/tab.html @@ -115,7 +115,7 @@ type="text/javascript" src="google-blockly/own/blocks_object.js" > - + diff --git a/io-package.json b/io-package.json index df751c15a..900a8f125 100644 --- a/io-package.json +++ b/io-package.json @@ -53,19 +53,6 @@ "uk": "Малі оптимізації інтерфейсу\nДодано підтримку користувацького OpenAI-сумісного API endpoints (наприклад, Ollama, LM Studio, Google Gemini, DeepSeek, OpenRouter)\nДодано налаштування URL-адреси бази в налаштуваннях адаптера\nМоделі тепер динамічно від налаштованої точки API\nДодано кнопку \"Test API підключення\" в налаштуваннях адаптера\nДодана обробка помилок з зручними повідомленнями для ненадійних постачальників\nДодано функцію трейдингу для завантаження моделі\nУсі виклики API (модельи + чат) проксіовані сервери, щоб уникнути проблем з локальними постачальниками\nСмуга LLM мислення артефакти відповідей (для місцевих моделей, таких як Ollama)", "zh-cn": "小图形界面优化\n添加自定义的 OpenAI 兼容 API 端点支持( 如 Ollama, LM Studio, Google 双子座, DeepSeek, OpenRouter)\n在适配器设置中添加可配置的基础 URL\n现在从配置的 API 端点动态获取模型\n在适配器设置中添加“ 测试 API 连接” 按钮\n为无法访问的提供者处理方便用户的信件时添加错误处理\n为失败的模型加载添加了重试功能\n所有 API 呼叫( 模式 + 聊天) 均为代理服务器侧面, 以避免 CORS 与本地供应商发生问题\n从回应中脱去LLM思考文物(为奥拉马等本地模型)" }, - "9.1.0": { - "en": "Added support for custom OpenAI-compatible API endpoints (e.g. Ollama, LM Studio, Google Gemini, DeepSeek, OpenRouter)\nAdded configurable base URL in adapter settings\nModels are now fetched dynamically from the configured API endpoint\nAdded the \"Test API connection\" button in adapter settings\nAdded error handling with user-friendly messages for unreachable providers\nAdded retry functionality for failed model loading\nAll API calls (models + chat) are proxied server-side to avoid CORS issues with local providers\nStrip LLM thinking artifacts from responses (for local models like Ollama)", - "de": "Unterstützung für benutzerdefinierte OpenAI-kompatible API-Endpunkte (z.B. Ollama, LM Studio, Google Gemini, DeepSeek, OpenRouter)\nKonfigurierbare Basis-URL in Adaptereinstellungen hinzugefügt\nModelle werden nun dynamisch vom konfigurierten API-Endpunkt abgeholt\nHinzufügen der Schaltfläche \"Test API-Verbindung\" in Adaptereinstellungen\nHinzugefügt Fehlerbehandlung mit benutzerfreundlichen Nachrichten für unerreichbare Anbieter\nZusätzliche Retry-Funktionalität für gescheiterte Modellbeladung\nAlle API-Anrufe (Modelle + Chat) sind serverseitig proxied, um CORS Probleme mit lokalen Anbietern zu vermeiden\nStrip LLM denkende Artefakte aus Antworten (für lokale Modelle wie Ollama)", - "ru": "Добавлена поддержка пользовательских OpenAI-совместимых конечных точек API (например, Ollama, LM Studio, Google Gemini, DeepSeek, OpenRouter)\nДобавлен настраиваемый базовый URL в настройках адаптера\nМодели теперь динамически извлекаются из конфигурированной конечной точки API\nДобавлена кнопка «Test API connection» в настройках адаптера\nДобавлена обработка ошибок с помощью удобных сообщений для недостижимых поставщиков\nДобавлена функция retry для неудавшейся загрузки модели\nВсе вызовы API (модели + чат) проходят на стороне сервера, чтобы избежать проблем с CORS с местными провайдерами\nСтриптиз LLM мыслящие артефакты из ответов (для местных моделей, таких как Ollama)", - "pt": "Adicionado suporte para endpoints personalizados compatíveis com OpenAI API (por exemplo, Ollama, LM Studio, Google Gemini, DeepSeek, OpenRouter)\nAdicionado URL base configurável nas configurações do adaptador\nOs modelos agora são obtidos dinamicamente do endpoint da API configurado\nAdicionado o botão \"Teste conexão API\" nas configurações do adaptador\nTratamento de erros adicionado com mensagens amigáveis para provedores inalcançáveis\nAdicionada funcionalidade de repetição para carregamento do modelo falhou\nTodas as chamadas de API (modelos + chat) são proxied servidor-lado para evitar problemas CORS com fornecedores locais\nRetire artefatos de pensamento LLM de respostas (para modelos locais como Ollama)", - "nl": "Extra ondersteuning voor aangepaste OpenAI-compatibele API-eindpunten (bijv. Ollama, LM Studio, Google Gemini, DeepSeek, OpenRouter)\nConfigureerbare basis-URL in adapterinstellingen toegevoegd\nModellen worden nu dynamisch opgehaald uit het geconfigureerde API-eindpunt\nToegevoegd de \"Test API connection\" knop in adapter instellingen\nToegevoegd foutafhandeling met gebruiksvriendelijke berichten voor onbereikbare providers\nName\nAlle API-gesprekken (modellen + chat) zijn aangeprezen server-kant om CORS problemen met lokale aanbieders te voorkomen\nStrip LLM denken artefacten uit reacties (voor lokale modellen zoals Ollama)", - "fr": "Ajout de la prise en charge des paramètres d'API compatibles OpenAI personnalisés (par exemple Ollama, LM Studio, Google Gemini, DeepSeek, OpenRouter)\nAjout de l'URL de base configurable dans les paramètres de l'adaptateur\nLes modèles sont maintenant récupérés dynamiquement à partir du paramètre API configuré\nAjout du bouton \"Tester la connexion API\" dans les paramètres de l'adaptateur\nAjout du traitement des erreurs avec des messages conviviaux pour les fournisseurs inaccessibles\nAjout de la fonctionnalité de réessayer pour le chargement du modèle échoué\nTous les appels API (modèles + chat) sont proxiés côté serveur pour éviter les problèmes CORS avec les fournisseurs locaux\nStrip LLM artefacts de réflexion des réponses (pour les modèles locaux comme Ollama)", - "it": "Aggiunto il supporto per i endpoint API personalizzati compatibili con OpenAI (ad esempio Ollama, LM Studio, Google Gemini, DeepSeek, OpenRouter)\nAggiunto URL di base configurabile nelle impostazioni dell'adattatore\nI modelli sono ora recuperati dinamicamente dal endpoint API configurato\nAggiunto il pulsante \"Test API Connection\" nelle impostazioni dell'adattatore\nGestione degli errori aggiunti con messaggi intuitivi per fornitori irraggiungibili\nAggiunta funzionalità retry per il caricamento del modello fallito\nTutte le chiamate API (modelli + chat) sono proxied server-side per evitare problemi CORS con i fornitori locali\nStrip LLM pensa artefatti da risposte (per modelli locali come Ollama)", - "es": "Añadido soporte para terminales API compatibles con OpenAI (por ejemplo Ollama, LM Studio, Google Gemini, DeepSeek, OpenRouter)\nURL de base configurable en la configuración del adaptador\nLos modelos ahora se recogen dinámicamente desde el punto final de API configurado\nSe agregó el botón \"Test API connection\" en la configuración del adaptador\nManejo de error añadido con mensajes fáciles de usar para proveedores no accesibles\nFunción de retry adicional para la carga del modelo fallido\nTodas las llamadas de API (models + chat) son proxied servidor-side para evitar problemas de CORS con proveedores locales\nStrip LLM piensa artefactos de respuestas (para modelos locales como Ollama)", - "pl": "Dodano obsługę własnych punktów końcowych kompatybilnych z OpenAI (np. Ollama, LM Studio, Google Gemini, DeepSeek, OpenRouter)\nDodano konfigurowalny podstawowy adres URL w ustawieniach adaptera\nModele są teraz odbierane dynamicznie z skonfigurowanego punktu końcowego API\nDodano przycisk \"Test API connection\" w ustawieniach adaptera\nDodano obsługę błędów z komunikatami przyjaznymi dla użytkownika dla nieosiągalnych dostawców\nDodano funkcję ponownego testowania dla nieudanego obciążenia modelu\nWszystkie połączenia API (modele + czat) są proxied server- side, aby uniknąć problemów CORS z lokalnymi dostawcami\nStrip LLM myśli artefakty z odpowiedzi (dla lokalnych modeli takich jak Ollama)", - "uk": "Додано підтримку користувацького OpenAI-сумісного API endpoints (наприклад, Ollama, LM Studio, Google Gemini, DeepSeek, OpenRouter)\nДодано налаштування URL-адреси бази в налаштуваннях адаптера\nМоделі тепер динамічно від налаштованої точки API\nДодано кнопку \"Test API підключення\" в налаштуваннях адаптера\nДодана обробка помилок з зручними повідомленнями для ненадійних постачальників\nДодано функцію трейдингу для завантаження моделі\nУсі виклики API (модельи + чат) проксіовані сервери, щоб уникнути проблем з локальними постачальниками\nСмуга LLM мислення артефакти відповідей (для місцевих моделей, таких як Ollama)", - "zh-cn": "添加自定义的 OpenAI 兼容 API 端点支持( 如 Ollama, LM Studio, Google 双子座, DeepSeek, OpenRouter)\n在适配器设置中添加可配置的基础 URL\n现在从配置的 API 端点动态获取模型\n在适配器设置中添加“ 测试 API 连接” 按钮\n为无法访问的提供者处理方便用户的信件时添加错误处理\n为失败的模型加载添加了重试功能\n所有 API 呼叫( 模式 + 聊天) 均为代理服务器侧面, 以避免 CORS 与本地供应商发生问题\n从回应中脱去LLM思考文物(为奥拉马等本地模型)" - }, "9.0.18": { "en": "Corrected error message with `lastSync`\nCorrected JavaScript filter", "de": "Korrigierte Fehlermeldung mit `last Synthetisch `\nJavaScript-Filter korrigiert", diff --git a/src-admin/package-lock.json b/src-admin/package-lock.json index 6b8c62821..9228b5845 100644 --- a/src-admin/package-lock.json +++ b/src-admin/package-lock.json @@ -133,6 +133,7 @@ "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.29.0", "@babel/generator": "^7.29.0", @@ -1692,6 +1693,7 @@ "integrity": "sha512-yjvtXoFcrPLGtgKRxFaH6OQPtcLPhkloC0BML6rBG5UeldR0nPULR/2E2BfXdo5JNV7j7lOzrrLX2Qf/iSidow==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/runtime": "^7.26.0", "@mui/core-downloads-tracker": "^6.5.0", @@ -1846,7 +1848,6 @@ "integrity": "sha512-OJM+9nj5JIyPUvsZ5ZjaeC9PfktmK+W5YaVLToLR8L0lB/DGmv1gcKE43ssNLSvpoW71Hct0necfade6+kW3zQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.28.4", "@mui/utils": "^7.3.3", @@ -1875,7 +1876,6 @@ "integrity": "sha512-8vVje9rdEr1rY8oIkYgP+Su5Kwl6ik7O3jQ0wl78JGSmiZhRHV+vkjooGdKD8pbtZbutXFVTWQYshu2b3sG9zw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.28.4" }, @@ -1894,7 +1894,6 @@ "integrity": "sha512-kwNAUh7bLZ7mRz9JZ+6qfRnnxbE4Zuc+RzXnhSpRSxjTlSTj7b4JxRLXpG+MVtPVtqks5k/XC8No1Vs3x4Z2gg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.28.4", "@mui/types": "^7.4.7", @@ -1926,7 +1925,6 @@ "integrity": "sha512-CmFxvRJIBCEaWdilhXMw/5wFJ1+FT9f3xt+m2pPXhHPeVIbBg9MnMvNSJjdALvnQJMPw8jLhrUtXmN7QAZV2fw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.28.4", "@emotion/cache": "^11.14.0", @@ -1962,7 +1960,6 @@ "integrity": "sha512-Lqq3emZr5IzRLKaHPuMaLBDVaGvxoh6z7HMWd1RPKawBM5uMRaQ4ImsmmgXWtwJdfZux5eugfDhXJUo2mliS8Q==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.28.4", "@mui/private-theming": "^7.3.3", @@ -2004,7 +2001,6 @@ "integrity": "sha512-8vVje9rdEr1rY8oIkYgP+Su5Kwl6ik7O3jQ0wl78JGSmiZhRHV+vkjooGdKD8pbtZbutXFVTWQYshu2b3sG9zw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.28.4" }, @@ -2023,7 +2019,6 @@ "integrity": "sha512-kwNAUh7bLZ7mRz9JZ+6qfRnnxbE4Zuc+RzXnhSpRSxjTlSTj7b4JxRLXpG+MVtPVtqks5k/XC8No1Vs3x4Z2gg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.28.4", "@mui/types": "^7.4.7", @@ -3015,6 +3010,7 @@ "integrity": "sha512-z9VXpC7MWrhfWipitjNdgCauoMLRdIILQsAEV+ZesIzBq/oUlxk0m3ApZuMFCXdnS4U7KrI+l3WRUEGQ8K1QKw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@types/prop-types": "*", "csstype": "^3.2.2" @@ -3263,6 +3259,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.9.0", "caniuse-lite": "^1.0.30001759", @@ -3591,6 +3588,7 @@ "integrity": "sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==", "dev": true, "license": "MIT", + "peer": true, "funding": { "type": "github", "url": "https://github.com/sponsors/kossnocorp" @@ -4757,7 +4755,8 @@ "resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.9.4.tgz", "integrity": "sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA==", "dev": true, - "license": "BSD-2-Clause" + "license": "BSD-2-Clause", + "peer": true }, "node_modules/lie": { "version": "3.3.0", @@ -5478,6 +5477,7 @@ "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "loose-envify": "^1.1.0" }, @@ -5552,6 +5552,7 @@ "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" @@ -5825,6 +5826,7 @@ "integrity": "sha512-3GuObel8h7Kqdjt0gxkEzaifHTqLVW56Y/bjN7PSQtkKr0w3V/QYSdt6QWYtd7A1xUtYQigtdUfgj1RvWVtorw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@types/estree": "1.0.8" }, @@ -6365,6 +6367,7 @@ "integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.27.0", "fdir": "^6.5.0", @@ -6511,6 +6514,7 @@ "integrity": "sha512-LZNJgPzfKR+/J3cHkxcpHKpKKvGfDZVPS4hfJCc4cCG0CgYzvlD6yE/S3CIL/Yt91ak327YCpiF/0MyeZHEHKA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@colors/colors": "^1.6.0", "@dabh/diagnostics": "^2.0.8", @@ -6640,6 +6644,7 @@ "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=10.0.0" }, diff --git a/src-admin/package.json b/src-admin/package.json index 51c2c4a88..ba3c7d653 100644 --- a/src-admin/package.json +++ b/src-admin/package.json @@ -1,7 +1,7 @@ { "name": "iobroker-admin-component-javascript", "private": true, - "version": "9.1.0", + "version": "9.1.1", "type": "module", "scripts": { "start": "vite --port 4173", diff --git a/src-editor/package-lock.json b/src-editor/package-lock.json index eb41ca8f8..ad9b06a27 100644 --- a/src-editor/package-lock.json +++ b/src-editor/package-lock.json @@ -29,6 +29,7 @@ "@vitejs/plugin-react": "^5.2.0", "blockly": "^11.2.2", "file-selector": "^2.1.2", + "jszip": "^3.10.1", "monaco-editor": "~0.55.1", "openai": "^6.32.0", "react": "^18.3.1", @@ -168,6 +169,7 @@ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz", "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==", "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.29.0", "@babel/generator": "^7.29.0", @@ -229,7 +231,6 @@ "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.27.3.tgz", "integrity": "sha512-fXSwMQqitTGeHLBC08Eq5yXz2m37E4pJX1qAU1+2cNedz/ifv/bVXft90VeSav5nFO61EcNgwr0aJxbyPaWBPg==", "license": "MIT", - "peer": true, "dependencies": { "@babel/types": "^7.27.3" }, @@ -370,7 +371,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.28.6.tgz", "integrity": "sha512-wgEmr06G6sIpqr8YDwA2dSRTE3bJ+V0IfpzfSY3Lfgd7YWOaAdlykvJi13ZKBt8cZHfgH1IXN+CL656W3uUa4w==", "license": "MIT", - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.28.6" }, @@ -594,6 +594,7 @@ } ], "license": "MIT", + "peer": true, "engines": { "node": ">=18" }, @@ -616,6 +617,7 @@ } ], "license": "MIT", + "peer": true, "engines": { "node": ">=18" } @@ -783,8 +785,7 @@ "version": "0.8.5", "resolved": "https://registry.npmjs.org/@emotion/stylis/-/stylis-0.8.5.tgz", "integrity": "sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@emotion/unitless": { "version": "0.10.0", @@ -1574,26 +1575,6 @@ "node": ">=10" } }, - "node_modules/@module-federation/dts-plugin/node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, "node_modules/@module-federation/dts-plugin/node_modules/ws": { "version": "8.18.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", @@ -1661,26 +1642,6 @@ "node": ">=10" } }, - "node_modules/@module-federation/managers/node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, "node_modules/@module-federation/runtime": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/@module-federation/runtime/-/runtime-2.2.3.tgz", @@ -1716,26 +1677,6 @@ } } }, - "node_modules/@module-federation/runtime-core/node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, "node_modules/@module-federation/runtime/node_modules/@module-federation/sdk": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/@module-federation/sdk/-/sdk-2.2.3.tgz", @@ -1750,26 +1691,6 @@ } } }, - "node_modules/@module-federation/runtime/node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, "node_modules/@module-federation/third-party-dts-extractor": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/@module-federation/third-party-dts-extractor/-/third-party-dts-extractor-2.2.2.tgz", @@ -1882,26 +1803,6 @@ "@types/estree": "^1.0.0" } }, - "node_modules/@module-federation/vite/node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, "node_modules/@mui/core-downloads-tracker": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-6.5.0.tgz", @@ -1943,6 +1844,7 @@ "resolved": "https://registry.npmjs.org/@mui/material/-/material-6.5.0.tgz", "integrity": "sha512-yjvtXoFcrPLGtgKRxFaH6OQPtcLPhkloC0BML6rBG5UeldR0nPULR/2E2BfXdo5JNV7j7lOzrrLX2Qf/iSidow==", "license": "MIT", + "peer": true, "dependencies": { "@babel/runtime": "^7.26.0", "@mui/core-downloads-tracker": "^6.5.0", @@ -2099,7 +2001,6 @@ "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-7.3.9.tgz", "integrity": "sha512-ErIyRQvsiQEq7Yvcvfw9UDHngaqjMy9P3JDPnRAaKG5qhpl2C4tX/W1S4zJvpu+feihmZJStjIyvnv6KDbIrlw==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.28.6", "@mui/utils": "^7.3.9", @@ -2127,7 +2028,6 @@ "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.4.12.tgz", "integrity": "sha512-iKNAF2u9PzSIj40CjvKJWxFXJo122jXVdrmdh0hMYd+FR+NuJMkr/L88XwWLCRiJ5P1j+uyac25+Kp6YC4hu6w==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.28.6" }, @@ -2145,7 +2045,6 @@ "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-7.3.9.tgz", "integrity": "sha512-U6SdZaGbfb65fqTsH3V5oJdFj9uYwyLE2WVuNvmbggTSDBb8QHrFsqY8BN3taK9t3yJ8/BPHD/kNvLNyjwM7Yw==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.28.6", "@mui/types": "^7.4.12", @@ -2175,15 +2074,13 @@ "version": "19.2.4", "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.2.4.tgz", "integrity": "sha512-W+EWGn2v0ApPKgKKCy/7s7WHXkboGcsrXE+2joLyVxkbyVQfO3MUEaUQDHoSmb8TFFrSKYa9mw64WZHNHSDzYA==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@mui/styled-engine": { "version": "7.3.9", "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-7.3.9.tgz", "integrity": "sha512-JqujWt5bX4okjUPGpVof/7pvgClqh7HvIbsIBIOOlCh2u3wG/Bwp4+E1bc1dXSwkrkp9WUAoNdI5HEC+5HKvMw==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.28.6", "@emotion/cache": "^11.14.0", @@ -2218,7 +2115,6 @@ "resolved": "https://registry.npmjs.org/@mui/system/-/system-7.3.9.tgz", "integrity": "sha512-aL1q9am8XpRrSabv9qWf5RHhJICJql34wnrc1nz0MuOglPRYF/liN+c8VqZdTvUn9qg+ZjRVbKf4sJVFfIDtmg==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.28.6", "@mui/private-theming": "^7.3.9", @@ -2259,7 +2155,6 @@ "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.4.12.tgz", "integrity": "sha512-iKNAF2u9PzSIj40CjvKJWxFXJo122jXVdrmdh0hMYd+FR+NuJMkr/L88XwWLCRiJ5P1j+uyac25+Kp6YC4hu6w==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.28.6" }, @@ -2277,7 +2172,6 @@ "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-7.3.9.tgz", "integrity": "sha512-U6SdZaGbfb65fqTsH3V5oJdFj9uYwyLE2WVuNvmbggTSDBb8QHrFsqY8BN3taK9t3yJ8/BPHD/kNvLNyjwM7Yw==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.28.6", "@mui/types": "^7.4.12", @@ -2307,8 +2201,7 @@ "version": "19.2.4", "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.2.4.tgz", "integrity": "sha512-W+EWGn2v0ApPKgKKCy/7s7WHXkboGcsrXE+2joLyVxkbyVQfO3MUEaUQDHoSmb8TFFrSKYa9mw64WZHNHSDzYA==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@mui/types": { "version": "7.2.24", @@ -3534,6 +3427,7 @@ "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.28.tgz", "integrity": "sha512-z9VXpC7MWrhfWipitjNdgCauoMLRdIILQsAEV+ZesIzBq/oUlxk0m3ApZuMFCXdnS4U7KrI+l3WRUEGQ8K1QKw==", "license": "MIT", + "peer": true, "dependencies": { "@types/prop-types": "*", "csstype": "^3.2.2" @@ -3738,7 +3632,6 @@ "resolved": "https://registry.npmjs.org/babel-plugin-styled-components/-/babel-plugin-styled-components-2.1.4.tgz", "integrity": "sha512-Xgp9g+A/cG47sUyRwwYxGM4bR/jDRg5N6it/8+HxCnbT5XNKSKDT9xm4oag/osgqjC2It/vH0yXsomOG6k558g==", "license": "MIT", - "peer": true, "dependencies": { "@babel/helper-annotate-as-pure": "^7.22.5", "@babel/helper-module-imports": "^7.22.5", @@ -3755,7 +3648,6 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "license": "MIT", - "peer": true, "engines": { "node": ">=8.6" }, @@ -3796,6 +3688,7 @@ "resolved": "https://registry.npmjs.org/blockly/-/blockly-11.2.2.tgz", "integrity": "sha512-YJW9jMz4qoBXzOOUqxWBOHL35QhOOTAg2a6sVAFJh+/uNTXW0z506JS7qkqZI4PQ9fnUhDqmhF8a0qWSTL1tjg==", "license": "Apache-2.0", + "peer": true, "dependencies": { "jsdom": "25.0.1" }, @@ -3834,6 +3727,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.9.0", "caniuse-lite": "^1.0.30001759", @@ -3893,7 +3787,6 @@ "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.1.tgz", "integrity": "sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==", "license": "MIT", - "peer": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -4183,7 +4076,6 @@ "resolved": "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz", "integrity": "sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==", "license": "ISC", - "peer": true, "engines": { "node": ">=4" } @@ -4193,7 +4085,6 @@ "resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-3.2.0.tgz", "integrity": "sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==", "license": "MIT", - "peer": true, "dependencies": { "camelize": "^1.0.0", "css-color-keywords": "^1.0.0", @@ -4231,7 +4122,6 @@ "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", "license": "MIT", "optional": true, - "peer": true, "engines": { "node": ">= 12" } @@ -4720,7 +4610,6 @@ ], "license": "MIT", "optional": true, - "peer": true, "dependencies": { "node-domexception": "^1.0.0", "web-streams-polyfill": "^3.0.3" @@ -4871,7 +4760,6 @@ "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", "license": "MIT", "optional": true, - "peer": true, "dependencies": { "fetch-blob": "^3.1.2" }, @@ -5078,7 +4966,6 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "license": "MIT", - "peer": true, "engines": { "node": ">=4" } @@ -5206,9 +5093,9 @@ } }, "node_modules/i18next": { - "version": "25.8.18", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-25.8.18.tgz", - "integrity": "sha512-lzY5X83BiL5AP77+9DydbrqkQHFN9hUzWGjqjLpPcp5ZOzuu1aSoKaU3xbBLSjWx9dAzW431y+d+aogxOZaKRA==", + "version": "25.10.2", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-25.10.2.tgz", + "integrity": "sha512-eI/yYvivefa3sX6kRRhIuAHFNWS3NVa5joa0I80tDZ2Kw6uI2Cjhxb9R89A1f06N4DcryQbdGUieMitMnDA+1A==", "funding": [ { "type": "individual", @@ -5226,7 +5113,7 @@ "license": "MIT", "peer": true, "dependencies": { - "@babel/runtime": "^7.28.6" + "@babel/runtime": "^7.29.2" }, "peerDependencies": { "typescript": "^5" @@ -5899,6 +5786,7 @@ "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.55.1.tgz", "integrity": "sha512-jz4x+TJNFHwHtwuV9vA9rMujcZRb0CEilTEwG2rRSpe/A7Jdkuj8xPKttCgOh+v/lkHy7HsZ64oj+q3xoAFl9A==", "license": "MIT", + "peer": true, "dependencies": { "dompurify": "3.2.7", "marked": "14.0.0" @@ -5969,7 +5857,6 @@ ], "license": "MIT", "optional": true, - "peer": true, "engines": { "node": ">=10.5.0" } @@ -6297,8 +6184,7 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/process-nextick-args": { "version": "2.0.1", @@ -6329,6 +6215,7 @@ "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", "license": "MIT", + "peer": true, "dependencies": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", @@ -6393,6 +6280,7 @@ "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", "license": "MIT", + "peer": true, "dependencies": { "loose-envify": "^1.1.0" }, @@ -6527,6 +6415,7 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", "license": "MIT", + "peer": true, "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" @@ -6645,8 +6534,7 @@ "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/react-json-view": { "version": "1.21.3", @@ -6966,6 +6854,7 @@ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.52.5.tgz", "integrity": "sha512-3GuObel8h7Kqdjt0gxkEzaifHTqLVW56Y/bjN7PSQtkKr0w3V/QYSdt6QWYtd7A1xUtYQigtdUfgj1RvWVtorw==", "license": "MIT", + "peer": true, "dependencies": { "@types/estree": "1.0.8" }, @@ -7071,6 +6960,7 @@ "resolved": "https://registry.npmjs.org/sass/-/sass-1.98.0.tgz", "integrity": "sha512-+4N/u9dZ4PrgzGgPlKnaaRQx64RO0JBKs9sDhQ2pLgN6JQZ25uPQZKQYaBJU48Kd5BxgXoJ4e09Dq7nMcOUW3A==", "license": "MIT", + "peer": true, "dependencies": { "chokidar": "^4.0.0", "immutable": "^5.1.5", @@ -7148,8 +7038,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz", "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/shebang-command": { "version": "2.0.0", @@ -7324,7 +7213,6 @@ "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-5.3.11.tgz", "integrity": "sha512-uuzIIfnVkagcVHv9nE0VPlHPSCmXIUGKfJ42LNjxCCTDTL5sgnJ8Z7GZBq0EnLYGln77tPpEpExt2+qa+cZqSw==", "license": "MIT", - "peer": true, "dependencies": { "@babel/helper-module-imports": "^7.0.0", "@babel/traverse": "^7.4.5", @@ -7354,8 +7242,7 @@ "version": "0.7.5", "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz", "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/stylis": { "version": "4.2.0", @@ -7373,7 +7260,6 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "license": "MIT", - "peer": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -7740,6 +7626,7 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.1.tgz", "integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==", "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.27.0", "fdir": "^6.5.0", @@ -7887,7 +7774,6 @@ "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", "license": "MIT", "optional": true, - "peer": true, "engines": { "node": ">= 8" } @@ -7955,6 +7841,7 @@ "resolved": "https://registry.npmjs.org/winston/-/winston-3.19.0.tgz", "integrity": "sha512-LZNJgPzfKR+/J3cHkxcpHKpKKvGfDZVPS4hfJCc4cCG0CgYzvlD6yE/S3CIL/Yt91ak327YCpiF/0MyeZHEHKA==", "license": "MIT", + "peer": true, "dependencies": { "@colors/colors": "^1.6.0", "@dabh/diagnostics": "^2.0.8", @@ -8076,6 +7963,7 @@ "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", "license": "MIT", + "peer": true, "engines": { "node": ">=10.0.0" }, diff --git a/src-editor/package.json b/src-editor/package.json index 3e1319a89..9d92a8f40 100644 --- a/src-editor/package.json +++ b/src-editor/package.json @@ -1,6 +1,6 @@ { "name": "js", - "version": "9.1.0", + "version": "9.1.1", "private": true, "type": "module", "dependencies": { @@ -25,6 +25,7 @@ "@vitejs/plugin-react": "^5.2.0", "blockly": "^11.2.2", "file-selector": "^2.1.2", + "jszip": "^3.10.1", "monaco-editor": "~0.55.1", "openai": "^6.32.0", "react": "^18.3.1", diff --git a/src-editor/src/App.tsx b/src-editor/src/App.tsx index 78c38f1e9..24d6e70b3 100644 --- a/src-editor/src/App.tsx +++ b/src-editor/src/App.tsx @@ -37,6 +37,7 @@ import ptLang from './i18n/pt.json'; import ruLang from './i18n/ru.json'; import ukLang from './i18n/uk.json'; import zhCnLang from './i18n/zh-cn.json'; +import JSZip from 'jszip'; import type { ScriptType } from '@/types'; import PasswordDialog from '@/Dialogs/Password'; @@ -166,6 +167,7 @@ interface AppState extends GenericAppState { export default class App extends GenericApp { private hosts: string[] = []; private importFile: string | null = null; + private importFileName: string | null = null; private scripts: Record = {}; private confirmCallback: null | ((result: boolean) => void) = null; private changedScripts: { [id: string]: boolean } = {}; @@ -831,13 +833,7 @@ export default class App extends GenericApp { return undefined; } - async onExport(): Promise { - const host = await this.getLiveHost(); - if (!host) { - this.showJsError(I18n.t('No active host found')); - return; - } - + async onExport(isJsonOrText: boolean): Promise { const d = new Date(); let date = d.getFullYear().toString(); let m: number | string = d.getMonth() + 1; @@ -851,43 +847,82 @@ export default class App extends GenericApp { } date += `-${m}-`; - this.socket.getRawSocket().emit( - 'sendToHost', - host, - 'readObjectsAsZip', - { - adapter: 'javascript', - id: 'script.js', - link: `${date}scripts.zip`, // request link to file and not the data itself - fileStorageNamespace: `admin.${this.instance}`, // new controller 5.x understands this and saves ZIP in the file store - }, - (data: string | { data?: string; error?: string }) => { - if (typeof data === 'string') { - // it is a link to the created file - const a = document.createElement('a'); - // actual position is http://IP:8081/adapter/javascript/index.html - // we need http://IP:8081/files/admin.0/zip/2023-06-20-scripts.zip - a.href = `../../files/${data}`; - document.body.appendChild(a); - a.click(); - a.remove(); - } else { - data.error && this.showJsError(data.error); - if (data.data) { + if (isJsonOrText) { + // Export as JSON + const host = await this.getLiveHost(); + if (!host) { + this.showJsError(I18n.t('No active host found')); + return; + } + this.socket.getRawSocket().emit( + 'sendToHost', + host, + 'readObjectsAsZip', + { + adapter: 'javascript', + id: 'script.js', + link: `${date}scripts.zip`, // request link to file and not the data itself + fileStorageNamespace: `admin.${this.instance}`, // new controller 5.x understands this and saves ZIP in the file store + }, + (data: string | { data?: string; error?: string }) => { + if (typeof data === 'string') { + // it is a link to the created file const a = document.createElement('a'); - a.href = `data: application/zip;base64,${data.data}`; - a.download = `${date}scripts.zip`; + // actual position is http://IP:8081/adapter/javascript/index.html + // we need http://IP:8081/files/admin.0/zip/2023-06-20-scripts.zip + a.href = `../../files/${data}`; document.body.appendChild(a); a.click(); a.remove(); + } else { + data.error && this.showJsError(data.error); + if (data.data) { + const a = document.createElement('a'); + a.href = `data: application/zip;base64,${data.data}`; + a.download = `${date}scripts.zip`; + document.body.appendChild(a); + a.click(); + a.remove(); + } } + }, + ); + } else { + // Export as ZIP with same structure of scripts but in plain text + const zip = new JSZip(); + for (const [id, obj] of Object.entries(this.scripts)) { + if (obj.type === 'script') { + const scriptObj = obj; + const ext = + scriptObj.common.engineType === 'TypeScript/ts' + ? 'ts' + : scriptObj.common.engineType === 'Blockly' + ? 'blockly' + : scriptObj.common.engineType === 'Rules' + ? 'rules' + : 'js'; + let text = `/******* (ext=${ext}/engine=${scriptObj.common.engine}/debug=${scriptObj.common.debug}/verbose=${scriptObj.common.verbose}/enabled=${scriptObj.common.enabled}) *******/\n`; + text += scriptObj.common.source || ''; + // Convert dots in the path to slashes to create folder structure, e.g. common.myFolder.myScript → common/myFolder/myScript.js + const filePath = `${id.substring('script.js.'.length).replace(/\./g, '/')}.${ext}`; + zip.file(filePath, text); } - }, - ); + } + zip.generateAsync({ type: 'blob' }).then(blob => { + const a = document.createElement('a'); + a.href = URL.createObjectURL(blob); + a.download = `${date}scripts_plain.zip`; + document.body.appendChild(a); + a.click(); + a.remove(); + URL.revokeObjectURL(a.href); + }); + } } - onImport(data: string | undefined): void { + onImport(data: string | undefined, name?: string): void { this.importFile = data || null; + this.importFileName = name || null; if (data) { this.confirmCallback = this.onImportConfirmed.bind(this); this.setState({ importFile: false, confirm: I18n.t('Existing scripts will be overwritten.') }); @@ -898,35 +933,141 @@ export default class App extends GenericApp { async onImportConfirmed(ok: boolean): Promise { let data = this.importFile; + const fileName = this.importFileName; this.importFile = null; + this.importFileName = null; if (ok && data) { - data = data.split(',')[1]; - const host = await this.getLiveHost(); - if (!host) { - this.showJsError(I18n.t('No active host found')); - return; - } - this.socket.getRawSocket().emit( - 'sendToHost', - host, - 'writeObjectsAsZip', - { - data: data, - adapter: 'javascript', - id: 'script.js', - }, - (data: string | { error?: string }) => { - if (data === 'permissionError') { - this.showJsError(I18n.t(data)); - } else if (!data || (data as { error?: string }).error) { - this.showJsError( - data ? I18n.t((data as { error?: string }).error || '') : I18n.t('Unknown error'), + // Check if the file name indicates a plain text export (e.g., "2026-03-21-scripts_plain.zip") + const isPlain = fileName && /_(plain|text)\.zip$/i.test(fileName); + + if (isPlain) { + // Import plain text ZIP in browser: parse each file's first line for metadata + data = data.split(',')[1]; + try { + const zip = await JSZip.loadAsync(data, { base64: true }); + const promises: Promise[] = []; + + zip.forEach((relativePath, zipEntry) => { + if (zipEntry.dir) { + return; + } + promises.push( + zipEntry.async('string').then(async content => { + const lines = content.split('\n'); + const firstLine = lines[0] || ''; + const source = lines.slice(1).join('\n'); + + // Parse first line: /******* (ext=js/engine=system.adapter.javascript.0/debug=false/verbose=false/enabled=true) *******/ + const match = firstLine.match( + /\/\*{7}\s*\(ext=(\w+)\/engine=([^/]+)\/debug=(\w+)\/verbose=(\w+)\/enabled=(\w+)\)\s*\*{7}\//, + ); + + let engineType: ScriptType = 'Javascript/js'; + let engine = 'system.adapter.javascript.0'; + let debug = false; + let verbose = false; + let enabled = false; + + if (match) { + const ext = match[1]; + engine = match[2]; + debug = match[3] === 'true'; + verbose = match[4] === 'true'; + enabled = match[5] === 'true'; + + if (ext === 'ts') { + engineType = 'TypeScript/ts'; + } else if (ext === 'blockly') { + engineType = 'Blockly'; + } else if (ext === 'rules') { + engineType = 'Rules'; + } + } + + // Convert file path back to script ID: common/myFolder/myScript.js → script.js.common.myFolder.myScript + const scriptPath = relativePath.replace(/\.\w+$/, '').replace(/\//g, '.'); + const id = `script.js.${scriptPath}`; + const name = scriptPath.split('.').pop() || scriptPath; + + // Ensure parent folders exist + const parts = id.split('.'); + for (let i = 3; i < parts.length; i++) { + const folderId = parts.slice(0, i).join('.'); + if (!this.scripts[folderId]) { + try { + await this.socket.setObject(folderId, { + _id: folderId, + type: 'channel', + common: { + name: parts[i - 1], + expert: true, + }, + native: {}, + }); + } catch { + // folder may already exist + } + } + } + + await this.socket.setObject(id, { + _id: id, + type: 'script', + common: { + name, + expert: true, + engineType: engineType as + | 'TypeScript/ts' + | 'Blockly' + | 'Rules' + | 'Javascript/js', + engine, + enabled, + source, + debug, + verbose, + }, + native: {}, + }); + }), ); - } else { - this.showMessage(I18n.t('Done')); - } - }, - ); + }); + + await Promise.all(promises); + this.showMessage(I18n.t('Done')); + } catch (err) { + this.showJsError(err as Error); + } + } else { + // Standard JSON ZIP import via host + data = data.split(',')[1]; + const host = await this.getLiveHost(); + if (!host) { + this.showJsError(I18n.t('No active host found')); + return; + } + this.socket.getRawSocket().emit( + 'sendToHost', + host, + 'writeObjectsAsZip', + { + data: data, + adapter: 'javascript', + id: 'script.js', + }, + (data: string | { error?: string }) => { + if (data === 'permissionError') { + this.showJsError(I18n.t(data)); + } else if (!data || (data as { error?: string }).error) { + this.showJsError( + data ? I18n.t((data as { error?: string }).error || '') : I18n.t('Unknown error'), + ); + } else { + this.showMessage(I18n.t('Done')); + } + }, + ); + } } } @@ -1092,7 +1233,7 @@ export default class App extends GenericApp { {this.state.importFile ? ( this.onImport(data)} + onClose={(data, name) => this.onImport(data, name)} /> ) : null} {this.state.confirm ? ( diff --git a/src-editor/src/Dialogs/ImportFile.tsx b/src-editor/src/Dialogs/ImportFile.tsx index db1da5360..ccf0a6bfb 100644 --- a/src-editor/src/Dialogs/ImportFile.tsx +++ b/src-editor/src/Dialogs/ImportFile.tsx @@ -67,7 +67,7 @@ const styles: Record = { }; interface DialogImportFileProps { - onClose: (data?: string) => void; + onClose: (data?: string, name?: string) => void; } interface DialogImportFileState { error: string; @@ -135,7 +135,7 @@ class DialogImportFile extends React.Component void; onEnableDisable: (id: string, enabled: boolean) => void; onDelete: (id: string) => void; - onExport: () => void; - onImport: () => void; + onExport?: (isJsonOrText: boolean) => void; + onImport?: () => void; onRename: (oldId: string, newId: string, newName?: string, newInstance?: number) => void; instances: number[]; scripts: Record; @@ -552,6 +556,7 @@ interface SideDrawerState { scriptsHash: number; showAdapterDebug: boolean; isAllZeroInstances: boolean; + showExportDialog: boolean; } export default class SideDrawer extends React.Component { @@ -603,6 +608,7 @@ export default class SideDrawer extends React.Component { event.stopPropagation(); event.preventDefault(); - this.onCloseMenu(() => this.props.onExport()); + this.onCloseMenu(() => this.setState({ showExportDialog: true })); }} > @@ -1531,7 +1537,7 @@ export default class SideDrawer extends React.Component { event.stopPropagation(); event.preventDefault(); - this.onCloseMenu(() => this.props.onImport()); + this.onCloseMenu(() => this.props.onImport!()); }} > @@ -2194,6 +2200,45 @@ export default class SideDrawer extends React.Component this.setState({ showExportDialog: false })} + > + {I18n.t('Export all scripts')} + + + + + + + ) : null, ]; } } diff --git a/src-editor/src/i18n/de.json b/src-editor/src/i18n/de.json index 369fceb7c..1df304a38 100644 --- a/src-editor/src/i18n/de.json +++ b/src-editor/src/i18n/de.json @@ -280,6 +280,8 @@ "acknowledgment": "Wissen", "all": "alle", "and": "und", + "as JSON": "als JSON", + "as plain text": "als Klartext", "astro": "Astro", "at": "um", "clear running": "laufende abbrechen", diff --git a/src-editor/src/i18n/en.json b/src-editor/src/i18n/en.json index 6b7966842..5bc6b01ce 100644 --- a/src-editor/src/i18n/en.json +++ b/src-editor/src/i18n/en.json @@ -280,6 +280,8 @@ "acknowledgment": "acknowledgment", "all": "all", "and": "and", + "as JSON": "as JSON", + "as plain text": "as plain text", "astro": "Astro", "at": "at", "clear running": "clear running", diff --git a/src-editor/src/i18n/es.json b/src-editor/src/i18n/es.json index 35b018b3e..b06f10de2 100644 --- a/src-editor/src/i18n/es.json +++ b/src-editor/src/i18n/es.json @@ -280,6 +280,8 @@ "acknowledgment": "Reconocimiento", "all": "todos", "and": "y", + "as JSON": "como JSON", + "as plain text": "como texto plano", "astro": "astro", "at": "a", "clear running": "carrera clara", diff --git a/src-editor/src/i18n/fr.json b/src-editor/src/i18n/fr.json index f81e63b89..7a5c06e55 100644 --- a/src-editor/src/i18n/fr.json +++ b/src-editor/src/i18n/fr.json @@ -280,6 +280,8 @@ "acknowledgment": "reconnaissance", "all": "tout", "and": "et", + "as JSON": "en JSON", + "as plain text": "en texte brut", "astro": "astro", "at": "à", "clear running": "course claire", diff --git a/src-editor/src/i18n/it.json b/src-editor/src/i18n/it.json index dc623b930..8aa27a422 100644 --- a/src-editor/src/i18n/it.json +++ b/src-editor/src/i18n/it.json @@ -280,6 +280,8 @@ "acknowledgment": "riconoscimento", "all": "tutti", "and": "e", + "as JSON": "come JSON", + "as plain text": "come testo", "astro": "astro", "at": "a", "clear running": "chiara esecuzione", diff --git a/src-editor/src/i18n/nl.json b/src-editor/src/i18n/nl.json index 83e1203c2..7f3335bd8 100644 --- a/src-editor/src/i18n/nl.json +++ b/src-editor/src/i18n/nl.json @@ -280,6 +280,8 @@ "acknowledgment": "erkenning", "all": "alle", "and": "en", + "as JSON": "als JSON", + "as plain text": "als platte tekst", "astro": "astro", "at": "Bij", "clear running": "duidelijk rennen", diff --git a/src-editor/src/i18n/pl.json b/src-editor/src/i18n/pl.json index af4300b76..9e3a5fd02 100644 --- a/src-editor/src/i18n/pl.json +++ b/src-editor/src/i18n/pl.json @@ -280,6 +280,8 @@ "acknowledgment": "potwierdzenie", "all": "wszystko", "and": "i", + "as JSON": "jako JSON", + "as plain text": "jako zwykły tekst", "astro": "Astro", "at": "w", "clear running": "czyste uruchomienie", diff --git a/src-editor/src/i18n/pt.json b/src-editor/src/i18n/pt.json index 470154acd..6f07def91 100644 --- a/src-editor/src/i18n/pt.json +++ b/src-editor/src/i18n/pt.json @@ -280,6 +280,8 @@ "acknowledgment": "reconhecimento", "all": "todos", "and": "e", + "as JSON": "como JSON", + "as plain text": "como texto simples", "astro": "astro", "at": "no", "clear running": "corrida limpa", diff --git a/src-editor/src/i18n/ru.json b/src-editor/src/i18n/ru.json index f747b7d2d..bd5131ba8 100644 --- a/src-editor/src/i18n/ru.json +++ b/src-editor/src/i18n/ru.json @@ -280,6 +280,8 @@ "acknowledgment": "подтверждение", "all": "все", "and": "и", + "as JSON": "как JSON", + "as plain text": "как текст", "astro": "Астро", "at": "в", "clear running": "остановить уже бегущие", diff --git a/src-editor/src/i18n/uk.json b/src-editor/src/i18n/uk.json index 65e87349c..c9a6b590f 100644 --- a/src-editor/src/i18n/uk.json +++ b/src-editor/src/i18n/uk.json @@ -280,6 +280,8 @@ "acknowledgment": "підтвердження", "all": "все", "and": "і", + "as JSON": "як JSON", + "as plain text": "як текст", "astro": "Астро", "at": "в", "clear running": "чіткий біг", diff --git a/src-editor/src/i18n/zh-cn.json b/src-editor/src/i18n/zh-cn.json index 40ffdb94c..a0a126df7 100644 --- a/src-editor/src/i18n/zh-cn.json +++ b/src-editor/src/i18n/zh-cn.json @@ -280,6 +280,8 @@ "acknowledgment": "致谢", "all": "全部", "and": "和", + "as JSON": "为 JSON", + "as plain text": "为纯文本", "astro": "天文", "at": "在", "clear running": "畅通无阻", From 06bad4dff44112291a223ba15bb26c24ae567bfe Mon Sep 17 00:00:00 2001 From: GermanBluefox Date: Sat, 21 Mar 2026 19:12:05 +0100 Subject: [PATCH 2/7] Disallow writing into node_moduiles: https://github.com/ioBroker/ioBroker.javascript/issues/2127 --- src/lib/protectFs.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/protectFs.ts b/src/lib/protectFs.ts index f9135675e..01b09947d 100644 --- a/src/lib/protectFs.ts +++ b/src/lib/protectFs.ts @@ -342,6 +342,11 @@ export default class ProtectFs { ProtectFs.log?.error(`May not write ${(file as PathLike).toString()} - use writeFile instead`); throw new Error('Permission denied'); } + // Disallow writing into node_modules directories (see #2127) + if (!readOnly && `${sep}${filePath}${sep}`.includes(`${sep}node_modules${sep}`)) { + ProtectFs.log?.error(`May not write into node_modules: ${(file as PathLike).toString()}`); + throw new Error('Permission denied. Writing into node_modules is not allowed'); + } } access(path: PathLike, mode?: number | NoParamCallback, callback?: NoParamCallback): void { From e48a4d6143880b278a08d5ef4abccc4c974155a4 Mon Sep 17 00:00:00 2001 From: GermanBluefox Date: Sat, 21 Mar 2026 19:31:18 +0100 Subject: [PATCH 3/7] Do not start a script twice if it is already enabled: https://github.com/ioBroker/ioBroker.javascript/issues/2114 --- build/lib/protectFs.js | 5 +++++ build/lib/protectFs.js.map | 2 +- build/lib/sandbox.js | 3 +-- build/lib/sandbox.js.map | 2 +- src/lib/sandbox.ts | 3 +-- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/build/lib/protectFs.js b/build/lib/protectFs.js index d6b7b1d94..3d229c87a 100644 --- a/build/lib/protectFs.js +++ b/build/lib/protectFs.js @@ -220,6 +220,11 @@ class ProtectFs { ProtectFs.log?.error(`May not write ${file.toString()} - use writeFile instead`); throw new Error('Permission denied'); } + // Disallow writing into node_modules directories (see #2127) + if (!readOnly && `${node_path_1.sep}${filePath}${node_path_1.sep}`.includes(`${node_path_1.sep}node_modules${node_path_1.sep}`)) { + ProtectFs.log?.error(`May not write into node_modules: ${file.toString()}`); + throw new Error('Permission denied. Writing into node_modules is not allowed'); + } } access(path, mode, callback) { ProtectFs.checkProtected(path, true); diff --git a/build/lib/protectFs.js.map b/build/lib/protectFs.js.map index 775dad472..e46dcbcfc 100644 --- a/build/lib/protectFs.js.map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AS,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACzC,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,QAA+B,CAAC,CAAC;IACpF,CAAC;;AAjzBL,4BAkzBC","sourcesContent":["import type {\n BufferEncodingOption,\n CopyOptions,\n Dirent,\n MakeDirectoryOptions,\n Mode,\n ObjectEncodingOptions,\n OpenMode,\n PathLike,\n RmDirOptions,\n RmOptions,\n StatOptions,\n Stats,\n TimeLike,\n CopySyncOptions,\n NoParamCallback,\n PathOrFileDescriptor,\n WriteFileOptions,\n EncodingOption,\n FSWatcher,\n ReadStream,\n StatsListener,\n StatWatcher,\n WatchListener,\n WriteStream,\n BigIntStatsListener,\n WatchOptions,\n} from 'node:fs';\nimport type { Abortable } from 'node:events';\nimport type { FileHandle, FlagAndOpenMode } from 'node:fs/promises';\nimport type { URL } from 'node:url';\nimport type { Stream } from 'node:stream';\n\nimport * as nodeFS from 'node:fs';\nimport { sep, normalize, join, resolve } from 'node:path';\n\nexport default class ProtectFs {\n private readonly log: ioBroker.Logger;\n private readonly ioBrokerDataDir: string;\n public readonly promises: {\n access: (path: PathLike, mode?: number) => Promise;\n cp: (source: string | URL, destination: string | URL, opts?: CopyOptions) => Promise;\n readFile: (\n path: PathLike | FileHandle,\n options:\n | ({\n encoding: BufferEncoding;\n flag?: OpenMode | undefined;\n } & Abortable)\n | BufferEncoding,\n ) => Promise;\n readlink: (path: PathLike, options: BufferEncodingOption) => Promise;\n symlink: (target: PathLike, path: PathLike, type?: string | null) => Promise;\n writeFile: (\n file: PathLike | FileHandle,\n data:\n | string\n | NodeJS.ArrayBufferView\n | Iterable\n | AsyncIterable\n | Stream,\n options?:\n | (ObjectEncodingOptions & {\n mode?: Mode | undefined;\n flag?: OpenMode | undefined;\n flush?: boolean | undefined;\n } & Abortable)\n | BufferEncoding\n | null,\n ) => Promise;\n unlink: (path: PathLike) => Promise;\n appendFile: (\n path: PathLike | FileHandle,\n data: string | Uint8Array,\n options?:\n | (ObjectEncodingOptions & FlagAndOpenMode & { flush?: boolean | undefined })\n | BufferEncoding\n | null,\n ) => Promise;\n chmod: (path: PathLike, mode: Mode) => Promise;\n copyFile: (src: PathLike, dest: PathLike, mode?: number) => Promise;\n rename: (oldPath: PathLike, newPath: PathLike) => Promise;\n open: (path: PathLike, flags?: string | number, mode?: Mode) => Promise;\n truncate: (path: PathLike, len?: number) => Promise;\n stat: (path: PathLike, opts?: StatOptions) => Promise;\n utimes: (path: PathLike, atime: TimeLike, mtime: TimeLike) => Promise;\n readdir: (\n path: PathLike,\n options?: ObjectEncodingOptions & {\n withFileTypes: true;\n recursive?: boolean | undefined;\n },\n ) => Promise;\n lchmod: (path: PathLike, mode: Mode) => Promise;\n lchown: (path: PathLike, uid: number, gid: number) => Promise;\n link: (existingPath: PathLike, newPath: PathLike) => Promise;\n lstat: (path: PathLike, opts?: StatOptions) => Promise;\n lutimes: (path: PathLike, atime: TimeLike, mtime: TimeLike) => Promise;\n mkdir: (path: PathLike, options?: Mode | MakeDirectoryOptions | null) => Promise;\n mkdtemp: (prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null) => Promise;\n rm: (path: PathLike, options?: RmOptions) => Promise;\n rmdir: (path: PathLike, options?: RmDirOptions) => Promise;\n };\n public readonly constants: Record;\n static log: ioBroker.Logger | null = null;\n static staticIoBrokerDataDir: string = '';\n\n constructor(log: ioBroker.Logger, ioBrokerDataDir: string) {\n this.ioBrokerDataDir = ioBrokerDataDir;\n ProtectFs.staticIoBrokerDataDir = ioBrokerDataDir;\n\n this.log = log || {\n silly: (message: string): void => console.log(message),\n debug: (message: string): void => console.debug(message),\n info: (message: string): void => console.info(message),\n warn: (message: string): void => console.warn(message),\n error: (message: string): void => console.error(message),\n level: 'info',\n };\n\n ProtectFs.log = this.log;\n\n this.promises = {\n access: async (path: PathLike, mode?: number): Promise => {\n ProtectFs.checkProtected(path, true);\n return nodeFS.promises.access(path, mode);\n },\n cp: async (source: string | URL, destination: string | URL, opts?: CopyOptions): Promise => {\n ProtectFs.checkProtected(source, false);\n ProtectFs.checkProtected(destination, false);\n return nodeFS.promises.cp(source, destination, opts);\n },\n readFile: async (\n path: PathLike | FileHandle,\n options:\n | ({\n encoding: BufferEncoding;\n flag?: OpenMode | undefined;\n } & Abortable)\n | BufferEncoding,\n ): Promise => {\n ProtectFs.checkProtected(path, true);\n return nodeFS.promises.readFile(path, options); // async function readFile(path, options) {\n },\n readlink: async (path: PathLike, options: BufferEncodingOption): Promise => {\n ProtectFs.checkProtected(path, true);\n return nodeFS.promises.readlink(path, options); // async function readlink(path, options) {\n },\n symlink: async (target: PathLike, path: PathLike, type?: string | null): Promise => {\n ProtectFs.checkProtected(target, true);\n ProtectFs.checkProtected(path, false);\n return nodeFS.promises.symlink(target, path, type); // async function symlink(target, path, type_) {\n },\n writeFile: async (\n file: PathLike | FileHandle,\n data:\n | string\n | NodeJS.ArrayBufferView\n | Iterable\n | AsyncIterable\n | Stream,\n options?:\n | (ObjectEncodingOptions & {\n mode?: Mode | undefined;\n flag?: OpenMode | undefined;\n /**\n * If all data is successfully written to the file, and `flush`\n * is `true`, `filehandle.sync()` is used to flush the data.\n *\n * @default false\n */\n flush?: boolean | undefined;\n } & Abortable)\n | BufferEncoding\n | null,\n ): Promise => {\n ProtectFs.checkProtected(file, true);\n return nodeFS.promises.writeFile.call(this, file, data, options); // async function writeFile(path, data, options) {\n },\n unlink: async (path: PathLike): Promise => {\n ProtectFs.checkProtected(path, false);\n return nodeFS.promises.unlink.call(this, path); // async function unlink(path) {\n },\n appendFile: async (\n path: PathLike | FileHandle,\n data: string | Uint8Array,\n options?:\n | (ObjectEncodingOptions & FlagAndOpenMode & { flush?: boolean | undefined })\n | BufferEncoding\n | null,\n ): Promise => {\n ProtectFs.checkProtected(path, false);\n return nodeFS.promises.appendFile.call(this, path, data, options); // async function appendFile(path, data, options) {\n },\n chmod: async (path: PathLike, mode: Mode): Promise => {\n ProtectFs.checkProtected(path, false);\n return nodeFS.promises.chmod.call(this, path, mode); // async function chmod(path, mode) {\n },\n copyFile: async (src: PathLike, dest: PathLike, mode?: number): Promise => {\n ProtectFs.checkProtected(src, false);\n ProtectFs.checkProtected(dest, false);\n return nodeFS.promises.copyFile.call(this, src, dest, mode); // async function copyFile(src, dest, mode) {\n },\n rename: async (oldPath: PathLike, newPath: PathLike): Promise => {\n ProtectFs.checkProtected(oldPath, false);\n ProtectFs.checkProtected(newPath, false);\n return nodeFS.promises.rename.call(this, oldPath, newPath); // async function rename(oldPath, newPath) {\n },\n open: async (path: PathLike, flags?: string | number, mode?: Mode): Promise => {\n ProtectFs.checkProtected(path, true);\n return nodeFS.promises.open.call(this, path, flags, mode); // async function open(path, flags, mode) {\n },\n truncate: async (path: PathLike, len?: number): Promise => {\n ProtectFs.checkProtected(path, false);\n return nodeFS.promises.truncate.call(this, path, len); // async function truncate(path, len = 0) {\n },\n stat: async (path: PathLike, opts?: StatOptions): Promise => {\n ProtectFs.checkProtected(path, true);\n const result = await nodeFS.promises.stat.call(this, path, opts); // async function stat(path, options = { bigint: false }) {\n return result as Stats;\n },\n utimes: async (path: PathLike, atime: TimeLike, mtime: TimeLike): Promise => {\n ProtectFs.checkProtected(path, false);\n return nodeFS.promises.utimes.call(this, path, atime, mtime); // async function utimes(path, atime, mtime) {\n },\n readdir: async (\n path: PathLike,\n options?: ObjectEncodingOptions & {\n withFileTypes: true;\n recursive?: boolean | undefined;\n },\n ): Promise => {\n ProtectFs.checkProtected(path, true);\n // @ts-expect-error fix later\n return nodeFS.promises.readdir.call(this, path, options || { encoding: null, withFileTypes: true }); // async function readdir(path, options) {\n },\n lchmod: async (path: PathLike, mode: Mode): Promise => {\n ProtectFs.checkProtected(path, false);\n return nodeFS.promises.lchmod.call(this, path, mode); // async function lchmod(path, mode) {\n },\n lchown: async (path: PathLike, uid: number, gid: number): Promise => {\n ProtectFs.checkProtected(path, false);\n return nodeFS.promises.lchown.call(this, path, uid, gid); // async function lchown(path, uid, gid) {\n },\n link: async (existingPath: PathLike, newPath: PathLike): Promise => {\n ProtectFs.checkProtected(existingPath, false);\n ProtectFs.checkProtected(newPath, false);\n return nodeFS.promises.link.call(this, existingPath, newPath); // async function link(existingPath, newPath) {\n },\n lstat: async (path: PathLike, opts?: StatOptions): Promise => {\n ProtectFs.checkProtected(path, true);\n const res = await nodeFS.promises.lstat.call(this, path, opts); // async function lstat(path, options = { bigint: false }) {\n return res as Stats;\n },\n lutimes: async (path: PathLike, atime: TimeLike, mtime: TimeLike): Promise => {\n ProtectFs.checkProtected(path, false);\n return nodeFS.promises.lutimes.call(this, path, atime, mtime); // async function lutimes(path, atime, mtime) {\n },\n mkdir: async (\n path: PathLike,\n options?: Mode | MakeDirectoryOptions | null,\n ): Promise => {\n ProtectFs.checkProtected(path, false);\n return nodeFS.promises.mkdir.call(this, path, options); // async function mkdir(path, options) {\n },\n mkdtemp: async (\n prefix: string,\n options?: ObjectEncodingOptions | BufferEncoding | null,\n ): Promise => {\n ProtectFs.checkProtected(prefix, false);\n const tmp = await nodeFS.promises.mkdtemp.call(this, prefix, options); // async function mkdtemp(prefix, options) {\n return tmp.toString();\n },\n rm: async (path: PathLike, options?: RmOptions): Promise => {\n ProtectFs.checkProtected(path, false);\n return nodeFS.promises.rm.call(this, path, options); // async function rm(path, options) {\n },\n rmdir: async (path: PathLike): Promise => {\n ProtectFs.checkProtected(path, false);\n return nodeFS.promises.rmdir.call(this, path); // async function rmdir(path, options) {\n },\n };\n\n // Add missing constants\n this.constants = nodeFS.constants;\n\n // Add missing functions\n for (const m in nodeFS) {\n if (\n typeof (nodeFS as unknown as Record)[m] === 'function' &&\n Object.hasOwn(nodeFS, m) &&\n !Object.hasOwn(Object.getPrototypeOf(this), 'appendFile')\n ) {\n // console.debug(`Missing function in ProtectFS: ${m} - adding from node:fs`);\n // @ts-expect-error Elsewise we must implement EVERY function in fs\n this[m] = nodeFS[m];\n }\n }\n\n for (const m in nodeFS.promises) {\n if (\n typeof (nodeFS.promises as unknown as Record)[m] === 'function' &&\n Object.hasOwn(nodeFS.promises, m) &&\n !Object.hasOwn(this.promises, m)\n ) {\n // console.debug(`Missing function in ProtectFS: ${m} - adding from node:fs/promises`);\n // @ts-expect-error Elsewise we must implement EVERY function in fs\n this.promises[m] = nodeFS.promises[m];\n }\n }\n }\n\n static checkProtected(file: PathLike | FileHandle, readOnly: boolean): void {\n if ((file as FileHandle).fd) {\n // FileHandle objects bypass path checks — they were already validated at open() time.\n // This is safe because the sandbox only exposes the wrapped fs where open() is protected.\n return;\n }\n let filePath: string;\n try {\n // Use resolve() instead of normalize() to get an absolute path and eliminate .. traversals.\n // Then try realpath to resolve symlinks — fall back to resolved path if file doesn't exist yet.\n const resolved = resolve((file as PathLike).toString());\n try {\n filePath = nodeFS.realpathSync(resolved);\n } catch {\n filePath = resolved;\n }\n } catch {\n filePath = normalize((file as PathLike).toString());\n }\n\n if (filePath.endsWith(`-data${sep}objects.json`) || filePath.endsWith(`-data${sep}objects.jsonl`)) {\n ProtectFs.log?.error(`May not access ${(file as PathLike).toString()}`);\n throw new Error('Permission denied');\n }\n if (!readOnly && filePath.startsWith(join(ProtectFs.staticIoBrokerDataDir, 'files'))) {\n ProtectFs.log?.error(`May not write ${(file as PathLike).toString()} - use writeFile instead`);\n throw new Error('Permission denied');\n }\n if (!readOnly && filePath.startsWith(`file://${join(ProtectFs.staticIoBrokerDataDir, 'files')}`)) {\n ProtectFs.log?.error(`May not write ${(file as PathLike).toString()} - use writeFile instead`);\n throw new Error('Permission denied');\n }\n }\n\n access(path: PathLike, mode?: number | NoParamCallback, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(path, true);\n if (typeof callback === 'function') {\n return nodeFS.access(path, mode as number | undefined, callback);\n }\n return nodeFS.access(path, mode as NoParamCallback);\n }\n\n accessSync(path: PathLike, mode?: number): void {\n ProtectFs.checkProtected(path, true);\n return nodeFS.accessSync(path, mode);\n }\n\n cp(\n source: string | URL,\n destination: string | URL,\n opts?: CopyOptions | ((err: NodeJS.ErrnoException | null) => void),\n callback?: (err: NodeJS.ErrnoException | null) => void,\n ): void {\n ProtectFs.checkProtected(source, false);\n ProtectFs.checkProtected(destination, false);\n if (callback) {\n return nodeFS.cp(source, destination, opts as CopyOptions, callback);\n }\n if (typeof opts === 'function') {\n return nodeFS.cp(source, destination, opts);\n }\n return nodeFS.cp(source, destination, opts as (err: NodeJS.ErrnoException | null) => void);\n }\n\n cpSync(source: string | URL, destination: string | URL, opts?: CopySyncOptions): void {\n ProtectFs.checkProtected(source, false);\n ProtectFs.checkProtected(destination, false);\n return nodeFS.cpSync.call(this, source, destination, opts);\n }\n\n readFile(\n path: PathOrFileDescriptor,\n options:\n | (ObjectEncodingOptions & {\n flag?: string | undefined;\n } & Abortable)\n | BufferEncoding\n | undefined\n | null\n | ((err: NodeJS.ErrnoException | null, data: string | NonSharedBuffer) => void),\n callback?: (err: NodeJS.ErrnoException | null, data: string | NonSharedBuffer) => void,\n ): void {\n if (typeof path !== 'number') {\n ProtectFs.checkProtected(path, true);\n }\n if (typeof callback === 'function') {\n return nodeFS.readFile.call(\n this,\n path,\n options as\n | (ObjectEncodingOptions & {\n flag?: string | undefined;\n } & Abortable)\n | BufferEncoding\n | undefined\n | null,\n // @ts-expect-error readFile can accept 3 arguments too\n callback,\n );\n }\n return nodeFS.readFile.call(\n this,\n path,\n options as (err: NodeJS.ErrnoException | null, data: string | NonSharedBuffer) => void,\n );\n }\n\n readFileSync(\n path: PathOrFileDescriptor,\n options?:\n | {\n encoding: BufferEncoding;\n flag?: string | undefined;\n }\n | BufferEncoding,\n ): string | Buffer {\n if (typeof path !== 'number') {\n ProtectFs.checkProtected(path, true);\n }\n return nodeFS.readFileSync.call(this, path, options);\n }\n\n readlink(\n path: PathLike,\n options: EncodingOption | ((err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void),\n callback?: (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void,\n ): void {\n ProtectFs.checkProtected(path, true);\n if (typeof callback === 'function') {\n // @ts-expect-error should work\n return nodeFS.readlink.call(this, path, options, callback); //\n }\n return nodeFS.readlink.call(\n this,\n path,\n options as (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void,\n );\n }\n\n readlinkSync(path: PathLike, options?: EncodingOption): string | Buffer {\n ProtectFs.checkProtected(path, true);\n return nodeFS.readlinkSync.call(this, path, options);\n }\n\n symlink(\n target: PathLike,\n path: PathLike,\n type?: 'dir' | 'file' | 'junction' | null | NoParamCallback,\n callback?: NoParamCallback,\n ): void {\n ProtectFs.checkProtected(target, true);\n ProtectFs.checkProtected(path, false);\n if (typeof callback === 'function') {\n // @ts-expect-error should work\n return nodeFS.symlink.call(this, target, path, type as 'dir' | 'file' | 'junction' | null, callback);\n }\n return nodeFS.symlink.call(this, target, path, type as NoParamCallback);\n }\n\n symlinkSync(target: PathLike, path: PathLike, type?: 'dir' | 'file' | 'junction' | null): void {\n ProtectFs.checkProtected(target, true);\n ProtectFs.checkProtected(path, false);\n return nodeFS.symlinkSync.call(this, target, path, type);\n }\n\n writeFile(\n file: PathLike | number,\n data: string | NodeJS.ArrayBufferView,\n options?: WriteFileOptions | NoParamCallback,\n callback?: NoParamCallback,\n ): void {\n if (typeof file !== 'number') {\n ProtectFs.checkProtected(file, false);\n }\n if (typeof callback === 'function') {\n // @ts-expect-error should work\n return nodeFS.writeFile.call(this, file, data, options, callback);\n }\n return nodeFS.writeFile.call(this, file, data, options as NoParamCallback);\n }\n\n writeFileSync(file: PathLike | number, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): void {\n if (typeof file !== 'number') {\n ProtectFs.checkProtected(file, false);\n }\n return nodeFS.writeFileSync.call(this, file, data, options);\n }\n\n unlink(path: PathLike, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.unlink.call(this, path, callback || ((_err: NodeJS.ErrnoException | null) => {}));\n }\n\n unlinkSync(path: PathLike): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.unlinkSync.call(this, path);\n }\n\n appendFile(\n file: PathLike | number,\n data: string | Uint8Array,\n options?: WriteFileOptions | NoParamCallback,\n callback?: NoParamCallback,\n ): void {\n if (typeof file !== 'number') {\n ProtectFs.checkProtected(file, false);\n }\n if (typeof callback === 'function') {\n // @ts-expect-error should work\n return nodeFS.appendFile.call(this, file, data, options, callback);\n }\n return nodeFS.appendFile.call(this, file, data, options as NoParamCallback);\n }\n\n appendFileSync(file: PathLike | number, data: string | Uint8Array, options?: WriteFileOptions): void {\n if (typeof file !== 'number') {\n ProtectFs.checkProtected(file, false);\n }\n return nodeFS.appendFileSync.call(this, file, data, options);\n }\n\n chmod(path: PathLike, mode: Mode, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.chmod.call(this, path, mode, callback || ((_err: NodeJS.ErrnoException | null) => {}));\n }\n\n chmodSync(path: PathLike, mode: Mode): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.chmodSync.call(this, path, mode);\n }\n\n chown(path: PathLike, uid: number, gid: number, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.chown.call(this, path, uid, gid, callback || ((_err: NodeJS.ErrnoException | null) => {}));\n }\n\n chownSync(path: PathLike, uid: number, gid: number): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.chownSync.call(this, path, uid, gid);\n }\n\n copyFile(src: PathLike, dest: PathLike, mode: number | NoParamCallback, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(src, true);\n ProtectFs.checkProtected(dest, false);\n // @ts-expect-error should work\n return nodeFS.copyFile.call(this, src, dest, mode, callback);\n }\n\n copyFileSync(src: PathLike, dest: PathLike, mode?: number): void {\n ProtectFs.checkProtected(src, true);\n ProtectFs.checkProtected(dest, false);\n return nodeFS.copyFileSync.call(this, src, dest, mode);\n }\n\n rename(oldPath: PathLike, newPath: PathLike, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(oldPath, false);\n ProtectFs.checkProtected(newPath, false);\n return nodeFS.rename.call(this, oldPath, newPath, callback || ((_err: NodeJS.ErrnoException | null) => {}));\n }\n\n renameSync(oldPath: PathLike, newPath: PathLike): void {\n ProtectFs.checkProtected(oldPath, false);\n ProtectFs.checkProtected(newPath, false);\n return nodeFS.renameSync.call(this, oldPath, newPath);\n }\n\n open(path: PathLike, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void {\n ProtectFs.checkProtected(path, true);\n return nodeFS.open.call(this, path, callback);\n }\n\n openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number {\n ProtectFs.checkProtected(path, true);\n return nodeFS.openSync.call(this, path, flags, mode);\n }\n\n truncate(path: PathLike, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.truncate.call(this, path, callback || ((_err: NodeJS.ErrnoException | null) => {}));\n }\n\n truncateSync(path: PathLike): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.truncateSync.call(this, path);\n }\n\n exists(path: PathLike, callback: (exists: boolean) => void): void {\n ProtectFs.checkProtected(path, true);\n return nodeFS.exists.call(this, path, callback);\n }\n\n existsSync(path: PathLike): boolean {\n ProtectFs.checkProtected(path, true);\n return nodeFS.existsSync.call(this, path);\n }\n\n stat(\n path: PathLike,\n options: StatOptions | undefined | ((err: NodeJS.ErrnoException | null, stats: Stats) => void),\n callback?: (err: NodeJS.ErrnoException | null, stats: Stats) => void,\n ): void {\n ProtectFs.checkProtected(path, true);\n if (typeof callback === 'function') {\n // @ts-expect-error should work\n return nodeFS.stat.call(this, path, options as StatOptions | undefined, callback);\n }\n // @ts-expect-error should work\n return nodeFS.stat.call(this, path, options as (err: NodeJS.ErrnoException | null, stats: Stats) => void);\n }\n\n statSync(path: PathLike, options?: StatOptions): Stats {\n ProtectFs.checkProtected(path, true);\n return nodeFS.statSync.call(this, path, options);\n }\n\n utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.utimes.call(this, path, atime, mtime, callback || ((_err: NodeJS.ErrnoException | null) => {}));\n }\n\n utimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.utimesSync.call(this, path, atime, mtime);\n }\n\n readdir(\n path: PathLike,\n options:\n | (ObjectEncodingOptions & {\n withFileTypes: true;\n recursive?: boolean | undefined;\n })\n | ((err: NodeJS.ErrnoException | null, files: Dirent[][]) => void),\n callback?: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void,\n ): void {\n ProtectFs.checkProtected(path, true);\n if (typeof callback === 'function') {\n return nodeFS.readdir.call(\n this,\n path,\n options as ObjectEncodingOptions & {\n encoding: 'buffer';\n withFileTypes: true;\n recursive?: boolean | undefined;\n },\n callback,\n );\n }\n // @ts-expect-error should work\n return nodeFS.readdir.call(this, path, options as (err: NodeJS.ErrnoException | null, files: Dirent[]) => void);\n }\n\n readdirSync(\n path: PathLike,\n options?: ObjectEncodingOptions & {\n withFileTypes: true;\n recursive?: boolean | undefined;\n },\n ): Dirent[] {\n ProtectFs.checkProtected(path, true);\n // @ts-expect-error should work\n return nodeFS.readdirSync.call(this, path, options);\n }\n\n createReadStream(path: PathLike, options?: BufferEncoding): ReadStream {\n ProtectFs.checkProtected(path, true);\n return nodeFS.createReadStream.call(this, path, options);\n }\n\n createWriteStream(path: PathLike, options?: BufferEncoding): WriteStream {\n ProtectFs.checkProtected(path, false);\n return nodeFS.createWriteStream.call(this, path, options);\n }\n\n lchmod(path: PathLike, mode: Mode, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.lchmod.call(this, path, mode, callback || ((_err: NodeJS.ErrnoException | null) => {}));\n }\n\n lchmodSync(path: PathLike, mode: Mode): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.lchmodSync.call(this, path, mode);\n }\n\n lchown(path: PathLike, uid: number, gid: number, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.lchown.call(this, path, uid, gid, callback || ((_err: NodeJS.ErrnoException | null) => {}));\n }\n\n lchownSync(path: PathLike, uid: number, gid: number): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.lchownSync.call(this, path, uid, gid);\n }\n\n link(existingPath: PathLike, newPath: PathLike, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(existingPath, false);\n ProtectFs.checkProtected(newPath, false);\n return nodeFS.link.call(this, existingPath, newPath, callback || ((_err: NodeJS.ErrnoException | null) => {}));\n }\n\n linkSync(existingPath: PathLike, newPath: PathLike): void {\n ProtectFs.checkProtected(existingPath, false);\n ProtectFs.checkProtected(newPath, false);\n return nodeFS.linkSync.call(this, existingPath, newPath);\n }\n\n lstat(\n path: PathLike,\n options: StatOptions | undefined | ((err: NodeJS.ErrnoException | null, stats: Stats) => void),\n callback?: (err: NodeJS.ErrnoException | null, stats: Stats) => void,\n ): void {\n ProtectFs.checkProtected(path, true);\n if (typeof callback === 'function') {\n // @ts-expect-error should work\n return nodeFS.lstat.call(this, path, options as StatOptions | undefined, callback);\n }\n // @ts-expect-error should work\n return nodeFS.lstat.call(this, path, options as (err: NodeJS.ErrnoException | null, stats: Stats) => void);\n }\n\n lstatSync(path: PathLike, options?: StatOptions): Stats {\n ProtectFs.checkProtected(path, true);\n return nodeFS.lstatSync.call(this, path, options);\n }\n\n lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.lutimes.call(this, path, atime, mtime, callback || ((_err: NodeJS.ErrnoException | null) => {}));\n }\n\n lutimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.lutimesSync.call(this, path, atime, mtime);\n }\n\n mkdir(\n path: PathLike,\n options:\n | Mode\n | (MakeDirectoryOptions & {\n recursive: true;\n })\n | null\n | undefined\n | ((err: NodeJS.ErrnoException | null, path?: string) => void),\n callback?: (err: NodeJS.ErrnoException | null, path?: string) => void,\n ): void {\n ProtectFs.checkProtected(path, false);\n if (typeof callback === 'function') {\n // @ts-expect-error should work\n return nodeFS.mkdir.call(this, path, options as MakeDirectoryOptions & { recursive?: boolean }, callback);\n }\n return nodeFS.mkdir.call(this, path, options as (err: NodeJS.ErrnoException | null, path?: string) => void);\n }\n\n mkdirSync(\n path: PathLike,\n options?: MakeDirectoryOptions & {\n recursive: true;\n },\n ): string | undefined {\n ProtectFs.checkProtected(path, false);\n return nodeFS.mkdirSync.call(this, path, options);\n }\n\n mkdtemp(\n prefix: string,\n options: EncodingOption | ((err: NodeJS.ErrnoException | null, folder: string) => void),\n callback?: (err: NodeJS.ErrnoException | null, folder: string) => void,\n ): void {\n ProtectFs.checkProtected(prefix, false);\n if (typeof callback === 'function') {\n // @ts-expect-error should work\n return nodeFS.mkdtemp.call(this, prefix, options, callback);\n }\n return nodeFS.mkdtemp.call(\n this,\n prefix,\n options as (err: NodeJS.ErrnoException | null, folder: string) => void,\n );\n }\n\n mkdtempSync(prefix: string, options?: EncodingOption): string | Buffer {\n ProtectFs.checkProtected(prefix, false);\n return nodeFS.mkdtempSync.call(this, prefix, options);\n }\n\n rm(path: PathLike, options?: RmOptions | NoParamCallback, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(path, false);\n if (typeof callback === 'function') {\n return nodeFS.rm.call(this, path, options as RmOptions, callback);\n }\n // @ts-expect-error should work\n return nodeFS.rm.call(this, path, options as NoParamCallback);\n }\n\n rmSync(path: PathLike, options?: RmOptions): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.rmSync.call(this, path, options);\n }\n\n rmdir(path: PathLike, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(path, false);\n if (typeof callback === 'function') {\n return nodeFS.rmdir.call(this, path, callback);\n }\n return nodeFS.rmdirSync.call(this, path);\n }\n\n rmdirSync(path: PathLike): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.rmdirSync.call(this, path);\n }\n\n watch(\n filename: PathLike,\n options?:\n | (WatchOptions & {\n encoding: 'buffer';\n })\n | 'buffer'\n | WatchListener,\n listener?: WatchListener,\n ): FSWatcher {\n ProtectFs.checkProtected(filename, true);\n if (typeof listener === 'function') {\n // @ts-expect-error should work\n return nodeFS.watch.call(this, filename, options as WatchOptions & { encoding: 'buffer' }, listener);\n }\n\n return nodeFS.watch.call(this, filename, options as WatchListener);\n }\n\n watchFile(filename: PathLike, listener: StatsListener): StatWatcher {\n ProtectFs.checkProtected(filename, true);\n return nodeFS.watchFile.call(this, filename, listener);\n }\n\n unwatchFile(filename: PathLike, listener: StatsListener | BigIntStatsListener): void {\n ProtectFs.checkProtected(filename, true);\n return nodeFS.unwatchFile.call(this, filename, listener as BigIntStatsListener);\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"protectFs.js","sourceRoot":"","sources":["../../src/lib/protectFs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,gDAAkC;AAClC,yCAA0D;AAE1D,MAAqB,SAAS;IACT,GAAG,CAAkB;IACrB,eAAe,CAAS;IACzB,QAAQ,CA+DtB;IACc,SAAS,CAAyB;IAClD,MAAM,CAAC,GAAG,GAA2B,IAAI,CAAC;IAC1C,MAAM,CAAC,qBAAqB,GAAW,EAAE,CAAC;IAE1C,YAAY,GAAoB,EAAE,eAAuB;QACrD,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,SAAS,CAAC,qBAAqB,GAAG,eAAe,CAAC;QAElD,IAAI,CAAC,GAAG,GAAG,GAAG,IAAI;YACd,KAAK,EAAE,CAAC,OAAe,EAAQ,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;YACtD,KAAK,EAAE,CAAC,OAAe,EAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC;YACxD,IAAI,EAAE,CAAC,OAAe,EAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;YACtD,IAAI,EAAE,CAAC,OAAe,EAAQ,EAAE,CAAC,OAAO,CAAC,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,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CACD,QAAkB,EAClB,OAK2B,EAC3B,QAAgC;QAEhC,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACzC,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;YACjC,+BAA+B;YAC/B,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAgD,EAAE,QAAQ,CAAC,CAAC;QACzG,CAAC;QAED,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAgC,CAAC,CAAC;IAC/E,CAAC;IAED,SAAS,CAAC,QAAkB,EAAE,QAAuB;QACjD,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACzC,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC3D,CAAC;IAED,WAAW,CAAC,QAAkB,EAAE,QAA6C;QACzE,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACzC,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,QAA+B,CAAC,CAAC;IACpF,CAAC;;AAtzBL,4BAuzBC","sourcesContent":["import type {\n BufferEncodingOption,\n CopyOptions,\n Dirent,\n MakeDirectoryOptions,\n Mode,\n ObjectEncodingOptions,\n OpenMode,\n PathLike,\n RmDirOptions,\n RmOptions,\n StatOptions,\n Stats,\n TimeLike,\n CopySyncOptions,\n NoParamCallback,\n PathOrFileDescriptor,\n WriteFileOptions,\n EncodingOption,\n FSWatcher,\n ReadStream,\n StatsListener,\n StatWatcher,\n WatchListener,\n WriteStream,\n BigIntStatsListener,\n WatchOptions,\n} from 'node:fs';\nimport type { Abortable } from 'node:events';\nimport type { FileHandle, FlagAndOpenMode } from 'node:fs/promises';\nimport type { URL } from 'node:url';\nimport type { Stream } from 'node:stream';\n\nimport * as nodeFS from 'node:fs';\nimport { sep, normalize, join, resolve } from 'node:path';\n\nexport default class ProtectFs {\n private readonly log: ioBroker.Logger;\n private readonly ioBrokerDataDir: string;\n public readonly promises: {\n access: (path: PathLike, mode?: number) => Promise;\n cp: (source: string | URL, destination: string | URL, opts?: CopyOptions) => Promise;\n readFile: (\n path: PathLike | FileHandle,\n options:\n | ({\n encoding: BufferEncoding;\n flag?: OpenMode | undefined;\n } & Abortable)\n | BufferEncoding,\n ) => Promise;\n readlink: (path: PathLike, options: BufferEncodingOption) => Promise;\n symlink: (target: PathLike, path: PathLike, type?: string | null) => Promise;\n writeFile: (\n file: PathLike | FileHandle,\n data:\n | string\n | NodeJS.ArrayBufferView\n | Iterable\n | AsyncIterable\n | Stream,\n options?:\n | (ObjectEncodingOptions & {\n mode?: Mode | undefined;\n flag?: OpenMode | undefined;\n flush?: boolean | undefined;\n } & Abortable)\n | BufferEncoding\n | null,\n ) => Promise;\n unlink: (path: PathLike) => Promise;\n appendFile: (\n path: PathLike | FileHandle,\n data: string | Uint8Array,\n options?:\n | (ObjectEncodingOptions & FlagAndOpenMode & { flush?: boolean | undefined })\n | BufferEncoding\n | null,\n ) => Promise;\n chmod: (path: PathLike, mode: Mode) => Promise;\n copyFile: (src: PathLike, dest: PathLike, mode?: number) => Promise;\n rename: (oldPath: PathLike, newPath: PathLike) => Promise;\n open: (path: PathLike, flags?: string | number, mode?: Mode) => Promise;\n truncate: (path: PathLike, len?: number) => Promise;\n stat: (path: PathLike, opts?: StatOptions) => Promise;\n utimes: (path: PathLike, atime: TimeLike, mtime: TimeLike) => Promise;\n readdir: (\n path: PathLike,\n options?: ObjectEncodingOptions & {\n withFileTypes: true;\n recursive?: boolean | undefined;\n },\n ) => Promise;\n lchmod: (path: PathLike, mode: Mode) => Promise;\n lchown: (path: PathLike, uid: number, gid: number) => Promise;\n link: (existingPath: PathLike, newPath: PathLike) => Promise;\n lstat: (path: PathLike, opts?: StatOptions) => Promise;\n lutimes: (path: PathLike, atime: TimeLike, mtime: TimeLike) => Promise;\n mkdir: (path: PathLike, options?: Mode | MakeDirectoryOptions | null) => Promise;\n mkdtemp: (prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null) => Promise;\n rm: (path: PathLike, options?: RmOptions) => Promise;\n rmdir: (path: PathLike, options?: RmDirOptions) => Promise;\n };\n public readonly constants: Record;\n static log: ioBroker.Logger | null = null;\n static staticIoBrokerDataDir: string = '';\n\n constructor(log: ioBroker.Logger, ioBrokerDataDir: string) {\n this.ioBrokerDataDir = ioBrokerDataDir;\n ProtectFs.staticIoBrokerDataDir = ioBrokerDataDir;\n\n this.log = log || {\n silly: (message: string): void => console.log(message),\n debug: (message: string): void => console.debug(message),\n info: (message: string): void => console.info(message),\n warn: (message: string): void => console.warn(message),\n error: (message: string): void => console.error(message),\n level: 'info',\n };\n\n ProtectFs.log = this.log;\n\n this.promises = {\n access: async (path: PathLike, mode?: number): Promise => {\n ProtectFs.checkProtected(path, true);\n return nodeFS.promises.access(path, mode);\n },\n cp: async (source: string | URL, destination: string | URL, opts?: CopyOptions): Promise => {\n ProtectFs.checkProtected(source, false);\n ProtectFs.checkProtected(destination, false);\n return nodeFS.promises.cp(source, destination, opts);\n },\n readFile: async (\n path: PathLike | FileHandle,\n options:\n | ({\n encoding: BufferEncoding;\n flag?: OpenMode | undefined;\n } & Abortable)\n | BufferEncoding,\n ): Promise => {\n ProtectFs.checkProtected(path, true);\n return nodeFS.promises.readFile(path, options); // async function readFile(path, options) {\n },\n readlink: async (path: PathLike, options: BufferEncodingOption): Promise => {\n ProtectFs.checkProtected(path, true);\n return nodeFS.promises.readlink(path, options); // async function readlink(path, options) {\n },\n symlink: async (target: PathLike, path: PathLike, type?: string | null): Promise => {\n ProtectFs.checkProtected(target, true);\n ProtectFs.checkProtected(path, false);\n return nodeFS.promises.symlink(target, path, type); // async function symlink(target, path, type_) {\n },\n writeFile: async (\n file: PathLike | FileHandle,\n data:\n | string\n | NodeJS.ArrayBufferView\n | Iterable\n | AsyncIterable\n | Stream,\n options?:\n | (ObjectEncodingOptions & {\n mode?: Mode | undefined;\n flag?: OpenMode | undefined;\n /**\n * If all data is successfully written to the file, and `flush`\n * is `true`, `filehandle.sync()` is used to flush the data.\n *\n * @default false\n */\n flush?: boolean | undefined;\n } & Abortable)\n | BufferEncoding\n | null,\n ): Promise => {\n ProtectFs.checkProtected(file, true);\n return nodeFS.promises.writeFile.call(this, file, data, options); // async function writeFile(path, data, options) {\n },\n unlink: async (path: PathLike): Promise => {\n ProtectFs.checkProtected(path, false);\n return nodeFS.promises.unlink.call(this, path); // async function unlink(path) {\n },\n appendFile: async (\n path: PathLike | FileHandle,\n data: string | Uint8Array,\n options?:\n | (ObjectEncodingOptions & FlagAndOpenMode & { flush?: boolean | undefined })\n | BufferEncoding\n | null,\n ): Promise => {\n ProtectFs.checkProtected(path, false);\n return nodeFS.promises.appendFile.call(this, path, data, options); // async function appendFile(path, data, options) {\n },\n chmod: async (path: PathLike, mode: Mode): Promise => {\n ProtectFs.checkProtected(path, false);\n return nodeFS.promises.chmod.call(this, path, mode); // async function chmod(path, mode) {\n },\n copyFile: async (src: PathLike, dest: PathLike, mode?: number): Promise => {\n ProtectFs.checkProtected(src, false);\n ProtectFs.checkProtected(dest, false);\n return nodeFS.promises.copyFile.call(this, src, dest, mode); // async function copyFile(src, dest, mode) {\n },\n rename: async (oldPath: PathLike, newPath: PathLike): Promise => {\n ProtectFs.checkProtected(oldPath, false);\n ProtectFs.checkProtected(newPath, false);\n return nodeFS.promises.rename.call(this, oldPath, newPath); // async function rename(oldPath, newPath) {\n },\n open: async (path: PathLike, flags?: string | number, mode?: Mode): Promise => {\n ProtectFs.checkProtected(path, true);\n return nodeFS.promises.open.call(this, path, flags, mode); // async function open(path, flags, mode) {\n },\n truncate: async (path: PathLike, len?: number): Promise => {\n ProtectFs.checkProtected(path, false);\n return nodeFS.promises.truncate.call(this, path, len); // async function truncate(path, len = 0) {\n },\n stat: async (path: PathLike, opts?: StatOptions): Promise => {\n ProtectFs.checkProtected(path, true);\n const result = await nodeFS.promises.stat.call(this, path, opts); // async function stat(path, options = { bigint: false }) {\n return result as Stats;\n },\n utimes: async (path: PathLike, atime: TimeLike, mtime: TimeLike): Promise => {\n ProtectFs.checkProtected(path, false);\n return nodeFS.promises.utimes.call(this, path, atime, mtime); // async function utimes(path, atime, mtime) {\n },\n readdir: async (\n path: PathLike,\n options?: ObjectEncodingOptions & {\n withFileTypes: true;\n recursive?: boolean | undefined;\n },\n ): Promise => {\n ProtectFs.checkProtected(path, true);\n // @ts-expect-error fix later\n return nodeFS.promises.readdir.call(this, path, options || { encoding: null, withFileTypes: true }); // async function readdir(path, options) {\n },\n lchmod: async (path: PathLike, mode: Mode): Promise => {\n ProtectFs.checkProtected(path, false);\n return nodeFS.promises.lchmod.call(this, path, mode); // async function lchmod(path, mode) {\n },\n lchown: async (path: PathLike, uid: number, gid: number): Promise => {\n ProtectFs.checkProtected(path, false);\n return nodeFS.promises.lchown.call(this, path, uid, gid); // async function lchown(path, uid, gid) {\n },\n link: async (existingPath: PathLike, newPath: PathLike): Promise => {\n ProtectFs.checkProtected(existingPath, false);\n ProtectFs.checkProtected(newPath, false);\n return nodeFS.promises.link.call(this, existingPath, newPath); // async function link(existingPath, newPath) {\n },\n lstat: async (path: PathLike, opts?: StatOptions): Promise => {\n ProtectFs.checkProtected(path, true);\n const res = await nodeFS.promises.lstat.call(this, path, opts); // async function lstat(path, options = { bigint: false }) {\n return res as Stats;\n },\n lutimes: async (path: PathLike, atime: TimeLike, mtime: TimeLike): Promise => {\n ProtectFs.checkProtected(path, false);\n return nodeFS.promises.lutimes.call(this, path, atime, mtime); // async function lutimes(path, atime, mtime) {\n },\n mkdir: async (\n path: PathLike,\n options?: Mode | MakeDirectoryOptions | null,\n ): Promise => {\n ProtectFs.checkProtected(path, false);\n return nodeFS.promises.mkdir.call(this, path, options); // async function mkdir(path, options) {\n },\n mkdtemp: async (\n prefix: string,\n options?: ObjectEncodingOptions | BufferEncoding | null,\n ): Promise => {\n ProtectFs.checkProtected(prefix, false);\n const tmp = await nodeFS.promises.mkdtemp.call(this, prefix, options); // async function mkdtemp(prefix, options) {\n return tmp.toString();\n },\n rm: async (path: PathLike, options?: RmOptions): Promise => {\n ProtectFs.checkProtected(path, false);\n return nodeFS.promises.rm.call(this, path, options); // async function rm(path, options) {\n },\n rmdir: async (path: PathLike): Promise => {\n ProtectFs.checkProtected(path, false);\n return nodeFS.promises.rmdir.call(this, path); // async function rmdir(path, options) {\n },\n };\n\n // Add missing constants\n this.constants = nodeFS.constants;\n\n // Add missing functions\n for (const m in nodeFS) {\n if (\n typeof (nodeFS as unknown as Record)[m] === 'function' &&\n Object.hasOwn(nodeFS, m) &&\n !Object.hasOwn(Object.getPrototypeOf(this), 'appendFile')\n ) {\n // console.debug(`Missing function in ProtectFS: ${m} - adding from node:fs`);\n // @ts-expect-error Elsewise we must implement EVERY function in fs\n this[m] = nodeFS[m];\n }\n }\n\n for (const m in nodeFS.promises) {\n if (\n typeof (nodeFS.promises as unknown as Record)[m] === 'function' &&\n Object.hasOwn(nodeFS.promises, m) &&\n !Object.hasOwn(this.promises, m)\n ) {\n // console.debug(`Missing function in ProtectFS: ${m} - adding from node:fs/promises`);\n // @ts-expect-error Elsewise we must implement EVERY function in fs\n this.promises[m] = nodeFS.promises[m];\n }\n }\n }\n\n static checkProtected(file: PathLike | FileHandle, readOnly: boolean): void {\n if ((file as FileHandle).fd) {\n // FileHandle objects bypass path checks — they were already validated at open() time.\n // This is safe because the sandbox only exposes the wrapped fs where open() is protected.\n return;\n }\n let filePath: string;\n try {\n // Use resolve() instead of normalize() to get an absolute path and eliminate .. traversals.\n // Then try realpath to resolve symlinks — fall back to resolved path if file doesn't exist yet.\n const resolved = resolve((file as PathLike).toString());\n try {\n filePath = nodeFS.realpathSync(resolved);\n } catch {\n filePath = resolved;\n }\n } catch {\n filePath = normalize((file as PathLike).toString());\n }\n\n if (filePath.endsWith(`-data${sep}objects.json`) || filePath.endsWith(`-data${sep}objects.jsonl`)) {\n ProtectFs.log?.error(`May not access ${(file as PathLike).toString()}`);\n throw new Error('Permission denied');\n }\n if (!readOnly && filePath.startsWith(join(ProtectFs.staticIoBrokerDataDir, 'files'))) {\n ProtectFs.log?.error(`May not write ${(file as PathLike).toString()} - use writeFile instead`);\n throw new Error('Permission denied');\n }\n if (!readOnly && filePath.startsWith(`file://${join(ProtectFs.staticIoBrokerDataDir, 'files')}`)) {\n ProtectFs.log?.error(`May not write ${(file as PathLike).toString()} - use writeFile instead`);\n throw new Error('Permission denied');\n }\n // Disallow writing into node_modules directories (see #2127)\n if (!readOnly && `${sep}${filePath}${sep}`.includes(`${sep}node_modules${sep}`)) {\n ProtectFs.log?.error(`May not write into node_modules: ${(file as PathLike).toString()}`);\n throw new Error('Permission denied. Writing into node_modules is not allowed');\n }\n }\n\n access(path: PathLike, mode?: number | NoParamCallback, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(path, true);\n if (typeof callback === 'function') {\n return nodeFS.access(path, mode as number | undefined, callback);\n }\n return nodeFS.access(path, mode as NoParamCallback);\n }\n\n accessSync(path: PathLike, mode?: number): void {\n ProtectFs.checkProtected(path, true);\n return nodeFS.accessSync(path, mode);\n }\n\n cp(\n source: string | URL,\n destination: string | URL,\n opts?: CopyOptions | ((err: NodeJS.ErrnoException | null) => void),\n callback?: (err: NodeJS.ErrnoException | null) => void,\n ): void {\n ProtectFs.checkProtected(source, false);\n ProtectFs.checkProtected(destination, false);\n if (callback) {\n return nodeFS.cp(source, destination, opts as CopyOptions, callback);\n }\n if (typeof opts === 'function') {\n return nodeFS.cp(source, destination, opts);\n }\n return nodeFS.cp(source, destination, opts as (err: NodeJS.ErrnoException | null) => void);\n }\n\n cpSync(source: string | URL, destination: string | URL, opts?: CopySyncOptions): void {\n ProtectFs.checkProtected(source, false);\n ProtectFs.checkProtected(destination, false);\n return nodeFS.cpSync.call(this, source, destination, opts);\n }\n\n readFile(\n path: PathOrFileDescriptor,\n options:\n | (ObjectEncodingOptions & {\n flag?: string | undefined;\n } & Abortable)\n | BufferEncoding\n | undefined\n | null\n | ((err: NodeJS.ErrnoException | null, data: string | NonSharedBuffer) => void),\n callback?: (err: NodeJS.ErrnoException | null, data: string | NonSharedBuffer) => void,\n ): void {\n if (typeof path !== 'number') {\n ProtectFs.checkProtected(path, true);\n }\n if (typeof callback === 'function') {\n return nodeFS.readFile.call(\n this,\n path,\n options as\n | (ObjectEncodingOptions & {\n flag?: string | undefined;\n } & Abortable)\n | BufferEncoding\n | undefined\n | null,\n // @ts-expect-error readFile can accept 3 arguments too\n callback,\n );\n }\n return nodeFS.readFile.call(\n this,\n path,\n options as (err: NodeJS.ErrnoException | null, data: string | NonSharedBuffer) => void,\n );\n }\n\n readFileSync(\n path: PathOrFileDescriptor,\n options?:\n | {\n encoding: BufferEncoding;\n flag?: string | undefined;\n }\n | BufferEncoding,\n ): string | Buffer {\n if (typeof path !== 'number') {\n ProtectFs.checkProtected(path, true);\n }\n return nodeFS.readFileSync.call(this, path, options);\n }\n\n readlink(\n path: PathLike,\n options: EncodingOption | ((err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void),\n callback?: (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void,\n ): void {\n ProtectFs.checkProtected(path, true);\n if (typeof callback === 'function') {\n // @ts-expect-error should work\n return nodeFS.readlink.call(this, path, options, callback); //\n }\n return nodeFS.readlink.call(\n this,\n path,\n options as (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void,\n );\n }\n\n readlinkSync(path: PathLike, options?: EncodingOption): string | Buffer {\n ProtectFs.checkProtected(path, true);\n return nodeFS.readlinkSync.call(this, path, options);\n }\n\n symlink(\n target: PathLike,\n path: PathLike,\n type?: 'dir' | 'file' | 'junction' | null | NoParamCallback,\n callback?: NoParamCallback,\n ): void {\n ProtectFs.checkProtected(target, true);\n ProtectFs.checkProtected(path, false);\n if (typeof callback === 'function') {\n // @ts-expect-error should work\n return nodeFS.symlink.call(this, target, path, type as 'dir' | 'file' | 'junction' | null, callback);\n }\n return nodeFS.symlink.call(this, target, path, type as NoParamCallback);\n }\n\n symlinkSync(target: PathLike, path: PathLike, type?: 'dir' | 'file' | 'junction' | null): void {\n ProtectFs.checkProtected(target, true);\n ProtectFs.checkProtected(path, false);\n return nodeFS.symlinkSync.call(this, target, path, type);\n }\n\n writeFile(\n file: PathLike | number,\n data: string | NodeJS.ArrayBufferView,\n options?: WriteFileOptions | NoParamCallback,\n callback?: NoParamCallback,\n ): void {\n if (typeof file !== 'number') {\n ProtectFs.checkProtected(file, false);\n }\n if (typeof callback === 'function') {\n // @ts-expect-error should work\n return nodeFS.writeFile.call(this, file, data, options, callback);\n }\n return nodeFS.writeFile.call(this, file, data, options as NoParamCallback);\n }\n\n writeFileSync(file: PathLike | number, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): void {\n if (typeof file !== 'number') {\n ProtectFs.checkProtected(file, false);\n }\n return nodeFS.writeFileSync.call(this, file, data, options);\n }\n\n unlink(path: PathLike, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.unlink.call(this, path, callback || ((_err: NodeJS.ErrnoException | null) => {}));\n }\n\n unlinkSync(path: PathLike): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.unlinkSync.call(this, path);\n }\n\n appendFile(\n file: PathLike | number,\n data: string | Uint8Array,\n options?: WriteFileOptions | NoParamCallback,\n callback?: NoParamCallback,\n ): void {\n if (typeof file !== 'number') {\n ProtectFs.checkProtected(file, false);\n }\n if (typeof callback === 'function') {\n // @ts-expect-error should work\n return nodeFS.appendFile.call(this, file, data, options, callback);\n }\n return nodeFS.appendFile.call(this, file, data, options as NoParamCallback);\n }\n\n appendFileSync(file: PathLike | number, data: string | Uint8Array, options?: WriteFileOptions): void {\n if (typeof file !== 'number') {\n ProtectFs.checkProtected(file, false);\n }\n return nodeFS.appendFileSync.call(this, file, data, options);\n }\n\n chmod(path: PathLike, mode: Mode, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.chmod.call(this, path, mode, callback || ((_err: NodeJS.ErrnoException | null) => {}));\n }\n\n chmodSync(path: PathLike, mode: Mode): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.chmodSync.call(this, path, mode);\n }\n\n chown(path: PathLike, uid: number, gid: number, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.chown.call(this, path, uid, gid, callback || ((_err: NodeJS.ErrnoException | null) => {}));\n }\n\n chownSync(path: PathLike, uid: number, gid: number): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.chownSync.call(this, path, uid, gid);\n }\n\n copyFile(src: PathLike, dest: PathLike, mode: number | NoParamCallback, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(src, true);\n ProtectFs.checkProtected(dest, false);\n // @ts-expect-error should work\n return nodeFS.copyFile.call(this, src, dest, mode, callback);\n }\n\n copyFileSync(src: PathLike, dest: PathLike, mode?: number): void {\n ProtectFs.checkProtected(src, true);\n ProtectFs.checkProtected(dest, false);\n return nodeFS.copyFileSync.call(this, src, dest, mode);\n }\n\n rename(oldPath: PathLike, newPath: PathLike, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(oldPath, false);\n ProtectFs.checkProtected(newPath, false);\n return nodeFS.rename.call(this, oldPath, newPath, callback || ((_err: NodeJS.ErrnoException | null) => {}));\n }\n\n renameSync(oldPath: PathLike, newPath: PathLike): void {\n ProtectFs.checkProtected(oldPath, false);\n ProtectFs.checkProtected(newPath, false);\n return nodeFS.renameSync.call(this, oldPath, newPath);\n }\n\n open(path: PathLike, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void {\n ProtectFs.checkProtected(path, true);\n return nodeFS.open.call(this, path, callback);\n }\n\n openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number {\n ProtectFs.checkProtected(path, true);\n return nodeFS.openSync.call(this, path, flags, mode);\n }\n\n truncate(path: PathLike, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.truncate.call(this, path, callback || ((_err: NodeJS.ErrnoException | null) => {}));\n }\n\n truncateSync(path: PathLike): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.truncateSync.call(this, path);\n }\n\n exists(path: PathLike, callback: (exists: boolean) => void): void {\n ProtectFs.checkProtected(path, true);\n return nodeFS.exists.call(this, path, callback);\n }\n\n existsSync(path: PathLike): boolean {\n ProtectFs.checkProtected(path, true);\n return nodeFS.existsSync.call(this, path);\n }\n\n stat(\n path: PathLike,\n options: StatOptions | undefined | ((err: NodeJS.ErrnoException | null, stats: Stats) => void),\n callback?: (err: NodeJS.ErrnoException | null, stats: Stats) => void,\n ): void {\n ProtectFs.checkProtected(path, true);\n if (typeof callback === 'function') {\n // @ts-expect-error should work\n return nodeFS.stat.call(this, path, options as StatOptions | undefined, callback);\n }\n // @ts-expect-error should work\n return nodeFS.stat.call(this, path, options as (err: NodeJS.ErrnoException | null, stats: Stats) => void);\n }\n\n statSync(path: PathLike, options?: StatOptions): Stats {\n ProtectFs.checkProtected(path, true);\n return nodeFS.statSync.call(this, path, options);\n }\n\n utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.utimes.call(this, path, atime, mtime, callback || ((_err: NodeJS.ErrnoException | null) => {}));\n }\n\n utimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.utimesSync.call(this, path, atime, mtime);\n }\n\n readdir(\n path: PathLike,\n options:\n | (ObjectEncodingOptions & {\n withFileTypes: true;\n recursive?: boolean | undefined;\n })\n | ((err: NodeJS.ErrnoException | null, files: Dirent[][]) => void),\n callback?: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void,\n ): void {\n ProtectFs.checkProtected(path, true);\n if (typeof callback === 'function') {\n return nodeFS.readdir.call(\n this,\n path,\n options as ObjectEncodingOptions & {\n encoding: 'buffer';\n withFileTypes: true;\n recursive?: boolean | undefined;\n },\n callback,\n );\n }\n // @ts-expect-error should work\n return nodeFS.readdir.call(this, path, options as (err: NodeJS.ErrnoException | null, files: Dirent[]) => void);\n }\n\n readdirSync(\n path: PathLike,\n options?: ObjectEncodingOptions & {\n withFileTypes: true;\n recursive?: boolean | undefined;\n },\n ): Dirent[] {\n ProtectFs.checkProtected(path, true);\n // @ts-expect-error should work\n return nodeFS.readdirSync.call(this, path, options);\n }\n\n createReadStream(path: PathLike, options?: BufferEncoding): ReadStream {\n ProtectFs.checkProtected(path, true);\n return nodeFS.createReadStream.call(this, path, options);\n }\n\n createWriteStream(path: PathLike, options?: BufferEncoding): WriteStream {\n ProtectFs.checkProtected(path, false);\n return nodeFS.createWriteStream.call(this, path, options);\n }\n\n lchmod(path: PathLike, mode: Mode, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.lchmod.call(this, path, mode, callback || ((_err: NodeJS.ErrnoException | null) => {}));\n }\n\n lchmodSync(path: PathLike, mode: Mode): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.lchmodSync.call(this, path, mode);\n }\n\n lchown(path: PathLike, uid: number, gid: number, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.lchown.call(this, path, uid, gid, callback || ((_err: NodeJS.ErrnoException | null) => {}));\n }\n\n lchownSync(path: PathLike, uid: number, gid: number): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.lchownSync.call(this, path, uid, gid);\n }\n\n link(existingPath: PathLike, newPath: PathLike, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(existingPath, false);\n ProtectFs.checkProtected(newPath, false);\n return nodeFS.link.call(this, existingPath, newPath, callback || ((_err: NodeJS.ErrnoException | null) => {}));\n }\n\n linkSync(existingPath: PathLike, newPath: PathLike): void {\n ProtectFs.checkProtected(existingPath, false);\n ProtectFs.checkProtected(newPath, false);\n return nodeFS.linkSync.call(this, existingPath, newPath);\n }\n\n lstat(\n path: PathLike,\n options: StatOptions | undefined | ((err: NodeJS.ErrnoException | null, stats: Stats) => void),\n callback?: (err: NodeJS.ErrnoException | null, stats: Stats) => void,\n ): void {\n ProtectFs.checkProtected(path, true);\n if (typeof callback === 'function') {\n // @ts-expect-error should work\n return nodeFS.lstat.call(this, path, options as StatOptions | undefined, callback);\n }\n // @ts-expect-error should work\n return nodeFS.lstat.call(this, path, options as (err: NodeJS.ErrnoException | null, stats: Stats) => void);\n }\n\n lstatSync(path: PathLike, options?: StatOptions): Stats {\n ProtectFs.checkProtected(path, true);\n return nodeFS.lstatSync.call(this, path, options);\n }\n\n lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.lutimes.call(this, path, atime, mtime, callback || ((_err: NodeJS.ErrnoException | null) => {}));\n }\n\n lutimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.lutimesSync.call(this, path, atime, mtime);\n }\n\n mkdir(\n path: PathLike,\n options:\n | Mode\n | (MakeDirectoryOptions & {\n recursive: true;\n })\n | null\n | undefined\n | ((err: NodeJS.ErrnoException | null, path?: string) => void),\n callback?: (err: NodeJS.ErrnoException | null, path?: string) => void,\n ): void {\n ProtectFs.checkProtected(path, false);\n if (typeof callback === 'function') {\n // @ts-expect-error should work\n return nodeFS.mkdir.call(this, path, options as MakeDirectoryOptions & { recursive?: boolean }, callback);\n }\n return nodeFS.mkdir.call(this, path, options as (err: NodeJS.ErrnoException | null, path?: string) => void);\n }\n\n mkdirSync(\n path: PathLike,\n options?: MakeDirectoryOptions & {\n recursive: true;\n },\n ): string | undefined {\n ProtectFs.checkProtected(path, false);\n return nodeFS.mkdirSync.call(this, path, options);\n }\n\n mkdtemp(\n prefix: string,\n options: EncodingOption | ((err: NodeJS.ErrnoException | null, folder: string) => void),\n callback?: (err: NodeJS.ErrnoException | null, folder: string) => void,\n ): void {\n ProtectFs.checkProtected(prefix, false);\n if (typeof callback === 'function') {\n // @ts-expect-error should work\n return nodeFS.mkdtemp.call(this, prefix, options, callback);\n }\n return nodeFS.mkdtemp.call(\n this,\n prefix,\n options as (err: NodeJS.ErrnoException | null, folder: string) => void,\n );\n }\n\n mkdtempSync(prefix: string, options?: EncodingOption): string | Buffer {\n ProtectFs.checkProtected(prefix, false);\n return nodeFS.mkdtempSync.call(this, prefix, options);\n }\n\n rm(path: PathLike, options?: RmOptions | NoParamCallback, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(path, false);\n if (typeof callback === 'function') {\n return nodeFS.rm.call(this, path, options as RmOptions, callback);\n }\n // @ts-expect-error should work\n return nodeFS.rm.call(this, path, options as NoParamCallback);\n }\n\n rmSync(path: PathLike, options?: RmOptions): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.rmSync.call(this, path, options);\n }\n\n rmdir(path: PathLike, callback?: NoParamCallback): void {\n ProtectFs.checkProtected(path, false);\n if (typeof callback === 'function') {\n return nodeFS.rmdir.call(this, path, callback);\n }\n return nodeFS.rmdirSync.call(this, path);\n }\n\n rmdirSync(path: PathLike): void {\n ProtectFs.checkProtected(path, false);\n return nodeFS.rmdirSync.call(this, path);\n }\n\n watch(\n filename: PathLike,\n options?:\n | (WatchOptions & {\n encoding: 'buffer';\n })\n | 'buffer'\n | WatchListener,\n listener?: WatchListener,\n ): FSWatcher {\n ProtectFs.checkProtected(filename, true);\n if (typeof listener === 'function') {\n // @ts-expect-error should work\n return nodeFS.watch.call(this, filename, options as WatchOptions & { encoding: 'buffer' }, listener);\n }\n\n return nodeFS.watch.call(this, filename, options as WatchListener);\n }\n\n watchFile(filename: PathLike, listener: StatsListener): StatWatcher {\n ProtectFs.checkProtected(filename, true);\n return nodeFS.watchFile.call(this, filename, listener);\n }\n\n unwatchFile(filename: PathLike, listener: StatsListener | BigIntStatsListener): void {\n ProtectFs.checkProtected(filename, true);\n return nodeFS.unwatchFile.call(this, filename, listener as BigIntStatsListener);\n }\n}\n"]} \ No newline at end of file diff --git a/build/lib/sandbox.js b/build/lib/sandbox.js index 13a2e5360..f4d2c814b 100644 --- a/build/lib/sandbox.js +++ b/build/lib/sandbox.js @@ -3964,7 +3964,7 @@ function sandBox(script, name, verbose, debug, context) { callback = ignoreIfStarted; ignoreIfStarted = false; } - scriptName = scriptName || name; + scriptName ||= name; if (!scriptName.match(/^script\.js\./)) { scriptName = `script.js.${scriptName}`; } @@ -3980,7 +3980,6 @@ function sandBox(script, name, verbose, debug, context) { } if (objects[scriptName].common.enabled) { if (!ignoreIfStarted) { - objects[scriptName].common.enabled = false; adapter.extendForeignObject(scriptName, { common: { enabled: false } }, () => { adapter.extendForeignObject(scriptName, { common: { enabled: true } }, err => typeof callback === 'function' && callback(err, true)); }); diff --git a/build/lib/sandbox.js.map b/build/lib/sandbox.js.map index b2b43eff4..3ba99ed44 100644 --- a/build/lib/sandbox.js.map +++ b/build/lib/sandbox.js.map @@ -1 +1 @@ -{"version":3,"file":"sandbox.js","sourceRoot":"","sources":["../../src/lib/sandbox.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,0BAijLC;AAzlLD,oDAAsC;AAItC,yDAAqD;AAErD,mCAA6E;AAmB7E,oDAAsC;AACtC,kDAAoC;AACpC,wDAA0C;AAC1C,uEAGmC;AAKnC,MAAM,kBAAkB,GAAG,YAAY,CAAC;AAExC,MAAM,aAAa,GAAG,0BAAW,CAAC,aAAa,CAAC;AAEhD,SAAgB,OAAO,CACnB,MAAgB,EAChB,IAAY,EACZ,OAA4B,EAC5B,KAA0B,EAC1B,OAA0B;IAE1B,MAAM,MAAM,GAAG,SAAS,CAAC;IACzB,MAAM,KAAK,GAAG,QAAQ,CAAC;IACvB,MAAM,QAAQ,GAAG,WAAW,CAAC;IAC7B,MAAM,uBAAuB,GAAG,iDAA0B,CAAC;IAC3D,MAAM,OAAO,G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iBAAS,EAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACpD,OAAO,CAAC,WAAW,GAAG,IAAA,iBAAS,EAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAChD,OAAO,CAAC,YAAY,GAAG,IAAA,iBAAS,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAClD,OAAO,CAAC,WAAW,GAAG,IAAA,iBAAS,EAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAChD,OAAO,CAAC,eAAe,GAAG,IAAA,iBAAS,EAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACxD,OAAO,CAAC,eAAe,GAAG,IAAA,iBAAS,EAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACxD,OAAO,CAAC,YAAY,GAAG,IAAA,iBAAS,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAClD,OAAO,CAAC,aAAa,GAAG,IAAA,iBAAS,EAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEpD,uFAAuF;IACvF,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACtC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE;YACjC,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,KAAK;SAClB,CAAC,CAAC;IACP,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC","sourcesContent":["import type { ChildProcess, ExecOptions } from 'node:child_process';\nimport * as jsonataMod from 'jsonata';\nimport type { SendMailOptions } from 'nodemailer';\nimport type { AxiosError, AxiosHeaderValue, AxiosResponse, ResponseType } from 'axios';\n\nimport { commonTools } from '@iobroker/adapter-core';\n\nimport { isObject, isArray, promisify, getHttpRequestConfig } from './tools';\nimport type {\n JavaScriptAdapterConfig,\n AstroRule,\n ChangeType,\n CommonAlias,\n FileSubscriptionResult,\n IobSchedule,\n JavascriptContext,\n JsScript,\n LogMessage,\n Pattern,\n PushoverOptions,\n SandboxType,\n Selector,\n SubscribeObject,\n SubscriptionResult,\n TimeRule,\n} from '../types';\nimport * as constsMod from './consts';\nimport * as wordsMod from './words';\nimport * as eventObjMod from './eventObj';\nimport {\n patternCompareFunctions as patternCompareFunctionsMod,\n type PatternEventCompareFunction,\n} from './patternCompareFunctions';\nimport type { ScheduleName, SchedulerRule } from './scheduler';\nimport type { EventObj } from './eventObj';\nimport type { AstroEvent } from './consts';\n\nconst SCRIPT_CODE_MARKER = 'script.js.';\n\nconst pattern2RegEx = commonTools.pattern2RegEx;\n\nexport function sandBox(\n script: JsScript,\n name: string,\n verbose: boolean | undefined,\n debug: boolean | undefined,\n context: JavascriptContext,\n): SandboxType {\n const consts = constsMod;\n const words = wordsMod;\n const eventObj = eventObjMod;\n const patternCompareFunctions = patternCompareFunctionsMod;\n const jsonata = jsonataMod.default;\n\n const adapter: ioBroker.Adapter = context.adapter;\n const mods = context.mods;\n const states = context.states;\n const objects = context.objects;\n const timers = context.timers;\n const enums = context.enums;\n const debugMode = context.debugMode;\n\n // eslint-disable-next-line prefer-const\n let sandbox: SandboxType;\n\n function errorInCallback(e: Error): void {\n void adapter.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: true,\n ack: true,\n c: 'errorInCallback',\n });\n context.logError(name, 'Error in callback:', e);\n context.debugMode && console.log(`error$$${name}$$Exception in callback: ${e}`, Date.now());\n }\n\n function subscribePattern(script: JsScript, pattern: string): void {\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n if (!script.subscribes[pattern]) {\n script.subscribes[pattern] = 1;\n } else {\n script.subscribes[pattern]++;\n }\n\n if (!context.subscribedPatterns[pattern]) {\n context.subscribedPatterns[pattern] = 1;\n\n if (sandbox.verbose) {\n sandbox.log(`subscribePattern(pattern=${pattern})`, 'info');\n }\n adapter.subscribeForeignStates(pattern);\n\n // request current value to deliver old value on change.\n if (typeof pattern === 'string' && !pattern.includes('*')) {\n void adapter.getForeignState(pattern, (_err, state) => {\n if (state) {\n states[pattern] = state;\n }\n });\n } else {\n adapter.getForeignStates(\n pattern,\n (_err, _states) => _states && Object.keys(_states).forEach(id => (states[id] = _states[id])),\n );\n }\n } else {\n context.subscribedPatterns[pattern]++;\n }\n }\n }\n\n function unsubscribePattern(script: JsScript, pattern: string): void {\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n if (script.subscribes[pattern]) {\n script.subscribes[pattern]--;\n if (!script.subscribes[pattern]) {\n delete script.subscribes[pattern];\n }\n }\n\n if (context.subscribedPatterns[pattern]) {\n context.subscribedPatterns[pattern]--;\n if (!context.subscribedPatterns[pattern]) {\n adapter.unsubscribeForeignStates(pattern);\n delete context.subscribedPatterns[pattern];\n\n // if the pattern was regex or with * some states will stay in RAM, but it is OK.\n if (states[pattern]) {\n delete states[pattern];\n }\n }\n }\n }\n }\n\n function subscribeFile(script: JsScript, id: string, fileNamePattern: string): void {\n const key = `${id}$%$${fileNamePattern}`;\n if (!script.subscribesFile[key]) {\n script.subscribesFile[key] = 1;\n } else {\n script.subscribesFile[key]++;\n }\n\n if (!context.subscribedPatternsFile[key]) {\n context.subscribedPatternsFile[key] = 1;\n void adapter.subscribeForeignFiles(id, fileNamePattern);\n } else {\n context.subscribedPatternsFile[key]++;\n }\n }\n\n function unsubscribeFile(script: JsScript, id: string, fileNamePattern: string): void {\n const key = `${id}$%$${fileNamePattern}`;\n if (script.subscribesFile[key]) {\n script.subscribesFile[key]--;\n if (!script.subscribesFile[key]) {\n delete script.subscribesFile[key];\n }\n }\n\n if (context.subscribedPatternsFile[key]) {\n context.subscribedPatternsFile[key]--;\n if (!context.subscribedPatternsFile[key]) {\n void adapter.unsubscribeForeignFiles(id, fileNamePattern);\n delete context.subscribedPatternsFile[key];\n }\n }\n }\n\n function getPatternCompareFunctions(pattern: Pattern): PatternEventCompareFunction[] & { logic?: 'and' | 'or' } {\n let func: PatternEventCompareFunction;\n const functions: PatternEventCompareFunction[] & { logic?: 'and' | 'or' } = [];\n functions.logic = pattern.logic || 'and';\n\n for (const key in pattern) {\n if (!Object.prototype.hasOwnProperty.call(pattern, key)) {\n continue;\n }\n if (key === 'logic') {\n continue;\n }\n if (key === 'change' && pattern.change === 'any') {\n continue;\n }\n const _func: (pattern: Pattern) => PatternEventCompareFunction = (\n patternCompareFunctions as unknown as Record PatternEventCompareFunction>\n )[key];\n if (!_func) {\n continue;\n }\n func = _func(pattern);\n if (typeof func !== 'function') {\n continue;\n }\n functions.push(func);\n }\n return functions;\n }\n\n /**\n * Splits a selector string into attribute and value\n *\n * @param selector The selector string to split\n */\n function splitSelectorString(selector: string): Selector {\n const parts = selector.split('=', 2);\n if (parts[1] && parts[1][0] === '\"') {\n parts[1] = parts[1].substring(1);\n const len = parts[1].length;\n if (parts[1] && parts[1][len - 1] === '\"') {\n parts[1] = parts[1].substring(0, len - 1);\n }\n }\n if (parts[1] && parts[1][0] === \"'\") {\n parts[1] = parts[1].substring(1);\n const len = parts[1].length;\n if (parts[1] && parts[1][len - 1] === \"'\") {\n parts[1] = parts[1].substring(0, len - 1);\n }\n }\n\n if (parts[1]) {\n parts[1] = parts[1].trim();\n }\n parts[0] = parts[0].trim();\n\n return { attr: parts[0], value: parts[1] };\n }\n\n /**\n * Transforms a selector string with wildcards into a regular expression\n *\n * @param str The selector string to transform into a regular expression\n */\n function selectorStringToRegExp(str: string): RegExp {\n const startsWithWildcard = str[0] === '*';\n const endsWithWildcard = str[str.length - 1] === '*';\n\n // Sanitize the selector, so it is safe to use in a RegEx\n // Taken from https://stackoverflow.com/a/3561711/10179833 but modified\n // since * has a special meaning in our selector and should not be escaped\n // eslint-disable-next-line no-useless-escape\n str = str.replace(/[-\\/\\\\^$+?.()|[\\]{}]/g, '\\\\$&').replace(/\\*/g, '.*');\n\n return new RegExp((startsWithWildcard ? '' : '^') + str + (endsWithWildcard ? '' : '$'));\n }\n\n /**\n * Adds a regular expression for selectors targeting the state ID\n *\n * @param selector The selector to apply the transform to\n */\n function addRegExpToIdAttrSelectors(selector: Selector): Selector {\n if ((selector.attr === 'id' || selector.attr === 'state.id') && !selector.idRegExp && selector.value) {\n return {\n attr: selector.attr,\n value: selector.value,\n idRegExp: selectorStringToRegExp(selector.value),\n };\n }\n return selector;\n }\n\n /**\n * Tests if a value loosely equals (==) the reference string.\n * In contrast to the equality operator, this treats true == \"true\" as well\n * so we can test common and native attributes for boolean values\n *\n * @param value The value to compare with the reference\n * @param reference The reference to compare the value to\n */\n function looselyEqualsString(value: string | number | boolean | undefined, reference: string): boolean {\n // For booleans, compare the string representation\n // For other types do a loose comparison\n return typeof value === 'boolean'\n ? (value && reference === 'true') || (!value && reference === 'false')\n : value == reference;\n }\n\n /**\n * Returns the `common.type` for a given variable\n */\n function getCommonTypeOf(value: any): ioBroker.CommonType {\n return isArray(value) ? 'array' : isObject(value) ? 'object' : (typeof value as ioBroker.CommonType);\n }\n\n /**\n * Returns if an id is in an allowed namespace for automatic object creations\n *\n * @param id id to check\n */\n function validIdForAutomaticFolderCreation(id: string): boolean {\n return id.startsWith('javascript.') || id.startsWith('0_userdata.0.') || id.startsWith('alias.0.');\n }\n\n /**\n * Iterate through object structure to create missing folder objects\n */\n async function ensureObjectStructure(id: string): Promise {\n if (!validIdForAutomaticFolderCreation(id)) {\n return;\n }\n if (context.folderCreationVerifiedObjects[id] === true) {\n return;\n }\n const idArr = id.split('.');\n idArr.pop(); // the last is created as an object in any way\n if (idArr.length < 3) {\n return; // Nothing to do\n }\n // We just create sublevel projects\n let idToCheck = idArr.splice(0, 2).join('.');\n\n context.folderCreationVerifiedObjects[id] = true;\n for (const part of idArr) {\n idToCheck += `.${part}`;\n if (context.folderCreationVerifiedObjects[idToCheck] === true || objects[idToCheck]) {\n continue;\n }\n context.folderCreationVerifiedObjects[idToCheck] = true;\n let obj: ioBroker.Object | null | undefined;\n try {\n obj = await adapter.getForeignObjectAsync(idToCheck);\n } catch {\n // ignore\n }\n if (!obj?.common) {\n sandbox.log(`Create folder object for ${idToCheck}`, 'debug');\n try {\n await adapter.setForeignObjectAsync(idToCheck, {\n _id: idToCheck,\n type: 'folder',\n common: {\n name: part,\n },\n native: {\n autocreated: 'by automatic ensure logic',\n },\n } as ioBroker.FolderObject);\n } catch (err: any) {\n sandbox.log(`Could not automatically create folder object ${idToCheck}: ${err.message}`, 'info');\n }\n } else {\n //sandbox.log(` already existing \"${idToCheck}\": ${JSON.stringify(obj)}`, 'debug');\n }\n }\n }\n\n function setStateHelper(\n sandbox: SandboxType,\n isCreate: boolean,\n isChanged: boolean,\n id: string,\n state: null | ioBroker.SettableState | ioBroker.StateValue,\n isAck: boolean | 'true' | 'false' | undefined | ((error?: Error | null) => void),\n callback?: (error?: Error | null) => void,\n ): void {\n if (typeof isAck === 'function') {\n callback = isAck;\n isAck = undefined;\n }\n\n let stateNotNull: ioBroker.SettableState | ioBroker.StateValue;\n\n if (isAck === true || isAck === false || isAck === 'true' || isAck === 'false') {\n if (state && typeof state === 'object' && state.val !== undefined) {\n stateNotNull = state;\n // we assume that we were given a state object if\n // state is an object that contains a `val` property\n if (!Object.prototype.hasOwnProperty.call(state, 'ack')) {\n stateNotNull.ack = isAck === true || isAck === 'true';\n }\n } else if (state === null) {\n stateNotNull = { val: null, ack: isAck === true || isAck === 'true' };\n } else {\n // otherwise, assume that the given state is the value to be set\n stateNotNull = { val: state as ioBroker.StateValue, ack: isAck === true || isAck === 'true' };\n }\n } else if (state === null) {\n stateNotNull = { val: null };\n } else {\n stateNotNull = state;\n }\n\n // Check a type of state\n if (!objects[id] && objects[`${adapter.namespace}.${id}`]) {\n id = `${adapter.namespace}.${id}`;\n }\n\n if (isCreate) {\n if (id.match(/^javascript\\.\\d+\\.scriptEnabled/)) {\n sandbox.log(\n `Own states (${id}) should not be used in javascript.X.scriptEnabled.*! Please move the states to 0_userdata.0.*`,\n 'info',\n );\n } else if (id.match(/^javascript\\.\\d+\\.scriptProblem/)) {\n sandbox.log(\n `Own states (${id}) should not be used in javascript.X.scriptProblem.*! Please move the states to 0_userdata.0.*`,\n 'info',\n );\n }\n }\n\n const common = objects[id] ? objects[id].common : null;\n if (common?.type && common.type !== 'mixed' && common.type !== 'json') {\n // Find out which type the value has\n let actualCommonType: ioBroker.CommonType | undefined;\n if (typeof stateNotNull === 'object') {\n if (stateNotNull && stateNotNull.val !== undefined && stateNotNull.val !== null) {\n actualCommonType = getCommonTypeOf(stateNotNull.val);\n }\n } else if (stateNotNull !== null && stateNotNull !== undefined) {\n actualCommonType = getCommonTypeOf(stateNotNull);\n }\n // If this is not the expected one, issue a warning\n if (actualCommonType && actualCommonType !== common.type) {\n context.logWithLineInfo(\n `You are assigning a ${actualCommonType} to the state \"${id}\" which expects a ${common.type}. ` +\n `Please fix your code to use a ${common.type} or change the state type to ${actualCommonType}. ` +\n `This warning might become an error in future versions.`,\n );\n }\n\n if (actualCommonType === 'array' || actualCommonType === 'object') {\n try {\n if (typeof stateNotNull === 'object' && typeof stateNotNull.val !== 'undefined') {\n stateNotNull.val = JSON.stringify(stateNotNull.val);\n } else {\n stateNotNull = JSON.stringify(stateNotNull);\n }\n } catch (err: any) {\n context.logWithLineInfo(\n `Could not stringify value for type ${actualCommonType} and id ${id}: ${err.message}`,\n );\n if (typeof callback === 'function') {\n try {\n callback.call(\n sandbox,\n new Error(\n `Could not stringify value for type ${actualCommonType} and id ${id}: ${err.message}`,\n ),\n );\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n }\n }\n }\n // Check min and max of value\n if (typeof stateNotNull === 'object') {\n if (common && typeof stateNotNull.val === 'number') {\n const num: number = stateNotNull.val;\n if (common.min !== undefined && num < common.min) {\n stateNotNull.val = common.min;\n } else if (common.max !== undefined && num > common.max) {\n stateNotNull.val = common.max;\n }\n }\n } else if (common && typeof stateNotNull === 'number') {\n const num: number = stateNotNull;\n if (common.min !== undefined && num < common.min) {\n stateNotNull = common.min;\n }\n if (common.max !== undefined && num > common.max) {\n stateNotNull = common.max;\n }\n }\n\n let stateAsObject: ioBroker.State;\n // modify state here, to make it available in callback\n if (\n stateNotNull === null ||\n typeof stateNotNull !== 'object' ||\n (stateNotNull as ioBroker.SettableState).val === undefined\n ) {\n stateAsObject = context.prepareStateObject(id, {\n val: stateNotNull as ioBroker.StateValue,\n ack: isAck === true || isAck === 'true',\n });\n } else {\n stateAsObject = context.prepareStateObject(id, stateNotNull as ioBroker.SettableState);\n }\n\n // set as comment: from which script this state was set.\n stateAsObject.c = sandbox.scriptName;\n\n if (objects[id]) {\n script.setStatePerMinuteCounter++;\n if (sandbox.verbose) {\n sandbox.log(`setForeignState(id=${id}, state=${JSON.stringify(stateAsObject)})`, 'info');\n }\n\n if (debug) {\n sandbox.log(\n `setForeignState(id=${id}, state=${JSON.stringify(stateAsObject)}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n\n if (typeof callback === 'function') {\n setImmediate(() => {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n });\n }\n } else {\n if (!(adapter.config as JavaScriptAdapterConfig).subscribe) {\n // store actual state to make possible to process value in callback\n // risk that there will be an error on setState is very low,\n // but we will not store new state if the setStateChanged is called\n if (!isChanged) {\n context.interimStateValues[id] = stateAsObject;\n }\n }\n const errHandler = (err: Error | null | undefined, funcId: string): void => {\n err && sandbox.log(`${funcId}: ${err}`, 'error');\n // If adapter holds all states\n if (err && !(adapter.config as JavaScriptAdapterConfig).subscribe) {\n delete context.interimStateValues[id];\n }\n\n if (typeof callback === 'function') {\n setImmediate(() => {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n });\n }\n };\n if (isChanged) {\n if (!(adapter.config as JavaScriptAdapterConfig).subscribe && context.interimStateValues[id]) {\n // if the state is changed, we will compare it with interimStateValues\n const oldState = context.interimStateValues[id];\n const attrs: string[] = Object.keys(stateAsObject).filter(\n attr => attr !== 'ts' && (stateAsObject as Record)[attr] !== undefined,\n );\n if (\n !attrs.every(\n attr =>\n (stateAsObject as Record)[attr] ===\n (oldState as Record)[attr],\n )\n ) {\n // state is changed for sure, and we will call setForeignState\n // and store new state to interimStateValues\n context.interimStateValues[id] = stateAsObject;\n adapter.setForeignState(id, stateAsObject, err => errHandler(err, 'setForeignState'));\n } else {\n // otherwise - do nothing as we have cached state, except callback\n errHandler(null, 'setForeignStateCached');\n }\n } else {\n // adapter doesn't hold all states, or it has not cached then we will simply call setForeignStateChanged\n adapter.setForeignStateChanged(id, { ...stateAsObject, ts: undefined }, err =>\n errHandler(err, 'setForeignStateChanged'),\n );\n }\n } else {\n adapter.setForeignState(id, stateAsObject, err => errHandler(err, 'setForeignState'));\n }\n }\n } else {\n context.logWithLineInfo(`State \"${id}\" not found`);\n if (typeof callback === 'function') {\n setImmediate(() => {\n try {\n callback.call(sandbox, new Error(`State \"${id}\" not found`));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n });\n }\n }\n }\n\n sandbox = {\n mods,\n _id: script._id,\n // @deprecated use scriptName\n name,\n scriptName: name,\n instance: adapter.instance || 0,\n defaultDataDir: context.getAbsoluteDefaultDataDir(),\n verbose,\n exports: {}, // Polyfill for the export object in TypeScript modules\n require: function (md: string): any {\n if (typeof md === 'string' && md.startsWith('node:')) {\n md = md.replace(/^node:/, '');\n }\n\n if (md === 'request') {\n if (!sandbox.__engine.__deprecatedWarnings.includes(md)) {\n sandbox.log(\n `request package is deprecated - please use httpGet (or a stable lib like axios) instead!`,\n 'warn',\n );\n sandbox.__engine.__deprecatedWarnings.push(md);\n }\n }\n\n if (mods[md]) {\n return mods[md];\n }\n\n let error: Error | undefined;\n\n try {\n mods[md] = require(\n adapter.getAdapterScopedPackageIdentifier ? adapter.getAdapterScopedPackageIdentifier(md) : md,\n );\n return mods[md];\n } catch (e: any) {\n error = e as Error;\n }\n\n try {\n // the user requires a module which is not specified in the additional node modules\n // for backward compatibility we check if the module can simply be required directly before we fail (e.g., direct dependencies of JavaScript adapter)\n adapter.log.debug(`Try direct require of \"${md}\" as not specified in the additional dependencies`);\n mods[md] = require(md);\n\n return mods[md];\n } catch (e: any) {\n context.logError(name, `Error by loading module \"${md}\":`, error || e, 6);\n\n void adapter.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: true,\n ack: true,\n c: 'require',\n });\n }\n },\n Buffer: Buffer,\n __engine: {\n __deprecatedWarnings: [],\n __subscriptionsObject: 0,\n __subscriptions: 0,\n __subscriptionsMessage: 0,\n __subscriptionsFile: 0,\n __subscriptionsLog: 0,\n __schedules: 0,\n },\n\n $: function (selector: string): iobJS.QueryResult {\n // following is supported\n // 'type[commonAttr=something]', 'id[commonAttr=something]', id(enumName=\"something\")', id{nativeName=\"something\"}\n // Type can be state, channel or device\n // Attr can be any of the common attributes and can have wildcards *\n // E.g. \"state[id='hm-rpc.0.*]\" or \"hm-rpc.0.*\" returns all states of adapter instance hm-rpc.0\n // channel(room=\"Living room\") => all states in room \"Living room\"\n // channel{TYPE=BLIND}[state.id=*.LEVEL]\n // Switch all states with .STATE of channels with role \"switch\" in \"Wohnzimmer\" to false\n // $('channel[role=switch][state.id=*.STATE](rooms=Wohnzimmer)').setState(false);\n //\n // Following functions are possible, setValue, getValue (only from first), on, each\n\n // Todo CACHE!!!\n\n const result: iobJS.QueryResult = {} as iobJS.QueryResult;\n\n let name = '';\n const commonStrings: string[] = [];\n const enumStrings: string[] = [];\n const nativeStrings: string[] = [];\n let isInsideName = true;\n let isInsideCommonString = false;\n let isInsideEnumString = false;\n let isInsideNativeString = false;\n let currentCommonString = '';\n let currentNativeString = '';\n let currentEnumString = '';\n\n // parse string\n let selectorHasInvalidType = false;\n if (typeof selector === 'string') {\n for (let i = 0; i < selector.length; i++) {\n if (selector[i] === '{') {\n isInsideName = false;\n if (isInsideCommonString || isInsideEnumString || isInsideNativeString) {\n // Error\n break;\n }\n isInsideNativeString = true;\n } else if (selector[i] === '}') {\n isInsideNativeString = false;\n nativeStrings.push(currentNativeString);\n currentNativeString = '';\n } else if (selector[i] === '[') {\n isInsideName = false;\n if (isInsideCommonString || isInsideEnumString || isInsideNativeString) {\n // Error\n break;\n }\n isInsideCommonString = true;\n } else if (selector[i] === ']') {\n isInsideCommonString = false;\n commonStrings.push(currentCommonString);\n currentCommonString = '';\n } else if (selector[i] === '(') {\n isInsideName = false;\n if (isInsideCommonString || isInsideEnumString || isInsideNativeString) {\n // Error\n break;\n }\n isInsideEnumString = true;\n } else if (selector[i] === ')') {\n isInsideEnumString = false;\n enumStrings.push(currentEnumString);\n currentEnumString = '';\n } else if (isInsideName) {\n name += selector[i];\n } else if (isInsideCommonString) {\n currentCommonString += selector[i];\n } else if (isInsideEnumString) {\n currentEnumString += selector[i];\n } else if (isInsideNativeString) {\n currentNativeString += selector[i];\n } //else {\n // some error\n //}\n }\n } else {\n selectorHasInvalidType = true;\n }\n\n // If some error in the selector\n if (selectorHasInvalidType || isInsideEnumString || isInsideCommonString || isInsideNativeString) {\n result.length = 0;\n result.toArray = function () {\n return [];\n };\n result.each = function () {\n return this;\n };\n result.getState = function () {\n return null;\n };\n result.setState = function () {\n return this;\n };\n result.on = function () {\n return this;\n };\n }\n\n if (isInsideEnumString) {\n sandbox.log(`Invalid selector: enum close bracket \")\" cannot be found in \"${selector}\"`, 'warn');\n result.error = 'Invalid selector: enum close bracket \")\" cannot be found';\n return result;\n } else if (isInsideCommonString) {\n sandbox.log(`Invalid selector: common close bracket \"]\" cannot be found in \"${selector}\"`, 'warn');\n result.error = 'Invalid selector: common close bracket \"]\" cannot be found';\n return result;\n } else if (isInsideNativeString) {\n sandbox.log(`Invalid selector: native close bracket \"}\" cannot be found in \"${selector}\"`, 'warn');\n result.error = 'Invalid selector: native close bracket \"}\" cannot be found';\n return result;\n } else if (selectorHasInvalidType) {\n const message = `Invalid selector: selector must be a string but is of type ${typeof selector}`;\n sandbox.log(message, 'warn');\n result.error = message;\n return result;\n }\n\n let commonSelectors: Selector[] = commonStrings.map(selector => splitSelectorString(selector));\n let nativeSelectors: Selector[] = nativeStrings.map(selector => splitSelectorString(selector));\n const enumSelectorObjects: Selector[] = enumStrings.map(_enum => splitSelectorString(_enum));\n const allSelectors: Selector[] = commonSelectors.concat(nativeSelectors, enumSelectorObjects);\n\n // These selectors match the state or object ID and don't belong in the common/native selectors\n // Also use RegExp for the ID matching\n const stateIdSelectors: Selector[] = allSelectors\n .filter(selector => selector.attr === 'state.id')\n .map(selector => addRegExpToIdAttrSelectors(selector));\n const objectIdSelectors: Selector[] = allSelectors\n .filter(selector => selector.attr === 'id')\n .map(selector => addRegExpToIdAttrSelectors(selector));\n commonSelectors = commonSelectors.filter(\n selector => selector.attr !== 'state.id' && selector.attr !== 'id',\n );\n nativeSelectors = nativeSelectors.filter(\n selector => selector.attr !== 'state.id' && selector.attr !== 'id',\n );\n const enumSelectors: string[] = enumSelectorObjects\n .filter(selector => selector.attr !== 'state.id' && selector.attr !== 'id')\n // enums are filtered by their enum id, so transform the selector into that\n .map(selector => `enum.${selector.attr}.${selector.value}`);\n\n name = name.trim();\n\n if (name === 'channel' || name === 'device') {\n // Fill the channels and devices objects with the IDs of all their states,\n // so we can loop over them afterward\n if (!context.channels || !context.devices) {\n context.channels = {};\n context.devices = {};\n for (const _id in objects) {\n if (Object.prototype.hasOwnProperty.call(objects, _id) && objects[_id].type === 'state') {\n const parts = _id.split('.');\n parts.pop();\n const chn = parts.join('.');\n\n parts.pop();\n const dev = parts.join('.');\n\n context.devices[dev] = context.devices[dev] || [];\n context.devices[dev].push(_id);\n\n context.channels[chn] = context.channels[chn] || [];\n context.channels[chn].push(_id);\n }\n }\n }\n }\n\n if (name === 'schedule') {\n if (!context.schedules) {\n context.schedules = [];\n for (const _id in objects) {\n if (Object.prototype.hasOwnProperty.call(objects, _id) && objects[_id].type === 'schedule') {\n context.schedules.push(_id);\n }\n }\n }\n }\n\n /**\n * applies all selectors targeting an object or state ID\n */\n function applyIDSelectors(objId: string, selectors: Selector[]): boolean {\n // Only keep the ID if it matches every ID selector\n return selectors.every(selector => !selector.idRegExp || selector.idRegExp.test(objId));\n }\n\n /**\n * Applies all selectors targeting the Object common properties\n *\n * @param objId - The ID of the object in question\n */\n function applyCommonSelectors(objId: string): boolean {\n const obj = objects[objId];\n if (!obj?.common) {\n return false;\n }\n const objCommon = obj.common;\n\n // make sure this object satisfies all selectors\n return commonSelectors.every(\n selector =>\n // ensure a property exists\n (selector.value === undefined && objCommon[selector.attr] !== undefined) ||\n // or match exact values\n looselyEqualsString(objCommon[selector.attr], selector.value),\n );\n }\n\n /**\n * Applies all selectors targeting the Object native properties\n *\n * @param objId - The ID of the object in question\n */\n function applyNativeSelectors(objId: string): boolean {\n const obj = objects[objId];\n if (!obj || !obj.native) {\n return false;\n }\n const objNative = obj.native;\n // make sure this object satisfies all selectors\n return nativeSelectors.every(\n selector =>\n // ensure a property exists\n (selector.value === undefined && objNative[selector.attr] !== undefined) ||\n // or match exact values\n looselyEqualsString(objNative[selector.attr], selector.value),\n );\n }\n\n /**\n * Applies all selectors targeting the Objects enums\n *\n * @param objId - The ID of the object in question\n */\n function applyEnumSelectors(objId: string): boolean {\n const enumIds: string[] = [];\n eventObj.getObjectEnumsSync(context, objId, enumIds);\n // make sure this object satisfies all selectors\n return enumSelectors.every(_enum => enumIds.includes(_enum));\n }\n\n let res: string[];\n\n if (name === 'schedule') {\n res = context.schedules || [];\n if (objectIdSelectors.length) {\n res = res.filter(channelId => applyIDSelectors(channelId, objectIdSelectors));\n }\n\n // filter out those that don't match every common selector\n if (commonSelectors.length) {\n res = res.filter(id => applyCommonSelectors(id));\n }\n\n // filter out those that don't match every native selector\n if (nativeSelectors.length) {\n res = res.filter(id => applyNativeSelectors(id));\n }\n\n // filter out those that don't match every enum selector\n if (enumSelectors.length) {\n res = res.filter(channelId => applyEnumSelectors(channelId));\n }\n } else if (name === 'channel') {\n if (!context.channels) {\n // TODO: fill the channels and maintain them on all places where context.stateIds will be changed\n }\n const channels = context.channels || {};\n\n // go through all channels\n res = Object.keys(channels);\n // filter out those that don't match every ID selector for the channel ID\n if (objectIdSelectors.length) {\n res = res.filter(channelId => applyIDSelectors(channelId, objectIdSelectors));\n }\n // filter out those that don't match every common selector\n if (commonSelectors.length) {\n res = res.filter(channelId => applyCommonSelectors(channelId));\n }\n // filter out those that don't match every native selector\n if (nativeSelectors.length) {\n res = res.filter(channelId => applyNativeSelectors(channelId));\n }\n // filter out those that don't match every enum selector\n if (enumSelectors.length) {\n res = res.filter(channelId => applyEnumSelectors(channelId));\n }\n\n // retrieve the state ID collection for all remaining channels\n res = res\n .map(id => channels[id])\n // and flatten the array to get only the state IDs\n .reduce((acc, next) => acc.concat(next), []);\n\n // now filter out those that don't match every ID selector for the state ID\n if (stateIdSelectors.length) {\n res = res.filter(stateId => applyIDSelectors(stateId, stateIdSelectors));\n }\n } else if (name === 'device') {\n if (!context.devices) {\n // TODO: fill the devices and maintain them on all places where context.stateIds will be changed\n }\n\n const devices = context.devices || {};\n\n // go through all devices\n res = Object.keys(devices);\n // filter out those that don't match every ID selector for the channel ID\n if (objectIdSelectors.length) {\n res = res.filter(deviceId => applyIDSelectors(deviceId, objectIdSelectors));\n }\n\n // filter out those that don't match every common selector\n if (commonSelectors.length) {\n res = res.filter(deviceId => applyCommonSelectors(deviceId));\n }\n\n // filter out those that don't match every native selector\n if (nativeSelectors.length) {\n res = res.filter(deviceId => applyNativeSelectors(deviceId));\n }\n\n // filter out those that don't match every enum selector\n if (enumSelectors.length) {\n res = res.filter(deviceId => applyEnumSelectors(deviceId));\n }\n\n // retrieve the state ID collection for all remaining devices\n res = res\n .map(id => devices[id])\n // and flatten the array to get only the state IDs\n .reduce((acc, next) => acc.concat(next), []);\n\n // now filter out those that don't match every ID selector for the state ID\n if (stateIdSelectors.length) {\n res = res.filter(stateId => applyIDSelectors(stateId, stateIdSelectors));\n }\n } else {\n // go through all states\n res = context.stateIds;\n // if the \"name\" is not state, then we filter for the ID as well\n if (name && name !== 'state') {\n const r = new RegExp(`^${name.replace(/\\./g, '\\\\.').replace(/\\*/g, '.*')}$`);\n res = res.filter(id => r.test(id));\n }\n\n // filter out those that don't match every ID selector for the object ID or the state ID\n if (objectIdSelectors.length) {\n res = res.filter(id => applyIDSelectors(id, objectIdSelectors));\n }\n\n // filter out those that don't match every ID selector for the state ID\n if (stateIdSelectors.length) {\n res = res.filter(id => applyIDSelectors(id, stateIdSelectors));\n }\n\n // filter out those that don't match every common selector\n if (commonSelectors.length) {\n res = res.filter(id => applyCommonSelectors(id));\n }\n\n // filter out those that don't match every native selector\n if (nativeSelectors.length) {\n res = res.filter(id => applyNativeSelectors(id));\n }\n\n // filter out those that don't match every enum selector\n if (enumSelectors.length) {\n res = res.filter(id => applyEnumSelectors(id));\n }\n }\n\n const resUnique: string[] = [];\n for (let i = 0; i < res.length; i++) {\n if (!resUnique.includes(res[i])) {\n resUnique.push(res[i]);\n }\n }\n\n for (let i = 0; i < resUnique.length; i++) {\n result[i] = resUnique[i];\n }\n result.length = resUnique.length;\n\n // Implementing the Symbol.iterator contract makes the query result iterable\n result[Symbol.iterator] = function* () {\n for (let i = 0; i < result.length; i++) {\n yield result[i];\n }\n };\n result.toArray = function (): string[] {\n return [...resUnique];\n };\n result.each = function (callback: (id: string, index: number) => void | false): iobJS.QueryResult {\n if (typeof callback === 'function') {\n let r: boolean | void;\n for (let i = 0; i < this.length; i++) {\n r = callback(result[i], i);\n if (r === false) {\n break;\n }\n }\n }\n return this;\n };\n // @ts-expect-error fix later\n result.getState = function (\n callback?: iobJS.GetStateCallback,\n ): void | null | undefined | iobJS.TypedState | iobJS.AbsentState {\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n if (typeof callback !== 'function') {\n sandbox.log('You cannot use this function synchronous', 'error');\n } else {\n void adapter.getForeignState(\n this[0],\n (err: Error | null | undefined, state?: ioBroker.State | null): void => {\n void callback(\n err,\n context.convertBackStringifiedValues(this[0], state) as\n | iobJS.TypedState\n | iobJS.AbsentState,\n );\n },\n );\n }\n } else {\n if (!this[0]) {\n return null;\n }\n if (context.interimStateValues[this[0]] !== undefined) {\n return context.convertBackStringifiedValues(this[0], context.interimStateValues[this[0]]) as\n | iobJS.TypedState\n | iobJS.AbsentState;\n }\n return context.convertBackStringifiedValues(this[0], states[this[0]]) as\n | iobJS.TypedState\n | iobJS.AbsentState;\n }\n };\n result.getStateAsync = async function (): Promise<\n iobJS.TypedState | iobJS.AbsentState | null | undefined\n > {\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n const state = await adapter.getForeignStateAsync(this[0]);\n return context.convertBackStringifiedValues(this[0], state) as\n | iobJS.TypedState\n | iobJS.AbsentState\n | null;\n }\n if (!this[0]) {\n return null;\n }\n if (context.interimStateValues[this[0]] !== undefined) {\n return context.convertBackStringifiedValues(this[0], context.interimStateValues[this[0]]) as\n | iobJS.TypedState\n | iobJS.AbsentState\n | null;\n }\n return context.convertBackStringifiedValues(this[0], states[this[0]]) as\n | iobJS.TypedState\n | iobJS.AbsentState\n | null;\n };\n result.setState = function (\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean | 'false' | 'true' | null | iobJS.SetStateCallback,\n callback?: iobJS.SetStateCallback,\n ) {\n if (typeof isAck === 'function') {\n callback = isAck;\n isAck = undefined;\n }\n void result\n .setStateAsync(state, isAck as boolean | 'false' | 'true')\n .then(() => typeof callback === 'function' && callback());\n return this;\n };\n result.setStateAsync = async function (\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean,\n ): Promise {\n for (let i = 0; i < this.length; i++) {\n await sandbox.setStateAsync(this[i], state, isAck);\n }\n };\n result.setStateChanged = function (\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean,\n callback?: () => void,\n ) {\n if (typeof isAck === 'function') {\n callback = isAck;\n isAck = undefined;\n }\n void result.setStateChangedAsync(state, isAck).then(() => typeof callback === 'function' && callback());\n return this;\n };\n result.setStateChangedAsync = async function (\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean,\n ): Promise {\n for (let i = 0; i < this.length; i++) {\n await sandbox.setStateChangedAsync(this[i], state, isAck);\n }\n };\n result.setStateDelayed = function (\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck: boolean | number | undefined,\n delay?: number | boolean,\n clearRunning?: boolean | (() => void),\n callback?: () => void,\n ) {\n if (typeof isAck !== 'boolean') {\n callback = clearRunning as () => void;\n clearRunning = delay as boolean;\n delay = isAck as number;\n isAck = undefined;\n }\n if (typeof delay !== 'number') {\n callback = clearRunning as () => void;\n clearRunning = delay;\n delay = 0;\n }\n if (typeof clearRunning !== 'boolean') {\n callback = clearRunning;\n clearRunning = true;\n }\n let count = this.length;\n for (let i = 0; i < this.length; i++) {\n sandbox.setStateDelayed(this[i], state, isAck as boolean, delay, clearRunning, () => {\n if (!--count && typeof callback === 'function') {\n callback();\n }\n });\n }\n return this;\n };\n result.on = function (callbackOrId: string | ((data: any) => void), value?: any) {\n for (let i = 0; i < this.length; i++) {\n sandbox.subscribe(this[i], callbackOrId, value);\n }\n return this;\n };\n return result;\n },\n log: function (msg: string, severity?: ioBroker.LogLevel): void {\n severity = severity || 'info';\n\n // disable log in log handler (prevent endless loops)\n if (sandbox.logHandler && (sandbox.logHandler === severity || sandbox.logHandler === '*')) {\n return;\n }\n\n if (!adapter.log[severity]) {\n msg = `Unknown severity level \"${severity}\" by log of [${msg}]`;\n severity = 'warn';\n }\n\n if (msg && typeof msg !== 'string') {\n msg = mods.util.format(msg);\n }\n\n if (debugMode) {\n console.log(`${severity}$$${name}$$${msg}`, Date.now());\n } else {\n adapter.log[severity](`${name}: ${msg}`);\n }\n },\n onLog: function (severity: ioBroker.LogLevel, callback: (info: LogMessage) => void): number {\n if (!['info', 'error', 'debug', 'silly', 'warn', '*'].includes(severity)) {\n sandbox.log(`Unknown severity \"${severity}\"`, 'warn');\n return 0;\n }\n if (typeof callback !== 'function') {\n sandbox.log(`Invalid callback for onLog`, 'warn');\n return 0;\n }\n\n const handler = { id: Date.now() + Math.floor(Math.random() * 10000), cb: callback, sandbox, severity };\n context.logSubscriptions[sandbox.scriptName] = context.logSubscriptions[sandbox.scriptName] || [];\n context.logSubscriptions[sandbox.scriptName].push(handler);\n context.updateLogSubscriptions();\n\n sandbox.__engine.__subscriptionsLog += 1;\n\n sandbox.verbose &&\n sandbox.log(\n `onLog(severity=${severity}, id=${handler.id}) - logSubscriptions=${sandbox.__engine.__subscriptionsLog}`,\n 'info',\n );\n\n if (\n sandbox.__engine.__subscriptionsLog %\n (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__subscriptionsLog} log subscriptions registered. Check your script!`,\n 'warn',\n );\n }\n\n return handler.id;\n },\n onLogUnregister: function (\n idOrCallbackOrSeverity: number | ioBroker.LogLevel | ((info: LogMessage) => void),\n ): boolean {\n let found = false;\n\n if (context.logSubscriptions?.[sandbox.scriptName]) {\n sandbox.verbose &&\n sandbox.log(\n `onLogUnregister(idOrCallbackOrSeverity=${JSON.stringify(idOrCallbackOrSeverity)}) - logSubscriptions=${sandbox.__engine.__subscriptionsLog}`,\n 'info',\n );\n\n for (let i = 0; i < context.logSubscriptions[sandbox.scriptName].length; i++) {\n if (\n context.logSubscriptions[sandbox.scriptName][i].cb === idOrCallbackOrSeverity ||\n context.logSubscriptions[sandbox.scriptName][i].id === idOrCallbackOrSeverity ||\n context.logSubscriptions[sandbox.scriptName][i].severity === idOrCallbackOrSeverity\n ) {\n sandbox.verbose &&\n sandbox.log(\n `onLogUnregister(idOrCallbackOrSeverity=${JSON.stringify(idOrCallbackOrSeverity)}, removing id=${context.logSubscriptions[sandbox.scriptName][i].id})`,\n 'info',\n );\n\n context.logSubscriptions[sandbox.scriptName].splice(i, 1);\n i--;\n sandbox.__engine.__subscriptionsLog--;\n\n found = true;\n\n // if deletion via ID\n if (typeof idOrCallbackOrSeverity === 'number') {\n break;\n }\n } else {\n sandbox.verbose &&\n sandbox.log(\n `onLogUnregister(idOrCallbackOrSeverity=${JSON.stringify(idOrCallbackOrSeverity)}) NOT = ${JSON.stringify(context.logSubscriptions[sandbox.scriptName][i])}`,\n 'info',\n );\n }\n }\n }\n\n context.updateLogSubscriptions();\n\n return found;\n },\n exec: function (\n cmd: string,\n options?: ExecOptions | ((error: Error | null | string, stdout?: string, stderr?: string) => void),\n callback?: (error: Error | null | string, stdout?: string, stderr?: string) => void,\n ): undefined | ChildProcess {\n if (typeof options === 'function') {\n callback = options as (error: Error | null | string, stdout?: string, stderr?: string) => void;\n options = {};\n }\n if (!(adapter.config as JavaScriptAdapterConfig).enableExec) {\n const error = 'exec is not available. Please enable \"Enable Exec\" option in instance settings';\n sandbox.log(error, 'error');\n\n if (typeof callback === 'function') {\n setImmediate(callback, error, undefined, undefined);\n }\n } else {\n if (sandbox.verbose) {\n sandbox.log(`exec(cmd=${cmd})`, 'info');\n }\n\n if (debug) {\n sandbox.log(words._('Command %s was not executed, while debug mode is active', cmd), 'warn');\n if (typeof callback === 'function') {\n setImmediate(function () {\n callback(null, '', '');\n });\n }\n } else {\n return mods.child_process.exec(\n cmd,\n options,\n (error: Error | null, stdout: string, stderr: string): void => {\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, error, stdout, stderr);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n },\n );\n }\n }\n },\n email: function (msg: string | SendMailOptions): void {\n if (sandbox.verbose) {\n sandbox.log(`email(msg=${JSON.stringify(msg)})`, 'info');\n }\n sandbox.log(`email(msg=${JSON.stringify(msg)}) is deprecated. Please use sendTo instead!`, 'warn');\n adapter.sendTo('email', msg);\n },\n pushover: function (msg: string | PushoverOptions): void {\n if (sandbox.verbose) {\n sandbox.log(`pushover(msg=${JSON.stringify(msg)})`, 'info');\n }\n sandbox.log(`pushover(msg=${JSON.stringify(msg)}) is deprecated. Please use sendTo instead!`, 'warn');\n adapter.sendTo('pushover', msg);\n },\n httpGet: function (\n url: string,\n options:\n | {\n timeout?: number;\n responseType?: ResponseType;\n headers?: Record;\n basicAuth?: { user: string; password: string } | null;\n bearerAuth?: string;\n validateCertificate?: boolean;\n }\n | ((\n error: Error | null,\n result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n },\n ) => void),\n callback?: (\n error: Error | null,\n result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n },\n ) => void,\n ): void {\n if (typeof options === 'function') {\n callback = options as (\n error: Error | null,\n result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n },\n ) => void;\n options = {};\n }\n\n const config = {\n ...getHttpRequestConfig(url, options, context.allowSelfSignedCerts),\n method: 'get',\n };\n\n if (sandbox.verbose) {\n sandbox.log(`httpGet(config=${JSON.stringify(config)})`, 'info');\n }\n\n const startTime = Date.now();\n\n mods.axios\n .default(config)\n .then((response: AxiosResponse) => {\n const responseTime = Date.now() - startTime;\n\n if (sandbox.verbose) {\n sandbox.log(`httpGet(url=${url}, responseTime=${responseTime}ms)`, 'info');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, null, {\n statusCode: response.status,\n data: response.data,\n headers: response.headers as Record,\n responseTime,\n });\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n })\n .catch((error: any) => {\n const responseTime = Date.now() - startTime;\n\n sandbox.log(`httpGet(url=${url}, error=${error.message})`, 'error');\n\n if (typeof callback === 'function') {\n let result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n } = {\n statusCode: null,\n data: null,\n headers: {},\n responseTime,\n };\n\n if (error.response) {\n result = {\n statusCode: error.response.status,\n data: error.response.data,\n headers: error.response.headers,\n responseTime,\n };\n }\n\n try {\n callback.call(sandbox, error.message, result);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n });\n },\n httpPost: function (\n url: string,\n data: any,\n options:\n | {\n timeout?: number;\n responseType?: ResponseType;\n headers?: Record;\n basicAuth?: { user: string; password: string } | null;\n bearerAuth?: string;\n validateCertificate?: boolean;\n }\n | ((\n error: Error | null,\n result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n },\n ) => void),\n callback?: (\n error: Error | null,\n result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n },\n ) => void,\n ): void {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n\n const config = {\n ...getHttpRequestConfig(\n url,\n options as {\n timeout?: number;\n responseType?: ResponseType;\n headers?: Record;\n basicAuth?: { user: string; password: string } | null;\n bearerAuth?: string;\n validateCertificate?: boolean;\n },\n context.allowSelfSignedCerts,\n ),\n method: 'post',\n data,\n };\n\n if (sandbox.verbose) {\n sandbox.log(`httpPost(config=${JSON.stringify(config)}, data=${data})`, 'info');\n }\n\n const startTime = Date.now();\n\n mods.axios\n .default(config)\n .then((response: AxiosResponse) => {\n const responseTime = Date.now() - startTime;\n\n if (sandbox.verbose) {\n sandbox.log(`httpPost(url=${url}, responseTime=${responseTime}ms)`, 'info');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, null, {\n statusCode: response.status,\n data: response.data,\n headers: response.headers,\n responseTime,\n });\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n })\n .catch((error: unknown) => {\n const responseTime = Date.now() - startTime;\n\n sandbox.log(`httpPost(url=${url}, error=${(error as Error).message})`, 'error');\n\n if (typeof callback === 'function') {\n let result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n } = {\n statusCode: null,\n data: null,\n headers: {},\n responseTime,\n };\n const response: AxiosResponse | undefined = (error as AxiosError).response;\n\n if (response) {\n result = {\n statusCode: response.status,\n data: response.data,\n headers: response.headers,\n responseTime,\n };\n }\n\n try {\n callback.call(sandbox, new Error((error as AxiosError).message), result);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n });\n },\n createTempFile: function (fileName: string, data: Buffer | string): undefined | string {\n const os = mods.os;\n const path = mods.path;\n const fs = mods.fs;\n\n let tempDirPath = context.tempDirectories?.[sandbox.scriptName];\n\n if (!tempDirPath) {\n // create temp directory\n tempDirPath = fs.mkdtempSync(\n path.join(os.tmpdir(), `${sandbox.scriptName.substring(SCRIPT_CODE_MARKER.length)}-`),\n );\n context.tempDirectories[sandbox.scriptName] = tempDirPath;\n\n sandbox.verbose &&\n sandbox.log(\n `createTempFile(fileName=${fileName}, tempDirPath=${tempDirPath}) created temp directory in ${os.tmpdir()}`,\n 'info',\n );\n }\n\n const filePath = path.join(tempDirPath, fileName);\n\n // is sub dir?\n const fileDir = path.dirname(filePath);\n if (!fs.existsSync(fileDir)) {\n fs.mkdirSync(fileDir, { recursive: true });\n }\n\n if (typeof data === 'undefined') {\n sandbox.log(\n `createTempFile(fileName=${fileName}, fileDir=${fileDir}, filePath=${filePath}) data is undefined, file not created!`,\n 'error',\n );\n\n return undefined;\n }\n\n fs.writeFileSync(filePath, data);\n sandbox.verbose &&\n sandbox.log(`createTempFile(fileName=${fileName}, fileDir=${fileDir}, filePath=${filePath})`, 'info');\n\n return filePath;\n },\n subscribe: function (\n pattern:\n | TimeRule\n | AstroRule\n | Pattern\n | SchedulerRule\n | string\n | (TimeRule | AstroRule | Pattern | SchedulerRule | string)[],\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n callbackOrChangeTypeOrId: string | ChangeType | ((event?: EventObj) => void),\n value?: any,\n ):\n | SubscriptionResult\n | IobSchedule\n | string\n | null\n | undefined\n | (SubscriptionResult | IobSchedule | string | null | undefined)[] {\n // If a schedule object is given\n if (\n (typeof pattern === 'string' && pattern[0] === '{') ||\n (typeof pattern === 'object' && (pattern as SchedulerRule).period)\n ) {\n return sandbox.schedule(pattern as SchedulerRule, callbackOrChangeTypeOrId as () => void);\n }\n // If an array of schedules is given\n if (pattern && Array.isArray(pattern)) {\n const result: (IobSchedule | string | null | undefined)[] = [];\n for (const p of pattern) {\n result.push(\n sandbox.subscribe(p as SchedulerRule | string, callbackOrChangeTypeOrId, value) as\n | IobSchedule\n | string\n | null\n | undefined,\n );\n }\n return result;\n }\n\n // detect subscribe('id', 'any', (obj) => {})\n let oPattern: Pattern;\n if (\n (typeof pattern === 'string' || pattern instanceof RegExp) &&\n typeof callbackOrChangeTypeOrId === 'string' &&\n typeof value === 'function'\n ) {\n oPattern = { id: pattern, change: callbackOrChangeTypeOrId as ChangeType };\n callbackOrChangeTypeOrId = value;\n value = undefined;\n } else {\n oPattern = pattern as Pattern;\n }\n\n if (oPattern?.id && Array.isArray(oPattern.id)) {\n const result: (IobSchedule | string | null | undefined)[] = [];\n for (let t = 0; t < oPattern.id.length; t++) {\n const pa: Pattern = JSON.parse(JSON.stringify(oPattern));\n pa.id = oPattern.id[t];\n result.push(\n sandbox.subscribe(pa, callbackOrChangeTypeOrId, value) as\n | IobSchedule\n | string\n | null\n | undefined,\n );\n }\n return result;\n }\n\n // try to detect astro or cron (by spaces)\n if (isObject(pattern) || (typeof pattern === 'string' && pattern.match(/[,/\\d*]+\\s[,/\\d*]+\\s[,/\\d*]+/))) {\n if ((pattern as AstroRule).astro) {\n return sandbox.schedule(pattern as AstroRule, callbackOrChangeTypeOrId as () => void);\n } else if ((pattern as TimeRule).time) {\n return sandbox.schedule(\n (pattern as TimeRule).time as string,\n callbackOrChangeTypeOrId as () => void,\n );\n }\n }\n\n let callback: undefined | ((obj: EventObj) => void);\n\n // source is set by regexp if defined as /regexp/\n if (!isObject(pattern) || pattern instanceof RegExp || (pattern as RegExp).source) {\n oPattern = { id: pattern as string | RegExp, change: 'ne' };\n }\n\n if (oPattern.id !== undefined && !oPattern.id) {\n sandbox.log(`Error by subscription (trigger): empty ID defined. All states matched.`, 'error');\n return;\n } else if (typeof oPattern.id === 'boolean' || typeof oPattern.id === 'number') {\n sandbox.log(`Error by subscription (trigger): Wrong ID of type boolean or number.`, 'error');\n return;\n }\n\n sandbox.__engine.__subscriptions += 1;\n\n if (\n sandbox.__engine.__subscriptions % (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__subscriptions} subscriptions registered. Check your script!`,\n 'warn',\n );\n }\n\n if (oPattern.q === undefined) {\n oPattern.q = 0;\n }\n\n // add adapter namespace if nothing given\n if (oPattern.id && typeof oPattern.id === 'string' && !oPattern.id.includes('.')) {\n oPattern.id = `${adapter.namespace}.${oPattern.id}`;\n }\n\n if (typeof callbackOrChangeTypeOrId === 'function') {\n callback = callbackOrChangeTypeOrId;\n } else {\n if (typeof value === 'undefined') {\n callback = function (obj: EventObj) {\n sandbox.setState(callbackOrChangeTypeOrId, obj.newState.val);\n };\n } else {\n callback = function (/* obj */) {\n sandbox.setState(callbackOrChangeTypeOrId, value);\n };\n }\n }\n\n const subs: SubscriptionResult = {\n pattern: oPattern,\n callback: (obj: EventObj) => {\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, obj);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n },\n name,\n };\n\n // try to extract adapter\n if (oPattern.id && typeof oPattern.id === 'string') {\n const parts = oPattern.id.split('.');\n const a = `${parts[0]}.${parts[1]}`;\n const _adapter = `system.adapter.${a}`;\n\n if (objects[_adapter] && objects[_adapter].common && objects[_adapter].common.subscribable) {\n const alive = `system.adapter.${a}.alive`;\n context.adapterSubs[alive] = context.adapterSubs[alive] || [];\n\n const subExists = context.adapterSubs[alive].filter(sub => sub === oPattern.id).length > 0;\n\n if (!subExists) {\n context.adapterSubs[alive].push(oPattern.id);\n adapter.sendTo(a, 'subscribe', oPattern.id);\n }\n }\n }\n if (sandbox.verbose) {\n sandbox.log(`subscribe: ${JSON.stringify(subs)}`, 'info');\n }\n\n subscribePattern(script, oPattern.id as string);\n\n subs.patternCompareFunctions = getPatternCompareFunctions(oPattern);\n context.subscriptions.push(subs);\n\n if (oPattern.enumName || oPattern.enumId) {\n context.isEnums = true;\n }\n return subs;\n },\n getSubscriptions: function (): Record {\n const result: Record = {};\n for (let s = 0; s < context.subscriptions.length; s++) {\n result[context.subscriptions[s].pattern.id as string] =\n result[context.subscriptions[s].pattern.id as string] || [];\n result[context.subscriptions[s].pattern.id as string].push({\n name: context.subscriptions[s].name,\n pattern: context.subscriptions[s].pattern,\n });\n }\n if (sandbox.verbose) {\n sandbox.log(`getSubscriptions() => ${JSON.stringify(result)}`, 'info');\n }\n return result;\n },\n getFileSubscriptions: function (): Record {\n const result: Record = {};\n for (let s = 0; s < context.subscriptionsFile.length; s++) {\n const key = `${context.subscriptionsFile[s].id}$%$${context.subscriptionsFile[s].fileNamePattern}`;\n result[key] = result[key] || [];\n result[key].push({\n name: context.subscriptionsFile[s].name,\n id: context.subscriptionsFile[s].id,\n fileNamePattern: context.subscriptionsFile[s].fileNamePattern,\n });\n }\n if (sandbox.verbose) {\n sandbox.log(`getFileSubscriptions() => ${JSON.stringify(result)}`, 'info');\n }\n return result;\n },\n adapterSubscribe: function (id: string): void {\n if (typeof id !== 'string') {\n sandbox.log(`adapterSubscribe: invalid type of id ${typeof id}`, 'error');\n return;\n }\n const parts = id.split('.');\n const _adapter = `system.adapter.${parts[0]}.${parts[1]}`;\n if (objects[_adapter]?.common?.subscribable) {\n const a = `${parts[0]}.${parts[1]}`;\n const alive = `system.adapter.${a}.alive`;\n context.adapterSubs[alive] = context.adapterSubs[alive] || [];\n context.adapterSubs[alive].push(id);\n if (sandbox.verbose) {\n sandbox.log(`adapterSubscribe: ${a} - ${id}`, 'info');\n }\n adapter.sendTo(a, 'subscribe', id);\n }\n },\n adapterUnsubscribe: function (\n idOrObject: string | SubscriptionResult | (string | SubscriptionResult)[],\n ): boolean | boolean[] {\n // todo: BF - it could be an error\n return sandbox.unsubscribe(idOrObject);\n },\n unsubscribe: function (\n idOrObject: string | SubscriptionResult | (string | SubscriptionResult)[],\n ): boolean | boolean[] {\n if (idOrObject && Array.isArray(idOrObject)) {\n const result: boolean[] = [];\n for (let t = 0; t < idOrObject.length; t++) {\n result.push(sandbox.unsubscribe(idOrObject[t]) as boolean);\n }\n return result;\n }\n\n if (sandbox.verbose) {\n sandbox.log(`adapterUnsubscribe(id=${JSON.stringify(idOrObject)})`, 'info');\n }\n\n if (isObject(idOrObject)) {\n for (let i = context.subscriptions.length - 1; i >= 0; i--) {\n if (context.subscriptions[i] === idOrObject) {\n unsubscribePattern(script, context.subscriptions[i].pattern.id as string);\n context.subscriptions.splice(i, 1);\n sandbox.__engine.__subscriptions--;\n return true;\n }\n }\n return false;\n }\n let deleted = 0;\n for (let i = context.subscriptions.length - 1; i >= 0; i--) {\n if (context.subscriptions[i].name === name && context.subscriptions[i].pattern.id === idOrObject) {\n deleted++;\n unsubscribePattern(script, context.subscriptions[i].pattern.id as string);\n context.subscriptions.splice(i, 1);\n sandbox.__engine.__subscriptions--;\n }\n }\n return !!deleted;\n },\n on: function (\n pattern:\n | TimeRule\n | AstroRule\n | Pattern\n | SchedulerRule\n | string\n | (TimeRule | AstroRule | Pattern | SchedulerRule | string)[],\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n callbackOrChangeTypeOrId: string | ChangeType | ((event?: EventObj) => void),\n value?: any,\n ):\n | SubscriptionResult\n | IobSchedule\n | string\n | null\n | undefined\n | (SubscriptionResult | IobSchedule | string | null | undefined)[] {\n return sandbox.subscribe(pattern, callbackOrChangeTypeOrId, value);\n },\n onEnumMembers: function (enumId: string, callback: (event?: EventObj) => void): void {\n if (enums.includes(enumId)) {\n const subscriptions: Record = {};\n\n const init = (): void => {\n const obj: ioBroker.EnumObject = objects[enumId] as ioBroker.EnumObject;\n const common: ioBroker.EnumCommon = obj?.common ?? {};\n const members: string[] = common?.members ?? [];\n\n // Remove old subscriptions\n for (const [objId, subscription] of Object.entries(subscriptions)) {\n if (!members.includes(objId)) {\n sandbox.unsubscribe(subscription);\n delete subscriptions[objId];\n }\n }\n\n // Subscribe to all members of enum\n for (const objId of members) {\n if (!Object.keys(subscriptions).includes(objId)) {\n if (objects?.[objId]?.type === 'state') {\n // Just subscribe to states\n subscriptions[objId] = sandbox.subscribe(objId, callback) as\n | string\n | SubscriptionResult; // TODO: more features\n }\n }\n }\n\n sandbox.verbose &&\n sandbox.log(\n `onEnumMembers(id=${enumId}, members=${JSON.stringify(Object.keys(subscriptions))})`,\n 'info',\n );\n };\n\n init();\n\n sandbox.subscribeObject(enumId, obj => obj && init());\n } else {\n sandbox.log(`onEnumMembers: enum with id \"${enumId}\" doesn't exists`, 'error');\n }\n },\n onFile: function (\n id: string,\n fileNamePattern: string | string[],\n withFileOrCallback:\n | boolean\n | ((id: string, fileName: string, size: number, file?: string | Buffer, mimeType?: string) => void),\n callback?: (\n id: string,\n fileName: string,\n size: number | null,\n file?: string | Buffer,\n mimeType?: string,\n ) => void,\n ): undefined | FileSubscriptionResult | (undefined | FileSubscriptionResult)[] {\n if (typeof withFileOrCallback === 'function') {\n callback = withFileOrCallback as (\n id: string,\n fileName: string,\n size: number | null,\n file?: string | Buffer,\n mimeType?: string,\n ) => void;\n withFileOrCallback = false;\n }\n\n if (!adapter.subscribeForeignFiles) {\n sandbox.log(\n 'onFile: your js-controller does not support yet onFile subscribes. Please update to js-controller@4.1.x or newer',\n 'warn',\n );\n return;\n }\n if (!id || !fileNamePattern) {\n sandbox.log(\n 'onFile: invalid parameters. Usage: onFile(\"vis.0\", \"main/*\", true, (id, fileName, size, file, mimeType) => {});',\n 'error',\n );\n return;\n }\n if (typeof callback !== 'function') {\n sandbox.offFile(id, fileNamePattern);\n return;\n }\n\n if (Array.isArray(fileNamePattern)) {\n return fileNamePattern.map(\n filePattern =>\n sandbox.onFile(id, filePattern, withFileOrCallback, callback) as\n | undefined\n | FileSubscriptionResult,\n );\n }\n\n sandbox.__engine.__subscriptionsFile += 1;\n\n sandbox.verbose &&\n sandbox.log(\n `onFile(id=${id}, fileNamePattern=${fileNamePattern}) - fileSubscriptions=${sandbox.__engine.__subscriptionsFile}`,\n 'info',\n );\n\n if (\n sandbox.__engine.__subscriptionsFile %\n (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__subscriptionsFile} file subscriptions registered. Check your script!`,\n 'warn',\n );\n }\n\n let idRegEx: RegExp | undefined;\n let fileRegEx: RegExp | undefined;\n if (id.includes('*')) {\n idRegEx = new RegExp(pattern2RegEx(id));\n }\n if (fileNamePattern.includes('*')) {\n fileRegEx = new RegExp(pattern2RegEx(fileNamePattern));\n }\n\n const subs: FileSubscriptionResult = {\n id,\n fileNamePattern,\n withFile: withFileOrCallback,\n idRegEx,\n fileRegEx,\n callback: (id: string, fileName: string, size: number | null, withFile: boolean): void => {\n try {\n sandbox.verbose &&\n sandbox.log(`onFile changed(id=${id}, fileName=${fileName}, size=${size})`, 'info');\n\n if (withFile && (size || 0) > 0) {\n adapter\n .readFileAsync(id, fileName)\n .then(data => {\n try {\n callback.call(sandbox, id, fileName, size, data.file, data.mimeType);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n })\n .catch(error => errorInCallback(error));\n } else {\n callback.call(sandbox, id, fileName, size);\n }\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n },\n name,\n };\n\n context.subscriptionsFile.push(subs);\n subscribeFile(script, id, fileNamePattern);\n return subs;\n },\n offFile: function (\n idOrObject: FileSubscriptionResult | string | (FileSubscriptionResult | string)[],\n fileNamePattern?: string | string[],\n ): boolean | boolean[] {\n if (!adapter.unsubscribeForeignFiles) {\n sandbox.log(\n 'offFile: your js-controller does not support yet file unsubscribes. Please update to js-controller@4.1.x or newer',\n 'warn',\n );\n return false;\n }\n\n sandbox.verbose &&\n sandbox.log(\n `offFile(idOrObject=${JSON.stringify(idOrObject)}, fileNamePattern=${JSON.stringify(fileNamePattern)}) - fileSubscriptions=${sandbox.__engine.__subscriptionsFile}`,\n 'info',\n );\n\n if (idOrObject && typeof idOrObject === 'object') {\n if (Array.isArray(idOrObject)) {\n const result: boolean[] = [];\n for (let t = 0; t < idOrObject.length; t++) {\n result.push(sandbox.offFile(idOrObject[t]) as boolean);\n }\n return result;\n }\n for (let i = context.subscriptionsFile.length - 1; i >= 0; i--) {\n if (context.subscriptionsFile[i] === idOrObject) {\n unsubscribeFile(\n script,\n context.subscriptionsFile[i].id,\n context.subscriptionsFile[i].fileNamePattern,\n );\n\n sandbox.verbose &&\n sandbox.log(\n `offFile(type=object, fileNamePattern=${JSON.stringify(fileNamePattern)}, removing id=${context.subscriptionsFile[i].id})`,\n 'info',\n );\n\n context.subscriptionsFile.splice(i, 1);\n sandbox.__engine.__subscriptionsFile--;\n return true;\n }\n }\n return false;\n }\n\n if (fileNamePattern && Array.isArray(fileNamePattern)) {\n const result: boolean[] = [];\n for (let t = 0; t < fileNamePattern.length; t++) {\n result.push(sandbox.offFile(idOrObject, fileNamePattern[t]) as boolean);\n }\n return result;\n }\n\n let deleted = 0;\n for (let i = context.subscriptionsFile.length - 1; i >= 0; i--) {\n if (\n context.subscriptionsFile[i].id === idOrObject &&\n context.subscriptionsFile[i].fileNamePattern === fileNamePattern\n ) {\n deleted++;\n unsubscribeFile(\n script,\n context.subscriptionsFile[i].id,\n context.subscriptionsFile[i].fileNamePattern,\n );\n\n sandbox.verbose &&\n sandbox.log(\n `offFile(type=string, fileNamePattern=${fileNamePattern}, removing id=${context.subscriptionsFile[i].id})`,\n 'info',\n );\n\n context.subscriptionsFile.splice(i, 1);\n sandbox.__engine.__subscriptionsFile--;\n }\n }\n return !!deleted;\n },\n /** Registers a one-time subscription which automatically unsubscribes after the first invocation */\n once: function (\n pattern:\n | TimeRule\n | AstroRule\n | Pattern\n | SchedulerRule\n | string\n | (TimeRule | AstroRule | Pattern | SchedulerRule | string)[],\n callback?: (event?: EventObj) => void,\n ): string | SubscriptionResult | Promise {\n function _once(cb: (obj?: EventObj) => void): string | SubscriptionResult {\n // eslint-disable-next-line prefer-const\n let subscription: string | SubscriptionResult;\n const handler = (obj?: EventObj): void => {\n subscription && sandbox.unsubscribe(subscription);\n typeof cb === 'function' && cb(obj);\n };\n subscription = sandbox.subscribe(pattern, handler) as string | SubscriptionResult;\n return subscription;\n }\n if (typeof callback === 'function') {\n // Callback-style: once(\"id\", (obj) => { ... })\n return _once(callback);\n }\n\n // Promise-style: once(\"id\").then(obj => { ... })\n return new Promise(resolve => _once(resolve));\n },\n schedule: function (\n pattern: SchedulerRule | AstroRule | Date | string,\n callback: () => void,\n ): IobSchedule | string | null | undefined {\n if (typeof callback !== 'function') {\n sandbox.log(`schedule callback missing`, 'error');\n return null;\n }\n\n if (\n (typeof pattern === 'string' && pattern[0] === '{') ||\n (typeof pattern === 'object' && (pattern as SchedulerRule).period)\n ) {\n sandbox.verbose &&\n sandbox.log(\n `schedule(wizard=${typeof pattern === 'object' ? JSON.stringify(pattern) : pattern})`,\n 'info',\n );\n\n if (!context.scheduler) {\n sandbox.log(\n `Cannot schedule \"${typeof pattern === 'object' ? JSON.stringify(pattern) : pattern}\" because scheduler is not available`,\n 'error',\n );\n return null;\n }\n\n const schedule: string | null = context.scheduler.add(\n pattern as SchedulerRule | string,\n sandbox.scriptName,\n callback,\n );\n if (schedule) {\n script.wizards.push(schedule);\n sandbox.__engine.__schedules += 1;\n\n if (\n sandbox.__engine.__schedules %\n (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__schedules} schedules registered. Check your script!`,\n 'warn',\n );\n }\n }\n\n return schedule;\n }\n\n const adapterConfig: JavaScriptAdapterConfig = adapter.config as JavaScriptAdapterConfig;\n\n if (typeof pattern === 'object' && (pattern as AstroRule).astro) {\n const astroPattern = pattern as AstroRule;\n const nowDate = new Date();\n\n if (\n adapterConfig.latitude === undefined ||\n adapterConfig.longitude === undefined ||\n adapterConfig.latitude === null ||\n adapterConfig.longitude === null\n ) {\n sandbox.log('Longitude or latitude does not set. Cannot use astro.', 'error');\n return null;\n }\n\n // ensure events are calculated independent of current time\n // TODO: use getAstroStartOfDay of adapter?\n const todayNoon = new Date(nowDate);\n todayNoon.setHours(12, 0, 0, 0);\n let ts = mods.suncalc.getTimes(todayNoon, adapterConfig.latitude, adapterConfig.longitude)[\n astroPattern.astro\n ];\n\n // event on the next day, correct or force recalculation at midnight\n if (todayNoon.getDate() !== ts.getDate()) {\n todayNoon.setDate(todayNoon.getDate() - 1);\n ts = mods.suncalc.getTimes(todayNoon, adapterConfig.latitude, adapterConfig.longitude)[\n astroPattern.astro\n ];\n }\n\n if (ts.getTime().toString() === 'NaN') {\n sandbox.log(\n `Cannot calculate \"${astroPattern.astro}\" for ${adapterConfig.latitude}, ${adapterConfig.longitude}`,\n 'warn',\n );\n ts = new Date(nowDate.getTime());\n\n if (\n astroPattern.astro === 'sunriseEnd' ||\n astroPattern.astro === 'goldenHourEnd' ||\n astroPattern.astro === 'sunset' ||\n astroPattern.astro === 'nightEnd' ||\n astroPattern.astro === 'nauticalDusk'\n ) {\n ts.setHours(23);\n ts.setMinutes(59);\n ts.setSeconds(59);\n } else {\n ts.setHours(23);\n ts.setMinutes(59);\n ts.setSeconds(58);\n }\n }\n\n if (ts && astroPattern.shift) {\n ts = new Date(ts.getTime() + astroPattern.shift * 60000);\n }\n\n if (!ts || ts < nowDate) {\n const date = new Date(nowDate);\n // Event doesn't occur today - try again tomorrow\n // Calculate time till 24:00 (local, NOT UTC) and set timeout\n date.setDate(date.getDate() + 1);\n date.setMinutes(0); // Sometimes timer fires at 23:59:59\n date.setHours(0);\n date.setSeconds(1);\n date.setMilliseconds(0);\n\n sandbox.__engine.__schedules += 1;\n\n if (sandbox.__engine.__schedules % adapterConfig.maxTriggersPerScript === 0) {\n sandbox.log(\n `More than ${sandbox.__engine.__schedules} schedules registered. Check your script!`,\n 'warn',\n );\n }\n\n sandbox.verbose &&\n sandbox.log(\n `schedule(astro=${astroPattern.astro}, offset=${astroPattern.shift}) is tomorrow, waiting until ${date.toISOString()}`,\n 'info',\n );\n\n // Calculate new schedule in the next day\n sandbox.setTimeout(() => {\n if (sandbox.__engine.__schedules > 0) {\n sandbox.__engine.__schedules--;\n }\n sandbox.schedule(astroPattern, callback);\n }, date.getTime() - Date.now());\n\n return;\n }\n\n sandbox.__engine.__schedules += 1;\n\n if (sandbox.__engine.__schedules % adapterConfig.maxTriggersPerScript === 0) {\n sandbox.log(\n `More than ${sandbox.__engine.__schedules} schedules registered. Check your script!`,\n 'warn',\n );\n }\n\n sandbox.setTimeout(() => {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n // Reschedule in 2 seconds\n sandbox.setTimeout(() => {\n if (sandbox.__engine.__schedules > 0) {\n sandbox.__engine.__schedules--;\n }\n sandbox.schedule(astroPattern, callback);\n }, 2000);\n }, ts.getTime() - Date.now());\n\n sandbox.verbose &&\n sandbox.log(\n `schedule(astro=${astroPattern.astro}, offset=${astroPattern.shift}) is today, waiting until ${ts.toISOString()}`,\n 'info',\n );\n } else {\n // fix a problem with sunday and 7\n if (typeof pattern === 'string') {\n // this could be a CRON\n const parts = pattern.replace(/\\s+/g, ' ').split(' ');\n if (parts.length >= 5 && parseInt(parts[5], 10) >= 7) {\n parts[5] = '0';\n }\n pattern = parts.join(' ');\n }\n // created in VM the date object: pattern instanceof Date => false\n // so fix it\n if (typeof pattern === 'object' && (pattern as Date).getDate) {\n pattern = new Date(pattern as Date);\n }\n\n const schedule: IobSchedule = mods.nodeSchedule.scheduleJob(pattern, (): void => {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n });\n if (schedule) {\n sandbox.__engine.__schedules += 1;\n\n if (\n sandbox.__engine.__schedules %\n (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__schedules} schedules registered. Check your script!`,\n 'warn',\n );\n }\n\n schedule._ioBroker = {\n type: 'cron',\n pattern: pattern as string | Date,\n scriptName: sandbox.scriptName,\n id: `cron_${Date.now()}_${Math.round(Math.random() * 100000)}`,\n };\n\n script.schedules.push(schedule);\n } else {\n sandbox.log(`schedule(cron=${JSON.stringify(pattern)}): cannot create schedule`, 'error');\n }\n\n if (sandbox.verbose) {\n sandbox.log(`schedule(cron=${JSON.stringify(pattern)})`, 'info');\n }\n\n return schedule;\n }\n },\n scheduleById: function (id: string, ack: boolean | (() => void) | undefined, callback?: () => void): void {\n let scheduleId: IobSchedule | string | null | undefined = null;\n let currentExp: string | null = null; // current cron expression\n\n if (typeof ack === 'function') {\n callback = ack;\n ack = undefined;\n }\n\n const rhms = /^(2[0-3]|[01]?[0-9]):([0-5]?[0-9]):([0-5]?[0-9])$/; // hh:mm:ss\n const rhm = /^(2[0-3]|[01]?[0-9]):([0-5]?[0-9])$/; // hh:mm\n\n const init = (time: string): void => {\n if (typeof time === 'string') {\n let h: number | undefined = undefined;\n let m: number | undefined = undefined;\n let s: number | undefined = undefined;\n\n let isValid = false;\n\n let result = time.match(rhms);\n if (result) {\n [, h, m, s] = result.map(v => parseInt(v));\n isValid = true;\n } else {\n result = time.match(rhm);\n if (result) {\n [, h, m] = result.map(v => parseInt(v));\n isValid = true;\n }\n }\n\n if (isValid) {\n const cronExp = `${s ?? '0'} ${m ?? '0'} ${h ?? '0'} * * *`;\n\n if (cronExp !== currentExp) {\n sandbox.verbose &&\n sandbox.log(\n `scheduleById(id=${id}): Init with expression ${cronExp} from ${time}`,\n 'info',\n );\n currentExp = cronExp;\n\n if (scheduleId) {\n sandbox.clearSchedule(scheduleId);\n scheduleId = null;\n }\n\n scheduleId = sandbox.schedule(cronExp, () => {\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n });\n }\n } else {\n sandbox.log(\n `scheduleById(id=${id},time=${time}): cannot create schedule - invalid format (HH:MM:SS or H:M:S required)`,\n 'error',\n );\n }\n } else {\n sandbox.log(\n `scheduleById(id=${id}): cannot create schedule - invalid var type (no string)`,\n 'error',\n );\n }\n };\n\n sandbox.getState(id, (err, state) => {\n if (!err && state?.val) {\n if (sandbox.verbose) {\n sandbox.log(`scheduleById(id=${id}): Init with value ${state.val}`, 'info');\n }\n init(state.val.toString());\n }\n });\n\n const triggerDef: Pattern = { id, change: 'any' };\n if (ack !== undefined) {\n triggerDef.ack = ack;\n }\n\n sandbox.on(triggerDef, obj => {\n if (obj?.state?.val) {\n sandbox.verbose &&\n sandbox.log(`scheduleById(id=${id}): Update with value ${obj.state.val}`, 'info');\n init(obj.state.val.toString());\n }\n });\n },\n getAstroDate: function (pattern: AstroEvent, date?: Date | number, offsetMinutes?: number): Date | undefined {\n if (date === undefined) {\n date = new Date();\n }\n if (typeof date === 'number') {\n date = new Date(date);\n } else {\n date = new Date(date.getTime());\n }\n\n if (!consts.astroList.includes(pattern)) {\n const pos = consts.astroListLow.indexOf(pattern.toLowerCase());\n if (pos !== -1) {\n pattern = consts.astroList[pos];\n }\n }\n\n if (\n (!(adapter.config as JavaScriptAdapterConfig).latitude &&\n ((adapter.config as JavaScriptAdapterConfig).latitude as unknown as number) !== 0) ||\n (!(adapter.config as JavaScriptAdapterConfig).longitude &&\n ((adapter.config as JavaScriptAdapterConfig).longitude as unknown as number) !== 0)\n ) {\n sandbox.log('Longitude or latitude does not set. Cannot use astro.', 'error');\n return;\n }\n\n // ensure events are calculated independent of current time\n date.setHours(12, 0, 0, 0);\n let ts = mods.suncalc.getTimes(\n date,\n (adapter.config as JavaScriptAdapterConfig).latitude,\n (adapter.config as JavaScriptAdapterConfig).longitude,\n )[pattern];\n\n if (ts === undefined || ts.getTime().toString() === 'NaN') {\n sandbox.log(\n `Cannot calculate astro date \"${pattern}\" for ${(adapter.config as JavaScriptAdapterConfig).latitude}, ${(adapter.config as JavaScriptAdapterConfig).longitude}`,\n 'warn',\n );\n }\n\n if (sandbox.verbose) {\n sandbox.log(`getAstroDate(pattern=${pattern}, date=${date.toString()}) => ${ts}`, 'info');\n }\n\n if (offsetMinutes !== undefined) {\n ts = new Date(ts.getTime() + offsetMinutes * 60000);\n }\n return ts;\n },\n isAstroDay: function (): boolean | undefined {\n const nowDate = new Date();\n const dayBegin = sandbox.getAstroDate('sunrise');\n const dayEnd = sandbox.getAstroDate('sunset');\n\n if (dayBegin === undefined || dayEnd === undefined) {\n return;\n }\n\n if (sandbox.verbose) {\n sandbox.log(`isAstroDay() => ${nowDate >= dayBegin && nowDate <= dayEnd}`, 'info');\n }\n\n return nowDate >= dayBegin && nowDate <= dayEnd;\n },\n clearSchedule: function (schedule: IobSchedule | ScheduleName | string): boolean {\n if (context.scheduler?.get(schedule as string | ScheduleName)) {\n if (sandbox.verbose) {\n sandbox.log('clearSchedule() => wizard cleared', 'info');\n }\n const pos = script.wizards.indexOf(schedule as string);\n if (pos !== -1) {\n script.wizards.splice(pos, 1);\n if (sandbox.__engine.__schedules > 0) {\n sandbox.__engine.__schedules--;\n }\n }\n context.scheduler.remove(schedule as string | ScheduleName);\n return true;\n }\n for (let i = 0; i < script.schedules.length; i++) {\n if (schedule && typeof schedule === 'object' && (schedule as IobSchedule)._ioBroker?.type === 'cron') {\n if (script.schedules[i]._ioBroker.id === (schedule as IobSchedule)._ioBroker.id) {\n if (!mods.nodeSchedule.cancelJob(script.schedules[i])) {\n sandbox.log('Error by canceling scheduled job', 'error');\n }\n script.schedules.splice(i, 1);\n if (sandbox.__engine.__schedules > 0) {\n sandbox.__engine.__schedules--;\n }\n\n if (sandbox.verbose) {\n sandbox.log('clearSchedule() => cleared', 'info');\n }\n return true;\n }\n } else if (script.schedules[i] === schedule) {\n if (!mods.nodeSchedule.cancelJob(script.schedules[i])) {\n sandbox.log('Error by canceling scheduled job', 'error');\n }\n script.schedules.splice(i, 1);\n if (sandbox.__engine.__schedules > 0) {\n sandbox.__engine.__schedules--;\n }\n\n if (sandbox.verbose) {\n sandbox.log('clearSchedule() => cleared', 'info');\n }\n return true;\n }\n }\n\n if (sandbox.verbose) {\n sandbox.log('clearSchedule() => invalid handler', 'warn');\n }\n return false;\n },\n getSchedules: function (allScripts?: boolean): ScheduleName[] {\n const schedules = context.scheduler?.getList() || [];\n if (allScripts) {\n Object.keys(context.scripts).forEach(\n name =>\n context.scripts[name].schedules &&\n context.scripts[name].schedules.forEach(s =>\n schedules.push(JSON.parse(JSON.stringify(s._ioBroker))),\n ),\n );\n } else {\n script.schedules &&\n script.schedules.forEach(s => schedules.push(JSON.parse(JSON.stringify(s._ioBroker))));\n }\n return schedules;\n },\n setState: function (\n id: string,\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean | 'true' | 'false' | ((err?: Error | null) => void),\n callback?: (err?: Error | null) => void,\n ): void {\n return setStateHelper(sandbox, false, false, id, state, isAck, callback);\n },\n setStateChanged: function (\n id: string,\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean | ((err?: Error | null) => void),\n callback?: (err?: Error | null) => void,\n ): void {\n return setStateHelper(sandbox, false, true, id, state, isAck, callback);\n },\n setStateDelayed: function (\n id: string,\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck: boolean | number | undefined,\n delay?: number | boolean,\n clearRunning?: boolean | ((err?: Error | null) => void),\n callback?: (err?: Error | null) => void,\n ): number | null {\n // find arguments\n if (typeof isAck !== 'boolean') {\n callback = clearRunning as (err?: Error | null) => void;\n clearRunning = delay as boolean;\n delay = isAck as number;\n isAck = undefined;\n }\n if (typeof delay !== 'number') {\n callback = clearRunning as (err?: Error | null) => void;\n clearRunning = delay as boolean;\n delay = 0;\n }\n if (typeof clearRunning !== 'boolean') {\n callback = clearRunning;\n clearRunning = true;\n }\n\n // Check a type of state\n if (!objects[id] && objects[`${adapter.namespace}.${id}`]) {\n id = `${adapter.namespace}.${id}`;\n }\n\n sandbox.verbose &&\n sandbox.log(\n `setStateDelayed(id=${id}, state=${JSON.stringify(state)}, isAck=${isAck}, delay=${delay}, clearRunning=${clearRunning})`,\n 'info',\n );\n\n if (clearRunning) {\n if (timers[id]) {\n sandbox.verbose &&\n sandbox.log(`setStateDelayed: clear ${timers[id].length} running timers`, 'info');\n\n for (let i = 0; i < timers[id].length; i++) {\n clearTimeout(timers[id][i].t);\n }\n delete timers[id];\n } else {\n if (sandbox.verbose) {\n sandbox.log('setStateDelayed: no running timers', 'info');\n }\n }\n }\n // If no delay => starts immediately\n if (!delay) {\n sandbox.setState(id, state, isAck, callback);\n return null;\n }\n // If delay\n timers[id] = timers[id] || [];\n\n // calculate timerId\n context.timerId++;\n if (context.timerId > 0xfffffffe) {\n context.timerId = 0;\n }\n\n // Start timeout\n const timer = setTimeout(\n function (_timerId, _id, _state, _isAck) {\n sandbox.setState(_id, _state, _isAck, callback);\n // delete timer handler\n if (timers[_id]) {\n // optimisation\n if (timers[_id].length === 1) {\n delete timers[_id];\n } else {\n for (let t = 0; t < timers[_id].length; t++) {\n if (timers[_id][t].id === _timerId) {\n timers[_id].splice(t, 1);\n break;\n }\n }\n if (!timers[_id].length) {\n delete timers[_id];\n }\n }\n }\n },\n delay,\n context.timerId,\n id,\n state,\n isAck,\n );\n\n // add timer handler\n timers[id].push({\n t: timer,\n id: context.timerId,\n ts: Date.now(),\n delay: delay,\n val:\n isObject(state) && (state as ioBroker.SettableState).val !== undefined\n ? ((state as ioBroker.SettableState).val as ioBroker.StateValue)\n : (state as ioBroker.StateValue),\n ack:\n isObject(state) &&\n (state as ioBroker.SettableState).val !== undefined &&\n (state as ioBroker.SettableState).ack !== undefined\n ? (state as ioBroker.SettableState).ack\n : isAck,\n });\n\n return context.timerId;\n },\n clearStateDelayed: function (id: string, timerId: number): boolean {\n // Check a type of state\n if (!objects[id] && objects[`${adapter.namespace}.${id}`]) {\n id = `${adapter.namespace}.${id}`;\n }\n\n if (sandbox.verbose) {\n sandbox.log(`clearStateDelayed(id=${id}, timerId=${timerId})`, 'info');\n }\n\n if (timers[id]) {\n for (let i = timers[id].length - 1; i >= 0; i--) {\n if (timerId === undefined || timers[id][i].id === timerId) {\n clearTimeout(timers[id][i].t);\n if (timerId !== undefined) {\n timers[id].splice(i, 1);\n }\n if (sandbox.verbose) {\n sandbox.log(`clearStateDelayed: clear timer ${timers[id][i].id}`, 'info');\n }\n }\n }\n if (timerId === undefined) {\n delete timers[id];\n } else {\n if (!timers[id].length) {\n delete timers[id];\n }\n }\n return true;\n }\n return false;\n },\n getStateDelayed: function (\n id: string | number,\n ):\n | null\n | { timerId: number; left: number; delay: number; val: ioBroker.StateValue; ack?: boolean }\n | { timerId: number; left: number; delay: number; val: ioBroker.StateValue; ack?: boolean }[]\n | Record<\n string,\n { timerId: number; left: number; delay: number; val: ioBroker.StateValue; ack?: boolean }[]\n > {\n const now = Date.now();\n if (id) {\n // Check a type of state\n if (!objects[id] && objects[`${adapter.namespace}.${id}`]) {\n id = `${adapter.namespace}.${id}`;\n }\n // If timerId given\n if (typeof id === 'number') {\n for (const _id_ in timers) {\n if (Object.prototype.hasOwnProperty.call(timers, _id_)) {\n for (let ttt = 0; ttt < timers[_id_].length; ttt++) {\n if (timers[_id_][ttt].id === id) {\n return {\n timerId: id,\n left: timers[_id_][ttt].delay - (now - timers[_id_][ttt].ts),\n delay: timers[_id_][ttt].delay,\n val: timers[_id_][ttt].val,\n ack: timers[_id_][ttt].ack,\n };\n }\n }\n }\n }\n return null;\n }\n\n const result: {\n timerId: number;\n left: number;\n delay: number;\n val: ioBroker.StateValue;\n ack?: boolean;\n }[] = [];\n if (Object.prototype.hasOwnProperty.call(timers, id) && timers[id] && timers[id].length) {\n for (let tt = 0; tt < timers[id].length; tt++) {\n result.push({\n timerId: timers[id][tt].id,\n left: timers[id][tt].delay - (now - timers[id][tt].ts),\n delay: timers[id][tt].delay,\n val: timers[id][tt].val,\n ack: timers[id][tt].ack,\n });\n }\n }\n return result;\n }\n const result: Record<\n string,\n { timerId: number; left: number; delay: number; val: ioBroker.StateValue; ack?: boolean }[]\n > = {};\n for (const _id in timers) {\n if (Object.prototype.hasOwnProperty.call(timers, _id) && timers[_id] && timers[_id].length) {\n result[_id] = [];\n for (let t = 0; t < timers[_id].length; t++) {\n result[_id].push({\n timerId: timers[_id][t].id,\n left: timers[_id][t].delay - (now - timers[_id][t].ts),\n delay: timers[_id][t].delay,\n val: timers[_id][t].val,\n ack: timers[_id][t].ack,\n });\n }\n }\n }\n return result;\n },\n getStateAsync: async function (id: string): Promise {\n let state: ioBroker.State | null | undefined;\n if (id.includes('.')) {\n state = await adapter.getForeignStateAsync(id);\n } else {\n state = await adapter.getStateAsync(id);\n }\n return context.convertBackStringifiedValues(id, state);\n },\n setStateAsync: function (\n id: string,\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean,\n ): Promise {\n return new Promise((resolve, reject) =>\n setStateHelper(sandbox, false, false, id, state, isAck, err => (err ? reject(err) : resolve())),\n );\n },\n setStateChangedAsync: function (\n id: string,\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean,\n ): Promise {\n return new Promise((resolve, reject) =>\n setStateHelper(sandbox, false, true, id, state, isAck, err => (err ? reject(err) : resolve())),\n );\n },\n getState: function (\n id: string,\n callback?: (err: Error | null | undefined, state?: ioBroker.State | null) => void,\n ): undefined | void | (ioBroker.State & { notExist?: true }) | null {\n if (typeof id !== 'string') {\n sandbox.log(`getState has been called with id of type \"${typeof id}\" but expects a string`, 'error');\n return undefined;\n }\n\n if (typeof callback === 'function') {\n if (!id.includes('.')) {\n adapter.getState(id, (err, state) =>\n callback(err, context.convertBackStringifiedValues(id, state)),\n );\n } else {\n void adapter.getForeignState(id, (err, state) =>\n callback(err, context.convertBackStringifiedValues(id, state)),\n );\n }\n } else {\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n sandbox.log(\n 'The \"getState\" method cannot be used synchronously, because the adapter setting \"Do not subscribe to all states on start\" is enabled.',\n 'error',\n );\n sandbox.log(\n `Please disable that setting or use \"getState\" with a callback, e.g.: getState('${id}', (err, state) => { ... });`,\n 'error',\n );\n } else {\n if (states[id]) {\n sandbox.verbose &&\n sandbox.log(\n `getState(id=${id}, timerId=${JSON.stringify(timers[id])}) => ${JSON.stringify(states[id])}`,\n 'info',\n );\n if (context.interimStateValues[id] !== undefined) {\n return context.convertBackStringifiedValues(id, context.interimStateValues[id]);\n }\n return context.convertBackStringifiedValues(id, states[id]);\n } else if (states[`${adapter.namespace}.${id}`]) {\n sandbox.verbose &&\n sandbox.log(\n `getState(id=${id}, timerId=${JSON.stringify(timers[id])}) => ${JSON.stringify(states[`${adapter.namespace}.${id}`])}`,\n 'info',\n );\n if (context.interimStateValues[`${adapter.namespace}.${id}`] !== undefined) {\n return context.convertBackStringifiedValues(\n id,\n context.interimStateValues[`${adapter.namespace}.${id}`],\n );\n }\n return context.convertBackStringifiedValues(id, states[`${adapter.namespace}.${id}`]);\n }\n\n if (sandbox.verbose) {\n sandbox.log(`getState(id=${id}, timerId=${JSON.stringify(timers[id])}) => not found`, 'info');\n }\n\n context.logWithLineInfo(\n `getState \"${id}\" not found (3)${states[id] !== undefined ? ` states[id]=${JSON.stringify(states[id])}` : ''}`,\n ); ///xxx\n return { val: null, notExist: true } as ioBroker.State & { notExist?: true };\n }\n }\n },\n existsState: function (\n id: string,\n callback?: (err: Error | null | undefined, stateExists?: boolean) => void,\n ): void | boolean {\n if (typeof id !== 'string') {\n sandbox.log(`existsState has been called with id of type \"${typeof id}\" but expects a string`, 'error');\n return false;\n }\n\n if (typeof callback === 'function') {\n void adapter.getForeignObject(id, (err, obj) => {\n if (!obj || obj.type !== 'state') {\n callback(err, false);\n return;\n }\n\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n void adapter.getForeignState(id, (err, state) => {\n callback(err, !!state);\n });\n } else {\n callback(err, !!states[id]);\n }\n });\n } else {\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n sandbox.log(\n 'The \"existsState\" method cannot be used synchronously, because the adapter setting \"Do not subscribe to all states on start\" is enabled.',\n 'error',\n );\n sandbox.log(\n `Please disable that setting or use \"existsState\" with a callback, e.g.: existsState('${id}', (err, stateExists) => { ... });`,\n 'error',\n );\n } else {\n return !!states[id];\n }\n }\n },\n existsObject: function (\n id: string,\n callback?: (err: Error | null | undefined, objectExists?: boolean) => void,\n ): void | boolean {\n if (typeof id !== 'string') {\n sandbox.log(\n `existsObject has been called with id of type \"${typeof id}\" but expects a string`,\n 'error',\n );\n return false;\n }\n\n if (typeof callback === 'function') {\n void adapter.getForeignObject(id, (err, obj) => callback(err, !!obj));\n } else {\n return !!objects[id];\n }\n },\n getIdByName: function (name: string, alwaysArray?: boolean): string | string[] | null {\n sandbox.verbose &&\n sandbox.log(\n `getIdByName(name=${name}, alwaysArray=${alwaysArray}) => ${JSON.stringify(context.names[name])}`,\n 'info',\n );\n if (Object.prototype.hasOwnProperty.call(context.names, name)) {\n if (alwaysArray) {\n return !Array.isArray(context.names[name]) ? [context.names[name]] : context.names[name];\n }\n return context.names[name];\n }\n if (alwaysArray) {\n return [];\n }\n return null;\n },\n getObject: function (\n id: string,\n enumName: null | string | ((err: Error | null | undefined, obj?: ioBroker.Object | null) => void),\n cb?: (err: Error | null | undefined, obj?: ioBroker.Object | null) => void,\n ): void | ioBroker.Object | null {\n if (typeof id !== 'string') {\n sandbox.log(`getObject has been called with id of type \"${typeof id}\" but expects a string`, 'error');\n return null;\n }\n\n if (typeof enumName === 'function') {\n cb = enumName;\n enumName = null;\n }\n // with callback\n if (typeof cb === 'function') {\n void adapter.getForeignObject(id, (err, obj) => {\n if (obj) {\n objects[id] = obj;\n } else if (objects[id]) {\n delete objects[id];\n }\n let result: ioBroker.Object | null | undefined;\n try {\n result = JSON.parse(JSON.stringify(objects[id]));\n } catch (err: unknown) {\n void adapter.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: true,\n ack: true,\n c: 'getObject',\n });\n sandbox.log(`Object \"${id}\" can't be copied: ${JSON.stringify(err)}`, 'error');\n return cb(null, null);\n }\n sandbox.verbose &&\n sandbox.log(`getObject(id=${id}, enumName=${enumName}) => ${JSON.stringify(result)}`, 'info');\n cb(err, result);\n });\n } else {\n if (!objects[id]) {\n sandbox.verbose &&\n sandbox.log(`getObject(id=${id}, enumName=${enumName}) => does not exist`, 'info');\n sandbox.log(`Object \"${id}\" does not exist`, 'warn');\n return null;\n }\n if (enumName) {\n const e = eventObj.getObjectEnumsSync(context, id);\n const obj = JSON.parse(JSON.stringify(objects[id]));\n obj.enumIds = JSON.parse(JSON.stringify(e.enumIds));\n obj.enumNames = JSON.parse(JSON.stringify(e.enumNames));\n if (typeof enumName === 'string') {\n const r = new RegExp(`^enum\\\\.${enumName}\\\\.`);\n for (let i = obj.enumIds.length - 1; i >= 0; i--) {\n if (!r.test(obj.enumIds[i])) {\n obj.enumIds.splice(i, 1);\n obj.enumNames.splice(i, 1);\n }\n }\n }\n sandbox.verbose &&\n sandbox.log(`getObject(id=${id}, enumName=${enumName}) => ${JSON.stringify(obj)}`, 'info');\n\n return obj;\n }\n let result: ioBroker.Object | null | undefined;\n try {\n result = JSON.parse(JSON.stringify(objects[id]));\n } catch (err: unknown) {\n void adapter.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: true,\n ack: true,\n c: 'getObject',\n });\n sandbox.log(`Object \"${id}\" can't be copied: ${JSON.stringify(err)}`, 'error');\n return null;\n }\n sandbox.verbose &&\n sandbox.log(`getObject(id=${id}, enumName=${enumName}) => ${JSON.stringify(result)}`, 'info');\n return result;\n }\n },\n // This function will be overloaded later if the modification of objects is allowed\n setObject: function (\n _id: string,\n _obj: ioBroker.Object,\n callback?: (err?: Error | null, res?: { id: string }) => void,\n ): void {\n sandbox.log('Function \"setObject\" is not allowed. Use adapter settings to allow it.', 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(\n sandbox,\n new Error('Function \"setObject\" is not allowed. Use adapter settings to allow it.'),\n );\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n },\n // This function will be overloaded later if the modification of objects is allowed\n extendObject: function (\n _id: string,\n _obj: Partial,\n callback?: (err?: Error | null, res?: { id: string }) => void,\n ): void {\n sandbox.log('Function \"extendObject\" is not allowed. Use adapter settings to allow it.', 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(\n sandbox,\n new Error('Function \"extendObject\" is not allowed. Use adapter settings to allow it.'),\n );\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n },\n // This function will be overloaded later if the modification of objects is allowed\n deleteObject: function (\n _id: string,\n _isRecursive?: boolean | ioBroker.ErrorCallback,\n callback?: ioBroker.ErrorCallback,\n ): void {\n if (typeof _isRecursive === 'function') {\n callback = _isRecursive;\n }\n sandbox.log('Function \"deleteObject\" is not allowed. Use adapter settings to allow it.', 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(\n sandbox,\n new Error('Function \"deleteObject\" is not allowed. Use adapter settings to allow it.'),\n );\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n },\n getEnums: function (enumName?: string): { id: string; members: string[]; name: ioBroker.StringOrTranslated }[] {\n const result: { id: string; members: string[]; name: ioBroker.StringOrTranslated }[] = [];\n const r = enumName ? new RegExp(`^enum\\\\.${enumName}\\\\.`) : false;\n for (let i = 0; i < enums.length; i++) {\n if (!r || r.test(enums[i])) {\n const common: ioBroker.EnumCommon =\n (objects[enums[i]] as ioBroker.EnumObject).common || ({} as ioBroker.EnumCommon);\n result.push({\n id: enums[i],\n members: common.members || [],\n name: common.name || '',\n });\n }\n }\n if (sandbox.verbose) {\n sandbox.log(`getEnums(enumName=${enumName}) => ${JSON.stringify(result)}`, 'info');\n }\n return JSON.parse(JSON.stringify(result));\n },\n createAlias: function (\n name: string,\n alias: string | CommonAlias,\n forceCreation: boolean | Partial | ((err: Error | null) => void) | undefined,\n common?: Partial | Record | ((err: Error | null) => void),\n native?: Record | ((err: Error | null) => void),\n callback?: (err: Error | null) => void,\n ) {\n if (typeof native === 'function') {\n callback = native as (err: Error | null) => void;\n native = {};\n }\n if (typeof common === 'function') {\n callback = common as (err: Error | null) => void;\n common = undefined;\n }\n if (typeof forceCreation === 'function') {\n callback = forceCreation as (err: Error | null) => void;\n forceCreation = undefined;\n }\n if (isObject(forceCreation)) {\n native = common;\n common = forceCreation as Partial;\n forceCreation = undefined;\n }\n\n if (typeof name !== 'string') {\n const err = `Wrong type of name \"${typeof name}\". Expected \"string\".`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n\n if (!name) {\n const err = 'Empty ID is not allowed.';\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n\n if (!name.startsWith('alias.0.')) {\n name = `alias.0.${name}`;\n }\n\n const _common: Partial = (common as Partial) || {};\n if (isObject(_common.alias)) {\n // alias already in common, use this\n } else if (\n isObject(alias) &&\n (typeof (alias as CommonAlias).id === 'string' || isObject((alias as CommonAlias).id))\n ) {\n _common.alias = alias as CommonAlias;\n } else if (typeof alias === 'string') {\n _common.alias = { id: alias };\n } else {\n const err = 'Source ID needs to be provided as string or object with id property.';\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n\n let aliasSourceId = '';\n if (_common.alias) {\n aliasSourceId = isObject(_common.alias.id)\n ? (_common.alias.id as { read: string; write: string }).read\n : (_common.alias.id as string);\n if (!objects[aliasSourceId] && objects[`${adapter.namespace}.${aliasSourceId}`]) {\n aliasSourceId = `${adapter.namespace}.${aliasSourceId}`;\n if (isObject(_common.alias.id)) {\n (_common.alias.id as { read: string; write: string }).read = aliasSourceId;\n } else {\n _common.alias.id = aliasSourceId;\n }\n }\n if (\n isObject(_common.alias.id) &&\n (_common.alias.id as { read: string; write: string }).write &&\n !objects[(_common.alias.id as { read: string; write: string }).write] &&\n objects[`${adapter.namespace}.${(_common.alias.id as { read: string; write: string }).write}`]\n ) {\n (_common.alias.id as { read: string; write: string }).write =\n `${adapter.namespace}.${(_common.alias.id as { read: string; write: string }).write}`;\n }\n }\n const obj = objects[aliasSourceId];\n if (!obj) {\n const err = `Alias source object \"${aliasSourceId}\" does not exist.`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n if (obj.type !== 'state') {\n const err = `Alias source object \"${aliasSourceId}\" must be a state object.`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n if (_common.name === undefined) {\n _common.name = obj.common.name || name;\n }\n if (_common.type === undefined && obj.common.type !== undefined) {\n _common.type = obj.common.type;\n }\n if (_common.role === undefined && obj.common.role !== undefined) {\n _common.role = obj.common.role;\n }\n if (_common.min === undefined && obj.common.min !== undefined) {\n _common.min = obj.common.min;\n }\n if (_common.max === undefined && obj.common.max !== undefined) {\n _common.max = obj.common.max;\n }\n if (_common.step === undefined && obj.common.step !== undefined) {\n _common.step = obj.common.step;\n }\n if (_common.unit === undefined && obj.common.unit !== undefined) {\n _common.unit = obj.common.unit;\n }\n if (_common.desc === undefined && obj.common.desc !== undefined) {\n _common.desc = obj.common.desc;\n }\n\n return sandbox.createState(\n name,\n undefined,\n forceCreation as boolean,\n _common,\n native,\n callback as (err?: Error | null) => void,\n );\n },\n createState: async function (\n name: string,\n initValue: undefined | ioBroker.StateValue | ioBroker.State,\n forceCreation:\n | boolean\n | undefined\n | Record\n | Partial\n | ((err: Error | null) => void),\n common?: Partial | ((err: Error | null) => void),\n native?: Record | ((err: Error | null) => void),\n callback?: (error: Error | null | undefined, id?: string) => void,\n ) {\n if (typeof native === 'function') {\n callback = native as (err?: Error | null) => void;\n native = {};\n }\n if (typeof common === 'function') {\n callback = common as (err?: Error | null) => void;\n common = undefined;\n }\n if (typeof initValue === 'function') {\n callback = initValue as (err?: Error | null) => void;\n initValue = undefined;\n }\n if (typeof forceCreation === 'function') {\n callback = forceCreation as (err?: Error | null) => void;\n forceCreation = undefined;\n }\n if (isObject(initValue)) {\n common = initValue as Partial;\n native = forceCreation as Record;\n forceCreation = undefined;\n initValue = undefined;\n }\n if (isObject(forceCreation)) {\n native = common as Record;\n common = forceCreation as Partial;\n forceCreation = undefined;\n }\n\n if (typeof name !== 'string') {\n const err = `Wrong type of name \"${typeof name}\". Expected \"string\".`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n\n if (!name) {\n const err = 'Empty ID is not allowed.';\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n\n const isAlias = name.startsWith('alias.0.');\n\n const _common: ioBroker.StateCommon = (common || {}) as ioBroker.StateCommon;\n _common.name = _common.name || name;\n _common.role = _common.role || 'state';\n _common.type = _common.type || 'mixed';\n if (!isAlias && initValue === undefined) {\n initValue = _common.def;\n }\n\n native = native || {};\n\n // Check min, max and def values for number\n if (_common.type !== undefined && _common.type === 'number') {\n let min = 0;\n let max = 0;\n let def = 0;\n let err: string | undefined;\n if (_common.min !== undefined) {\n min = _common.min;\n if (typeof min !== 'number') {\n min = parseFloat(min);\n if (isNaN(min)) {\n err = `Wrong type of ${name}.common.min`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n _common.min = min;\n }\n }\n if (_common.max !== undefined) {\n max = _common.max;\n if (typeof max !== 'number') {\n max = parseFloat(max);\n if (isNaN(max)) {\n err = `Wrong type of ${name}.common.max`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n _common.max = max;\n }\n }\n\n if (_common.def !== undefined) {\n if (isAlias) {\n delete _common.def;\n } else {\n def = _common.def;\n if (typeof def !== 'number') {\n def = parseFloat(def);\n if (isNaN(def)) {\n err = `Wrong type of ${name}.common.def`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n _common.def = def;\n }\n }\n }\n\n if (_common.min !== undefined && _common.max !== undefined && min > max) {\n _common.max = min;\n _common.min = max;\n }\n if (_common.def !== undefined && _common.min !== undefined && def < min) {\n _common.def = min;\n }\n if (_common.def !== undefined && _common.max !== undefined && def > max) {\n _common.def = max;\n }\n }\n\n if (sandbox.verbose) {\n sandbox.log(\n `createState(name=${name}, initValue=${JSON.stringify(initValue)}, forceCreation=${JSON.stringify(forceCreation)}, common=${JSON.stringify(common)}, native=${JSON.stringify(native)}, isAlias=${isAlias})`,\n 'debug',\n );\n }\n\n let id = `${adapter.namespace}.${name}`;\n if (name.match(/^javascript\\.\\d+\\./) || name.startsWith('0_userdata.0.') || isAlias) {\n id = name;\n }\n if (id.match(/^javascript\\.\\d+\\.scriptEnabled/)) {\n sandbox.log(\n `Own states (${id}) should not be created in javascript.X.scriptEnabled.*! Please move the states to 0_userdata.0.*`,\n 'info',\n );\n } else if (id.match(/^javascript\\.\\d+\\.scriptProblem/)) {\n sandbox.log(\n `Own states (${id}) should not be created in javascript.X.scriptProblem.*! Please move the states to 0_userdata.0.*`,\n 'info',\n );\n }\n\n // User can create aliases by two ways:\n // - id is starting with \"alias.0.\" and common.alias.id is set, so the state defined in common.alias.id will be created automatically if not exists\n // - id is not starting with \"alias.0.\", but common.alias is set, so the state defined in common.alias will be created automatically if not exists\n if (!isAlias && _common.alias) {\n // check and create if not exists the alias\n let alias: CommonAlias;\n if (typeof _common.alias === 'string') {\n alias = {\n id: _common.alias,\n };\n } else if (typeof _common.alias === 'boolean') {\n const parts = id.split('.');\n parts[0] = 'alias';\n parts[1] = '0';\n\n alias = {\n id: parts.join('.'),\n };\n } else {\n alias = _common.alias;\n }\n delete _common.alias;\n\n if (!(alias.id as string).startsWith('alias.0.')) {\n alias.id = `alias.0.${alias.id as string}`;\n }\n\n let aObj: ioBroker.StateObject | null | undefined;\n try {\n aObj = (await adapter.getForeignObjectAsync(alias.id as string)) as\n | ioBroker.StateObject\n | null\n | undefined;\n } catch {\n // ignore\n }\n if (!aObj) {\n try {\n const _obj: ioBroker.StateObject = {\n _id: alias.id as string,\n type: 'state',\n common: {\n name: `Alias to ${id}`,\n role: 'state',\n type: _common.type,\n read: _common.read,\n write: _common.write,\n unit: _common.unit,\n alias: {\n id,\n read: alias.read,\n write: alias.write,\n },\n },\n native: {},\n };\n\n await adapter.setForeignObjectAsync(alias.id as string, _obj);\n } catch (err: unknown) {\n sandbox.log(`Cannot create alias \"${alias.id as string}\": ${err as Error}`, 'error');\n }\n }\n } else if (isAlias && _common.alias) {\n if (typeof _common.alias === 'string') {\n _common.alias = {\n id: _common.alias,\n };\n }\n const readId = typeof _common.alias.id === 'string' ? _common.alias.id : _common.alias.id.read;\n let writeId: string | undefined =\n typeof _common.alias.id === 'string' ? _common.alias.id : _common.alias.id.write;\n if (writeId === readId) {\n writeId = undefined;\n }\n // try to create the linked states\n let aObj: ioBroker.StateObject | null | undefined;\n try {\n aObj = (await adapter.getForeignObjectAsync(readId)) as ioBroker.StateObject | null | undefined;\n } catch {\n // ignore\n }\n if (!aObj) {\n try {\n await adapter.setForeignObjectAsync(readId, {\n type: 'state',\n common: {\n name: `State for ${id}`,\n role: 'state',\n type: _common.type,\n read: _common.read,\n write: _common.write,\n unit: _common.unit,\n },\n native: {},\n });\n } catch (err: unknown) {\n sandbox.log(`Cannot create alias \"${readId}\": ${err as Error}`, 'error');\n }\n }\n if (writeId && _common.write !== false) {\n try {\n aObj = (await adapter.getForeignObjectAsync(writeId)) as\n | ioBroker.StateObject\n | null\n | undefined;\n } catch {\n // ignore\n }\n if (!aObj) {\n try {\n await adapter.setForeignObjectAsync(writeId, {\n type: 'state',\n common: {\n name: `Write state for ${id}`,\n role: 'state',\n type: _common.type,\n read: _common.read,\n write: _common.write,\n unit: _common.unit,\n },\n native: {},\n });\n } catch (err: unknown) {\n sandbox.log(`Cannot create alias \"${writeId}\": ${err as Error}`, 'error');\n }\n }\n }\n }\n\n let obj: ioBroker.Object | null | undefined;\n try {\n obj = await adapter.getForeignObjectAsync(id);\n } catch {\n // ignore\n }\n\n if (\n obj?._id &&\n validIdForAutomaticFolderCreation(obj._id) &&\n obj.type === 'folder' &&\n obj.native &&\n obj.native.autocreated === 'by automatic ensure logic'\n ) {\n // ignore a default created object because we now have a better defined one\n obj = null;\n }\n\n if (!obj || forceCreation) {\n // create new one\n const newObj: ioBroker.StateObject = {\n _id: id,\n common: _common,\n native,\n type: 'state',\n };\n try {\n await adapter.setForeignObjectAsync(id, newObj);\n } catch (err: unknown) {\n sandbox.log(`Cannot set object \"${id}\": ${err as Error}`, 'warn');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, err as Error);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n\n // Update meta objects\n context.updateObjectContext(id, newObj);\n\n if (!isAlias && initValue !== undefined) {\n if (isObject(initValue) && (initValue as ioBroker.State).ack !== undefined) {\n setStateHelper(sandbox, true, false, id, initValue, callback);\n } else {\n setStateHelper(sandbox, true, false, id, initValue, true, callback);\n }\n } else if (!isAlias && !forceCreation) {\n setStateHelper(sandbox, true, false, id, null, callback);\n } else if (isAlias) {\n try {\n const state = await adapter.getForeignStateAsync(id);\n if (state) {\n states[id] = state;\n }\n } catch {\n // ignore\n }\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, null, id);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n } else if (typeof callback === 'function') {\n try {\n callback.call(sandbox, null, id);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n await ensureObjectStructure(id);\n } else {\n // state yet exists\n if (\n !(adapter.config as JavaScriptAdapterConfig).subscribe &&\n !states[id] &&\n states[`${adapter.namespace}.${id}`] === undefined\n ) {\n states[id] = {\n val: null,\n ack: true,\n lc: Date.now(),\n ts: Date.now(),\n q: 0,\n from: `system.adapter.${adapter.namespace}`,\n };\n }\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, null, id);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n\n await ensureObjectStructure(id);\n }\n },\n deleteState: function (id: string, callback?: (err: Error | null | undefined, found?: boolean) => void): void {\n // todo: check rights\n // todo: also remove from \"names\"\n\n if (sandbox.verbose) {\n sandbox.log(`deleteState(id=${id})`, 'debug');\n }\n\n let found = false;\n if ((id.startsWith('0_userdata.0.') || id.startsWith(adapter.namespace)) && objects[id]) {\n found = true;\n delete objects[id];\n if (states[id]) {\n delete states[id];\n }\n\n adapter.delForeignObject(id, function (err) {\n err && sandbox.log(`Object for state \"${id}\" does not exist: ${err}`, 'warn');\n\n adapter.delForeignState(id, function (err) {\n err && sandbox.log(`Cannot delete state \"${id}\": ${err}`, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, err, found);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n });\n });\n } else if (objects[`${adapter.namespace}.${id}`]) {\n delete objects[`${adapter.namespace}.${id}`];\n found = true;\n if (states[`${adapter.namespace}.${id}`]) {\n delete states[`${adapter.namespace}.${id}`];\n }\n\n adapter.delObject(id, function (err) {\n err && sandbox.log(`Object for state \"${id}\" does not exist: ${err}`, 'warn');\n\n adapter.delState(id, function (err) {\n err && sandbox.log(`Cannot delete state \"${id}\": ${err}`, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, err, found);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n });\n });\n } else {\n const err = 'Not found';\n sandbox.log(`Cannot delete state \"${id}\": ${err}`, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err), found);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n }\n },\n sendTo: function (\n _adapter: string,\n cmd: string,\n msg?: any,\n options?: Record | ((result: any, options: Record, _adapter: string) => void),\n callback?: (result: any, options: Record, _adapter: string) => void,\n ): void {\n const defaultTimeout = 20000;\n\n if (typeof options === 'function') {\n callback = options as (result: any, options: Record, _adapter: string) => void;\n options = { timeout: defaultTimeout };\n }\n\n let timeout: NodeJS.Timeout | null = null;\n if (typeof callback === 'function') {\n const timeoutDuration = parseInt(options?.timeout, 10) || defaultTimeout;\n\n timeout = setTimeout(() => {\n timeout = null;\n\n if (sandbox.verbose) {\n sandbox.log(`sendTo => timeout: ${timeoutDuration}`, 'debug');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, { error: 'timeout' }, options as Record, _adapter);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n callback = undefined;\n }\n }, timeoutDuration);\n }\n\n let cbFunc: undefined | ((result: any) => void);\n if (timeout) {\n cbFunc = function (result: any): void {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n\n if (sandbox.verbose && result) {\n sandbox.log(`sendTo => ${JSON.stringify(result)}`, 'debug');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, result, options as Record, _adapter);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n callback = undefined;\n }\n };\n }\n\n // If specific instance\n if (_adapter.match(/\\.[0-9]+$/)) {\n sandbox.verbose &&\n sandbox.log(\n `sendTo(instance=${_adapter}, cmd=${cmd}, msg=${JSON.stringify(msg)}, hasCallback=${typeof callback === 'function'})`,\n 'info',\n );\n\n adapter.sendTo(_adapter, cmd, msg, cbFunc, options);\n } else {\n // Send it to all instances\n context.adapter.getObjectView(\n 'system',\n 'instance',\n { startkey: `system.adapter.${_adapter}.`, endkey: `system.adapter.${_adapter}.\\u9999` },\n options,\n (err, res) => {\n if (err || !res) {\n sandbox.log(`sendTo failed: ${err?.message}`, 'error');\n return;\n }\n\n const instances = res.rows.map(item => item.id.substring('system.adapter.'.length));\n\n instances.forEach(instance => {\n sandbox.verbose &&\n sandbox.log(\n `sendTo(instance=${instance}, cmd=${cmd}, msg=${JSON.stringify(msg)}, hasCallback=${typeof callback === 'function'})`,\n 'info',\n );\n adapter.sendTo(instance, cmd, msg, cbFunc, options);\n });\n },\n );\n }\n },\n sendto: function (\n _adapter: string,\n cmd: string,\n msg: any,\n callback?: (result: any, options: Record, _adapter: string) => void,\n ): void {\n return sandbox.sendTo(_adapter, cmd, msg, callback);\n },\n sendToAsync: function (_adapter: string, cmd: string, msg?: any, options?: Record): Promise {\n return new Promise((resolve, reject) => {\n sandbox.sendTo(_adapter, cmd, msg, options, res => {\n if (!res || res.error) {\n reject(res ? new Error(res.error) : new Error('Unknown error'));\n } else {\n resolve(res);\n }\n });\n });\n },\n sendToHost: function (host: string, cmd: string, msg?: any, callback?: (result: any) => void): void {\n if (!(adapter.config as JavaScriptAdapterConfig).enableSendToHost) {\n const error =\n 'sendToHost is not available. Please enable \"Enable SendToHost\" option in instance settings';\n sandbox.log(error, 'error');\n\n if (typeof callback === 'function') {\n // leave it as a normal function and not as a lambda, to hide the \"this\" object\n setImmediate(function () {\n callback(error);\n });\n }\n } else {\n sandbox.verbose &&\n sandbox.log(`sendToHost(adapter=${host}, cmd=${cmd}, msg=${JSON.stringify(msg)})`, 'info');\n adapter.sendToHost(host, cmd, msg, callback);\n }\n },\n sendToHostAsync: function (host: string, cmd: string, msg?: any): Promise {\n return new Promise((resolve, reject) => {\n sandbox.sendToHost(host, cmd, msg, res => {\n if (!res || res.error) {\n reject(res ? new Error(res.error) : new Error('Unknown error'));\n } else {\n resolve(res);\n }\n });\n });\n },\n registerNotification: function (msg: string, isAlert?: boolean): void {\n const category = !isAlert ? 'scriptMessage' : 'scriptAlert';\n\n if (sandbox.verbose) {\n sandbox.log(`registerNotification(msg=${msg}, category=${category})`, 'info');\n }\n\n void adapter.registerNotification('javascript', category, msg);\n },\n setInterval: function (callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout | null {\n if (typeof callback === 'function') {\n const int: NodeJS.Timeout = setInterval(() => {\n try {\n callback.call(sandbox, ...args);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, ms);\n script.intervals.push(int);\n\n if (sandbox.verbose) {\n sandbox.log(`setInterval(ms=${ms})`, 'info');\n }\n return int;\n }\n sandbox.log(`Invalid callback for setInterval! - ${typeof callback}`, 'error');\n return null;\n },\n clearInterval: function (id: NodeJS.Timeout): void {\n const pos = script.intervals.indexOf(id);\n if (pos !== -1) {\n if (sandbox.verbose) {\n sandbox.log('clearInterval() => cleared', 'info');\n }\n clearInterval(id);\n script.intervals.splice(pos, 1);\n } else {\n if (sandbox.verbose) {\n sandbox.log('clearInterval() => not found', 'warn');\n }\n }\n },\n setTimeout: function (callback: (args?: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout | null {\n if (typeof callback === 'function') {\n const to = setTimeout(() => {\n // Remove timeout from the list\n const pos = script.timeouts.indexOf(to);\n if (pos !== -1) {\n script.timeouts.splice(pos, 1);\n }\n\n try {\n callback.call(sandbox, ...args);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, ms);\n if (sandbox.verbose) {\n sandbox.log(`setTimeout(ms=${ms})`, 'info');\n }\n\n script.timeouts.push(to);\n return to;\n }\n sandbox.log(`Invalid callback for setTimeout! - ${typeof callback}`, 'error');\n return null;\n },\n clearTimeout: function (id: NodeJS.Timeout): void {\n const pos = script.timeouts.indexOf(id);\n if (pos !== -1) {\n if (sandbox.verbose) {\n sandbox.log('clearTimeout() => cleared', 'info');\n }\n clearTimeout(id);\n script.timeouts.splice(pos, 1);\n } else {\n if (sandbox.verbose) {\n sandbox.log('clearTimeout() => not found', 'warn');\n }\n }\n },\n setImmediate: function (callback: (..._args: any[]) => void, ...args: any[]): void {\n if (typeof callback === 'function') {\n setImmediate(() => {\n try {\n callback.apply(sandbox, args);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n });\n if (sandbox.verbose) {\n sandbox.log('setImmediate()', 'info');\n }\n } else {\n sandbox.log(`Invalid callback for setImmediate! - ${typeof callback}`, 'error');\n }\n },\n cb: function (callback: (..._args: any[]) => void): (...args: any[]) => void {\n return function (args: any[]) {\n if (context.scripts[name]?._id === sandbox._id) {\n if (typeof callback === 'function') {\n try {\n callback.apply(sandbox, args);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n } else {\n sandbox.log(`Callback for old version of script: ${name}`, 'warn');\n }\n };\n },\n compareTime: function (\n startTime: iobJS.AstroDate | string | Date | number,\n endTime: iobJS.AstroDate | string | Date | number | null,\n operation: 'between' | 'not between' | '<' | '<=' | '>' | '>=' | '==' | '<>' | '!=',\n time?: iobJS.AstroDate | string | Date | number,\n ): boolean {\n if (startTime && typeof startTime === 'string') {\n const pos = consts.astroListLow.indexOf(startTime.toLowerCase());\n if (pos !== -1) {\n const aTime = sandbox.getAstroDate(consts.astroList[pos]);\n if (aTime) {\n startTime = aTime.toLocaleTimeString([], {\n hour: '2-digit',\n minute: '2-digit',\n hour12: false,\n });\n } else {\n startTime = 0;\n }\n }\n } else if (startTime && isObject(startTime) && (startTime as iobJS.AstroDate).astro) {\n const aTime = sandbox.getAstroDate(\n (startTime as iobJS.AstroDate).astro,\n (startTime as iobJS.AstroDate).date || new Date(),\n (startTime as iobJS.AstroDate).offset || 0,\n );\n if (aTime) {\n startTime = aTime.toLocaleTimeString([], {\n hour: '2-digit',\n minute: '2-digit',\n hour12: false,\n });\n } else {\n startTime = 0;\n }\n }\n\n if (endTime && typeof endTime === 'string') {\n const pos = consts.astroListLow.indexOf(endTime.toLowerCase());\n if (pos !== -1) {\n const aTime = sandbox.getAstroDate(consts.astroList[pos]);\n endTime =\n aTime?.toLocaleTimeString([], {\n hour: '2-digit',\n minute: '2-digit',\n hour12: false,\n }) || 0;\n }\n } else if (endTime && isObject(endTime) && (endTime as iobJS.AstroDate).astro) {\n const aTime = sandbox.getAstroDate(\n (endTime as iobJS.AstroDate).astro,\n (endTime as iobJS.AstroDate).date || new Date(),\n (endTime as iobJS.AstroDate).offset || 0,\n );\n endTime =\n aTime?.toLocaleTimeString([], {\n hour: '2-digit',\n minute: '2-digit',\n hour12: false,\n }) || 0;\n }\n\n // --- Convert \"time\" to number\n let nTime: number | undefined;\n // maybe it is astro date like 'sunrise' or 'sunset'\n if (time && typeof time === 'string') {\n const pos = consts.astroListLow.indexOf(time.toLowerCase());\n if (pos !== -1) {\n nTime = sandbox.getAstroDate(consts.astroList[pos])?.getTime() || 0;\n }\n } else if (time && isObject(time) && (time as iobJS.AstroDate).astro) {\n nTime =\n sandbox\n .getAstroDate(\n (time as iobJS.AstroDate).astro,\n (time as iobJS.AstroDate).date || new Date(),\n (time as iobJS.AstroDate).offset || 0,\n )\n ?.getTime() || 0;\n }\n\n let daily = true;\n if (time) {\n daily = false;\n }\n // if not astro date\n if (!nTime) {\n if (time && !isObject(time)) {\n if (typeof time === 'string' && !time.includes(' ') && !time.includes('T')) {\n const parts = time.split(':');\n const oTime = new Date();\n oTime.setHours(parseInt(parts[0], 10));\n oTime.setMinutes(parseInt(parts[1], 10));\n oTime.setMilliseconds(0);\n\n if (parts.length === 3) {\n oTime.setSeconds(parseInt(parts[2], 10));\n } else {\n oTime.setSeconds(0);\n }\n nTime = oTime.getTime();\n } else {\n nTime = new Date(time as string | number).getTime();\n }\n } else if (!time) {\n const oTime = new Date();\n oTime.setMilliseconds(0);\n nTime = oTime.getTime();\n } else {\n // If Date\n nTime = (time as Date).getTime();\n }\n }\n // --- End of conversion \"time\" to number\n if (typeof startTime === 'string') {\n if (!startTime.includes(' ') && !startTime.includes('T')) {\n const parts = startTime.split(':');\n startTime = new Date();\n startTime.setHours(parseInt(parts[0], 10));\n startTime.setMinutes(parseInt(parts[1], 10));\n startTime.setMilliseconds(0);\n\n if (parts.length === 3) {\n startTime.setSeconds(parseInt(parts[2], 10));\n } else {\n startTime.setSeconds(0);\n }\n } else {\n daily = false;\n startTime = new Date(startTime);\n }\n } else {\n daily = false;\n startTime = new Date(startTime as number | Date);\n }\n const nStartTime = startTime.getTime();\n\n let nEndTime: number | null;\n if (endTime && typeof endTime === 'string') {\n if (!endTime.includes(' ') && !endTime.includes('T')) {\n const parts = endTime.split(':');\n endTime = new Date();\n endTime.setHours(parseInt(parts[0], 10));\n endTime.setMinutes(parseInt(parts[1], 10));\n endTime.setMilliseconds(0);\n\n if (parts.length === 3) {\n endTime.setSeconds(parseInt(parts[2], 10));\n } else {\n endTime.setSeconds(0);\n }\n } else {\n daily = false;\n endTime = new Date(endTime);\n }\n } else if (endTime) {\n daily = false;\n endTime = new Date(endTime as number | Date);\n } else {\n endTime = null;\n }\n\n if (endTime) {\n nEndTime = endTime.getTime();\n } else {\n nEndTime = null;\n }\n\n if (operation === 'between') {\n if (nEndTime) {\n if (nStartTime > nEndTime && daily) {\n return !(nTime >= nEndTime && nTime < nStartTime);\n }\n return nTime >= nStartTime && nTime < nEndTime;\n }\n sandbox.log(`missing or unrecognized endTime expression: ${JSON.stringify(endTime)}`, 'warn');\n return false;\n }\n\n if (operation === 'not between') {\n if (nEndTime) {\n if (nStartTime > nEndTime && daily) {\n return nTime >= nEndTime && nTime < nStartTime;\n }\n return !(nTime >= nStartTime && nTime < nEndTime);\n }\n sandbox.log(`missing or unrecognized endTime expression: ${JSON.stringify(endTime)}`, 'warn');\n return false;\n }\n\n if (operation === '>') {\n return nTime > nStartTime;\n }\n if (operation === '>=') {\n return nTime >= nStartTime;\n }\n if (operation === '<') {\n return nTime < nStartTime;\n }\n if (operation === '<=') {\n return nTime <= nStartTime;\n }\n if (operation === '==') {\n return nTime === nStartTime;\n }\n if (operation === '<>' || operation === '!=') {\n return nTime !== nStartTime;\n }\n sandbox.log(`Invalid operator: ${operation as string}`, 'warn');\n return false;\n },\n onStop: function (cb: () => void, timeout?: number): void {\n if (sandbox.verbose) {\n sandbox.log(`onStop(timeout=${timeout})`, 'info');\n }\n\n script.onStopCb = cb;\n script.onStopTimeout = timeout || 1000;\n },\n formatValue: function (value: number | string, decimals: number | string, format?: string): string {\n if (typeof decimals === 'string') {\n format = decimals;\n decimals = 0;\n }\n if (!format) {\n if (adapter.isFloatComma !== undefined) {\n format = adapter.isFloatComma ? '.,' : ',.';\n } else if (objects['system.config'] && objects['system.config'].common) {\n format = objects['system.config'].common.isFloatComma ? '.,' : ',.';\n }\n }\n return adapter.formatValue(value, decimals, format);\n },\n formatDate: function (\n date: Date | string | number | iobJS.AstroDate,\n format?: string,\n language?: ioBroker.Languages,\n ): string {\n if (!format) {\n if (adapter.dateFormat) {\n format = adapter.dateFormat;\n } else {\n format =\n objects['system.config'] && objects['system.config'].common\n ? objects['system.config'].common.dateFormat || 'DD.MM.YYYY'\n : 'DD.MM.YYYY';\n }\n format = format || 'DD.MM.YYYY';\n }\n // maybe it is astro date like 'sunrise' or 'sunset'\n if (date && typeof date === 'string') {\n const pos = consts.astroListLow.indexOf(date.toLowerCase());\n if (pos !== -1) {\n date = sandbox.getAstroDate(consts.astroList[pos])?.getTime() || 0;\n }\n } else if (date && isObject(date) && (date as iobJS.AstroDate).astro) {\n date =\n sandbox\n .getAstroDate(\n (date as iobJS.AstroDate).astro,\n (date as iobJS.AstroDate).date || new Date(),\n (date as iobJS.AstroDate).offset || 0,\n )\n ?.getTime() || 0;\n }\n\n if (format.match(/[WНOО]+/)) {\n let text: string = adapter.formatDate(date as Date | string | number, format);\n if (!language || !consts.dayOfWeeksFull[language]) {\n language =\n adapter.language ||\n (objects['system.config'] &&\n objects['system.config'].common &&\n objects['system.config'].common.language) ||\n 'en';\n if (!consts.dayOfWeeksFull[language as ioBroker.Languages]) {\n language = 'en';\n }\n }\n if (typeof date === 'number' || typeof date === 'string') {\n date = new Date(date);\n } else if (typeof (date as Date).getMonth !== 'function') {\n sandbox.log(`Invalid date object provided: ${JSON.stringify(date)}`, 'error');\n return 'Invalid date';\n }\n const d: number = (date as Date).getDay();\n text = text.replace('НН', consts.dayOfWeeksFull[language as ioBroker.Languages][d]);\n let initialText = text;\n text = text.replace('WW', consts.dayOfWeeksFull[language as ioBroker.Languages][d]);\n\n if (initialText === text) {\n text = text.replace('W', consts.dayOfWeeksShort[language as ioBroker.Languages][d]);\n }\n\n text = text.replace('Н', consts.dayOfWeeksShort[language as ioBroker.Languages][d]);\n text = text.replace('Н', consts.dayOfWeeksShort[language as ioBroker.Languages][d]);\n const m: number = (date as Date).getMonth();\n initialText = text;\n text = text.replace('OOO', consts.monthFullGen[language as ioBroker.Languages][m]);\n text = text.replace('ООО', consts.monthFullGen[language as ioBroker.Languages][m]);\n text = text.replace('OO', consts.monthFull[language as ioBroker.Languages][m]);\n text = text.replace('ОО', consts.monthFull[language as ioBroker.Languages][m]);\n\n if (initialText === text) {\n text = text.replace('O', consts.monthShort[language as ioBroker.Languages][m]);\n }\n return text;\n }\n return adapter.formatDate(date as string | number | Date, format);\n },\n formatTimeDiff: function (diff: number, format?: string): string {\n if (!format) {\n format = 'hh:mm:ss';\n }\n\n let text = format;\n\n if (sandbox.verbose) {\n sandbox.log(`formatTimeDiff(format=${format}, diff=${diff})`, 'debug');\n }\n\n const second = 1000;\n const minute = 60 * second;\n const hour = 60 * minute;\n const day = 24 * hour;\n const neg = diff < 0;\n diff = Math.abs(diff);\n\n if (/(? void),\n callback?: (err?: Error | null) => void,\n ): void {\n if (typeof data === 'function' || !data) {\n callback = data as (err?: Error | null) => void;\n data = fileName;\n fileName = _adapter;\n _adapter = '0_userdata.0';\n }\n _adapter = _adapter || '0_userdata.0';\n\n if (debug) {\n sandbox.log(\n `writeFile(adapter=${_adapter}, fileName=${fileName}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n setTimeout(function (): void {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, 0);\n }\n } else {\n if (sandbox.verbose) {\n sandbox.log(`writeFile(adapter=${_adapter}, fileName=${fileName})`, 'info');\n }\n if (callback) {\n adapter.writeFile(_adapter, fileName, data, callback);\n } else {\n // @ts-expect-error should be fixed in js-controller\n adapter.writeFile(_adapter, fileName, data);\n }\n }\n },\n readFile: function (\n _adapter: string,\n fileName: string | ((err: Error | null | undefined, data?: Buffer | string, mimeType?: string) => void),\n callback?: (err: Error | null | undefined, data?: Buffer | string, mimeType?: string) => void,\n ): void {\n if (typeof fileName === 'function') {\n callback = fileName as (\n err: Error | null | undefined,\n data?: Buffer | string,\n mimeType?: string,\n ) => void;\n fileName = _adapter;\n _adapter = '0_userdata.0';\n }\n if (typeof callback !== 'function') {\n sandbox.log(`readFile(adapter=${_adapter}, fileName=${fileName}): no callback`, 'error');\n return;\n }\n _adapter = _adapter || '0_userdata.0';\n if (sandbox.verbose) {\n sandbox.log(`readFile(adapter=${_adapter}, fileName=${fileName})`, 'info');\n }\n\n adapter.fileExists(_adapter, fileName, (error: Error | null | undefined, result?: boolean): void => {\n if (error) {\n callback(error);\n } else if (!result) {\n callback(new Error('Not exists'));\n } else {\n adapter.readFile(_adapter, fileName, callback);\n }\n });\n },\n unlink: function (\n _adapter: string,\n fileName: string | ((err?: Error | null) => void),\n callback?: (err?: Error | null) => void,\n ): void {\n if (typeof fileName === 'function') {\n callback = fileName;\n fileName = _adapter;\n _adapter = '0_userdata.0';\n }\n _adapter = _adapter || '0_userdata.0';\n\n if (debug) {\n sandbox.log(\n `unlink(adapter=${_adapter}, fileName=${fileName}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n setTimeout(function (): void {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, 0);\n }\n } else {\n if (sandbox.verbose) {\n sandbox.log(`unlink(adapter=${_adapter}, fileName=${fileName})`, 'info');\n }\n if (callback) {\n adapter.unlink(_adapter, fileName, callback);\n } else {\n // @ts-expect-error should be fixed in js-controller\n adapter.unlink(_adapter, fileName);\n }\n }\n },\n delFile: function (\n _adapter: string,\n fileName: string | ((err?: Error | null) => void),\n callback?: (err?: Error | null) => void,\n ): void {\n return sandbox.unlink(_adapter, fileName as string, callback);\n },\n rename: function (\n _adapter: string,\n oldName: string,\n newName: string,\n callback?: (err?: Error | null) => void,\n ): void {\n _adapter = _adapter || '0_userdata.0';\n\n if (debug) {\n sandbox.log(\n `rename(adapter=${_adapter}, oldName=${oldName}, newName=${newName}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n setTimeout(function () {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, 0);\n }\n } else {\n sandbox.verbose &&\n sandbox.log(`rename(adapter=${_adapter}, oldName=${oldName}, newName=${newName})`, 'info');\n if (callback) {\n adapter.rename(_adapter, oldName, newName, callback);\n } else {\n // @ts-expect-error should be fixed in js-controller\n adapter.rename(_adapter, oldName, newName);\n }\n }\n },\n renameFile: function (\n _adapter: string,\n oldName: string,\n newName: string,\n callback?: (err?: Error | null) => void,\n ): void {\n return sandbox.rename(_adapter, oldName, newName, callback);\n },\n getHistory: function (\n instance: string | (ioBroker.GetHistoryOptions & { id: string; timeout?: number | string }),\n options:\n | (ioBroker.GetHistoryOptions & { id?: string; timeout?: number | string })\n | ((\n error: Error | null,\n result?: ioBroker.GetHistoryResult | null,\n options?: ioBroker.GetHistoryOptions & { id: string; timeout?: number | string },\n instance?: string,\n ) => void),\n callback?: (\n error: Error | null,\n result?: ioBroker.GetHistoryResult | null,\n options?: ioBroker.GetHistoryOptions & { id: string; timeout?: number | string },\n instance?: string,\n ) => void,\n ): void {\n if (isObject(instance)) {\n callback = options as (\n error: Error | null,\n result?: ioBroker.GetHistoryResult | null,\n options?: ioBroker.GetHistoryOptions & { id: string; timeout?: number | string },\n instance?: string,\n ) => void;\n options = instance as ioBroker.GetHistoryOptions & { id?: string; timeout?: number | string };\n instance = '';\n }\n\n if (typeof callback !== 'function') {\n return sandbox.log('No callback found!', 'error');\n }\n if (!isObject(options)) {\n return sandbox.log('No options found!', 'error');\n }\n if (!(options as ioBroker.GetHistoryOptions & { id?: string; timeout?: number | string }).id) {\n return sandbox.log('No ID found!', 'error');\n }\n const timeoutMs =\n parseInt(\n (options as ioBroker.GetHistoryOptions & { id?: string; timeout?: number })\n ?.timeout as unknown as string,\n 10,\n ) || 20000;\n\n if (!instance) {\n // @ts-expect-error defaultHistory is private attribute of adapter. Fix later\n if (adapter.defaultHistory) {\n // @ts-expect-error defaultHistory is private attribute of adapter. Fix later\n instance = adapter.defaultHistory;\n } else {\n instance = objects['system.config']?.common?.defaultHistory || null;\n }\n }\n\n if (sandbox.verbose) {\n sandbox.log(`getHistory(instance=${instance as string}, options=${JSON.stringify(options)})`, 'info');\n }\n\n if (!instance) {\n sandbox.log('No default history instance found!', 'error');\n try {\n callback.call(sandbox, new Error('No default history instance found!'));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n return;\n }\n if ((instance as string).startsWith('system.adapter.')) {\n instance = (instance as string).substring('system.adapter.'.length);\n }\n\n if (!objects[`system.adapter.${instance as string}`]) {\n sandbox.log(`Instance \"${instance as string}\" not found!`, 'error');\n try {\n callback.call(sandbox, new Error(`Instance \"${instance as string}\" not found!`));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n return;\n }\n\n let _timeout: NodeJS.Timeout | null = setTimeout(() => {\n _timeout = null;\n if (sandbox.verbose) {\n sandbox.log('getHistory => timeout', 'debug');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(\n sandbox,\n new Error('Timeout'),\n null,\n options as ioBroker.GetHistoryOptions & { id: string; timeout?: number | string },\n instance as string,\n );\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n callback = undefined;\n }\n }, timeoutMs);\n\n adapter.sendTo(\n instance as string,\n 'getHistory',\n {\n id: (options as ioBroker.GetHistoryOptions & { id: string; timeout?: number | string }).id,\n options,\n },\n (res: any): void => {\n if (_timeout) {\n clearTimeout(_timeout);\n _timeout = null;\n }\n const result: {\n error?: string;\n result?: ioBroker.GetHistoryResult;\n step?: number;\n sessionId?: string;\n } = res;\n\n if (sandbox.verbose && result?.error) {\n sandbox.log(`getHistory => ${result.error}`, 'error');\n }\n if (sandbox.verbose && result?.result) {\n sandbox.log(`getHistory => ${result.result.length} items`, 'debug');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(\n sandbox,\n result.error ? new Error(result.error) : null,\n result.result,\n options as ioBroker.GetHistoryOptions & { id: string; timeout?: number | string },\n instance as string,\n );\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n callback = undefined;\n }\n },\n );\n },\n runScript: function (scriptName: string, callback?: (err?: Error | null) => void): boolean {\n scriptName = scriptName || name;\n if (!scriptName.match(/^script\\.js\\./)) {\n scriptName = `script.js.${scriptName}`;\n }\n // start another script\n if (!objects[scriptName] || !objects[scriptName].common) {\n sandbox.log(`Cannot start \"${scriptName}\", because not found`, 'error');\n return false;\n }\n if (debug) {\n sandbox.log(\n `runScript(scriptName=${scriptName}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n typeof callback === 'function' && callback();\n return true;\n }\n if (objects[scriptName].common.enabled) {\n objects[scriptName].common.enabled = false;\n adapter.extendForeignObject(scriptName, { common: { enabled: false } }, (/* err, obj */) => {\n adapter.extendForeignObject(\n scriptName,\n { common: { enabled: true } },\n err => typeof callback === 'function' && callback(err),\n );\n });\n return true;\n }\n adapter.extendForeignObject(\n scriptName,\n { common: { enabled: true } },\n err => typeof callback === 'function' && callback(err),\n );\n return true;\n },\n runScriptAsync: function (scriptName: string): Promise {\n let done = false;\n return new Promise((resolve, reject) => {\n const result = sandbox.runScript(scriptName, err => {\n if (err) {\n reject(err);\n done = true;\n } else {\n resolve();\n }\n });\n if (result === false && !done) {\n reject(new Error(`Script ${scriptName} was not found!`));\n }\n });\n },\n startScript: function (\n scriptName: string,\n ignoreIfStarted?: boolean | ((err: Error | null | undefined, started: boolean) => void),\n callback?: (err: Error | null | undefined, started: boolean) => void,\n ): boolean {\n if (typeof ignoreIfStarted === 'function') {\n callback = ignoreIfStarted as (err: Error | null | undefined, started: boolean) => void;\n ignoreIfStarted = false;\n }\n scriptName = scriptName || name;\n if (!scriptName.match(/^script\\.js\\./)) {\n scriptName = `script.js.${scriptName}`;\n }\n // start another script\n if (!objects[scriptName] || !objects[scriptName].common) {\n sandbox.log(`Cannot start \"${scriptName}\", because not found`, 'error');\n return false;\n }\n if (debug) {\n sandbox.log(\n `startScript(scriptName=${scriptName}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n typeof callback === 'function' && callback(null, false);\n return true;\n }\n if (objects[scriptName].common.enabled) {\n if (!ignoreIfStarted) {\n objects[scriptName].common.enabled = false;\n adapter.extendForeignObject(scriptName, { common: { enabled: false } }, () => {\n adapter.extendForeignObject(\n scriptName,\n { common: { enabled: true } },\n err => typeof callback === 'function' && callback(err, true),\n );\n });\n } else if (typeof callback === 'function') {\n callback(null, false);\n }\n return true;\n }\n adapter.extendForeignObject(scriptName, { common: { enabled: true } }, err => {\n typeof callback === 'function' && callback(err, true);\n });\n return true;\n },\n startScriptAsync: function (scriptName: string, ignoreIfStarted?: boolean): Promise {\n return new Promise((resolve, reject) => {\n const result = sandbox.startScript(\n scriptName,\n !!ignoreIfStarted,\n (err: Error | null | undefined, started: boolean): void => {\n if (err) {\n reject(err);\n } else {\n resolve(started);\n }\n },\n );\n if (result === false) {\n reject(new Error(`Script ${scriptName} was not found!`));\n }\n });\n },\n stopScript: function (\n scriptName: string,\n callback?: (err: Error | null | undefined, stopped: boolean) => void,\n ): boolean {\n scriptName = scriptName || name;\n\n if (!scriptName.match(/^script\\.js\\./)) {\n scriptName = `script.js.${scriptName}`;\n }\n\n // stop another script\n if (!objects[scriptName] || !objects[scriptName].common) {\n sandbox.log(`Cannot stop \"${scriptName}\", because not found`, 'error');\n return false;\n }\n if (debug) {\n sandbox.log(\n `stopScript(scriptName=${scriptName}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n callback(null, false);\n }\n return true;\n }\n if (objects[scriptName].common.enabled) {\n objects[scriptName].common.enabled = false;\n adapter.extendForeignObject(scriptName, { common: { enabled: false } }, err => {\n if (typeof callback === 'function') {\n callback(err, true);\n }\n });\n } else if (typeof callback === 'function') {\n callback(null, false);\n }\n return true;\n },\n stopScriptAsync: function (scriptName: string): Promise {\n return new Promise((resolve, reject) => {\n const result = sandbox.stopScript(\n scriptName,\n (err: Error | null | undefined, stopped: boolean): void => {\n if (err) {\n reject(err);\n } else {\n resolve(stopped);\n }\n },\n );\n if (result === false) {\n reject(new Error(`Script ${scriptName} was not found!`));\n }\n });\n },\n isScriptActive: function (scriptName: string): boolean {\n if (!scriptName.match(/^script\\.js\\./)) {\n scriptName = `script.js.${scriptName}`;\n }\n if (!objects[scriptName] || !objects[scriptName].common) {\n sandbox.log('Script does not exist', 'error');\n return false;\n }\n return objects[scriptName].common.enabled;\n },\n startInstanceAsync: async function (instanceName: string): Promise {\n const objInstanceId = `system.adapter.${instanceName}`;\n const exists = await adapter.foreignObjectExists(objInstanceId);\n\n if (exists) {\n const instanceObj = await adapter.getForeignObjectAsync(objInstanceId);\n\n if (instanceObj?.type === 'instance' && !instanceObj.common.enabled) {\n await adapter.extendForeignObjectAsync(objInstanceId, { common: { enabled: true } });\n\n if (sandbox.verbose) {\n sandbox.log(`startInstanceAsync (instanceName=${instanceName})`, 'info');\n }\n\n return true;\n }\n sandbox.log(`Cannot start instance \"${instanceName}\", because already running`, 'warn');\n } else {\n sandbox.log(`Cannot start instance \"${instanceName}\", because not found`, 'error');\n }\n\n return false;\n },\n restartInstanceAsync: async function (instanceName: string): Promise {\n const objInstanceId = `system.adapter.${instanceName}`;\n const exists = await adapter.foreignObjectExists(objInstanceId);\n\n if (exists) {\n const instanceObj = await adapter.getForeignObjectAsync(objInstanceId);\n\n if (instanceObj?.type === 'instance' && instanceObj.common.enabled) {\n await adapter.extendForeignObjectAsync(objInstanceId, {});\n\n if (sandbox.verbose) {\n sandbox.log(`restartInstanceAsync (instanceName=${instanceName})`, 'info');\n }\n\n return true;\n }\n sandbox.log(`Cannot restart instance \"${instanceName}\", because not running`, 'warn');\n } else {\n sandbox.log(`Cannot restart instance \"${instanceName}\", because not found`, 'error');\n }\n\n return false;\n },\n stopInstanceAsync: async function (instanceName: string): Promise {\n const objInstanceId = `system.adapter.${instanceName}`;\n const exists = await adapter.foreignObjectExists(objInstanceId);\n\n if (exists) {\n const instanceObj = await adapter.getForeignObjectAsync(objInstanceId);\n\n if (instanceObj?.type === 'instance' && instanceObj.common.enabled) {\n await adapter.extendForeignObjectAsync(objInstanceId, { common: { enabled: false } });\n\n if (sandbox.verbose) {\n sandbox.log(`stopInstanceAsync (instanceName=${instanceName})`, 'info');\n }\n\n return true;\n }\n sandbox.log(`Cannot stop instance \"${instanceName}\", because not running`, 'warn');\n } else {\n sandbox.log(`Cannot stop instance \"${instanceName}\", because not found`, 'error');\n }\n\n return false;\n },\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n toInt: function (val: boolean | string | number | 'true' | 'false'): number {\n if (val === true || val === 'true') {\n val = 1;\n }\n if (val === false || val === 'false') {\n val = 0;\n }\n val = parseInt(val as unknown as string) || 0;\n return val;\n },\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n toFloat: function (val: boolean | string | number | 'true' | 'false'): number {\n if (val === true || val === 'true') {\n val = 1;\n }\n if (val === false || val === 'false') {\n val = 0;\n }\n val = parseFloat(val as unknown as string) || 0;\n return val;\n },\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n toBoolean: function (val: boolean | string | number | 'true' | 'false'): boolean {\n if (val === '1' || val === 'true') {\n val = true;\n }\n if (val === '0' || val === 'false') {\n val = false;\n }\n return !!val;\n },\n getAttr: function (obj: string | Record, path: string | string[]): any {\n if (typeof path === 'string') {\n path = path.split('.');\n }\n if (typeof obj === 'string') {\n try {\n obj = JSON.parse(obj);\n } catch (err: unknown) {\n void adapter.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: true,\n ack: true,\n c: 'getAttr',\n });\n sandbox.log(`Cannot parse \"${obj.substring(0, 30)}\": ${err as Error}`, 'error');\n\n return null;\n }\n }\n\n const attr: string = path.shift() || '';\n try {\n obj = (obj as Record)[attr];\n } catch (err: unknown) {\n void adapter.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: true,\n ack: true,\n c: 'getAttr',\n });\n sandbox.log(`Cannot get ${attr} of \"${JSON.stringify(obj)}\": ${err as Error}`, 'error');\n\n return null;\n }\n\n if (!path.length) {\n return obj;\n }\n const type = typeof obj;\n if (obj === null || obj === undefined || type === 'boolean' || type === 'number') {\n return null;\n }\n return sandbox.getAttr(obj, path);\n },\n messageTo: function (\n target: string | { instance: string | null | number; script: string | null; message: string },\n data: any,\n options: { timeout?: number | string } | ((result: any, options: { timeout?: number | string }) => void),\n callback?: (result: any, options: { timeout?: number | string }, instance: string | number | null) => void,\n ) {\n const defaultTimeout = 5000;\n\n if (typeof target !== 'object') {\n target = { instance: null, script: null, message: target };\n }\n if (typeof options === 'function') {\n callback = options;\n options = { timeout: defaultTimeout };\n }\n\n let timeout: NodeJS.Timeout | null = null;\n if (typeof callback === 'function') {\n const timeoutDuration = parseInt(options?.timeout as unknown as string, 10) || defaultTimeout;\n\n timeout = setTimeout(() => {\n timeout = null;\n\n if (sandbox.verbose) {\n sandbox.log(`messageTo => timeout: ${timeoutDuration}`, 'debug');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, { error: 'timeout' }, options, target.instance);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n callback = undefined;\n }\n }, timeoutDuration);\n }\n let cbFunc: undefined | ((result: any) => void);\n if (timeout) {\n cbFunc = function (res: any) {\n timeout && clearTimeout(timeout);\n const result: { result?: any; error?: string | null } = res;\n\n if (sandbox.verbose && result?.result) {\n sandbox.log(`messageTo => ${JSON.stringify(result)}`, 'debug');\n }\n if (sandbox.verbose && result?.error) {\n sandbox.log(`messageTo => ${result.error}`, 'error');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, result, options, target.instance);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n callback = undefined;\n }\n };\n }\n\n if (target.instance || target.instance === 0) {\n if (\n typeof target.instance === 'string' &&\n target.instance &&\n target.instance.startsWith('system.adapter.')\n ) {\n target.instance = target.instance.substring('system.adapter.'.length);\n } else if (typeof target.instance === 'number') {\n target.instance = `javascript.${target.instance}`;\n }\n\n adapter.sendTo(\n target.instance,\n 'jsMessageBus',\n { message: target.message, script: target.script, data },\n cbFunc,\n );\n } else {\n // Send it to all instances\n context.adapter.getObjectView(\n 'system',\n 'instance',\n { startkey: 'system.adapter.javascript.', endkey: 'system.adapter.javascript.\\u9999' },\n options,\n (err: Error | null | undefined, res): void => {\n if (err || !res) {\n sandbox.log(`messageTo failed: ${err?.message}`, 'error');\n return;\n }\n const len = 'system.adapter.'.length;\n const instances = res.rows.map(item => item.id.substring(len));\n\n instances.forEach(instance => {\n adapter.sendTo(\n instance,\n 'jsMessageBus',\n { message: target.message, script: target.script, data },\n cbFunc,\n );\n });\n },\n );\n }\n },\n messageToAsync: function (\n target: string | { instance: string | null | number; script: string | null; message: string },\n data: any,\n options?: { timeout?: number | string },\n ): Promise {\n return new Promise((resolve, reject) => {\n sandbox.messageTo(target, data, options, (res: any): void => {\n const result: { error?: string } = res;\n if (sandbox.verbose) {\n sandbox.log(`messageTo result => ${JSON.stringify(res)}`, 'debug');\n }\n if (!res || result.error) {\n reject(result ? new Error(result.error) : new Error('Unknown error'));\n } else {\n resolve(result);\n }\n });\n });\n },\n onMessage: function (\n messageName: string,\n callback: (data: any, cb: (result: any) => void) => void,\n ): null | number {\n if (typeof callback !== 'function') {\n sandbox.log('onMessage callback is not a function', 'error');\n\n return null;\n }\n context.messageBusHandlers[sandbox.scriptName] = context.messageBusHandlers[sandbox.scriptName] || {};\n context.messageBusHandlers[sandbox.scriptName][messageName] =\n context.messageBusHandlers[sandbox.scriptName][messageName] || [];\n\n const handler = { id: Date.now() + Math.floor(Math.random() * 10000), cb: callback, sandbox };\n context.messageBusHandlers[sandbox.scriptName][messageName].push(handler);\n\n sandbox.__engine.__subscriptionsMessage += 1;\n\n if (\n sandbox.__engine.__subscriptionsMessage %\n (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__subscriptionsMessage} message subscriptions registered. Check your script!`,\n 'warn',\n );\n }\n\n return handler.id;\n },\n onMessageUnregister: function (idOrName: number | string): boolean {\n const ctx = context.messageBusHandlers[sandbox.scriptName];\n let found = false;\n if (ctx) {\n if (typeof idOrName === 'number') {\n for (const messageName in ctx) {\n if (Object.prototype.hasOwnProperty.call(ctx, messageName)) {\n for (let i = 0; i < ctx[messageName].length; i++) {\n if (ctx[messageName][i].id === idOrName) {\n ctx[messageName].splice(i, 1);\n if (!ctx[messageName].length) {\n delete ctx[messageName];\n sandbox.__engine.__subscriptionsMessage--;\n }\n found = true;\n break;\n }\n }\n }\n if (found) {\n break;\n }\n }\n } else if (idOrName && ctx[idOrName]) {\n delete ctx[idOrName];\n sandbox.__engine.__subscriptionsMessage--;\n found = true;\n }\n }\n return found;\n },\n console: {\n log: function (msg: string): void {\n sandbox.log(msg, 'info');\n },\n error: function (msg: string): void {\n sandbox.log(msg, 'error');\n },\n warn: function (msg: string): void {\n sandbox.log(msg, 'warn');\n },\n info: function (msg: string): void {\n sandbox.log(msg, 'info');\n },\n debug: function (msg: string): void {\n sandbox.log(msg, 'debug');\n },\n },\n jsonataExpression: function (data: any, expression: string): Promise {\n return jsonata(expression).evaluate(data);\n },\n wait: function (ms: number): Promise {\n return new Promise((resolve: () => void): void => {\n sandbox.setTimeout(resolve, ms);\n });\n },\n sleep: function (ms: number): Promise {\n return sandbox.wait(ms);\n },\n onObject: function (\n pattern: string | string[],\n callback: (id: string, obj?: ioBroker.Object | null) => void,\n ): SubscribeObject | SubscribeObject[] | null {\n return sandbox.subscribeObject(pattern, callback);\n },\n subscribeObject: function (\n pattern: string | string[],\n callback: (id: string, obj?: ioBroker.Object | null) => void,\n ): SubscribeObject | SubscribeObject[] | null {\n if (Array.isArray(pattern)) {\n const result: {\n name: string;\n pattern: string;\n callback: (id: string, obj?: ioBroker.Object | null) => void;\n }[] = [];\n for (let p = 0; p < pattern.length; p++) {\n result.push(\n sandbox.subscribeObject(pattern[p], callback) as {\n name: string;\n pattern: string;\n callback: (id: string, obj?: ioBroker.Object | null) => void;\n },\n );\n }\n return result;\n }\n\n sandbox.__engine.__subscriptionsObject += 1;\n\n if (\n sandbox.__engine.__subscriptionsObject %\n (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__subscriptionsObject} object subscriptions registered. Check your script!`,\n 'warn',\n );\n }\n\n // source is set by regexp if defined as /regexp/\n if (!pattern || typeof pattern !== 'string') {\n sandbox.log('Error by subscribeObject: pattern can be only string or array of strings.', 'error');\n return null;\n }\n\n if (typeof callback !== 'function') {\n sandbox.log('Error by subscribeObject: callback is not a function', 'error');\n return null;\n }\n\n const subs: SubscribeObject = { pattern, callback, name };\n if (sandbox.verbose) {\n sandbox.log(`subscribeObject: ${JSON.stringify(subs)}`, 'info');\n }\n\n adapter.subscribeForeignObjects(pattern);\n\n context.subscriptionsObject.push(subs);\n\n return subs;\n },\n unsubscribeObject: function (subObject: SubscribeObject | SubscribeObject[]): boolean | boolean[] {\n if (subObject && Array.isArray(subObject)) {\n const result: boolean[] = [];\n for (let t = 0; t < subObject.length; t++) {\n result.push(sandbox.unsubscribeObject(subObject[t]) as boolean);\n }\n return result;\n }\n\n if (sandbox.verbose) {\n sandbox.log(`adapterUnsubscribeObject(id=${JSON.stringify(subObject)})`, 'info');\n }\n\n for (let i = context.subscriptionsObject.length - 1; i >= 0; i--) {\n if (context.subscriptionsObject[i] === subObject) {\n adapter.unsubscribeForeignObjects(subObject.pattern);\n context.subscriptionsObject.splice(i, 1);\n sandbox.__engine.__subscriptionsObject--;\n return true;\n }\n }\n let deleted = 0;\n for (let i = context.subscriptionsObject.length - 1; i >= 0; i--) {\n if (\n context.subscriptionsObject[i].name &&\n context.subscriptionsObject[i].pattern === subObject.pattern\n ) {\n deleted++;\n adapter.unsubscribeForeignObjects(subObject.pattern);\n context.subscriptionsObject.splice(i, 1);\n sandbox.__engine.__subscriptionsObject--;\n }\n }\n return !!deleted;\n },\n // internal function to send the block debugging info to the front-end\n _sendToFrontEnd: function (blockId: string, data: any): void {\n if (context.rulesOpened === sandbox.scriptName) {\n void adapter.setState(\n 'debug.rules',\n JSON.stringify({ ruleId: sandbox.scriptName, blockId, data, ts: Date.now() }),\n true,\n );\n }\n },\n existsStateAsync: function (_id: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n existsObjectAsync: function (_id: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n getObjectAsync: function (_id: string, _enumName: null | string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n setObjectAsync: function (_id: string, _obj: ioBroker.Object): Promise<{ id: string }> {\n return Promise.reject(new Error('Not implemented'));\n },\n extendObjectAsync: function (_id: string, _obj: Partial): Promise<{ id: string }> {\n return Promise.reject(new Error('Not implemented'));\n },\n deleteObjectAsync: function (_id: string, _isRecursive?: boolean): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n createStateAsync: function (\n _name: string,\n _initValue: undefined | ioBroker.StateValue | ioBroker.State,\n _forceCreation:\n | boolean\n | undefined\n | Record\n | Partial\n | ((err: Error | null) => void),\n _common?: Partial | ((err: Error | null) => void),\n _native?: Record | ((err: Error | null) => void),\n ): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n createAliasAsync: function (\n _name: string,\n _alias: string | CommonAlias,\n _forceCreation: boolean | Partial | undefined,\n _common?: Partial | Record,\n _native?: Record,\n ): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n deleteStateAsync: function (_id: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n writeFileAsync: function (\n _adapter: string,\n _fileName: string | Buffer,\n _data?: string | Buffer,\n ): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n readFileAsync: function (_adapter: string, _fileName?: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n unlinkAsync: function (_adapter: string, _fileName?: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n delFileAsync: function (_adapter: string, _fileName?: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n renameAsync: function (_adapter: string, _oldName: string, _newName?: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n renameFileAsync: function (_adapter: string, _oldName: string, _newName?: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n getHistoryAsync: function (\n _instance: string | (ioBroker.GetHistoryOptions & { id: string; timeout?: number | string }),\n _options?: ioBroker.GetHistoryOptions & { id?: string; timeout?: number | string },\n ): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n httpGetAsync: function (\n _url: string,\n _options?: {\n timeout?: number;\n responseType?: ResponseType;\n headers?: Record;\n basicAuth?: { user: string; password: string } | null;\n bearerAuth?: string;\n validateCertificate?: boolean;\n },\n ): Promise<{\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n }> {\n return Promise.reject(new Error('Not implemented'));\n },\n httpPostAsync: function (\n _url: string,\n _data: any,\n _options: {\n timeout?: number;\n responseType?: ResponseType;\n headers?: Record;\n basicAuth?: { user: string; password: string } | null;\n bearerAuth?: string;\n validateCertificate?: boolean;\n },\n ): Promise<{\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n }> {\n return Promise.reject(new Error('Not implemented'));\n },\n };\n\n // Create advanced functions that can modify objects\n if ((adapter.config as JavaScriptAdapterConfig).enableSetObject) {\n sandbox.setObject = function (\n id: string,\n obj: ioBroker.Object,\n callback?: (err?: Error | null, res?: { id: string }) => void,\n ): void {\n if (id && typeof id === 'string' && id.startsWith('system.adapter.')) {\n sandbox.log(\n `Using setObject on system object ${id} can be dangerous (protected instance attributes may be lost)`,\n 'info',\n );\n }\n if (debug) {\n sandbox.log(\n `setObject(id=${id}, obj=${JSON.stringify(obj)}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n setImmediate(function () {\n try {\n callback.call(sandbox, null, { id });\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n });\n }\n } else {\n if (sandbox.verbose) {\n sandbox.log(`setObject(id=${id}, obj=${JSON.stringify(obj)})`, 'info');\n }\n adapter.setForeignObject(id, obj, (err, res) => {\n if (!err) {\n // Update meta object data\n context.updateObjectContext(id, obj);\n }\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, err, res);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n });\n }\n };\n sandbox.extendObject = function (\n id: string,\n obj: Partial,\n callback?: (err?: Error | null, obj?: { id: string }) => void,\n ): void {\n if (debug) {\n sandbox.log(\n `extendObject(id=${id}, obj=${JSON.stringify(obj)}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n setTimeout(function () {\n try {\n callback.call(sandbox, null, { id });\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, 0);\n }\n } else {\n if (sandbox.verbose) {\n sandbox.log(`extendObject(id=${id}, obj=${JSON.stringify(obj)})`, 'info');\n }\n if (callback) {\n adapter.extendForeignObject(id, JSON.parse(JSON.stringify(obj)), callback);\n } else {\n void adapter.extendForeignObject(id, JSON.parse(JSON.stringify(obj)));\n }\n }\n };\n sandbox.deleteObject = function (id: string, isRecursive?: boolean, callback?: ioBroker.ErrorCallback): void {\n if (typeof isRecursive === 'function') {\n callback = isRecursive;\n isRecursive = false;\n }\n if (debug) {\n sandbox.log(\n `deleteObject(id=${id}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n setTimeout(function () {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, 0);\n }\n } else {\n if (sandbox.verbose) {\n sandbox.log(`deleteObject(id=${id})`, 'info');\n }\n adapter.delForeignObject(id, { recursive: isRecursive }, callback);\n }\n };\n }\n\n // promisify methods on the sandbox\n sandbox.existsStateAsync = promisify(sandbox.existsState);\n sandbox.existsObjectAsync = promisify(sandbox.existsObject);\n sandbox.getObjectAsync = promisify(sandbox.getObject);\n sandbox.setObjectAsync = promisify(sandbox.setObject);\n sandbox.extendObjectAsync = promisify(sandbox.extendObject);\n sandbox.deleteObjectAsync = promisify(sandbox.deleteObject);\n sandbox.createStateAsync = promisify(sandbox.createState);\n sandbox.createAliasAsync = promisify(sandbox.createAlias);\n sandbox.deleteStateAsync = promisify(sandbox.deleteState);\n sandbox.writeFileAsync = promisify(sandbox.writeFile);\n sandbox.readFileAsync = promisify(sandbox.readFile);\n sandbox.unlinkAsync = promisify(sandbox.unlink);\n sandbox.delFileAsync = promisify(sandbox.delFile);\n sandbox.renameAsync = promisify(sandbox.rename);\n sandbox.renameFileAsync = promisify(sandbox.renameFile);\n sandbox.getHistoryAsync = promisify(sandbox.getHistory);\n sandbox.httpGetAsync = promisify(sandbox.httpGet);\n sandbox.httpPostAsync = promisify(sandbox.httpPost);\n\n // Make all predefined properties and methods readonly so scripts cannot overwrite them\n for (const prop of Object.keys(sandbox)) {\n Object.defineProperty(sandbox, prop, {\n configurable: false,\n writable: false,\n });\n }\n\n return sandbox;\n}\n"]} \ No newline at end of file +{"version":3,"file":"sandbox.js","sourceRoot":"","sources":["../../src/lib/sandbox.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,0BAgjLC;AAxlLD,oDAAsC;AAItC,yDAAqD;AAErD,mCAA6E;AAmB7E,oDAAsC;AACtC,kDAAoC;AACpC,wDAA0C;AAC1C,uEAGmC;AAKnC,MAAM,kBAAkB,GAAG,YAAY,CAAC;AAExC,MAAM,aAAa,GAAG,0BAAW,CAAC,aAAa,CAAC;AAEhD,SAAgB,OAAO,CACnB,MAAgB,EAChB,IAAY,EACZ,OAA4B,EAC5B,KAA0B,EAC1B,OAA0B;IAE1B,MAAM,MAAM,GAAG,SAAS,CAAC;IACzB,MAAM,KAAK,GAAG,QAAQ,CAAC;IACvB,MAAM,QAAQ,GAAG,WAAW,CAAC;IAC7B,MAAM,uBAAuB,GAAG,iDAA0B,CAAC;IAC3D,MAAM,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,iBAAS,EAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAChD,OAAO,CAAC,YAAY,GAAG,IAAA,iBAAS,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAClD,OAAO,CAAC,WAAW,GAAG,IAAA,iBAAS,EAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAChD,OAAO,CAAC,eAAe,GAAG,IAAA,iBAAS,EAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACxD,OAAO,CAAC,eAAe,GAAG,IAAA,iBAAS,EAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACxD,OAAO,CAAC,YAAY,GAAG,IAAA,iBAAS,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAClD,OAAO,CAAC,aAAa,GAAG,IAAA,iBAAS,EAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEpD,uFAAuF;IACvF,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACtC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE;YACjC,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,KAAK;SAClB,CAAC,CAAC;IACP,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC","sourcesContent":["import type { ChildProcess, ExecOptions } from 'node:child_process';\nimport * as jsonataMod from 'jsonata';\nimport type { SendMailOptions } from 'nodemailer';\nimport type { AxiosError, AxiosHeaderValue, AxiosResponse, ResponseType } from 'axios';\n\nimport { commonTools } from '@iobroker/adapter-core';\n\nimport { isObject, isArray, promisify, getHttpRequestConfig } from './tools';\nimport type {\n JavaScriptAdapterConfig,\n AstroRule,\n ChangeType,\n CommonAlias,\n FileSubscriptionResult,\n IobSchedule,\n JavascriptContext,\n JsScript,\n LogMessage,\n Pattern,\n PushoverOptions,\n SandboxType,\n Selector,\n SubscribeObject,\n SubscriptionResult,\n TimeRule,\n} from '../types';\nimport * as constsMod from './consts';\nimport * as wordsMod from './words';\nimport * as eventObjMod from './eventObj';\nimport {\n patternCompareFunctions as patternCompareFunctionsMod,\n type PatternEventCompareFunction,\n} from './patternCompareFunctions';\nimport type { ScheduleName, SchedulerRule } from './scheduler';\nimport type { EventObj } from './eventObj';\nimport type { AstroEvent } from './consts';\n\nconst SCRIPT_CODE_MARKER = 'script.js.';\n\nconst pattern2RegEx = commonTools.pattern2RegEx;\n\nexport function sandBox(\n script: JsScript,\n name: string,\n verbose: boolean | undefined,\n debug: boolean | undefined,\n context: JavascriptContext,\n): SandboxType {\n const consts = constsMod;\n const words = wordsMod;\n const eventObj = eventObjMod;\n const patternCompareFunctions = patternCompareFunctionsMod;\n const jsonata = jsonataMod.default;\n\n const adapter: ioBroker.Adapter = context.adapter;\n const mods = context.mods;\n const states = context.states;\n const objects = context.objects;\n const timers = context.timers;\n const enums = context.enums;\n const debugMode = context.debugMode;\n\n // eslint-disable-next-line prefer-const\n let sandbox: SandboxType;\n\n function errorInCallback(e: Error): void {\n void adapter.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: true,\n ack: true,\n c: 'errorInCallback',\n });\n context.logError(name, 'Error in callback:', e);\n context.debugMode && console.log(`error$$${name}$$Exception in callback: ${e}`, Date.now());\n }\n\n function subscribePattern(script: JsScript, pattern: string): void {\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n if (!script.subscribes[pattern]) {\n script.subscribes[pattern] = 1;\n } else {\n script.subscribes[pattern]++;\n }\n\n if (!context.subscribedPatterns[pattern]) {\n context.subscribedPatterns[pattern] = 1;\n\n if (sandbox.verbose) {\n sandbox.log(`subscribePattern(pattern=${pattern})`, 'info');\n }\n adapter.subscribeForeignStates(pattern);\n\n // request current value to deliver old value on change.\n if (typeof pattern === 'string' && !pattern.includes('*')) {\n void adapter.getForeignState(pattern, (_err, state) => {\n if (state) {\n states[pattern] = state;\n }\n });\n } else {\n adapter.getForeignStates(\n pattern,\n (_err, _states) => _states && Object.keys(_states).forEach(id => (states[id] = _states[id])),\n );\n }\n } else {\n context.subscribedPatterns[pattern]++;\n }\n }\n }\n\n function unsubscribePattern(script: JsScript, pattern: string): void {\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n if (script.subscribes[pattern]) {\n script.subscribes[pattern]--;\n if (!script.subscribes[pattern]) {\n delete script.subscribes[pattern];\n }\n }\n\n if (context.subscribedPatterns[pattern]) {\n context.subscribedPatterns[pattern]--;\n if (!context.subscribedPatterns[pattern]) {\n adapter.unsubscribeForeignStates(pattern);\n delete context.subscribedPatterns[pattern];\n\n // if the pattern was regex or with * some states will stay in RAM, but it is OK.\n if (states[pattern]) {\n delete states[pattern];\n }\n }\n }\n }\n }\n\n function subscribeFile(script: JsScript, id: string, fileNamePattern: string): void {\n const key = `${id}$%$${fileNamePattern}`;\n if (!script.subscribesFile[key]) {\n script.subscribesFile[key] = 1;\n } else {\n script.subscribesFile[key]++;\n }\n\n if (!context.subscribedPatternsFile[key]) {\n context.subscribedPatternsFile[key] = 1;\n void adapter.subscribeForeignFiles(id, fileNamePattern);\n } else {\n context.subscribedPatternsFile[key]++;\n }\n }\n\n function unsubscribeFile(script: JsScript, id: string, fileNamePattern: string): void {\n const key = `${id}$%$${fileNamePattern}`;\n if (script.subscribesFile[key]) {\n script.subscribesFile[key]--;\n if (!script.subscribesFile[key]) {\n delete script.subscribesFile[key];\n }\n }\n\n if (context.subscribedPatternsFile[key]) {\n context.subscribedPatternsFile[key]--;\n if (!context.subscribedPatternsFile[key]) {\n void adapter.unsubscribeForeignFiles(id, fileNamePattern);\n delete context.subscribedPatternsFile[key];\n }\n }\n }\n\n function getPatternCompareFunctions(pattern: Pattern): PatternEventCompareFunction[] & { logic?: 'and' | 'or' } {\n let func: PatternEventCompareFunction;\n const functions: PatternEventCompareFunction[] & { logic?: 'and' | 'or' } = [];\n functions.logic = pattern.logic || 'and';\n\n for (const key in pattern) {\n if (!Object.prototype.hasOwnProperty.call(pattern, key)) {\n continue;\n }\n if (key === 'logic') {\n continue;\n }\n if (key === 'change' && pattern.change === 'any') {\n continue;\n }\n const _func: (pattern: Pattern) => PatternEventCompareFunction = (\n patternCompareFunctions as unknown as Record PatternEventCompareFunction>\n )[key];\n if (!_func) {\n continue;\n }\n func = _func(pattern);\n if (typeof func !== 'function') {\n continue;\n }\n functions.push(func);\n }\n return functions;\n }\n\n /**\n * Splits a selector string into attribute and value\n *\n * @param selector The selector string to split\n */\n function splitSelectorString(selector: string): Selector {\n const parts = selector.split('=', 2);\n if (parts[1] && parts[1][0] === '\"') {\n parts[1] = parts[1].substring(1);\n const len = parts[1].length;\n if (parts[1] && parts[1][len - 1] === '\"') {\n parts[1] = parts[1].substring(0, len - 1);\n }\n }\n if (parts[1] && parts[1][0] === \"'\") {\n parts[1] = parts[1].substring(1);\n const len = parts[1].length;\n if (parts[1] && parts[1][len - 1] === \"'\") {\n parts[1] = parts[1].substring(0, len - 1);\n }\n }\n\n if (parts[1]) {\n parts[1] = parts[1].trim();\n }\n parts[0] = parts[0].trim();\n\n return { attr: parts[0], value: parts[1] };\n }\n\n /**\n * Transforms a selector string with wildcards into a regular expression\n *\n * @param str The selector string to transform into a regular expression\n */\n function selectorStringToRegExp(str: string): RegExp {\n const startsWithWildcard = str[0] === '*';\n const endsWithWildcard = str[str.length - 1] === '*';\n\n // Sanitize the selector, so it is safe to use in a RegEx\n // Taken from https://stackoverflow.com/a/3561711/10179833 but modified\n // since * has a special meaning in our selector and should not be escaped\n // eslint-disable-next-line no-useless-escape\n str = str.replace(/[-\\/\\\\^$+?.()|[\\]{}]/g, '\\\\$&').replace(/\\*/g, '.*');\n\n return new RegExp((startsWithWildcard ? '' : '^') + str + (endsWithWildcard ? '' : '$'));\n }\n\n /**\n * Adds a regular expression for selectors targeting the state ID\n *\n * @param selector The selector to apply the transform to\n */\n function addRegExpToIdAttrSelectors(selector: Selector): Selector {\n if ((selector.attr === 'id' || selector.attr === 'state.id') && !selector.idRegExp && selector.value) {\n return {\n attr: selector.attr,\n value: selector.value,\n idRegExp: selectorStringToRegExp(selector.value),\n };\n }\n return selector;\n }\n\n /**\n * Tests if a value loosely equals (==) the reference string.\n * In contrast to the equality operator, this treats true == \"true\" as well\n * so we can test common and native attributes for boolean values\n *\n * @param value The value to compare with the reference\n * @param reference The reference to compare the value to\n */\n function looselyEqualsString(value: string | number | boolean | undefined, reference: string): boolean {\n // For booleans, compare the string representation\n // For other types do a loose comparison\n return typeof value === 'boolean'\n ? (value && reference === 'true') || (!value && reference === 'false')\n : value == reference;\n }\n\n /**\n * Returns the `common.type` for a given variable\n */\n function getCommonTypeOf(value: any): ioBroker.CommonType {\n return isArray(value) ? 'array' : isObject(value) ? 'object' : (typeof value as ioBroker.CommonType);\n }\n\n /**\n * Returns if an id is in an allowed namespace for automatic object creations\n *\n * @param id id to check\n */\n function validIdForAutomaticFolderCreation(id: string): boolean {\n return id.startsWith('javascript.') || id.startsWith('0_userdata.0.') || id.startsWith('alias.0.');\n }\n\n /**\n * Iterate through object structure to create missing folder objects\n */\n async function ensureObjectStructure(id: string): Promise {\n if (!validIdForAutomaticFolderCreation(id)) {\n return;\n }\n if (context.folderCreationVerifiedObjects[id] === true) {\n return;\n }\n const idArr = id.split('.');\n idArr.pop(); // the last is created as an object in any way\n if (idArr.length < 3) {\n return; // Nothing to do\n }\n // We just create sublevel projects\n let idToCheck = idArr.splice(0, 2).join('.');\n\n context.folderCreationVerifiedObjects[id] = true;\n for (const part of idArr) {\n idToCheck += `.${part}`;\n if (context.folderCreationVerifiedObjects[idToCheck] === true || objects[idToCheck]) {\n continue;\n }\n context.folderCreationVerifiedObjects[idToCheck] = true;\n let obj: ioBroker.Object | null | undefined;\n try {\n obj = await adapter.getForeignObjectAsync(idToCheck);\n } catch {\n // ignore\n }\n if (!obj?.common) {\n sandbox.log(`Create folder object for ${idToCheck}`, 'debug');\n try {\n await adapter.setForeignObjectAsync(idToCheck, {\n _id: idToCheck,\n type: 'folder',\n common: {\n name: part,\n },\n native: {\n autocreated: 'by automatic ensure logic',\n },\n } as ioBroker.FolderObject);\n } catch (err: any) {\n sandbox.log(`Could not automatically create folder object ${idToCheck}: ${err.message}`, 'info');\n }\n } else {\n //sandbox.log(` already existing \"${idToCheck}\": ${JSON.stringify(obj)}`, 'debug');\n }\n }\n }\n\n function setStateHelper(\n sandbox: SandboxType,\n isCreate: boolean,\n isChanged: boolean,\n id: string,\n state: null | ioBroker.SettableState | ioBroker.StateValue,\n isAck: boolean | 'true' | 'false' | undefined | ((error?: Error | null) => void),\n callback?: (error?: Error | null) => void,\n ): void {\n if (typeof isAck === 'function') {\n callback = isAck;\n isAck = undefined;\n }\n\n let stateNotNull: ioBroker.SettableState | ioBroker.StateValue;\n\n if (isAck === true || isAck === false || isAck === 'true' || isAck === 'false') {\n if (state && typeof state === 'object' && state.val !== undefined) {\n stateNotNull = state;\n // we assume that we were given a state object if\n // state is an object that contains a `val` property\n if (!Object.prototype.hasOwnProperty.call(state, 'ack')) {\n stateNotNull.ack = isAck === true || isAck === 'true';\n }\n } else if (state === null) {\n stateNotNull = { val: null, ack: isAck === true || isAck === 'true' };\n } else {\n // otherwise, assume that the given state is the value to be set\n stateNotNull = { val: state as ioBroker.StateValue, ack: isAck === true || isAck === 'true' };\n }\n } else if (state === null) {\n stateNotNull = { val: null };\n } else {\n stateNotNull = state;\n }\n\n // Check a type of state\n if (!objects[id] && objects[`${adapter.namespace}.${id}`]) {\n id = `${adapter.namespace}.${id}`;\n }\n\n if (isCreate) {\n if (id.match(/^javascript\\.\\d+\\.scriptEnabled/)) {\n sandbox.log(\n `Own states (${id}) should not be used in javascript.X.scriptEnabled.*! Please move the states to 0_userdata.0.*`,\n 'info',\n );\n } else if (id.match(/^javascript\\.\\d+\\.scriptProblem/)) {\n sandbox.log(\n `Own states (${id}) should not be used in javascript.X.scriptProblem.*! Please move the states to 0_userdata.0.*`,\n 'info',\n );\n }\n }\n\n const common = objects[id] ? objects[id].common : null;\n if (common?.type && common.type !== 'mixed' && common.type !== 'json') {\n // Find out which type the value has\n let actualCommonType: ioBroker.CommonType | undefined;\n if (typeof stateNotNull === 'object') {\n if (stateNotNull && stateNotNull.val !== undefined && stateNotNull.val !== null) {\n actualCommonType = getCommonTypeOf(stateNotNull.val);\n }\n } else if (stateNotNull !== null && stateNotNull !== undefined) {\n actualCommonType = getCommonTypeOf(stateNotNull);\n }\n // If this is not the expected one, issue a warning\n if (actualCommonType && actualCommonType !== common.type) {\n context.logWithLineInfo(\n `You are assigning a ${actualCommonType} to the state \"${id}\" which expects a ${common.type}. ` +\n `Please fix your code to use a ${common.type} or change the state type to ${actualCommonType}. ` +\n `This warning might become an error in future versions.`,\n );\n }\n\n if (actualCommonType === 'array' || actualCommonType === 'object') {\n try {\n if (typeof stateNotNull === 'object' && typeof stateNotNull.val !== 'undefined') {\n stateNotNull.val = JSON.stringify(stateNotNull.val);\n } else {\n stateNotNull = JSON.stringify(stateNotNull);\n }\n } catch (err: any) {\n context.logWithLineInfo(\n `Could not stringify value for type ${actualCommonType} and id ${id}: ${err.message}`,\n );\n if (typeof callback === 'function') {\n try {\n callback.call(\n sandbox,\n new Error(\n `Could not stringify value for type ${actualCommonType} and id ${id}: ${err.message}`,\n ),\n );\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n }\n }\n }\n // Check min and max of value\n if (typeof stateNotNull === 'object') {\n if (common && typeof stateNotNull.val === 'number') {\n const num: number = stateNotNull.val;\n if (common.min !== undefined && num < common.min) {\n stateNotNull.val = common.min;\n } else if (common.max !== undefined && num > common.max) {\n stateNotNull.val = common.max;\n }\n }\n } else if (common && typeof stateNotNull === 'number') {\n const num: number = stateNotNull;\n if (common.min !== undefined && num < common.min) {\n stateNotNull = common.min;\n }\n if (common.max !== undefined && num > common.max) {\n stateNotNull = common.max;\n }\n }\n\n let stateAsObject: ioBroker.State;\n // modify state here, to make it available in callback\n if (\n stateNotNull === null ||\n typeof stateNotNull !== 'object' ||\n (stateNotNull as ioBroker.SettableState).val === undefined\n ) {\n stateAsObject = context.prepareStateObject(id, {\n val: stateNotNull as ioBroker.StateValue,\n ack: isAck === true || isAck === 'true',\n });\n } else {\n stateAsObject = context.prepareStateObject(id, stateNotNull as ioBroker.SettableState);\n }\n\n // set as comment: from which script this state was set.\n stateAsObject.c = sandbox.scriptName;\n\n if (objects[id]) {\n script.setStatePerMinuteCounter++;\n if (sandbox.verbose) {\n sandbox.log(`setForeignState(id=${id}, state=${JSON.stringify(stateAsObject)})`, 'info');\n }\n\n if (debug) {\n sandbox.log(\n `setForeignState(id=${id}, state=${JSON.stringify(stateAsObject)}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n\n if (typeof callback === 'function') {\n setImmediate(() => {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n });\n }\n } else {\n if (!(adapter.config as JavaScriptAdapterConfig).subscribe) {\n // store actual state to make possible to process value in callback\n // risk that there will be an error on setState is very low,\n // but we will not store new state if the setStateChanged is called\n if (!isChanged) {\n context.interimStateValues[id] = stateAsObject;\n }\n }\n const errHandler = (err: Error | null | undefined, funcId: string): void => {\n err && sandbox.log(`${funcId}: ${err}`, 'error');\n // If adapter holds all states\n if (err && !(adapter.config as JavaScriptAdapterConfig).subscribe) {\n delete context.interimStateValues[id];\n }\n\n if (typeof callback === 'function') {\n setImmediate(() => {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n });\n }\n };\n if (isChanged) {\n if (!(adapter.config as JavaScriptAdapterConfig).subscribe && context.interimStateValues[id]) {\n // if the state is changed, we will compare it with interimStateValues\n const oldState = context.interimStateValues[id];\n const attrs: string[] = Object.keys(stateAsObject).filter(\n attr => attr !== 'ts' && (stateAsObject as Record)[attr] !== undefined,\n );\n if (\n !attrs.every(\n attr =>\n (stateAsObject as Record)[attr] ===\n (oldState as Record)[attr],\n )\n ) {\n // state is changed for sure, and we will call setForeignState\n // and store new state to interimStateValues\n context.interimStateValues[id] = stateAsObject;\n adapter.setForeignState(id, stateAsObject, err => errHandler(err, 'setForeignState'));\n } else {\n // otherwise - do nothing as we have cached state, except callback\n errHandler(null, 'setForeignStateCached');\n }\n } else {\n // adapter doesn't hold all states, or it has not cached then we will simply call setForeignStateChanged\n adapter.setForeignStateChanged(id, { ...stateAsObject, ts: undefined }, err =>\n errHandler(err, 'setForeignStateChanged'),\n );\n }\n } else {\n adapter.setForeignState(id, stateAsObject, err => errHandler(err, 'setForeignState'));\n }\n }\n } else {\n context.logWithLineInfo(`State \"${id}\" not found`);\n if (typeof callback === 'function') {\n setImmediate(() => {\n try {\n callback.call(sandbox, new Error(`State \"${id}\" not found`));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n });\n }\n }\n }\n\n sandbox = {\n mods,\n _id: script._id,\n // @deprecated use scriptName\n name,\n scriptName: name,\n instance: adapter.instance || 0,\n defaultDataDir: context.getAbsoluteDefaultDataDir(),\n verbose,\n exports: {}, // Polyfill for the export object in TypeScript modules\n require: function (md: string): any {\n if (typeof md === 'string' && md.startsWith('node:')) {\n md = md.replace(/^node:/, '');\n }\n\n if (md === 'request') {\n if (!sandbox.__engine.__deprecatedWarnings.includes(md)) {\n sandbox.log(\n `request package is deprecated - please use httpGet (or a stable lib like axios) instead!`,\n 'warn',\n );\n sandbox.__engine.__deprecatedWarnings.push(md);\n }\n }\n\n if (mods[md]) {\n return mods[md];\n }\n\n let error: Error | undefined;\n\n try {\n mods[md] = require(\n adapter.getAdapterScopedPackageIdentifier ? adapter.getAdapterScopedPackageIdentifier(md) : md,\n );\n return mods[md];\n } catch (e: any) {\n error = e as Error;\n }\n\n try {\n // the user requires a module which is not specified in the additional node modules\n // for backward compatibility we check if the module can simply be required directly before we fail (e.g., direct dependencies of JavaScript adapter)\n adapter.log.debug(`Try direct require of \"${md}\" as not specified in the additional dependencies`);\n mods[md] = require(md);\n\n return mods[md];\n } catch (e: any) {\n context.logError(name, `Error by loading module \"${md}\":`, error || e, 6);\n\n void adapter.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: true,\n ack: true,\n c: 'require',\n });\n }\n },\n Buffer: Buffer,\n __engine: {\n __deprecatedWarnings: [],\n __subscriptionsObject: 0,\n __subscriptions: 0,\n __subscriptionsMessage: 0,\n __subscriptionsFile: 0,\n __subscriptionsLog: 0,\n __schedules: 0,\n },\n\n $: function (selector: string): iobJS.QueryResult {\n // following is supported\n // 'type[commonAttr=something]', 'id[commonAttr=something]', id(enumName=\"something\")', id{nativeName=\"something\"}\n // Type can be state, channel or device\n // Attr can be any of the common attributes and can have wildcards *\n // E.g. \"state[id='hm-rpc.0.*]\" or \"hm-rpc.0.*\" returns all states of adapter instance hm-rpc.0\n // channel(room=\"Living room\") => all states in room \"Living room\"\n // channel{TYPE=BLIND}[state.id=*.LEVEL]\n // Switch all states with .STATE of channels with role \"switch\" in \"Wohnzimmer\" to false\n // $('channel[role=switch][state.id=*.STATE](rooms=Wohnzimmer)').setState(false);\n //\n // Following functions are possible, setValue, getValue (only from first), on, each\n\n // Todo CACHE!!!\n\n const result: iobJS.QueryResult = {} as iobJS.QueryResult;\n\n let name = '';\n const commonStrings: string[] = [];\n const enumStrings: string[] = [];\n const nativeStrings: string[] = [];\n let isInsideName = true;\n let isInsideCommonString = false;\n let isInsideEnumString = false;\n let isInsideNativeString = false;\n let currentCommonString = '';\n let currentNativeString = '';\n let currentEnumString = '';\n\n // parse string\n let selectorHasInvalidType = false;\n if (typeof selector === 'string') {\n for (let i = 0; i < selector.length; i++) {\n if (selector[i] === '{') {\n isInsideName = false;\n if (isInsideCommonString || isInsideEnumString || isInsideNativeString) {\n // Error\n break;\n }\n isInsideNativeString = true;\n } else if (selector[i] === '}') {\n isInsideNativeString = false;\n nativeStrings.push(currentNativeString);\n currentNativeString = '';\n } else if (selector[i] === '[') {\n isInsideName = false;\n if (isInsideCommonString || isInsideEnumString || isInsideNativeString) {\n // Error\n break;\n }\n isInsideCommonString = true;\n } else if (selector[i] === ']') {\n isInsideCommonString = false;\n commonStrings.push(currentCommonString);\n currentCommonString = '';\n } else if (selector[i] === '(') {\n isInsideName = false;\n if (isInsideCommonString || isInsideEnumString || isInsideNativeString) {\n // Error\n break;\n }\n isInsideEnumString = true;\n } else if (selector[i] === ')') {\n isInsideEnumString = false;\n enumStrings.push(currentEnumString);\n currentEnumString = '';\n } else if (isInsideName) {\n name += selector[i];\n } else if (isInsideCommonString) {\n currentCommonString += selector[i];\n } else if (isInsideEnumString) {\n currentEnumString += selector[i];\n } else if (isInsideNativeString) {\n currentNativeString += selector[i];\n } //else {\n // some error\n //}\n }\n } else {\n selectorHasInvalidType = true;\n }\n\n // If some error in the selector\n if (selectorHasInvalidType || isInsideEnumString || isInsideCommonString || isInsideNativeString) {\n result.length = 0;\n result.toArray = function () {\n return [];\n };\n result.each = function () {\n return this;\n };\n result.getState = function () {\n return null;\n };\n result.setState = function () {\n return this;\n };\n result.on = function () {\n return this;\n };\n }\n\n if (isInsideEnumString) {\n sandbox.log(`Invalid selector: enum close bracket \")\" cannot be found in \"${selector}\"`, 'warn');\n result.error = 'Invalid selector: enum close bracket \")\" cannot be found';\n return result;\n } else if (isInsideCommonString) {\n sandbox.log(`Invalid selector: common close bracket \"]\" cannot be found in \"${selector}\"`, 'warn');\n result.error = 'Invalid selector: common close bracket \"]\" cannot be found';\n return result;\n } else if (isInsideNativeString) {\n sandbox.log(`Invalid selector: native close bracket \"}\" cannot be found in \"${selector}\"`, 'warn');\n result.error = 'Invalid selector: native close bracket \"}\" cannot be found';\n return result;\n } else if (selectorHasInvalidType) {\n const message = `Invalid selector: selector must be a string but is of type ${typeof selector}`;\n sandbox.log(message, 'warn');\n result.error = message;\n return result;\n }\n\n let commonSelectors: Selector[] = commonStrings.map(selector => splitSelectorString(selector));\n let nativeSelectors: Selector[] = nativeStrings.map(selector => splitSelectorString(selector));\n const enumSelectorObjects: Selector[] = enumStrings.map(_enum => splitSelectorString(_enum));\n const allSelectors: Selector[] = commonSelectors.concat(nativeSelectors, enumSelectorObjects);\n\n // These selectors match the state or object ID and don't belong in the common/native selectors\n // Also use RegExp for the ID matching\n const stateIdSelectors: Selector[] = allSelectors\n .filter(selector => selector.attr === 'state.id')\n .map(selector => addRegExpToIdAttrSelectors(selector));\n const objectIdSelectors: Selector[] = allSelectors\n .filter(selector => selector.attr === 'id')\n .map(selector => addRegExpToIdAttrSelectors(selector));\n commonSelectors = commonSelectors.filter(\n selector => selector.attr !== 'state.id' && selector.attr !== 'id',\n );\n nativeSelectors = nativeSelectors.filter(\n selector => selector.attr !== 'state.id' && selector.attr !== 'id',\n );\n const enumSelectors: string[] = enumSelectorObjects\n .filter(selector => selector.attr !== 'state.id' && selector.attr !== 'id')\n // enums are filtered by their enum id, so transform the selector into that\n .map(selector => `enum.${selector.attr}.${selector.value}`);\n\n name = name.trim();\n\n if (name === 'channel' || name === 'device') {\n // Fill the channels and devices objects with the IDs of all their states,\n // so we can loop over them afterward\n if (!context.channels || !context.devices) {\n context.channels = {};\n context.devices = {};\n for (const _id in objects) {\n if (Object.prototype.hasOwnProperty.call(objects, _id) && objects[_id].type === 'state') {\n const parts = _id.split('.');\n parts.pop();\n const chn = parts.join('.');\n\n parts.pop();\n const dev = parts.join('.');\n\n context.devices[dev] = context.devices[dev] || [];\n context.devices[dev].push(_id);\n\n context.channels[chn] = context.channels[chn] || [];\n context.channels[chn].push(_id);\n }\n }\n }\n }\n\n if (name === 'schedule') {\n if (!context.schedules) {\n context.schedules = [];\n for (const _id in objects) {\n if (Object.prototype.hasOwnProperty.call(objects, _id) && objects[_id].type === 'schedule') {\n context.schedules.push(_id);\n }\n }\n }\n }\n\n /**\n * applies all selectors targeting an object or state ID\n */\n function applyIDSelectors(objId: string, selectors: Selector[]): boolean {\n // Only keep the ID if it matches every ID selector\n return selectors.every(selector => !selector.idRegExp || selector.idRegExp.test(objId));\n }\n\n /**\n * Applies all selectors targeting the Object common properties\n *\n * @param objId - The ID of the object in question\n */\n function applyCommonSelectors(objId: string): boolean {\n const obj = objects[objId];\n if (!obj?.common) {\n return false;\n }\n const objCommon = obj.common;\n\n // make sure this object satisfies all selectors\n return commonSelectors.every(\n selector =>\n // ensure a property exists\n (selector.value === undefined && objCommon[selector.attr] !== undefined) ||\n // or match exact values\n looselyEqualsString(objCommon[selector.attr], selector.value),\n );\n }\n\n /**\n * Applies all selectors targeting the Object native properties\n *\n * @param objId - The ID of the object in question\n */\n function applyNativeSelectors(objId: string): boolean {\n const obj = objects[objId];\n if (!obj || !obj.native) {\n return false;\n }\n const objNative = obj.native;\n // make sure this object satisfies all selectors\n return nativeSelectors.every(\n selector =>\n // ensure a property exists\n (selector.value === undefined && objNative[selector.attr] !== undefined) ||\n // or match exact values\n looselyEqualsString(objNative[selector.attr], selector.value),\n );\n }\n\n /**\n * Applies all selectors targeting the Objects enums\n *\n * @param objId - The ID of the object in question\n */\n function applyEnumSelectors(objId: string): boolean {\n const enumIds: string[] = [];\n eventObj.getObjectEnumsSync(context, objId, enumIds);\n // make sure this object satisfies all selectors\n return enumSelectors.every(_enum => enumIds.includes(_enum));\n }\n\n let res: string[];\n\n if (name === 'schedule') {\n res = context.schedules || [];\n if (objectIdSelectors.length) {\n res = res.filter(channelId => applyIDSelectors(channelId, objectIdSelectors));\n }\n\n // filter out those that don't match every common selector\n if (commonSelectors.length) {\n res = res.filter(id => applyCommonSelectors(id));\n }\n\n // filter out those that don't match every native selector\n if (nativeSelectors.length) {\n res = res.filter(id => applyNativeSelectors(id));\n }\n\n // filter out those that don't match every enum selector\n if (enumSelectors.length) {\n res = res.filter(channelId => applyEnumSelectors(channelId));\n }\n } else if (name === 'channel') {\n if (!context.channels) {\n // TODO: fill the channels and maintain them on all places where context.stateIds will be changed\n }\n const channels = context.channels || {};\n\n // go through all channels\n res = Object.keys(channels);\n // filter out those that don't match every ID selector for the channel ID\n if (objectIdSelectors.length) {\n res = res.filter(channelId => applyIDSelectors(channelId, objectIdSelectors));\n }\n // filter out those that don't match every common selector\n if (commonSelectors.length) {\n res = res.filter(channelId => applyCommonSelectors(channelId));\n }\n // filter out those that don't match every native selector\n if (nativeSelectors.length) {\n res = res.filter(channelId => applyNativeSelectors(channelId));\n }\n // filter out those that don't match every enum selector\n if (enumSelectors.length) {\n res = res.filter(channelId => applyEnumSelectors(channelId));\n }\n\n // retrieve the state ID collection for all remaining channels\n res = res\n .map(id => channels[id])\n // and flatten the array to get only the state IDs\n .reduce((acc, next) => acc.concat(next), []);\n\n // now filter out those that don't match every ID selector for the state ID\n if (stateIdSelectors.length) {\n res = res.filter(stateId => applyIDSelectors(stateId, stateIdSelectors));\n }\n } else if (name === 'device') {\n if (!context.devices) {\n // TODO: fill the devices and maintain them on all places where context.stateIds will be changed\n }\n\n const devices = context.devices || {};\n\n // go through all devices\n res = Object.keys(devices);\n // filter out those that don't match every ID selector for the channel ID\n if (objectIdSelectors.length) {\n res = res.filter(deviceId => applyIDSelectors(deviceId, objectIdSelectors));\n }\n\n // filter out those that don't match every common selector\n if (commonSelectors.length) {\n res = res.filter(deviceId => applyCommonSelectors(deviceId));\n }\n\n // filter out those that don't match every native selector\n if (nativeSelectors.length) {\n res = res.filter(deviceId => applyNativeSelectors(deviceId));\n }\n\n // filter out those that don't match every enum selector\n if (enumSelectors.length) {\n res = res.filter(deviceId => applyEnumSelectors(deviceId));\n }\n\n // retrieve the state ID collection for all remaining devices\n res = res\n .map(id => devices[id])\n // and flatten the array to get only the state IDs\n .reduce((acc, next) => acc.concat(next), []);\n\n // now filter out those that don't match every ID selector for the state ID\n if (stateIdSelectors.length) {\n res = res.filter(stateId => applyIDSelectors(stateId, stateIdSelectors));\n }\n } else {\n // go through all states\n res = context.stateIds;\n // if the \"name\" is not state, then we filter for the ID as well\n if (name && name !== 'state') {\n const r = new RegExp(`^${name.replace(/\\./g, '\\\\.').replace(/\\*/g, '.*')}$`);\n res = res.filter(id => r.test(id));\n }\n\n // filter out those that don't match every ID selector for the object ID or the state ID\n if (objectIdSelectors.length) {\n res = res.filter(id => applyIDSelectors(id, objectIdSelectors));\n }\n\n // filter out those that don't match every ID selector for the state ID\n if (stateIdSelectors.length) {\n res = res.filter(id => applyIDSelectors(id, stateIdSelectors));\n }\n\n // filter out those that don't match every common selector\n if (commonSelectors.length) {\n res = res.filter(id => applyCommonSelectors(id));\n }\n\n // filter out those that don't match every native selector\n if (nativeSelectors.length) {\n res = res.filter(id => applyNativeSelectors(id));\n }\n\n // filter out those that don't match every enum selector\n if (enumSelectors.length) {\n res = res.filter(id => applyEnumSelectors(id));\n }\n }\n\n const resUnique: string[] = [];\n for (let i = 0; i < res.length; i++) {\n if (!resUnique.includes(res[i])) {\n resUnique.push(res[i]);\n }\n }\n\n for (let i = 0; i < resUnique.length; i++) {\n result[i] = resUnique[i];\n }\n result.length = resUnique.length;\n\n // Implementing the Symbol.iterator contract makes the query result iterable\n result[Symbol.iterator] = function* () {\n for (let i = 0; i < result.length; i++) {\n yield result[i];\n }\n };\n result.toArray = function (): string[] {\n return [...resUnique];\n };\n result.each = function (callback: (id: string, index: number) => void | false): iobJS.QueryResult {\n if (typeof callback === 'function') {\n let r: boolean | void;\n for (let i = 0; i < this.length; i++) {\n r = callback(result[i], i);\n if (r === false) {\n break;\n }\n }\n }\n return this;\n };\n // @ts-expect-error fix later\n result.getState = function (\n callback?: iobJS.GetStateCallback,\n ): void | null | undefined | iobJS.TypedState | iobJS.AbsentState {\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n if (typeof callback !== 'function') {\n sandbox.log('You cannot use this function synchronous', 'error');\n } else {\n void adapter.getForeignState(\n this[0],\n (err: Error | null | undefined, state?: ioBroker.State | null): void => {\n void callback(\n err,\n context.convertBackStringifiedValues(this[0], state) as\n | iobJS.TypedState\n | iobJS.AbsentState,\n );\n },\n );\n }\n } else {\n if (!this[0]) {\n return null;\n }\n if (context.interimStateValues[this[0]] !== undefined) {\n return context.convertBackStringifiedValues(this[0], context.interimStateValues[this[0]]) as\n | iobJS.TypedState\n | iobJS.AbsentState;\n }\n return context.convertBackStringifiedValues(this[0], states[this[0]]) as\n | iobJS.TypedState\n | iobJS.AbsentState;\n }\n };\n result.getStateAsync = async function (): Promise<\n iobJS.TypedState | iobJS.AbsentState | null | undefined\n > {\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n const state = await adapter.getForeignStateAsync(this[0]);\n return context.convertBackStringifiedValues(this[0], state) as\n | iobJS.TypedState\n | iobJS.AbsentState\n | null;\n }\n if (!this[0]) {\n return null;\n }\n if (context.interimStateValues[this[0]] !== undefined) {\n return context.convertBackStringifiedValues(this[0], context.interimStateValues[this[0]]) as\n | iobJS.TypedState\n | iobJS.AbsentState\n | null;\n }\n return context.convertBackStringifiedValues(this[0], states[this[0]]) as\n | iobJS.TypedState\n | iobJS.AbsentState\n | null;\n };\n result.setState = function (\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean | 'false' | 'true' | null | iobJS.SetStateCallback,\n callback?: iobJS.SetStateCallback,\n ) {\n if (typeof isAck === 'function') {\n callback = isAck;\n isAck = undefined;\n }\n void result\n .setStateAsync(state, isAck as boolean | 'false' | 'true')\n .then(() => typeof callback === 'function' && callback());\n return this;\n };\n result.setStateAsync = async function (\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean,\n ): Promise {\n for (let i = 0; i < this.length; i++) {\n await sandbox.setStateAsync(this[i], state, isAck);\n }\n };\n result.setStateChanged = function (\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean,\n callback?: () => void,\n ) {\n if (typeof isAck === 'function') {\n callback = isAck;\n isAck = undefined;\n }\n void result.setStateChangedAsync(state, isAck).then(() => typeof callback === 'function' && callback());\n return this;\n };\n result.setStateChangedAsync = async function (\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean,\n ): Promise {\n for (let i = 0; i < this.length; i++) {\n await sandbox.setStateChangedAsync(this[i], state, isAck);\n }\n };\n result.setStateDelayed = function (\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck: boolean | number | undefined,\n delay?: number | boolean,\n clearRunning?: boolean | (() => void),\n callback?: () => void,\n ) {\n if (typeof isAck !== 'boolean') {\n callback = clearRunning as () => void;\n clearRunning = delay as boolean;\n delay = isAck as number;\n isAck = undefined;\n }\n if (typeof delay !== 'number') {\n callback = clearRunning as () => void;\n clearRunning = delay;\n delay = 0;\n }\n if (typeof clearRunning !== 'boolean') {\n callback = clearRunning;\n clearRunning = true;\n }\n let count = this.length;\n for (let i = 0; i < this.length; i++) {\n sandbox.setStateDelayed(this[i], state, isAck as boolean, delay, clearRunning, () => {\n if (!--count && typeof callback === 'function') {\n callback();\n }\n });\n }\n return this;\n };\n result.on = function (callbackOrId: string | ((data: any) => void), value?: any) {\n for (let i = 0; i < this.length; i++) {\n sandbox.subscribe(this[i], callbackOrId, value);\n }\n return this;\n };\n return result;\n },\n log: function (msg: string, severity?: ioBroker.LogLevel): void {\n severity = severity || 'info';\n\n // disable log in log handler (prevent endless loops)\n if (sandbox.logHandler && (sandbox.logHandler === severity || sandbox.logHandler === '*')) {\n return;\n }\n\n if (!adapter.log[severity]) {\n msg = `Unknown severity level \"${severity}\" by log of [${msg}]`;\n severity = 'warn';\n }\n\n if (msg && typeof msg !== 'string') {\n msg = mods.util.format(msg);\n }\n\n if (debugMode) {\n console.log(`${severity}$$${name}$$${msg}`, Date.now());\n } else {\n adapter.log[severity](`${name}: ${msg}`);\n }\n },\n onLog: function (severity: ioBroker.LogLevel, callback: (info: LogMessage) => void): number {\n if (!['info', 'error', 'debug', 'silly', 'warn', '*'].includes(severity)) {\n sandbox.log(`Unknown severity \"${severity}\"`, 'warn');\n return 0;\n }\n if (typeof callback !== 'function') {\n sandbox.log(`Invalid callback for onLog`, 'warn');\n return 0;\n }\n\n const handler = { id: Date.now() + Math.floor(Math.random() * 10000), cb: callback, sandbox, severity };\n context.logSubscriptions[sandbox.scriptName] = context.logSubscriptions[sandbox.scriptName] || [];\n context.logSubscriptions[sandbox.scriptName].push(handler);\n context.updateLogSubscriptions();\n\n sandbox.__engine.__subscriptionsLog += 1;\n\n sandbox.verbose &&\n sandbox.log(\n `onLog(severity=${severity}, id=${handler.id}) - logSubscriptions=${sandbox.__engine.__subscriptionsLog}`,\n 'info',\n );\n\n if (\n sandbox.__engine.__subscriptionsLog %\n (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__subscriptionsLog} log subscriptions registered. Check your script!`,\n 'warn',\n );\n }\n\n return handler.id;\n },\n onLogUnregister: function (\n idOrCallbackOrSeverity: number | ioBroker.LogLevel | ((info: LogMessage) => void),\n ): boolean {\n let found = false;\n\n if (context.logSubscriptions?.[sandbox.scriptName]) {\n sandbox.verbose &&\n sandbox.log(\n `onLogUnregister(idOrCallbackOrSeverity=${JSON.stringify(idOrCallbackOrSeverity)}) - logSubscriptions=${sandbox.__engine.__subscriptionsLog}`,\n 'info',\n );\n\n for (let i = 0; i < context.logSubscriptions[sandbox.scriptName].length; i++) {\n if (\n context.logSubscriptions[sandbox.scriptName][i].cb === idOrCallbackOrSeverity ||\n context.logSubscriptions[sandbox.scriptName][i].id === idOrCallbackOrSeverity ||\n context.logSubscriptions[sandbox.scriptName][i].severity === idOrCallbackOrSeverity\n ) {\n sandbox.verbose &&\n sandbox.log(\n `onLogUnregister(idOrCallbackOrSeverity=${JSON.stringify(idOrCallbackOrSeverity)}, removing id=${context.logSubscriptions[sandbox.scriptName][i].id})`,\n 'info',\n );\n\n context.logSubscriptions[sandbox.scriptName].splice(i, 1);\n i--;\n sandbox.__engine.__subscriptionsLog--;\n\n found = true;\n\n // if deletion via ID\n if (typeof idOrCallbackOrSeverity === 'number') {\n break;\n }\n } else {\n sandbox.verbose &&\n sandbox.log(\n `onLogUnregister(idOrCallbackOrSeverity=${JSON.stringify(idOrCallbackOrSeverity)}) NOT = ${JSON.stringify(context.logSubscriptions[sandbox.scriptName][i])}`,\n 'info',\n );\n }\n }\n }\n\n context.updateLogSubscriptions();\n\n return found;\n },\n exec: function (\n cmd: string,\n options?: ExecOptions | ((error: Error | null | string, stdout?: string, stderr?: string) => void),\n callback?: (error: Error | null | string, stdout?: string, stderr?: string) => void,\n ): undefined | ChildProcess {\n if (typeof options === 'function') {\n callback = options as (error: Error | null | string, stdout?: string, stderr?: string) => void;\n options = {};\n }\n if (!(adapter.config as JavaScriptAdapterConfig).enableExec) {\n const error = 'exec is not available. Please enable \"Enable Exec\" option in instance settings';\n sandbox.log(error, 'error');\n\n if (typeof callback === 'function') {\n setImmediate(callback, error, undefined, undefined);\n }\n } else {\n if (sandbox.verbose) {\n sandbox.log(`exec(cmd=${cmd})`, 'info');\n }\n\n if (debug) {\n sandbox.log(words._('Command %s was not executed, while debug mode is active', cmd), 'warn');\n if (typeof callback === 'function') {\n setImmediate(function () {\n callback(null, '', '');\n });\n }\n } else {\n return mods.child_process.exec(\n cmd,\n options,\n (error: Error | null, stdout: string, stderr: string): void => {\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, error, stdout, stderr);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n },\n );\n }\n }\n },\n email: function (msg: string | SendMailOptions): void {\n if (sandbox.verbose) {\n sandbox.log(`email(msg=${JSON.stringify(msg)})`, 'info');\n }\n sandbox.log(`email(msg=${JSON.stringify(msg)}) is deprecated. Please use sendTo instead!`, 'warn');\n adapter.sendTo('email', msg);\n },\n pushover: function (msg: string | PushoverOptions): void {\n if (sandbox.verbose) {\n sandbox.log(`pushover(msg=${JSON.stringify(msg)})`, 'info');\n }\n sandbox.log(`pushover(msg=${JSON.stringify(msg)}) is deprecated. Please use sendTo instead!`, 'warn');\n adapter.sendTo('pushover', msg);\n },\n httpGet: function (\n url: string,\n options:\n | {\n timeout?: number;\n responseType?: ResponseType;\n headers?: Record;\n basicAuth?: { user: string; password: string } | null;\n bearerAuth?: string;\n validateCertificate?: boolean;\n }\n | ((\n error: Error | null,\n result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n },\n ) => void),\n callback?: (\n error: Error | null,\n result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n },\n ) => void,\n ): void {\n if (typeof options === 'function') {\n callback = options as (\n error: Error | null,\n result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n },\n ) => void;\n options = {};\n }\n\n const config = {\n ...getHttpRequestConfig(url, options, context.allowSelfSignedCerts),\n method: 'get',\n };\n\n if (sandbox.verbose) {\n sandbox.log(`httpGet(config=${JSON.stringify(config)})`, 'info');\n }\n\n const startTime = Date.now();\n\n mods.axios\n .default(config)\n .then((response: AxiosResponse) => {\n const responseTime = Date.now() - startTime;\n\n if (sandbox.verbose) {\n sandbox.log(`httpGet(url=${url}, responseTime=${responseTime}ms)`, 'info');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, null, {\n statusCode: response.status,\n data: response.data,\n headers: response.headers as Record,\n responseTime,\n });\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n })\n .catch((error: any) => {\n const responseTime = Date.now() - startTime;\n\n sandbox.log(`httpGet(url=${url}, error=${error.message})`, 'error');\n\n if (typeof callback === 'function') {\n let result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n } = {\n statusCode: null,\n data: null,\n headers: {},\n responseTime,\n };\n\n if (error.response) {\n result = {\n statusCode: error.response.status,\n data: error.response.data,\n headers: error.response.headers,\n responseTime,\n };\n }\n\n try {\n callback.call(sandbox, error.message, result);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n });\n },\n httpPost: function (\n url: string,\n data: any,\n options:\n | {\n timeout?: number;\n responseType?: ResponseType;\n headers?: Record;\n basicAuth?: { user: string; password: string } | null;\n bearerAuth?: string;\n validateCertificate?: boolean;\n }\n | ((\n error: Error | null,\n result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n },\n ) => void),\n callback?: (\n error: Error | null,\n result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n },\n ) => void,\n ): void {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n\n const config = {\n ...getHttpRequestConfig(\n url,\n options as {\n timeout?: number;\n responseType?: ResponseType;\n headers?: Record;\n basicAuth?: { user: string; password: string } | null;\n bearerAuth?: string;\n validateCertificate?: boolean;\n },\n context.allowSelfSignedCerts,\n ),\n method: 'post',\n data,\n };\n\n if (sandbox.verbose) {\n sandbox.log(`httpPost(config=${JSON.stringify(config)}, data=${data})`, 'info');\n }\n\n const startTime = Date.now();\n\n mods.axios\n .default(config)\n .then((response: AxiosResponse) => {\n const responseTime = Date.now() - startTime;\n\n if (sandbox.verbose) {\n sandbox.log(`httpPost(url=${url}, responseTime=${responseTime}ms)`, 'info');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, null, {\n statusCode: response.status,\n data: response.data,\n headers: response.headers,\n responseTime,\n });\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n })\n .catch((error: unknown) => {\n const responseTime = Date.now() - startTime;\n\n sandbox.log(`httpPost(url=${url}, error=${(error as Error).message})`, 'error');\n\n if (typeof callback === 'function') {\n let result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n } = {\n statusCode: null,\n data: null,\n headers: {},\n responseTime,\n };\n const response: AxiosResponse | undefined = (error as AxiosError).response;\n\n if (response) {\n result = {\n statusCode: response.status,\n data: response.data,\n headers: response.headers,\n responseTime,\n };\n }\n\n try {\n callback.call(sandbox, new Error((error as AxiosError).message), result);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n });\n },\n createTempFile: function (fileName: string, data: Buffer | string): undefined | string {\n const os = mods.os;\n const path = mods.path;\n const fs = mods.fs;\n\n let tempDirPath = context.tempDirectories?.[sandbox.scriptName];\n\n if (!tempDirPath) {\n // create temp directory\n tempDirPath = fs.mkdtempSync(\n path.join(os.tmpdir(), `${sandbox.scriptName.substring(SCRIPT_CODE_MARKER.length)}-`),\n );\n context.tempDirectories[sandbox.scriptName] = tempDirPath;\n\n sandbox.verbose &&\n sandbox.log(\n `createTempFile(fileName=${fileName}, tempDirPath=${tempDirPath}) created temp directory in ${os.tmpdir()}`,\n 'info',\n );\n }\n\n const filePath = path.join(tempDirPath, fileName);\n\n // is sub dir?\n const fileDir = path.dirname(filePath);\n if (!fs.existsSync(fileDir)) {\n fs.mkdirSync(fileDir, { recursive: true });\n }\n\n if (typeof data === 'undefined') {\n sandbox.log(\n `createTempFile(fileName=${fileName}, fileDir=${fileDir}, filePath=${filePath}) data is undefined, file not created!`,\n 'error',\n );\n\n return undefined;\n }\n\n fs.writeFileSync(filePath, data);\n sandbox.verbose &&\n sandbox.log(`createTempFile(fileName=${fileName}, fileDir=${fileDir}, filePath=${filePath})`, 'info');\n\n return filePath;\n },\n subscribe: function (\n pattern:\n | TimeRule\n | AstroRule\n | Pattern\n | SchedulerRule\n | string\n | (TimeRule | AstroRule | Pattern | SchedulerRule | string)[],\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n callbackOrChangeTypeOrId: string | ChangeType | ((event?: EventObj) => void),\n value?: any,\n ):\n | SubscriptionResult\n | IobSchedule\n | string\n | null\n | undefined\n | (SubscriptionResult | IobSchedule | string | null | undefined)[] {\n // If a schedule object is given\n if (\n (typeof pattern === 'string' && pattern[0] === '{') ||\n (typeof pattern === 'object' && (pattern as SchedulerRule).period)\n ) {\n return sandbox.schedule(pattern as SchedulerRule, callbackOrChangeTypeOrId as () => void);\n }\n // If an array of schedules is given\n if (pattern && Array.isArray(pattern)) {\n const result: (IobSchedule | string | null | undefined)[] = [];\n for (const p of pattern) {\n result.push(\n sandbox.subscribe(p as SchedulerRule | string, callbackOrChangeTypeOrId, value) as\n | IobSchedule\n | string\n | null\n | undefined,\n );\n }\n return result;\n }\n\n // detect subscribe('id', 'any', (obj) => {})\n let oPattern: Pattern;\n if (\n (typeof pattern === 'string' || pattern instanceof RegExp) &&\n typeof callbackOrChangeTypeOrId === 'string' &&\n typeof value === 'function'\n ) {\n oPattern = { id: pattern, change: callbackOrChangeTypeOrId as ChangeType };\n callbackOrChangeTypeOrId = value;\n value = undefined;\n } else {\n oPattern = pattern as Pattern;\n }\n\n if (oPattern?.id && Array.isArray(oPattern.id)) {\n const result: (IobSchedule | string | null | undefined)[] = [];\n for (let t = 0; t < oPattern.id.length; t++) {\n const pa: Pattern = JSON.parse(JSON.stringify(oPattern));\n pa.id = oPattern.id[t];\n result.push(\n sandbox.subscribe(pa, callbackOrChangeTypeOrId, value) as\n | IobSchedule\n | string\n | null\n | undefined,\n );\n }\n return result;\n }\n\n // try to detect astro or cron (by spaces)\n if (isObject(pattern) || (typeof pattern === 'string' && pattern.match(/[,/\\d*]+\\s[,/\\d*]+\\s[,/\\d*]+/))) {\n if ((pattern as AstroRule).astro) {\n return sandbox.schedule(pattern as AstroRule, callbackOrChangeTypeOrId as () => void);\n } else if ((pattern as TimeRule).time) {\n return sandbox.schedule(\n (pattern as TimeRule).time as string,\n callbackOrChangeTypeOrId as () => void,\n );\n }\n }\n\n let callback: undefined | ((obj: EventObj) => void);\n\n // source is set by regexp if defined as /regexp/\n if (!isObject(pattern) || pattern instanceof RegExp || (pattern as RegExp).source) {\n oPattern = { id: pattern as string | RegExp, change: 'ne' };\n }\n\n if (oPattern.id !== undefined && !oPattern.id) {\n sandbox.log(`Error by subscription (trigger): empty ID defined. All states matched.`, 'error');\n return;\n } else if (typeof oPattern.id === 'boolean' || typeof oPattern.id === 'number') {\n sandbox.log(`Error by subscription (trigger): Wrong ID of type boolean or number.`, 'error');\n return;\n }\n\n sandbox.__engine.__subscriptions += 1;\n\n if (\n sandbox.__engine.__subscriptions % (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__subscriptions} subscriptions registered. Check your script!`,\n 'warn',\n );\n }\n\n if (oPattern.q === undefined) {\n oPattern.q = 0;\n }\n\n // add adapter namespace if nothing given\n if (oPattern.id && typeof oPattern.id === 'string' && !oPattern.id.includes('.')) {\n oPattern.id = `${adapter.namespace}.${oPattern.id}`;\n }\n\n if (typeof callbackOrChangeTypeOrId === 'function') {\n callback = callbackOrChangeTypeOrId;\n } else {\n if (typeof value === 'undefined') {\n callback = function (obj: EventObj) {\n sandbox.setState(callbackOrChangeTypeOrId, obj.newState.val);\n };\n } else {\n callback = function (/* obj */) {\n sandbox.setState(callbackOrChangeTypeOrId, value);\n };\n }\n }\n\n const subs: SubscriptionResult = {\n pattern: oPattern,\n callback: (obj: EventObj) => {\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, obj);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n },\n name,\n };\n\n // try to extract adapter\n if (oPattern.id && typeof oPattern.id === 'string') {\n const parts = oPattern.id.split('.');\n const a = `${parts[0]}.${parts[1]}`;\n const _adapter = `system.adapter.${a}`;\n\n if (objects[_adapter] && objects[_adapter].common && objects[_adapter].common.subscribable) {\n const alive = `system.adapter.${a}.alive`;\n context.adapterSubs[alive] = context.adapterSubs[alive] || [];\n\n const subExists = context.adapterSubs[alive].filter(sub => sub === oPattern.id).length > 0;\n\n if (!subExists) {\n context.adapterSubs[alive].push(oPattern.id);\n adapter.sendTo(a, 'subscribe', oPattern.id);\n }\n }\n }\n if (sandbox.verbose) {\n sandbox.log(`subscribe: ${JSON.stringify(subs)}`, 'info');\n }\n\n subscribePattern(script, oPattern.id as string);\n\n subs.patternCompareFunctions = getPatternCompareFunctions(oPattern);\n context.subscriptions.push(subs);\n\n if (oPattern.enumName || oPattern.enumId) {\n context.isEnums = true;\n }\n return subs;\n },\n getSubscriptions: function (): Record {\n const result: Record = {};\n for (let s = 0; s < context.subscriptions.length; s++) {\n result[context.subscriptions[s].pattern.id as string] =\n result[context.subscriptions[s].pattern.id as string] || [];\n result[context.subscriptions[s].pattern.id as string].push({\n name: context.subscriptions[s].name,\n pattern: context.subscriptions[s].pattern,\n });\n }\n if (sandbox.verbose) {\n sandbox.log(`getSubscriptions() => ${JSON.stringify(result)}`, 'info');\n }\n return result;\n },\n getFileSubscriptions: function (): Record {\n const result: Record = {};\n for (let s = 0; s < context.subscriptionsFile.length; s++) {\n const key = `${context.subscriptionsFile[s].id}$%$${context.subscriptionsFile[s].fileNamePattern}`;\n result[key] = result[key] || [];\n result[key].push({\n name: context.subscriptionsFile[s].name,\n id: context.subscriptionsFile[s].id,\n fileNamePattern: context.subscriptionsFile[s].fileNamePattern,\n });\n }\n if (sandbox.verbose) {\n sandbox.log(`getFileSubscriptions() => ${JSON.stringify(result)}`, 'info');\n }\n return result;\n },\n adapterSubscribe: function (id: string): void {\n if (typeof id !== 'string') {\n sandbox.log(`adapterSubscribe: invalid type of id ${typeof id}`, 'error');\n return;\n }\n const parts = id.split('.');\n const _adapter = `system.adapter.${parts[0]}.${parts[1]}`;\n if (objects[_adapter]?.common?.subscribable) {\n const a = `${parts[0]}.${parts[1]}`;\n const alive = `system.adapter.${a}.alive`;\n context.adapterSubs[alive] = context.adapterSubs[alive] || [];\n context.adapterSubs[alive].push(id);\n if (sandbox.verbose) {\n sandbox.log(`adapterSubscribe: ${a} - ${id}`, 'info');\n }\n adapter.sendTo(a, 'subscribe', id);\n }\n },\n adapterUnsubscribe: function (\n idOrObject: string | SubscriptionResult | (string | SubscriptionResult)[],\n ): boolean | boolean[] {\n // todo: BF - it could be an error\n return sandbox.unsubscribe(idOrObject);\n },\n unsubscribe: function (\n idOrObject: string | SubscriptionResult | (string | SubscriptionResult)[],\n ): boolean | boolean[] {\n if (idOrObject && Array.isArray(idOrObject)) {\n const result: boolean[] = [];\n for (let t = 0; t < idOrObject.length; t++) {\n result.push(sandbox.unsubscribe(idOrObject[t]) as boolean);\n }\n return result;\n }\n\n if (sandbox.verbose) {\n sandbox.log(`adapterUnsubscribe(id=${JSON.stringify(idOrObject)})`, 'info');\n }\n\n if (isObject(idOrObject)) {\n for (let i = context.subscriptions.length - 1; i >= 0; i--) {\n if (context.subscriptions[i] === idOrObject) {\n unsubscribePattern(script, context.subscriptions[i].pattern.id as string);\n context.subscriptions.splice(i, 1);\n sandbox.__engine.__subscriptions--;\n return true;\n }\n }\n return false;\n }\n let deleted = 0;\n for (let i = context.subscriptions.length - 1; i >= 0; i--) {\n if (context.subscriptions[i].name === name && context.subscriptions[i].pattern.id === idOrObject) {\n deleted++;\n unsubscribePattern(script, context.subscriptions[i].pattern.id as string);\n context.subscriptions.splice(i, 1);\n sandbox.__engine.__subscriptions--;\n }\n }\n return !!deleted;\n },\n on: function (\n pattern:\n | TimeRule\n | AstroRule\n | Pattern\n | SchedulerRule\n | string\n | (TimeRule | AstroRule | Pattern | SchedulerRule | string)[],\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n callbackOrChangeTypeOrId: string | ChangeType | ((event?: EventObj) => void),\n value?: any,\n ):\n | SubscriptionResult\n | IobSchedule\n | string\n | null\n | undefined\n | (SubscriptionResult | IobSchedule | string | null | undefined)[] {\n return sandbox.subscribe(pattern, callbackOrChangeTypeOrId, value);\n },\n onEnumMembers: function (enumId: string, callback: (event?: EventObj) => void): void {\n if (enums.includes(enumId)) {\n const subscriptions: Record = {};\n\n const init = (): void => {\n const obj: ioBroker.EnumObject = objects[enumId] as ioBroker.EnumObject;\n const common: ioBroker.EnumCommon = obj?.common ?? {};\n const members: string[] = common?.members ?? [];\n\n // Remove old subscriptions\n for (const [objId, subscription] of Object.entries(subscriptions)) {\n if (!members.includes(objId)) {\n sandbox.unsubscribe(subscription);\n delete subscriptions[objId];\n }\n }\n\n // Subscribe to all members of enum\n for (const objId of members) {\n if (!Object.keys(subscriptions).includes(objId)) {\n if (objects?.[objId]?.type === 'state') {\n // Just subscribe to states\n subscriptions[objId] = sandbox.subscribe(objId, callback) as\n | string\n | SubscriptionResult; // TODO: more features\n }\n }\n }\n\n sandbox.verbose &&\n sandbox.log(\n `onEnumMembers(id=${enumId}, members=${JSON.stringify(Object.keys(subscriptions))})`,\n 'info',\n );\n };\n\n init();\n\n sandbox.subscribeObject(enumId, obj => obj && init());\n } else {\n sandbox.log(`onEnumMembers: enum with id \"${enumId}\" doesn't exists`, 'error');\n }\n },\n onFile: function (\n id: string,\n fileNamePattern: string | string[],\n withFileOrCallback:\n | boolean\n | ((id: string, fileName: string, size: number, file?: string | Buffer, mimeType?: string) => void),\n callback?: (\n id: string,\n fileName: string,\n size: number | null,\n file?: string | Buffer,\n mimeType?: string,\n ) => void,\n ): undefined | FileSubscriptionResult | (undefined | FileSubscriptionResult)[] {\n if (typeof withFileOrCallback === 'function') {\n callback = withFileOrCallback as (\n id: string,\n fileName: string,\n size: number | null,\n file?: string | Buffer,\n mimeType?: string,\n ) => void;\n withFileOrCallback = false;\n }\n\n if (!adapter.subscribeForeignFiles) {\n sandbox.log(\n 'onFile: your js-controller does not support yet onFile subscribes. Please update to js-controller@4.1.x or newer',\n 'warn',\n );\n return;\n }\n if (!id || !fileNamePattern) {\n sandbox.log(\n 'onFile: invalid parameters. Usage: onFile(\"vis.0\", \"main/*\", true, (id, fileName, size, file, mimeType) => {});',\n 'error',\n );\n return;\n }\n if (typeof callback !== 'function') {\n sandbox.offFile(id, fileNamePattern);\n return;\n }\n\n if (Array.isArray(fileNamePattern)) {\n return fileNamePattern.map(\n filePattern =>\n sandbox.onFile(id, filePattern, withFileOrCallback, callback) as\n | undefined\n | FileSubscriptionResult,\n );\n }\n\n sandbox.__engine.__subscriptionsFile += 1;\n\n sandbox.verbose &&\n sandbox.log(\n `onFile(id=${id}, fileNamePattern=${fileNamePattern}) - fileSubscriptions=${sandbox.__engine.__subscriptionsFile}`,\n 'info',\n );\n\n if (\n sandbox.__engine.__subscriptionsFile %\n (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__subscriptionsFile} file subscriptions registered. Check your script!`,\n 'warn',\n );\n }\n\n let idRegEx: RegExp | undefined;\n let fileRegEx: RegExp | undefined;\n if (id.includes('*')) {\n idRegEx = new RegExp(pattern2RegEx(id));\n }\n if (fileNamePattern.includes('*')) {\n fileRegEx = new RegExp(pattern2RegEx(fileNamePattern));\n }\n\n const subs: FileSubscriptionResult = {\n id,\n fileNamePattern,\n withFile: withFileOrCallback,\n idRegEx,\n fileRegEx,\n callback: (id: string, fileName: string, size: number | null, withFile: boolean): void => {\n try {\n sandbox.verbose &&\n sandbox.log(`onFile changed(id=${id}, fileName=${fileName}, size=${size})`, 'info');\n\n if (withFile && (size || 0) > 0) {\n adapter\n .readFileAsync(id, fileName)\n .then(data => {\n try {\n callback.call(sandbox, id, fileName, size, data.file, data.mimeType);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n })\n .catch(error => errorInCallback(error));\n } else {\n callback.call(sandbox, id, fileName, size);\n }\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n },\n name,\n };\n\n context.subscriptionsFile.push(subs);\n subscribeFile(script, id, fileNamePattern);\n return subs;\n },\n offFile: function (\n idOrObject: FileSubscriptionResult | string | (FileSubscriptionResult | string)[],\n fileNamePattern?: string | string[],\n ): boolean | boolean[] {\n if (!adapter.unsubscribeForeignFiles) {\n sandbox.log(\n 'offFile: your js-controller does not support yet file unsubscribes. Please update to js-controller@4.1.x or newer',\n 'warn',\n );\n return false;\n }\n\n sandbox.verbose &&\n sandbox.log(\n `offFile(idOrObject=${JSON.stringify(idOrObject)}, fileNamePattern=${JSON.stringify(fileNamePattern)}) - fileSubscriptions=${sandbox.__engine.__subscriptionsFile}`,\n 'info',\n );\n\n if (idOrObject && typeof idOrObject === 'object') {\n if (Array.isArray(idOrObject)) {\n const result: boolean[] = [];\n for (let t = 0; t < idOrObject.length; t++) {\n result.push(sandbox.offFile(idOrObject[t]) as boolean);\n }\n return result;\n }\n for (let i = context.subscriptionsFile.length - 1; i >= 0; i--) {\n if (context.subscriptionsFile[i] === idOrObject) {\n unsubscribeFile(\n script,\n context.subscriptionsFile[i].id,\n context.subscriptionsFile[i].fileNamePattern,\n );\n\n sandbox.verbose &&\n sandbox.log(\n `offFile(type=object, fileNamePattern=${JSON.stringify(fileNamePattern)}, removing id=${context.subscriptionsFile[i].id})`,\n 'info',\n );\n\n context.subscriptionsFile.splice(i, 1);\n sandbox.__engine.__subscriptionsFile--;\n return true;\n }\n }\n return false;\n }\n\n if (fileNamePattern && Array.isArray(fileNamePattern)) {\n const result: boolean[] = [];\n for (let t = 0; t < fileNamePattern.length; t++) {\n result.push(sandbox.offFile(idOrObject, fileNamePattern[t]) as boolean);\n }\n return result;\n }\n\n let deleted = 0;\n for (let i = context.subscriptionsFile.length - 1; i >= 0; i--) {\n if (\n context.subscriptionsFile[i].id === idOrObject &&\n context.subscriptionsFile[i].fileNamePattern === fileNamePattern\n ) {\n deleted++;\n unsubscribeFile(\n script,\n context.subscriptionsFile[i].id,\n context.subscriptionsFile[i].fileNamePattern,\n );\n\n sandbox.verbose &&\n sandbox.log(\n `offFile(type=string, fileNamePattern=${fileNamePattern}, removing id=${context.subscriptionsFile[i].id})`,\n 'info',\n );\n\n context.subscriptionsFile.splice(i, 1);\n sandbox.__engine.__subscriptionsFile--;\n }\n }\n return !!deleted;\n },\n /** Registers a one-time subscription which automatically unsubscribes after the first invocation */\n once: function (\n pattern:\n | TimeRule\n | AstroRule\n | Pattern\n | SchedulerRule\n | string\n | (TimeRule | AstroRule | Pattern | SchedulerRule | string)[],\n callback?: (event?: EventObj) => void,\n ): string | SubscriptionResult | Promise {\n function _once(cb: (obj?: EventObj) => void): string | SubscriptionResult {\n // eslint-disable-next-line prefer-const\n let subscription: string | SubscriptionResult;\n const handler = (obj?: EventObj): void => {\n subscription && sandbox.unsubscribe(subscription);\n typeof cb === 'function' && cb(obj);\n };\n subscription = sandbox.subscribe(pattern, handler) as string | SubscriptionResult;\n return subscription;\n }\n if (typeof callback === 'function') {\n // Callback-style: once(\"id\", (obj) => { ... })\n return _once(callback);\n }\n\n // Promise-style: once(\"id\").then(obj => { ... })\n return new Promise(resolve => _once(resolve));\n },\n schedule: function (\n pattern: SchedulerRule | AstroRule | Date | string,\n callback: () => void,\n ): IobSchedule | string | null | undefined {\n if (typeof callback !== 'function') {\n sandbox.log(`schedule callback missing`, 'error');\n return null;\n }\n\n if (\n (typeof pattern === 'string' && pattern[0] === '{') ||\n (typeof pattern === 'object' && (pattern as SchedulerRule).period)\n ) {\n sandbox.verbose &&\n sandbox.log(\n `schedule(wizard=${typeof pattern === 'object' ? JSON.stringify(pattern) : pattern})`,\n 'info',\n );\n\n if (!context.scheduler) {\n sandbox.log(\n `Cannot schedule \"${typeof pattern === 'object' ? JSON.stringify(pattern) : pattern}\" because scheduler is not available`,\n 'error',\n );\n return null;\n }\n\n const schedule: string | null = context.scheduler.add(\n pattern as SchedulerRule | string,\n sandbox.scriptName,\n callback,\n );\n if (schedule) {\n script.wizards.push(schedule);\n sandbox.__engine.__schedules += 1;\n\n if (\n sandbox.__engine.__schedules %\n (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__schedules} schedules registered. Check your script!`,\n 'warn',\n );\n }\n }\n\n return schedule;\n }\n\n const adapterConfig: JavaScriptAdapterConfig = adapter.config as JavaScriptAdapterConfig;\n\n if (typeof pattern === 'object' && (pattern as AstroRule).astro) {\n const astroPattern = pattern as AstroRule;\n const nowDate = new Date();\n\n if (\n adapterConfig.latitude === undefined ||\n adapterConfig.longitude === undefined ||\n adapterConfig.latitude === null ||\n adapterConfig.longitude === null\n ) {\n sandbox.log('Longitude or latitude does not set. Cannot use astro.', 'error');\n return null;\n }\n\n // ensure events are calculated independent of current time\n // TODO: use getAstroStartOfDay of adapter?\n const todayNoon = new Date(nowDate);\n todayNoon.setHours(12, 0, 0, 0);\n let ts = mods.suncalc.getTimes(todayNoon, adapterConfig.latitude, adapterConfig.longitude)[\n astroPattern.astro\n ];\n\n // event on the next day, correct or force recalculation at midnight\n if (todayNoon.getDate() !== ts.getDate()) {\n todayNoon.setDate(todayNoon.getDate() - 1);\n ts = mods.suncalc.getTimes(todayNoon, adapterConfig.latitude, adapterConfig.longitude)[\n astroPattern.astro\n ];\n }\n\n if (ts.getTime().toString() === 'NaN') {\n sandbox.log(\n `Cannot calculate \"${astroPattern.astro}\" for ${adapterConfig.latitude}, ${adapterConfig.longitude}`,\n 'warn',\n );\n ts = new Date(nowDate.getTime());\n\n if (\n astroPattern.astro === 'sunriseEnd' ||\n astroPattern.astro === 'goldenHourEnd' ||\n astroPattern.astro === 'sunset' ||\n astroPattern.astro === 'nightEnd' ||\n astroPattern.astro === 'nauticalDusk'\n ) {\n ts.setHours(23);\n ts.setMinutes(59);\n ts.setSeconds(59);\n } else {\n ts.setHours(23);\n ts.setMinutes(59);\n ts.setSeconds(58);\n }\n }\n\n if (ts && astroPattern.shift) {\n ts = new Date(ts.getTime() + astroPattern.shift * 60000);\n }\n\n if (!ts || ts < nowDate) {\n const date = new Date(nowDate);\n // Event doesn't occur today - try again tomorrow\n // Calculate time till 24:00 (local, NOT UTC) and set timeout\n date.setDate(date.getDate() + 1);\n date.setMinutes(0); // Sometimes timer fires at 23:59:59\n date.setHours(0);\n date.setSeconds(1);\n date.setMilliseconds(0);\n\n sandbox.__engine.__schedules += 1;\n\n if (sandbox.__engine.__schedules % adapterConfig.maxTriggersPerScript === 0) {\n sandbox.log(\n `More than ${sandbox.__engine.__schedules} schedules registered. Check your script!`,\n 'warn',\n );\n }\n\n sandbox.verbose &&\n sandbox.log(\n `schedule(astro=${astroPattern.astro}, offset=${astroPattern.shift}) is tomorrow, waiting until ${date.toISOString()}`,\n 'info',\n );\n\n // Calculate new schedule in the next day\n sandbox.setTimeout(() => {\n if (sandbox.__engine.__schedules > 0) {\n sandbox.__engine.__schedules--;\n }\n sandbox.schedule(astroPattern, callback);\n }, date.getTime() - Date.now());\n\n return;\n }\n\n sandbox.__engine.__schedules += 1;\n\n if (sandbox.__engine.__schedules % adapterConfig.maxTriggersPerScript === 0) {\n sandbox.log(\n `More than ${sandbox.__engine.__schedules} schedules registered. Check your script!`,\n 'warn',\n );\n }\n\n sandbox.setTimeout(() => {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n // Reschedule in 2 seconds\n sandbox.setTimeout(() => {\n if (sandbox.__engine.__schedules > 0) {\n sandbox.__engine.__schedules--;\n }\n sandbox.schedule(astroPattern, callback);\n }, 2000);\n }, ts.getTime() - Date.now());\n\n sandbox.verbose &&\n sandbox.log(\n `schedule(astro=${astroPattern.astro}, offset=${astroPattern.shift}) is today, waiting until ${ts.toISOString()}`,\n 'info',\n );\n } else {\n // fix a problem with sunday and 7\n if (typeof pattern === 'string') {\n // this could be a CRON\n const parts = pattern.replace(/\\s+/g, ' ').split(' ');\n if (parts.length >= 5 && parseInt(parts[5], 10) >= 7) {\n parts[5] = '0';\n }\n pattern = parts.join(' ');\n }\n // created in VM the date object: pattern instanceof Date => false\n // so fix it\n if (typeof pattern === 'object' && (pattern as Date).getDate) {\n pattern = new Date(pattern as Date);\n }\n\n const schedule: IobSchedule = mods.nodeSchedule.scheduleJob(pattern, (): void => {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n });\n if (schedule) {\n sandbox.__engine.__schedules += 1;\n\n if (\n sandbox.__engine.__schedules %\n (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__schedules} schedules registered. Check your script!`,\n 'warn',\n );\n }\n\n schedule._ioBroker = {\n type: 'cron',\n pattern: pattern as string | Date,\n scriptName: sandbox.scriptName,\n id: `cron_${Date.now()}_${Math.round(Math.random() * 100000)}`,\n };\n\n script.schedules.push(schedule);\n } else {\n sandbox.log(`schedule(cron=${JSON.stringify(pattern)}): cannot create schedule`, 'error');\n }\n\n if (sandbox.verbose) {\n sandbox.log(`schedule(cron=${JSON.stringify(pattern)})`, 'info');\n }\n\n return schedule;\n }\n },\n scheduleById: function (id: string, ack: boolean | (() => void) | undefined, callback?: () => void): void {\n let scheduleId: IobSchedule | string | null | undefined = null;\n let currentExp: string | null = null; // current cron expression\n\n if (typeof ack === 'function') {\n callback = ack;\n ack = undefined;\n }\n\n const rhms = /^(2[0-3]|[01]?[0-9]):([0-5]?[0-9]):([0-5]?[0-9])$/; // hh:mm:ss\n const rhm = /^(2[0-3]|[01]?[0-9]):([0-5]?[0-9])$/; // hh:mm\n\n const init = (time: string): void => {\n if (typeof time === 'string') {\n let h: number | undefined = undefined;\n let m: number | undefined = undefined;\n let s: number | undefined = undefined;\n\n let isValid = false;\n\n let result = time.match(rhms);\n if (result) {\n [, h, m, s] = result.map(v => parseInt(v));\n isValid = true;\n } else {\n result = time.match(rhm);\n if (result) {\n [, h, m] = result.map(v => parseInt(v));\n isValid = true;\n }\n }\n\n if (isValid) {\n const cronExp = `${s ?? '0'} ${m ?? '0'} ${h ?? '0'} * * *`;\n\n if (cronExp !== currentExp) {\n sandbox.verbose &&\n sandbox.log(\n `scheduleById(id=${id}): Init with expression ${cronExp} from ${time}`,\n 'info',\n );\n currentExp = cronExp;\n\n if (scheduleId) {\n sandbox.clearSchedule(scheduleId);\n scheduleId = null;\n }\n\n scheduleId = sandbox.schedule(cronExp, () => {\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n });\n }\n } else {\n sandbox.log(\n `scheduleById(id=${id},time=${time}): cannot create schedule - invalid format (HH:MM:SS or H:M:S required)`,\n 'error',\n );\n }\n } else {\n sandbox.log(\n `scheduleById(id=${id}): cannot create schedule - invalid var type (no string)`,\n 'error',\n );\n }\n };\n\n sandbox.getState(id, (err, state) => {\n if (!err && state?.val) {\n if (sandbox.verbose) {\n sandbox.log(`scheduleById(id=${id}): Init with value ${state.val}`, 'info');\n }\n init(state.val.toString());\n }\n });\n\n const triggerDef: Pattern = { id, change: 'any' };\n if (ack !== undefined) {\n triggerDef.ack = ack;\n }\n\n sandbox.on(triggerDef, obj => {\n if (obj?.state?.val) {\n sandbox.verbose &&\n sandbox.log(`scheduleById(id=${id}): Update with value ${obj.state.val}`, 'info');\n init(obj.state.val.toString());\n }\n });\n },\n getAstroDate: function (pattern: AstroEvent, date?: Date | number, offsetMinutes?: number): Date | undefined {\n if (date === undefined) {\n date = new Date();\n }\n if (typeof date === 'number') {\n date = new Date(date);\n } else {\n date = new Date(date.getTime());\n }\n\n if (!consts.astroList.includes(pattern)) {\n const pos = consts.astroListLow.indexOf(pattern.toLowerCase());\n if (pos !== -1) {\n pattern = consts.astroList[pos];\n }\n }\n\n if (\n (!(adapter.config as JavaScriptAdapterConfig).latitude &&\n ((adapter.config as JavaScriptAdapterConfig).latitude as unknown as number) !== 0) ||\n (!(adapter.config as JavaScriptAdapterConfig).longitude &&\n ((adapter.config as JavaScriptAdapterConfig).longitude as unknown as number) !== 0)\n ) {\n sandbox.log('Longitude or latitude does not set. Cannot use astro.', 'error');\n return;\n }\n\n // ensure events are calculated independent of current time\n date.setHours(12, 0, 0, 0);\n let ts = mods.suncalc.getTimes(\n date,\n (adapter.config as JavaScriptAdapterConfig).latitude,\n (adapter.config as JavaScriptAdapterConfig).longitude,\n )[pattern];\n\n if (ts === undefined || ts.getTime().toString() === 'NaN') {\n sandbox.log(\n `Cannot calculate astro date \"${pattern}\" for ${(adapter.config as JavaScriptAdapterConfig).latitude}, ${(adapter.config as JavaScriptAdapterConfig).longitude}`,\n 'warn',\n );\n }\n\n if (sandbox.verbose) {\n sandbox.log(`getAstroDate(pattern=${pattern}, date=${date.toString()}) => ${ts}`, 'info');\n }\n\n if (offsetMinutes !== undefined) {\n ts = new Date(ts.getTime() + offsetMinutes * 60000);\n }\n return ts;\n },\n isAstroDay: function (): boolean | undefined {\n const nowDate = new Date();\n const dayBegin = sandbox.getAstroDate('sunrise');\n const dayEnd = sandbox.getAstroDate('sunset');\n\n if (dayBegin === undefined || dayEnd === undefined) {\n return;\n }\n\n if (sandbox.verbose) {\n sandbox.log(`isAstroDay() => ${nowDate >= dayBegin && nowDate <= dayEnd}`, 'info');\n }\n\n return nowDate >= dayBegin && nowDate <= dayEnd;\n },\n clearSchedule: function (schedule: IobSchedule | ScheduleName | string): boolean {\n if (context.scheduler?.get(schedule as string | ScheduleName)) {\n if (sandbox.verbose) {\n sandbox.log('clearSchedule() => wizard cleared', 'info');\n }\n const pos = script.wizards.indexOf(schedule as string);\n if (pos !== -1) {\n script.wizards.splice(pos, 1);\n if (sandbox.__engine.__schedules > 0) {\n sandbox.__engine.__schedules--;\n }\n }\n context.scheduler.remove(schedule as string | ScheduleName);\n return true;\n }\n for (let i = 0; i < script.schedules.length; i++) {\n if (schedule && typeof schedule === 'object' && (schedule as IobSchedule)._ioBroker?.type === 'cron') {\n if (script.schedules[i]._ioBroker.id === (schedule as IobSchedule)._ioBroker.id) {\n if (!mods.nodeSchedule.cancelJob(script.schedules[i])) {\n sandbox.log('Error by canceling scheduled job', 'error');\n }\n script.schedules.splice(i, 1);\n if (sandbox.__engine.__schedules > 0) {\n sandbox.__engine.__schedules--;\n }\n\n if (sandbox.verbose) {\n sandbox.log('clearSchedule() => cleared', 'info');\n }\n return true;\n }\n } else if (script.schedules[i] === schedule) {\n if (!mods.nodeSchedule.cancelJob(script.schedules[i])) {\n sandbox.log('Error by canceling scheduled job', 'error');\n }\n script.schedules.splice(i, 1);\n if (sandbox.__engine.__schedules > 0) {\n sandbox.__engine.__schedules--;\n }\n\n if (sandbox.verbose) {\n sandbox.log('clearSchedule() => cleared', 'info');\n }\n return true;\n }\n }\n\n if (sandbox.verbose) {\n sandbox.log('clearSchedule() => invalid handler', 'warn');\n }\n return false;\n },\n getSchedules: function (allScripts?: boolean): ScheduleName[] {\n const schedules = context.scheduler?.getList() || [];\n if (allScripts) {\n Object.keys(context.scripts).forEach(\n name =>\n context.scripts[name].schedules &&\n context.scripts[name].schedules.forEach(s =>\n schedules.push(JSON.parse(JSON.stringify(s._ioBroker))),\n ),\n );\n } else {\n script.schedules &&\n script.schedules.forEach(s => schedules.push(JSON.parse(JSON.stringify(s._ioBroker))));\n }\n return schedules;\n },\n setState: function (\n id: string,\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean | 'true' | 'false' | ((err?: Error | null) => void),\n callback?: (err?: Error | null) => void,\n ): void {\n return setStateHelper(sandbox, false, false, id, state, isAck, callback);\n },\n setStateChanged: function (\n id: string,\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean | ((err?: Error | null) => void),\n callback?: (err?: Error | null) => void,\n ): void {\n return setStateHelper(sandbox, false, true, id, state, isAck, callback);\n },\n setStateDelayed: function (\n id: string,\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck: boolean | number | undefined,\n delay?: number | boolean,\n clearRunning?: boolean | ((err?: Error | null) => void),\n callback?: (err?: Error | null) => void,\n ): number | null {\n // find arguments\n if (typeof isAck !== 'boolean') {\n callback = clearRunning as (err?: Error | null) => void;\n clearRunning = delay as boolean;\n delay = isAck as number;\n isAck = undefined;\n }\n if (typeof delay !== 'number') {\n callback = clearRunning as (err?: Error | null) => void;\n clearRunning = delay as boolean;\n delay = 0;\n }\n if (typeof clearRunning !== 'boolean') {\n callback = clearRunning;\n clearRunning = true;\n }\n\n // Check a type of state\n if (!objects[id] && objects[`${adapter.namespace}.${id}`]) {\n id = `${adapter.namespace}.${id}`;\n }\n\n sandbox.verbose &&\n sandbox.log(\n `setStateDelayed(id=${id}, state=${JSON.stringify(state)}, isAck=${isAck}, delay=${delay}, clearRunning=${clearRunning})`,\n 'info',\n );\n\n if (clearRunning) {\n if (timers[id]) {\n sandbox.verbose &&\n sandbox.log(`setStateDelayed: clear ${timers[id].length} running timers`, 'info');\n\n for (let i = 0; i < timers[id].length; i++) {\n clearTimeout(timers[id][i].t);\n }\n delete timers[id];\n } else {\n if (sandbox.verbose) {\n sandbox.log('setStateDelayed: no running timers', 'info');\n }\n }\n }\n // If no delay => starts immediately\n if (!delay) {\n sandbox.setState(id, state, isAck, callback);\n return null;\n }\n // If delay\n timers[id] = timers[id] || [];\n\n // calculate timerId\n context.timerId++;\n if (context.timerId > 0xfffffffe) {\n context.timerId = 0;\n }\n\n // Start timeout\n const timer = setTimeout(\n function (_timerId, _id, _state, _isAck) {\n sandbox.setState(_id, _state, _isAck, callback);\n // delete timer handler\n if (timers[_id]) {\n // optimisation\n if (timers[_id].length === 1) {\n delete timers[_id];\n } else {\n for (let t = 0; t < timers[_id].length; t++) {\n if (timers[_id][t].id === _timerId) {\n timers[_id].splice(t, 1);\n break;\n }\n }\n if (!timers[_id].length) {\n delete timers[_id];\n }\n }\n }\n },\n delay,\n context.timerId,\n id,\n state,\n isAck,\n );\n\n // add timer handler\n timers[id].push({\n t: timer,\n id: context.timerId,\n ts: Date.now(),\n delay: delay,\n val:\n isObject(state) && (state as ioBroker.SettableState).val !== undefined\n ? ((state as ioBroker.SettableState).val as ioBroker.StateValue)\n : (state as ioBroker.StateValue),\n ack:\n isObject(state) &&\n (state as ioBroker.SettableState).val !== undefined &&\n (state as ioBroker.SettableState).ack !== undefined\n ? (state as ioBroker.SettableState).ack\n : isAck,\n });\n\n return context.timerId;\n },\n clearStateDelayed: function (id: string, timerId: number): boolean {\n // Check a type of state\n if (!objects[id] && objects[`${adapter.namespace}.${id}`]) {\n id = `${adapter.namespace}.${id}`;\n }\n\n if (sandbox.verbose) {\n sandbox.log(`clearStateDelayed(id=${id}, timerId=${timerId})`, 'info');\n }\n\n if (timers[id]) {\n for (let i = timers[id].length - 1; i >= 0; i--) {\n if (timerId === undefined || timers[id][i].id === timerId) {\n clearTimeout(timers[id][i].t);\n if (timerId !== undefined) {\n timers[id].splice(i, 1);\n }\n if (sandbox.verbose) {\n sandbox.log(`clearStateDelayed: clear timer ${timers[id][i].id}`, 'info');\n }\n }\n }\n if (timerId === undefined) {\n delete timers[id];\n } else {\n if (!timers[id].length) {\n delete timers[id];\n }\n }\n return true;\n }\n return false;\n },\n getStateDelayed: function (\n id: string | number,\n ):\n | null\n | { timerId: number; left: number; delay: number; val: ioBroker.StateValue; ack?: boolean }\n | { timerId: number; left: number; delay: number; val: ioBroker.StateValue; ack?: boolean }[]\n | Record<\n string,\n { timerId: number; left: number; delay: number; val: ioBroker.StateValue; ack?: boolean }[]\n > {\n const now = Date.now();\n if (id) {\n // Check a type of state\n if (!objects[id] && objects[`${adapter.namespace}.${id}`]) {\n id = `${adapter.namespace}.${id}`;\n }\n // If timerId given\n if (typeof id === 'number') {\n for (const _id_ in timers) {\n if (Object.prototype.hasOwnProperty.call(timers, _id_)) {\n for (let ttt = 0; ttt < timers[_id_].length; ttt++) {\n if (timers[_id_][ttt].id === id) {\n return {\n timerId: id,\n left: timers[_id_][ttt].delay - (now - timers[_id_][ttt].ts),\n delay: timers[_id_][ttt].delay,\n val: timers[_id_][ttt].val,\n ack: timers[_id_][ttt].ack,\n };\n }\n }\n }\n }\n return null;\n }\n\n const result: {\n timerId: number;\n left: number;\n delay: number;\n val: ioBroker.StateValue;\n ack?: boolean;\n }[] = [];\n if (Object.prototype.hasOwnProperty.call(timers, id) && timers[id] && timers[id].length) {\n for (let tt = 0; tt < timers[id].length; tt++) {\n result.push({\n timerId: timers[id][tt].id,\n left: timers[id][tt].delay - (now - timers[id][tt].ts),\n delay: timers[id][tt].delay,\n val: timers[id][tt].val,\n ack: timers[id][tt].ack,\n });\n }\n }\n return result;\n }\n const result: Record<\n string,\n { timerId: number; left: number; delay: number; val: ioBroker.StateValue; ack?: boolean }[]\n > = {};\n for (const _id in timers) {\n if (Object.prototype.hasOwnProperty.call(timers, _id) && timers[_id] && timers[_id].length) {\n result[_id] = [];\n for (let t = 0; t < timers[_id].length; t++) {\n result[_id].push({\n timerId: timers[_id][t].id,\n left: timers[_id][t].delay - (now - timers[_id][t].ts),\n delay: timers[_id][t].delay,\n val: timers[_id][t].val,\n ack: timers[_id][t].ack,\n });\n }\n }\n }\n return result;\n },\n getStateAsync: async function (id: string): Promise {\n let state: ioBroker.State | null | undefined;\n if (id.includes('.')) {\n state = await adapter.getForeignStateAsync(id);\n } else {\n state = await adapter.getStateAsync(id);\n }\n return context.convertBackStringifiedValues(id, state);\n },\n setStateAsync: function (\n id: string,\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean,\n ): Promise {\n return new Promise((resolve, reject) =>\n setStateHelper(sandbox, false, false, id, state, isAck, err => (err ? reject(err) : resolve())),\n );\n },\n setStateChangedAsync: function (\n id: string,\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean,\n ): Promise {\n return new Promise((resolve, reject) =>\n setStateHelper(sandbox, false, true, id, state, isAck, err => (err ? reject(err) : resolve())),\n );\n },\n getState: function (\n id: string,\n callback?: (err: Error | null | undefined, state?: ioBroker.State | null) => void,\n ): undefined | void | (ioBroker.State & { notExist?: true }) | null {\n if (typeof id !== 'string') {\n sandbox.log(`getState has been called with id of type \"${typeof id}\" but expects a string`, 'error');\n return undefined;\n }\n\n if (typeof callback === 'function') {\n if (!id.includes('.')) {\n adapter.getState(id, (err, state) =>\n callback(err, context.convertBackStringifiedValues(id, state)),\n );\n } else {\n void adapter.getForeignState(id, (err, state) =>\n callback(err, context.convertBackStringifiedValues(id, state)),\n );\n }\n } else {\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n sandbox.log(\n 'The \"getState\" method cannot be used synchronously, because the adapter setting \"Do not subscribe to all states on start\" is enabled.',\n 'error',\n );\n sandbox.log(\n `Please disable that setting or use \"getState\" with a callback, e.g.: getState('${id}', (err, state) => { ... });`,\n 'error',\n );\n } else {\n if (states[id]) {\n sandbox.verbose &&\n sandbox.log(\n `getState(id=${id}, timerId=${JSON.stringify(timers[id])}) => ${JSON.stringify(states[id])}`,\n 'info',\n );\n if (context.interimStateValues[id] !== undefined) {\n return context.convertBackStringifiedValues(id, context.interimStateValues[id]);\n }\n return context.convertBackStringifiedValues(id, states[id]);\n } else if (states[`${adapter.namespace}.${id}`]) {\n sandbox.verbose &&\n sandbox.log(\n `getState(id=${id}, timerId=${JSON.stringify(timers[id])}) => ${JSON.stringify(states[`${adapter.namespace}.${id}`])}`,\n 'info',\n );\n if (context.interimStateValues[`${adapter.namespace}.${id}`] !== undefined) {\n return context.convertBackStringifiedValues(\n id,\n context.interimStateValues[`${adapter.namespace}.${id}`],\n );\n }\n return context.convertBackStringifiedValues(id, states[`${adapter.namespace}.${id}`]);\n }\n\n if (sandbox.verbose) {\n sandbox.log(`getState(id=${id}, timerId=${JSON.stringify(timers[id])}) => not found`, 'info');\n }\n\n context.logWithLineInfo(\n `getState \"${id}\" not found (3)${states[id] !== undefined ? ` states[id]=${JSON.stringify(states[id])}` : ''}`,\n ); ///xxx\n return { val: null, notExist: true } as ioBroker.State & { notExist?: true };\n }\n }\n },\n existsState: function (\n id: string,\n callback?: (err: Error | null | undefined, stateExists?: boolean) => void,\n ): void | boolean {\n if (typeof id !== 'string') {\n sandbox.log(`existsState has been called with id of type \"${typeof id}\" but expects a string`, 'error');\n return false;\n }\n\n if (typeof callback === 'function') {\n void adapter.getForeignObject(id, (err, obj) => {\n if (!obj || obj.type !== 'state') {\n callback(err, false);\n return;\n }\n\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n void adapter.getForeignState(id, (err, state) => {\n callback(err, !!state);\n });\n } else {\n callback(err, !!states[id]);\n }\n });\n } else {\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n sandbox.log(\n 'The \"existsState\" method cannot be used synchronously, because the adapter setting \"Do not subscribe to all states on start\" is enabled.',\n 'error',\n );\n sandbox.log(\n `Please disable that setting or use \"existsState\" with a callback, e.g.: existsState('${id}', (err, stateExists) => { ... });`,\n 'error',\n );\n } else {\n return !!states[id];\n }\n }\n },\n existsObject: function (\n id: string,\n callback?: (err: Error | null | undefined, objectExists?: boolean) => void,\n ): void | boolean {\n if (typeof id !== 'string') {\n sandbox.log(\n `existsObject has been called with id of type \"${typeof id}\" but expects a string`,\n 'error',\n );\n return false;\n }\n\n if (typeof callback === 'function') {\n void adapter.getForeignObject(id, (err, obj) => callback(err, !!obj));\n } else {\n return !!objects[id];\n }\n },\n getIdByName: function (name: string, alwaysArray?: boolean): string | string[] | null {\n sandbox.verbose &&\n sandbox.log(\n `getIdByName(name=${name}, alwaysArray=${alwaysArray}) => ${JSON.stringify(context.names[name])}`,\n 'info',\n );\n if (Object.prototype.hasOwnProperty.call(context.names, name)) {\n if (alwaysArray) {\n return !Array.isArray(context.names[name]) ? [context.names[name]] : context.names[name];\n }\n return context.names[name];\n }\n if (alwaysArray) {\n return [];\n }\n return null;\n },\n getObject: function (\n id: string,\n enumName: null | string | ((err: Error | null | undefined, obj?: ioBroker.Object | null) => void),\n cb?: (err: Error | null | undefined, obj?: ioBroker.Object | null) => void,\n ): void | ioBroker.Object | null {\n if (typeof id !== 'string') {\n sandbox.log(`getObject has been called with id of type \"${typeof id}\" but expects a string`, 'error');\n return null;\n }\n\n if (typeof enumName === 'function') {\n cb = enumName;\n enumName = null;\n }\n // with callback\n if (typeof cb === 'function') {\n void adapter.getForeignObject(id, (err, obj) => {\n if (obj) {\n objects[id] = obj;\n } else if (objects[id]) {\n delete objects[id];\n }\n let result: ioBroker.Object | null | undefined;\n try {\n result = JSON.parse(JSON.stringify(objects[id]));\n } catch (err: unknown) {\n void adapter.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: true,\n ack: true,\n c: 'getObject',\n });\n sandbox.log(`Object \"${id}\" can't be copied: ${JSON.stringify(err)}`, 'error');\n return cb(null, null);\n }\n sandbox.verbose &&\n sandbox.log(`getObject(id=${id}, enumName=${enumName}) => ${JSON.stringify(result)}`, 'info');\n cb(err, result);\n });\n } else {\n if (!objects[id]) {\n sandbox.verbose &&\n sandbox.log(`getObject(id=${id}, enumName=${enumName}) => does not exist`, 'info');\n sandbox.log(`Object \"${id}\" does not exist`, 'warn');\n return null;\n }\n if (enumName) {\n const e = eventObj.getObjectEnumsSync(context, id);\n const obj = JSON.parse(JSON.stringify(objects[id]));\n obj.enumIds = JSON.parse(JSON.stringify(e.enumIds));\n obj.enumNames = JSON.parse(JSON.stringify(e.enumNames));\n if (typeof enumName === 'string') {\n const r = new RegExp(`^enum\\\\.${enumName}\\\\.`);\n for (let i = obj.enumIds.length - 1; i >= 0; i--) {\n if (!r.test(obj.enumIds[i])) {\n obj.enumIds.splice(i, 1);\n obj.enumNames.splice(i, 1);\n }\n }\n }\n sandbox.verbose &&\n sandbox.log(`getObject(id=${id}, enumName=${enumName}) => ${JSON.stringify(obj)}`, 'info');\n\n return obj;\n }\n let result: ioBroker.Object | null | undefined;\n try {\n result = JSON.parse(JSON.stringify(objects[id]));\n } catch (err: unknown) {\n void adapter.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: true,\n ack: true,\n c: 'getObject',\n });\n sandbox.log(`Object \"${id}\" can't be copied: ${JSON.stringify(err)}`, 'error');\n return null;\n }\n sandbox.verbose &&\n sandbox.log(`getObject(id=${id}, enumName=${enumName}) => ${JSON.stringify(result)}`, 'info');\n return result;\n }\n },\n // This function will be overloaded later if the modification of objects is allowed\n setObject: function (\n _id: string,\n _obj: ioBroker.Object,\n callback?: (err?: Error | null, res?: { id: string }) => void,\n ): void {\n sandbox.log('Function \"setObject\" is not allowed. Use adapter settings to allow it.', 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(\n sandbox,\n new Error('Function \"setObject\" is not allowed. Use adapter settings to allow it.'),\n );\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n },\n // This function will be overloaded later if the modification of objects is allowed\n extendObject: function (\n _id: string,\n _obj: Partial,\n callback?: (err?: Error | null, res?: { id: string }) => void,\n ): void {\n sandbox.log('Function \"extendObject\" is not allowed. Use adapter settings to allow it.', 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(\n sandbox,\n new Error('Function \"extendObject\" is not allowed. Use adapter settings to allow it.'),\n );\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n },\n // This function will be overloaded later if the modification of objects is allowed\n deleteObject: function (\n _id: string,\n _isRecursive?: boolean | ioBroker.ErrorCallback,\n callback?: ioBroker.ErrorCallback,\n ): void {\n if (typeof _isRecursive === 'function') {\n callback = _isRecursive;\n }\n sandbox.log('Function \"deleteObject\" is not allowed. Use adapter settings to allow it.', 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(\n sandbox,\n new Error('Function \"deleteObject\" is not allowed. Use adapter settings to allow it.'),\n );\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n },\n getEnums: function (enumName?: string): { id: string; members: string[]; name: ioBroker.StringOrTranslated }[] {\n const result: { id: string; members: string[]; name: ioBroker.StringOrTranslated }[] = [];\n const r = enumName ? new RegExp(`^enum\\\\.${enumName}\\\\.`) : false;\n for (let i = 0; i < enums.length; i++) {\n if (!r || r.test(enums[i])) {\n const common: ioBroker.EnumCommon =\n (objects[enums[i]] as ioBroker.EnumObject).common || ({} as ioBroker.EnumCommon);\n result.push({\n id: enums[i],\n members: common.members || [],\n name: common.name || '',\n });\n }\n }\n if (sandbox.verbose) {\n sandbox.log(`getEnums(enumName=${enumName}) => ${JSON.stringify(result)}`, 'info');\n }\n return JSON.parse(JSON.stringify(result));\n },\n createAlias: function (\n name: string,\n alias: string | CommonAlias,\n forceCreation: boolean | Partial | ((err: Error | null) => void) | undefined,\n common?: Partial | Record | ((err: Error | null) => void),\n native?: Record | ((err: Error | null) => void),\n callback?: (err: Error | null) => void,\n ) {\n if (typeof native === 'function') {\n callback = native as (err: Error | null) => void;\n native = {};\n }\n if (typeof common === 'function') {\n callback = common as (err: Error | null) => void;\n common = undefined;\n }\n if (typeof forceCreation === 'function') {\n callback = forceCreation as (err: Error | null) => void;\n forceCreation = undefined;\n }\n if (isObject(forceCreation)) {\n native = common;\n common = forceCreation as Partial;\n forceCreation = undefined;\n }\n\n if (typeof name !== 'string') {\n const err = `Wrong type of name \"${typeof name}\". Expected \"string\".`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n\n if (!name) {\n const err = 'Empty ID is not allowed.';\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n\n if (!name.startsWith('alias.0.')) {\n name = `alias.0.${name}`;\n }\n\n const _common: Partial = (common as Partial) || {};\n if (isObject(_common.alias)) {\n // alias already in common, use this\n } else if (\n isObject(alias) &&\n (typeof (alias as CommonAlias).id === 'string' || isObject((alias as CommonAlias).id))\n ) {\n _common.alias = alias as CommonAlias;\n } else if (typeof alias === 'string') {\n _common.alias = { id: alias };\n } else {\n const err = 'Source ID needs to be provided as string or object with id property.';\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n\n let aliasSourceId = '';\n if (_common.alias) {\n aliasSourceId = isObject(_common.alias.id)\n ? (_common.alias.id as { read: string; write: string }).read\n : (_common.alias.id as string);\n if (!objects[aliasSourceId] && objects[`${adapter.namespace}.${aliasSourceId}`]) {\n aliasSourceId = `${adapter.namespace}.${aliasSourceId}`;\n if (isObject(_common.alias.id)) {\n (_common.alias.id as { read: string; write: string }).read = aliasSourceId;\n } else {\n _common.alias.id = aliasSourceId;\n }\n }\n if (\n isObject(_common.alias.id) &&\n (_common.alias.id as { read: string; write: string }).write &&\n !objects[(_common.alias.id as { read: string; write: string }).write] &&\n objects[`${adapter.namespace}.${(_common.alias.id as { read: string; write: string }).write}`]\n ) {\n (_common.alias.id as { read: string; write: string }).write =\n `${adapter.namespace}.${(_common.alias.id as { read: string; write: string }).write}`;\n }\n }\n const obj = objects[aliasSourceId];\n if (!obj) {\n const err = `Alias source object \"${aliasSourceId}\" does not exist.`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n if (obj.type !== 'state') {\n const err = `Alias source object \"${aliasSourceId}\" must be a state object.`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n if (_common.name === undefined) {\n _common.name = obj.common.name || name;\n }\n if (_common.type === undefined && obj.common.type !== undefined) {\n _common.type = obj.common.type;\n }\n if (_common.role === undefined && obj.common.role !== undefined) {\n _common.role = obj.common.role;\n }\n if (_common.min === undefined && obj.common.min !== undefined) {\n _common.min = obj.common.min;\n }\n if (_common.max === undefined && obj.common.max !== undefined) {\n _common.max = obj.common.max;\n }\n if (_common.step === undefined && obj.common.step !== undefined) {\n _common.step = obj.common.step;\n }\n if (_common.unit === undefined && obj.common.unit !== undefined) {\n _common.unit = obj.common.unit;\n }\n if (_common.desc === undefined && obj.common.desc !== undefined) {\n _common.desc = obj.common.desc;\n }\n\n return sandbox.createState(\n name,\n undefined,\n forceCreation as boolean,\n _common,\n native,\n callback as (err?: Error | null) => void,\n );\n },\n createState: async function (\n name: string,\n initValue: undefined | ioBroker.StateValue | ioBroker.State,\n forceCreation:\n | boolean\n | undefined\n | Record\n | Partial\n | ((err: Error | null) => void),\n common?: Partial | ((err: Error | null) => void),\n native?: Record | ((err: Error | null) => void),\n callback?: (error: Error | null | undefined, id?: string) => void,\n ) {\n if (typeof native === 'function') {\n callback = native as (err?: Error | null) => void;\n native = {};\n }\n if (typeof common === 'function') {\n callback = common as (err?: Error | null) => void;\n common = undefined;\n }\n if (typeof initValue === 'function') {\n callback = initValue as (err?: Error | null) => void;\n initValue = undefined;\n }\n if (typeof forceCreation === 'function') {\n callback = forceCreation as (err?: Error | null) => void;\n forceCreation = undefined;\n }\n if (isObject(initValue)) {\n common = initValue as Partial;\n native = forceCreation as Record;\n forceCreation = undefined;\n initValue = undefined;\n }\n if (isObject(forceCreation)) {\n native = common as Record;\n common = forceCreation as Partial;\n forceCreation = undefined;\n }\n\n if (typeof name !== 'string') {\n const err = `Wrong type of name \"${typeof name}\". Expected \"string\".`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n\n if (!name) {\n const err = 'Empty ID is not allowed.';\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n\n const isAlias = name.startsWith('alias.0.');\n\n const _common: ioBroker.StateCommon = (common || {}) as ioBroker.StateCommon;\n _common.name = _common.name || name;\n _common.role = _common.role || 'state';\n _common.type = _common.type || 'mixed';\n if (!isAlias && initValue === undefined) {\n initValue = _common.def;\n }\n\n native = native || {};\n\n // Check min, max and def values for number\n if (_common.type !== undefined && _common.type === 'number') {\n let min = 0;\n let max = 0;\n let def = 0;\n let err: string | undefined;\n if (_common.min !== undefined) {\n min = _common.min;\n if (typeof min !== 'number') {\n min = parseFloat(min);\n if (isNaN(min)) {\n err = `Wrong type of ${name}.common.min`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n _common.min = min;\n }\n }\n if (_common.max !== undefined) {\n max = _common.max;\n if (typeof max !== 'number') {\n max = parseFloat(max);\n if (isNaN(max)) {\n err = `Wrong type of ${name}.common.max`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n _common.max = max;\n }\n }\n\n if (_common.def !== undefined) {\n if (isAlias) {\n delete _common.def;\n } else {\n def = _common.def;\n if (typeof def !== 'number') {\n def = parseFloat(def);\n if (isNaN(def)) {\n err = `Wrong type of ${name}.common.def`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n _common.def = def;\n }\n }\n }\n\n if (_common.min !== undefined && _common.max !== undefined && min > max) {\n _common.max = min;\n _common.min = max;\n }\n if (_common.def !== undefined && _common.min !== undefined && def < min) {\n _common.def = min;\n }\n if (_common.def !== undefined && _common.max !== undefined && def > max) {\n _common.def = max;\n }\n }\n\n if (sandbox.verbose) {\n sandbox.log(\n `createState(name=${name}, initValue=${JSON.stringify(initValue)}, forceCreation=${JSON.stringify(forceCreation)}, common=${JSON.stringify(common)}, native=${JSON.stringify(native)}, isAlias=${isAlias})`,\n 'debug',\n );\n }\n\n let id = `${adapter.namespace}.${name}`;\n if (name.match(/^javascript\\.\\d+\\./) || name.startsWith('0_userdata.0.') || isAlias) {\n id = name;\n }\n if (id.match(/^javascript\\.\\d+\\.scriptEnabled/)) {\n sandbox.log(\n `Own states (${id}) should not be created in javascript.X.scriptEnabled.*! Please move the states to 0_userdata.0.*`,\n 'info',\n );\n } else if (id.match(/^javascript\\.\\d+\\.scriptProblem/)) {\n sandbox.log(\n `Own states (${id}) should not be created in javascript.X.scriptProblem.*! Please move the states to 0_userdata.0.*`,\n 'info',\n );\n }\n\n // User can create aliases by two ways:\n // - id is starting with \"alias.0.\" and common.alias.id is set, so the state defined in common.alias.id will be created automatically if not exists\n // - id is not starting with \"alias.0.\", but common.alias is set, so the state defined in common.alias will be created automatically if not exists\n if (!isAlias && _common.alias) {\n // check and create if not exists the alias\n let alias: CommonAlias;\n if (typeof _common.alias === 'string') {\n alias = {\n id: _common.alias,\n };\n } else if (typeof _common.alias === 'boolean') {\n const parts = id.split('.');\n parts[0] = 'alias';\n parts[1] = '0';\n\n alias = {\n id: parts.join('.'),\n };\n } else {\n alias = _common.alias;\n }\n delete _common.alias;\n\n if (!(alias.id as string).startsWith('alias.0.')) {\n alias.id = `alias.0.${alias.id as string}`;\n }\n\n let aObj: ioBroker.StateObject | null | undefined;\n try {\n aObj = (await adapter.getForeignObjectAsync(alias.id as string)) as\n | ioBroker.StateObject\n | null\n | undefined;\n } catch {\n // ignore\n }\n if (!aObj) {\n try {\n const _obj: ioBroker.StateObject = {\n _id: alias.id as string,\n type: 'state',\n common: {\n name: `Alias to ${id}`,\n role: 'state',\n type: _common.type,\n read: _common.read,\n write: _common.write,\n unit: _common.unit,\n alias: {\n id,\n read: alias.read,\n write: alias.write,\n },\n },\n native: {},\n };\n\n await adapter.setForeignObjectAsync(alias.id as string, _obj);\n } catch (err: unknown) {\n sandbox.log(`Cannot create alias \"${alias.id as string}\": ${err as Error}`, 'error');\n }\n }\n } else if (isAlias && _common.alias) {\n if (typeof _common.alias === 'string') {\n _common.alias = {\n id: _common.alias,\n };\n }\n const readId = typeof _common.alias.id === 'string' ? _common.alias.id : _common.alias.id.read;\n let writeId: string | undefined =\n typeof _common.alias.id === 'string' ? _common.alias.id : _common.alias.id.write;\n if (writeId === readId) {\n writeId = undefined;\n }\n // try to create the linked states\n let aObj: ioBroker.StateObject | null | undefined;\n try {\n aObj = (await adapter.getForeignObjectAsync(readId)) as ioBroker.StateObject | null | undefined;\n } catch {\n // ignore\n }\n if (!aObj) {\n try {\n await adapter.setForeignObjectAsync(readId, {\n type: 'state',\n common: {\n name: `State for ${id}`,\n role: 'state',\n type: _common.type,\n read: _common.read,\n write: _common.write,\n unit: _common.unit,\n },\n native: {},\n });\n } catch (err: unknown) {\n sandbox.log(`Cannot create alias \"${readId}\": ${err as Error}`, 'error');\n }\n }\n if (writeId && _common.write !== false) {\n try {\n aObj = (await adapter.getForeignObjectAsync(writeId)) as\n | ioBroker.StateObject\n | null\n | undefined;\n } catch {\n // ignore\n }\n if (!aObj) {\n try {\n await adapter.setForeignObjectAsync(writeId, {\n type: 'state',\n common: {\n name: `Write state for ${id}`,\n role: 'state',\n type: _common.type,\n read: _common.read,\n write: _common.write,\n unit: _common.unit,\n },\n native: {},\n });\n } catch (err: unknown) {\n sandbox.log(`Cannot create alias \"${writeId}\": ${err as Error}`, 'error');\n }\n }\n }\n }\n\n let obj: ioBroker.Object | null | undefined;\n try {\n obj = await adapter.getForeignObjectAsync(id);\n } catch {\n // ignore\n }\n\n if (\n obj?._id &&\n validIdForAutomaticFolderCreation(obj._id) &&\n obj.type === 'folder' &&\n obj.native &&\n obj.native.autocreated === 'by automatic ensure logic'\n ) {\n // ignore a default created object because we now have a better defined one\n obj = null;\n }\n\n if (!obj || forceCreation) {\n // create new one\n const newObj: ioBroker.StateObject = {\n _id: id,\n common: _common,\n native,\n type: 'state',\n };\n try {\n await adapter.setForeignObjectAsync(id, newObj);\n } catch (err: unknown) {\n sandbox.log(`Cannot set object \"${id}\": ${err as Error}`, 'warn');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, err as Error);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n\n // Update meta objects\n context.updateObjectContext(id, newObj);\n\n if (!isAlias && initValue !== undefined) {\n if (isObject(initValue) && (initValue as ioBroker.State).ack !== undefined) {\n setStateHelper(sandbox, true, false, id, initValue, callback);\n } else {\n setStateHelper(sandbox, true, false, id, initValue, true, callback);\n }\n } else if (!isAlias && !forceCreation) {\n setStateHelper(sandbox, true, false, id, null, callback);\n } else if (isAlias) {\n try {\n const state = await adapter.getForeignStateAsync(id);\n if (state) {\n states[id] = state;\n }\n } catch {\n // ignore\n }\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, null, id);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n } else if (typeof callback === 'function') {\n try {\n callback.call(sandbox, null, id);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n await ensureObjectStructure(id);\n } else {\n // state yet exists\n if (\n !(adapter.config as JavaScriptAdapterConfig).subscribe &&\n !states[id] &&\n states[`${adapter.namespace}.${id}`] === undefined\n ) {\n states[id] = {\n val: null,\n ack: true,\n lc: Date.now(),\n ts: Date.now(),\n q: 0,\n from: `system.adapter.${adapter.namespace}`,\n };\n }\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, null, id);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n\n await ensureObjectStructure(id);\n }\n },\n deleteState: function (id: string, callback?: (err: Error | null | undefined, found?: boolean) => void): void {\n // todo: check rights\n // todo: also remove from \"names\"\n\n if (sandbox.verbose) {\n sandbox.log(`deleteState(id=${id})`, 'debug');\n }\n\n let found = false;\n if ((id.startsWith('0_userdata.0.') || id.startsWith(adapter.namespace)) && objects[id]) {\n found = true;\n delete objects[id];\n if (states[id]) {\n delete states[id];\n }\n\n adapter.delForeignObject(id, function (err) {\n err && sandbox.log(`Object for state \"${id}\" does not exist: ${err}`, 'warn');\n\n adapter.delForeignState(id, function (err) {\n err && sandbox.log(`Cannot delete state \"${id}\": ${err}`, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, err, found);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n });\n });\n } else if (objects[`${adapter.namespace}.${id}`]) {\n delete objects[`${adapter.namespace}.${id}`];\n found = true;\n if (states[`${adapter.namespace}.${id}`]) {\n delete states[`${adapter.namespace}.${id}`];\n }\n\n adapter.delObject(id, function (err) {\n err && sandbox.log(`Object for state \"${id}\" does not exist: ${err}`, 'warn');\n\n adapter.delState(id, function (err) {\n err && sandbox.log(`Cannot delete state \"${id}\": ${err}`, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, err, found);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n });\n });\n } else {\n const err = 'Not found';\n sandbox.log(`Cannot delete state \"${id}\": ${err}`, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err), found);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n }\n },\n sendTo: function (\n _adapter: string,\n cmd: string,\n msg?: any,\n options?: Record | ((result: any, options: Record, _adapter: string) => void),\n callback?: (result: any, options: Record, _adapter: string) => void,\n ): void {\n const defaultTimeout = 20000;\n\n if (typeof options === 'function') {\n callback = options as (result: any, options: Record, _adapter: string) => void;\n options = { timeout: defaultTimeout };\n }\n\n let timeout: NodeJS.Timeout | null = null;\n if (typeof callback === 'function') {\n const timeoutDuration = parseInt(options?.timeout, 10) || defaultTimeout;\n\n timeout = setTimeout(() => {\n timeout = null;\n\n if (sandbox.verbose) {\n sandbox.log(`sendTo => timeout: ${timeoutDuration}`, 'debug');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, { error: 'timeout' }, options as Record, _adapter);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n callback = undefined;\n }\n }, timeoutDuration);\n }\n\n let cbFunc: undefined | ((result: any) => void);\n if (timeout) {\n cbFunc = function (result: any): void {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n\n if (sandbox.verbose && result) {\n sandbox.log(`sendTo => ${JSON.stringify(result)}`, 'debug');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, result, options as Record, _adapter);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n callback = undefined;\n }\n };\n }\n\n // If specific instance\n if (_adapter.match(/\\.[0-9]+$/)) {\n sandbox.verbose &&\n sandbox.log(\n `sendTo(instance=${_adapter}, cmd=${cmd}, msg=${JSON.stringify(msg)}, hasCallback=${typeof callback === 'function'})`,\n 'info',\n );\n\n adapter.sendTo(_adapter, cmd, msg, cbFunc, options);\n } else {\n // Send it to all instances\n context.adapter.getObjectView(\n 'system',\n 'instance',\n { startkey: `system.adapter.${_adapter}.`, endkey: `system.adapter.${_adapter}.\\u9999` },\n options,\n (err, res) => {\n if (err || !res) {\n sandbox.log(`sendTo failed: ${err?.message}`, 'error');\n return;\n }\n\n const instances = res.rows.map(item => item.id.substring('system.adapter.'.length));\n\n instances.forEach(instance => {\n sandbox.verbose &&\n sandbox.log(\n `sendTo(instance=${instance}, cmd=${cmd}, msg=${JSON.stringify(msg)}, hasCallback=${typeof callback === 'function'})`,\n 'info',\n );\n adapter.sendTo(instance, cmd, msg, cbFunc, options);\n });\n },\n );\n }\n },\n sendto: function (\n _adapter: string,\n cmd: string,\n msg: any,\n callback?: (result: any, options: Record, _adapter: string) => void,\n ): void {\n return sandbox.sendTo(_adapter, cmd, msg, callback);\n },\n sendToAsync: function (_adapter: string, cmd: string, msg?: any, options?: Record): Promise {\n return new Promise((resolve, reject) => {\n sandbox.sendTo(_adapter, cmd, msg, options, res => {\n if (!res || res.error) {\n reject(res ? new Error(res.error) : new Error('Unknown error'));\n } else {\n resolve(res);\n }\n });\n });\n },\n sendToHost: function (host: string, cmd: string, msg?: any, callback?: (result: any) => void): void {\n if (!(adapter.config as JavaScriptAdapterConfig).enableSendToHost) {\n const error =\n 'sendToHost is not available. Please enable \"Enable SendToHost\" option in instance settings';\n sandbox.log(error, 'error');\n\n if (typeof callback === 'function') {\n // leave it as a normal function and not as a lambda, to hide the \"this\" object\n setImmediate(function () {\n callback(error);\n });\n }\n } else {\n sandbox.verbose &&\n sandbox.log(`sendToHost(adapter=${host}, cmd=${cmd}, msg=${JSON.stringify(msg)})`, 'info');\n adapter.sendToHost(host, cmd, msg, callback);\n }\n },\n sendToHostAsync: function (host: string, cmd: string, msg?: any): Promise {\n return new Promise((resolve, reject) => {\n sandbox.sendToHost(host, cmd, msg, res => {\n if (!res || res.error) {\n reject(res ? new Error(res.error) : new Error('Unknown error'));\n } else {\n resolve(res);\n }\n });\n });\n },\n registerNotification: function (msg: string, isAlert?: boolean): void {\n const category = !isAlert ? 'scriptMessage' : 'scriptAlert';\n\n if (sandbox.verbose) {\n sandbox.log(`registerNotification(msg=${msg}, category=${category})`, 'info');\n }\n\n void adapter.registerNotification('javascript', category, msg);\n },\n setInterval: function (callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout | null {\n if (typeof callback === 'function') {\n const int: NodeJS.Timeout = setInterval(() => {\n try {\n callback.call(sandbox, ...args);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, ms);\n script.intervals.push(int);\n\n if (sandbox.verbose) {\n sandbox.log(`setInterval(ms=${ms})`, 'info');\n }\n return int;\n }\n sandbox.log(`Invalid callback for setInterval! - ${typeof callback}`, 'error');\n return null;\n },\n clearInterval: function (id: NodeJS.Timeout): void {\n const pos = script.intervals.indexOf(id);\n if (pos !== -1) {\n if (sandbox.verbose) {\n sandbox.log('clearInterval() => cleared', 'info');\n }\n clearInterval(id);\n script.intervals.splice(pos, 1);\n } else {\n if (sandbox.verbose) {\n sandbox.log('clearInterval() => not found', 'warn');\n }\n }\n },\n setTimeout: function (callback: (args?: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout | null {\n if (typeof callback === 'function') {\n const to = setTimeout(() => {\n // Remove timeout from the list\n const pos = script.timeouts.indexOf(to);\n if (pos !== -1) {\n script.timeouts.splice(pos, 1);\n }\n\n try {\n callback.call(sandbox, ...args);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, ms);\n if (sandbox.verbose) {\n sandbox.log(`setTimeout(ms=${ms})`, 'info');\n }\n\n script.timeouts.push(to);\n return to;\n }\n sandbox.log(`Invalid callback for setTimeout! - ${typeof callback}`, 'error');\n return null;\n },\n clearTimeout: function (id: NodeJS.Timeout): void {\n const pos = script.timeouts.indexOf(id);\n if (pos !== -1) {\n if (sandbox.verbose) {\n sandbox.log('clearTimeout() => cleared', 'info');\n }\n clearTimeout(id);\n script.timeouts.splice(pos, 1);\n } else {\n if (sandbox.verbose) {\n sandbox.log('clearTimeout() => not found', 'warn');\n }\n }\n },\n setImmediate: function (callback: (..._args: any[]) => void, ...args: any[]): void {\n if (typeof callback === 'function') {\n setImmediate(() => {\n try {\n callback.apply(sandbox, args);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n });\n if (sandbox.verbose) {\n sandbox.log('setImmediate()', 'info');\n }\n } else {\n sandbox.log(`Invalid callback for setImmediate! - ${typeof callback}`, 'error');\n }\n },\n cb: function (callback: (..._args: any[]) => void): (...args: any[]) => void {\n return function (args: any[]) {\n if (context.scripts[name]?._id === sandbox._id) {\n if (typeof callback === 'function') {\n try {\n callback.apply(sandbox, args);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n } else {\n sandbox.log(`Callback for old version of script: ${name}`, 'warn');\n }\n };\n },\n compareTime: function (\n startTime: iobJS.AstroDate | string | Date | number,\n endTime: iobJS.AstroDate | string | Date | number | null,\n operation: 'between' | 'not between' | '<' | '<=' | '>' | '>=' | '==' | '<>' | '!=',\n time?: iobJS.AstroDate | string | Date | number,\n ): boolean {\n if (startTime && typeof startTime === 'string') {\n const pos = consts.astroListLow.indexOf(startTime.toLowerCase());\n if (pos !== -1) {\n const aTime = sandbox.getAstroDate(consts.astroList[pos]);\n if (aTime) {\n startTime = aTime.toLocaleTimeString([], {\n hour: '2-digit',\n minute: '2-digit',\n hour12: false,\n });\n } else {\n startTime = 0;\n }\n }\n } else if (startTime && isObject(startTime) && (startTime as iobJS.AstroDate).astro) {\n const aTime = sandbox.getAstroDate(\n (startTime as iobJS.AstroDate).astro,\n (startTime as iobJS.AstroDate).date || new Date(),\n (startTime as iobJS.AstroDate).offset || 0,\n );\n if (aTime) {\n startTime = aTime.toLocaleTimeString([], {\n hour: '2-digit',\n minute: '2-digit',\n hour12: false,\n });\n } else {\n startTime = 0;\n }\n }\n\n if (endTime && typeof endTime === 'string') {\n const pos = consts.astroListLow.indexOf(endTime.toLowerCase());\n if (pos !== -1) {\n const aTime = sandbox.getAstroDate(consts.astroList[pos]);\n endTime =\n aTime?.toLocaleTimeString([], {\n hour: '2-digit',\n minute: '2-digit',\n hour12: false,\n }) || 0;\n }\n } else if (endTime && isObject(endTime) && (endTime as iobJS.AstroDate).astro) {\n const aTime = sandbox.getAstroDate(\n (endTime as iobJS.AstroDate).astro,\n (endTime as iobJS.AstroDate).date || new Date(),\n (endTime as iobJS.AstroDate).offset || 0,\n );\n endTime =\n aTime?.toLocaleTimeString([], {\n hour: '2-digit',\n minute: '2-digit',\n hour12: false,\n }) || 0;\n }\n\n // --- Convert \"time\" to number\n let nTime: number | undefined;\n // maybe it is astro date like 'sunrise' or 'sunset'\n if (time && typeof time === 'string') {\n const pos = consts.astroListLow.indexOf(time.toLowerCase());\n if (pos !== -1) {\n nTime = sandbox.getAstroDate(consts.astroList[pos])?.getTime() || 0;\n }\n } else if (time && isObject(time) && (time as iobJS.AstroDate).astro) {\n nTime =\n sandbox\n .getAstroDate(\n (time as iobJS.AstroDate).astro,\n (time as iobJS.AstroDate).date || new Date(),\n (time as iobJS.AstroDate).offset || 0,\n )\n ?.getTime() || 0;\n }\n\n let daily = true;\n if (time) {\n daily = false;\n }\n // if not astro date\n if (!nTime) {\n if (time && !isObject(time)) {\n if (typeof time === 'string' && !time.includes(' ') && !time.includes('T')) {\n const parts = time.split(':');\n const oTime = new Date();\n oTime.setHours(parseInt(parts[0], 10));\n oTime.setMinutes(parseInt(parts[1], 10));\n oTime.setMilliseconds(0);\n\n if (parts.length === 3) {\n oTime.setSeconds(parseInt(parts[2], 10));\n } else {\n oTime.setSeconds(0);\n }\n nTime = oTime.getTime();\n } else {\n nTime = new Date(time as string | number).getTime();\n }\n } else if (!time) {\n const oTime = new Date();\n oTime.setMilliseconds(0);\n nTime = oTime.getTime();\n } else {\n // If Date\n nTime = (time as Date).getTime();\n }\n }\n // --- End of conversion \"time\" to number\n if (typeof startTime === 'string') {\n if (!startTime.includes(' ') && !startTime.includes('T')) {\n const parts = startTime.split(':');\n startTime = new Date();\n startTime.setHours(parseInt(parts[0], 10));\n startTime.setMinutes(parseInt(parts[1], 10));\n startTime.setMilliseconds(0);\n\n if (parts.length === 3) {\n startTime.setSeconds(parseInt(parts[2], 10));\n } else {\n startTime.setSeconds(0);\n }\n } else {\n daily = false;\n startTime = new Date(startTime);\n }\n } else {\n daily = false;\n startTime = new Date(startTime as number | Date);\n }\n const nStartTime = startTime.getTime();\n\n let nEndTime: number | null;\n if (endTime && typeof endTime === 'string') {\n if (!endTime.includes(' ') && !endTime.includes('T')) {\n const parts = endTime.split(':');\n endTime = new Date();\n endTime.setHours(parseInt(parts[0], 10));\n endTime.setMinutes(parseInt(parts[1], 10));\n endTime.setMilliseconds(0);\n\n if (parts.length === 3) {\n endTime.setSeconds(parseInt(parts[2], 10));\n } else {\n endTime.setSeconds(0);\n }\n } else {\n daily = false;\n endTime = new Date(endTime);\n }\n } else if (endTime) {\n daily = false;\n endTime = new Date(endTime as number | Date);\n } else {\n endTime = null;\n }\n\n if (endTime) {\n nEndTime = endTime.getTime();\n } else {\n nEndTime = null;\n }\n\n if (operation === 'between') {\n if (nEndTime) {\n if (nStartTime > nEndTime && daily) {\n return !(nTime >= nEndTime && nTime < nStartTime);\n }\n return nTime >= nStartTime && nTime < nEndTime;\n }\n sandbox.log(`missing or unrecognized endTime expression: ${JSON.stringify(endTime)}`, 'warn');\n return false;\n }\n\n if (operation === 'not between') {\n if (nEndTime) {\n if (nStartTime > nEndTime && daily) {\n return nTime >= nEndTime && nTime < nStartTime;\n }\n return !(nTime >= nStartTime && nTime < nEndTime);\n }\n sandbox.log(`missing or unrecognized endTime expression: ${JSON.stringify(endTime)}`, 'warn');\n return false;\n }\n\n if (operation === '>') {\n return nTime > nStartTime;\n }\n if (operation === '>=') {\n return nTime >= nStartTime;\n }\n if (operation === '<') {\n return nTime < nStartTime;\n }\n if (operation === '<=') {\n return nTime <= nStartTime;\n }\n if (operation === '==') {\n return nTime === nStartTime;\n }\n if (operation === '<>' || operation === '!=') {\n return nTime !== nStartTime;\n }\n sandbox.log(`Invalid operator: ${operation as string}`, 'warn');\n return false;\n },\n onStop: function (cb: () => void, timeout?: number): void {\n if (sandbox.verbose) {\n sandbox.log(`onStop(timeout=${timeout})`, 'info');\n }\n\n script.onStopCb = cb;\n script.onStopTimeout = timeout || 1000;\n },\n formatValue: function (value: number | string, decimals: number | string, format?: string): string {\n if (typeof decimals === 'string') {\n format = decimals;\n decimals = 0;\n }\n if (!format) {\n if (adapter.isFloatComma !== undefined) {\n format = adapter.isFloatComma ? '.,' : ',.';\n } else if (objects['system.config'] && objects['system.config'].common) {\n format = objects['system.config'].common.isFloatComma ? '.,' : ',.';\n }\n }\n return adapter.formatValue(value, decimals, format);\n },\n formatDate: function (\n date: Date | string | number | iobJS.AstroDate,\n format?: string,\n language?: ioBroker.Languages,\n ): string {\n if (!format) {\n if (adapter.dateFormat) {\n format = adapter.dateFormat;\n } else {\n format =\n objects['system.config'] && objects['system.config'].common\n ? objects['system.config'].common.dateFormat || 'DD.MM.YYYY'\n : 'DD.MM.YYYY';\n }\n format = format || 'DD.MM.YYYY';\n }\n // maybe it is astro date like 'sunrise' or 'sunset'\n if (date && typeof date === 'string') {\n const pos = consts.astroListLow.indexOf(date.toLowerCase());\n if (pos !== -1) {\n date = sandbox.getAstroDate(consts.astroList[pos])?.getTime() || 0;\n }\n } else if (date && isObject(date) && (date as iobJS.AstroDate).astro) {\n date =\n sandbox\n .getAstroDate(\n (date as iobJS.AstroDate).astro,\n (date as iobJS.AstroDate).date || new Date(),\n (date as iobJS.AstroDate).offset || 0,\n )\n ?.getTime() || 0;\n }\n\n if (format.match(/[WНOО]+/)) {\n let text: string = adapter.formatDate(date as Date | string | number, format);\n if (!language || !consts.dayOfWeeksFull[language]) {\n language =\n adapter.language ||\n (objects['system.config'] &&\n objects['system.config'].common &&\n objects['system.config'].common.language) ||\n 'en';\n if (!consts.dayOfWeeksFull[language as ioBroker.Languages]) {\n language = 'en';\n }\n }\n if (typeof date === 'number' || typeof date === 'string') {\n date = new Date(date);\n } else if (typeof (date as Date).getMonth !== 'function') {\n sandbox.log(`Invalid date object provided: ${JSON.stringify(date)}`, 'error');\n return 'Invalid date';\n }\n const d: number = (date as Date).getDay();\n text = text.replace('НН', consts.dayOfWeeksFull[language as ioBroker.Languages][d]);\n let initialText = text;\n text = text.replace('WW', consts.dayOfWeeksFull[language as ioBroker.Languages][d]);\n\n if (initialText === text) {\n text = text.replace('W', consts.dayOfWeeksShort[language as ioBroker.Languages][d]);\n }\n\n text = text.replace('Н', consts.dayOfWeeksShort[language as ioBroker.Languages][d]);\n text = text.replace('Н', consts.dayOfWeeksShort[language as ioBroker.Languages][d]);\n const m: number = (date as Date).getMonth();\n initialText = text;\n text = text.replace('OOO', consts.monthFullGen[language as ioBroker.Languages][m]);\n text = text.replace('ООО', consts.monthFullGen[language as ioBroker.Languages][m]);\n text = text.replace('OO', consts.monthFull[language as ioBroker.Languages][m]);\n text = text.replace('ОО', consts.monthFull[language as ioBroker.Languages][m]);\n\n if (initialText === text) {\n text = text.replace('O', consts.monthShort[language as ioBroker.Languages][m]);\n }\n return text;\n }\n return adapter.formatDate(date as string | number | Date, format);\n },\n formatTimeDiff: function (diff: number, format?: string): string {\n if (!format) {\n format = 'hh:mm:ss';\n }\n\n let text = format;\n\n if (sandbox.verbose) {\n sandbox.log(`formatTimeDiff(format=${format}, diff=${diff})`, 'debug');\n }\n\n const second = 1000;\n const minute = 60 * second;\n const hour = 60 * minute;\n const day = 24 * hour;\n const neg = diff < 0;\n diff = Math.abs(diff);\n\n if (/(? void),\n callback?: (err?: Error | null) => void,\n ): void {\n if (typeof data === 'function' || !data) {\n callback = data as (err?: Error | null) => void;\n data = fileName;\n fileName = _adapter;\n _adapter = '0_userdata.0';\n }\n _adapter = _adapter || '0_userdata.0';\n\n if (debug) {\n sandbox.log(\n `writeFile(adapter=${_adapter}, fileName=${fileName}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n setTimeout(function (): void {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, 0);\n }\n } else {\n if (sandbox.verbose) {\n sandbox.log(`writeFile(adapter=${_adapter}, fileName=${fileName})`, 'info');\n }\n if (callback) {\n adapter.writeFile(_adapter, fileName, data, callback);\n } else {\n // @ts-expect-error should be fixed in js-controller\n adapter.writeFile(_adapter, fileName, data);\n }\n }\n },\n readFile: function (\n _adapter: string,\n fileName: string | ((err: Error | null | undefined, data?: Buffer | string, mimeType?: string) => void),\n callback?: (err: Error | null | undefined, data?: Buffer | string, mimeType?: string) => void,\n ): void {\n if (typeof fileName === 'function') {\n callback = fileName as (\n err: Error | null | undefined,\n data?: Buffer | string,\n mimeType?: string,\n ) => void;\n fileName = _adapter;\n _adapter = '0_userdata.0';\n }\n if (typeof callback !== 'function') {\n sandbox.log(`readFile(adapter=${_adapter}, fileName=${fileName}): no callback`, 'error');\n return;\n }\n _adapter = _adapter || '0_userdata.0';\n if (sandbox.verbose) {\n sandbox.log(`readFile(adapter=${_adapter}, fileName=${fileName})`, 'info');\n }\n\n adapter.fileExists(_adapter, fileName, (error: Error | null | undefined, result?: boolean): void => {\n if (error) {\n callback(error);\n } else if (!result) {\n callback(new Error('Not exists'));\n } else {\n adapter.readFile(_adapter, fileName, callback);\n }\n });\n },\n unlink: function (\n _adapter: string,\n fileName: string | ((err?: Error | null) => void),\n callback?: (err?: Error | null) => void,\n ): void {\n if (typeof fileName === 'function') {\n callback = fileName;\n fileName = _adapter;\n _adapter = '0_userdata.0';\n }\n _adapter = _adapter || '0_userdata.0';\n\n if (debug) {\n sandbox.log(\n `unlink(adapter=${_adapter}, fileName=${fileName}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n setTimeout(function (): void {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, 0);\n }\n } else {\n if (sandbox.verbose) {\n sandbox.log(`unlink(adapter=${_adapter}, fileName=${fileName})`, 'info');\n }\n if (callback) {\n adapter.unlink(_adapter, fileName, callback);\n } else {\n // @ts-expect-error should be fixed in js-controller\n adapter.unlink(_adapter, fileName);\n }\n }\n },\n delFile: function (\n _adapter: string,\n fileName: string | ((err?: Error | null) => void),\n callback?: (err?: Error | null) => void,\n ): void {\n return sandbox.unlink(_adapter, fileName as string, callback);\n },\n rename: function (\n _adapter: string,\n oldName: string,\n newName: string,\n callback?: (err?: Error | null) => void,\n ): void {\n _adapter = _adapter || '0_userdata.0';\n\n if (debug) {\n sandbox.log(\n `rename(adapter=${_adapter}, oldName=${oldName}, newName=${newName}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n setTimeout(function () {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, 0);\n }\n } else {\n sandbox.verbose &&\n sandbox.log(`rename(adapter=${_adapter}, oldName=${oldName}, newName=${newName})`, 'info');\n if (callback) {\n adapter.rename(_adapter, oldName, newName, callback);\n } else {\n // @ts-expect-error should be fixed in js-controller\n adapter.rename(_adapter, oldName, newName);\n }\n }\n },\n renameFile: function (\n _adapter: string,\n oldName: string,\n newName: string,\n callback?: (err?: Error | null) => void,\n ): void {\n return sandbox.rename(_adapter, oldName, newName, callback);\n },\n getHistory: function (\n instance: string | (ioBroker.GetHistoryOptions & { id: string; timeout?: number | string }),\n options:\n | (ioBroker.GetHistoryOptions & { id?: string; timeout?: number | string })\n | ((\n error: Error | null,\n result?: ioBroker.GetHistoryResult | null,\n options?: ioBroker.GetHistoryOptions & { id: string; timeout?: number | string },\n instance?: string,\n ) => void),\n callback?: (\n error: Error | null,\n result?: ioBroker.GetHistoryResult | null,\n options?: ioBroker.GetHistoryOptions & { id: string; timeout?: number | string },\n instance?: string,\n ) => void,\n ): void {\n if (isObject(instance)) {\n callback = options as (\n error: Error | null,\n result?: ioBroker.GetHistoryResult | null,\n options?: ioBroker.GetHistoryOptions & { id: string; timeout?: number | string },\n instance?: string,\n ) => void;\n options = instance as ioBroker.GetHistoryOptions & { id?: string; timeout?: number | string };\n instance = '';\n }\n\n if (typeof callback !== 'function') {\n return sandbox.log('No callback found!', 'error');\n }\n if (!isObject(options)) {\n return sandbox.log('No options found!', 'error');\n }\n if (!(options as ioBroker.GetHistoryOptions & { id?: string; timeout?: number | string }).id) {\n return sandbox.log('No ID found!', 'error');\n }\n const timeoutMs =\n parseInt(\n (options as ioBroker.GetHistoryOptions & { id?: string; timeout?: number })\n ?.timeout as unknown as string,\n 10,\n ) || 20000;\n\n if (!instance) {\n // @ts-expect-error defaultHistory is private attribute of adapter. Fix later\n if (adapter.defaultHistory) {\n // @ts-expect-error defaultHistory is private attribute of adapter. Fix later\n instance = adapter.defaultHistory;\n } else {\n instance = objects['system.config']?.common?.defaultHistory || null;\n }\n }\n\n if (sandbox.verbose) {\n sandbox.log(`getHistory(instance=${instance as string}, options=${JSON.stringify(options)})`, 'info');\n }\n\n if (!instance) {\n sandbox.log('No default history instance found!', 'error');\n try {\n callback.call(sandbox, new Error('No default history instance found!'));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n return;\n }\n if ((instance as string).startsWith('system.adapter.')) {\n instance = (instance as string).substring('system.adapter.'.length);\n }\n\n if (!objects[`system.adapter.${instance as string}`]) {\n sandbox.log(`Instance \"${instance as string}\" not found!`, 'error');\n try {\n callback.call(sandbox, new Error(`Instance \"${instance as string}\" not found!`));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n return;\n }\n\n let _timeout: NodeJS.Timeout | null = setTimeout(() => {\n _timeout = null;\n if (sandbox.verbose) {\n sandbox.log('getHistory => timeout', 'debug');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(\n sandbox,\n new Error('Timeout'),\n null,\n options as ioBroker.GetHistoryOptions & { id: string; timeout?: number | string },\n instance as string,\n );\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n callback = undefined;\n }\n }, timeoutMs);\n\n adapter.sendTo(\n instance as string,\n 'getHistory',\n {\n id: (options as ioBroker.GetHistoryOptions & { id: string; timeout?: number | string }).id,\n options,\n },\n (res: any): void => {\n if (_timeout) {\n clearTimeout(_timeout);\n _timeout = null;\n }\n const result: {\n error?: string;\n result?: ioBroker.GetHistoryResult;\n step?: number;\n sessionId?: string;\n } = res;\n\n if (sandbox.verbose && result?.error) {\n sandbox.log(`getHistory => ${result.error}`, 'error');\n }\n if (sandbox.verbose && result?.result) {\n sandbox.log(`getHistory => ${result.result.length} items`, 'debug');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(\n sandbox,\n result.error ? new Error(result.error) : null,\n result.result,\n options as ioBroker.GetHistoryOptions & { id: string; timeout?: number | string },\n instance as string,\n );\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n callback = undefined;\n }\n },\n );\n },\n runScript: function (scriptName: string, callback?: (err?: Error | null) => void): boolean {\n scriptName = scriptName || name;\n if (!scriptName.match(/^script\\.js\\./)) {\n scriptName = `script.js.${scriptName}`;\n }\n // start another script\n if (!objects[scriptName] || !objects[scriptName].common) {\n sandbox.log(`Cannot start \"${scriptName}\", because not found`, 'error');\n return false;\n }\n if (debug) {\n sandbox.log(\n `runScript(scriptName=${scriptName}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n typeof callback === 'function' && callback();\n return true;\n }\n if (objects[scriptName].common.enabled) {\n objects[scriptName].common.enabled = false;\n adapter.extendForeignObject(scriptName, { common: { enabled: false } }, (/* err, obj */) => {\n adapter.extendForeignObject(\n scriptName,\n { common: { enabled: true } },\n err => typeof callback === 'function' && callback(err),\n );\n });\n return true;\n }\n adapter.extendForeignObject(\n scriptName,\n { common: { enabled: true } },\n err => typeof callback === 'function' && callback(err),\n );\n return true;\n },\n runScriptAsync: function (scriptName: string): Promise {\n let done = false;\n return new Promise((resolve, reject) => {\n const result = sandbox.runScript(scriptName, err => {\n if (err) {\n reject(err);\n done = true;\n } else {\n resolve();\n }\n });\n if (result === false && !done) {\n reject(new Error(`Script ${scriptName} was not found!`));\n }\n });\n },\n startScript: function (\n scriptName: string,\n ignoreIfStarted?: boolean | ((err: Error | null | undefined, started: boolean) => void),\n callback?: (err: Error | null | undefined, started: boolean) => void,\n ): boolean {\n if (typeof ignoreIfStarted === 'function') {\n callback = ignoreIfStarted as (err: Error | null | undefined, started: boolean) => void;\n ignoreIfStarted = false;\n }\n scriptName ||= name;\n if (!scriptName.match(/^script\\.js\\./)) {\n scriptName = `script.js.${scriptName}`;\n }\n // start another script\n if (!objects[scriptName] || !objects[scriptName].common) {\n sandbox.log(`Cannot start \"${scriptName}\", because not found`, 'error');\n return false;\n }\n if (debug) {\n sandbox.log(\n `startScript(scriptName=${scriptName}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n typeof callback === 'function' && callback(null, false);\n return true;\n }\n if (objects[scriptName].common.enabled) {\n if (!ignoreIfStarted) {\n adapter.extendForeignObject(scriptName, { common: { enabled: false } }, () => {\n adapter.extendForeignObject(\n scriptName,\n { common: { enabled: true } },\n err => typeof callback === 'function' && callback(err, true),\n );\n });\n } else if (typeof callback === 'function') {\n callback(null, false);\n }\n return true;\n }\n adapter.extendForeignObject(scriptName, { common: { enabled: true } }, err => {\n typeof callback === 'function' && callback(err, true);\n });\n return true;\n },\n startScriptAsync: function (scriptName: string, ignoreIfStarted?: boolean): Promise {\n return new Promise((resolve, reject) => {\n const result = sandbox.startScript(\n scriptName,\n !!ignoreIfStarted,\n (err: Error | null | undefined, started: boolean): void => {\n if (err) {\n reject(err);\n } else {\n resolve(started);\n }\n },\n );\n if (result === false) {\n reject(new Error(`Script ${scriptName} was not found!`));\n }\n });\n },\n stopScript: function (\n scriptName: string,\n callback?: (err: Error | null | undefined, stopped: boolean) => void,\n ): boolean {\n scriptName = scriptName || name;\n\n if (!scriptName.match(/^script\\.js\\./)) {\n scriptName = `script.js.${scriptName}`;\n }\n\n // stop another script\n if (!objects[scriptName] || !objects[scriptName].common) {\n sandbox.log(`Cannot stop \"${scriptName}\", because not found`, 'error');\n return false;\n }\n if (debug) {\n sandbox.log(\n `stopScript(scriptName=${scriptName}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n callback(null, false);\n }\n return true;\n }\n if (objects[scriptName].common.enabled) {\n objects[scriptName].common.enabled = false;\n adapter.extendForeignObject(scriptName, { common: { enabled: false } }, err => {\n if (typeof callback === 'function') {\n callback(err, true);\n }\n });\n } else if (typeof callback === 'function') {\n callback(null, false);\n }\n return true;\n },\n stopScriptAsync: function (scriptName: string): Promise {\n return new Promise((resolve, reject) => {\n const result = sandbox.stopScript(\n scriptName,\n (err: Error | null | undefined, stopped: boolean): void => {\n if (err) {\n reject(err);\n } else {\n resolve(stopped);\n }\n },\n );\n if (result === false) {\n reject(new Error(`Script ${scriptName} was not found!`));\n }\n });\n },\n isScriptActive: function (scriptName: string): boolean {\n if (!scriptName.match(/^script\\.js\\./)) {\n scriptName = `script.js.${scriptName}`;\n }\n if (!objects[scriptName] || !objects[scriptName].common) {\n sandbox.log('Script does not exist', 'error');\n return false;\n }\n return objects[scriptName].common.enabled;\n },\n startInstanceAsync: async function (instanceName: string): Promise {\n const objInstanceId = `system.adapter.${instanceName}`;\n const exists = await adapter.foreignObjectExists(objInstanceId);\n\n if (exists) {\n const instanceObj = await adapter.getForeignObjectAsync(objInstanceId);\n\n if (instanceObj?.type === 'instance' && !instanceObj.common.enabled) {\n await adapter.extendForeignObjectAsync(objInstanceId, { common: { enabled: true } });\n\n if (sandbox.verbose) {\n sandbox.log(`startInstanceAsync (instanceName=${instanceName})`, 'info');\n }\n\n return true;\n }\n sandbox.log(`Cannot start instance \"${instanceName}\", because already running`, 'warn');\n } else {\n sandbox.log(`Cannot start instance \"${instanceName}\", because not found`, 'error');\n }\n\n return false;\n },\n restartInstanceAsync: async function (instanceName: string): Promise {\n const objInstanceId = `system.adapter.${instanceName}`;\n const exists = await adapter.foreignObjectExists(objInstanceId);\n\n if (exists) {\n const instanceObj = await adapter.getForeignObjectAsync(objInstanceId);\n\n if (instanceObj?.type === 'instance' && instanceObj.common.enabled) {\n await adapter.extendForeignObjectAsync(objInstanceId, {});\n\n if (sandbox.verbose) {\n sandbox.log(`restartInstanceAsync (instanceName=${instanceName})`, 'info');\n }\n\n return true;\n }\n sandbox.log(`Cannot restart instance \"${instanceName}\", because not running`, 'warn');\n } else {\n sandbox.log(`Cannot restart instance \"${instanceName}\", because not found`, 'error');\n }\n\n return false;\n },\n stopInstanceAsync: async function (instanceName: string): Promise {\n const objInstanceId = `system.adapter.${instanceName}`;\n const exists = await adapter.foreignObjectExists(objInstanceId);\n\n if (exists) {\n const instanceObj = await adapter.getForeignObjectAsync(objInstanceId);\n\n if (instanceObj?.type === 'instance' && instanceObj.common.enabled) {\n await adapter.extendForeignObjectAsync(objInstanceId, { common: { enabled: false } });\n\n if (sandbox.verbose) {\n sandbox.log(`stopInstanceAsync (instanceName=${instanceName})`, 'info');\n }\n\n return true;\n }\n sandbox.log(`Cannot stop instance \"${instanceName}\", because not running`, 'warn');\n } else {\n sandbox.log(`Cannot stop instance \"${instanceName}\", because not found`, 'error');\n }\n\n return false;\n },\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n toInt: function (val: boolean | string | number | 'true' | 'false'): number {\n if (val === true || val === 'true') {\n val = 1;\n }\n if (val === false || val === 'false') {\n val = 0;\n }\n val = parseInt(val as unknown as string) || 0;\n return val;\n },\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n toFloat: function (val: boolean | string | number | 'true' | 'false'): number {\n if (val === true || val === 'true') {\n val = 1;\n }\n if (val === false || val === 'false') {\n val = 0;\n }\n val = parseFloat(val as unknown as string) || 0;\n return val;\n },\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n toBoolean: function (val: boolean | string | number | 'true' | 'false'): boolean {\n if (val === '1' || val === 'true') {\n val = true;\n }\n if (val === '0' || val === 'false') {\n val = false;\n }\n return !!val;\n },\n getAttr: function (obj: string | Record, path: string | string[]): any {\n if (typeof path === 'string') {\n path = path.split('.');\n }\n if (typeof obj === 'string') {\n try {\n obj = JSON.parse(obj);\n } catch (err: unknown) {\n void adapter.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: true,\n ack: true,\n c: 'getAttr',\n });\n sandbox.log(`Cannot parse \"${obj.substring(0, 30)}\": ${err as Error}`, 'error');\n\n return null;\n }\n }\n\n const attr: string = path.shift() || '';\n try {\n obj = (obj as Record)[attr];\n } catch (err: unknown) {\n void adapter.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: true,\n ack: true,\n c: 'getAttr',\n });\n sandbox.log(`Cannot get ${attr} of \"${JSON.stringify(obj)}\": ${err as Error}`, 'error');\n\n return null;\n }\n\n if (!path.length) {\n return obj;\n }\n const type = typeof obj;\n if (obj === null || obj === undefined || type === 'boolean' || type === 'number') {\n return null;\n }\n return sandbox.getAttr(obj, path);\n },\n messageTo: function (\n target: string | { instance: string | null | number; script: string | null; message: string },\n data: any,\n options: { timeout?: number | string } | ((result: any, options: { timeout?: number | string }) => void),\n callback?: (result: any, options: { timeout?: number | string }, instance: string | number | null) => void,\n ) {\n const defaultTimeout = 5000;\n\n if (typeof target !== 'object') {\n target = { instance: null, script: null, message: target };\n }\n if (typeof options === 'function') {\n callback = options;\n options = { timeout: defaultTimeout };\n }\n\n let timeout: NodeJS.Timeout | null = null;\n if (typeof callback === 'function') {\n const timeoutDuration = parseInt(options?.timeout as unknown as string, 10) || defaultTimeout;\n\n timeout = setTimeout(() => {\n timeout = null;\n\n if (sandbox.verbose) {\n sandbox.log(`messageTo => timeout: ${timeoutDuration}`, 'debug');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, { error: 'timeout' }, options, target.instance);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n callback = undefined;\n }\n }, timeoutDuration);\n }\n let cbFunc: undefined | ((result: any) => void);\n if (timeout) {\n cbFunc = function (res: any) {\n timeout && clearTimeout(timeout);\n const result: { result?: any; error?: string | null } = res;\n\n if (sandbox.verbose && result?.result) {\n sandbox.log(`messageTo => ${JSON.stringify(result)}`, 'debug');\n }\n if (sandbox.verbose && result?.error) {\n sandbox.log(`messageTo => ${result.error}`, 'error');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, result, options, target.instance);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n callback = undefined;\n }\n };\n }\n\n if (target.instance || target.instance === 0) {\n if (\n typeof target.instance === 'string' &&\n target.instance &&\n target.instance.startsWith('system.adapter.')\n ) {\n target.instance = target.instance.substring('system.adapter.'.length);\n } else if (typeof target.instance === 'number') {\n target.instance = `javascript.${target.instance}`;\n }\n\n adapter.sendTo(\n target.instance,\n 'jsMessageBus',\n { message: target.message, script: target.script, data },\n cbFunc,\n );\n } else {\n // Send it to all instances\n context.adapter.getObjectView(\n 'system',\n 'instance',\n { startkey: 'system.adapter.javascript.', endkey: 'system.adapter.javascript.\\u9999' },\n options,\n (err: Error | null | undefined, res): void => {\n if (err || !res) {\n sandbox.log(`messageTo failed: ${err?.message}`, 'error');\n return;\n }\n const len = 'system.adapter.'.length;\n const instances = res.rows.map(item => item.id.substring(len));\n\n instances.forEach(instance => {\n adapter.sendTo(\n instance,\n 'jsMessageBus',\n { message: target.message, script: target.script, data },\n cbFunc,\n );\n });\n },\n );\n }\n },\n messageToAsync: function (\n target: string | { instance: string | null | number; script: string | null; message: string },\n data: any,\n options?: { timeout?: number | string },\n ): Promise {\n return new Promise((resolve, reject) => {\n sandbox.messageTo(target, data, options, (res: any): void => {\n const result: { error?: string } = res;\n if (sandbox.verbose) {\n sandbox.log(`messageTo result => ${JSON.stringify(res)}`, 'debug');\n }\n if (!res || result.error) {\n reject(result ? new Error(result.error) : new Error('Unknown error'));\n } else {\n resolve(result);\n }\n });\n });\n },\n onMessage: function (\n messageName: string,\n callback: (data: any, cb: (result: any) => void) => void,\n ): null | number {\n if (typeof callback !== 'function') {\n sandbox.log('onMessage callback is not a function', 'error');\n\n return null;\n }\n context.messageBusHandlers[sandbox.scriptName] = context.messageBusHandlers[sandbox.scriptName] || {};\n context.messageBusHandlers[sandbox.scriptName][messageName] =\n context.messageBusHandlers[sandbox.scriptName][messageName] || [];\n\n const handler = { id: Date.now() + Math.floor(Math.random() * 10000), cb: callback, sandbox };\n context.messageBusHandlers[sandbox.scriptName][messageName].push(handler);\n\n sandbox.__engine.__subscriptionsMessage += 1;\n\n if (\n sandbox.__engine.__subscriptionsMessage %\n (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__subscriptionsMessage} message subscriptions registered. Check your script!`,\n 'warn',\n );\n }\n\n return handler.id;\n },\n onMessageUnregister: function (idOrName: number | string): boolean {\n const ctx = context.messageBusHandlers[sandbox.scriptName];\n let found = false;\n if (ctx) {\n if (typeof idOrName === 'number') {\n for (const messageName in ctx) {\n if (Object.prototype.hasOwnProperty.call(ctx, messageName)) {\n for (let i = 0; i < ctx[messageName].length; i++) {\n if (ctx[messageName][i].id === idOrName) {\n ctx[messageName].splice(i, 1);\n if (!ctx[messageName].length) {\n delete ctx[messageName];\n sandbox.__engine.__subscriptionsMessage--;\n }\n found = true;\n break;\n }\n }\n }\n if (found) {\n break;\n }\n }\n } else if (idOrName && ctx[idOrName]) {\n delete ctx[idOrName];\n sandbox.__engine.__subscriptionsMessage--;\n found = true;\n }\n }\n return found;\n },\n console: {\n log: function (msg: string): void {\n sandbox.log(msg, 'info');\n },\n error: function (msg: string): void {\n sandbox.log(msg, 'error');\n },\n warn: function (msg: string): void {\n sandbox.log(msg, 'warn');\n },\n info: function (msg: string): void {\n sandbox.log(msg, 'info');\n },\n debug: function (msg: string): void {\n sandbox.log(msg, 'debug');\n },\n },\n jsonataExpression: function (data: any, expression: string): Promise {\n return jsonata(expression).evaluate(data);\n },\n wait: function (ms: number): Promise {\n return new Promise((resolve: () => void): void => {\n sandbox.setTimeout(resolve, ms);\n });\n },\n sleep: function (ms: number): Promise {\n return sandbox.wait(ms);\n },\n onObject: function (\n pattern: string | string[],\n callback: (id: string, obj?: ioBroker.Object | null) => void,\n ): SubscribeObject | SubscribeObject[] | null {\n return sandbox.subscribeObject(pattern, callback);\n },\n subscribeObject: function (\n pattern: string | string[],\n callback: (id: string, obj?: ioBroker.Object | null) => void,\n ): SubscribeObject | SubscribeObject[] | null {\n if (Array.isArray(pattern)) {\n const result: {\n name: string;\n pattern: string;\n callback: (id: string, obj?: ioBroker.Object | null) => void;\n }[] = [];\n for (let p = 0; p < pattern.length; p++) {\n result.push(\n sandbox.subscribeObject(pattern[p], callback) as {\n name: string;\n pattern: string;\n callback: (id: string, obj?: ioBroker.Object | null) => void;\n },\n );\n }\n return result;\n }\n\n sandbox.__engine.__subscriptionsObject += 1;\n\n if (\n sandbox.__engine.__subscriptionsObject %\n (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__subscriptionsObject} object subscriptions registered. Check your script!`,\n 'warn',\n );\n }\n\n // source is set by regexp if defined as /regexp/\n if (!pattern || typeof pattern !== 'string') {\n sandbox.log('Error by subscribeObject: pattern can be only string or array of strings.', 'error');\n return null;\n }\n\n if (typeof callback !== 'function') {\n sandbox.log('Error by subscribeObject: callback is not a function', 'error');\n return null;\n }\n\n const subs: SubscribeObject = { pattern, callback, name };\n if (sandbox.verbose) {\n sandbox.log(`subscribeObject: ${JSON.stringify(subs)}`, 'info');\n }\n\n adapter.subscribeForeignObjects(pattern);\n\n context.subscriptionsObject.push(subs);\n\n return subs;\n },\n unsubscribeObject: function (subObject: SubscribeObject | SubscribeObject[]): boolean | boolean[] {\n if (subObject && Array.isArray(subObject)) {\n const result: boolean[] = [];\n for (let t = 0; t < subObject.length; t++) {\n result.push(sandbox.unsubscribeObject(subObject[t]) as boolean);\n }\n return result;\n }\n\n if (sandbox.verbose) {\n sandbox.log(`adapterUnsubscribeObject(id=${JSON.stringify(subObject)})`, 'info');\n }\n\n for (let i = context.subscriptionsObject.length - 1; i >= 0; i--) {\n if (context.subscriptionsObject[i] === subObject) {\n adapter.unsubscribeForeignObjects(subObject.pattern);\n context.subscriptionsObject.splice(i, 1);\n sandbox.__engine.__subscriptionsObject--;\n return true;\n }\n }\n let deleted = 0;\n for (let i = context.subscriptionsObject.length - 1; i >= 0; i--) {\n if (\n context.subscriptionsObject[i].name &&\n context.subscriptionsObject[i].pattern === subObject.pattern\n ) {\n deleted++;\n adapter.unsubscribeForeignObjects(subObject.pattern);\n context.subscriptionsObject.splice(i, 1);\n sandbox.__engine.__subscriptionsObject--;\n }\n }\n return !!deleted;\n },\n // internal function to send the block debugging info to the front-end\n _sendToFrontEnd: function (blockId: string, data: any): void {\n if (context.rulesOpened === sandbox.scriptName) {\n void adapter.setState(\n 'debug.rules',\n JSON.stringify({ ruleId: sandbox.scriptName, blockId, data, ts: Date.now() }),\n true,\n );\n }\n },\n existsStateAsync: function (_id: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n existsObjectAsync: function (_id: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n getObjectAsync: function (_id: string, _enumName: null | string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n setObjectAsync: function (_id: string, _obj: ioBroker.Object): Promise<{ id: string }> {\n return Promise.reject(new Error('Not implemented'));\n },\n extendObjectAsync: function (_id: string, _obj: Partial): Promise<{ id: string }> {\n return Promise.reject(new Error('Not implemented'));\n },\n deleteObjectAsync: function (_id: string, _isRecursive?: boolean): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n createStateAsync: function (\n _name: string,\n _initValue: undefined | ioBroker.StateValue | ioBroker.State,\n _forceCreation:\n | boolean\n | undefined\n | Record\n | Partial\n | ((err: Error | null) => void),\n _common?: Partial | ((err: Error | null) => void),\n _native?: Record | ((err: Error | null) => void),\n ): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n createAliasAsync: function (\n _name: string,\n _alias: string | CommonAlias,\n _forceCreation: boolean | Partial | undefined,\n _common?: Partial | Record,\n _native?: Record,\n ): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n deleteStateAsync: function (_id: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n writeFileAsync: function (\n _adapter: string,\n _fileName: string | Buffer,\n _data?: string | Buffer,\n ): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n readFileAsync: function (_adapter: string, _fileName?: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n unlinkAsync: function (_adapter: string, _fileName?: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n delFileAsync: function (_adapter: string, _fileName?: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n renameAsync: function (_adapter: string, _oldName: string, _newName?: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n renameFileAsync: function (_adapter: string, _oldName: string, _newName?: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n getHistoryAsync: function (\n _instance: string | (ioBroker.GetHistoryOptions & { id: string; timeout?: number | string }),\n _options?: ioBroker.GetHistoryOptions & { id?: string; timeout?: number | string },\n ): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n httpGetAsync: function (\n _url: string,\n _options?: {\n timeout?: number;\n responseType?: ResponseType;\n headers?: Record;\n basicAuth?: { user: string; password: string } | null;\n bearerAuth?: string;\n validateCertificate?: boolean;\n },\n ): Promise<{\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n }> {\n return Promise.reject(new Error('Not implemented'));\n },\n httpPostAsync: function (\n _url: string,\n _data: any,\n _options: {\n timeout?: number;\n responseType?: ResponseType;\n headers?: Record;\n basicAuth?: { user: string; password: string } | null;\n bearerAuth?: string;\n validateCertificate?: boolean;\n },\n ): Promise<{\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n }> {\n return Promise.reject(new Error('Not implemented'));\n },\n };\n\n // Create advanced functions that can modify objects\n if ((adapter.config as JavaScriptAdapterConfig).enableSetObject) {\n sandbox.setObject = function (\n id: string,\n obj: ioBroker.Object,\n callback?: (err?: Error | null, res?: { id: string }) => void,\n ): void {\n if (id && typeof id === 'string' && id.startsWith('system.adapter.')) {\n sandbox.log(\n `Using setObject on system object ${id} can be dangerous (protected instance attributes may be lost)`,\n 'info',\n );\n }\n if (debug) {\n sandbox.log(\n `setObject(id=${id}, obj=${JSON.stringify(obj)}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n setImmediate(function () {\n try {\n callback.call(sandbox, null, { id });\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n });\n }\n } else {\n if (sandbox.verbose) {\n sandbox.log(`setObject(id=${id}, obj=${JSON.stringify(obj)})`, 'info');\n }\n adapter.setForeignObject(id, obj, (err, res) => {\n if (!err) {\n // Update meta object data\n context.updateObjectContext(id, obj);\n }\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, err, res);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n });\n }\n };\n sandbox.extendObject = function (\n id: string,\n obj: Partial,\n callback?: (err?: Error | null, obj?: { id: string }) => void,\n ): void {\n if (debug) {\n sandbox.log(\n `extendObject(id=${id}, obj=${JSON.stringify(obj)}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n setTimeout(function () {\n try {\n callback.call(sandbox, null, { id });\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, 0);\n }\n } else {\n if (sandbox.verbose) {\n sandbox.log(`extendObject(id=${id}, obj=${JSON.stringify(obj)})`, 'info');\n }\n if (callback) {\n adapter.extendForeignObject(id, JSON.parse(JSON.stringify(obj)), callback);\n } else {\n void adapter.extendForeignObject(id, JSON.parse(JSON.stringify(obj)));\n }\n }\n };\n sandbox.deleteObject = function (id: string, isRecursive?: boolean, callback?: ioBroker.ErrorCallback): void {\n if (typeof isRecursive === 'function') {\n callback = isRecursive;\n isRecursive = false;\n }\n if (debug) {\n sandbox.log(\n `deleteObject(id=${id}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n setTimeout(function () {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, 0);\n }\n } else {\n if (sandbox.verbose) {\n sandbox.log(`deleteObject(id=${id})`, 'info');\n }\n adapter.delForeignObject(id, { recursive: isRecursive }, callback);\n }\n };\n }\n\n // promisify methods on the sandbox\n sandbox.existsStateAsync = promisify(sandbox.existsState);\n sandbox.existsObjectAsync = promisify(sandbox.existsObject);\n sandbox.getObjectAsync = promisify(sandbox.getObject);\n sandbox.setObjectAsync = promisify(sandbox.setObject);\n sandbox.extendObjectAsync = promisify(sandbox.extendObject);\n sandbox.deleteObjectAsync = promisify(sandbox.deleteObject);\n sandbox.createStateAsync = promisify(sandbox.createState);\n sandbox.createAliasAsync = promisify(sandbox.createAlias);\n sandbox.deleteStateAsync = promisify(sandbox.deleteState);\n sandbox.writeFileAsync = promisify(sandbox.writeFile);\n sandbox.readFileAsync = promisify(sandbox.readFile);\n sandbox.unlinkAsync = promisify(sandbox.unlink);\n sandbox.delFileAsync = promisify(sandbox.delFile);\n sandbox.renameAsync = promisify(sandbox.rename);\n sandbox.renameFileAsync = promisify(sandbox.renameFile);\n sandbox.getHistoryAsync = promisify(sandbox.getHistory);\n sandbox.httpGetAsync = promisify(sandbox.httpGet);\n sandbox.httpPostAsync = promisify(sandbox.httpPost);\n\n // Make all predefined properties and methods readonly so scripts cannot overwrite them\n for (const prop of Object.keys(sandbox)) {\n Object.defineProperty(sandbox, prop, {\n configurable: false,\n writable: false,\n });\n }\n\n return sandbox;\n}\n"]} \ No newline at end of file diff --git a/src/lib/sandbox.ts b/src/lib/sandbox.ts index 5f4dfa1ff..3b6ec4fb7 100644 --- a/src/lib/sandbox.ts +++ b/src/lib/sandbox.ts @@ -4892,7 +4892,7 @@ export function sandBox( callback = ignoreIfStarted as (err: Error | null | undefined, started: boolean) => void; ignoreIfStarted = false; } - scriptName = scriptName || name; + scriptName ||= name; if (!scriptName.match(/^script\.js\./)) { scriptName = `script.js.${scriptName}`; } @@ -4911,7 +4911,6 @@ export function sandBox( } if (objects[scriptName].common.enabled) { if (!ignoreIfStarted) { - objects[scriptName].common.enabled = false; adapter.extendForeignObject(scriptName, { common: { enabled: false } }, () => { adapter.extendForeignObject( scriptName, From a663bc8a7336feece2a5645fef66d645598c1bd5 Mon Sep 17 00:00:00 2001 From: GermanBluefox Date: Sat, 21 Mar 2026 21:42:18 +0100 Subject: [PATCH 4/7] Stop all delayed states writings by script stop: https://github.com/ioBroker/ioBroker.javascript/issues/2069 --- ...g-DibIpG1Q.js => OpenAiDialog-CEA56Rl4.js} | 2 +- .../{index-_UYoIw1I.js => index-Bm6wEaaB.js} | 114 +++++++++--------- .../{index-DnqTM0A3.js => index-C9EIOjDT.js} | 2 +- .../{index-vgcfJH38.js => index-DWalwvIj.js} | 2 +- admin/tab.html | 2 +- build/lib/sandbox.js | 1 + build/lib/sandbox.js.map | 2 +- build/main.js | 14 +++ build/main.js.map | 2 +- build/types.d.ts | 1 + io-package.json | 41 +------ package.json | 1 - src-admin/package-lock.json | 4 +- src-editor/package-lock.json | 4 +- src-editor/src/SideMenu.tsx | 14 ++- src-editor/src/i18n/de.json | 1 + src-editor/src/i18n/en.json | 1 + src-editor/src/i18n/es.json | 1 + src-editor/src/i18n/fr.json | 1 + src-editor/src/i18n/it.json | 1 + src-editor/src/i18n/nl.json | 1 + src-editor/src/i18n/pl.json | 1 + src-editor/src/i18n/pt.json | 1 + src-editor/src/i18n/ru.json | 1 + src-editor/src/i18n/uk.json | 1 + src-editor/src/i18n/zh-cn.json | 1 + src/lib/sandbox.ts | 1 + src/main.ts | 14 +++ src/types.d.ts | 1 + 29 files changed, 121 insertions(+), 112 deletions(-) rename admin/assets/{OpenAiDialog-DibIpG1Q.js => OpenAiDialog-CEA56Rl4.js} (99%) rename admin/assets/{index-_UYoIw1I.js => index-Bm6wEaaB.js} (79%) rename admin/assets/{index-DnqTM0A3.js => index-C9EIOjDT.js} (99%) rename admin/assets/{index-vgcfJH38.js => index-DWalwvIj.js} (99%) diff --git a/admin/assets/OpenAiDialog-DibIpG1Q.js b/admin/assets/OpenAiDialog-CEA56Rl4.js similarity index 99% rename from admin/assets/OpenAiDialog-DibIpG1Q.js rename to admin/assets/OpenAiDialog-CEA56Rl4.js index 399fa4a77..ef766e19c 100644 --- a/admin/assets/OpenAiDialog-DibIpG1Q.js +++ b/admin/assets/OpenAiDialog-CEA56Rl4.js @@ -1,4 +1,4 @@ -import{c as ie,j as n}from"./createSvgIcon-DPvF8xqu.js";import{j as S,b as H,k as J,c as re}from"./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js";import{_ as F,a as Q,b as Z,i as $,h as X,c as oe,$ as ae,d as ce,e as le,f as de,g as ee}from"./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js";import{_ as l}from"./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js";import{_ as me}from"./preload-helper-BDBacUwf.js";import{C as he,b as ue,R as fe}from"./index-gIA8x-8f.js";import pe from"./ScriptEditorVanillaMonaco-DSYvOslZ.js";import{c as te,I as ge}from"./index-C49cpVll.js";import{h as ye}from"./index-_UYoIw1I.js";import"./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js";import"./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js";import"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js";import"./inheritsLoose-B0Ba5G9z.js";const ve=ie(n.jsx("path",{d:"M11.07 12.85c.77-1.39 2.25-2.21 3.11-3.44.91-1.29.4-3.7-2.18-3.7-1.69 0-2.52 1.28-2.87 2.34L6.54 6.96C7.25 4.83 9.18 3 11.99 3c2.35 0 3.96 1.07 4.78 2.41.7 1.15 1.11 3.3.03 4.9-1.2 1.77-2.35 2.31-2.97 3.45-.25.46-.35.76-.35 2.24h-2.89c-.01-.78-.13-2.05.48-3.15M14 20c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2"}),"QuestionMark"),je=me(()=>import("./docs-BrInh2Pn.js"),[],import.meta.url);let G=null;async function xe(s){if(G)return G;const f=await s.getObjectViewSystem("state","","香"),r=await s.getObjectViewSystem("channel","","香"),v=await s.getObjectViewSystem("device","","香"),d=await s.getObjectViewSystem("folder","","香"),k=await s.getObjectViewSystem("enum","","香");return G=Object.assign(f,r,v,d,k),G}function V(s,f){return s&&typeof s=="object"?s[f]||s.en:s||""}async function Ie(s){var P,N,L,K;const f=l.I18n.getLanguage(),r=await xe(s),v=Object.keys(r).sort(),d=new he,k=[],A=["UNREACH_STICKY"],W=[ue.Types.info],_=[],b=[],R=[],D=[];v.forEach(m=>{var a,h,c;((a=r[m])==null?void 0:a.type)==="enum"?_.push(m):(c=(h=r[m])==null?void 0:h.common)!=null&&c.smartName&&D.push(m)}),_.forEach(m=>{m.startsWith("enum.rooms.")?b.push(m):m.startsWith("enum.functions.")&&R.push(m);const a=r[m].common.members;a!=null&&a.length&&a.forEach(h=>{r[h]&&(D.includes(h)||D.push(h))})});const M={id:"",objects:r,_keysOptional:v,_usedIdsOptional:k,ignoreIndicators:A,excludedTypes:W},E=[];D.forEach(m=>{M.id=m;const a=d.detect(M);a&&a.forEach(h=>{var w;const c=(w=h.states.find(i=>i.id))==null?void 0:w.id;if(!c||E.find(i=>i.id===c))return;const j=r[c],z={id:c,name:V(j.common.name,f),type:j.type,deviceType:h.type,states:h.states.filter(i=>i.id).map(i=>({id:i.id,name:i.name,role:i.defaultRole,type:r[i.id].common.type,unit:r[i.id].common.unit,read:r[i.id].common.read===void 0?!0:r[i.id].common.read,write:r[i.id].common.write===void 0?!0:r[i.id].common.write}))},T=c.split(".");let e,o;(j.type==="channel"||j.type==="state")&&(T.pop(),e=T.join("."),r[e]&&(r[e].type==="channel"||r[e].type==="folder")?(T.pop(),o=T.join("."),(!r[o]||r[o].type!=="device"&&r[e].type!=="folder")&&(o=void 0)):e=void 0);const I=b.find(i=>{var x,p,t;return(x=r[i].common.members)!=null&&x.includes(c)||e&&((p=r[i].common.members)!=null&&p.includes(e))?!0:o&&((t=r[i].common.members)==null?void 0:t.includes(o))});I&&(z.room=V(r[I].common.name,f));const g=R.find(i=>{var x,p,t;return(x=r[i].common.members)!=null&&x.includes(c)||e&&((p=r[i].common.members)!=null&&p.includes(e))?!0:o&&((t=r[i].common.members)==null?void 0:t.includes(o))});g&&(z.function=V(r[g].common.name,f)),E.push(z)})});for(let m=0;m(await je).default,we={ru:"Russian",en:"English",de:"German",es:"Spanish",fr:"French",it:"Italian",pl:"Polish",nl:"Dutch",pt:"Portuguese",uk:"Ukrainian","zh-cn":"Chinese"},Y={flexShrink:0,opacity:.7},ne={openai:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",style:Y,children:n.jsx("path",{d:"M22.282 9.821a5.985 5.985 0 0 0-.516-4.91 6.046 6.046 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a5.985 5.985 0 0 0-3.998 2.9 6.046 6.046 0 0 0 .743 7.097 5.98 5.98 0 0 0 .51 4.911 6.051 6.051 0 0 0 6.515 2.9A5.985 5.985 0 0 0 13.26 24a6.056 6.056 0 0 0 5.772-4.206 5.99 5.99 0 0 0 3.997-2.9 6.056 6.056 0 0 0-.747-7.073zM13.26 22.43a4.476 4.476 0 0 1-2.876-1.04l.141-.081 4.779-2.758a.795.795 0 0 0 .392-.681v-6.737l2.02 1.168a.071.071 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494zM3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085 4.783 2.759a.771.771 0 0 0 .78 0l5.843-3.369v2.332a.08.08 0 0 1-.033.062L9.74 19.95a4.5 4.5 0 0 1-6.14-1.646zM2.34 7.896a4.485 4.485 0 0 1 2.366-1.973V11.6a.766.766 0 0 0 .388.676l5.815 3.355-2.02 1.168a.076.076 0 0 1-.071 0l-4.83-2.786A4.504 4.504 0 0 1 2.34 7.872zm16.597 3.855-5.833-3.387L15.119 7.2a.076.076 0 0 1 .071 0l4.83 2.791a4.494 4.494 0 0 1-.676 8.105v-5.678a.79.79 0 0 0-.407-.667zm2.01-3.023-.141-.085-4.774-2.782a.776.776 0 0 0-.785 0L9.409 9.23V6.897a.066.066 0 0 1 .028-.061l4.83-2.787a4.5 4.5 0 0 1 6.68 4.66zm-12.64 4.135-2.02-1.164a.08.08 0 0 1-.038-.057V6.075a4.5 4.5 0 0 1 7.375-3.453l-.142.08L8.704 5.46a.795.795 0 0 0-.393.681zm1.097-2.365 2.602-1.5 2.607 1.5v2.999l-2.597 1.5-2.607-1.5z"})}),anthropic:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",style:Y,children:n.jsx("path",{d:"M17.304 3.54h-3.604L7.128 20.46h3.604l1.345-3.462h6.932l1.345 3.462H24L17.304 3.54zm-3.45 10.696 2.647-6.812 2.647 6.812h-5.295zM6.696 3.54H3.092L0 20.46h3.604L6.696 3.54z"})}),gemini:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",style:Y,children:n.jsx("path",{d:"M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0z"})}),deepseek:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",style:Y,children:n.jsx("path",{d:"M5 3h6a9 9 0 0 1 0 18H5V3zm4 14V7h2a5 5 0 0 1 0 10H9z"})})};async function se(s,f){const r=Object.keys(f);for(let v=0;v{const[f,r]=S(window.localStorage.getItem("openai-question")||""),[v,d]=S(""),[k,A]=S(!1),[W,_]=S(!1),[b,R]=S(window.localStorage.getItem("openai-model")||""),[D,M]=S(!1),[E,P]=S([]),[N,L]=S(!0),[K,m]=S(null),a=H(null),h=H(null),c=H({}),j=H(null),z=J(async e=>{L(!0),m(null);try{const o=await se(s.socket,s.runningInstances);if(e!=null&&e.current)return;if(!o){L(!1);return}h.current=o;const I=Object.keys(s.runningInstances)[0];if(!I){m(l.I18n.t("No running javascript instance found")),L(!1);return}const g=[],w={},i=[],x=[],p=(t,B)=>{for(const O of t){const C=O.toLowerCase();C.includes("embedding")||C.includes("moderation")||C.startsWith("dall-e")||C.startsWith("tts-")||C.startsWith("whisper")||C.startsWith("babbage")||C.startsWith("davinci")||C.startsWith("sora")||C.startsWith("omni-moderation")||w[O]||(g.push(O),w[O]=B)}};if((o.gptKey||o.gptBaseUrl)&&x.push(s.socket.sendTo(I,"testApiConnection",{apiKey:o.gptKey,baseUrl:o.gptBaseUrl||"",provider:"openai"}).then(t=>{t.models?p(t.models,"openai"):t.error&&i.push(`OpenAI: ${t.error}`)}).catch(t=>{i.push(`OpenAI: ${String(t)}`)})),o.claudeKey&&x.push(s.socket.sendTo(I,"testApiConnection",{apiKey:o.claudeKey,provider:"anthropic"}).then(t=>{t.models?p(t.models,"anthropic"):t.error&&i.push(`Anthropic: ${t.error}`)}).catch(t=>{i.push(`Anthropic: ${String(t)}`)})),o.geminiKey&&x.push(s.socket.sendTo(I,"testApiConnection",{apiKey:o.geminiKey,provider:"gemini"}).then(t=>{t.models?p(t.models,"gemini"):t.error&&i.push(`Gemini: ${t.error}`)}).catch(t=>{i.push(`Gemini: ${String(t)}`)})),o.deepseekKey&&x.push(s.socket.sendTo(I,"testApiConnection",{apiKey:o.deepseekKey,provider:"deepseek"}).then(t=>{t.models?p(t.models,"deepseek"):t.error&&i.push(`DeepSeek: ${t.error}`)}).catch(t=>{i.push(`DeepSeek: ${String(t)}`)})),await Promise.all(x),e!=null&&e.current)return;if(c.current=w,g.length>0){g.sort(),P(g);const t=window.localStorage.getItem("openai-model");t&&g.includes(t)?R(t):R(g[0])}i.length>0&&m(i.join("; "))}catch(o){console.error("Failed to fetch models:",o),e!=null&&e.current||m(l.I18n.t("Request failed: %s",String(o)))}e!=null&&e.current||L(!1)},[s.socket,s.runningInstances]);re(()=>{const e={current:!1};return z(e),()=>{e.current=!0}},[z]);const T=J(async()=>{let e;a.current?e=a.current:(e=await Ie(s.socket),a.current=e,console.log(`devices: ${JSON.stringify(e,null,2)}`));let o=h.current;o||(o=await se(s.socket,s.runningInstances),h.current=o);let I;if(j.current?I=j.current:(I=await _e(),j.current=I),!o){M(!0);return}const g=c.current[b];if(!g){_(l.I18n.t("Please select a valid model"));return}let w,i;g==="anthropic"?(w=o.claudeKey,i=""):g==="gemini"?(w=o.geminiKey,i=""):g==="deepseek"?(w=o.deepseekKey,i=""):(w=o.gptKey,i=o.gptBaseUrl||"");const x=Object.keys(s.runningInstances)[0];if(!x){_(l.I18n.t("No running javascript instance found"));return}A(!0),_(!1);try{const p=await s.socket.sendTo(x,"chatCompletion",{apiKey:w,baseUrl:i,model:b,provider:g,messages:[{role:"system",content:`You are programmer. Here is a documentation: +import{c as ie,j as n}from"./createSvgIcon-DPvF8xqu.js";import{j as S,b as H,k as J,c as re}from"./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js";import{_ as F,a as Q,b as Z,i as $,h as X,c as oe,$ as ae,d as ce,e as le,f as de,g as ee}from"./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js";import{_ as l}from"./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js";import{_ as me}from"./preload-helper-BDBacUwf.js";import{C as he,b as ue,R as fe}from"./index-gIA8x-8f.js";import pe from"./ScriptEditorVanillaMonaco-DSYvOslZ.js";import{c as te,I as ge}from"./index-C49cpVll.js";import{h as ye}from"./index-Bm6wEaaB.js";import"./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js";import"./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js";import"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js";import"./inheritsLoose-B0Ba5G9z.js";const ve=ie(n.jsx("path",{d:"M11.07 12.85c.77-1.39 2.25-2.21 3.11-3.44.91-1.29.4-3.7-2.18-3.7-1.69 0-2.52 1.28-2.87 2.34L6.54 6.96C7.25 4.83 9.18 3 11.99 3c2.35 0 3.96 1.07 4.78 2.41.7 1.15 1.11 3.3.03 4.9-1.2 1.77-2.35 2.31-2.97 3.45-.25.46-.35.76-.35 2.24h-2.89c-.01-.78-.13-2.05.48-3.15M14 20c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2"}),"QuestionMark"),je=me(()=>import("./docs-BrInh2Pn.js"),[],import.meta.url);let G=null;async function xe(s){if(G)return G;const f=await s.getObjectViewSystem("state","","香"),r=await s.getObjectViewSystem("channel","","香"),v=await s.getObjectViewSystem("device","","香"),d=await s.getObjectViewSystem("folder","","香"),k=await s.getObjectViewSystem("enum","","香");return G=Object.assign(f,r,v,d,k),G}function V(s,f){return s&&typeof s=="object"?s[f]||s.en:s||""}async function Ie(s){var P,N,L,K;const f=l.I18n.getLanguage(),r=await xe(s),v=Object.keys(r).sort(),d=new he,k=[],A=["UNREACH_STICKY"],W=[ue.Types.info],_=[],b=[],R=[],D=[];v.forEach(m=>{var a,h,c;((a=r[m])==null?void 0:a.type)==="enum"?_.push(m):(c=(h=r[m])==null?void 0:h.common)!=null&&c.smartName&&D.push(m)}),_.forEach(m=>{m.startsWith("enum.rooms.")?b.push(m):m.startsWith("enum.functions.")&&R.push(m);const a=r[m].common.members;a!=null&&a.length&&a.forEach(h=>{r[h]&&(D.includes(h)||D.push(h))})});const M={id:"",objects:r,_keysOptional:v,_usedIdsOptional:k,ignoreIndicators:A,excludedTypes:W},E=[];D.forEach(m=>{M.id=m;const a=d.detect(M);a&&a.forEach(h=>{var w;const c=(w=h.states.find(i=>i.id))==null?void 0:w.id;if(!c||E.find(i=>i.id===c))return;const j=r[c],z={id:c,name:V(j.common.name,f),type:j.type,deviceType:h.type,states:h.states.filter(i=>i.id).map(i=>({id:i.id,name:i.name,role:i.defaultRole,type:r[i.id].common.type,unit:r[i.id].common.unit,read:r[i.id].common.read===void 0?!0:r[i.id].common.read,write:r[i.id].common.write===void 0?!0:r[i.id].common.write}))},T=c.split(".");let e,o;(j.type==="channel"||j.type==="state")&&(T.pop(),e=T.join("."),r[e]&&(r[e].type==="channel"||r[e].type==="folder")?(T.pop(),o=T.join("."),(!r[o]||r[o].type!=="device"&&r[e].type!=="folder")&&(o=void 0)):e=void 0);const I=b.find(i=>{var x,p,t;return(x=r[i].common.members)!=null&&x.includes(c)||e&&((p=r[i].common.members)!=null&&p.includes(e))?!0:o&&((t=r[i].common.members)==null?void 0:t.includes(o))});I&&(z.room=V(r[I].common.name,f));const g=R.find(i=>{var x,p,t;return(x=r[i].common.members)!=null&&x.includes(c)||e&&((p=r[i].common.members)!=null&&p.includes(e))?!0:o&&((t=r[i].common.members)==null?void 0:t.includes(o))});g&&(z.function=V(r[g].common.name,f)),E.push(z)})});for(let m=0;m(await je).default,we={ru:"Russian",en:"English",de:"German",es:"Spanish",fr:"French",it:"Italian",pl:"Polish",nl:"Dutch",pt:"Portuguese",uk:"Ukrainian","zh-cn":"Chinese"},Y={flexShrink:0,opacity:.7},ne={openai:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",style:Y,children:n.jsx("path",{d:"M22.282 9.821a5.985 5.985 0 0 0-.516-4.91 6.046 6.046 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a5.985 5.985 0 0 0-3.998 2.9 6.046 6.046 0 0 0 .743 7.097 5.98 5.98 0 0 0 .51 4.911 6.051 6.051 0 0 0 6.515 2.9A5.985 5.985 0 0 0 13.26 24a6.056 6.056 0 0 0 5.772-4.206 5.99 5.99 0 0 0 3.997-2.9 6.056 6.056 0 0 0-.747-7.073zM13.26 22.43a4.476 4.476 0 0 1-2.876-1.04l.141-.081 4.779-2.758a.795.795 0 0 0 .392-.681v-6.737l2.02 1.168a.071.071 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494zM3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085 4.783 2.759a.771.771 0 0 0 .78 0l5.843-3.369v2.332a.08.08 0 0 1-.033.062L9.74 19.95a4.5 4.5 0 0 1-6.14-1.646zM2.34 7.896a4.485 4.485 0 0 1 2.366-1.973V11.6a.766.766 0 0 0 .388.676l5.815 3.355-2.02 1.168a.076.076 0 0 1-.071 0l-4.83-2.786A4.504 4.504 0 0 1 2.34 7.872zm16.597 3.855-5.833-3.387L15.119 7.2a.076.076 0 0 1 .071 0l4.83 2.791a4.494 4.494 0 0 1-.676 8.105v-5.678a.79.79 0 0 0-.407-.667zm2.01-3.023-.141-.085-4.774-2.782a.776.776 0 0 0-.785 0L9.409 9.23V6.897a.066.066 0 0 1 .028-.061l4.83-2.787a4.5 4.5 0 0 1 6.68 4.66zm-12.64 4.135-2.02-1.164a.08.08 0 0 1-.038-.057V6.075a4.5 4.5 0 0 1 7.375-3.453l-.142.08L8.704 5.46a.795.795 0 0 0-.393.681zm1.097-2.365 2.602-1.5 2.607 1.5v2.999l-2.597 1.5-2.607-1.5z"})}),anthropic:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",style:Y,children:n.jsx("path",{d:"M17.304 3.54h-3.604L7.128 20.46h3.604l1.345-3.462h6.932l1.345 3.462H24L17.304 3.54zm-3.45 10.696 2.647-6.812 2.647 6.812h-5.295zM6.696 3.54H3.092L0 20.46h3.604L6.696 3.54z"})}),gemini:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",style:Y,children:n.jsx("path",{d:"M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0z"})}),deepseek:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",style:Y,children:n.jsx("path",{d:"M5 3h6a9 9 0 0 1 0 18H5V3zm4 14V7h2a5 5 0 0 1 0 10H9z"})})};async function se(s,f){const r=Object.keys(f);for(let v=0;v{const[f,r]=S(window.localStorage.getItem("openai-question")||""),[v,d]=S(""),[k,A]=S(!1),[W,_]=S(!1),[b,R]=S(window.localStorage.getItem("openai-model")||""),[D,M]=S(!1),[E,P]=S([]),[N,L]=S(!0),[K,m]=S(null),a=H(null),h=H(null),c=H({}),j=H(null),z=J(async e=>{L(!0),m(null);try{const o=await se(s.socket,s.runningInstances);if(e!=null&&e.current)return;if(!o){L(!1);return}h.current=o;const I=Object.keys(s.runningInstances)[0];if(!I){m(l.I18n.t("No running javascript instance found")),L(!1);return}const g=[],w={},i=[],x=[],p=(t,B)=>{for(const O of t){const C=O.toLowerCase();C.includes("embedding")||C.includes("moderation")||C.startsWith("dall-e")||C.startsWith("tts-")||C.startsWith("whisper")||C.startsWith("babbage")||C.startsWith("davinci")||C.startsWith("sora")||C.startsWith("omni-moderation")||w[O]||(g.push(O),w[O]=B)}};if((o.gptKey||o.gptBaseUrl)&&x.push(s.socket.sendTo(I,"testApiConnection",{apiKey:o.gptKey,baseUrl:o.gptBaseUrl||"",provider:"openai"}).then(t=>{t.models?p(t.models,"openai"):t.error&&i.push(`OpenAI: ${t.error}`)}).catch(t=>{i.push(`OpenAI: ${String(t)}`)})),o.claudeKey&&x.push(s.socket.sendTo(I,"testApiConnection",{apiKey:o.claudeKey,provider:"anthropic"}).then(t=>{t.models?p(t.models,"anthropic"):t.error&&i.push(`Anthropic: ${t.error}`)}).catch(t=>{i.push(`Anthropic: ${String(t)}`)})),o.geminiKey&&x.push(s.socket.sendTo(I,"testApiConnection",{apiKey:o.geminiKey,provider:"gemini"}).then(t=>{t.models?p(t.models,"gemini"):t.error&&i.push(`Gemini: ${t.error}`)}).catch(t=>{i.push(`Gemini: ${String(t)}`)})),o.deepseekKey&&x.push(s.socket.sendTo(I,"testApiConnection",{apiKey:o.deepseekKey,provider:"deepseek"}).then(t=>{t.models?p(t.models,"deepseek"):t.error&&i.push(`DeepSeek: ${t.error}`)}).catch(t=>{i.push(`DeepSeek: ${String(t)}`)})),await Promise.all(x),e!=null&&e.current)return;if(c.current=w,g.length>0){g.sort(),P(g);const t=window.localStorage.getItem("openai-model");t&&g.includes(t)?R(t):R(g[0])}i.length>0&&m(i.join("; "))}catch(o){console.error("Failed to fetch models:",o),e!=null&&e.current||m(l.I18n.t("Request failed: %s",String(o)))}e!=null&&e.current||L(!1)},[s.socket,s.runningInstances]);re(()=>{const e={current:!1};return z(e),()=>{e.current=!0}},[z]);const T=J(async()=>{let e;a.current?e=a.current:(e=await Ie(s.socket),a.current=e,console.log(`devices: ${JSON.stringify(e,null,2)}`));let o=h.current;o||(o=await se(s.socket,s.runningInstances),h.current=o);let I;if(j.current?I=j.current:(I=await _e(),j.current=I),!o){M(!0);return}const g=c.current[b];if(!g){_(l.I18n.t("Please select a valid model"));return}let w,i;g==="anthropic"?(w=o.claudeKey,i=""):g==="gemini"?(w=o.geminiKey,i=""):g==="deepseek"?(w=o.deepseekKey,i=""):(w=o.gptKey,i=o.gptBaseUrl||"");const x=Object.keys(s.runningInstances)[0];if(!x){_(l.I18n.t("No running javascript instance found"));return}A(!0),_(!1);try{const p=await s.socket.sendTo(x,"chatCompletion",{apiKey:w,baseUrl:i,model:b,provider:g,messages:[{role:"system",content:`You are programmer. Here is a documentation: ${I}`},{role:"system",content:`Here is list of devices: diff --git a/admin/assets/index-_UYoIw1I.js b/admin/assets/index-Bm6wEaaB.js similarity index 79% rename from admin/assets/index-_UYoIw1I.js rename to admin/assets/index-Bm6wEaaB.js index a144af44f..73678bee6 100644 --- a/admin/assets/index-_UYoIw1I.js +++ b/admin/assets/index-Bm6wEaaB.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-vgcfJH38.js","./createSvgIcon-DPvF8xqu.js","./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js","./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js","./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js","./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js","./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js","./index-C49cpVll.js","./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js","./preload-helper-BDBacUwf.js","./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js","./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js","./inheritsLoose-B0Ba5G9z.js","./index-BCK6q-N6.css","./index-DnqTM0A3.js","./ScriptEditorVanillaMonaco-DSYvOslZ.js","./ScriptEditor-C-fO5h68.js","./Save-Cld9qv9i.js","./OpenAiDialog-DibIpG1Q.js","./index-gIA8x-8f.js"])))=>i.map(i=>d[i]); -import{d as Zy}from"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js";import{j as m,c as $t,g as Tw,r as Sw,_ as Sg,i as Qy}from"./createSvgIcon-DPvF8xqu.js";import{r as DT}from"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js";import{a as _e,_ as AT,b as Ko,c as Lt,d as OT,e as Ew,f as Eg,g as lm,h as cm,i as um,j as kt,k as xn,l as us,m as ia,n as Iw,o as Ig,p as RT,q as NT,r as xw,s as MT,t as _n}from"./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js";import{_ as Ut,a as ss,b as qt,c as Eo,d as Di,e as xg,f as Ai,g as it,h as Ht,i as He,j as Xl,k as Zl,l as Ql,m as ec,n as tc,o as qe,p as Dw,q as Si,r as Dg,s as e_,t as Ag,u as Og,v as Pn,w as Aw,x as LT,y as dm,z as wt,A as PT,B as t_,C as BT,D as qp,E as wc,F as FT,G as jT,H as zT,I as UT,J as Ow,K as HT,L as WT,M as s_,N as wn,O as GT,P as VT,Q as KT,R as YT,S as JT,T as Rw,U as qT,V as Rg,W as Nw,X as XT}from"./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js";import{_ as x}from"./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js";import{I as qo,a as so,b as mc,C as ZT,c as Mw,F as QT,d as eS,e as kc,f as Ng,g as tS,h as sS,i as oS,j as iS,M as nS,k as rS,l as aS,m as lS,_ as cS,n as sc,o as uS,p as dS,q as oc,r as o_,s as hS,t as pS,u as gS,v as mS,w as i_,x as Yc,y as fS,z as $S,A as bS,B as vS,D as yS,E as _S,G as wS,H as Lw,J as Pw,K as Bw,L as kS,N as CS,O as TS,P as SS,Q as ES,R as IS}from"./index-C49cpVll.js";import{y as xS,_ as DS,a as AS,m as OS,S as n_,T as r_}from"./inheritsLoose-B0Ba5G9z.js";import{c as eo}from"./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js";function Xo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}import{_ as jn}from"./preload-helper-BDBacUwf.js";import{P as ke}from"./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js";import{_ as RS}from"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();var Fw,a_=DT;Fw=a_.createRoot,a_.hydrateRoot;var jw={exports:{}},ht={};var Jc=60103,qc=60106,na=60107,ra=60108,aa=60114,la=60109,ca=60110,ua=60112,da=60113,hm=60120,ha=60115,pa=60116,zw=60121,Uw=60122,Hw=60117,Ww=60129,Gw=60131;if(typeof Symbol=="function"&&Symbol.for){var Nt=Symbol.for;Jc=Nt("react.element"),qc=Nt("react.portal"),na=Nt("react.fragment"),ra=Nt("react.strict_mode"),aa=Nt("react.profiler"),la=Nt("react.provider"),ca=Nt("react.context"),ua=Nt("react.forward_ref"),da=Nt("react.suspense"),hm=Nt("react.suspense_list"),ha=Nt("react.memo"),pa=Nt("react.lazy"),zw=Nt("react.block"),Uw=Nt("react.server.block"),Hw=Nt("react.fundamental"),Ww=Nt("react.debug_trace_mode"),Gw=Nt("react.legacy_hidden")}function Ms(a){if(typeof a=="object"&&a!==null){var s=a.$$typeof;switch(s){case Jc:switch(a=a.type,a){case na:case aa:case ra:case da:case hm:return a;default:switch(a=a&&a.$$typeof,a){case ca:case ua:case pa:case ha:case la:return a;default:return s}}case qc:return s}}}var NS=la,MS=Jc,LS=ua,PS=na,BS=pa,FS=ha,jS=qc,zS=aa,US=ra,HS=da;ht.ContextConsumer=ca;ht.ContextProvider=NS;ht.Element=MS;ht.ForwardRef=LS;ht.Fragment=PS;ht.Lazy=BS;ht.Memo=FS;ht.Portal=jS;ht.Profiler=zS;ht.StrictMode=US;ht.Suspense=HS;ht.isAsyncMode=function(){return!1};ht.isConcurrentMode=function(){return!1};ht.isContextConsumer=function(a){return Ms(a)===ca};ht.isContextProvider=function(a){return Ms(a)===la};ht.isElement=function(a){return typeof a=="object"&&a!==null&&a.$$typeof===Jc};ht.isForwardRef=function(a){return Ms(a)===ua};ht.isFragment=function(a){return Ms(a)===na};ht.isLazy=function(a){return Ms(a)===pa};ht.isMemo=function(a){return Ms(a)===ha};ht.isPortal=function(a){return Ms(a)===qc};ht.isProfiler=function(a){return Ms(a)===aa};ht.isStrictMode=function(a){return Ms(a)===ra};ht.isSuspense=function(a){return Ms(a)===da};ht.isValidElementType=function(a){return typeof a=="string"||typeof a=="function"||a===na||a===aa||a===Ww||a===ra||a===da||a===hm||a===Gw||typeof a=="object"&&a!==null&&(a.$$typeof===pa||a.$$typeof===ha||a.$$typeof===la||a.$$typeof===ca||a.$$typeof===ua||a.$$typeof===Hw||a.$$typeof===zw||a[0]===Uw)};ht.typeOf=Ms;jw.exports=ht;var WS=jw.exports;function Cc(a,s){const i=getComputedStyle(s);if(!i)return;let r=a===ft.Horizontal?s.clientWidth:s.clientHeight;return r!==0?(a===ft.Horizontal?r-=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight):r-=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom),r):void 0}function ic(a,s,i=[],r={condition:!0}){const{condition:l}=r,c=(function(d,h){var p={};for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&h.indexOf(f)<0&&(p[f]=d[f]);if(d!=null&&typeof Object.getOwnPropertySymbols=="function"){var b=0;for(f=Object.getOwnPropertySymbols(d);b(l&&window.addEventListener(a,s,c),()=>{l&&window.removeEventListener(a,s)})),[a,s,l,...i])}(function(a,s){s===void 0&&(s={});var i=s.insertAt;if(typeof document<"u"){var r=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css",i==="top"&&r.firstChild?r.insertBefore(l,r.firstChild):r.appendChild(l),l.styleSheet?l.styleSheet.cssText=a:l.appendChild(document.createTextNode(a))}})(`/* === Main Container === */ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DWalwvIj.js","./createSvgIcon-DPvF8xqu.js","./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js","./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js","./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js","./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js","./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js","./index-C49cpVll.js","./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js","./preload-helper-BDBacUwf.js","./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js","./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js","./inheritsLoose-B0Ba5G9z.js","./index-BCK6q-N6.css","./index-C9EIOjDT.js","./ScriptEditorVanillaMonaco-DSYvOslZ.js","./ScriptEditor-C-fO5h68.js","./Save-Cld9qv9i.js","./OpenAiDialog-CEA56Rl4.js","./index-gIA8x-8f.js"])))=>i.map(i=>d[i]); +import{d as e_}from"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js";import{j as m,c as $t,g as Tw,r as Sw,_ as Ig,i as t_}from"./createSvgIcon-DPvF8xqu.js";import{r as DT}from"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js";import{a as _e,_ as AT,b as Ko,c as Lt,d as OT,e as Ew,f as xg,g as um,h as dm,i as hm,j as kt,k as xn,l as us,m as ia,n as Iw,o as Dg,p as RT,q as NT,r as xw,s as MT,t as _n}from"./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js";import{_ as Ut,a as ss,b as qt,c as Eo,d as Di,e as Ag,f as Ai,g as it,h as Ht,i as He,j as Xl,k as Zl,l as Ql,m as ec,n as tc,o as qe,p as Dw,q as Si,r as Og,s as s_,t as Rg,u as Ng,v as Pn,w as Aw,x as LT,y as pm,z as wt,A as PT,B as o_,C as BT,D as qp,E as wc,F as FT,G as jT,H as zT,I as UT,J as Ow,K as HT,L as WT,M as i_,N as wn,O as GT,P as VT,Q as KT,R as YT,S as JT,T as Rw,U as qT,V as Mg,W as Nw,X as XT}from"./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js";import{_ as x}from"./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js";import{I as qo,a as so,b as mc,C as ZT,c as Mw,F as QT,d as eS,e as kc,f as Lg,g as tS,h as sS,i as oS,j as iS,M as nS,k as rS,l as aS,m as lS,_ as cS,n as sc,o as uS,p as dS,q as oc,r as n_,s as hS,t as pS,u as gS,v as mS,w as r_,x as Yc,y as fS,z as $S,A as bS,B as vS,D as yS,E as _S,G as wS,H as Lw,J as Pw,K as Bw,L as kS,N as CS,O as TS,P as SS,Q as ES,R as IS}from"./index-C49cpVll.js";import{y as xS,_ as DS,a as AS,m as OS,S as a_,T as l_}from"./inheritsLoose-B0Ba5G9z.js";import{c as eo}from"./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js";function Xo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}import{_ as jn}from"./preload-helper-BDBacUwf.js";import{P as ke}from"./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js";import{_ as RS}from"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();var Fw,c_=DT;Fw=c_.createRoot,c_.hydrateRoot;var jw={exports:{}},ht={};var Jc=60103,qc=60106,na=60107,ra=60108,aa=60114,la=60109,ca=60110,ua=60112,da=60113,gm=60120,ha=60115,pa=60116,zw=60121,Uw=60122,Hw=60117,Ww=60129,Gw=60131;if(typeof Symbol=="function"&&Symbol.for){var Nt=Symbol.for;Jc=Nt("react.element"),qc=Nt("react.portal"),na=Nt("react.fragment"),ra=Nt("react.strict_mode"),aa=Nt("react.profiler"),la=Nt("react.provider"),ca=Nt("react.context"),ua=Nt("react.forward_ref"),da=Nt("react.suspense"),gm=Nt("react.suspense_list"),ha=Nt("react.memo"),pa=Nt("react.lazy"),zw=Nt("react.block"),Uw=Nt("react.server.block"),Hw=Nt("react.fundamental"),Ww=Nt("react.debug_trace_mode"),Gw=Nt("react.legacy_hidden")}function Ms(a){if(typeof a=="object"&&a!==null){var s=a.$$typeof;switch(s){case Jc:switch(a=a.type,a){case na:case aa:case ra:case da:case gm:return a;default:switch(a=a&&a.$$typeof,a){case ca:case ua:case pa:case ha:case la:return a;default:return s}}case qc:return s}}}var NS=la,MS=Jc,LS=ua,PS=na,BS=pa,FS=ha,jS=qc,zS=aa,US=ra,HS=da;ht.ContextConsumer=ca;ht.ContextProvider=NS;ht.Element=MS;ht.ForwardRef=LS;ht.Fragment=PS;ht.Lazy=BS;ht.Memo=FS;ht.Portal=jS;ht.Profiler=zS;ht.StrictMode=US;ht.Suspense=HS;ht.isAsyncMode=function(){return!1};ht.isConcurrentMode=function(){return!1};ht.isContextConsumer=function(a){return Ms(a)===ca};ht.isContextProvider=function(a){return Ms(a)===la};ht.isElement=function(a){return typeof a=="object"&&a!==null&&a.$$typeof===Jc};ht.isForwardRef=function(a){return Ms(a)===ua};ht.isFragment=function(a){return Ms(a)===na};ht.isLazy=function(a){return Ms(a)===pa};ht.isMemo=function(a){return Ms(a)===ha};ht.isPortal=function(a){return Ms(a)===qc};ht.isProfiler=function(a){return Ms(a)===aa};ht.isStrictMode=function(a){return Ms(a)===ra};ht.isSuspense=function(a){return Ms(a)===da};ht.isValidElementType=function(a){return typeof a=="string"||typeof a=="function"||a===na||a===aa||a===Ww||a===ra||a===da||a===gm||a===Gw||typeof a=="object"&&a!==null&&(a.$$typeof===pa||a.$$typeof===ha||a.$$typeof===la||a.$$typeof===ca||a.$$typeof===ua||a.$$typeof===Hw||a.$$typeof===zw||a[0]===Uw)};ht.typeOf=Ms;jw.exports=ht;var WS=jw.exports;function Cc(a,s){const i=getComputedStyle(s);if(!i)return;let r=a===ft.Horizontal?s.clientWidth:s.clientHeight;return r!==0?(a===ft.Horizontal?r-=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight):r-=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom),r):void 0}function ic(a,s,i=[],r={condition:!0}){const{condition:l}=r,c=(function(d,h){var p={};for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&h.indexOf(f)<0&&(p[f]=d[f]);if(d!=null&&typeof Object.getOwnPropertySymbols=="function"){var b=0;for(f=Object.getOwnPropertySymbols(d);b(l&&window.addEventListener(a,s,c),()=>{l&&window.removeEventListener(a,s)})),[a,s,l,...i])}(function(a,s){s===void 0&&(s={});var i=s.insertAt;if(typeof document<"u"){var r=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css",i==="top"&&r.firstChild?r.insertBefore(l,r.firstChild):r.appendChild(l),l.styleSheet?l.styleSheet.cssText=a:l.appendChild(document.createTextNode(a))}})(`/* === Main Container === */ .__dbk__container { height: 100%; width: 100%; @@ -88,14 +88,14 @@ import{d as Zy}from"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntr .__dbk__dragger.Dark { background: #434252; } -/* ====== */`);const GS=_e.forwardRef((({className:a,theme:s,draggerClassName:i,direction:r=ft.Vertical,onDragging:l},c)=>{const d=`__dbk__gutter ${r} ${a||s}`,h=`__dbk__dragger ${r} ${i||s}`;return m.jsx("div",Object.assign({className:d,ref:c,dir:r,onMouseDown:l,onTouchStart:fc?l:void 0},{children:m.jsx("div",{className:h},void 0)}),void 0)}));var ws;function Mg(a,s,i){let r,l;return s?(r=a/2,l=a):i?(r=a,l=a/2):(r=a,l=a),{aGutterSize:r,bGutterSize:l}}function VS(a,s){switch(s.type){case ws.SetIsReadyToCompute:return Object.assign(Object.assign({},a),{isReady:s.payload.isReady});case ws.CreatePairs:{const{direction:i,children:r,gutters:l}=s.payload,c=r[0].parentNode;if(!c)throw new Error("Cannot create pairs - parent is undefined.");const d=Cc(i,c);if(d===void 0)throw new Error(`Cannot create pairs - parent has undefined or zero size: ${d}.`);const h=[];return r.forEach(((p,f)=>{if(f>0){const b=r[f-1],y=r[f],w=l[f-1],v=i===ft.Horizontal?b.getBoundingClientRect().left:b.getBoundingClientRect().top,_=i===ft.Horizontal?y.getBoundingClientRect().right:y.getBoundingClientRect().bottom,$=i===ft.Horizontal?b.getBoundingClientRect().width+w.getBoundingClientRect().width+y.getBoundingClientRect().width:b.getBoundingClientRect().height+w.getBoundingClientRect().height+y.getBoundingClientRect().height,S=i===ft.Horizontal?w.getBoundingClientRect().width:w.getBoundingClientRect().height,T={idx:f-1,a:b,b:y,gutter:w,parent:c,start:v,end:_,size:$,gutterSize:S,aSizePct:100/r.length,bSizePct:100/r.length};h.push(T)}})),Object.assign(Object.assign({},a),{pairs:h})}case ws.StartDragging:{const{gutterIdx:i}=s.payload;return Object.assign(Object.assign({},a),{isDragging:!0,draggingIdx:i})}case ws.StopDragging:return Object.assign(Object.assign({},a),{isDragging:!1});case ws.CalculateSizes:{const{direction:i,gutterIdx:r}=s.payload,l=a.pairs[r],c=Cc(i,l.parent);if(!c)throw new Error("Cannot calculate sizes - 'pair.parent' has undefined or zero size.");const d=l.gutter[i===ft.Horizontal?"clientWidth":"clientHeight"],h=r===0,p=r===a.pairs.length-1,{aGutterSize:f,bGutterSize:b}=Mg(d,h,p);let y,w,v,_,$;return i===ft.Horizontal?(y=l.a.getBoundingClientRect().left,w=l.b.getBoundingClientRect().right,_=(l.a.getBoundingClientRect().width+f)/c*100,$=(l.b.getBoundingClientRect().width+b)/c*100,v=l.a.getBoundingClientRect().width+f+b+l.b.getBoundingClientRect().width):(y=l.a.getBoundingClientRect().top,w=l.b.getBoundingClientRect().bottom,_=(l.a.getBoundingClientRect().height+f)/c*100,$=(l.b.getBoundingClientRect().height+b)/c*100,v=l.a.getBoundingClientRect().height+f+b+l.b.getBoundingClientRect().height),a.pairs[r]=Object.assign(Object.assign({},l),{start:y,end:w,size:v,aSizePct:_,bSizePct:$,gutterSize:d}),Object.assign({},a)}default:return a}}function Vw(a,s=0,i=[]){return OT.toArray(a).reduce(((r,l,c)=>(WS.isFragment(l)?r.push.apply(r,Vw(l.props.children,s+1,i.concat(l.key||c))):Ew(l)?r.push(Eg(l,{key:i.concat(String(l.key)).join(".")})):typeof l!="string"&&typeof l!="number"||r.push(l),r)),[])}(function(a){a[a.SetIsReadyToCompute=0]="SetIsReadyToCompute",a[a.CreatePairs=1]="CreatePairs",a[a.CalculateSizes=2]="CalculateSizes",a[a.StartDragging=3]="StartDragging",a[a.StopDragging=4]="StopDragging"})(ws||(ws={}));const l_=a=>"changedTouches"in a;var ft,Lg;(function(a){a.Horizontal="Horizontal",a.Vertical="Vertical"})(ft||(ft={})),(function(a){a.Light="Light",a.Dark="Dark"})(Lg||(Lg={}));const fc=typeof window<"u"&&"ontouchstart"in window;function Xp(a){return a===ft.Horizontal?"col-resize":"row-resize"}const KS={isReady:!1,isDragging:!1,pairs:[]};function c_({direction:a=ft.Horizontal,minWidths:s=[],minHeights:i=[],initialSizes:r,gutterTheme:l=Lg.Dark,gutterClassName:c,draggerClassName:d,children:h,onResizeStarted:p,onResizeFinished:f,classes:b=[]}){const y=Vw(h),[w,v]=AT(VS,KS),_=Ko(null),$=Ko([]),S=Ko([]);$.current=[],S.current=[];const T=_e.useCallback((R=>{v({type:ws.SetIsReadyToCompute,payload:{isReady:R}})}),[]),E=_e.useCallback(((R,K)=>{v({type:ws.StartDragging,payload:{gutterIdx:K}});const C=w.pairs[K];p==null||p(C.idx),C.a.style.userSelect="none",C.b.style.userSelect="none",C.gutter.style.cursor=Xp(R),C.parent.style.cursor=Xp(R),document.body.style.cursor=Xp(R)}),[w.pairs]),D=_e.useCallback((()=>{v({type:ws.StopDragging});const R=[];for(let C=0;C{v({type:ws.CalculateSizes,payload:{direction:R,gutterIdx:K}})}),[]),P=_e.useCallback(((R,K,C)=>{v({type:ws.CreatePairs,payload:{direction:R,children:K,gutters:C}})}),[]),W=_e.useCallback(((R,K,C,Q)=>{const ve=K[0].parentNode;if(!ve)throw new Error("Cannot set initial sizes - parent is undefined");if(Cc(R,ve)===void 0)throw new Error("Cannot set initial sizes - parent has undefined size");K.forEach(((ce,ne)=>{const me=ne===0,re=ne===K.length-1;let B,N=0;K.length>1&&(N=C[re?ne-1:ne].getBoundingClientRect()[R===ft.Horizontal?"width":"height"],N=me||re?N/2:N),B=Q&&ne{if(w.draggingIdx===void 0)throw new Error("Cannot adjust size - 'draggingIdx' is undefined");const C=w.pairs[w.draggingIdx];if(C.size===void 0)throw new Error("Cannot adjust size - 'pair.size' is undefined");if(C.gutterSize===void 0)throw new Error("Cannot adjust size - 'pair.gutterSize' is undefined");const Q=C.aSizePct+C.bSizePct,ve=K/C.size*Q,ce=Q-K/C.size*Q,ne=w.draggingIdx===0,me=w.draggingIdx===w.pairs.length-1,{aGutterSize:re,bGutterSize:B}=Mg(C.gutterSize,ne,me),N=`calc(${ve}% - ${re}px)`,te=`calc(${ce}% - ${B}px)`;R===ft.Horizontal?(C.a.style.width=N,C.b.style.width=te):(C.a.style.height=N,C.b.style.height=te)}),[w.draggingIdx,w.pairs,a]),z=_e.useCallback(((R,K,C)=>{if(!w.isDragging)return;if(w.draggingIdx===void 0)throw new Error("Cannot drag - 'draggingIdx' is undefined");const Q=w.pairs[w.draggingIdx];if(Q.start===void 0)throw new Error("Cannot drag - 'pair.start' is undefined");if(Q.size===void 0)throw new Error("Cannot drag - 'pair.size' is undefined");if(Q.gutterSize===void 0)throw new Error("Cannot drag - 'pair.gutterSize' is undefined");let ve=(function(me,re){const B=l_(re)?re.changedTouches[0]:re;return me===ft.Horizontal?B.clientX:B.clientY})(K,R)-Q.start,ce=16,ne=16;C.length>w.draggingIdx&&(ce=C[w.draggingIdx]),C.length>=w.draggingIdx+1&&(ne=C[w.draggingIdx+1]),ve=Q.size-(Q.gutterSize+ne)&&(ve=Q.size-(Q.gutterSize+ne)),G(K,ve)}),[w.isDragging,w.draggingIdx,w.pairs,G]),Z=()=>{if(w.isDragging){if(w.draggingIdx===void 0)throw new Error("Cannot calculate sizes after dragging = 'state.draggingIdx' is undefined");M(a,w.draggingIdx),D()}},he=R=>{w.isDragging&&(l_(R)&&R.preventDefault(),z(R,a,a===ft.Horizontal?s:i))};function Ce(R,K){if(!R.current)throw new Error("Can't add element to ref object - ref isn't initialized");K&&!R.current.includes(K)&&R.current.push(K)}return ic("mouseup",Z,[w.isDragging,D]),ic("mousemove",he,[a,w.isDragging,z,s,i]),ic("touchend",Z,[w.isDragging,D],{condition:fc}),ic("touchmove",he,[a,w.isDragging,z,s,i],{condition:fc,passive:!fc}),Lt((function(){if(!_.current)return;const R=_.current.parentElement;if(!R)return;const K=new ResizeObserver((()=>{const C=getComputedStyle(R),Q=a===ft.Horizontal?R.clientWidth:R.clientHeight;T(!!C&&!!Q)}));return K.observe(R),()=>{K.disconnect()}}),[_.current,a]),Lt((function(){if(w.isReady&&(!$.current||$.current[0].offsetParent)){if(!$.current||!S.current)throw new Error("Cannot create pairs - either variable 'childRefs' or 'gutterRefs' is undefined");y.length<=1?W(a,$.current,S.current,r):(W(a,$.current,S.current,r),P(a,$.current,S.current))}}),[h,w.isReady,a,W,P,r]),m.jsx("div",Object.assign({className:`__dbk__container ${a}`,ref:_},{children:w.isReady&&y.map(((R,K)=>m.jsxs(_e.Fragment,{children:[m.jsx("div",Object.assign({ref:C=>Ce($,C),className:"__dbk__child-wrapper "+(KCe(S,C),className:c,theme:l,draggerClassName:d,direction:a,onDragging:()=>{return M(a,C=K),void E(a,C);var C}},void 0)]},K)))}),void 0)}const Kw=lm({dragDropManager:void 0});function Qr(a){"@babel/helpers - typeof";return Qr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},Qr(a)}function YS(a,s){if(Qr(a)!="object"||!a)return a;var i=a[Symbol.toPrimitive];if(i!==void 0){var r=i.call(a,s);if(Qr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(a)}function JS(a){var s=YS(a,"string");return Qr(s)=="symbol"?s:s+""}function qS(a,s,i){return(s=JS(s))in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function bs(a){return"Minified Redux error #"+a+"; visit https://redux.js.org/Errors?code="+a+" for the full message or use the non-minified dev environment for full errors. "}var u_=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),d_=function(){return Math.random().toString(36).substring(7).split("").join(".")},h_={INIT:"@@redux/INIT"+d_(),REPLACE:"@@redux/REPLACE"+d_()};function XS(a){if(typeof a!="object"||a===null)return!1;for(var s=a;Object.getPrototypeOf(s)!==null;)s=Object.getPrototypeOf(s);return Object.getPrototypeOf(a)===s}function Yw(a,s,i){var r;if(typeof s=="function"&&typeof i=="function"||typeof i=="function"&&typeof arguments[3]=="function")throw new Error(bs(0));if(typeof s=="function"&&typeof i>"u"&&(i=s,s=void 0),typeof i<"u"){if(typeof i!="function")throw new Error(bs(1));return i(Yw)(a,s)}if(typeof a!="function")throw new Error(bs(2));var l=a,c=s,d=[],h=d,p=!1;function f(){h===d&&(h=d.slice())}function b(){if(p)throw new Error(bs(3));return c}function y($){if(typeof $!="function")throw new Error(bs(4));if(p)throw new Error(bs(5));var S=!0;return f(),h.push($),function(){if(S){if(p)throw new Error(bs(6));S=!1,f();var E=h.indexOf($);h.splice(E,1),d=null}}}function w($){if(!XS($))throw new Error(bs(7));if(typeof $.type>"u")throw new Error(bs(8));if(p)throw new Error(bs(9));try{p=!0,c=l(c,$)}finally{p=!1}for(var S=d=h,T=0;Tr&&r[l]?r[l]:i||null,a)}function eE(a,s){return a.filter(i=>i!==s)}function Jw(a){return typeof a=="object"}function tE(a,s){const i=new Map,r=c=>{i.set(c,i.has(c)?i.get(c)+1:1)};a.forEach(r),s.forEach(r);const l=[];return i.forEach((c,d)=>{c===1&&l.push(d)}),l}function sE(a,s){return a.filter(i=>s.indexOf(i)>-1)}const pm="dnd-core/INIT_COORDS",Xc="dnd-core/BEGIN_DRAG",gm="dnd-core/PUBLISH_DRAG_SOURCE",Zc="dnd-core/HOVER",Qc="dnd-core/DROP",eu="dnd-core/END_DRAG";function p_(a,s){return{type:pm,payload:{sourceClientOffset:s||null,clientOffset:a||null}}}const oE={type:pm,payload:{clientOffset:null,sourceClientOffset:null}};function iE(a){return function(i=[],r={publishSource:!0}){const{publishSource:l=!0,clientOffset:c,getSourceClientOffset:d}=r,h=a.getMonitor(),p=a.getRegistry();a.dispatch(p_(c)),nE(i,h,p);const f=lE(i,h);if(f==null){a.dispatch(oE);return}let b=null;if(c){if(!d)throw new Error("getSourceClientOffset must be defined");rE(d),b=d(f)}a.dispatch(p_(c,b));const w=p.getSource(f).beginDrag(h,f);if(w==null)return;aE(w),p.pinSource(f);const v=p.getSourceType(f);return{type:Xc,payload:{itemType:v,item:w,sourceId:f,clientOffset:c||null,sourceClientOffset:b||null,isSourcePublic:!!l}}}}function nE(a,s,i){Ve(!s.isDragging(),"Cannot call beginDrag while dragging."),a.forEach(function(r){Ve(i.getSource(r),"Expected sourceIds to be registered.")})}function rE(a){Ve(typeof a=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function aE(a){Ve(Jw(a),"Item must be an object.")}function lE(a,s){let i=null;for(let r=a.length-1;r>=0;r--)if(s.canDragSource(a[r])){i=a[r];break}return i}function cE(a,s,i){return s in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function uE(a){for(var s=1;s{const p=pE(d,h,l,r),f={type:Qc,payload:{dropResult:uE({},i,p)}};a.dispatch(f)})}}function hE(a){Ve(a.isDragging(),"Cannot call drop while not dragging."),Ve(!a.didDrop(),"Cannot call drop twice during one drag operation.")}function pE(a,s,i,r){const l=i.getTarget(a);let c=l?l.drop(r,a):void 0;return gE(c),typeof c>"u"&&(c=s===0?{}:r.getDropResult()),c}function gE(a){Ve(typeof a>"u"||Jw(a),"Drop result must either be an object or undefined.")}function mE(a){const s=a.getTargetIds().filter(a.canDropOnTarget,a);return s.reverse(),s}function fE(a){return function(){const i=a.getMonitor(),r=a.getRegistry();$E(i);const l=i.getSourceId();return l!=null&&(r.getSource(l,!0).endDrag(i,l),r.unpinSource()),{type:eu}}}function $E(a){Ve(a.isDragging(),"Cannot call endDrag while not dragging.")}function Pg(a,s){return s===null?a===null:Array.isArray(a)?a.some(i=>i===s):a===s}function bE(a){return function(i,{clientOffset:r}={}){vE(i);const l=i.slice(0),c=a.getMonitor(),d=a.getRegistry(),h=c.getItemType();return _E(l,d,h),yE(l,c,d),wE(l,c,d),{type:Zc,payload:{targetIds:l,clientOffset:r||null}}}}function vE(a){Ve(Array.isArray(a),"Expected targetIds to be an array.")}function yE(a,s,i){Ve(s.isDragging(),"Cannot call hover while not dragging."),Ve(!s.didDrop(),"Cannot call hover after drop.");for(let r=0;r=0;r--){const l=a[r],c=s.getTargetType(l);Pg(c,i)||a.splice(r,1)}}function wE(a,s,i){a.forEach(function(r){i.getTarget(r).hover(s,r)})}function kE(a){return function(){if(a.getMonitor().isDragging())return{type:gm}}}function CE(a){return{beginDrag:iE(a),publishDragSource:kE(a),hover:bE(a),drop:dE(a),endDrag:fE(a)}}class TE{receiveBackend(s){this.backend=s}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const s=this,{dispatch:i}=this.store;function r(c){return(...d)=>{const h=c.apply(s,d);typeof h<"u"&&i(h)}}const l=CE(this);return Object.keys(l).reduce((c,d)=>{const h=l[d];return c[d]=r(h),c},{})}dispatch(s){this.store.dispatch(s)}constructor(s,i){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=s,this.monitor=i,s.subscribe(this.handleRefCountChange)}}function SE(a,s){return{x:a.x+s.x,y:a.y+s.y}}function qw(a,s){return{x:a.x-s.x,y:a.y-s.y}}function EE(a){const{clientOffset:s,initialClientOffset:i,initialSourceClientOffset:r}=a;return!s||!i||!r?null:qw(SE(s,r),i)}function IE(a){const{clientOffset:s,initialClientOffset:i}=a;return!s||!i?null:qw(s,i)}const Kr=[],mm=[];Kr.__IS_NONE__=!0;mm.__IS_ALL__=!0;function xE(a,s){return a===Kr?!1:a===mm||typeof s>"u"?!0:sE(s,a).length>0}class DE{subscribeToStateChange(s,i={}){const{handlerIds:r}=i;Ve(typeof s=="function","listener must be a function."),Ve(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let l=this.store.getState().stateId;const c=()=>{const d=this.store.getState(),h=d.stateId;try{h===l||h===l+1&&!xE(d.dirtyHandlerIds,r)||s()}finally{l=h}};return this.store.subscribe(c)}subscribeToOffsetChange(s){Ve(typeof s=="function","listener must be a function.");let i=this.store.getState().dragOffset;const r=()=>{const l=this.store.getState().dragOffset;l!==i&&(i=l,s())};return this.store.subscribe(r)}canDragSource(s){if(!s)return!1;const i=this.registry.getSource(s);return Ve(i,`Expected to find a valid source. sourceId=${s}`),this.isDragging()?!1:i.canDrag(this,s)}canDropOnTarget(s){if(!s)return!1;const i=this.registry.getTarget(s);if(Ve(i,`Expected to find a valid target. targetId=${s}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(s),l=this.getItemType();return Pg(r,l)&&i.canDrop(this,s)}isDragging(){return!!this.getItemType()}isDraggingSource(s){if(!s)return!1;const i=this.registry.getSource(s,!0);if(Ve(i,`Expected to find a valid source. sourceId=${s}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(s),l=this.getItemType();return r!==l?!1:i.isDragging(this,s)}isOverTarget(s,i={shallow:!1}){if(!s)return!1;const{shallow:r}=i;if(!this.isDragging())return!1;const l=this.registry.getTargetType(s),c=this.getItemType();if(c&&!Pg(l,c))return!1;const d=this.getTargetIds();if(!d.length)return!1;const h=d.indexOf(s);return r?h===d.length-1:h>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return EE(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return IE(this.store.getState().dragOffset)}constructor(s,i){this.store=s,this.registry=i}}const g_=typeof global<"u"?global:self,Xw=g_.MutationObserver||g_.WebKitMutationObserver;function Zw(a){return function(){const i=setTimeout(l,0),r=setInterval(l,50);function l(){clearTimeout(i),clearInterval(r),a()}}}function AE(a){let s=1;const i=new Xw(a),r=document.createTextNode("");return i.observe(r,{characterData:!0}),function(){s=-s,r.data=s}}const OE=typeof Xw=="function"?AE:Zw;class RE{enqueueTask(s){const{queue:i,requestFlush:r}=this;i.length||(r(),this.flushing=!0),i[i.length]=s}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:s}=this;for(;this.indexthis.capacity){for(let r=0,l=s.length-this.index;r{this.pendingErrors.push(s),this.requestErrorThrow()},this.requestFlush=OE(this.flush),this.requestErrorThrow=Zw(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class NE{call(){try{this.task&&this.task()}catch(s){this.onError(s)}finally{this.task=null,this.release(this)}}constructor(s,i){this.onError=s,this.release=i,this.task=null}}class ME{create(s){const i=this.freeTasks,r=i.length?i.pop():new NE(this.onError,l=>i[i.length]=l);return r.task=s,r}constructor(s){this.onError=s,this.freeTasks=[]}}const Qw=new RE,LE=new ME(Qw.registerPendingError);function PE(a){Qw.enqueueTask(LE.create(a))}const fm="dnd-core/ADD_SOURCE",$m="dnd-core/ADD_TARGET",bm="dnd-core/REMOVE_SOURCE",tu="dnd-core/REMOVE_TARGET";function BE(a){return{type:fm,payload:{sourceId:a}}}function FE(a){return{type:$m,payload:{targetId:a}}}function jE(a){return{type:bm,payload:{sourceId:a}}}function zE(a){return{type:tu,payload:{targetId:a}}}function UE(a){Ve(typeof a.canDrag=="function","Expected canDrag to be a function."),Ve(typeof a.beginDrag=="function","Expected beginDrag to be a function."),Ve(typeof a.endDrag=="function","Expected endDrag to be a function.")}function HE(a){Ve(typeof a.canDrop=="function","Expected canDrop to be a function."),Ve(typeof a.hover=="function","Expected hover to be a function."),Ve(typeof a.drop=="function","Expected beginDrag to be a function.")}function Bg(a,s){if(s&&Array.isArray(a)){a.forEach(i=>Bg(i,!1));return}Ve(typeof a=="string"||typeof a=="symbol",s?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var _s;(function(a){a.SOURCE="SOURCE",a.TARGET="TARGET"})(_s||(_s={}));let WE=0;function GE(){return WE++}function VE(a){const s=GE().toString();switch(a){case _s.SOURCE:return`S${s}`;case _s.TARGET:return`T${s}`;default:throw new Error(`Unknown Handler Role: ${a}`)}}function m_(a){switch(a[0]){case"S":return _s.SOURCE;case"T":return _s.TARGET;default:throw new Error(`Cannot parse handler ID: ${a}`)}}function f_(a,s){const i=a.entries();let r=!1;do{const{done:l,value:[,c]}=i.next();if(c===s)return!0;r=!!l}while(!r);return!1}class KE{addSource(s,i){Bg(s),UE(i);const r=this.addHandler(_s.SOURCE,s,i);return this.store.dispatch(BE(r)),r}addTarget(s,i){Bg(s,!0),HE(i);const r=this.addHandler(_s.TARGET,s,i);return this.store.dispatch(FE(r)),r}containsHandler(s){return f_(this.dragSources,s)||f_(this.dropTargets,s)}getSource(s,i=!1){return Ve(this.isSourceId(s),"Expected a valid source ID."),i&&s===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(s)}getTarget(s){return Ve(this.isTargetId(s),"Expected a valid target ID."),this.dropTargets.get(s)}getSourceType(s){return Ve(this.isSourceId(s),"Expected a valid source ID."),this.types.get(s)}getTargetType(s){return Ve(this.isTargetId(s),"Expected a valid target ID."),this.types.get(s)}isSourceId(s){return m_(s)===_s.SOURCE}isTargetId(s){return m_(s)===_s.TARGET}removeSource(s){Ve(this.getSource(s),"Expected an existing source."),this.store.dispatch(jE(s)),PE(()=>{this.dragSources.delete(s),this.types.delete(s)})}removeTarget(s){Ve(this.getTarget(s),"Expected an existing target."),this.store.dispatch(zE(s)),this.dropTargets.delete(s),this.types.delete(s)}pinSource(s){const i=this.getSource(s);Ve(i,"Expected an existing source."),this.pinnedSourceId=s,this.pinnedSource=i}unpinSource(){Ve(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(s,i,r){const l=VE(s);return this.types.set(l,i),s===_s.SOURCE?this.dragSources.set(l,r):s===_s.TARGET&&this.dropTargets.set(l,r),l}constructor(s){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=s}}const YE=(a,s)=>a===s;function JE(a,s){return!a&&!s?!0:!a||!s?!1:a.x===s.x&&a.y===s.y}function qE(a,s,i=YE){if(a.length!==s.length)return!1;for(let r=0;r0||!qE(i,r)))return Kr;const d=r[r.length-1],h=i[i.length-1];return d!==h&&(d&&l.push(d),h&&l.push(h)),l}function ZE(a,s,i){return s in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function QE(a){for(var s=1;s=0)&&Object.prototype.propertyIsEnumerable.call(a,r)&&(i[r]=a[r])}return i}function hI(a,s){if(a==null)return{};var i={},r=Object.keys(a),l,c;for(c=0;c=0)&&(i[l]=a[l]);return i}let b_=0;const $c=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var ek=cm(function(s){var{children:i}=s,r=dI(s,["children"]);const[l,c]=pI(r);return Lt(()=>{if(c){const d=tk();return++b_,()=>{--b_===0&&(d[$c]=null)}}},[]),m.jsx(Kw.Provider,{value:l,children:i})});function pI(a){if("manager"in a)return[{dragDropManager:a.manager},!1];const s=gI(a.backend,a.context,a.options,a.debugMode),i=!a.context;return[s,i]}function gI(a,s=tk(),i,r){const l=s;return l[$c]||(l[$c]={dragDropManager:cI(a,s,i,r)}),l[$c]}function tk(){return typeof global<"u"?global:window}var mI=function a(s,i){if(s===i)return!0;if(s&&i&&typeof s=="object"&&typeof i=="object"){if(s.constructor!==i.constructor)return!1;var r,l,c;if(Array.isArray(s)){if(r=s.length,r!=i.length)return!1;for(l=r;l--!==0;)if(!a(s[l],i[l]))return!1;return!0}if(s.constructor===RegExp)return s.source===i.source&&s.flags===i.flags;if(s.valueOf!==Object.prototype.valueOf)return s.valueOf()===i.valueOf();if(s.toString!==Object.prototype.toString)return s.toString()===i.toString();if(c=Object.keys(s),r=c.length,r!==Object.keys(i).length)return!1;for(l=r;l--!==0;)if(!Object.prototype.hasOwnProperty.call(i,c[l]))return!1;for(l=r;l--!==0;){var d=c[l];if(!a(s[d],i[d]))return!1}return!0}return s!==s&&i!==i};const fI=Xo(mI),Oi=typeof window<"u"?um:Lt;function $I(a,s,i){const[r,l]=kt(()=>s(a)),c=xn(()=>{const d=s(a);fI(r,d)||(l(d),i&&i())},[r,a,i]);return Oi(c),[r,c]}function bI(a,s,i){const[r,l]=$I(a,s,i);return Oi(function(){const d=a.getHandlerId();if(d!=null)return a.subscribeToStateChange(l,{handlerIds:[d]})},[a,l]),r}function sk(a,s,i){return bI(s,a||(()=>({})),()=>i.reconnect())}function ok(a,s){const i=[];return typeof a!="function"&&i.push(a),us(()=>typeof a=="function"?a():a,i)}function vI(a){return us(()=>a.hooks.dragSource(),[a])}function yI(a){return us(()=>a.hooks.dragPreview(),[a])}let Zp=!1,Qp=!1;class _I{receiveHandlerId(s){this.sourceId=s}getHandlerId(){return this.sourceId}canDrag(){Ve(!Zp,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Zp=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Zp=!1}}isDragging(){if(!this.sourceId)return!1;Ve(!Qp,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Qp=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Qp=!1}}subscribeToStateChange(s,i){return this.internalMonitor.subscribeToStateChange(s,i)}isDraggingSource(s){return this.internalMonitor.isDraggingSource(s)}isOverTarget(s,i){return this.internalMonitor.isOverTarget(s,i)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(s){return this.internalMonitor.subscribeToOffsetChange(s)}canDragSource(s){return this.internalMonitor.canDragSource(s)}canDropOnTarget(s){return this.internalMonitor.canDropOnTarget(s)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(s){this.sourceId=null,this.internalMonitor=s.getMonitor()}}let eg=!1;class wI{receiveHandlerId(s){this.targetId=s}getHandlerId(){return this.targetId}subscribeToStateChange(s,i){return this.internalMonitor.subscribeToStateChange(s,i)}canDrop(){if(!this.targetId)return!1;Ve(!eg,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return eg=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{eg=!1}}isOver(s){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,s):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(s){this.targetId=null,this.internalMonitor=s.getMonitor()}}function kI(a,s,i){const r=i.getRegistry(),l=r.addTarget(a,s);return[l,()=>r.removeTarget(l)]}function CI(a,s,i){const r=i.getRegistry(),l=r.addSource(a,s);return[l,()=>r.removeSource(l)]}function Fg(a,s,i,r){let l;if(l!==void 0)return!!l;if(a===s)return!0;if(typeof a!="object"||!a||typeof s!="object"||!s)return!1;const c=Object.keys(a),d=Object.keys(s);if(c.length!==d.length)return!1;const h=Object.prototype.hasOwnProperty.bind(s);for(let p=0;p, or turn it into a drag source or a drop target itself.`)}function SI(a){return(s=null,i=null)=>{if(!Ew(s)){const c=s;return a(c,i),c}const r=s;return TI(r),EI(r,i?c=>a(c,i):a)}}function ik(a){const s={};return Object.keys(a).forEach(i=>{const r=a[i];if(i.endsWith("Ref"))s[i]=a[i];else{const l=SI(r);s[i]=()=>l}}),s}function v_(a,s){typeof a=="function"?a(s):a.current=s}function EI(a,s){const i=a.ref;return Ve(typeof i!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a or
. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),i?Eg(a,{ref:r=>{v_(i,r),v_(s,r)}}):Eg(a,{ref:s})}class II{receiveHandlerId(s){this.handlerId!==s&&(this.handlerId=s,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(s){this.dragSourceOptionsInternal=s}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(s){this.dragPreviewOptionsInternal=s}reconnect(){const s=this.reconnectDragSource();this.reconnectDragPreview(s)}reconnectDragSource(){const s=this.dragSource,i=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return i&&this.disconnectDragSource(),this.handlerId?s?(i&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=s,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,s,this.dragSourceOptions)),i):(this.lastConnectedDragSource=s,i):i}reconnectDragPreview(s=!1){const i=this.dragPreview,r=s||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!i){this.lastConnectedDragPreview=i;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=i,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,i,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Fg(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Fg(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(s){this.hooks=ik({dragSource:(i,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,jg(i)?this.dragSourceRef=i:this.dragSourceNode=i,this.reconnectDragSource()},dragPreview:(i,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,jg(i)?this.dragPreviewRef=i:this.dragPreviewNode=i,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=s}}class xI{get connectTarget(){return this.dropTarget}reconnect(){const s=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();s&&this.disconnectDropTarget();const i=this.dropTarget;if(this.handlerId){if(!i){this.lastConnectedDropTarget=i;return}s&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=i,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,i,this.dropTargetOptions))}}receiveHandlerId(s){s!==this.handlerId&&(this.handlerId=s,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(s){this.dropTargetOptionsInternal=s}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Fg(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(s){this.hooks=ik({dropTarget:(i,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,jg(i)?this.dropTargetRef=i:this.dropTargetNode=i,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=s}}function zn(){const{dragDropManager:a}=ia(Kw);return Ve(a!=null,"Expected drag drop context"),a}function DI(a,s){const i=zn(),r=us(()=>new II(i.getBackend()),[i]);return Oi(()=>(r.dragSourceOptions=a||null,r.reconnect(),()=>r.disconnectDragSource()),[r,a]),Oi(()=>(r.dragPreviewOptions=s||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,s]),r}function AI(){const a=zn();return us(()=>new _I(a),[a])}class OI{beginDrag(){const s=this.spec,i=this.monitor;let r=null;return typeof s.item=="object"?r=s.item:typeof s.item=="function"?r=s.item(i):r={},r??null}canDrag(){const s=this.spec,i=this.monitor;return typeof s.canDrag=="boolean"?s.canDrag:typeof s.canDrag=="function"?s.canDrag(i):!0}isDragging(s,i){const r=this.spec,l=this.monitor,{isDragging:c}=r;return c?c(l):i===s.getSourceId()}endDrag(){const s=this.spec,i=this.monitor,r=this.connector,{end:l}=s;l&&l(i.getItem(),i),r.reconnect()}constructor(s,i,r){this.spec=s,this.monitor=i,this.connector=r}}function RI(a,s,i){const r=us(()=>new OI(a,s,i),[s,i]);return Lt(()=>{r.spec=a},[a]),r}function NI(a){return us(()=>{const s=a.type;return Ve(s!=null,"spec.type must be defined"),s},[a])}function MI(a,s,i){const r=zn(),l=RI(a,s,i),c=NI(a);Oi(function(){if(c!=null){const[h,p]=CI(c,l,r);return s.receiveHandlerId(h),i.receiveHandlerId(h),p}},[r,s,i,l,c])}function LI(a,s){const i=ok(a);Ve(!i.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=AI(),l=DI(i.options,i.previewOptions);return MI(i,r,l),[sk(i.collect,r,l),vI(l),yI(l)]}function PI(a){return us(()=>a.hooks.dropTarget(),[a])}function BI(a){const s=zn(),i=us(()=>new xI(s.getBackend()),[s]);return Oi(()=>(i.dropTargetOptions=a||null,i.reconnect(),()=>i.disconnectDropTarget()),[a]),i}function FI(){const a=zn();return us(()=>new wI(a),[a])}function jI(a){const{accept:s}=a;return us(()=>(Ve(a.accept!=null,"accept must be defined"),Array.isArray(s)?s:[s]),[s])}class zI{canDrop(){const s=this.spec,i=this.monitor;return s.canDrop?s.canDrop(i.getItem(),i):!0}hover(){const s=this.spec,i=this.monitor;s.hover&&s.hover(i.getItem(),i)}drop(){const s=this.spec,i=this.monitor;if(s.drop)return s.drop(i.getItem(),i)}constructor(s,i){this.spec=s,this.monitor=i}}function UI(a,s){const i=us(()=>new zI(a,s),[s]);return Lt(()=>{i.spec=a},[a]),i}function HI(a,s,i){const r=zn(),l=UI(a,s),c=jI(a);Oi(function(){const[h,p]=kI(c,l,r);return s.receiveHandlerId(h),i.receiveHandlerId(h),p},[r,s,l,i,c.map(d=>d.toString()).join("|")])}function WI(a,s){const i=ok(a),r=FI(),l=BI(i.options);return HI(i,r,l),[sk(i.collect,r,l),PI(l)]}function nk(a){let s=null;return()=>(s==null&&(s=a()),s)}function GI(a,s){return a.filter(i=>i!==s)}function VI(a,s){const i=new Set,r=c=>i.add(c);a.forEach(r),s.forEach(r);const l=[];return i.forEach(c=>l.push(c)),l}class KI{enter(s){const i=this.entered.length,r=l=>this.isNodeInDocument(l)&&(!l.contains||l.contains(s));return this.entered=VI(this.entered.filter(r),[s]),i===0&&this.entered.length>0}leave(s){const i=this.entered.length;return this.entered=GI(this.entered.filter(this.isNodeInDocument),s),i>0&&this.entered.length===0}reset(){this.entered=[]}constructor(s){this.entered=[],this.isNodeInDocument=s}}class YI{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(s=>{Object.defineProperty(this.item,s,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${s}" until the drop event.`),null}})})}loadDataTransfer(s){if(s){const i={};Object.keys(this.config.exposeProperties).forEach(r=>{const l=this.config.exposeProperties[r];l!=null&&(i[r]={value:l(s,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,i)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(s,i){return i===s.getSourceId()}endDrag(){}constructor(s){this.config=s,this.item={},this.initializeExposedProperties()}}const rk="__NATIVE_FILE__",ak="__NATIVE_URL__",lk="__NATIVE_TEXT__",ck="__NATIVE_HTML__",y_=Object.freeze(Object.defineProperty({__proto__:null,FILE:rk,HTML:ck,TEXT:lk,URL:ak},Symbol.toStringTag,{value:"Module"}));function tg(a,s,i){const r=s.reduce((l,c)=>l||a.getData(c),"");return r??i}const zg={[rk]:{exposeProperties:{files:a=>Array.prototype.slice.call(a.files),items:a=>a.items,dataTransfer:a=>a},matchesTypes:["Files"]},[ck]:{exposeProperties:{html:(a,s)=>tg(a,s,""),dataTransfer:a=>a},matchesTypes:["Html","text/html"]},[ak]:{exposeProperties:{urls:(a,s)=>tg(a,s,"").split(` -`),dataTransfer:a=>a},matchesTypes:["Url","text/uri-list"]},[lk]:{exposeProperties:{text:(a,s)=>tg(a,s,""),dataTransfer:a=>a},matchesTypes:["Text","text/plain"]}};function JI(a,s){const i=zg[a];if(!i)throw new Error(`native type ${a} has no configuration`);const r=new YI(i);return r.loadDataTransfer(s),r}function sg(a){if(!a)return null;const s=Array.prototype.slice.call(a.types||[]);return Object.keys(zg).filter(i=>{const r=zg[i];return r!=null&&r.matchesTypes?r.matchesTypes.some(l=>s.indexOf(l)>-1):!1})[0]||null}const qI=nk(()=>/firefox/i.test(navigator.userAgent)),uk=nk(()=>!!window.safari);class __{interpolate(s){const{xs:i,ys:r,c1s:l,c2s:c,c3s:d}=this;let h=i.length-1;if(s===i[h])return r[h];let p=0,f=d.length-1,b;for(;p<=f;){b=Math.floor(.5*(p+f));const v=i[b];if(vs)f=b-1;else return r[b]}h=Math.max(0,f);const y=s-i[h],w=y*y;return r[h]+l[h]*y+c[h]*w+d[h]*y*w}constructor(s,i){const{length:r}=s,l=[];for(let v=0;vs[v]{let W=new __([0,.5,1],[p.y,p.y/b*_,p.y+_-b]).interpolate(w);return uk()&&c&&(W+=(window.devicePixelRatio-1)*_),W},S=()=>new __([0,.5,1],[p.x,p.x/f*v,p.x+v-f]).interpolate(y),{offsetX:T,offsetY:E}=l,D=T===0||T,M=E===0||E;return{x:D?T:S(),y:M?E:$()}}let tx=class{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var s;return!((s=this.globalContext)===null||s===void 0)&&s.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var s;return((s=this.optionsArgs)===null||s===void 0?void 0:s.rootElement)||this.window}constructor(s,i){this.ownerDocument=null,this.globalContext=s,this.optionsArgs=i}};function sx(a,s,i){return s in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function w_(a){for(var s=1;s{this.sourcePreviewNodes.delete(s),this.sourcePreviewNodeOptions.delete(s)}}connectDragSource(s,i,r){this.sourceNodes.set(s,i),this.sourceNodeOptions.set(s,r);const l=d=>this.handleDragStart(d,s),c=d=>this.handleSelectStart(d);return i.setAttribute("draggable","true"),i.addEventListener("dragstart",l),i.addEventListener("selectstart",c),()=>{this.sourceNodes.delete(s),this.sourceNodeOptions.delete(s),i.removeEventListener("dragstart",l),i.removeEventListener("selectstart",c),i.setAttribute("draggable","false")}}connectDropTarget(s,i){const r=d=>this.handleDragEnter(d,s),l=d=>this.handleDragOver(d,s),c=d=>this.handleDrop(d,s);return i.addEventListener("dragenter",r),i.addEventListener("dragover",l),i.addEventListener("drop",c),()=>{i.removeEventListener("dragenter",r),i.removeEventListener("dragover",l),i.removeEventListener("drop",c)}}addEventListeners(s){s.addEventListener&&(s.addEventListener("dragstart",this.handleTopDragStart),s.addEventListener("dragstart",this.handleTopDragStartCapture,!0),s.addEventListener("dragend",this.handleTopDragEndCapture,!0),s.addEventListener("dragenter",this.handleTopDragEnter),s.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),s.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),s.addEventListener("dragover",this.handleTopDragOver),s.addEventListener("dragover",this.handleTopDragOverCapture,!0),s.addEventListener("drop",this.handleTopDrop),s.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(s){s.removeEventListener&&(s.removeEventListener("dragstart",this.handleTopDragStart),s.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),s.removeEventListener("dragend",this.handleTopDragEndCapture,!0),s.removeEventListener("dragenter",this.handleTopDragEnter),s.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),s.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),s.removeEventListener("dragover",this.handleTopDragOver),s.removeEventListener("dragover",this.handleTopDragOverCapture,!0),s.removeEventListener("drop",this.handleTopDrop),s.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const s=this.monitor.getSourceId(),i=this.sourceNodeOptions.get(s);return w_({dropEffect:this.altKeyPressed?"copy":"move"},i||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const s=this.monitor.getSourceId(),i=this.sourcePreviewNodeOptions.get(s);return w_({anchorX:.5,anchorY:.5,captureDraggingState:!1},i||{})}isDraggingNativeItem(){const s=this.monitor.getItemType();return Object.keys(y_).some(i=>y_[i]===s)}beginDragNativeItem(s,i){this.clearCurrentDragSourceNode(),this.currentNativeSource=JI(s,i),this.currentNativeHandle=this.registry.addSource(s,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(s){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=s;const i=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},i)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var s;(s=this.window)===null||s===void 0||s.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(s,i){s.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(i))}handleDragEnter(s,i){this.dragEnterTargetIds.unshift(i)}handleDragOver(s,i){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(i)}handleDrop(s,i){this.dropTargetIds.unshift(i)}constructor(s,i,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=l=>{const c=this.sourceNodes.get(l);return c&&dk(c)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=l=>!!(l&&this.document&&this.document.body&&this.document.body.contains(l)),this.endDragIfSourceWasRemovedFromDOM=()=>{const l=this.currentDragSourceNode;l==null||this.isNodeInDocument(l)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=l=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(l||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=l=>{if(l.defaultPrevented)return;const{dragStartSourceIds:c}=this;this.dragStartSourceIds=null;const d=nc(l);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(c||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:d});const{dataTransfer:h}=l,p=sg(h);if(this.monitor.isDragging()){if(h&&typeof h.setDragImage=="function"){const b=this.monitor.getSourceId(),y=this.sourceNodes.get(b),w=this.sourcePreviewNodes.get(b)||y;if(w){const{anchorX:v,anchorY:_,offsetX:$,offsetY:S}=this.getCurrentSourcePreviewNodeOptions(),D=ex(y,w,d,{anchorX:v,anchorY:_},{offsetX:$,offsetY:S});h.setDragImage(w,D.x,D.y)}}try{h==null||h.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(l.target);const{captureDraggingState:f}=this.getCurrentSourcePreviewNodeOptions();f?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(p)this.beginDragNativeItem(p);else{if(h&&!h.types&&(l.target&&!l.target.hasAttribute||!l.target.hasAttribute("draggable")))return;l.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=l=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var c;(c=this.currentNativeSource)===null||c===void 0||c.loadDataTransfer(l.dataTransfer)}if(!this.enterLeaveCounter.enter(l.target)||this.monitor.isDragging())return;const{dataTransfer:h}=l,p=sg(h);p&&this.beginDragNativeItem(p,h)},this.handleTopDragEnter=l=>{const{dragEnterTargetIds:c}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=l.altKey,c.length>0&&this.actions.hover(c,{clientOffset:nc(l)}),c.some(h=>this.monitor.canDropOnTarget(h))&&(l.preventDefault(),l.dataTransfer&&(l.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=l=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var c;(c=this.currentNativeSource)===null||c===void 0||c.loadDataTransfer(l.dataTransfer)}},this.handleTopDragOver=l=>{const{dragOverTargetIds:c}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){l.preventDefault(),l.dataTransfer&&(l.dataTransfer.dropEffect="none");return}this.altKeyPressed=l.altKey,this.lastClientOffset=nc(l),this.scheduleHover(c),(c||[]).some(h=>this.monitor.canDropOnTarget(h))?(l.preventDefault(),l.dataTransfer&&(l.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?l.preventDefault():(l.preventDefault(),l.dataTransfer&&(l.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=l=>{this.isDraggingNativeItem()&&l.preventDefault(),this.enterLeaveCounter.leave(l.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=l=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var c;l.preventDefault(),(c=this.currentNativeSource)===null||c===void 0||c.loadDataTransfer(l.dataTransfer)}else sg(l.dataTransfer)&&l.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=l=>{const{dropTargetIds:c}=this;this.dropTargetIds=[],this.actions.hover(c,{clientOffset:nc(l)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=l=>{const c=l.target;typeof c.dragDrop=="function"&&(c.tagName==="INPUT"||c.tagName==="SELECT"||c.tagName==="TEXTAREA"||c.isContentEditable||(l.preventDefault(),c.dragDrop()))},this.options=new tx(i,r),this.actions=s.getActions(),this.monitor=s.getMonitor(),this.registry=s.getRegistry(),this.enterLeaveCounter=new KI(this.isNodeInDocument)}}const hk=function(s,i,r){return new ox(s,i,r)},ix=$t([m.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),m.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"AccessTime"),nx=$t(m.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox"),rx=$t(m.jsx("path",{d:"M4 8h4V4H4zm6 12h4v-4h-4zm-6 0h4v-4H4zm0-6h4v-4H4zm6 0h4v-4h-4zm6-10v4h4V4zm-6 4h4V4h-4zm6 6h4v-4h-4zm0 6h4v-4h-4z"}),"Apps"),ax=$t(m.jsx("path",{d:"M9 2c-1.05 0-2.05.16-3 .46 4.06 1.27 7 5.06 7 9.54s-2.94 8.27-7 9.54c.95.3 1.95.46 3 .46 5.52 0 10-4.48 10-10S14.52 2 9 2"}),"Brightness3"),lx=$t(m.jsx("path",{d:"M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5s-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20zm-6 8h-4v-2h4zm0-4h-4v-2h4z"}),"BugReport"),cx=$t(m.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm-1 4 6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2zm-1 7h5.5L14 6.5z"}),"FileCopy"),ux=$t(m.jsx("path",{d:"M7 2v11h3v9l7-12h-4l4-8z"}),"FlashOn"),dx=$t(m.jsx("path",{d:"M3.27 5 2 6.27l6.97 6.97L6.5 19h3l1.57-3.66L16.73 21 18 19.73 3.55 5.27zM6 5v.18L8.82 8h2.4l-.72 1.68 2.1 2.1L14.21 8H20V5z"}),"FormatClear"),hx=$t(m.jsx("path",{d:"M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z"}),"Functions"),pk=$t(m.jsx("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutline"),px=$t(m.jsx("path",{d:"M21 3.01H3c-1.1 0-2 .9-2 2V9h2V4.99h18v14.03H3V15H1v4.01c0 1.1.9 1.98 2 1.98h18c1.1 0 2-.88 2-1.98v-14c0-1.11-.9-2-2-2M11 16l4-4-4-4v3H1v2h10z"}),"Input"),k_=$t(m.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"}),"Lock"),gx=$t(m.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert"),mx=$t(m.jsx("path",{d:"M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10c1.38 0 2.5-1.12 2.5-2.5 0-.61-.23-1.2-.64-1.67-.08-.1-.13-.21-.13-.33 0-.28.22-.5.5-.5H16c3.31 0 6-2.69 6-6 0-4.96-4.49-9-10-9m5.5 11c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m-3-4c-.83 0-1.5-.67-1.5-1.5S13.67 6 14.5 6s1.5.67 1.5 1.5S15.33 9 14.5 9M5 11.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5S7.33 13 6.5 13 5 12.33 5 11.5m6-4c0 .83-.67 1.5-1.5 1.5S8 8.33 8 7.5 8.67 6 9.5 6s1.5.67 1.5 1.5"}),"Palette"),bc=$t(m.jsx("path",{d:"M6 19h4V5H6zm8-14v14h4V5z"}),"Pause"),Ug=$t(m.jsx("path",{d:"M8 5v14l11-7z"}),"PlayArrow"),fx=$t(m.jsx("path",{d:"M11 5v5.59H7.5l4.5 4.5 4.5-4.5H13V5zm-5 9c0 3.31 2.69 6 6 6s6-2.69 6-6h-2c0 2.21-1.79 4-4 4s-4-1.79-4-4z"}),"PlayForWork"),$x=$t(m.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search"),bx=$t(m.jsx("path",{d:"M10.59 9.17 5.41 4 4 5.41l5.17 5.17zM14.5 4l2.04 2.04L4 18.59 5.41 20 17.96 7.46 20 9.5V4zm.33 9.41-1.41 1.41 3.13 3.13L14.5 20H20v-5.5l-2.04 2.04z"}),"Shuffle"),vx=$t(m.jsx("path",{d:"M2 20h20v-4H2zm2-3h2v2H4zM2 4v4h20V4zm4 3H4V5h2zm-4 7h20v-4H2zm2-3h2v2H4z"}),"Storage"),yx=$t(m.jsx("path",{d:"M14 17H4v2h10zm6-8H4v2h16zM4 15h16v-2H4zM4 5v2h16V5z"}),"Subject"),_x=$t(m.jsx("path",{d:"M16 17.01V10h-2v7.01h-3L15 21l4-3.99zM9 3 5 6.99h3V14h2V6.99h3z"}),"SwapVert"),wx=$t(m.jsx("path",{d:"M7.41 18.59 8.83 20 12 16.83 15.17 20l1.41-1.41L12 14zm9.18-13.18L15.17 4 12 7.17 8.83 4 7.41 5.41 12 10z"}),"UnfoldLess"),kx=$t(m.jsx("path",{d:"M12 5.83 15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15z"}),"UnfoldMore"),Tc="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='512'%20height='512'%20shape-rendering='geometricPrecision'%20image-rendering='optimizeQuality'%20fill-rule='evenodd'%20xmlns:v='https://vecta.io/nano'%3e%3cpath%20fill='%23efda4e'%20d='M-.5-.5h512v512H-.5V-.5z'/%3e%3cpath%20fill='%23020100'%20d='M308.5%20287.5c1.777-3.005%202.777-6.338%203-10%209.147-21.963%2025.48-35.463%2049-40.5%2021.999-4.173%2043.666-2.84%2065%204%2014.575%205.411%2025.575%2014.911%2033%2028.5l-1%202c-12.413%205.624-24.58%2011.624-36.5%2018-5.321-8.25-12.821-13.417-22.5-15.5-13.957-3.122-27.29-1.455-40%205-8.125%205.36-10.958%2012.86-8.5%2022.5%203.223%206.223%208.057%2010.723%2014.5%2013.5l64%2020c38.459%2016.085%2052.626%2044.585%2042.5%2085.5-7.572%2026.208-24.738%2042.041-51.5%2047.5-25.102%205.733-49.768%204.4-74-4-19.291-8.625-32.291-22.958-39-43%2011.266-8.887%2023.433-16.387%2036.5-22.5%203.117%206.896%206.784%2013.563%2011%2020%2012.705%2012.307%2027.872%2016.807%2045.5%2013.5%2022.189-3.504%2032.355-16.338%2030.5-38.5-2.833-6.833-7.667-11.667-14.5-14.5l-57-17c-36.004-11.84-52.67-36.673-50-74.5z'/%3e%3cpath%20fill='%23020200'%20d='M222.5%20238.5h43l-.5%20159c-2.688%2052.355-30.188%2076.855-82.5%2073.5-24.871-3.543-41.204-17.21-49-41l.5-2.5a12.14%2012.14%200%200%200%204.5-3.5c10.653-5.825%2021.32-11.325%2032-16.5%204.763%2021.72%2017.763%2028.887%2039%2021.5%204.616-2.618%207.783-6.451%209.5-11.5%201.163-5.968%202.163-11.968%203-18l.5-161z'/%3e%3cpath%20fill='%23615820'%20d='M311.5%20277.5c-.223%203.662-1.223%206.995-3%2010%20.223-3.662%201.223-6.995%203-10z'/%3e%3c/svg%3e",gk="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20500%20500'%3e%3cpath%20fill='%234285f4'%20d='M44.271%2027.275l206.5%201v170l-58.5-36.5c-7.005-.916-12.505%201.584-16.5%207.5v147c4.625%204.412%2010.125%206.245%2016.5%205.5l57.5-35.5c.833%2054.003%201.356%20108.003.189%20162-1.272.546-45.599-.242-48.689%201.121-3.674%207.844-4.79%2011.207-13%2023.879-4.372%205.527-2.19%204.097-10.689%2012.258-5.166%202.748-4.191%203.45-14.311%206.242-17.67%201.983-35.336%201.983-53%200-9.535-3.774-10.879-4.163-18.526-11.22-5.562-4.39-11.131-11.803-11.974-15.28-4.068-7.881-3.42-9.116-5.5-13.5-3.672-1.503-35.798.203-40.746-1.335-5.823-2.314-2.946-.422-7.954-3.689-2.888-2.668-2.255-3.221-2.421-9.904L20.771%2050.275c.36-2.108-.41-5.806%202.522-11.615%204.343-5.852%205.374-7%2010.061-9.146%206.083-2.73%208.677-1.475%2010.917-2.239z'/%3e%3cpath%20d='M258.271%2030.275l154.63.407c5.654.559%2010.783%203.17%2014.37%207.093%204.907%204.408%206.204%208.723%207.5%2013.5v373c-.208%205.716-.297%207.982-4.848%2015.404-7.078%206.393-9.879%206.39-15.652%206.692-24.804%201.296-50.079%201.189-74.96%201.041-24.516-.014-68.46.89-81.5.391l-2.512-172.528c-20.083%2012.625-42.777%2025.125-63.028%2037.5-4.127%201.292-7.294.125-9.5-3.5l1-137c1.864-2.707%204.364-3.541%207.5-2.5%2020.366%2013.427%2064.35%2038.947%2065.581%2038.339l1.419-177.839z'%20fill='%23DDD'/%3e%3c/svg%3e",mk="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20512%20512'%20width='32'%20height='32'%3e%3cpath%20fill='%23007acc'%20d='M-.5-.5h503l-1%20179h10v333h-421v-7h-91V-.5z'/%3e%3cpath%20fill='%230f81cf'%20d='M502.5-.5h9v179h-10l1-179z'/%3e%3cpath%20fill='%23fdfefe'%20d='M470.5%20227.5c.33%2017.508-.003%2034.841-1%2052-23.486-15.709-48.82-19.875-76-12.5-15.89%208.078-19.39%2019.911-10.5%2035.5%204.673%205.577%2010.173%2010.077%2016.5%2013.5l38%2019c17.945%209.278%2031.112%2023.112%2039.5%2041.5%201.352%203.22%202.186%206.553%202.5%2010a305.16%20305.16%200%200%201%201%2026c-3.553%2033.726-21.886%2054.559-55%2062.5-34.769%207.363-68.435%204.196-101-9.5-.167-19.003%200-38.003.5-57%2022.903%2021.314%2049.736%2029.147%2080.5%2023.5%2019.435-5.701%2025.268-17.868%2017.5-36.5-4.718-6.44-10.552-11.606-17.5-15.5a1552.42%201552.42%200%200%201-47-24c-27.679-19.331-38.846-45.831-33.5-79.5%206.43-26.433%2022.597-43.933%2048.5-52.5%2026.131-6.625%2052.464-7.292%2079-2a565.56%20565.56%200%200%201%2018%205.5z'/%3e%3cpath%20fill='%23fefefe'%20d='M122.5%20222.5h182v46h-65v206h-52v-206h-65v-46z'/%3e%3cpath%20fill='%2370b3e1'%20d='M470.5%20227.5c1.327%2017.505%201.327%2035.171%200%2053-.607-.124-.94-.457-1-1%20.997-17.159%201.33-34.492%201-52z'/%3e%3cpath%20fill='%236cafe0'%20d='M479.5%20386.5c1.465%205.09%202.132%2010.423%202%2016-.002%203.518-.335%206.851-1%2010a305.16%20305.16%200%200%200-1-26z'/%3e%3cpath%20fill='%231283cf'%20d='M-.5%20504.5h91v7h-91v-7z'/%3e%3c/svg%3e",fk="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIj4KICAgIDxyYWRpYWxHcmFkaWVudCBpZD0ibXlHcmFkaWVudCI+CiAgICAgICAgPHN0b3Agb2Zmc2V0PSIxMCUiIHN0b3AtY29sb3I9IiMxQzJENUYiIC8+CiAgICAgICAgPHN0b3Agb2Zmc2V0PSI5NSUiIHN0b3AtY29sb3I9IiMwQjFENTMiIC8+CiAgICA8L3JhZGlhbEdyYWRpZW50PgogICAgPHBhdGggZmlsbD0idXJsKCcjbXlHcmFkaWVudCcpIiBkPSJNLS4xLS4xaDUxMnY1MTJILS4xVi0uMXoiLz4KICAgIDxwYXRoIGZpbGw9IiNmOGY4ZmEiCiAgICAgICAgICBkPSJNNDgyLjUgMjMxLjV2NmgtMjVjLS45NzItOC4xNy01LjYzOS0x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5LS45OTYgMjkuMTU3LTEuMzI5IDQ0LTF2LTE2Yy0xNC44NDMuMzI5LTI5LjUxLS4wMDQtNDQtMXoiLz4KICAgIDxwYXRoIGZpbGw9IiNhMmE5YmUiIGQ9Ik00MjguNSAyNzUuNWgtMjV2OGMtLjk3Ny0yLjc4Ny0xLjMxLTUuNzg3LTEtOSA4Ljg0OS0uMzI2IDE3LjUxNi4wMDcgMjYgMXoiLz4KICAgIDxwYXRoIGZpbGw9IiNhNWFjYmYiCiAgICAgICAgICBkPSJNMTEzLjUgMzAxLjVjLjk3OC4zMTEgMS42NDUuOTc4IDIgMmwtMTYgMWMtNS43MTEtLjAwNS0xMS4wNDQtLjY3Mi0xNi0yYTEyOC4xOSAxMjguMTkgMCAwIDAgMTUuNSAxYzUuMjE2LS4wMDYgMTAuMDQ5LS42NzMgMTQuNS0yeiIvPgogICAgPHBhdGggZmlsbD0iI2E1YWNjMCIgZD0iTTIzMy41IDIwOS41djk0aDY5di0xN2MtMTMuNTEuMzI5LTI2Ljg0NC0uMDA0LTQwLTFoNDF2MTloLTcxYTIyNTYuNDEgMjI1Ni40MSAwIDAgMSAxLTk1eiIvPgogICAgPHBhdGggZmlsbD0iI2E2YWNjMCIKICAgICAgICAgIGQ9Ik0zMTYuNSAyMDkuNWMtLjk5OCAzMS4xNjItMS4zMzIgNjIuNDk2LTEgOTRoNzN2LTE3Yy0xNC44NDMuMzI5LTI5LjUxLS4wMDQtNDQtMWg0NXYxOWgtNzVhMjMwNC45NSAyMzA0Ljk1IDAgMCAxIDEtOTZjLjYwNy4xMjQuOTQuNDU3IDEgMXoiLz4KPC9zdmc+";class vm extends _e.Component{isShowInstance;oldId;constructor(s){super(s),this.state={name:s.name,id:s.id,instance:s.instance||0,prefix:vm.getPrefix(s.id)},this.isShowInstance=!s.folder&&!!s.instances&&(!!s.instance||!!s.instances[0]||s.instances.length>1),this.oldId=s.id}static getPrefix(s){const i=(s||"").split(".");return i.pop(),i.join(".")}getId(s){return s=(s||"").replace(/[\\/\][*,;'"`<>?\s]/g,"_"),`${this.state.prefix}.${s}`}handleCancel=()=>{this.props.onClose()};handleOk=()=>{this.props.onRename(this.oldId,this.state.id,this.state.name,this.state.instance===0?0:this.state.instance||void 0),this.props.onClose()};handleChange=s=>{this.setState({name:s,id:this.getId(s)})};render(){return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"md",fullWidth:!0,open:!0,"aria-labelledby":"confirmation-dialog-title",children:[m.jsx(ss,{id:"confirmation-dialog-title",children:x.I18n.t("Rename")}),m.jsx(qt,{children:m.jsxs("form",{noValidate:!0,autoComplete:"off",children:[m.jsx(Eo,{variant:"standard",style:{width:"100%"},id:"standard-name",autoFocus:!0,label:x.I18n.t("Name"),value:this.state.name,onKeyUp:s=>{s.key==="Enter"&&(s.preventDefault(),setTimeout(()=>this.handleOk(),200))},onChange:s=>this.handleChange(s.target.value),margin:"normal"}),m.jsx(Eo,{variant:"standard",id:"standard-name-id",style:{width:"100%"},label:x.I18n.t("ID"),value:this.state.id,disabled:!0,margin:"normal"}),this.isShowInstance&&m.jsxs(Di,{variant:"standard",children:[m.jsx(xg,{htmlFor:"instance",children:x.I18n.t("Instance")}),m.jsx(Ai,{variant:"standard",value:this.state.instance,onChange:s=>this.setState({instance:parseInt(s.target.value,10)}),inputProps:{name:"instance",id:"instance"},children:this.props.instances.map(s=>m.jsx(it,{value:s,children:s||"0"},s))})]})]})}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",onClick:this.handleOk,color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Ok")}),m.jsx(He,{color:"grey",variant:"contained",onClick:this.handleCancel,startIcon:m.jsx(so,{}),children:x.I18n.t("Cancel")})]})]})}}class Cx extends _e.Component{constructor(s){super(s),this.state={name:s.name,id:s.id}}handleCancel=()=>{this.props.onClose()};handleOk=()=>{this.props.onDelete(this.state.id),this.props.onClose()};render(){return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"md",open:!0,"aria-labelledby":"confirmation-dialog-title",children:[m.jsx(ss,{id:"confirmation-dialog-title",children:x.I18n.t("Are you sure?")}),m.jsxs(qt,{children:[m.jsx(mc,{}),m.jsx("span",{style:{fontSize:14,fontWeight:"bold"},children:x.I18n.t("Delete %s",this.state.name)})]}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",onClick:this.handleOk,color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Ok")}),m.jsx(He,{color:"grey",variant:"contained",onClick:this.handleCancel,startIcon:m.jsx(so,{}),children:x.I18n.t("Cancel")})]})]})}}const Tx=""+new URL("tileJS-C48gYbHw.png",import.meta.url).href,Sx=""+new URL("tileTS-CsXmgy4B.png",import.meta.url).href,Ex=""+new URL("tileBlockly-BMpdinN3.png",import.meta.url).href,Ix=""+new URL("tileRules-BkbaFIhs.png",import.meta.url).href,jt={card:{maxWidth:345,minWidth:250,display:"inline-block",margin:"0 10px 0 10px"},media:{height:122},text:{maxWidth:218,minHeight:30},complexity:{fontWeight:"bold",fontStyle:"italic",marginBottom:8}};class Dn extends _e.Component{handleCancel=()=>{this.props.onClose()};static openHtml(s){const i=x.I18n.getLanguage();!s.includes("javascript.md")&&(i==="de"||i==="ru")&&(s=s.replace(/\/en\//,`/${i}/`));const r=window.open(s,"_blank");r==null||r.focus()}getJSCard(){return m.jsxs(Xl,{style:jt.card,children:[m.jsxs(Zl,{onClick:()=>this.props.onClose&&this.props.onClose("Javascript/js"),children:[m.jsx(Ql,{style:jt.media,image:Tx,title:"JavaScript"}),m.jsxs(ec,{children:[m.jsx("h2",{children:"JavaScript"}),m.jsx("div",{style:jt.complexity,children:x.I18n.t("for programmers")}),m.jsx("div",{style:jt.text,children:x.I18n.t("JS description")})]})]}),m.jsxs(tc,{children:[m.jsx(He,{size:"small",color:"primary",variant:"contained",onClick:()=>this.props.onClose&&this.props.onClose("Javascript/js"),children:x.I18n.t("Add")}),m.jsx(He,{size:"small",color:"secondary",onClick:()=>Dn.openHtml("https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/javascript.md"),children:x.I18n.t("Learn More")})]})]})}getTSCard(){return m.jsxs(Xl,{style:jt.card,children:[m.jsxs(Zl,{onClick:()=>this.props.onClose&&this.props.onClose("TypeScript/ts"),children:[m.jsx(Ql,{style:jt.media,image:Sx,title:"TypeScript"}),m.jsxs(ec,{children:[m.jsx("h2",{children:"TypeScript"}),m.jsx("div",{style:jt.complexity,children:x.I18n.t("for professionals")}),m.jsx("div",{style:jt.text,children:x.I18n.t("TS description")})]})]}),m.jsxs(tc,{children:[m.jsx(He,{size:"small",color:"primary",variant:"contained",onClick:()=>this.props.onClose&&this.props.onClose("TypeScript/ts"),children:x.I18n.t("Add")}),m.jsx(He,{size:"small",color:"secondary",onClick:()=>Dn.openHtml("https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/javascript.md"),children:x.I18n.t("Learn More")})]})]})}getBlocklyCard(){return m.jsxs(Xl,{style:jt.card,children:[m.jsxs(Zl,{onClick:()=>this.props.onClose&&this.props.onClose("Blockly"),children:[m.jsx(Ql,{style:jt.media,image:Ex,title:"Blockly"}),m.jsxs(ec,{children:[m.jsx("h2",{children:"Blockly"}),m.jsx("div",{style:jt.complexity,children:x.I18n.t("normal")}),m.jsx("div",{style:jt.text,children:x.I18n.t("Blockly description")})]})]}),m.jsxs(tc,{children:[m.jsx(He,{size:"small",color:"primary",variant:"contained",onClick:()=>this.props.onClose&&this.props.onClose("Blockly"),children:x.I18n.t("Add")}),m.jsx(He,{size:"small",color:"secondary",onClick:()=>Dn.openHtml("https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/blockly.md"),children:x.I18n.t("Learn More")})]})]})}getRulesCard(){return m.jsxs(Xl,{style:jt.card,children:[m.jsxs(Zl,{onClick:()=>this.props.onClose&&this.props.onClose("Rules"),children:[m.jsx(Ql,{style:jt.media,image:Ix,title:"Rules"}),m.jsxs(ec,{children:[m.jsx("h2",{children:"Rules"}),m.jsx("div",{style:jt.complexity,children:x.I18n.t("easy")}),m.jsx("div",{style:jt.text,children:x.I18n.t("Rules description")})]})]}),m.jsxs(tc,{children:[m.jsx(He,{size:"small",color:"primary",variant:"contained",onClick:()=>this.props.onClose&&this.props.onClose("Rules"),children:x.I18n.t("Add")}),m.jsx(He,{size:"small",color:"secondary",onClick:()=>Dn.openHtml("https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/javascript.md"),children:x.I18n.t("Learn More")})]})]})}render(){return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"lg",fullWidth:!0,open:!0,"aria-labelledby":"confirmation-dialog-title",children:[m.jsx(ss,{id:"confirmation-dialog-title",children:x.I18n.t("Add new script")}),m.jsxs(qt,{style:{textAlign:"center"},children:[this.getRulesCard(),this.getBlocklyCard(),this.getJSCard(),this.getTSCard()]}),m.jsx(Ht,{children:m.jsx(He,{color:"grey",onClick:this.handleCancel,startIcon:m.jsx(so,{}),children:x.I18n.t("Cancel")})})]})}}class og extends _e.Component{isShowInstance;constructor(s){super(s),this.state={name:s.name||"Script",instance:s.instance||0,parent:s.parent,error:"",id:""},this.isShowInstance=!s.folder&&!!s.instances&&(!!s.instance||!!s.instances[0]||s.instances.length>1)}getId(s){return s=s||this.state.name||"",s=s.replace(/[\\/\][.*,;'"`<>?\s]/g,"_").trim().replace(/\.$/,"_"),`${this.state?this.state.parent:this.props.parent}.${s}`}handleOk=()=>{this.props.onAdd(this.getId(this.state.name),this.state.name,this.state.instance,this.props.type),this.props.onClose()};render(){var s;return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"md",fullWidth:!0,open:!0,"aria-labelledby":"confirmation-dialog-title",children:[m.jsx(ss,{id:"confirmation-dialog-title",children:this.props.title||x.I18n.t("Create new")}),m.jsx(qt,{children:m.jsxs("form",{noValidate:!0,autoComplete:"off",children:[m.jsx(Eo,{variant:"standard",style:{width:"100%"},id:"standard-name",autoFocus:!0,error:!!this.state.error,label:x.I18n.t("Name"),value:this.state.name||"",helperText:this.state.error,slotProps:{input:{endAdornment:this.state.name?m.jsx(qe,{size:"small",onClick:()=>this.setState({name:""}),children:m.jsx(ZT,{})}):void 0}},onKeyUp:i=>{i.preventDefault(),i.key==="Enter"&&!this.state.error&&setTimeout(()=>this.handleOk(),200)},onChange:i=>{var c;const r=i.target.value,l=this.getId(r);r?(c=this.props.existingItems)!=null&&c.includes(l)?this.setState({name:r,id:l,error:x.I18n.t("Duplicate name")}):this.setState({name:r,id:l,error:""}):this.setState({name:r,id:l,error:x.I18n.t("Empty name is not allowed")})},margin:"normal"}),m.jsxs(Di,{variant:"standard",style:{width:"100%"},children:[m.jsx(xg,{htmlFor:"parent",children:x.I18n.t("Folder")}),m.jsx(Ai,{variant:"standard",style:{width:"100%"},value:this.state.parent,onChange:i=>this.setState({parent:i.target.value}),inputProps:{name:"parent",id:"parent"},children:this.props.parents.map(i=>{const r=i.id.split(".");r.splice(0,2);const l=[];let c="script.js";return r.forEach(d=>{c+=`.${d}`;const h=this.props.parents.find(p=>p.id===c);h?l.push(h.name):l.push(d)}),l.length||l.push(i.name),m.jsx(it,{value:i.id,children:l.join(" / ")},i.id)})})]}),m.jsx(Eo,{variant:"standard",id:"standard-name-id",style:{width:"100%"},label:x.I18n.t("ID"),value:this.getId(),disabled:!0,margin:"normal"}),this.isShowInstance&&m.jsxs(Di,{variant:"standard",children:[m.jsx(xg,{htmlFor:"instance",children:x.I18n.t("Instance")}),m.jsx(Ai,{variant:"standard",value:this.state.instance,onChange:i=>this.setState({instance:parseInt(i.target.value,10)}),inputProps:{name:"instance",id:"instance"},children:(s=this.props.instances)==null?void 0:s.map(i=>m.jsx(it,{value:i,children:i||"0"},`instance${i}`))})]})]})}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",onClick:this.handleOk,disabled:!!this.state.error,color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Ok")}),m.jsx(He,{color:"grey",variant:"contained",onClick:()=>this.props.onClose(),startIcon:m.jsx(so,{}),children:x.I18n.t("Cancel")})]})]})}}const xx={title:a=>({background:a.palette.error.main,color:a.palette.error.contrastText,"&>h2":{color:a.palette.error.contrastText}})};class su extends _e.Component{handleOk=()=>{this.props.onClose()};render(){return m.jsxs(Ut,{open:!0,maxWidth:"sm",fullWidth:!0,onClose:()=>this.handleOk(),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[m.jsx(ss,{sx:xx.title,id:"alert-dialog-title",children:this.props.title||x.I18n.t("Error")}),m.jsx(qt,{children:m.jsx(Dw,{id:"alert-dialog-description",children:this.props.text||x.I18n.t("Unknown error!")})}),m.jsx(Ht,{children:m.jsx(He,{variant:"contained",onClick:()=>this.handleOk(),color:"primary",autoFocus:!0,startIcon:m.jsx(qo,{}),children:x.I18n.t("Ok")})})]})}}const zr={icon:{width:24,height:24},filterWithButton:{width:"100%"},title:{fontWeight:"bold",marginTop:16}};class Dx extends _e.Component{constructor(s){super(s),this.state={instances:[],filter:window.localStorage.getItem("javascript.debug.filter")||"",showAskForStop:!1,jsInstance:window.localStorage.getItem("javascript.debug.instance")||"",jsInstanceHost:"",adapterToDebug:window.localStorage.getItem("javascript.debug.adapter")||""}}componentDidMount(){this.props.socket.getAdapterInstances().then(s=>{const i=s.filter(h=>{var p;return h&&!((p=h.common)!=null&&p.onlyWWW)}).map(h=>{var b,y,w;const p=h._id.replace(/^system\.adapter\./,""),[f]=p.split(".");return{id:p,enabled:(b=h.common)==null?void 0:b.enabled,host:(y=h.common)==null?void 0:y.host,icon:(w=h.common)!=null&&w.icon?`../../adapter/${f}/${h.common.icon}`:""}});i.sort((h,p)=>h.id>p.id?1:h.idh.id===this.state.jsInstance):null;let c;if(!this.state.jsInstance||!l){const h=i.find(p=>p.id.startsWith("javascript."));c=(h==null?void 0:h.host)||"",r=(h==null?void 0:h.id)||""}else c=(l==null?void 0:l.host)||"";let d=this.state.adapterToDebug||"";d&&!i.find(h=>h.id===d)&&(d=""),this.setState({instances:i,jsInstance:r,adapterToDebug:d,jsInstanceHost:c})})}handleOk=()=>{var s;if((s=this.state.instances.find(i=>i.id===this.state.adapterToDebug))!=null&&s.enabled){this.props.socket.getObject(`system.adapter.${this.state.adapterToDebug}`).then(i=>{i&&(i.common.enabled=!1,this.props.socket.setObject(i._id,i).then(()=>this.props.onDebug(this.state.jsInstance,this.state.adapterToDebug)))});return}this.props.onDebug(this.state.jsInstance,this.state.adapterToDebug)};renderJavascriptList(){const s=this.state.instances.filter(i=>i.id.startsWith("javascript."));return s.length<2?null:m.jsxs(Si,{children:[m.jsx("div",{style:zr.title,children:x.I18n.t("Host")}),m.jsx(Dg,{component:"nav",children:s.map(i=>m.jsxs(e_,{component:"div",selected:this.state.jsInstance===i.id,onClick:()=>this.setState({jsInstance:i.id,jsInstanceHost:i.host}),children:[m.jsx(Ag,{children:m.jsx("img",{src:i.icon,alt:i.id,style:zr.icon})}),m.jsx(Og,{primary:i.id})]},i.id))})]})}renderInstances(){if(!this.state.jsInstance)return m.jsx(Si,{});const s=this.state.instances.filter(i=>i.id!==this.state.jsInstance&&i.host===this.state.jsInstanceHost&&(!this.state.filter||i.id.includes(this.state.filter.toLowerCase())));return m.jsxs(Si,{children:[m.jsx("div",{style:zr.title,children:x.I18n.t("Instances")}),m.jsx(Dg,{component:"nav",children:s.map(i=>m.jsxs(e_,{selected:this.state.adapterToDebug===i.id,onDoubleClick:()=>this.setState({adapterToDebug:i.id},()=>this.handleOk()),onClick:()=>this.setState({adapterToDebug:i.id}),children:[m.jsx(Ag,{children:m.jsx("img",{src:i.icon,alt:i.id,style:zr.icon})}),m.jsx(Og,{primary:i.id})]},i.id))})]})}render(){return m.jsxs(Ut,{maxWidth:"md",fullWidth:!1,open:!0,onClose:()=>!1,"aria-labelledby":"confirmation-dialog-title",children:[m.jsx(ss,{id:"confirmation-dialog-title",children:this.props.title||x.I18n.t("Debug instance")}),m.jsx(qt,{children:m.jsxs(Si,{container:!0,direction:"column",children:[m.jsx(Si,{children:m.jsx(Pn,{style:zr.filterWithButton,value:this.state.filter,placeholder:x.I18n.t("Filter"),onChange:s=>{this.setState({filter:s.target.value}),window.localStorage.setItem("javascript.debug.filter",s.target.value)},endAdornment:m.jsx(Aw,{position:"end",children:this.state.filter?m.jsx(qe,{size:"small","aria-label":"toggle password visibility",onClick:()=>this.setState({filter:""}),children:m.jsx(Mw,{})}):""})})}),m.jsx(Si,{children:m.jsxs(Si,{container:!0,children:[this.renderJavascriptList(),this.renderInstances()]})})]})}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",onClick:this.handleOk,disabled:!this.state.jsInstance||!this.state.adapterToDebug,color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Start")}),m.jsx(He,{color:"grey",variant:"contained",onClick:()=>this.props.onClose(),startIcon:m.jsx(so,{}),children:x.I18n.t("Close")})]})]})}}function $k(a){if(!a)throw new Error("Password must be a non-empty string.")}function Hg(a){return new TextEncoder().encode(a)}function Ax(a){return new TextDecoder().decode(a)}function Ox(a){let s="";for(let i=0;i({height:a.toolbar.height}),toolbarButtons:a=>({color:a.palette.mode==="dark"?"white !important":"black !important"}),iconButtonsDisabled:{filter:"grayscale(100%)",opacity:.5},toolbarSearch:{width:"calc(100% - 105px)",lineHeight:"34px",marginLeft:5},iconButtons:{width:32,height:32,padding:2},iconDropdownMenu:{paddingRight:5},menu:{width:"100%",height:"100%"},innerMenu:{width:"100%",height:"calc(100% - 76px)",overflowX:"hidden",overflowY:"auto"},listItemIcon:{minWidth:32},scriptIcon:{width:18,height:18,borderRadius:2,marginTop:4,marginBottom:4,marginLeft:8,marginRight:4},folder:{cursor:"pointer",padding:0,userSelect:"none"},folderReorder:{opacity:.3,transitionDuration:"0.5s",transitionProperty:"opacity"},folderIcon:{width:20,height:20},folderIconReorder:{paddingTop:4,paddingBottom:4,paddingLeft:8,paddingRight:4},folderIconNoReorder:{cursor:"pointer",paddingTop:4,paddingBottom:4,paddingLeft:8,paddingRight:4},script:{cursor:"pointer",padding:0,userSelect:"none"},scriptReorder:{opacity:1,transitionDuration:"0.5s",transitionProperty:"opacity"},reorder:{},selected:window.vendorPrefix?a=>({backgroundColor:a.palette.primary.main,color:a.palette.text.primary}):{backgroundColor:"#164477",color:"white"},instances:{color:"gray",fontSize:"smaller"},childrenCount:{fontSize:10,opacity:.4},footer:{height:24,display:"flex"},footerButtons:a=>({"& img":{color:a.palette.mode==="dark"?"#ffffff":"#111111",cursor:"pointer",mt:"1px",mr:"2px",height:22,width:22,"&:hover":{backgroundColor:"#dbdbdb"}},"& svg":{color:a.palette.mode==="dark"?"#ffffff":"#111111",cursor:"pointer",mt:"1px",mr:"2px",height:22,width:22,"&:hover":{backgroundColor:"#dbdbdb"}}}),footerButtonsRight:{float:"right"}},Tn={Blockly:gk,"Javascript/js":Tc,def:Tc,Rules:fk,"TypeScript/ts":mk};function Gg(a,s,i){var r;return i=i||x.I18n.getLanguage(),(r=s==null?void 0:s.common)!=null&&r.name?typeof s.common.name=="object"?(s.common.name[i]||s.common.name.en||a.replace(/^script\.js./,"")).toString():s.common.name.toString():a.replace(/^script\.js./,"")}function E_(a){var l;const s=[{id:Jt,depth:0,index:0,parent:null,title:"root",type:"folder",parentIndex:null}],i=Object.keys(a);for(let c=0;c1?h.join("."):null,instance:d.common.engine?parseInt(d.common.engine.split(".").pop(),10)||0:null,index:0,parentIndex:0}):s.push({id:i[c],title:Gg(i[c],d),depth:h.length-1,type:"folder",parent:h.length>1?h.join("."):null,index:0,parentIndex:null})}let r;do r=!1,s.forEach(c=>{if(c.parent&&!s.find(h=>h.id===c.parent)){const h=c.parent.split(".");h.pop(),s.push({id:c.parent,title:c.parent.split(".").pop()||"",depth:h.length-1,type:"folder",parent:h.length>1?h.join("."):null,index:0,parentIndex:null}),r=!0}});while(r);return s.sort((c,d)=>{const h=c.id.toLowerCase(),p=d.id.toLowerCase();return c.type==="folder"&&d.type!=="folder"?-1:d.type==="folder"&&c.type!=="folder"||h>p?1:hc.index=d),s.forEach(c=>{if(c.parent){const d=s.find(h=>h.id===c.parent);d&&(c.parentIndex=d.index)}}),s}function Lx(a){const{onDrop:s}=a,[{isOver:i,isOverAny:r},l]=WI({accept:"script",drop:c=>i?s(c):void 0,collect:c=>({isOver:c.isOver({shallow:!0}),isOverAny:c.isOver()})});return m.jsx("div",{ref:l,style:{background:i?"#40adff":void 0,opacity:r?.7:void 0},children:a.children},a.folderName)}function I_(a){const{name:s}=a,[{opacity:i},r]=LI({type:"script",item:()=>({name:s}),collect:l=>({opacity:l.isDragging()?.3:1})});return m.jsx("div",{ref:r,style:{opacity:i,transform:"translate3d(0, 0, 0)"},children:a.children},s)}class So extends _e.Component{inputRef;filterTimer;problems;problemsTimer;onProblemUpdatedBound;parent=null;constructor(s){super(s);const i=window.localStorage?window.localStorage.getItem("SideMenu.expanded"):"[]";let r;try{r=JSON.parse(i||"[]")||[]}catch{r=[]}this.inputRef=_e.createRef(),this.state={listItems:E_(s.scripts||{}),expanded:r,problems:[],reorder:!1,themeName:this.props.themeName,selected:window.localStorage&&window.localStorage.getItem("SideMenu.selected")||null,creatingScript:null,creatingFolder:!1,copingScript:"",renaming:null,deleting:null,choosingType:!1,errorText:"",instances:s.instances||[],menuOpened:!1,menuAnchorEl:null,menuAnchorFilterEl:null,searchMode:!1,expertMode:this.props.expertMode,searchText:"",width:this.props.width||300,typeFilter:window.localStorage&&window.localStorage.getItem("SideMenu.typeFilter")||"",statusFilter:window.localStorage&&window.localStorage.getItem("SideMenu.statusFilter")||"",runningInstances:this.props.runningInstances||{},scriptsHash:s.scriptsHash,showAdapterDebug:!1,isAllZeroInstances:!1,showExportDialog:!1};const l=this.ensureSelectedIsVisible();l&&Object.assign(this.state,{expanded:l}),this.filterTimer=null,Object.assign(this.state,{isAllZeroInstances:this.getIsAllZeroInstances()}),this.problems=null,this.problemsTimer=null,this.onProblemUpdatedBound=this.onProblemUpdated.bind(this)}readProblems(s,i){var r,l;if(i||(i=Object.keys(this.props.scripts)),!i||!i.length)s&&s();else{const c=i.shift(),d=this.props.scripts[c];if(((r=this.props.scripts)==null?void 0:r[c].type)==="script"&&((l=d.common)!=null&&l.enabled)&&!c.match(/^script\.js\.global\./)){const h=d.common.engine.split(".").pop(),p=this,f=`javascript.${h}.scriptProblem.${c.substring(Jt.length+1)}`;this.props.socket.getState(f).then(b=>{p.onProblemUpdated(f,b),setTimeout(()=>p.readProblems(s,i),0)})}else setTimeout(()=>this.readProblems(s,i),0)}}componentDidMount(){this.readProblems(()=>{this.props.instances.forEach(s=>{this.props.socket.subscribeState(`javascript.${s}.scriptProblem.*`,this.onProblemUpdatedBound)})})}componentWillUnmount(){this.props.instances.forEach(s=>{this.props.socket.unsubscribeState(`javascript.${s}.scriptProblem.*`,this.onProblemUpdatedBound)})}onProblemUpdated(s,i){if(!i||!s)return;s=`${Jt}.${s.replace(/^javascript\.\d+\.scriptProblem\./,"")}`,this.problems||(this.problems=JSON.parse(JSON.stringify(this.state.problems))||[]);let r=!1;if(i.val)this.problems.includes(s)||(this.problems.push(s),r=!0);else{const l=this.problems.indexOf(s);l!==-1&&(this.problems.splice(l,1),r=!0)}r&&!this.problemsTimer&&(this.problemsTimer=setTimeout(()=>{this.problemsTimer=null,this.setState({problems:this.problems}),this.problems=null},300))}static filterListStatic(s,i,r,l,c){i=JSON.parse(JSON.stringify(i));let d=!1;const h={listItems:i};if(s&&r&&l){const p=l.toLowerCase();if(i.forEach(f=>{var v;const b=f.title.toLowerCase();f.filteredPartly=!1;let y=b.includes(p);const w=(v=c==null?void 0:c[f.id])==null?void 0:v.common;if(!y&&(w!=null&&w.source))if(w.engineType==="Blockly"){const _=w.source.lastIndexOf("//");y=w.source.substring(0,_).toLowerCase().includes(p)}else y=w.source.toLowerCase().includes(p);y?f.filtered&&(f.filtered=!1,d=!0):f.filtered||(f.filtered=!0,d=!0)}),d)for(let f=i.length-1;f>=0;f--){const b=i[f];if(!b.filtered||b.filteredPartly){let y=b;do y!=null&&y.parent&&i[y.parentIndex]&&(d=!0,i[y.parentIndex].filteredPartly=!0),y=y!=null&&y.parent&&i[y.parentIndex]?i[y.parentIndex]:null;while(y)}}}else i.forEach(p=>{(p.filtered||p.filteredPartly)&&(p.filtered=!1,p.filteredPartly=!1,d=!0)}),s||(h.searchText="",h.searchMode=!1,d=!0);return d?h:null}filterList(s,i){const r=So.filterListStatic(s,this.state.listItems,this.state.searchMode,this.state.searchText,this.props.scripts);r?this.setState(r,()=>i&&i()):i&&i()}static ensureSelectedIsVisibleStatic(s,i,r){i=JSON.parse(JSON.stringify(i));let l=!1,c=typeof s=="object"?s:r.find(d=>d.id===s);do{if(c!=null&&c.parent){const d=c.parent;c=r.find(h=>h.id===d)}else c=void 0;c&&(i.includes(c.id)||(i.push(c.id),l=!0))}while(c);return l?i:null}ensureSelectedIsVisible(s,i){return So.ensureSelectedIsVisibleStatic(s||this.state.selected,i||this.state.expanded,this.state.listItems)}static getDerivedStateFromProps(s,i){const r={};let l=!1;if(i.expertMode!==s.expertMode&&(l=!0,r.expertMode=s.expertMode),i.scriptsHash!==s.scriptsHash&&s.scripts){const c=E_(s.scripts||{});if(r.listItems=c,i.searchText){const p=So.filterListStatic(!0,c,i.searchMode,i.searchText,s.scripts);p&&Object.assign(r,p)}const d=So.getIsAllZeroInstancesStatic(c,s.instances||[]),h=So.ensureSelectedIsVisibleStatic(i.selected,i.expanded,i.listItems);r.isAllZeroInstances=d,h&&(r.expanded=h),l=!0}if(i.width!==s.width&&(l=!0,r.width=s.width),i.themeName!==s.themeName&&(l=!0,r.themeName=s.themeName),s.selectId&&i.selected!==s.selectId){const c=i.listItems.find(d=>d.id===s.selectId);if(!i.reorder&&c){const d=So.ensureSelectedIsVisibleStatic(c,i.expanded,i.listItems);r.selected=c.id,d&&(r.expanded=d),l=!0,window.localStorage&&window.localStorage.setItem("SideMenu.selected",c.id)}}return l?r:null}static getIsAllZeroInstancesStatic(s,i){let r=!i[0]&&i.length<=1;return r&&s.forEach(l=>{l.type!=="folder"&&l.instance!==0&&(r=!1)}),r}getIsAllZeroInstances(s,i){return s=s||this.state.listItems,i=i||this.state.instances,So.getIsAllZeroInstancesStatic(s||this.state.listItems,i||this.state.instances)}saveExpanded(s){window.localStorage.setItem("SideMenu.expanded",JSON.stringify(s||this.state.expanded))}showError(s){this.setState({errorText:s})}onToggle(s,i){if(i==null||i.stopPropagation(),s===Jt)return;const r=[...this.state.expanded],l=r.indexOf(s);l!==-1?(r.splice(l,1),this.state.selected&&this.state.selected.startsWith(`${s}.`)&&window.localStorage&&window.localStorage.setItem("SideMenu.selected",s)):(r.push(s),r.sort()),this.setState({expanded:r}),this.saveExpanded(r)}renderItemButtonsOnEnd(s,i){if(this.state.reorder)return null;if(s.type!=="folder"){let r=s.enabled?C_:S_;return s.enabled&&this.state.problems.includes(s.id)&&(r=T_),[m.jsx(qe,{onClick:l=>{l.stopPropagation(),this.props.onEnableDisable&&this.props.onEnableDisable(s.id,!s.enabled)},title:s.enabled?x.I18n.t("Pause script"):x.I18n.t("Run script"),disabled:this.props.debugMode,style:{...Pe.iconButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0,color:r},size:"medium",children:s.enabled?m.jsx(bc,{}):m.jsx(Ug,{})},"startStop"),this.state.width>Ur?m.jsx(qe,{style:this.props.debugMode?Pe.iconButtonsDisabled:void 0,title:x.I18n.t("Delete script"),disabled:s.id===To||s.id===Cn||this.props.debugMode,onClick:l=>this.onDelete(s,l),size:"medium",children:m.jsx(mc,{})},"delete"):null,m.jsx(qe,{style:this.props.debugMode?Pe.iconButtonsDisabled:void 0,disabled:this.props.debugMode,title:x.I18n.t("Edit script or just double click"),onClick:l=>this.onEdit(s,l),size:"medium",children:m.jsx(px,{})},"openInEdit")]}return this.state.width>Ur&&s.id!==Jt&&s.id!==Cn&&s.id!==To&&!(i!=null&&i.length)?m.jsx(qe,{style:this.props.debugMode?Pe.iconButtonsDisabled:void 0,title:x.I18n.t("Delete folder"),disabled:s.id===To||s.id===Cn||this.props.debugMode,onClick:r=>this.onDelete(s,r),size:"medium",children:m.jsx(mc,{})},"delete"):null}onDelete(s,i){return i==null||i.stopPropagation(),new Promise(r=>{if(!s){r();return}typeof s!="object"?this.setState({deleting:s},()=>r()):this.setState({deleting:s.id},()=>r())})}onEdit(s,i){this.onClick(s,i),this.props.onEdit&&this.props.onEdit(s.id)}getTextStyle(s){return!this.state.reorder&&s.type!=="folder"?{width:`calc(100% - ${this.state.width>Ur?185:137}px)`,overflow:"hidden",whiteSpace:"nowrap",flex:"none",padding:"0 16px 0 0"}:{whiteSpace:"nowrap",padding:"0 16px 0 0"}}onClick(s,i){if(i==null||i.stopPropagation(),!this.state.reorder&&s){const r=this.ensureSelectedIsVisible(s),l={selected:s.id};r&&(l.expanded=r),this.setState(l),window.localStorage&&window.localStorage.setItem("SideMenu.selected",s.id)}}onDblClick(s,i){i==null||i.stopPropagation(),!this.state.reorder&&(s.type==="folder"?this.onToggle(s.id):this.onEdit(s))}isFilteredOut(s){var i,r;return s.filtered&&!s.filteredPartly||this.state.typeFilter&&s.type!=="folder"&&s.type.toLowerCase()!==this.state.typeFilter.toLowerCase()||!this.state.expertMode&&((r=(i=this.props.scripts[s.id])==null?void 0:i.native)!=null&&r.protected)||this.state.statusFilter&&s.type!=="folder"&&(this.state.statusFilter==="running"&&!s.enabled||this.state.statusFilter==="paused"&&s.enabled||this.state.statusFilter==="problems"&&(!s.enabled||this.state.problems.indexOf(s.id)===-1))?!0:s.id===To&&!this.state.expertMode}renderListItem(s,i,r){var w,v;if(s.id===Jt&&!this.state.reorder)return null;const l=(this.state.reorder?s.depth:s.depth-1)*Mx;let c=s.title;if(this.state.searchText){const _=c.toLowerCase().indexOf(this.state.searchText.toLowerCase());_!==-1&&(c=[m.jsx("span",{children:c.substring(0,_)},"first"),m.jsx("span",{style:{color:"orange"},children:c.substring(_,_+this.state.searchText.length)},"second"),m.jsx("span",{children:c.substring(_+this.state.searchText.length)},"third")])}!this.state.isAllZeroInstances&&s.type!=="folder"&&(c=[m.jsx("span",{children:c},"title"),m.jsxs("span",{title:x.I18n.t("Instance"),style:Pe.instances,children:["[",s.instance,"]"]},"instance")]);const d=this.state.reorder&&!this.props.debugMode,h={marginLeft:l,cursor:s.type==="folder"&&d?"default":"inherit",width:`calc(100% - ${l}px)`};d||(h.opacity=s.filteredPartly?.5:1),s.id===To&&s.id!==this.state.selected&&(h.color="#00a200");let p=s.id===Jt;!p&&i&&(p=this.state.expanded.includes(s.id));let f;s.type==="folder"?f={...Pe.folderIcon,...d?Pe.folderIconReorder:Pe.folderIconNoReorder}:f={...Pe.scriptIcon},s.id===To?f.color="#356956":s.id===Cn&&(f.color="#4899e1");let b=null;(r&&r.length||i&&i.length)&&(b=m.jsx("span",{style:Pe.childrenCount,children:r&&r.length!==i.length?`${r.length}(${i.length})`:i.length}));const y={...s.type==="folder"?Pe.folder:Pe.script,...d?Pe.reorder:void 0,...d&&s.type!=="folder"?Pe.scriptReorder:void 0,...d&&s.type==="folder"?Pe.folderReorder:void 0,...h};return m.jsxs(LT,{style:y,sx:s.id===this.state.selected&&!d?Pe.selected:void 0,className:x.Utils.clsx(d&&s.type==="folder"&&"folder-reorder",d&&s.type!=="folder"&&"script-reorder"),onClick:_=>this.onClick(s,_),onDoubleClick:_=>this.onDblClick(s,_),secondaryAction:this.renderItemButtonsOnEnd(s,i),children:[(v=(w=this.props.scripts[s.id])==null?void 0:w.native)!=null&&v.protected?m.jsx(k_,{style:{color:"orange",position:"absolute",right:5,width:10,height:10}}):null,m.jsx(Ag,{style:Pe.listItemIcon,children:s.type==="folder"?d||p?m.jsx(QT,{style:f,onClick:_=>!d&&this.onToggle(s.id,_)}):m.jsx(eS,{style:f,onClick:_=>!d&&this.onToggle(s.id,_)}):m.jsx("img",{style:f,alt:s.type,src:Tn[s.type]||Tn.def})}),m.jsx(Og,{sx:{"& .MuiListItemText-primary":s.id===this.state.selected&&!d?Pe.selected:void 0},style:this.getTextStyle(s),primary:m.jsxs("span",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[c,b]})})]},s.id)}onDragFinish(s,i){let r=`${i}.${s.split(".").pop()}`;r!==s&&(this.state.listItems.find(l=>l.id===r)&&(r+=`_${x.I18n.t("copy")}`),this.props.onRename&&this.props.onRename(s,r))}renderOneItem(s,i){const r=this.state.statusFilter||this.state.typeFilter?s.filter(f=>f.parent===i.id?!this.isFilteredOut(f):!1):[],l=s.filter(f=>f.parent===i.id);if(this.isFilteredOut(i)||i.type==="folder"&&(this.state.statusFilter||this.state.typeFilter)&&!r.length)return null;const c=this.state.reorder&&!this.props.debugMode,d=this.renderListItem(i,l,r),h=[];let p;return l&&(c||this.state.expanded.includes(i.id)||i.id===Jt)&&(p=l.map(f=>this.renderOneItem(s,f))),c?i.type==="folder"?h.push(m.jsxs(Lx,{onDrop:f=>this.onDragFinish(f.name,i.id),folderName:i.id,children:[m.jsx(I_,{name:i.id,children:d},`draggable_${i.id}`),p||null]},`droppable_${i.id}`)):h.push(m.jsxs(I_,{name:i.id,children:[d,p||null]},`draggable_${i.id}`)):(h.push(d),p==null||p.forEach(f=>h.push(f))),h}renderAllItems(s){const i=s.filter(r=>!r.parent).map(r=>this.renderOneItem(s,r));return m.jsx(Dg,{dense:!0,disablePadding:!0,sx:Pe.mainList,children:i})}onAddNew(s){s==null||s.stopPropagation();let i=this.state.listItems.find(l=>l.id===this.state.selected),r=Jt;for(;i&&i.type!=="folder";)i=this.state.listItems[i.parentIndex];i&&(r=i.id),this.parent=r,this.setState({choosingType:!0})}onCopy(s,i){s==null||s.stopPropagation();let r=this.state.listItems.find(c=>c.id===i),l=Jt;for(;r&&r.type!=="folder";)r=this.state.listItems[r.parentIndex];r&&(l=r.id),this.parent=l,this.setState({copingScript:i||""})}onAddNewFolder(s){s==null||s.stopPropagation();let i=this.state.listItems.find(l=>l.id===this.state.selected),r=Jt;for(;i&&i.type!=="folder";)i=this.state.listItems[i.parentIndex];i&&(r=i.id),this.parent=r,this.setState({creatingFolder:!0})}onRename(s){s==null||s.stopPropagation(),this.setState({renaming:this.state.selected})}getUniqueName(s){let i=1,r=`${x.I18n.t("Script")} `;if(s){const l=Gg(s,this.props.scripts[s]),c=l.match(/\d+$/);c?(r=l.replace(/\d+$/,""),i=parseInt(c[0],10)+1):r=l}for(;this.state.listItems.find(l=>l.id===`${this.parent}.${r.replace(/\.\s/g,"_")}${i}`);)i++;return r+i}getUniqueFolderName(){let s=1;for(;this.state.listItems.find(i=>i.id===`${this.parent}.${x.I18n.t("Folder")}_${s}`);)s++;return`${x.I18n.t("Folder")} ${s}`}onCloseMenu(s){this.setState({menuOpened:!1,menuAnchorEl:null,menuAnchorFilterEl:null},s)}getMainMenu(s,i){var l,c,d,h;const r=this.state.expertMode&&!!Object.keys(this.props.changedScripts).find(p=>{var f,b;return this.props.changedScripts[p]&&((b=(f=this.props.scripts[p])==null?void 0:f.native)==null?void 0:b.protected)});return m.jsxs(dm,{id:"long-menu",anchorEl:this.state.menuAnchorEl,open:this.state.menuOpened,onClose:()=>this.setState({menuOpened:!1,menuAnchorEl:null}),slotProps:{paper:{style:{maxHeight:Nx*7.5}}},children:[this.state.width<=Ur?m.jsxs(it,{disabled:this.props.debugMode||!this.state.selected||this.state.selected===To||this.state.selected===Cn||!!(s!=null&&s.length),onClick:p=>{if(p.stopPropagation(),p.preventDefault(),this.state.listItems.find(f=>f.parent===this.state.selected)){this.showError(x.I18n.t("Cannot delete non empty item!"));return}this.setState({menuOpened:!1,menuAnchorEl:null},()=>this.onDelete(this.state.selected).then(()=>{}))},children:[m.jsx(mc,{style:{...Pe.iconDropdownMenu,color:"red"}}),x.I18n.t("Delete")]},"delete"):null,m.jsxs(it,{disabled:this.props.debugMode||r,selected:this.state.expertMode,onClick:p=>{p.stopPropagation(),p.preventDefault(),this.onCloseMenu(()=>this.props.onExpertModeChange&&this.props.onExpertModeChange(!this.state.expertMode))},children:[m.jsx(x.IconExpert,{style:{...Pe.iconDropdownMenu,color:this.state.expertMode?"orange":"inherit"}}),x.I18n.t("Expert mode")]},"expertMode"),this.props.onExport&&m.jsxs(it,{onClick:p=>{p.stopPropagation(),p.preventDefault(),this.onCloseMenu(()=>this.setState({showExportDialog:!0}))},children:[m.jsx(kc,{style:Pe.iconDropdownMenu}),x.I18n.t("Export all scripts")]},"exportAll"),this.props.onImport&&m.jsxs(it,{disabled:this.props.debugMode,onClick:p=>{p.stopPropagation(),p.preventDefault(),this.onCloseMenu(()=>this.props.onImport())},children:[m.jsx(Ng,{style:Pe.iconDropdownMenu}),x.I18n.t("Import scripts")]},"import"),this.props.onThemeChange&&m.jsxs(it,{onClick:()=>this.onCloseMenu(()=>{this.props.onThemeChange&&this.props.onThemeChange(x.Utils.toggleTheme(this.state.themeName))}),children:[m.jsx(mx,{style:Pe.iconDropdownMenu}),x.I18n.t('Change theme (actual "%s")',this.state.themeName)]},"dark"),this.props.onAddNew&&m.jsxs(it,{disabled:!this.state.selected||!i||i.type==="folder",onClick:p=>{const f=this.state.selected;this.onCloseMenu(()=>this.onCopy(p,f))},children:[m.jsx(tS,{style:Pe.iconDropdownMenu}),x.I18n.t("Copy script")]},"copy"),this.state.expertMode&&m.jsxs(it,{disabled:this.props.debugMode,onClick:p=>{p.stopPropagation(),p.preventDefault(),this.onCloseMenu(()=>this.setState({showAdapterDebug:!0}))},children:[m.jsx(lx,{style:Pe.iconDropdownMenu}),x.I18n.t("Debug instance")]},"debugInstance"),this.state.selected&&this.props.password&&this.props.scripts[this.state.selected].type==="script"?m.jsxs(it,{disabled:this.props.debugMode||this.props.changedScripts[this.state.selected],onClick:p=>{p.stopPropagation(),p.preventDefault(),this.onCloseMenu(async()=>{var b;const f=await this.props.socket.getObject(this.state.selected);f&&((b=f.native)!=null&&b.protected?(delete f.native.protected,f.common.source=Wg(this.props.password,f.common.source||"")):(f.native||={},f.native.protected=!0,f.common.source=vc(this.props.password,f.common.source||"")),await this.props.socket.setObject(f._id,f))})},children:[m.jsx(k_,{style:{...Pe.iconDropdownMenu,color:"orange"}}),(c=(l=this.props.scripts[this.state.selected])==null?void 0:l.native)!=null&&c.protected?m.jsx("span",{style:{color:(h=(d=this.props.scripts[this.state.selected])==null?void 0:d.native)!=null&&h.protected?"orange":void 0},children:x.I18n.t("Unprotect script")}):x.I18n.t("Protect script")]},"encrypt"):null]},"menu")}getToolbarButtons(){const s=[],i=this.state.reorder&&!this.props.debugMode;if(this.state.searchMode&&!this.props.debugMode)s.push(m.jsx(Pn,{value:this.state.searchText,style:Pe.toolbarSearch,ref:this.inputRef,autoFocus:!0,placeholder:x.I18n.t("Search..."),onChange:r=>{this.setState({searchText:r.target.value}),this.filterTimer&&clearTimeout(this.filterTimer),this.filterTimer=setTimeout(()=>{this.filterTimer=null,this.filterList(!0),this.props.onSearch&&this.props.onSearch(this.state.searchText)},400)}},"searchInput")),s.push(m.jsx(qe,{sx:Pe.toolbarButtons,style:{float:"right"},title:x.I18n.t("End search mode"),onClick:r=>{r.stopPropagation(),this.filterList(!1,()=>this.props.onSearch&&this.props.onSearch(this.state.searchText))},size:"medium",children:m.jsx(dx,{})},"disableSearch")),this.state.searchText&&s.push(m.jsx(qe,{title:x.I18n.t("Clear search input"),sx:Pe.toolbarButtons,style:{marginTop:7,float:"right"},onClick:r=>{r.stopPropagation(),this.setState({searchText:""},()=>{this.filterList(!0),this.props.onSearch&&this.props.onSearch(this.state.searchText)})},size:"medium",children:m.jsx(Mw,{fontSize:"small"})},"cleanSearch"));else{if(!i){s.push(m.jsx(qe,{"aria-label":"More","aria-owns":this.state.menuOpened?"long-menu":void 0,title:x.I18n.t("Menu"),"aria-haspopup":"true",onClick:c=>{c.stopPropagation(),c.preventDefault(),this.setState({menuOpened:!0,menuAnchorEl:c.currentTarget})},size:"medium",children:m.jsx(gx,{})},"menuButton"));const r=this.state.listItems.find(c=>c.id===this.state.selected);let l;r&&this.state.width<=Ur&&r.type==="folder"&&(l=this.state.listItems.filter(c=>c.parent===this.state.selected)),s.push(this.getMainMenu(l,r)),s.push(m.jsx(qe,{disabled:this.props.debugMode,title:x.I18n.t("Create new script"),sx:{...Pe.toolbarButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0},style:{color:i?"red":"inherit"},onClick:c=>this.onAddNew(c),size:"medium",children:m.jsx(sS,{})},"new-script")),s.push(m.jsx(qe,{disabled:this.props.debugMode,title:x.I18n.t("Create new folder"),sx:{...Pe.toolbarButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0},style:{color:i?"red":"inherit"},onClick:c=>this.onAddNewFolder(c),size:"medium",children:m.jsx(oS,{})},"new-folder"))}s.push(m.jsx(qe,{disabled:i||this.props.debugMode,sx:{...Pe.toolbarButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0},title:x.I18n.t("Search in scripts"),style:{float:"right",opacity:this.props.debugMode?.5:i?0:1},onClick:r=>{r.stopPropagation(),this.setState({searchMode:!0})},size:"medium",children:m.jsx($x,{})},"search")),s.push(m.jsx(qe,{disabled:this.props.debugMode,title:x.I18n.t("Reorder scripts in folders"),sx:{...Pe.toolbarButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0},style:{color:i?"red":"inherit",float:"right"},onClick:r=>{r.stopPropagation(),this.setState({reorder:!this.state.reorder})},size:"medium",children:m.jsx(_x,{})},"reorder")),!i&&this.state.selected&&this.state.selected!==To&&this.state.selected!==Cn&&s.push(m.jsx(qe,{sx:{...Pe.toolbarButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0},disabled:this.props.debugMode,title:x.I18n.t("Rename"),onClick:r=>this.onRename(r),size:"medium",children:m.jsx(iS,{})},"rename")),s.push(m.jsxs("span",{style:{opacity:.5,fontSize:10},children:["v",this.props.version]},"version"))}return s}getFolders(){const s=[{id:Jt,name:x.I18n.t("Root folder")}];return this.state.listItems.forEach(i=>{i.type==="folder"&&i.id!==Jt&&(!i.id.startsWith(To)||this.state.expertMode)&&s.push({id:i.id,name:i.title})}),s}onCollapseAll(){this.setState({expanded:[]}),this.saveExpanded([])}onExpandAll(){const s=[];this.state.listItems.forEach(i=>this.state.listItems.find(r=>r.parent===i.id)&&s.push(i.id)),this.setState({expanded:s}),this.saveExpanded(s)}getBottomButtons(){return this.state.reorder||this.props.debugMode?null:[m.jsx(wt,{sx:Pe.footerButtons,title:x.I18n.t("Show only running scripts"),onClick:s=>{s.stopPropagation(),s.preventDefault();const i=this.state.statusFilter==="running"?"":"running";window.localStorage&&window.localStorage.setItem("SideMenu.statusFilter",i),this.setState({statusFilter:i})},children:m.jsx(bc,{style:{color:C_,opacity:this.state.statusFilter==="running"?1:.3,background:this.state.statusFilter==="running"?"gray":"inherit"}})},"filterByRunning"),m.jsx(wt,{sx:Pe.footerButtons,title:x.I18n.t("Show only paused scripts"),onClick:()=>{const s=this.state.statusFilter==="paused"?"":"paused";window.localStorage&&window.localStorage.setItem("SideMenu.statusFilter",s),this.setState({statusFilter:s})},children:m.jsx(Ug,{style:{color:S_,opacity:this.state.statusFilter==="paused"?1:.3,background:this.state.statusFilter==="paused"?"gray":"inherit"}})},"filterByPaused"),m.jsx(wt,{sx:Pe.footerButtons,style:{marginRight:16},title:x.I18n.t("Show only scripts with problems"),onClick:()=>{const s=this.state.statusFilter==="problems"?"":"problems";window.localStorage&&window.localStorage.setItem("SideMenu.statusFilter",s),this.setState({statusFilter:s})},children:m.jsx(bc,{style:{color:T_,opacity:this.state.statusFilter==="problems"?1:.3,background:this.state.statusFilter==="problems"?"gray":"inherit"}})},"filterByProblem"),m.jsx(wt,{sx:Pe.footerButtons,children:m.jsx("img",{alt:"Blockly",style:{opacity:this.state.typeFilter==="Blockly"?1:.3,background:this.state.typeFilter==="Blockly"?"gray":"inherit"},src:Tn.Blockly,onClick:()=>{const s=this.state.typeFilter==="Blockly"?"":"Blockly";window.localStorage&&window.localStorage.setItem("SideMenu.typeFilter",s),this.setState({typeFilter:s})}})},"filterBlockly"),m.jsx(wt,{sx:Pe.footerButtons,children:m.jsx("img",{alt:"Javascript",style:{opacity:this.state.typeFilter==="Javascript/js"?1:.3,background:this.state.typeFilter==="Javascript/js"?"gray":"inherit"},src:Tn["Javascript/js"],onClick:()=>{const s=this.state.typeFilter==="Javascript/js"?"":"Javascript/js";window.localStorage&&window.localStorage.setItem("SideMenu.typeFilter",s),this.setState({typeFilter:s})}})},"filterJS"),m.jsx(wt,{sx:Pe.footerButtons,children:m.jsx("img",{alt:"TypeScript",style:{opacity:this.state.typeFilter==="TypeScript/ts"?1:.3,background:this.state.typeFilter==="TypeScript/ts"?"gray":"inherit"},src:Tn["TypeScript/ts"],onClick:()=>{const s=this.state.typeFilter==="TypeScript/ts"?"":"TypeScript/ts";window.localStorage&&window.localStorage.setItem("SideMenu.typeFilter",s),this.setState({typeFilter:s})}})},"filterTS"),m.jsx(wt,{sx:Pe.footerButtons,children:m.jsx("img",{alt:"Rules",style:{opacity:this.state.typeFilter==="Rules"?1:.3,background:this.state.typeFilter==="Rules"?"gray":"inherit"},src:Tn.Rules,onClick:()=>{const s=this.state.typeFilter==="Rules"?"":"Rules";window.localStorage&&window.localStorage.setItem("SideMenu.typeFilter",s),this.setState({typeFilter:s})}})},"filterRules"),m.jsx("div",{style:{flexGrow:1}},"padding"),m.jsx(wt,{sx:Pe.footerButtons,onClick:()=>this.onExpandAll(),title:x.I18n.t("Expand all"),children:m.jsx(kx,{style:Pe.footerButtonsRight})},"expandAll"),this.state.expanded.length?m.jsx(wt,{sx:Pe.footerButtons,onClick:()=>this.onCollapseAll(),title:x.I18n.t("Collapse all"),children:m.jsx(wx,{style:Pe.footerButtonsRight})},"collapseAll"):m.jsx("div",{style:{height:22,width:24}})]}getAdapterDebugDialog(){return this.state.showAdapterDebug?m.jsx(Dx,{socket:this.props.socket,onClose:()=>this.setState({showAdapterDebug:!1}),onDebug:(s,i)=>this.setState({showAdapterDebug:!1},()=>this.props.onDebugInstance({instance:s,adapter:i}))},"debug"):null}render(){var r,l,c;const s=this.state.renaming?this.state.listItems.find(d=>d.id===this.state.renaming):void 0,i=this.state.copingScript&&this.props.scripts[this.state.copingScript].type==="script"?this.props.scripts[this.state.copingScript]:void 0;return[m.jsxs(PT,{variant:"permanent",style:Pe.menu,sx:{"& .MuiDrawer-paper":Pe.drawerPaper},anchor:"left",onClick:()=>this.onClick({id:""}),children:[m.jsx(wt,{sx:Pe.toolbar,children:this.getToolbarButtons()}),m.jsx(t_,{}),m.jsx(ek,{backend:hk,children:m.jsx("div",{style:Pe.innerMenu,children:this.renderAllItems(this.state.listItems)})}),m.jsx(t_,{}),m.jsx("div",{style:Pe.footer,children:this.getBottomButtons()})]},"drawer"),s?m.jsx(vm,{name:s.title,id:this.state.renaming||"",folder:s.type==="folder",instance:s.instance,instances:this.props.instances,onClose:()=>this.setState({renaming:null}),onRename:(d,h,p,f)=>this.props.onRename&&this.props.onRename(d,h,p,f)},"dialog-rename"):null,this.state.deleting?m.jsx(Cx,{name:this.state.listItems.find(d=>d.id===this.state.deleting).title,id:this.state.deleting,onClose:()=>this.setState({deleting:null}),onDelete:d=>this.props.onDelete&&this.props.onDelete(d)},"dialog-delete"):null,this.state.choosingType?m.jsx(Dn,{onClose:d=>{const h={choosingType:!1};d&&(h.creatingScript=d),this.setState(h)}},"dialog-script-type"):null,this.state.creatingScript?m.jsx(og,{onClose:()=>this.setState({creatingScript:null}),title:x.I18n.t("Create new script"),name:this.getUniqueName(),parents:this.getFolders(),folder:!1,existingItems:this.state.listItems.map(d=>d.id),instance:this.props.instances[0]||0,instances:this.props.instances,type:this.state.creatingScript,parent:this.parent,onAdd:(d,h,p,f)=>this.props.onAddNew&&this.props.onAddNew(d,h,!1,p,f)},"dialog-new-script"):null,this.state.copingScript?m.jsx(og,{onClose:()=>this.setState({copingScript:""}),title:x.I18n.t("Copy script"),name:this.getUniqueName(this.state.copingScript),parents:this.getFolders(),folder:!1,instance:parseInt((l=(r=i==null?void 0:i.common)==null?void 0:r.engine)==null?void 0:l.split(".").pop(),10)||0,instances:this.props.instances,type:((c=i==null?void 0:i.common)==null?void 0:c.engineType)||"Javascript/js",parent:this.parent,onAdd:(d,h,p,f)=>{var y;const b=this.state.copingScript&&this.props.scripts[this.state.copingScript].type==="script"?this.props.scripts[this.state.copingScript]:void 0;b!=null&&b.common&&(b.common.enabled=!1),this.props.onAddNew&&this.props.onAddNew(d,h,!1,p,f,(y=b==null?void 0:b.common)==null?void 0:y.source)}},"dialog-copy-script"):null,this.state.creatingFolder?m.jsx(og,{onClose:()=>this.setState({creatingFolder:!1}),title:x.I18n.t("Create new folder"),parents:this.getFolders(),name:this.getUniqueFolderName(),parent:this.parent,onAdd:(d,h)=>this.props.onAddNew&&this.props.onAddNew(d,h,!0)},"dialog-new-folder"):null,this.state.errorText?m.jsx(su,{onClose:()=>this.setState({errorText:""}),text:this.state.errorText},"error"):null,this.getAdapterDebugDialog(),this.state.showExportDialog?m.jsxs(Ut,{open:!0,onClose:()=>this.setState({showExportDialog:!1}),children:[m.jsx(ss,{children:x.I18n.t("Export all scripts")}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",onClick:()=>{this.setState({showExportDialog:!1}),this.props.onExport(!0)},color:"primary",children:x.I18n.t("as JSON")}),m.jsx(He,{variant:"contained",onClick:()=>{this.setState({showExportDialog:!1}),this.props.onExport(!1)},color:"grey",children:x.I18n.t("as plain text")}),m.jsx(He,{variant:"contained",onClick:()=>this.setState({showExportDialog:!1}),color:"primary",children:x.I18n.t("Cancel")})]})]},"dialog-export-format"):null]}}const Px="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgAQMAAADYVuV7AAAABlBMVEUAAAAzMzPI8eYgAAAAAXRSTlMAQObYZgAAACFJREFUeAFjAIJRwP////8PYIKWHCigNQdKj/pn1D+jAABTG16wVQqVpQAAAABJRU5ErkJggg==",Bx="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgAQMAAADYVuV7AAAABlBMVEUAAAAzMzPI8eYgAAAAAXRSTlMAQObYZgAAABtJREFUeAFjAIJRwP8fCj7QkENn/4z6Z5QzCgBjbWaoyx1PqQAAAABJRU5ErkJggg==";function Fx(a){let s,i=a.getHours();return i<10&&(i=`0${i.toString()}`),s=`${i}:`,i=a.getMinutes(),i<10&&(i=`0${i.toString()}`),s+=`${i}:`,i=a.getSeconds(),i<10&&(i=`0${i.toString()}`),s+=`${i}.`,i=a.getMilliseconds(),i<10?i=`00${i.toString()}`:i<100&&(i=`0${i.toString()}`),s+=i,s}const x_=34,zt={logBox:{width:"100%",height:"100%",position:"relative",overflow:"hidden"},logBoxInner:a=>({display:"inline-block",color:a.palette.mode==="dark"?"white":"black",width:`calc(100% - ${x_}px)`,height:"100%",overflow:"auto",position:"relative",verticalAlign:"top"}),info:a=>({background:a.palette.mode==="dark"?"darkgrey":"lightgrey",color:(a.palette.mode==="dark","black")}),error:a=>({background:"#FF0000",color:a.palette.mode==="dark"?"black":"white"}),warn:a=>({background:"#FF8000",color:a.palette.mode==="dark"?"black":"white"}),debug:a=>({background:"gray",opacity:.8,color:a.palette.mode==="dark"?"black":"white"}),silly:a=>({background:"gray",opacity:.6,color:a.palette.mode==="dark"?"black":"white"}),table:{fontFamily:"monospace",width:"100%"},toolbox:{width:x_,height:"100%",boxShadow:"2px 0px 4px -1px rgba(0, 0, 0, 0.2), 4px 0px 5px 0px rgba(0, 0, 0, 0.14), 1px 0px 10px 0px rgba(0, 0, 0, 0.12)",display:"inline-block",verticalAlign:"top",overflow:"hidden"},trFrom:{width:90},trTime:{width:90},trSeverity:{width:40,fontWeight:"bold"},trPreMessage:{padding:0,margin:0},iconButtons:{width:32,height:32,padding:4},layoutIcon:a=>({"& img":{width:24,height:24,background:a.palette.mode==="dark"?"#9d9d9d":void 0,borderRadius:a.palette.mode==="dark"?"30px":void 0}})};function jx(a){return a<10?`00${a}`:a<100?`0${a}`:a.toString()}const Zs={};class ym extends _e.Component{messagesEnd;constructor(s){super(s),this.state={lines:{},goBottom:!0,selected:null,editing:this.props.editing||[]},this.messagesEnd=_e.createRef()}static generateLine(s,i){let r=s.message||"";if(typeof r!="object"){const l=new RegExp(`${s.from.replace(".","\\.").replace(")","\\)").replace("(","\\(")} \\(\\d+\\) `,"g"),c=r.match(l);c?r=r.replace(c[0],""):r=r.replace(`${s.from} `,"")}return r.startsWith(`${i}: `)&&(r=r.substring(i.length+2)),m.jsxs(wt,{component:"tr",sx:zt[s.severity],children:[m.jsx("td",{style:zt.trFrom,children:s.from}),m.jsx("td",{style:zt.trTime,children:Fx(new Date(s.ts))}),m.jsx("td",{style:zt.trSeverity,children:s.severity}),m.jsx("td",{children:m.jsx("pre",{style:zt.trPreMessage,children:r})})]},`tr_${s.ts}_${s.message.substring(s.message.length-10)}`)}scrollToBottom(){var s,i;(i=(s=this.messagesEnd)==null?void 0:s.current)==null||i.scrollIntoView({behavior:"smooth"})}logHandler=s=>{const i=this.state.lines,r=this.state.editing.filter(f=>s.message.includes(f));let l=null;if(!r.length||(r.length===1?l=r[0]:(r.sort(),l=r[r.length-1]),!l))return;const c=i[l]||[],d=Zs[l]||[];c.push(ym.generateLine(s,l));let h=s.severity;(h==="info"||h==="warn")&&(h+=" ");const p=new Date(s.ts);d.push(`${p.toLocaleString()}.${jx(p.getMilliseconds())} [${h}]: ${s.message}`),c.length>300&&(c.splice(0,c.length-300),d.splice(0,c.length-300)),Zs[l]=d,i[l]=c,this.setState({lines:i})};componentDidMount(){this.props.socket.registerLogHandler(this.logHandler)}componentWillUnmount(){this.props.socket.unregisterLogHandler(this.logHandler)}componentDidUpdate(){this.state.goBottom&&this.scrollToBottom()}static getDerivedStateFromProps(s,i){let r=!1;const l={};if(s.selected!==i.selected){const c=s.selected,d=i.lines;c&&(d[c]=d[c]||[],Zs[c]=Zs[c]||[]),l.selected=c,r=!0}if(JSON.stringify(s.editing)!==JSON.stringify(i.editing)){const c=JSON.parse(JSON.stringify(s.editing));r=!0;const d=i.lines;for(const h in Zs)Object.prototype.hasOwnProperty.call(Zs,h)&&(c.includes(h)||(delete Zs[h],delete d[h]));l.editing=c}return r?l:null}onCopy(){x.Utils.copyToClipboard((Zs[this.state.selected]||[]).join(` -`))}clearLog(){const s=this.state.lines;s[this.state.selected]&&(s[this.state.selected]=[]),Zs[this.state.selected]&&(Zs[this.state.selected]=[]),this.setState({lines:s})}renderLogList(s){return this.state.selected&&(s!=null&&s.length)?m.jsxs(wt,{sx:zt.logBoxInner,children:[m.jsx("table",{style:zt.table,children:m.jsx("tbody",{children:s})},"logTable"),m.jsx("div",{ref:this.messagesEnd,style:{float:"left",clear:"both"}},"logScrollPoint")]},"logList"):m.jsx(wt,{sx:zt.logBoxInner,style:{paddingLeft:10},children:x.I18n.t("Log outputs")},"logList")}render(){const s=this.state.selected?this.state.lines[this.state.selected]:null;return m.jsxs("div",{style:zt.logBox,children:[m.jsxs("div",{style:zt.toolbox,children:[m.jsx(qe,{style:zt.iconButtons,onClick:()=>this.setState({goBottom:!this.state.goBottom}),color:this.state.goBottom?"secondary":void 0,size:"medium",children:m.jsx(nS,{})}),s!=null&&s.length?m.jsx(qe,{style:zt.iconButtons,onClick:()=>this.clearLog(),size:"medium",children:m.jsx(rS,{})}):null,s!=null&&s.length?m.jsx(qe,{style:zt.iconButtons,onClick:()=>this.onCopy(),size:"medium",children:m.jsx(aS,{})}):null,this.props.onLayoutChange?m.jsx(qe,{style:zt.iconButtons,onClick:()=>this.props.onLayoutChange&&this.props.onLayoutChange(),title:x.I18n.t("Change layout"),size:"medium",sx:zt.layoutIcon,children:m.jsx("img",{alt:"split",src:this.props.verticalLayout?Px:Bx})}):null,m.jsx(qe,{style:zt.iconButtons,onClick:()=>this.props.onHideLog(),title:x.I18n.t("Hide logs"),size:"medium",children:m.jsx(lS,{})})]},"toolbox"),this.renderLogList(s)]})}}var D_="focus-outline-hidden";function vk(){var a=this;document.addEventListener("keydown",function(s){a.focusByKeyboard=!0},!0),document.addEventListener("mousedown",function(s){a.focusByKeyboard=!1},!0),document.addEventListener("focus",function(s){a.updateVisibility()},!0),document.addEventListener("focusout",function(s){window.setTimeout(function(){document.hasFocus()||(a.focusByKeyboard=!0,a.updateVisibility())},0)}),this.updateVisibility()}vk.prototype={focusByKeyboard:!0,updateVisibility:function(){this.hidden=!this.focusByKeyboard},set hidden(a){document.documentElement.classList.toggle(D_,a)},get hidden(){return document.documentElement.classList.contains(D_)}};new vk;var yk={exports:{}};(function(a){(function(){var s={}.hasOwnProperty;function i(){for(var r=[],l=0;l4&&arguments[4]!==void 0?arguments[4]:"easeInOutCubic";return r>l?i:s+(i-s)*Ux[c](r/l)};Mi.calcEndPoint=function(s){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(Hx(s))return parseInt(s)+r;var l=i===window||i===document.documentElement?window.pageYOffset:i.scrollTop-i.getBoundingClientRect().top,c=s.nodeName.toLowerCase()==="html"?-l:s.getBoundingClientRect().top+l;return c+r};(function(a,s){Object.defineProperty(s,"__esModule",{value:!0});var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},r=Mi;s.default=function(l){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d=c.duration,h=d===void 0?500:d,p=c.context,f=p===void 0?window:p,b=c.offset,y=b===void 0?0:b,w=c.ease,v=w===void 0?"easeInOutCubic":w,_=c.callback;if((typeof window>"u"?"undefined":i(window))==="object"){var $=f.scrollTop!==null&&f.scrollTop!==void 0?f.scrollTop:window.pageYOffset,S=(0,r.calcEndPoint)(l,f,y),T=performance.now(),E=window.requestAnimationFrame,D=function M(){var P=performance.now()-T,W=(0,r.setPosition)($,S,P,h,v);f!==window?f.scrollTop=W:window.scroll(0,W),P>h?typeof _=="function"&&_(l):E(M)};D()}},a.exports=s.default})(Kg,Kg.exports);var _k=Kg.exports,Yg={exports:{}};(function(a,s){Object.defineProperty(s,"__esModule",{value:!0});var i=Object.assign||function(d){for(var h=1;h0&&arguments[0]!==void 0?arguments[0]:{},h=d.query,p=h===void 0?'[href^="#"]:not([href="#"]':h,f=d.match,b=f===void 0?function(S){return document.getElementById(S.hash.substring(1))}:f,y=d.hashChange,w=y===void 0?!0:y,v=d.scrollSmoothConfig,_=document.querySelectorAll(p),$=function(T){T.preventDefault();var E=b(T.target);E&&(w&&history.replaceState(null,null,"#"+E.id),(0,l.default)(E,i({},v)))};Array.from(_).map(function(S){S.addEventListener("click",$,!1)})},a.exports=s.default})(Yg,Yg.exports);var Wx=Yg.exports,Jg={exports:{}};(function(a,s){Object.defineProperty(s,"__esModule",{value:!0});function i(r){if(Array.isArray(r)){for(var l=0,c=Array(r.length);l0&&arguments[0]!==void 0?arguments[0]:{},l=r.activeClass,c=l===void 0?"active":l,d=r.query,h=d===void 0?'[href^="#"]:not([href="#"]):not([href="#0"])':d,p=r.threshold,f=p===void 0?[.25,.5,.75]:p,b=r.detectType,y=b===void 0?"max":b,w={threshold:f},v=function(W){return W.classList.remove(c)},_=function(W){return W.classList.add(c)},$=function(){document.querySelectorAll("."+c).forEach(v)},S=function(W){$(),_(document.querySelector('a[href="#'+W.id+'"]'))},T=function(W){W.forEach(function(G){G.intersectionRatio>=Math[y].apply(Math,i(f))&&S(G.target)})},E=document.querySelectorAll(h),D=new IntersectionObserver(T,w),M=function(W){var G=document.querySelector("#"+W.hash.slice(1));D.observe(G)};E.forEach(M)},a.exports=s.default})(Jg,Jg.exports);var Gx=Jg.exports;(function(a,s){Object.defineProperty(s,"__esModule",{value:!0});var i=_k,r=f(i),l=Mi,c=Wx,d=f(c),h=Gx,p=f(h);function f(b){return b&&b.__esModule?b:{default:b}}s.default={to:r.default,calcEndPoint:l.calcEndPoint,anchorScroll:d.default,observe:p.default},a.exports=s.default})(Vg,Vg.exports);var Vx=Vg.exports;const Kx=Xo(Vx);var _m={exports:{}},Yx=_m.exports;(function(a){(function(s,i){a.exports?a.exports=i():s.Scrollparent=i()})(Yx,function(){var s=/(auto|scroll)/,i=function(h,p){return h.parentNode===null?p:i(h.parentNode,p.concat([h]))},r=function(h,p){return getComputedStyle(h,null).getPropertyValue(p)},l=function(h){return r(h,"overflow")+r(h,"overflow-y")+r(h,"overflow-x")},c=function(h){return s.test(l(h))},d=function(h){if(h instanceof HTMLElement||h instanceof SVGElement){for(var p=i(h.parentNode,[]),f=0;f=s||G<0||y&&z>=c}function T(){var W=ig();if(S(W))return E(W);h=setTimeout(T,$(W))}function E(W){return h=void 0,w&&r?v(W):(r=l=void 0,d)}function D(){h!==void 0&&clearTimeout(h),f=0,r=p=l=h=void 0}function M(){return h===void 0?d:E(ig())}function P(){var W=ig(),G=S(W);if(r=arguments,l=this,p=W,G){if(h===void 0)return _(p);if(y)return h=setTimeout(T,s),v(p)}return h===void 0&&(h=setTimeout(T,s)),d}return P.cancel=D,P.flush=M,P}function qg(a){var s=typeof a;return!!a&&(s=="object"||s=="function")}function h0(a){return!!a&&typeof a=="object"}function p0(a){return typeof a=="symbol"||h0(a)&&l0.call(a)==Zx}function R_(a){if(typeof a=="number")return a;if(p0(a))return O_;if(qg(a)){var s=typeof a.valueOf=="function"?a.valueOf():a;a=qg(s)?s+"":s}if(typeof a!="string")return a===0?a:+a;a=a.replace(Qx,"");var i=t0.test(a);return i||s0.test(a)?o0(a.slice(2),i?2:8):e0.test(a)?O_:+a}var g0=d0;const m0=Xo(g0);var Xg="data-focus-lock",wk="data-focus-lock-disabled",f0="data-no-focus-lock",$0="data-autofocus-inside",b0="data-no-autofocus";function ng(a,s){return typeof a=="function"?a(s):a&&(a.current=s),a}function v0(a,s){var i=kt(function(){return{value:a,callback:s,facade:{get current(){return i.value},set current(r){var l=i.value;l!==r&&(i.value=r,i.callback(r,l))}}}})[0];return i.callback=s,i.facade}var y0=typeof window<"u"?um:Lt,N_=new WeakMap;function _0(a,s){var i=v0(null,function(r){return a.forEach(function(l){return ng(l,r)})});return y0(function(){var r=N_.get(i);if(r){var l=new Set(r),c=new Set(a),d=i.current;l.forEach(function(h){c.has(h)||ng(h,null)}),c.forEach(function(h){l.has(h)||ng(h,d)})}N_.set(i,a)},[a]),i}var rg={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"};function kk(a){return a}function Ck(a,s){s===void 0&&(s=kk);var i=[],r=!1,l={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:a},useMedium:function(c){var d=s(c,r);return i.push(d),function(){i=i.filter(function(h){return h!==d})}},assignSyncMedium:function(c){for(r=!0;i.length;){var d=i;i=[],d.forEach(c)}i={push:function(h){return c(h)},filter:function(){return i}}},assignMedium:function(c){r=!0;var d=[];if(i.length){var h=i;i=[],h.forEach(c),d=i}var p=function(){var b=d;d=[],b.forEach(c)},f=function(){return Promise.resolve().then(p)};f(),i={push:function(b){d.push(b),f()},filter:function(b){return d=d.filter(b),i}}}};return l}function wm(a,s){return s===void 0&&(s=kk),Ck(a,s)}function w0(a){a===void 0&&(a={});var s=Ck(null);return s.options=cS({async:!0,ssr:!1},a),s}var Tk=wm({},function(a){var s=a.target,i=a.currentTarget;return{target:s,currentTarget:i}}),Sk=wm(),k0=wm(),C0=w0({async:!0,ssr:typeof document<"u"}),T0=lm(void 0),S0=[],km=Iw(function(s,i){var r,l=kt(),c=l[0],d=l[1],h=Ko(),p=Ko(!1),f=Ko(null),b=kt({}),y=b[1],w=s.children,v=s.disabled,_=v===void 0?!1:v,$=s.noFocusGuards,S=$===void 0?!1:$,T=s.persistentFocus,E=T===void 0?!1:T,D=s.crossFrame,M=D===void 0?!0:D,P=s.autoFocus,W=P===void 0?!0:P;s.allowTextSelection;var G=s.group,z=s.className,Z=s.whiteList,he=s.hasPositiveIndices,Ce=s.shards,R=Ce===void 0?S0:Ce,K=s.as,C=K===void 0?"div":K,Q=s.lockProps,ve=Q===void 0?{}:Q,ce=s.sideCar,ne=s.returnFocus,me=ne===void 0?!1:ne,re=s.focusOptions,B=s.onActivation,N=s.onDeactivation,te=kt({}),q=te[0],se=xn(function(Y){var O=Y.captureFocusRestore;if(!f.current){var A,U=(A=document)==null?void 0:A.activeElement;f.current=U,U!==document.body&&(f.current=O(U))}h.current&&B&&B(h.current),p.current=!0,y()},[B]),j=xn(function(){p.current=!1,N&&N(h.current),y()},[N]),Te=xn(function(Y){var O=f.current;if(O){var A=(typeof O=="function"?O():O)||document.body,U=typeof me=="function"?me(A):me;if(U){var H=typeof U=="object"?U:void 0;f.current=null,Y?Promise.resolve().then(function(){return A.focus(H)}):A.focus(H)}}},[me]),ae=xn(function(Y){p.current&&Tk.useMedium(Y)},[]),we=Sk.useMedium,Ie=xn(function(Y){h.current!==Y&&(h.current=Y,d(Y))},[]),Ne=Sg((r={},r[wk]=_&&"disabled",r[Xg]=G,r),ve),Ae=S!==!0,We=Ae&&S!=="tail",k=_0([i,Ie]),X=us(function(){return{observed:h,shards:R,enabled:!_,active:p.current}},[_,p.current,R,c]);return _e.createElement(Ig,null,Ae&&[_e.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:_?-1:0,style:rg}),he?_e.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:_?-1:1,style:rg}):null],!_&&_e.createElement(ce,{id:q,sideCar:C0,observed:c,disabled:_,persistentFocus:E,crossFrame:M,autoFocus:W,whiteList:Z,shards:R,onActivation:se,onDeactivation:j,returnFocus:Te,focusOptions:re,noFocusGuards:S}),_e.createElement(C,Sg({ref:k},Ne,{className:z,onBlur:we,onFocus:ae}),_e.createElement(T0.Provider,{value:X},w)),We&&_e.createElement("div",{"data-focus-guard":!0,tabIndex:_?-1:0,style:rg}))});km.propTypes={};function E0(a,s){function i(r){return r.displayName||r.name||"Component"}return function(l){var c=[],d;function h(){d=a(c.map(function(f){return f.props})),s(d)}var p=(function(f){DS(b,f);function b(){return f.apply(this,arguments)||this}b.peek=function(){return d};var y=b.prototype;return y.componentDidMount=function(){c.push(this),h()},y.componentDidUpdate=function(){h()},y.componentWillUnmount=function(){var v=c.indexOf(this);c.splice(v,1),h()},y.render=function(){return _e.createElement(l,this.props)},b})(RT);return qS(p,"displayName","SideEffect("+i(l)+")"),p}}var oo=function(a){for(var s=Array(a.length),i=0;i=0}).sort(L0)},B0=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],Sm=B0.join(","),F0="".concat(Sm,", [data-focus-guard]"),Mk=function(a,s){return oo((a.shadowRoot||a).children).reduce(function(i,r){return i.concat(r.matches(s?F0:Sm)?[r]:[],Mk(r))},[])},j0=function(a,s){var i;return a instanceof HTMLIFrameElement&&(!((i=a.contentDocument)===null||i===void 0)&&i.body)?Bn([a.contentDocument.body],s):[a]},Bn=function(a,s){return a.reduce(function(i,r){var l,c=Mk(r,s),d=(l=[]).concat.apply(l,c.map(function(h){return j0(h,s)}));return i.concat(d,r.parentNode?oo(r.parentNode.querySelectorAll(Sm)).filter(function(h){return h===r}):[])},[])},z0=function(a){var s=a.querySelectorAll("[".concat($0,"]"));return oo(s).map(function(i){return Bn([i])}).reduce(function(i,r){return i.concat(r)},[])},Em=function(a,s){return oo(a).filter(function(i){return Dk(s,i)}).filter(function(i){return R0(i)})},M_=function(a,s){return s===void 0&&(s=new Map),oo(a).filter(function(i){return Ak(s,i)})},Im=function(a,s,i){return Tm(Em(Bn(a,i),s),!0,i)},ea=function(a,s){return Tm(Em(Bn(a),s),!1)},U0=function(a,s){return Em(z0(a),s)},xi=function(a,s){return a.shadowRoot?xi(a.shadowRoot,s):Object.getPrototypeOf(a).contains!==void 0&&Object.getPrototypeOf(a).contains.call(a,s)?!0:oo(a.children).some(function(i){var r;if(i instanceof HTMLIFrameElement){var l=(r=i.contentDocument)===null||r===void 0?void 0:r.body;return l?xi(l,s):!1}return xi(i,s)})},H0=function(a){for(var s=new Set,i=a.length,r=0;r0&&s.add(l),(c&Node.DOCUMENT_POSITION_CONTAINS)>0&&s.add(r)}return a.filter(function(d,h){return!s.has(h)})},Lk=function(a){return a.parentNode?Lk(a.parentNode):a},xm=function(a){var s=Ri(a);return s.filter(Boolean).reduce(function(i,r){var l=r.getAttribute(Xg);return i.push.apply(i,l?H0(oo(Lk(r).querySelectorAll("[".concat(Xg,'="').concat(l,'"]:not([').concat(wk,'="disabled"])')))):[r]),i},[])},W0=function(a){try{return a()}catch{return}},ta=function(a){if(a===void 0&&(a=document),!(!a||!a.activeElement)){var s=a.activeElement;return s.shadowRoot?ta(s.shadowRoot):s instanceof HTMLIFrameElement&&W0(function(){return s.contentWindow.document})?ta(s.contentWindow.document):s}},G0=function(a,s){return a===s},V0=function(a,s){return!!oo(a.querySelectorAll("iframe")).some(function(i){return G0(i,s)})},Pk=function(a,s){return s===void 0&&(s=ta(Ek(a).ownerDocument)),!s||s.dataset&&s.dataset.focusGuard?!1:xm(a).some(function(i){return xi(i,s)||V0(i,s)})},K0=function(a){a===void 0&&(a=document);var s=ta(a);return s?oo(a.querySelectorAll("[".concat(f0,"]"))).some(function(i){return xi(i,s)}):!1},Y0=function(a,s){return s.filter(Nk).filter(function(i){return i.name===a.name}).filter(function(i){return i.checked})[0]||a},Dm=function(a,s){return Nk(a)&&a.name?Y0(a,s):a},J0=function(a){var s=new Set;return a.forEach(function(i){return s.add(Dm(i,a))}),a.filter(function(i){return s.has(i)})},L_=function(a){return a[0]&&a.length>1?Dm(a[0],a):a[0]},P_=function(a,s){return a.indexOf(Dm(s,a))},Qg="NEW_FOCUS",q0=function(a,s,i,r,l){var c=a.length,d=a[0],h=a[c-1],p=Cm(r);if(!(r&&a.indexOf(r)>=0)){var f=r!==void 0?i.indexOf(r):-1,b=l?i.indexOf(l):f,y=l?a.indexOf(l):-1;if(f===-1)return y!==-1?y:Qg;if(y===-1)return Qg;var w=f-b,v=i.indexOf(d),_=i.indexOf(h),$=J0(i),S=r!==void 0?$.indexOf(r):-1,T=l?$.indexOf(l):S,E=$.filter(function(z){return z.tabIndex>=0}),D=r!==void 0?E.indexOf(r):-1,M=l?E.indexOf(l):D,P=D>=0&&M>=0?M-D:T-S;if(!w&&y>=0||s.length===0)return y;var W=P_(a,s[0]),G=P_(a,s[s.length-1]);if(f<=v&&p&&Math.abs(w)>1)return G;if(f>=_&&p&&Math.abs(w)>1)return W;if(w&&Math.abs(P)>1)return y;if(f<=v)return G;if(f>_)return W;if(w)return Math.abs(w)>1?y:(c+y+w)%c}},X0=function(a){return function(s){var i,r=(i=Ok(s))===null||i===void 0?void 0:i.autofocus;return s.autofocus||r!==void 0&&r!=="false"||a.indexOf(s)>=0}},B_=function(a,s,i){var r=a.map(function(c){var d=c.node;return d}),l=M_(r.filter(X0(i)));return l&&l.length?L_(l):L_(M_(s))},em=function(a,s){return s===void 0&&(s=[]),s.push(a),a.parentNode&&em(a.parentNode.host||a.parentNode,s),s},ag=function(a,s){for(var i=em(a),r=em(s),l=0;l=0)return c}return!1},Bk=function(a,s,i){var r=Ri(a),l=Ri(s),c=r[0],d=!1;return l.filter(Boolean).forEach(function(h){d=ag(d||h,h)||d,i.filter(Boolean).forEach(function(p){var f=ag(c,p);f&&(!d||xi(f,d)?d=f:d=ag(f,d))})}),d},F_=function(a,s){return a.reduce(function(i,r){return i.concat(U0(r,s))},[])},Z0=function(a,s){var i=new Map;return s.forEach(function(r){return i.set(r.node,r)}),a.map(function(r){return i.get(r)}).filter(M0)},Q0=function(a,s){var i=ta(Ri(a).length>0?document:Ek(a).ownerDocument),r=xm(a).filter(Zg),l=Bk(i||a,a,r),c=new Map,d=ea(r,c),h=d.filter(function(_){var $=_.node;return Zg($)});if(h[0]){var p=ea([l],c).map(function(_){var $=_.node;return $}),f=Z0(p,h),b=f.map(function(_){var $=_.node;return $}),y=f.filter(function(_){var $=_.tabIndex;return $>=0}).map(function(_){var $=_.node;return $}),w=q0(b,y,p,i,s);if(w===Qg){var v=B_(d,y,F_(r,c))||B_(d,b,F_(r,c));if(v)return{node:v};console.warn("focus-lock: cannot find any node to move focus into");return}return w===void 0?w:f[w]}},eD=function(a){var s=xm(a).filter(Zg),i=Bk(a,a,s),r=Tm(Bn([i],!0),!0,!0),l=Bn(s,!1);return r.map(function(c){var d=c.node,h=c.index;return{node:d,index:h,lockItem:l.indexOf(d)>=0,guard:Cm(d)}})},Am=function(a,s){a&&("focus"in a&&a.focus(s),"contentWindow"in a&&a.contentWindow&&a.contentWindow.focus())},lg=0,cg=!1,Fk=function(a,s,i){i===void 0&&(i={});var r=Q0(a,s);if(!cg&&r){if(lg>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),cg=!0,setTimeout(function(){cg=!1},1);return}lg++,Am(r.node,i.focusOptions),lg--}};function Hr(a){if(!a)return null;if(typeof WeakRef>"u")return function(){return a||null};var s=a?new WeakRef(a):null;return function(){return(s==null?void 0:s.deref())||null}}var tD=function(a){if(!a)return null;for(var s=[],i=a;i&&i!==document.body;)s.push({current:Hr(i),parent:Hr(i.parentElement),left:Hr(i.previousElementSibling),right:Hr(i.nextElementSibling)}),i=i.parentElement;return{element:Hr(a),stack:s,ownerDocument:a.ownerDocument}},sD=function(a){var s,i,r,l,c;if(a)for(var d=a.stack,h=a.ownerDocument,p=new Map,f=0,b=d;f-1&&(S.filter(function(E){var D=E.guard,M=E.node;return D&&M.dataset.focusAutoGuard}).forEach(function(E){var D=E.node;return D.removeAttribute("tabIndex")}),z_(T,S.length,1,S),z_(T,-1,-1,S))}}}return s},Gk=function(s){Sc()&&s&&(s.stopPropagation(),s.preventDefault())},Nm=function(){return Om(Sc)},yD=function(s){var i=s.target,r=s.currentTarget;r.contains(i)||gD(r,i)},_D=function(){return null},Vk=function(){Rm=!0},Kk=function(){Rm=!1,sa="just",Om(function(){sa="meanwhile"})},wD=function(){document.addEventListener("focusin",Gk),document.addEventListener("focusout",Nm),window.addEventListener("focus",Vk),window.addEventListener("blur",Kk)},kD=function(){document.removeEventListener("focusin",Gk),document.removeEventListener("focusout",Nm),window.removeEventListener("focus",Vk),window.removeEventListener("blur",Kk)};function CD(a){return a.filter(function(s){var i=s.disabled;return!i})}var Yk={moveFocusInside:Fk,focusInside:Pk,focusNextElement:rD,focusPrevElement:aD,focusFirstElement:lD,focusLastElement:cD,captureFocusRestore:jk};function TD(a){var s=a.slice(-1)[0];s&&!Rn&&wD();var i=Rn,r=i&&s&&s.id===i.id;Rn=s,i&&!r&&(i.onDeactivation(),a.filter(function(l){var c=l.id;return c===i.id}).length||i.returnFocus(!s)),s?(ts=null,(!r||i.observed!==s.observed)&&s.onActivation(Yk),Sc(),Om(Sc)):(kD(),ts=null)}Tk.assignSyncMedium(yD);Sk.assignMedium(Nm);k0.assignMedium(function(a){return a(Yk)});const SD=E0(CD,TD)(_D);var Jk=Iw(function(s,i){return _e.createElement(km,Sg({sideCar:SD,ref:i},s))}),qk=km.propTypes||{};qk.sideCar;AS(qk,["sideCar"]);Jk.propTypes={};var Xk={exports:{}},ct={};var Mm=Symbol.for("react.element"),Lm=Symbol.for("react.portal"),ou=Symbol.for("react.fragment"),iu=Symbol.for("react.strict_mode"),nu=Symbol.for("react.profiler"),ru=Symbol.for("react.provider"),au=Symbol.for("react.context"),ED=Symbol.for("react.server_context"),lu=Symbol.for("react.forward_ref"),cu=Symbol.for("react.suspense"),uu=Symbol.for("react.suspense_list"),du=Symbol.for("react.memo"),hu=Symbol.for("react.lazy"),ID=Symbol.for("react.offscreen"),Zk;Zk=Symbol.for("react.module.reference");function Cs(a){if(typeof a=="object"&&a!==null){var s=a.$$typeof;switch(s){case Mm:switch(a=a.type,a){case ou:case nu:case iu:case cu:case uu:return a;default:switch(a=a&&a.$$typeof,a){case ED:case au:case lu:case hu:case du:case ru:return a;default:return s}}case Lm:return s}}}ct.ContextConsumer=au;ct.ContextProvider=ru;ct.Element=Mm;ct.ForwardRef=lu;ct.Fragment=ou;ct.Lazy=hu;ct.Memo=du;ct.Portal=Lm;ct.Profiler=nu;ct.StrictMode=iu;ct.Suspense=cu;ct.SuspenseList=uu;ct.isAsyncMode=function(){return!1};ct.isConcurrentMode=function(){return!1};ct.isContextConsumer=function(a){return Cs(a)===au};ct.isContextProvider=function(a){return Cs(a)===ru};ct.isElement=function(a){return typeof a=="object"&&a!==null&&a.$$typeof===Mm};ct.isForwardRef=function(a){return Cs(a)===lu};ct.isFragment=function(a){return Cs(a)===ou};ct.isLazy=function(a){return Cs(a)===hu};ct.isMemo=function(a){return Cs(a)===du};ct.isPortal=function(a){return Cs(a)===Lm};ct.isProfiler=function(a){return Cs(a)===nu};ct.isStrictMode=function(a){return Cs(a)===iu};ct.isSuspense=function(a){return Cs(a)===cu};ct.isSuspenseList=function(a){return Cs(a)===uu};ct.isValidElementType=function(a){return typeof a=="string"||typeof a=="function"||a===ou||a===nu||a===iu||a===cu||a===uu||a===ID||typeof a=="object"&&a!==null&&(a.$$typeof===hu||a.$$typeof===du||a.$$typeof===ru||a.$$typeof===au||a.$$typeof===lu||a.$$typeof===Zk||a.getModuleId!==void 0)};ct.typeOf=Cs;Xk.exports=ct;var Qk=Xk.exports;function xD(a){function s(N,te,q,se,j){for(var Te=0,ae=0,we=0,Ie=0,Ne,Ae,We=0,k=0,X,Y=X=Ne=0,O=0,A=0,U=0,H=0,ue=q.length,V=ue-1,be,pe="",fe="",Le="",Ue="",Be;ONe)&&(H=(pe=pe.replace(" ",":")).length),0se&&(se=(te=te.trim()).charCodeAt(0)),se){case 38:return te.replace(T,"$1"+N.trim());case 58:return N.trim()+te.replace(T,"$1"+N.trim());default:if(0<1*q&&0ae.charCodeAt(8))break;case 115:j=j.replace(ae,"-webkit-"+ae)+";"+j;break;case 207:case 102:j=j.replace(ae,"-webkit-"+(102q.charCodeAt(0)&&(q=q.trim()),B=q,q=[B],01?s-1:0),r=1;r0?" Args: "+i.join(", "):""))}var RD=(function(){function a(i){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=i}var s=a.prototype;return s.indexOfGroup=function(i){for(var r=0,l=0;l=this.groupSizes.length){for(var l=this.groupSizes,c=l.length,d=c;i>=d;)(d<<=1)<0&&ga(16,""+i);this.groupSizes=new Uint32Array(d),this.groupSizes.set(l),this.length=d;for(var h=c;h=this.length||this.groupSizes[i]===0)return r;for(var l=this.groupSizes[i],c=this.indexOfGroup(i),d=c+l,h=c;h{const d=`__dbk__gutter ${r} ${a||s}`,h=`__dbk__dragger ${r} ${i||s}`;return m.jsx("div",Object.assign({className:d,ref:c,dir:r,onMouseDown:l,onTouchStart:fc?l:void 0},{children:m.jsx("div",{className:h},void 0)}),void 0)}));var ws;function Pg(a,s,i){let r,l;return s?(r=a/2,l=a):i?(r=a,l=a/2):(r=a,l=a),{aGutterSize:r,bGutterSize:l}}function VS(a,s){switch(s.type){case ws.SetIsReadyToCompute:return Object.assign(Object.assign({},a),{isReady:s.payload.isReady});case ws.CreatePairs:{const{direction:i,children:r,gutters:l}=s.payload,c=r[0].parentNode;if(!c)throw new Error("Cannot create pairs - parent is undefined.");const d=Cc(i,c);if(d===void 0)throw new Error(`Cannot create pairs - parent has undefined or zero size: ${d}.`);const h=[];return r.forEach(((p,f)=>{if(f>0){const b=r[f-1],y=r[f],w=l[f-1],v=i===ft.Horizontal?b.getBoundingClientRect().left:b.getBoundingClientRect().top,_=i===ft.Horizontal?y.getBoundingClientRect().right:y.getBoundingClientRect().bottom,$=i===ft.Horizontal?b.getBoundingClientRect().width+w.getBoundingClientRect().width+y.getBoundingClientRect().width:b.getBoundingClientRect().height+w.getBoundingClientRect().height+y.getBoundingClientRect().height,S=i===ft.Horizontal?w.getBoundingClientRect().width:w.getBoundingClientRect().height,T={idx:f-1,a:b,b:y,gutter:w,parent:c,start:v,end:_,size:$,gutterSize:S,aSizePct:100/r.length,bSizePct:100/r.length};h.push(T)}})),Object.assign(Object.assign({},a),{pairs:h})}case ws.StartDragging:{const{gutterIdx:i}=s.payload;return Object.assign(Object.assign({},a),{isDragging:!0,draggingIdx:i})}case ws.StopDragging:return Object.assign(Object.assign({},a),{isDragging:!1});case ws.CalculateSizes:{const{direction:i,gutterIdx:r}=s.payload,l=a.pairs[r],c=Cc(i,l.parent);if(!c)throw new Error("Cannot calculate sizes - 'pair.parent' has undefined or zero size.");const d=l.gutter[i===ft.Horizontal?"clientWidth":"clientHeight"],h=r===0,p=r===a.pairs.length-1,{aGutterSize:f,bGutterSize:b}=Pg(d,h,p);let y,w,v,_,$;return i===ft.Horizontal?(y=l.a.getBoundingClientRect().left,w=l.b.getBoundingClientRect().right,_=(l.a.getBoundingClientRect().width+f)/c*100,$=(l.b.getBoundingClientRect().width+b)/c*100,v=l.a.getBoundingClientRect().width+f+b+l.b.getBoundingClientRect().width):(y=l.a.getBoundingClientRect().top,w=l.b.getBoundingClientRect().bottom,_=(l.a.getBoundingClientRect().height+f)/c*100,$=(l.b.getBoundingClientRect().height+b)/c*100,v=l.a.getBoundingClientRect().height+f+b+l.b.getBoundingClientRect().height),a.pairs[r]=Object.assign(Object.assign({},l),{start:y,end:w,size:v,aSizePct:_,bSizePct:$,gutterSize:d}),Object.assign({},a)}default:return a}}function Vw(a,s=0,i=[]){return OT.toArray(a).reduce(((r,l,c)=>(WS.isFragment(l)?r.push.apply(r,Vw(l.props.children,s+1,i.concat(l.key||c))):Ew(l)?r.push(xg(l,{key:i.concat(String(l.key)).join(".")})):typeof l!="string"&&typeof l!="number"||r.push(l),r)),[])}(function(a){a[a.SetIsReadyToCompute=0]="SetIsReadyToCompute",a[a.CreatePairs=1]="CreatePairs",a[a.CalculateSizes=2]="CalculateSizes",a[a.StartDragging=3]="StartDragging",a[a.StopDragging=4]="StopDragging"})(ws||(ws={}));const u_=a=>"changedTouches"in a;var ft,Bg;(function(a){a.Horizontal="Horizontal",a.Vertical="Vertical"})(ft||(ft={})),(function(a){a.Light="Light",a.Dark="Dark"})(Bg||(Bg={}));const fc=typeof window<"u"&&"ontouchstart"in window;function Xp(a){return a===ft.Horizontal?"col-resize":"row-resize"}const KS={isReady:!1,isDragging:!1,pairs:[]};function d_({direction:a=ft.Horizontal,minWidths:s=[],minHeights:i=[],initialSizes:r,gutterTheme:l=Bg.Dark,gutterClassName:c,draggerClassName:d,children:h,onResizeStarted:p,onResizeFinished:f,classes:b=[]}){const y=Vw(h),[w,v]=AT(VS,KS),_=Ko(null),$=Ko([]),S=Ko([]);$.current=[],S.current=[];const T=_e.useCallback((R=>{v({type:ws.SetIsReadyToCompute,payload:{isReady:R}})}),[]),E=_e.useCallback(((R,K)=>{v({type:ws.StartDragging,payload:{gutterIdx:K}});const C=w.pairs[K];p==null||p(C.idx),C.a.style.userSelect="none",C.b.style.userSelect="none",C.gutter.style.cursor=Xp(R),C.parent.style.cursor=Xp(R),document.body.style.cursor=Xp(R)}),[w.pairs]),D=_e.useCallback((()=>{v({type:ws.StopDragging});const R=[];for(let C=0;C{v({type:ws.CalculateSizes,payload:{direction:R,gutterIdx:K}})}),[]),P=_e.useCallback(((R,K,C)=>{v({type:ws.CreatePairs,payload:{direction:R,children:K,gutters:C}})}),[]),W=_e.useCallback(((R,K,C,Q)=>{const ve=K[0].parentNode;if(!ve)throw new Error("Cannot set initial sizes - parent is undefined");if(Cc(R,ve)===void 0)throw new Error("Cannot set initial sizes - parent has undefined size");K.forEach(((ce,ne)=>{const me=ne===0,re=ne===K.length-1;let B,N=0;K.length>1&&(N=C[re?ne-1:ne].getBoundingClientRect()[R===ft.Horizontal?"width":"height"],N=me||re?N/2:N),B=Q&&ne{if(w.draggingIdx===void 0)throw new Error("Cannot adjust size - 'draggingIdx' is undefined");const C=w.pairs[w.draggingIdx];if(C.size===void 0)throw new Error("Cannot adjust size - 'pair.size' is undefined");if(C.gutterSize===void 0)throw new Error("Cannot adjust size - 'pair.gutterSize' is undefined");const Q=C.aSizePct+C.bSizePct,ve=K/C.size*Q,ce=Q-K/C.size*Q,ne=w.draggingIdx===0,me=w.draggingIdx===w.pairs.length-1,{aGutterSize:re,bGutterSize:B}=Pg(C.gutterSize,ne,me),N=`calc(${ve}% - ${re}px)`,te=`calc(${ce}% - ${B}px)`;R===ft.Horizontal?(C.a.style.width=N,C.b.style.width=te):(C.a.style.height=N,C.b.style.height=te)}),[w.draggingIdx,w.pairs,a]),z=_e.useCallback(((R,K,C)=>{if(!w.isDragging)return;if(w.draggingIdx===void 0)throw new Error("Cannot drag - 'draggingIdx' is undefined");const Q=w.pairs[w.draggingIdx];if(Q.start===void 0)throw new Error("Cannot drag - 'pair.start' is undefined");if(Q.size===void 0)throw new Error("Cannot drag - 'pair.size' is undefined");if(Q.gutterSize===void 0)throw new Error("Cannot drag - 'pair.gutterSize' is undefined");let ve=(function(me,re){const B=u_(re)?re.changedTouches[0]:re;return me===ft.Horizontal?B.clientX:B.clientY})(K,R)-Q.start,ce=16,ne=16;C.length>w.draggingIdx&&(ce=C[w.draggingIdx]),C.length>=w.draggingIdx+1&&(ne=C[w.draggingIdx+1]),ve=Q.size-(Q.gutterSize+ne)&&(ve=Q.size-(Q.gutterSize+ne)),G(K,ve)}),[w.isDragging,w.draggingIdx,w.pairs,G]),Z=()=>{if(w.isDragging){if(w.draggingIdx===void 0)throw new Error("Cannot calculate sizes after dragging = 'state.draggingIdx' is undefined");M(a,w.draggingIdx),D()}},he=R=>{w.isDragging&&(u_(R)&&R.preventDefault(),z(R,a,a===ft.Horizontal?s:i))};function Ce(R,K){if(!R.current)throw new Error("Can't add element to ref object - ref isn't initialized");K&&!R.current.includes(K)&&R.current.push(K)}return ic("mouseup",Z,[w.isDragging,D]),ic("mousemove",he,[a,w.isDragging,z,s,i]),ic("touchend",Z,[w.isDragging,D],{condition:fc}),ic("touchmove",he,[a,w.isDragging,z,s,i],{condition:fc,passive:!fc}),Lt((function(){if(!_.current)return;const R=_.current.parentElement;if(!R)return;const K=new ResizeObserver((()=>{const C=getComputedStyle(R),Q=a===ft.Horizontal?R.clientWidth:R.clientHeight;T(!!C&&!!Q)}));return K.observe(R),()=>{K.disconnect()}}),[_.current,a]),Lt((function(){if(w.isReady&&(!$.current||$.current[0].offsetParent)){if(!$.current||!S.current)throw new Error("Cannot create pairs - either variable 'childRefs' or 'gutterRefs' is undefined");y.length<=1?W(a,$.current,S.current,r):(W(a,$.current,S.current,r),P(a,$.current,S.current))}}),[h,w.isReady,a,W,P,r]),m.jsx("div",Object.assign({className:`__dbk__container ${a}`,ref:_},{children:w.isReady&&y.map(((R,K)=>m.jsxs(_e.Fragment,{children:[m.jsx("div",Object.assign({ref:C=>Ce($,C),className:"__dbk__child-wrapper "+(KCe(S,C),className:c,theme:l,draggerClassName:d,direction:a,onDragging:()=>{return M(a,C=K),void E(a,C);var C}},void 0)]},K)))}),void 0)}const Kw=um({dragDropManager:void 0});function Qr(a){"@babel/helpers - typeof";return Qr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},Qr(a)}function YS(a,s){if(Qr(a)!="object"||!a)return a;var i=a[Symbol.toPrimitive];if(i!==void 0){var r=i.call(a,s);if(Qr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(a)}function JS(a){var s=YS(a,"string");return Qr(s)=="symbol"?s:s+""}function qS(a,s,i){return(s=JS(s))in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function bs(a){return"Minified Redux error #"+a+"; visit https://redux.js.org/Errors?code="+a+" for the full message or use the non-minified dev environment for full errors. "}var h_=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),p_=function(){return Math.random().toString(36).substring(7).split("").join(".")},g_={INIT:"@@redux/INIT"+p_(),REPLACE:"@@redux/REPLACE"+p_()};function XS(a){if(typeof a!="object"||a===null)return!1;for(var s=a;Object.getPrototypeOf(s)!==null;)s=Object.getPrototypeOf(s);return Object.getPrototypeOf(a)===s}function Yw(a,s,i){var r;if(typeof s=="function"&&typeof i=="function"||typeof i=="function"&&typeof arguments[3]=="function")throw new Error(bs(0));if(typeof s=="function"&&typeof i>"u"&&(i=s,s=void 0),typeof i<"u"){if(typeof i!="function")throw new Error(bs(1));return i(Yw)(a,s)}if(typeof a!="function")throw new Error(bs(2));var l=a,c=s,d=[],h=d,p=!1;function f(){h===d&&(h=d.slice())}function b(){if(p)throw new Error(bs(3));return c}function y($){if(typeof $!="function")throw new Error(bs(4));if(p)throw new Error(bs(5));var S=!0;return f(),h.push($),function(){if(S){if(p)throw new Error(bs(6));S=!1,f();var E=h.indexOf($);h.splice(E,1),d=null}}}function w($){if(!XS($))throw new Error(bs(7));if(typeof $.type>"u")throw new Error(bs(8));if(p)throw new Error(bs(9));try{p=!0,c=l(c,$)}finally{p=!1}for(var S=d=h,T=0;Tr&&r[l]?r[l]:i||null,a)}function eE(a,s){return a.filter(i=>i!==s)}function Jw(a){return typeof a=="object"}function tE(a,s){const i=new Map,r=c=>{i.set(c,i.has(c)?i.get(c)+1:1)};a.forEach(r),s.forEach(r);const l=[];return i.forEach((c,d)=>{c===1&&l.push(d)}),l}function sE(a,s){return a.filter(i=>s.indexOf(i)>-1)}const mm="dnd-core/INIT_COORDS",Xc="dnd-core/BEGIN_DRAG",fm="dnd-core/PUBLISH_DRAG_SOURCE",Zc="dnd-core/HOVER",Qc="dnd-core/DROP",eu="dnd-core/END_DRAG";function m_(a,s){return{type:mm,payload:{sourceClientOffset:s||null,clientOffset:a||null}}}const oE={type:mm,payload:{clientOffset:null,sourceClientOffset:null}};function iE(a){return function(i=[],r={publishSource:!0}){const{publishSource:l=!0,clientOffset:c,getSourceClientOffset:d}=r,h=a.getMonitor(),p=a.getRegistry();a.dispatch(m_(c)),nE(i,h,p);const f=lE(i,h);if(f==null){a.dispatch(oE);return}let b=null;if(c){if(!d)throw new Error("getSourceClientOffset must be defined");rE(d),b=d(f)}a.dispatch(m_(c,b));const w=p.getSource(f).beginDrag(h,f);if(w==null)return;aE(w),p.pinSource(f);const v=p.getSourceType(f);return{type:Xc,payload:{itemType:v,item:w,sourceId:f,clientOffset:c||null,sourceClientOffset:b||null,isSourcePublic:!!l}}}}function nE(a,s,i){Ve(!s.isDragging(),"Cannot call beginDrag while dragging."),a.forEach(function(r){Ve(i.getSource(r),"Expected sourceIds to be registered.")})}function rE(a){Ve(typeof a=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function aE(a){Ve(Jw(a),"Item must be an object.")}function lE(a,s){let i=null;for(let r=a.length-1;r>=0;r--)if(s.canDragSource(a[r])){i=a[r];break}return i}function cE(a,s,i){return s in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function uE(a){for(var s=1;s{const p=pE(d,h,l,r),f={type:Qc,payload:{dropResult:uE({},i,p)}};a.dispatch(f)})}}function hE(a){Ve(a.isDragging(),"Cannot call drop while not dragging."),Ve(!a.didDrop(),"Cannot call drop twice during one drag operation.")}function pE(a,s,i,r){const l=i.getTarget(a);let c=l?l.drop(r,a):void 0;return gE(c),typeof c>"u"&&(c=s===0?{}:r.getDropResult()),c}function gE(a){Ve(typeof a>"u"||Jw(a),"Drop result must either be an object or undefined.")}function mE(a){const s=a.getTargetIds().filter(a.canDropOnTarget,a);return s.reverse(),s}function fE(a){return function(){const i=a.getMonitor(),r=a.getRegistry();$E(i);const l=i.getSourceId();return l!=null&&(r.getSource(l,!0).endDrag(i,l),r.unpinSource()),{type:eu}}}function $E(a){Ve(a.isDragging(),"Cannot call endDrag while not dragging.")}function Fg(a,s){return s===null?a===null:Array.isArray(a)?a.some(i=>i===s):a===s}function bE(a){return function(i,{clientOffset:r}={}){vE(i);const l=i.slice(0),c=a.getMonitor(),d=a.getRegistry(),h=c.getItemType();return _E(l,d,h),yE(l,c,d),wE(l,c,d),{type:Zc,payload:{targetIds:l,clientOffset:r||null}}}}function vE(a){Ve(Array.isArray(a),"Expected targetIds to be an array.")}function yE(a,s,i){Ve(s.isDragging(),"Cannot call hover while not dragging."),Ve(!s.didDrop(),"Cannot call hover after drop.");for(let r=0;r=0;r--){const l=a[r],c=s.getTargetType(l);Fg(c,i)||a.splice(r,1)}}function wE(a,s,i){a.forEach(function(r){i.getTarget(r).hover(s,r)})}function kE(a){return function(){if(a.getMonitor().isDragging())return{type:fm}}}function CE(a){return{beginDrag:iE(a),publishDragSource:kE(a),hover:bE(a),drop:dE(a),endDrag:fE(a)}}class TE{receiveBackend(s){this.backend=s}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const s=this,{dispatch:i}=this.store;function r(c){return(...d)=>{const h=c.apply(s,d);typeof h<"u"&&i(h)}}const l=CE(this);return Object.keys(l).reduce((c,d)=>{const h=l[d];return c[d]=r(h),c},{})}dispatch(s){this.store.dispatch(s)}constructor(s,i){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=s,this.monitor=i,s.subscribe(this.handleRefCountChange)}}function SE(a,s){return{x:a.x+s.x,y:a.y+s.y}}function qw(a,s){return{x:a.x-s.x,y:a.y-s.y}}function EE(a){const{clientOffset:s,initialClientOffset:i,initialSourceClientOffset:r}=a;return!s||!i||!r?null:qw(SE(s,r),i)}function IE(a){const{clientOffset:s,initialClientOffset:i}=a;return!s||!i?null:qw(s,i)}const Kr=[],$m=[];Kr.__IS_NONE__=!0;$m.__IS_ALL__=!0;function xE(a,s){return a===Kr?!1:a===$m||typeof s>"u"?!0:sE(s,a).length>0}class DE{subscribeToStateChange(s,i={}){const{handlerIds:r}=i;Ve(typeof s=="function","listener must be a function."),Ve(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let l=this.store.getState().stateId;const c=()=>{const d=this.store.getState(),h=d.stateId;try{h===l||h===l+1&&!xE(d.dirtyHandlerIds,r)||s()}finally{l=h}};return this.store.subscribe(c)}subscribeToOffsetChange(s){Ve(typeof s=="function","listener must be a function.");let i=this.store.getState().dragOffset;const r=()=>{const l=this.store.getState().dragOffset;l!==i&&(i=l,s())};return this.store.subscribe(r)}canDragSource(s){if(!s)return!1;const i=this.registry.getSource(s);return Ve(i,`Expected to find a valid source. sourceId=${s}`),this.isDragging()?!1:i.canDrag(this,s)}canDropOnTarget(s){if(!s)return!1;const i=this.registry.getTarget(s);if(Ve(i,`Expected to find a valid target. targetId=${s}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(s),l=this.getItemType();return Fg(r,l)&&i.canDrop(this,s)}isDragging(){return!!this.getItemType()}isDraggingSource(s){if(!s)return!1;const i=this.registry.getSource(s,!0);if(Ve(i,`Expected to find a valid source. sourceId=${s}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(s),l=this.getItemType();return r!==l?!1:i.isDragging(this,s)}isOverTarget(s,i={shallow:!1}){if(!s)return!1;const{shallow:r}=i;if(!this.isDragging())return!1;const l=this.registry.getTargetType(s),c=this.getItemType();if(c&&!Fg(l,c))return!1;const d=this.getTargetIds();if(!d.length)return!1;const h=d.indexOf(s);return r?h===d.length-1:h>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return EE(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return IE(this.store.getState().dragOffset)}constructor(s,i){this.store=s,this.registry=i}}const f_=typeof global<"u"?global:self,Xw=f_.MutationObserver||f_.WebKitMutationObserver;function Zw(a){return function(){const i=setTimeout(l,0),r=setInterval(l,50);function l(){clearTimeout(i),clearInterval(r),a()}}}function AE(a){let s=1;const i=new Xw(a),r=document.createTextNode("");return i.observe(r,{characterData:!0}),function(){s=-s,r.data=s}}const OE=typeof Xw=="function"?AE:Zw;class RE{enqueueTask(s){const{queue:i,requestFlush:r}=this;i.length||(r(),this.flushing=!0),i[i.length]=s}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:s}=this;for(;this.indexthis.capacity){for(let r=0,l=s.length-this.index;r{this.pendingErrors.push(s),this.requestErrorThrow()},this.requestFlush=OE(this.flush),this.requestErrorThrow=Zw(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class NE{call(){try{this.task&&this.task()}catch(s){this.onError(s)}finally{this.task=null,this.release(this)}}constructor(s,i){this.onError=s,this.release=i,this.task=null}}class ME{create(s){const i=this.freeTasks,r=i.length?i.pop():new NE(this.onError,l=>i[i.length]=l);return r.task=s,r}constructor(s){this.onError=s,this.freeTasks=[]}}const Qw=new RE,LE=new ME(Qw.registerPendingError);function PE(a){Qw.enqueueTask(LE.create(a))}const bm="dnd-core/ADD_SOURCE",vm="dnd-core/ADD_TARGET",ym="dnd-core/REMOVE_SOURCE",tu="dnd-core/REMOVE_TARGET";function BE(a){return{type:bm,payload:{sourceId:a}}}function FE(a){return{type:vm,payload:{targetId:a}}}function jE(a){return{type:ym,payload:{sourceId:a}}}function zE(a){return{type:tu,payload:{targetId:a}}}function UE(a){Ve(typeof a.canDrag=="function","Expected canDrag to be a function."),Ve(typeof a.beginDrag=="function","Expected beginDrag to be a function."),Ve(typeof a.endDrag=="function","Expected endDrag to be a function.")}function HE(a){Ve(typeof a.canDrop=="function","Expected canDrop to be a function."),Ve(typeof a.hover=="function","Expected hover to be a function."),Ve(typeof a.drop=="function","Expected beginDrag to be a function.")}function jg(a,s){if(s&&Array.isArray(a)){a.forEach(i=>jg(i,!1));return}Ve(typeof a=="string"||typeof a=="symbol",s?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var _s;(function(a){a.SOURCE="SOURCE",a.TARGET="TARGET"})(_s||(_s={}));let WE=0;function GE(){return WE++}function VE(a){const s=GE().toString();switch(a){case _s.SOURCE:return`S${s}`;case _s.TARGET:return`T${s}`;default:throw new Error(`Unknown Handler Role: ${a}`)}}function $_(a){switch(a[0]){case"S":return _s.SOURCE;case"T":return _s.TARGET;default:throw new Error(`Cannot parse handler ID: ${a}`)}}function b_(a,s){const i=a.entries();let r=!1;do{const{done:l,value:[,c]}=i.next();if(c===s)return!0;r=!!l}while(!r);return!1}class KE{addSource(s,i){jg(s),UE(i);const r=this.addHandler(_s.SOURCE,s,i);return this.store.dispatch(BE(r)),r}addTarget(s,i){jg(s,!0),HE(i);const r=this.addHandler(_s.TARGET,s,i);return this.store.dispatch(FE(r)),r}containsHandler(s){return b_(this.dragSources,s)||b_(this.dropTargets,s)}getSource(s,i=!1){return Ve(this.isSourceId(s),"Expected a valid source ID."),i&&s===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(s)}getTarget(s){return Ve(this.isTargetId(s),"Expected a valid target ID."),this.dropTargets.get(s)}getSourceType(s){return Ve(this.isSourceId(s),"Expected a valid source ID."),this.types.get(s)}getTargetType(s){return Ve(this.isTargetId(s),"Expected a valid target ID."),this.types.get(s)}isSourceId(s){return $_(s)===_s.SOURCE}isTargetId(s){return $_(s)===_s.TARGET}removeSource(s){Ve(this.getSource(s),"Expected an existing source."),this.store.dispatch(jE(s)),PE(()=>{this.dragSources.delete(s),this.types.delete(s)})}removeTarget(s){Ve(this.getTarget(s),"Expected an existing target."),this.store.dispatch(zE(s)),this.dropTargets.delete(s),this.types.delete(s)}pinSource(s){const i=this.getSource(s);Ve(i,"Expected an existing source."),this.pinnedSourceId=s,this.pinnedSource=i}unpinSource(){Ve(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(s,i,r){const l=VE(s);return this.types.set(l,i),s===_s.SOURCE?this.dragSources.set(l,r):s===_s.TARGET&&this.dropTargets.set(l,r),l}constructor(s){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=s}}const YE=(a,s)=>a===s;function JE(a,s){return!a&&!s?!0:!a||!s?!1:a.x===s.x&&a.y===s.y}function qE(a,s,i=YE){if(a.length!==s.length)return!1;for(let r=0;r0||!qE(i,r)))return Kr;const d=r[r.length-1],h=i[i.length-1];return d!==h&&(d&&l.push(d),h&&l.push(h)),l}function ZE(a,s,i){return s in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function QE(a){for(var s=1;s=0)&&Object.prototype.propertyIsEnumerable.call(a,r)&&(i[r]=a[r])}return i}function hI(a,s){if(a==null)return{};var i={},r=Object.keys(a),l,c;for(c=0;c=0)&&(i[l]=a[l]);return i}let y_=0;const $c=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var ek=dm(function(s){var{children:i}=s,r=dI(s,["children"]);const[l,c]=pI(r);return Lt(()=>{if(c){const d=tk();return++y_,()=>{--y_===0&&(d[$c]=null)}}},[]),m.jsx(Kw.Provider,{value:l,children:i})});function pI(a){if("manager"in a)return[{dragDropManager:a.manager},!1];const s=gI(a.backend,a.context,a.options,a.debugMode),i=!a.context;return[s,i]}function gI(a,s=tk(),i,r){const l=s;return l[$c]||(l[$c]={dragDropManager:cI(a,s,i,r)}),l[$c]}function tk(){return typeof global<"u"?global:window}var mI=function a(s,i){if(s===i)return!0;if(s&&i&&typeof s=="object"&&typeof i=="object"){if(s.constructor!==i.constructor)return!1;var r,l,c;if(Array.isArray(s)){if(r=s.length,r!=i.length)return!1;for(l=r;l--!==0;)if(!a(s[l],i[l]))return!1;return!0}if(s.constructor===RegExp)return s.source===i.source&&s.flags===i.flags;if(s.valueOf!==Object.prototype.valueOf)return s.valueOf()===i.valueOf();if(s.toString!==Object.prototype.toString)return s.toString()===i.toString();if(c=Object.keys(s),r=c.length,r!==Object.keys(i).length)return!1;for(l=r;l--!==0;)if(!Object.prototype.hasOwnProperty.call(i,c[l]))return!1;for(l=r;l--!==0;){var d=c[l];if(!a(s[d],i[d]))return!1}return!0}return s!==s&&i!==i};const fI=Xo(mI),Oi=typeof window<"u"?hm:Lt;function $I(a,s,i){const[r,l]=kt(()=>s(a)),c=xn(()=>{const d=s(a);fI(r,d)||(l(d),i&&i())},[r,a,i]);return Oi(c),[r,c]}function bI(a,s,i){const[r,l]=$I(a,s,i);return Oi(function(){const d=a.getHandlerId();if(d!=null)return a.subscribeToStateChange(l,{handlerIds:[d]})},[a,l]),r}function sk(a,s,i){return bI(s,a||(()=>({})),()=>i.reconnect())}function ok(a,s){const i=[];return typeof a!="function"&&i.push(a),us(()=>typeof a=="function"?a():a,i)}function vI(a){return us(()=>a.hooks.dragSource(),[a])}function yI(a){return us(()=>a.hooks.dragPreview(),[a])}let Zp=!1,Qp=!1;class _I{receiveHandlerId(s){this.sourceId=s}getHandlerId(){return this.sourceId}canDrag(){Ve(!Zp,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Zp=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Zp=!1}}isDragging(){if(!this.sourceId)return!1;Ve(!Qp,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Qp=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Qp=!1}}subscribeToStateChange(s,i){return this.internalMonitor.subscribeToStateChange(s,i)}isDraggingSource(s){return this.internalMonitor.isDraggingSource(s)}isOverTarget(s,i){return this.internalMonitor.isOverTarget(s,i)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(s){return this.internalMonitor.subscribeToOffsetChange(s)}canDragSource(s){return this.internalMonitor.canDragSource(s)}canDropOnTarget(s){return this.internalMonitor.canDropOnTarget(s)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(s){this.sourceId=null,this.internalMonitor=s.getMonitor()}}let eg=!1;class wI{receiveHandlerId(s){this.targetId=s}getHandlerId(){return this.targetId}subscribeToStateChange(s,i){return this.internalMonitor.subscribeToStateChange(s,i)}canDrop(){if(!this.targetId)return!1;Ve(!eg,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return eg=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{eg=!1}}isOver(s){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,s):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(s){this.targetId=null,this.internalMonitor=s.getMonitor()}}function kI(a,s,i){const r=i.getRegistry(),l=r.addTarget(a,s);return[l,()=>r.removeTarget(l)]}function CI(a,s,i){const r=i.getRegistry(),l=r.addSource(a,s);return[l,()=>r.removeSource(l)]}function zg(a,s,i,r){let l;if(l!==void 0)return!!l;if(a===s)return!0;if(typeof a!="object"||!a||typeof s!="object"||!s)return!1;const c=Object.keys(a),d=Object.keys(s);if(c.length!==d.length)return!1;const h=Object.prototype.hasOwnProperty.bind(s);for(let p=0;p, or turn it into a drag source or a drop target itself.`)}function SI(a){return(s=null,i=null)=>{if(!Ew(s)){const c=s;return a(c,i),c}const r=s;return TI(r),EI(r,i?c=>a(c,i):a)}}function ik(a){const s={};return Object.keys(a).forEach(i=>{const r=a[i];if(i.endsWith("Ref"))s[i]=a[i];else{const l=SI(r);s[i]=()=>l}}),s}function __(a,s){typeof a=="function"?a(s):a.current=s}function EI(a,s){const i=a.ref;return Ve(typeof i!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a or
. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),i?xg(a,{ref:r=>{__(i,r),__(s,r)}}):xg(a,{ref:s})}class II{receiveHandlerId(s){this.handlerId!==s&&(this.handlerId=s,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(s){this.dragSourceOptionsInternal=s}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(s){this.dragPreviewOptionsInternal=s}reconnect(){const s=this.reconnectDragSource();this.reconnectDragPreview(s)}reconnectDragSource(){const s=this.dragSource,i=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return i&&this.disconnectDragSource(),this.handlerId?s?(i&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=s,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,s,this.dragSourceOptions)),i):(this.lastConnectedDragSource=s,i):i}reconnectDragPreview(s=!1){const i=this.dragPreview,r=s||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!i){this.lastConnectedDragPreview=i;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=i,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,i,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!zg(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!zg(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(s){this.hooks=ik({dragSource:(i,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,Ug(i)?this.dragSourceRef=i:this.dragSourceNode=i,this.reconnectDragSource()},dragPreview:(i,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,Ug(i)?this.dragPreviewRef=i:this.dragPreviewNode=i,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=s}}class xI{get connectTarget(){return this.dropTarget}reconnect(){const s=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();s&&this.disconnectDropTarget();const i=this.dropTarget;if(this.handlerId){if(!i){this.lastConnectedDropTarget=i;return}s&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=i,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,i,this.dropTargetOptions))}}receiveHandlerId(s){s!==this.handlerId&&(this.handlerId=s,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(s){this.dropTargetOptionsInternal=s}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!zg(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(s){this.hooks=ik({dropTarget:(i,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,Ug(i)?this.dropTargetRef=i:this.dropTargetNode=i,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=s}}function zn(){const{dragDropManager:a}=ia(Kw);return Ve(a!=null,"Expected drag drop context"),a}function DI(a,s){const i=zn(),r=us(()=>new II(i.getBackend()),[i]);return Oi(()=>(r.dragSourceOptions=a||null,r.reconnect(),()=>r.disconnectDragSource()),[r,a]),Oi(()=>(r.dragPreviewOptions=s||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,s]),r}function AI(){const a=zn();return us(()=>new _I(a),[a])}class OI{beginDrag(){const s=this.spec,i=this.monitor;let r=null;return typeof s.item=="object"?r=s.item:typeof s.item=="function"?r=s.item(i):r={},r??null}canDrag(){const s=this.spec,i=this.monitor;return typeof s.canDrag=="boolean"?s.canDrag:typeof s.canDrag=="function"?s.canDrag(i):!0}isDragging(s,i){const r=this.spec,l=this.monitor,{isDragging:c}=r;return c?c(l):i===s.getSourceId()}endDrag(){const s=this.spec,i=this.monitor,r=this.connector,{end:l}=s;l&&l(i.getItem(),i),r.reconnect()}constructor(s,i,r){this.spec=s,this.monitor=i,this.connector=r}}function RI(a,s,i){const r=us(()=>new OI(a,s,i),[s,i]);return Lt(()=>{r.spec=a},[a]),r}function NI(a){return us(()=>{const s=a.type;return Ve(s!=null,"spec.type must be defined"),s},[a])}function MI(a,s,i){const r=zn(),l=RI(a,s,i),c=NI(a);Oi(function(){if(c!=null){const[h,p]=CI(c,l,r);return s.receiveHandlerId(h),i.receiveHandlerId(h),p}},[r,s,i,l,c])}function LI(a,s){const i=ok(a);Ve(!i.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=AI(),l=DI(i.options,i.previewOptions);return MI(i,r,l),[sk(i.collect,r,l),vI(l),yI(l)]}function PI(a){return us(()=>a.hooks.dropTarget(),[a])}function BI(a){const s=zn(),i=us(()=>new xI(s.getBackend()),[s]);return Oi(()=>(i.dropTargetOptions=a||null,i.reconnect(),()=>i.disconnectDropTarget()),[a]),i}function FI(){const a=zn();return us(()=>new wI(a),[a])}function jI(a){const{accept:s}=a;return us(()=>(Ve(a.accept!=null,"accept must be defined"),Array.isArray(s)?s:[s]),[s])}class zI{canDrop(){const s=this.spec,i=this.monitor;return s.canDrop?s.canDrop(i.getItem(),i):!0}hover(){const s=this.spec,i=this.monitor;s.hover&&s.hover(i.getItem(),i)}drop(){const s=this.spec,i=this.monitor;if(s.drop)return s.drop(i.getItem(),i)}constructor(s,i){this.spec=s,this.monitor=i}}function UI(a,s){const i=us(()=>new zI(a,s),[s]);return Lt(()=>{i.spec=a},[a]),i}function HI(a,s,i){const r=zn(),l=UI(a,s),c=jI(a);Oi(function(){const[h,p]=kI(c,l,r);return s.receiveHandlerId(h),i.receiveHandlerId(h),p},[r,s,l,i,c.map(d=>d.toString()).join("|")])}function WI(a,s){const i=ok(a),r=FI(),l=BI(i.options);return HI(i,r,l),[sk(i.collect,r,l),PI(l)]}function nk(a){let s=null;return()=>(s==null&&(s=a()),s)}function GI(a,s){return a.filter(i=>i!==s)}function VI(a,s){const i=new Set,r=c=>i.add(c);a.forEach(r),s.forEach(r);const l=[];return i.forEach(c=>l.push(c)),l}class KI{enter(s){const i=this.entered.length,r=l=>this.isNodeInDocument(l)&&(!l.contains||l.contains(s));return this.entered=VI(this.entered.filter(r),[s]),i===0&&this.entered.length>0}leave(s){const i=this.entered.length;return this.entered=GI(this.entered.filter(this.isNodeInDocument),s),i>0&&this.entered.length===0}reset(){this.entered=[]}constructor(s){this.entered=[],this.isNodeInDocument=s}}class YI{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(s=>{Object.defineProperty(this.item,s,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${s}" until the drop event.`),null}})})}loadDataTransfer(s){if(s){const i={};Object.keys(this.config.exposeProperties).forEach(r=>{const l=this.config.exposeProperties[r];l!=null&&(i[r]={value:l(s,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,i)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(s,i){return i===s.getSourceId()}endDrag(){}constructor(s){this.config=s,this.item={},this.initializeExposedProperties()}}const rk="__NATIVE_FILE__",ak="__NATIVE_URL__",lk="__NATIVE_TEXT__",ck="__NATIVE_HTML__",w_=Object.freeze(Object.defineProperty({__proto__:null,FILE:rk,HTML:ck,TEXT:lk,URL:ak},Symbol.toStringTag,{value:"Module"}));function tg(a,s,i){const r=s.reduce((l,c)=>l||a.getData(c),"");return r??i}const Hg={[rk]:{exposeProperties:{files:a=>Array.prototype.slice.call(a.files),items:a=>a.items,dataTransfer:a=>a},matchesTypes:["Files"]},[ck]:{exposeProperties:{html:(a,s)=>tg(a,s,""),dataTransfer:a=>a},matchesTypes:["Html","text/html"]},[ak]:{exposeProperties:{urls:(a,s)=>tg(a,s,"").split(` +`),dataTransfer:a=>a},matchesTypes:["Url","text/uri-list"]},[lk]:{exposeProperties:{text:(a,s)=>tg(a,s,""),dataTransfer:a=>a},matchesTypes:["Text","text/plain"]}};function JI(a,s){const i=Hg[a];if(!i)throw new Error(`native type ${a} has no configuration`);const r=new YI(i);return r.loadDataTransfer(s),r}function sg(a){if(!a)return null;const s=Array.prototype.slice.call(a.types||[]);return Object.keys(Hg).filter(i=>{const r=Hg[i];return r!=null&&r.matchesTypes?r.matchesTypes.some(l=>s.indexOf(l)>-1):!1})[0]||null}const qI=nk(()=>/firefox/i.test(navigator.userAgent)),uk=nk(()=>!!window.safari);class k_{interpolate(s){const{xs:i,ys:r,c1s:l,c2s:c,c3s:d}=this;let h=i.length-1;if(s===i[h])return r[h];let p=0,f=d.length-1,b;for(;p<=f;){b=Math.floor(.5*(p+f));const v=i[b];if(vs)f=b-1;else return r[b]}h=Math.max(0,f);const y=s-i[h],w=y*y;return r[h]+l[h]*y+c[h]*w+d[h]*y*w}constructor(s,i){const{length:r}=s,l=[];for(let v=0;vs[v]{let W=new k_([0,.5,1],[p.y,p.y/b*_,p.y+_-b]).interpolate(w);return uk()&&c&&(W+=(window.devicePixelRatio-1)*_),W},S=()=>new k_([0,.5,1],[p.x,p.x/f*v,p.x+v-f]).interpolate(y),{offsetX:T,offsetY:E}=l,D=T===0||T,M=E===0||E;return{x:D?T:S(),y:M?E:$()}}let tx=class{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var s;return!((s=this.globalContext)===null||s===void 0)&&s.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var s;return((s=this.optionsArgs)===null||s===void 0?void 0:s.rootElement)||this.window}constructor(s,i){this.ownerDocument=null,this.globalContext=s,this.optionsArgs=i}};function sx(a,s,i){return s in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function C_(a){for(var s=1;s{this.sourcePreviewNodes.delete(s),this.sourcePreviewNodeOptions.delete(s)}}connectDragSource(s,i,r){this.sourceNodes.set(s,i),this.sourceNodeOptions.set(s,r);const l=d=>this.handleDragStart(d,s),c=d=>this.handleSelectStart(d);return i.setAttribute("draggable","true"),i.addEventListener("dragstart",l),i.addEventListener("selectstart",c),()=>{this.sourceNodes.delete(s),this.sourceNodeOptions.delete(s),i.removeEventListener("dragstart",l),i.removeEventListener("selectstart",c),i.setAttribute("draggable","false")}}connectDropTarget(s,i){const r=d=>this.handleDragEnter(d,s),l=d=>this.handleDragOver(d,s),c=d=>this.handleDrop(d,s);return i.addEventListener("dragenter",r),i.addEventListener("dragover",l),i.addEventListener("drop",c),()=>{i.removeEventListener("dragenter",r),i.removeEventListener("dragover",l),i.removeEventListener("drop",c)}}addEventListeners(s){s.addEventListener&&(s.addEventListener("dragstart",this.handleTopDragStart),s.addEventListener("dragstart",this.handleTopDragStartCapture,!0),s.addEventListener("dragend",this.handleTopDragEndCapture,!0),s.addEventListener("dragenter",this.handleTopDragEnter),s.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),s.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),s.addEventListener("dragover",this.handleTopDragOver),s.addEventListener("dragover",this.handleTopDragOverCapture,!0),s.addEventListener("drop",this.handleTopDrop),s.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(s){s.removeEventListener&&(s.removeEventListener("dragstart",this.handleTopDragStart),s.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),s.removeEventListener("dragend",this.handleTopDragEndCapture,!0),s.removeEventListener("dragenter",this.handleTopDragEnter),s.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),s.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),s.removeEventListener("dragover",this.handleTopDragOver),s.removeEventListener("dragover",this.handleTopDragOverCapture,!0),s.removeEventListener("drop",this.handleTopDrop),s.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const s=this.monitor.getSourceId(),i=this.sourceNodeOptions.get(s);return C_({dropEffect:this.altKeyPressed?"copy":"move"},i||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const s=this.monitor.getSourceId(),i=this.sourcePreviewNodeOptions.get(s);return C_({anchorX:.5,anchorY:.5,captureDraggingState:!1},i||{})}isDraggingNativeItem(){const s=this.monitor.getItemType();return Object.keys(w_).some(i=>w_[i]===s)}beginDragNativeItem(s,i){this.clearCurrentDragSourceNode(),this.currentNativeSource=JI(s,i),this.currentNativeHandle=this.registry.addSource(s,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(s){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=s;const i=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},i)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var s;(s=this.window)===null||s===void 0||s.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(s,i){s.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(i))}handleDragEnter(s,i){this.dragEnterTargetIds.unshift(i)}handleDragOver(s,i){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(i)}handleDrop(s,i){this.dropTargetIds.unshift(i)}constructor(s,i,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=l=>{const c=this.sourceNodes.get(l);return c&&dk(c)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=l=>!!(l&&this.document&&this.document.body&&this.document.body.contains(l)),this.endDragIfSourceWasRemovedFromDOM=()=>{const l=this.currentDragSourceNode;l==null||this.isNodeInDocument(l)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=l=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(l||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=l=>{if(l.defaultPrevented)return;const{dragStartSourceIds:c}=this;this.dragStartSourceIds=null;const d=nc(l);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(c||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:d});const{dataTransfer:h}=l,p=sg(h);if(this.monitor.isDragging()){if(h&&typeof h.setDragImage=="function"){const b=this.monitor.getSourceId(),y=this.sourceNodes.get(b),w=this.sourcePreviewNodes.get(b)||y;if(w){const{anchorX:v,anchorY:_,offsetX:$,offsetY:S}=this.getCurrentSourcePreviewNodeOptions(),D=ex(y,w,d,{anchorX:v,anchorY:_},{offsetX:$,offsetY:S});h.setDragImage(w,D.x,D.y)}}try{h==null||h.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(l.target);const{captureDraggingState:f}=this.getCurrentSourcePreviewNodeOptions();f?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(p)this.beginDragNativeItem(p);else{if(h&&!h.types&&(l.target&&!l.target.hasAttribute||!l.target.hasAttribute("draggable")))return;l.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=l=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var c;(c=this.currentNativeSource)===null||c===void 0||c.loadDataTransfer(l.dataTransfer)}if(!this.enterLeaveCounter.enter(l.target)||this.monitor.isDragging())return;const{dataTransfer:h}=l,p=sg(h);p&&this.beginDragNativeItem(p,h)},this.handleTopDragEnter=l=>{const{dragEnterTargetIds:c}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=l.altKey,c.length>0&&this.actions.hover(c,{clientOffset:nc(l)}),c.some(h=>this.monitor.canDropOnTarget(h))&&(l.preventDefault(),l.dataTransfer&&(l.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=l=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var c;(c=this.currentNativeSource)===null||c===void 0||c.loadDataTransfer(l.dataTransfer)}},this.handleTopDragOver=l=>{const{dragOverTargetIds:c}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){l.preventDefault(),l.dataTransfer&&(l.dataTransfer.dropEffect="none");return}this.altKeyPressed=l.altKey,this.lastClientOffset=nc(l),this.scheduleHover(c),(c||[]).some(h=>this.monitor.canDropOnTarget(h))?(l.preventDefault(),l.dataTransfer&&(l.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?l.preventDefault():(l.preventDefault(),l.dataTransfer&&(l.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=l=>{this.isDraggingNativeItem()&&l.preventDefault(),this.enterLeaveCounter.leave(l.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=l=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var c;l.preventDefault(),(c=this.currentNativeSource)===null||c===void 0||c.loadDataTransfer(l.dataTransfer)}else sg(l.dataTransfer)&&l.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=l=>{const{dropTargetIds:c}=this;this.dropTargetIds=[],this.actions.hover(c,{clientOffset:nc(l)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=l=>{const c=l.target;typeof c.dragDrop=="function"&&(c.tagName==="INPUT"||c.tagName==="SELECT"||c.tagName==="TEXTAREA"||c.isContentEditable||(l.preventDefault(),c.dragDrop()))},this.options=new tx(i,r),this.actions=s.getActions(),this.monitor=s.getMonitor(),this.registry=s.getRegistry(),this.enterLeaveCounter=new KI(this.isNodeInDocument)}}const hk=function(s,i,r){return new ox(s,i,r)},ix=$t([m.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),m.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"AccessTime"),nx=$t(m.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox"),rx=$t(m.jsx("path",{d:"M4 8h4V4H4zm6 12h4v-4h-4zm-6 0h4v-4H4zm0-6h4v-4H4zm6 0h4v-4h-4zm6-10v4h4V4zm-6 4h4V4h-4zm6 6h4v-4h-4zm0 6h4v-4h-4z"}),"Apps"),ax=$t(m.jsx("path",{d:"M9 2c-1.05 0-2.05.16-3 .46 4.06 1.27 7 5.06 7 9.54s-2.94 8.27-7 9.54c.95.3 1.95.46 3 .46 5.52 0 10-4.48 10-10S14.52 2 9 2"}),"Brightness3"),lx=$t(m.jsx("path",{d:"M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5s-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20zm-6 8h-4v-2h4zm0-4h-4v-2h4z"}),"BugReport"),cx=$t(m.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm-1 4 6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2zm-1 7h5.5L14 6.5z"}),"FileCopy"),ux=$t(m.jsx("path",{d:"M7 2v11h3v9l7-12h-4l4-8z"}),"FlashOn"),dx=$t(m.jsx("path",{d:"M3.27 5 2 6.27l6.97 6.97L6.5 19h3l1.57-3.66L16.73 21 18 19.73 3.55 5.27zM6 5v.18L8.82 8h2.4l-.72 1.68 2.1 2.1L14.21 8H20V5z"}),"FormatClear"),hx=$t(m.jsx("path",{d:"M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z"}),"Functions"),pk=$t(m.jsx("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutline"),px=$t(m.jsx("path",{d:"M21 3.01H3c-1.1 0-2 .9-2 2V9h2V4.99h18v14.03H3V15H1v4.01c0 1.1.9 1.98 2 1.98h18c1.1 0 2-.88 2-1.98v-14c0-1.11-.9-2-2-2M11 16l4-4-4-4v3H1v2h10z"}),"Input"),T_=$t(m.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"}),"Lock"),gx=$t(m.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert"),mx=$t(m.jsx("path",{d:"M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10c1.38 0 2.5-1.12 2.5-2.5 0-.61-.23-1.2-.64-1.67-.08-.1-.13-.21-.13-.33 0-.28.22-.5.5-.5H16c3.31 0 6-2.69 6-6 0-4.96-4.49-9-10-9m5.5 11c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m-3-4c-.83 0-1.5-.67-1.5-1.5S13.67 6 14.5 6s1.5.67 1.5 1.5S15.33 9 14.5 9M5 11.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5S7.33 13 6.5 13 5 12.33 5 11.5m6-4c0 .83-.67 1.5-1.5 1.5S8 8.33 8 7.5 8.67 6 9.5 6s1.5.67 1.5 1.5"}),"Palette"),bc=$t(m.jsx("path",{d:"M6 19h4V5H6zm8-14v14h4V5z"}),"Pause"),Wg=$t(m.jsx("path",{d:"M8 5v14l11-7z"}),"PlayArrow"),fx=$t(m.jsx("path",{d:"M11 5v5.59H7.5l4.5 4.5 4.5-4.5H13V5zm-5 9c0 3.31 2.69 6 6 6s6-2.69 6-6h-2c0 2.21-1.79 4-4 4s-4-1.79-4-4z"}),"PlayForWork"),$x=$t(m.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search"),bx=$t(m.jsx("path",{d:"M10.59 9.17 5.41 4 4 5.41l5.17 5.17zM14.5 4l2.04 2.04L4 18.59 5.41 20 17.96 7.46 20 9.5V4zm.33 9.41-1.41 1.41 3.13 3.13L14.5 20H20v-5.5l-2.04 2.04z"}),"Shuffle"),vx=$t(m.jsx("path",{d:"M2 20h20v-4H2zm2-3h2v2H4zM2 4v4h20V4zm4 3H4V5h2zm-4 7h20v-4H2zm2-3h2v2H4z"}),"Storage"),yx=$t(m.jsx("path",{d:"M14 17H4v2h10zm6-8H4v2h16zM4 15h16v-2H4zM4 5v2h16V5z"}),"Subject"),_x=$t(m.jsx("path",{d:"M16 17.01V10h-2v7.01h-3L15 21l4-3.99zM9 3 5 6.99h3V14h2V6.99h3z"}),"SwapVert"),wx=$t(m.jsx("path",{d:"M7.41 18.59 8.83 20 12 16.83 15.17 20l1.41-1.41L12 14zm9.18-13.18L15.17 4 12 7.17 8.83 4 7.41 5.41 12 10z"}),"UnfoldLess"),kx=$t(m.jsx("path",{d:"M12 5.83 15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15z"}),"UnfoldMore"),Tc="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='512'%20height='512'%20shape-rendering='geometricPrecision'%20image-rendering='optimizeQuality'%20fill-rule='evenodd'%20xmlns:v='https://vecta.io/nano'%3e%3cpath%20fill='%23efda4e'%20d='M-.5-.5h512v512H-.5V-.5z'/%3e%3cpath%20fill='%23020100'%20d='M308.5%20287.5c1.777-3.005%202.777-6.338%203-10%209.147-21.963%2025.48-35.463%2049-40.5%2021.999-4.173%2043.666-2.84%2065%204%2014.575%205.411%2025.575%2014.911%2033%2028.5l-1%202c-12.413%205.624-24.58%2011.624-36.5%2018-5.321-8.25-12.821-13.417-22.5-15.5-13.957-3.122-27.29-1.455-40%205-8.125%205.36-10.958%2012.86-8.5%2022.5%203.223%206.223%208.057%2010.723%2014.5%2013.5l64%2020c38.459%2016.085%2052.626%2044.585%2042.5%2085.5-7.572%2026.208-24.738%2042.041-51.5%2047.5-25.102%205.733-49.768%204.4-74-4-19.291-8.625-32.291-22.958-39-43%2011.266-8.887%2023.433-16.387%2036.5-22.5%203.117%206.896%206.784%2013.563%2011%2020%2012.705%2012.307%2027.872%2016.807%2045.5%2013.5%2022.189-3.504%2032.355-16.338%2030.5-38.5-2.833-6.833-7.667-11.667-14.5-14.5l-57-17c-36.004-11.84-52.67-36.673-50-74.5z'/%3e%3cpath%20fill='%23020200'%20d='M222.5%20238.5h43l-.5%20159c-2.688%2052.355-30.188%2076.855-82.5%2073.5-24.871-3.543-41.204-17.21-49-41l.5-2.5a12.14%2012.14%200%200%200%204.5-3.5c10.653-5.825%2021.32-11.325%2032-16.5%204.763%2021.72%2017.763%2028.887%2039%2021.5%204.616-2.618%207.783-6.451%209.5-11.5%201.163-5.968%202.163-11.968%203-18l.5-161z'/%3e%3cpath%20fill='%23615820'%20d='M311.5%20277.5c-.223%203.662-1.223%206.995-3%2010%20.223-3.662%201.223-6.995%203-10z'/%3e%3c/svg%3e",gk="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20500%20500'%3e%3cpath%20fill='%234285f4'%20d='M44.271%2027.275l206.5%201v170l-58.5-36.5c-7.005-.916-12.505%201.584-16.5%207.5v147c4.625%204.412%2010.125%206.245%2016.5%205.5l57.5-35.5c.833%2054.003%201.356%20108.003.189%20162-1.272.546-45.599-.242-48.689%201.121-3.674%207.844-4.79%2011.207-13%2023.879-4.372%205.527-2.19%204.097-10.689%2012.258-5.166%202.748-4.191%203.45-14.311%206.242-17.67%201.983-35.336%201.983-53%200-9.535-3.774-10.879-4.163-18.526-11.22-5.562-4.39-11.131-11.803-11.974-15.28-4.068-7.881-3.42-9.116-5.5-13.5-3.672-1.503-35.798.203-40.746-1.335-5.823-2.314-2.946-.422-7.954-3.689-2.888-2.668-2.255-3.221-2.421-9.904L20.771%2050.275c.36-2.108-.41-5.806%202.522-11.615%204.343-5.852%205.374-7%2010.061-9.146%206.083-2.73%208.677-1.475%2010.917-2.239z'/%3e%3cpath%20d='M258.271%2030.275l154.63.407c5.654.559%2010.783%203.17%2014.37%207.093%204.907%204.408%206.204%208.723%207.5%2013.5v373c-.208%205.716-.297%207.982-4.848%2015.404-7.078%206.393-9.879%206.39-15.652%206.692-24.804%201.296-50.079%201.189-74.96%201.041-24.516-.014-68.46.89-81.5.391l-2.512-172.528c-20.083%2012.625-42.777%2025.125-63.028%2037.5-4.127%201.292-7.294.125-9.5-3.5l1-137c1.864-2.707%204.364-3.541%207.5-2.5%2020.366%2013.427%2064.35%2038.947%2065.581%2038.339l1.419-177.839z'%20fill='%23DDD'/%3e%3c/svg%3e",mk="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20512%20512'%20width='32'%20height='32'%3e%3cpath%20fill='%23007acc'%20d='M-.5-.5h503l-1%20179h10v333h-421v-7h-91V-.5z'/%3e%3cpath%20fill='%230f81cf'%20d='M502.5-.5h9v179h-10l1-179z'/%3e%3cpath%20fill='%23fdfefe'%20d='M470.5%20227.5c.33%2017.508-.003%2034.841-1%2052-23.486-15.709-48.82-19.875-76-12.5-15.89%208.078-19.39%2019.911-10.5%2035.5%204.673%205.577%2010.173%2010.077%2016.5%2013.5l38%2019c17.945%209.278%2031.112%2023.112%2039.5%2041.5%201.352%203.22%202.186%206.553%202.5%2010a305.16%20305.16%200%200%201%201%2026c-3.553%2033.726-21.886%2054.559-55%2062.5-34.769%207.363-68.435%204.196-101-9.5-.167-19.003%200-38.003.5-57%2022.903%2021.314%2049.736%2029.147%2080.5%2023.5%2019.435-5.701%2025.268-17.868%2017.5-36.5-4.718-6.44-10.552-11.606-17.5-15.5a1552.42%201552.42%200%200%201-47-24c-27.679-19.331-38.846-45.831-33.5-79.5%206.43-26.433%2022.597-43.933%2048.5-52.5%2026.131-6.625%2052.464-7.292%2079-2a565.56%20565.56%200%200%201%2018%205.5z'/%3e%3cpath%20fill='%23fefefe'%20d='M122.5%20222.5h182v46h-65v206h-52v-206h-65v-46z'/%3e%3cpath%20fill='%2370b3e1'%20d='M470.5%20227.5c1.327%2017.505%201.327%2035.171%200%2053-.607-.124-.94-.457-1-1%20.997-17.159%201.33-34.492%201-52z'/%3e%3cpath%20fill='%236cafe0'%20d='M479.5%20386.5c1.465%205.09%202.132%2010.423%202%2016-.002%203.518-.335%206.851-1%2010a305.16%20305.16%200%200%200-1-26z'/%3e%3cpath%20fill='%231283cf'%20d='M-.5%20504.5h91v7h-91v-7z'/%3e%3c/svg%3e",fk="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIj4KICAgIDxyYWRpYWxHcmFkaWVudCBpZD0ibXlHcmFkaWVudCI+CiAgICAgICAgPHN0b3Agb2Zmc2V0PSIxMCUiIHN0b3AtY29sb3I9IiMxQzJENUYiIC8+CiAgICAgICAgPHN0b3Agb2Zmc2V0PSI5NSUiIHN0b3AtY29sb3I9IiMwQjFENTMiIC8+CiAgICA8L3JhZGlhbEdyYWRpZW50PgogICAgPHBhdGggZmlsbD0idXJsKCcjbXlHcmFkaWVudCcpIiBkPSJNLS4xLS4xaDUxMnY1MTJILS4xVi0uMXoiLz4KICAgIDxwYXRoIGZpbGw9IiNmOGY4ZmEiCiAgICAgICAg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TZhZGMwIiBkPSJNMzQ0LjUgMjQ3LjVoNDV2MThoLTQ1YzE0LjQ5LS45OTYgMjkuMTU3LTEuMzI5IDQ0LTF2LTE2Yy0xNC44NDMuMzI5LTI5LjUxLS4wMDQtNDQtMXoiLz4KICAgIDxwYXRoIGZpbGw9IiNhMmE5YmUiIGQ9Ik00MjguNSAyNzUuNWgtMjV2OGMtLjk3Ny0yLjc4Ny0xLjMxLTUuNzg3LTEtOSA4Ljg0OS0uMzI2IDE3LjUxNi4wMDcgMjYgMXoiLz4KICAgIDxwYXRoIGZpbGw9IiNhNWFjYmYiCiAgICAgICAgICBkPSJNMTEzLjUgMzAxLjVjLjk3OC4zMTEgMS42NDUuOTc4IDIgMmwtMTYgMWMtNS43MTEtLjAwNS0xMS4wNDQtLjY3Mi0xNi0yYTEyOC4xOSAxMjguMTkgMCAwIDAgMTUuNSAxYzUuMjE2LS4wMDYgMTAuMDQ5LS42NzMgMTQuNS0yeiIvPgogICAgPHBhdGggZmlsbD0iI2E1YWNjMCIgZD0iTTIzMy41IDIwOS41djk0aDY5di0xN2MtMTMuNTEuMzI5LTI2Ljg0NC0uMDA0LTQwLTFoNDF2MTloLTcxYTIyNTYuNDEgMjI1Ni40MSAwIDAgMSAxLTk1eiIvPgogICAgPHBhdGggZmlsbD0iI2E2YWNjMCIKICAgICAgICAgIGQ9Ik0zMTYuNSAyMDkuNWMtLjk5OCAzMS4xNjItMS4zMzIgNjIuNDk2LTEgOTRoNzN2LTE3Yy0xNC44NDMuMzI5LTI5LjUxLS4wMDQtNDQtMWg0NXYxOWgtNzVhMjMwNC45NSAyMzA0Ljk1IDAgMCAxIDEtOTZjLjYwNy4xMjQuOTQuNDU3IDEgMXoiLz4KPC9zdmc+";class _m extends _e.Component{isShowInstance;oldId;constructor(s){super(s),this.state={name:s.name,id:s.id,instance:s.instance||0,prefix:_m.getPrefix(s.id)},this.isShowInstance=!s.folder&&!!s.instances&&(!!s.instance||!!s.instances[0]||s.instances.length>1),this.oldId=s.id}static getPrefix(s){const i=(s||"").split(".");return i.pop(),i.join(".")}getId(s){return s=(s||"").replace(/[\\/\][*,;'"`<>?\s]/g,"_"),`${this.state.prefix}.${s}`}handleCancel=()=>{this.props.onClose()};handleOk=()=>{this.props.onRename(this.oldId,this.state.id,this.state.name,this.state.instance===0?0:this.state.instance||void 0),this.props.onClose()};handleChange=s=>{this.setState({name:s,id:this.getId(s)})};render(){return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"md",fullWidth:!0,open:!0,"aria-labelledby":"confirmation-dialog-title",children:[m.jsx(ss,{id:"confirmation-dialog-title",children:x.I18n.t("Rename")}),m.jsx(qt,{children:m.jsxs("form",{noValidate:!0,autoComplete:"off",children:[m.jsx(Eo,{variant:"standard",style:{width:"100%"},id:"standard-name",autoFocus:!0,label:x.I18n.t("Name"),value:this.state.name,onKeyUp:s=>{s.key==="Enter"&&(s.preventDefault(),setTimeout(()=>this.handleOk(),200))},onChange:s=>this.handleChange(s.target.value),margin:"normal"}),m.jsx(Eo,{variant:"standard",id:"standard-name-id",style:{width:"100%"},label:x.I18n.t("ID"),value:this.state.id,disabled:!0,margin:"normal"}),this.isShowInstance&&m.jsxs(Di,{variant:"standard",children:[m.jsx(Ag,{htmlFor:"instance",children:x.I18n.t("Instance")}),m.jsx(Ai,{variant:"standard",value:this.state.instance,onChange:s=>this.setState({instance:parseInt(s.target.value,10)}),inputProps:{name:"instance",id:"instance"},children:this.props.instances.map(s=>m.jsx(it,{value:s,children:s||"0"},s))})]})]})}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",onClick:this.handleOk,color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Ok")}),m.jsx(He,{color:"grey",variant:"contained",onClick:this.handleCancel,startIcon:m.jsx(so,{}),children:x.I18n.t("Cancel")})]})]})}}class Cx extends _e.Component{constructor(s){super(s),this.state={name:s.name,id:s.id}}handleCancel=()=>{this.props.onClose()};handleOk=()=>{this.props.onDelete(this.state.id),this.props.onClose()};render(){return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"md",open:!0,"aria-labelledby":"confirmation-dialog-title",children:[m.jsx(ss,{id:"confirmation-dialog-title",children:x.I18n.t("Are you sure?")}),m.jsxs(qt,{children:[m.jsx(mc,{}),m.jsx("span",{style:{fontSize:14,fontWeight:"bold"},children:x.I18n.t("Delete %s",this.state.name)})]}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",onClick:this.handleOk,color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Ok")}),m.jsx(He,{color:"grey",variant:"contained",onClick:this.handleCancel,startIcon:m.jsx(so,{}),children:x.I18n.t("Cancel")})]})]})}}const Tx=""+new URL("tileJS-C48gYbHw.png",import.meta.url).href,Sx=""+new URL("tileTS-CsXmgy4B.png",import.meta.url).href,Ex=""+new URL("tileBlockly-BMpdinN3.png",import.meta.url).href,Ix=""+new URL("tileRules-BkbaFIhs.png",import.meta.url).href,jt={card:{maxWidth:345,minWidth:250,display:"inline-block",margin:"0 10px 0 10px"},media:{height:122},text:{maxWidth:218,minHeight:30},complexity:{fontWeight:"bold",fontStyle:"italic",marginBottom:8}};class Dn extends _e.Component{handleCancel=()=>{this.props.onClose()};static openHtml(s){const i=x.I18n.getLanguage();!s.includes("javascript.md")&&(i==="de"||i==="ru")&&(s=s.replace(/\/en\//,`/${i}/`));const r=window.open(s,"_blank");r==null||r.focus()}getJSCard(){return m.jsxs(Xl,{style:jt.card,children:[m.jsxs(Zl,{onClick:()=>this.props.onClose&&this.props.onClose("Javascript/js"),children:[m.jsx(Ql,{style:jt.media,image:Tx,title:"JavaScript"}),m.jsxs(ec,{children:[m.jsx("h2",{children:"JavaScript"}),m.jsx("div",{style:jt.complexity,children:x.I18n.t("for programmers")}),m.jsx("div",{style:jt.text,children:x.I18n.t("JS description")})]})]}),m.jsxs(tc,{children:[m.jsx(He,{size:"small",color:"primary",variant:"contained",onClick:()=>this.props.onClose&&this.props.onClose("Javascript/js"),children:x.I18n.t("Add")}),m.jsx(He,{size:"small",color:"secondary",onClick:()=>Dn.openHtml("https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/javascript.md"),children:x.I18n.t("Learn More")})]})]})}getTSCard(){return m.jsxs(Xl,{style:jt.card,children:[m.jsxs(Zl,{onClick:()=>this.props.onClose&&this.props.onClose("TypeScript/ts"),children:[m.jsx(Ql,{style:jt.media,image:Sx,title:"TypeScript"}),m.jsxs(ec,{children:[m.jsx("h2",{children:"TypeScript"}),m.jsx("div",{style:jt.complexity,children:x.I18n.t("for professionals")}),m.jsx("div",{style:jt.text,children:x.I18n.t("TS description")})]})]}),m.jsxs(tc,{children:[m.jsx(He,{size:"small",color:"primary",variant:"contained",onClick:()=>this.props.onClose&&this.props.onClose("TypeScript/ts"),children:x.I18n.t("Add")}),m.jsx(He,{size:"small",color:"secondary",onClick:()=>Dn.openHtml("https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/javascript.md"),children:x.I18n.t("Learn More")})]})]})}getBlocklyCard(){return m.jsxs(Xl,{style:jt.card,children:[m.jsxs(Zl,{onClick:()=>this.props.onClose&&this.props.onClose("Blockly"),children:[m.jsx(Ql,{style:jt.media,image:Ex,title:"Blockly"}),m.jsxs(ec,{children:[m.jsx("h2",{children:"Blockly"}),m.jsx("div",{style:jt.complexity,children:x.I18n.t("normal")}),m.jsx("div",{style:jt.text,children:x.I18n.t("Blockly description")})]})]}),m.jsxs(tc,{children:[m.jsx(He,{size:"small",color:"primary",variant:"contained",onClick:()=>this.props.onClose&&this.props.onClose("Blockly"),children:x.I18n.t("Add")}),m.jsx(He,{size:"small",color:"secondary",onClick:()=>Dn.openHtml("https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/blockly.md"),children:x.I18n.t("Learn More")})]})]})}getRulesCard(){return m.jsxs(Xl,{style:jt.card,children:[m.jsxs(Zl,{onClick:()=>this.props.onClose&&this.props.onClose("Rules"),children:[m.jsx(Ql,{style:jt.media,image:Ix,title:"Rules"}),m.jsxs(ec,{children:[m.jsx("h2",{children:"Rules"}),m.jsx("div",{style:jt.complexity,children:x.I18n.t("easy")}),m.jsx("div",{style:jt.text,children:x.I18n.t("Rules description")})]})]}),m.jsxs(tc,{children:[m.jsx(He,{size:"small",color:"primary",variant:"contained",onClick:()=>this.props.onClose&&this.props.onClose("Rules"),children:x.I18n.t("Add")}),m.jsx(He,{size:"small",color:"secondary",onClick:()=>Dn.openHtml("https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/javascript.md"),children:x.I18n.t("Learn More")})]})]})}render(){return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"lg",fullWidth:!0,open:!0,"aria-labelledby":"confirmation-dialog-title",children:[m.jsx(ss,{id:"confirmation-dialog-title",children:x.I18n.t("Add new script")}),m.jsxs(qt,{style:{textAlign:"center"},children:[this.getRulesCard(),this.getBlocklyCard(),this.getJSCard(),this.getTSCard()]}),m.jsx(Ht,{children:m.jsx(He,{color:"grey",onClick:this.handleCancel,startIcon:m.jsx(so,{}),children:x.I18n.t("Cancel")})})]})}}class og extends _e.Component{isShowInstance;constructor(s){super(s),this.state={name:s.name||"Script",instance:s.instance||0,parent:s.parent,error:"",id:""},this.isShowInstance=!s.folder&&!!s.instances&&(!!s.instance||!!s.instances[0]||s.instances.length>1)}getId(s){return s=s||this.state.name||"",s=s.replace(/[\\/\][.*,;'"`<>?\s]/g,"_").trim().replace(/\.$/,"_"),`${this.state?this.state.parent:this.props.parent}.${s}`}handleOk=()=>{this.props.onAdd(this.getId(this.state.name),this.state.name,this.state.instance,this.props.type),this.props.onClose()};render(){var s;return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"md",fullWidth:!0,open:!0,"aria-labelledby":"confirmation-dialog-title",children:[m.jsx(ss,{id:"confirmation-dialog-title",children:this.props.title||x.I18n.t("Create new")}),m.jsx(qt,{children:m.jsxs("form",{noValidate:!0,autoComplete:"off",children:[m.jsx(Eo,{variant:"standard",style:{width:"100%"},id:"standard-name",autoFocus:!0,error:!!this.state.error,label:x.I18n.t("Name"),value:this.state.name||"",helperText:this.state.error,slotProps:{input:{endAdornment:this.state.name?m.jsx(qe,{size:"small",onClick:()=>this.setState({name:""}),children:m.jsx(ZT,{})}):void 0}},onKeyUp:i=>{i.preventDefault(),i.key==="Enter"&&!this.state.error&&setTimeout(()=>this.handleOk(),200)},onChange:i=>{var c;const r=i.target.value,l=this.getId(r);r?(c=this.props.existingItems)!=null&&c.includes(l)?this.setState({name:r,id:l,error:x.I18n.t("Duplicate name")}):this.setState({name:r,id:l,error:""}):this.setState({name:r,id:l,error:x.I18n.t("Empty name is not allowed")})},margin:"normal"}),m.jsxs(Di,{variant:"standard",style:{width:"100%"},children:[m.jsx(Ag,{htmlFor:"parent",children:x.I18n.t("Folder")}),m.jsx(Ai,{variant:"standard",style:{width:"100%"},value:this.state.parent,onChange:i=>this.setState({parent:i.target.value}),inputProps:{name:"parent",id:"parent"},children:this.props.parents.map(i=>{const r=i.id.split(".");r.splice(0,2);const l=[];let c="script.js";return r.forEach(d=>{c+=`.${d}`;const h=this.props.parents.find(p=>p.id===c);h?l.push(h.name):l.push(d)}),l.length||l.push(i.name),m.jsx(it,{value:i.id,children:l.join(" / ")},i.id)})})]}),m.jsx(Eo,{variant:"standard",id:"standard-name-id",style:{width:"100%"},label:x.I18n.t("ID"),value:this.getId(),disabled:!0,margin:"normal"}),this.isShowInstance&&m.jsxs(Di,{variant:"standard",children:[m.jsx(Ag,{htmlFor:"instance",children:x.I18n.t("Instance")}),m.jsx(Ai,{variant:"standard",value:this.state.instance,onChange:i=>this.setState({instance:parseInt(i.target.value,10)}),inputProps:{name:"instance",id:"instance"},children:(s=this.props.instances)==null?void 0:s.map(i=>m.jsx(it,{value:i,children:i||"0"},`instance${i}`))})]})]})}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",onClick:this.handleOk,disabled:!!this.state.error,color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Ok")}),m.jsx(He,{color:"grey",variant:"contained",onClick:()=>this.props.onClose(),startIcon:m.jsx(so,{}),children:x.I18n.t("Cancel")})]})]})}}const xx={title:a=>({background:a.palette.error.main,color:a.palette.error.contrastText,"&>h2":{color:a.palette.error.contrastText}})};class su extends _e.Component{handleOk=()=>{this.props.onClose()};render(){return m.jsxs(Ut,{open:!0,maxWidth:"sm",fullWidth:!0,onClose:()=>this.handleOk(),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[m.jsx(ss,{sx:xx.title,id:"alert-dialog-title",children:this.props.title||x.I18n.t("Error")}),m.jsx(qt,{children:m.jsx(Dw,{id:"alert-dialog-description",children:this.props.text||x.I18n.t("Unknown error!")})}),m.jsx(Ht,{children:m.jsx(He,{variant:"contained",onClick:()=>this.handleOk(),color:"primary",autoFocus:!0,startIcon:m.jsx(qo,{}),children:x.I18n.t("Ok")})})]})}}const zr={icon:{width:24,height:24},filterWithButton:{width:"100%"},title:{fontWeight:"bold",marginTop:16}};class Dx extends _e.Component{constructor(s){super(s),this.state={instances:[],filter:window.localStorage.getItem("javascript.debug.filter")||"",showAskForStop:!1,jsInstance:window.localStorage.getItem("javascript.debug.instance")||"",jsInstanceHost:"",adapterToDebug:window.localStorage.getItem("javascript.debug.adapter")||""}}componentDidMount(){this.props.socket.getAdapterInstances().then(s=>{const i=s.filter(h=>{var p;return h&&!((p=h.common)!=null&&p.onlyWWW)}).map(h=>{var b,y,w;const p=h._id.replace(/^system\.adapter\./,""),[f]=p.split(".");return{id:p,enabled:(b=h.common)==null?void 0:b.enabled,host:(y=h.common)==null?void 0:y.host,icon:(w=h.common)!=null&&w.icon?`../../adapter/${f}/${h.common.icon}`:""}});i.sort((h,p)=>h.id>p.id?1:h.idh.id===this.state.jsInstance):null;let c;if(!this.state.jsInstance||!l){const h=i.find(p=>p.id.startsWith("javascript."));c=(h==null?void 0:h.host)||"",r=(h==null?void 0:h.id)||""}else c=(l==null?void 0:l.host)||"";let d=this.state.adapterToDebug||"";d&&!i.find(h=>h.id===d)&&(d=""),this.setState({instances:i,jsInstance:r,adapterToDebug:d,jsInstanceHost:c})})}handleOk=()=>{var s;if((s=this.state.instances.find(i=>i.id===this.state.adapterToDebug))!=null&&s.enabled){this.props.socket.getObject(`system.adapter.${this.state.adapterToDebug}`).then(i=>{i&&(i.common.enabled=!1,this.props.socket.setObject(i._id,i).then(()=>this.props.onDebug(this.state.jsInstance,this.state.adapterToDebug)))});return}this.props.onDebug(this.state.jsInstance,this.state.adapterToDebug)};renderJavascriptList(){const s=this.state.instances.filter(i=>i.id.startsWith("javascript."));return s.length<2?null:m.jsxs(Si,{children:[m.jsx("div",{style:zr.title,children:x.I18n.t("Host")}),m.jsx(Og,{component:"nav",children:s.map(i=>m.jsxs(s_,{component:"div",selected:this.state.jsInstance===i.id,onClick:()=>this.setState({jsInstance:i.id,jsInstanceHost:i.host}),children:[m.jsx(Rg,{children:m.jsx("img",{src:i.icon,alt:i.id,style:zr.icon})}),m.jsx(Ng,{primary:i.id})]},i.id))})]})}renderInstances(){if(!this.state.jsInstance)return m.jsx(Si,{});const s=this.state.instances.filter(i=>i.id!==this.state.jsInstance&&i.host===this.state.jsInstanceHost&&(!this.state.filter||i.id.includes(this.state.filter.toLowerCase())));return m.jsxs(Si,{children:[m.jsx("div",{style:zr.title,children:x.I18n.t("Instances")}),m.jsx(Og,{component:"nav",children:s.map(i=>m.jsxs(s_,{selected:this.state.adapterToDebug===i.id,onDoubleClick:()=>this.setState({adapterToDebug:i.id},()=>this.handleOk()),onClick:()=>this.setState({adapterToDebug:i.id}),children:[m.jsx(Rg,{children:m.jsx("img",{src:i.icon,alt:i.id,style:zr.icon})}),m.jsx(Ng,{primary:i.id})]},i.id))})]})}render(){return m.jsxs(Ut,{maxWidth:"md",fullWidth:!1,open:!0,onClose:()=>!1,"aria-labelledby":"confirmation-dialog-title",children:[m.jsx(ss,{id:"confirmation-dialog-title",children:this.props.title||x.I18n.t("Debug instance")}),m.jsx(qt,{children:m.jsxs(Si,{container:!0,direction:"column",children:[m.jsx(Si,{children:m.jsx(Pn,{style:zr.filterWithButton,value:this.state.filter,placeholder:x.I18n.t("Filter"),onChange:s=>{this.setState({filter:s.target.value}),window.localStorage.setItem("javascript.debug.filter",s.target.value)},endAdornment:m.jsx(Aw,{position:"end",children:this.state.filter?m.jsx(qe,{size:"small","aria-label":"toggle password visibility",onClick:()=>this.setState({filter:""}),children:m.jsx(Mw,{})}):""})})}),m.jsx(Si,{children:m.jsxs(Si,{container:!0,children:[this.renderJavascriptList(),this.renderInstances()]})})]})}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",onClick:this.handleOk,disabled:!this.state.jsInstance||!this.state.adapterToDebug,color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Start")}),m.jsx(He,{color:"grey",variant:"contained",onClick:()=>this.props.onClose(),startIcon:m.jsx(so,{}),children:x.I18n.t("Close")})]})]})}}function $k(a){if(!a)throw new Error("Password must be a non-empty string.")}function Gg(a){return new TextEncoder().encode(a)}function Ax(a){return new TextDecoder().decode(a)}function Ox(a){let s="";for(let i=0;i({height:a.toolbar.height}),toolbarButtons:a=>({color:a.palette.mode==="dark"?"white !important":"black !important"}),iconButtonsDisabled:{filter:"grayscale(100%)",opacity:.5},toolbarSearch:{width:"calc(100% - 105px)",lineHeight:"34px",marginLeft:5},iconButtons:{width:32,height:32,padding:2},iconDropdownMenu:{paddingRight:5},menu:{width:"100%",height:"100%"},innerMenu:{width:"100%",height:"calc(100% - 76px)",overflowX:"hidden",overflowY:"auto"},listItemIcon:{minWidth:32},scriptIcon:{width:18,height:18,borderRadius:2,marginTop:4,marginBottom:4,marginLeft:8,marginRight:4},folder:{cursor:"pointer",padding:0,userSelect:"none"},folderReorder:{opacity:.3,transitionDuration:"0.5s",transitionProperty:"opacity"},folderIcon:{width:20,height:20},folderIconReorder:{paddingTop:4,paddingBottom:4,paddingLeft:8,paddingRight:4},folderIconNoReorder:{cursor:"pointer",paddingTop:4,paddingBottom:4,paddingLeft:8,paddingRight:4},script:{cursor:"pointer",padding:0,userSelect:"none"},scriptReorder:{opacity:1,transitionDuration:"0.5s",transitionProperty:"opacity"},reorder:{},selected:window.vendorPrefix?a=>({backgroundColor:a.palette.primary.main,color:a.palette.text.primary}):{backgroundColor:"#164477",color:"white"},instances:{fontSize:"smaller",fontWeight:"bold",marginRight:4},childrenCount:{fontSize:10,opacity:.4},footer:{height:24,display:"flex"},footerButtons:a=>({"& img":{color:a.palette.mode==="dark"?"#ffffff":"#111111",cursor:"pointer",mt:"1px",mr:"2px",height:22,width:22,"&:hover":{backgroundColor:"#dbdbdb"}},"& svg":{color:a.palette.mode==="dark"?"#ffffff":"#111111",cursor:"pointer",mt:"1px",mr:"2px",height:22,width:22,"&:hover":{backgroundColor:"#dbdbdb"}}}),footerButtonsRight:{float:"right"}},Tn={Blockly:gk,"Javascript/js":Tc,def:Tc,Rules:fk,"TypeScript/ts":mk};function Kg(a,s,i){var r;return i=i||x.I18n.getLanguage(),(r=s==null?void 0:s.common)!=null&&r.name?typeof s.common.name=="object"?(s.common.name[i]||s.common.name.en||a.replace(/^script\.js./,"")).toString():s.common.name.toString():a.replace(/^script\.js./,"")}function E_(a){var l;const s=[{id:Jt,depth:0,index:0,parent:null,title:"root",type:"folder",parentIndex:null}],i=Object.keys(a);for(let c=0;c1?h.join("."):null,instance:d.common.engine?parseInt(d.common.engine.split(".").pop(),10)||0:null,index:0,parentIndex:0}):s.push({id:i[c],title:Kg(i[c],d),depth:h.length-1,type:"folder",parent:h.length>1?h.join("."):null,index:0,parentIndex:null})}let r;do r=!1,s.forEach(c=>{if(c.parent&&!s.find(h=>h.id===c.parent)){const h=c.parent.split(".");h.pop(),s.push({id:c.parent,title:c.parent.split(".").pop()||"",depth:h.length-1,type:"folder",parent:h.length>1?h.join("."):null,index:0,parentIndex:null}),r=!0}});while(r);return s.sort((c,d)=>{const h=c.id.toLowerCase(),p=d.id.toLowerCase();return c.type==="folder"&&d.type!=="folder"?-1:d.type==="folder"&&c.type!=="folder"||h>p?1:hc.index=d),s.forEach(c=>{if(c.parent){const d=s.find(h=>h.id===c.parent);d&&(c.parentIndex=d.index)}}),s}function Lx(a){const{onDrop:s}=a,[{isOver:i,isOverAny:r},l]=WI({accept:"script",drop:c=>i?s(c):void 0,collect:c=>({isOver:c.isOver({shallow:!0}),isOverAny:c.isOver()})});return m.jsx("div",{ref:l,style:{background:i?"#40adff":void 0,opacity:r?.7:void 0},children:a.children},a.folderName)}function I_(a){const{name:s}=a,[{opacity:i},r]=LI({type:"script",item:()=>({name:s}),collect:l=>({opacity:l.isDragging()?.3:1})});return m.jsx("div",{ref:r,style:{opacity:i,transform:"translate3d(0, 0, 0)"},children:a.children},s)}class So extends _e.Component{inputRef;filterTimer;problems;problemsTimer;onProblemUpdatedBound;parent=null;constructor(s){super(s);const i=window.localStorage?window.localStorage.getItem("SideMenu.expanded"):"[]";let r;try{r=JSON.parse(i||"[]")||[]}catch{r=[]}this.inputRef=_e.createRef(),this.state={listItems:E_(s.scripts||{}),expanded:r,problems:[],reorder:!1,themeName:this.props.themeName,selected:window.localStorage&&window.localStorage.getItem("SideMenu.selected")||null,creatingScript:null,creatingFolder:!1,copingScript:"",renaming:null,deleting:null,choosingType:!1,errorText:"",instances:s.instances||[],menuOpened:!1,menuAnchorEl:null,menuAnchorFilterEl:null,searchMode:!1,expertMode:this.props.expertMode,searchText:"",width:this.props.width||300,typeFilter:window.localStorage&&window.localStorage.getItem("SideMenu.typeFilter")||"",statusFilter:window.localStorage&&window.localStorage.getItem("SideMenu.statusFilter")||"",runningInstances:this.props.runningInstances||{},scriptsHash:s.scriptsHash,showAdapterDebug:!1,isAllZeroInstances:!1,showExportDialog:!1};const l=this.ensureSelectedIsVisible();l&&Object.assign(this.state,{expanded:l}),this.filterTimer=null,Object.assign(this.state,{isAllZeroInstances:this.getIsAllZeroInstances()}),this.problems=null,this.problemsTimer=null,this.onProblemUpdatedBound=this.onProblemUpdated.bind(this)}readProblems(s,i){var r,l;if(i||(i=Object.keys(this.props.scripts)),!i||!i.length)s&&s();else{const c=i.shift(),d=this.props.scripts[c];if(((r=this.props.scripts)==null?void 0:r[c].type)==="script"&&((l=d.common)!=null&&l.enabled)&&!c.match(/^script\.js\.global\./)){const h=d.common.engine.split(".").pop(),p=this,f=`javascript.${h}.scriptProblem.${c.substring(Jt.length+1)}`;this.props.socket.getState(f).then(b=>{p.onProblemUpdated(f,b),setTimeout(()=>p.readProblems(s,i),0)})}else setTimeout(()=>this.readProblems(s,i),0)}}componentDidMount(){this.readProblems(()=>{this.props.instances.forEach(s=>{this.props.socket.subscribeState(`javascript.${s}.scriptProblem.*`,this.onProblemUpdatedBound)})})}componentWillUnmount(){this.props.instances.forEach(s=>{this.props.socket.unsubscribeState(`javascript.${s}.scriptProblem.*`,this.onProblemUpdatedBound)})}onProblemUpdated(s,i){if(!i||!s)return;s=`${Jt}.${s.replace(/^javascript\.\d+\.scriptProblem\./,"")}`,this.problems||(this.problems=JSON.parse(JSON.stringify(this.state.problems))||[]);let r=!1;if(i.val)this.problems.includes(s)||(this.problems.push(s),r=!0);else{const l=this.problems.indexOf(s);l!==-1&&(this.problems.splice(l,1),r=!0)}r&&!this.problemsTimer&&(this.problemsTimer=setTimeout(()=>{this.problemsTimer=null,this.setState({problems:this.problems}),this.problems=null},300))}static filterListStatic(s,i,r,l,c){i=JSON.parse(JSON.stringify(i));let d=!1;const h={listItems:i};if(s&&r&&l){const p=l.toLowerCase();if(i.forEach(f=>{var v;const b=f.title.toLowerCase();f.filteredPartly=!1;let y=b.includes(p);const w=(v=c==null?void 0:c[f.id])==null?void 0:v.common;if(!y&&(w!=null&&w.source))if(w.engineType==="Blockly"){const _=w.source.lastIndexOf("//");y=w.source.substring(0,_).toLowerCase().includes(p)}else y=w.source.toLowerCase().includes(p);y?f.filtered&&(f.filtered=!1,d=!0):f.filtered||(f.filtered=!0,d=!0)}),d)for(let f=i.length-1;f>=0;f--){const b=i[f];if(!b.filtered||b.filteredPartly){let y=b;do y!=null&&y.parent&&i[y.parentIndex]&&(d=!0,i[y.parentIndex].filteredPartly=!0),y=y!=null&&y.parent&&i[y.parentIndex]?i[y.parentIndex]:null;while(y)}}}else i.forEach(p=>{(p.filtered||p.filteredPartly)&&(p.filtered=!1,p.filteredPartly=!1,d=!0)}),s||(h.searchText="",h.searchMode=!1,d=!0);return d?h:null}filterList(s,i){const r=So.filterListStatic(s,this.state.listItems,this.state.searchMode,this.state.searchText,this.props.scripts);r?this.setState(r,()=>i&&i()):i&&i()}static ensureSelectedIsVisibleStatic(s,i,r){i=JSON.parse(JSON.stringify(i));let l=!1,c=typeof s=="object"?s:r.find(d=>d.id===s);do{if(c!=null&&c.parent){const d=c.parent;c=r.find(h=>h.id===d)}else c=void 0;c&&(i.includes(c.id)||(i.push(c.id),l=!0))}while(c);return l?i:null}ensureSelectedIsVisible(s,i){return So.ensureSelectedIsVisibleStatic(s||this.state.selected,i||this.state.expanded,this.state.listItems)}static getDerivedStateFromProps(s,i){const r={};let l=!1;if(i.expertMode!==s.expertMode&&(l=!0,r.expertMode=s.expertMode),i.scriptsHash!==s.scriptsHash&&s.scripts){const c=E_(s.scripts||{});if(r.listItems=c,i.searchText){const p=So.filterListStatic(!0,c,i.searchMode,i.searchText,s.scripts);p&&Object.assign(r,p)}const d=So.getIsAllZeroInstancesStatic(c,s.instances||[]),h=So.ensureSelectedIsVisibleStatic(i.selected,i.expanded,i.listItems);r.isAllZeroInstances=d,h&&(r.expanded=h),l=!0}if(i.width!==s.width&&(l=!0,r.width=s.width),i.themeName!==s.themeName&&(l=!0,r.themeName=s.themeName),s.selectId&&i.selected!==s.selectId){const c=i.listItems.find(d=>d.id===s.selectId);if(!i.reorder&&c){const d=So.ensureSelectedIsVisibleStatic(c,i.expanded,i.listItems);r.selected=c.id,d&&(r.expanded=d),l=!0,window.localStorage&&window.localStorage.setItem("SideMenu.selected",c.id)}}return l?r:null}static getIsAllZeroInstancesStatic(s,i){let r=!i[0]&&i.length<=1;return r&&s.forEach(l=>{l.type!=="folder"&&l.instance!==0&&(r=!1)}),r}getIsAllZeroInstances(s,i){return s=s||this.state.listItems,i=i||this.state.instances,So.getIsAllZeroInstancesStatic(s||this.state.listItems,i||this.state.instances)}saveExpanded(s){window.localStorage.setItem("SideMenu.expanded",JSON.stringify(s||this.state.expanded))}showError(s){this.setState({errorText:s})}onToggle(s,i){if(i==null||i.stopPropagation(),s===Jt)return;const r=[...this.state.expanded],l=r.indexOf(s);l!==-1?(r.splice(l,1),this.state.selected&&this.state.selected.startsWith(`${s}.`)&&window.localStorage&&window.localStorage.setItem("SideMenu.selected",s)):(r.push(s),r.sort()),this.setState({expanded:r}),this.saveExpanded(r)}renderItemButtonsOnEnd(s,i){if(this.state.reorder)return null;if(s.type!=="folder"){let r=s.enabled?ig:ng;return s.enabled&&this.state.problems.includes(s.id)&&(r=S_),[m.jsx(qe,{onClick:l=>{l.stopPropagation(),this.props.onEnableDisable&&this.props.onEnableDisable(s.id,!s.enabled)},title:s.enabled?x.I18n.t("Pause script"):x.I18n.t("Run script"),disabled:this.props.debugMode,style:{...Pe.iconButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0,color:r},size:"medium",children:s.enabled?m.jsx(bc,{}):m.jsx(Wg,{})},"startStop"),this.state.width>Ur?m.jsx(qe,{style:this.props.debugMode?Pe.iconButtonsDisabled:void 0,title:x.I18n.t("Delete script"),disabled:s.id===To||s.id===Cn||this.props.debugMode,onClick:l=>this.onDelete(s,l),size:"medium",children:m.jsx(mc,{})},"delete"):null,m.jsx(qe,{style:this.props.debugMode?Pe.iconButtonsDisabled:void 0,disabled:this.props.debugMode,title:x.I18n.t("Edit script or just double click"),onClick:l=>this.onEdit(s,l),size:"medium",children:m.jsx(px,{})},"openInEdit")]}return this.state.width>Ur&&s.id!==Jt&&s.id!==Cn&&s.id!==To&&!(i!=null&&i.length)?m.jsx(qe,{style:this.props.debugMode?Pe.iconButtonsDisabled:void 0,title:x.I18n.t("Delete folder"),disabled:s.id===To||s.id===Cn||this.props.debugMode,onClick:r=>this.onDelete(s,r),size:"medium",children:m.jsx(mc,{})},"delete"):null}onDelete(s,i){return i==null||i.stopPropagation(),new Promise(r=>{if(!s){r();return}typeof s!="object"?this.setState({deleting:s},()=>r()):this.setState({deleting:s.id},()=>r())})}onEdit(s,i){this.onClick(s,i),this.props.onEdit&&this.props.onEdit(s.id)}getTextStyle(s){return!this.state.reorder&&s.type!=="folder"?{width:`calc(100% - ${this.state.width>Ur?185:137}px)`,overflow:"hidden",whiteSpace:"nowrap",flex:"none",padding:"0 16px 0 0"}:{whiteSpace:"nowrap",padding:"0 16px 0 0"}}onClick(s,i){if(i==null||i.stopPropagation(),!this.state.reorder&&s){const r=this.ensureSelectedIsVisible(s),l={selected:s.id};r&&(l.expanded=r),this.setState(l),window.localStorage&&window.localStorage.setItem("SideMenu.selected",s.id)}}onDblClick(s,i){i==null||i.stopPropagation(),!this.state.reorder&&(s.type==="folder"?this.onToggle(s.id):this.onEdit(s))}isFilteredOut(s){var i,r;return s.filtered&&!s.filteredPartly||this.state.typeFilter&&s.type!=="folder"&&s.type.toLowerCase()!==this.state.typeFilter.toLowerCase()||!this.state.expertMode&&((r=(i=this.props.scripts[s.id])==null?void 0:i.native)!=null&&r.protected)||this.state.statusFilter&&s.type!=="folder"&&(this.state.statusFilter==="running"&&!s.enabled||this.state.statusFilter==="paused"&&s.enabled||this.state.statusFilter==="problems"&&(!s.enabled||this.state.problems.indexOf(s.id)===-1))?!0:s.id===To&&!this.state.expertMode}renderListItem(s,i,r){var w,v;if(s.id===Jt&&!this.state.reorder)return null;const l=(this.state.reorder?s.depth:s.depth-1)*Mx;let c=s.title;if(this.state.searchText){const _=c.toLowerCase().indexOf(this.state.searchText.toLowerCase());_!==-1&&(c=[m.jsx("span",{children:c.substring(0,_)},"first"),m.jsx("span",{style:{color:"orange"},children:c.substring(_,_+this.state.searchText.length)},"second"),m.jsx("span",{children:c.substring(_+this.state.searchText.length)},"third")])}if(!this.state.isAllZeroInstances&&s.type!=="folder"){const _=this.state.runningInstances[`system.adapter.javascript.${s.instance}`];c=[m.jsxs("span",{title:`${x.I18n.t("Instance")} ${s.instance}${_?"":` (${x.I18n.t("not running")})`}`,style:{...Pe.instances,color:_?ig:ng},children:["[",s.instance,"]"]},"instance"),m.jsx("span",{children:c},"title")]}const d=this.state.reorder&&!this.props.debugMode,h={marginLeft:l,cursor:s.type==="folder"&&d?"default":"inherit",width:`calc(100% - ${l}px)`};d||(h.opacity=s.filteredPartly?.5:1),s.id===To&&s.id!==this.state.selected&&(h.color="#00a200");let p=s.id===Jt;!p&&i&&(p=this.state.expanded.includes(s.id));let f;s.type==="folder"?f={...Pe.folderIcon,...d?Pe.folderIconReorder:Pe.folderIconNoReorder}:f={...Pe.scriptIcon},s.id===To?f.color="#356956":s.id===Cn&&(f.color="#4899e1");let b=null;(r&&r.length||i&&i.length)&&(b=m.jsx("span",{style:Pe.childrenCount,children:r&&r.length!==i.length?`${r.length}(${i.length})`:i.length}));const y={...s.type==="folder"?Pe.folder:Pe.script,...d?Pe.reorder:void 0,...d&&s.type!=="folder"?Pe.scriptReorder:void 0,...d&&s.type==="folder"?Pe.folderReorder:void 0,...h};return m.jsxs(LT,{style:y,sx:s.id===this.state.selected&&!d?Pe.selected:void 0,className:x.Utils.clsx(d&&s.type==="folder"&&"folder-reorder",d&&s.type!=="folder"&&"script-reorder"),onClick:_=>this.onClick(s,_),onDoubleClick:_=>this.onDblClick(s,_),secondaryAction:this.renderItemButtonsOnEnd(s,i),children:[(v=(w=this.props.scripts[s.id])==null?void 0:w.native)!=null&&v.protected?m.jsx(T_,{style:{color:"orange",position:"absolute",right:5,width:10,height:10}}):null,m.jsx(Rg,{style:Pe.listItemIcon,children:s.type==="folder"?d||p?m.jsx(QT,{style:f,onClick:_=>!d&&this.onToggle(s.id,_)}):m.jsx(eS,{style:f,onClick:_=>!d&&this.onToggle(s.id,_)}):m.jsx("img",{style:f,alt:s.type,src:Tn[s.type]||Tn.def})}),m.jsx(Ng,{sx:{"& .MuiListItemText-primary":s.id===this.state.selected&&!d?Pe.selected:void 0},style:this.getTextStyle(s),primary:m.jsxs("span",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[c,b]})})]},s.id)}onDragFinish(s,i){let r=`${i}.${s.split(".").pop()}`;r!==s&&(this.state.listItems.find(l=>l.id===r)&&(r+=`_${x.I18n.t("copy")}`),this.props.onRename&&this.props.onRename(s,r))}renderOneItem(s,i){const r=this.state.statusFilter||this.state.typeFilter?s.filter(f=>f.parent===i.id?!this.isFilteredOut(f):!1):[],l=s.filter(f=>f.parent===i.id);if(this.isFilteredOut(i)||i.type==="folder"&&(this.state.statusFilter||this.state.typeFilter)&&!r.length)return null;const c=this.state.reorder&&!this.props.debugMode,d=this.renderListItem(i,l,r),h=[];let p;return l&&(c||this.state.expanded.includes(i.id)||i.id===Jt)&&(p=l.map(f=>this.renderOneItem(s,f))),c?i.type==="folder"?h.push(m.jsxs(Lx,{onDrop:f=>this.onDragFinish(f.name,i.id),folderName:i.id,children:[m.jsx(I_,{name:i.id,children:d},`draggable_${i.id}`),p||null]},`droppable_${i.id}`)):h.push(m.jsxs(I_,{name:i.id,children:[d,p||null]},`draggable_${i.id}`)):(h.push(d),p==null||p.forEach(f=>h.push(f))),h}renderAllItems(s){const i=s.filter(r=>!r.parent).map(r=>this.renderOneItem(s,r));return m.jsx(Og,{dense:!0,disablePadding:!0,sx:Pe.mainList,children:i})}onAddNew(s){s==null||s.stopPropagation();let i=this.state.listItems.find(l=>l.id===this.state.selected),r=Jt;for(;i&&i.type!=="folder";)i=this.state.listItems[i.parentIndex];i&&(r=i.id),this.parent=r,this.setState({choosingType:!0})}onCopy(s,i){s==null||s.stopPropagation();let r=this.state.listItems.find(c=>c.id===i),l=Jt;for(;r&&r.type!=="folder";)r=this.state.listItems[r.parentIndex];r&&(l=r.id),this.parent=l,this.setState({copingScript:i||""})}onAddNewFolder(s){s==null||s.stopPropagation();let i=this.state.listItems.find(l=>l.id===this.state.selected),r=Jt;for(;i&&i.type!=="folder";)i=this.state.listItems[i.parentIndex];i&&(r=i.id),this.parent=r,this.setState({creatingFolder:!0})}onRename(s){s==null||s.stopPropagation(),this.setState({renaming:this.state.selected})}getUniqueName(s){let i=1,r=`${x.I18n.t("Script")} `;if(s){const l=Kg(s,this.props.scripts[s]),c=l.match(/\d+$/);c?(r=l.replace(/\d+$/,""),i=parseInt(c[0],10)+1):r=l}for(;this.state.listItems.find(l=>l.id===`${this.parent}.${r.replace(/\.\s/g,"_")}${i}`);)i++;return r+i}getUniqueFolderName(){let s=1;for(;this.state.listItems.find(i=>i.id===`${this.parent}.${x.I18n.t("Folder")}_${s}`);)s++;return`${x.I18n.t("Folder")} ${s}`}onCloseMenu(s){this.setState({menuOpened:!1,menuAnchorEl:null,menuAnchorFilterEl:null},s)}getMainMenu(s,i){var l,c,d,h;const r=this.state.expertMode&&!!Object.keys(this.props.changedScripts).find(p=>{var f,b;return this.props.changedScripts[p]&&((b=(f=this.props.scripts[p])==null?void 0:f.native)==null?void 0:b.protected)});return m.jsxs(pm,{id:"long-menu",anchorEl:this.state.menuAnchorEl,open:this.state.menuOpened,onClose:()=>this.setState({menuOpened:!1,menuAnchorEl:null}),slotProps:{paper:{style:{maxHeight:Nx*7.5}}},children:[this.state.width<=Ur?m.jsxs(it,{disabled:this.props.debugMode||!this.state.selected||this.state.selected===To||this.state.selected===Cn||!!(s!=null&&s.length),onClick:p=>{if(p.stopPropagation(),p.preventDefault(),this.state.listItems.find(f=>f.parent===this.state.selected)){this.showError(x.I18n.t("Cannot delete non empty item!"));return}this.setState({menuOpened:!1,menuAnchorEl:null},()=>this.onDelete(this.state.selected).then(()=>{}))},children:[m.jsx(mc,{style:{...Pe.iconDropdownMenu,color:"red"}}),x.I18n.t("Delete")]},"delete"):null,m.jsxs(it,{disabled:this.props.debugMode||r,selected:this.state.expertMode,onClick:p=>{p.stopPropagation(),p.preventDefault(),this.onCloseMenu(()=>this.props.onExpertModeChange&&this.props.onExpertModeChange(!this.state.expertMode))},children:[m.jsx(x.IconExpert,{style:{...Pe.iconDropdownMenu,color:this.state.expertMode?"orange":"inherit"}}),x.I18n.t("Expert mode")]},"expertMode"),this.props.onExport&&m.jsxs(it,{onClick:p=>{p.stopPropagation(),p.preventDefault(),this.onCloseMenu(()=>this.setState({showExportDialog:!0}))},children:[m.jsx(kc,{style:Pe.iconDropdownMenu}),x.I18n.t("Export all scripts")]},"exportAll"),this.props.onImport&&m.jsxs(it,{disabled:this.props.debugMode,onClick:p=>{p.stopPropagation(),p.preventDefault(),this.onCloseMenu(()=>this.props.onImport())},children:[m.jsx(Lg,{style:Pe.iconDropdownMenu}),x.I18n.t("Import scripts")]},"import"),this.props.onThemeChange&&m.jsxs(it,{onClick:()=>this.onCloseMenu(()=>{this.props.onThemeChange&&this.props.onThemeChange(x.Utils.toggleTheme(this.state.themeName))}),children:[m.jsx(mx,{style:Pe.iconDropdownMenu}),x.I18n.t('Change theme (actual "%s")',this.state.themeName)]},"dark"),this.props.onAddNew&&m.jsxs(it,{disabled:!this.state.selected||!i||i.type==="folder",onClick:p=>{const f=this.state.selected;this.onCloseMenu(()=>this.onCopy(p,f))},children:[m.jsx(tS,{style:Pe.iconDropdownMenu}),x.I18n.t("Copy script")]},"copy"),this.state.expertMode&&m.jsxs(it,{disabled:this.props.debugMode,onClick:p=>{p.stopPropagation(),p.preventDefault(),this.onCloseMenu(()=>this.setState({showAdapterDebug:!0}))},children:[m.jsx(lx,{style:Pe.iconDropdownMenu}),x.I18n.t("Debug instance")]},"debugInstance"),this.state.selected&&this.props.password&&this.props.scripts[this.state.selected].type==="script"?m.jsxs(it,{disabled:this.props.debugMode||this.props.changedScripts[this.state.selected],onClick:p=>{p.stopPropagation(),p.preventDefault(),this.onCloseMenu(async()=>{var b;const f=await this.props.socket.getObject(this.state.selected);f&&((b=f.native)!=null&&b.protected?(delete f.native.protected,f.common.source=Vg(this.props.password,f.common.source||"")):(f.native||={},f.native.protected=!0,f.common.source=vc(this.props.password,f.common.source||"")),await this.props.socket.setObject(f._id,f))})},children:[m.jsx(T_,{style:{...Pe.iconDropdownMenu,color:"orange"}}),(c=(l=this.props.scripts[this.state.selected])==null?void 0:l.native)!=null&&c.protected?m.jsx("span",{style:{color:(h=(d=this.props.scripts[this.state.selected])==null?void 0:d.native)!=null&&h.protected?"orange":void 0},children:x.I18n.t("Unprotect script")}):x.I18n.t("Protect script")]},"encrypt"):null]},"menu")}getToolbarButtons(){const s=[],i=this.state.reorder&&!this.props.debugMode;if(this.state.searchMode&&!this.props.debugMode)s.push(m.jsx(Pn,{value:this.state.searchText,style:Pe.toolbarSearch,ref:this.inputRef,autoFocus:!0,placeholder:x.I18n.t("Search..."),onChange:r=>{this.setState({searchText:r.target.value}),this.filterTimer&&clearTimeout(this.filterTimer),this.filterTimer=setTimeout(()=>{this.filterTimer=null,this.filterList(!0),this.props.onSearch&&this.props.onSearch(this.state.searchText)},400)}},"searchInput")),s.push(m.jsx(qe,{sx:Pe.toolbarButtons,style:{float:"right"},title:x.I18n.t("End search mode"),onClick:r=>{r.stopPropagation(),this.filterList(!1,()=>this.props.onSearch&&this.props.onSearch(this.state.searchText))},size:"medium",children:m.jsx(dx,{})},"disableSearch")),this.state.searchText&&s.push(m.jsx(qe,{title:x.I18n.t("Clear search input"),sx:Pe.toolbarButtons,style:{marginTop:7,float:"right"},onClick:r=>{r.stopPropagation(),this.setState({searchText:""},()=>{this.filterList(!0),this.props.onSearch&&this.props.onSearch(this.state.searchText)})},size:"medium",children:m.jsx(Mw,{fontSize:"small"})},"cleanSearch"));else{if(!i){s.push(m.jsx(qe,{"aria-label":"More","aria-owns":this.state.menuOpened?"long-menu":void 0,title:x.I18n.t("Menu"),"aria-haspopup":"true",onClick:c=>{c.stopPropagation(),c.preventDefault(),this.setState({menuOpened:!0,menuAnchorEl:c.currentTarget})},size:"medium",children:m.jsx(gx,{})},"menuButton"));const r=this.state.listItems.find(c=>c.id===this.state.selected);let l;r&&this.state.width<=Ur&&r.type==="folder"&&(l=this.state.listItems.filter(c=>c.parent===this.state.selected)),s.push(this.getMainMenu(l,r)),s.push(m.jsx(qe,{disabled:this.props.debugMode,title:x.I18n.t("Create new script"),sx:{...Pe.toolbarButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0},style:{color:i?"red":"inherit"},onClick:c=>this.onAddNew(c),size:"medium",children:m.jsx(sS,{})},"new-script")),s.push(m.jsx(qe,{disabled:this.props.debugMode,title:x.I18n.t("Create new folder"),sx:{...Pe.toolbarButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0},style:{color:i?"red":"inherit"},onClick:c=>this.onAddNewFolder(c),size:"medium",children:m.jsx(oS,{})},"new-folder"))}s.push(m.jsx(qe,{disabled:i||this.props.debugMode,sx:{...Pe.toolbarButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0},title:x.I18n.t("Search in scripts"),style:{float:"right",opacity:this.props.debugMode?.5:i?0:1},onClick:r=>{r.stopPropagation(),this.setState({searchMode:!0})},size:"medium",children:m.jsx($x,{})},"search")),s.push(m.jsx(qe,{disabled:this.props.debugMode,title:x.I18n.t("Reorder scripts in folders"),sx:{...Pe.toolbarButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0},style:{color:i?"red":"inherit",float:"right"},onClick:r=>{r.stopPropagation(),this.setState({reorder:!this.state.reorder})},size:"medium",children:m.jsx(_x,{})},"reorder")),!i&&this.state.selected&&this.state.selected!==To&&this.state.selected!==Cn&&s.push(m.jsx(qe,{sx:{...Pe.toolbarButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0},disabled:this.props.debugMode,title:x.I18n.t("Rename"),onClick:r=>this.onRename(r),size:"medium",children:m.jsx(iS,{})},"rename")),s.push(m.jsxs("span",{style:{opacity:.5,fontSize:10},children:["v",this.props.version]},"version"))}return s}getFolders(){const s=[{id:Jt,name:x.I18n.t("Root folder")}];return this.state.listItems.forEach(i=>{i.type==="folder"&&i.id!==Jt&&(!i.id.startsWith(To)||this.state.expertMode)&&s.push({id:i.id,name:i.title})}),s}onCollapseAll(){this.setState({expanded:[]}),this.saveExpanded([])}onExpandAll(){const s=[];this.state.listItems.forEach(i=>this.state.listItems.find(r=>r.parent===i.id)&&s.push(i.id)),this.setState({expanded:s}),this.saveExpanded(s)}getBottomButtons(){return this.state.reorder||this.props.debugMode?null:[m.jsx(wt,{sx:Pe.footerButtons,title:x.I18n.t("Show only running scripts"),onClick:s=>{s.stopPropagation(),s.preventDefault();const i=this.state.statusFilter==="running"?"":"running";window.localStorage&&window.localStorage.setItem("SideMenu.statusFilter",i),this.setState({statusFilter:i})},children:m.jsx(bc,{style:{color:ig,opacity:this.state.statusFilter==="running"?1:.3,background:this.state.statusFilter==="running"?"gray":"inherit"}})},"filterByRunning"),m.jsx(wt,{sx:Pe.footerButtons,title:x.I18n.t("Show only paused scripts"),onClick:()=>{const s=this.state.statusFilter==="paused"?"":"paused";window.localStorage&&window.localStorage.setItem("SideMenu.statusFilter",s),this.setState({statusFilter:s})},children:m.jsx(Wg,{style:{color:ng,opacity:this.state.statusFilter==="paused"?1:.3,background:this.state.statusFilter==="paused"?"gray":"inherit"}})},"filterByPaused"),m.jsx(wt,{sx:Pe.footerButtons,style:{marginRight:16},title:x.I18n.t("Show only scripts with problems"),onClick:()=>{const s=this.state.statusFilter==="problems"?"":"problems";window.localStorage&&window.localStorage.setItem("SideMenu.statusFilter",s),this.setState({statusFilter:s})},children:m.jsx(bc,{style:{color:S_,opacity:this.state.statusFilter==="problems"?1:.3,background:this.state.statusFilter==="problems"?"gray":"inherit"}})},"filterByProblem"),m.jsx(wt,{sx:Pe.footerButtons,children:m.jsx("img",{alt:"Blockly",style:{opacity:this.state.typeFilter==="Blockly"?1:.3,background:this.state.typeFilter==="Blockly"?"gray":"inherit"},src:Tn.Blockly,onClick:()=>{const s=this.state.typeFilter==="Blockly"?"":"Blockly";window.localStorage&&window.localStorage.setItem("SideMenu.typeFilter",s),this.setState({typeFilter:s})}})},"filterBlockly"),m.jsx(wt,{sx:Pe.footerButtons,children:m.jsx("img",{alt:"Javascript",style:{opacity:this.state.typeFilter==="Javascript/js"?1:.3,background:this.state.typeFilter==="Javascript/js"?"gray":"inherit"},src:Tn["Javascript/js"],onClick:()=>{const s=this.state.typeFilter==="Javascript/js"?"":"Javascript/js";window.localStorage&&window.localStorage.setItem("SideMenu.typeFilter",s),this.setState({typeFilter:s})}})},"filterJS"),m.jsx(wt,{sx:Pe.footerButtons,children:m.jsx("img",{alt:"TypeScript",style:{opacity:this.state.typeFilter==="TypeScript/ts"?1:.3,background:this.state.typeFilter==="TypeScript/ts"?"gray":"inherit"},src:Tn["TypeScript/ts"],onClick:()=>{const s=this.state.typeFilter==="TypeScript/ts"?"":"TypeScript/ts";window.localStorage&&window.localStorage.setItem("SideMenu.typeFilter",s),this.setState({typeFilter:s})}})},"filterTS"),m.jsx(wt,{sx:Pe.footerButtons,children:m.jsx("img",{alt:"Rules",style:{opacity:this.state.typeFilter==="Rules"?1:.3,background:this.state.typeFilter==="Rules"?"gray":"inherit"},src:Tn.Rules,onClick:()=>{const s=this.state.typeFilter==="Rules"?"":"Rules";window.localStorage&&window.localStorage.setItem("SideMenu.typeFilter",s),this.setState({typeFilter:s})}})},"filterRules"),m.jsx("div",{style:{flexGrow:1}},"padding"),m.jsx(wt,{sx:Pe.footerButtons,onClick:()=>this.onExpandAll(),title:x.I18n.t("Expand all"),children:m.jsx(kx,{style:Pe.footerButtonsRight})},"expandAll"),this.state.expanded.length?m.jsx(wt,{sx:Pe.footerButtons,onClick:()=>this.onCollapseAll(),title:x.I18n.t("Collapse all"),children:m.jsx(wx,{style:Pe.footerButtonsRight})},"collapseAll"):m.jsx("div",{style:{height:22,width:24}})]}getAdapterDebugDialog(){return this.state.showAdapterDebug?m.jsx(Dx,{socket:this.props.socket,onClose:()=>this.setState({showAdapterDebug:!1}),onDebug:(s,i)=>this.setState({showAdapterDebug:!1},()=>this.props.onDebugInstance({instance:s,adapter:i}))},"debug"):null}render(){var r,l,c;const s=this.state.renaming?this.state.listItems.find(d=>d.id===this.state.renaming):void 0,i=this.state.copingScript&&this.props.scripts[this.state.copingScript].type==="script"?this.props.scripts[this.state.copingScript]:void 0;return[m.jsxs(PT,{variant:"permanent",style:Pe.menu,sx:{"& .MuiDrawer-paper":Pe.drawerPaper},anchor:"left",onClick:()=>this.onClick({id:""}),children:[m.jsx(wt,{sx:Pe.toolbar,children:this.getToolbarButtons()}),m.jsx(o_,{}),m.jsx(ek,{backend:hk,children:m.jsx("div",{style:Pe.innerMenu,children:this.renderAllItems(this.state.listItems)})}),m.jsx(o_,{}),m.jsx("div",{style:Pe.footer,children:this.getBottomButtons()})]},"drawer"),s?m.jsx(_m,{name:s.title,id:this.state.renaming||"",folder:s.type==="folder",instance:s.instance,instances:this.props.instances,onClose:()=>this.setState({renaming:null}),onRename:(d,h,p,f)=>this.props.onRename&&this.props.onRename(d,h,p,f)},"dialog-rename"):null,this.state.deleting?m.jsx(Cx,{name:this.state.listItems.find(d=>d.id===this.state.deleting).title,id:this.state.deleting,onClose:()=>this.setState({deleting:null}),onDelete:d=>this.props.onDelete&&this.props.onDelete(d)},"dialog-delete"):null,this.state.choosingType?m.jsx(Dn,{onClose:d=>{const h={choosingType:!1};d&&(h.creatingScript=d),this.setState(h)}},"dialog-script-type"):null,this.state.creatingScript?m.jsx(og,{onClose:()=>this.setState({creatingScript:null}),title:x.I18n.t("Create new script"),name:this.getUniqueName(),parents:this.getFolders(),folder:!1,existingItems:this.state.listItems.map(d=>d.id),instance:this.props.instances[0]||0,instances:this.props.instances,type:this.state.creatingScript,parent:this.parent,onAdd:(d,h,p,f)=>this.props.onAddNew&&this.props.onAddNew(d,h,!1,p,f)},"dialog-new-script"):null,this.state.copingScript?m.jsx(og,{onClose:()=>this.setState({copingScript:""}),title:x.I18n.t("Copy script"),name:this.getUniqueName(this.state.copingScript),parents:this.getFolders(),folder:!1,instance:parseInt((l=(r=i==null?void 0:i.common)==null?void 0:r.engine)==null?void 0:l.split(".").pop(),10)||0,instances:this.props.instances,type:((c=i==null?void 0:i.common)==null?void 0:c.engineType)||"Javascript/js",parent:this.parent,onAdd:(d,h,p,f)=>{var y;const b=this.state.copingScript&&this.props.scripts[this.state.copingScript].type==="script"?this.props.scripts[this.state.copingScript]:void 0;b!=null&&b.common&&(b.common.enabled=!1),this.props.onAddNew&&this.props.onAddNew(d,h,!1,p,f,(y=b==null?void 0:b.common)==null?void 0:y.source)}},"dialog-copy-script"):null,this.state.creatingFolder?m.jsx(og,{onClose:()=>this.setState({creatingFolder:!1}),title:x.I18n.t("Create new folder"),parents:this.getFolders(),name:this.getUniqueFolderName(),parent:this.parent,onAdd:(d,h)=>this.props.onAddNew&&this.props.onAddNew(d,h,!0)},"dialog-new-folder"):null,this.state.errorText?m.jsx(su,{onClose:()=>this.setState({errorText:""}),text:this.state.errorText},"error"):null,this.getAdapterDebugDialog(),this.state.showExportDialog?m.jsxs(Ut,{open:!0,onClose:()=>this.setState({showExportDialog:!1}),children:[m.jsx(ss,{children:x.I18n.t("Export all scripts")}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",onClick:()=>{this.setState({showExportDialog:!1}),this.props.onExport(!0)},color:"primary",children:x.I18n.t("as JSON")}),m.jsx(He,{variant:"contained",onClick:()=>{this.setState({showExportDialog:!1}),this.props.onExport(!1)},color:"grey",children:x.I18n.t("as plain text")}),m.jsx(He,{variant:"contained",onClick:()=>this.setState({showExportDialog:!1}),color:"primary",children:x.I18n.t("Cancel")})]})]},"dialog-export-format"):null]}}const Px="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgAQMAAADYVuV7AAAABlBMVEUAAAAzMzPI8eYgAAAAAXRSTlMAQObYZgAAACFJREFUeAFjAIJRwP////8PYIKWHCigNQdKj/pn1D+jAABTG16wVQqVpQAAAABJRU5ErkJggg==",Bx="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgAQMAAADYVuV7AAAABlBMVEUAAAAzMzPI8eYgAAAAAXRSTlMAQObYZgAAABtJREFUeAFjAIJRwP8fCj7QkENn/4z6Z5QzCgBjbWaoyx1PqQAAAABJRU5ErkJggg==";function Fx(a){let s,i=a.getHours();return i<10&&(i=`0${i.toString()}`),s=`${i}:`,i=a.getMinutes(),i<10&&(i=`0${i.toString()}`),s+=`${i}:`,i=a.getSeconds(),i<10&&(i=`0${i.toString()}`),s+=`${i}.`,i=a.getMilliseconds(),i<10?i=`00${i.toString()}`:i<100&&(i=`0${i.toString()}`),s+=i,s}const x_=34,zt={logBox:{width:"100%",height:"100%",position:"relative",overflow:"hidden"},logBoxInner:a=>({display:"inline-block",color:a.palette.mode==="dark"?"white":"black",width:`calc(100% - ${x_}px)`,height:"100%",overflow:"auto",position:"relative",verticalAlign:"top"}),info:a=>({background:a.palette.mode==="dark"?"darkgrey":"lightgrey",color:(a.palette.mode==="dark","black")}),error:a=>({background:"#FF0000",color:a.palette.mode==="dark"?"black":"white"}),warn:a=>({background:"#FF8000",color:a.palette.mode==="dark"?"black":"white"}),debug:a=>({background:"gray",opacity:.8,color:a.palette.mode==="dark"?"black":"white"}),silly:a=>({background:"gray",opacity:.6,color:a.palette.mode==="dark"?"black":"white"}),table:{fontFamily:"monospace",width:"100%"},toolbox:{width:x_,height:"100%",boxShadow:"2px 0px 4px -1px rgba(0, 0, 0, 0.2), 4px 0px 5px 0px rgba(0, 0, 0, 0.14), 1px 0px 10px 0px rgba(0, 0, 0, 0.12)",display:"inline-block",verticalAlign:"top",overflow:"hidden"},trFrom:{width:90},trTime:{width:90},trSeverity:{width:40,fontWeight:"bold"},trPreMessage:{padding:0,margin:0},iconButtons:{width:32,height:32,padding:4},layoutIcon:a=>({"& img":{width:24,height:24,background:a.palette.mode==="dark"?"#9d9d9d":void 0,borderRadius:a.palette.mode==="dark"?"30px":void 0}})};function jx(a){return a<10?`00${a}`:a<100?`0${a}`:a.toString()}const Zs={};class wm extends _e.Component{messagesEnd;constructor(s){super(s),this.state={lines:{},goBottom:!0,selected:null,editing:this.props.editing||[]},this.messagesEnd=_e.createRef()}static generateLine(s,i){let r=s.message||"";if(typeof r!="object"){const l=new RegExp(`${s.from.replace(".","\\.").replace(")","\\)").replace("(","\\(")} \\(\\d+\\) `,"g"),c=r.match(l);c?r=r.replace(c[0],""):r=r.replace(`${s.from} `,"")}return r.startsWith(`${i}: `)&&(r=r.substring(i.length+2)),m.jsxs(wt,{component:"tr",sx:zt[s.severity],children:[m.jsx("td",{style:zt.trFrom,children:s.from}),m.jsx("td",{style:zt.trTime,children:Fx(new Date(s.ts))}),m.jsx("td",{style:zt.trSeverity,children:s.severity}),m.jsx("td",{children:m.jsx("pre",{style:zt.trPreMessage,children:r})})]},`tr_${s.ts}_${s.message.substring(s.message.length-10)}`)}scrollToBottom(){var s,i;(i=(s=this.messagesEnd)==null?void 0:s.current)==null||i.scrollIntoView({behavior:"smooth"})}logHandler=s=>{const i=this.state.lines,r=this.state.editing.filter(f=>s.message.includes(f));let l=null;if(!r.length||(r.length===1?l=r[0]:(r.sort(),l=r[r.length-1]),!l))return;const c=i[l]||[],d=Zs[l]||[];c.push(wm.generateLine(s,l));let h=s.severity;(h==="info"||h==="warn")&&(h+=" ");const p=new Date(s.ts);d.push(`${p.toLocaleString()}.${jx(p.getMilliseconds())} [${h}]: ${s.message}`),c.length>300&&(c.splice(0,c.length-300),d.splice(0,c.length-300)),Zs[l]=d,i[l]=c,this.setState({lines:i})};componentDidMount(){this.props.socket.registerLogHandler(this.logHandler)}componentWillUnmount(){this.props.socket.unregisterLogHandler(this.logHandler)}componentDidUpdate(){this.state.goBottom&&this.scrollToBottom()}static getDerivedStateFromProps(s,i){let r=!1;const l={};if(s.selected!==i.selected){const c=s.selected,d=i.lines;c&&(d[c]=d[c]||[],Zs[c]=Zs[c]||[]),l.selected=c,r=!0}if(JSON.stringify(s.editing)!==JSON.stringify(i.editing)){const c=JSON.parse(JSON.stringify(s.editing));r=!0;const d=i.lines;for(const h in Zs)Object.prototype.hasOwnProperty.call(Zs,h)&&(c.includes(h)||(delete Zs[h],delete d[h]));l.editing=c}return r?l:null}onCopy(){x.Utils.copyToClipboard((Zs[this.state.selected]||[]).join(` +`))}clearLog(){const s=this.state.lines;s[this.state.selected]&&(s[this.state.selected]=[]),Zs[this.state.selected]&&(Zs[this.state.selected]=[]),this.setState({lines:s})}renderLogList(s){return this.state.selected&&(s!=null&&s.length)?m.jsxs(wt,{sx:zt.logBoxInner,children:[m.jsx("table",{style:zt.table,children:m.jsx("tbody",{children:s})},"logTable"),m.jsx("div",{ref:this.messagesEnd,style:{float:"left",clear:"both"}},"logScrollPoint")]},"logList"):m.jsx(wt,{sx:zt.logBoxInner,style:{paddingLeft:10},children:x.I18n.t("Log outputs")},"logList")}render(){const s=this.state.selected?this.state.lines[this.state.selected]:null;return m.jsxs("div",{style:zt.logBox,children:[m.jsxs("div",{style:zt.toolbox,children:[m.jsx(qe,{style:zt.iconButtons,onClick:()=>this.setState({goBottom:!this.state.goBottom}),color:this.state.goBottom?"secondary":void 0,size:"medium",children:m.jsx(nS,{})}),s!=null&&s.length?m.jsx(qe,{style:zt.iconButtons,onClick:()=>this.clearLog(),size:"medium",children:m.jsx(rS,{})}):null,s!=null&&s.length?m.jsx(qe,{style:zt.iconButtons,onClick:()=>this.onCopy(),size:"medium",children:m.jsx(aS,{})}):null,this.props.onLayoutChange?m.jsx(qe,{style:zt.iconButtons,onClick:()=>this.props.onLayoutChange&&this.props.onLayoutChange(),title:x.I18n.t("Change layout"),size:"medium",sx:zt.layoutIcon,children:m.jsx("img",{alt:"split",src:this.props.verticalLayout?Px:Bx})}):null,m.jsx(qe,{style:zt.iconButtons,onClick:()=>this.props.onHideLog(),title:x.I18n.t("Hide logs"),size:"medium",children:m.jsx(lS,{})})]},"toolbox"),this.renderLogList(s)]})}}var D_="focus-outline-hidden";function vk(){var a=this;document.addEventListener("keydown",function(s){a.focusByKeyboard=!0},!0),document.addEventListener("mousedown",function(s){a.focusByKeyboard=!1},!0),document.addEventListener("focus",function(s){a.updateVisibility()},!0),document.addEventListener("focusout",function(s){window.setTimeout(function(){document.hasFocus()||(a.focusByKeyboard=!0,a.updateVisibility())},0)}),this.updateVisibility()}vk.prototype={focusByKeyboard:!0,updateVisibility:function(){this.hidden=!this.focusByKeyboard},set hidden(a){document.documentElement.classList.toggle(D_,a)},get hidden(){return document.documentElement.classList.contains(D_)}};new vk;var yk={exports:{}};(function(a){(function(){var s={}.hasOwnProperty;function i(){for(var r=[],l=0;l4&&arguments[4]!==void 0?arguments[4]:"easeInOutCubic";return r>l?i:s+(i-s)*Ux[c](r/l)};Mi.calcEndPoint=function(s){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(Hx(s))return parseInt(s)+r;var l=i===window||i===document.documentElement?window.pageYOffset:i.scrollTop-i.getBoundingClientRect().top,c=s.nodeName.toLowerCase()==="html"?-l:s.getBoundingClientRect().top+l;return c+r};(function(a,s){Object.defineProperty(s,"__esModule",{value:!0});var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},r=Mi;s.default=function(l){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d=c.duration,h=d===void 0?500:d,p=c.context,f=p===void 0?window:p,b=c.offset,y=b===void 0?0:b,w=c.ease,v=w===void 0?"easeInOutCubic":w,_=c.callback;if((typeof window>"u"?"undefined":i(window))==="object"){var $=f.scrollTop!==null&&f.scrollTop!==void 0?f.scrollTop:window.pageYOffset,S=(0,r.calcEndPoint)(l,f,y),T=performance.now(),E=window.requestAnimationFrame,D=function M(){var P=performance.now()-T,W=(0,r.setPosition)($,S,P,h,v);f!==window?f.scrollTop=W:window.scroll(0,W),P>h?typeof _=="function"&&_(l):E(M)};D()}},a.exports=s.default})(Jg,Jg.exports);var _k=Jg.exports,qg={exports:{}};(function(a,s){Object.defineProperty(s,"__esModule",{value:!0});var i=Object.assign||function(d){for(var h=1;h0&&arguments[0]!==void 0?arguments[0]:{},h=d.query,p=h===void 0?'[href^="#"]:not([href="#"]':h,f=d.match,b=f===void 0?function(S){return document.getElementById(S.hash.substring(1))}:f,y=d.hashChange,w=y===void 0?!0:y,v=d.scrollSmoothConfig,_=document.querySelectorAll(p),$=function(T){T.preventDefault();var E=b(T.target);E&&(w&&history.replaceState(null,null,"#"+E.id),(0,l.default)(E,i({},v)))};Array.from(_).map(function(S){S.addEventListener("click",$,!1)})},a.exports=s.default})(qg,qg.exports);var Wx=qg.exports,Xg={exports:{}};(function(a,s){Object.defineProperty(s,"__esModule",{value:!0});function i(r){if(Array.isArray(r)){for(var l=0,c=Array(r.length);l0&&arguments[0]!==void 0?arguments[0]:{},l=r.activeClass,c=l===void 0?"active":l,d=r.query,h=d===void 0?'[href^="#"]:not([href="#"]):not([href="#0"])':d,p=r.threshold,f=p===void 0?[.25,.5,.75]:p,b=r.detectType,y=b===void 0?"max":b,w={threshold:f},v=function(W){return W.classList.remove(c)},_=function(W){return W.classList.add(c)},$=function(){document.querySelectorAll("."+c).forEach(v)},S=function(W){$(),_(document.querySelector('a[href="#'+W.id+'"]'))},T=function(W){W.forEach(function(G){G.intersectionRatio>=Math[y].apply(Math,i(f))&&S(G.target)})},E=document.querySelectorAll(h),D=new IntersectionObserver(T,w),M=function(W){var G=document.querySelector("#"+W.hash.slice(1));D.observe(G)};E.forEach(M)},a.exports=s.default})(Xg,Xg.exports);var Gx=Xg.exports;(function(a,s){Object.defineProperty(s,"__esModule",{value:!0});var i=_k,r=f(i),l=Mi,c=Wx,d=f(c),h=Gx,p=f(h);function f(b){return b&&b.__esModule?b:{default:b}}s.default={to:r.default,calcEndPoint:l.calcEndPoint,anchorScroll:d.default,observe:p.default},a.exports=s.default})(Yg,Yg.exports);var Vx=Yg.exports;const Kx=Xo(Vx);var km={exports:{}},Yx=km.exports;(function(a){(function(s,i){a.exports?a.exports=i():s.Scrollparent=i()})(Yx,function(){var s=/(auto|scroll)/,i=function(h,p){return h.parentNode===null?p:i(h.parentNode,p.concat([h]))},r=function(h,p){return getComputedStyle(h,null).getPropertyValue(p)},l=function(h){return r(h,"overflow")+r(h,"overflow-y")+r(h,"overflow-x")},c=function(h){return s.test(l(h))},d=function(h){if(h instanceof HTMLElement||h instanceof SVGElement){for(var p=i(h.parentNode,[]),f=0;f=s||G<0||y&&z>=c}function T(){var W=rg();if(S(W))return E(W);h=setTimeout(T,$(W))}function E(W){return h=void 0,w&&r?v(W):(r=l=void 0,d)}function D(){h!==void 0&&clearTimeout(h),f=0,r=p=l=h=void 0}function M(){return h===void 0?d:E(rg())}function P(){var W=rg(),G=S(W);if(r=arguments,l=this,p=W,G){if(h===void 0)return _(p);if(y)return h=setTimeout(T,s),v(p)}return h===void 0&&(h=setTimeout(T,s)),d}return P.cancel=D,P.flush=M,P}function Zg(a){var s=typeof a;return!!a&&(s=="object"||s=="function")}function h0(a){return!!a&&typeof a=="object"}function p0(a){return typeof a=="symbol"||h0(a)&&l0.call(a)==Zx}function R_(a){if(typeof a=="number")return a;if(p0(a))return O_;if(Zg(a)){var s=typeof a.valueOf=="function"?a.valueOf():a;a=Zg(s)?s+"":s}if(typeof a!="string")return a===0?a:+a;a=a.replace(Qx,"");var i=t0.test(a);return i||s0.test(a)?o0(a.slice(2),i?2:8):e0.test(a)?O_:+a}var g0=d0;const m0=Xo(g0);var Qg="data-focus-lock",wk="data-focus-lock-disabled",f0="data-no-focus-lock",$0="data-autofocus-inside",b0="data-no-autofocus";function ag(a,s){return typeof a=="function"?a(s):a&&(a.current=s),a}function v0(a,s){var i=kt(function(){return{value:a,callback:s,facade:{get current(){return i.value},set current(r){var l=i.value;l!==r&&(i.value=r,i.callback(r,l))}}}})[0];return i.callback=s,i.facade}var y0=typeof window<"u"?hm:Lt,N_=new WeakMap;function _0(a,s){var i=v0(null,function(r){return a.forEach(function(l){return ag(l,r)})});return y0(function(){var r=N_.get(i);if(r){var l=new Set(r),c=new Set(a),d=i.current;l.forEach(function(h){c.has(h)||ag(h,null)}),c.forEach(function(h){l.has(h)||ag(h,d)})}N_.set(i,a)},[a]),i}var lg={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"};function kk(a){return a}function Ck(a,s){s===void 0&&(s=kk);var i=[],r=!1,l={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:a},useMedium:function(c){var d=s(c,r);return i.push(d),function(){i=i.filter(function(h){return h!==d})}},assignSyncMedium:function(c){for(r=!0;i.length;){var d=i;i=[],d.forEach(c)}i={push:function(h){return c(h)},filter:function(){return i}}},assignMedium:function(c){r=!0;var d=[];if(i.length){var h=i;i=[],h.forEach(c),d=i}var p=function(){var b=d;d=[],b.forEach(c)},f=function(){return Promise.resolve().then(p)};f(),i={push:function(b){d.push(b),f()},filter:function(b){return d=d.filter(b),i}}}};return l}function Cm(a,s){return s===void 0&&(s=kk),Ck(a,s)}function w0(a){a===void 0&&(a={});var s=Ck(null);return s.options=cS({async:!0,ssr:!1},a),s}var Tk=Cm({},function(a){var s=a.target,i=a.currentTarget;return{target:s,currentTarget:i}}),Sk=Cm(),k0=Cm(),C0=w0({async:!0,ssr:typeof document<"u"}),T0=um(void 0),S0=[],Tm=Iw(function(s,i){var r,l=kt(),c=l[0],d=l[1],h=Ko(),p=Ko(!1),f=Ko(null),b=kt({}),y=b[1],w=s.children,v=s.disabled,_=v===void 0?!1:v,$=s.noFocusGuards,S=$===void 0?!1:$,T=s.persistentFocus,E=T===void 0?!1:T,D=s.crossFrame,M=D===void 0?!0:D,P=s.autoFocus,W=P===void 0?!0:P;s.allowTextSelection;var G=s.group,z=s.className,Z=s.whiteList,he=s.hasPositiveIndices,Ce=s.shards,R=Ce===void 0?S0:Ce,K=s.as,C=K===void 0?"div":K,Q=s.lockProps,ve=Q===void 0?{}:Q,ce=s.sideCar,ne=s.returnFocus,me=ne===void 0?!1:ne,re=s.focusOptions,B=s.onActivation,N=s.onDeactivation,te=kt({}),q=te[0],se=xn(function(Y){var O=Y.captureFocusRestore;if(!f.current){var A,U=(A=document)==null?void 0:A.activeElement;f.current=U,U!==document.body&&(f.current=O(U))}h.current&&B&&B(h.current),p.current=!0,y()},[B]),j=xn(function(){p.current=!1,N&&N(h.current),y()},[N]),Te=xn(function(Y){var O=f.current;if(O){var A=(typeof O=="function"?O():O)||document.body,U=typeof me=="function"?me(A):me;if(U){var H=typeof U=="object"?U:void 0;f.current=null,Y?Promise.resolve().then(function(){return A.focus(H)}):A.focus(H)}}},[me]),ae=xn(function(Y){p.current&&Tk.useMedium(Y)},[]),we=Sk.useMedium,Ie=xn(function(Y){h.current!==Y&&(h.current=Y,d(Y))},[]),Ne=Ig((r={},r[wk]=_&&"disabled",r[Qg]=G,r),ve),Ae=S!==!0,We=Ae&&S!=="tail",k=_0([i,Ie]),X=us(function(){return{observed:h,shards:R,enabled:!_,active:p.current}},[_,p.current,R,c]);return _e.createElement(Dg,null,Ae&&[_e.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:_?-1:0,style:lg}),he?_e.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:_?-1:1,style:lg}):null],!_&&_e.createElement(ce,{id:q,sideCar:C0,observed:c,disabled:_,persistentFocus:E,crossFrame:M,autoFocus:W,whiteList:Z,shards:R,onActivation:se,onDeactivation:j,returnFocus:Te,focusOptions:re,noFocusGuards:S}),_e.createElement(C,Ig({ref:k},Ne,{className:z,onBlur:we,onFocus:ae}),_e.createElement(T0.Provider,{value:X},w)),We&&_e.createElement("div",{"data-focus-guard":!0,tabIndex:_?-1:0,style:lg}))});Tm.propTypes={};function E0(a,s){function i(r){return r.displayName||r.name||"Component"}return function(l){var c=[],d;function h(){d=a(c.map(function(f){return f.props})),s(d)}var p=(function(f){DS(b,f);function b(){return f.apply(this,arguments)||this}b.peek=function(){return d};var y=b.prototype;return y.componentDidMount=function(){c.push(this),h()},y.componentDidUpdate=function(){h()},y.componentWillUnmount=function(){var v=c.indexOf(this);c.splice(v,1),h()},y.render=function(){return _e.createElement(l,this.props)},b})(RT);return qS(p,"displayName","SideEffect("+i(l)+")"),p}}var oo=function(a){for(var s=Array(a.length),i=0;i=0}).sort(L0)},B0=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],Im=B0.join(","),F0="".concat(Im,", [data-focus-guard]"),Mk=function(a,s){return oo((a.shadowRoot||a).children).reduce(function(i,r){return i.concat(r.matches(s?F0:Im)?[r]:[],Mk(r))},[])},j0=function(a,s){var i;return a instanceof HTMLIFrameElement&&(!((i=a.contentDocument)===null||i===void 0)&&i.body)?Bn([a.contentDocument.body],s):[a]},Bn=function(a,s){return a.reduce(function(i,r){var l,c=Mk(r,s),d=(l=[]).concat.apply(l,c.map(function(h){return j0(h,s)}));return i.concat(d,r.parentNode?oo(r.parentNode.querySelectorAll(Im)).filter(function(h){return h===r}):[])},[])},z0=function(a){var s=a.querySelectorAll("[".concat($0,"]"));return oo(s).map(function(i){return Bn([i])}).reduce(function(i,r){return i.concat(r)},[])},xm=function(a,s){return oo(a).filter(function(i){return Dk(s,i)}).filter(function(i){return R0(i)})},M_=function(a,s){return s===void 0&&(s=new Map),oo(a).filter(function(i){return Ak(s,i)})},Dm=function(a,s,i){return Em(xm(Bn(a,i),s),!0,i)},ea=function(a,s){return Em(xm(Bn(a),s),!1)},U0=function(a,s){return xm(z0(a),s)},xi=function(a,s){return a.shadowRoot?xi(a.shadowRoot,s):Object.getPrototypeOf(a).contains!==void 0&&Object.getPrototypeOf(a).contains.call(a,s)?!0:oo(a.children).some(function(i){var r;if(i instanceof HTMLIFrameElement){var l=(r=i.contentDocument)===null||r===void 0?void 0:r.body;return l?xi(l,s):!1}return xi(i,s)})},H0=function(a){for(var s=new Set,i=a.length,r=0;r0&&s.add(l),(c&Node.DOCUMENT_POSITION_CONTAINS)>0&&s.add(r)}return a.filter(function(d,h){return!s.has(h)})},Lk=function(a){return a.parentNode?Lk(a.parentNode):a},Am=function(a){var s=Ri(a);return s.filter(Boolean).reduce(function(i,r){var l=r.getAttribute(Qg);return i.push.apply(i,l?H0(oo(Lk(r).querySelectorAll("[".concat(Qg,'="').concat(l,'"]:not([').concat(wk,'="disabled"])')))):[r]),i},[])},W0=function(a){try{return a()}catch{return}},ta=function(a){if(a===void 0&&(a=document),!(!a||!a.activeElement)){var s=a.activeElement;return s.shadowRoot?ta(s.shadowRoot):s instanceof HTMLIFrameElement&&W0(function(){return s.contentWindow.document})?ta(s.contentWindow.document):s}},G0=function(a,s){return a===s},V0=function(a,s){return!!oo(a.querySelectorAll("iframe")).some(function(i){return G0(i,s)})},Pk=function(a,s){return s===void 0&&(s=ta(Ek(a).ownerDocument)),!s||s.dataset&&s.dataset.focusGuard?!1:Am(a).some(function(i){return xi(i,s)||V0(i,s)})},K0=function(a){a===void 0&&(a=document);var s=ta(a);return s?oo(a.querySelectorAll("[".concat(f0,"]"))).some(function(i){return xi(i,s)}):!1},Y0=function(a,s){return s.filter(Nk).filter(function(i){return i.name===a.name}).filter(function(i){return i.checked})[0]||a},Om=function(a,s){return Nk(a)&&a.name?Y0(a,s):a},J0=function(a){var s=new Set;return a.forEach(function(i){return s.add(Om(i,a))}),a.filter(function(i){return s.has(i)})},L_=function(a){return a[0]&&a.length>1?Om(a[0],a):a[0]},P_=function(a,s){return a.indexOf(Om(s,a))},tm="NEW_FOCUS",q0=function(a,s,i,r,l){var c=a.length,d=a[0],h=a[c-1],p=Sm(r);if(!(r&&a.indexOf(r)>=0)){var f=r!==void 0?i.indexOf(r):-1,b=l?i.indexOf(l):f,y=l?a.indexOf(l):-1;if(f===-1)return y!==-1?y:tm;if(y===-1)return tm;var w=f-b,v=i.indexOf(d),_=i.indexOf(h),$=J0(i),S=r!==void 0?$.indexOf(r):-1,T=l?$.indexOf(l):S,E=$.filter(function(z){return z.tabIndex>=0}),D=r!==void 0?E.indexOf(r):-1,M=l?E.indexOf(l):D,P=D>=0&&M>=0?M-D:T-S;if(!w&&y>=0||s.length===0)return y;var W=P_(a,s[0]),G=P_(a,s[s.length-1]);if(f<=v&&p&&Math.abs(w)>1)return G;if(f>=_&&p&&Math.abs(w)>1)return W;if(w&&Math.abs(P)>1)return y;if(f<=v)return G;if(f>_)return W;if(w)return Math.abs(w)>1?y:(c+y+w)%c}},X0=function(a){return function(s){var i,r=(i=Ok(s))===null||i===void 0?void 0:i.autofocus;return s.autofocus||r!==void 0&&r!=="false"||a.indexOf(s)>=0}},B_=function(a,s,i){var r=a.map(function(c){var d=c.node;return d}),l=M_(r.filter(X0(i)));return l&&l.length?L_(l):L_(M_(s))},sm=function(a,s){return s===void 0&&(s=[]),s.push(a),a.parentNode&&sm(a.parentNode.host||a.parentNode,s),s},cg=function(a,s){for(var i=sm(a),r=sm(s),l=0;l=0)return c}return!1},Bk=function(a,s,i){var r=Ri(a),l=Ri(s),c=r[0],d=!1;return l.filter(Boolean).forEach(function(h){d=cg(d||h,h)||d,i.filter(Boolean).forEach(function(p){var f=cg(c,p);f&&(!d||xi(f,d)?d=f:d=cg(f,d))})}),d},F_=function(a,s){return a.reduce(function(i,r){return i.concat(U0(r,s))},[])},Z0=function(a,s){var i=new Map;return s.forEach(function(r){return i.set(r.node,r)}),a.map(function(r){return i.get(r)}).filter(M0)},Q0=function(a,s){var i=ta(Ri(a).length>0?document:Ek(a).ownerDocument),r=Am(a).filter(em),l=Bk(i||a,a,r),c=new Map,d=ea(r,c),h=d.filter(function(_){var $=_.node;return em($)});if(h[0]){var p=ea([l],c).map(function(_){var $=_.node;return $}),f=Z0(p,h),b=f.map(function(_){var $=_.node;return $}),y=f.filter(function(_){var $=_.tabIndex;return $>=0}).map(function(_){var $=_.node;return $}),w=q0(b,y,p,i,s);if(w===tm){var v=B_(d,y,F_(r,c))||B_(d,b,F_(r,c));if(v)return{node:v};console.warn("focus-lock: cannot find any node to move focus into");return}return w===void 0?w:f[w]}},eD=function(a){var s=Am(a).filter(em),i=Bk(a,a,s),r=Em(Bn([i],!0),!0,!0),l=Bn(s,!1);return r.map(function(c){var d=c.node,h=c.index;return{node:d,index:h,lockItem:l.indexOf(d)>=0,guard:Sm(d)}})},Rm=function(a,s){a&&("focus"in a&&a.focus(s),"contentWindow"in a&&a.contentWindow&&a.contentWindow.focus())},ug=0,dg=!1,Fk=function(a,s,i){i===void 0&&(i={});var r=Q0(a,s);if(!dg&&r){if(ug>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),dg=!0,setTimeout(function(){dg=!1},1);return}ug++,Rm(r.node,i.focusOptions),ug--}};function Hr(a){if(!a)return null;if(typeof WeakRef>"u")return function(){return a||null};var s=a?new WeakRef(a):null;return function(){return(s==null?void 0:s.deref())||null}}var tD=function(a){if(!a)return null;for(var s=[],i=a;i&&i!==document.body;)s.push({current:Hr(i),parent:Hr(i.parentElement),left:Hr(i.previousElementSibling),right:Hr(i.nextElementSibling)}),i=i.parentElement;return{element:Hr(a),stack:s,ownerDocument:a.ownerDocument}},sD=function(a){var s,i,r,l,c;if(a)for(var d=a.stack,h=a.ownerDocument,p=new Map,f=0,b=d;f-1&&(S.filter(function(E){var D=E.guard,M=E.node;return D&&M.dataset.focusAutoGuard}).forEach(function(E){var D=E.node;return D.removeAttribute("tabIndex")}),z_(T,S.length,1,S),z_(T,-1,-1,S))}}}return s},Gk=function(s){Sc()&&s&&(s.stopPropagation(),s.preventDefault())},Lm=function(){return Nm(Sc)},yD=function(s){var i=s.target,r=s.currentTarget;r.contains(i)||gD(r,i)},_D=function(){return null},Vk=function(){Mm=!0},Kk=function(){Mm=!1,sa="just",Nm(function(){sa="meanwhile"})},wD=function(){document.addEventListener("focusin",Gk),document.addEventListener("focusout",Lm),window.addEventListener("focus",Vk),window.addEventListener("blur",Kk)},kD=function(){document.removeEventListener("focusin",Gk),document.removeEventListener("focusout",Lm),window.removeEventListener("focus",Vk),window.removeEventListener("blur",Kk)};function CD(a){return a.filter(function(s){var i=s.disabled;return!i})}var Yk={moveFocusInside:Fk,focusInside:Pk,focusNextElement:rD,focusPrevElement:aD,focusFirstElement:lD,focusLastElement:cD,captureFocusRestore:jk};function TD(a){var s=a.slice(-1)[0];s&&!Rn&&wD();var i=Rn,r=i&&s&&s.id===i.id;Rn=s,i&&!r&&(i.onDeactivation(),a.filter(function(l){var c=l.id;return c===i.id}).length||i.returnFocus(!s)),s?(ts=null,(!r||i.observed!==s.observed)&&s.onActivation(Yk),Sc(),Nm(Sc)):(kD(),ts=null)}Tk.assignSyncMedium(yD);Sk.assignMedium(Lm);k0.assignMedium(function(a){return a(Yk)});const SD=E0(CD,TD)(_D);var Jk=Iw(function(s,i){return _e.createElement(Tm,Ig({sideCar:SD,ref:i},s))}),qk=Tm.propTypes||{};qk.sideCar;AS(qk,["sideCar"]);Jk.propTypes={};var Xk={exports:{}},ct={};var Pm=Symbol.for("react.element"),Bm=Symbol.for("react.portal"),ou=Symbol.for("react.fragment"),iu=Symbol.for("react.strict_mode"),nu=Symbol.for("react.profiler"),ru=Symbol.for("react.provider"),au=Symbol.for("react.context"),ED=Symbol.for("react.server_context"),lu=Symbol.for("react.forward_ref"),cu=Symbol.for("react.suspense"),uu=Symbol.for("react.suspense_list"),du=Symbol.for("react.memo"),hu=Symbol.for("react.lazy"),ID=Symbol.for("react.offscreen"),Zk;Zk=Symbol.for("react.module.reference");function Cs(a){if(typeof a=="object"&&a!==null){var s=a.$$typeof;switch(s){case Pm:switch(a=a.type,a){case ou:case nu:case iu:case cu:case uu:return a;default:switch(a=a&&a.$$typeof,a){case ED:case au:case lu:case hu:case du:case ru:return a;default:return s}}case Bm:return s}}}ct.ContextConsumer=au;ct.ContextProvider=ru;ct.Element=Pm;ct.ForwardRef=lu;ct.Fragment=ou;ct.Lazy=hu;ct.Memo=du;ct.Portal=Bm;ct.Profiler=nu;ct.StrictMode=iu;ct.Suspense=cu;ct.SuspenseList=uu;ct.isAsyncMode=function(){return!1};ct.isConcurrentMode=function(){return!1};ct.isContextConsumer=function(a){return Cs(a)===au};ct.isContextProvider=function(a){return Cs(a)===ru};ct.isElement=function(a){return typeof a=="object"&&a!==null&&a.$$typeof===Pm};ct.isForwardRef=function(a){return Cs(a)===lu};ct.isFragment=function(a){return Cs(a)===ou};ct.isLazy=function(a){return Cs(a)===hu};ct.isMemo=function(a){return Cs(a)===du};ct.isPortal=function(a){return Cs(a)===Bm};ct.isProfiler=function(a){return Cs(a)===nu};ct.isStrictMode=function(a){return Cs(a)===iu};ct.isSuspense=function(a){return Cs(a)===cu};ct.isSuspenseList=function(a){return Cs(a)===uu};ct.isValidElementType=function(a){return typeof a=="string"||typeof a=="function"||a===ou||a===nu||a===iu||a===cu||a===uu||a===ID||typeof a=="object"&&a!==null&&(a.$$typeof===hu||a.$$typeof===du||a.$$typeof===ru||a.$$typeof===au||a.$$typeof===lu||a.$$typeof===Zk||a.getModuleId!==void 0)};ct.typeOf=Cs;Xk.exports=ct;var Qk=Xk.exports;function xD(a){function s(N,te,q,se,j){for(var Te=0,ae=0,we=0,Ie=0,Ne,Ae,We=0,k=0,X,Y=X=Ne=0,O=0,A=0,U=0,H=0,ue=q.length,V=ue-1,be,pe="",fe="",Le="",Ue="",Be;ONe)&&(H=(pe=pe.replace(" ",":")).length),0se&&(se=(te=te.trim()).charCodeAt(0)),se){case 38:return te.replace(T,"$1"+N.trim());case 58:return N.trim()+te.replace(T,"$1"+N.trim());default:if(0<1*q&&0ae.charCodeAt(8))break;case 115:j=j.replace(ae,"-webkit-"+ae)+";"+j;break;case 207:case 102:j=j.replace(ae,"-webkit-"+(102q.charCodeAt(0)&&(q=q.trim()),B=q,q=[B],01?s-1:0),r=1;r0?" Args: "+i.join(", "):""))}var RD=(function(){function a(i){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=i}var s=a.prototype;return s.indexOfGroup=function(i){for(var r=0,l=0;l=this.groupSizes.length){for(var l=this.groupSizes,c=l.length,d=c;i>=d;)(d<<=1)<0&&ga(16,""+i);this.groupSizes=new Uint32Array(d),this.groupSizes.set(l),this.length=d;for(var h=c;h=this.length||this.groupSizes[i]===0)return r;for(var l=this.groupSizes[i],c=this.indexOfGroup(i),d=c+l,h=c;h=Yr&&(Yr=s+1),yc.set(a,s),Ic.set(s,a)},LD="style["+Fn+'][data-styled-version="5.3.11"]',PD=new RegExp("^"+Fn+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),BD=function(a,s,i){for(var r,l=i.split(","),c=0,d=l.length;c=0;f--){var b=p[f];if(b&&b.nodeType===1&&b.hasAttribute(Fn))return b}})(i),c=l!==void 0?l.nextSibling:null;r.setAttribute(Fn,"active"),r.setAttribute("data-styled-version","5.3.11");var d=jD();return d&&r.setAttribute("nonce",d),i.insertBefore(r,c),r},zD=(function(){function a(i){var r=this.element=eC(i);r.appendChild(document.createTextNode("")),this.sheet=(function(l){if(l.sheet)return l.sheet;for(var c=document.styleSheets,d=0,h=c.length;d=0){var l=document.createTextNode(r),c=this.nodes[i];return this.element.insertBefore(l,c||null),this.length++,!0}return!1},s.deleteRule=function(i){this.element.removeChild(this.nodes[i]),this.length--},s.getRule=function(i){return i0&&(y+=w+",")})),c+=""+f+b+'{content:"'+y+`"}/*!sc*/ -`}}}return c})(this)},a})(),GD=/(a)(d)/gi,G_=function(a){return String.fromCharCode(a+(a>25?39:97))};function sm(a){var s,i="";for(s=Math.abs(a);s>52;s=s/52|0)i=G_(s%52)+i;return(G_(s%52)+i).replace(GD,"$1-$2")}var An=function(a,s){for(var i=s.length;i;)a=33*a^s.charCodeAt(--i);return a},tC=function(a){return An(5381,a)};function sC(a){for(var s=0;s>>0);if(!i.hasNameForId(l,h)){var p=r(d,"."+h,void 0,l);i.insertRules(l,h,p)}c.push(h),this.staticRulesId=h}else{for(var f=this.rules.length,b=An(this.baseHash,r.hash),y="",w=0;w>>0);if(!i.hasNameForId(l,S)){var T=r(y,"."+S,void 0,l);i.insertRules(l,S,T)}c.push(S)}}return c.join(" ")},a})(),YD=/^\s*\/\/.*$/gm,JD=[":","[",".","#"];function qD(a){var s,i,r,l,c=Yo,d=c.options,h=d===void 0?Yo:d,p=c.plugins,f=p===void 0?Ec:p,b=new xD(h),y=[],w=(function($){function S(T){if(T)try{$(T+"}")}catch{}}return function(T,E,D,M,P,W,G,z,Z,he){switch(T){case 1:if(Z===0&&E.charCodeAt(0)===64)return $(E+";"),"";break;case 2:if(z===0)return E+"/*|*/";break;case 3:switch(z){case 102:case 112:return $(D[0]+E),"";default:return E+(he===0?"/*|*/":"")}case-2:E.split("/*|*/}").forEach(S)}}})((function($){y.push($)})),v=function($,S,T){return S===0&&JD.indexOf(T[i.length])!==-1||T.match(l)?$:"."+s};function _($,S,T,E){E===void 0&&(E="&");var D=$.replace(YD,""),M=S&&T?T+" "+S+" { "+D+" }":D;return s=E,i=S,r=new RegExp("\\"+i+"\\b","g"),l=new RegExp("(\\"+i+"\\b){2,}"),b(T||!S?"":S,M)}return b.use([].concat(f,[function($,S,T){$===2&&T.length&&T[0].lastIndexOf(i)>0&&(T[0]=T[0].replace(r,v))},w,function($){if($===-2){var S=y;return y=[],S}}])),_.hash=f.length?f.reduce((function($,S){return S.name||ga(15),An($,S.name)}),5381).toString():"",_}var oC=_e.createContext();oC.Consumer;var iC=_e.createContext(),XD=(iC.Consumer,new xc),om=qD();function nC(){return ia(oC)||XD}function rC(){return ia(iC)||om}var ZD=(function(){function a(s,i){var r=this;this.inject=function(l,c){c===void 0&&(c=om);var d=r.name+c.hash;l.hasNameForId(r.id,d)||l.insertRules(r.id,d,c(r.rules,d,"@keyframes"))},this.toString=function(){return ga(12,String(r.name))},this.name=s,this.id="sc-keyframes-"+s,this.rules=i}return a.prototype.getName=function(s){return s===void 0&&(s=om),this.name+s.hash},a})(),QD=/([A-Z])/,eA=/([A-Z])/g,tA=/^ms-/,sA=function(a){return"-"+a.toLowerCase()};function V_(a){return QD.test(a)?a.replace(eA,sA).replace(tA,"-ms-"):a}var K_=function(a){return a==null||a===!1||a===""};function Ni(a,s,i,r){if(Array.isArray(a)){for(var l,c=[],d=0,h=a.length;d1?s-1:0),r=1;r?@[\\\]^`{|}~-]+/g,iA=/(^-|-$)/g;function ug(a){return a.replace(oA,"-").replace(iA,"")}var cC=function(a){return sm(tC(a)>>>0)};function ac(a){return typeof a=="string"&&!0}var im=function(a){return typeof a=="function"||typeof a=="object"&&a!==null&&!Array.isArray(a)},nA=function(a){return a!=="__proto__"&&a!=="constructor"&&a!=="prototype"};function rA(a,s,i){var r=a[i];im(s)&&im(r)?uC(r,s):a[i]=s}function uC(a){for(var s=arguments.length,i=new Array(s>1?s-1:0),r=1;r=0||(he[z]=W[z]);return he})(s,["componentId"]),P=D&&D+"-"+(ac(E)?E:ug(H_(E)));return dC(E,to({},M,{attrs:w,componentId:P}),i)},Object.defineProperty(_,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(E){this._foldedDefaultProps=r?uC({},a.defaultProps,E):E}}),Object.defineProperty(_,"toString",{value:function(){return"."+_.styledComponentId}}),l&&OS(_,a,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),_}var ks=function(a){return(function s(i,r,l){if(l===void 0&&(l=Yo),!Qk.isValidElementType(r))return ga(1,String(r));var c=function(){return i(r,l,aC.apply(void 0,arguments))};return c.withConfig=function(d){return s(i,r,to({},l,{},d))},c.attrs=function(d){return s(i,r,to({},l,{attrs:Array.prototype.concat(l.attrs,d).filter(Boolean)}))},c})(dC,a)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(a){ks[a]=ks(a)}));var aA=(function(){function a(i,r){this.rules=i,this.componentId=r,this.isStatic=sC(i),xc.registerId(this.componentId+1)}var s=a.prototype;return s.createStyles=function(i,r,l,c){var d=c(Ni(this.rules,r,l,c).join(""),""),h=this.componentId+i;l.insertRules(h,h,d)},s.removeStyles=function(i,r){r.clearRules(this.componentId+i)},s.renderStyles=function(i,r,l,c){i>2&&xc.registerId(this.componentId+i),this.removeStyles(i,l),this.createStyles(i,r,l,c)},a})();function lA(a){for(var s=arguments.length,i=new Array(s>1?s-1:0),r=1;ra.length)&&(s=a.length);for(var i=0,r=Array(s);i=a.length?{done:!0}:{done:!1,value:a[r++]}},e:function(p){throw p},f:l}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var c,d=!0,h=!1;return{s:function(){i=i.call(a)},n:function(){var p=i.next();return d=p.done,p},e:function(p){h=!0,c=p},f:function(){try{d||i.return==null||i.return()}finally{if(h)throw c}}}}function vs(a,s,i){return(s=pC(s))in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function Dc(a){return Dc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(s){return s.__proto__||Object.getPrototypeOf(s)},Dc(a)}function mA(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(s&&s.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),s&&nm(a,s)}function hC(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(hC=function(){return!!a})()}function fA(a,s){var i=a==null?null:typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(i!=null){var r,l,c,d,h=[],p=!0,f=!1;try{if(c=(i=i.call(a)).next,s!==0)for(;!(p=(r=c.call(i)).done)&&(h.push(r.value),h.length!==s);p=!0);}catch(b){f=!0,l=b}finally{try{if(!p&&i.return!=null&&(d=i.return(),Object(d)!==d))return}finally{if(f)throw l}}return h}}function $A(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q_(a,s){var i=Object.keys(a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(a);s&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(a,l).enumerable})),i.push.apply(i,r)}return i}function Ac(a){for(var s=1;s=0;f--){var b=p[f];if(b&&b.nodeType===1&&b.hasAttribute(Fn))return b}})(i),c=l!==void 0?l.nextSibling:null;r.setAttribute(Fn,"active"),r.setAttribute("data-styled-version","5.3.11");var d=jD();return d&&r.setAttribute("nonce",d),i.insertBefore(r,c),r},zD=(function(){function a(i){var r=this.element=eC(i);r.appendChild(document.createTextNode("")),this.sheet=(function(l){if(l.sheet)return l.sheet;for(var c=document.styleSheets,d=0,h=c.length;d=0){var l=document.createTextNode(r),c=this.nodes[i];return this.element.insertBefore(l,c||null),this.length++,!0}return!1},s.deleteRule=function(i){this.element.removeChild(this.nodes[i]),this.length--},s.getRule=function(i){return i0&&(y+=w+",")})),c+=""+f+b+'{content:"'+y+`"}/*!sc*/ +`}}}return c})(this)},a})(),GD=/(a)(d)/gi,G_=function(a){return String.fromCharCode(a+(a>25?39:97))};function im(a){var s,i="";for(s=Math.abs(a);s>52;s=s/52|0)i=G_(s%52)+i;return(G_(s%52)+i).replace(GD,"$1-$2")}var An=function(a,s){for(var i=s.length;i;)a=33*a^s.charCodeAt(--i);return a},tC=function(a){return An(5381,a)};function sC(a){for(var s=0;s>>0);if(!i.hasNameForId(l,h)){var p=r(d,"."+h,void 0,l);i.insertRules(l,h,p)}c.push(h),this.staticRulesId=h}else{for(var f=this.rules.length,b=An(this.baseHash,r.hash),y="",w=0;w>>0);if(!i.hasNameForId(l,S)){var T=r(y,"."+S,void 0,l);i.insertRules(l,S,T)}c.push(S)}}return c.join(" ")},a})(),YD=/^\s*\/\/.*$/gm,JD=[":","[",".","#"];function qD(a){var s,i,r,l,c=Yo,d=c.options,h=d===void 0?Yo:d,p=c.plugins,f=p===void 0?Ec:p,b=new xD(h),y=[],w=(function($){function S(T){if(T)try{$(T+"}")}catch{}}return function(T,E,D,M,P,W,G,z,Z,he){switch(T){case 1:if(Z===0&&E.charCodeAt(0)===64)return $(E+";"),"";break;case 2:if(z===0)return E+"/*|*/";break;case 3:switch(z){case 102:case 112:return $(D[0]+E),"";default:return E+(he===0?"/*|*/":"")}case-2:E.split("/*|*/}").forEach(S)}}})((function($){y.push($)})),v=function($,S,T){return S===0&&JD.indexOf(T[i.length])!==-1||T.match(l)?$:"."+s};function _($,S,T,E){E===void 0&&(E="&");var D=$.replace(YD,""),M=S&&T?T+" "+S+" { "+D+" }":D;return s=E,i=S,r=new RegExp("\\"+i+"\\b","g"),l=new RegExp("(\\"+i+"\\b){2,}"),b(T||!S?"":S,M)}return b.use([].concat(f,[function($,S,T){$===2&&T.length&&T[0].lastIndexOf(i)>0&&(T[0]=T[0].replace(r,v))},w,function($){if($===-2){var S=y;return y=[],S}}])),_.hash=f.length?f.reduce((function($,S){return S.name||ga(15),An($,S.name)}),5381).toString():"",_}var oC=_e.createContext();oC.Consumer;var iC=_e.createContext(),XD=(iC.Consumer,new xc),nm=qD();function nC(){return ia(oC)||XD}function rC(){return ia(iC)||nm}var ZD=(function(){function a(s,i){var r=this;this.inject=function(l,c){c===void 0&&(c=nm);var d=r.name+c.hash;l.hasNameForId(r.id,d)||l.insertRules(r.id,d,c(r.rules,d,"@keyframes"))},this.toString=function(){return ga(12,String(r.name))},this.name=s,this.id="sc-keyframes-"+s,this.rules=i}return a.prototype.getName=function(s){return s===void 0&&(s=nm),this.name+s.hash},a})(),QD=/([A-Z])/,eA=/([A-Z])/g,tA=/^ms-/,sA=function(a){return"-"+a.toLowerCase()};function V_(a){return QD.test(a)?a.replace(eA,sA).replace(tA,"-ms-"):a}var K_=function(a){return a==null||a===!1||a===""};function Ni(a,s,i,r){if(Array.isArray(a)){for(var l,c=[],d=0,h=a.length;d1?s-1:0),r=1;r?@[\\\]^`{|}~-]+/g,iA=/(^-|-$)/g;function hg(a){return a.replace(oA,"-").replace(iA,"")}var cC=function(a){return im(tC(a)>>>0)};function ac(a){return typeof a=="string"&&!0}var rm=function(a){return typeof a=="function"||typeof a=="object"&&a!==null&&!Array.isArray(a)},nA=function(a){return a!=="__proto__"&&a!=="constructor"&&a!=="prototype"};function rA(a,s,i){var r=a[i];rm(s)&&rm(r)?uC(r,s):a[i]=s}function uC(a){for(var s=arguments.length,i=new Array(s>1?s-1:0),r=1;r=0||(he[z]=W[z]);return he})(s,["componentId"]),P=D&&D+"-"+(ac(E)?E:hg(H_(E)));return dC(E,to({},M,{attrs:w,componentId:P}),i)},Object.defineProperty(_,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(E){this._foldedDefaultProps=r?uC({},a.defaultProps,E):E}}),Object.defineProperty(_,"toString",{value:function(){return"."+_.styledComponentId}}),l&&OS(_,a,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),_}var ks=function(a){return(function s(i,r,l){if(l===void 0&&(l=Yo),!Qk.isValidElementType(r))return ga(1,String(r));var c=function(){return i(r,l,aC.apply(void 0,arguments))};return c.withConfig=function(d){return s(i,r,to({},l,{},d))},c.attrs=function(d){return s(i,r,to({},l,{attrs:Array.prototype.concat(l.attrs,d).filter(Boolean)}))},c})(dC,a)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(a){ks[a]=ks(a)}));var aA=(function(){function a(i,r){this.rules=i,this.componentId=r,this.isStatic=sC(i),xc.registerId(this.componentId+1)}var s=a.prototype;return s.createStyles=function(i,r,l,c){var d=c(Ni(this.rules,r,l,c).join(""),""),h=this.componentId+i;l.insertRules(h,h,d)},s.removeStyles=function(i,r){r.clearRules(this.componentId+i)},s.renderStyles=function(i,r,l,c){i>2&&xc.registerId(this.componentId+i),this.removeStyles(i,l),this.createStyles(i,r,l,c)},a})();function lA(a){for(var s=arguments.length,i=new Array(s>1?s-1:0),r=1;ra.length)&&(s=a.length);for(var i=0,r=Array(s);i=a.length?{done:!0}:{done:!1,value:a[r++]}},e:function(p){throw p},f:l}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var c,d=!0,h=!1;return{s:function(){i=i.call(a)},n:function(){var p=i.next();return d=p.done,p},e:function(p){h=!0,c=p},f:function(){try{d||i.return==null||i.return()}finally{if(h)throw c}}}}function vs(a,s,i){return(s=pC(s))in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function Dc(a){return Dc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(s){return s.__proto__||Object.getPrototypeOf(s)},Dc(a)}function mA(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(s&&s.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),s&&am(a,s)}function hC(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(hC=function(){return!!a})()}function fA(a,s){var i=a==null?null:typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(i!=null){var r,l,c,d,h=[],p=!0,f=!1;try{if(c=(i=i.call(a)).next,s!==0)for(;!(p=(r=c.call(i)).done)&&(h.push(r.value),h.length!==s);p=!0);}catch(b){f=!0,l=b}finally{try{if(!p&&i.return!=null&&(d=i.return(),Object(d)!==d))return}finally{if(f)throw l}}return h}}function $A(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q_(a,s){var i=Object.keys(a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(a);s&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(a,l).enumerable})),i.push.apply(i,r)}return i}function Ac(a){for(var s=1;si.right&&(i.right=h.right),h.bottom>i.bottom&&(i.bottom=h.bottom),h.left=0+p&&l>=0+p&&r<=d-p&&i<=c-p}function TA(a){return a===document.querySelector("body")||a===document.querySelector("html")}var SA=function(s){return/(left|right)/.test(s)},hg=function(s,i){return s>i},pg=function(s,i){return s>i},Qs=function(s){return s<0?0:s};function EA(a){return Object.keys(a).map(function(s){return{position:s,value:a[s]}}).sort(function(s,i){return i.value-s.value}).map(function(s){return s.position})}var ow,IA=ks.div(ow||(ow=Ls([` +`])));function _c(a){var s=a.getBoundingClientRect(),i=s.top,r=s.right,l=s.bottom,c=s.left,d=s.width,h=s.height;return{top:i,right:r,bottom:l,left:c,width:d,height:h}}function bC(a,s){if(!s.highlightedSelectors)return _c(a);var i=_c(a),r=Mn(s.highlightedSelectors),l;try{for(r.s();!(l=r.n()).done;){var c=l.value,d=document.querySelector(c);if(!(!d||d.style.display==="none"||d.style.visibility==="hidden")){var h=_c(d);h.topi.right&&(i.right=h.right),h.bottom>i.bottom&&(i.bottom=h.bottom),h.left=0+p&&l>=0+p&&r<=d-p&&i<=c-p}function TA(a){return a===document.querySelector("body")||a===document.querySelector("html")}var SA=function(s){return/(left|right)/.test(s)},gg=function(s,i){return s>i},mg=function(s,i){return s>i},Qs=function(s){return s<0?0:s};function EA(a){return Object.keys(a).map(function(s){return{position:s,value:a[s]}}).sort(function(s,i){return i.value-s.value}).map(function(s){return s.position})}var ow,IA=ks.div(ow||(ow=Ls([` --reactour-accent: `,`; `,` position: fixed; @@ -151,7 +151,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho padding: 24px 30px; box-shadow: 0 0.5em 3em rgba(0, 0, 0, 0.3); color: inherit; - `):""},function(a){var s=a.targetTop,i=a.targetRight,r=a.targetBottom,l=a.targetLeft,c=a.windowWidth,d=a.windowHeight,h=a.helperWidth,p=a.helperHeight,f=a.helperPosition,b=a.padding,y={left:l,right:c-i,top:s,bottom:d-r},w=function(T){return y[T]>(SA(T)?h+b*2:p+b*2)},v=function(T){for(var E=EA(y),D=0;Db?P:b,G=pg(s+p,d)?pg(r+b,d)?r-p:r-p+b:s-b,z=G>b?G:b,Z={top:[W,s-p-b*2],right:[i+b*2,z],bottom:[W,r+b*2],left:[l-h-b*2,z],center:[c/2-h/2,d/2-p/2]};return T==="center"||w(T)?Z[T]:v(Z)},$=_(f);return"translate(".concat(Math.round($[0]),"px, ").concat(Math.round($[1]),"px)")}),iw,xA=ks.span(iw||(iw=Ls([` + `):""},function(a){var s=a.targetTop,i=a.targetRight,r=a.targetBottom,l=a.targetLeft,c=a.windowWidth,d=a.windowHeight,h=a.helperWidth,p=a.helperHeight,f=a.helperPosition,b=a.padding,y={left:l,right:c-i,top:s,bottom:d-r},w=function(T){return y[T]>(SA(T)?h+b*2:p+b*2)},v=function(T){for(var E=EA(y),D=0;Db?P:b,G=mg(s+p,d)?mg(r+b,d)?r-p:r-p+b:s-b,z=G>b?G:b,Z={top:[W,s-p-b*2],right:[i+b*2,z],bottom:[W,r+b*2],left:[l-h-b*2,z],center:[c/2-h/2,d/2-p/2]};return T==="center"||w(T)?Z[T]:v(Z)},$=_(f);return"translate(".concat(Math.round($[0]),"px, ").concat(Math.round($[1]),"px)")}),iw,xA=ks.span(iw||(iw=Ls([` position: absolute; font-family: monospace; background: var(--reactour-accent); @@ -227,7 +227,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho position: fixed; z-index: 99999; pointer-events: none; -`])),function(a){return!a.maskClassName&&.7},function(a){return!a.maskClassName&&"#000"});function vC(a){var s=a.windowWidth,i=a.windowHeight,r=a.targetWidth,l=a.targetHeight,c=a.targetTop,d=a.targetLeft,h=a.padding,p=a.rounded,f=a.roundedStep,b=a.disableInteraction,y=a.disableInteractionClassName,w=a.className,v=a.onClick,_=a.highlightedBorder,$=Qs(r+h*2),S=Qs(l+h*2),T=Qs(c-h),E=Qs(d-h),D=f?Math.min($/2,S/2):p;return _e.createElement(RA,{onClick:v,maskClassName:w},_e.createElement("svg",{width:s,height:i,xmlns:"http://www.w3.org/2000/svg",className:w},_e.createElement("defs",null,_e.createElement("mask",{id:"mask-main"},_e.createElement("rect",{x:0,y:0,width:s,height:i,fill:"white"}),_e.createElement("rect",{x:E,y:T,width:$,height:S,fill:"black"}),_e.createElement("rect",{x:E-1,y:T-1,width:D,height:D,fill:"white"}),_e.createElement("circle",{cx:E+D,cy:T+D,r:D,fill:"black"}),_e.createElement("rect",{x:E+$-D+1,y:T-1,width:D,height:D,fill:"white"}),_e.createElement("circle",{cx:E+$-D,cy:T+D,r:D,fill:"black"}),_e.createElement("rect",{x:E-1,y:T+S-D+1,width:D,height:D,fill:"white"}),_e.createElement("circle",{cx:E+D,cy:T+S-D,r:D,fill:"black"}),_e.createElement("rect",{x:E+$-D+1,y:T+S-D+1,width:D,height:D,fill:"white"}),_e.createElement("circle",{cx:E+$-D,cy:T+S-D,r:D,fill:"black "})),_e.createElement("clipPath",{id:"clip-path"},_e.createElement("rect",{x:0,y:0,width:s,height:T}),_e.createElement("rect",{x:0,y:T,width:E,height:S}),_e.createElement("rect",{x:d+r+h,y:T,width:Qs(s-r-E),height:S}),_e.createElement("rect",{x:0,y:c+l+h,width:s,height:Qs(i-l-T)}))),_e.createElement("rect",{x:0,y:0,width:s,height:i,fill:"currentColor",mask:"url(#mask-main)"}),_e.createElement("rect",{x:0,y:0,width:s,height:i,fill:"currentColor",clipPath:"url(#clip-path)",pointerEvents:"auto"}),_e.createElement("rect",{x:E,y:T,width:$,height:S,pointerEvents:"auto",fill:"transparent",display:b?"block":"none",className:y}),_&&_e.createElement("rect",{x:Qs(E+_.width/2),y:Qs(T+_.width/2),width:Qs($-_.width),height:Qs(S-_.width),pointerEvents:"auto",fill:"none",strokeWidth:_.width,stroke:_.color,rx:D-2})))}vC.propTypes={windowWidth:ke.number.isRequired,windowHeight:ke.number.isRequired,targetWidth:ke.number.isRequired,targetHeight:ke.number.isRequired,targetTop:ke.number.isRequired,targetLeft:ke.number.isRequired,padding:ke.number.isRequired,rounded:ke.number.isRequired,roundedStep:ke.bool,disableInteraction:ke.bool.isRequired,disableInteractionClassName:ke.string.isRequired,highlightedBorder:ke.shape({color:ke.string.isRequired,width:ke.number.isRequired})};var NA=(function(a){var s=a.step,i=a.refresh,r=kt(0),l=vA(r,2),c=l[0],d=l[1];return Lt(function(){if(s.resizeObservables){var h=function(w){var v=Mn(w),_;try{var $=function(){var T=_.value;if(!T.attributes)return 1;var E=s.resizeObservables.find(function(D){return T.matches(D)||T.querySelector(D)!=null});E&&d(c+1)};for(v.s();!(_=v.n()).done;)$()}catch(S){v.e(S)}finally{v.f()}},p=new MutationObserver(function(y){var w=Mn(y),v;try{for(w.s();!(v=w.n()).done;){var _=v.value;_.addedNodes.length!==0&&h(_.addedNodes),_.removedNodes.length!==0&&h(_.removedNodes)}}catch($){w.e($)}finally{w.f()}}),f=document.documentElement||document.body,b={childList:!0,subtree:!0};return p.observe(f,b),function(){p.disconnect()}}},[s,c]),Lt(function(){if(s.resizeObservables){var h=new ResizeObserver(function(w){i()}),p=Mn(s.resizeObservables),f;try{for(p.s();!(f=p.n()).done;){var b=f.value,y=document.querySelector(b);y&&h.observe(y)}}catch(w){p.e(w)}finally{p.f()}return function(){h.disconnect()}}},[s,c]),null}),MA=(function(a){var s=a.step,i=a.refresh;return Lt(function(){if(s.mutationObservables){var r=function(p){var f=Mn(p),b;try{var y=function(){var v=b.value;if(!v.attributes)return 1;var _=s.mutationObservables.find(function($){return v.matches($)||v.querySelector($)!=null});_&&i()};for(f.s();!(b=f.n()).done;)y()}catch(w){f.e(w)}finally{f.f()}},l=new MutationObserver(function(h){var p=Mn(h),f;try{for(p.s();!(f=p.n()).done;){var b=f.value;b.addedNodes.length!==0&&r(b.addedNodes),b.removedNodes.length!==0&&r(b.removedNodes)}}catch(y){p.e(y)}finally{p.f()}}),c=document.documentElement||document.body,d={childList:!0,subtree:!0};return l.observe(c,d),function(){l.disconnect()}}},[s]),null});function LA(a){var s=a.children,i=Ko(null);return i.current===null&&(i.current=document.createElement("div"),i.current.setAttribute("id","___reactour")),Lt(function(){return document.body.appendChild(i.current),function(){document.body.removeChild(i.current)}},[i]),RS(s,i.current)}var PA={disableFocusLock:ke.bool,badgeContent:ke.func,highlightedMaskClassName:ke.string,children:ke.oneOfType([ke.node,ke.element]),className:ke.string,closeButtonAriaLabel:ke.string,closeWithMask:ke.bool,inViewThreshold:ke.number,isOpen:ke.bool.isRequired,lastStepNextButton:ke.node,maskClassName:ke.string,maskSpace:ke.number,nextButton:ke.node,onAfterOpen:ke.func,onBeforeClose:ke.func,onRequestClose:ke.func,prevButton:ke.node,scrollDuration:ke.number,scrollOffset:ke.number,showButtons:ke.bool,showCloseButton:ke.bool,showNavigation:ke.bool,showNavigationNumber:ke.bool,showNumber:ke.bool,startAt:ke.number,goToStep:ke.number,getCurrentStep:ke.func,nextStep:ke.func,prevStep:ke.func,steps:ke.arrayOf(ke.shape({selector:ke.string,content:ke.oneOfType([ke.node,ke.element,ke.func]).isRequired,position:ke.oneOfType([ke.arrayOf(ke.number),ke.oneOf(["top","right","bottom","left","center"])]),action:ke.func,style:ke.object,stepInteraction:ke.bool,navDotAriaLabel:ke.string,roundedStep:ke.bool})),update:ke.string,updateDelay:ke.number,disableInteraction:ke.bool,disableDotsNavigation:ke.bool,disableKeyboardNavigation:ke.oneOfType([ke.arrayOf(ke.oneOf(["esc","right","left"])),ke.bool]),rounded:ke.number,accentColor:ke.string,highlightedBorder:ke.shape({color:ke.string.isRequired,width:ke.number.isRequired})},BA={disableFocusLock:!1,showNavigation:!0,showNavigationNumber:!0,showButtons:!0,showCloseButton:!0,closeButtonAriaLabel:"Close",showNumber:!0,scrollDuration:1,maskSpace:10,updateDelay:1,disableInteraction:!1,rounded:0,accentColor:"#007aff",closeWithMask:!0},Sn={mask:{disableInteraction:"reactour__mask--disable-interaction"},helper:{base:"reactour__helper",isOpen:"reactour__helper--is-open"},dot:{base:"reactour__dot",active:"reactour__dot--is-active"}},jm=(function(a){function s(){var i;return hA(this,s),i=dA(this,s),vs(i,"unlockFocus",function(r){i.setState({focusUnlocked:!0},r())}),vs(i,"showStep",function(){if(!(!i.helper||!i.helper.current)){var r=i.props.steps,l=i.state,c=l.current,d=l.focusUnlocked;d&&i.setState({focusUnlocked:!1});var h=r[c],p=h.selector?document.querySelector(h.selector):null,f=function(_){h.action&&typeof h.action=="function"&&i.unlockFocus(function(){return h.action(_)})};if(h.observe){var b=document.querySelector(h.observe),y={attributes:!0,childList:!0,characterData:!0};i.setState(function(v){return v.observer&&setTimeout(function(){v.observer.disconnect()},0),{observer:new MutationObserver(function(_){_.forEach(function($){if($.type==="childList"&&$.addedNodes.length>0){var S=function(){return f($.addedNodes[0])};setTimeout(function(){return i.calculateNode($.addedNodes[0],h,S)},100)}else if($.type==="childList"&&$.removedNodes.length>0){var T=function(){return f(p)};i.calculateNode(p,h,T)}})})}},function(){return i.state.observer.observe(b,y)})}else i.state.observer&&(i.state.observer.disconnect(),i.setState({observer:null}));if(p){var w=function(){return f(p)};i.calculateNode(p,h,w)}else i.setState(gg(null,h,i.helper.current),f),h.selector&&console.warn("Doesn't find a DOM node '".concat(h.selector,"'. Please check the 'steps' Tour prop Array at position ").concat(c,"."))}}),vs(i,"calculateNode",function(r,l,c){var d=i.props,h=d.scrollDuration,p=d.inViewThreshold,f=d.scrollOffset,b=bC(r,l),y=Math.max(document.documentElement.clientWidth,window.innerWidth||0),w=Math.max(document.documentElement.clientHeight,window.innerHeight||0);if(CA(Ac(Ac({},b),{},{w:y,h:w,threshold:p})))i.setState(gg(r,l,i.helper.current),c);else{var v=qx(r),_=f||(b.height>w?-25:-(w/2)+b.height/2);Kx.to(r,{context:TA(v)?window:v,duration:h,offset:_,callback:function(S){i.setState(gg(S,l,i.helper.current),c)}})}}),vs(i,"recalculateNode",function(r){var l=document.querySelector(r.selector),c=function(h){r.action&&typeof r.action=="function"&&i.unlockFocus(function(){return r.action(h)})};i.calculateNode(l,r,function(){return c(l)})}),vs(i,"maskClickHandler",function(r){var l=i.props,c=l.closeWithMask,d=l.onRequestClose;c&&!r.target.classList.contains(Sn.mask.disableInteraction)&&d(r)}),vs(i,"nextStep",function(){var r=i.props,l=r.steps,c=r.getCurrentStep;i.setState(function(d){var h=d.current0?l.current-1:l.current;return typeof r=="function"&&r(c),{current:c}},i.showStep)}),vs(i,"gotoStep",function(r){var l=i.props,c=l.steps,d=l.getCurrentStep;i.setState(function(h){var p=c[r]?r:h.current;return typeof d=="function"&&d(p),{current:p}},i.showStep)}),vs(i,"keyDownHandler",function(r){var l=i.props,c=l.onRequestClose,d=l.nextStep,h=l.prevStep,p=l.disableKeyboardNavigation;if(r.stopPropagation(),p!==!0){var f,b,y;p&&(f=p.includes("esc"),b=p.includes("right"),y=p.includes("left")),r.keyCode===27&&!f&&(r.preventDefault(),c()),r.keyCode===39&&!b&&(r.preventDefault(),typeof d=="function"?d():i.nextStep()),r.keyCode===37&&!y&&(r.preventDefault(),typeof h=="function"?h():i.prevStep())}}),i.state={isOpen:!1,current:0,top:0,right:0,bottom:0,left:0,width:0,height:0,w:0,h:0,inDOM:!1,observer:null,focusUnlocked:!1},i.helper=MT(),i.helperElement=null,i.debouncedShowStep=m0(i.showStep,70),i}return mA(s,a),gA(s,[{key:"componentDidMount",value:function(){var r=this.props,l=r.isOpen,c=r.startAt;l&&this.open(c)}},{key:"UNSAFE_componentWillReceiveProps",value:function(r){var l=this.props,c=l.isOpen,d=l.update,h=l.updateDelay;!c&&r.isOpen?this.open(r.startAt):c&&!r.isOpen&&this.close(),c&&d!==r.update&&(r.steps[this.state.current]?setTimeout(this.showStep,h):this.props.onRequestClose()),c&&r.isOpen&&this.state.current!==r.goToStep&&this.gotoStep(r.goToStep)}},{key:"componentWillUnmount",value:function(){var r=this.props.isOpen;r&&this.close(),this.state.observer&&this.state.observer.disconnect()}},{key:"open",value:function(r){var l=this,c=this.props.onAfterOpen;this.setState(function(d){return{isOpen:!0,current:r!==void 0?r:d.current}},function(){setTimeout(l.showStep,1),l.helperElement=l.helper.current,l.props.disableFocusLock||l.helper.current.focus(),c&&c(l.helperElement)}),window.addEventListener("resize",this.debouncedShowStep,!1),window.addEventListener("keydown",this.keyDownHandler,!1)}},{key:"close",value:function(){this.setState(function(r){return r.observer&&r.observer.disconnect(),{isOpen:!1,observer:null}},this.onBeforeClose),window.removeEventListener("resize",this.debouncedShowStep),window.removeEventListener("keydown",this.keyDownHandler)}},{key:"onBeforeClose",value:function(){var r=this.props.onBeforeClose;r&&r(this.helperElement)}},{key:"render",value:function(){var r=this,l=this.props,c=l.className,d=l.steps,h=l.maskClassName,p=l.showButtons,f=l.showCloseButton,b=l.closeButtonAriaLabel,y=l.showNavigation,w=l.showNavigationNumber,v=l.showNumber,_=l.onRequestClose,$=l.maskSpace,S=l.lastStepNextButton,T=l.nextButton,E=l.prevButton,D=l.badgeContent,M=l.highlightedMaskClassName,P=l.disableInteraction,W=l.disableDotsNavigation,G=l.nextStep,z=l.prevStep,Z=l.rounded,he=l.accentColor,Ce=l.CustomHelper,R=l.disableFocusLock,K=l.highlightedBorder,C=this.state,Q=C.isOpen,ve=C.current,ce=C.inDOM,ne=C.top,me=C.right,re=C.bottom,B=C.left,N=C.width,te=C.height,q=C.w,se=C.h,j=C.helperWidth,Te=C.helperHeight,ae=C.helperPosition;return Q?_e.createElement(LA,null,_e.createElement(_A,null),_e.createElement(NA,{step:d[ve],refresh:function(){return r.recalculateNode(d[ve])}}),_e.createElement(MA,{step:d[ve],refresh:function(){return r.recalculateNode(d[ve])}}),_e.createElement(vC,{onClick:this.maskClickHandler,forwardRef:function(Ie){return r.mask=Ie},windowWidth:q,windowHeight:se,targetWidth:N,targetHeight:te,targetTop:ne,targetLeft:B,padding:$,rounded:Z,roundedStep:d[ve].roundedStep,className:h,disableInteraction:d[ve].stepInteraction===!1||P?!d[ve].stepInteraction:P,disableInteractionClassName:"".concat(Sn.mask.disableInteraction," ").concat(M),highlightedBorder:K}),_e.createElement(Jk,{disabled:R,autoFocus:!1},_e.createElement(IA,{ref:this.helper,targetHeight:te,targetWidth:N,targetTop:ne,targetRight:me,targetBottom:re,targetLeft:B,windowWidth:q,windowHeight:se,helperWidth:j,helperHeight:Te,helperPosition:ae,padding:$,tabIndex:-1,current:ve,style:d[ve].style?d[ve].style:{},rounded:Z,className:A_(Sn.helper.base,c,vs({},Sn.helper.isOpen,Q)),accentColor:he,defaultStyles:!Ce,role:"dialog"},Ce?_e.createElement(Ce,{current:ve,totalSteps:d.length,gotoStep:this.gotoStep,close:_,content:d[ve]&&(typeof d[ve].content=="function"?d[ve].content({close:_,goTo:this.gotoStep,inDOM:ce,step:ve+1}):d[ve].content)},this.props.children):_e.createElement(_e.Fragment,null,this.props.children,d[ve]&&(typeof d[ve].content=="function"?d[ve].content({close:_,goTo:this.gotoStep,inDOM:ce,step:ve+1}):d[ve].content),v&&_e.createElement(xA,{"data-tour-elem":"badge",accentColor:he},typeof D=="function"?D(ve+1,d.length):ve+1),(p||y)&&_e.createElement(DA,{"data-tour-elem":"controls"},p&&_e.createElement(tw,{onClick:typeof z=="function"?z:this.prevStep,disabled:ve===0,label:E||null}),y&&_e.createElement(AA,{"data-tour-elem":"navigation"},d.map(function(we,Ie){return _e.createElement(OA,{key:"".concat(we.selector?we.selector:"undef","_").concat(Ie),onClick:function(){return r.gotoStep(Ie)},current:ve,index:Ie,accentColor:he,disabled:ve===Ie||W,showNumber:w,"data-tour-elem":"dot",className:A_(Sn.dot.base,vs({},Sn.dot.active,ve===Ie)),"aria-label":we.navDotAriaLabel})})),p&&_e.createElement(tw,{onClick:ve===d.length-1?S?_:function(){}:typeof G=="function"?G:this.nextStep,disabled:!S&&ve===d.length-1,inverted:!0,label:S&&ve===d.length-1?S:T||null})),f&&_e.createElement(kA,{onClick:_,className:"reactour__close",ariaLabel:b}))))):null}}])})(xw),gg=function(s,i,r){if(r){var l=Math.max(document.documentElement.clientWidth,window.innerWidth||0),c=Math.max(document.documentElement.clientHeight,window.innerHeight||0),d=_c(r),h=d.width,p=d.height,f={top:c+10,right:l/2+9,bottom:c/2+9,left:l/2-h/2,width:0,height:0,w:l,h:c,helperPosition:"center"};return s&&(f=bC(s,i)),function(){return Ac(Ac({w:l,h:c,helperWidth:h,helperHeight:p,helperPosition:i.position},f),{},{inDOM:!!s})}}};jm.propTypes=PA;jm.defaultProps=BA;const FA=""+new URL("blockly2js-B3Jxf2e-.svg",import.meta.url).href,jA=""+new URL("rules2js-DnYyR8mI.svg",import.meta.url).href,Ns={selectTriggers:0,addScheduleByDoubleClick:1,openTagsMenu:2,selectIntervalTag:3,selectActions:4,addActionPrintText:5,showJavascript:6,switchBackToRules:7,saveTheScript:8},zA=[{selector:".blocks-triggers",content:"Select triggers"},{selector:".block-TriggerScheduleBlock",content:"Double click to add the block"},{selector:".tag-card",content:"Open drop down menu"},{selector:".tag-card-interval",content:"Select interval"},{selector:".blocks-actions",content:"Select action blocks"},{selector:".block-ActionPrintText",content:"Double click to add the block"},{selector:".button-js-code",content:"Check the script"},{selector:".button-js-code",content:"Switch back to rules"},{selector:".button-save",content:"Save the script"}],mg=187,lc={root:{left:0,top:0,width:"100%",height:"100%",position:"fixed",background:"rgba(0, 0, 0, .3)",zIndex:2e4},connecting:{left:"40%",top:"40%",width:"20%",height:"20%",position:"absolute"},spinner:{animation:"admin-connecting-rotator 1.4s linear infinite"},path:{strokeDasharray:187,strokeDashoffset:0,transformOrigin:"center",animation:"admin-connecting-dash 1.4s ease-in-out infinite, $colors 5.6s ease-in-out infinite"}};function En(){return m.jsxs("div",{style:lc.root,children:[m.jsx("style",{children:` +`])),function(a){return!a.maskClassName&&.7},function(a){return!a.maskClassName&&"#000"});function vC(a){var s=a.windowWidth,i=a.windowHeight,r=a.targetWidth,l=a.targetHeight,c=a.targetTop,d=a.targetLeft,h=a.padding,p=a.rounded,f=a.roundedStep,b=a.disableInteraction,y=a.disableInteractionClassName,w=a.className,v=a.onClick,_=a.highlightedBorder,$=Qs(r+h*2),S=Qs(l+h*2),T=Qs(c-h),E=Qs(d-h),D=f?Math.min($/2,S/2):p;return _e.createElement(RA,{onClick:v,maskClassName:w},_e.createElement("svg",{width:s,height:i,xmlns:"http://www.w3.org/2000/svg",className:w},_e.createElement("defs",null,_e.createElement("mask",{id:"mask-main"},_e.createElement("rect",{x:0,y:0,width:s,height:i,fill:"white"}),_e.createElement("rect",{x:E,y:T,width:$,height:S,fill:"black"}),_e.createElement("rect",{x:E-1,y:T-1,width:D,height:D,fill:"white"}),_e.createElement("circle",{cx:E+D,cy:T+D,r:D,fill:"black"}),_e.createElement("rect",{x:E+$-D+1,y:T-1,width:D,height:D,fill:"white"}),_e.createElement("circle",{cx:E+$-D,cy:T+D,r:D,fill:"black"}),_e.createElement("rect",{x:E-1,y:T+S-D+1,width:D,height:D,fill:"white"}),_e.createElement("circle",{cx:E+D,cy:T+S-D,r:D,fill:"black"}),_e.createElement("rect",{x:E+$-D+1,y:T+S-D+1,width:D,height:D,fill:"white"}),_e.createElement("circle",{cx:E+$-D,cy:T+S-D,r:D,fill:"black "})),_e.createElement("clipPath",{id:"clip-path"},_e.createElement("rect",{x:0,y:0,width:s,height:T}),_e.createElement("rect",{x:0,y:T,width:E,height:S}),_e.createElement("rect",{x:d+r+h,y:T,width:Qs(s-r-E),height:S}),_e.createElement("rect",{x:0,y:c+l+h,width:s,height:Qs(i-l-T)}))),_e.createElement("rect",{x:0,y:0,width:s,height:i,fill:"currentColor",mask:"url(#mask-main)"}),_e.createElement("rect",{x:0,y:0,width:s,height:i,fill:"currentColor",clipPath:"url(#clip-path)",pointerEvents:"auto"}),_e.createElement("rect",{x:E,y:T,width:$,height:S,pointerEvents:"auto",fill:"transparent",display:b?"block":"none",className:y}),_&&_e.createElement("rect",{x:Qs(E+_.width/2),y:Qs(T+_.width/2),width:Qs($-_.width),height:Qs(S-_.width),pointerEvents:"auto",fill:"none",strokeWidth:_.width,stroke:_.color,rx:D-2})))}vC.propTypes={windowWidth:ke.number.isRequired,windowHeight:ke.number.isRequired,targetWidth:ke.number.isRequired,targetHeight:ke.number.isRequired,targetTop:ke.number.isRequired,targetLeft:ke.number.isRequired,padding:ke.number.isRequired,rounded:ke.number.isRequired,roundedStep:ke.bool,disableInteraction:ke.bool.isRequired,disableInteractionClassName:ke.string.isRequired,highlightedBorder:ke.shape({color:ke.string.isRequired,width:ke.number.isRequired})};var NA=(function(a){var s=a.step,i=a.refresh,r=kt(0),l=vA(r,2),c=l[0],d=l[1];return Lt(function(){if(s.resizeObservables){var h=function(w){var v=Mn(w),_;try{var $=function(){var T=_.value;if(!T.attributes)return 1;var E=s.resizeObservables.find(function(D){return T.matches(D)||T.querySelector(D)!=null});E&&d(c+1)};for(v.s();!(_=v.n()).done;)$()}catch(S){v.e(S)}finally{v.f()}},p=new MutationObserver(function(y){var w=Mn(y),v;try{for(w.s();!(v=w.n()).done;){var _=v.value;_.addedNodes.length!==0&&h(_.addedNodes),_.removedNodes.length!==0&&h(_.removedNodes)}}catch($){w.e($)}finally{w.f()}}),f=document.documentElement||document.body,b={childList:!0,subtree:!0};return p.observe(f,b),function(){p.disconnect()}}},[s,c]),Lt(function(){if(s.resizeObservables){var h=new ResizeObserver(function(w){i()}),p=Mn(s.resizeObservables),f;try{for(p.s();!(f=p.n()).done;){var b=f.value,y=document.querySelector(b);y&&h.observe(y)}}catch(w){p.e(w)}finally{p.f()}return function(){h.disconnect()}}},[s,c]),null}),MA=(function(a){var s=a.step,i=a.refresh;return Lt(function(){if(s.mutationObservables){var r=function(p){var f=Mn(p),b;try{var y=function(){var v=b.value;if(!v.attributes)return 1;var _=s.mutationObservables.find(function($){return v.matches($)||v.querySelector($)!=null});_&&i()};for(f.s();!(b=f.n()).done;)y()}catch(w){f.e(w)}finally{f.f()}},l=new MutationObserver(function(h){var p=Mn(h),f;try{for(p.s();!(f=p.n()).done;){var b=f.value;b.addedNodes.length!==0&&r(b.addedNodes),b.removedNodes.length!==0&&r(b.removedNodes)}}catch(y){p.e(y)}finally{p.f()}}),c=document.documentElement||document.body,d={childList:!0,subtree:!0};return l.observe(c,d),function(){l.disconnect()}}},[s]),null});function LA(a){var s=a.children,i=Ko(null);return i.current===null&&(i.current=document.createElement("div"),i.current.setAttribute("id","___reactour")),Lt(function(){return document.body.appendChild(i.current),function(){document.body.removeChild(i.current)}},[i]),RS(s,i.current)}var PA={disableFocusLock:ke.bool,badgeContent:ke.func,highlightedMaskClassName:ke.string,children:ke.oneOfType([ke.node,ke.element]),className:ke.string,closeButtonAriaLabel:ke.string,closeWithMask:ke.bool,inViewThreshold:ke.number,isOpen:ke.bool.isRequired,lastStepNextButton:ke.node,maskClassName:ke.string,maskSpace:ke.number,nextButton:ke.node,onAfterOpen:ke.func,onBeforeClose:ke.func,onRequestClose:ke.func,prevButton:ke.node,scrollDuration:ke.number,scrollOffset:ke.number,showButtons:ke.bool,showCloseButton:ke.bool,showNavigation:ke.bool,showNavigationNumber:ke.bool,showNumber:ke.bool,startAt:ke.number,goToStep:ke.number,getCurrentStep:ke.func,nextStep:ke.func,prevStep:ke.func,steps:ke.arrayOf(ke.shape({selector:ke.string,content:ke.oneOfType([ke.node,ke.element,ke.func]).isRequired,position:ke.oneOfType([ke.arrayOf(ke.number),ke.oneOf(["top","right","bottom","left","center"])]),action:ke.func,style:ke.object,stepInteraction:ke.bool,navDotAriaLabel:ke.string,roundedStep:ke.bool})),update:ke.string,updateDelay:ke.number,disableInteraction:ke.bool,disableDotsNavigation:ke.bool,disableKeyboardNavigation:ke.oneOfType([ke.arrayOf(ke.oneOf(["esc","right","left"])),ke.bool]),rounded:ke.number,accentColor:ke.string,highlightedBorder:ke.shape({color:ke.string.isRequired,width:ke.number.isRequired})},BA={disableFocusLock:!1,showNavigation:!0,showNavigationNumber:!0,showButtons:!0,showCloseButton:!0,closeButtonAriaLabel:"Close",showNumber:!0,scrollDuration:1,maskSpace:10,updateDelay:1,disableInteraction:!1,rounded:0,accentColor:"#007aff",closeWithMask:!0},Sn={mask:{disableInteraction:"reactour__mask--disable-interaction"},helper:{base:"reactour__helper",isOpen:"reactour__helper--is-open"},dot:{base:"reactour__dot",active:"reactour__dot--is-active"}},Um=(function(a){function s(){var i;return hA(this,s),i=dA(this,s),vs(i,"unlockFocus",function(r){i.setState({focusUnlocked:!0},r())}),vs(i,"showStep",function(){if(!(!i.helper||!i.helper.current)){var r=i.props.steps,l=i.state,c=l.current,d=l.focusUnlocked;d&&i.setState({focusUnlocked:!1});var h=r[c],p=h.selector?document.querySelector(h.selector):null,f=function(_){h.action&&typeof h.action=="function"&&i.unlockFocus(function(){return h.action(_)})};if(h.observe){var b=document.querySelector(h.observe),y={attributes:!0,childList:!0,characterData:!0};i.setState(function(v){return v.observer&&setTimeout(function(){v.observer.disconnect()},0),{observer:new MutationObserver(function(_){_.forEach(function($){if($.type==="childList"&&$.addedNodes.length>0){var S=function(){return f($.addedNodes[0])};setTimeout(function(){return i.calculateNode($.addedNodes[0],h,S)},100)}else if($.type==="childList"&&$.removedNodes.length>0){var T=function(){return f(p)};i.calculateNode(p,h,T)}})})}},function(){return i.state.observer.observe(b,y)})}else i.state.observer&&(i.state.observer.disconnect(),i.setState({observer:null}));if(p){var w=function(){return f(p)};i.calculateNode(p,h,w)}else i.setState(fg(null,h,i.helper.current),f),h.selector&&console.warn("Doesn't find a DOM node '".concat(h.selector,"'. Please check the 'steps' Tour prop Array at position ").concat(c,"."))}}),vs(i,"calculateNode",function(r,l,c){var d=i.props,h=d.scrollDuration,p=d.inViewThreshold,f=d.scrollOffset,b=bC(r,l),y=Math.max(document.documentElement.clientWidth,window.innerWidth||0),w=Math.max(document.documentElement.clientHeight,window.innerHeight||0);if(CA(Ac(Ac({},b),{},{w:y,h:w,threshold:p})))i.setState(fg(r,l,i.helper.current),c);else{var v=qx(r),_=f||(b.height>w?-25:-(w/2)+b.height/2);Kx.to(r,{context:TA(v)?window:v,duration:h,offset:_,callback:function(S){i.setState(fg(S,l,i.helper.current),c)}})}}),vs(i,"recalculateNode",function(r){var l=document.querySelector(r.selector),c=function(h){r.action&&typeof r.action=="function"&&i.unlockFocus(function(){return r.action(h)})};i.calculateNode(l,r,function(){return c(l)})}),vs(i,"maskClickHandler",function(r){var l=i.props,c=l.closeWithMask,d=l.onRequestClose;c&&!r.target.classList.contains(Sn.mask.disableInteraction)&&d(r)}),vs(i,"nextStep",function(){var r=i.props,l=r.steps,c=r.getCurrentStep;i.setState(function(d){var h=d.current0?l.current-1:l.current;return typeof r=="function"&&r(c),{current:c}},i.showStep)}),vs(i,"gotoStep",function(r){var l=i.props,c=l.steps,d=l.getCurrentStep;i.setState(function(h){var p=c[r]?r:h.current;return typeof d=="function"&&d(p),{current:p}},i.showStep)}),vs(i,"keyDownHandler",function(r){var l=i.props,c=l.onRequestClose,d=l.nextStep,h=l.prevStep,p=l.disableKeyboardNavigation;if(r.stopPropagation(),p!==!0){var f,b,y;p&&(f=p.includes("esc"),b=p.includes("right"),y=p.includes("left")),r.keyCode===27&&!f&&(r.preventDefault(),c()),r.keyCode===39&&!b&&(r.preventDefault(),typeof d=="function"?d():i.nextStep()),r.keyCode===37&&!y&&(r.preventDefault(),typeof h=="function"?h():i.prevStep())}}),i.state={isOpen:!1,current:0,top:0,right:0,bottom:0,left:0,width:0,height:0,w:0,h:0,inDOM:!1,observer:null,focusUnlocked:!1},i.helper=MT(),i.helperElement=null,i.debouncedShowStep=m0(i.showStep,70),i}return mA(s,a),gA(s,[{key:"componentDidMount",value:function(){var r=this.props,l=r.isOpen,c=r.startAt;l&&this.open(c)}},{key:"UNSAFE_componentWillReceiveProps",value:function(r){var l=this.props,c=l.isOpen,d=l.update,h=l.updateDelay;!c&&r.isOpen?this.open(r.startAt):c&&!r.isOpen&&this.close(),c&&d!==r.update&&(r.steps[this.state.current]?setTimeout(this.showStep,h):this.props.onRequestClose()),c&&r.isOpen&&this.state.current!==r.goToStep&&this.gotoStep(r.goToStep)}},{key:"componentWillUnmount",value:function(){var r=this.props.isOpen;r&&this.close(),this.state.observer&&this.state.observer.disconnect()}},{key:"open",value:function(r){var l=this,c=this.props.onAfterOpen;this.setState(function(d){return{isOpen:!0,current:r!==void 0?r:d.current}},function(){setTimeout(l.showStep,1),l.helperElement=l.helper.current,l.props.disableFocusLock||l.helper.current.focus(),c&&c(l.helperElement)}),window.addEventListener("resize",this.debouncedShowStep,!1),window.addEventListener("keydown",this.keyDownHandler,!1)}},{key:"close",value:function(){this.setState(function(r){return r.observer&&r.observer.disconnect(),{isOpen:!1,observer:null}},this.onBeforeClose),window.removeEventListener("resize",this.debouncedShowStep),window.removeEventListener("keydown",this.keyDownHandler)}},{key:"onBeforeClose",value:function(){var r=this.props.onBeforeClose;r&&r(this.helperElement)}},{key:"render",value:function(){var r=this,l=this.props,c=l.className,d=l.steps,h=l.maskClassName,p=l.showButtons,f=l.showCloseButton,b=l.closeButtonAriaLabel,y=l.showNavigation,w=l.showNavigationNumber,v=l.showNumber,_=l.onRequestClose,$=l.maskSpace,S=l.lastStepNextButton,T=l.nextButton,E=l.prevButton,D=l.badgeContent,M=l.highlightedMaskClassName,P=l.disableInteraction,W=l.disableDotsNavigation,G=l.nextStep,z=l.prevStep,Z=l.rounded,he=l.accentColor,Ce=l.CustomHelper,R=l.disableFocusLock,K=l.highlightedBorder,C=this.state,Q=C.isOpen,ve=C.current,ce=C.inDOM,ne=C.top,me=C.right,re=C.bottom,B=C.left,N=C.width,te=C.height,q=C.w,se=C.h,j=C.helperWidth,Te=C.helperHeight,ae=C.helperPosition;return Q?_e.createElement(LA,null,_e.createElement(_A,null),_e.createElement(NA,{step:d[ve],refresh:function(){return r.recalculateNode(d[ve])}}),_e.createElement(MA,{step:d[ve],refresh:function(){return r.recalculateNode(d[ve])}}),_e.createElement(vC,{onClick:this.maskClickHandler,forwardRef:function(Ie){return r.mask=Ie},windowWidth:q,windowHeight:se,targetWidth:N,targetHeight:te,targetTop:ne,targetLeft:B,padding:$,rounded:Z,roundedStep:d[ve].roundedStep,className:h,disableInteraction:d[ve].stepInteraction===!1||P?!d[ve].stepInteraction:P,disableInteractionClassName:"".concat(Sn.mask.disableInteraction," ").concat(M),highlightedBorder:K}),_e.createElement(Jk,{disabled:R,autoFocus:!1},_e.createElement(IA,{ref:this.helper,targetHeight:te,targetWidth:N,targetTop:ne,targetRight:me,targetBottom:re,targetLeft:B,windowWidth:q,windowHeight:se,helperWidth:j,helperHeight:Te,helperPosition:ae,padding:$,tabIndex:-1,current:ve,style:d[ve].style?d[ve].style:{},rounded:Z,className:A_(Sn.helper.base,c,vs({},Sn.helper.isOpen,Q)),accentColor:he,defaultStyles:!Ce,role:"dialog"},Ce?_e.createElement(Ce,{current:ve,totalSteps:d.length,gotoStep:this.gotoStep,close:_,content:d[ve]&&(typeof d[ve].content=="function"?d[ve].content({close:_,goTo:this.gotoStep,inDOM:ce,step:ve+1}):d[ve].content)},this.props.children):_e.createElement(_e.Fragment,null,this.props.children,d[ve]&&(typeof d[ve].content=="function"?d[ve].content({close:_,goTo:this.gotoStep,inDOM:ce,step:ve+1}):d[ve].content),v&&_e.createElement(xA,{"data-tour-elem":"badge",accentColor:he},typeof D=="function"?D(ve+1,d.length):ve+1),(p||y)&&_e.createElement(DA,{"data-tour-elem":"controls"},p&&_e.createElement(tw,{onClick:typeof z=="function"?z:this.prevStep,disabled:ve===0,label:E||null}),y&&_e.createElement(AA,{"data-tour-elem":"navigation"},d.map(function(we,Ie){return _e.createElement(OA,{key:"".concat(we.selector?we.selector:"undef","_").concat(Ie),onClick:function(){return r.gotoStep(Ie)},current:ve,index:Ie,accentColor:he,disabled:ve===Ie||W,showNumber:w,"data-tour-elem":"dot",className:A_(Sn.dot.base,vs({},Sn.dot.active,ve===Ie)),"aria-label":we.navDotAriaLabel})})),p&&_e.createElement(tw,{onClick:ve===d.length-1?S?_:function(){}:typeof G=="function"?G:this.nextStep,disabled:!S&&ve===d.length-1,inverted:!0,label:S&&ve===d.length-1?S:T||null})),f&&_e.createElement(kA,{onClick:_,className:"reactour__close",ariaLabel:b}))))):null}}])})(xw),fg=function(s,i,r){if(r){var l=Math.max(document.documentElement.clientWidth,window.innerWidth||0),c=Math.max(document.documentElement.clientHeight,window.innerHeight||0),d=_c(r),h=d.width,p=d.height,f={top:c+10,right:l/2+9,bottom:c/2+9,left:l/2-h/2,width:0,height:0,w:l,h:c,helperPosition:"center"};return s&&(f=bC(s,i)),function(){return Ac(Ac({w:l,h:c,helperWidth:h,helperHeight:p,helperPosition:i.position},f),{},{inDOM:!!s})}}};Um.propTypes=PA;Um.defaultProps=BA;const FA=""+new URL("blockly2js-B3Jxf2e-.svg",import.meta.url).href,jA=""+new URL("rules2js-DnYyR8mI.svg",import.meta.url).href,Ns={selectTriggers:0,addScheduleByDoubleClick:1,openTagsMenu:2,selectIntervalTag:3,selectActions:4,addActionPrintText:5,showJavascript:6,switchBackToRules:7,saveTheScript:8},zA=[{selector:".blocks-triggers",content:"Select triggers"},{selector:".block-TriggerScheduleBlock",content:"Double click to add the block"},{selector:".tag-card",content:"Open drop down menu"},{selector:".tag-card-interval",content:"Select interval"},{selector:".blocks-actions",content:"Select action blocks"},{selector:".block-ActionPrintText",content:"Double click to add the block"},{selector:".button-js-code",content:"Check the script"},{selector:".button-js-code",content:"Switch back to rules"},{selector:".button-save",content:"Save the script"}],$g=187,lc={root:{left:0,top:0,width:"100%",height:"100%",position:"fixed",background:"rgba(0, 0, 0, .3)",zIndex:2e4},connecting:{left:"40%",top:"40%",width:"20%",height:"20%",position:"absolute"},spinner:{animation:"admin-connecting-rotator 1.4s linear infinite"},path:{strokeDasharray:187,strokeDashoffset:0,transformOrigin:"center",animation:"admin-connecting-dash 1.4s ease-in-out infinite, $colors 5.6s ease-in-out infinite"}};function En(){return m.jsxs("div",{style:lc.root,children:[m.jsx("style",{children:` ' @keyframes admin-connecting-colors { 0% { stroke: #4285F4; @@ -247,14 +247,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho } @keyframes admin-connecting-dash { 0% { - stroke-dashoffset: ${mg}; + stroke-dashoffset: ${$g}; } 50% { - stroke-dashoffset: ${mg/4}; + stroke-dashoffset: ${$g/4}; transform: rotate(135deg); } 100% { - stroke-dashoffset: ${mg}; + stroke-dashoffset: ${$g}; transform: 'rotate(450deg); } } @@ -266,20 +266,20 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho transform: rotate(270deg); } } -`}),m.jsx("div",{style:lc.connecting,children:m.jsx("svg",{style:lc.spinner,width:"100%",height:"100%",viewBox:"0 0 66 66",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("circle",{style:lc.path,fill:"none",strokeWidth:"6",strokeLinecap:"round",cx:"33",cy:"33",r:"30"})})})]})}const UA=_e.lazy(()=>jn(()=>Promise.resolve().then(()=>vO),void 0,import.meta.url)),HA=_e.lazy(()=>jn(()=>import("./index-vgcfJH38.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url)),WA=_e.lazy(()=>jn(()=>import("./index-DnqTM0A3.js"),__vite__mapDeps([14,1,2,3,4,6,7,5,15,8,9,10,11,12]),import.meta.url)),GA=_e.lazy(()=>jn(()=>import("./ScriptEditorVanillaMonaco-DSYvOslZ.js"),__vite__mapDeps([15,1,2,3,4,6,7,5]),import.meta.url)),VA=_e.lazy(()=>jn(()=>import("./ScriptEditor-C-fO5h68.js"),__vite__mapDeps([16,1,2,3,4,6,5,15,7,17]),import.meta.url)),KA=_e.lazy(()=>jn(()=>import("./OpenAiDialog-DibIpG1Q.js"),__vite__mapDeps([18,1,2,3,4,6,5,9,19,15,7,8,10,11,12]),import.meta.url)),cw={Blockly:gk,"Javascript/js":Tc,Rules:fk,def:Tc,"TypeScript/ts":mk},YA=48,uw="#02a102",fg="#70aae9",JA=Tw[400],qA=Sw[400],je={toolbar:a=>({minHeight:38,boxShadow:"0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12)",backgroundColor:a.palette.mode==="dark"?"#1e1e1e":"#E2E2E2"}),toolbarButtons:{padding:4,marginLeft:4},toolbarButtonsDisabled:{filter:"grayscale(100%)",opacity:.5},editorDiv:a=>({height:`calc(100% - ${(parseInt(a.toolbar.height,10)||48)+38+10}px)`,width:"100%",overflow:"hidden",position:"relative"}),textButton:{marginRight:10,minHeight:24,padding:"6px 16px",height:32},saveButton:{background:"#ff9900"},tabIcon:{width:24,height:24,verticalAlign:"middle",marginBottom:2,marginRight:2,borderRadius:3},hintIcon:{padding:"0 8px 0 8px"},hintButton:{marginTop:8,marginLeft:20},tabMenuButton:{position:"absolute",top:0,right:0},tabChanged:a=>({color:a.palette.secondary.main}),tabText:{maxWidth:130,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",display:"inline-block",verticalAlign:"middle"},tabChangedIcon:{color:"#FF0000",fontSize:16,marginLeft:5},closeButton:{marginLeft:5},notRunning:{color:"#ffbc00",marginRight:8,marginLeft:8},tabButton:{minHeight:48},tabButtonWrapper:{display:"inline-block"},menuIcon:{width:18,height:18,borderRadius:2,marginRight:5}};class On extends _e.Component{getSelect=null;changedMirror={};cron={initValue:null,callback:null};scriptDialog={initValue:null,callback:null,args:null,isReturn:!1};objects;scripts;selectId={initValue:null,callback:null};confirmCallback=null;constructor(s){var c,d;super(s);let i=window.localStorage.getItem("Editor.selected")||"";const r=window.localStorage.getItem("Editor.editing")||"[]";let l;try{l=JSON.parse(r)}catch{l=[]}i&&!l.includes(i)&&l.push(i),i&&!this.props.password&&((d=(c=this.props.objects[i])==null?void 0:c.native)!=null&&d.protected)&&(i=l.find(h=>{var p,f;return!((f=(p=this.props.objects[h])==null?void 0:p.native)!=null&&f.protected)})||""),!i&&l.length&&(this.props.password?i=l[0]:i=l.find(h=>{var p,f;return!((f=(p=this.props.objects[h])==null?void 0:p.native)!=null&&f.protected)})||""),this.state={askAboutDebug:!1,astroEvents:null,blockly:null,changed:{},cmdToBlockly:"",cmdToRules:"",confirm:"",debugEnabled:!1,editing:l,insert:"",instancesLoaded:!1,isTourOpen:window.localStorage.getItem("tour")!=="true",menuDebugAnchorEl:null,menuOpened:!!this.props.menuOpened,menuTabsOpened:!1,openAiDialog:!1,triggerPrettier:1,rules:null,runningInstances:this.props.runningInstances||{},searchText:"",selected:i,showAdapterDebug:!1,showAstro:!1,showCompiledCode:!1,showCron:!1,showDebugMenu:!1,showScript:!1,showSelectId:!1,themeType:this.props.themeType,toast:"",tourStep:Ns.selectTriggers,verboseEnabled:!1,visible:s.visible},this.setChangedInAdmin(),window.systemLang=x.I18n.getLanguage(),window.main={objects:{},getObject:(h,p)=>this.props.socket.getObject(h).then(f=>p==null?void 0:p(null,f)).catch(f=>p==null?void 0:p(f)),instances:[],selectIdDialog:(h,p,f)=>{typeof p=="function"&&(f=p,p=null),this.selectId.callback=f,this.selectId.initValue=h,this.selectId.type=p,this.setState({showSelectId:!0})},cronDialog:(h,p)=>{this.cron.callback=p,this.cron.initValue=h,this.setState({showCron:!0})},showScriptDialog:(h,p,f,b)=>{this.scriptDialog.callback=b,this.scriptDialog.initValue=h,this.scriptDialog.args=p,this.scriptDialog.isReturn=f||!1,this.setState({showScript:!0})}},this.objects=s.objects,this.scripts={},this.getAllAdapterInstances().then(()=>{this.props.onSelectedChange&&this.state.selected&&setTimeout(()=>this.props.onSelectedChange(this.state.selected,this.state.editing),100)})}async getAllAdapterInstances(){const s=await this.props.socket.getAdapterInstances(!0),i={},r=s.map(l=>(i[l._id]=l,l._id));window.main.objects=i,window.main.instances=r,this.setState({instancesLoaded:!0})}static onInstanceChanged(s,i){if(s)if(!i&&window.main.instances.includes(s)){delete window.main.objects[s];const r=window.main.instances.indexOf(s);window.main.instances.splice(r,1)}else(i==null?void 0:i.type)==="instance"&&(window.main.instances.includes(s)||(window.main.instances.push(s),window.main.instances.sort()),window.main.objects[s]=i)}setChangedInAdmin(){const s=Object.keys(this.state.changed).find(i=>this.state.changed[i]);Object.keys(this.state.changed).forEach(i=>{this.changedMirror[i]=this.state.changed[i]}),Object.keys(this.changedMirror).forEach(i=>{this.state.changed[i]===void 0&&delete this.changedMirror[i]}),this.props.onChangedChanged(this.changedMirror),typeof window.parent<"u"&&window.parent&&(window.parent.configNotSaved=!!s)}componentDidMount(){window.addEventListener("beforeunload",this.onBrowserClose,!1),this.props.socket.subscribeObject("system.adapter.*",On.onInstanceChanged)}componentWillUnmount(){window.removeEventListener("beforeunload",this.onBrowserClose),this.props.socket.unsubscribeObject("system.adapter.*",On.onInstanceChanged)}onBrowserClose=s=>{const i=Object.keys(this.scripts).find(r=>JSON.stringify(this.scripts[r])!==JSON.stringify(this.getScriptFromObject(r)));if(i){console.log(`Script ${JSON.stringify(this.scripts[i])}`);const r=x.I18n.t("Configuration not saved.");return s=s||window.event,s&&(s.returnValue=r),r}};removeNonExistingScripts(s,i){s=s||this.props,i=i||{};let r=!1;if(this.state.editing&&this.state.editing.find(c=>s&&!s.objects[c])){const c=[...this.state.editing];for(let d=c.length-1;d>=0;d--)this.objects[c[d]]||(r=!0,c.splice(d,1));r&&(i.editing=c),this.state.selected&&!this.objects[this.state.selected]&&(r=!0,i.selected=c[0]||"",i.selected&&this.scripts[i.selected]&&(this.state.blockly!==(this.scripts[i.selected].engineType==="Blockly")&&(i.blockly=this.scripts[i.selected].engineType==="Blockly",r=!0),this.state.rules!==(this.scripts[i.selected].engineType==="Rules")&&(i.rules=this.scripts[i.selected].engineType==="Rules",r=!0),this.state.verboseEnabled!==this.scripts[i.selected].verbose&&(i.verboseEnabled=this.scripts[i.selected].verbose,r=!0),this.state.debugEnabled!==this.scripts[i.selected].debug&&(i.debugEnabled=this.scripts[i.selected].debug,r=!0)))}return r}UNSAFE_componentWillReceiveProps(s){var l,c,d;const i={};let r=!1;if(JSON.stringify(s.runningInstances)!==JSON.stringify(this.state.runningInstances)&&(r=!0,i.runningInstances=s.runningInstances),this.state.menuOpened!==s.menuOpened&&(i.menuOpened=s.menuOpened,r=!0),this.state.themeType!==s.themeType&&(i.themeType=s.themeType,r=!0),this.removeNonExistingScripts(s,i)&&(r=!0),this.state.searchText!==s.searchText&&(i.searchText=s.searchText,r=!0),this.objects!==s.objects){this.objects=s.objects,window.main.objects=s.objects,Object.keys(this.scripts).forEach(p=>{const f=this.scripts[p].source;this.scripts[p]=JSON.parse(JSON.stringify(this.objects[p].common)),this.scripts[p].source=f}),this.state.selected&&this.objects[this.state.selected]&&(this.scripts[this.state.selected]||=JSON.parse(JSON.stringify(this.objects[this.state.selected].common)),this.state.blockly!==(this.scripts[this.state.selected].engineType==="Blockly")&&(i.blockly=this.scripts[this.state.selected].engineType==="Blockly",r=!0),this.state.rules!==(this.scripts[this.state.selected].engineType==="Rules")&&(i.rules=this.scripts[this.state.selected].engineType==="Rules",r=!0),this.state.verboseEnabled!==this.scripts[this.state.selected].verbose&&(i.verboseEnabled=this.scripts[this.state.selected].verbose,r=!0),this.state.debugEnabled!==this.scripts[this.state.selected].debug&&(i.debugEnabled=this.scripts[this.state.selected].debug,r=!0));const h=[...this.state.editing];for(let p=h.length-1;p>=0;p--)this.objects[h[p]]||(r=!0,h.splice(p,1),this.state.changed[h[p]]!==void 0&&(i.changed||={...this.state.changed},i.changed&&delete i.changed[h[p]]));this.state.selected&&!this.objects[this.state.selected]&&(i.selected=h[0]||""),r&&(i.editing=h)}else for(const h in this.scripts)if(Object.prototype.hasOwnProperty.call(this.scripts,h)){if((l=this.objects[h])!=null&&l.common){if(this.objects[h].type==="script"){const p=this.scripts[h].source,f=JSON.parse(JSON.stringify(this.scripts[h]));f.source=this.objects[h].common.source,JSON.stringify(f)!==JSON.stringify(this.objects[h].common)&&(this.scripts[h]=JSON.parse(JSON.stringify(this.objects[h].common)),this.scripts[h].source=p),p!==this.objects[h].common.source?this.state.changed[h]?(d=this.objects[h].from)!=null&&d.startsWith("system.adapter.javascript.")&&(this.objects[h].from="system.adapter.admin.0",this.setState({toast:x.I18n.t("Script %s was modified on disk.",h.split(".").pop())})):this.props.password&&((c=this.objects[h].native)!=null&&c.protected)?this.scripts[h].source=Wg(this.props.password,this.objects[h].common.source):this.scripts[h].source=this.objects[h].common.source:this.state.changed[h]&&(i.changed||={...this.state.changed},i.changed&&(i.changed[h]=!1),r=!0)}}else if(this.scripts[h]&&(delete this.scripts[h],this.state.selected===h)){if(this.state.editing.indexOf(h)!==-1){const p=[...this.state.editing],f=p.indexOf(h);f!==-1&&(p.splice(f,1),i.editing=p,r=!0)}i.selected=this.state.editing[0]||"",r=!0}}if(s.selected&&this.state.selected!==s.selected){const h=this.getScriptFromObject(s.selected);this.scripts[s.selected]||=h;const p=h&&JSON.stringify(this.scripts[s.selected])!==JSON.stringify(h),f=[...this.state.editing];s.selected&&!f.includes(s.selected)&&(f.push(s.selected),this.props.onSelectedChange(s.selected,f),window.localStorage.setItem("Editor.editing",JSON.stringify(f))),r=!0,i.changed||={...this.state.changed},i.changed[s.selected]=!!p,i.editing=f,i.selected=s.selected,i.blockly=this.scripts[s.selected].engineType==="Blockly",i.rules=this.scripts[s.selected].engineType==="Rules",i.verboseEnabled=this.scripts[s.selected].verbose,i.debugEnabled=this.scripts[s.selected].debug,i.showCompiledCode=!1}this.state.visible!==s.visible&&(r=!0,i.visible=s.visible),r&&this.setState(i,()=>this.setChangedInAdmin())}onRestart(){var s,i;(i=(s=this.props).onRestart)==null||i.call(s,this.state.selected)}onStartStop(){var i,r,l;const s=JSON.parse(JSON.stringify(this.scripts[this.state.selected]));s.enabled=!s.enabled,this.props.password&&((i=this.props.objects[this.state.selected].native)!=null&&i.protected)&&(s.source=vc(this.props.password,s.source)),(l=(r=this.props).onChange)==null||l.call(r,this.state.selected,s)}onSave(){if(this.state.isTourOpen&&this.state.tourStep===Ns.saveTheScript&&(this.setState({isTourOpen:!1}),window.localStorage.setItem("tour","true")),this.state.changed[this.state.selected]){const s={...this.state.changed};s[this.state.selected]=!1,this.setState({changed:s},()=>{var r,l,c;this.setChangedInAdmin();const i=JSON.parse(JSON.stringify(this.scripts[this.state.selected]));this.props.password&&((r=this.props.objects[this.state.selected].native)!=null&&r.protected)&&(i.source=vc(this.props.password,i.source)),(c=(l=this.props).onChange)==null||c.call(l,this.state.selected,i)})}}onSaveAll(){const s={...this.state.changed};Object.keys(s).forEach(i=>{var r,l,c;if(s[i]){s[i]=!1;const d=JSON.parse(JSON.stringify(this.scripts[i]));this.props.password&&((r=this.props.objects[i].native)!=null&&r.protected)&&(d.source=vc(this.props.password,d.source)),(c=(l=this.props).onChange)==null||c.call(l,i,d)}}),this.setState({changed:s},()=>this.setChangedInAdmin())}onCancel(){this.scripts[this.state.selected]=this.getScriptFromObject(this.state.selected);const s={...this.state.changed};s[this.state.selected]=!1,this.setState({changed:s},()=>this.setChangedInAdmin())}onRegisterSelect(s){this.getSelect=s}onConvertBlockly2JS(){this.showConfirmDialog(x.I18n.t("It will not be possible to revert this operation."),s=>{if(s){this.scripts[this.state.selected].engineType="Javascript/js";const r=this.scripts[this.state.selected].source.split(` +`}),m.jsx("div",{style:lc.connecting,children:m.jsx("svg",{style:lc.spinner,width:"100%",height:"100%",viewBox:"0 0 66 66",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("circle",{style:lc.path,fill:"none",strokeWidth:"6",strokeLinecap:"round",cx:"33",cy:"33",r:"30"})})})]})}const UA=_e.lazy(()=>jn(()=>Promise.resolve().then(()=>vO),void 0,import.meta.url)),HA=_e.lazy(()=>jn(()=>import("./index-DWalwvIj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url)),WA=_e.lazy(()=>jn(()=>import("./index-C9EIOjDT.js"),__vite__mapDeps([14,1,2,3,4,6,7,5,15,8,9,10,11,12]),import.meta.url)),GA=_e.lazy(()=>jn(()=>import("./ScriptEditorVanillaMonaco-DSYvOslZ.js"),__vite__mapDeps([15,1,2,3,4,6,7,5]),import.meta.url)),VA=_e.lazy(()=>jn(()=>import("./ScriptEditor-C-fO5h68.js"),__vite__mapDeps([16,1,2,3,4,6,5,15,7,17]),import.meta.url)),KA=_e.lazy(()=>jn(()=>import("./OpenAiDialog-CEA56Rl4.js"),__vite__mapDeps([18,1,2,3,4,6,5,9,19,15,7,8,10,11,12]),import.meta.url)),cw={Blockly:gk,"Javascript/js":Tc,Rules:fk,def:Tc,"TypeScript/ts":mk},YA=48,uw="#02a102",bg="#70aae9",JA=Tw[400],qA=Sw[400],je={toolbar:a=>({minHeight:38,boxShadow:"0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12)",backgroundColor:a.palette.mode==="dark"?"#1e1e1e":"#E2E2E2"}),toolbarButtons:{padding:4,marginLeft:4},toolbarButtonsDisabled:{filter:"grayscale(100%)",opacity:.5},editorDiv:a=>({height:`calc(100% - ${(parseInt(a.toolbar.height,10)||48)+38+10}px)`,width:"100%",overflow:"hidden",position:"relative"}),textButton:{marginRight:10,minHeight:24,padding:"6px 16px",height:32},saveButton:{background:"#ff9900"},tabIcon:{width:24,height:24,verticalAlign:"middle",marginBottom:2,marginRight:2,borderRadius:3},hintIcon:{padding:"0 8px 0 8px"},hintButton:{marginTop:8,marginLeft:20},tabMenuButton:{position:"absolute",top:0,right:0},tabChanged:a=>({color:a.palette.secondary.main}),tabText:{maxWidth:130,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",display:"inline-block",verticalAlign:"middle"},tabChangedIcon:{color:"#FF0000",fontSize:16,marginLeft:5},closeButton:{marginLeft:5},notRunning:{color:"#ffbc00",marginRight:8,marginLeft:8},tabButton:{minHeight:48},tabButtonWrapper:{display:"inline-block"},menuIcon:{width:18,height:18,borderRadius:2,marginRight:5}};class On extends _e.Component{getSelect=null;changedMirror={};cron={initValue:null,callback:null};scriptDialog={initValue:null,callback:null,args:null,isReturn:!1};objects;scripts;selectId={initValue:null,callback:null};confirmCallback=null;constructor(s){var c,d;super(s);let i=window.localStorage.getItem("Editor.selected")||"";const r=window.localStorage.getItem("Editor.editing")||"[]";let l;try{l=JSON.parse(r)}catch{l=[]}i&&!l.includes(i)&&l.push(i),i&&!this.props.password&&((d=(c=this.props.objects[i])==null?void 0:c.native)!=null&&d.protected)&&(i=l.find(h=>{var p,f;return!((f=(p=this.props.objects[h])==null?void 0:p.native)!=null&&f.protected)})||""),!i&&l.length&&(this.props.password?i=l[0]:i=l.find(h=>{var p,f;return!((f=(p=this.props.objects[h])==null?void 0:p.native)!=null&&f.protected)})||""),this.state={askAboutDebug:!1,astroEvents:null,blockly:null,changed:{},cmdToBlockly:"",cmdToRules:"",confirm:"",debugEnabled:!1,editing:l,insert:"",instancesLoaded:!1,isTourOpen:window.localStorage.getItem("tour")!=="true",menuDebugAnchorEl:null,menuOpened:!!this.props.menuOpened,menuTabsOpened:!1,openAiDialog:!1,triggerPrettier:1,rules:null,runningInstances:this.props.runningInstances||{},searchText:"",selected:i,showAdapterDebug:!1,showAstro:!1,showCompiledCode:!1,showCron:!1,showDebugMenu:!1,showScript:!1,showSelectId:!1,themeType:this.props.themeType,toast:"",tourStep:Ns.selectTriggers,verboseEnabled:!1,visible:s.visible},this.setChangedInAdmin(),window.systemLang=x.I18n.getLanguage(),window.main={objects:{},getObject:(h,p)=>this.props.socket.getObject(h).then(f=>p==null?void 0:p(null,f)).catch(f=>p==null?void 0:p(f)),instances:[],selectIdDialog:(h,p,f)=>{typeof p=="function"&&(f=p,p=null),this.selectId.callback=f,this.selectId.initValue=h,this.selectId.type=p,this.setState({showSelectId:!0})},cronDialog:(h,p)=>{this.cron.callback=p,this.cron.initValue=h,this.setState({showCron:!0})},showScriptDialog:(h,p,f,b)=>{this.scriptDialog.callback=b,this.scriptDialog.initValue=h,this.scriptDialog.args=p,this.scriptDialog.isReturn=f||!1,this.setState({showScript:!0})}},this.objects=s.objects,this.scripts={},this.getAllAdapterInstances().then(()=>{this.props.onSelectedChange&&this.state.selected&&setTimeout(()=>this.props.onSelectedChange(this.state.selected,this.state.editing),100)})}async getAllAdapterInstances(){const s=await this.props.socket.getAdapterInstances(!0),i={},r=s.map(l=>(i[l._id]=l,l._id));window.main.objects=i,window.main.instances=r,this.setState({instancesLoaded:!0})}static onInstanceChanged(s,i){if(s)if(!i&&window.main.instances.includes(s)){delete window.main.objects[s];const r=window.main.instances.indexOf(s);window.main.instances.splice(r,1)}else(i==null?void 0:i.type)==="instance"&&(window.main.instances.includes(s)||(window.main.instances.push(s),window.main.instances.sort()),window.main.objects[s]=i)}setChangedInAdmin(){const s=Object.keys(this.state.changed).find(i=>this.state.changed[i]);Object.keys(this.state.changed).forEach(i=>{this.changedMirror[i]=this.state.changed[i]}),Object.keys(this.changedMirror).forEach(i=>{this.state.changed[i]===void 0&&delete this.changedMirror[i]}),this.props.onChangedChanged(this.changedMirror),typeof window.parent<"u"&&window.parent&&(window.parent.configNotSaved=!!s)}componentDidMount(){window.addEventListener("beforeunload",this.onBrowserClose,!1),this.props.socket.subscribeObject("system.adapter.*",On.onInstanceChanged)}componentWillUnmount(){window.removeEventListener("beforeunload",this.onBrowserClose),this.props.socket.unsubscribeObject("system.adapter.*",On.onInstanceChanged)}onBrowserClose=s=>{const i=Object.keys(this.scripts).find(r=>JSON.stringify(this.scripts[r])!==JSON.stringify(this.getScriptFromObject(r)));if(i){console.log(`Script ${JSON.stringify(this.scripts[i])}`);const r=x.I18n.t("Configuration not saved.");return s=s||window.event,s&&(s.returnValue=r),r}};removeNonExistingScripts(s,i){s=s||this.props,i=i||{};let r=!1;if(this.state.editing&&this.state.editing.find(c=>s&&!s.objects[c])){const c=[...this.state.editing];for(let d=c.length-1;d>=0;d--)this.objects[c[d]]||(r=!0,c.splice(d,1));r&&(i.editing=c),this.state.selected&&!this.objects[this.state.selected]&&(r=!0,i.selected=c[0]||"",i.selected&&this.scripts[i.selected]&&(this.state.blockly!==(this.scripts[i.selected].engineType==="Blockly")&&(i.blockly=this.scripts[i.selected].engineType==="Blockly",r=!0),this.state.rules!==(this.scripts[i.selected].engineType==="Rules")&&(i.rules=this.scripts[i.selected].engineType==="Rules",r=!0),this.state.verboseEnabled!==this.scripts[i.selected].verbose&&(i.verboseEnabled=this.scripts[i.selected].verbose,r=!0),this.state.debugEnabled!==this.scripts[i.selected].debug&&(i.debugEnabled=this.scripts[i.selected].debug,r=!0)))}return r}UNSAFE_componentWillReceiveProps(s){var l,c,d;const i={};let r=!1;if(JSON.stringify(s.runningInstances)!==JSON.stringify(this.state.runningInstances)&&(r=!0,i.runningInstances=s.runningInstances),this.state.menuOpened!==s.menuOpened&&(i.menuOpened=s.menuOpened,r=!0),this.state.themeType!==s.themeType&&(i.themeType=s.themeType,r=!0),this.removeNonExistingScripts(s,i)&&(r=!0),this.state.searchText!==s.searchText&&(i.searchText=s.searchText,r=!0),this.objects!==s.objects){this.objects=s.objects,window.main.objects=s.objects,Object.keys(this.scripts).forEach(p=>{const f=this.scripts[p].source;this.scripts[p]=JSON.parse(JSON.stringify(this.objects[p].common)),this.scripts[p].source=f}),this.state.selected&&this.objects[this.state.selected]&&(this.scripts[this.state.selected]||=JSON.parse(JSON.stringify(this.objects[this.state.selected].common)),this.state.blockly!==(this.scripts[this.state.selected].engineType==="Blockly")&&(i.blockly=this.scripts[this.state.selected].engineType==="Blockly",r=!0),this.state.rules!==(this.scripts[this.state.selected].engineType==="Rules")&&(i.rules=this.scripts[this.state.selected].engineType==="Rules",r=!0),this.state.verboseEnabled!==this.scripts[this.state.selected].verbose&&(i.verboseEnabled=this.scripts[this.state.selected].verbose,r=!0),this.state.debugEnabled!==this.scripts[this.state.selected].debug&&(i.debugEnabled=this.scripts[this.state.selected].debug,r=!0));const h=[...this.state.editing];for(let p=h.length-1;p>=0;p--)this.objects[h[p]]||(r=!0,h.splice(p,1),this.state.changed[h[p]]!==void 0&&(i.changed||={...this.state.changed},i.changed&&delete i.changed[h[p]]));this.state.selected&&!this.objects[this.state.selected]&&(i.selected=h[0]||""),r&&(i.editing=h)}else for(const h in this.scripts)if(Object.prototype.hasOwnProperty.call(this.scripts,h)){if((l=this.objects[h])!=null&&l.common){if(this.objects[h].type==="script"){const p=this.scripts[h].source,f=JSON.parse(JSON.stringify(this.scripts[h]));f.source=this.objects[h].common.source,JSON.stringify(f)!==JSON.stringify(this.objects[h].common)&&(this.scripts[h]=JSON.parse(JSON.stringify(this.objects[h].common)),this.scripts[h].source=p),p!==this.objects[h].common.source?this.state.changed[h]?(d=this.objects[h].from)!=null&&d.startsWith("system.adapter.javascript.")&&(this.objects[h].from="system.adapter.admin.0",this.setState({toast:x.I18n.t("Script %s was modified on disk.",h.split(".").pop())})):this.props.password&&((c=this.objects[h].native)!=null&&c.protected)?this.scripts[h].source=Vg(this.props.password,this.objects[h].common.source):this.scripts[h].source=this.objects[h].common.source:this.state.changed[h]&&(i.changed||={...this.state.changed},i.changed&&(i.changed[h]=!1),r=!0)}}else if(this.scripts[h]&&(delete this.scripts[h],this.state.selected===h)){if(this.state.editing.indexOf(h)!==-1){const p=[...this.state.editing],f=p.indexOf(h);f!==-1&&(p.splice(f,1),i.editing=p,r=!0)}i.selected=this.state.editing[0]||"",r=!0}}if(s.selected&&this.state.selected!==s.selected){const h=this.getScriptFromObject(s.selected);this.scripts[s.selected]||=h;const p=h&&JSON.stringify(this.scripts[s.selected])!==JSON.stringify(h),f=[...this.state.editing];s.selected&&!f.includes(s.selected)&&(f.push(s.selected),this.props.onSelectedChange(s.selected,f),window.localStorage.setItem("Editor.editing",JSON.stringify(f))),r=!0,i.changed||={...this.state.changed},i.changed[s.selected]=!!p,i.editing=f,i.selected=s.selected,i.blockly=this.scripts[s.selected].engineType==="Blockly",i.rules=this.scripts[s.selected].engineType==="Rules",i.verboseEnabled=this.scripts[s.selected].verbose,i.debugEnabled=this.scripts[s.selected].debug,i.showCompiledCode=!1}this.state.visible!==s.visible&&(r=!0,i.visible=s.visible),r&&this.setState(i,()=>this.setChangedInAdmin())}onRestart(){var s,i;(i=(s=this.props).onRestart)==null||i.call(s,this.state.selected)}onStartStop(){var i,r,l;const s=JSON.parse(JSON.stringify(this.scripts[this.state.selected]));s.enabled=!s.enabled,this.props.password&&((i=this.props.objects[this.state.selected].native)!=null&&i.protected)&&(s.source=vc(this.props.password,s.source)),(l=(r=this.props).onChange)==null||l.call(r,this.state.selected,s)}onSave(){if(this.state.isTourOpen&&this.state.tourStep===Ns.saveTheScript&&(this.setState({isTourOpen:!1}),window.localStorage.setItem("tour","true")),this.state.changed[this.state.selected]){const s={...this.state.changed};s[this.state.selected]=!1,this.setState({changed:s},()=>{var r,l,c;this.setChangedInAdmin();const i=JSON.parse(JSON.stringify(this.scripts[this.state.selected]));this.props.password&&((r=this.props.objects[this.state.selected].native)!=null&&r.protected)&&(i.source=vc(this.props.password,i.source)),(c=(l=this.props).onChange)==null||c.call(l,this.state.selected,i)})}}onSaveAll(){const s={...this.state.changed};Object.keys(s).forEach(i=>{var r,l,c;if(s[i]){s[i]=!1;const d=JSON.parse(JSON.stringify(this.scripts[i]));this.props.password&&((r=this.props.objects[i].native)!=null&&r.protected)&&(d.source=vc(this.props.password,d.source)),(c=(l=this.props).onChange)==null||c.call(l,i,d)}}),this.setState({changed:s},()=>this.setChangedInAdmin())}onCancel(){this.scripts[this.state.selected]=this.getScriptFromObject(this.state.selected);const s={...this.state.changed};s[this.state.selected]=!1,this.setState({changed:s},()=>this.setChangedInAdmin())}onRegisterSelect(s){this.getSelect=s}onConvertBlockly2JS(){this.showConfirmDialog(x.I18n.t("It will not be possible to revert this operation."),s=>{if(s){this.scripts[this.state.selected].engineType="Javascript/js";const r=this.scripts[this.state.selected].source.split(` `);r.pop(),this.scripts[this.state.selected].source=r.join(` -`);const l=this.state.selected,c={...this.state.changed};c[this.state.selected]=!0,this.setState({changed:c,blockly:!1,selected:""},()=>{this.setChangedInAdmin(),setTimeout(()=>this.setState({selected:l}),100)})}})}onChange(s){if(s.script!==void 0){if(s.script===this.scripts[this.state.selected].source)return;this.scripts[this.state.selected].source=s.script}s.debug!==void 0&&(this.scripts[this.state.selected].debug=s.debug),s.verbose!==void 0&&(this.scripts[this.state.selected].verbose=s.verbose);const i=JSON.stringify(this.scripts[this.state.selected])!==JSON.stringify(this.getScriptFromObject(this.state.selected));if(i!==!!this.state.changed[this.state.selected]){const r={...this.state.changed};r[this.state.selected]=i,this.objects[this.state.selected].from="system.adapter.admin.0",this.setState({changed:r},()=>this.setChangedInAdmin())}}onTabChange(s){var r,l;if(this.props.debugMode)return;window.localStorage.setItem("Editor.selected",s);const i=this.scripts[s]||this.getScriptFromObject(s);this.setState({selected:s,rules:i.engineType==="Rules",blockly:i.engineType==="Blockly",showCompiledCode:!1,verboseEnabled:i.verbose,debugEnabled:i.debug}),(l=(r=this.props).onSelectedChange)==null||l.call(r,s,this.state.editing)}isScriptChanged(s){return!!(this.scripts[s]&&this.props.objects[s]&&JSON.stringify(this.scripts[s])!==JSON.stringify(this.getScriptFromObject(s)))}onTabClose(s,i){i==null||i.stopPropagation();const r=this.state.editing.indexOf(s);if(this.state.editing.includes(s))if(this.isScriptChanged(s))this.showConfirmDialog(x.I18n.t("Discard changes for %s",this.props.objects[s].common.name),l=>{l&&(delete this.scripts[s],this.onTabClose(s))});else{const l=[...this.state.editing];l.splice(r,1);const c={editing:l};if(s===this.state.selected?l.length?r===0||l.length===1?c.selected=l[0]:c.selected=l[r-1]:c.selected="":this.state.selected&&!l.length&&(c.selected=""),window.localStorage.setItem("Editor.editing",JSON.stringify(l)),c.selected!==void 0){c.changed||={...this.state.changed},c.changed[c.selected]=this.isScriptChanged(c.selected);const d=c.selected?this.scripts[c.selected]||this.getScriptFromObject(c.selected):void 0;c.blockly=(d==null?void 0:d.engineType)==="Blockly",c.rules=(d==null?void 0:d.engineType)==="Rules",c.verboseEnabled=!!(d!=null&&d.verbose),c.debugEnabled=!!(d!=null&&d.debug),c.showCompiledCode=!1}this.setState(c,()=>{var d,h,p,f;this.setChangedInAdmin(),c.selected!==void 0?((h=(d=this.props).onSelectedChange)==null||h.call(d,c.selected,this.state.editing),window.localStorage.setItem("Editor.selected",c.selected)):(f=(p=this.props).onSelectedChange)==null||f.call(p,this.state.selected,this.state.editing)})}}showConfirmDialog(s,i){this.confirmCallback=i,this.setState({confirm:s})}sendCommandToBlockly(s){this.setState({cmdToBlockly:s},()=>setTimeout(()=>this.setState({cmdToBlockly:""}),200))}sendCommandToRules(s){this.setState({cmdToRules:s},()=>setTimeout(()=>this.setState({cmdToRules:""}),200))}static getText(s){return typeof s=="object"?s[x.I18n.getLanguage()]||s.en:s}getScriptFullName(s){var c;const i=s.split(".");i.shift(),i.shift();const r=[];let l="script.js";for(let d=0;dthis.onTabChange(i),indicatorColor:"primary",style:{position:"relative",marginLeft:10,width:this.state.editing.length>1?"calc(100% - 50px)":"100%",display:"inline-block"},textColor:"primary",variant:"scrollable",scrollButtons:"auto",allowScrollButtonsMobile:!0,children:[this.state.editing.map(s=>{var h,p;if(!this.props.objects[s]){const f=[m.jsx(wt,{sx:this.isScriptChanged(s)?je.tabChanged:void 0,style:je.tabText,children:s.split(".").pop()},"text"),m.jsx(qe,{onClick:b=>this.onTabClose(s,b),style:je.closeButton,size:"small",component:"span",children:m.jsx(sc,{})},"icon")];return m.jsx(qp,{wrapped:!0,href:`#${s}`,label:f,value:s,sx:{"& .MuiTab-wrapper":je.tabButtonWrapper}},s)}if(!this.props.password&&((h=this.props.objects[s].native)!=null&&h.protected))return null;let i=On.getText(this.props.objects[s].common.name)||"";const r=this.getScriptFullName(s);i.length>18&&(i=`${i.substring(0,15)}...`);const l=(p=this.getScriptFromObject(s))==null?void 0:p.source,c=this.scripts[s]&&l!==this.scripts[s].source,d=[m.jsx(wt,{sx:this.isScriptChanged(s)?je.tabChanged:void 0,style:je.tabText,children:i},"text"),c?m.jsx("span",{style:je.tabChangedIcon,children:"▣"},"changedSign"):null,!this.props.debugInstance&&(!this.props.debugMode||this.state.selected!==s)&&m.jsx(qe,{onClick:f=>this.onTabClose(s,f),style:je.closeButton,size:"small",component:"span",children:m.jsx(sc,{})},"icon")];return m.jsx(qp,{disabled:!!this.props.debugInstance||this.state.selected!==s&&this.props.debugMode,wrapped:!0,iconPosition:"start",icon:m.jsx("img",{alt:"",src:cw[this.props.objects[s].common.engineType]||cw.def,style:je.tabIcon},"icon"),href:`#${s}`,label:d,style:je.tabButton,value:s,title:r,sx:{"& .MuiTab-wrapper":je.tabButtonWrapper}},s)}),this.props.debugInstance?m.jsx(qp,{disabled:!1,wrapped:!0,href:`#${this.props.debugInstance.adapter}`,label:this.props.debugInstance.adapter,style:je.tabButton,value:this.props.debugInstance.adapter,title:this.props.debugInstance.adapter,sx:{"& .MuiTab-wrapper":je.tabButtonWrapper}},this.props.debugInstance.adapter):""]},"tabs1"),this.state.editing.length>1?m.jsx(qe,{href:"#","aria-label":"Close all but current",style:je.tabMenuButton,title:x.I18n.t("Close all but current"),"aria-haspopup":"false",onClick:s=>{const i=[this.state.selected];Object.keys(this.scripts).forEach(r=>r!==this.state.selected&&JSON.stringify(this.scripts[r])!==JSON.stringify(this.getScriptFromObject(r))&&i.push(r)),window.localStorage.setItem("Editor.editing",JSON.stringify(i)),this.setState({menuTabsOpened:!1,editing:i})},size:"medium",children:m.jsx(uS,{})},"menuButton"):null]:m.jsx(wt,{sx:je.toolbar,children:m.jsxs(He,{color:"grey",disabled:!0,style:je.hintButton,href:"",children:[m.jsx("span",{children:x.I18n.t("Click on this icon")},"select2"),m.jsx(dS,{style:je.hintIcon},"select3"),m.jsx("span",{children:x.I18n.t("for edit or create script")},"select4")]},"select1")},"tabs2")}getDebugMenu(){return this.state.showDebugMenu?m.jsxs(dm,{id:"menu-debug",anchorEl:this.state.menuDebugAnchorEl,open:this.state.showDebugMenu,onClose:()=>this.setState({showDebugMenu:!1,menuDebugAnchorEl:null}),slotProps:{root:{style:{maxHeight:YA*7.5}}},children:[m.jsxs(it,{title:x.I18n.t("debug_help"),onClick:s=>{s.stopPropagation(),s.preventDefault(),this.setState({showDebugMenu:!1,menuDebugAnchorEl:null,debugEnabled:!this.state.debugEnabled},()=>this.onChange({debug:this.state.debugEnabled}))},children:[m.jsx(wc,{checked:this.state.debugEnabled}),m.jsx(oc,{style:{...je.menuIcon,color:uw}}),x.I18n.t("debug_label")]},"debugEnabled"),m.jsxs(it,{title:x.I18n.t("verbose_help"),onClick:s=>{s.stopPropagation(),s.preventDefault(),this.setState({showDebugMenu:!1,menuDebugAnchorEl:null,verboseEnabled:!this.state.verboseEnabled},()=>this.onChange({verbose:this.state.verboseEnabled}))},children:[m.jsx(wc,{checked:this.state.verboseEnabled}),m.jsx(o_,{style:{...je.menuIcon,color:fg}}),x.I18n.t("verbose_label")]},"verboseEnabled")]},"menuDebug"):null}getDebugBadge(){return[this.state.debugEnabled&&this.state.verboseEnabled?m.jsx(oc,{style:{...je.menuIcon,color:fg}},"DebugVerbose"):null,this.state.debugEnabled&&!this.state.verboseEnabled?m.jsx(oc,{style:{...je.menuIcon,color:uw}},"DebugNoVerbose"):null,!this.state.debugEnabled&&this.state.verboseEnabled?m.jsx(o_,{style:{...je.menuIcon,color:fg}},"noDebugVerbose"):null]}getAskAboutDebug(){return this.state.askAboutDebug?m.jsx(x.DialogConfirm,{onClose:()=>{this.setState({askAboutDebug:!1},()=>this.props.onDebugModeChange(!0))},ok:x.I18n.t("Yes"),cancel:x.I18n.t("Cancel"),text:x.I18n.t("The script will be stopped and must be activated manually after debugging. Continue?")}):null}renderOpenAiDialog(){return this.state.openAiDialog?m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(KA,{adapterName:this.props.adapterName,socket:this.props.socket,runningInstances:this.state.runningInstances,themeType:this.state.themeType,onClose:()=>this.setState({openAiDialog:!1}),language:this.scripts[this.state.selected].engineType==="TypeScript/ts"?"typescript":"javascript",onAddCode:s=>this.setState({insert:s})})}):null}getToolbar(){var r,l;const s=!!(this.state.selected&&((r=this.scripts[this.state.selected])!=null&&r.engine)&&this.state.runningInstances[this.scripts[this.state.selected].engine]),i=!!(this.state.selected&&((l=this.scripts[this.state.selected])!=null&&l.enabled));if(this.state.selected){const c=Object.keys(this.state.changed).filter(h=>this.state.changed[h]).length,d=this.state.changed[this.state.selected];return m.jsxs(FT,{variant:"dense",sx:je.toolbar,children:[!this.props.debugInstance&&this.state.menuOpened&&this.props.onLocate&&m.jsx(qe,{style:je.toolbarButtons,title:x.I18n.t("Locate file"),onClick:()=>this.props.onLocate(this.state.selected),size:"medium",children:m.jsx(hS,{})},"locate"),!this.props.debugInstance&&!d&&s?m.jsx(qe,{disabled:this.props.debugMode,style:je.toolbarButtons,onClick:()=>this.onRestart(),title:x.I18n.t("Restart"),size:"medium",children:m.jsx(pS,{})},"restart"):null,!this.props.debugInstance&&!d?m.jsx(qe,{disabled:this.props.debugMode,onClick:()=>this.onStartStop(),title:i?x.I18n.t("Pause script"):x.I18n.t("Run script"),size:"medium",style:{...je.toolbarButtons,color:i?JA:qA},children:i?m.jsx(gS,{}):m.jsx(mS,{})},"start-stop"):null,!this.props.debugInstance&&!d&&!i?m.jsx("span",{style:je.notRunning,children:x.I18n.t("Script is not running")}):null,!d&&i&&!s?m.jsx("span",{style:je.notRunning,children:x.I18n.t("Instance is disabled")}):null,d?m.jsx(He,{color:"grey",variant:"contained",style:{...je.textButton,...je.saveButton},className:"button-save",onClick:()=>this.onSave(),endIcon:m.jsx(i_,{}),children:x.I18n.t("Save")},"save"):null,c>1||c===1&&!d?m.jsx(He,{color:"grey",variant:"contained",style:je.textButton,onClick:()=>this.onSaveAll(),endIcon:m.jsx(i_,{}),children:x.I18n.t("Save all")},"saveall"):null,d?m.jsx(He,{color:"grey",variant:"contained",style:je.textButton,onClick:()=>this.onCancel(),endIcon:m.jsx(Yc,{}),children:x.I18n.t("Cancel")},"cancel"):null,m.jsx("div",{style:{flex:2}}),!this.props.debugInstance&&!this.state.showCompiledCode&&m.jsx(qe,{style:je.toolbarButtons,title:x.I18n.t("Prettify the script"),onClick:()=>this.setState({triggerPrettier:this.state.triggerPrettier+1}),size:"medium",children:m.jsx(fS,{})},"prettier"),this.state.blockly&&!this.state.showCompiledCode?m.jsx(qe,{"aria-label":"Export Blocks",title:x.I18n.t("Export blocks"),style:je.toolbarButtons,onClick:()=>this.sendCommandToBlockly("export"),size:"medium",children:m.jsx(kc,{})},"export"):null,this.state.blockly&&!this.state.showCompiledCode&&m.jsx(qe,{"aria-label":"Import Blocks",title:x.I18n.t("Import blocks"),style:je.toolbarButtons,onClick:()=>this.sendCommandToBlockly("import"),size:"medium",children:m.jsx(Ng,{})},"import"),this.state.blockly&&!this.state.showCompiledCode&&m.jsx(qe,{"aria-label":"Check code",title:x.I18n.t("Check blocks"),style:je.toolbarButtons,onClick:()=>this.sendCommandToBlockly("check"),size:"medium",children:m.jsx($S,{})},"check"),!this.props.debugMode&&!this.state.blockly&&!this.state.rules&&!this.state.showCompiledCode?m.jsx(qe,{"aria-label":"create CRON",title:x.I18n.t("Create or edit CRON or time wizard"),style:je.toolbarButtons,onClick:()=>this.setState({showCron:!0}),size:"medium",children:m.jsx(bS,{})},"select-cron"):null,this.scripts[this.state.selected]&&this.scripts[this.state.selected].engineType!=="Blockly"&&this.scripts[this.state.selected].engineType!=="Rules"?m.jsx(qe,{"aria-label":"AI",title:x.I18n.t("AI code generator"),style:je.toolbarButtons,size:"medium",onClick:()=>this.setState({openAiDialog:!0}),children:m.jsx(vS,{})},"ai"):null,m.jsx(qe,{"aria-label":"Show astronomical events",title:x.I18n.t("Show astronomical events"),style:je.toolbarButtons,disabled:!s,onClick:()=>{this.setState({showAstro:!0,astroEvents:null}),this.props.socket.sendTo(this.scripts[this.state.selected].engine.replace("system.adapter.",""),"calcAstroAll",{}).then(h=>this.setState({astroEvents:h}))},size:"medium",children:m.jsx(yS,{})},"show-astro"),!this.props.debugMode&&!this.state.blockly&&!this.state.rules&&!this.state.showCompiledCode&&m.jsx(qe,{"aria-label":"select ID",title:x.I18n.t("Insert object ID"),style:je.toolbarButtons,onClick:()=>this.setState({showSelectId:!0}),size:"medium",children:m.jsx(_S,{})},"select-id"),this.state.blockly&&!this.state.rules&&this.state.showCompiledCode&&m.jsx(He,{color:"grey","aria-label":"convert to javascript",title:x.I18n.t("Convert blockly to javascript for ever."),onClick:()=>this.onConvertBlockly2JS(),children:"Blockly=>JS"},"convert2js"),this.state.rules&&!this.state.showCompiledCode&&m.jsx(qe,{"aria-label":"Export Blocks",title:x.I18n.t("Export blocks"),style:je.toolbarButtons,onClick:()=>this.sendCommandToRules("export"),size:"medium",children:m.jsx(kc,{})},"export"),this.state.rules&&!this.state.showCompiledCode&&m.jsx(qe,{"aria-label":"Import Blocks",title:x.I18n.t("Import blocks"),style:je.toolbarButtons,onClick:()=>this.sendCommandToRules("import"),size:"medium",children:m.jsx(Ng,{})},"import"),this.props.expertMode&&!d&&(this.props.debugMode||!this.state.blockly&&!this.state.rules||(this.state.blockly||this.state.rules)&&this.state.showCompiledCode)&&m.jsx(qe,{style:je.toolbarButtons,color:this.props.debugMode?"primary":"default",disabled:!this.props.debugMode&&!s,onClick:()=>{!this.props.debugMode&&i?this.setState({askAboutDebug:!0}):this.props.onDebugModeChange(!this.props.debugMode)},size:"medium",children:m.jsx(oc,{style:{fontSize:32}})}),(this.state.blockly||this.state.rules)&&m.jsx(He,{"aria-label":"blockly",title:x.I18n.t("Show javascript code"),className:"button-js-code",color:this.state.showCompiledCode?"secondary":"inherit",disabled:this.props.debugMode,style:{...je.toolbarButtons,...this.props.debugMode?je.toolbarButtonsDisabled:void 0,padding:"0 5px"},onClick:()=>{this.props.debugMode||(this.setState({showCompiledCode:!this.state.showCompiledCode}),this.state.isTourOpen&&this.state.tourStep===Ns.showJavascript&&this.setState({tourStep:Ns.switchBackToRules}),this.state.isTourOpen&&this.state.tourStep===Ns.switchBackToRules&&this.setState({tourStep:Ns.saveTheScript}))},children:m.jsx("img",{alt:this.state.blockly?"blockly2js":"rules2js",src:this.state.blockly?FA:jA})},"blockly-code"),m.jsx(qe,{disabled:this.props.debugMode,"aria-label":"Debug menu",title:x.I18n.t("Debug options"),style:je.toolbarButtons,onClick:h=>this.setState({showDebugMenu:!0,menuDebugAnchorEl:h.currentTarget}),size:"medium",children:m.jsx(jT,{style:je.badgeMargin,badgeContent:this.getDebugBadge(),children:m.jsx(wS,{})})},"debug")]},"toolbar1")}return null}getScriptEditor(){return!this.props.debugMode&&this.state.selected&&this.props.objects[this.state.selected]&&this.state.blockly!==null&&(!this.state.blockly||this.state.showCompiledCode)&&(!this.state.rules||this.state.showCompiledCode)?(this.scripts[this.state.selected]||=this.getScriptFromObject(this.state.selected),m.jsx(wt,{sx:je.editorDiv,children:m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(GA,{name:this.state.selected,adapterName:this.props.adapterName,insert:this.state.insert,onInserted:()=>this.setState({insert:""}),onForceSave:()=>this.onSave(),searchText:this.state.searchText,onRegisterSelect:s=>this.onRegisterSelect(s),readOnly:this.state.showCompiledCode,changed:this.state.changed[this.state.selected],code:this.scripts[this.state.selected].source||"",isDark:this.state.themeType==="dark",socket:this.props.socket,runningInstances:this.state.runningInstances,triggerPrettier:this.state.triggerPrettier,onChange:s=>this.onChange({script:s}),language:this.scripts[this.state.selected].engineType==="TypeScript/ts"?"typescript":"javascript"},"scriptEditor1")})},"scriptEditorDiv")):null}getBlocklyEditor(){return!this.props.debugMode&&this.state.instancesLoaded&&this.state.selected&&this.props.objects[this.state.selected]&&this.state.blockly&&!this.state.showCompiledCode&&this.state.visible?(this.scripts[this.state.selected]||=this.getScriptFromObject(this.state.selected),m.jsx(wt,{sx:je.editorDiv,children:m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(UA,{command:this.state.cmdToBlockly,themeType:this.state.themeType,searchText:this.state.searchText,code:this.scripts[this.state.selected].source||"",scriptId:this.state.selected,onChange:s=>this.onChange({script:s})},"BlocklyEditor")})},"blocklyEditorDiv")):null}getRulesEditor(){var s,i;if(!this.props.debugMode&&this.state.instancesLoaded&&this.state.selected&&this.props.objects[this.state.selected]&&this.state.rules&&!this.state.showCompiledCode&&this.state.visible){this.scripts[this.state.selected]||=this.getScriptFromObject(this.state.selected);const r=!!this.state.selected&&!!((s=this.scripts[this.state.selected])!=null&&s.engine)&&this.state.runningInstances[this.scripts[this.state.selected].engine],l=!!this.state.selected&&((i=this.scripts[this.state.selected])==null?void 0:i.enabled);return m.jsx(wt,{sx:je.editorDiv,children:m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(HA,{scriptId:this.state.selected,setTourStep:this.setTourStep,tourStep:this.state.tourStep,isTourOpen:this.state.isTourOpen,changed:this.state.changed[this.state.selected],running:r&&l,command:this.state.cmdToRules,themeType:this.state.themeType,themeName:this.props.themeName,theme:this.props.theme,searchText:this.state.searchText,resizing:this.props.resizing,code:this.scripts[this.state.selected].source||"",onChange:c=>this.onChange({script:c})},"flowEditor")})},"flowEditorDiv")}return null}getConfirmDialog(){return this.state.confirm?m.jsx(x.DialogConfirm,{text:this.state.confirm,onClose:s=>{if(this.confirmCallback){const i=this.confirmCallback;this.confirmCallback=null,i(s)}this.setState({confirm:""})}},"dialogConfirm1"):null}getSelectIdDialog(){var s;if(this.state.showSelectId){const i=["state","channel","device","adapter","instance","enum","host","config","script","user","group"],r=["adapter","instance","enum","host","config","script","user","group"];let l=this.selectId.callback?this.selectId.initValue||"":this.getSelect&&this.getSelect()||"",c=l.indexOf("/*");c!==-1&&(l=l.substring(0,c)),c=l.indexOf("//"),c!==-1&&(l=l.substring(0,c));let d=l.match(/"([^"]+)"/);return d&&(l=d[1]),d=l.match(/'([^']+)'/),d&&(l=d[1]),m.jsx(x.DialogSelectID,{theme:this.props.theme,imagePrefix:"../..",themeName:this.props.themeName,themeType:this.state.themeType,socket:this.props.socket,selected:l,expertMode:this.selectId.type&&this.selectId.type!=="all"&&r.includes(this.selectId.type)?!0:void 0,types:((s=this.selectId)==null?void 0:s.type)==="all"?i:[this.selectId.type||"state"],onClose:()=>{this.setState({showSelectId:!1}),this.selectId.callback&&(this.selectId.callback=null)},onOk:(h,p)=>{this.selectId.initValue=null,this.selectId.callback?(this.selectId.callback(h),this.selectId.callback=null):this.setState({insert:`'${h}'/*${p}*/`})}},"dialogSelectID1")}return null}getCronDialog(){return this.state.showCron?m.jsx(x.DialogCron,{theme:this.props.theme,cron:this.cron.callback?this.cron.initValue||"":this.getSelect?this.getSelect():"* * * * *",onClose:()=>this.setState({showCron:!1}),onOk:s=>{this.cron.initValue=null,this.cron.callback?(this.cron.callback(s),this.cron.callback=null):this.setState({insert:`'${s}'`})}},"dialogCron1"):null}getAstroDialog(){return this.state.showAstro?m.jsxs(Ut,{open:!0,onClose:()=>this.setState({showAstro:!1}),children:[m.jsx(ss,{children:x.I18n.t("Astronomical events today")}),m.jsx(qt,{children:this.state.astroEvents?m.jsx(UT,{component:Ow,children:m.jsxs(HT,{size:"small",children:[m.jsx(WT,{children:m.jsxs(s_,{children:[m.jsx(wn,{children:x.I18n.t("Name")}),m.jsx(wn,{children:x.I18n.t("Server time")}),m.jsx(wn,{children:x.I18n.t("Description")})]})}),m.jsx(GT,{children:Object.keys(this.state.astroEvents).map(s=>{var i,r,l,c;return m.jsxs(s_,{children:[m.jsx(wn,{component:"th",scope:"row",children:s.startsWith("next")?"":s}),m.jsx(VT,{title:`${x.I18n.t("Local time")}: ${(i=this.state.astroEvents)!=null&&i[s].isValidDate?new Date((r=this.state.astroEvents)==null?void 0:r[s].date).toLocaleTimeString():"n/a"}`,children:m.jsx(wn,{align:"right",children:(l=this.state.astroEvents)!=null&&l[s].isValidDate?(c=this.state.astroEvents)==null?void 0:c[s].serverTime:"n/a"})}),m.jsx(wn,{children:x.I18n.t(s)})]},s)})})]})}):m.jsx(zT,{})}),m.jsx(Ht,{children:m.jsx(He,{variant:"contained",onClick:()=>this.setState({showAstro:!1}),color:"primary",startIcon:m.jsx(sc,{}),children:x.I18n.t("Close")})})]},"dialogAstro"):null}getEditorDialog(){return this.state.showScript?m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(VA,{adapterName:this.props.adapterName,source:this.scriptDialog.initValue||"",args:this.scriptDialog.args?this.scriptDialog.args.join(", "):"",isReturn:this.scriptDialog.isReturn,socket:this.props.socket,runningInstances:this.state.runningInstances,themeType:this.state.themeType,onClose:s=>{this.scriptDialog.initValue=null,this.scriptDialog.callback&&(s!==!1&&this.scriptDialog.callback(s||""),this.scriptDialog.callback=null),this.setState({showScript:!1})}},"scriptEditorDialog")}):null}getToast(){return m.jsx(KT,{anchorOrigin:{vertical:"bottom",horizontal:"left"},open:!!this.state.toast,autoHideDuration:6e3,onClose:()=>this.setState({toast:""}),slotProps:{content:{"aria-describedby":"message-id"}},message:m.jsx("span",{id:"message-id",children:this.state.toast}),action:[m.jsx(qe,{"aria-label":"close",color:"inherit",style:je.closeToast,onClick:()=>this.setState({toast:""}),size:"medium",children:m.jsx(sc,{})},"close")]},"toast")}setTourStep=s=>this.setState({tourStep:s});getTour(){return this.state.instancesLoaded&&this.state.selected&&this.props.isAnyRulesExists===1&&this.props.objects[this.state.selected]&&this.state.rules&&this.state.visible?m.jsx(jm,{steps:zA,isOpen:this.state.isTourOpen,onRequestClose:()=>{this.setState({isTourOpen:!1}),window.localStorage.setItem("tour","true"),this.props.socket.setState("javascript.0.variables.rulesTour",{val:!0,ack:!0})},goToStep:this.state.tourStep},"tour"):null}getDebug(){return this.props.debugMode?this.state.selected&&this.scripts[this.state.selected]&&this.scripts[this.state.selected].engine&&this.state.runningInstances[this.scripts[this.state.selected].engine]?m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(WA,{runningInstances:this.state.runningInstances,adapterName:this.props.adapterName,socket:this.props.socket,themeName:this.props.themeName,themeType:this.props.themeType,src:this.props.debugInstance?this.props.debugInstance.adapter:this.state.selected,debugInstance:this.props.debugInstance},"debugger")}):(setTimeout(()=>this.props.onDebugModeChange(!1)),null):null}getScriptFromObject(s){var r,l;if(!((r=this.props.objects[s])!=null&&r.common))return;const i=JSON.parse(JSON.stringify(this.props.objects[s].common));return(l=this.props.objects[s].native)!=null&&l.protected&&this.props.password&&(i.source=Wg(this.props.password,i.source)),i}render(){var s,i;return this.state.selected&&this.props.objects[this.state.selected]&&this.state.blockly===null&&this.state.rules===null&&(this.scripts[this.state.selected]||=this.getScriptFromObject(this.state.selected),setTimeout(()=>{const r={blockly:this.scripts[this.state.selected].engineType==="Blockly",rules:this.scripts[this.state.selected].engineType==="Rules",showCompiledCode:!1,debugEnabled:this.scripts[this.state.selected].debug,verboseEnabled:this.scripts[this.state.selected].verbose};this.removeNonExistingScripts(null,r),this.setState(r)},100)),this.state.selected&&!this.props.password&&((i=(s=this.props.objects[this.state.selected])==null?void 0:s.native)!=null&&i.protected)&&setTimeout(()=>{const r=this.state.editing.find(l=>{var c,d;return!((d=(c=this.props.objects[l])==null?void 0:c.native)!=null&&d.protected)})||"";Object.keys(this.scripts).forEach(l=>{var c,d;(d=(c=this.props.objects[l])==null?void 0:c.native)!=null&&d.protected&&delete this.scripts[l]}),this.setState({selected:r},()=>{var l,c;(c=(l=this.props).onSelectedChange)==null||c.call(l,r,this.state.editing),this.state.selected?window.localStorage.setItem("Editor.selected",this.state.selected):window.localStorage.removeItem("Editor.selected")})},50),!this.state.selected&&this.props.password&&this.state.editing.length&&setTimeout(()=>{const r=this.state.editing[0];this.setState({selected:r},()=>{var l,c;(c=(l=this.props).onSelectedChange)==null||c.call(l,r,this.state.editing),window.localStorage.setItem("Editor.selected",this.state.selected)})},50),[this.getTabs(),this.getToolbar(),this.getScriptEditor(),this.getAskAboutDebug(),this.getBlocklyEditor(),this.getRulesEditor(),this.getDebug(),this.getConfirmDialog(),this.getSelectIdDialog(),this.getCronDialog(),this.getEditorDialog(),this.getAstroDialog(),this.getDebugMenu(),this.renderOpenAiDialog(),this.getToast(),this.getTour()]}}const Yt={dialog:{height:"95%"},dropzone:{marginTop:20,width:"100%",borderWidth:5,borderStyle:"dashed",borderColor:"#d0cccc",textAlign:"center",boxSizing:"border-box",paddingTop:45,borderRadius:10,height:"calc(100% - 10px)"},dropzoneDiv:{width:"100%",height:"100%"},dropzoneRejected:{borderColor:"#970000"},dropzoneAccepted:{borderColor:"#17cd02"},icon:{height:"30%",width:"30%",color:"#eeeeee",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",zIndex:0},iconError:{color:"#ffc3c6"},iconOk:{color:"#aaeebc"},text:{top:"50%",left:"50%",transform:"translate(-50%,-50%)",color:"#868686",position:"absolute",zIndex:1}};class zm extends _e.Component{constructor(s){super(s),this.state={error:"",imageStatus:""}}componentDidMount(){setTimeout(()=>{var s;try{(s=window.document.getElementById("import-text-area"))==null||s.focus()}catch{}},100)}handleCancel(){this.props.onClose()}static readFileDataUrl(s,i){const r=new FileReader;r.onload=()=>{i(null,{data:r.result,name:s.name})},r.onabort=()=>{console.error("file reading was aborted"),i(x.I18n.t("file reading was aborted"))},r.onerror=l=>{console.error("file reading has failed"),i(x.I18n.t("file reading has failed: %s",l))},r.readAsDataURL(s)}handleDropFile(s){if(!(s!=null&&s.length))return;const i=s[s.length-1];i&&zm.readFileDataUrl(i,(r,l)=>{var c;r||!l?this.setState({error:r||"No data"}):this.props.onClose(((c=l.data)==null?void 0:c.toString())||"",l.name)})}render(){const s={...Yt.dropzone,...this.state.imageStatus==="accepted"?Yt.dropzoneAccepted:this.state.imageStatus==="rejected"?Yt.dropzoneRejected:void 0};return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"lg",sx:{"& .MuiDialog-paper":Yt.dialog},fullWidth:!0,open:!0,"aria-labelledby":"import-dialog-title",PaperProps:{style:{minHeight:"90%",maxHeight:"90%"}},children:[m.jsx(ss,{id:"import-dialog-title",children:x.I18n.t("Import scripts")}),m.jsxs(qt,{children:[m.jsx(Lw,{maxSize:5e7,onDrop:(i,r)=>{var l,c,d;i.length?this.handleDropFile(i):window.alert(((d=(c=(l=r==null?void 0:r[0])==null?void 0:l.errors)==null?void 0:c[0])==null?void 0:d.message)||x.I18n.t("ra_Cannot upload"))},multiple:!1,accept:{"application/zip":[],"application/x-zip-compressed":[]},children:({getRootProps:i,getInputProps:r,isDragActive:l,isDragReject:c})=>c?(this.state.imageStatus!=="rejected"&&this.setState({imageStatus:"rejected"}),m.jsxs("div",{style:{...s,...Yt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Yt.text,children:x.I18n.t("Some files will be rejected")},"text"),m.jsx(Yc,{style:{...Yt.icon,...Yt.iconError}},"icon")]})):l?(this.state.imageStatus!=="accepted"&&this.setState({imageStatus:"accepted"}),m.jsxs("div",{style:{...s,...Yt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Yt.text,children:x.I18n.t("All files will be accepted")},"text"),m.jsx(Pw,{style:{...Yt.icon,...Yt.iconOk}},"icon")]})):(this.state.imageStatus!=="wait"&&this.setState({imageStatus:"wait"}),m.jsxs("div",{style:{...s,...Yt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Yt.text,children:x.I18n.t("Drop some files here or click...")},"text"),m.jsx(Bw,{style:Yt.icon},"icon")]}))},"image-drop"),this.state.error?m.jsx(su,{text:this.state.error,onClose:()=>this.setState({error:""})}):null]}),m.jsx(Ht,{children:m.jsx(He,{color:"grey",variant:"contained",onClick:()=>this.handleCancel(),startIcon:m.jsx(so,{}),children:x.I18n.t("Close")})})]})}}var Um={exports:{}},XA=Um.exports;(function(a,s){(function(i,r){a.exports=r()})(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St,pt,Hs,Yi,De,vt,Sd,A$,Oo,Ja,qa,Ed,O$,Id,Xa,xd,Dd,R$,Ad,N$,Za,M$,L$,P$,B$,F$,Od,j$,rr,ar,z$,Rd,Nd,Md,Ld,Qa,Pd,U$,H$,W$,Ji,Bd,G$,el,ds,V$,Ro,Fd,K$,lr,jd,zd,Ud,Hd,Wd,Gd,Vd,Kd,Yd,Jd,Y$,J$,q$,X$,Z$,Q$,tl,eb,tb,qd,Xd,Zd,Qd,eh,th,sh,sl,cr,oh,sb,ih,nh,rh,ah,lh,ch,uh,dh,hh,ph,ob,ib,nb,gh,rb,ab,lb,cb,ub,ge;r=function(e,t,o,n){if(!(e instanceof $e)&&typeof e!="string"||`${e}`.trim()==="")throw Error('Invalid type "'+e+'". The type must be a non-empty string or a Blockly.registry.Type.');if(e=`${e}`.toLowerCase(),typeof t!="string"||t.trim()==="")throw Error('Invalid name "'+t+'". The name must be a non-empty string.');const u=t.toLowerCase();if(!o)throw Error("Can not register a null value");let g=No[e],I=ol[e];if(g||(g=No[e]=Object.create(null),I=ol[e]=Object.create(null)),l(e,o),!n&&g[u]&&g[u]!==o)throw Error('Name "'+u+'" with type "'+e+'" already registered.');g[u]=o,I[u]=t},l=function(e,t){switch(e){case String($e.FIELD):if(typeof t.fromJson!="function")throw Error('Type "'+e+'" must have a fromJson function')}},c=function(e,t){e=`${e}`.toLowerCase(),t=t.toLowerCase();const o=No[e];o&&o[t]?(delete No[e][t],delete ol[e][t]):console.warn("Unable to unregister ["+t+"]["+e+"] from the registry.")},d=function(e,t,o){e=`${e}`.toLowerCase(),t=t.toLowerCase();const n=No[e];if(!n||!n[t]){if(t="Unable to find ["+t+"]["+e+"] in the registry.",o)throw Error(t+" You must require or register a "+e+" plugin.");return console.warn(t),null}return n[t]},h=function(e,t){return e=`${e}`.toLowerCase(),t=t.toLowerCase(),(e=No[e])?!!e[t]:!1},p=function(e,t,o){return d(e,t,o)},f=function(e,t,o){return d(e,t,o)},b=function(e,t,o){e=`${e}`.toLowerCase();var n=No[e];if(!n){if(n=`Unable to find [${e}] in the registry.`,o)throw Error(`${n} You must require or register a ${e} plugin.`);return console.warn(n),null}if(!t)return n;e=ol[e],o=Object.create(null);for(const u of Object.keys(n))o[e[u]]=n[u];return o},y=function(e,t,o){return t=t.plugins[String(e)]||Ws,typeof t=="function"?t:p(e,t,o)},w=function(e,t,o,n){e=e+" was deprecated in "+t+" and will be deleted in "+o+".",n&&(e+=` -Use `+n+" instead."),hb.has(e)||(hb.add(e),console.warn(e))},v=function(){return"blockly-"+(LC++).toString(36)},_=function(){return mb.genUid()},$=function(e){return e.type===ee.BLOCK_CREATE},S=function(e){return e.type===ee.BLOCK_DELETE},T=function(e){return e.type===ee.BLOCK_CHANGE},E=function(e){return e.type===ee.BLOCK_FIELD_INTERMEDIATE_CHANGE},D=function(e){return e.type===ee.BLOCK_MOVE},M=function(e){return e.type===ee.CLICK},P=function(e){return e.type===ee.BUBBLE_OPEN},W=function(e){return e.type===ee.VIEWPORT_CHANGE},i.setRecordUndo$$module$build$src$core$events$utils=function(e){ur=e},G=function(){return ur},z=function(e){$b.fireInternal(e)},Z=function(e){if(C()){if(!po.length)try{requestAnimationFrame(()=>{setTimeout(he,0)})}catch{setTimeout(he,0)}Ce(e)}},he=function(){const e=R(po,!0);po.length=0;for(const t of e){if(!t.workspaceId)continue;let o;(o=re(t.workspaceId))==null||o.fireChangeListener(t)}},Ce=function(e){if(T(e)&&e.element==="mutation"){let t;for(t=po.length;0!n.isNull()),t||e.reverse(),e},K=function(){for(let e=0,t;t=po[e];e++)t.recordUndo=!1},i.disable$$module$build$src$core$events$utils=function(){fh++},i.enable$$module$build$src$core$events$utils=function(){fh--},C=function(){return fh===0},i.getGroup$$module$build$src$core$events$utils=function(){return fb},i.setGroup$$module$build$src$core$events$utils=function(e){$b.setGroupInternal(e)},Q=function(e){fb=typeof e=="boolean"?e?_():"":e},ve=function(e){const t=[];e=e.getDescendants(!1);for(let o=0,n;n=e[o];o++)t[o]=n.id;return t},ce=function(e,t){const o=ne(e.type);if(!o)throw Error("Unknown event type.");return o.fromJson(e,t)},ne=function(e){const t=p($e.EVENT,e);if(!t)throw Error(`Event type ${e} not found in registry.`);return t},me=function(e){if((D(e)||$(e))&&e.workspaceId){var t=re(e.workspaceId);if(!e.blockId)throw Error("Encountered a blockEvent without a proper blockId");if(e=t.getBlockById(e.blockId)){const o=ur;try{ur=!1;const n=e.getParent();if(n&&!n.hasDisabledReason($h)){const u=e.getDescendants(!1);for(let g=0,I;I=u[g];g++)I.setDisabledReason(!1,$h)}else if((e.outputConnection||e.previousConnection)&&!t.isDragging())do e.setDisabledReason(!0,$h),e=e.getNextBlock();while(e)}finally{ur=o}}}},re=function(e){return dr[e]||null},B=function(){const e=[];for(const t in dr)e.push(dr[t]);return e},N=function(e){dr[e.id]=e},te=function(e){delete dr[e.id]},q=function(){return bb},se=function(e){bb=e},j=function(){return ai},i.setSelected$$module$build$src$core$common=function(e){if(ai!==e){var t,o,n,u,g,I,L=new(ne(ee.SELECTED))((n=(t=ai)==null?void 0:t.id)!=null?n:null,(u=e==null?void 0:e.id)!=null?u:null,(I=(g=e==null?void 0:e.workspace.id)!=null?g:(o=ai)==null?void 0:o.workspace.id)!=null?I:"");z(L);var le;(le=ai)==null||le.unselect(),ai=e;var Ee;(Ee=ai)==null||Ee.select()}},Te=function(){return vb},ae=function(e){vb=e},we=function(e){for(;e.options.parentWorkspace;)e=e.options.parentWorkspace;const t=e.getParentSvg(),o=e.getCachedParentSvgSize();var n=t.parentElement;if(n instanceof HTMLElement){var u=n.offsetWidth;n=n.offsetHeight,o.width!==u&&(t.setAttribute("width",u+"px"),e.setCachedParentSvgSize(u,null)),o.height!==n&&(t.setAttribute("height",n+"px"),e.setCachedParentSvgSize(null,n)),e.resize()}},Ie=function(e,t){const o=Object.create(null),n=e.getDescendants(!0);t&&(e=e.getNextBlock())&&(e=n.indexOf(e),n.splice(e,n.length-e));for(let u=0,g;g=n[u];u++)o[g.type]?o[g.type]++:o[g.type]=1;return o},Ne=function(e){return function(){this.jsonInit(e)}},Ae=function(e){yb.defineBlocksWithJsonArrayInternal(e)},We=function(e){i.defineBlocks$$module$build$src$core$common(i.createBlockDefinitionsFromJsonArray$$module$build$src$core$common(e))},i.createBlockDefinitionsFromJsonArray$$module$build$src$core$common=function(e){const t={};for(let o=0;o{this.setChangedInAdmin(),setTimeout(()=>this.setState({selected:l}),100)})}})}onChange(s){if(s.script!==void 0){if(s.script===this.scripts[this.state.selected].source)return;this.scripts[this.state.selected].source=s.script}s.debug!==void 0&&(this.scripts[this.state.selected].debug=s.debug),s.verbose!==void 0&&(this.scripts[this.state.selected].verbose=s.verbose);const i=JSON.stringify(this.scripts[this.state.selected])!==JSON.stringify(this.getScriptFromObject(this.state.selected));if(i!==!!this.state.changed[this.state.selected]){const r={...this.state.changed};r[this.state.selected]=i,this.objects[this.state.selected].from="system.adapter.admin.0",this.setState({changed:r},()=>this.setChangedInAdmin())}}onTabChange(s){var r,l;if(this.props.debugMode)return;window.localStorage.setItem("Editor.selected",s);const i=this.scripts[s]||this.getScriptFromObject(s);this.setState({selected:s,rules:i.engineType==="Rules",blockly:i.engineType==="Blockly",showCompiledCode:!1,verboseEnabled:i.verbose,debugEnabled:i.debug}),(l=(r=this.props).onSelectedChange)==null||l.call(r,s,this.state.editing)}isScriptChanged(s){return!!(this.scripts[s]&&this.props.objects[s]&&JSON.stringify(this.scripts[s])!==JSON.stringify(this.getScriptFromObject(s)))}onTabClose(s,i){i==null||i.stopPropagation();const r=this.state.editing.indexOf(s);if(this.state.editing.includes(s))if(this.isScriptChanged(s))this.showConfirmDialog(x.I18n.t("Discard changes for %s",this.props.objects[s].common.name),l=>{l&&(delete this.scripts[s],this.onTabClose(s))});else{const l=[...this.state.editing];l.splice(r,1);const c={editing:l};if(s===this.state.selected?l.length?r===0||l.length===1?c.selected=l[0]:c.selected=l[r-1]:c.selected="":this.state.selected&&!l.length&&(c.selected=""),window.localStorage.setItem("Editor.editing",JSON.stringify(l)),c.selected!==void 0){c.changed||={...this.state.changed},c.changed[c.selected]=this.isScriptChanged(c.selected);const d=c.selected?this.scripts[c.selected]||this.getScriptFromObject(c.selected):void 0;c.blockly=(d==null?void 0:d.engineType)==="Blockly",c.rules=(d==null?void 0:d.engineType)==="Rules",c.verboseEnabled=!!(d!=null&&d.verbose),c.debugEnabled=!!(d!=null&&d.debug),c.showCompiledCode=!1}this.setState(c,()=>{var d,h,p,f;this.setChangedInAdmin(),c.selected!==void 0?((h=(d=this.props).onSelectedChange)==null||h.call(d,c.selected,this.state.editing),window.localStorage.setItem("Editor.selected",c.selected)):(f=(p=this.props).onSelectedChange)==null||f.call(p,this.state.selected,this.state.editing)})}}showConfirmDialog(s,i){this.confirmCallback=i,this.setState({confirm:s})}sendCommandToBlockly(s){this.setState({cmdToBlockly:s},()=>setTimeout(()=>this.setState({cmdToBlockly:""}),200))}sendCommandToRules(s){this.setState({cmdToRules:s},()=>setTimeout(()=>this.setState({cmdToRules:""}),200))}static getText(s){return typeof s=="object"?s[x.I18n.getLanguage()]||s.en:s}getScriptFullName(s){var c;const i=s.split(".");i.shift(),i.shift();const r=[];let l="script.js";for(let d=0;dthis.onTabChange(i),indicatorColor:"primary",style:{position:"relative",marginLeft:10,width:this.state.editing.length>1?"calc(100% - 50px)":"100%",display:"inline-block"},textColor:"primary",variant:"scrollable",scrollButtons:"auto",allowScrollButtonsMobile:!0,children:[this.state.editing.map(s=>{var h,p;if(!this.props.objects[s]){const f=[m.jsx(wt,{sx:this.isScriptChanged(s)?je.tabChanged:void 0,style:je.tabText,children:s.split(".").pop()},"text"),m.jsx(qe,{onClick:b=>this.onTabClose(s,b),style:je.closeButton,size:"small",component:"span",children:m.jsx(sc,{})},"icon")];return m.jsx(qp,{wrapped:!0,href:`#${s}`,label:f,value:s,sx:{"& .MuiTab-wrapper":je.tabButtonWrapper}},s)}if(!this.props.password&&((h=this.props.objects[s].native)!=null&&h.protected))return null;let i=On.getText(this.props.objects[s].common.name)||"";const r=this.getScriptFullName(s);i.length>18&&(i=`${i.substring(0,15)}...`);const l=(p=this.getScriptFromObject(s))==null?void 0:p.source,c=this.scripts[s]&&l!==this.scripts[s].source,d=[m.jsx(wt,{sx:this.isScriptChanged(s)?je.tabChanged:void 0,style:je.tabText,children:i},"text"),c?m.jsx("span",{style:je.tabChangedIcon,children:"▣"},"changedSign"):null,!this.props.debugInstance&&(!this.props.debugMode||this.state.selected!==s)&&m.jsx(qe,{onClick:f=>this.onTabClose(s,f),style:je.closeButton,size:"small",component:"span",children:m.jsx(sc,{})},"icon")];return m.jsx(qp,{disabled:!!this.props.debugInstance||this.state.selected!==s&&this.props.debugMode,wrapped:!0,iconPosition:"start",icon:m.jsx("img",{alt:"",src:cw[this.props.objects[s].common.engineType]||cw.def,style:je.tabIcon},"icon"),href:`#${s}`,label:d,style:je.tabButton,value:s,title:r,sx:{"& .MuiTab-wrapper":je.tabButtonWrapper}},s)}),this.props.debugInstance?m.jsx(qp,{disabled:!1,wrapped:!0,href:`#${this.props.debugInstance.adapter}`,label:this.props.debugInstance.adapter,style:je.tabButton,value:this.props.debugInstance.adapter,title:this.props.debugInstance.adapter,sx:{"& .MuiTab-wrapper":je.tabButtonWrapper}},this.props.debugInstance.adapter):""]},"tabs1"),this.state.editing.length>1?m.jsx(qe,{href:"#","aria-label":"Close all but current",style:je.tabMenuButton,title:x.I18n.t("Close all but current"),"aria-haspopup":"false",onClick:s=>{const i=[this.state.selected];Object.keys(this.scripts).forEach(r=>r!==this.state.selected&&JSON.stringify(this.scripts[r])!==JSON.stringify(this.getScriptFromObject(r))&&i.push(r)),window.localStorage.setItem("Editor.editing",JSON.stringify(i)),this.setState({menuTabsOpened:!1,editing:i})},size:"medium",children:m.jsx(uS,{})},"menuButton"):null]:m.jsx(wt,{sx:je.toolbar,children:m.jsxs(He,{color:"grey",disabled:!0,style:je.hintButton,href:"",children:[m.jsx("span",{children:x.I18n.t("Click on this icon")},"select2"),m.jsx(dS,{style:je.hintIcon},"select3"),m.jsx("span",{children:x.I18n.t("for edit or create script")},"select4")]},"select1")},"tabs2")}getDebugMenu(){return this.state.showDebugMenu?m.jsxs(pm,{id:"menu-debug",anchorEl:this.state.menuDebugAnchorEl,open:this.state.showDebugMenu,onClose:()=>this.setState({showDebugMenu:!1,menuDebugAnchorEl:null}),slotProps:{root:{style:{maxHeight:YA*7.5}}},children:[m.jsxs(it,{title:x.I18n.t("debug_help"),onClick:s=>{s.stopPropagation(),s.preventDefault(),this.setState({showDebugMenu:!1,menuDebugAnchorEl:null,debugEnabled:!this.state.debugEnabled},()=>this.onChange({debug:this.state.debugEnabled}))},children:[m.jsx(wc,{checked:this.state.debugEnabled}),m.jsx(oc,{style:{...je.menuIcon,color:uw}}),x.I18n.t("debug_label")]},"debugEnabled"),m.jsxs(it,{title:x.I18n.t("verbose_help"),onClick:s=>{s.stopPropagation(),s.preventDefault(),this.setState({showDebugMenu:!1,menuDebugAnchorEl:null,verboseEnabled:!this.state.verboseEnabled},()=>this.onChange({verbose:this.state.verboseEnabled}))},children:[m.jsx(wc,{checked:this.state.verboseEnabled}),m.jsx(n_,{style:{...je.menuIcon,color:bg}}),x.I18n.t("verbose_label")]},"verboseEnabled")]},"menuDebug"):null}getDebugBadge(){return[this.state.debugEnabled&&this.state.verboseEnabled?m.jsx(oc,{style:{...je.menuIcon,color:bg}},"DebugVerbose"):null,this.state.debugEnabled&&!this.state.verboseEnabled?m.jsx(oc,{style:{...je.menuIcon,color:uw}},"DebugNoVerbose"):null,!this.state.debugEnabled&&this.state.verboseEnabled?m.jsx(n_,{style:{...je.menuIcon,color:bg}},"noDebugVerbose"):null]}getAskAboutDebug(){return this.state.askAboutDebug?m.jsx(x.DialogConfirm,{onClose:()=>{this.setState({askAboutDebug:!1},()=>this.props.onDebugModeChange(!0))},ok:x.I18n.t("Yes"),cancel:x.I18n.t("Cancel"),text:x.I18n.t("The script will be stopped and must be activated manually after debugging. Continue?")}):null}renderOpenAiDialog(){return this.state.openAiDialog?m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(KA,{adapterName:this.props.adapterName,socket:this.props.socket,runningInstances:this.state.runningInstances,themeType:this.state.themeType,onClose:()=>this.setState({openAiDialog:!1}),language:this.scripts[this.state.selected].engineType==="TypeScript/ts"?"typescript":"javascript",onAddCode:s=>this.setState({insert:s})})}):null}getToolbar(){var r,l;const s=!!(this.state.selected&&((r=this.scripts[this.state.selected])!=null&&r.engine)&&this.state.runningInstances[this.scripts[this.state.selected].engine]),i=!!(this.state.selected&&((l=this.scripts[this.state.selected])!=null&&l.enabled));if(this.state.selected){const c=Object.keys(this.state.changed).filter(h=>this.state.changed[h]).length,d=this.state.changed[this.state.selected];return m.jsxs(FT,{variant:"dense",sx:je.toolbar,children:[!this.props.debugInstance&&this.state.menuOpened&&this.props.onLocate&&m.jsx(qe,{style:je.toolbarButtons,title:x.I18n.t("Locate file"),onClick:()=>this.props.onLocate(this.state.selected),size:"medium",children:m.jsx(hS,{})},"locate"),!this.props.debugInstance&&!d&&s?m.jsx(qe,{disabled:this.props.debugMode,style:je.toolbarButtons,onClick:()=>this.onRestart(),title:x.I18n.t("Restart"),size:"medium",children:m.jsx(pS,{})},"restart"):null,!this.props.debugInstance&&!d?m.jsx(qe,{disabled:this.props.debugMode,onClick:()=>this.onStartStop(),title:i?x.I18n.t("Pause script"):x.I18n.t("Run script"),size:"medium",style:{...je.toolbarButtons,color:i?JA:qA},children:i?m.jsx(gS,{}):m.jsx(mS,{})},"start-stop"):null,!this.props.debugInstance&&!d&&!i?m.jsx("span",{style:je.notRunning,children:x.I18n.t("Script is not running")}):null,!d&&i&&!s?m.jsx("span",{style:je.notRunning,children:x.I18n.t("Instance is disabled")}):null,d?m.jsx(He,{color:"grey",variant:"contained",style:{...je.textButton,...je.saveButton},className:"button-save",onClick:()=>this.onSave(),endIcon:m.jsx(r_,{}),children:x.I18n.t("Save")},"save"):null,c>1||c===1&&!d?m.jsx(He,{color:"grey",variant:"contained",style:je.textButton,onClick:()=>this.onSaveAll(),endIcon:m.jsx(r_,{}),children:x.I18n.t("Save all")},"saveall"):null,d?m.jsx(He,{color:"grey",variant:"contained",style:je.textButton,onClick:()=>this.onCancel(),endIcon:m.jsx(Yc,{}),children:x.I18n.t("Cancel")},"cancel"):null,m.jsx("div",{style:{flex:2}}),!this.props.debugInstance&&!this.state.showCompiledCode&&m.jsx(qe,{style:je.toolbarButtons,title:x.I18n.t("Prettify the script"),onClick:()=>this.setState({triggerPrettier:this.state.triggerPrettier+1}),size:"medium",children:m.jsx(fS,{})},"prettier"),this.state.blockly&&!this.state.showCompiledCode?m.jsx(qe,{"aria-label":"Export Blocks",title:x.I18n.t("Export blocks"),style:je.toolbarButtons,onClick:()=>this.sendCommandToBlockly("export"),size:"medium",children:m.jsx(kc,{})},"export"):null,this.state.blockly&&!this.state.showCompiledCode&&m.jsx(qe,{"aria-label":"Import Blocks",title:x.I18n.t("Import blocks"),style:je.toolbarButtons,onClick:()=>this.sendCommandToBlockly("import"),size:"medium",children:m.jsx(Lg,{})},"import"),this.state.blockly&&!this.state.showCompiledCode&&m.jsx(qe,{"aria-label":"Check code",title:x.I18n.t("Check blocks"),style:je.toolbarButtons,onClick:()=>this.sendCommandToBlockly("check"),size:"medium",children:m.jsx($S,{})},"check"),!this.props.debugMode&&!this.state.blockly&&!this.state.rules&&!this.state.showCompiledCode?m.jsx(qe,{"aria-label":"create CRON",title:x.I18n.t("Create or edit CRON or time wizard"),style:je.toolbarButtons,onClick:()=>this.setState({showCron:!0}),size:"medium",children:m.jsx(bS,{})},"select-cron"):null,this.scripts[this.state.selected]&&this.scripts[this.state.selected].engineType!=="Blockly"&&this.scripts[this.state.selected].engineType!=="Rules"?m.jsx(qe,{"aria-label":"AI",title:x.I18n.t("AI code generator"),style:je.toolbarButtons,size:"medium",onClick:()=>this.setState({openAiDialog:!0}),children:m.jsx(vS,{})},"ai"):null,m.jsx(qe,{"aria-label":"Show astronomical events",title:x.I18n.t("Show astronomical events"),style:je.toolbarButtons,disabled:!s,onClick:()=>{this.setState({showAstro:!0,astroEvents:null}),this.props.socket.sendTo(this.scripts[this.state.selected].engine.replace("system.adapter.",""),"calcAstroAll",{}).then(h=>this.setState({astroEvents:h}))},size:"medium",children:m.jsx(yS,{})},"show-astro"),!this.props.debugMode&&!this.state.blockly&&!this.state.rules&&!this.state.showCompiledCode&&m.jsx(qe,{"aria-label":"select ID",title:x.I18n.t("Insert object ID"),style:je.toolbarButtons,onClick:()=>this.setState({showSelectId:!0}),size:"medium",children:m.jsx(_S,{})},"select-id"),this.state.blockly&&!this.state.rules&&this.state.showCompiledCode&&m.jsx(He,{color:"grey","aria-label":"convert to javascript",title:x.I18n.t("Convert blockly to javascript for ever."),onClick:()=>this.onConvertBlockly2JS(),children:"Blockly=>JS"},"convert2js"),this.state.rules&&!this.state.showCompiledCode&&m.jsx(qe,{"aria-label":"Export Blocks",title:x.I18n.t("Export blocks"),style:je.toolbarButtons,onClick:()=>this.sendCommandToRules("export"),size:"medium",children:m.jsx(kc,{})},"export"),this.state.rules&&!this.state.showCompiledCode&&m.jsx(qe,{"aria-label":"Import Blocks",title:x.I18n.t("Import blocks"),style:je.toolbarButtons,onClick:()=>this.sendCommandToRules("import"),size:"medium",children:m.jsx(Lg,{})},"import"),this.props.expertMode&&!d&&(this.props.debugMode||!this.state.blockly&&!this.state.rules||(this.state.blockly||this.state.rules)&&this.state.showCompiledCode)&&m.jsx(qe,{style:je.toolbarButtons,color:this.props.debugMode?"primary":"default",disabled:!this.props.debugMode&&!s,onClick:()=>{!this.props.debugMode&&i?this.setState({askAboutDebug:!0}):this.props.onDebugModeChange(!this.props.debugMode)},size:"medium",children:m.jsx(oc,{style:{fontSize:32}})}),(this.state.blockly||this.state.rules)&&m.jsx(He,{"aria-label":"blockly",title:x.I18n.t("Show javascript code"),className:"button-js-code",color:this.state.showCompiledCode?"secondary":"inherit",disabled:this.props.debugMode,style:{...je.toolbarButtons,...this.props.debugMode?je.toolbarButtonsDisabled:void 0,padding:"0 5px"},onClick:()=>{this.props.debugMode||(this.setState({showCompiledCode:!this.state.showCompiledCode}),this.state.isTourOpen&&this.state.tourStep===Ns.showJavascript&&this.setState({tourStep:Ns.switchBackToRules}),this.state.isTourOpen&&this.state.tourStep===Ns.switchBackToRules&&this.setState({tourStep:Ns.saveTheScript}))},children:m.jsx("img",{alt:this.state.blockly?"blockly2js":"rules2js",src:this.state.blockly?FA:jA})},"blockly-code"),m.jsx(qe,{disabled:this.props.debugMode,"aria-label":"Debug menu",title:x.I18n.t("Debug options"),style:je.toolbarButtons,onClick:h=>this.setState({showDebugMenu:!0,menuDebugAnchorEl:h.currentTarget}),size:"medium",children:m.jsx(jT,{style:je.badgeMargin,badgeContent:this.getDebugBadge(),children:m.jsx(wS,{})})},"debug")]},"toolbar1")}return null}getScriptEditor(){return!this.props.debugMode&&this.state.selected&&this.props.objects[this.state.selected]&&this.state.blockly!==null&&(!this.state.blockly||this.state.showCompiledCode)&&(!this.state.rules||this.state.showCompiledCode)?(this.scripts[this.state.selected]||=this.getScriptFromObject(this.state.selected),m.jsx(wt,{sx:je.editorDiv,children:m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(GA,{name:this.state.selected,adapterName:this.props.adapterName,insert:this.state.insert,onInserted:()=>this.setState({insert:""}),onForceSave:()=>this.onSave(),searchText:this.state.searchText,onRegisterSelect:s=>this.onRegisterSelect(s),readOnly:this.state.showCompiledCode,changed:this.state.changed[this.state.selected],code:this.scripts[this.state.selected].source||"",isDark:this.state.themeType==="dark",socket:this.props.socket,runningInstances:this.state.runningInstances,triggerPrettier:this.state.triggerPrettier,onChange:s=>this.onChange({script:s}),language:this.scripts[this.state.selected].engineType==="TypeScript/ts"?"typescript":"javascript"},"scriptEditor1")})},"scriptEditorDiv")):null}getBlocklyEditor(){return!this.props.debugMode&&this.state.instancesLoaded&&this.state.selected&&this.props.objects[this.state.selected]&&this.state.blockly&&!this.state.showCompiledCode&&this.state.visible?(this.scripts[this.state.selected]||=this.getScriptFromObject(this.state.selected),m.jsx(wt,{sx:je.editorDiv,children:m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(UA,{command:this.state.cmdToBlockly,themeType:this.state.themeType,searchText:this.state.searchText,code:this.scripts[this.state.selected].source||"",scriptId:this.state.selected,onChange:s=>this.onChange({script:s})},"BlocklyEditor")})},"blocklyEditorDiv")):null}getRulesEditor(){var s,i;if(!this.props.debugMode&&this.state.instancesLoaded&&this.state.selected&&this.props.objects[this.state.selected]&&this.state.rules&&!this.state.showCompiledCode&&this.state.visible){this.scripts[this.state.selected]||=this.getScriptFromObject(this.state.selected);const r=!!this.state.selected&&!!((s=this.scripts[this.state.selected])!=null&&s.engine)&&this.state.runningInstances[this.scripts[this.state.selected].engine],l=!!this.state.selected&&((i=this.scripts[this.state.selected])==null?void 0:i.enabled);return m.jsx(wt,{sx:je.editorDiv,children:m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(HA,{scriptId:this.state.selected,setTourStep:this.setTourStep,tourStep:this.state.tourStep,isTourOpen:this.state.isTourOpen,changed:this.state.changed[this.state.selected],running:r&&l,command:this.state.cmdToRules,themeType:this.state.themeType,themeName:this.props.themeName,theme:this.props.theme,searchText:this.state.searchText,resizing:this.props.resizing,code:this.scripts[this.state.selected].source||"",onChange:c=>this.onChange({script:c})},"flowEditor")})},"flowEditorDiv")}return null}getConfirmDialog(){return this.state.confirm?m.jsx(x.DialogConfirm,{text:this.state.confirm,onClose:s=>{if(this.confirmCallback){const i=this.confirmCallback;this.confirmCallback=null,i(s)}this.setState({confirm:""})}},"dialogConfirm1"):null}getSelectIdDialog(){var s;if(this.state.showSelectId){const i=["state","channel","device","adapter","instance","enum","host","config","script","user","group"],r=["adapter","instance","enum","host","config","script","user","group"];let l=this.selectId.callback?this.selectId.initValue||"":this.getSelect&&this.getSelect()||"",c=l.indexOf("/*");c!==-1&&(l=l.substring(0,c)),c=l.indexOf("//"),c!==-1&&(l=l.substring(0,c));let d=l.match(/"([^"]+)"/);return d&&(l=d[1]),d=l.match(/'([^']+)'/),d&&(l=d[1]),m.jsx(x.DialogSelectID,{theme:this.props.theme,imagePrefix:"../..",themeName:this.props.themeName,themeType:this.state.themeType,socket:this.props.socket,selected:l,expertMode:this.selectId.type&&this.selectId.type!=="all"&&r.includes(this.selectId.type)?!0:void 0,types:((s=this.selectId)==null?void 0:s.type)==="all"?i:[this.selectId.type||"state"],onClose:()=>{this.setState({showSelectId:!1}),this.selectId.callback&&(this.selectId.callback=null)},onOk:(h,p)=>{this.selectId.initValue=null,this.selectId.callback?(this.selectId.callback(h),this.selectId.callback=null):this.setState({insert:`'${h}'/*${p}*/`})}},"dialogSelectID1")}return null}getCronDialog(){return this.state.showCron?m.jsx(x.DialogCron,{theme:this.props.theme,cron:this.cron.callback?this.cron.initValue||"":this.getSelect?this.getSelect():"* * * * *",onClose:()=>this.setState({showCron:!1}),onOk:s=>{this.cron.initValue=null,this.cron.callback?(this.cron.callback(s),this.cron.callback=null):this.setState({insert:`'${s}'`})}},"dialogCron1"):null}getAstroDialog(){return this.state.showAstro?m.jsxs(Ut,{open:!0,onClose:()=>this.setState({showAstro:!1}),children:[m.jsx(ss,{children:x.I18n.t("Astronomical events today")}),m.jsx(qt,{children:this.state.astroEvents?m.jsx(UT,{component:Ow,children:m.jsxs(HT,{size:"small",children:[m.jsx(WT,{children:m.jsxs(i_,{children:[m.jsx(wn,{children:x.I18n.t("Name")}),m.jsx(wn,{children:x.I18n.t("Server time")}),m.jsx(wn,{children:x.I18n.t("Description")})]})}),m.jsx(GT,{children:Object.keys(this.state.astroEvents).map(s=>{var i,r,l,c;return m.jsxs(i_,{children:[m.jsx(wn,{component:"th",scope:"row",children:s.startsWith("next")?"":s}),m.jsx(VT,{title:`${x.I18n.t("Local time")}: ${(i=this.state.astroEvents)!=null&&i[s].isValidDate?new Date((r=this.state.astroEvents)==null?void 0:r[s].date).toLocaleTimeString():"n/a"}`,children:m.jsx(wn,{align:"right",children:(l=this.state.astroEvents)!=null&&l[s].isValidDate?(c=this.state.astroEvents)==null?void 0:c[s].serverTime:"n/a"})}),m.jsx(wn,{children:x.I18n.t(s)})]},s)})})]})}):m.jsx(zT,{})}),m.jsx(Ht,{children:m.jsx(He,{variant:"contained",onClick:()=>this.setState({showAstro:!1}),color:"primary",startIcon:m.jsx(sc,{}),children:x.I18n.t("Close")})})]},"dialogAstro"):null}getEditorDialog(){return this.state.showScript?m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(VA,{adapterName:this.props.adapterName,source:this.scriptDialog.initValue||"",args:this.scriptDialog.args?this.scriptDialog.args.join(", "):"",isReturn:this.scriptDialog.isReturn,socket:this.props.socket,runningInstances:this.state.runningInstances,themeType:this.state.themeType,onClose:s=>{this.scriptDialog.initValue=null,this.scriptDialog.callback&&(s!==!1&&this.scriptDialog.callback(s||""),this.scriptDialog.callback=null),this.setState({showScript:!1})}},"scriptEditorDialog")}):null}getToast(){return m.jsx(KT,{anchorOrigin:{vertical:"bottom",horizontal:"left"},open:!!this.state.toast,autoHideDuration:6e3,onClose:()=>this.setState({toast:""}),slotProps:{content:{"aria-describedby":"message-id"}},message:m.jsx("span",{id:"message-id",children:this.state.toast}),action:[m.jsx(qe,{"aria-label":"close",color:"inherit",style:je.closeToast,onClick:()=>this.setState({toast:""}),size:"medium",children:m.jsx(sc,{})},"close")]},"toast")}setTourStep=s=>this.setState({tourStep:s});getTour(){return this.state.instancesLoaded&&this.state.selected&&this.props.isAnyRulesExists===1&&this.props.objects[this.state.selected]&&this.state.rules&&this.state.visible?m.jsx(Um,{steps:zA,isOpen:this.state.isTourOpen,onRequestClose:()=>{this.setState({isTourOpen:!1}),window.localStorage.setItem("tour","true"),this.props.socket.setState("javascript.0.variables.rulesTour",{val:!0,ack:!0})},goToStep:this.state.tourStep},"tour"):null}getDebug(){return this.props.debugMode?this.state.selected&&this.scripts[this.state.selected]&&this.scripts[this.state.selected].engine&&this.state.runningInstances[this.scripts[this.state.selected].engine]?m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(WA,{runningInstances:this.state.runningInstances,adapterName:this.props.adapterName,socket:this.props.socket,themeName:this.props.themeName,themeType:this.props.themeType,src:this.props.debugInstance?this.props.debugInstance.adapter:this.state.selected,debugInstance:this.props.debugInstance},"debugger")}):(setTimeout(()=>this.props.onDebugModeChange(!1)),null):null}getScriptFromObject(s){var r,l;if(!((r=this.props.objects[s])!=null&&r.common))return;const i=JSON.parse(JSON.stringify(this.props.objects[s].common));return(l=this.props.objects[s].native)!=null&&l.protected&&this.props.password&&(i.source=Vg(this.props.password,i.source)),i}render(){var s,i;return this.state.selected&&this.props.objects[this.state.selected]&&this.state.blockly===null&&this.state.rules===null&&(this.scripts[this.state.selected]||=this.getScriptFromObject(this.state.selected),setTimeout(()=>{const r={blockly:this.scripts[this.state.selected].engineType==="Blockly",rules:this.scripts[this.state.selected].engineType==="Rules",showCompiledCode:!1,debugEnabled:this.scripts[this.state.selected].debug,verboseEnabled:this.scripts[this.state.selected].verbose};this.removeNonExistingScripts(null,r),this.setState(r)},100)),this.state.selected&&!this.props.password&&((i=(s=this.props.objects[this.state.selected])==null?void 0:s.native)!=null&&i.protected)&&setTimeout(()=>{const r=this.state.editing.find(l=>{var c,d;return!((d=(c=this.props.objects[l])==null?void 0:c.native)!=null&&d.protected)})||"";Object.keys(this.scripts).forEach(l=>{var c,d;(d=(c=this.props.objects[l])==null?void 0:c.native)!=null&&d.protected&&delete this.scripts[l]}),this.setState({selected:r},()=>{var l,c;(c=(l=this.props).onSelectedChange)==null||c.call(l,r,this.state.editing),this.state.selected?window.localStorage.setItem("Editor.selected",this.state.selected):window.localStorage.removeItem("Editor.selected")})},50),!this.state.selected&&this.props.password&&this.state.editing.length&&setTimeout(()=>{const r=this.state.editing[0];this.setState({selected:r},()=>{var l,c;(c=(l=this.props).onSelectedChange)==null||c.call(l,r,this.state.editing),window.localStorage.setItem("Editor.selected",this.state.selected)})},50),[this.getTabs(),this.getToolbar(),this.getScriptEditor(),this.getAskAboutDebug(),this.getBlocklyEditor(),this.getRulesEditor(),this.getDebug(),this.getConfirmDialog(),this.getSelectIdDialog(),this.getCronDialog(),this.getEditorDialog(),this.getAstroDialog(),this.getDebugMenu(),this.renderOpenAiDialog(),this.getToast(),this.getTour()]}}const Yt={dialog:{height:"95%"},dropzone:{marginTop:20,width:"100%",borderWidth:5,borderStyle:"dashed",borderColor:"#d0cccc",textAlign:"center",boxSizing:"border-box",paddingTop:45,borderRadius:10,height:"calc(100% - 10px)"},dropzoneDiv:{width:"100%",height:"100%"},dropzoneRejected:{borderColor:"#970000"},dropzoneAccepted:{borderColor:"#17cd02"},icon:{height:"30%",width:"30%",color:"#eeeeee",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",zIndex:0},iconError:{color:"#ffc3c6"},iconOk:{color:"#aaeebc"},text:{top:"50%",left:"50%",transform:"translate(-50%,-50%)",color:"#868686",position:"absolute",zIndex:1}};class Hm extends _e.Component{constructor(s){super(s),this.state={error:"",imageStatus:""}}componentDidMount(){setTimeout(()=>{var s;try{(s=window.document.getElementById("import-text-area"))==null||s.focus()}catch{}},100)}handleCancel(){this.props.onClose()}static readFileDataUrl(s,i){const r=new FileReader;r.onload=()=>{i(null,{data:r.result,name:s.name})},r.onabort=()=>{console.error("file reading was aborted"),i(x.I18n.t("file reading was aborted"))},r.onerror=l=>{console.error("file reading has failed"),i(x.I18n.t("file reading has failed: %s",l))},r.readAsDataURL(s)}handleDropFile(s){if(!(s!=null&&s.length))return;const i=s[s.length-1];i&&Hm.readFileDataUrl(i,(r,l)=>{var c;r||!l?this.setState({error:r||"No data"}):this.props.onClose(((c=l.data)==null?void 0:c.toString())||"",l.name)})}render(){const s={...Yt.dropzone,...this.state.imageStatus==="accepted"?Yt.dropzoneAccepted:this.state.imageStatus==="rejected"?Yt.dropzoneRejected:void 0};return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"lg",sx:{"& .MuiDialog-paper":Yt.dialog},fullWidth:!0,open:!0,"aria-labelledby":"import-dialog-title",PaperProps:{style:{minHeight:"90%",maxHeight:"90%"}},children:[m.jsx(ss,{id:"import-dialog-title",children:x.I18n.t("Import scripts")}),m.jsxs(qt,{children:[m.jsx(Lw,{maxSize:5e7,onDrop:(i,r)=>{var l,c,d;i.length?this.handleDropFile(i):window.alert(((d=(c=(l=r==null?void 0:r[0])==null?void 0:l.errors)==null?void 0:c[0])==null?void 0:d.message)||x.I18n.t("ra_Cannot upload"))},multiple:!1,accept:{"application/zip":[],"application/x-zip-compressed":[]},children:({getRootProps:i,getInputProps:r,isDragActive:l,isDragReject:c})=>c?(this.state.imageStatus!=="rejected"&&this.setState({imageStatus:"rejected"}),m.jsxs("div",{style:{...s,...Yt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Yt.text,children:x.I18n.t("Some files will be rejected")},"text"),m.jsx(Yc,{style:{...Yt.icon,...Yt.iconError}},"icon")]})):l?(this.state.imageStatus!=="accepted"&&this.setState({imageStatus:"accepted"}),m.jsxs("div",{style:{...s,...Yt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Yt.text,children:x.I18n.t("All files will be accepted")},"text"),m.jsx(Pw,{style:{...Yt.icon,...Yt.iconOk}},"icon")]})):(this.state.imageStatus!=="wait"&&this.setState({imageStatus:"wait"}),m.jsxs("div",{style:{...s,...Yt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Yt.text,children:x.I18n.t("Drop some files here or click...")},"text"),m.jsx(Bw,{style:Yt.icon},"icon")]}))},"image-drop"),this.state.error?m.jsx(su,{text:this.state.error,onClose:()=>this.setState({error:""})}):null]}),m.jsx(Ht,{children:m.jsx(He,{color:"grey",variant:"contained",onClick:()=>this.handleCancel(),startIcon:m.jsx(so,{}),children:x.I18n.t("Close")})})]})}}var Wm={exports:{}},XA=Wm.exports;(function(a,s){(function(i,r){a.exports=r()})(XA,function(){var i={},r,l,c,d,h,p,f,b,y,w,v,_,$,S,T,E,D,M,P,W,G,z,Z,he,Ce,R,K,C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P$,B$,F$,j$,z$,Od,U$,rr,ar,H$,Rd,Nd,Md,Ld,Qa,Pd,W$,G$,V$,Ji,Bd,K$,el,ds,Y$,Ro,Fd,J$,lr,jd,zd,Ud,Hd,Wd,Gd,Vd,Kd,Yd,Jd,q$,X$,Z$,Q$,eb,tb,tl,sb,ob,qd,Xd,Zd,Qd,eh,th,sh,sl,cr,oh,ib,ih,nh,rh,ah,lh,ch,uh,dh,hh,ph,nb,rb,ab,gh,lb,cb,ub,db,hb,ge;r=function(e,t,o,n){if(!(e instanceof $e)&&typeof e!="string"||`${e}`.trim()==="")throw Error('Invalid type "'+e+'". The type must be a non-empty string or a Blockly.registry.Type.');if(e=`${e}`.toLowerCase(),typeof t!="string"||t.trim()==="")throw Error('Invalid name "'+t+'". The name must be a non-empty string.');const u=t.toLowerCase();if(!o)throw Error("Can not register a null value");let g=No[e],I=ol[e];if(g||(g=No[e]=Object.create(null),I=ol[e]=Object.create(null)),l(e,o),!n&&g[u]&&g[u]!==o)throw Error('Name "'+u+'" with type "'+e+'" already registered.');g[u]=o,I[u]=t},l=function(e,t){switch(e){case String($e.FIELD):if(typeof t.fromJson!="function")throw Error('Type "'+e+'" must have a fromJson function')}},c=function(e,t){e=`${e}`.toLowerCase(),t=t.toLowerCase();const o=No[e];o&&o[t]?(delete No[e][t],delete ol[e][t]):console.warn("Unable to unregister ["+t+"]["+e+"] from the registry.")},d=function(e,t,o){e=`${e}`.toLowerCase(),t=t.toLowerCase();const n=No[e];if(!n||!n[t]){if(t="Unable to find ["+t+"]["+e+"] in the registry.",o)throw Error(t+" You must require or register a "+e+" plugin.");return console.warn(t),null}return n[t]},h=function(e,t){return e=`${e}`.toLowerCase(),t=t.toLowerCase(),(e=No[e])?!!e[t]:!1},p=function(e,t,o){return d(e,t,o)},f=function(e,t,o){return d(e,t,o)},b=function(e,t,o){e=`${e}`.toLowerCase();var n=No[e];if(!n){if(n=`Unable to find [${e}] in the registry.`,o)throw Error(`${n} You must require or register a ${e} plugin.`);return console.warn(n),null}if(!t)return n;e=ol[e],o=Object.create(null);for(const u of Object.keys(n))o[e[u]]=n[u];return o},y=function(e,t,o){return t=t.plugins[String(e)]||Ws,typeof t=="function"?t:p(e,t,o)},w=function(e,t,o,n){e=e+" was deprecated in "+t+" and will be deleted in "+o+".",n&&(e+=` +Use `+n+" instead."),gb.has(e)||(gb.add(e),console.warn(e))},v=function(){return"blockly-"+(LC++).toString(36)},_=function(){return $b.genUid()},$=function(e){return e.type===ee.BLOCK_CREATE},S=function(e){return e.type===ee.BLOCK_DELETE},T=function(e){return e.type===ee.BLOCK_CHANGE},E=function(e){return e.type===ee.BLOCK_FIELD_INTERMEDIATE_CHANGE},D=function(e){return e.type===ee.BLOCK_MOVE},M=function(e){return e.type===ee.CLICK},P=function(e){return e.type===ee.BUBBLE_OPEN},W=function(e){return e.type===ee.VIEWPORT_CHANGE},i.setRecordUndo$$module$build$src$core$events$utils=function(e){ur=e},G=function(){return ur},z=function(e){vb.fireInternal(e)},Z=function(e){if(C()){if(!po.length)try{requestAnimationFrame(()=>{setTimeout(he,0)})}catch{setTimeout(he,0)}Ce(e)}},he=function(){const e=R(po,!0);po.length=0;for(const t of e){if(!t.workspaceId)continue;let o;(o=re(t.workspaceId))==null||o.fireChangeListener(t)}},Ce=function(e){if(T(e)&&e.element==="mutation"){let t;for(t=po.length;0!n.isNull()),t||e.reverse(),e},K=function(){for(let e=0,t;t=po[e];e++)t.recordUndo=!1},i.disable$$module$build$src$core$events$utils=function(){fh++},i.enable$$module$build$src$core$events$utils=function(){fh--},C=function(){return fh===0},i.getGroup$$module$build$src$core$events$utils=function(){return bb},i.setGroup$$module$build$src$core$events$utils=function(e){vb.setGroupInternal(e)},Q=function(e){bb=typeof e=="boolean"?e?_():"":e},ve=function(e){const t=[];e=e.getDescendants(!1);for(let o=0,n;n=e[o];o++)t[o]=n.id;return t},ce=function(e,t){const o=ne(e.type);if(!o)throw Error("Unknown event type.");return o.fromJson(e,t)},ne=function(e){const t=p($e.EVENT,e);if(!t)throw Error(`Event type ${e} not found in registry.`);return t},me=function(e){if((D(e)||$(e))&&e.workspaceId){var t=re(e.workspaceId);if(!e.blockId)throw Error("Encountered a blockEvent without a proper blockId");if(e=t.getBlockById(e.blockId)){const o=ur;try{ur=!1;const n=e.getParent();if(n&&!n.hasDisabledReason($h)){const u=e.getDescendants(!1);for(let g=0,I;I=u[g];g++)I.setDisabledReason(!1,$h)}else if((e.outputConnection||e.previousConnection)&&!t.isDragging())do e.setDisabledReason(!0,$h),e=e.getNextBlock();while(e)}finally{ur=o}}}},re=function(e){return dr[e]||null},B=function(){const e=[];for(const t in dr)e.push(dr[t]);return e},N=function(e){dr[e.id]=e},te=function(e){delete dr[e.id]},q=function(){return yb},se=function(e){yb=e},j=function(){return ai},i.setSelected$$module$build$src$core$common=function(e){if(ai!==e){var t,o,n,u,g,I,L=new(ne(ee.SELECTED))((n=(t=ai)==null?void 0:t.id)!=null?n:null,(u=e==null?void 0:e.id)!=null?u:null,(I=(g=e==null?void 0:e.workspace.id)!=null?g:(o=ai)==null?void 0:o.workspace.id)!=null?I:"");z(L);var le;(le=ai)==null||le.unselect(),ai=e;var Ee;(Ee=ai)==null||Ee.select()}},Te=function(){return _b},ae=function(e){_b=e},we=function(e){for(;e.options.parentWorkspace;)e=e.options.parentWorkspace;const t=e.getParentSvg(),o=e.getCachedParentSvgSize();var n=t.parentElement;if(n instanceof HTMLElement){var u=n.offsetWidth;n=n.offsetHeight,o.width!==u&&(t.setAttribute("width",u+"px"),e.setCachedParentSvgSize(u,null)),o.height!==n&&(t.setAttribute("height",n+"px"),e.setCachedParentSvgSize(null,n)),e.resize()}},Ie=function(e,t){const o=Object.create(null),n=e.getDescendants(!0);t&&(e=e.getNextBlock())&&(e=n.indexOf(e),n.splice(e,n.length-e));for(let u=0,g;g=n[u];u++)o[g.type]?o[g.type]++:o[g.type]=1;return o},Ne=function(e){return function(){this.jsonInit(e)}},Ae=function(e){wb.defineBlocksWithJsonArrayInternal(e)},We=function(e){i.defineBlocks$$module$build$src$core$common(i.createBlockDefinitionsFromJsonArray$$module$build$src$core$common(e))},i.createBlockDefinitionsFromJsonArray$$module$build$src$core$common=function(e){const t={};for(let o=0;o>>/g,e),Th="",e=document.createElement("style"),e.id="blockly-common-style",t=document.createTextNode(t),e.appendChild(t),document.head.insertBefore(e,document.head.firstChild)))},ie=function(e,t,o){e=document.createElementNS(pr,`${e}`);for(const n in t)e.setAttribute(n,`${t[n]}`);return o&&o.appendChild(e),e},Oe=function(e,t){return t=t.split(" "),t.every(o=>e.classList.contains(o))?!1:(e.classList.add(...t),!0)},Ps=function(e,t){e.classList.remove(...t.split(" "))},ze=function(e,t){return t=t.split(" "),t.every(o=>!e.classList.contains(o))?!1:(e.classList.remove(...t),!0)},Zo=function(e,t){return e.classList.contains(t)},Ze=function(e){return e&&e.parentNode?e.parentNode.removeChild(e):null},At=function(e,t){const o=t.nextSibling;if(t=t.parentNode,!t)throw Error("Reference node has no parent.");o?t.insertBefore(e,o):t.appendChild(e)},Qo=function(e,t){e.style.transform=t,e.style["-webkit-transform"]=t},io=function(){Eh++,Es||(Es=Object.create(null))},no=function(){Eh--,Eh||(Es=null)},Un=function(e){const t=e.textContent+` `+e.className.baseVal;let o;if(Es&&(o=Es[t]))return o;try{o=e.getComputedTextLength()}catch{return 8*e.textContent.length}return Es&&(Es[t]=o),o},Io=function(e,t,o,n){return Bs(e,t+"pt",o,n)},Bs=function(e,t,o,n){const u=e.textContent;e=u+` -`+e.className.baseVal;var g;return Es&&(g=Es[e])||(cl||(g=document.createElement("canvas"),g.className="blocklyComputeCanvas",document.body.appendChild(g),cl=g.getContext("2d")),cl.font=o+" "+t+" "+n,g=u?cl.measureText(u).width:0,Es&&(Es[e]=g)),g},ro=function(e,t,o,n){const u=document.createElement("span");u.style.font=o+" "+t+" "+n,u.textContent=e,e=document.createElement("div"),e.style.width="1px",e.style.height="0",t=document.createElement("div"),t.style.display="flex",t.style.position="fixed",t.style.top="0",t.style.left="0",t.appendChild(u),t.appendChild(e),document.body.appendChild(t),o={height:0,baseline:0};try{t.style.alignItems="baseline",o.baseline=e.offsetTop-u.offsetTop,t.style.alignItems="flex-end",o.height=e.offsetTop-u.offsetTop}finally{document.body.removeChild(t)}return o},Hn=function(e){return Mb.getSizeInternal(e)},Gm=function(e){if(Fs(e,"display")!=="none")return pu(e);const t=e.style,o=t.display,n=t.visibility,u=t.position;t.visibility="hidden",t.position="absolute",t.display="inline";const g=e.offsetWidth;return e=e.offsetHeight,t.display=o,t.position=u,t.visibility=n,new Xe(g,e)},pu=function(e){return new Xe(e.offsetWidth,e.offsetHeight)},Fs=function(e,t){return e=window.getComputedStyle(e),e[t]||e.getPropertyValue(t)},xo=function(e){const t=new ye(0,0);e=e.getBoundingClientRect();var o=document.documentElement;return o=new ye(window.pageXOffset||o.scrollLeft,window.pageYOffset||o.scrollTop),t.x=e.left+o.x,t.y=e.top+o.y,t},gu=function(){const e=document.body,t=document.documentElement;return new ye(e.scrollLeft||t.scrollLeft,e.scrollTop||t.scrollTop)},mu=function(e){const t=parseFloat(Fs(e,"borderLeftWidth")),o=parseFloat(Fs(e,"borderRightWidth")),n=parseFloat(Fs(e,"borderTopWidth"));return e=parseFloat(Fs(e,"borderBottomWidth")),new rt(n,e,t,o)},ma=function(e,t,o){e=fu(e,t,o),t.scrollLeft=e.x,t.scrollTop=e.y},fu=function(e,t,o){var n=xo(e),u=xo(t),g=mu(t);const I=n.x-u.x-g.left;return n=n.y-u.y-g.top,u=pu(e),e=t.clientWidth-u.width,u=t.clientHeight-u.height,g=t.scrollLeft,t=t.scrollTop,o?(g+=I-e/2,t+=n-u/2):(g+=Math.min(I,Math.max(I-e,0)),t+=Math.min(n,Math.max(n-u,0))),new ye(g,t)},Wn=function(e){const t=new ye(0,0);var o=e.x&&e.getAttribute("x");const n=e.y&&e.getAttribute("y");return o&&(t.x=parseInt(o)),n&&(t.y=parseInt(n)),(o=(o=e.getAttribute("transform"))&&o.match(Lb))&&(t.x+=Number(o[1]),o[3]&&(t.y+=Number(o[3]))),(e=e.getAttribute("style"))&&e.includes("translate")&&(e=e.match(Pb))&&(t.x+=Number(e[1]),e[3]&&(t.y+=Number(e[3]))),t},fa=function(e){let t=0,o=0;for(;e;){const n=Wn(e);if(t+=n.x,o+=n.y,(" "+(e.getAttribute("class")||"")+" ").includes(" injectionDiv "))break;e=e.parentNode}return new ye(t,o)},$u=function(){const e=gu();return new rt(e.y,document.documentElement.clientHeight+e.y,e.x,document.documentElement.clientWidth+e.x)},bu=function(){const e=document.documentElement,t=window;return new ye(t.pageXOffset||e.scrollLeft,t.pageYOffset||e.scrollTop)},Vm=function(e,t){var o=t.x;t=t.y;const n=e.getInjectionDiv().getBoundingClientRect();return o=new ye(o-n.left,t-n.top),t=e.getOriginOffsetInPixels(),ye.difference(o,t).scale(1/e.scale)},Km=function(e,t){var o=t.scale(e.scale);t=o.x,o=o.y;const n=e.getInjectionDiv().getBoundingClientRect();return e=e.getOriginOffsetInPixels(),new ye(t+n.left+e.x,o+n.top+e.y)},Ym=function(e){({document:dl=dl,DOMParser:gr=gr,XMLSerializer:mr=mr}=e),ul=new gr,Ih=new mr},i.createElement$$module$build$src$core$utils$xml=function(e){return dl.createElementNS(Bb,e)},i.createTextNode$$module$build$src$core$utils$xml=function(e){return dl.createTextNode(e)},i.textToDom$$module$build$src$core$utils$xml=function(e){let t=ul.parseFromString(e,"text/xml");if(t&&t.documentElement&&!t.getElementsByTagName("parsererror").length)return t.documentElement;if((t=ul.parseFromString(e,"text/html"))&&t.body.firstChild&&t.body.firstChild.nodeName.toLowerCase()==="xml")return t.body.firstChild;throw Error(`DOMParser was unable to parse: ${e}`)},Li=function(e){return Jm(Ih.serializeToString(e))},Jm=function(e){return e.replace(zC,t=>`&#${t.charCodeAt(0)};`)},$a=function(e){return e?((e instanceof Element||typeof e=="string")&&(e=yu(e),e=Zm(e)),qm(e),e):null},qm=function(e){const t=e.kind;if(e=e.contents,t&&t!==Fb&&t!==xh)throw Error("Invalid toolbox kind "+t+". Please supply either "+Fb+" or "+xh);if(!e)throw Error("Toolbox must have a contents attribute.")},Gn=function(e){return e?e.contents?e.contents:Array.isArray(e)&&0o.kind.toUpperCase()==="CATEGORY").length},va=function(e){return e&&e.contents?!!e.contents.filter(function(t){return t.kind.toUpperCase()==="CATEGORY"}).length:!1},Zm=function(e){const t={contents:ya(e)};return e instanceof Node&&vu(e,t),t},ya=function(e){const t=[];let o=e.childNodes;o||(o=e);for(let n=0,u;u=o[n];n++){if(!u.tagName)continue;e={};const g=u.tagName.toUpperCase();e.kind=g,g==="BLOCK"?e.blockxml=u:u.childNodes&&0 document.")}else e instanceof Element&&(t=e);return t},_a=function(e,t,o,n,u,g){const I=g.scrollbar&&g.scrollbar.canScrollVertically();return e.horizontal===Zi.LEFT?(o=u.absoluteMetrics.left+o,I&&g.RTL&&(o+=yt.scrollbarThickness)):(o=u.absoluteMetrics.left+u.viewMetrics.width-t.width-o,I&&!g.RTL&&(o-=yt.scrollbarThickness)),e.vertical===$o.TOP?e=u.absoluteMetrics.top+n:(e=u.absoluteMetrics.top+u.viewMetrics.height-t.height-n,g.scrollbar&&g.scrollbar.canScrollHorizontally()&&(e-=yt.scrollbarThickness)),new rt(e,e+t.height,o,o+t.width)},wa=function(e,t){return{horizontal:t.toolboxMetrics.position===Ge.LEFT||e.horizontalLayout&&!e.RTL?Zi.RIGHT:Zi.LEFT,vertical:t.toolboxMetrics.position===Ge.BOTTOM?$o.TOP:$o.BOTTOM}},ka=function(e,t,o,n){const u=e.left,g=e.right-e.left,I=e.bottom-e.top;for(let L=0;Lg.id!==e.id).map(g=>g.getRelativeToSurfaceXY());for(;sf(ye.sum(o,n),u);)n.translate(t.RTL?-30:30,30);e.moveTo(ye.sum(o,n))},sf=function(e,t){return t.some(o=>1>=Math.abs(o.x-e.x)&&1>=Math.abs(o.y-e.y))},Do=function(e,t){e.setAttribute(WC,t)},xt=function(e,t,o){Array.isArray(o)&&(o=o.join(" ")),e.setAttribute(HC+t,`${o}`)},Yn=function(e){return e.saveState!==void 0&&e.loadState!==void 0},_u=function(e){return wu(e),of()?(Ta(),Promise.resolve()):(Qi||(Qi=new Promise(t=>{Ph=t,Kb=window.requestAnimationFrame(()=>{Ta(),t()})})),Qi)},Ts=function(){return Qi||Promise.resolve()},ao=function(e){e||window.cancelAnimationFrame(Kb),Ta(e),!e&&Ph&&Ph()},of=function(){return Ib},wu=function(e){Mh.add(e),Lh.set(e,i.getGroup$$module$build$src$core$events$utils());const t=e.getParent();t?wu(t):ml.add(e)},Ta=function(e){const t=e?new Set([e]):new Set([...ml].map(g=>g.workspace)),o=[...ml].filter(nf).filter(g=>t.has(g.workspace));for(var n of o)Cu(n);for(const g of t)g.resizeContents();for(var u of o)n=u.getRelativeToSurfaceXY(),u.updateComponentLocations(n);for(const g of o)u=i.getGroup$$module$build$src$core$events$utils(),(n=Lh.get(g))&&i.setGroup$$module$build$src$core$events$utils(n),g.bumpNeighbours(),i.setGroup$$module$build$src$core$events$utils(u);for(const g of o)ku(g);e||(Qi=null)},ku=function(e){ml.delete(e),Mh.delete(e),Lh.delete(e);for(const t of e.getChildren(!1))ku(t)},nf=function(e){return!e.isDisposed()&&!e.getParent()},Cu=function(e){if(Mh.has(e)&&e.initialized){for(const t of e.getChildren(!1))Cu(t);e.renderEfficiently()}},Jn=function(e,t){Yb(e,t)},rf=function(e){Yb=e},Sa=function(e,t){Xb.confirmInternal(e,t)},af=function(e,t){Jb(e,t)},lf=function(e){Jb=e},Ea=function(e,t,o){qb(e,t,o)},cf=function(e){qb=e},Bi=function(e){return e.getProcedureDef!==void 0},uf=function(e){return e.getProcedureCall!==void 0&&e.renameProcedure!==void 0},Tu=function(e){return e.getVariableModel!==void 0},i.allUsedVarModels$$module$build$src$core$variables=function(e){e=e.getAllBlocks(!1);const t=new Set;for(let o=0;o1'),n.appendChild(o),t.push(n)),Zt.variables_get){e.sort(vr.compareByName);for(let u=0,g;g=e[u];u++)o=i.createElement$$module$build$src$core$utils$xml("block"),o.setAttribute("type","variables_get"),o.setAttribute("gap","8"),o.appendChild(ei(g)),t.push(o)}}return t},Eu=function(e){return Qb.generateUniqueNameInternal(e)},df=function(e){return xa(zh.charAt(0),e.getAllVariableNames())},xa=function(e,t){if(!t.length)return e;const o=zh;let n="",u=o.indexOf(e);for(;;){let g=!1;for(let I=0;Ig.getVariableModel().name);if(n&&(o=n.some(g=>g.toLowerCase()===e),n=n.some(g=>g.toLowerCase()===t),o&&n))return u.getName()}return null},gf=function(e,t,o){e=e.toLowerCase(),t=t.toLowerCase(),o=o.getAllBlocks(!1);for(const u of o){if(!Bi(u))continue;o=u.getProcedureDef();var n=o[1];const g=n.some(I=>I.toLowerCase()===e);if(n=n.some(I=>I.toLowerCase()===t),g&&n)return o[0]}return null},ei=function(e){const t=i.createElement$$module$build$src$core$utils$xml("field");return t.setAttribute("name","VAR"),t.setAttribute("id",e.getId()),t.setAttribute("variabletype",e.type),e=i.createTextNode$$module$build$src$core$utils$xml(e.name),t.appendChild(e),t},i.getOrCreateVariablePackage$$module$build$src$core$variables=function(e,t,o,n){let u=i.getVariable$$module$build$src$core$variables(e,t,o,n);return u||(u=mf(e,t,o,n)),u},i.getVariable$$module$build$src$core$variables=function(e,t,o,n){const u=e.getPotentialVariableMap();let g=null;if(t&&(g=e.getVariableById(t),!g&&u&&(g=u.getVariableById(t)),g))return g;if(o){if(n===void 0)throw Error("Tried to look up a variable by name without a type");g=e.getVariable(o,n),!g&&u&&(g=u.getVariable(o,n))}return g},mf=function(e,t,o,n){const u=e.getPotentialVariableMap();return o||(o=Eu(e.isFlyout?e.targetWorkspace:e)),u?u.createVariable(o,n,t):e.createVariable(o,n,t)},qn=function(e,t){e=e.getAllVariables();const o=[];if(t.length!==e.length)for(let n=0;n{le.disposed||le.setConnectionTracking(!0)},1)}return L},Au=function(e,t,{parentConnection:o,isShadow:n=!1}={}){if(!e.type)throw new ev(e);const u=t.newBlock(e.type,e.id);return u.setShadow(n),Cf(u,e),Tf(u,e),Sf(u,e),Ef(o,u,e),If(u,e),xf(u,e),Df(u,e),Af(u,e),Of(u,t.rendered),u},kf=function(e,t){if(C())for(e=qn(e,t),t=0;tt&&(t=o[n].length);var u=-1/0;let g,I=1;do{n=u,g=e,e=[],u=o.length/I;let L=1;for(let le=0;len);return g},Ma=function(e,t,o){const n=[0],u=[];for(var g=0;gn&&(n=L,u=I)}return u?Ju(e,u,o):t},Pf=function(e,t){const o=[];for(let n=0;nuv&&co()}else Cr!==hs&&(clearTimeout(bi),Vh=e.pageX,Kh=e.pageY,bi=setTimeout(Kf,dv))},Qu=function(){Cr=hs=null,co()},co=function(){kr&&(kr=!1,Tt&&(Tt.style.display="none")),bi&&(clearTimeout(bi),bi=0)},ed=function(){co(),rn=!0},td=function(){rn=!1},Wf=function(){Tt&&hs&&(typeof yl=="function"?yl(Tt,hs):Gf())},Gf=function(){var e=Hi(hs);e=i.wrap$$module$build$src$core$utils$string(e,lv),e=e.split(` -`);for(let t=0;to+window.scrollY&&(u-=Tt.offsetHeight+2*Jh),e?n=Math.max(_l-window.scrollX,n):n+Tt.offsetWidth>t+window.scrollX-2*_l&&(n=t-Tt.offsetWidth-2*_l),{x:n,y:u}},Kf=function(){if(!rn&&(Cr=hs,Tt)){Tt.textContent="",Wf();var e=hs.RTL;Tt.style.direction=e?"rtl":"ltr",Tt.style.display="block",kr=!0;var{x:t,y:o}=Vf(e);Tt.style.left=t+"px",Tt.style.top=o+"px"}},sd=function(){return qh},Yf=function(e){qh=e},od=function(){return Xh},Jf=function(e){Xh=e},ti=function(e){e=`${e}`.toLowerCase().trim();var t=hv[e];if(t||(t=e.substring(0,2)==="0x"?"#"+e.substring(2):e,t=t[0]==="#"?t:"#"+t,/^#[0-9a-f]{6}$/.test(t)))return t;if(/^#[0-9a-f]{3}$/.test(t))return["#",t[1],t[1],t[2],t[2],t[3],t[3]].join("");var o=e.match(/^(?:rgb)?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);return o&&(e=Number(o[1]),t=Number(o[2]),o=Number(o[3]),0<=e&&256>e&&0<=t&&256>t&&0<=o&&256>o)?er(e,t,o):null},er=function(e,t,o){return t=e<<16|t<<8|o,16>e?"#"+(16777216|t).toString(16).substr(1):"#"+t.toString(16)},Pa=function(e){return e=ti(e),e?(e=parseInt(e.substr(1),16),[e>>16,e>>8&255,e&255]):[0,0,0]},Ba=function(e,t,o){let n=0,u=0,g=0;if(t===0)g=u=n=o;else{const I=Math.floor(e/60),L=e/60-I;e=o*(1-t);const le=o*(1-t*L);switch(t=o*(1-t*(1-L)),I){case 1:n=le,u=o,g=e;break;case 2:n=e,u=o,g=t;break;case 3:n=e,u=le,g=o;break;case 4:n=t,u=e,g=o;break;case 5:n=o,u=e,g=le;break;case 6:case 0:n=o,u=t,g=e}}return er(Math.floor(n),Math.floor(u),Math.floor(g))},si=function(e,t,o){return e=ti(e),!e||(t=ti(t),!t)?null:(e=Pa(e),t=Pa(t),er(Math.round(t[0]+o*(e[0]-t[0])),Math.round(t[1]+o*(e[1]-t[1])),Math.round(t[2]+o*(e[2]-t[2]))))},id=function(e){return Ba(e,qh,255*Xh)},Fa=function(e,t,o){const n=[];var u=e.split("");u.push("");var g=0;e=[];let I=null;for(let Ee=0;Ee`&#${t.charCodeAt(0)};`)},$a=function(e){return e?((e instanceof Element||typeof e=="string")&&(e=yu(e),e=ef(e)),Zm(e),e):null},Zm=function(e){const t=e.kind;if(e=e.contents,t&&t!==zb&&t!==xh)throw Error("Invalid toolbox kind "+t+". Please supply either "+zb+" or "+xh);if(!e)throw Error("Toolbox must have a contents attribute.")},Gn=function(e){return e?e.contents?e.contents:Array.isArray(e)&&0o.kind.toUpperCase()==="CATEGORY").length},va=function(e){return e&&e.contents?!!e.contents.filter(function(t){return t.kind.toUpperCase()==="CATEGORY"}).length:!1},ef=function(e){const t={contents:ya(e)};return e instanceof Node&&vu(e,t),t},ya=function(e){const t=[];let o=e.childNodes;o||(o=e);for(let n=0,u;u=o[n];n++){if(!u.tagName)continue;e={};const g=u.tagName.toUpperCase();e.kind=g,g==="BLOCK"?e.blockxml=u:u.childNodes&&0 document.")}else e instanceof Element&&(t=e);return t},_a=function(e,t,o,n,u,g){const I=g.scrollbar&&g.scrollbar.canScrollVertically();return e.horizontal===Zi.LEFT?(o=u.absoluteMetrics.left+o,I&&g.RTL&&(o+=yt.scrollbarThickness)):(o=u.absoluteMetrics.left+u.viewMetrics.width-t.width-o,I&&!g.RTL&&(o-=yt.scrollbarThickness)),e.vertical===$o.TOP?e=u.absoluteMetrics.top+n:(e=u.absoluteMetrics.top+u.viewMetrics.height-t.height-n,g.scrollbar&&g.scrollbar.canScrollHorizontally()&&(e-=yt.scrollbarThickness)),new rt(e,e+t.height,o,o+t.width)},wa=function(e,t){return{horizontal:t.toolboxMetrics.position===Ge.LEFT||e.horizontalLayout&&!e.RTL?Zi.RIGHT:Zi.LEFT,vertical:t.toolboxMetrics.position===Ge.BOTTOM?$o.TOP:$o.BOTTOM}},ka=function(e,t,o,n){const u=e.left,g=e.right-e.left,I=e.bottom-e.top;for(let L=0;Lg.id!==e.id).map(g=>g.getRelativeToSurfaceXY());for(;nf(ye.sum(o,n),u);)n.translate(t.RTL?-30:30,30);e.moveTo(ye.sum(o,n))},nf=function(e,t){return t.some(o=>1>=Math.abs(o.x-e.x)&&1>=Math.abs(o.y-e.y))},Do=function(e,t){e.setAttribute(WC,t)},xt=function(e,t,o){Array.isArray(o)&&(o=o.join(" ")),e.setAttribute(HC+t,`${o}`)},Yn=function(e){return e.saveState!==void 0&&e.loadState!==void 0},_u=function(e){return wu(e),rf()?(Ta(),Promise.resolve()):(Qi||(Qi=new Promise(t=>{Ph=t,Jb=window.requestAnimationFrame(()=>{Ta(),t()})})),Qi)},Ts=function(){return Qi||Promise.resolve()},ao=function(e){e||window.cancelAnimationFrame(Jb),Ta(e),!e&&Ph&&Ph()},rf=function(){return Db},wu=function(e){Mh.add(e),Lh.set(e,i.getGroup$$module$build$src$core$events$utils());const t=e.getParent();t?wu(t):ml.add(e)},Ta=function(e){const t=e?new Set([e]):new Set([...ml].map(g=>g.workspace)),o=[...ml].filter(af).filter(g=>t.has(g.workspace));for(var n of o)Cu(n);for(const g of t)g.resizeContents();for(var u of o)n=u.getRelativeToSurfaceXY(),u.updateComponentLocations(n);for(const g of o)u=i.getGroup$$module$build$src$core$events$utils(),(n=Lh.get(g))&&i.setGroup$$module$build$src$core$events$utils(n),g.bumpNeighbours(),i.setGroup$$module$build$src$core$events$utils(u);for(const g of o)ku(g);e||(Qi=null)},ku=function(e){ml.delete(e),Mh.delete(e),Lh.delete(e);for(const t of e.getChildren(!1))ku(t)},af=function(e){return!e.isDisposed()&&!e.getParent()},Cu=function(e){if(Mh.has(e)&&e.initialized){for(const t of e.getChildren(!1))Cu(t);e.renderEfficiently()}},Jn=function(e,t){qb(e,t)},lf=function(e){qb=e},Sa=function(e,t){Qb.confirmInternal(e,t)},cf=function(e,t){Xb(e,t)},uf=function(e){Xb=e},Ea=function(e,t,o){Zb(e,t,o)},df=function(e){Zb=e},Bi=function(e){return e.getProcedureDef!==void 0},hf=function(e){return e.getProcedureCall!==void 0&&e.renameProcedure!==void 0},Tu=function(e){return e.getVariableModel!==void 0},i.allUsedVarModels$$module$build$src$core$variables=function(e){e=e.getAllBlocks(!1);const t=new Set;for(let o=0;o1'),n.appendChild(o),t.push(n)),Zt.variables_get){e.sort(vr.compareByName);for(let u=0,g;g=e[u];u++)o=i.createElement$$module$build$src$core$utils$xml("block"),o.setAttribute("type","variables_get"),o.setAttribute("gap","8"),o.appendChild(ei(g)),t.push(o)}}return t},Eu=function(e){return tv.generateUniqueNameInternal(e)},pf=function(e){return xa(zh.charAt(0),e.getAllVariableNames())},xa=function(e,t){if(!t.length)return e;const o=zh;let n="",u=o.indexOf(e);for(;;){let g=!1;for(let I=0;Ig.getVariableModel().name);if(n&&(o=n.some(g=>g.toLowerCase()===e),n=n.some(g=>g.toLowerCase()===t),o&&n))return u.getName()}return null},ff=function(e,t,o){e=e.toLowerCase(),t=t.toLowerCase(),o=o.getAllBlocks(!1);for(const u of o){if(!Bi(u))continue;o=u.getProcedureDef();var n=o[1];const g=n.some(I=>I.toLowerCase()===e);if(n=n.some(I=>I.toLowerCase()===t),g&&n)return o[0]}return null},ei=function(e){const t=i.createElement$$module$build$src$core$utils$xml("field");return t.setAttribute("name","VAR"),t.setAttribute("id",e.getId()),t.setAttribute("variabletype",e.type),e=i.createTextNode$$module$build$src$core$utils$xml(e.name),t.appendChild(e),t},i.getOrCreateVariablePackage$$module$build$src$core$variables=function(e,t,o,n){let u=i.getVariable$$module$build$src$core$variables(e,t,o,n);return u||(u=$f(e,t,o,n)),u},i.getVariable$$module$build$src$core$variables=function(e,t,o,n){const u=e.getPotentialVariableMap();let g=null;if(t&&(g=e.getVariableById(t),!g&&u&&(g=u.getVariableById(t)),g))return g;if(o){if(n===void 0)throw Error("Tried to look up a variable by name without a type");g=e.getVariable(o,n),!g&&u&&(g=u.getVariable(o,n))}return g},$f=function(e,t,o,n){const u=e.getPotentialVariableMap();return o||(o=Eu(e.isFlyout?e.targetWorkspace:e)),u?u.createVariable(o,n,t):e.createVariable(o,n,t)},qn=function(e,t){e=e.getAllVariables();const o=[];if(t.length!==e.length)for(let n=0;n{le.disposed||le.setConnectionTracking(!0)},1)}return L},Au=function(e,t,{parentConnection:o,isShadow:n=!1}={}){if(!e.type)throw new sv(e);const u=t.newBlock(e.type,e.id);return u.setShadow(n),Sf(u,e),Ef(u,e),If(u,e),xf(o,u,e),Df(u,e),Af(u,e),Of(u,e),Rf(u,e),Nf(u,t.rendered),u},Tf=function(e,t){if(C())for(e=qn(e,t),t=0;tt&&(t=o[n].length);var u=-1/0;let g,I=1;do{n=u,g=e,e=[],u=o.length/I;let L=1;for(let le=0;len);return g},Ma=function(e,t,o){const n=[0],u=[];for(var g=0;gn&&(n=L,u=I)}return u?Ju(e,u,o):t},Ff=function(e,t){const o=[];for(let n=0;nhv&&co()}else Cr!==hs&&(clearTimeout(bi),Vh=e.pageX,Kh=e.pageY,bi=setTimeout(Jf,pv))},Qu=function(){Cr=hs=null,co()},co=function(){kr&&(kr=!1,Tt&&(Tt.style.display="none")),bi&&(clearTimeout(bi),bi=0)},ed=function(){co(),rn=!0},td=function(){rn=!1},Vf=function(){Tt&&hs&&(typeof yl=="function"?yl(Tt,hs):Kf())},Kf=function(){var e=Hi(hs);e=i.wrap$$module$build$src$core$utils$string(e,uv),e=e.split(` +`);for(let t=0;to+window.scrollY&&(u-=Tt.offsetHeight+2*Jh),e?n=Math.max(_l-window.scrollX,n):n+Tt.offsetWidth>t+window.scrollX-2*_l&&(n=t-Tt.offsetWidth-2*_l),{x:n,y:u}},Jf=function(){if(!rn&&(Cr=hs,Tt)){Tt.textContent="",Vf();var e=hs.RTL;Tt.style.direction=e?"rtl":"ltr",Tt.style.display="block",kr=!0;var{x:t,y:o}=Yf(e);Tt.style.left=t+"px",Tt.style.top=o+"px"}},sd=function(){return qh},qf=function(e){qh=e},od=function(){return Xh},Xf=function(e){Xh=e},ti=function(e){e=`${e}`.toLowerCase().trim();var t=gv[e];if(t||(t=e.substring(0,2)==="0x"?"#"+e.substring(2):e,t=t[0]==="#"?t:"#"+t,/^#[0-9a-f]{6}$/.test(t)))return t;if(/^#[0-9a-f]{3}$/.test(t))return["#",t[1],t[1],t[2],t[2],t[3],t[3]].join("");var o=e.match(/^(?:rgb)?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);return o&&(e=Number(o[1]),t=Number(o[2]),o=Number(o[3]),0<=e&&256>e&&0<=t&&256>t&&0<=o&&256>o)?er(e,t,o):null},er=function(e,t,o){return t=e<<16|t<<8|o,16>e?"#"+(16777216|t).toString(16).substr(1):"#"+t.toString(16)},Pa=function(e){return e=ti(e),e?(e=parseInt(e.substr(1),16),[e>>16,e>>8&255,e&255]):[0,0,0]},Ba=function(e,t,o){let n=0,u=0,g=0;if(t===0)g=u=n=o;else{const I=Math.floor(e/60),L=e/60-I;e=o*(1-t);const le=o*(1-t*L);switch(t=o*(1-t*(1-L)),I){case 1:n=le,u=o,g=e;break;case 2:n=e,u=o,g=t;break;case 3:n=e,u=le,g=o;break;case 4:n=t,u=e,g=o;break;case 5:n=o,u=e,g=le;break;case 6:case 0:n=o,u=t,g=e}}return er(Math.floor(n),Math.floor(u),Math.floor(g))},si=function(e,t,o){return e=ti(e),!e||(t=ti(t),!t)?null:(e=Pa(e),t=Pa(t),er(Math.round(t[0]+o*(e[0]-t[0])),Math.round(t[1]+o*(e[1]-t[1])),Math.round(t[2]+o*(e[2]-t[2]))))},id=function(e){return Ba(e,qh,255*Xh)},Fa=function(e,t,o){const n=[];var u=e.split("");u.push("");var g=0;e=[];let I=null;for(let Ee=0;Ee=L?(g=2,I=L,(L=e.join(""))&&n.push(L),e.length=0):L==="{"?g=3:(e.push("%",L),g=0);else if(g===2)if("0"<=L&&"9">=L)I+=L;else{var le=void 0;n.push(parseInt((le=I)!=null?le:"",10)),Ee--,g=0}else g===3&&(L===""?(e.splice(0,0,"%{"),Ee--,g=0):L!=="}"?e.push(L):(g=e.join(""),/[A-Z]\w*/i.test(g)?(L=g.toUpperCase(),(L=L.startsWith("BKY_")?L.substring(4):null)&&L in i.Msg$$module$build$src$core$msg?(g=i.Msg$$module$build$src$core$msg[L],typeof g=="string"?Array.prototype.push.apply(n,Fa(g,t,o)):t?n.push(`${g}`):n.push(g)):n.push("%{"+g+"}")):n.push("%{"+g+"}"),g=e.length=0))}for((t=e.join(""))&&n.push(t),le=[],e.length=0,u=0;u=o)return{hue:o,hex:Ba(o,sd(),255*od())};if(o=ti(t))return{hue:null,hex:o};throw o='Invalid colour: "'+t+'"',e!==t&&(o+=' (from "'+e+'")'),Error(o)},oi=function(){return xs},Xf=function(e){if(xs=e,e===null){let t;(t=document.querySelector("."+kl))==null||t.remove()}},rd=function(){const e=Te()||document.body;document.querySelector("."+kl)?xs=document.querySelector("."+kl):(xs=document.createElement("div"),xs.className=kl),e.appendChild(xs)},ja=function(e,t,o,n){if(Vi(),an=e,wl=o,o=xs){if(o.style.direction=t?"rtl":"ltr",o.style.display="block",!n&&e instanceof lt){let I;n=(I=e.getSourceBlock())==null?void 0:I.workspace}var u;Zh=(u=n)!=null?u:null;var g;e=(g=n)!=null?g:q(),ln=e.getRenderer().getClassName(),cn=e.getTheme().getClassName(),ln&&Oe(o,ln),cn&&Oe(o,cn)}},Vi=function(){if(ad()){an=null;var e=xs;e&&(e.style.display="none",e.style.left="",e.style.top="",wl&&wl(),wl=null,e.textContent="",ln&&(ze(e,ln),ln=""),cn&&(ze(e,cn),cn=""),q().markFocused())}},ad=function(){return!!an},ii=function(e){an===e&&Vi()},tr=function(e){Zh!==null&&Zh!==e||Vi()},ld=function(e,t,o){xs.style.left=e+"px",xs.style.top=t+"px",xs.style.height=o+"px"},cd=function(e,t,o,n){const u=Qf(e,t,o);e=Zf(e,t,o,n),0>u?ld(e,0,o.height+u):ld(e,u,o.height)},Zf=function(e,t,o,n){return n?Math.min(Math.max(t.right-o.width,e.left),e.right-o.width):Math.max(Math.min(t.left,e.right-o.width),e.left)},Qf=function(e,t,o){return t.bottom+o.height>=e.bottom?t.top-o.height:t.bottom},e$=function(e){return!(e==null||!e.repositionForWindowResize)},ud=function(){e$(an)&&an.repositionForWindowResize()||Vi()},t$=function(){return Cl},dd=function(e){Cl=e},sr=function(e,t,o,n){if(ja(pv,o,hd,n),t.length){var u=s$(t,o,e);Tl=u,o$(u,e,o),setTimeout(function(){u.focus()},1),Cl=null}else or()},s$=function(e,t,o){const n=new Rh;n.setRole(Is.MENU);for(let u=0;u{setTimeout(()=>{g.callback(g.scope,o)},0)})},{})}return n},o$=function(e,t,o){const n=$u();t=new rt(t.clientY+n.top,t.clientY+n.top,t.clientX+n.left,t.clientX+n.left),i$(e);const u=e.getSize();o&&(t.left+=u.width,t.right+=u.width,n.left+=u.width,n.right+=u.width),cd(n,t,u,o),e.focus()},i$=function(e){var t=oi();if(!t)throw Error("Attempting to create a context menu when widget div is null");t=e.render(t),Oe(t,"blocklyContextMenu"),H(t,"contextmenu",null,n$),e.focus()},n$=function(e){e.preventDefault(),e.stopPropagation()},or=function(){ii(pv),Cl=null},hd=function(){Tl&&(Tl.dispose(),Tl=null)},i.callbackFactory$$module$build$src$core$contextmenu=function(e,t){return()=>{i.disable$$module$build$src$core$events$utils();let o;try{o=t instanceof Element?ni(t,e.workspace):ji(t,e.workspace);const n=e.getRelativeToSurfaceXY();n.x=e.RTL?n.x-i.config$$module$build$src$core$config.snapRadius:n.x+i.config$$module$build$src$core$config.snapRadius,n.y+=2*i.config$$module$build$src$core$config.snapRadius,o.moveBy(n.x,n.y)}finally{i.enable$$module$build$src$core$events$utils()}return C()&&!o.isShadow()&&z(new(ne(ee.BLOCK_CREATE))(o)),i.setSelected$$module$build$src$core$common(o),o}},pd=function(e,t){return t=fe(t,e.getParentSvg(),e.getInverseScreenCTM()),t.x/=e.scale,t.y/=e.scale,t},za=function(e,t,o){t=pd(e,t),mv.set(e,ye.difference(o,t))},Ua=function(e,t){if(t=pd(e,t),e=mv.get(e),!e)throw Error("Drag not initialized");return ye.sum(e,t)},r$=function(e,t=!1){const o=i.createElement$$module$build$src$core$utils$xml("xml");var n=gd(i.allUsedVarModels$$module$build$src$core$variables(e));n.hasChildNodes()&&o.appendChild(n);for(const u of e.getTopComments())o.appendChild(ir(u,t));for(e=e.getTopBlocks(!0),n=0;n/g,"<$1$2>")},c$=function(e){e=zs(e).split("<");let t="";for(let o=1;o"&&(t+=" ")}return e=e.join(` -`),e=e.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1"),e.replace(/^\n/,"")},u$=function(e,t){return t.setResizesEnabled(!1),t.clear(),e=i.domToWorkspace$$module$build$src$core$xml(e,t),t.setResizesEnabled(!0),e},i.domToWorkspace$$module$build$src$core$xml=function(e,t){let o=0;t.RTL&&(o=t.getWidth());const n=[];io();const u=i.getGroup$$module$build$src$core$events$utils();u||i.setGroup$$module$build$src$core$events$utils(!0),t.setResizesEnabled&&t.setResizesEnabled(!1);let g=!0;try{for(let I=0,L;L=e.childNodes[I];I++){const le=L.nodeName.toLowerCase(),Ee=L;if(le==="block"||le==="shadow"&&!G()){const dt=ni(Ee,t);n.push(dt.id);let ut;const es=parseInt((ut=Ee.getAttribute("x"))!=null?ut:"10",10);let yn;const jr=parseInt((yn=Ee.getAttribute("y"))!=null?yn:"10",10);isNaN(es)||isNaN(jr)||dt.moveBy(t.RTL?o-es:es,jr,["create"]),g=!1}else{if(le==="shadow")throw TypeError("Shadow block cannot be a top-level block.");if(le==="comment")fd(Ee,t);else if(le==="variables"){if(g)$d(Ee,t);else throw Error("'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location.");g=!1}}}}finally{i.setGroup$$module$build$src$core$events$utils(u),t.setResizesEnabled&&t.setResizesEnabled(!0),t.rendered&&ao(),no()}return z(new(ne(ee.FINISHED_LOADING))(t)),n},fd=function(e,t){var o;const n=(o=e.getAttribute("id"))!=null?o:void 0;o=t.rendered?new Il(t,n):new El(t,n);var u;o.setText((u=e.textContent)!=null?u:"");var g;u=parseInt((g=e.getAttribute("x"))!=null?g:"",10);let I;g=parseInt((I=e.getAttribute("y"))!=null?I:"",10),isNaN(u)||isNaN(g)||(u=t.RTL?t.getWidth()-u:u,o.moveTo(new ye(u,g)));var L;t=parseInt((L=e.getAttribute("w"))!=null?L:"",10);let le;return L=parseInt((le=e.getAttribute("h"))!=null?le:"",10),isNaN(t)||isNaN(L)||o.setSize(new Xe(t,L)),e.getAttribute("collapsed")==="true"&&o.setCollapsed(!0),e.getAttribute("editable")==="false"&&o.setEditable(!1),e.getAttribute("movable")==="false"&&o.setMovable(!1),e.getAttribute("deletable")==="false"&&o.setDeletable(!1),o},d$=function(e,t){if(!t.getBlocksBoundingBox)return i.domToWorkspace$$module$build$src$core$xml(e,t);var o=t.getBlocksBoundingBox();if(e=i.domToWorkspace$$module$build$src$core$xml(e,t),o&&o.top!==o.bottom){var n=o.bottom;o=t.RTL?o.right:o.left;var u=1/0;let g=-1/0,I=1/0;for(let L=0;Lg&&(g=le.x)}for(n=n-I+10,o=t.RTL?o-g:o-u,u=0;uEe.setBubbleVisible(g),1)}},m$=function(e,t){for(let o=0;ou}),yd(u,{x:n.x,y:n.y,width:e.width,height:e.height},t.RTL,new Date)}},yd=function(e,t,o,n){const u=(new Date().getTime()-n.getTime())/150;1o)){var n=t.getSvgXY(e.getSvgRoot());e.outputConnection?(n.x+=(e.RTL?3:-3)*o,n.y+=13*o):e.previousConnection&&(n.x+=(e.RTL?-23:23)*o,n.y+=3*o);var u=ie(J.CIRCLE,{cx:n.x,cy:n.y,r:0,fill:"none",stroke:"#888","stroke-width":10},t.getParentSvg());e=ie(J.ANIMATE,{id:"animationCircle",begin:"indefinite",attributeName:"r",dur:"150ms",from:0,to:25*o},u),t=ie(J.ANIMATE,{id:"animationOpacity",begin:"indefinite",attributeName:"opacity",dur:"150ms",from:1,to:0},u),e.beginElement(),t.beginElement(),setTimeout(()=>{Ze(u)},150)}},_d=function(e){if(Ki(),e.workspace.getAudioManager().play("disconnect"),!(1>e.workspace.scale)){var t=e.getHeightWidth().height;t=Math.atan(10/t)/Math.PI*180,e.RTL||(t*=-1),Sr=e,wd(e,t,new Date,0)}},wd=function(e,t,o,n){const u=[.66,1,.66,0,-.66,-1,-.66,0];let g="";o.getTime()+200>new Date().getTime()&&(g=`skewX(${Math.round(u[n%u.length]*t)})`,xl=setTimeout(wd,15,e,t,o,n+1)),e.getSvgRoot().setAttribute("transform",`${e.getTranslation()} ${g}`)},Ki=function(){Sr&&(xl&&(clearTimeout(xl),xl=null),Sr.getSvgRoot().setAttribute("transform",Sr.getTranslation()),Sr=null)},ri=function(e){return e.getRelativeToSurfaceXY!==void 0&&e.isMovable!==void 0&&e.startDrag!==void 0&&e.drag!==void 0&&e.endDrag!==void 0&&e.revertDrag!==void 0},uo=function(e,t){for(const o in t)e[o]=t[o]!==null&&typeof t[o]=="object"?uo(e[o]||Object.create(null),t[o]):t[o];return e},Us=function(e,t){r($e.FIELD,e,t)},_$=function(e){c($e.FIELD,e)},i.fromJson$$module$build$src$core$field_registry=function(e){return vv.fromJsonInternal(e)},w$=function(e){const t=f($e.FIELD,e.type);return t?t.fromJson(e):(console.warn("Blockly could not create a field of type "+e.type+". The field is probably not being registered. This could be because the file is not loaded, the field does not register itself (Issue #1584), or the registration is not being reached."),null)},i.register$$module$build$src$core$extensions=function(e,t){if(typeof e!="string"||e.trim()==="")throw Error('Error: Invalid extension name "'+e+'"');if(dn[e])throw Error('Error: Extension "'+e+'" is already registered.');if(typeof t!="function")throw Error('Error: Extension "'+e+'" must be a function');dn[e]=t},i.registerMixin$$module$build$src$core$extensions=function(e,t){if(!t||typeof t!="object")throw Error('Error: Mixin "'+e+'" must be a object');i.register$$module$build$src$core$extensions(e,function(){this.mixin(t)})},i.registerMutator$$module$build$src$core$extensions=function(e,t,o,n){const u='Error when registering mutator "'+e+'": ';Td(u,t);const g=Cd(t,u);if(o&&typeof o!="function")throw Error(u+'Extension "'+e+'" is not a function');i.register$$module$build$src$core$extensions(e,function(){g&&this.setMutator(new i.MutatorIcon$$module$build$src$core$icons$mutator_icon(n||[],this)),this.mixin(t),o&&o.apply(this)})},k$=function(e){kd(e)?delete dn[e]:console.warn('No extension mapping for name "'+e+'" found to unregister')},kd=function(e){return!!dn[e]},Va=function(e,t,o){const n=dn[e];if(typeof n!="function")throw Error('Error: Extension "'+e+'" not found.');let u;if(o?C$(e,t):u=Ya(t),n.apply(t),o)Td('Error after applying mutator "'+e+'": ',t);else if(!E$(u,t))throw Error('Error when applying extension "'+e+'": mutation properties changed when applying a non-mutator extension.')},C$=function(e,t){if(Ya(t).length)throw Error('Error: tried to apply mutation "'+e+'" to a block that already has mutator functions. Block id: '+t.id)},T$=function(e,t){return Ka(e.mutationToDom,e.domToMutation,t+" mutationToDom/domToMutation")},S$=function(e,t){return Ka(e.saveExtraState,e.loadExtraState,t+" saveExtraState/loadExtraState")},Cd=function(e,t){return Ka(e.compose,e.decompose,t+" compose/decompose")},Ka=function(e,t,o){if(e&&t){if(typeof e!="function"||typeof t!="function")throw Error(o+" must be a function");return!0}if(!e&&!t)return!1;throw Error(o+"Must have both or neither functions")},Td=function(e,t){const o=T$(t,e),n=S$(t,e);if(!o&&!n)throw Error(e+"Mutations must contain either XML hooks, or JSON hooks, or both");Cd(t,e)},Ya=function(e){const t=[];return e.domToMutation!==void 0&&t.push(e.domToMutation),e.mutationToDom!==void 0&&t.push(e.mutationToDom),e.saveExtraState!==void 0&&t.push(e.saveExtraState),e.loadExtraState!==void 0&&t.push(e.loadExtraState),e.compose!==void 0&&t.push(e.compose),e.decompose!==void 0&&t.push(e.decompose),t},E$=function(e,t){if(t=Ya(t),t.length!==e.length)return!1;for(let o=0;o!n.getReturnTypes()).map(n=>[n.getName(),n.getParameters().map(u=>u.getName()),!1]);e.getBlocksByType("procedures_defnoreturn",!1).forEach(n=>{!Oo(n)&&Bi(n)&&t.push(n.getProcedureDef())});const o=e.getProcedureMap().getProcedures().filter(n=>!!n.getReturnTypes()).map(n=>[n.getName(),n.getParameters().map(u=>u.getName()),!0]);return e.getBlocksByType("procedures_defreturn",!1).forEach(n=>{!Oo(n)&&Bi(n)&&o.push(n.getProcedureDef())}),t.sort(Ed),o.sort(Ed),[t,o]},Ed=function(e,t){return e[0].localeCompare(t[0],void 0,{sensitivity:"base"})},i.findLegalName$$module$build$src$core$procedures=function(e,t){if(t.isInFlyout)return e;for(e=e||i.Msg$$module$build$src$core$msg.UNNAMED_KEY||"unnamed";!O$(e,t.workspace,t);){const o=e.match(/^(.*?)(\d+)$/);e=o?o[1]+(parseInt(o[2])+1):e+"2"}return e},O$=function(e,t,o){return!Id(e,t,o)},Id=function(e,t,o){for(const n of t.getAllBlocks(!1))if(n!==o&&Bi(n)&&i.Names$$module$build$src$core$names.equals(n.getProcedureDef()[0],e))return!0;o=o&&Oo(o)?o==null?void 0:o.getProcedureModel():void 0;for(const n of t.getProcedureMap().getProcedures())if(n!==o&&i.Names$$module$build$src$core$names.equals(n.getName(),e))return!0;return!1},i.rename$$module$build$src$core$procedures=function(e){var t=this.getSourceBlock();if(!t)throw new _t;e=e.trim();const o=i.findLegalName$$module$build$src$core$procedures(e,t);Oo(t)&&!t.isInsertionMarker()&&t.getProcedureModel().setName(o);const n=this.getValue();if(n!==e&&n!==o)for(e=t.workspace.getAllBlocks(!1),t=0;tN$(o,e)||uf(o)&&i.Names$$module$build$src$core$names.equals(o.getProcedureCall(),e))},N$=function(e,t){return Oo(e)&&!e.isProcedureDef()&&e.getProcedureModel()&&i.Names$$module$build$src$core$names.equals(e.getProcedureModel().getName(),t)},i.mutateCallers$$module$build$src$core$procedures=function(e){const t=G();var o=e.getProcedureDef()[0];const n=e.mutationToDom(!0);e=Ad(o,e.workspace);for(let g=0,I;I=e[g];g++){o=(o=I.mutationToDom())&&Li(o),I.domToMutation&&I.domToMutation(n);var u=I.mutationToDom();u=u&&Li(u),o!==u&&(i.setRecordUndo$$module$build$src$core$events$utils(!1),z(new(ne(ee.BLOCK_CHANGE))(I,"mutation",null,o,u)),i.setRecordUndo$$module$build$src$core$events$utils(t))}},i.getDefinition$$module$build$src$core$procedures=function(e,t){for(const o of t.getAllBlocks(!1))if(Oo(o)&&o.isProcedureDef()&&i.Names$$module$build$src$core$names.equals(o.getProcedureModel().getName(),e)||Bi(o)&&i.Names$$module$build$src$core$names.equals(o.getProcedureDef()[0],e))return o;return null},Za=function(e){return e.isDynamic},M$=function(e){return e.pathDown!==void 0&&e.pathUp!==void 0},L$=function(e){return e.pathLeft!==void 0&&e.pathRight!==void 0},P$=function(e,t){if(!e||!t)throw Error("Cannot connect null connections.");e.targetConnection=t,t.targetConnection=e},B$=function(e,t){let o=null;t=t.outputConnection;const n=t==null?void 0:t.getConnectionChecker();for(let u=0,g;g=e.inputList[u];u++){const I=g.connection;let L;if(I&&((L=n)!=null&&L.canConnect(t,I,!1))){if(o)return null;o=I}}return o},F$=function(e,t){let o;for(;o=B$(e,t);)if(e=o.targetBlock(),!e||e.isShadow())return o;return null},Od=function(e){return e.getType!==void 0&&e.initView!==void 0&&e.dispose!==void 0&&e.getWeight!==void 0&&e.getSize!==void 0&&e.applyColour!==void 0&&e.hideForInsertionMarker!==void 0&&e.updateEditable!==void 0&&e.updateCollapsed!==void 0&&e.isShownWhenCollapsed!==void 0&&e.setOffsetInBlock!==void 0&&e.onLocationChange!==void 0&&e.onClick!==void 0},j$=function(e){return Od(e)&&zi(e)&&Yn(e)&&e.setText!==void 0&&e.getText!==void 0&&e.setBubbleSize!==void 0&&e.getBubbleSize!==void 0&&e.getType()===Ct.COMMENT},rr=function(e){let t=e.outputConnection;return(!t||e.previousConnection&&e.previousConnection.isConnected())&&(t=e.previousConnection),t},ar=function(e,t){r($e.RENDERER,e,t)},z$=function(e){c($e.RENDERER,e)},Rd=function(e,t,o){return e=new(p($e.RENDERER,e))(e),e.init(t,o),e},Nd=function(e){Fi(e.getTargetWorkspace(),void 0,"String")},Md=function(e){Fi(e.getTargetWorkspace(),void 0,"Number")},Ld=function(e){Fi(e.getTargetWorkspace(),void 0,"Colour")},Qa=function(e){let t=[],o=document.createElement("button");return o.setAttribute("text",i.Msg$$module$build$src$core$msg.NEW_STRING_VARIABLE),o.setAttribute("callbackKey","CREATE_VARIABLE_STRING"),t.push(o),o=document.createElement("button"),o.setAttribute("text",i.Msg$$module$build$src$core$msg.NEW_NUMBER_VARIABLE),o.setAttribute("callbackKey","CREATE_VARIABLE_NUMBER"),t.push(o),o=document.createElement("button"),o.setAttribute("text",i.Msg$$module$build$src$core$msg.NEW_COLOUR_VARIABLE),o.setAttribute("callbackKey","CREATE_VARIABLE_COLOUR"),t.push(o),e.registerButtonCallback("CREATE_VARIABLE_STRING",Nd),e.registerButtonCallback("CREATE_VARIABLE_NUMBER",Md),e.registerButtonCallback("CREATE_VARIABLE_COLOUR",Ld),e=Pd(e),t=t.concat(e)},Pd=function(e){e=e.getAllVariables();const t=[];if(0L.id!=e.id).map(L=>L.getRelativeToSurfaceXY());for(;H$(ye.sum(t,g),I)||W$(e,ye.sum(u,g),n);)o.RTL?g.translate(-n,2*n):g.translate(n,2*n);e.moveTo(ye.sum(t,g))},H$=function(e,t){return t.some(o=>1>=Math.abs(o.x-e.x)&&1>=Math.abs(o.y-e.y))},W$=function(e,t,o){return e.getConnections_(!1).some(n=>!!n.closest(o,t).connection)},Ji=function(e,t,o){const n=o.getBoundingRectangle(),u=n.right-n.left,g=Ui(t.top,n.top,t.top+t.height-(n.bottom-n.top))-n.top;let I=t.left;return t=t.left+t.width-u,e.RTL?I=Math.min(t,I):t=Math.max(I,t),(e=Ui(I,n.left,t)-n.left)||g?(o.moveBy(e,g,["inbounds"]),!0):!1},Bd=function(e){return t=>{var o=e.getMetricsManager();if(o.hasFixedEdges()&&!e.isDragging()){var n;if(db.includes((n=t.type)!=null?n:"")){n=o.getScrollMetrics(!0);const u=G$(e,t);u&&(o=i.getGroup$$module$build$src$core$events$utils()||!1,i.setGroup$$module$build$src$core$events$utils(t.group),Ji(e,n,u)&&!t.group&&console.warn("Moved object in bounds but there was no event group. This may break undo."),i.setGroup$$module$build$src$core$events$utils(o))}else W(t)&&t.scale&&t.oldScale&&t.scale>t.oldScale&&el(e)}}},G$=function(e,t){let o=null;switch(t.type){case ee.BLOCK_CREATE:case ee.BLOCK_MOVE:(o=e.getBlockById(t.blockId))&&(o=o.getRootBlock());break;case ee.COMMENT_CREATE:case ee.COMMENT_MOVE:case ee.COMMENT_RESIZE:o=e.getCommentById(t.commentId)}return o},el=function(e){var t=e.getMetricsManager();if(t.hasFixedEdges()&&!e.isDragging()){t=t.getScrollMetrics(!0);var o=e.getTopBoundedElements();for(let n=0,u;u=o[n];n++)Ji(e,t,u)}},ds=function(e){return e.isDeletable!==void 0&&e.dispose!==void 0&&e.setDeleteStyle!==void 0},V$=function(e){const t=e.toCopyData();Sp=t;let o;return Ep=(o=e.workspace)!=null?o:null,t},Ro=function(e,t,o){return e&&t?Fd(e,t,o):Sp&&Ep?Fd(Sp,Ep):null},Fd=function(e,t,o){let n;t=t.isMutator?t:(n=t.getRootWorkspace())!=null?n:t;let u,g;return(g=(u=f($e.PASTER,e.paster,!1))==null?void 0:u.paste(e,t,o))!=null?g:null},K$=function(e){const t=e.toCopyData();return t?Ro(t,e.workspace):null},lr=function(e){return e.toCopyData!==void 0},jd=function(){st.registry.register({name:Ys.ESCAPE,preconditionFn(e){return!e.options.readOnly},callback(e){return e.hideChaff(),!0},keyCodes:[Ye.ESC]})},zd=function(){st.registry.register({name:Ys.DELETE,preconditionFn(e){const t=j();return!e.options.readOnly&&t!=null&&ds(t)&&t.isDeletable()&&!bo.inProgress()},callback(e,t){return t.preventDefault(),e=j(),e instanceof $s?e.checkAndDelete():ds(e)&&e.isDeletable()&&(i.setGroup$$module$build$src$core$events$utils(!0),e.dispose(),i.setGroup$$module$build$src$core$events$utils(!1)),!0},keyCodes:[Ye.DELETE,Ye.BACKSPACE]})},Ud=function(){const e=st.registry.createSerializedKey(Ye.C,[Ye.CTRL]),t=st.registry.createSerializedKey(Ye.C,[Ye.ALT]),o=st.registry.createSerializedKey(Ye.C,[Ye.META]);st.registry.register({name:Ys.COPY,preconditionFn(n){const u=j();return!n.options.readOnly&&!bo.inProgress()&&u!=null&&ds(u)&&u.isDeletable()&&ri(u)&&u.isMovable()&&lr(u)},callback(n,u){return u.preventDefault(),n.hideChaff(),u=j(),!u||!lr(u)?!1:(Ho=u.toCopyData(),Wo=u.workspace instanceof cs?u.workspace:n,$n=ri(u)?u.getRelativeToSurfaceXY():null,!!Ho)},keyCodes:[e,t,o]})},Hd=function(){const e=st.registry.createSerializedKey(Ye.X,[Ye.CTRL]),t=st.registry.createSerializedKey(Ye.X,[Ye.ALT]),o=st.registry.createSerializedKey(Ye.X,[Ye.META]);st.registry.register({name:Ys.CUT,preconditionFn(n){const u=j();return!n.options.readOnly&&!bo.inProgress()&&u!=null&&ds(u)&&u.isDeletable()&&ri(u)&&u.isMovable()&&!u.workspace.isFlyout},callback(n){const u=j();return u instanceof $s?(Ho=u.toCopyData(),Wo=n,$n=u.getRelativeToSurfaceXY(),u.checkAndDelete(),!0):ds(u)&&u.isDeletable()&&lr(u)?(Ho=u.toCopyData(),Wo=n,$n=ri(u)?u.getRelativeToSurfaceXY():null,u.dispose(),!0):!1},keyCodes:[e,t,o]})},Wd=function(){const e=st.registry.createSerializedKey(Ye.V,[Ye.CTRL]),t=st.registry.createSerializedKey(Ye.V,[Ye.ALT]),o=st.registry.createSerializedKey(Ye.V,[Ye.META]);st.registry.register({name:Ys.PASTE,preconditionFn(n){return!n.options.readOnly&&!bo.inProgress()},callback(){if(!Ho||!Wo)return!1;if(!$n)return!!Ro(Ho,Wo);const{left:n,top:u,width:g,height:I}=Wo.getMetricsManager().getViewMetrics(!0);if(new rt(u,u+I,n,n+g).contains($n.x,$n.y))return!!Ro(Ho,Wo);const L=new ye(n+g/2,u+I/2);return!!Ro(Ho,Wo,L)},keyCodes:[e,t,o]})},Gd=function(){const e=st.registry.createSerializedKey(Ye.Z,[Ye.CTRL]),t=st.registry.createSerializedKey(Ye.Z,[Ye.ALT]),o=st.registry.createSerializedKey(Ye.Z,[Ye.META]);st.registry.register({name:Ys.UNDO,preconditionFn(n){return!n.options.readOnly&&!bo.inProgress()},callback(n,u){return n.hideChaff(),n.undo(!1),u.preventDefault(),!0},keyCodes:[e,t,o]})},Vd=function(){const e=st.registry.createSerializedKey(Ye.Z,[Ye.SHIFT,Ye.CTRL]),t=st.registry.createSerializedKey(Ye.Z,[Ye.SHIFT,Ye.ALT]),o=st.registry.createSerializedKey(Ye.Z,[Ye.SHIFT,Ye.META]),n=st.registry.createSerializedKey(Ye.Y,[Ye.CTRL]);st.registry.register({name:Ys.REDO,preconditionFn(u){return!bo.inProgress()&&!u.options.readOnly},callback(u,g){return u.hideChaff(),u.undo(!0),g.preventDefault(),!0},keyCodes:[e,t,o,n]})},Kd=function(){jd(),zd(),Ud(),Hd(),Wd(),Gd(),Vd()},Yd=function(e){const t=e.saveState();return e.getParameters().length&&(t.parameters=e.getParameters().map(o=>o.saveState())),t},Jd=function(e,t,o,n){if(e=e.loadState(o,n),!o.parameters)return e;for(const[u,g]of o.parameters.entries())e.insertParameter(t.loadState(g,n),u);return e},Y$=function(e){const t=Object.create(null),o=b($e.SERIALIZER,!0);for(const n in o){let u;const g=(u=o[n])==null?void 0:u.save(e);g&&(t[n]=g)}return t},J$=function(e,t,{recordUndo:o=!1}={}){var n=b($e.SERIALIZER,!0);if(n){n=Object.entries(n).sort((g,I)=>I[1].priority-g[1].priority);var u=G();i.setRecordUndo$$module$build$src$core$events$utils(o),(o=i.getGroup$$module$build$src$core$events$utils())||i.setGroup$$module$build$src$core$events$utils(!0),io(),t instanceof cs&&t.setResizesEnabled(!1);for(const[,g]of n.reverse()){let I;(I=g)==null||I.clear(t)}for(const[g,I]of n.reverse())if(e[g]){let L;(L=I)==null||L.load(e[g],t)}t instanceof cs&&t.setResizesEnabled(!0),no(),z(new(ne(ee.FINISHED_LOADING))(t)),i.setGroup$$module$build$src$core$events$utils(o),i.setRecordUndo$$module$build$src$core$events$utils(u)}},q$=function(e,t){let o=null;o=typeof e=="string"?document.getElementById(e)||document.querySelector(e):e;var n;if(!document.contains(o)&&document!==((n=o)==null?void 0:n.ownerDocument))throw Error("Error: container is not in current document");e=new gs(t||{}),n=document.createElement("div"),Oe(n,"injectionDiv"),t!=null&&t.rtl&&Oe(n,"blocklyRTL"),n.tabIndex=0,xt(n,Et.LABEL,i.Msg$$module$build$src$core$msg.WORKSPACE_ARIA_LABEL),o.appendChild(n),t=X$(n,e);const u=Z$(n,t,e);return Q$(u),se(u),we(u),n.addEventListener("focusin",function(){se(u)}),H(n,"keydown",null,tl),H(Xn(),"keydown",null,tl),(t=oi())&&H(t,"keydown",null,tl),u},X$=function(e,t){e.setAttribute("dir","LTR"),Pt(t.hasCss,t.pathToMedia),e=ie(J.SVG,{xmlns:pr,"xmlns:html":Gs,"xmlns:xlink":is,version:"1.1",class:"blocklySvg",tabindex:"0"},e);const o=ie(J.DEFS,{},e),n=String(Math.random()).substring(2);return t.gridPattern=sp.createDom(n,t.gridOptions,o),e},Z$=function(e,t,o){o.parentWorkspace=null,o=new cs(o);const n=o.options;o.scale=n.zoomOptions.startScale,t.appendChild(o.createDom("blocklyMainBackground",e));var u=o.getRenderer().getClassName();return u&&Oe(e,u),(u=o.getTheme().getClassName())&&Oe(e,u),!n.hasCategories&&n.languageTree&&(e=o.addFlyout(J.SVG),At(e,t)),n.hasTrashcan&&o.addTrashcan(),n.zoomOptions&&n.zoomOptions.controls&&o.addZoomControls(),o.getThemeManager().subscribe(t,"workspaceBackgroundColour","background-color"),o.translate(0,0),o.addChangeListener(Bd(o)),we(o),rd(),Ru(),Xu(),o},Q$=function(e){const t=e.options;var o=e.getParentSvg();if(H(o.parentNode,"contextmenu",null,function(n){be(n)||n.preventDefault()}),o=H(window,"resize",null,function(){co(),e.hideComponents(!0),Vu(),ud(),we(e),el(e)}),e.setResizeHandlerWrapper(o),eb(),t.languageTree){o=e.getToolbox();const n=e.getFlyout(!0);o?o.init():n&&(n.init(e),n.show(t.languageTree),typeof n.scrollToStart=="function"&&n.scrollToStart())}t.hasTrashcan&&e.trashcan.init(),t.zoomOptions&&t.zoomOptions.controls&&e.zoomControls_.init(),t.moveOptions&&t.moveOptions.scrollbars?(e.scrollbar=new xp(e,t.moveOptions.scrollbars===!0||!!t.moveOptions.scrollbars.horizontal,t.moveOptions.scrollbars===!0||!!t.moveOptions.scrollbars.vertical,"blocklyMainWorkspaceScrollbar"),e.scrollbar.resize()):e.setMetrics({x:.5,y:.5}),t.hasSounds&&tb(t.pathToMedia,e)},tl=function(e){const t=q();t&&!(be(e)||t.rendered&&!t.isVisible())&&st.registry.onKeyDown(t,e)},eb=function(){iy||(H(document,"scroll",null,function(){const e=B();for(let t=0,o;o=e[t];t++)o instanceof cs&&o.updateInverseScreenCTM()}),ue(document,"touchend",null,X),ue(document,"touchcancel",null,X)),iy=!0},tb=function(e,t){function o(){for(;u.length;){const g=u.pop();g&&V(g)}n.preload()}const n=t.getAudioManager();n.load([e+"click.mp3",e+"click.wav",e+"click.ogg"],"click"),n.load([e+"disconnect.wav",e+"disconnect.mp3",e+"disconnect.ogg"],"disconnect"),n.load([e+"delete.mp3",e+"delete.ogg",e+"delete.wav"],"delete");const u=[];u.push(H(document,"pointermove",null,o,!0)),u.push(H(document,"touchstart",null,o,!0))},qd=function(){Ke.registry.register({displayText(){return i.Msg$$module$build$src$core$msg.UNDO},preconditionFn(e){return 0t.length?cr(t):Sa(i.Msg$$module$build$src$core$msg.DELETE_ALL_BLOCKS.replace("%1",String(t.length)),function(o){o&&cr(t)})}},scopeType:Ke.ScopeType.WORKSPACE,id:"workspaceDelete",weight:6})},sb=function(){qd(),Xd(),Zd(),eh(),th(),oh()},ih=function(){Ke.registry.register({displayText(){return i.Msg$$module$build$src$core$msg.DUPLICATE_BLOCK},preconditionFn(e){return e=e.block,!e.isInFlyout&&e.isDeletable()&&e.isMovable()?e.isDuplicatable()?"enabled":"disabled":"hidden"},callback(e){if(e.block){var t=e.block.toCopyData();t&&Ro(t,e.block.workspace)}},scopeType:Ke.ScopeType.BLOCK,id:"blockDuplicate",weight:1})},nh=function(){Ke.registry.register({displayText(e){return e.block.hasIcon(_o.TYPE)?i.Msg$$module$build$src$core$msg.REMOVE_COMMENT:i.Msg$$module$build$src$core$msg.ADD_COMMENT},preconditionFn(e){return e=e.block,!e.isInFlyout&&e.workspace.options.comments&&!e.isCollapsed()&&e.isEditable()?"enabled":"hidden"},callback(e){e=e.block,e.hasIcon(_o.TYPE)?e.setCommentText(null):e.setCommentText("")},scopeType:Ke.ScopeType.BLOCK,id:"blockComment",weight:2})},rh=function(){Ke.registry.register({displayText(e){return e.block.getInputsInline()?i.Msg$$module$build$src$core$msg.EXTERNAL_INPUTS:i.Msg$$module$build$src$core$msg.INLINE_INPUTS},preconditionFn(e){if(e=e.block,!e.isInFlyout&&e.isMovable()&&!e.isCollapsed()){for(let t=1;t(t.has(Gt)?1:0),e.getInheritedDisabled()||t?"disabled":"enabled"}return"hidden"},callback(e){e=e.block;const t=i.getGroup$$module$build$src$core$events$utils();t||i.setGroup$$module$build$src$core$events$utils(!0),e.setDisabledReason(!e.hasDisabledReason(Gt),Gt),i.setGroup$$module$build$src$core$events$utils(t)},scopeType:Ke.ScopeType.BLOCK,id:"blockDisable",weight:5})},ch=function(){Ke.registry.register({displayText(e){var t=e.block;return e=t.getDescendants(!1).length,(t=t.getNextBlock())&&(e-=t.getDescendants(!1).length),e===1?i.Msg$$module$build$src$core$msg.DELETE_BLOCK:i.Msg$$module$build$src$core$msg.DELETE_X_BLOCKS.replace("%1",`${e}`)},preconditionFn(e){return!e.block.isInFlyout&&e.block.isDeletable()?"enabled":"hidden"},callback(e){e.block&&e.block.checkAndDelete()},scopeType:Ke.ScopeType.BLOCK,id:"blockDelete",weight:6})},uh=function(){Ke.registry.register({displayText(){return i.Msg$$module$build$src$core$msg.HELP},preconditionFn(e){return e=e.block,(typeof e.helpUrl=="function"?e.helpUrl():e.helpUrl)?"enabled":"hidden"},callback(e){e.block.showHelp()},scopeType:Ke.ScopeType.BLOCK,id:"blockHelp",weight:7})},dh=function(){Ke.registry.register({displayText:()=>i.Msg$$module$build$src$core$msg.REMOVE_COMMENT,preconditionFn(e){let t;return(t=e.comment)!=null&&t.isDeletable()?"enabled":"hidden"},callback(e){i.setGroup$$module$build$src$core$events$utils(!0);let t;(t=e.comment)==null||t.dispose(),i.setGroup$$module$build$src$core$events$utils(!1)},scopeType:Ke.ScopeType.COMMENT,id:"commentDelete",weight:6})},hh=function(){Ke.registry.register({displayText:()=>i.Msg$$module$build$src$core$msg.DUPLICATE_COMMENT,preconditionFn(e){let t;return(t=e.comment)!=null&&t.isMovable()?"enabled":"hidden"},callback(e){if(e.comment){var t=e.comment.toCopyData();t&&Ro(t,e.comment.workspace)}},scopeType:Ke.ScopeType.COMMENT,id:"commentDuplicate",weight:1})},ph=function(){Ke.registry.register({displayText:()=>i.Msg$$module$build$src$core$msg.ADD_COMMENT,preconditionFn:e=>{let t;return(t=e.workspace)!=null&&t.isMutator?"hidden":"enabled"},callback:(e,t)=>{if(e=e.workspace){i.setGroup$$module$build$src$core$events$utils(!0);var o=new Il(e);o.setText(i.Msg$$module$build$src$core$msg.WORKSPACE_COMMENT_DEFAULT_TEXT),o.moveTo(ob(new ye(t.clientX,t.clientY),e)),i.setSelected$$module$build$src$core$common(o),i.setGroup$$module$build$src$core$events$utils(!1)}},scopeType:Ke.ScopeType.WORKSPACE,id:"commentCreate",weight:8})},ob=function(e,t){var o=t.getInjectionDiv().getBoundingClientRect();return e=new ye(e.x-o.left,e.y-o.top),o=t.getOriginOffsetInPixels(),e=ye.difference(e,o),e.scale(1/t.scale),e},ib=function(){ih(),nh(),rh(),ah(),lh(),ch(),uh()},nb=function(){hh(),dh(),ph()},gh=function(){sb(),ib()},rb=function(e){return e.paste!==void 0},ab=function(e){return e.getSvgRoot!==void 0},lb=function(e){return typeof e.id=="string"&&e.workspace!==void 0&&e.select!==void 0&&e.unselect!==void 0},cb=function(e){return e.isSelectable()},ub=function(e){q().hideChaff(e)},ge=ge||{},ge.scope={},ge.ASSUME_ES5=!1,ge.ASSUME_NO_NATIVE_MAP=!1,ge.ASSUME_NO_NATIVE_SET=!1,ge.SIMPLE_FROUND_POLYFILL=!1,ge.ISOLATE_POLYFILLS=!1,ge.FORCE_POLYFILL_PROMISE=!1,ge.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1,ge.defineProperty=ge.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(e,t,o){return e==Array.prototype||e==Object.prototype||(e[t]=o.value),e},ge.getGlobal=function(e){e=[typeof globalThis=="object"&&globalThis,e,typeof window=="object"&&window,typeof self=="object"&&self,typeof eo=="object"&&eo];for(var t=0;t>>0,ge.propertyToPolyfillSymbol[u]=ge.IS_SYMBOL_NATIVE?ge.global.Symbol(u):ge.POLYFILL_PREFIX+o+"$"+u),ge.defineProperty(n,ge.propertyToPolyfillSymbol[u],{configurable:!0,writable:!0,value:t})))},ge.underscoreProtoCanBeSet=function(){var e={a:!0},t={};try{return t.__proto__=e,t.a}catch{}return!1},ge.setPrototypeOf=ge.TRUST_ES6_POLYFILLS&&typeof Object.setPrototypeOf=="function"?Object.setPrototypeOf:ge.underscoreProtoCanBeSet()?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null,ge.arrayIteratorImpl=function(e){var t=0;return function(){return to&&(o=Math.max(o+u,0));o{const e=gb.length,t=[];for(let o=0;20>o;o++)t[o]=gb.charAt(Math.random()*e);return t.join("")}},LC=0,mh={TEST_ONLY:mb};mh.genUid=_,mh.getNextUniqueId=v;var fb="",ur=!0,fh=0,$h="ORPHANED_BLOCK",po=[],$b={FIRE_QUEUE:po,enqueueEvent:Ce,fireNow:he,fireInternal:Z,setGroupInternal:Q};i.disable$$module$build$src$core$events$utils,i.enable$$module$build$src$core$events$utils,i.getGroup$$module$build$src$core$events$utils,i.setGroup$$module$build$src$core$events$utils,i.setRecordUndo$$module$build$src$core$events$utils;var dr=Object.create(null),bb,ai=null,vb,hr=[],yb={defineBlocksWithJsonArrayInternal:We},Ot={TEST_ONLY:yb};Ot.createBlockDefinitionsFromJsonArray=i.createBlockDefinitionsFromJsonArray$$module$build$src$core$common,Ot.defineBlocks=i.defineBlocks$$module$build$src$core$common,Ot.defineBlocksWithJsonArray=Ae,Ot.draggingConnections=hr,Ot.getAllWorkspaces=B,Ot.getBlockTypeCounts=Ie,Ot.getMainWorkspace=q,Ot.getParentContainer=Te,Ot.getSelected=j,Ot.getWorkspaceById=re,Ot.registerWorkspace=N,Ot.setMainWorkspace=se,Ot.setParentContainer=ae,Ot.setSelected=i.setSelected$$module$build$src$core$common,Ot.svgResize=we,Ot.unregisterWorkpace=te;var qi=class{constructor(){this.workspaceId=void 0,this.isUiEvent=!1,this.type="",this.group=i.getGroup$$module$build$src$core$events$utils(),this.recordUndo=G()}toJson(){return{type:this.type,group:this.group}}static fromJson(e,t,o){return o.isBlank=!1,o.group=e.group||"",o.workspaceId=t.id,o}isNull(){return!1}run(e){}getEventWorkspace_(){let e;if(this.workspaceId&&(e=re(this.workspaceId)),!e)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return e}},Ss=class extends qi{constructor(e){super(),this.recordUndo=!1,this.isUiEvent=!0,this.isBlank=typeof e>"u",this.workspaceId=e||""}},bh=class extends Ss{constructor(e,t,o){t=e?e.workspace.id:t,t===null&&(t=void 0),super(t),this.type=ee.CLICK,this.blockId=e?e.id:void 0,this.targetType=o}toJson(){const e=super.toJson();if(!this.targetType)throw Error("The click target type is undefined. Either pass a block to the constructor, or call fromJson");return e.targetType=this.targetType,e.blockId=this.blockId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new bh),t.targetType=e.targetType,t.blockId=e.blockId,t}},vh;(function(e){e.BLOCK="block",e.WORKSPACE="workspace",e.ZOOM_CONTROLS="zoom_controls"})(vh||(vh={})),r($e.EVENT,ee.CLICK,bh);var PC=750,_b="ontouchstart"in globalThis||!!(globalThis.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!globalThis.navigator||!globalThis.navigator.maxTouchPoints&&!globalThis.navigator.msMaxTouchPoints),il=null,li={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"],mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]},nl=0,ci={TOUCH_ENABLED:_b,TOUCH_MAP:li};ci.checkTouchIdentifier=U,ci.clearTouchIdentifier=Y,ci.getTouchIdentifierFromEvent=A,ci.longStart=k,ci.longStop=X,ci.shouldHandleEvent=O;var yh,wb,kb,Cb,rl,al,_h,Tb,Sb,Eb;(function(e){function t(n){return o.includes(n.toUpperCase())}yh=e;const o=yh.toUpperCase();wb=t("JavaFX"),kb=t("WebKit"),Cb=t("Gecko")&&!kb,rl=t("Android"),e=globalThis.navigator&&globalThis.navigator.maxTouchPoints,al=t("iPad")||t("Macintosh")&&0{n.push(this.componentData.get(u))}),n.sort(function(u,g){return u.weight-g.weight}),n.forEach(function(u){o.push(u.component)})}else e.forEach(n=>{o.push(this.componentData.get(n).component)});return o}};gt.Capability=mo,(function(e){e=e.ComponentWeight||(e.ComponentWeight={}),e[e.TOOLBOX_WEIGHT=0]="TOOLBOX_WEIGHT",e[e.FLYOUT_WEIGHT=1]="FLYOUT_WEIGHT",e[e.TRASHCAN_WEIGHT=2]="TRASHCAN_WEIGHT",e[e.ZOOM_CONTROLS_WEIGHT=3]="ZOOM_CONTROLS_WEIGHT"})(gt||(gt={})),gt.ComponentWeight;var Ch=!1,Th=` +`?((t=e.join(""))&&le.push(t),e.length=0,le.push(n[u])):e.push(n[u]);return(t=e.join(""))&&le.push(t),e.length=0,le},nd=function(e){return Fa(e,!0,!0)},bt=function(e){return typeof e!="string"?e:(e=Fa(e,!1,!1),e.length?String(e[0]):"")},Zf=function(e){let t=!0;const o=i.Msg$$module$build$src$core$msg,n=e.match(/%{BKY_[A-Z]\w*}/gi);if(n)for(let u=0;u=o)return{hue:o,hex:Ba(o,sd(),255*od())};if(o=ti(t))return{hue:null,hex:o};throw o='Invalid colour: "'+t+'"',e!==t&&(o+=' (from "'+e+'")'),Error(o)},oi=function(){return xs},Qf=function(e){if(xs=e,e===null){let t;(t=document.querySelector("."+kl))==null||t.remove()}},rd=function(){const e=Te()||document.body;document.querySelector("."+kl)?xs=document.querySelector("."+kl):(xs=document.createElement("div"),xs.className=kl),e.appendChild(xs)},ja=function(e,t,o,n){if(Vi(),an=e,wl=o,o=xs){if(o.style.direction=t?"rtl":"ltr",o.style.display="block",!n&&e instanceof lt){let I;n=(I=e.getSourceBlock())==null?void 0:I.workspace}var u;Zh=(u=n)!=null?u:null;var g;e=(g=n)!=null?g:q(),ln=e.getRenderer().getClassName(),cn=e.getTheme().getClassName(),ln&&Oe(o,ln),cn&&Oe(o,cn)}},Vi=function(){if(ad()){an=null;var e=xs;e&&(e.style.display="none",e.style.left="",e.style.top="",wl&&wl(),wl=null,e.textContent="",ln&&(ze(e,ln),ln=""),cn&&(ze(e,cn),cn=""),q().markFocused())}},ad=function(){return!!an},ii=function(e){an===e&&Vi()},tr=function(e){Zh!==null&&Zh!==e||Vi()},ld=function(e,t,o){xs.style.left=e+"px",xs.style.top=t+"px",xs.style.height=o+"px"},cd=function(e,t,o,n){const u=t$(e,t,o);e=e$(e,t,o,n),0>u?ld(e,0,o.height+u):ld(e,u,o.height)},e$=function(e,t,o,n){return n?Math.min(Math.max(t.right-o.width,e.left),e.right-o.width):Math.max(Math.min(t.left,e.right-o.width),e.left)},t$=function(e,t,o){return t.bottom+o.height>=e.bottom?t.top-o.height:t.bottom},s$=function(e){return!(e==null||!e.repositionForWindowResize)},ud=function(){s$(an)&&an.repositionForWindowResize()||Vi()},o$=function(){return Cl},dd=function(e){Cl=e},sr=function(e,t,o,n){if(ja(mv,o,hd,n),t.length){var u=i$(t,o,e);Tl=u,n$(u,e,o),setTimeout(function(){u.focus()},1),Cl=null}else or()},i$=function(e,t,o){const n=new Rh;n.setRole(Is.MENU);for(let u=0;u{setTimeout(()=>{g.callback(g.scope,o)},0)})},{})}return n},n$=function(e,t,o){const n=$u();t=new rt(t.clientY+n.top,t.clientY+n.top,t.clientX+n.left,t.clientX+n.left),r$(e);const u=e.getSize();o&&(t.left+=u.width,t.right+=u.width,n.left+=u.width,n.right+=u.width),cd(n,t,u,o),e.focus()},r$=function(e){var t=oi();if(!t)throw Error("Attempting to create a context menu when widget div is null");t=e.render(t),Oe(t,"blocklyContextMenu"),H(t,"contextmenu",null,a$),e.focus()},a$=function(e){e.preventDefault(),e.stopPropagation()},or=function(){ii(mv),Cl=null},hd=function(){Tl&&(Tl.dispose(),Tl=null)},i.callbackFactory$$module$build$src$core$contextmenu=function(e,t){return()=>{i.disable$$module$build$src$core$events$utils();let o;try{o=t instanceof Element?ni(t,e.workspace):ji(t,e.workspace);const n=e.getRelativeToSurfaceXY();n.x=e.RTL?n.x-i.config$$module$build$src$core$config.snapRadius:n.x+i.config$$module$build$src$core$config.snapRadius,n.y+=2*i.config$$module$build$src$core$config.snapRadius,o.moveBy(n.x,n.y)}finally{i.enable$$module$build$src$core$events$utils()}return C()&&!o.isShadow()&&z(new(ne(ee.BLOCK_CREATE))(o)),i.setSelected$$module$build$src$core$common(o),o}},pd=function(e,t){return t=fe(t,e.getParentSvg(),e.getInverseScreenCTM()),t.x/=e.scale,t.y/=e.scale,t},za=function(e,t,o){t=pd(e,t),$v.set(e,ye.difference(o,t))},Ua=function(e,t){if(t=pd(e,t),e=$v.get(e),!e)throw Error("Drag not initialized");return ye.sum(e,t)},l$=function(e,t=!1){const o=i.createElement$$module$build$src$core$utils$xml("xml");var n=gd(i.allUsedVarModels$$module$build$src$core$variables(e));n.hasChildNodes()&&o.appendChild(n);for(const u of e.getTopComments())o.appendChild(ir(u,t));for(e=e.getTopBlocks(!0),n=0;n/g,"<$1$2>")},d$=function(e){e=zs(e).split("<");let t="";for(let o=1;o"&&(t+=" ")}return e=e.join(` +`),e=e.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1"),e.replace(/^\n/,"")},h$=function(e,t){return t.setResizesEnabled(!1),t.clear(),e=i.domToWorkspace$$module$build$src$core$xml(e,t),t.setResizesEnabled(!0),e},i.domToWorkspace$$module$build$src$core$xml=function(e,t){let o=0;t.RTL&&(o=t.getWidth());const n=[];io();const u=i.getGroup$$module$build$src$core$events$utils();u||i.setGroup$$module$build$src$core$events$utils(!0),t.setResizesEnabled&&t.setResizesEnabled(!1);let g=!0;try{for(let I=0,L;L=e.childNodes[I];I++){const le=L.nodeName.toLowerCase(),Ee=L;if(le==="block"||le==="shadow"&&!G()){const dt=ni(Ee,t);n.push(dt.id);let ut;const es=parseInt((ut=Ee.getAttribute("x"))!=null?ut:"10",10);let yn;const jr=parseInt((yn=Ee.getAttribute("y"))!=null?yn:"10",10);isNaN(es)||isNaN(jr)||dt.moveBy(t.RTL?o-es:es,jr,["create"]),g=!1}else{if(le==="shadow")throw TypeError("Shadow block cannot be a top-level block.");if(le==="comment")fd(Ee,t);else if(le==="variables"){if(g)$d(Ee,t);else throw Error("'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location.");g=!1}}}}finally{i.setGroup$$module$build$src$core$events$utils(u),t.setResizesEnabled&&t.setResizesEnabled(!0),t.rendered&&ao(),no()}return z(new(ne(ee.FINISHED_LOADING))(t)),n},fd=function(e,t){var o;const n=(o=e.getAttribute("id"))!=null?o:void 0;o=t.rendered?new Il(t,n):new El(t,n);var u;o.setText((u=e.textContent)!=null?u:"");var g;u=parseInt((g=e.getAttribute("x"))!=null?g:"",10);let I;g=parseInt((I=e.getAttribute("y"))!=null?I:"",10),isNaN(u)||isNaN(g)||(u=t.RTL?t.getWidth()-u:u,o.moveTo(new ye(u,g)));var L;t=parseInt((L=e.getAttribute("w"))!=null?L:"",10);let le;return L=parseInt((le=e.getAttribute("h"))!=null?le:"",10),isNaN(t)||isNaN(L)||o.setSize(new Xe(t,L)),e.getAttribute("collapsed")==="true"&&o.setCollapsed(!0),e.getAttribute("editable")==="false"&&o.setEditable(!1),e.getAttribute("movable")==="false"&&o.setMovable(!1),e.getAttribute("deletable")==="false"&&o.setDeletable(!1),o},p$=function(e,t){if(!t.getBlocksBoundingBox)return i.domToWorkspace$$module$build$src$core$xml(e,t);var o=t.getBlocksBoundingBox();if(e=i.domToWorkspace$$module$build$src$core$xml(e,t),o&&o.top!==o.bottom){var n=o.bottom;o=t.RTL?o.right:o.left;var u=1/0;let g=-1/0,I=1/0;for(let L=0;Lg&&(g=le.x)}for(n=n-I+10,o=t.RTL?o-g:o-u,u=0;uEe.setBubbleVisible(g),1)}},$$=function(e,t){for(let o=0;ou}),yd(u,{x:n.x,y:n.y,width:e.width,height:e.height},t.RTL,new Date)}},yd=function(e,t,o,n){const u=(new Date().getTime()-n.getTime())/150;1o)){var n=t.getSvgXY(e.getSvgRoot());e.outputConnection?(n.x+=(e.RTL?3:-3)*o,n.y+=13*o):e.previousConnection&&(n.x+=(e.RTL?-23:23)*o,n.y+=3*o);var u=ie(J.CIRCLE,{cx:n.x,cy:n.y,r:0,fill:"none",stroke:"#888","stroke-width":10},t.getParentSvg());e=ie(J.ANIMATE,{id:"animationCircle",begin:"indefinite",attributeName:"r",dur:"150ms",from:0,to:25*o},u),t=ie(J.ANIMATE,{id:"animationOpacity",begin:"indefinite",attributeName:"opacity",dur:"150ms",from:1,to:0},u),e.beginElement(),t.beginElement(),setTimeout(()=>{Ze(u)},150)}},_d=function(e){if(Ki(),e.workspace.getAudioManager().play("disconnect"),!(1>e.workspace.scale)){var t=e.getHeightWidth().height;t=Math.atan(10/t)/Math.PI*180,e.RTL||(t*=-1),Sr=e,wd(e,t,new Date,0)}},wd=function(e,t,o,n){const u=[.66,1,.66,0,-.66,-1,-.66,0];let g="";o.getTime()+200>new Date().getTime()&&(g=`skewX(${Math.round(u[n%u.length]*t)})`,xl=setTimeout(wd,15,e,t,o,n+1)),e.getSvgRoot().setAttribute("transform",`${e.getTranslation()} ${g}`)},Ki=function(){Sr&&(xl&&(clearTimeout(xl),xl=null),Sr.getSvgRoot().setAttribute("transform",Sr.getTranslation()),Sr=null)},ri=function(e){return e.getRelativeToSurfaceXY!==void 0&&e.isMovable!==void 0&&e.startDrag!==void 0&&e.drag!==void 0&&e.endDrag!==void 0&&e.revertDrag!==void 0},uo=function(e,t){for(const o in t)e[o]=t[o]!==null&&typeof t[o]=="object"?uo(e[o]||Object.create(null),t[o]):t[o];return e},Us=function(e,t){r($e.FIELD,e,t)},k$=function(e){c($e.FIELD,e)},i.fromJson$$module$build$src$core$field_registry=function(e){return _v.fromJsonInternal(e)},C$=function(e){const t=f($e.FIELD,e.type);return t?t.fromJson(e):(console.warn("Blockly could not create a field of type "+e.type+". The field is probably not being registered. This could be because the file is not loaded, the field does not register itself (Issue #1584), or the registration is not being reached."),null)},i.register$$module$build$src$core$extensions=function(e,t){if(typeof e!="string"||e.trim()==="")throw Error('Error: Invalid extension name "'+e+'"');if(dn[e])throw Error('Error: Extension "'+e+'" is already registered.');if(typeof t!="function")throw Error('Error: Extension "'+e+'" must be a function');dn[e]=t},i.registerMixin$$module$build$src$core$extensions=function(e,t){if(!t||typeof t!="object")throw Error('Error: Mixin "'+e+'" must be a object');i.register$$module$build$src$core$extensions(e,function(){this.mixin(t)})},i.registerMutator$$module$build$src$core$extensions=function(e,t,o,n){const u='Error when registering mutator "'+e+'": ';Td(u,t);const g=Cd(t,u);if(o&&typeof o!="function")throw Error(u+'Extension "'+e+'" is not a function');i.register$$module$build$src$core$extensions(e,function(){g&&this.setMutator(new i.MutatorIcon$$module$build$src$core$icons$mutator_icon(n||[],this)),this.mixin(t),o&&o.apply(this)})},T$=function(e){kd(e)?delete dn[e]:console.warn('No extension mapping for name "'+e+'" found to unregister')},kd=function(e){return!!dn[e]},Va=function(e,t,o){const n=dn[e];if(typeof n!="function")throw Error('Error: Extension "'+e+'" not found.');let u;if(o?S$(e,t):u=Ya(t),n.apply(t),o)Td('Error after applying mutator "'+e+'": ',t);else if(!x$(u,t))throw Error('Error when applying extension "'+e+'": mutation properties changed when applying a non-mutator extension.')},S$=function(e,t){if(Ya(t).length)throw Error('Error: tried to apply mutation "'+e+'" to a block that already has mutator functions. Block id: '+t.id)},E$=function(e,t){return Ka(e.mutationToDom,e.domToMutation,t+" mutationToDom/domToMutation")},I$=function(e,t){return Ka(e.saveExtraState,e.loadExtraState,t+" saveExtraState/loadExtraState")},Cd=function(e,t){return Ka(e.compose,e.decompose,t+" compose/decompose")},Ka=function(e,t,o){if(e&&t){if(typeof e!="function"||typeof t!="function")throw Error(o+" must be a function");return!0}if(!e&&!t)return!1;throw Error(o+"Must have both or neither functions")},Td=function(e,t){const o=E$(t,e),n=I$(t,e);if(!o&&!n)throw Error(e+"Mutations must contain either XML hooks, or JSON hooks, or both");Cd(t,e)},Ya=function(e){const t=[];return e.domToMutation!==void 0&&t.push(e.domToMutation),e.mutationToDom!==void 0&&t.push(e.mutationToDom),e.saveExtraState!==void 0&&t.push(e.saveExtraState),e.loadExtraState!==void 0&&t.push(e.loadExtraState),e.compose!==void 0&&t.push(e.compose),e.decompose!==void 0&&t.push(e.decompose),t},x$=function(e,t){if(t=Ya(t),t.length!==e.length)return!1;for(let o=0;o!n.getReturnTypes()).map(n=>[n.getName(),n.getParameters().map(u=>u.getName()),!1]);e.getBlocksByType("procedures_defnoreturn",!1).forEach(n=>{!Oo(n)&&Bi(n)&&t.push(n.getProcedureDef())});const o=e.getProcedureMap().getProcedures().filter(n=>!!n.getReturnTypes()).map(n=>[n.getName(),n.getParameters().map(u=>u.getName()),!0]);return e.getBlocksByType("procedures_defreturn",!1).forEach(n=>{!Oo(n)&&Bi(n)&&o.push(n.getProcedureDef())}),t.sort(Ed),o.sort(Ed),[t,o]},Ed=function(e,t){return e[0].localeCompare(t[0],void 0,{sensitivity:"base"})},i.findLegalName$$module$build$src$core$procedures=function(e,t){if(t.isInFlyout)return e;for(e=e||i.Msg$$module$build$src$core$msg.UNNAMED_KEY||"unnamed";!N$(e,t.workspace,t);){const o=e.match(/^(.*?)(\d+)$/);e=o?o[1]+(parseInt(o[2])+1):e+"2"}return e},N$=function(e,t,o){return!Id(e,t,o)},Id=function(e,t,o){for(const n of t.getAllBlocks(!1))if(n!==o&&Bi(n)&&i.Names$$module$build$src$core$names.equals(n.getProcedureDef()[0],e))return!0;o=o&&Oo(o)?o==null?void 0:o.getProcedureModel():void 0;for(const n of t.getProcedureMap().getProcedures())if(n!==o&&i.Names$$module$build$src$core$names.equals(n.getName(),e))return!0;return!1},i.rename$$module$build$src$core$procedures=function(e){var t=this.getSourceBlock();if(!t)throw new _t;e=e.trim();const o=i.findLegalName$$module$build$src$core$procedures(e,t);Oo(t)&&!t.isInsertionMarker()&&t.getProcedureModel().setName(o);const n=this.getValue();if(n!==e&&n!==o)for(e=t.workspace.getAllBlocks(!1),t=0;tL$(o,e)||hf(o)&&i.Names$$module$build$src$core$names.equals(o.getProcedureCall(),e))},L$=function(e,t){return Oo(e)&&!e.isProcedureDef()&&e.getProcedureModel()&&i.Names$$module$build$src$core$names.equals(e.getProcedureModel().getName(),t)},i.mutateCallers$$module$build$src$core$procedures=function(e){const t=G();var o=e.getProcedureDef()[0];const n=e.mutationToDom(!0);e=Ad(o,e.workspace);for(let g=0,I;I=e[g];g++){o=(o=I.mutationToDom())&&Li(o),I.domToMutation&&I.domToMutation(n);var u=I.mutationToDom();u=u&&Li(u),o!==u&&(i.setRecordUndo$$module$build$src$core$events$utils(!1),z(new(ne(ee.BLOCK_CHANGE))(I,"mutation",null,o,u)),i.setRecordUndo$$module$build$src$core$events$utils(t))}},i.getDefinition$$module$build$src$core$procedures=function(e,t){for(const o of t.getAllBlocks(!1))if(Oo(o)&&o.isProcedureDef()&&i.Names$$module$build$src$core$names.equals(o.getProcedureModel().getName(),e)||Bi(o)&&i.Names$$module$build$src$core$names.equals(o.getProcedureDef()[0],e))return o;return null},Za=function(e){return e.isDynamic},P$=function(e){return e.pathDown!==void 0&&e.pathUp!==void 0},B$=function(e){return e.pathLeft!==void 0&&e.pathRight!==void 0},F$=function(e,t){if(!e||!t)throw Error("Cannot connect null connections.");e.targetConnection=t,t.targetConnection=e},j$=function(e,t){let o=null;t=t.outputConnection;const n=t==null?void 0:t.getConnectionChecker();for(let u=0,g;g=e.inputList[u];u++){const I=g.connection;let L;if(I&&((L=n)!=null&&L.canConnect(t,I,!1))){if(o)return null;o=I}}return o},z$=function(e,t){let o;for(;o=j$(e,t);)if(e=o.targetBlock(),!e||e.isShadow())return o;return null},Od=function(e){return e.getType!==void 0&&e.initView!==void 0&&e.dispose!==void 0&&e.getWeight!==void 0&&e.getSize!==void 0&&e.applyColour!==void 0&&e.hideForInsertionMarker!==void 0&&e.updateEditable!==void 0&&e.updateCollapsed!==void 0&&e.isShownWhenCollapsed!==void 0&&e.setOffsetInBlock!==void 0&&e.onLocationChange!==void 0&&e.onClick!==void 0},U$=function(e){return Od(e)&&zi(e)&&Yn(e)&&e.setText!==void 0&&e.getText!==void 0&&e.setBubbleSize!==void 0&&e.getBubbleSize!==void 0&&e.getType()===Ct.COMMENT},rr=function(e){let t=e.outputConnection;return(!t||e.previousConnection&&e.previousConnection.isConnected())&&(t=e.previousConnection),t},ar=function(e,t){r($e.RENDERER,e,t)},H$=function(e){c($e.RENDERER,e)},Rd=function(e,t,o){return e=new(p($e.RENDERER,e))(e),e.init(t,o),e},Nd=function(e){Fi(e.getTargetWorkspace(),void 0,"String")},Md=function(e){Fi(e.getTargetWorkspace(),void 0,"Number")},Ld=function(e){Fi(e.getTargetWorkspace(),void 0,"Colour")},Qa=function(e){let t=[],o=document.createElement("button");return o.setAttribute("text",i.Msg$$module$build$src$core$msg.NEW_STRING_VARIABLE),o.setAttribute("callbackKey","CREATE_VARIABLE_STRING"),t.push(o),o=document.createElement("button"),o.setAttribute("text",i.Msg$$module$build$src$core$msg.NEW_NUMBER_VARIABLE),o.setAttribute("callbackKey","CREATE_VARIABLE_NUMBER"),t.push(o),o=document.createElement("button"),o.setAttribute("text",i.Msg$$module$build$src$core$msg.NEW_COLOUR_VARIABLE),o.setAttribute("callbackKey","CREATE_VARIABLE_COLOUR"),t.push(o),e.registerButtonCallback("CREATE_VARIABLE_STRING",Nd),e.registerButtonCallback("CREATE_VARIABLE_NUMBER",Md),e.registerButtonCallback("CREATE_VARIABLE_COLOUR",Ld),e=Pd(e),t=t.concat(e)},Pd=function(e){e=e.getAllVariables();const t=[];if(0L.id!=e.id).map(L=>L.getRelativeToSurfaceXY());for(;G$(ye.sum(t,g),I)||V$(e,ye.sum(u,g),n);)o.RTL?g.translate(-n,2*n):g.translate(n,2*n);e.moveTo(ye.sum(t,g))},G$=function(e,t){return t.some(o=>1>=Math.abs(o.x-e.x)&&1>=Math.abs(o.y-e.y))},V$=function(e,t,o){return e.getConnections_(!1).some(n=>!!n.closest(o,t).connection)},Ji=function(e,t,o){const n=o.getBoundingRectangle(),u=n.right-n.left,g=Ui(t.top,n.top,t.top+t.height-(n.bottom-n.top))-n.top;let I=t.left;return t=t.left+t.width-u,e.RTL?I=Math.min(t,I):t=Math.max(I,t),(e=Ui(I,n.left,t)-n.left)||g?(o.moveBy(e,g,["inbounds"]),!0):!1},Bd=function(e){return t=>{var o=e.getMetricsManager();if(o.hasFixedEdges()&&!e.isDragging()){var n;if(pb.includes((n=t.type)!=null?n:"")){n=o.getScrollMetrics(!0);const u=K$(e,t);u&&(o=i.getGroup$$module$build$src$core$events$utils()||!1,i.setGroup$$module$build$src$core$events$utils(t.group),Ji(e,n,u)&&!t.group&&console.warn("Moved object in bounds but there was no event group. This may break undo."),i.setGroup$$module$build$src$core$events$utils(o))}else W(t)&&t.scale&&t.oldScale&&t.scale>t.oldScale&&el(e)}}},K$=function(e,t){let o=null;switch(t.type){case ee.BLOCK_CREATE:case ee.BLOCK_MOVE:(o=e.getBlockById(t.blockId))&&(o=o.getRootBlock());break;case ee.COMMENT_CREATE:case ee.COMMENT_MOVE:case ee.COMMENT_RESIZE:o=e.getCommentById(t.commentId)}return o},el=function(e){var t=e.getMetricsManager();if(t.hasFixedEdges()&&!e.isDragging()){t=t.getScrollMetrics(!0);var o=e.getTopBoundedElements();for(let n=0,u;u=o[n];n++)Ji(e,t,u)}},ds=function(e){return e.isDeletable!==void 0&&e.dispose!==void 0&&e.setDeleteStyle!==void 0},Y$=function(e){const t=e.toCopyData();Sp=t;let o;return Ep=(o=e.workspace)!=null?o:null,t},Ro=function(e,t,o){return e&&t?Fd(e,t,o):Sp&&Ep?Fd(Sp,Ep):null},Fd=function(e,t,o){let n;t=t.isMutator?t:(n=t.getRootWorkspace())!=null?n:t;let u,g;return(g=(u=f($e.PASTER,e.paster,!1))==null?void 0:u.paste(e,t,o))!=null?g:null},J$=function(e){const t=e.toCopyData();return t?Ro(t,e.workspace):null},lr=function(e){return e.toCopyData!==void 0},jd=function(){st.registry.register({name:Ys.ESCAPE,preconditionFn(e){return!e.options.readOnly},callback(e){return e.hideChaff(),!0},keyCodes:[Ye.ESC]})},zd=function(){st.registry.register({name:Ys.DELETE,preconditionFn(e){const t=j();return!e.options.readOnly&&t!=null&&ds(t)&&t.isDeletable()&&!bo.inProgress()},callback(e,t){return t.preventDefault(),e=j(),e instanceof $s?e.checkAndDelete():ds(e)&&e.isDeletable()&&(i.setGroup$$module$build$src$core$events$utils(!0),e.dispose(),i.setGroup$$module$build$src$core$events$utils(!1)),!0},keyCodes:[Ye.DELETE,Ye.BACKSPACE]})},Ud=function(){const e=st.registry.createSerializedKey(Ye.C,[Ye.CTRL]),t=st.registry.createSerializedKey(Ye.C,[Ye.ALT]),o=st.registry.createSerializedKey(Ye.C,[Ye.META]);st.registry.register({name:Ys.COPY,preconditionFn(n){const u=j();return!n.options.readOnly&&!bo.inProgress()&&u!=null&&ds(u)&&u.isDeletable()&&ri(u)&&u.isMovable()&&lr(u)},callback(n,u){return u.preventDefault(),n.hideChaff(),u=j(),!u||!lr(u)?!1:(Ho=u.toCopyData(),Wo=u.workspace instanceof cs?u.workspace:n,$n=ri(u)?u.getRelativeToSurfaceXY():null,!!Ho)},keyCodes:[e,t,o]})},Hd=function(){const e=st.registry.createSerializedKey(Ye.X,[Ye.CTRL]),t=st.registry.createSerializedKey(Ye.X,[Ye.ALT]),o=st.registry.createSerializedKey(Ye.X,[Ye.META]);st.registry.register({name:Ys.CUT,preconditionFn(n){const u=j();return!n.options.readOnly&&!bo.inProgress()&&u!=null&&ds(u)&&u.isDeletable()&&ri(u)&&u.isMovable()&&!u.workspace.isFlyout},callback(n){const u=j();return u instanceof $s?(Ho=u.toCopyData(),Wo=n,$n=u.getRelativeToSurfaceXY(),u.checkAndDelete(),!0):ds(u)&&u.isDeletable()&&lr(u)?(Ho=u.toCopyData(),Wo=n,$n=ri(u)?u.getRelativeToSurfaceXY():null,u.dispose(),!0):!1},keyCodes:[e,t,o]})},Wd=function(){const e=st.registry.createSerializedKey(Ye.V,[Ye.CTRL]),t=st.registry.createSerializedKey(Ye.V,[Ye.ALT]),o=st.registry.createSerializedKey(Ye.V,[Ye.META]);st.registry.register({name:Ys.PASTE,preconditionFn(n){return!n.options.readOnly&&!bo.inProgress()},callback(){if(!Ho||!Wo)return!1;if(!$n)return!!Ro(Ho,Wo);const{left:n,top:u,width:g,height:I}=Wo.getMetricsManager().getViewMetrics(!0);if(new rt(u,u+I,n,n+g).contains($n.x,$n.y))return!!Ro(Ho,Wo);const L=new ye(n+g/2,u+I/2);return!!Ro(Ho,Wo,L)},keyCodes:[e,t,o]})},Gd=function(){const e=st.registry.createSerializedKey(Ye.Z,[Ye.CTRL]),t=st.registry.createSerializedKey(Ye.Z,[Ye.ALT]),o=st.registry.createSerializedKey(Ye.Z,[Ye.META]);st.registry.register({name:Ys.UNDO,preconditionFn(n){return!n.options.readOnly&&!bo.inProgress()},callback(n,u){return n.hideChaff(),n.undo(!1),u.preventDefault(),!0},keyCodes:[e,t,o]})},Vd=function(){const e=st.registry.createSerializedKey(Ye.Z,[Ye.SHIFT,Ye.CTRL]),t=st.registry.createSerializedKey(Ye.Z,[Ye.SHIFT,Ye.ALT]),o=st.registry.createSerializedKey(Ye.Z,[Ye.SHIFT,Ye.META]),n=st.registry.createSerializedKey(Ye.Y,[Ye.CTRL]);st.registry.register({name:Ys.REDO,preconditionFn(u){return!bo.inProgress()&&!u.options.readOnly},callback(u,g){return u.hideChaff(),u.undo(!0),g.preventDefault(),!0},keyCodes:[e,t,o,n]})},Kd=function(){jd(),zd(),Ud(),Hd(),Wd(),Gd(),Vd()},Yd=function(e){const t=e.saveState();return e.getParameters().length&&(t.parameters=e.getParameters().map(o=>o.saveState())),t},Jd=function(e,t,o,n){if(e=e.loadState(o,n),!o.parameters)return e;for(const[u,g]of o.parameters.entries())e.insertParameter(t.loadState(g,n),u);return e},q$=function(e){const t=Object.create(null),o=b($e.SERIALIZER,!0);for(const n in o){let u;const g=(u=o[n])==null?void 0:u.save(e);g&&(t[n]=g)}return t},X$=function(e,t,{recordUndo:o=!1}={}){var n=b($e.SERIALIZER,!0);if(n){n=Object.entries(n).sort((g,I)=>I[1].priority-g[1].priority);var u=G();i.setRecordUndo$$module$build$src$core$events$utils(o),(o=i.getGroup$$module$build$src$core$events$utils())||i.setGroup$$module$build$src$core$events$utils(!0),io(),t instanceof cs&&t.setResizesEnabled(!1);for(const[,g]of n.reverse()){let I;(I=g)==null||I.clear(t)}for(const[g,I]of n.reverse())if(e[g]){let L;(L=I)==null||L.load(e[g],t)}t instanceof cs&&t.setResizesEnabled(!0),no(),z(new(ne(ee.FINISHED_LOADING))(t)),i.setGroup$$module$build$src$core$events$utils(o),i.setRecordUndo$$module$build$src$core$events$utils(u)}},Z$=function(e,t){let o=null;o=typeof e=="string"?document.getElementById(e)||document.querySelector(e):e;var n;if(!document.contains(o)&&document!==((n=o)==null?void 0:n.ownerDocument))throw Error("Error: container is not in current document");e=new gs(t||{}),n=document.createElement("div"),Oe(n,"injectionDiv"),t!=null&&t.rtl&&Oe(n,"blocklyRTL"),n.tabIndex=0,xt(n,Et.LABEL,i.Msg$$module$build$src$core$msg.WORKSPACE_ARIA_LABEL),o.appendChild(n),t=Q$(n,e);const u=eb(n,t,e);return tb(u),se(u),we(u),n.addEventListener("focusin",function(){se(u)}),H(n,"keydown",null,tl),H(Xn(),"keydown",null,tl),(t=oi())&&H(t,"keydown",null,tl),u},Q$=function(e,t){e.setAttribute("dir","LTR"),Pt(t.hasCss,t.pathToMedia),e=ie(J.SVG,{xmlns:pr,"xmlns:html":Gs,"xmlns:xlink":is,version:"1.1",class:"blocklySvg",tabindex:"0"},e);const o=ie(J.DEFS,{},e),n=String(Math.random()).substring(2);return t.gridPattern=sp.createDom(n,t.gridOptions,o),e},eb=function(e,t,o){o.parentWorkspace=null,o=new cs(o);const n=o.options;o.scale=n.zoomOptions.startScale,t.appendChild(o.createDom("blocklyMainBackground",e));var u=o.getRenderer().getClassName();return u&&Oe(e,u),(u=o.getTheme().getClassName())&&Oe(e,u),!n.hasCategories&&n.languageTree&&(e=o.addFlyout(J.SVG),At(e,t)),n.hasTrashcan&&o.addTrashcan(),n.zoomOptions&&n.zoomOptions.controls&&o.addZoomControls(),o.getThemeManager().subscribe(t,"workspaceBackgroundColour","background-color"),o.translate(0,0),o.addChangeListener(Bd(o)),we(o),rd(),Ru(),Xu(),o},tb=function(e){const t=e.options;var o=e.getParentSvg();if(H(o.parentNode,"contextmenu",null,function(n){be(n)||n.preventDefault()}),o=H(window,"resize",null,function(){co(),e.hideComponents(!0),Vu(),ud(),we(e),el(e)}),e.setResizeHandlerWrapper(o),sb(),t.languageTree){o=e.getToolbox();const n=e.getFlyout(!0);o?o.init():n&&(n.init(e),n.show(t.languageTree),typeof n.scrollToStart=="function"&&n.scrollToStart())}t.hasTrashcan&&e.trashcan.init(),t.zoomOptions&&t.zoomOptions.controls&&e.zoomControls_.init(),t.moveOptions&&t.moveOptions.scrollbars?(e.scrollbar=new xp(e,t.moveOptions.scrollbars===!0||!!t.moveOptions.scrollbars.horizontal,t.moveOptions.scrollbars===!0||!!t.moveOptions.scrollbars.vertical,"blocklyMainWorkspaceScrollbar"),e.scrollbar.resize()):e.setMetrics({x:.5,y:.5}),t.hasSounds&&ob(t.pathToMedia,e)},tl=function(e){const t=q();t&&!(be(e)||t.rendered&&!t.isVisible())&&st.registry.onKeyDown(t,e)},sb=function(){ry||(H(document,"scroll",null,function(){const e=B();for(let t=0,o;o=e[t];t++)o instanceof cs&&o.updateInverseScreenCTM()}),ue(document,"touchend",null,X),ue(document,"touchcancel",null,X)),ry=!0},ob=function(e,t){function o(){for(;u.length;){const g=u.pop();g&&V(g)}n.preload()}const n=t.getAudioManager();n.load([e+"click.mp3",e+"click.wav",e+"click.ogg"],"click"),n.load([e+"disconnect.wav",e+"disconnect.mp3",e+"disconnect.ogg"],"disconnect"),n.load([e+"delete.mp3",e+"delete.ogg",e+"delete.wav"],"delete");const u=[];u.push(H(document,"pointermove",null,o,!0)),u.push(H(document,"touchstart",null,o,!0))},qd=function(){Ke.registry.register({displayText(){return i.Msg$$module$build$src$core$msg.UNDO},preconditionFn(e){return 0t.length?cr(t):Sa(i.Msg$$module$build$src$core$msg.DELETE_ALL_BLOCKS.replace("%1",String(t.length)),function(o){o&&cr(t)})}},scopeType:Ke.ScopeType.WORKSPACE,id:"workspaceDelete",weight:6})},ib=function(){qd(),Xd(),Zd(),eh(),th(),oh()},ih=function(){Ke.registry.register({displayText(){return i.Msg$$module$build$src$core$msg.DUPLICATE_BLOCK},preconditionFn(e){return e=e.block,!e.isInFlyout&&e.isDeletable()&&e.isMovable()?e.isDuplicatable()?"enabled":"disabled":"hidden"},callback(e){if(e.block){var t=e.block.toCopyData();t&&Ro(t,e.block.workspace)}},scopeType:Ke.ScopeType.BLOCK,id:"blockDuplicate",weight:1})},nh=function(){Ke.registry.register({displayText(e){return e.block.hasIcon(_o.TYPE)?i.Msg$$module$build$src$core$msg.REMOVE_COMMENT:i.Msg$$module$build$src$core$msg.ADD_COMMENT},preconditionFn(e){return e=e.block,!e.isInFlyout&&e.workspace.options.comments&&!e.isCollapsed()&&e.isEditable()?"enabled":"hidden"},callback(e){e=e.block,e.hasIcon(_o.TYPE)?e.setCommentText(null):e.setCommentText("")},scopeType:Ke.ScopeType.BLOCK,id:"blockComment",weight:2})},rh=function(){Ke.registry.register({displayText(e){return e.block.getInputsInline()?i.Msg$$module$build$src$core$msg.EXTERNAL_INPUTS:i.Msg$$module$build$src$core$msg.INLINE_INPUTS},preconditionFn(e){if(e=e.block,!e.isInFlyout&&e.isMovable()&&!e.isCollapsed()){for(let t=1;t(t.has(Gt)?1:0),e.getInheritedDisabled()||t?"disabled":"enabled"}return"hidden"},callback(e){e=e.block;const t=i.getGroup$$module$build$src$core$events$utils();t||i.setGroup$$module$build$src$core$events$utils(!0),e.setDisabledReason(!e.hasDisabledReason(Gt),Gt),i.setGroup$$module$build$src$core$events$utils(t)},scopeType:Ke.ScopeType.BLOCK,id:"blockDisable",weight:5})},ch=function(){Ke.registry.register({displayText(e){var t=e.block;return e=t.getDescendants(!1).length,(t=t.getNextBlock())&&(e-=t.getDescendants(!1).length),e===1?i.Msg$$module$build$src$core$msg.DELETE_BLOCK:i.Msg$$module$build$src$core$msg.DELETE_X_BLOCKS.replace("%1",`${e}`)},preconditionFn(e){return!e.block.isInFlyout&&e.block.isDeletable()?"enabled":"hidden"},callback(e){e.block&&e.block.checkAndDelete()},scopeType:Ke.ScopeType.BLOCK,id:"blockDelete",weight:6})},uh=function(){Ke.registry.register({displayText(){return i.Msg$$module$build$src$core$msg.HELP},preconditionFn(e){return e=e.block,(typeof e.helpUrl=="function"?e.helpUrl():e.helpUrl)?"enabled":"hidden"},callback(e){e.block.showHelp()},scopeType:Ke.ScopeType.BLOCK,id:"blockHelp",weight:7})},dh=function(){Ke.registry.register({displayText:()=>i.Msg$$module$build$src$core$msg.REMOVE_COMMENT,preconditionFn(e){let t;return(t=e.comment)!=null&&t.isDeletable()?"enabled":"hidden"},callback(e){i.setGroup$$module$build$src$core$events$utils(!0);let t;(t=e.comment)==null||t.dispose(),i.setGroup$$module$build$src$core$events$utils(!1)},scopeType:Ke.ScopeType.COMMENT,id:"commentDelete",weight:6})},hh=function(){Ke.registry.register({displayText:()=>i.Msg$$module$build$src$core$msg.DUPLICATE_COMMENT,preconditionFn(e){let t;return(t=e.comment)!=null&&t.isMovable()?"enabled":"hidden"},callback(e){if(e.comment){var t=e.comment.toCopyData();t&&Ro(t,e.comment.workspace)}},scopeType:Ke.ScopeType.COMMENT,id:"commentDuplicate",weight:1})},ph=function(){Ke.registry.register({displayText:()=>i.Msg$$module$build$src$core$msg.ADD_COMMENT,preconditionFn:e=>{let t;return(t=e.workspace)!=null&&t.isMutator?"hidden":"enabled"},callback:(e,t)=>{if(e=e.workspace){i.setGroup$$module$build$src$core$events$utils(!0);var o=new Il(e);o.setText(i.Msg$$module$build$src$core$msg.WORKSPACE_COMMENT_DEFAULT_TEXT),o.moveTo(nb(new ye(t.clientX,t.clientY),e)),i.setSelected$$module$build$src$core$common(o),i.setGroup$$module$build$src$core$events$utils(!1)}},scopeType:Ke.ScopeType.WORKSPACE,id:"commentCreate",weight:8})},nb=function(e,t){var o=t.getInjectionDiv().getBoundingClientRect();return e=new ye(e.x-o.left,e.y-o.top),o=t.getOriginOffsetInPixels(),e=ye.difference(e,o),e.scale(1/t.scale),e},rb=function(){ih(),nh(),rh(),ah(),lh(),ch(),uh()},ab=function(){hh(),dh(),ph()},gh=function(){ib(),rb()},lb=function(e){return e.paste!==void 0},cb=function(e){return e.getSvgRoot!==void 0},ub=function(e){return typeof e.id=="string"&&e.workspace!==void 0&&e.select!==void 0&&e.unselect!==void 0},db=function(e){return e.isSelectable()},hb=function(e){q().hideChaff(e)},ge=ge||{},ge.scope={},ge.ASSUME_ES5=!1,ge.ASSUME_NO_NATIVE_MAP=!1,ge.ASSUME_NO_NATIVE_SET=!1,ge.SIMPLE_FROUND_POLYFILL=!1,ge.ISOLATE_POLYFILLS=!1,ge.FORCE_POLYFILL_PROMISE=!1,ge.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1,ge.defineProperty=ge.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(e,t,o){return e==Array.prototype||e==Object.prototype||(e[t]=o.value),e},ge.getGlobal=function(e){e=[typeof globalThis=="object"&&globalThis,e,typeof window=="object"&&window,typeof self=="object"&&self,typeof eo=="object"&&eo];for(var t=0;t>>0,ge.propertyToPolyfillSymbol[u]=ge.IS_SYMBOL_NATIVE?ge.global.Symbol(u):ge.POLYFILL_PREFIX+o+"$"+u),ge.defineProperty(n,ge.propertyToPolyfillSymbol[u],{configurable:!0,writable:!0,value:t})))},ge.underscoreProtoCanBeSet=function(){var e={a:!0},t={};try{return t.__proto__=e,t.a}catch{}return!1},ge.setPrototypeOf=ge.TRUST_ES6_POLYFILLS&&typeof Object.setPrototypeOf=="function"?Object.setPrototypeOf:ge.underscoreProtoCanBeSet()?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null,ge.arrayIteratorImpl=function(e){var t=0;return function(){return to&&(o=Math.max(o+u,0));o{const e=fb.length,t=[];for(let o=0;20>o;o++)t[o]=fb.charAt(Math.random()*e);return t.join("")}},LC=0,mh={TEST_ONLY:$b};mh.genUid=_,mh.getNextUniqueId=v;var bb="",ur=!0,fh=0,$h="ORPHANED_BLOCK",po=[],vb={FIRE_QUEUE:po,enqueueEvent:Ce,fireNow:he,fireInternal:Z,setGroupInternal:Q};i.disable$$module$build$src$core$events$utils,i.enable$$module$build$src$core$events$utils,i.getGroup$$module$build$src$core$events$utils,i.setGroup$$module$build$src$core$events$utils,i.setRecordUndo$$module$build$src$core$events$utils;var dr=Object.create(null),yb,ai=null,_b,hr=[],wb={defineBlocksWithJsonArrayInternal:We},Ot={TEST_ONLY:wb};Ot.createBlockDefinitionsFromJsonArray=i.createBlockDefinitionsFromJsonArray$$module$build$src$core$common,Ot.defineBlocks=i.defineBlocks$$module$build$src$core$common,Ot.defineBlocksWithJsonArray=Ae,Ot.draggingConnections=hr,Ot.getAllWorkspaces=B,Ot.getBlockTypeCounts=Ie,Ot.getMainWorkspace=q,Ot.getParentContainer=Te,Ot.getSelected=j,Ot.getWorkspaceById=re,Ot.registerWorkspace=N,Ot.setMainWorkspace=se,Ot.setParentContainer=ae,Ot.setSelected=i.setSelected$$module$build$src$core$common,Ot.svgResize=we,Ot.unregisterWorkpace=te;var qi=class{constructor(){this.workspaceId=void 0,this.isUiEvent=!1,this.type="",this.group=i.getGroup$$module$build$src$core$events$utils(),this.recordUndo=G()}toJson(){return{type:this.type,group:this.group}}static fromJson(e,t,o){return o.isBlank=!1,o.group=e.group||"",o.workspaceId=t.id,o}isNull(){return!1}run(e){}getEventWorkspace_(){let e;if(this.workspaceId&&(e=re(this.workspaceId)),!e)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return e}},Ss=class extends qi{constructor(e){super(),this.recordUndo=!1,this.isUiEvent=!0,this.isBlank=typeof e>"u",this.workspaceId=e||""}},bh=class extends Ss{constructor(e,t,o){t=e?e.workspace.id:t,t===null&&(t=void 0),super(t),this.type=ee.CLICK,this.blockId=e?e.id:void 0,this.targetType=o}toJson(){const e=super.toJson();if(!this.targetType)throw Error("The click target type is undefined. Either pass a block to the constructor, or call fromJson");return e.targetType=this.targetType,e.blockId=this.blockId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new bh),t.targetType=e.targetType,t.blockId=e.blockId,t}},vh;(function(e){e.BLOCK="block",e.WORKSPACE="workspace",e.ZOOM_CONTROLS="zoom_controls"})(vh||(vh={})),r($e.EVENT,ee.CLICK,bh);var PC=750,kb="ontouchstart"in globalThis||!!(globalThis.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!globalThis.navigator||!globalThis.navigator.maxTouchPoints&&!globalThis.navigator.msMaxTouchPoints),il=null,li={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"],mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]},nl=0,ci={TOUCH_ENABLED:kb,TOUCH_MAP:li};ci.checkTouchIdentifier=U,ci.clearTouchIdentifier=Y,ci.getTouchIdentifierFromEvent=A,ci.longStart=k,ci.longStop=X,ci.shouldHandleEvent=O;var yh,Cb,Tb,Sb,rl,al,_h,Eb,Ib,xb;(function(e){function t(n){return o.includes(n.toUpperCase())}yh=e;const o=yh.toUpperCase();Cb=t("JavaFX"),Tb=t("WebKit"),Sb=t("Gecko")&&!Tb,rl=t("Android"),e=globalThis.navigator&&globalThis.navigator.maxTouchPoints,al=t("iPad")||t("Macintosh")&&0{n.push(this.componentData.get(u))}),n.sort(function(u,g){return u.weight-g.weight}),n.forEach(function(u){o.push(u.component)})}else e.forEach(n=>{o.push(this.componentData.get(n).component)});return o}};gt.Capability=mo,(function(e){e=e.ComponentWeight||(e.ComponentWeight={}),e[e.TOOLBOX_WEIGHT=0]="TOOLBOX_WEIGHT",e[e.FLYOUT_WEIGHT=1]="FLYOUT_WEIGHT",e[e.TRASHCAN_WEIGHT=2]="TRASHCAN_WEIGHT",e[e.ZOOM_CONTROLS_WEIGHT=3]="ZOOM_CONTROLS_WEIGHT"})(gt||(gt={})),gt.ComponentWeight;var Ch=!1,Th=` .blocklySvg { background-color: #fff; outline: none; @@ -719,7 +719,7 @@ input[type=number] { z-index: 80; pointer-events: none; } -`,Sh={};Sh.inject=Pt,Sh.register=Be;var ye=class{constructor(e,t){this.x=e,this.y=t}clone(){return new ye(this.x,this.y)}scale(e){return this.x*=e,this.y*=e,this}translate(e,t){return this.x+=e,this.y+=t,this}static equals(e,t){return e===t?!0:e&&t?e.x===t.x&&e.y===t.y:!1}static distance(e,t){const o=e.x-t.x;return e=e.y-t.y,Math.sqrt(o*o+e*e)}static magnitude(e){return Math.sqrt(e.x*e.x+e.y*e.y)}static difference(e,t){return new ye(e.x-t.x,e.y-t.y)}static sum(e,t){return new ye(e.x+t.x,e.y+t.y)}},pr="http://www.w3.org/2000/svg",Gs="http://www.w3.org/1999/xhtml",is="http://www.w3.org/1999/xlink",fo;(function(e){e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE"})(fo||(fo={}));var Es=null,Eh=0,cl=null,Dt={HTML_NS:Gs};Dt.NodeType=fo,Dt.SVG_NS=pr,Dt.XLINK_NS=is,Dt.addClass=Oe,Dt.createSvgElement=ie,Dt.getFastTextWidth=Io,Dt.getFastTextWidthWithSizeString=Bs,Dt.getTextWidth=Un,Dt.hasClass=Zo,Dt.insertAfter=At,Dt.measureFontMetrics=ro,Dt.removeClass=ze,Dt.removeClasses=Ps,Dt.removeNode=Ze,Dt.setCssTransform=Qo,Dt.startTextWidthCache=io,Dt.stopTextWidthCache=no;var J=class{constructor(e){this.tagName=e}toString(){return this.tagName}};J.ANIMATE=new J("animate"),J.CIRCLE=new J("circle"),J.CLIPPATH=new J("clipPath"),J.DEFS=new J("defs"),J.FECOMPOSITE=new J("feComposite"),J.FECOMPONENTTRANSFER=new J("feComponentTransfer"),J.FEFLOOD=new J("feFlood"),J.FEFUNCA=new J("feFuncA"),J.FEGAUSSIANBLUR=new J("feGaussianBlur"),J.FEPOINTLIGHT=new J("fePointLight"),J.FESPECULARLIGHTING=new J("feSpecularLighting"),J.FILTER=new J("filter"),J.FOREIGNOBJECT=new J("foreignObject"),J.G=new J("g"),J.IMAGE=new J("image"),J.LINE=new J("line"),J.PATH=new J("path"),J.PATTERN=new J("pattern"),J.POLYGON=new J("polygon"),J.RECT=new J("rect"),J.SVG=new J("svg"),J.TEXT=new J("text"),J.TSPAN=new J("tspan");var rt=class{constructor(e,t,o,n){this.top=e,this.bottom=t,this.left=o,this.right=n}clone(){return new rt(this.top,this.bottom,this.left,this.right)}getHeight(){return this.bottom-this.top}getWidth(){return this.right-this.left}contains(e,t){return e>=this.left&&e<=this.right&&t>=this.top&&t<=this.bottom}intersects(e){return this.left<=e.right&&this.right>=e.left&&this.bottom>=e.top&&this.top<=e.bottom}static equals(e,t){return e===t?!0:e&&t?e.top===t.top&&e.bottom===t.bottom&&e.left===t.left&&e.right===t.right:!1}static createFromPoint(e,t,o){const n=e.x;return e=e.y,new rt(e,e+o,n,n+t)}},Xe=class{constructor(e,t){this.width=e,this.height=t}static equals(e,t){return e===t?!0:e&&t?e.width===t.width&&e.height===t.height:!1}static max(e,t){return new Xe(Math.max(e.width,t.width),Math.max(e.height,t.height))}static min(e,t){return new Xe(Math.min(e.width,t.width),Math.min(e.height,t.height))}},Mb={getSizeInternal:Gm},Mo={TEST_ONLY:Mb};Mo.getBorderBox=mu,Mo.getComputedStyle=Fs,Mo.getContainerOffsetToScrollInto=fu,Mo.getPageOffset=xo,Mo.getSize=Hn,Mo.getViewportPageOffset=gu,Mo.scrollIntoContainerView=ma;var Lb=/translate\(\s*([-+\d.e]+)([ ,]\s*([-+\d.e]+)\s*)?/,Pb=/transform:\s*translate(?:3d)?\(\s*([-+\d.e]+)\s*px([ ,]\s*([-+\d.e]+)\s*px)?/,jC={XY_REGEX:Lb,XY_STYLE_REGEX:Pb},ui={TEST_ONLY:jC};ui.getDocumentScroll=bu,ui.getInjectionDivXY=fa,ui.getRelativeXY=Wn,ui.getViewportBBox=$u,ui.screenToWsCoordinates=Vm,ui.wsToScreenCoordinates=Km;var yt=class{constructor(e,t,o,n,u){this.workspace=e,this.horizontal=t,this.oldHostMetrics=null,this.ratio=1,this.origin=new ye(0,0),this.startDragHandle=this.handlePosition=this.handleLength=this.scrollbarLength=this.startDragMouse=0,this.containerVisible=this.isHandleVisible=!0,this.position=new ye(0,0),this.onMouseMoveWrapper_=this.onMouseUpWrapper_=null,this.pair=o||!1,this.margin=u!==void 0?u:yt.DEFAULT_SCROLLBAR_MARGIN,e="blocklyScrollbar"+(this.horizontal?"Horizontal":"Vertical"),n&&(e+=" "+n),this.outerSvg=ie(J.SVG,{class:e}),n=ie(J.G,{},this.outerSvg),this.svgBackground=ie(J.RECT,{class:"blocklyScrollbarBackground"},n),e=Math.floor((yt.scrollbarThickness-5)/2),this.svgHandle=ie(J.RECT,{class:"blocklyScrollbarHandle",rx:e,ry:e},n),this.workspace.getThemeManager().subscribe(this.svgHandle,"scrollbarColour","fill"),this.workspace.getThemeManager().subscribe(this.svgHandle,"scrollbarOpacity","fill-opacity"),At(this.outerSvg,this.workspace.getParentSvg()),this.setInitialThickness(),t?(this.lengthAttribute_="width",this.positionAttribute_="x"):(this.lengthAttribute_="height",this.positionAttribute_="y"),this.onMouseDownBarWrapper_=H(this.svgBackground,"pointerdown",this,this.onMouseDownBar),this.onMouseDownHandleWrapper_=H(this.svgHandle,"pointerdown",this,this.onMouseDownHandle)}setInitialThickness(){const e=yt.scrollbarThickness;this.horizontal?(this.svgBackground.setAttribute("height",String(e)),this.outerSvg.setAttribute("height",String(e)),this.svgHandle.setAttribute("height",String(e-5)),this.svgHandle.setAttribute("y","2.5")):(this.svgBackground.setAttribute("width",String(e)),this.outerSvg.setAttribute("width",String(e)),this.svgHandle.setAttribute("width",String(e-5)),this.svgHandle.setAttribute("x","2.5"))}dispose(){this.cleanUp(),V(this.onMouseDownBarWrapper_),V(this.onMouseDownHandleWrapper_),Ze(this.outerSvg),this.workspace.getThemeManager().unsubscribe(this.svgHandle)}constrainHandleLength(e){return e=0>=e||isNaN(e)?0:Math.min(e,this.scrollbarLength)}setHandleLength(e){this.handleLength=e,this.svgHandle.setAttribute(this.lengthAttribute_,String(this.handleLength))}constrainHandlePosition(e){return e=0>=e||isNaN(e)?0:Math.min(e,this.scrollbarLength-this.handleLength)}setHandlePosition(e){this.handlePosition=e,this.svgHandle.setAttribute(this.positionAttribute_,String(this.handlePosition))}setScrollbarLength(e){this.scrollbarLength=e,this.outerSvg.setAttribute(this.lengthAttribute_,String(this.scrollbarLength)),this.svgBackground.setAttribute(this.lengthAttribute_,String(this.scrollbarLength))}setPosition(e,t){this.position.x=e,this.position.y=t,Qo(this.outerSvg,"translate("+(this.position.x+this.origin.x)+"px,"+(this.position.y+this.origin.y)+"px)")}resize(e){!e&&(e=this.workspace.getMetrics(),!e)||this.oldHostMetrics&&yt.metricsAreEquivalent(e,this.oldHostMetrics)||(this.horizontal?this.resizeHorizontal(e):this.resizeVertical(e),this.oldHostMetrics=e,this.updateMetrics())}requiresViewResize(e){return this.oldHostMetrics?this.oldHostMetrics.viewWidth!==e.viewWidth||this.oldHostMetrics.viewHeight!==e.viewHeight||this.oldHostMetrics.absoluteLeft!==e.absoluteLeft||this.oldHostMetrics.absoluteTop!==e.absoluteTop:!0}resizeHorizontal(e){this.requiresViewResize(e)?this.resizeViewHorizontal(e):this.resizeContentHorizontal(e)}resizeViewHorizontal(e){var t=e.viewWidth-2*this.margin;this.pair&&(t-=yt.scrollbarThickness),this.setScrollbarLength(Math.max(0,t)),t=e.absoluteLeft+this.margin,this.pair&&this.workspace.RTL&&(t+=yt.scrollbarThickness),this.setPosition(t,e.absoluteTop+e.viewHeight-yt.scrollbarThickness-this.margin),this.resizeContentHorizontal(e)}resizeContentHorizontal(e){if(e.viewWidth>=e.scrollWidth)this.setHandleLength(this.scrollbarLength),this.setHandlePosition(0),this.pair||this.setVisible(!1);else{this.pair||this.setVisible(!0);var t=this.scrollbarLength*e.viewWidth/e.scrollWidth;t=this.constrainHandleLength(t),this.setHandleLength(t),t=e.scrollWidth-e.viewWidth;var o=this.scrollbarLength-this.handleLength;e=(e.viewLeft-e.scrollLeft)/t*o,e=this.constrainHandlePosition(e),this.setHandlePosition(e),this.ratio=o/t}}resizeVertical(e){this.requiresViewResize(e)?this.resizeViewVertical(e):this.resizeContentVertical(e)}resizeViewVertical(e){let t=e.viewHeight-2*this.margin;this.pair&&(t-=yt.scrollbarThickness),this.setScrollbarLength(Math.max(0,t)),this.setPosition(this.workspace.RTL?e.absoluteLeft+this.margin:e.absoluteLeft+e.viewWidth-yt.scrollbarThickness-this.margin,e.absoluteTop+this.margin),this.resizeContentVertical(e)}resizeContentVertical(e){if(e.viewHeight>=e.scrollHeight)this.setHandleLength(this.scrollbarLength),this.setHandlePosition(0),this.pair||this.setVisible(!1);else{this.pair||this.setVisible(!0);var t=this.scrollbarLength*e.viewHeight/e.scrollHeight;t=this.constrainHandleLength(t),this.setHandleLength(t),t=e.scrollHeight-e.viewHeight;var o=this.scrollbarLength-this.handleLength;e=(e.viewTop-e.scrollTop)/t*o,e=this.constrainHandlePosition(e),this.setHandlePosition(e),this.ratio=o/t}}isVisible(){return this.isHandleVisible}setContainerVisible(e){const t=e!==this.containerVisible;this.containerVisible=e,t&&this.updateDisplay_()}setVisible(e){if(this.pair)throw Error("Unable to toggle visibility of paired scrollbars.");this.setVisibleInternal(e)}setVisibleInternal(e){const t=e!==this.isVisible();this.isHandleVisible=e,t&&this.updateDisplay_()}updateDisplay_(){this.containerVisible&&this.isVisible()?this.outerSvg.setAttribute("display","block"):this.outerSvg.setAttribute("display","none")}onMouseDownBar(e){if(this.workspace.markFocused(),Y(),this.cleanUp(),pe(e))e.stopPropagation();else{var t=fe(e,this.workspace.getParentSvg(),this.workspace.getInverseScreenCTM());t=this.horizontal?t.x:t.y;var o=fa(this.svgHandle);o=this.horizontal?o.x:o.y;var n=this.handlePosition,u=.95*this.handleLength;t<=o?n-=u:t>=o+this.handleLength&&(n+=u),this.setHandlePosition(this.constrainHandlePosition(n)),this.updateMetrics(),e.stopPropagation(),e.preventDefault()}}onMouseDownHandle(e){this.workspace.markFocused(),this.cleanUp(),pe(e)?e.stopPropagation():(this.startDragHandle=this.handlePosition,this.startDragMouse=this.horizontal?e.clientX:e.clientY,this.onMouseUpWrapper_=H(document,"pointerup",this,this.onMouseUpHandle),this.onMouseMoveWrapper_=H(document,"pointermove",this,this.onMouseMoveHandle),e.stopPropagation(),e.preventDefault())}onMouseMoveHandle(e){this.setHandlePosition(this.constrainHandlePosition(this.startDragHandle+((this.horizontal?e.clientX:e.clientY)-this.startDragMouse))),this.updateMetrics()}onMouseUpHandle(){Y(),this.cleanUp()}cleanUp(){this.workspace.hideChaff(!0),this.onMouseUpWrapper_&&(V(this.onMouseUpWrapper_),this.onMouseUpWrapper_=null),this.onMouseMoveWrapper_&&(V(this.onMouseMoveWrapper_),this.onMouseMoveWrapper_=null)}getRatio_(){let e=this.handlePosition/(this.scrollbarLength-this.handleLength);return isNaN(e)&&(e=0),e}updateMetrics(){const e=this.getRatio_();this.horizontal?this.workspace.setMetrics({x:e}):this.workspace.setMetrics({y:e})}set(e,t){this.setHandlePosition(this.constrainHandlePosition(e*this.ratio)),(t||t===void 0)&&this.updateMetrics()}setOrigin(e,t){this.origin=new ye(e,t)}static metricsAreEquivalent(e,t){return e.viewWidth===t.viewWidth&&e.viewHeight===t.viewHeight&&e.viewLeft===t.viewLeft&&e.viewTop===t.viewTop&&e.absoluteTop===t.absoluteTop&&e.absoluteLeft===t.absoluteLeft&&e.scrollWidth===t.scrollWidth&&e.scrollHeight===t.scrollHeight&&e.scrollLeft===t.scrollLeft&&e.scrollTop===t.scrollTop}};yt.scrollbarThickness=_b?25:15,yt.DEFAULT_SCROLLBAR_MARGIN=.5;var ul={parseFromString:function(){throw Error("DOMParser was not found in the global scope and was not properly injected using injectDependencies")}},Ih={serializeToString:function(){throw Error("XMLSerializer was not foundin the global scope and was not properly injected using injectDependencies")}},{document:dl,DOMParser:gr,XMLSerializer:mr}=globalThis;gr&&(ul=new gr),mr&&(Ih=new mr);var Bb="https://developers.google.com/blockly/xml",zC=/[\x00-\x09\x0B\x0C\x0E-\x1F]/g,Xi={NAME_SPACE:Bb};Xi.createElement=i.createElement$$module$build$src$core$utils$xml,Xi.createTextNode=i.createTextNode$$module$build$src$core$utils$xml,Xi.domToText=Li,Xi.injectDependencies=Ym,Xi.textToDom=i.textToDom$$module$build$src$core$utils$xml;var xh="categoryToolbox",Fb="flyoutToolbox",Ge;(function(e){e[e.TOP=0]="TOP",e[e.BOTTOM=1]="BOTTOM",e[e.LEFT=2]="LEFT",e[e.RIGHT=3]="RIGHT"})(Ge||(Ge={}));var jb={hasCategoriesInternal:Xm},Lo={};Lo.Position=Ge,Lo.TEST_ONLY=jb,Lo.convertFlyoutDefToJsonArray=Gn,Lo.convertToolboxDefToJson=$a,Lo.hasCategories=ba,Lo.isCategoryCollapsible=va,Lo.parseToolboxTree=yu;var $o;(function(e){e[e.TOP=0]="TOP",e[e.BOTTOM=1]="BOTTOM"})($o||($o={}));var Zi;(function(e){e[e.LEFT=0]="LEFT",e[e.RIGHT=1]="RIGHT"})(Zi||(Zi={}));var Po;(function(e){e[e.UP=0]="UP",e[e.DOWN=1]="DOWN"})(Po||(Po={}));var di={};di.bumpDirection=Po,di.bumpPositionRect=ka,di.getCornerOppositeToolbox=wa,di.getStartPositionRect=_a,di.horizontalPosition=Zi,di.verticalPosition=$o;var Wt={width:96,height:124,url:"sprites.png"},zb=class{constructor(e){this.workspace=e,this.id="zoomControls",this.boundEvents=[],this.zoomResetGroup=this.zoomOutGroup=this.zoomInGroup=null,this.HEIGHT=this.WIDTH=32,this.SMALL_SPACING=2,this.LARGE_SPACING=11,this.MARGIN_HORIZONTAL=this.MARGIN_VERTICAL=20,this.svgGroup=null,this.top=this.left=0,this.initialized=!1}createDom(){this.svgGroup=ie(J.G,{});const e=String(Math.random()).substring(2);return this.createZoomOutSvg(e),this.createZoomInSvg(e),this.workspace.isMovable()&&this.createZoomResetSvg(e),this.svgGroup}init(){this.workspace.getComponentManager().addComponent({component:this,weight:gt.ComponentWeight.ZOOM_CONTROLS_WEIGHT,capabilities:[gt.Capability.POSITIONABLE]}),this.initialized=!0}dispose(){this.workspace.getComponentManager().removeComponent("zoomControls"),this.svgGroup&&Ze(this.svgGroup);for(const e of this.boundEvents)V(e);this.boundEvents.length=0}getBoundingRectangle(){let e=this.SMALL_SPACING+2*this.HEIGHT;return this.zoomResetGroup&&(e+=this.LARGE_SPACING+this.HEIGHT),new rt(this.top,this.top+e,this.left,this.left+this.WIDTH)}position(e,t){if(this.initialized){var o=wa(this.workspace,e),n=this.SMALL_SPACING+2*this.HEIGHT;if(this.zoomResetGroup&&(n+=this.LARGE_SPACING+this.HEIGHT),e=_a(o,new Xe(this.WIDTH,n),this.MARGIN_HORIZONTAL,this.MARGIN_VERTICAL,e,this.workspace),o=o.vertical,t=ka(e,this.MARGIN_VERTICAL,o===$o.TOP?Po.DOWN:Po.UP,t),o===$o.TOP){var u=this.SMALL_SPACING+this.HEIGHT,g;(g=this.zoomInGroup)==null||g.setAttribute("transform","translate(0, "+u+")"),this.zoomResetGroup&&this.zoomResetGroup.setAttribute("transform","translate(0, "+(u+this.LARGE_SPACING+this.HEIGHT)+")")}else{g=this.zoomResetGroup?this.LARGE_SPACING+this.HEIGHT:0;let L;(L=this.zoomInGroup)==null||L.setAttribute("transform","translate(0, "+g+")"),g=g+this.SMALL_SPACING+this.HEIGHT,(u=this.zoomOutGroup)==null||u.setAttribute("transform","translate(0, "+g+")")}this.top=t.top,this.left=t.left;var I;(I=this.svgGroup)==null||I.setAttribute("transform","translate("+this.left+","+this.top+")")}}createZoomOutSvg(e){this.zoomOutGroup=ie(J.G,{class:"blocklyZoom blocklyZoomOut"},this.svgGroup);const t=ie(J.CLIPPATH,{id:"blocklyZoomoutClipPath"+e},this.zoomOutGroup);ie(J.RECT,{width:32,height:32},t),ie(J.IMAGE,{width:Wt.width,height:Wt.height,x:-64,y:-92,"clip-path":"url(#blocklyZoomoutClipPath"+e+")"},this.zoomOutGroup).setAttributeNS(is,"xlink:href",this.workspace.options.pathToMedia+Wt.url),this.boundEvents.push(H(this.zoomOutGroup,"pointerdown",null,this.zoom.bind(this,-1)))}createZoomInSvg(e){this.zoomInGroup=ie(J.G,{class:"blocklyZoom blocklyZoomIn"},this.svgGroup);const t=ie(J.CLIPPATH,{id:"blocklyZoominClipPath"+e},this.zoomInGroup);ie(J.RECT,{width:32,height:32},t),ie(J.IMAGE,{width:Wt.width,height:Wt.height,x:-32,y:-92,"clip-path":"url(#blocklyZoominClipPath"+e+")"},this.zoomInGroup).setAttributeNS(is,"xlink:href",this.workspace.options.pathToMedia+Wt.url),this.boundEvents.push(H(this.zoomInGroup,"pointerdown",null,this.zoom.bind(this,1)))}zoom(e,t){this.workspace.markFocused(),this.workspace.zoomCenter(e),this.fireZoomEvent(),Y(),t.stopPropagation(),t.preventDefault()}createZoomResetSvg(e){this.zoomResetGroup=ie(J.G,{class:"blocklyZoom blocklyZoomReset"},this.svgGroup);const t=ie(J.CLIPPATH,{id:"blocklyZoomresetClipPath"+e},this.zoomResetGroup);ie(J.RECT,{width:32,height:32},t),ie(J.IMAGE,{width:Wt.width,height:Wt.height,y:-92,"clip-path":"url(#blocklyZoomresetClipPath"+e+")"},this.zoomResetGroup).setAttributeNS(is,"xlink:href",this.workspace.options.pathToMedia+Wt.url),this.boundEvents.push(H(this.zoomResetGroup,"pointerdown",null,this.resetZoom.bind(this)))}resetZoom(e){this.workspace.markFocused();const t=Math.log(this.workspace.options.zoomOptions.startScale/this.workspace.scale)/Math.log(this.workspace.options.zoomOptions.scaleSpeed);this.workspace.beginCanvasTransition(),this.workspace.zoomCenter(t),this.workspace.scrollCenter(),setTimeout(this.workspace.endCanvasTransition.bind(this.workspace),500),this.fireZoomEvent(),Y(),e.stopPropagation(),e.preventDefault()}fireZoomEvent(){const e=new(ne(ee.CLICK))(null,this.workspace.id,"zoom_controls");z(e)}};Be(` +`,Sh={};Sh.inject=Pt,Sh.register=Be;var ye=class{constructor(e,t){this.x=e,this.y=t}clone(){return new ye(this.x,this.y)}scale(e){return this.x*=e,this.y*=e,this}translate(e,t){return this.x+=e,this.y+=t,this}static equals(e,t){return e===t?!0:e&&t?e.x===t.x&&e.y===t.y:!1}static distance(e,t){const o=e.x-t.x;return e=e.y-t.y,Math.sqrt(o*o+e*e)}static magnitude(e){return Math.sqrt(e.x*e.x+e.y*e.y)}static difference(e,t){return new ye(e.x-t.x,e.y-t.y)}static sum(e,t){return new ye(e.x+t.x,e.y+t.y)}},pr="http://www.w3.org/2000/svg",Gs="http://www.w3.org/1999/xhtml",is="http://www.w3.org/1999/xlink",fo;(function(e){e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE"})(fo||(fo={}));var Es=null,Eh=0,cl=null,Dt={HTML_NS:Gs};Dt.NodeType=fo,Dt.SVG_NS=pr,Dt.XLINK_NS=is,Dt.addClass=Oe,Dt.createSvgElement=ie,Dt.getFastTextWidth=Io,Dt.getFastTextWidthWithSizeString=Bs,Dt.getTextWidth=Un,Dt.hasClass=Zo,Dt.insertAfter=At,Dt.measureFontMetrics=ro,Dt.removeClass=ze,Dt.removeClasses=Ps,Dt.removeNode=Ze,Dt.setCssTransform=Qo,Dt.startTextWidthCache=io,Dt.stopTextWidthCache=no;var J=class{constructor(e){this.tagName=e}toString(){return this.tagName}};J.ANIMATE=new J("animate"),J.CIRCLE=new J("circle"),J.CLIPPATH=new J("clipPath"),J.DEFS=new J("defs"),J.FECOMPOSITE=new J("feComposite"),J.FECOMPONENTTRANSFER=new J("feComponentTransfer"),J.FEFLOOD=new J("feFlood"),J.FEFUNCA=new J("feFuncA"),J.FEGAUSSIANBLUR=new J("feGaussianBlur"),J.FEPOINTLIGHT=new J("fePointLight"),J.FESPECULARLIGHTING=new J("feSpecularLighting"),J.FILTER=new J("filter"),J.FOREIGNOBJECT=new J("foreignObject"),J.G=new J("g"),J.IMAGE=new J("image"),J.LINE=new J("line"),J.PATH=new J("path"),J.PATTERN=new J("pattern"),J.POLYGON=new J("polygon"),J.RECT=new J("rect"),J.SVG=new J("svg"),J.TEXT=new J("text"),J.TSPAN=new J("tspan");var rt=class{constructor(e,t,o,n){this.top=e,this.bottom=t,this.left=o,this.right=n}clone(){return new rt(this.top,this.bottom,this.left,this.right)}getHeight(){return this.bottom-this.top}getWidth(){return this.right-this.left}contains(e,t){return e>=this.left&&e<=this.right&&t>=this.top&&t<=this.bottom}intersects(e){return this.left<=e.right&&this.right>=e.left&&this.bottom>=e.top&&this.top<=e.bottom}static equals(e,t){return e===t?!0:e&&t?e.top===t.top&&e.bottom===t.bottom&&e.left===t.left&&e.right===t.right:!1}static createFromPoint(e,t,o){const n=e.x;return e=e.y,new rt(e,e+o,n,n+t)}},Xe=class{constructor(e,t){this.width=e,this.height=t}static equals(e,t){return e===t?!0:e&&t?e.width===t.width&&e.height===t.height:!1}static max(e,t){return new Xe(Math.max(e.width,t.width),Math.max(e.height,t.height))}static min(e,t){return new Xe(Math.min(e.width,t.width),Math.min(e.height,t.height))}},Pb={getSizeInternal:Km},Mo={TEST_ONLY:Pb};Mo.getBorderBox=mu,Mo.getComputedStyle=Fs,Mo.getContainerOffsetToScrollInto=fu,Mo.getPageOffset=xo,Mo.getSize=Hn,Mo.getViewportPageOffset=gu,Mo.scrollIntoContainerView=ma;var Bb=/translate\(\s*([-+\d.e]+)([ ,]\s*([-+\d.e]+)\s*)?/,Fb=/transform:\s*translate(?:3d)?\(\s*([-+\d.e]+)\s*px([ ,]\s*([-+\d.e]+)\s*px)?/,jC={XY_REGEX:Bb,XY_STYLE_REGEX:Fb},ui={TEST_ONLY:jC};ui.getDocumentScroll=bu,ui.getInjectionDivXY=fa,ui.getRelativeXY=Wn,ui.getViewportBBox=$u,ui.screenToWsCoordinates=Ym,ui.wsToScreenCoordinates=Jm;var yt=class{constructor(e,t,o,n,u){this.workspace=e,this.horizontal=t,this.oldHostMetrics=null,this.ratio=1,this.origin=new ye(0,0),this.startDragHandle=this.handlePosition=this.handleLength=this.scrollbarLength=this.startDragMouse=0,this.containerVisible=this.isHandleVisible=!0,this.position=new ye(0,0),this.onMouseMoveWrapper_=this.onMouseUpWrapper_=null,this.pair=o||!1,this.margin=u!==void 0?u:yt.DEFAULT_SCROLLBAR_MARGIN,e="blocklyScrollbar"+(this.horizontal?"Horizontal":"Vertical"),n&&(e+=" "+n),this.outerSvg=ie(J.SVG,{class:e}),n=ie(J.G,{},this.outerSvg),this.svgBackground=ie(J.RECT,{class:"blocklyScrollbarBackground"},n),e=Math.floor((yt.scrollbarThickness-5)/2),this.svgHandle=ie(J.RECT,{class:"blocklyScrollbarHandle",rx:e,ry:e},n),this.workspace.getThemeManager().subscribe(this.svgHandle,"scrollbarColour","fill"),this.workspace.getThemeManager().subscribe(this.svgHandle,"scrollbarOpacity","fill-opacity"),At(this.outerSvg,this.workspace.getParentSvg()),this.setInitialThickness(),t?(this.lengthAttribute_="width",this.positionAttribute_="x"):(this.lengthAttribute_="height",this.positionAttribute_="y"),this.onMouseDownBarWrapper_=H(this.svgBackground,"pointerdown",this,this.onMouseDownBar),this.onMouseDownHandleWrapper_=H(this.svgHandle,"pointerdown",this,this.onMouseDownHandle)}setInitialThickness(){const e=yt.scrollbarThickness;this.horizontal?(this.svgBackground.setAttribute("height",String(e)),this.outerSvg.setAttribute("height",String(e)),this.svgHandle.setAttribute("height",String(e-5)),this.svgHandle.setAttribute("y","2.5")):(this.svgBackground.setAttribute("width",String(e)),this.outerSvg.setAttribute("width",String(e)),this.svgHandle.setAttribute("width",String(e-5)),this.svgHandle.setAttribute("x","2.5"))}dispose(){this.cleanUp(),V(this.onMouseDownBarWrapper_),V(this.onMouseDownHandleWrapper_),Ze(this.outerSvg),this.workspace.getThemeManager().unsubscribe(this.svgHandle)}constrainHandleLength(e){return e=0>=e||isNaN(e)?0:Math.min(e,this.scrollbarLength)}setHandleLength(e){this.handleLength=e,this.svgHandle.setAttribute(this.lengthAttribute_,String(this.handleLength))}constrainHandlePosition(e){return e=0>=e||isNaN(e)?0:Math.min(e,this.scrollbarLength-this.handleLength)}setHandlePosition(e){this.handlePosition=e,this.svgHandle.setAttribute(this.positionAttribute_,String(this.handlePosition))}setScrollbarLength(e){this.scrollbarLength=e,this.outerSvg.setAttribute(this.lengthAttribute_,String(this.scrollbarLength)),this.svgBackground.setAttribute(this.lengthAttribute_,String(this.scrollbarLength))}setPosition(e,t){this.position.x=e,this.position.y=t,Qo(this.outerSvg,"translate("+(this.position.x+this.origin.x)+"px,"+(this.position.y+this.origin.y)+"px)")}resize(e){!e&&(e=this.workspace.getMetrics(),!e)||this.oldHostMetrics&&yt.metricsAreEquivalent(e,this.oldHostMetrics)||(this.horizontal?this.resizeHorizontal(e):this.resizeVertical(e),this.oldHostMetrics=e,this.updateMetrics())}requiresViewResize(e){return this.oldHostMetrics?this.oldHostMetrics.viewWidth!==e.viewWidth||this.oldHostMetrics.viewHeight!==e.viewHeight||this.oldHostMetrics.absoluteLeft!==e.absoluteLeft||this.oldHostMetrics.absoluteTop!==e.absoluteTop:!0}resizeHorizontal(e){this.requiresViewResize(e)?this.resizeViewHorizontal(e):this.resizeContentHorizontal(e)}resizeViewHorizontal(e){var t=e.viewWidth-2*this.margin;this.pair&&(t-=yt.scrollbarThickness),this.setScrollbarLength(Math.max(0,t)),t=e.absoluteLeft+this.margin,this.pair&&this.workspace.RTL&&(t+=yt.scrollbarThickness),this.setPosition(t,e.absoluteTop+e.viewHeight-yt.scrollbarThickness-this.margin),this.resizeContentHorizontal(e)}resizeContentHorizontal(e){if(e.viewWidth>=e.scrollWidth)this.setHandleLength(this.scrollbarLength),this.setHandlePosition(0),this.pair||this.setVisible(!1);else{this.pair||this.setVisible(!0);var t=this.scrollbarLength*e.viewWidth/e.scrollWidth;t=this.constrainHandleLength(t),this.setHandleLength(t),t=e.scrollWidth-e.viewWidth;var o=this.scrollbarLength-this.handleLength;e=(e.viewLeft-e.scrollLeft)/t*o,e=this.constrainHandlePosition(e),this.setHandlePosition(e),this.ratio=o/t}}resizeVertical(e){this.requiresViewResize(e)?this.resizeViewVertical(e):this.resizeContentVertical(e)}resizeViewVertical(e){let t=e.viewHeight-2*this.margin;this.pair&&(t-=yt.scrollbarThickness),this.setScrollbarLength(Math.max(0,t)),this.setPosition(this.workspace.RTL?e.absoluteLeft+this.margin:e.absoluteLeft+e.viewWidth-yt.scrollbarThickness-this.margin,e.absoluteTop+this.margin),this.resizeContentVertical(e)}resizeContentVertical(e){if(e.viewHeight>=e.scrollHeight)this.setHandleLength(this.scrollbarLength),this.setHandlePosition(0),this.pair||this.setVisible(!1);else{this.pair||this.setVisible(!0);var t=this.scrollbarLength*e.viewHeight/e.scrollHeight;t=this.constrainHandleLength(t),this.setHandleLength(t),t=e.scrollHeight-e.viewHeight;var o=this.scrollbarLength-this.handleLength;e=(e.viewTop-e.scrollTop)/t*o,e=this.constrainHandlePosition(e),this.setHandlePosition(e),this.ratio=o/t}}isVisible(){return this.isHandleVisible}setContainerVisible(e){const t=e!==this.containerVisible;this.containerVisible=e,t&&this.updateDisplay_()}setVisible(e){if(this.pair)throw Error("Unable to toggle visibility of paired scrollbars.");this.setVisibleInternal(e)}setVisibleInternal(e){const t=e!==this.isVisible();this.isHandleVisible=e,t&&this.updateDisplay_()}updateDisplay_(){this.containerVisible&&this.isVisible()?this.outerSvg.setAttribute("display","block"):this.outerSvg.setAttribute("display","none")}onMouseDownBar(e){if(this.workspace.markFocused(),Y(),this.cleanUp(),pe(e))e.stopPropagation();else{var t=fe(e,this.workspace.getParentSvg(),this.workspace.getInverseScreenCTM());t=this.horizontal?t.x:t.y;var o=fa(this.svgHandle);o=this.horizontal?o.x:o.y;var n=this.handlePosition,u=.95*this.handleLength;t<=o?n-=u:t>=o+this.handleLength&&(n+=u),this.setHandlePosition(this.constrainHandlePosition(n)),this.updateMetrics(),e.stopPropagation(),e.preventDefault()}}onMouseDownHandle(e){this.workspace.markFocused(),this.cleanUp(),pe(e)?e.stopPropagation():(this.startDragHandle=this.handlePosition,this.startDragMouse=this.horizontal?e.clientX:e.clientY,this.onMouseUpWrapper_=H(document,"pointerup",this,this.onMouseUpHandle),this.onMouseMoveWrapper_=H(document,"pointermove",this,this.onMouseMoveHandle),e.stopPropagation(),e.preventDefault())}onMouseMoveHandle(e){this.setHandlePosition(this.constrainHandlePosition(this.startDragHandle+((this.horizontal?e.clientX:e.clientY)-this.startDragMouse))),this.updateMetrics()}onMouseUpHandle(){Y(),this.cleanUp()}cleanUp(){this.workspace.hideChaff(!0),this.onMouseUpWrapper_&&(V(this.onMouseUpWrapper_),this.onMouseUpWrapper_=null),this.onMouseMoveWrapper_&&(V(this.onMouseMoveWrapper_),this.onMouseMoveWrapper_=null)}getRatio_(){let e=this.handlePosition/(this.scrollbarLength-this.handleLength);return isNaN(e)&&(e=0),e}updateMetrics(){const e=this.getRatio_();this.horizontal?this.workspace.setMetrics({x:e}):this.workspace.setMetrics({y:e})}set(e,t){this.setHandlePosition(this.constrainHandlePosition(e*this.ratio)),(t||t===void 0)&&this.updateMetrics()}setOrigin(e,t){this.origin=new ye(e,t)}static metricsAreEquivalent(e,t){return e.viewWidth===t.viewWidth&&e.viewHeight===t.viewHeight&&e.viewLeft===t.viewLeft&&e.viewTop===t.viewTop&&e.absoluteTop===t.absoluteTop&&e.absoluteLeft===t.absoluteLeft&&e.scrollWidth===t.scrollWidth&&e.scrollHeight===t.scrollHeight&&e.scrollLeft===t.scrollLeft&&e.scrollTop===t.scrollTop}};yt.scrollbarThickness=kb?25:15,yt.DEFAULT_SCROLLBAR_MARGIN=.5;var ul={parseFromString:function(){throw Error("DOMParser was not found in the global scope and was not properly injected using injectDependencies")}},Ih={serializeToString:function(){throw Error("XMLSerializer was not foundin the global scope and was not properly injected using injectDependencies")}},{document:dl,DOMParser:gr,XMLSerializer:mr}=globalThis;gr&&(ul=new gr),mr&&(Ih=new mr);var jb="https://developers.google.com/blockly/xml",zC=/[\x00-\x09\x0B\x0C\x0E-\x1F]/g,Xi={NAME_SPACE:jb};Xi.createElement=i.createElement$$module$build$src$core$utils$xml,Xi.createTextNode=i.createTextNode$$module$build$src$core$utils$xml,Xi.domToText=Li,Xi.injectDependencies=qm,Xi.textToDom=i.textToDom$$module$build$src$core$utils$xml;var xh="categoryToolbox",zb="flyoutToolbox",Ge;(function(e){e[e.TOP=0]="TOP",e[e.BOTTOM=1]="BOTTOM",e[e.LEFT=2]="LEFT",e[e.RIGHT=3]="RIGHT"})(Ge||(Ge={}));var Ub={hasCategoriesInternal:Qm},Lo={};Lo.Position=Ge,Lo.TEST_ONLY=Ub,Lo.convertFlyoutDefToJsonArray=Gn,Lo.convertToolboxDefToJson=$a,Lo.hasCategories=ba,Lo.isCategoryCollapsible=va,Lo.parseToolboxTree=yu;var $o;(function(e){e[e.TOP=0]="TOP",e[e.BOTTOM=1]="BOTTOM"})($o||($o={}));var Zi;(function(e){e[e.LEFT=0]="LEFT",e[e.RIGHT=1]="RIGHT"})(Zi||(Zi={}));var Po;(function(e){e[e.UP=0]="UP",e[e.DOWN=1]="DOWN"})(Po||(Po={}));var di={};di.bumpDirection=Po,di.bumpPositionRect=ka,di.getCornerOppositeToolbox=wa,di.getStartPositionRect=_a,di.horizontalPosition=Zi,di.verticalPosition=$o;var Wt={width:96,height:124,url:"sprites.png"},Hb=class{constructor(e){this.workspace=e,this.id="zoomControls",this.boundEvents=[],this.zoomResetGroup=this.zoomOutGroup=this.zoomInGroup=null,this.HEIGHT=this.WIDTH=32,this.SMALL_SPACING=2,this.LARGE_SPACING=11,this.MARGIN_HORIZONTAL=this.MARGIN_VERTICAL=20,this.svgGroup=null,this.top=this.left=0,this.initialized=!1}createDom(){this.svgGroup=ie(J.G,{});const e=String(Math.random()).substring(2);return this.createZoomOutSvg(e),this.createZoomInSvg(e),this.workspace.isMovable()&&this.createZoomResetSvg(e),this.svgGroup}init(){this.workspace.getComponentManager().addComponent({component:this,weight:gt.ComponentWeight.ZOOM_CONTROLS_WEIGHT,capabilities:[gt.Capability.POSITIONABLE]}),this.initialized=!0}dispose(){this.workspace.getComponentManager().removeComponent("zoomControls"),this.svgGroup&&Ze(this.svgGroup);for(const e of this.boundEvents)V(e);this.boundEvents.length=0}getBoundingRectangle(){let e=this.SMALL_SPACING+2*this.HEIGHT;return this.zoomResetGroup&&(e+=this.LARGE_SPACING+this.HEIGHT),new rt(this.top,this.top+e,this.left,this.left+this.WIDTH)}position(e,t){if(this.initialized){var o=wa(this.workspace,e),n=this.SMALL_SPACING+2*this.HEIGHT;if(this.zoomResetGroup&&(n+=this.LARGE_SPACING+this.HEIGHT),e=_a(o,new Xe(this.WIDTH,n),this.MARGIN_HORIZONTAL,this.MARGIN_VERTICAL,e,this.workspace),o=o.vertical,t=ka(e,this.MARGIN_VERTICAL,o===$o.TOP?Po.DOWN:Po.UP,t),o===$o.TOP){var u=this.SMALL_SPACING+this.HEIGHT,g;(g=this.zoomInGroup)==null||g.setAttribute("transform","translate(0, "+u+")"),this.zoomResetGroup&&this.zoomResetGroup.setAttribute("transform","translate(0, "+(u+this.LARGE_SPACING+this.HEIGHT)+")")}else{g=this.zoomResetGroup?this.LARGE_SPACING+this.HEIGHT:0;let L;(L=this.zoomInGroup)==null||L.setAttribute("transform","translate(0, "+g+")"),g=g+this.SMALL_SPACING+this.HEIGHT,(u=this.zoomOutGroup)==null||u.setAttribute("transform","translate(0, "+g+")")}this.top=t.top,this.left=t.left;var I;(I=this.svgGroup)==null||I.setAttribute("transform","translate("+this.left+","+this.top+")")}}createZoomOutSvg(e){this.zoomOutGroup=ie(J.G,{class:"blocklyZoom blocklyZoomOut"},this.svgGroup);const t=ie(J.CLIPPATH,{id:"blocklyZoomoutClipPath"+e},this.zoomOutGroup);ie(J.RECT,{width:32,height:32},t),ie(J.IMAGE,{width:Wt.width,height:Wt.height,x:-64,y:-92,"clip-path":"url(#blocklyZoomoutClipPath"+e+")"},this.zoomOutGroup).setAttributeNS(is,"xlink:href",this.workspace.options.pathToMedia+Wt.url),this.boundEvents.push(H(this.zoomOutGroup,"pointerdown",null,this.zoom.bind(this,-1)))}createZoomInSvg(e){this.zoomInGroup=ie(J.G,{class:"blocklyZoom blocklyZoomIn"},this.svgGroup);const t=ie(J.CLIPPATH,{id:"blocklyZoominClipPath"+e},this.zoomInGroup);ie(J.RECT,{width:32,height:32},t),ie(J.IMAGE,{width:Wt.width,height:Wt.height,x:-32,y:-92,"clip-path":"url(#blocklyZoominClipPath"+e+")"},this.zoomInGroup).setAttributeNS(is,"xlink:href",this.workspace.options.pathToMedia+Wt.url),this.boundEvents.push(H(this.zoomInGroup,"pointerdown",null,this.zoom.bind(this,1)))}zoom(e,t){this.workspace.markFocused(),this.workspace.zoomCenter(e),this.fireZoomEvent(),Y(),t.stopPropagation(),t.preventDefault()}createZoomResetSvg(e){this.zoomResetGroup=ie(J.G,{class:"blocklyZoom blocklyZoomReset"},this.svgGroup);const t=ie(J.CLIPPATH,{id:"blocklyZoomresetClipPath"+e},this.zoomResetGroup);ie(J.RECT,{width:32,height:32},t),ie(J.IMAGE,{width:Wt.width,height:Wt.height,y:-92,"clip-path":"url(#blocklyZoomresetClipPath"+e+")"},this.zoomResetGroup).setAttributeNS(is,"xlink:href",this.workspace.options.pathToMedia+Wt.url),this.boundEvents.push(H(this.zoomResetGroup,"pointerdown",null,this.resetZoom.bind(this)))}resetZoom(e){this.workspace.markFocused();const t=Math.log(this.workspace.options.zoomOptions.startScale/this.workspace.scale)/Math.log(this.workspace.options.zoomOptions.scaleSpeed);this.workspace.beginCanvasTransition(),this.workspace.zoomCenter(t),this.workspace.scrollCenter(),setTimeout(this.workspace.endCanvasTransition.bind(this.workspace),500),this.fireZoomEvent(),Y(),e.stopPropagation(),e.preventDefault()}fireZoomEvent(){const e=new(ne(ee.CLICK))(null,this.workspace.id,"zoom_controls");z(e)}};Be(` .blocklyZoom>image, .blocklyZoom>svg>image { opacity: .4; } @@ -731,11 +731,11 @@ input[type=number] { .blocklyZoom>image:active, .blocklyZoom>svg>image:active { opacity: .8; } -`);var Ub=100,Hb=75,Wb=50,Gb=25,UC={BLOCKS:Wb,PROCEDURES:Hb,VARIABLES:Ub,WORKSPACE_COMMENTS:Gb},Dh={};Dh.register=Vn,Dh.unregister=Qm;var Vb=class{constructor(){this.priority=Gb}save(e){const t=[];for(const o of e.getTopComments())(e=Pi(o,{addCoordinates:!0,saveIds:!0}))&&t.push(e);return t.length?t:null}load(e,t){for(const o of e)Kn(o,t,{recordUndo:G()})}clear(e){for(const t of e.getTopComments())t.dispose()}};Vn("workspaceComments",new Vb);var hl={};hl.WorkspaceCommentSerializer=Vb,hl.append=Kn,hl.save=Pi;var Ah={};Ah.register=Ca,Ah.unregister=ef;var pl=class{paste(e,t,o){e=e.commentState,o&&(e.x=o.x,e.y=o.y),i.disable$$module$build$src$core$events$utils();let n;try{n=Kn(e,t),tf(n)}finally{i.enable$$module$build$src$core$events$utils()}return n?(C()&&z(new(ne(ee.COMMENT_CREATE))(n)),i.setSelected$$module$build$src$core$common(n),n):null}};pl.TYPE="workspace-comment",Ca(pl.TYPE,new pl);var Oh;Oh=28,i.config$$module$build$src$core$config={dragRadius:5,flyoutDragRadius:10,snapRadius:Oh,connectingSnapRadius:Oh,currentConnectionPreference:8,bumpDelay:250},i.config$$module$build$src$core$config;var HC="aria-",WC="role",Is;(function(e){e.GRID="grid",e.GRIDCELL="gridcell",e.GROUP="group",e.LISTBOX="listbox",e.MENU="menu",e.MENUITEM="menuitem",e.MENUITEMCHECKBOX="menuitemcheckbox",e.OPTION="option",e.PRESENTATION="presentation",e.ROW="row",e.TREE="tree",e.TREEITEM="treeitem"})(Is||(Is={}));var Et;(function(e){e.ACTIVEDESCENDANT="activedescendant",e.COLCOUNT="colcount",e.DISABLED="disabled",e.EXPANDED="expanded",e.INVALID="invalid",e.LABEL="label",e.LABELLEDBY="labelledby",e.LEVEL="level",e.ORIENTATION="orientation",e.POSINSET="posinset",e.ROWCOUNT="rowcount",e.SELECTED="selected",e.SETSIZE="setsize",e.VALUEMAX="valuemax",e.VALUEMIN="valuemin"})(Et||(Et={}));var fr={};fr.Role=Is,fr.State=Et,fr.setRole=Do,fr.setState=xt;var Rh=class{constructor(){this.menuItems=[],this.roleName=this.element=this.onKeyDownHandler=this.pointerLeaveHandler=this.pointerEnterHandler=this.clickHandler=this.pointerMoveHandler=this.highlightedItem=this.openingCoords=null}addChild(e){this.menuItems.push(e)}render(e){const t=document.createElement("div");t.className="blocklyMenu goog-menu blocklyNonSelectable",t.tabIndex=0,this.roleName&&Do(t,this.roleName),this.element=t;for(let o=0,n;n=this.menuItems[o];o++)t.appendChild(n.createDom());return this.pointerMoveHandler=H(t,"pointermove",this,this.handlePointerMove,!0),this.clickHandler=H(t,"pointerup",this,this.handleClick,!0),this.pointerEnterHandler=H(t,"pointerenter",this,this.handlePointerEnter,!0),this.pointerLeaveHandler=H(t,"pointerleave",this,this.handlePointerLeave,!0),this.onKeyDownHandler=H(t,"keydown",this,this.handleKeyEvent),e.appendChild(t),t}getElement(){return this.element}focus(){const e=this.getElement();e&&(e.focus({preventScroll:!0}),Oe(e,"blocklyFocused"))}blur(){const e=this.getElement();e&&(e.blur(),ze(e,"blocklyFocused"))}setRole(e){this.roleName=e}dispose(){this.pointerMoveHandler&&(V(this.pointerMoveHandler),this.pointerMoveHandler=null),this.clickHandler&&(V(this.clickHandler),this.clickHandler=null),this.pointerEnterHandler&&(V(this.pointerEnterHandler),this.pointerEnterHandler=null),this.pointerLeaveHandler&&(V(this.pointerLeaveHandler),this.pointerLeaveHandler=null),this.onKeyDownHandler&&(V(this.onKeyDownHandler),this.onKeyDownHandler=null);for(let e=0,t;t=this.menuItems[e];e++)t.dispose();this.element=null}getMenuItem(e){const t=this.getElement();for(;e&&e!==t;){if(e.classList.contains("blocklyMenuItem")){for(let o=0,n;n=this.menuItems[o];o++)if(n.getElement()===e)return n}e=e.parentElement}return null}setHighlighted(e){var t=this.highlightedItem;if(t&&(t.setHighlighted(!1),this.highlightedItem=null),e){e.setHighlighted(!0),this.highlightedItem=e,t=this.getElement();const o=t==null?void 0:t.parentElement,n=e.getElement();o&&n&&(ma(n,o),xt(t,Et.ACTIVEDESCENDANT,e.getId()))}}highlightNext(){const e=this.highlightedItem?this.menuItems.indexOf(this.highlightedItem):-1;this.highlightHelper(e,1)}highlightPrevious(){const e=this.highlightedItem?this.menuItems.indexOf(this.highlightedItem):-1;this.highlightHelper(0>e?this.menuItems.length:e,-1)}highlightFirst(){this.highlightHelper(-1,1)}highlightLast(){this.highlightHelper(this.menuItems.length,-1)}highlightHelper(e,t){e+=t;let o;for(;o=this.menuItems[e];){if(o.isEnabled()){this.setHighlighted(o);break}e+=t}}handlePointerMove(e){Math.max(Math.abs(e.movementX),Math.abs(e.movementY))!==0&&(e=this.getMenuItem(e.target))&&(e.isEnabled()?this.highlightedItem!==e&&this.setHighlighted(e):this.setHighlighted(null))}handleClick(e){const t=this.openingCoords;if(this.openingCoords=null,t&&typeof e.clientX=="number"){const o=new ye(e.clientX,e.clientY);if(1>ye.distance(t,o))return}(e=this.getMenuItem(e.target))&&e.performAction()}handlePointerEnter(e){this.focus()}handlePointerLeave(e){this.getElement()&&this.setHighlighted(null)}handleKeyEvent(e){if(this.menuItems.length&&!(e.shiftKey||e.ctrlKey||e.metaKey||e.altKey)){var t=this.highlightedItem;switch(e.key){case"Enter":case" ":t&&t.performAction();break;case"ArrowUp":this.highlightPrevious();break;case"ArrowDown":this.highlightNext();break;case"PageUp":case"Home":this.highlightFirst();break;case"PageDown":case"End":this.highlightLast();break;default:return}e.preventDefault(),e.stopPropagation()}}getSize(){const e=this.getElement(),t=Hn(e);return t.height=e.scrollHeight,t}},Nh=class{constructor(e,t){this.content=e,this.opt_value=t,this.enabled=!0,this.element=null,this.rightToLeft=!1,this.roleName=null,this.highlight=this.checked=this.checkable=!1,this.actionHandler=null}createDom(){const e=document.createElement("div");e.id=v(),this.element=e,e.className="blocklyMenuItem goog-menuitem "+(this.enabled?"":"blocklyMenuItemDisabled goog-menuitem-disabled ")+(this.checked?"blocklyMenuItemSelected goog-option-selected ":"")+(this.highlight?"blocklyMenuItemHighlight goog-menuitem-highlight ":"")+(this.rightToLeft?"blocklyMenuItemRtl goog-menuitem-rtl ":"");const t=document.createElement("div");if(t.className="blocklyMenuItemContent goog-menuitem-content",this.checkable){var o=document.createElement("div");o.className="blocklyMenuItemCheckbox goog-menuitem-checkbox",t.appendChild(o)}return o=this.content,typeof this.content=="string"&&(o=document.createTextNode(this.content)),t.appendChild(o),e.appendChild(t),this.roleName&&Do(e,this.roleName),xt(e,Et.SELECTED,this.checkable&&this.checked||!1),xt(e,Et.DISABLED,!this.enabled),e}dispose(){this.element=null}getElement(){return this.element}getId(){return this.element.id}getValue(){let e;return(e=this.opt_value)!=null?e:null}setRightToLeft(e){this.rightToLeft=e}setRole(e){this.roleName=e}setCheckable(e){this.checkable=e}setChecked(e){this.checked=e}setHighlighted(e){this.highlight=e;const t=this.getElement();t&&this.isEnabled()&&(e?(Oe(t,"blocklyMenuItemHighlight"),Oe(t,"goog-menuitem-highlight")):(ze(t,"blocklyMenuItemHighlight"),ze(t,"goog-menuitem-highlight")))}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}performAction(){this.isEnabled()&&this.actionHandler&&this.actionHandler(this)}onAction(e,t){this.actionHandler=e.bind(t)}},$r="_TEMP_COLLAPSED_INPUT",gl="_TEMP_COLLAPSED_FIELD",Gt="MANUALLY_DISABLED",GC={COLLAPSED_FIELD_NAME:gl,COLLAPSED_INPUT_NAME:$r,MANUALLY_DISABLED:Gt};(function(e){e[e.VALUE=1]="VALUE",e[e.STATEMENT=3]="STATEMENT",e[e.DUMMY=5]="DUMMY",e[e.CUSTOM=6]="CUSTOM",e[e.END_ROW=7]="END_ROW"})(i.inputTypes$$module$build$src$core$inputs$input_types||(i.inputTypes$$module$build$src$core$inputs$input_types={})),i.inputTypes$$module$build$src$core$inputs$input_types;var ml=new Set,Mh=new WeakSet,Lh=new WeakMap,Qi=null,Ph=null,Kb=0,fl={};fl.finishQueuedRenders=Ts,fl.queueRender=_u,fl.triggerQueuedRenders=ao;var Yb=function(e,t){window.alert(e),t&&t()},Jb=function(e,t){t(window.confirm(e))},qb=function(e,t,o){o(window.prompt(e,t))},Xb={confirmInternal:af},hi={TEST_ONLY:Xb};hi.alert=Jn,hi.confirm=Sa,hi.prompt=Ea,hi.setAlert=rf,hi.setConfirm=lf,hi.setPrompt=cf;var Bh,Zb;i.Msg$$module$build$src$core$msg=Object.create(null),Bh=function(e){Object.keys(e).forEach(function(t){i.Msg$$module$build$src$core$msg[t]=e[t]})},Zb={Msg:i.Msg$$module$build$src$core$msg,setLocale:Bh};var br=class extends qi{constructor(e){super(),this.isBlank=typeof e>"u",e&&(this.varId=e.getId(),this.workspaceId=e.workspace.id)}toJson(){const e=super.toJson();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");return e.varId=this.varId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new br),t.varId=e.varId,t}},Fh=class extends br{constructor(e){super(e),this.type=ee.VAR_CREATE,e&&(this.varType=e.type,this.varName=e.name)}toJson(){const e=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");return e.varType=this.varType,e.varName=this.varName,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Fh),t.varType=e.varType,t.varName=e.varName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");e?t.createVariable(this.varName,this.varType,this.varId):t.deleteVariableById(this.varId)}};r($e.EVENT,ee.VAR_CREATE,Fh);var vr=class{constructor(e,t,o,n){this.workspace=e,this.name=t,this.type=o||"",this.id=n||_()}getId(){return this.id}static compareByName(e,t){return e.name.localeCompare(t.name,void 0,{sensitivity:"base"})}},jh="VARIABLE",zh="ijkmnopqrstuvwxyzabcdefgh",Qb={generateUniqueNameInternal:df},Rt={CATEGORY_NAME:jh,TEST_ONLY:Qb,VAR_LETTER_OPTIONS:zh};Rt.allDeveloperVariables=i.allDeveloperVariables$$module$build$src$core$variables,Rt.allUsedVarModels=i.allUsedVarModels$$module$build$src$core$variables,Rt.createVariableButtonHandler=Fi,Rt.flyoutCategory=Ia,Rt.flyoutCategoryBlocks=Su,Rt.generateUniqueName=Eu,Rt.generateUniqueNameFromOptions=xa,Rt.generateVariableFieldDom=ei,Rt.getAddedVariables=qn,Rt.getOrCreateVariablePackage=i.getOrCreateVariablePackage$$module$build$src$core$variables,Rt.getVariable=i.getVariable$$module$build$src$core$variables,Rt.nameUsedWithAnyType=Iu,Rt.nameUsedWithConflictingParam=xu,Rt.promptName=Da,Rt.renameVariable=i.renameVariable$$module$build$src$core$variables;var en=class extends Error{},ev=class extends en{constructor(e){super("Expected to find a 'type' property, defining the block type"),this.state=e}},yr=class extends en{constructor(e,t,o){super(`The block ${t.toDevString()} is missing a(n) ${e} -connection`),this.block=t,this.state=o}},tv=class extends en{constructor(e,t,o,n){super(`The block ${o.toDevString()} could not connect its -${t} to its parent, because: ${e}`),this.childBlock=o,this.childState=n}},sv=class extends en{constructor(e){super(`Encountered a real block which is defined as a child of a shadow +`);var Wb=100,Gb=75,Vb=50,Kb=25,UC={BLOCKS:Vb,PROCEDURES:Gb,VARIABLES:Wb,WORKSPACE_COMMENTS:Kb},Dh={};Dh.register=Vn,Dh.unregister=tf;var Yb=class{constructor(){this.priority=Kb}save(e){const t=[];for(const o of e.getTopComments())(e=Pi(o,{addCoordinates:!0,saveIds:!0}))&&t.push(e);return t.length?t:null}load(e,t){for(const o of e)Kn(o,t,{recordUndo:G()})}clear(e){for(const t of e.getTopComments())t.dispose()}};Vn("workspaceComments",new Yb);var hl={};hl.WorkspaceCommentSerializer=Yb,hl.append=Kn,hl.save=Pi;var Ah={};Ah.register=Ca,Ah.unregister=sf;var pl=class{paste(e,t,o){e=e.commentState,o&&(e.x=o.x,e.y=o.y),i.disable$$module$build$src$core$events$utils();let n;try{n=Kn(e,t),of(n)}finally{i.enable$$module$build$src$core$events$utils()}return n?(C()&&z(new(ne(ee.COMMENT_CREATE))(n)),i.setSelected$$module$build$src$core$common(n),n):null}};pl.TYPE="workspace-comment",Ca(pl.TYPE,new pl);var Oh;Oh=28,i.config$$module$build$src$core$config={dragRadius:5,flyoutDragRadius:10,snapRadius:Oh,connectingSnapRadius:Oh,currentConnectionPreference:8,bumpDelay:250},i.config$$module$build$src$core$config;var HC="aria-",WC="role",Is;(function(e){e.GRID="grid",e.GRIDCELL="gridcell",e.GROUP="group",e.LISTBOX="listbox",e.MENU="menu",e.MENUITEM="menuitem",e.MENUITEMCHECKBOX="menuitemcheckbox",e.OPTION="option",e.PRESENTATION="presentation",e.ROW="row",e.TREE="tree",e.TREEITEM="treeitem"})(Is||(Is={}));var Et;(function(e){e.ACTIVEDESCENDANT="activedescendant",e.COLCOUNT="colcount",e.DISABLED="disabled",e.EXPANDED="expanded",e.INVALID="invalid",e.LABEL="label",e.LABELLEDBY="labelledby",e.LEVEL="level",e.ORIENTATION="orientation",e.POSINSET="posinset",e.ROWCOUNT="rowcount",e.SELECTED="selected",e.SETSIZE="setsize",e.VALUEMAX="valuemax",e.VALUEMIN="valuemin"})(Et||(Et={}));var fr={};fr.Role=Is,fr.State=Et,fr.setRole=Do,fr.setState=xt;var Rh=class{constructor(){this.menuItems=[],this.roleName=this.element=this.onKeyDownHandler=this.pointerLeaveHandler=this.pointerEnterHandler=this.clickHandler=this.pointerMoveHandler=this.highlightedItem=this.openingCoords=null}addChild(e){this.menuItems.push(e)}render(e){const t=document.createElement("div");t.className="blocklyMenu goog-menu blocklyNonSelectable",t.tabIndex=0,this.roleName&&Do(t,this.roleName),this.element=t;for(let o=0,n;n=this.menuItems[o];o++)t.appendChild(n.createDom());return this.pointerMoveHandler=H(t,"pointermove",this,this.handlePointerMove,!0),this.clickHandler=H(t,"pointerup",this,this.handleClick,!0),this.pointerEnterHandler=H(t,"pointerenter",this,this.handlePointerEnter,!0),this.pointerLeaveHandler=H(t,"pointerleave",this,this.handlePointerLeave,!0),this.onKeyDownHandler=H(t,"keydown",this,this.handleKeyEvent),e.appendChild(t),t}getElement(){return this.element}focus(){const e=this.getElement();e&&(e.focus({preventScroll:!0}),Oe(e,"blocklyFocused"))}blur(){const e=this.getElement();e&&(e.blur(),ze(e,"blocklyFocused"))}setRole(e){this.roleName=e}dispose(){this.pointerMoveHandler&&(V(this.pointerMoveHandler),this.pointerMoveHandler=null),this.clickHandler&&(V(this.clickHandler),this.clickHandler=null),this.pointerEnterHandler&&(V(this.pointerEnterHandler),this.pointerEnterHandler=null),this.pointerLeaveHandler&&(V(this.pointerLeaveHandler),this.pointerLeaveHandler=null),this.onKeyDownHandler&&(V(this.onKeyDownHandler),this.onKeyDownHandler=null);for(let e=0,t;t=this.menuItems[e];e++)t.dispose();this.element=null}getMenuItem(e){const t=this.getElement();for(;e&&e!==t;){if(e.classList.contains("blocklyMenuItem")){for(let o=0,n;n=this.menuItems[o];o++)if(n.getElement()===e)return n}e=e.parentElement}return null}setHighlighted(e){var t=this.highlightedItem;if(t&&(t.setHighlighted(!1),this.highlightedItem=null),e){e.setHighlighted(!0),this.highlightedItem=e,t=this.getElement();const o=t==null?void 0:t.parentElement,n=e.getElement();o&&n&&(ma(n,o),xt(t,Et.ACTIVEDESCENDANT,e.getId()))}}highlightNext(){const e=this.highlightedItem?this.menuItems.indexOf(this.highlightedItem):-1;this.highlightHelper(e,1)}highlightPrevious(){const e=this.highlightedItem?this.menuItems.indexOf(this.highlightedItem):-1;this.highlightHelper(0>e?this.menuItems.length:e,-1)}highlightFirst(){this.highlightHelper(-1,1)}highlightLast(){this.highlightHelper(this.menuItems.length,-1)}highlightHelper(e,t){e+=t;let o;for(;o=this.menuItems[e];){if(o.isEnabled()){this.setHighlighted(o);break}e+=t}}handlePointerMove(e){Math.max(Math.abs(e.movementX),Math.abs(e.movementY))!==0&&(e=this.getMenuItem(e.target))&&(e.isEnabled()?this.highlightedItem!==e&&this.setHighlighted(e):this.setHighlighted(null))}handleClick(e){const t=this.openingCoords;if(this.openingCoords=null,t&&typeof e.clientX=="number"){const o=new ye(e.clientX,e.clientY);if(1>ye.distance(t,o))return}(e=this.getMenuItem(e.target))&&e.performAction()}handlePointerEnter(e){this.focus()}handlePointerLeave(e){this.getElement()&&this.setHighlighted(null)}handleKeyEvent(e){if(this.menuItems.length&&!(e.shiftKey||e.ctrlKey||e.metaKey||e.altKey)){var t=this.highlightedItem;switch(e.key){case"Enter":case" ":t&&t.performAction();break;case"ArrowUp":this.highlightPrevious();break;case"ArrowDown":this.highlightNext();break;case"PageUp":case"Home":this.highlightFirst();break;case"PageDown":case"End":this.highlightLast();break;default:return}e.preventDefault(),e.stopPropagation()}}getSize(){const e=this.getElement(),t=Hn(e);return t.height=e.scrollHeight,t}},Nh=class{constructor(e,t){this.content=e,this.opt_value=t,this.enabled=!0,this.element=null,this.rightToLeft=!1,this.roleName=null,this.highlight=this.checked=this.checkable=!1,this.actionHandler=null}createDom(){const e=document.createElement("div");e.id=v(),this.element=e,e.className="blocklyMenuItem goog-menuitem "+(this.enabled?"":"blocklyMenuItemDisabled goog-menuitem-disabled ")+(this.checked?"blocklyMenuItemSelected goog-option-selected ":"")+(this.highlight?"blocklyMenuItemHighlight goog-menuitem-highlight ":"")+(this.rightToLeft?"blocklyMenuItemRtl goog-menuitem-rtl ":"");const t=document.createElement("div");if(t.className="blocklyMenuItemContent goog-menuitem-content",this.checkable){var o=document.createElement("div");o.className="blocklyMenuItemCheckbox goog-menuitem-checkbox",t.appendChild(o)}return o=this.content,typeof this.content=="string"&&(o=document.createTextNode(this.content)),t.appendChild(o),e.appendChild(t),this.roleName&&Do(e,this.roleName),xt(e,Et.SELECTED,this.checkable&&this.checked||!1),xt(e,Et.DISABLED,!this.enabled),e}dispose(){this.element=null}getElement(){return this.element}getId(){return this.element.id}getValue(){let e;return(e=this.opt_value)!=null?e:null}setRightToLeft(e){this.rightToLeft=e}setRole(e){this.roleName=e}setCheckable(e){this.checkable=e}setChecked(e){this.checked=e}setHighlighted(e){this.highlight=e;const t=this.getElement();t&&this.isEnabled()&&(e?(Oe(t,"blocklyMenuItemHighlight"),Oe(t,"goog-menuitem-highlight")):(ze(t,"blocklyMenuItemHighlight"),ze(t,"goog-menuitem-highlight")))}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}performAction(){this.isEnabled()&&this.actionHandler&&this.actionHandler(this)}onAction(e,t){this.actionHandler=e.bind(t)}},$r="_TEMP_COLLAPSED_INPUT",gl="_TEMP_COLLAPSED_FIELD",Gt="MANUALLY_DISABLED",GC={COLLAPSED_FIELD_NAME:gl,COLLAPSED_INPUT_NAME:$r,MANUALLY_DISABLED:Gt};(function(e){e[e.VALUE=1]="VALUE",e[e.STATEMENT=3]="STATEMENT",e[e.DUMMY=5]="DUMMY",e[e.CUSTOM=6]="CUSTOM",e[e.END_ROW=7]="END_ROW"})(i.inputTypes$$module$build$src$core$inputs$input_types||(i.inputTypes$$module$build$src$core$inputs$input_types={})),i.inputTypes$$module$build$src$core$inputs$input_types;var ml=new Set,Mh=new WeakSet,Lh=new WeakMap,Qi=null,Ph=null,Jb=0,fl={};fl.finishQueuedRenders=Ts,fl.queueRender=_u,fl.triggerQueuedRenders=ao;var qb=function(e,t){window.alert(e),t&&t()},Xb=function(e,t){t(window.confirm(e))},Zb=function(e,t,o){o(window.prompt(e,t))},Qb={confirmInternal:cf},hi={TEST_ONLY:Qb};hi.alert=Jn,hi.confirm=Sa,hi.prompt=Ea,hi.setAlert=lf,hi.setConfirm=uf,hi.setPrompt=df;var Bh,ev;i.Msg$$module$build$src$core$msg=Object.create(null),Bh=function(e){Object.keys(e).forEach(function(t){i.Msg$$module$build$src$core$msg[t]=e[t]})},ev={Msg:i.Msg$$module$build$src$core$msg,setLocale:Bh};var br=class extends qi{constructor(e){super(),this.isBlank=typeof e>"u",e&&(this.varId=e.getId(),this.workspaceId=e.workspace.id)}toJson(){const e=super.toJson();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");return e.varId=this.varId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new br),t.varId=e.varId,t}},Fh=class extends br{constructor(e){super(e),this.type=ee.VAR_CREATE,e&&(this.varType=e.type,this.varName=e.name)}toJson(){const e=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");return e.varType=this.varType,e.varName=this.varName,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Fh),t.varType=e.varType,t.varName=e.varName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");e?t.createVariable(this.varName,this.varType,this.varId):t.deleteVariableById(this.varId)}};r($e.EVENT,ee.VAR_CREATE,Fh);var vr=class{constructor(e,t,o,n){this.workspace=e,this.name=t,this.type=o||"",this.id=n||_()}getId(){return this.id}static compareByName(e,t){return e.name.localeCompare(t.name,void 0,{sensitivity:"base"})}},jh="VARIABLE",zh="ijkmnopqrstuvwxyzabcdefgh",tv={generateUniqueNameInternal:pf},Rt={CATEGORY_NAME:jh,TEST_ONLY:tv,VAR_LETTER_OPTIONS:zh};Rt.allDeveloperVariables=i.allDeveloperVariables$$module$build$src$core$variables,Rt.allUsedVarModels=i.allUsedVarModels$$module$build$src$core$variables,Rt.createVariableButtonHandler=Fi,Rt.flyoutCategory=Ia,Rt.flyoutCategoryBlocks=Su,Rt.generateUniqueName=Eu,Rt.generateUniqueNameFromOptions=xa,Rt.generateVariableFieldDom=ei,Rt.getAddedVariables=qn,Rt.getOrCreateVariablePackage=i.getOrCreateVariablePackage$$module$build$src$core$variables,Rt.getVariable=i.getVariable$$module$build$src$core$variables,Rt.nameUsedWithAnyType=Iu,Rt.nameUsedWithConflictingParam=xu,Rt.promptName=Da,Rt.renameVariable=i.renameVariable$$module$build$src$core$variables;var en=class extends Error{},sv=class extends en{constructor(e){super("Expected to find a 'type' property, defining the block type"),this.state=e}},yr=class extends en{constructor(e,t,o){super(`The block ${t.toDevString()} is missing a(n) ${e} +connection`),this.block=t,this.state=o}},ov=class extends en{constructor(e,t,o,n){super(`The block ${o.toDevString()} could not connect its +${t} to its parent, because: ${e}`),this.childBlock=o,this.childState=n}},iv=class extends en{constructor(e){super(`Encountered a real block which is defined as a child of a shadow block. It is an invariant of Blockly that shadow blocks only have shadow -children`),this.state=e}},ov=class extends en{constructor(e,t,o){super(`Cannot add an icon of type '${e}' to the block ${t.toDevString()}, because there is no icon registered with type '${e}'. Make sure that all of your icons have been registered.`),this.block=t,this.state=o}},pi={};pi.BadConnectionCheck=tv,pi.DeserializationError=en,pi.MissingBlockType=ev,pi.MissingConnection=yr,pi.RealChildOfShadow=sv,pi.UnregisteredIcon=ov;var iv=class{constructor(){this.priority=Wb}save(e){const t=[];for(const o of e.getTopBlocks(!1))(e=os(o,{addCoordinates:!0,doFullSerialization:!1}))&&t.push(e);return t.length?{languageVersion:0,blocks:t}:null}load(e,t){e=e.blocks;for(const o of e)lo(o,t,{recordUndo:G()})}clear(e){for(const t of e.getTopBlocks(!1))t.dispose(!1)}};Vn("blocks",new iv);var _r={};_r.BlockSerializer=iv,_r.append=lo,_r.appendInternal=ji,_r.save=os;var Ct=class{constructor(e){this.name=e}toString(){return this.name}equals(e){return this.name===e.toString()}};Ct.MUTATOR=new Ct("mutator"),Ct.WARNING=new Ct("warning"),Ct.COMMENT=new Ct("comment");var gi=class extends qi{constructor(e){super(),this.isBlank=!e,e&&(this.blockId=e.id,this.workspaceId=e.workspace.id)}toJson(){const e=super.toJson();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");return e.blockId=this.blockId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new gi),t.blockId=e.blockId,t}},mi=class extends gi{constructor(e,t,o,n,u){super(e),this.type=ee.BLOCK_CHANGE,e&&(this.element=t,this.name=o||void 0,this.oldValue=n,this.newValue=u)}toJson(){const e=super.toJson();if(!this.element)throw Error("The changed element is undefined. Either pass an element to the constructor, or call fromJson");return e.element=this.element,e.name=this.name,e.oldValue=this.oldValue,e.newValue=this.newValue,this.disabledReason&&(e.disabledReason=this.disabledReason),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new mi),t.element=e.element,t.name=e.name,t.oldValue=e.oldValue,t.newValue=e.newValue,e.disabledReason!==void 0&&(t.disabledReason=e.disabledReason),t}setDisabledReason(e){if(this.element!=="disabled")throw Error('Cannot set the disabled reason for a BlockChange event if the element is not "disabled".');this.disabledReason=e}isNull(){return this.oldValue===this.newValue}run(e){var t=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");if(t=t.getBlockById(this.blockId),!t)throw Error("The associated block is undefined. Either pass a block to the constructor, or call fromJson");const o=t.getIcon(Ct.MUTATOR);switch(o&&zi(o)&&o.bubbleIsVisible()&&o.setBubbleVisible(!1),e=e?this.newValue:this.oldValue,this.element){case"field":(t=t.getField(this.name))?t.setValue(e):console.warn("Can't set non-existent field: "+this.name);break;case"comment":t.setCommentText(e||null);break;case"collapsed":t.setCollapsed(!!e);break;case"disabled":var n;t.setDisabledReason(!!e,(n=this.disabledReason)!=null?n:Gt);break;case"inline":t.setInputsInline(!!e);break;case"mutation":n=mi.getExtraBlockState_(t),t.loadExtraState?t.loadExtraState(JSON.parse(e||"{}")):t.domToMutation&&t.domToMutation(i.textToDom$$module$build$src$core$utils$xml(e||"")),z(new mi(t,"mutation",null,n,e));break;default:console.warn("Unknown change type: "+this.element)}}static getExtraBlockState_(e){return e.saveExtraState?(e=e.saveExtraState(!0))?JSON.stringify(e):"":e.mutationToDom&&(e=e.mutationToDom())?zs(e):""}};r($e.EVENT,ee.BLOCK_CHANGE,mi);var $l={};$l.clamp=Ui,$l.toDegrees=Rf,$l.toRadians=Aa;var bl=16,nv=1,rv=12,Uh=16,vl=.25,Hh=null,fi=null,tn="",sn="",tt,on,$i,Wh=null,Bo=null,av=null,Gh={getBoundsInfo:function(){const e=xo(Wh),t=Hn(Wh);return{left:e.x,right:e.x+t.width,top:e.y,bottom:e.y+t.height,width:t.width,height:t.height}},getPositionMetrics:function(e,t,o,n){const u=Gh.getBoundsInfo(),g=Hn(tt);return t+g.heightu.top?Hu(o,n,u,g):t+g.heightdocument.documentElement.clientTop?Hu(o,n,u,g):Mf(e,u,g)}},Bt={ANIMATION_TIME:vl,ARROW_HORIZONTAL_PADDING:rv,ARROW_SIZE:bl,BORDER_SIZE:nv,PADDING_Y:Uh,TEST_ONLY:Gh};Bt.clearContent=Oa,Bt.createDom=Ru,Bt.getContentDiv=Xn,Bt.getOwner=Mu,Bt.getPositionX=Zn,Bt.hide=Na,Bt.hideIfOwner=Ra,Bt.hideWithoutAnimation=js,Bt.isVisible=Wu,Bt.repositionForWindowResize=Vu,Bt.setBoundsElement=Nu,Bt.setColour=Lu,Bt.show=zu,Bt.showPositionedByBlock=Nf,Bt.showPositionedByField=Pu;var wr=class{constructor(e){this.workspace=e,this.cursorSvg=this.cursor=null,this.markers=new Map,this.markerSvg=null}registerMarker(e,t){this.markers.has(e)&&this.unregisterMarker(e),t.setDrawer(this.workspace.getRenderer().makeMarkerDrawer(this.workspace,t)),this.setMarkerSvg(t.getDrawer().createDom()),this.markers.set(e,t)}unregisterMarker(e){const t=this.markers.get(e);if(t)t.dispose(),this.markers.delete(e);else throw Error("Marker with ID "+e+" does not exist. Can only unregister markers that exist.")}getCursor(){return this.cursor}getMarker(e){return this.markers.get(e)||null}setCursor(e){this.cursor&&this.cursor.getDrawer()&&this.cursor.getDrawer().dispose(),(this.cursor=e)&&(e=this.workspace.getRenderer().makeMarkerDrawer(this.workspace,this.cursor),this.cursor.setDrawer(e),this.setCursorSvg(this.cursor.getDrawer().createDom()))}setCursorSvg(e){e?(this.workspace.getBlockCanvas().appendChild(e),this.cursorSvg=e):this.cursorSvg=null}setMarkerSvg(e){e?this.workspace.getBlockCanvas()&&(this.cursorSvg?this.workspace.getBlockCanvas().insertBefore(e,this.cursorSvg):this.workspace.getBlockCanvas().appendChild(e)):this.markerSvg=null}updateMarkers(){this.workspace.keyboardAccessibilityMode&&this.cursorSvg&&this.workspace.getCursor().draw()}dispose(){const e=Object.keys(this.markers);for(let t=0,o;o=e[t];t++)this.unregisterMarker(o);this.markers.clear(),this.cursor&&(this.cursor.dispose(),this.cursor=null)}};wr.LOCAL_MARKER="local_marker_1";var nn={};nn.commonWordPrefix=Ku,nn.commonWordSuffix=Yu,nn.isNumber=i.isNumber$$module$build$src$core$utils$string,nn.shortestStringLength=Qn,nn.wrap=i.wrap$$module$build$src$core$utils$string;var yl=void 0,kr=!1,rn=!1,lv=50,cv=0,bi=0,Vh=0,Kh=0,hs=null,Cr=null,Yh=0,Jh=10,uv=10,dv=750,_l=5,Tt=null,ns={HOVER_MS:dv,LIMIT:lv,MARGINS:_l,OFFSET_X:Yh,OFFSET_Y:Jh,RADIUS_OK:uv};ns.bindMouseEvents=Wi,ns.block=ed,ns.createDom=Xu,ns.dispose=Qu,ns.getCustomTooltip=Ff,ns.getDiv=zf,ns.getTooltipOfObject=Hi,ns.hide=co,ns.isVisible=jf,ns.setCustomTooltip=Bf,ns.unbindMouseEvents=La,ns.unblock=td;var qh=.45,Xh=.65,hv={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00"},ps={};ps.blend=si,ps.getHsvSaturation=sd,ps.getHsvValue=od,ps.hexToRgb=Pa,ps.hsvToHex=Ba,ps.hueToHex=id,ps.names=hv,ps.parse=ti,ps.rgbToHex=er,ps.setHsvSaturation=Yf,ps.setHsvValue=Jf;var Tr={};Tr.checkMessageReferences=qf,Tr.parseBlockColour=Gi,Tr.replaceMessageReferences=bt,Tr.tokenizeInterpolation=nd;var lt=class{constructor(e,t,o){this.DEFAULT_VALUE=null,this.name=void 0,this.constants_=this.mouseDownWrapper=this.textContent_=this.textElement_=this.borderRect_=this.fieldGroup_=this.markerSvg=this.cursorSvg=this.tooltip=this.validator_=null,this.disposed=!1,this.maxDisplayLength=50,this.sourceBlock_=null,this.enabled_=this.visible_=this.isDirty_=!0,this.suffixField=this.prefixField=this.clickTarget_=null,this.EDITABLE=!0,this.SERIALIZABLE=!1,this.CURSOR="",this.value_="DEFAULT_VALUE"in new.target.prototype?new.target.prototype.DEFAULT_VALUE:this.DEFAULT_VALUE,this.size_=new Xe(0,0),e!==lt.SKIP_SETUP&&(o&&this.configure_(o),this.setValue(e),t&&this.setValidator(t))}configure_(e){e.tooltip&&this.setTooltip(bt(e.tooltip))}setSourceBlock(e){if(this.sourceBlock_)throw Error("Field already bound to a block");this.sourceBlock_=e}getConstants(){return!this.constants_&&this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&this.sourceBlock_.workspace.rendered&&(this.constants_=this.sourceBlock_.workspace.getRenderer().getConstants()),this.constants_}getSourceBlock(){return this.sourceBlock_}init(){this.fieldGroup_||(this.fieldGroup_=ie(J.G,{}),this.isVisible()||(this.fieldGroup_.style.display="none"),this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_),this.initView(),this.updateEditable(),this.setTooltip(this.tooltip),this.bindEvents_(),this.initModel(),this.applyColour())}initView(){this.createBorderRect_(),this.createTextElement_()}initModel(){}isFullBlockField(){return!this.borderRect_}createBorderRect_(){this.borderRect_=ie(J.RECT,{rx:this.getConstants().FIELD_BORDER_RECT_RADIUS,ry:this.getConstants().FIELD_BORDER_RECT_RADIUS,x:0,y:0,height:this.size_.height,width:this.size_.width,class:"blocklyFieldRect"},this.fieldGroup_)}createTextElement_(){this.textElement_=ie(J.TEXT,{class:"blocklyText"},this.fieldGroup_),this.getConstants().FIELD_TEXT_BASELINE_CENTER&&this.textElement_.setAttribute("dominant-baseline","central"),this.textContent_=document.createTextNode(""),this.textElement_.appendChild(this.textContent_)}bindEvents_(){const e=this.getClickTarget_();if(!e)throw Error("A click target has not been set.");Wi(e),this.mouseDownWrapper=H(e,"pointerdown",this,this.onMouseDown_)}fromXml(e){this.setValue(e.textContent)}toXml(e){return e.textContent=this.getValue(),e}saveState(e){return e=this.saveLegacyState(lt),e!==null?e:this.getValue()}loadState(e){this.loadLegacyState(lt,e)||this.setValue(e)}saveLegacyState(e){return e.prototype.saveState===this.saveState&&e.prototype.toXml!==this.toXml?(e=i.createElement$$module$build$src$core$utils$xml("field"),e.setAttribute("name",this.name||""),Li(this.toXml(e)).replace(' xmlns="https://developers.google.com/blockly/xml"',"")):null}loadLegacyState(e,t){return e.prototype.loadState===this.loadState&&e.prototype.fromXml!==this.fromXml?(this.fromXml(i.textToDom$$module$build$src$core$utils$xml(t)),!0):!1}dispose(){Ra(this),ii(this);let e;(e=this.getSourceBlock())!=null&&e.isDeadOrDying()||Ze(this.fieldGroup_),this.disposed=!0}updateEditable(){const e=this.fieldGroup_,t=this.getSourceBlock();this.EDITABLE&&e&&t&&(this.enabled_&&t.isEditable()?(Oe(e,"blocklyEditableText"),ze(e,"blocklyNonEditableText"),e.style.cursor=this.CURSOR):(Oe(e,"blocklyNonEditableText"),ze(e,"blocklyEditableText"),e.style.cursor=""))}setEnabled(e){this.enabled_=e,this.updateEditable()}isEnabled(){return this.enabled_}isClickable(){return this.enabled_&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()&&this.showEditor_!==lt.prototype.showEditor_}isClickableInFlyout(e){return!e}isCurrentlyEditable(){return this.enabled_&&this.EDITABLE&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()}isSerializable(){let e=!1;return this.name&&(this.SERIALIZABLE?e=!0:this.EDITABLE&&(console.warn("Detected an editable field that was not serializable. Please define SERIALIZABLE property as true on all editable custom fields. Proceeding with serialization."),e=!0)),e}isVisible(){return this.visible_}setVisible(e){if(this.visible_!==e){this.visible_=e;var t=this.fieldGroup_;t&&(t.style.display=e?"block":"none")}}setValidator(e){this.validator_=e}getValidator(){return this.validator_}getSvgRoot(){return this.fieldGroup_}getBorderRect(){if(!this.borderRect_)throw Error(`The border rectangle is ${this.borderRect_}.`);return this.borderRect_}getTextElement(){if(!this.textElement_)throw Error(`The text element is ${this.textElement_}.`);return this.textElement_}getTextContent(){if(!this.textContent_)throw Error(`The text content is ${this.textContent_}.`);return this.textContent_}applyColour(){}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_()}showEditor(e){this.isClickable()&&this.showEditor_(e)}showEditor_(e){}repositionForWindowResize(){return!1}updateSize_(e){const t=this.getConstants();e=e!==void 0?e:this.isFullBlockField()?0:this.getConstants().FIELD_BORDER_RECT_X_PADDING;let o=2*e,n=t.FIELD_TEXT_HEIGHT,u=0;this.textElement_&&(u=Io(this.textElement_,t.FIELD_TEXT_FONTSIZE,t.FIELD_TEXT_FONTWEIGHT,t.FIELD_TEXT_FONTFAMILY),o+=u),this.isFullBlockField()||(n=Math.max(n,t.FIELD_BORDER_RECT_HEIGHT)),this.size_.height=n,this.size_.width=o,this.positionTextElement_(e,u),this.positionBorderRect_()}positionTextElement_(e,t){if(this.textElement_){var o=this.getConstants(),n=this.size_.height/2,u;this.textElement_.setAttribute("x",String((u=this.getSourceBlock())!=null&&u.RTL?this.size_.width-t-e:e)),this.textElement_.setAttribute("y",String(o.FIELD_TEXT_BASELINE_CENTER?n:n-o.FIELD_TEXT_HEIGHT/2+o.FIELD_TEXT_BASELINE))}}positionBorderRect_(){this.borderRect_&&(this.borderRect_.setAttribute("width",String(this.size_.width)),this.borderRect_.setAttribute("height",String(this.size_.height)),this.borderRect_.setAttribute("rx",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)),this.borderRect_.setAttribute("ry",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)))}getSize(){return this.isVisible()?(this.isDirty_?(this.render_(),this.isDirty_=!1):this.visible_&&this.size_.width===0&&(this.render_(),this.size_.width!==0&&console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead.")),this.size_):new Xe(0,0)}getScaledBBox(){let e;var t=this.getSourceBlock();if(!t)throw new _t;if(this.isFullBlockField()){var o=this.sourceBlock_.getHeightWidth();const n=t.workspace.scale;e=this.getAbsoluteXY_(),t=(o.width+1)*n,o=(o.height+1)*n,xb?(e.x+=1.5*n,e.y+=1.5*n):(e.x-=.5*n,e.y-=.5*n)}else o=this.borderRect_.getBoundingClientRect(),e=xo(this.borderRect_),t=o.width,o=o.height;return new rt(e.y,e.y+o,e.x,e.x+t)}onLocationChange(e){}getDisplayText_(){let e=this.getText();return e?(e.length>this.maxDisplayLength&&(e=e.substring(0,this.maxDisplayLength-2)+"…"),e=e.replace(/\s/g,lt.NBSP),this.sourceBlock_&&this.sourceBlock_.RTL&&(e+="‏"),e):lt.NBSP}getText(){const e=this.getText_();return String(e!==null?e:this.getValue())}getText_(){return null}markDirty(){this.isDirty_=!0,this.constants_=null}forceRerender(){this.isDirty_=!0,this.sourceBlock_&&this.sourceBlock_.rendered&&this.sourceBlock_.queueRender()}setValue(e,t=!0){if(e!==null){var o=i.getGroup$$module$build$src$core$events$utils();o||i.setGroup$$module$build$src$core$events$utils(!0);try{const le=this.doClassValidation_(e),Ee=this.processValidation(e,le,t);if(!(Ee instanceof Error)){var n,u=(n=this.getValidator())==null?void 0:n.call(this,Ee),g=this.processValidation(Ee,u,t);if(!(g instanceof Error)){var I=this.sourceBlock_;if(!I||!I.disposed){var L=this.getValue();L===g?this.doValueUpdate_(g):(this.doValueUpdate_(g),t&&I&&C()&&z(new(ne(ee.BLOCK_CHANGE))(I,"field",this.name||null,L,g)),this.isDirty_&&this.forceRerender())}}}}finally{i.setGroup$$module$build$src$core$events$utils(o)}}}processValidation(e,t,o){return t===null?(this.doValueInvalid_(e,o),this.isDirty_&&this.forceRerender(),Error()):t===void 0?e:t}getValue(){return this.value_}doClassValidation_(e){return e??null}doValueUpdate_(e){this.value_=e,this.isDirty_=!0}doValueInvalid_(e,t){}onMouseDown_(e){this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&(e=this.sourceBlock_.workspace.getGesture(e))&&e.setStartField(this)}setTooltip(e){e||e===""||(e=this.sourceBlock_);const t=this.getClickTarget_();t?t.tooltip=e:this.tooltip=e}getTooltip(){const e=this.getClickTarget_();return Hi(e||{tooltip:this.tooltip})}getClickTarget_(){return this.clickTarget_||this.getSvgRoot()}getAbsoluteXY_(){return xo(this.getClickTarget_())}referencesVariables(){return!1}refreshVariableName(){}getParentInput(){let e=null;const t=this.getSourceBlock();if(!t)throw new _t;const o=t.inputList;for(let n=0;n")),z(new mi(t,"mutation",null,n,e));break;default:console.warn("Unknown change type: "+this.element)}}static getExtraBlockState_(e){return e.saveExtraState?(e=e.saveExtraState(!0))?JSON.stringify(e):"":e.mutationToDom&&(e=e.mutationToDom())?zs(e):""}};r($e.EVENT,ee.BLOCK_CHANGE,mi);var $l={};$l.clamp=Ui,$l.toDegrees=Mf,$l.toRadians=Aa;var bl=16,av=1,lv=12,Uh=16,vl=.25,Hh=null,fi=null,tn="",sn="",tt,on,$i,Wh=null,Bo=null,cv=null,Gh={getBoundsInfo:function(){const e=xo(Wh),t=Hn(Wh);return{left:e.x,right:e.x+t.width,top:e.y,bottom:e.y+t.height,width:t.width,height:t.height}},getPositionMetrics:function(e,t,o,n){const u=Gh.getBoundsInfo(),g=Hn(tt);return t+g.heightu.top?Hu(o,n,u,g):t+g.heightdocument.documentElement.clientTop?Hu(o,n,u,g):Pf(e,u,g)}},Bt={ANIMATION_TIME:vl,ARROW_HORIZONTAL_PADDING:lv,ARROW_SIZE:bl,BORDER_SIZE:av,PADDING_Y:Uh,TEST_ONLY:Gh};Bt.clearContent=Oa,Bt.createDom=Ru,Bt.getContentDiv=Xn,Bt.getOwner=Mu,Bt.getPositionX=Zn,Bt.hide=Na,Bt.hideIfOwner=Ra,Bt.hideWithoutAnimation=js,Bt.isVisible=Wu,Bt.repositionForWindowResize=Vu,Bt.setBoundsElement=Nu,Bt.setColour=Lu,Bt.show=zu,Bt.showPositionedByBlock=Lf,Bt.showPositionedByField=Pu;var wr=class{constructor(e){this.workspace=e,this.cursorSvg=this.cursor=null,this.markers=new Map,this.markerSvg=null}registerMarker(e,t){this.markers.has(e)&&this.unregisterMarker(e),t.setDrawer(this.workspace.getRenderer().makeMarkerDrawer(this.workspace,t)),this.setMarkerSvg(t.getDrawer().createDom()),this.markers.set(e,t)}unregisterMarker(e){const t=this.markers.get(e);if(t)t.dispose(),this.markers.delete(e);else throw Error("Marker with ID "+e+" does not exist. Can only unregister markers that exist.")}getCursor(){return this.cursor}getMarker(e){return this.markers.get(e)||null}setCursor(e){this.cursor&&this.cursor.getDrawer()&&this.cursor.getDrawer().dispose(),(this.cursor=e)&&(e=this.workspace.getRenderer().makeMarkerDrawer(this.workspace,this.cursor),this.cursor.setDrawer(e),this.setCursorSvg(this.cursor.getDrawer().createDom()))}setCursorSvg(e){e?(this.workspace.getBlockCanvas().appendChild(e),this.cursorSvg=e):this.cursorSvg=null}setMarkerSvg(e){e?this.workspace.getBlockCanvas()&&(this.cursorSvg?this.workspace.getBlockCanvas().insertBefore(e,this.cursorSvg):this.workspace.getBlockCanvas().appendChild(e)):this.markerSvg=null}updateMarkers(){this.workspace.keyboardAccessibilityMode&&this.cursorSvg&&this.workspace.getCursor().draw()}dispose(){const e=Object.keys(this.markers);for(let t=0,o;o=e[t];t++)this.unregisterMarker(o);this.markers.clear(),this.cursor&&(this.cursor.dispose(),this.cursor=null)}};wr.LOCAL_MARKER="local_marker_1";var nn={};nn.commonWordPrefix=Ku,nn.commonWordSuffix=Yu,nn.isNumber=i.isNumber$$module$build$src$core$utils$string,nn.shortestStringLength=Qn,nn.wrap=i.wrap$$module$build$src$core$utils$string;var yl=void 0,kr=!1,rn=!1,uv=50,dv=0,bi=0,Vh=0,Kh=0,hs=null,Cr=null,Yh=0,Jh=10,hv=10,pv=750,_l=5,Tt=null,ns={HOVER_MS:pv,LIMIT:uv,MARGINS:_l,OFFSET_X:Yh,OFFSET_Y:Jh,RADIUS_OK:hv};ns.bindMouseEvents=Wi,ns.block=ed,ns.createDom=Xu,ns.dispose=Qu,ns.getCustomTooltip=zf,ns.getDiv=Hf,ns.getTooltipOfObject=Hi,ns.hide=co,ns.isVisible=Uf,ns.setCustomTooltip=jf,ns.unbindMouseEvents=La,ns.unblock=td;var qh=.45,Xh=.65,gv={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00"},ps={};ps.blend=si,ps.getHsvSaturation=sd,ps.getHsvValue=od,ps.hexToRgb=Pa,ps.hsvToHex=Ba,ps.hueToHex=id,ps.names=gv,ps.parse=ti,ps.rgbToHex=er,ps.setHsvSaturation=qf,ps.setHsvValue=Xf;var Tr={};Tr.checkMessageReferences=Zf,Tr.parseBlockColour=Gi,Tr.replaceMessageReferences=bt,Tr.tokenizeInterpolation=nd;var lt=class{constructor(e,t,o){this.DEFAULT_VALUE=null,this.name=void 0,this.constants_=this.mouseDownWrapper=this.textContent_=this.textElement_=this.borderRect_=this.fieldGroup_=this.markerSvg=this.cursorSvg=this.tooltip=this.validator_=null,this.disposed=!1,this.maxDisplayLength=50,this.sourceBlock_=null,this.enabled_=this.visible_=this.isDirty_=!0,this.suffixField=this.prefixField=this.clickTarget_=null,this.EDITABLE=!0,this.SERIALIZABLE=!1,this.CURSOR="",this.value_="DEFAULT_VALUE"in new.target.prototype?new.target.prototype.DEFAULT_VALUE:this.DEFAULT_VALUE,this.size_=new Xe(0,0),e!==lt.SKIP_SETUP&&(o&&this.configure_(o),this.setValue(e),t&&this.setValidator(t))}configure_(e){e.tooltip&&this.setTooltip(bt(e.tooltip))}setSourceBlock(e){if(this.sourceBlock_)throw Error("Field already bound to a block");this.sourceBlock_=e}getConstants(){return!this.constants_&&this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&this.sourceBlock_.workspace.rendered&&(this.constants_=this.sourceBlock_.workspace.getRenderer().getConstants()),this.constants_}getSourceBlock(){return this.sourceBlock_}init(){this.fieldGroup_||(this.fieldGroup_=ie(J.G,{}),this.isVisible()||(this.fieldGroup_.style.display="none"),this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_),this.initView(),this.updateEditable(),this.setTooltip(this.tooltip),this.bindEvents_(),this.initModel(),this.applyColour())}initView(){this.createBorderRect_(),this.createTextElement_()}initModel(){}isFullBlockField(){return!this.borderRect_}createBorderRect_(){this.borderRect_=ie(J.RECT,{rx:this.getConstants().FIELD_BORDER_RECT_RADIUS,ry:this.getConstants().FIELD_BORDER_RECT_RADIUS,x:0,y:0,height:this.size_.height,width:this.size_.width,class:"blocklyFieldRect"},this.fieldGroup_)}createTextElement_(){this.textElement_=ie(J.TEXT,{class:"blocklyText"},this.fieldGroup_),this.getConstants().FIELD_TEXT_BASELINE_CENTER&&this.textElement_.setAttribute("dominant-baseline","central"),this.textContent_=document.createTextNode(""),this.textElement_.appendChild(this.textContent_)}bindEvents_(){const e=this.getClickTarget_();if(!e)throw Error("A click target has not been set.");Wi(e),this.mouseDownWrapper=H(e,"pointerdown",this,this.onMouseDown_)}fromXml(e){this.setValue(e.textContent)}toXml(e){return e.textContent=this.getValue(),e}saveState(e){return e=this.saveLegacyState(lt),e!==null?e:this.getValue()}loadState(e){this.loadLegacyState(lt,e)||this.setValue(e)}saveLegacyState(e){return e.prototype.saveState===this.saveState&&e.prototype.toXml!==this.toXml?(e=i.createElement$$module$build$src$core$utils$xml("field"),e.setAttribute("name",this.name||""),Li(this.toXml(e)).replace(' xmlns="https://developers.google.com/blockly/xml"',"")):null}loadLegacyState(e,t){return e.prototype.loadState===this.loadState&&e.prototype.fromXml!==this.fromXml?(this.fromXml(i.textToDom$$module$build$src$core$utils$xml(t)),!0):!1}dispose(){Ra(this),ii(this);let e;(e=this.getSourceBlock())!=null&&e.isDeadOrDying()||Ze(this.fieldGroup_),this.disposed=!0}updateEditable(){const e=this.fieldGroup_,t=this.getSourceBlock();this.EDITABLE&&e&&t&&(this.enabled_&&t.isEditable()?(Oe(e,"blocklyEditableText"),ze(e,"blocklyNonEditableText"),e.style.cursor=this.CURSOR):(Oe(e,"blocklyNonEditableText"),ze(e,"blocklyEditableText"),e.style.cursor=""))}setEnabled(e){this.enabled_=e,this.updateEditable()}isEnabled(){return this.enabled_}isClickable(){return this.enabled_&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()&&this.showEditor_!==lt.prototype.showEditor_}isClickableInFlyout(e){return!e}isCurrentlyEditable(){return this.enabled_&&this.EDITABLE&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()}isSerializable(){let e=!1;return this.name&&(this.SERIALIZABLE?e=!0:this.EDITABLE&&(console.warn("Detected an editable field that was not serializable. Please define SERIALIZABLE property as true on all editable custom fields. Proceeding with serialization."),e=!0)),e}isVisible(){return this.visible_}setVisible(e){if(this.visible_!==e){this.visible_=e;var t=this.fieldGroup_;t&&(t.style.display=e?"block":"none")}}setValidator(e){this.validator_=e}getValidator(){return this.validator_}getSvgRoot(){return this.fieldGroup_}getBorderRect(){if(!this.borderRect_)throw Error(`The border rectangle is ${this.borderRect_}.`);return this.borderRect_}getTextElement(){if(!this.textElement_)throw Error(`The text element is ${this.textElement_}.`);return this.textElement_}getTextContent(){if(!this.textContent_)throw Error(`The text content is ${this.textContent_}.`);return this.textContent_}applyColour(){}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_()}showEditor(e){this.isClickable()&&this.showEditor_(e)}showEditor_(e){}repositionForWindowResize(){return!1}updateSize_(e){const t=this.getConstants();e=e!==void 0?e:this.isFullBlockField()?0:this.getConstants().FIELD_BORDER_RECT_X_PADDING;let o=2*e,n=t.FIELD_TEXT_HEIGHT,u=0;this.textElement_&&(u=Io(this.textElement_,t.FIELD_TEXT_FONTSIZE,t.FIELD_TEXT_FONTWEIGHT,t.FIELD_TEXT_FONTFAMILY),o+=u),this.isFullBlockField()||(n=Math.max(n,t.FIELD_BORDER_RECT_HEIGHT)),this.size_.height=n,this.size_.width=o,this.positionTextElement_(e,u),this.positionBorderRect_()}positionTextElement_(e,t){if(this.textElement_){var o=this.getConstants(),n=this.size_.height/2,u;this.textElement_.setAttribute("x",String((u=this.getSourceBlock())!=null&&u.RTL?this.size_.width-t-e:e)),this.textElement_.setAttribute("y",String(o.FIELD_TEXT_BASELINE_CENTER?n:n-o.FIELD_TEXT_HEIGHT/2+o.FIELD_TEXT_BASELINE))}}positionBorderRect_(){this.borderRect_&&(this.borderRect_.setAttribute("width",String(this.size_.width)),this.borderRect_.setAttribute("height",String(this.size_.height)),this.borderRect_.setAttribute("rx",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)),this.borderRect_.setAttribute("ry",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)))}getSize(){return this.isVisible()?(this.isDirty_?(this.render_(),this.isDirty_=!1):this.visible_&&this.size_.width===0&&(this.render_(),this.size_.width!==0&&console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead.")),this.size_):new Xe(0,0)}getScaledBBox(){let e;var t=this.getSourceBlock();if(!t)throw new _t;if(this.isFullBlockField()){var o=this.sourceBlock_.getHeightWidth();const n=t.workspace.scale;e=this.getAbsoluteXY_(),t=(o.width+1)*n,o=(o.height+1)*n,Ab?(e.x+=1.5*n,e.y+=1.5*n):(e.x-=.5*n,e.y-=.5*n)}else o=this.borderRect_.getBoundingClientRect(),e=xo(this.borderRect_),t=o.width,o=o.height;return new rt(e.y,e.y+o,e.x,e.x+t)}onLocationChange(e){}getDisplayText_(){let e=this.getText();return e?(e.length>this.maxDisplayLength&&(e=e.substring(0,this.maxDisplayLength-2)+"…"),e=e.replace(/\s/g,lt.NBSP),this.sourceBlock_&&this.sourceBlock_.RTL&&(e+="‏"),e):lt.NBSP}getText(){const e=this.getText_();return String(e!==null?e:this.getValue())}getText_(){return null}markDirty(){this.isDirty_=!0,this.constants_=null}forceRerender(){this.isDirty_=!0,this.sourceBlock_&&this.sourceBlock_.rendered&&this.sourceBlock_.queueRender()}setValue(e,t=!0){if(e!==null){var o=i.getGroup$$module$build$src$core$events$utils();o||i.setGroup$$module$build$src$core$events$utils(!0);try{const le=this.doClassValidation_(e),Ee=this.processValidation(e,le,t);if(!(Ee instanceof Error)){var n,u=(n=this.getValidator())==null?void 0:n.call(this,Ee),g=this.processValidation(Ee,u,t);if(!(g instanceof Error)){var I=this.sourceBlock_;if(!I||!I.disposed){var L=this.getValue();L===g?this.doValueUpdate_(g):(this.doValueUpdate_(g),t&&I&&C()&&z(new(ne(ee.BLOCK_CHANGE))(I,"field",this.name||null,L,g)),this.isDirty_&&this.forceRerender())}}}}finally{i.setGroup$$module$build$src$core$events$utils(o)}}}processValidation(e,t,o){return t===null?(this.doValueInvalid_(e,o),this.isDirty_&&this.forceRerender(),Error()):t===void 0?e:t}getValue(){return this.value_}doClassValidation_(e){return e??null}doValueUpdate_(e){this.value_=e,this.isDirty_=!0}doValueInvalid_(e,t){}onMouseDown_(e){this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&(e=this.sourceBlock_.workspace.getGesture(e))&&e.setStartField(this)}setTooltip(e){e||e===""||(e=this.sourceBlock_);const t=this.getClickTarget_();t?t.tooltip=e:this.tooltip=e}getTooltip(){const e=this.getClickTarget_();return Hi(e||{tooltip:this.tooltip})}getClickTarget_(){return this.clickTarget_||this.getSvgRoot()}getAbsoluteXY_(){return xo(this.getClickTarget_())}referencesVariables(){return!1}refreshVariableName(){}getParentInput(){let e=null;const t=this.getSourceBlock();if(!t)throw new _t;const o=t.inputList;for(let n=0;n{o.stopPropagation()})}addModelUpdateBindings(){this.view.addTextChangeListener((e,t)=>{super.setText(t)}),this.view.addSizeChangeListener((e,t)=>{super.setSize(t)}),this.view.addOnCollapseListener(()=>{super.setCollapsed(this.view.isCollapsed())}),this.view.addDisposeListener(()=>{this.isDeadOrDying()||this.dispose()})}setText(e){this.view.setText(e)}setSize(e){this.view.setSize(e)}setCollapsed(e){this.view.setCollapsed(e)}setEditable(e){super.setEditable(e),this.view.setEditable(this.isEditable())}getSvgRoot(){return this.view.getSvgRoot()}getSize(){return super.getSize()}getBoundingRectangle(){const e=this.getRelativeToSurfaceXY();var t,o;const n=(o=(t=this.view)==null?void 0:t.getSize())!=null?o:this.getSize();return this.workspace.RTL?(t=e.x-n.width,o=e.x):(t=e.x,o=e.x+n.width),new rt(e.y,e.y+n.height,t,o)}moveBy(e,t,o){const n=this.getRelativeToSurfaceXY();e=new ye(n.x+e,n.y+t),this.moveTo(e,o)}moveTo(e,t){super.moveTo(e,t),this.view.moveTo(e)}moveDuringDrag(e){this.location=e,this.view.moveTo(e)}setDragging(e){e?Oe(this.getSvgRoot(),"blocklyDragging"):ze(this.getSvgRoot(),"blocklyDragging")}dispose(){this.disposing=!0,this.view.isDeadOrDying()||this.view.dispose(),super.dispose()}startGesture(e){const t=this.workspace.getGesture(e);if(t){if(be(e))e.stopPropagation();else{t.handleCommentStart(e,this);let o;(o=this.workspace.getLayerManager())==null||o.append(this,Fo)}i.setSelected$$module$build$src$core$common(this)}}setDeleteStyle(e){e?Oe(this.getSvgRoot(),"blocklyDraggingDelete"):ze(this.getSvgRoot(),"blocklyDraggingDelete")}isMovable(){return this.dragStrategy.isMovable()}startDrag(){this.dragStrategy.startDrag()}drag(e){this.dragStrategy.drag(e)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){Oe(this.getSvgRoot(),"blocklySelected")}unselect(){ze(this.getSvgRoot(),"blocklySelected")}toCopyData(){return{paster:pl.TYPE,commentState:Pi(this,{addCoordinates:!0})}}showContextMenu(e){const t=Ke.registry.getContextMenuOptions(Ke.ScopeType.COMMENT,{comment:this});sr(e,t,this.workspace.RTL,this.workspace)}snapToGrid(){if(!this.isDeadOrDying()){var e=this.workspace.getGrid();if(e!=null&&e.shouldSnap()){var t=this.getRelativeToSurfaceXY();e=e.alignXY(t),e!==t&&this.moveTo(e,["snap"])}}}},Ft={};Ft.appendDomToWorkspace=d$,Ft.blockToDom=Ao,Ft.blockToDomWithXY=nr,Ft.clearWorkspaceAndLoadFromXml=u$,Ft.deleteNext=y$,Ft.domToBlock=i.domToBlock$$module$build$src$core$xml,Ft.domToBlockInternal=ni,Ft.domToPrettyText=c$,Ft.domToText=zs,Ft.domToVariables=$d,Ft.domToWorkspace=i.domToWorkspace$$module$build$src$core$xml,Ft.loadWorkspaceComment=fd,Ft.saveWorkspaceComment=ir,Ft.variablesToDom=gd,Ft.workspaceToDom=r$;var Qh=class extends gi{constructor(e){super(e),this.type=ee.BLOCK_CREATE,e&&(e.isShadow()&&(this.recordUndo=!1),this.xml=nr(e),this.ids=ve(e),this.json=os(e,{addCoordinates:!0}))}toJson(){const e=super.toJson();if(!this.xml)throw Error("The block XML is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");return e.xml=zs(this.xml),e.ids=this.ids,e.json=this.json,this.recordUndo||(e.recordUndo=this.recordUndo),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Qh),t.xml=i.textToDom$$module$build$src$core$utils$xml(e.xml),t.ids=e.ids,t.json=e.json,e.recordUndo!==void 0&&(t.recordUndo=e.recordUndo),t}run(e){const t=this.getEventWorkspace_();if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!KC(t,this.ids))if(e)lo(this.json,t);else for(e=0;ee.getBlockById(o)).filter(o=>o&&o.isShadow()).length===t.length};r($e.EVENT,ee.BLOCK_CREATE,Qh);var ep=class extends Ss{constructor(e,t){super(t),this.type=ee.THEME_CHANGE,this.themeName=e}toJson(){const e=super.toJson();if(!this.themeName)throw Error("The theme name is undefined. Either pass a theme name to the constructor, or call fromJson");return e.themeName=this.themeName,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new ep),t.themeName=e.themeName,t}};r($e.EVENT,ee.THEME_CHANGE,ep);var tp=class extends Ss{constructor(e,t,o,n,u){super(n),this.type=ee.VIEWPORT_CHANGE,this.viewTop=e,this.viewLeft=t,this.scale=o,this.oldScale=u}toJson(){const e=super.toJson();if(this.viewTop===void 0)throw Error("The view top is undefined. Either pass a value to the constructor, or call fromJson");if(this.viewLeft===void 0)throw Error("The view left is undefined. Either pass a value to the constructor, or call fromJson");if(this.scale===void 0)throw Error("The scale is undefined. Either pass a value to the constructor, or call fromJson");if(this.oldScale===void 0)throw Error("The old scale is undefined. Either pass a value to the constructor, or call fromJson");return e.viewTop=this.viewTop,e.viewLeft=this.viewLeft,e.scale=this.scale,e.oldScale=this.oldScale,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new tp),t.viewTop=e.viewTop,t.viewLeft=e.viewLeft,t.scale=e.scale,t.oldScale=e.oldScale,t}};r($e.EVENT,ee.VIEWPORT_CHANGE,tp);var xe;(function(e){e[e.INPUT_VALUE=1]="INPUT_VALUE",e[e.OUTPUT_VALUE=2]="OUTPUT_VALUE",e[e.NEXT_STATEMENT=3]="NEXT_STATEMENT",e[e.PREVIOUS_STATEMENT=4]="PREVIOUS_STATEMENT"})(xe||(xe={}));var un=class{constructor(e){this.connectionChecker=e,this.connections=[]}addConnection(e,t){t=this.calculateIndexForYPos(t),this.connections.splice(t,0,e)}findIndexOfConnection(e,t){if(!this.connections.length)return-1;const o=this.calculateIndexForYPos(t);if(o>=this.connections.length)return-1;t=e.y;let n=o;for(;0<=n&&this.connections[n].y===t;){if(this.connections[n]===e)return n;n--}for(n=o;ne)o=n;else{t=n;break}}return t}removeConnection(e,t){if(e=this.findIndexOfConnection(e,t),e===-1)throw Error("Unable to find connection in connectionDB.");this.connections.splice(e,1)}getNeighbours(e,t){function o(Ee){const dt=u-n[Ee].x,ut=g-n[Ee].y;return Math.sqrt(dt*dt+ut*ut)<=t&&le.push(n[Ee]),ut(this.flyout?i.config$$module$build$src$core$config.flyoutDragRadius:i.config$$module$build$src$core$config.dragRadius)}updateIsDraggingFromFlyout(){let e;if(!this.targetBlock||(e=this.flyout)==null||!e.isBlockCreatable(this.targetBlock))return!1;if(!this.flyout.targetWorkspace)throw Error(`Cannot update dragging from the flyout because the ' + - 'flyout's target workspace is undefined`);return!this.flyout.isScrollable()||this.flyout.isDragTowardWorkspace(this.currentDragDeltaXY)?(this.startWorkspace_=this.flyout.targetWorkspace,this.startWorkspace_.updateScreenCalculationsIfScrolled(),i.getGroup$$module$build$src$core$events$utils()||i.setGroup$$module$build$src$core$events$utils(!0),this.startBlock=null,this.targetBlock=this.flyout.createBlock(this.targetBlock),i.setSelected$$module$build$src$core$common(this.targetBlock),!0):!1}updateIsDraggingWorkspace(){if(!this.startWorkspace_)throw Error("Cannot update dragging the workspace because the start workspace is undefined");(this.flyout?this.flyout.isScrollable():this.startWorkspace_&&this.startWorkspace_.isDraggable())&&(this.dragging=!0,this.workspaceDragger=new $v(this.startWorkspace_),this.workspaceDragger.startDrag())}updateIsDragging(e){if(!this.startWorkspace_)throw Error("Cannot update dragging because the start workspace is undefined");if(this.calledUpdateIsDragging)throw Error("updateIsDragging_ should only be called once per gesture.");this.calledUpdateIsDragging=!0,this.flyout&&this.updateIsDraggingFromFlyout();const t=j();t&&ri(t)&&t.isMovable()?(this.dragging=!0,this.dragger=this.createDragger(t,this.startWorkspace_),this.dragger.onDragStart(e),this.dragger.onDrag(e,this.currentDragDeltaXY)):this.updateIsDraggingWorkspace()}createDragger(e,t){return new(y($e.BLOCK_DRAGGER,this.creatorWorkspace.options,!0))(e,t)}doStart(e){if(!this.startWorkspace_)throw Error("Cannot start the touch gesture becauase the start workspace is undefined");this.isPinchZoomEnabled=this.startWorkspace_.options.zoomOptions&&this.startWorkspace_.options.zoomOptions.pinch,be(e)?this.cancel():(this.gestureHasStarted=!0,Ki(),this.startWorkspace_.updateScreenCalculationsIfScrolled(),this.startWorkspace_.isMutator&&this.startWorkspace_.resize(),this.currentDropdownOwner=Mu(),this.startWorkspace_.hideChaff(!!this.flyout),this.startWorkspace_.markFocused(),this.mostRecentEvent=e,ed(),pe(e)?this.handleRightClick(e):(e.type.toLowerCase()==="pointerdown"&&e.pointerType!=="mouse"&&k(e,this),this.mouseDownXY=new ye(e.clientX,e.clientY),this.bindMouseEvents(e),this.isEnding_||this.handleTouchStart(e)))}bindMouseEvents(e){this.boundEvents.push(H(document,"pointerdown",null,this.handleStart.bind(this),!0)),this.boundEvents.push(H(document,"pointermove",null,this.handleMove.bind(this),!0)),this.boundEvents.push(H(document,"pointerup",null,this.handleUp.bind(this),!0)),e.preventDefault(),e.stopPropagation()}handleStart(e){this.isDragging()||(this.handleTouchStart(e),this.isMultiTouch()&&X())}handleMove(e){this.isDragging()&&O(e)||!this.isMultiTouch()?(this.updateFromEvent(e),this.workspaceDragger?this.workspaceDragger.drag(this.currentDragDeltaXY):this.dragger&&this.dragger.onDrag(this.mostRecentEvent,this.currentDragDeltaXY),e.preventDefault(),e.stopPropagation()):this.isMultiTouch()&&(this.handleTouchMove(e),X())}handleUp(e){if(this.isDragging()||this.handleTouchEnd(e),!this.isMultiTouch()||this.isDragging()){if(!O(e))return;if(this.updateFromEvent(e),X(),this.isEnding_){console.log("Trying to end a gesture recursively.");return}this.isEnding_=!0,this.dragger?this.dragger.onDragEnd(e,this.currentDragDeltaXY):this.workspaceDragger?this.workspaceDragger.endDrag(this.currentDragDeltaXY):this.isBubbleClick()||this.isCommentClick()||(this.isFieldClick()?this.doFieldClick():this.isIconClick()?this.doIconClick():this.isBlockClick()?this.doBlockClick():this.isWorkspaceClick()&&this.doWorkspaceClick(e))}e.preventDefault(),e.stopPropagation(),this.dispose()}handleTouchStart(e){var t=A(e);this.cachedPoints.set(t,this.getTouchPoint(e));var o=Array.from(this.cachedPoints.keys());o.length===2&&(t=this.cachedPoints.get(o[0]),o=this.cachedPoints.get(o[1]),this.startDistance=ye.distance(t,o),this.multiTouch=!0,e.preventDefault())}handleTouchMove(e){const t=A(e);this.cachedPoints.set(t,this.getTouchPoint(e)),this.isPinchZoomEnabled&&this.cachedPoints.size===2?this.handlePinch(e):(this.updateFromEvent(e),this.workspaceDragger?this.workspaceDragger.drag(this.currentDragDeltaXY):this.dragger&&this.dragger.onDrag(this.mostRecentEvent,this.currentDragDeltaXY),e.preventDefault(),e.stopPropagation())}handlePinch(e){var t=Array.from(this.cachedPoints.keys()),o=this.cachedPoints.get(t[0]);if(t=this.cachedPoints.get(t[1]),o=ye.distance(o,t)/this.startDistance,0this.previousScale){if(t=o-this.previousScale,t=0this.cachedPoints.size&&(this.cachedPoints.clear(),this.previousScale=0)}getTouchPoint(e){return this.startWorkspace_?new ye(e.pageX,e.pageY):null}isMultiTouch(){return this.multiTouch}cancel(){this.isEnding_||(X(),this.dragger?this.dragger.onDragEnd(this.mostRecentEvent,this.currentDragDeltaXY):this.workspaceDragger&&this.workspaceDragger.endDrag(this.currentDragDeltaXY),this.dispose())}handleRightClick(e){this.targetBlock?(this.bringBlockToFront(),this.targetBlock.workspace.hideChaff(!!this.flyout),this.targetBlock.showContextMenu(e)):this.startBubble?this.startBubble.showContextMenu(e):this.startComment?(this.startComment.workspace.hideChaff(),this.startComment.showContextMenu(e)):this.startWorkspace_&&!this.flyout&&(this.startWorkspace_.hideChaff(),this.startWorkspace_.showContextMenu(e)),e.preventDefault(),e.stopPropagation(),this.dispose()}handleWsStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");this.setStartWorkspace(t),this.mostRecentEvent=e,this.startBlock||this.startBubble||this.startComment||i.setSelected$$module$build$src$core$common(null),this.doStart(e)}fireWorkspaceClick(e){z(new(ne(ee.CLICK))(null,e.id,"workspace"))}handleFlyoutStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");this.setStartFlyout(t),this.handleWsStart(e,t.getWorkspace())}handleBlockStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBlockStart, but the gesture had already been started.");this.setStartBlock(t),this.mostRecentEvent=e}handleBubbleStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");this.setStartBubble(t),this.mostRecentEvent=e}handleCommentStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleCommentStart, but the gesture had already been started.");this.setStartComment(t),this.mostRecentEvent=e}doFieldClick(){if(!this.startField)throw Error("Cannot do a field click because the start field is undefined");this.currentDropdownOwner!==this.startField&&this.startField.showEditor(this.mostRecentEvent),this.bringBlockToFront()}doIconClick(){if(!this.startIcon)throw Error("Cannot do an icon click because the start icon is undefined");this.bringBlockToFront(),this.startIcon.onClick()}doBlockClick(){if(this.flyout&&this.flyout.autoClose){if(!this.targetBlock)throw Error("Cannot do a block click because the target block is undefined");if(this.targetBlock.isEnabled()){i.getGroup$$module$build$src$core$events$utils()||i.setGroup$$module$build$src$core$events$utils(!0);var e=this.flyout.createBlock(this.targetBlock);e.snapToGrid(),e.bumpNeighbours()}}else{if(!this.startWorkspace_)throw Error("Cannot do a block click because the start workspace is undefined");e=new(ne(ee.CLICK))(this.startBlock,this.startWorkspace_.id,"block"),z(e)}this.bringBlockToFront(),i.setGroup$$module$build$src$core$events$utils(!1)}doWorkspaceClick(e){e=this.creatorWorkspace,j()&&j().unselect(),this.fireWorkspaceClick(this.startWorkspace_||e)}bringBlockToFront(){this.targetBlock&&!this.flyout&&this.targetBlock.bringToFront()}setStartField(e){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");this.startField||(this.startField=e)}setStartIcon(e){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartIcon, but the gesture had already been started.");this.startIcon||(this.startIcon=e)}setStartBubble(e){this.startBubble||(this.startBubble=e)}setStartComment(e){this.startComment||(this.startComment=e)}setStartBlock(e){this.startBlock||this.startBubble||(this.startBlock=e,i.setSelected$$module$build$src$core$common(this.startBlock),e.isInFlyout&&e!==e.getRootBlock()?this.setTargetBlock(e.getRootBlock()):this.setTargetBlock(e))}setTargetBlock(e){e.isShadow()?this.setTargetBlock(e.getParent()):this.targetBlock=e}setStartWorkspace(e){this.startWorkspace_||(this.startWorkspace_=e)}setStartFlyout(e){this.flyout||(this.flyout=e)}isBubbleClick(){return!!this.startBubble&&!this.hasExceededDragRadius}isCommentClick(){return!!this.startComment&&!this.hasExceededDragRadius}isBlockClick(){return!!this.startBlock&&!this.hasExceededDragRadius&&!this.isFieldClick()&&!this.isIconClick()}isFieldClick(){return this.startField?this.startField.isClickable()&&!this.hasExceededDragRadius&&(!this.flyout||this.startField.isClickableInFlyout(this.flyout.autoClose)):!1}isIconClick(){if(!this.startIcon)return!1;const e=!this.flyout||!this.startIcon.isClickableInFlyout||this.startIcon.isClickableInFlyout(this.flyout.autoClose);return!this.hasExceededDragRadius&&e}isWorkspaceClick(){return!this.startBlock&&!this.startBubble&&!this.startField&&!this.hasExceededDragRadius}getCurrentDragger(){let e,t;return(t=(e=this.workspaceDragger)!=null?e:this.dragger)!=null?t:null}isDragging(){return this.dragging}hasStarted(){return this.gestureHasStarted}static inProgress(){const e=B();for(let t=0,o;o=e[t];t++)if(o.currentGesture_)return!0;return!1}},sp=class{constructor(e,t){this.pattern=e,this.scale=1;let o;this.spacing=(o=t.spacing)!=null?o:0;let n;this.length=(n=t.length)!=null?n:1,this.line2=(this.line1=e.firstChild)&&this.line1.nextSibling;let u;this.snapToGrid=(u=t.snap)!=null?u:!1}setSpacing(e){this.spacing=e,this.update(this.scale)}getSpacing(){return this.spacing}setLength(e){this.length=e,this.update(this.scale)}getLength(){return this.length}setSnapToGrid(e){this.snapToGrid=e}shouldSnap(){return this.snapToGrid}getPatternId(){return this.pattern.id}update(e){this.scale=e;var t=this.spacing*e;this.pattern.setAttribute("width",`${t}`),this.pattern.setAttribute("height",`${t}`),t=Math.floor(this.spacing/2)+.5;let o=t-this.length/2,n=t+this.length/2;t*=e,o*=e,n*=e,this.setLineAttributes(this.line1,e,o,n,t,t),this.setLineAttributes(this.line2,e,t,t,o,n)}setLineAttributes(e,t,o,n,u,g){e&&(e.setAttribute("stroke-width",`${t}`),e.setAttribute("x1",`${o}`),e.setAttribute("y1",`${u}`),e.setAttribute("x2",`${n}`),e.setAttribute("y2",`${g}`))}moveTo(e,t){this.pattern.setAttribute("x",`${e}`),this.pattern.setAttribute("y",`${t}`)}alignXY(e){var t=this.getSpacing();const o=t/2,n=Math.round(Math.round((e.x-o)/t)*t+o);return t=Math.round(Math.round((e.y-o)/t)*t+o),n===e.x&&t===e.y?e:new ye(n,t)}static createDom(e,t,o){e=ie(J.PATTERN,{id:"blocklyGridPattern"+e,patternUnits:"userSpaceOnUse"},o);let n,u;if(0<((n=t.length)!=null?n:1)&&0<((u=t.spacing)!=null?u:0)){ie(J.LINE,{stroke:t.colour},e);let g;(g=t.length)!=null&&g&&ie(J.LINE,{stroke:t.colour},e)}else ie(J.LINE,{},e);return e}},qC=class{constructor(e){this.workspace=e,this.layers=new Map,(e=e.getInjectionDiv())&&(this.dragLayer=this.createDragLayer(e),this.animationLayer=this.createAnimationLayer(e)),e=this.createLayer(Fo),Oe(e,"blocklyBlockCanvas"),e=this.createLayer(Sl),Oe(e,"blocklyBubbleCanvas")}createDragLayer(e){const t=ie(J.SVG,{class:"blocklyBlockDragSurface",xmlns:pr,"xmlns:html":Gs,"xmlns:xlink":is,version:"1.1"});return e.append(t),ie(J.G,{},t)}createAnimationLayer(e){const t=ie(J.SVG,{class:"blocklyAnimationLayer",xmlns:pr,"xmlns:html":Gs,"xmlns:xlink":is,version:"1.1"});return e.append(t),ie(J.G,{},t)}appendToAnimationLayer(e){let t;const o=(t=this.dragLayer)==null?void 0:t.getAttribute("transform");if(o){let u;(u=this.animationLayer)==null||u.setAttribute("transform",o)}let n;(n=this.animationLayer)==null||n.appendChild(e.getSvgRoot())}translateLayers(e,t){e=`translate(${e.x}, ${e.y}) scale(${t})`;let o;(o=this.dragLayer)==null||o.setAttribute("transform",e);for(const[,n]of this.layers)n.setAttribute("transform",e)}moveToDragLayer(e){let t;(t=this.dragLayer)==null||t.appendChild(e.getSvgRoot())}moveOffDragLayer(e,t){this.append(e,t)}append(e,t){this.layers.has(t)||this.createLayer(t);let o;(o=this.layers.get(t))==null||o.appendChild(e.getSvgRoot())}createLayer(e){const t=this.workspace.getSvgGroup(),o=ie(J.G,{});let n=!1;const u=[...this.layers].sort((g,I)=>g[0]-I[0]);for(const[g,I]of u)if(et[1]===e)?e:(this.sourceBlock_&&console.warn("Cannot set the dropdown's value to an unavailable option. Block type: "+this.sourceBlock_.type+", Field name: "+this.name+", Value: "+e),null)}doValueUpdate_(e){super.doValueUpdate_(e),e=this.getOptions(!0);for(let t=0,o;o=e[t];t++)o[1]===this.value_&&(this.selectedOption=o)}applyColour(){const e=this.sourceBlock_;this.borderRect_&&(this.borderRect_.setAttribute("stroke",e.getColourTertiary()),this.menu_?this.borderRect_.setAttribute("fill",e.getColourTertiary()):this.borderRect_.setAttribute("fill","transparent")),e&&this.arrow&&(e.isShadow()?this.arrow.style.fill=e.getColourSecondary():this.arrow.style.fill=e.getColour())}render_(){this.getTextContent().nodeValue="",this.imageElement.style.display="none";const e=this.selectedOption&&this.selectedOption[0];e&&typeof e=="object"?this.renderSelectedImage(e):this.renderSelectedText(),this.positionBorderRect_()}renderSelectedImage(e){const t=this.getSourceBlock();if(!t)throw new _t;this.imageElement.style.display="",this.imageElement.setAttributeNS(is,"xlink:href",e.src),this.imageElement.setAttribute("height",String(e.height)),this.imageElement.setAttribute("width",String(e.width));const o=Number(e.height);e=Number(e.width);var n=!!this.borderRect_;const u=Math.max(n?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,o+Qt.IMAGE_Y_PADDING);n=n?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let g;g=this.svgArrow?this.positionSVGArrow(e+n,u/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2):Io(this.arrow,this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY),this.size_.width=e+g+2*n,this.size_.height=u;let I=0;t.RTL?this.imageElement.setAttribute("x",`${n+g}`):(I=e+g,this.getTextElement().setAttribute("text-anchor","end"),this.imageElement.setAttribute("x",`${n}`)),this.imageElement.setAttribute("y",String(u/2-o/2)),this.positionTextElement_(I+n,e+g)}renderSelectedText(){this.getTextContent().nodeValue=this.getDisplayText_();var e=this.getTextElement();Oe(e,"blocklyDropdownText"),e.setAttribute("text-anchor","start");var t=!!this.borderRect_;e=Math.max(t?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,this.getConstants().FIELD_TEXT_HEIGHT);const o=Io(this.getTextElement(),this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY);t=t?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let n=0;this.svgArrow&&(n=this.positionSVGArrow(o+t,e/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2)),this.size_.width=o+n+2*t,this.size_.height=e,this.positionTextElement_(t,o)}positionSVGArrow(e,t){if(!this.svgArrow)return 0;const o=this.getSourceBlock();if(!o)throw new _t;const n=this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0,u=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_PADDING,g=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE;return this.svgArrow.setAttribute("transform","translate("+(o.RTL?n:e+u)+","+t+")"),g+u}getText_(){if(!this.selectedOption)return null;const e=this.selectedOption[0];return typeof e=="object"?e.alt:e}static fromJson(e){if(!e.options)throw Error("options are required for the dropdown field. The options property must be assigned an array of [humanReadableValue, languageNeutralValue] tuples.");return new this(e.options,void 0,e)}trimOptions(e){let t=!1;const o=e.map(([I,L])=>typeof I=="string"?[bt(I),L]:(t=!0,[I.alt!==null?Object.assign({},I,{alt:bt(I.alt)}):Object.assign({},I),L]));if(t||2>e.length)return{options:o};var n=o.map(([I])=>I),u=Qn(n);e=Ku(n,u);const g=Yu(n,u);return!e&&!g||u<=e+g?{options:o}:(u=e?n[0].substring(0,e-1):void 0,n=g?n[0].substr(1-g):void 0,{options:this.applyTrim(o,e,g),prefix:u,suffix:n})}applyTrim(e,t,o){return e.map(([n,u])=>[n.substring(t,n.length-o),u])}validateOptions(e){if(!Array.isArray(e))throw TypeError("FieldDropdown options must be an array.");if(!e.length)throw TypeError("FieldDropdown options must not be an empty array.");let t=!1;for(let o=0;o{o.stopPropagation()})}addModelUpdateBindings(){this.view.addTextChangeListener((e,t)=>{super.setText(t)}),this.view.addSizeChangeListener((e,t)=>{super.setSize(t)}),this.view.addOnCollapseListener(()=>{super.setCollapsed(this.view.isCollapsed())}),this.view.addDisposeListener(()=>{this.isDeadOrDying()||this.dispose()})}setText(e){this.view.setText(e)}setSize(e){this.view.setSize(e)}setCollapsed(e){this.view.setCollapsed(e)}setEditable(e){super.setEditable(e),this.view.setEditable(this.isEditable())}getSvgRoot(){return this.view.getSvgRoot()}getSize(){return super.getSize()}getBoundingRectangle(){const e=this.getRelativeToSurfaceXY();var t,o;const n=(o=(t=this.view)==null?void 0:t.getSize())!=null?o:this.getSize();return this.workspace.RTL?(t=e.x-n.width,o=e.x):(t=e.x,o=e.x+n.width),new rt(e.y,e.y+n.height,t,o)}moveBy(e,t,o){const n=this.getRelativeToSurfaceXY();e=new ye(n.x+e,n.y+t),this.moveTo(e,o)}moveTo(e,t){super.moveTo(e,t),this.view.moveTo(e)}moveDuringDrag(e){this.location=e,this.view.moveTo(e)}setDragging(e){e?Oe(this.getSvgRoot(),"blocklyDragging"):ze(this.getSvgRoot(),"blocklyDragging")}dispose(){this.disposing=!0,this.view.isDeadOrDying()||this.view.dispose(),super.dispose()}startGesture(e){const t=this.workspace.getGesture(e);if(t){if(be(e))e.stopPropagation();else{t.handleCommentStart(e,this);let o;(o=this.workspace.getLayerManager())==null||o.append(this,Fo)}i.setSelected$$module$build$src$core$common(this)}}setDeleteStyle(e){e?Oe(this.getSvgRoot(),"blocklyDraggingDelete"):ze(this.getSvgRoot(),"blocklyDraggingDelete")}isMovable(){return this.dragStrategy.isMovable()}startDrag(){this.dragStrategy.startDrag()}drag(e){this.dragStrategy.drag(e)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){Oe(this.getSvgRoot(),"blocklySelected")}unselect(){ze(this.getSvgRoot(),"blocklySelected")}toCopyData(){return{paster:pl.TYPE,commentState:Pi(this,{addCoordinates:!0})}}showContextMenu(e){const t=Ke.registry.getContextMenuOptions(Ke.ScopeType.COMMENT,{comment:this});sr(e,t,this.workspace.RTL,this.workspace)}snapToGrid(){if(!this.isDeadOrDying()){var e=this.workspace.getGrid();if(e!=null&&e.shouldSnap()){var t=this.getRelativeToSurfaceXY();e=e.alignXY(t),e!==t&&this.moveTo(e,["snap"])}}}},Ft={};Ft.appendDomToWorkspace=p$,Ft.blockToDom=Ao,Ft.blockToDomWithXY=nr,Ft.clearWorkspaceAndLoadFromXml=h$,Ft.deleteNext=w$,Ft.domToBlock=i.domToBlock$$module$build$src$core$xml,Ft.domToBlockInternal=ni,Ft.domToPrettyText=d$,Ft.domToText=zs,Ft.domToVariables=$d,Ft.domToWorkspace=i.domToWorkspace$$module$build$src$core$xml,Ft.loadWorkspaceComment=fd,Ft.saveWorkspaceComment=ir,Ft.variablesToDom=gd,Ft.workspaceToDom=l$;var Qh=class extends gi{constructor(e){super(e),this.type=ee.BLOCK_CREATE,e&&(e.isShadow()&&(this.recordUndo=!1),this.xml=nr(e),this.ids=ve(e),this.json=os(e,{addCoordinates:!0}))}toJson(){const e=super.toJson();if(!this.xml)throw Error("The block XML is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");return e.xml=zs(this.xml),e.ids=this.ids,e.json=this.json,this.recordUndo||(e.recordUndo=this.recordUndo),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Qh),t.xml=i.textToDom$$module$build$src$core$utils$xml(e.xml),t.ids=e.ids,t.json=e.json,e.recordUndo!==void 0&&(t.recordUndo=e.recordUndo),t}run(e){const t=this.getEventWorkspace_();if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!KC(t,this.ids))if(e)lo(this.json,t);else for(e=0;ee.getBlockById(o)).filter(o=>o&&o.isShadow()).length===t.length};r($e.EVENT,ee.BLOCK_CREATE,Qh);var ep=class extends Ss{constructor(e,t){super(t),this.type=ee.THEME_CHANGE,this.themeName=e}toJson(){const e=super.toJson();if(!this.themeName)throw Error("The theme name is undefined. Either pass a theme name to the constructor, or call fromJson");return e.themeName=this.themeName,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new ep),t.themeName=e.themeName,t}};r($e.EVENT,ee.THEME_CHANGE,ep);var tp=class extends Ss{constructor(e,t,o,n,u){super(n),this.type=ee.VIEWPORT_CHANGE,this.viewTop=e,this.viewLeft=t,this.scale=o,this.oldScale=u}toJson(){const e=super.toJson();if(this.viewTop===void 0)throw Error("The view top is undefined. Either pass a value to the constructor, or call fromJson");if(this.viewLeft===void 0)throw Error("The view left is undefined. Either pass a value to the constructor, or call fromJson");if(this.scale===void 0)throw Error("The scale is undefined. Either pass a value to the constructor, or call fromJson");if(this.oldScale===void 0)throw Error("The old scale is undefined. Either pass a value to the constructor, or call fromJson");return e.viewTop=this.viewTop,e.viewLeft=this.viewLeft,e.scale=this.scale,e.oldScale=this.oldScale,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new tp),t.viewTop=e.viewTop,t.viewLeft=e.viewLeft,t.scale=e.scale,t.oldScale=e.oldScale,t}};r($e.EVENT,ee.VIEWPORT_CHANGE,tp);var xe;(function(e){e[e.INPUT_VALUE=1]="INPUT_VALUE",e[e.OUTPUT_VALUE=2]="OUTPUT_VALUE",e[e.NEXT_STATEMENT=3]="NEXT_STATEMENT",e[e.PREVIOUS_STATEMENT=4]="PREVIOUS_STATEMENT"})(xe||(xe={}));var un=class{constructor(e){this.connectionChecker=e,this.connections=[]}addConnection(e,t){t=this.calculateIndexForYPos(t),this.connections.splice(t,0,e)}findIndexOfConnection(e,t){if(!this.connections.length)return-1;const o=this.calculateIndexForYPos(t);if(o>=this.connections.length)return-1;t=e.y;let n=o;for(;0<=n&&this.connections[n].y===t;){if(this.connections[n]===e)return n;n--}for(n=o;ne)o=n;else{t=n;break}}return t}removeConnection(e,t){if(e=this.findIndexOfConnection(e,t),e===-1)throw Error("Unable to find connection in connectionDB.");this.connections.splice(e,1)}getNeighbours(e,t){function o(Ee){const dt=u-n[Ee].x,ut=g-n[Ee].y;return Math.sqrt(dt*dt+ut*ut)<=t&&le.push(n[Ee]),ut(this.flyout?i.config$$module$build$src$core$config.flyoutDragRadius:i.config$$module$build$src$core$config.dragRadius)}updateIsDraggingFromFlyout(){let e;if(!this.targetBlock||(e=this.flyout)==null||!e.isBlockCreatable(this.targetBlock))return!1;if(!this.flyout.targetWorkspace)throw Error(`Cannot update dragging from the flyout because the ' + + 'flyout's target workspace is undefined`);return!this.flyout.isScrollable()||this.flyout.isDragTowardWorkspace(this.currentDragDeltaXY)?(this.startWorkspace_=this.flyout.targetWorkspace,this.startWorkspace_.updateScreenCalculationsIfScrolled(),i.getGroup$$module$build$src$core$events$utils()||i.setGroup$$module$build$src$core$events$utils(!0),this.startBlock=null,this.targetBlock=this.flyout.createBlock(this.targetBlock),i.setSelected$$module$build$src$core$common(this.targetBlock),!0):!1}updateIsDraggingWorkspace(){if(!this.startWorkspace_)throw Error("Cannot update dragging the workspace because the start workspace is undefined");(this.flyout?this.flyout.isScrollable():this.startWorkspace_&&this.startWorkspace_.isDraggable())&&(this.dragging=!0,this.workspaceDragger=new vv(this.startWorkspace_),this.workspaceDragger.startDrag())}updateIsDragging(e){if(!this.startWorkspace_)throw Error("Cannot update dragging because the start workspace is undefined");if(this.calledUpdateIsDragging)throw Error("updateIsDragging_ should only be called once per gesture.");this.calledUpdateIsDragging=!0,this.flyout&&this.updateIsDraggingFromFlyout();const t=j();t&&ri(t)&&t.isMovable()?(this.dragging=!0,this.dragger=this.createDragger(t,this.startWorkspace_),this.dragger.onDragStart(e),this.dragger.onDrag(e,this.currentDragDeltaXY)):this.updateIsDraggingWorkspace()}createDragger(e,t){return new(y($e.BLOCK_DRAGGER,this.creatorWorkspace.options,!0))(e,t)}doStart(e){if(!this.startWorkspace_)throw Error("Cannot start the touch gesture becauase the start workspace is undefined");this.isPinchZoomEnabled=this.startWorkspace_.options.zoomOptions&&this.startWorkspace_.options.zoomOptions.pinch,be(e)?this.cancel():(this.gestureHasStarted=!0,Ki(),this.startWorkspace_.updateScreenCalculationsIfScrolled(),this.startWorkspace_.isMutator&&this.startWorkspace_.resize(),this.currentDropdownOwner=Mu(),this.startWorkspace_.hideChaff(!!this.flyout),this.startWorkspace_.markFocused(),this.mostRecentEvent=e,ed(),pe(e)?this.handleRightClick(e):(e.type.toLowerCase()==="pointerdown"&&e.pointerType!=="mouse"&&k(e,this),this.mouseDownXY=new ye(e.clientX,e.clientY),this.bindMouseEvents(e),this.isEnding_||this.handleTouchStart(e)))}bindMouseEvents(e){this.boundEvents.push(H(document,"pointerdown",null,this.handleStart.bind(this),!0)),this.boundEvents.push(H(document,"pointermove",null,this.handleMove.bind(this),!0)),this.boundEvents.push(H(document,"pointerup",null,this.handleUp.bind(this),!0)),e.preventDefault(),e.stopPropagation()}handleStart(e){this.isDragging()||(this.handleTouchStart(e),this.isMultiTouch()&&X())}handleMove(e){this.isDragging()&&O(e)||!this.isMultiTouch()?(this.updateFromEvent(e),this.workspaceDragger?this.workspaceDragger.drag(this.currentDragDeltaXY):this.dragger&&this.dragger.onDrag(this.mostRecentEvent,this.currentDragDeltaXY),e.preventDefault(),e.stopPropagation()):this.isMultiTouch()&&(this.handleTouchMove(e),X())}handleUp(e){if(this.isDragging()||this.handleTouchEnd(e),!this.isMultiTouch()||this.isDragging()){if(!O(e))return;if(this.updateFromEvent(e),X(),this.isEnding_){console.log("Trying to end a gesture recursively.");return}this.isEnding_=!0,this.dragger?this.dragger.onDragEnd(e,this.currentDragDeltaXY):this.workspaceDragger?this.workspaceDragger.endDrag(this.currentDragDeltaXY):this.isBubbleClick()||this.isCommentClick()||(this.isFieldClick()?this.doFieldClick():this.isIconClick()?this.doIconClick():this.isBlockClick()?this.doBlockClick():this.isWorkspaceClick()&&this.doWorkspaceClick(e))}e.preventDefault(),e.stopPropagation(),this.dispose()}handleTouchStart(e){var t=A(e);this.cachedPoints.set(t,this.getTouchPoint(e));var o=Array.from(this.cachedPoints.keys());o.length===2&&(t=this.cachedPoints.get(o[0]),o=this.cachedPoints.get(o[1]),this.startDistance=ye.distance(t,o),this.multiTouch=!0,e.preventDefault())}handleTouchMove(e){const t=A(e);this.cachedPoints.set(t,this.getTouchPoint(e)),this.isPinchZoomEnabled&&this.cachedPoints.size===2?this.handlePinch(e):(this.updateFromEvent(e),this.workspaceDragger?this.workspaceDragger.drag(this.currentDragDeltaXY):this.dragger&&this.dragger.onDrag(this.mostRecentEvent,this.currentDragDeltaXY),e.preventDefault(),e.stopPropagation())}handlePinch(e){var t=Array.from(this.cachedPoints.keys()),o=this.cachedPoints.get(t[0]);if(t=this.cachedPoints.get(t[1]),o=ye.distance(o,t)/this.startDistance,0this.previousScale){if(t=o-this.previousScale,t=0this.cachedPoints.size&&(this.cachedPoints.clear(),this.previousScale=0)}getTouchPoint(e){return this.startWorkspace_?new ye(e.pageX,e.pageY):null}isMultiTouch(){return this.multiTouch}cancel(){this.isEnding_||(X(),this.dragger?this.dragger.onDragEnd(this.mostRecentEvent,this.currentDragDeltaXY):this.workspaceDragger&&this.workspaceDragger.endDrag(this.currentDragDeltaXY),this.dispose())}handleRightClick(e){this.targetBlock?(this.bringBlockToFront(),this.targetBlock.workspace.hideChaff(!!this.flyout),this.targetBlock.showContextMenu(e)):this.startBubble?this.startBubble.showContextMenu(e):this.startComment?(this.startComment.workspace.hideChaff(),this.startComment.showContextMenu(e)):this.startWorkspace_&&!this.flyout&&(this.startWorkspace_.hideChaff(),this.startWorkspace_.showContextMenu(e)),e.preventDefault(),e.stopPropagation(),this.dispose()}handleWsStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");this.setStartWorkspace(t),this.mostRecentEvent=e,this.startBlock||this.startBubble||this.startComment||i.setSelected$$module$build$src$core$common(null),this.doStart(e)}fireWorkspaceClick(e){z(new(ne(ee.CLICK))(null,e.id,"workspace"))}handleFlyoutStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");this.setStartFlyout(t),this.handleWsStart(e,t.getWorkspace())}handleBlockStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBlockStart, but the gesture had already been started.");this.setStartBlock(t),this.mostRecentEvent=e}handleBubbleStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");this.setStartBubble(t),this.mostRecentEvent=e}handleCommentStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleCommentStart, but the gesture had already been started.");this.setStartComment(t),this.mostRecentEvent=e}doFieldClick(){if(!this.startField)throw Error("Cannot do a field click because the start field is undefined");this.currentDropdownOwner!==this.startField&&this.startField.showEditor(this.mostRecentEvent),this.bringBlockToFront()}doIconClick(){if(!this.startIcon)throw Error("Cannot do an icon click because the start icon is undefined");this.bringBlockToFront(),this.startIcon.onClick()}doBlockClick(){if(this.flyout&&this.flyout.autoClose){if(!this.targetBlock)throw Error("Cannot do a block click because the target block is undefined");if(this.targetBlock.isEnabled()){i.getGroup$$module$build$src$core$events$utils()||i.setGroup$$module$build$src$core$events$utils(!0);var e=this.flyout.createBlock(this.targetBlock);e.snapToGrid(),e.bumpNeighbours()}}else{if(!this.startWorkspace_)throw Error("Cannot do a block click because the start workspace is undefined");e=new(ne(ee.CLICK))(this.startBlock,this.startWorkspace_.id,"block"),z(e)}this.bringBlockToFront(),i.setGroup$$module$build$src$core$events$utils(!1)}doWorkspaceClick(e){e=this.creatorWorkspace,j()&&j().unselect(),this.fireWorkspaceClick(this.startWorkspace_||e)}bringBlockToFront(){this.targetBlock&&!this.flyout&&this.targetBlock.bringToFront()}setStartField(e){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");this.startField||(this.startField=e)}setStartIcon(e){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartIcon, but the gesture had already been started.");this.startIcon||(this.startIcon=e)}setStartBubble(e){this.startBubble||(this.startBubble=e)}setStartComment(e){this.startComment||(this.startComment=e)}setStartBlock(e){this.startBlock||this.startBubble||(this.startBlock=e,i.setSelected$$module$build$src$core$common(this.startBlock),e.isInFlyout&&e!==e.getRootBlock()?this.setTargetBlock(e.getRootBlock()):this.setTargetBlock(e))}setTargetBlock(e){e.isShadow()?this.setTargetBlock(e.getParent()):this.targetBlock=e}setStartWorkspace(e){this.startWorkspace_||(this.startWorkspace_=e)}setStartFlyout(e){this.flyout||(this.flyout=e)}isBubbleClick(){return!!this.startBubble&&!this.hasExceededDragRadius}isCommentClick(){return!!this.startComment&&!this.hasExceededDragRadius}isBlockClick(){return!!this.startBlock&&!this.hasExceededDragRadius&&!this.isFieldClick()&&!this.isIconClick()}isFieldClick(){return this.startField?this.startField.isClickable()&&!this.hasExceededDragRadius&&(!this.flyout||this.startField.isClickableInFlyout(this.flyout.autoClose)):!1}isIconClick(){if(!this.startIcon)return!1;const e=!this.flyout||!this.startIcon.isClickableInFlyout||this.startIcon.isClickableInFlyout(this.flyout.autoClose);return!this.hasExceededDragRadius&&e}isWorkspaceClick(){return!this.startBlock&&!this.startBubble&&!this.startField&&!this.hasExceededDragRadius}getCurrentDragger(){let e,t;return(t=(e=this.workspaceDragger)!=null?e:this.dragger)!=null?t:null}isDragging(){return this.dragging}hasStarted(){return this.gestureHasStarted}static inProgress(){const e=B();for(let t=0,o;o=e[t];t++)if(o.currentGesture_)return!0;return!1}},sp=class{constructor(e,t){this.pattern=e,this.scale=1;let o;this.spacing=(o=t.spacing)!=null?o:0;let n;this.length=(n=t.length)!=null?n:1,this.line2=(this.line1=e.firstChild)&&this.line1.nextSibling;let u;this.snapToGrid=(u=t.snap)!=null?u:!1}setSpacing(e){this.spacing=e,this.update(this.scale)}getSpacing(){return this.spacing}setLength(e){this.length=e,this.update(this.scale)}getLength(){return this.length}setSnapToGrid(e){this.snapToGrid=e}shouldSnap(){return this.snapToGrid}getPatternId(){return this.pattern.id}update(e){this.scale=e;var t=this.spacing*e;this.pattern.setAttribute("width",`${t}`),this.pattern.setAttribute("height",`${t}`),t=Math.floor(this.spacing/2)+.5;let o=t-this.length/2,n=t+this.length/2;t*=e,o*=e,n*=e,this.setLineAttributes(this.line1,e,o,n,t,t),this.setLineAttributes(this.line2,e,t,t,o,n)}setLineAttributes(e,t,o,n,u,g){e&&(e.setAttribute("stroke-width",`${t}`),e.setAttribute("x1",`${o}`),e.setAttribute("y1",`${u}`),e.setAttribute("x2",`${n}`),e.setAttribute("y2",`${g}`))}moveTo(e,t){this.pattern.setAttribute("x",`${e}`),this.pattern.setAttribute("y",`${t}`)}alignXY(e){var t=this.getSpacing();const o=t/2,n=Math.round(Math.round((e.x-o)/t)*t+o);return t=Math.round(Math.round((e.y-o)/t)*t+o),n===e.x&&t===e.y?e:new ye(n,t)}static createDom(e,t,o){e=ie(J.PATTERN,{id:"blocklyGridPattern"+e,patternUnits:"userSpaceOnUse"},o);let n,u;if(0<((n=t.length)!=null?n:1)&&0<((u=t.spacing)!=null?u:0)){ie(J.LINE,{stroke:t.colour},e);let g;(g=t.length)!=null&&g&&ie(J.LINE,{stroke:t.colour},e)}else ie(J.LINE,{},e);return e}},qC=class{constructor(e){this.workspace=e,this.layers=new Map,(e=e.getInjectionDiv())&&(this.dragLayer=this.createDragLayer(e),this.animationLayer=this.createAnimationLayer(e)),e=this.createLayer(Fo),Oe(e,"blocklyBlockCanvas"),e=this.createLayer(Sl),Oe(e,"blocklyBubbleCanvas")}createDragLayer(e){const t=ie(J.SVG,{class:"blocklyBlockDragSurface",xmlns:pr,"xmlns:html":Gs,"xmlns:xlink":is,version:"1.1"});return e.append(t),ie(J.G,{},t)}createAnimationLayer(e){const t=ie(J.SVG,{class:"blocklyAnimationLayer",xmlns:pr,"xmlns:html":Gs,"xmlns:xlink":is,version:"1.1"});return e.append(t),ie(J.G,{},t)}appendToAnimationLayer(e){let t;const o=(t=this.dragLayer)==null?void 0:t.getAttribute("transform");if(o){let u;(u=this.animationLayer)==null||u.setAttribute("transform",o)}let n;(n=this.animationLayer)==null||n.appendChild(e.getSvgRoot())}translateLayers(e,t){e=`translate(${e.x}, ${e.y}) scale(${t})`;let o;(o=this.dragLayer)==null||o.setAttribute("transform",e);for(const[,n]of this.layers)n.setAttribute("transform",e)}moveToDragLayer(e){let t;(t=this.dragLayer)==null||t.appendChild(e.getSvgRoot())}moveOffDragLayer(e,t){this.append(e,t)}append(e,t){this.layers.has(t)||this.createLayer(t);let o;(o=this.layers.get(t))==null||o.appendChild(e.getSvgRoot())}createLayer(e){const t=this.workspace.getSvgGroup(),o=ie(J.G,{});let n=!1;const u=[...this.layers].sort((g,I)=>g[0]-I[0]);for(const[g,I]of u)if(et[1]===e)?e:(this.sourceBlock_&&console.warn("Cannot set the dropdown's value to an unavailable option. Block type: "+this.sourceBlock_.type+", Field name: "+this.name+", Value: "+e),null)}doValueUpdate_(e){super.doValueUpdate_(e),e=this.getOptions(!0);for(let t=0,o;o=e[t];t++)o[1]===this.value_&&(this.selectedOption=o)}applyColour(){const e=this.sourceBlock_;this.borderRect_&&(this.borderRect_.setAttribute("stroke",e.getColourTertiary()),this.menu_?this.borderRect_.setAttribute("fill",e.getColourTertiary()):this.borderRect_.setAttribute("fill","transparent")),e&&this.arrow&&(e.isShadow()?this.arrow.style.fill=e.getColourSecondary():this.arrow.style.fill=e.getColour())}render_(){this.getTextContent().nodeValue="",this.imageElement.style.display="none";const e=this.selectedOption&&this.selectedOption[0];e&&typeof e=="object"?this.renderSelectedImage(e):this.renderSelectedText(),this.positionBorderRect_()}renderSelectedImage(e){const t=this.getSourceBlock();if(!t)throw new _t;this.imageElement.style.display="",this.imageElement.setAttributeNS(is,"xlink:href",e.src),this.imageElement.setAttribute("height",String(e.height)),this.imageElement.setAttribute("width",String(e.width));const o=Number(e.height);e=Number(e.width);var n=!!this.borderRect_;const u=Math.max(n?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,o+Qt.IMAGE_Y_PADDING);n=n?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let g;g=this.svgArrow?this.positionSVGArrow(e+n,u/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2):Io(this.arrow,this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY),this.size_.width=e+g+2*n,this.size_.height=u;let I=0;t.RTL?this.imageElement.setAttribute("x",`${n+g}`):(I=e+g,this.getTextElement().setAttribute("text-anchor","end"),this.imageElement.setAttribute("x",`${n}`)),this.imageElement.setAttribute("y",String(u/2-o/2)),this.positionTextElement_(I+n,e+g)}renderSelectedText(){this.getTextContent().nodeValue=this.getDisplayText_();var e=this.getTextElement();Oe(e,"blocklyDropdownText"),e.setAttribute("text-anchor","start");var t=!!this.borderRect_;e=Math.max(t?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,this.getConstants().FIELD_TEXT_HEIGHT);const o=Io(this.getTextElement(),this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY);t=t?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let n=0;this.svgArrow&&(n=this.positionSVGArrow(o+t,e/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2)),this.size_.width=o+n+2*t,this.size_.height=e,this.positionTextElement_(t,o)}positionSVGArrow(e,t){if(!this.svgArrow)return 0;const o=this.getSourceBlock();if(!o)throw new _t;const n=this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0,u=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_PADDING,g=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE;return this.svgArrow.setAttribute("transform","translate("+(o.RTL?n:e+u)+","+t+")"),g+u}getText_(){if(!this.selectedOption)return null;const e=this.selectedOption[0];return typeof e=="object"?e.alt:e}static fromJson(e){if(!e.options)throw Error("options are required for the dropdown field. The options property must be assigned an array of [humanReadableValue, languageNeutralValue] tuples.");return new this(e.options,void 0,e)}trimOptions(e){let t=!1;const o=e.map(([I,L])=>typeof I=="string"?[bt(I),L]:(t=!0,[I.alt!==null?Object.assign({},I,{alt:bt(I.alt)}):Object.assign({},I),L]));if(t||2>e.length)return{options:o};var n=o.map(([I])=>I),u=Qn(n);e=Ku(n,u);const g=Yu(n,u);return!e&&!g||u<=e+g?{options:o}:(u=e?n[0].substring(0,e-1):void 0,n=g?n[0].substr(1-g):void 0,{options:this.applyTrim(o,e,g),prefix:u,suffix:n})}applyTrim(e,t,o){return e.map(([n,u])=>[n.substring(t,n.length-o),u])}validateOptions(e){if(!Array.isArray(e))throw TypeError("FieldDropdown options must be an array.");if(!e.length)throw TypeError("FieldDropdown options must not be an empty array.");let t=!1;for(let o=0;oe.width)return t;if(e=this.getWorkspaceViewRect(e),this.workspace.RTL){var o=this.anchor.x-t;o-this.size.widthe.right&&(t=-(e.right-this.anchor.x))}else{o=t+this.anchor.x;const n=o+this.size.width;oe.right&&(t=e.right-this.anchor.x-this.size.width)}return t}getOptimalRelativeTop(e){let t=-this.size.height/4;if(this.size.height>e.height)return t;const o=this.anchor.y+t,n=o+this.size.height;return e=this.getWorkspaceViewRect(e),oe.bottom&&(t=e.bottom-this.anchor.y-this.size.height),t}getWorkspaceViewRect(e){const t=e.top;let o=e.top+e.height,n=e.left;return e=e.left+e.width,o-=this.getScrollbarThickness(),this.workspace.RTL?n-=this.getScrollbarThickness():e-=this.getScrollbarThickness(),new rt(t,o,n,e)}getScrollbarThickness(){return yt.scrollbarThickness/this.workspace.scale}renderTail(){const e=[];var t=this.size.width/2,o=this.size.height/2,n=-this.relativeLeft,u=-this.relativeTop;if(t===n&&o===u)e.push("M "+t+","+o);else{u-=o,n-=t,this.workspace.RTL&&(n*=-1);var g=Math.sqrt(u*u+n*n),I=Math.acos(n/g);0>u&&(I=2*Math.PI-I);var L=I+Math.PI/2;L>2*Math.PI&&(L-=2*Math.PI);var le=Math.sin(L);const dt=Math.cos(L);let ut=(this.size.width+this.size.height)/rs.TAIL_THICKNESS;ut=Math.min(ut,this.size.width,this.size.height)/4,L=1-rs.ANCHOR_RADIUS/g,n=t+L*n,u=o+L*u,L=t+ut*dt;const es=o+ut*le;t-=ut*dt,o-=ut*le,le=Aa(this.workspace.RTL?-rs.TAIL_ANGLE:rs.TAIL_ANGLE),le=I+le,le>2*Math.PI&&(le-=2*Math.PI),I=Math.sin(le)*g/rs.TAIL_BEND,g=Math.cos(le)*g/rs.TAIL_BEND,e.push("M"+L+","+es),e.push("C"+(L+g)+","+(es+I)+" "+n+","+u+" "+n+","+u),e.push("C"+n+","+u+" "+(t+g)+","+(o+I)+" "+t+","+o)}e.push("z");let Ee;(Ee=this.tail)==null||Ee.setAttribute("d",e.join(" "))}bringToFront(){let e;const t=(e=this.svgRoot)==null?void 0:e.parentNode;return this.svgRoot&&(t==null?void 0:t.lastChild)!==this.svgRoot?(t==null||t.appendChild(this.svgRoot),!0):!1}getRelativeToSurfaceXY(){return new ye(this.workspace.RTL?-this.relativeLeft+this.anchor.x-this.size.width:this.anchor.x+this.relativeLeft,this.anchor.y+this.relativeTop)}getSvgRoot(){return this.svgRoot}moveDuringDrag(e){this.moveTo(e.x,e.y),this.relativeLeft=this.workspace.RTL?this.anchor.x-e.x-this.size.width:e.x-this.anchor.x,this.relativeTop=e.y-this.anchor.y,this.renderTail()}setDragging(e){}setDeleteStyle(e){}isDeletable(){return!1}showContextMenu(e){}isMovable(){return!0}startDrag(){this.dragStrategy.startDrag()}drag(e){this.dragStrategy.drag(e)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){}unselect(){}};rs=nt,nt.BORDER_WIDTH=6,nt.DOUBLE_BORDER=2*rs.BORDER_WIDTH,nt.MIN_SIZE=rs.DOUBLE_BORDER,nt.TAIL_THICKNESS=1,nt.TAIL_ANGLE=20,nt.TAIL_BEND=4,nt.ANCHOR_RADIUS=8;var vo=class extends nt{constructor(e,t,o,n){super(t,o,n),this.workspace=t,this.anchor=o,this.ownerRect=n,this.autoLayout=!0,t=new gs(e),this.validateWorkspaceOptions(t),this.svgDialog=ie(J.SVG,{x:nt.BORDER_WIDTH,y:nt.BORDER_WIDTH},this.contentContainer),e.parentWorkspace=this.workspace,this.miniWorkspace=this.newWorkspaceSvg(new gs(e)),this.miniWorkspace.internalIsMutator=!0,e=this.miniWorkspace.createDom("blocklyMutatorBackground"),this.svgDialog.appendChild(e),t.languageTree&&(e.insertBefore(this.miniWorkspace.addFlyout(J.G),this.miniWorkspace.getCanvas()),e=this.miniWorkspace.getFlyout(),e==null||e.init(this.miniWorkspace),e==null||e.show(t.languageTree)),this.miniWorkspace.addChangeListener(this.onWorkspaceChange.bind(this));let u,g;(u=this.miniWorkspace.getFlyout())==null||(g=u.getWorkspace())==null||g.addChangeListener(this.onWorkspaceChange.bind(this)),this.updateBubbleSize()}dispose(){this.miniWorkspace.dispose(),super.dispose()}getWorkspace(){return this.miniWorkspace}addWorkspaceChangeListener(e){this.miniWorkspace.addChangeListener(e)}validateWorkspaceOptions(e){if(e.hasCategories)throw Error("The miniworkspace bubble does not support toolboxes with categories");if(e.hasTrashcan)throw Error("The miniworkspace bubble does not support trashcans");if(e.zoomOptions.controls||e.zoomOptions.wheel||e.zoomOptions.pinch)throw Error("The miniworkspace bubble does not support zooming");if(e.moveOptions.scrollbars||e.moveOptions.wheel||e.moveOptions.drag)throw Error("The miniworkspace bubble does not scrolling/moving the workspace");if(e.horizontalLayout)throw Error("The miniworkspace bubble does not support horizontal layouts")}onWorkspaceChange(){this.bumpBlocksIntoBounds(),this.updateBubbleSize()}bumpBlocksIntoBounds(){if(!this.miniWorkspace.isDragging())for(const e of this.miniWorkspace.getTopBlocks(!1)){const t=e.getRelativeToSurfaceXY();if(20>t.y&&e.moveBy(0,20-t.y),e.RTL){let o=-20;const n=this.miniWorkspace.getFlyout();n&&(o-=n.getWidth()),t.x>o&&e.moveBy(o-t.x,0)}else 20>t.x&&e.moveBy(20-t.x,0)}}updateBubbleSize(){if(!this.miniWorkspace.isDragging()){var e=this.getSize(),t=this.calculateWorkspaceSize();Math.abs(e.width-t.width)({kind:"block",type:o}))}),t}getAnchorLocation(){const e=Rl/2;return ye.sum(this.workspaceLocation,new ye(e,e))}getBubbleOwnerRect(){const e=this.sourceBlock.getSvgRoot().getBBox();return new rt(e.y,e.y+e.height,e.x,e.x+e.width)}createRootBlock(){if(!this.sourceBlock.decompose)throw Error("Blocks with mutator icons must include a decompose method");this.rootBlock=this.sourceBlock.decompose(this.miniWorkspaceBubble.getWorkspace());for(var e of this.rootBlock.getDescendants(!1))e.queueRender();this.rootBlock.setMovable(!1),this.rootBlock.setDeletable(!1);let t,o,n,u;e=(u=(t=this.miniWorkspaceBubble)==null||(o=t.getWorkspace())==null||(n=o.getFlyout())==null?void 0:n.getWidth())!=null?u:0,this.rootBlock.moveBy(this.rootBlock.RTL?-(e+Nl):Nl,Nl)}addSaveConnectionsListener(){this.sourceBlock.saveConnections&&this.rootBlock&&(this.saveConnectionsListener=()=>{this.sourceBlock.saveConnections&&this.rootBlock&&this.sourceBlock.saveConnections(this.rootBlock)},this.saveConnectionsListener(),this.sourceBlock.workspace.addChangeListener(this.saveConnectionsListener))}createMiniWorkspaceChangeListener(){return e=>{i.MutatorIcon$$module$build$src$core$icons$mutator_icon.isIgnorableMutatorEvent(e)||this.updateWorkspacePid||(this.updateWorkspacePid=setTimeout(()=>{this.updateWorkspacePid=null,this.recomposeSourceBlock()},0))}}static isIgnorableMutatorEvent(e){return e.isUiEvent||$(e)||T(e)&&e.element==="disabled"}recomposeSourceBlock(){if(this.rootBlock){if(!this.sourceBlock.compose)throw Error("Blocks with mutator icons must include a compose method");var e=i.getGroup$$module$build$src$core$events$utils();e||i.setGroup$$module$build$src$core$events$utils(!0);var t=mi.getExtraBlockState_(this.sourceBlock);this.sourceBlock.compose(this.rootBlock);var o=mi.getExtraBlockState_(this.sourceBlock);t!==o&&z(new(ne(ee.BLOCK_CHANGE))(this.sourceBlock,"mutation",null,t,o)),i.setGroup$$module$build$src$core$events$utils(e)}}getWorkspace(){let e;return(e=this.miniWorkspaceBubble)==null?void 0:e.getWorkspace()}},i.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE=Ct.MUTATOR,i.MutatorIcon$$module$build$src$core$icons$mutator_icon.WEIGHT=1,i.MutatorIcon$$module$build$src$core$icons$mutator_icon;var dn=Object.create(null),QC={allExtensions:dn};i.register$$module$build$src$core$extensions("parent_tooltip_when_inline",D$);var As={TEST_ONLY:QC};As.apply=Va,As.buildTooltipForDropdown=i.buildTooltipForDropdown$$module$build$src$core$extensions,As.buildTooltipWithFieldText=i.buildTooltipWithFieldText$$module$build$src$core$extensions,As.isRegistered=kd,As.register=i.register$$module$build$src$core$extensions,As.registerMixin=i.registerMixin$$module$build$src$core$extensions,As.registerMutator=i.registerMutator$$module$build$src$core$extensions,As.runAfterPageLoad=I$,As.unregister=k$;var Ye;(function(e){e[e.WIN_KEY_FF_LINUX=0]="WIN_KEY_FF_LINUX",e[e.MAC_ENTER=3]="MAC_ENTER",e[e.BACKSPACE=8]="BACKSPACE",e[e.TAB=9]="TAB",e[e.NUM_CENTER=12]="NUM_CENTER",e[e.ENTER=13]="ENTER",e[e.SHIFT=16]="SHIFT",e[e.CTRL=17]="CTRL",e[e.ALT=18]="ALT",e[e.PAUSE=19]="PAUSE",e[e.CAPS_LOCK=20]="CAPS_LOCK",e[e.ESC=27]="ESC",e[e.SPACE=32]="SPACE",e[e.PAGE_UP=33]="PAGE_UP",e[e.PAGE_DOWN=34]="PAGE_DOWN",e[e.END=35]="END",e[e.HOME=36]="HOME",e[e.LEFT=37]="LEFT",e[e.UP=38]="UP",e[e.RIGHT=39]="RIGHT",e[e.DOWN=40]="DOWN",e[e.PLUS_SIGN=43]="PLUS_SIGN",e[e.PRINT_SCREEN=44]="PRINT_SCREEN",e[e.INSERT=45]="INSERT",e[e.DELETE=46]="DELETE",e[e.ZERO=48]="ZERO",e[e.ONE=49]="ONE",e[e.TWO=50]="TWO",e[e.THREE=51]="THREE",e[e.FOUR=52]="FOUR",e[e.FIVE=53]="FIVE",e[e.SIX=54]="SIX",e[e.SEVEN=55]="SEVEN",e[e.EIGHT=56]="EIGHT",e[e.NINE=57]="NINE",e[e.FF_SEMICOLON=59]="FF_SEMICOLON",e[e.FF_EQUALS=61]="FF_EQUALS",e[e.FF_DASH=173]="FF_DASH",e[e.FF_HASH=163]="FF_HASH",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.AT_SIGN=64]="AT_SIGN",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.META=91]="META",e[e.WIN_KEY_RIGHT=92]="WIN_KEY_RIGHT",e[e.CONTEXT_MENU=93]="CONTEXT_MENU",e[e.NUM_ZERO=96]="NUM_ZERO",e[e.NUM_ONE=97]="NUM_ONE",e[e.NUM_TWO=98]="NUM_TWO",e[e.NUM_THREE=99]="NUM_THREE",e[e.NUM_FOUR=100]="NUM_FOUR",e[e.NUM_FIVE=101]="NUM_FIVE",e[e.NUM_SIX=102]="NUM_SIX",e[e.NUM_SEVEN=103]="NUM_SEVEN",e[e.NUM_EIGHT=104]="NUM_EIGHT",e[e.NUM_NINE=105]="NUM_NINE",e[e.NUM_MULTIPLY=106]="NUM_MULTIPLY",e[e.NUM_PLUS=107]="NUM_PLUS",e[e.NUM_MINUS=109]="NUM_MINUS",e[e.NUM_PERIOD=110]="NUM_PERIOD",e[e.NUM_DIVISION=111]="NUM_DIVISION",e[e.F1=112]="F1",e[e.F2=113]="F2",e[e.F3=114]="F3",e[e.F4=115]="F4",e[e.F5=116]="F5",e[e.F6=117]="F6",e[e.F7=118]="F7",e[e.F8=119]="F8",e[e.F9=120]="F9",e[e.F10=121]="F10",e[e.F11=122]="F11",e[e.F12=123]="F12",e[e.NUMLOCK=144]="NUMLOCK",e[e.SCROLL_LOCK=145]="SCROLL_LOCK",e[e.FIRST_MEDIA_KEY=166]="FIRST_MEDIA_KEY",e[e.LAST_MEDIA_KEY=183]="LAST_MEDIA_KEY",e[e.SEMICOLON=186]="SEMICOLON",e[e.DASH=189]="DASH",e[e.EQUALS=187]="EQUALS",e[e.COMMA=188]="COMMA",e[e.PERIOD=190]="PERIOD",e[e.SLASH=191]="SLASH",e[e.APOSTROPHE=192]="APOSTROPHE",e[e.TILDE=192]="TILDE",e[e.SINGLE_QUOTE=222]="SINGLE_QUOTE",e[e.OPEN_SQUARE_BRACKET=219]="OPEN_SQUARE_BRACKET",e[e.BACKSLASH=220]="BACKSLASH",e[e.CLOSE_SQUARE_BRACKET=221]="CLOSE_SQUARE_BRACKET",e[e.WIN_KEY=224]="WIN_KEY",e[e.MAC_FF_META=224]="MAC_FF_META",e[e.MAC_WK_CMD_LEFT=91]="MAC_WK_CMD_LEFT",e[e.MAC_WK_CMD_RIGHT=93]="MAC_WK_CMD_RIGHT",e[e.WIN_IME=229]="WIN_IME",e[e.VK_NONAME=252]="VK_NONAME",e[e.PHANTOM=255]="PHANTOM"})(Ye||(Ye={}));var yo={};yo.arc=vt,yo.curve=Xt,yo.line=Yi,yo.lineOnAxis=De,yo.lineTo=Hs,yo.moveBy=pt,yo.moveTo=St,yo.point=Me;var mt={};mt.Coordinate=ye,mt.KeyCodes=Ye,mt.Rect=rt,mt.Size=Xe,mt.Svg=J,mt.aria=fr,mt.array=Nb,mt.browserEvents=go,mt.colour=ps,mt.deprecation=pb,mt.dom=Dt,mt.extensions=As,mt.idGenerator=mh,mt.math=$l,mt.object=bv,mt.parsing=Tr,mt.string=nn,mt.style=Mo,mt.svgMath=ui,mt.svgPaths=yo,mt.toolbox=Lo,mt.userAgent=FC,mt.xml=Xi;var _v=class extends nt{constructor(e,t,o){super(e,t,o),this.workspace=e,this.anchor=t,this.ownerRect=o,this.resizePointerMoveListener=this.resizePointerUpListener=null,this.textChangeListeners=[],this.sizeChangeListeners=[],this.text="",this.DEFAULT_SIZE=new Xe(160+nt.DOUBLE_BORDER,80+nt.DOUBLE_BORDER),this.MIN_SIZE=new Xe(45+nt.DOUBLE_BORDER,20+nt.DOUBLE_BORDER),this.editable=!0,Oe(this.svgRoot,"blocklyTextInputBubble"),{inputRoot:this.inputRoot,textArea:this.textArea}=this.createEditor(this.contentContainer),this.resizeGroup=this.createResizeHandle(this.svgRoot,e),this.setSize(this.DEFAULT_SIZE,!0)}getText(){return this.text}setText(e){this.text=e,this.textArea.value=e,this.onTextChange()}setEditable(e){(this.editable=e)?this.textArea.removeAttribute("readonly"):this.textArea.setAttribute("readonly","")}isEditable(){return this.editable}addTextChangeListener(e){this.textChangeListeners.push(e)}addSizeChangeListener(e){this.sizeChangeListeners.push(e)}createEditor(e){e=ie(J.FOREIGNOBJECT,{x:nt.BORDER_WIDTH,y:nt.BORDER_WIDTH},e);const t=document.createElementNS(Gs,"body");t.setAttribute("xmlns",Gs),t.className="blocklyMinimalBody";const o=document.createElementNS(Gs,"textarea");return o.className="blocklyTextarea blocklyText",o.setAttribute("dir",this.workspace.RTL?"RTL":"LTR"),t.appendChild(o),e.appendChild(t),this.bindTextAreaEvents(o),setTimeout(()=>{o.focus()},0),{inputRoot:e,textArea:o}}bindTextAreaEvents(e){H(e,"wheel",this,t=>{t.stopPropagation()}),H(e,"focus",this,this.onStartEdit,!0),H(e,"change",this,this.onTextChange)}createResizeHandle(e,t){return e=ie(J.IMAGE,{class:"blocklyResizeHandle",href:`${t.options.pathToMedia}resize-handle.svg`},e),H(e,"pointerdown",this,this.onResizePointerDown),e}setSize(e,t=!1){e.width=Math.max(e.width,this.MIN_SIZE.width),e.height=Math.max(e.height,this.MIN_SIZE.height);const o=e.width-nt.DOUBLE_BORDER,n=e.height-nt.DOUBLE_BORDER;this.inputRoot.setAttribute("width",`${o}`),this.inputRoot.setAttribute("height",`${n}`),this.resizeGroup.setAttribute("y",`${n}`),this.workspace.RTL?this.resizeGroup.setAttribute("x",`${-nt.DOUBLE_BORDER}`):this.resizeGroup.setAttribute("x",`${o}`),super.setSize(e,t),this.onSizeChange()}getSize(){return super.getSize()}onResizePointerDown(e){this.bringToFront(),pe(e)||(za(this.workspace,e,new ye(this.workspace.RTL?-this.getSize().width:this.getSize().width,this.getSize().height)),this.resizePointerUpListener=H(document,"pointerup",this,this.onResizePointerUp),this.resizePointerMoveListener=H(document,"pointermove",this,this.onResizePointerMove),this.workspace.hideChaff()),e.stopPropagation()}onResizePointerUp(e){Y(),this.resizePointerUpListener&&(V(this.resizePointerUpListener),this.resizePointerUpListener=null),this.resizePointerMoveListener&&(V(this.resizePointerMoveListener),this.resizePointerMoveListener=null)}onResizePointerMove(e){e=Ua(this.workspace,e),this.setSize(new Xe(this.workspace.RTL?-e.x:e.x,e.y),!1),this.onSizeChange()}onStartEdit(){this.bringToFront()&&this.textArea.focus()}onTextChange(){this.text=this.textArea.value;for(const e of this.textChangeListeners)e()}onSizeChange(){for(const e of this.sizeChangeListeners)e()}};Be(` + Found: ${n}`))}if(t)throw TypeError("Found invalid FieldDropdown options.")}};Qt.CHECKMARK_OVERHANG=25,Qt.MAX_MENU_HEIGHT_VH=.45,Qt.ARROW_CHAR="▾",Qt.IMAGE_Y_OFFSET=5,Qt.IMAGE_Y_PADDING=2*Qt.IMAGE_Y_OFFSET,Us("field_dropdown",Qt);var wv=class{constructor(e,t){this.bubble=e,this.workspace=t,this.startLoc=null,this.inGroup=!1}isMovable(){return!0}startDrag(){(this.inGroup=!!i.getGroup$$module$build$src$core$events$utils())||i.setGroup$$module$build$src$core$events$utils(!0),this.startLoc=this.bubble.getRelativeToSurfaceXY(),this.workspace.setResizesEnabled(!1);let e;(e=this.workspace.getLayerManager())==null||e.moveToDragLayer(this.bubble),this.bubble.setDragging&&this.bubble.setDragging(!0)}drag(e){this.bubble.moveDuringDrag(e)}endDrag(){this.workspace.setResizesEnabled(!0),this.inGroup||i.setGroup$$module$build$src$core$events$utils(!1);let e;(e=this.workspace.getLayerManager())==null||e.moveOffDragLayer(this.bubble,Sl),this.bubble.setDragging(!1)}revertDrag(){this.startLoc&&this.bubble.moveDuringDrag(this.startLoc)}},rs,nt=class{constructor(e,t,o){this.workspace=e,this.anchor=t,this.ownerRect=o,this.size=new Xe(0,0),this.colour="#ffffff",this.disposed=!1,this.relativeLeft=this.relativeTop=0,this.dragStrategy=new wv(this,this.workspace),this.id=v(),this.svgRoot=ie(J.G,{class:"blocklyBubble"},e.getBubbleCanvas()),e=ie(J.G,{filter:`url(#${this.workspace.getRenderer().getConstants().embossFilterId})`},this.svgRoot),this.tail=ie(J.PATH,{class:"blocklyBubbleTail"},e),this.background=ie(J.RECT,{class:"blocklyDraggable",x:0,y:0,rx:rs.BORDER_WIDTH,ry:rs.BORDER_WIDTH},e),this.contentContainer=ie(J.G,{},this.svgRoot),H(this.background,"pointerdown",this,this.onMouseDown)}dispose(){Ze(this.svgRoot),this.disposed=!0}setAnchorLocation(e,t=!1){this.anchor=e,t?this.positionByRect(this.ownerRect):this.positionRelativeToAnchor(),this.renderTail()}setPositionRelativeToAnchor(e,t){this.relativeLeft=e,this.relativeTop=t,this.positionRelativeToAnchor(),this.renderTail()}getSize(){return this.size}setSize(e,t=!1){e.width=Math.max(e.width,rs.MIN_SIZE),e.height=Math.max(e.height,rs.MIN_SIZE),this.size=e,this.background.setAttribute("width",`${e.width}`),this.background.setAttribute("height",`${e.height}`),t?this.positionByRect(this.ownerRect):this.positionRelativeToAnchor(),this.renderTail()}getColour(){return this.colour}setColour(e){this.colour=e,this.tail.setAttribute("fill",e),this.background.setAttribute("fill",e)}onMouseDown(e){let t;(t=this.workspace.getGesture(e))==null||t.handleBubbleStart(e,this),this.bringToFront(),i.setSelected$$module$build$src$core$common(this)}positionRelativeToAnchor(){let e=this.anchor.x;e=this.workspace.RTL?e-(this.relativeLeft+this.size.width):e+this.relativeLeft,this.moveTo(e,this.relativeTop+this.anchor.y)}moveTo(e,t){this.svgRoot.setAttribute("transform",`translate(${e}, ${t})`)}positionByRect(e=new rt(0,0,0,0)){var t=this.workspace.getMetricsManager().getViewMetrics(!0),o=this.getOptimalRelativeLeft(t),n=this.getOptimalRelativeTop(t);const u={x:o,y:-this.size.height-this.workspace.getRenderer().getConstants().MIN_BLOCK_HEIGHT},g={x:-this.size.width-30,y:n};n={x:e.getWidth(),y:n};var I={x:o,y:e.getHeight()};o=e.getWidth()e.width)return t;if(e=this.getWorkspaceViewRect(e),this.workspace.RTL){var o=this.anchor.x-t;o-this.size.widthe.right&&(t=-(e.right-this.anchor.x))}else{o=t+this.anchor.x;const n=o+this.size.width;oe.right&&(t=e.right-this.anchor.x-this.size.width)}return t}getOptimalRelativeTop(e){let t=-this.size.height/4;if(this.size.height>e.height)return t;const o=this.anchor.y+t,n=o+this.size.height;return e=this.getWorkspaceViewRect(e),oe.bottom&&(t=e.bottom-this.anchor.y-this.size.height),t}getWorkspaceViewRect(e){const t=e.top;let o=e.top+e.height,n=e.left;return e=e.left+e.width,o-=this.getScrollbarThickness(),this.workspace.RTL?n-=this.getScrollbarThickness():e-=this.getScrollbarThickness(),new rt(t,o,n,e)}getScrollbarThickness(){return yt.scrollbarThickness/this.workspace.scale}renderTail(){const e=[];var t=this.size.width/2,o=this.size.height/2,n=-this.relativeLeft,u=-this.relativeTop;if(t===n&&o===u)e.push("M "+t+","+o);else{u-=o,n-=t,this.workspace.RTL&&(n*=-1);var g=Math.sqrt(u*u+n*n),I=Math.acos(n/g);0>u&&(I=2*Math.PI-I);var L=I+Math.PI/2;L>2*Math.PI&&(L-=2*Math.PI);var le=Math.sin(L);const dt=Math.cos(L);let ut=(this.size.width+this.size.height)/rs.TAIL_THICKNESS;ut=Math.min(ut,this.size.width,this.size.height)/4,L=1-rs.ANCHOR_RADIUS/g,n=t+L*n,u=o+L*u,L=t+ut*dt;const es=o+ut*le;t-=ut*dt,o-=ut*le,le=Aa(this.workspace.RTL?-rs.TAIL_ANGLE:rs.TAIL_ANGLE),le=I+le,le>2*Math.PI&&(le-=2*Math.PI),I=Math.sin(le)*g/rs.TAIL_BEND,g=Math.cos(le)*g/rs.TAIL_BEND,e.push("M"+L+","+es),e.push("C"+(L+g)+","+(es+I)+" "+n+","+u+" "+n+","+u),e.push("C"+n+","+u+" "+(t+g)+","+(o+I)+" "+t+","+o)}e.push("z");let Ee;(Ee=this.tail)==null||Ee.setAttribute("d",e.join(" "))}bringToFront(){let e;const t=(e=this.svgRoot)==null?void 0:e.parentNode;return this.svgRoot&&(t==null?void 0:t.lastChild)!==this.svgRoot?(t==null||t.appendChild(this.svgRoot),!0):!1}getRelativeToSurfaceXY(){return new ye(this.workspace.RTL?-this.relativeLeft+this.anchor.x-this.size.width:this.anchor.x+this.relativeLeft,this.anchor.y+this.relativeTop)}getSvgRoot(){return this.svgRoot}moveDuringDrag(e){this.moveTo(e.x,e.y),this.relativeLeft=this.workspace.RTL?this.anchor.x-e.x-this.size.width:e.x-this.anchor.x,this.relativeTop=e.y-this.anchor.y,this.renderTail()}setDragging(e){}setDeleteStyle(e){}isDeletable(){return!1}showContextMenu(e){}isMovable(){return!0}startDrag(){this.dragStrategy.startDrag()}drag(e){this.dragStrategy.drag(e)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){}unselect(){}};rs=nt,nt.BORDER_WIDTH=6,nt.DOUBLE_BORDER=2*rs.BORDER_WIDTH,nt.MIN_SIZE=rs.DOUBLE_BORDER,nt.TAIL_THICKNESS=1,nt.TAIL_ANGLE=20,nt.TAIL_BEND=4,nt.ANCHOR_RADIUS=8;var vo=class extends nt{constructor(e,t,o,n){super(t,o,n),this.workspace=t,this.anchor=o,this.ownerRect=n,this.autoLayout=!0,t=new gs(e),this.validateWorkspaceOptions(t),this.svgDialog=ie(J.SVG,{x:nt.BORDER_WIDTH,y:nt.BORDER_WIDTH},this.contentContainer),e.parentWorkspace=this.workspace,this.miniWorkspace=this.newWorkspaceSvg(new gs(e)),this.miniWorkspace.internalIsMutator=!0,e=this.miniWorkspace.createDom("blocklyMutatorBackground"),this.svgDialog.appendChild(e),t.languageTree&&(e.insertBefore(this.miniWorkspace.addFlyout(J.G),this.miniWorkspace.getCanvas()),e=this.miniWorkspace.getFlyout(),e==null||e.init(this.miniWorkspace),e==null||e.show(t.languageTree)),this.miniWorkspace.addChangeListener(this.onWorkspaceChange.bind(this));let u,g;(u=this.miniWorkspace.getFlyout())==null||(g=u.getWorkspace())==null||g.addChangeListener(this.onWorkspaceChange.bind(this)),this.updateBubbleSize()}dispose(){this.miniWorkspace.dispose(),super.dispose()}getWorkspace(){return this.miniWorkspace}addWorkspaceChangeListener(e){this.miniWorkspace.addChangeListener(e)}validateWorkspaceOptions(e){if(e.hasCategories)throw Error("The miniworkspace bubble does not support toolboxes with categories");if(e.hasTrashcan)throw Error("The miniworkspace bubble does not support trashcans");if(e.zoomOptions.controls||e.zoomOptions.wheel||e.zoomOptions.pinch)throw Error("The miniworkspace bubble does not support zooming");if(e.moveOptions.scrollbars||e.moveOptions.wheel||e.moveOptions.drag)throw Error("The miniworkspace bubble does not scrolling/moving the workspace");if(e.horizontalLayout)throw Error("The miniworkspace bubble does not support horizontal layouts")}onWorkspaceChange(){this.bumpBlocksIntoBounds(),this.updateBubbleSize()}bumpBlocksIntoBounds(){if(!this.miniWorkspace.isDragging())for(const e of this.miniWorkspace.getTopBlocks(!1)){const t=e.getRelativeToSurfaceXY();if(20>t.y&&e.moveBy(0,20-t.y),e.RTL){let o=-20;const n=this.miniWorkspace.getFlyout();n&&(o-=n.getWidth()),t.x>o&&e.moveBy(o-t.x,0)}else 20>t.x&&e.moveBy(20-t.x,0)}}updateBubbleSize(){if(!this.miniWorkspace.isDragging()){var e=this.getSize(),t=this.calculateWorkspaceSize();Math.abs(e.width-t.width)({kind:"block",type:o}))}),t}getAnchorLocation(){const e=Rl/2;return ye.sum(this.workspaceLocation,new ye(e,e))}getBubbleOwnerRect(){const e=this.sourceBlock.getSvgRoot().getBBox();return new rt(e.y,e.y+e.height,e.x,e.x+e.width)}createRootBlock(){if(!this.sourceBlock.decompose)throw Error("Blocks with mutator icons must include a decompose method");this.rootBlock=this.sourceBlock.decompose(this.miniWorkspaceBubble.getWorkspace());for(var e of this.rootBlock.getDescendants(!1))e.queueRender();this.rootBlock.setMovable(!1),this.rootBlock.setDeletable(!1);let t,o,n,u;e=(u=(t=this.miniWorkspaceBubble)==null||(o=t.getWorkspace())==null||(n=o.getFlyout())==null?void 0:n.getWidth())!=null?u:0,this.rootBlock.moveBy(this.rootBlock.RTL?-(e+Nl):Nl,Nl)}addSaveConnectionsListener(){this.sourceBlock.saveConnections&&this.rootBlock&&(this.saveConnectionsListener=()=>{this.sourceBlock.saveConnections&&this.rootBlock&&this.sourceBlock.saveConnections(this.rootBlock)},this.saveConnectionsListener(),this.sourceBlock.workspace.addChangeListener(this.saveConnectionsListener))}createMiniWorkspaceChangeListener(){return e=>{i.MutatorIcon$$module$build$src$core$icons$mutator_icon.isIgnorableMutatorEvent(e)||this.updateWorkspacePid||(this.updateWorkspacePid=setTimeout(()=>{this.updateWorkspacePid=null,this.recomposeSourceBlock()},0))}}static isIgnorableMutatorEvent(e){return e.isUiEvent||$(e)||T(e)&&e.element==="disabled"}recomposeSourceBlock(){if(this.rootBlock){if(!this.sourceBlock.compose)throw Error("Blocks with mutator icons must include a compose method");var e=i.getGroup$$module$build$src$core$events$utils();e||i.setGroup$$module$build$src$core$events$utils(!0);var t=mi.getExtraBlockState_(this.sourceBlock);this.sourceBlock.compose(this.rootBlock);var o=mi.getExtraBlockState_(this.sourceBlock);t!==o&&z(new(ne(ee.BLOCK_CHANGE))(this.sourceBlock,"mutation",null,t,o)),i.setGroup$$module$build$src$core$events$utils(e)}}getWorkspace(){let e;return(e=this.miniWorkspaceBubble)==null?void 0:e.getWorkspace()}},i.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE=Ct.MUTATOR,i.MutatorIcon$$module$build$src$core$icons$mutator_icon.WEIGHT=1,i.MutatorIcon$$module$build$src$core$icons$mutator_icon;var dn=Object.create(null),QC={allExtensions:dn};i.register$$module$build$src$core$extensions("parent_tooltip_when_inline",O$);var As={TEST_ONLY:QC};As.apply=Va,As.buildTooltipForDropdown=i.buildTooltipForDropdown$$module$build$src$core$extensions,As.buildTooltipWithFieldText=i.buildTooltipWithFieldText$$module$build$src$core$extensions,As.isRegistered=kd,As.register=i.register$$module$build$src$core$extensions,As.registerMixin=i.registerMixin$$module$build$src$core$extensions,As.registerMutator=i.registerMutator$$module$build$src$core$extensions,As.runAfterPageLoad=D$,As.unregister=T$;var Ye;(function(e){e[e.WIN_KEY_FF_LINUX=0]="WIN_KEY_FF_LINUX",e[e.MAC_ENTER=3]="MAC_ENTER",e[e.BACKSPACE=8]="BACKSPACE",e[e.TAB=9]="TAB",e[e.NUM_CENTER=12]="NUM_CENTER",e[e.ENTER=13]="ENTER",e[e.SHIFT=16]="SHIFT",e[e.CTRL=17]="CTRL",e[e.ALT=18]="ALT",e[e.PAUSE=19]="PAUSE",e[e.CAPS_LOCK=20]="CAPS_LOCK",e[e.ESC=27]="ESC",e[e.SPACE=32]="SPACE",e[e.PAGE_UP=33]="PAGE_UP",e[e.PAGE_DOWN=34]="PAGE_DOWN",e[e.END=35]="END",e[e.HOME=36]="HOME",e[e.LEFT=37]="LEFT",e[e.UP=38]="UP",e[e.RIGHT=39]="RIGHT",e[e.DOWN=40]="DOWN",e[e.PLUS_SIGN=43]="PLUS_SIGN",e[e.PRINT_SCREEN=44]="PRINT_SCREEN",e[e.INSERT=45]="INSERT",e[e.DELETE=46]="DELETE",e[e.ZERO=48]="ZERO",e[e.ONE=49]="ONE",e[e.TWO=50]="TWO",e[e.THREE=51]="THREE",e[e.FOUR=52]="FOUR",e[e.FIVE=53]="FIVE",e[e.SIX=54]="SIX",e[e.SEVEN=55]="SEVEN",e[e.EIGHT=56]="EIGHT",e[e.NINE=57]="NINE",e[e.FF_SEMICOLON=59]="FF_SEMICOLON",e[e.FF_EQUALS=61]="FF_EQUALS",e[e.FF_DASH=173]="FF_DASH",e[e.FF_HASH=163]="FF_HASH",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.AT_SIGN=64]="AT_SIGN",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.META=91]="META",e[e.WIN_KEY_RIGHT=92]="WIN_KEY_RIGHT",e[e.CONTEXT_MENU=93]="CONTEXT_MENU",e[e.NUM_ZERO=96]="NUM_ZERO",e[e.NUM_ONE=97]="NUM_ONE",e[e.NUM_TWO=98]="NUM_TWO",e[e.NUM_THREE=99]="NUM_THREE",e[e.NUM_FOUR=100]="NUM_FOUR",e[e.NUM_FIVE=101]="NUM_FIVE",e[e.NUM_SIX=102]="NUM_SIX",e[e.NUM_SEVEN=103]="NUM_SEVEN",e[e.NUM_EIGHT=104]="NUM_EIGHT",e[e.NUM_NINE=105]="NUM_NINE",e[e.NUM_MULTIPLY=106]="NUM_MULTIPLY",e[e.NUM_PLUS=107]="NUM_PLUS",e[e.NUM_MINUS=109]="NUM_MINUS",e[e.NUM_PERIOD=110]="NUM_PERIOD",e[e.NUM_DIVISION=111]="NUM_DIVISION",e[e.F1=112]="F1",e[e.F2=113]="F2",e[e.F3=114]="F3",e[e.F4=115]="F4",e[e.F5=116]="F5",e[e.F6=117]="F6",e[e.F7=118]="F7",e[e.F8=119]="F8",e[e.F9=120]="F9",e[e.F10=121]="F10",e[e.F11=122]="F11",e[e.F12=123]="F12",e[e.NUMLOCK=144]="NUMLOCK",e[e.SCROLL_LOCK=145]="SCROLL_LOCK",e[e.FIRST_MEDIA_KEY=166]="FIRST_MEDIA_KEY",e[e.LAST_MEDIA_KEY=183]="LAST_MEDIA_KEY",e[e.SEMICOLON=186]="SEMICOLON",e[e.DASH=189]="DASH",e[e.EQUALS=187]="EQUALS",e[e.COMMA=188]="COMMA",e[e.PERIOD=190]="PERIOD",e[e.SLASH=191]="SLASH",e[e.APOSTROPHE=192]="APOSTROPHE",e[e.TILDE=192]="TILDE",e[e.SINGLE_QUOTE=222]="SINGLE_QUOTE",e[e.OPEN_SQUARE_BRACKET=219]="OPEN_SQUARE_BRACKET",e[e.BACKSLASH=220]="BACKSLASH",e[e.CLOSE_SQUARE_BRACKET=221]="CLOSE_SQUARE_BRACKET",e[e.WIN_KEY=224]="WIN_KEY",e[e.MAC_FF_META=224]="MAC_FF_META",e[e.MAC_WK_CMD_LEFT=91]="MAC_WK_CMD_LEFT",e[e.MAC_WK_CMD_RIGHT=93]="MAC_WK_CMD_RIGHT",e[e.WIN_IME=229]="WIN_IME",e[e.VK_NONAME=252]="VK_NONAME",e[e.PHANTOM=255]="PHANTOM"})(Ye||(Ye={}));var yo={};yo.arc=vt,yo.curve=Xt,yo.line=Yi,yo.lineOnAxis=De,yo.lineTo=Hs,yo.moveBy=pt,yo.moveTo=St,yo.point=Me;var mt={};mt.Coordinate=ye,mt.KeyCodes=Ye,mt.Rect=rt,mt.Size=Xe,mt.Svg=J,mt.aria=fr,mt.array=Lb,mt.browserEvents=go,mt.colour=ps,mt.deprecation=mb,mt.dom=Dt,mt.extensions=As,mt.idGenerator=mh,mt.math=$l,mt.object=yv,mt.parsing=Tr,mt.string=nn,mt.style=Mo,mt.svgMath=ui,mt.svgPaths=yo,mt.toolbox=Lo,mt.userAgent=FC,mt.xml=Xi;var kv=class extends nt{constructor(e,t,o){super(e,t,o),this.workspace=e,this.anchor=t,this.ownerRect=o,this.resizePointerMoveListener=this.resizePointerUpListener=null,this.textChangeListeners=[],this.sizeChangeListeners=[],this.text="",this.DEFAULT_SIZE=new Xe(160+nt.DOUBLE_BORDER,80+nt.DOUBLE_BORDER),this.MIN_SIZE=new Xe(45+nt.DOUBLE_BORDER,20+nt.DOUBLE_BORDER),this.editable=!0,Oe(this.svgRoot,"blocklyTextInputBubble"),{inputRoot:this.inputRoot,textArea:this.textArea}=this.createEditor(this.contentContainer),this.resizeGroup=this.createResizeHandle(this.svgRoot,e),this.setSize(this.DEFAULT_SIZE,!0)}getText(){return this.text}setText(e){this.text=e,this.textArea.value=e,this.onTextChange()}setEditable(e){(this.editable=e)?this.textArea.removeAttribute("readonly"):this.textArea.setAttribute("readonly","")}isEditable(){return this.editable}addTextChangeListener(e){this.textChangeListeners.push(e)}addSizeChangeListener(e){this.sizeChangeListeners.push(e)}createEditor(e){e=ie(J.FOREIGNOBJECT,{x:nt.BORDER_WIDTH,y:nt.BORDER_WIDTH},e);const t=document.createElementNS(Gs,"body");t.setAttribute("xmlns",Gs),t.className="blocklyMinimalBody";const o=document.createElementNS(Gs,"textarea");return o.className="blocklyTextarea blocklyText",o.setAttribute("dir",this.workspace.RTL?"RTL":"LTR"),t.appendChild(o),e.appendChild(t),this.bindTextAreaEvents(o),setTimeout(()=>{o.focus()},0),{inputRoot:e,textArea:o}}bindTextAreaEvents(e){H(e,"wheel",this,t=>{t.stopPropagation()}),H(e,"focus",this,this.onStartEdit,!0),H(e,"change",this,this.onTextChange)}createResizeHandle(e,t){return e=ie(J.IMAGE,{class:"blocklyResizeHandle",href:`${t.options.pathToMedia}resize-handle.svg`},e),H(e,"pointerdown",this,this.onResizePointerDown),e}setSize(e,t=!1){e.width=Math.max(e.width,this.MIN_SIZE.width),e.height=Math.max(e.height,this.MIN_SIZE.height);const o=e.width-nt.DOUBLE_BORDER,n=e.height-nt.DOUBLE_BORDER;this.inputRoot.setAttribute("width",`${o}`),this.inputRoot.setAttribute("height",`${n}`),this.resizeGroup.setAttribute("y",`${n}`),this.workspace.RTL?this.resizeGroup.setAttribute("x",`${-nt.DOUBLE_BORDER}`):this.resizeGroup.setAttribute("x",`${o}`),super.setSize(e,t),this.onSizeChange()}getSize(){return super.getSize()}onResizePointerDown(e){this.bringToFront(),pe(e)||(za(this.workspace,e,new ye(this.workspace.RTL?-this.getSize().width:this.getSize().width,this.getSize().height)),this.resizePointerUpListener=H(document,"pointerup",this,this.onResizePointerUp),this.resizePointerMoveListener=H(document,"pointermove",this,this.onResizePointerMove),this.workspace.hideChaff()),e.stopPropagation()}onResizePointerUp(e){Y(),this.resizePointerUpListener&&(V(this.resizePointerUpListener),this.resizePointerUpListener=null),this.resizePointerMoveListener&&(V(this.resizePointerMoveListener),this.resizePointerMoveListener=null)}onResizePointerMove(e){e=Ua(this.workspace,e),this.setSize(new Xe(this.workspace.RTL?-e.x:e.x,e.y),!1),this.onSizeChange()}onStartEdit(){this.bringToFront()&&this.textArea.focus()}onTextChange(){this.text=this.textArea.value;for(const e of this.textChangeListeners)e()}onSizeChange(){for(const e of this.sizeChangeListeners)e()}};Be(` .blocklyTextInputBubble .blocklyTextarea { background-color: var(--commentFillColour); border: 0; @@ -855,13 +855,13 @@ children`),this.state=e}},ov=class extends en{constructor(e,t,o){super(`Cannot a width: 100%; height: 100%; } -`);var op={};op.register=Sd,op.unregister=A$;var ip=17,wv=160,kv=80,_o=class extends Ol{constructor(e){super(e),this.sourceBlock=e,this.textInputBubble=null,this.text="",this.bubbleSize=new Xe(wv,kv),this.bubbleVisiblity=!1}getType(){return _o.TYPE}initView(e){this.svgRoot||(super.initView(e),ie(J.CIRCLE,{class:"blocklyIconShape",r:"8",cx:"8",cy:"8"},this.svgRoot),ie(J.PATH,{class:"blocklyIconSymbol",d:"m6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.4050.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25-1.201,0.998 -1.201,1.528 -1.204,2.19z"},this.svgRoot),ie(J.RECT,{class:"blocklyIconSymbol",x:"6.8",y:"10.78",height:"2",width:"2"},this.svgRoot),Oe(this.svgRoot,"blockly-icon-comment"))}dispose(){super.dispose();let e;(e=this.textInputBubble)==null||e.dispose()}getWeight(){return _o.WEIGHT}getSize(){return new Xe(ip,ip)}applyColour(){super.applyColour();const e=this.sourceBlock.getColour();let t;(t=this.textInputBubble)==null||t.setColour(e)}updateEditable(){const e=this,t=()=>super.updateEditable;return ge.asyncExecutePromiseGeneratorFunction(function*(){t().call(e),e.bubbleIsVisible()&&(yield e.setBubbleVisible(!1),yield e.setBubbleVisible(!0))})}onLocationChange(e){super.onLocationChange(e),e=this.getAnchorLocation();let t;(t=this.textInputBubble)==null||t.setAnchorLocation(e)}setText(e){const t=this.text;z(new(ne(ee.BLOCK_CHANGE))(this.sourceBlock,"comment",null,t,e)),this.text=e;let o;(o=this.textInputBubble)==null||o.setText(this.text)}getText(){return this.text}setBubbleSize(e){this.bubbleSize=e;let t;(t=this.textInputBubble)==null||t.setSize(this.bubbleSize,!0)}getBubbleSize(){return this.bubbleSize}saveState(){return this.text?{text:this.text,pinned:this.bubbleIsVisible(),height:this.bubbleSize.height,width:this.bubbleSize.width}:null}loadState(e){let t;this.text=(t=e.text)!=null?t:"";let o,n;this.bubbleSize=new Xe((o=e.width)!=null?o:wv,(n=e.height)!=null?n:kv);let u;this.bubbleVisiblity=(u=e.pinned)!=null?u:!1,this.setBubbleVisible(this.bubbleVisiblity)}onClick(){super.onClick(),this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}onTextChange(){if(this.textInputBubble){var e=this.textInputBubble.getText();this.text!==e&&(z(new(ne(ee.BLOCK_CHANGE))(this.sourceBlock,"comment",null,this.text,e)),this.text=e)}}onSizeChange(){this.textInputBubble&&(this.bubbleSize=this.textInputBubble.getSize())}bubbleIsVisible(){return this.bubbleVisiblity}setBubbleVisible(e){const t=this;return ge.asyncExecutePromiseGeneratorFunction(function*(){t.bubbleVisiblity!==e&&(t.bubbleVisiblity=e,yield Ts(),!t.sourceBlock.rendered||t.sourceBlock.isInFlyout||t.sourceBlock.isInsertionMarker()||(e?(t.sourceBlock.isEditable()?t.showEditableBubble():t.showNonEditableBubble(),t.applyColour()):t.hideBubble(),z(new(ne(ee.BUBBLE_OPEN))(t.sourceBlock,e,"comment"))))})}showEditableBubble(){this.createBubble();let e;(e=this.textInputBubble)==null||e.addTextChangeListener(()=>this.onTextChange());let t;(t=this.textInputBubble)==null||t.addSizeChangeListener(()=>this.onSizeChange())}showNonEditableBubble(){this.createBubble();let e;(e=this.textInputBubble)==null||e.setEditable(!1)}createBubble(){this.textInputBubble=new _v(this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect()),this.textInputBubble.setText(this.getText()),this.textInputBubble.setSize(this.bubbleSize,!0)}hideBubble(){let e;(e=this.textInputBubble)==null||e.dispose(),this.textInputBubble=null}getAnchorLocation(){const e=ip/2;return ye.sum(this.workspaceLocation,new ye(e,e))}getBubbleOwnerRect(){return this.sourceBlock.getBoundingRectangleWithoutChildren()}};_o.TYPE=Ct.COMMENT,_o.WEIGHT=3,Sd(_o.TYPE,_o);var Cv=class extends Error{constructor(e){super(`Tried to append an icon of type ${e.getType()} when an icon of that type already exists on the block. Use getIcon to access the existing icon.`),this.icon=e}},Tv={};Tv.DuplicateIconType=Cv;var Sv=class extends nt{constructor(e,t,o,n){super(t,o,n),this.text=e,this.workspace=t,this.anchor=o,this.ownerRect=n,this.paragraph=this.stringToSvg(e,this.contentContainer),this.updateBubbleSize()}getText(){return this.text}setText(e){this.text=e,Ze(this.paragraph),this.paragraph=this.stringToSvg(e,this.contentContainer),this.updateBubbleSize()}stringToSvg(e,t){return t=this.createParagraph(t),e=this.createTextFragments(t,e),this.workspace.RTL&&this.rightAlignTextFragments(t.getBBox().width,e),t}createParagraph(e){return ie(J.G,{class:"blocklyText blocklyBubbleText blocklyNoPointerEvents",transform:`translate(0,${nt.BORDER_WIDTH})`,style:`direction: ${this.workspace.RTL?"rtl":"ltr"}`},e)}createTextFragments(e,t){let o=1;return t.split(` +`);var op={};op.register=Sd,op.unregister=R$;var ip=17,Cv=160,Tv=80,_o=class extends Ol{constructor(e){super(e),this.sourceBlock=e,this.textInputBubble=null,this.text="",this.bubbleSize=new Xe(Cv,Tv),this.bubbleVisiblity=!1}getType(){return _o.TYPE}initView(e){this.svgRoot||(super.initView(e),ie(J.CIRCLE,{class:"blocklyIconShape",r:"8",cx:"8",cy:"8"},this.svgRoot),ie(J.PATH,{class:"blocklyIconSymbol",d:"m6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.4050.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25-1.201,0.998 -1.201,1.528 -1.204,2.19z"},this.svgRoot),ie(J.RECT,{class:"blocklyIconSymbol",x:"6.8",y:"10.78",height:"2",width:"2"},this.svgRoot),Oe(this.svgRoot,"blockly-icon-comment"))}dispose(){super.dispose();let e;(e=this.textInputBubble)==null||e.dispose()}getWeight(){return _o.WEIGHT}getSize(){return new Xe(ip,ip)}applyColour(){super.applyColour();const e=this.sourceBlock.getColour();let t;(t=this.textInputBubble)==null||t.setColour(e)}updateEditable(){const e=this,t=()=>super.updateEditable;return ge.asyncExecutePromiseGeneratorFunction(function*(){t().call(e),e.bubbleIsVisible()&&(yield e.setBubbleVisible(!1),yield e.setBubbleVisible(!0))})}onLocationChange(e){super.onLocationChange(e),e=this.getAnchorLocation();let t;(t=this.textInputBubble)==null||t.setAnchorLocation(e)}setText(e){const t=this.text;z(new(ne(ee.BLOCK_CHANGE))(this.sourceBlock,"comment",null,t,e)),this.text=e;let o;(o=this.textInputBubble)==null||o.setText(this.text)}getText(){return this.text}setBubbleSize(e){this.bubbleSize=e;let t;(t=this.textInputBubble)==null||t.setSize(this.bubbleSize,!0)}getBubbleSize(){return this.bubbleSize}saveState(){return this.text?{text:this.text,pinned:this.bubbleIsVisible(),height:this.bubbleSize.height,width:this.bubbleSize.width}:null}loadState(e){let t;this.text=(t=e.text)!=null?t:"";let o,n;this.bubbleSize=new Xe((o=e.width)!=null?o:Cv,(n=e.height)!=null?n:Tv);let u;this.bubbleVisiblity=(u=e.pinned)!=null?u:!1,this.setBubbleVisible(this.bubbleVisiblity)}onClick(){super.onClick(),this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}onTextChange(){if(this.textInputBubble){var e=this.textInputBubble.getText();this.text!==e&&(z(new(ne(ee.BLOCK_CHANGE))(this.sourceBlock,"comment",null,this.text,e)),this.text=e)}}onSizeChange(){this.textInputBubble&&(this.bubbleSize=this.textInputBubble.getSize())}bubbleIsVisible(){return this.bubbleVisiblity}setBubbleVisible(e){const t=this;return ge.asyncExecutePromiseGeneratorFunction(function*(){t.bubbleVisiblity!==e&&(t.bubbleVisiblity=e,yield Ts(),!t.sourceBlock.rendered||t.sourceBlock.isInFlyout||t.sourceBlock.isInsertionMarker()||(e?(t.sourceBlock.isEditable()?t.showEditableBubble():t.showNonEditableBubble(),t.applyColour()):t.hideBubble(),z(new(ne(ee.BUBBLE_OPEN))(t.sourceBlock,e,"comment"))))})}showEditableBubble(){this.createBubble();let e;(e=this.textInputBubble)==null||e.addTextChangeListener(()=>this.onTextChange());let t;(t=this.textInputBubble)==null||t.addSizeChangeListener(()=>this.onSizeChange())}showNonEditableBubble(){this.createBubble();let e;(e=this.textInputBubble)==null||e.setEditable(!1)}createBubble(){this.textInputBubble=new kv(this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect()),this.textInputBubble.setText(this.getText()),this.textInputBubble.setSize(this.bubbleSize,!0)}hideBubble(){let e;(e=this.textInputBubble)==null||e.dispose(),this.textInputBubble=null}getAnchorLocation(){const e=ip/2;return ye.sum(this.workspaceLocation,new ye(e,e))}getBubbleOwnerRect(){return this.sourceBlock.getBoundingRectangleWithoutChildren()}};_o.TYPE=Ct.COMMENT,_o.WEIGHT=3,Sd(_o.TYPE,_o);var Sv=class extends Error{constructor(e){super(`Tried to append an icon of type ${e.getType()} when an icon of that type already exists on the block. Use getIcon to access the existing icon.`),this.icon=e}},Ev={};Ev.DuplicateIconType=Sv;var Iv=class extends nt{constructor(e,t,o,n){super(t,o,n),this.text=e,this.workspace=t,this.anchor=o,this.ownerRect=n,this.paragraph=this.stringToSvg(e,this.contentContainer),this.updateBubbleSize()}getText(){return this.text}setText(e){this.text=e,Ze(this.paragraph),this.paragraph=this.stringToSvg(e,this.contentContainer),this.updateBubbleSize()}stringToSvg(e,t){return t=this.createParagraph(t),e=this.createTextFragments(t,e),this.workspace.RTL&&this.rightAlignTextFragments(t.getBBox().width,e),t}createParagraph(e){return ie(J.G,{class:"blocklyText blocklyBubbleText blocklyNoPointerEvents",transform:`translate(0,${nt.BORDER_WIDTH})`,style:`direction: ${this.workspace.RTL?"rtl":"ltr"}`},e)}createTextFragments(e,t){let o=1;return t.split(` `).map(n=>{const u=ie(J.TEXT,{y:`${o}em`,x:nt.BORDER_WIDTH},e);return n=document.createTextNode(n),u.appendChild(n),o+=1,u})}rightAlignTextFragments(e,t){for(const o of t)o.setAttribute("text-anchor","start"),o.setAttribute("x",`${e+nt.BORDER_WIDTH}`)}updateBubbleSize(){const e=this.paragraph.getBBox();this.setSize(new Xe(e.width+2*nt.BORDER_WIDTH,e.height+2*nt.BORDER_WIDTH),!0)}},np=17,wo=class extends Ol{constructor(e){super(e),this.sourceBlock=e,this.textMap=new Map,this.textBubble=null}getType(){return wo.TYPE}initView(e){this.svgRoot||(super.initView(e),ie(J.PATH,{class:"blocklyIconShape",d:"M2,15Q-1,15 0.5,12L6.5,1.7Q8,-1 9.5,1.7L15.5,12Q17,15 14,15z"},this.svgRoot),ie(J.PATH,{class:"blocklyIconSymbol",d:"m7,4.8v3.16l0.27,2.27h1.46l0.27,-2.27v-3.16z"},this.svgRoot),ie(J.RECT,{class:"blocklyIconSymbol",x:"7",y:"11",height:"2",width:"2"},this.svgRoot),Oe(this.svgRoot,"blockly-icon-warning"))}dispose(){super.dispose();let e;(e=this.textBubble)==null||e.dispose()}getWeight(){return wo.WEIGHT}getSize(){return new Xe(np,np)}applyColour(){super.applyColour();let e;(e=this.textBubble)==null||e.setColour(this.sourceBlock.getColour())}updateCollapsed(){}isShownWhenCollapsed(){return!0}onLocationChange(e){super.onLocationChange(e);let t;(t=this.textBubble)==null||t.setAnchorLocation(this.getAnchorLocation())}addMessage(e,t){if(this.textMap.get(t)===e)return this;e?this.textMap.set(t,e):this.textMap.delete(t);let o;return(o=this.textBubble)==null||o.setText(this.getText()),this}getText(){return[...this.textMap.values()].join(` -`)}onClick(){super.onClick(),this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}bubbleIsVisible(){return!!this.textBubble}setBubbleVisible(e){const t=this;return ge.asyncExecutePromiseGeneratorFunction(function*(){if(t.bubbleIsVisible()!==e){if(yield Ts(),e)t.textBubble=new Sv(t.getText(),t.sourceBlock.workspace,t.getAnchorLocation(),t.getBubbleOwnerRect()),t.applyColour();else{let o;(o=t.textBubble)==null||o.dispose(),t.textBubble=null}z(new(ne(ee.BUBBLE_OPEN))(t.sourceBlock,e,"warning"))}})}getAnchorLocation(){const e=np/2;return ye.sum(this.workspaceLocation,new ye(e,e))}getBubbleOwnerRect(){const e=this.sourceBlock.getSvgRoot().getBBox();return new rt(e.y,e.y+e.height,e.x,e.x+e.width)}};wo.TYPE=Ct.WARNING,wo.WEIGHT=2;var jo={};jo.CommentIcon=_o,jo.Icon=Ol,jo.IconType=Ct,jo.MutatorIcon=i.MutatorIcon$$module$build$src$core$icons$mutator_icon,jo.WarningIcon=wo,jo.exceptions=Tv,jo.registry=op,i.Names$$module$build$src$core$names=class{constructor(e,t){this.db=new Map,this.dbReverse=new Set,this.variableMap=null,this.variablePrefix=t||"",this.reservedWords=new Set(e?e.split(","):[])}reset(){this.db.clear(),this.dbReverse.clear(),this.variableMap=null}setVariableMap(e){this.variableMap=e}getNameForUserVariable(e){return this.variableMap?(e=this.variableMap.getVariableById(e))?e.name:null:(console.warn(`Deprecated call to Names.prototype.getName without defining a variable map. To fix, add the following code in your generator's init() function: -Blockly.YourGeneratorName.nameDB_.setVariableMap(workspace.getVariableMap());`),null)}populateVariables(e){e=i.allUsedVarModels$$module$build$src$core$variables(e);for(let t=0;trect,`,`${e} .blocklyEditableText>rect {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"fill-opacity: .6;","stroke: none;","}",`${e} .blocklyNonEditableText>text,`,`${e} .blocklyEditableText>text {`,"fill: #000;","}",`${e} .blocklyFlyoutLabelText {`,"fill: #000;","}",`${e} .blocklyText.blocklyBubbleText {`,"fill: #000;","}",`${e} .blocklyEditableText:not(.editing):hover>rect {`,"stroke: #fff;","stroke-width: 2;","}",`${e} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,"}",`${e} .blocklySelected>.blocklyPath {`,"stroke: #fc3;","stroke-width: 3px;","}",`${e} .blocklyHighlightedConnectionPath {`,"stroke: #fc3;","}",`${e} .blocklyReplaceable .blocklyPath {`,"fill-opacity: .5;","}",`${e} .blocklyReplaceable .blocklyPathLight,`,`${e} .blocklyReplaceable .blocklyPathDark {`,"display: none;","}",`${e} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"]}},Bl=class{constructor(e,t){this.inlinePath_=this.outlinePath_="",this.block_=e,this.info_=t,this.topLeft_=e.getRelativeToSurfaceXY(),this.constants_=t.getRenderer().getConstants()}draw(){this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights(),this.block_.pathObject.setPath(this.outlinePath_+` -`+this.inlinePath_),this.info_.RTL&&this.block_.pathObject.flipRTL(),this.recordSizeOnBlock_()}recordSizeOnBlock_(){this.block_.height=this.info_.height,this.block_.width=this.info_.widthWithChildren,this.block_.childlessWidth=this.info_.width}drawOutline_(){this.drawTop_();for(let e=1;ee||e>this.fieldRow.length)throw Error("index "+e+" out of bounds.");return(t||t===""&&o)&&(typeof t=="string"&&(t=i.fromJson$$module$build$src$core$field_registry({type:"field_label",text:t})),t.setSourceBlock(this.sourceBlock),this.sourceBlock.initialized&&this.initField(t),t.name=o,t.setVisible(this.isVisible()),t.prefixField&&(e=this.insertFieldAt(e,t.prefixField)),this.fieldRow.splice(e,0,t),e++,t.suffixField&&(e=this.insertFieldAt(e,t.suffixField)),this.sourceBlock.rendered&&this.sourceBlock.queueRender()),e}removeField(e,t){for(let o=0,n;n=this.fieldRow[o];o++)if(n.name===e)return n.dispose(),this.fieldRow.splice(o,1),this.sourceBlock.rendered&&this.sourceBlock.queueRender(),!0;if(t)return!1;throw Error('Field "'+e+'" not found.')}isVisible(){return this.visible}setVisible(e){let t=[];if(this.visible===e)return t;this.visible=e;for(let n=0,u;u=this.fieldRow[n];n++)u.setVisible(e);if(this.connection){var o=this.connection;e?t=o.startTrackingAll():o.stopTrackingAll(),(o=o.targetBlock())&&(o.getSvgRoot().style.display=e?"block":"none")}return t}markDirty(){for(let e=0,t;t=this.fieldRow[e];e++)t.markDirty()}setCheck(e){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setCheck(e),this}setAlign(e){return this.align=e,this.sourceBlock.rendered&&this.sourceBlock.queueRender(),this}setShadowDom(e){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setShadowDom(e),this}getShadowDom(){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.getShadowDom()}init(){for(const e of this.fieldRow)e.init()}initModel(){for(const e of this.fieldRow)e.initModel()}initField(e){this.sourceBlock.rendered?e.init():e.initModel()}dispose(){for(let e=0,t;t=this.fieldRow[e];e++)t.dispose();this.connection&&this.connection.dispose()}makeConnection(e){return this.sourceBlock.makeConnection_(e)}},Ks=class extends pn{constructor(e,t){super(e,t),this.name=e,this.type=i.inputTypes$$module$build$src$core$inputs$input_types.DUMMY}},Co=class extends pn{constructor(e,t){super(e,t),this.name=e,this.type=i.inputTypes$$module$build$src$core$inputs$input_types.END_ROW}},ls=class extends pn{constructor(e,t){if(!e)throw Error("Statement inputs must have a non-empty name");super(e,t),this.name=e,this.type=i.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT,this.connection=this.makeConnection(xe.NEXT_STATEMENT)}},Rv;i.ValueInput$$module$build$src$core$inputs$value_input=class extends pn{constructor(e,t){if(!e)throw Error("Value inputs must have a non-empty name");super(e,t),this.name=e,this.type=i.inputTypes$$module$build$src$core$inputs$input_types.VALUE,this.connection=this.makeConnection(xe.INPUT_VALUE)}},Rv={},Rv.ValueInput=i.ValueInput$$module$build$src$core$inputs$value_input;var Or=class{constructor(e,t){this.statementEdge=this.width=this.widthWithChildren=this.height=0,this.rows=[],this.inputRows=[],this.startY=this.startX=0,this.renderer_=e,this.block_=t,this.constants_=this.renderer_.getConstants(),this.outputConnection=t.outputConnection?new Av(this.constants_,t.outputConnection):null,this.isInline=t.getInputsInline()&&!t.isCollapsed(),this.isCollapsed=t.isCollapsed(),this.isInsertionMarker=t.isInsertionMarker(),this.RTL=t.RTL,this.topRow=new dp(this.constants_),this.bottomRow=new rp(this.constants_)}getRenderer(){return this.renderer_}measure(){this.createRows_(),this.addElemSpacing_(),this.addRowSpacing_(),this.computeBounds_(),this.alignRowElements_(),this.finalize_()}createRows_(){this.populateTopRow_(),this.rows.push(this.topRow);let e=new cp(this.constants_);this.inputRows.push(e);var t=this.block_.getIcons();for(let o=0,n;n=t[o];o++){const u=new Iv(this.constants_,n);this.isCollapsed&&!n.isShownWhenCollapsed()||e.elements.push(u)}t=void 0;for(let o=0,n;n=this.block_.inputList[o];o++)if(n.isVisible()){this.shouldStartNewRow_(n,t)&&(this.rows.push(e),e=new cp(this.constants_),this.inputRows.push(e));for(let u=0,g;g=n.fieldRow[u];u++)e.elements.push(new hn(this.constants_,g,n));this.addInput_(n,e),t=n}this.isCollapsed&&(e.hasJaggedEdge=!0,e.elements.push(new xv(this.constants_))),(e.elements.length||e.hasDummyInput)&&this.rows.push(e),this.populateBottomRow_(),this.rows.push(this.bottomRow)}populateTopRow_(){var e=!!this.block_.previousConnection;const t=(this.block_.hat?this.block_.hat==="cap":this.constants_.ADD_START_HATS)&&!this.outputConnection&&!e;let o=this.topRow.hasLeftSquareCorner(this.block_)?Ar:Dr;this.topRow.elements.push(new o(this.constants_)),t?(e=new ap(this.constants_),this.topRow.elements.push(e),this.topRow.capline=e.ascenderHeight):e&&(this.topRow.hasPreviousConnection=!0,this.topRow.connection=new Ov(this.constants_,this.block_.previousConnection),this.topRow.elements.push(this.topRow.connection)),this.block_.inputList.length&&this.block_.inputList[0]instanceof ls&&!this.block_.isCollapsed()?this.topRow.minHeight=this.constants_.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT:this.topRow.minHeight=this.constants_.TOP_ROW_MIN_HEIGHT,o=this.topRow.hasRightSquareCorner(this.block_)?Ar:Dr,this.topRow.elements.push(new o(this.constants_,"right"))}populateBottomRow_(){this.bottomRow.hasNextConnection=!!this.block_.nextConnection,this.bottomRow.minHeight=this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1]instanceof ls?this.constants_.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT:this.constants_.BOTTOM_ROW_MIN_HEIGHT,this.bottomRow.hasLeftSquareCorner(this.block_)?this.bottomRow.elements.push(new Ar(this.constants_)):this.bottomRow.elements.push(new Dr(this.constants_)),this.bottomRow.hasNextConnection&&(this.bottomRow.connection=new Dv(this.constants_,this.block_.nextConnection),this.bottomRow.elements.push(this.bottomRow.connection)),this.bottomRow.hasRightSquareCorner(this.block_)?this.bottomRow.elements.push(new Ar(this.constants_,"right")):this.bottomRow.elements.push(new Dr(this.constants_,"right"))}addInput_(e,t){this.isInline&&e instanceof i.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new lp(this.constants_,e)),t.hasInlineInput=!0):e instanceof ls?(t.elements.push(new xr(this.constants_,e)),t.hasStatement=!0):e instanceof i.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new Ll(this.constants_,e)),t.hasExternalInput=!0):(e instanceof Ks||e instanceof Co)&&(t.minHeight=Math.max(t.minHeight,e.getSourceBlock()&&e.getSourceBlock().isShadow()?this.constants_.DUMMY_INPUT_SHADOW_MIN_HEIGHT:this.constants_.DUMMY_INPUT_MIN_HEIGHT),t.hasDummyInput=!0),t.align===null&&(t.align=e.align)}shouldStartNewRow_(e,t){return t?t instanceof Co||e instanceof ls||t instanceof ls?!0:e instanceof i.ValueInput$$module$build$src$core$inputs$value_input||e instanceof Ks||t instanceof i.ValueInput$$module$build$src$core$inputs$value_input?!this.isInline:!1:!1}addElemSpacing_(){for(let e=0,t;t=this.rows[e];e++){const o=t.elements;if(t.elements=[],t.startsWithElemSpacer()&&t.elements.push(new as(this.constants_,this.getInRowSpacing_(null,o[0]))),o.length){for(let n=0;ne.disposeInternal()),this.inputList.forEach(e=>e.dispose()),this.inputList.length=0,this.getConnections_(!0).forEach(e=>e.dispose()),this.disposed=!0}isDeadOrDying(){return this.disposing||this.disposed}initModel(){if(!this.initialized){for(const e of this.inputList)e.initModel();this.initialized=!0}}unplug(e){this.outputConnection&&this.unplugFromRow(e),this.previousConnection&&this.unplugFromStack(e)}unplugFromRow(e){let t=null,o;(o=this.outputConnection)!=null&&o.isConnected()&&(t=this.outputConnection.targetConnection,this.outputConnection.disconnect()),t&&e&&(e=this.getOnlyValueConnection())&&e.isConnected()&&!e.targetBlock().isShadow()&&(e=e.targetConnection,e==null||e.disconnect(),this.workspace.connectionChecker.canConnect(e,t,!1)?t.connect(e):e==null||e.onFailedConnect(t))}getOnlyValueConnection(){let e=null;for(let t=0;t(n=n+(o==="("||u===")"?"":" ")+u,o=u[u.length-1],n),""),t=t.trim()||"???",e&&t.length>e&&(t=t.substring(0,e-3)+"..."),t}toTokens(e="?"){const t=[];for(const n of this.inputList)if(n.name!=$r){for(const u of n.fieldRow)t.push(u.getText());if(n.connection){const u=n.connection.targetBlock();if(u){var o=n.connection;let g=o.getCheck();!g&&o.targetConnection&&(g=o.targetConnection.getCheck()),(o=!!g&&(g.includes("Boolean")||g.includes("Number")))&&t.push("("),t.push(...u.toTokens(e)),o&&t.push(")")}else t.push(e)}}return t}appendValueInput(e){return this.appendInput(new i.ValueInput$$module$build$src$core$inputs$value_input(e,this))}appendStatementInput(e){return this.statementInputCount++,this.appendInput(new ls(e,this))}appendDummyInput(e=""){return this.appendInput(new Ks(e,this))}appendEndRowInput(e=""){return this.appendInput(new Co(e,this))}appendInput(e){return this.inputList.push(e),e}appendInputFromRegistry(e,t){return(e=p($e.INPUT,e,!1))?this.appendInput(new e(t,this)):null}jsonInit(e){var t=e.type?'Block "'+e.type+'": ':"";if(e.output&&e.previousStatement)throw Error(t+"Must not have both an output and a previousStatement.");for(var o=0;e["args"+o];){if(e["message"+o]===void 0)throw Error(t+`args${o} must have a corresponding message (message${o}).`);o++}if(e.style&&e.style.hat&&(this.hat=e.style.hat,e.style=null),e.style&&e.colour)throw Error(t+"Must not have both a colour and a style.");for(e.style?this.jsonInitStyle(e,t):this.jsonInitColour(e,t),o=0;e["message"+o]!==void 0;)this.interpolate(e["message"+o],e["args"+o]||[],e["implicitAlign"+o]||e["lastDummyAlign"+o],t),o++;if(e.inputsInline!==void 0&&(i.disable$$module$build$src$core$events$utils(),this.setInputsInline(e.inputsInline),i.enable$$module$build$src$core$events$utils()),e.output!==void 0&&this.setOutput(!0,e.output),e.outputShape!==void 0&&this.setOutputShape(e.outputShape),e.previousStatement!==void 0&&this.setPreviousStatement(!0,e.previousStatement),e.nextStatement!==void 0&&this.setNextStatement(!0,e.nextStatement),e.tooltip!==void 0&&(o=bt(e.tooltip),this.setTooltip(o)),e.enableContextMenu!==void 0&&(this.contextMenu=!!e.enableContextMenu),e.suppressPrefixSuffix!==void 0&&(this.suppressPrefixSuffix=!!e.suppressPrefixSuffix),e.helpUrl!==void 0&&(o=bt(e.helpUrl),this.setHelpUrl(o)),typeof e.extensions=="string"&&(console.warn(t+"JSON attribute 'extensions' should be an array of strings. Found raw string in JSON for '"+e.type+"' block."),e.extensions=[e.extensions]),e.mutator!==void 0&&Va(e.mutator,this,!0),e=e.extensions,Array.isArray(e))for(t=0;tg||g>t)throw Error('Block "'+this.type+'": Message index %'+g+" out of range.");if(o[g])throw Error('Block "'+this.type+'": Message index %'+g+" duplicated.");o[g]=!0,n++}}if(n!==t)throw Error('Block "'+this.type+'": Message does not reference all '+t+" arg(s).")}interpolateArguments(e,t,o){const n=[];for(let g=0;g=this.inputList.length)throw RangeError("Input index "+e+" out of bounds.");if(t>this.inputList.length)throw RangeError("Reference input "+t+" out of bounds.");const o=this.inputList[e];this.inputList.splice(e,1),et.getWeight()-o.getWeight()),e}removeIcon(e){if(!this.hasIcon(e))return!1;let t;return(t=this.getIcon(e))==null||t.dispose(),this.icons=this.icons.filter(o=>!o.getType().equals(e)),!0}hasIcon(e){return this.icons.some(t=>t.getType().equals(e))}getIcon(e){return e instanceof Ct?this.icons.find(t=>t.getType().equals(e)):this.icons.find(t=>t.getType().toString()===e)}getIcons(){return[...this.icons]}getRelativeToSurfaceXY(){return this.xy}moveBy(e,t,o){if(this.parentBlock_)throw Error("Block has parent");const n=new(ne(ee.BLOCK_MOVE))(this);o&&n.setReason(o),this.xy.translate(e,t),n.recordNew(),z(n)}makeConnection_(e){return new Qe(this,e)}allInputsFilled(e){if(e===void 0&&(e=!0),!e&&this.isShadow())return!1;for(let o=0,n;n=this.inputList[o];o++)if(n.connection){var t=n.connection.targetBlock();if(!t||!t.allInputsFilled(e))return!1}return(t=this.getNextBlock())?t.allInputsFilled(e):!0}toDevString(){let e=this.type?'"'+this.type+'" block':"Block";return this.id&&(e+=' (id="'+this.id+'")'),e}};Uo.COLLAPSED_INPUT_NAME=$r,Uo.COLLAPSED_FIELD_NAME=gl;var ms=class{constructor(e,t,o,n){this.workspace=e,this.targetWorkspace=t,this.isFlyoutLabel=n,this.onMouseUpWrapper=null,this.height=this.width=0,this.cursorSvg=this.svgText=this.svgGroup=null,this.text=o.text,this.position=new ye(0,0),this.callbackKey=o.callbackKey||o.callbackkey,this.cssClass=o["web-class"]||null,this.info=o}createDom(){var e=this.isFlyoutLabel?"blocklyFlyoutLabel":"blocklyFlyoutButton";this.cssClass&&(e+=" "+this.cssClass),this.svgGroup=ie(J.G,{class:e},this.workspace.getCanvas());let t;this.isFlyoutLabel||(t=ie(J.RECT,{class:"blocklyFlyoutButtonShadow",rx:ms.BORDER_RADIUS,ry:ms.BORDER_RADIUS,x:1,y:1},this.svgGroup)),e=ie(J.RECT,{class:this.isFlyoutLabel?"blocklyFlyoutLabelBackground":"blocklyFlyoutButtonBackground",rx:ms.BORDER_RADIUS,ry:ms.BORDER_RADIUS},this.svgGroup);const o=ie(J.TEXT,{class:this.isFlyoutLabel?"blocklyFlyoutLabelText":"blocklyText",x:0,y:0,"text-anchor":"middle"},this.svgGroup);var n=bt(this.text);this.workspace.RTL&&(n+="‏"),o.textContent=n,this.isFlyoutLabel&&(this.svgText=o,this.workspace.getThemeManager().subscribe(this.svgText,"flyoutForegroundColour","fill"));const u=Fs(o,"fontSize"),g=Fs(o,"fontWeight"),I=Fs(o,"fontFamily");if(this.width=Bs(o,u,g,I),n=ro(n,u,g,I),this.height=n.height,!this.isFlyoutLabel){this.width+=2*ms.TEXT_MARGIN_X,this.height+=2*ms.TEXT_MARGIN_Y;let L;(L=t)==null||L.setAttribute("width",String(this.width));let le;(le=t)==null||le.setAttribute("height",String(this.height))}return e.setAttribute("width",String(this.width)),e.setAttribute("height",String(this.height)),o.setAttribute("x",String(this.width/2)),o.setAttribute("y",String(this.height/2-n.height/2+n.baseline)),this.updateTransform(),this.onMouseUpWrapper=H(this.svgGroup,"pointerup",this,this.onMouseUp),this.svgGroup}show(){this.updateTransform(),this.svgGroup.setAttribute("display","block")}updateTransform(){this.svgGroup.setAttribute("transform","translate("+this.position.x+","+this.position.y+")")}moveTo(e,t){this.position.x=e,this.position.y=t,this.updateTransform()}isLabel(){return this.isFlyoutLabel}getPosition(){return this.position}getButtonText(){return this.text}getTargetWorkspace(){return this.targetWorkspace}getWorkspace(){return this.workspace}dispose(){this.onMouseUpWrapper&&V(this.onMouseUpWrapper),this.svgGroup&&Ze(this.svgGroup),this.svgText&&this.workspace.getThemeManager().unsubscribe(this.svgText)}setCursorSvg(e){e?this.svgGroup&&(this.svgGroup.appendChild(e),this.cursorSvg=e):this.cursorSvg=null}setMarkerSvg(){throw Error("Attempted to set a marker on a button.")}onMouseUp(e){(e=this.targetWorkspace.getGesture(e))&&e.cancel(),this.isFlyoutLabel&&this.callbackKey?console.warn("Labels should not have callbacks. Label text: "+this.text):this.isFlyoutLabel||this.callbackKey&&this.targetWorkspace.getButtonCallback(this.callbackKey)?this.isFlyoutLabel||(e=this.targetWorkspace.getButtonCallback(this.callbackKey))&&e(this):console.warn("Buttons should have callbacks. Button text: "+this.text)}};ms.TEXT_MARGIN_X=5,ms.TEXT_MARGIN_Y=2,ms.BORDER_RADIUS=4,Be(` +`+this.inlinePath_),this.info_.RTL&&this.block_.pathObject.flipRTL(),this.recordSizeOnBlock_()}recordSizeOnBlock_(){this.block_.height=this.info_.height,this.block_.width=this.info_.widthWithChildren,this.block_.childlessWidth=this.info_.width}drawOutline_(){this.drawTop_();for(let e=1;ee||e>this.fieldRow.length)throw Error("index "+e+" out of bounds.");return(t||t===""&&o)&&(typeof t=="string"&&(t=i.fromJson$$module$build$src$core$field_registry({type:"field_label",text:t})),t.setSourceBlock(this.sourceBlock),this.sourceBlock.initialized&&this.initField(t),t.name=o,t.setVisible(this.isVisible()),t.prefixField&&(e=this.insertFieldAt(e,t.prefixField)),this.fieldRow.splice(e,0,t),e++,t.suffixField&&(e=this.insertFieldAt(e,t.suffixField)),this.sourceBlock.rendered&&this.sourceBlock.queueRender()),e}removeField(e,t){for(let o=0,n;n=this.fieldRow[o];o++)if(n.name===e)return n.dispose(),this.fieldRow.splice(o,1),this.sourceBlock.rendered&&this.sourceBlock.queueRender(),!0;if(t)return!1;throw Error('Field "'+e+'" not found.')}isVisible(){return this.visible}setVisible(e){let t=[];if(this.visible===e)return t;this.visible=e;for(let n=0,u;u=this.fieldRow[n];n++)u.setVisible(e);if(this.connection){var o=this.connection;e?t=o.startTrackingAll():o.stopTrackingAll(),(o=o.targetBlock())&&(o.getSvgRoot().style.display=e?"block":"none")}return t}markDirty(){for(let e=0,t;t=this.fieldRow[e];e++)t.markDirty()}setCheck(e){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setCheck(e),this}setAlign(e){return this.align=e,this.sourceBlock.rendered&&this.sourceBlock.queueRender(),this}setShadowDom(e){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setShadowDom(e),this}getShadowDom(){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.getShadowDom()}init(){for(const e of this.fieldRow)e.init()}initModel(){for(const e of this.fieldRow)e.initModel()}initField(e){this.sourceBlock.rendered?e.init():e.initModel()}dispose(){for(let e=0,t;t=this.fieldRow[e];e++)t.dispose();this.connection&&this.connection.dispose()}makeConnection(e){return this.sourceBlock.makeConnection_(e)}},Ks=class extends pn{constructor(e,t){super(e,t),this.name=e,this.type=i.inputTypes$$module$build$src$core$inputs$input_types.DUMMY}},Co=class extends pn{constructor(e,t){super(e,t),this.name=e,this.type=i.inputTypes$$module$build$src$core$inputs$input_types.END_ROW}},ls=class extends pn{constructor(e,t){if(!e)throw Error("Statement inputs must have a non-empty name");super(e,t),this.name=e,this.type=i.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT,this.connection=this.makeConnection(xe.NEXT_STATEMENT)}},Mv;i.ValueInput$$module$build$src$core$inputs$value_input=class extends pn{constructor(e,t){if(!e)throw Error("Value inputs must have a non-empty name");super(e,t),this.name=e,this.type=i.inputTypes$$module$build$src$core$inputs$input_types.VALUE,this.connection=this.makeConnection(xe.INPUT_VALUE)}},Mv={},Mv.ValueInput=i.ValueInput$$module$build$src$core$inputs$value_input;var Or=class{constructor(e,t){this.statementEdge=this.width=this.widthWithChildren=this.height=0,this.rows=[],this.inputRows=[],this.startY=this.startX=0,this.renderer_=e,this.block_=t,this.constants_=this.renderer_.getConstants(),this.outputConnection=t.outputConnection?new Rv(this.constants_,t.outputConnection):null,this.isInline=t.getInputsInline()&&!t.isCollapsed(),this.isCollapsed=t.isCollapsed(),this.isInsertionMarker=t.isInsertionMarker(),this.RTL=t.RTL,this.topRow=new dp(this.constants_),this.bottomRow=new rp(this.constants_)}getRenderer(){return this.renderer_}measure(){this.createRows_(),this.addElemSpacing_(),this.addRowSpacing_(),this.computeBounds_(),this.alignRowElements_(),this.finalize_()}createRows_(){this.populateTopRow_(),this.rows.push(this.topRow);let e=new cp(this.constants_);this.inputRows.push(e);var t=this.block_.getIcons();for(let o=0,n;n=t[o];o++){const u=new Dv(this.constants_,n);this.isCollapsed&&!n.isShownWhenCollapsed()||e.elements.push(u)}t=void 0;for(let o=0,n;n=this.block_.inputList[o];o++)if(n.isVisible()){this.shouldStartNewRow_(n,t)&&(this.rows.push(e),e=new cp(this.constants_),this.inputRows.push(e));for(let u=0,g;g=n.fieldRow[u];u++)e.elements.push(new hn(this.constants_,g,n));this.addInput_(n,e),t=n}this.isCollapsed&&(e.hasJaggedEdge=!0,e.elements.push(new Av(this.constants_))),(e.elements.length||e.hasDummyInput)&&this.rows.push(e),this.populateBottomRow_(),this.rows.push(this.bottomRow)}populateTopRow_(){var e=!!this.block_.previousConnection;const t=(this.block_.hat?this.block_.hat==="cap":this.constants_.ADD_START_HATS)&&!this.outputConnection&&!e;let o=this.topRow.hasLeftSquareCorner(this.block_)?Ar:Dr;this.topRow.elements.push(new o(this.constants_)),t?(e=new ap(this.constants_),this.topRow.elements.push(e),this.topRow.capline=e.ascenderHeight):e&&(this.topRow.hasPreviousConnection=!0,this.topRow.connection=new Nv(this.constants_,this.block_.previousConnection),this.topRow.elements.push(this.topRow.connection)),this.block_.inputList.length&&this.block_.inputList[0]instanceof ls&&!this.block_.isCollapsed()?this.topRow.minHeight=this.constants_.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT:this.topRow.minHeight=this.constants_.TOP_ROW_MIN_HEIGHT,o=this.topRow.hasRightSquareCorner(this.block_)?Ar:Dr,this.topRow.elements.push(new o(this.constants_,"right"))}populateBottomRow_(){this.bottomRow.hasNextConnection=!!this.block_.nextConnection,this.bottomRow.minHeight=this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1]instanceof ls?this.constants_.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT:this.constants_.BOTTOM_ROW_MIN_HEIGHT,this.bottomRow.hasLeftSquareCorner(this.block_)?this.bottomRow.elements.push(new Ar(this.constants_)):this.bottomRow.elements.push(new Dr(this.constants_)),this.bottomRow.hasNextConnection&&(this.bottomRow.connection=new Ov(this.constants_,this.block_.nextConnection),this.bottomRow.elements.push(this.bottomRow.connection)),this.bottomRow.hasRightSquareCorner(this.block_)?this.bottomRow.elements.push(new Ar(this.constants_,"right")):this.bottomRow.elements.push(new Dr(this.constants_,"right"))}addInput_(e,t){this.isInline&&e instanceof i.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new lp(this.constants_,e)),t.hasInlineInput=!0):e instanceof ls?(t.elements.push(new xr(this.constants_,e)),t.hasStatement=!0):e instanceof i.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new Ll(this.constants_,e)),t.hasExternalInput=!0):(e instanceof Ks||e instanceof Co)&&(t.minHeight=Math.max(t.minHeight,e.getSourceBlock()&&e.getSourceBlock().isShadow()?this.constants_.DUMMY_INPUT_SHADOW_MIN_HEIGHT:this.constants_.DUMMY_INPUT_MIN_HEIGHT),t.hasDummyInput=!0),t.align===null&&(t.align=e.align)}shouldStartNewRow_(e,t){return t?t instanceof Co||e instanceof ls||t instanceof ls?!0:e instanceof i.ValueInput$$module$build$src$core$inputs$value_input||e instanceof Ks||t instanceof i.ValueInput$$module$build$src$core$inputs$value_input?!this.isInline:!1:!1}addElemSpacing_(){for(let e=0,t;t=this.rows[e];e++){const o=t.elements;if(t.elements=[],t.startsWithElemSpacer()&&t.elements.push(new as(this.constants_,this.getInRowSpacing_(null,o[0]))),o.length){for(let n=0;ne.disposeInternal()),this.inputList.forEach(e=>e.dispose()),this.inputList.length=0,this.getConnections_(!0).forEach(e=>e.dispose()),this.disposed=!0}isDeadOrDying(){return this.disposing||this.disposed}initModel(){if(!this.initialized){for(const e of this.inputList)e.initModel();this.initialized=!0}}unplug(e){this.outputConnection&&this.unplugFromRow(e),this.previousConnection&&this.unplugFromStack(e)}unplugFromRow(e){let t=null,o;(o=this.outputConnection)!=null&&o.isConnected()&&(t=this.outputConnection.targetConnection,this.outputConnection.disconnect()),t&&e&&(e=this.getOnlyValueConnection())&&e.isConnected()&&!e.targetBlock().isShadow()&&(e=e.targetConnection,e==null||e.disconnect(),this.workspace.connectionChecker.canConnect(e,t,!1)?t.connect(e):e==null||e.onFailedConnect(t))}getOnlyValueConnection(){let e=null;for(let t=0;t(n=n+(o==="("||u===")"?"":" ")+u,o=u[u.length-1],n),""),t=t.trim()||"???",e&&t.length>e&&(t=t.substring(0,e-3)+"..."),t}toTokens(e="?"){const t=[];for(const n of this.inputList)if(n.name!=$r){for(const u of n.fieldRow)t.push(u.getText());if(n.connection){const u=n.connection.targetBlock();if(u){var o=n.connection;let g=o.getCheck();!g&&o.targetConnection&&(g=o.targetConnection.getCheck()),(o=!!g&&(g.includes("Boolean")||g.includes("Number")))&&t.push("("),t.push(...u.toTokens(e)),o&&t.push(")")}else t.push(e)}}return t}appendValueInput(e){return this.appendInput(new i.ValueInput$$module$build$src$core$inputs$value_input(e,this))}appendStatementInput(e){return this.statementInputCount++,this.appendInput(new ls(e,this))}appendDummyInput(e=""){return this.appendInput(new Ks(e,this))}appendEndRowInput(e=""){return this.appendInput(new Co(e,this))}appendInput(e){return this.inputList.push(e),e}appendInputFromRegistry(e,t){return(e=p($e.INPUT,e,!1))?this.appendInput(new e(t,this)):null}jsonInit(e){var t=e.type?'Block "'+e.type+'": ':"";if(e.output&&e.previousStatement)throw Error(t+"Must not have both an output and a previousStatement.");for(var o=0;e["args"+o];){if(e["message"+o]===void 0)throw Error(t+`args${o} must have a corresponding message (message${o}).`);o++}if(e.style&&e.style.hat&&(this.hat=e.style.hat,e.style=null),e.style&&e.colour)throw Error(t+"Must not have both a colour and a style.");for(e.style?this.jsonInitStyle(e,t):this.jsonInitColour(e,t),o=0;e["message"+o]!==void 0;)this.interpolate(e["message"+o],e["args"+o]||[],e["implicitAlign"+o]||e["lastDummyAlign"+o],t),o++;if(e.inputsInline!==void 0&&(i.disable$$module$build$src$core$events$utils(),this.setInputsInline(e.inputsInline),i.enable$$module$build$src$core$events$utils()),e.output!==void 0&&this.setOutput(!0,e.output),e.outputShape!==void 0&&this.setOutputShape(e.outputShape),e.previousStatement!==void 0&&this.setPreviousStatement(!0,e.previousStatement),e.nextStatement!==void 0&&this.setNextStatement(!0,e.nextStatement),e.tooltip!==void 0&&(o=bt(e.tooltip),this.setTooltip(o)),e.enableContextMenu!==void 0&&(this.contextMenu=!!e.enableContextMenu),e.suppressPrefixSuffix!==void 0&&(this.suppressPrefixSuffix=!!e.suppressPrefixSuffix),e.helpUrl!==void 0&&(o=bt(e.helpUrl),this.setHelpUrl(o)),typeof e.extensions=="string"&&(console.warn(t+"JSON attribute 'extensions' should be an array of strings. Found raw string in JSON for '"+e.type+"' block."),e.extensions=[e.extensions]),e.mutator!==void 0&&Va(e.mutator,this,!0),e=e.extensions,Array.isArray(e))for(t=0;tg||g>t)throw Error('Block "'+this.type+'": Message index %'+g+" out of range.");if(o[g])throw Error('Block "'+this.type+'": Message index %'+g+" duplicated.");o[g]=!0,n++}}if(n!==t)throw Error('Block "'+this.type+'": Message does not reference all '+t+" arg(s).")}interpolateArguments(e,t,o){const n=[];for(let g=0;g=this.inputList.length)throw RangeError("Input index "+e+" out of bounds.");if(t>this.inputList.length)throw RangeError("Reference input "+t+" out of bounds.");const o=this.inputList[e];this.inputList.splice(e,1),et.getWeight()-o.getWeight()),e}removeIcon(e){if(!this.hasIcon(e))return!1;let t;return(t=this.getIcon(e))==null||t.dispose(),this.icons=this.icons.filter(o=>!o.getType().equals(e)),!0}hasIcon(e){return this.icons.some(t=>t.getType().equals(e))}getIcon(e){return e instanceof Ct?this.icons.find(t=>t.getType().equals(e)):this.icons.find(t=>t.getType().toString()===e)}getIcons(){return[...this.icons]}getRelativeToSurfaceXY(){return this.xy}moveBy(e,t,o){if(this.parentBlock_)throw Error("Block has parent");const n=new(ne(ee.BLOCK_MOVE))(this);o&&n.setReason(o),this.xy.translate(e,t),n.recordNew(),z(n)}makeConnection_(e){return new Qe(this,e)}allInputsFilled(e){if(e===void 0&&(e=!0),!e&&this.isShadow())return!1;for(let o=0,n;n=this.inputList[o];o++)if(n.connection){var t=n.connection.targetBlock();if(!t||!t.allInputsFilled(e))return!1}return(t=this.getNextBlock())?t.allInputsFilled(e):!0}toDevString(){let e=this.type?'"'+this.type+'" block':"Block";return this.id&&(e+=' (id="'+this.id+'")'),e}};Uo.COLLAPSED_INPUT_NAME=$r,Uo.COLLAPSED_FIELD_NAME=gl;var ms=class{constructor(e,t,o,n){this.workspace=e,this.targetWorkspace=t,this.isFlyoutLabel=n,this.onMouseUpWrapper=null,this.height=this.width=0,this.cursorSvg=this.svgText=this.svgGroup=null,this.text=o.text,this.position=new ye(0,0),this.callbackKey=o.callbackKey||o.callbackkey,this.cssClass=o["web-class"]||null,this.info=o}createDom(){var e=this.isFlyoutLabel?"blocklyFlyoutLabel":"blocklyFlyoutButton";this.cssClass&&(e+=" "+this.cssClass),this.svgGroup=ie(J.G,{class:e},this.workspace.getCanvas());let t;this.isFlyoutLabel||(t=ie(J.RECT,{class:"blocklyFlyoutButtonShadow",rx:ms.BORDER_RADIUS,ry:ms.BORDER_RADIUS,x:1,y:1},this.svgGroup)),e=ie(J.RECT,{class:this.isFlyoutLabel?"blocklyFlyoutLabelBackground":"blocklyFlyoutButtonBackground",rx:ms.BORDER_RADIUS,ry:ms.BORDER_RADIUS},this.svgGroup);const o=ie(J.TEXT,{class:this.isFlyoutLabel?"blocklyFlyoutLabelText":"blocklyText",x:0,y:0,"text-anchor":"middle"},this.svgGroup);var n=bt(this.text);this.workspace.RTL&&(n+="‏"),o.textContent=n,this.isFlyoutLabel&&(this.svgText=o,this.workspace.getThemeManager().subscribe(this.svgText,"flyoutForegroundColour","fill"));const u=Fs(o,"fontSize"),g=Fs(o,"fontWeight"),I=Fs(o,"fontFamily");if(this.width=Bs(o,u,g,I),n=ro(n,u,g,I),this.height=n.height,!this.isFlyoutLabel){this.width+=2*ms.TEXT_MARGIN_X,this.height+=2*ms.TEXT_MARGIN_Y;let L;(L=t)==null||L.setAttribute("width",String(this.width));let le;(le=t)==null||le.setAttribute("height",String(this.height))}return e.setAttribute("width",String(this.width)),e.setAttribute("height",String(this.height)),o.setAttribute("x",String(this.width/2)),o.setAttribute("y",String(this.height/2-n.height/2+n.baseline)),this.updateTransform(),this.onMouseUpWrapper=H(this.svgGroup,"pointerup",this,this.onMouseUp),this.svgGroup}show(){this.updateTransform(),this.svgGroup.setAttribute("display","block")}updateTransform(){this.svgGroup.setAttribute("transform","translate("+this.position.x+","+this.position.y+")")}moveTo(e,t){this.position.x=e,this.position.y=t,this.updateTransform()}isLabel(){return this.isFlyoutLabel}getPosition(){return this.position}getButtonText(){return this.text}getTargetWorkspace(){return this.targetWorkspace}getWorkspace(){return this.workspace}dispose(){this.onMouseUpWrapper&&V(this.onMouseUpWrapper),this.svgGroup&&Ze(this.svgGroup),this.svgText&&this.workspace.getThemeManager().unsubscribe(this.svgText)}setCursorSvg(e){e?this.svgGroup&&(this.svgGroup.appendChild(e),this.cursorSvg=e):this.cursorSvg=null}setMarkerSvg(){throw Error("Attempted to set a marker on a button.")}onMouseUp(e){(e=this.targetWorkspace.getGesture(e))&&e.cancel(),this.isFlyoutLabel&&this.callbackKey?console.warn("Labels should not have callbacks. Label text: "+this.text):this.isFlyoutLabel||this.callbackKey&&this.targetWorkspace.getButtonCallback(this.callbackKey)?this.isFlyoutLabel||(e=this.targetWorkspace.getButtonCallback(this.callbackKey))&&e(this):console.warn("Buttons should have callbacks. Button text: "+this.text)}};ms.TEXT_MARGIN_X=5,ms.TEXT_MARGIN_Y=2,ms.BORDER_RADIUS=4,Be(` .blocklyFlyoutButton { fill: #888; cursor: default; @@ -882,16 +882,16 @@ Blockly.YourGeneratorName.nameDB_.setVariableMap(workspace.getVariableMap());`), .blocklyFlyoutLabelBackground { opacity: 0; } -`);var de=class{constructor(e,t,o){if(this.wsCoordinate=null,!t)throw Error("Cannot create a node without a location.");this.type=e,this.isConnectionLocation=de.isConnectionType(e),this.location=t,this.processParams(o||null)}processParams(e){e&&e.wsCoordinate&&(this.wsCoordinate=e.wsCoordinate)}getLocation(){return this.location}getType(){return this.type}getWsCoordinate(){return this.wsCoordinate}isConnection(){return this.isConnectionLocation}findNextForInput(){var e=this.location.getParentInput();const t=e.getSourceBlock();for(e=t.inputList.indexOf(e),e+=1;et instanceof Uo&&u.block===t||t instanceof ms&&u.button===t);return 0>n?null:(o=o?n+1:n-1,o===-1||o===e.length?null:e[o])}findTopASTNodeForBlock(e){const t=rr(e);return t?de.createConnectionNode(t):de.createBlockNode(e)}getOutAstNodeForBlock(e){if(!e)return null;e=e.getTopStackBlock();const t=rr(e);return t&&t.targetConnection&&t.targetConnection.getParentInput()?de.createInputNode(t.targetConnection.getParentInput()):de.createStackNode(e)}findFirstFieldOrInput(e){e=e.inputList;for(let t=0;t{Ga(o.getSourceBlock()),setTimeout(()=>{n.bringToFront()},0)})}}update(e,t){const o=this.getCandidate(e);((this.wouldDeleteBlock=this.shouldDelete(!!o,t))||this.shouldUpdatePreviews(o,e))&&(i.disable$$module$build$src$core$events$utils(),this.maybeHidePreview(o),this.maybeShowPreview(o),i.enable$$module$build$src$core$events$utils())}createMarkerBlock(e){i.disable$$module$build$src$core$events$utils();let t;try{const o=os(e,{addCoordinates:!1,addInputBlocks:!1,addNextBlocks:!1,doFullSerialization:!1});if(!o)throw Error(`Failed to serialize source block. ${e.toDevString()}`);t=lo(o,this.workspace);for(const n of t.getDescendants(!1))n.setInsertionMarker(!0);t.initSvg(),t.getSvgRoot().setAttribute("visibility","hidden")}finally{i.enable$$module$build$src$core$events$utils()}return t}initAvailableConnections(){const e=this.topBlock.getConnections_(!1),t=this.topBlock.lastConnectionInStack(!0);return t&&t!==this.topBlock.nextConnection&&(e.push(t),this.lastOnStack=t),e}shouldUpdatePreviews(e,t){if(!e)return!!this.activeCandidate;if(!this.activeCandidate)return!0;const{local:o,closest:n}=this.activeCandidate;if(n===e.closest&&o===e.local)return!1;const u=o.x+t.x-n.x;return t=o.y+t.y-n.y,e.radius{let le;(le=n)==null||le.positionNearConnection(L,g,I);let Ee;(Ee=n)==null||Ee.getSvgRoot().setAttribute("visibility","visible")}),this.markerConnection=u}hideInsertionMarker(){if(this.markerConnection){var e=this.markerConnection,t=e.getSourceBlock(),o=t.outputConnection,n;if((n=t.previousConnection)!=null&&n.targetConnection||o!=null&&o.targetConnection)t.unplug(!0);else{let u;(u=e.targetBlock())==null||u.unplug(!1)}if(e.targetConnection)throw Error("markerConnection still connected at the end of disconnectInsertionMarker");this.markerConnection=null,(e=t.getSvgRoot())&&e.setAttribute("visibility","hidden")}}showInsertionInputOutline(e){e=e.closest,this.highlightedBlock=e.getSourceBlock(),this.highlightedBlock.highlightShapeForInput(e,!0)}hideInsertionInputOutline(){if(this.highlightedBlock){if(!this.activeCandidate)throw Error("Cannot hide the insertion marker outline because there is no active candidate");this.highlightedBlock.highlightShapeForInput(this.activeCandidate.closest,!1),this.highlightedBlock=null}}showReplacementFade(e){if(this.fadedBlock=e.closest.targetBlock(),!this.fadedBlock)throw Error("Cannot show the replacement fade because the closest connection does not have a target block");this.fadedBlock.fadeForReplacement(!0)}hideReplacementFade(){this.fadedBlock&&(this.fadedBlock.fadeForReplacement(!1),this.fadedBlock=null)}getInsertionMarkers(){const e=[];return this.firstMarker&&e.push(this.firstMarker),this.lastMarker&&e.push(this.lastMarker),e}disposeInsertionMarker(e){if(e){i.disable$$module$build$src$core$events$utils();try{e.dispose()}finally{i.enable$$module$build$src$core$events$utils()}}}};(function(e){e=e.PREVIEW_TYPE||(e.PREVIEW_TYPE={}),e[e.INSERTION_MARKER=0]="INSERTION_MARKER",e[e.INPUT_OUTLINE=1]="INPUT_OUTLINE",e[e.REPLACEMENT_FADE=2]="REPLACEMENT_FADE"})(fs||(fs={})),fs.PREVIEW_TYPE;var jl=class{constructor(e){this.overrides=null,this.name=e}getClassName(){return this.name+"-renderer"}init(e,t){this.constants_=this.makeConstants_(),t&&(this.overrides=t,Object.assign(this.constants_,t)),this.constants_.setTheme(e),this.constants_.init()}createDom(e,t){this.constants_.createDom(e,this.name+"-"+t.name,"."+this.getClassName()+"."+t.getClassName())}refreshDom(e,t){const o=this.getConstants();o.dispose(),this.constants_=this.makeConstants_(),this.overrides&&Object.assign(this.constants_,this.overrides),this.constants_.randomIdentifier=o.randomIdentifier,this.constants_.setTheme(t),this.constants_.init(),this.createDom(e,t)}dispose(){this.constants_&&this.constants_.dispose()}makeConstants_(){return new Pl}makeRenderInfo_(e){return new Or(this,e)}makeDrawer_(e,t){return new Bl(e,t)}makeMarkerDrawer(e,t){return new gp(e,this.getConstants(),t)}makePathObject(e,t){return new Fl(e,t,this.constants_)}getConstants(){return this.constants_}shouldHighlightConnection(e){return!0}orphanCanConnectAtEnd(e,t,o){return!!Qe.getConnectionForOrphanedConnection(e,o===xe.OUTPUT_VALUE?t.outputConnection:t.previousConnection)}getConnectionPreviewMethod(e,t,o){return w("getConnectionPreviewMethod","v10","v12","an IConnectionPreviewer, if it fulfills your use case."),t.type===xe.OUTPUT_VALUE||t.type===xe.PREVIOUS_STATEMENT?!e.isConnected()||this.orphanCanConnectAtEnd(o,e.targetBlock(),t.type)?fs.PREVIEW_TYPE.INSERTION_MARKER:fs.PREVIEW_TYPE.REPLACEMENT_FADE:fs.PREVIEW_TYPE.INSERTION_MARKER}render(e){const t=this.makeRenderInfo_(e);t.measure(),this.makeDrawer_(e,t).draw()}},ot={};ot.BottomRow=rp,ot.Connection=ko,ot.ConstantProvider=Pl,ot.Drawer=Bl,ot.ExternalValueInput=Ll,ot.Field=hn,ot.Hat=ap,ot.Icon=Iv,ot.InRowSpacer=as,ot.InlineInput=lp,ot.InputConnection=zo,ot.InputRow=cp,ot.JaggedEdge=xv,ot.MarkerSvg=gp,ot.Measurable=Vs,ot.NextConnection=Dv,ot.OutputConnection=Av,ot.PathObject=Fl,ot.PreviousConnection=Ov,ot.RenderInfo=Or,ot.Renderer=jl,ot.RoundCorner=Dr,ot.Row=Ir,ot.SpacerRow=up,ot.SquareCorner=Ar,ot.StatementInput=xr,ot.TopRow=dp,ot.Types=F,ot.init=Rd,ot.register=ar,ot.unregister=z$;var Nv=class{constructor(e,t){this.workspace=e,this.theme=t,this.subscribedWorkspaces=[],this.componentDB=new Map}getTheme(){return this.theme}setTheme(e){var t=this.theme;this.theme=e,(e=this.workspace.getInjectionDiv())&&(t&&(t=t.getClassName())&&ze(e,t),(t=this.theme.getClassName())&&Oe(e,t));for(let o=0,n;n=this.subscribedWorkspaces[o];o++)n.refreshTheme();for(const[o,n]of this.componentDB)for(const u of n){e=u.element,t=u.propertyName;const g=this.theme&&this.theme.getComponentStyle(o);e.style.setProperty(t,g||"")}for(const o of this.subscribedWorkspaces)o.hideChaff()}subscribeWorkspace(e){this.subscribedWorkspaces.push(e)}unsubscribeWorkspace(e){if(!Ue(this.subscribedWorkspaces,e))throw Error("Cannot unsubscribe a workspace that hasn't been subscribed.")}subscribe(e,t,o){this.componentDB.has(t)||this.componentDB.set(t,[]),this.componentDB.get(t).push({element:e,propertyName:o}),t=this.theme&&this.theme.getComponentStyle(t),e.style.setProperty(o,t||"")}unsubscribe(e){if(e)for(const[t,o]of this.componentDB){for(let n=o.length-1;0<=n;n--)o[n].element===e&&o.splice(n,1);o.length||this.componentDB.delete(t)}}dispose(){this.subscribedWorkspaces.length=0,this.componentDB.clear()}},mp="VARIABLE_DYNAMIC",wi={CATEGORY_NAME:mp};wi.flyoutCategory=Qa,wi.flyoutCategoryBlocks=Pd,wi.onCreateVariableButtonClick_Colour=Ld,wi.onCreateVariableButtonClick_Number=Md,wi.onCreateVariableButtonClick_String=Nd;var Mv=30,ki=[];ki[xe.INPUT_VALUE]=xe.OUTPUT_VALUE,ki[xe.OUTPUT_VALUE]=xe.INPUT_VALUE,ki[xe.NEXT_STATEMENT]=xe.PREVIOUS_STATEMENT,ki[xe.PREVIOUS_STATEMENT]=xe.NEXT_STATEMENT;var fp="RENAME_VARIABLE_ID",$p="DELETE_VARIABLE_ID",Lv=class{canConnect(e,t,o,n){return this.canConnectWithReason(e,t,o,n)===Qe.CAN_CONNECT}canConnectWithReason(e,t,o,n){const u=this.doSafetyChecks(e,t);return u!==Qe.CAN_CONNECT?u:this.doTypeChecks(e,t)?o&&!this.doDragChecks(e,t,n||0)?Qe.REASON_DRAG_CHECKS_FAILED:Qe.CAN_CONNECT:Qe.REASON_CHECKS_FAILED}getErrorMessage(e,t,o){switch(e){case Qe.REASON_SELF_CONNECTION:return"Attempted to connect a block to itself.";case Qe.REASON_DIFFERENT_WORKSPACES:return"Blocks not on same workspace.";case Qe.REASON_WRONG_TYPE:return"Attempt to connect incompatible types.";case Qe.REASON_TARGET_NULL:return"Target connection is null.";case Qe.REASON_CHECKS_FAILED:return"Connection checks failed. "+(t+" expected "+t.getCheck()+", found "+o.getCheck());case Qe.REASON_SHADOW_PARENT:return"Connecting non-shadow to shadow block.";case Qe.REASON_DRAG_CHECKS_FAILED:return"Drag checks failed.";case Qe.REASON_PREVIOUS_AND_OUTPUT:return"Block would have an output and a previous connection.";default:return"Unknown connection failure: this should never happen!"}}doSafetyChecks(e,t){if(!e||!t)return Qe.REASON_TARGET_NULL;let o,n,u;return e.isSuperior()?(o=e.getSourceBlock(),n=t.getSourceBlock(),u=t):(n=e.getSourceBlock(),o=t.getSourceBlock(),u=e,e=t),o===n?Qe.REASON_SELF_CONNECTION:u.type!==ki[e.type]?Qe.REASON_WRONG_TYPE:o.workspace!==n.workspace?Qe.REASON_DIFFERENT_WORKSPACES:o.isShadow()&&!n.isShadow()?Qe.REASON_SHADOW_PARENT:u.type===xe.OUTPUT_VALUE&&n.previousConnection&&n.previousConnection.isConnected()||u.type===xe.PREVIOUS_STATEMENT&&n.outputConnection&&n.outputConnection.isConnected()?Qe.REASON_PREVIOUS_AND_OUTPUT:Qe.CAN_CONNECT}doTypeChecks(e,t){if(e=e.getCheck(),t=t.getCheck(),!e||!t)return!0;for(let o=0;oo||t.getSourceBlock().isInsertionMarker())return!1;switch(t.type){case xe.PREVIOUS_STATEMENT:return this.canConnectToPrevious_(e,t);case xe.OUTPUT_VALUE:if(t.isConnected()&&!t.targetBlock().isInsertionMarker()||e.isConnected())return!1;break;case xe.INPUT_VALUE:if(t.isConnected()&&!t.targetBlock().isMovable()&&!t.targetBlock().isShadow())return!1;break;case xe.NEXT_STATEMENT:if(t.isConnected()&&!e.getSourceBlock().nextConnection&&!t.targetBlock().isShadow()&&t.targetBlock().nextConnection||t.targetBlock()&&!t.targetBlock().isMovable()&&!t.targetBlock().isShadow())return!1;break;default:return!1}return!hr.includes(t)}canConnectToPrevious_(e,t){return e.targetConnection||hr.includes(t)?!1:t.targetConnection?(e=t.targetBlock(),e.isInsertionMarker()?!e.getPreviousBlock():!1):!0}};r($e.CONNECTION_CHECKER,Ws,Lv);var bp=class extends br{constructor(e){super(e),this.type=ee.VAR_DELETE,e&&(this.varType=e.type,this.varName=e.name)}toJson(){const e=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");return e.varType=this.varType,e.varName=this.varName,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new bp),t.varType=e.varType,t.varName=e.varName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");e?t.deleteVariableById(this.varId):t.createVariable(this.varName,this.varType,this.varId)}};r($e.EVENT,ee.VAR_DELETE,bp);var vp=class extends br{constructor(e,t){super(e),this.type=ee.VAR_RENAME,e&&(this.oldName=e.name,this.newName=typeof t>"u"?"":t)}toJson(){const e=super.toJson();if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson");return e.oldName=this.oldName,e.newName=this.newName,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new vp),t.oldName=e.oldName,t.newName=e.newName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson");e?t.renameVariableById(this.varId,this.newName):t.renameVariableById(this.varId,this.oldName)}};r($e.EVENT,ee.VAR_RENAME,vp);var yp=class{constructor(e){this.workspace=e,this.variableMap=new Map}clear(){for(const e of this.variableMap.values())for(;0{u&&t&&this.deleteVariableInternal(t,n)})):this.deleteVariableInternal(t,n)}else console.warn("Can't delete non-existent variable: "+e)}deleteVariableInternal(e,t){const o=i.getGroup$$module$build$src$core$events$utils();o||i.setGroup$$module$build$src$core$events$utils(!0);try{for(let n=0;ne.name)}getVariableUsesById(e){const t=[],o=this.workspace.getAllBlocks(!1);for(let n=0;n!o.isInsertionMarker())):[]}addTopComment(e){this.topComments.push(e),this.commentDB.has(e.id)&&console.warn('Overriding an existing comment on this workspace, with id "'+e.id+'"'),this.commentDB.set(e.id,e)}removeTopComment(e){if(!Ue(this.topComments,e))throw Error("Comment not present in workspace's list of top-most comments.");this.commentDB.delete(e.id)}getTopComments(e=!1){const t=[].concat(this.topComments);return e&&1!o.isInsertionMarker())}clear(){this.isClearing=!0;try{const e=i.getGroup$$module$build$src$core$events$utils();for(e||i.setGroup$$module$build$src$core$events$utils(!0);this.topBlocks.length;)this.topBlocks[0].dispose(!1);for(;this.topComments.length;)this.topComments[this.topComments.length-1].dispose();i.setGroup$$module$build$src$core$events$utils(e),this.variableMap.clear(),this.potentialVariableMap&&this.potentialVariableMap.clear()}finally{this.isClearing=!1}}renameVariableById(e,t){this.variableMap.renameVariableById(e,t)}createVariable(e,t,o){return this.variableMap.createVariable(e,t,o)}getVariableUsesById(e){return this.variableMap.getVariableUsesById(e)}deleteVariableById(e){this.variableMap.deleteVariableById(e)}getVariable(e,t){return this.variableMap.getVariable(e,t)}getVariableById(e){return this.variableMap.getVariableById(e)}getVariablesOfType(e){return this.variableMap.getVariablesOfType(e)}getVariableTypes(){return this.variableMap.getVariableTypes(this)}getAllVariables(){return this.variableMap.getAllVariables()}getAllVariableNames(){return this.variableMap.getAllVariableNames()}getWidth(){return 0}newBlock(e,t){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts")}newComment(e){throw Error("The implementation of newComment should be monkey-patched in by blockly.ts")}remainingCapacity(){return isNaN(this.options.maxBlocks)?1/0:this.options.maxBlocks-this.getAllBlocks(!1).length}remainingCapacityOfType(e){return this.options.maxInstances?(this.options.maxInstances[e]!==void 0?this.options.maxInstances[e]:1/0)-this.getBlocksByType(e,!1).length:1/0}isCapacityAvailable(e){if(!this.hasBlockLimits())return!0;let t=0;for(const o in e){if(e[o]>this.remainingCapacityOfType(o))return!1;t+=e[o]}return!(t>this.remainingCapacity())}hasBlockLimits(){return this.options.maxBlocks!==1/0||!!this.options.maxInstances}getUndoStack(){return this.undoStack_}getRedoStack(){return this.redoStack_}undo(e){var t=e?this.redoStack_:this.undoStack_,o=e?this.undoStack_:this.redoStack_;const n=t.pop();if(n){for(var u=[n];t.length&&n.group&&n.group===t[t.length-1].group;){const g=t.pop();g&&u.push(g)}for(t=0;tthis.MAX_UNDO&&0<=this.MAX_UNDO;)this.undoStack_.shift();for(let t=0;t!!t.getStyleName())),this.refreshToolboxSelection(),this.toolbox&&this.toolbox.refreshTheme(),this.isVisible()&&this.setVisible(!0);const e=new(ne(ee.THEME_CHANGE))(this.getTheme().name,this.id);z(e)}updateBlockStyles(e){for(let t=0,o;o=e[t];t++){const n=o.getStyleName();n&&o.setStyle(n)}}getInverseScreenCTM(){if(this.inverseScreenCTMDirty){const e=this.getParentSvg().getScreenCTM();e&&(this.inverseScreenCTM=e.inverse(),this.inverseScreenCTMDirty=!1)}return this.inverseScreenCTM}updateInverseScreenCTM(){this.inverseScreenCTMDirty=!0}isVisible(){return this.visible}getSvgXY(e){let t=0,o=0,n=1;(this.getCanvas().contains(e)||this.getBubbleCanvas().contains(e))&&(n=this.scale);do{const u=Wn(e);(e===this.getCanvas()||e===this.getBubbleCanvas())&&(n=1),t+=u.x*n,o+=u.y*n,e=e.parentNode}while(e&&e!==this.getParentSvg()&&e!==this.getInjectionDiv());return new ye(t,o)}getCachedParentSvgSize(){const e=this.cachedParentSvgSize;return new Xe(e.width,e.height)}getOriginOffsetInPixels(){return fa(this.getCanvas())}getInjectionDiv(){if(!this.injectionDiv){let e=this.svgGroup_;for(;e;){if((" "+(e.getAttribute("class")||"")+" ").includes(" injectionDiv ")){this.injectionDiv=e;break}e=e.parentNode}}return this.injectionDiv}getSvgGroup(){return this.svgGroup_}getBlockCanvas(){return this.getCanvas()}setResizeHandlerWrapper(e){this.resizeHandlerWrapper=e}createDom(e,t){return this.injectionDiv||(this.injectionDiv=t??null),this.svgGroup_=ie(J.G,{class:"blocklyWorkspace"}),e&&(this.svgBackground_=ie(J.RECT,{height:"100%",width:"100%",class:e},this.svgGroup_),e==="blocklyMainBackground"&&this.grid?this.svgBackground_.style.fill="url(#"+this.grid.getPatternId()+")":this.themeManager_.subscribe(this.svgBackground_,"workspaceBackgroundColour","fill")),this.layerManager=new qC(this),this.svgBlockCanvas_=this.layerManager.getBlockLayer(),this.svgBubbleCanvas_=this.layerManager.getBubbleLayer(),this.isFlyout||(H(this.svgGroup_,"pointerdown",this,this.onMouseDown,!1),this.dummyWheelListener=()=>{},document.body.addEventListener("wheel",this.dummyWheelListener),H(this.svgGroup_,"wheel",this,this.onMouseWheel)),this.options.hasCategories&&(this.toolbox=new(y($e.TOOLBOX,this.options,!0))(this)),this.grid&&this.grid.update(this.scale),this.recordDragTargets(),(e=y($e.CURSOR,this.options))&&this.markerManager.setCursor(new e),this.renderer.createDom(this.svgGroup_,this.getTheme()),this.svgGroup_}dispose(){if(this.rendered=!1,this.currentGesture_&&this.currentGesture_.cancel(),this.svgGroup_&&Ze(this.svgGroup_),this.toolbox&&(this.toolbox.dispose(),this.toolbox=null),this.flyout&&(this.flyout.dispose(),this.flyout=null),this.trashcan&&(this.trashcan.dispose(),this.trashcan=null),this.scrollbar&&(this.scrollbar.dispose(),this.scrollbar=null),this.zoomControls_&&this.zoomControls_.dispose(),this.audioManager&&this.audioManager.dispose(),this.grid&&(this.grid=null),this.renderer.dispose(),this.markerManager&&this.markerManager.dispose(),super.dispose(),this.themeManager_&&(this.themeManager_.unsubscribeWorkspace(this),this.themeManager_.unsubscribe(this.svgBackground_),this.options.parentWorkspace||this.themeManager_.dispose()),this.connectionDBList.length=0,this.toolboxCategoryCallbacks.clear(),this.flyoutButtonCallbacks.clear(),!this.options.parentWorkspace){const e=this.getParentSvg();e&&e.parentNode&&Ze(e.parentNode)}this.resizeHandlerWrapper&&(V(this.resizeHandlerWrapper),this.resizeHandlerWrapper=null),this.dummyWheelListener&&(document.body.removeEventListener("wheel",this.dummyWheelListener),this.dummyWheelListener=null)}addTrashcan(){this.trashcan=cs.newTrashcan(this);const e=this.trashcan.createDom();this.svgGroup_.insertBefore(e,this.getCanvas())}static newTrashcan(e){throw Error("The implementation of newTrashcan should be monkey-patched in by blockly.ts")}addZoomControls(){this.zoomControls_=new zb(this);const e=this.zoomControls_.createDom();this.svgGroup_.appendChild(e)}addFlyout(e){const t=new gs({parentWorkspace:this,rtl:this.RTL,oneBasedIndex:this.options.oneBasedIndex,horizontalLayout:this.horizontalLayout,renderer:this.options.renderer,rendererOverrides:this.options.rendererOverrides,move:{scrollbars:!0}});return t.toolboxPosition=this.options.toolboxPosition,this.flyout=this.horizontalLayout?new(y($e.FLYOUTS_HORIZONTAL_TOOLBOX,this.options,!0))(t):new(y($e.FLYOUTS_VERTICAL_TOOLBOX,this.options,!0))(t),this.flyout.autoClose=!1,this.flyout.getWorkspace().setVisible(!0),this.flyout.createDom(e)}getFlyout(e){return this.flyout||e?this.flyout:this.toolbox?this.toolbox.getFlyout():null}getToolbox(){return this.toolbox}updateScreenCalculations(){this.updateInverseScreenCTM(),this.recordDragTargets()}resizeContents(){this.resizesEnabled&&this.rendered&&(this.scrollbar&&this.scrollbar.resize(),this.updateInverseScreenCTM())}resize(){this.toolbox&&this.toolbox.position(),this.flyout&&this.flyout.position();const e=this.componentManager.getComponents(gt.Capability.POSITIONABLE,!0),t=this.getMetricsManager().getUiMetrics(),o=[];for(let n=0,u;u=e[n];n++){u.position(t,o);const g=u.getBoundingRectangle();g&&o.push(g)}this.scrollbar&&this.scrollbar.resize(),this.updateScreenCalculations()}updateScreenCalculationsIfScrolled(){const e=bu();ye.equals(this.lastRecordedPageScroll,e)||(this.lastRecordedPageScroll=e,this.updateScreenCalculations())}getLayerManager(){return this.layerManager}getCanvas(){return this.layerManager.getBlockLayer()}setCachedParentSvgSize(e,t){const o=this.getParentSvg();e!=null&&(this.cachedParentSvgSize.width=e,o.setAttribute("data-cached-width",`${e}`)),t!=null&&(this.cachedParentSvgSize.height=t,o.setAttribute("data-cached-height",`${t}`))}getBubbleCanvas(){return this.layerManager.getBubbleLayer()}getParentSvg(){if(!this.cachedParentSvg){let e=this.svgGroup_;for(;e;){if(e.tagName==="svg"){this.cachedParentSvg=e;break}e=e.parentNode}}return this.cachedParentSvg}maybeFireViewportChangeEvent(){if(C()){var e=this.scale,t=-this.scrollY,o=-this.scrollX;if(!(e===this.oldScale&&1>Math.abs(t-this.oldTop)&&1>Math.abs(o-this.oldLeft))){var n=new(ne(ee.VIEWPORT_CHANGE))(t,o,e,this.id,this.oldScale);this.oldScale=e,this.oldTop=t,this.oldLeft=o,z(n)}}}translate(e,t){let o;(o=this.layerManager)==null||o.translateLayers(new ye(e,t),this.scale);let n;(n=this.grid)==null||n.moveTo(e,t),this.maybeFireViewportChangeEvent()}getWidth(){const e=this.getMetrics();return e?e.viewWidth/this.scale:0}setVisible(e){this.visible=e,this.svgGroup_&&(this.scrollbar&&this.scrollbar.setContainerVisible(e),this.getFlyout()&&this.getFlyout().setContainerVisible(e),this.getParentSvg().style.display=e?"block":"none",this.toolbox&&this.toolbox.setVisible(e),e||this.hideChaff(!0))}render(){const e=this.getAllBlocks(!1);for(let t=e.length-1;0<=t;t--)e[t].queueRender();this.getTopBlocks().flatMap(t=>t.getDescendants(!1)).filter(t=>t.isInsertionMarker()).forEach(t=>t.queueRender()),Ts().then(()=>{this.markerManager.updateMarkers()})}highlightBlock(e,t){if(t===void 0){for(let o=0,n;n=this.highlightedBlocks[o];o++)n.setHighlighted(!1);this.highlightedBlocks.length=0}(e=e?this.getBlockById(e):null)&&((t=t===void 0||t)?this.highlightedBlocks.includes(e)||this.highlightedBlocks.push(e):Ue(this.highlightedBlocks,e),e.setHighlighted(t))}refreshToolboxSelection(){const e=this.isFlyout?this.targetWorkspace:this;e&&!e.currentGesture_&&e.toolbox&&e.toolbox.getFlyout()&&e.toolbox.refreshSelection()}renameVariableById(e,t){super.renameVariableById(e,t),this.refreshToolboxSelection()}deleteVariableById(e){super.deleteVariableById(e),this.refreshToolboxSelection()}createVariable(e,t,o){return e=super.createVariable(e,t,o),this.refreshToolboxSelection(),e}recordDragTargets(){const e=this.componentManager.getComponents(gt.Capability.DRAG_TARGET,!0);this.dragTargetAreas=[];for(let t=0,o;o=e[t];t++){const n=o.getClientRect();n&&this.dragTargetAreas.push({component:o,clientRect:n})}}newBlock(e,t){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts")}newComment(e){throw Error("The implementation of newComment should be monkey-patched in by blockly.ts")}getDragTarget(e){for(let t=0,o;o=this.dragTargetAreas[t];t++)if(o.clientRect.contains(e.clientX,e.clientY))return o.component;return null}onMouseDown(e){const t=this.getGesture(e);t&&t.handleWsStart(e,this)}startDrag(e,t){za(this,e,t)}moveDrag(e){return Ua(this,e)}isDragging(){return this.currentGesture_!==null&&this.currentGesture_.isDragging()}isDraggable(){return this.options.moveOptions&&this.options.moveOptions.drag}isMovable(){return this.options.moveOptions&&!!this.options.moveOptions.scrollbars||this.options.moveOptions&&this.options.moveOptions.wheel||this.options.moveOptions&&this.options.moveOptions.drag||this.options.zoomOptions&&this.options.zoomOptions.wheel||this.options.zoomOptions&&this.options.zoomOptions.pinch}isMovableHorizontally(){const e=!!this.scrollbar;return this.isMovable()&&(!e||e&&this.scrollbar.canScrollHorizontally())}isMovableVertically(){const e=!!this.scrollbar;return this.isMovable()&&(!e||e&&this.scrollbar.canScrollVertically())}onMouseWheel(e){if(bo.inProgress())e.preventDefault(),e.stopPropagation();else{var t=this.options.zoomOptions&&this.options.zoomOptions.wheel,o=this.options.moveOptions&&this.options.moveOptions.wheel;if(t||o){var n=Le(e);if(kh)var u=e.metaKey;t&&(e.ctrlKey||u||!o)?(n=-n.y/50,t=fe(e,this.getParentSvg(),this.getInverseScreenCTM()),this.zoom(t.x,t.y,n)):(t=this.scrollX-n.x,o=this.scrollY-n.y,e.shiftKey&&!n.x&&(t=this.scrollX-n.y,o=this.scrollY),this.scroll(t,o)),e.preventDefault()}}}getBlocksBoundingBox(){const e=this.getTopBoundedElements();if(!e.length)return new rt(0,0,0,0);const t=e[0].getBoundingRectangle();for(let n=1;nt.bottom&&(t.bottom=o.bottom),o.leftt.right&&(t.right=o.right))}return t}cleanUp(){this.setResizesEnabled(!1),i.setGroup$$module$build$src$core$events$utils(!0);var e=this.getTopBlocks(!0),t=e.filter(g=>g.isMovable());const o=e.filter(g=>!g.isMovable()).map(g=>g.getBoundingRectangle());e=function(g){for(const I of o)if(g.intersects(I))return I;return null};var n=0;const u=this.renderer.getConstants().MIN_BLOCK_HEIGHT;for(const g of t){for(t=g.getBoundingRectangle(),g.moveBy(-t.left,n-t.top,["cleanup"]),g.snapToGrid(),t=g.getBoundingRectangle(),n=e(t);n!=null;)n=n.top+n.getHeight()+u,g.moveBy(0,n-t.top,["cleanup"]),g.snapToGrid(),t=g.getBoundingRectangle(),n=e(t);n=g.getRelativeToSurfaceXY().y+g.getHeightWidth().height+u}i.setGroup$$module$build$src$core$events$utils(!1),this.setResizesEnabled(!0)}showContextMenu(e){if(!this.options.readOnly&&!this.isFlyout){var t=Ke.registry.getContextMenuOptions(Ke.ScopeType.WORKSPACE,{workspace:this});this.configureContextMenu&&this.configureContextMenu(t,e),sr(e,t,this.RTL,this)}}updateToolbox(e){if(e=$a(e)){if(!this.options.languageTree)throw Error("Existing toolbox is null. Can't create new toolbox.");if(ba(e)){if(!this.toolbox)throw Error("Existing toolbox has no categories. Can't change mode.");this.options.languageTree=e,this.toolbox.render(e)}else{if(!this.flyout)throw Error("Existing toolbox has categories. Can't change mode.");this.options.languageTree=e,this.flyout.show(e)}}else if(this.options.languageTree)throw Error("Can't nullify an existing toolbox.")}markFocused(){this.options.parentWorkspace?this.options.parentWorkspace.markFocused():(se(this),this.getParentSvg().focus({preventScroll:!0}))}zoom(e,t,o){o=Math.pow(this.options.zoomOptions.scaleSpeed,o);const n=this.scale*o;if(this.scale!==n){n>this.options.zoomOptions.maxScale?o=this.options.zoomOptions.maxScale/this.scale:nthis.options.zoomOptions.maxScale?e=this.options.zoomOptions.maxScale:this.options.zoomOptions.minScale&&et.autoHide(e))}static setTopLevelWorkspaceMetrics(e){const t=this.getMetrics();typeof e.x=="number"&&(this.scrollX=-(t.scrollLeft+(t.scrollWidth-t.viewWidth)*e.x)),typeof e.y=="number"&&(this.scrollY=-(t.scrollTop+(t.scrollHeight-t.viewHeight)*e.y)),this.translate(this.scrollX+t.absoluteLeft,this.scrollY+t.absoluteTop)}},_p=class extends Ss{constructor(e,t,o){super(o),this.type=ee.SELECTED,this.oldElementId=e??void 0,this.newElementId=t??void 0}toJson(){const e=super.toJson();return e.oldElementId=this.oldElementId,e.newElementId=this.newElementId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new _p),t.oldElementId=e.oldElementId,t.newElementId=e.newElementId,t}};r($e.EVENT,ee.SELECTED,_p);var Rr=class{paste(e,t,o){if(!t.isCapacityAvailable(e.typeCounts))return null;o&&(e.blockState.x=o.x,e.blockState.y=o.y),o=o||new ye(e.blockState.x||0,e.blockState.y||0),i.disable$$module$build$src$core$events$utils();let n;try{n=lo(e.blockState,t),U$(n,o)}finally{i.enable$$module$build$src$core$events$utils()}return n&&(C()&&!n.isShadow()&&z(new(ne(ee.BLOCK_CREATE))(n)),i.setSelected$$module$build$src$core$common(n),n)}};Rr.TYPE="block",Ca(Rr.TYPE,new Rr);var zl={};zl.bumpIntoBounds=Ji,zl.bumpIntoBoundsHandler=Bd,zl.bumpTopObjectsIntoBounds=el;var Bv=class{constructor(e){this.block=e,this.connectionPreviewer=this.connectionCandidate=this.startLoc=this.startChildConn=this.startParentConn=null,this.dragging=!1,this.dragOffset=new ye(0,0),this.inGroup=!1,this.workspace=e.workspace}isMovable(){if(this.block.isShadow()){let e,t;return(t=(e=this.block.getParent())==null?void 0:e.isMovable())!=null?t:!1}return this.block.isOwnMovable()&&!this.block.isDeadOrDying()&&!this.workspace.options.readOnly&&!this.block.isInFlyout}startDrag(e){if(this.block.isShadow())this.startDraggingShadow(e);else{this.dragging=!0,(this.inGroup=!!i.getGroup$$module$build$src$core$events$utils())||i.setGroup$$module$build$src$core$events$utils(!0),this.fireDragStartEvent(),this.startLoc=this.block.getRelativeToSurfaceXY(),this.connectionCandidate=null,this.connectionPreviewer=new(y($e.CONNECTION_PREVIEWER,this.workspace.options))(this.block),io(),this.workspace.setResizesEnabled(!1),Ki(),e=!!e&&(e.altKey||e.ctrlKey||e.metaKey),this.shouldDisconnect(e)&&this.disconnectBlock(e),this.block.setDragging(!0);var t;(t=this.workspace.getLayerManager())==null||t.moveToDragLayer(this.block)}}startDraggingShadow(e){const t=this.block.getParent();if(!t)throw Error("Tried to drag a shadow block with no parent. Shadow blocks should always have parents.");this.dragOffset=ye.difference(t.getRelativeToSurfaceXY(),this.block.getRelativeToSurfaceXY()),t.startDrag(e)}shouldDisconnect(e){return!!(this.block.getParent()||e&&this.block.nextConnection&&this.block.nextConnection.targetBlock())}disconnectBlock(e){let t,o,n;if(this.startParentConn=(n=(t=this.block.outputConnection)==null?void 0:t.targetConnection)!=null?n:(o=this.block.previousConnection)==null?void 0:o.targetConnection,e){let u;this.startChildConn=(u=this.block.nextConnection)==null?void 0:u.targetConnection}this.block.unplug(e),_d(this.block)}fireDragStartEvent(){const e=new(ne(ee.BLOCK_DRAG))(this.block,!0,this.block.getDescendants(!1));z(e)}fireDragEndEvent(){const e=new(ne(ee.BLOCK_DRAG))(this.block,!1,this.block.getDescendants(!1));z(e)}fireMoveEvent(){if(!this.block.isDeadOrDying()){var e=new(ne(ee.BLOCK_MOVE))(this.block);e.setReason(["drag"]),e.oldCoordinate=this.startLoc,e.recordNew(),z(e)}}drag(e){if(this.block.isShadow()){let t;(t=this.block.getParent())==null||t.drag(ye.sum(e,this.dragOffset))}else this.block.moveDuringDrag(e),this.updateConnectionPreview(this.block,ye.difference(e,this.startLoc))}updateConnectionPreview(e,t){var o=this.connectionCandidate;const n=this.getConnectionCandidate(e,t);if(n){this.connectionCandidate=t=o&&this.currCandidateIsBetter(o,t,n)?o:n;var{local:u,neighbour:g}=t;t=u.type===xe.OUTPUT_VALUE||u.type===xe.PREVIOUS_STATEMENT,o=g.isConnected()&&!g.targetBlock().isInsertionMarker(),t&&o&&!this.orphanCanConnectAtEnd(e,g.targetBlock(),u.type)?this.connectionPreviewer.previewReplacement(u,g,g.targetBlock()):this.connectionPreviewer.previewConnection(u,g)}else this.connectionPreviewer.hidePreview(),this.connectionCandidate=null}orphanCanConnectAtEnd(e,t,o){return!!Qe.getConnectionForOrphanedConnection(e,o===xe.OUTPUT_VALUE?t.outputConnection:t.previousConnection)}currCandidateIsBetter(e,t,o){const{local:n,neighbour:u}=e;e=new ye(n.x,n.y);const g=new ye(u.x,u.y);return t=ye.distance(ye.sum(e,t),g),o.distance>t-i.config$$module$build$src$core$config.currentConnectionPreference}getConnectionCandidate(e,t){e=this.getLocalConnections(e);let o=this.connectionCandidate?i.config$$module$build$src$core$config.connectingSnapRadius:i.config$$module$build$src$core$config.snapRadius,n=null;for(const u of e){const{connection:g,radius:I}=u.closest(o,t);g&&(n={local:u,neighbour:g,distance:I},o=I)}return n}getLocalConnections(e){const t=e.getConnections_(!1),o=e.lastConnectionInStack(!0);return o&&o!==e.nextConnection&&t.push(o),t}endDrag(e){if(this.block.isShadow()){let t;(t=this.block.getParent())==null||t.endDrag(e)}else{if(this.fireDragEndEvent(),this.fireMoveEvent(),no(),Ki(),this.connectionPreviewer.hidePreview(),!this.block.isDeadOrDying()&&this.dragging){let t;(t=this.workspace.getLayerManager())==null||t.moveOffDragLayer(this.block,Fo),this.block.setDragging(!1)}this.connectionCandidate?(this.applyConnections(this.connectionCandidate),this.disposeStep()):this.block.queueRender().then(()=>this.disposeStep()),this.inGroup||i.setGroup$$module$build$src$core$events$utils(!1)}}disposeStep(){this.block.snapToGrid(),this.connectionPreviewer.dispose(),this.workspace.setResizesEnabled(!0)}applyConnections(e){const{local:t,neighbour:o}=e;t.connect(o);const n=t.isSuperior()?o:t,u=this.block.getRootBlock();Ts().then(()=>{Ga(n.getSourceBlock()),setTimeout(()=>{u.bringToFront()},0)})}revertDrag(){if(this.block.isShadow()){let t;(t=this.block.getParent())==null||t.revertDrag()}else{var e;if((e=this.startChildConn)==null||e.connect(this.block.nextConnection),this.startParentConn)switch(this.startParentConn.type){case xe.INPUT_VALUE:this.startParentConn.connect(this.block.outputConnection);break;case xe.NEXT_STATEMENT:this.startParentConn.connect(this.block.previousConnection)}else{this.block.moveTo(this.startLoc,["drag"]);let t;(t=this.workspace.getLayerManager())==null||t.moveOffDragLayer(this.block,Fo),Ji(this.workspace,this.workspace.getMetricsManager().getScrollMetrics(!0),this.block)}this.startParentConn=this.startChildConn=null,this.connectionPreviewer.hidePreview(),this.connectionCandidate=null,this.block.setDragging(!1),this.dragging=!1}}},Fv=class{constructor(){this.drawer=this.curNode=this.colour=null,this.type="marker"}setDrawer(e){this.drawer=e}getDrawer(){return this.drawer}getCurNode(){return this.curNode}setCurNode(e){const t=this.curNode;this.curNode=e,this.drawer&&this.drawer.draw(t,this.curNode)}draw(){this.drawer&&this.drawer.draw(this.curNode,this.curNode)}hide(){this.drawer&&this.drawer.hide()}dispose(){this.getDrawer()&&this.getDrawer().dispose()}},wp=class extends Fv{constructor(){super(),this.type="cursor"}next(){var e=this.getCurNode();if(!e)return null;for(e=e.next();e&&e.next()&&(e.getType()===de.types.NEXT||e.getType()===de.types.BLOCK);)e=e.next();return e&&this.setCurNode(e),e}in(){var e=this.getCurNode();if(!e)return null;(e.getType()===de.types.PREVIOUS||e.getType()===de.types.OUTPUT)&&(e=e.next());let t,o;return(e=(o=(t=e)==null?void 0:t.in())!=null?o:null)&&this.setCurNode(e),e}prev(){var e=this.getCurNode();if(!e)return null;for(e=e.prev();e&&e.prev()&&(e.getType()===de.types.NEXT||e.getType()===de.types.BLOCK);)e=e.prev();return e&&this.setCurNode(e),e}out(){var e=this.getCurNode();return e?((e=e.out())&&e.getType()===de.types.BLOCK&&(e=e.prev()||e),e&&this.setCurNode(e),e):null}};r($e.CURSOR,Ws,wp);var Nr=class extends wp{constructor(){super()}next(){var e=this.getCurNode();return e?((e=this.getNextNode_(e,this.validNode_))&&this.setCurNode(e),e):null}in(){return this.next()}prev(){var e=this.getCurNode();return e?((e=this.getPreviousNode_(e,this.validNode_))&&this.setCurNode(e),e):null}out(){return this.prev()}getNextNode_(e,t){if(!e)return null;const o=e.in()||e.next();return t(o)?o:o?this.getNextNode_(o,t):(e=this.findSiblingOrParent(e.out()),t(e)?e:e?this.getNextNode_(e,t):null)}getPreviousNode_(e,t){if(!e)return null;let o=e.prev();return o=o?this.getRightMostChild(o):e.out(),t(o)?o:o?this.getPreviousNode_(o,t):null}validNode_(e){let t=!1;return e=e&&e.getType(),(e===de.types.OUTPUT||e===de.types.INPUT||e===de.types.FIELD||e===de.types.NEXT||e===de.types.PREVIOUS||e===de.types.WORKSPACE)&&(t=!0),t}findSiblingOrParent(e){if(!e)return null;const t=e.next();return t||this.findSiblingOrParent(e.out())}getRightMostChild(e){if(!e.in())return e;for(e=e.in();e&&e.next();)e=e.next();return this.getRightMostChild(e)}};Nr.registrationName="basicCursor",r($e.CURSOR,Nr.registrationName,Nr);var jv=class extends Nr{validNode_(e){let t=!1;const o=e&&e.getType();return e&&(e=e.getLocation(),o===de.types.FIELD&&e&&e.isTabNavigable()&&e.isClickable()&&(t=!0)),t}},zv=10,Kt=class extends Qe{constructor(e,t){super(e,t),this.highlighted=!1,this.targetConnection=null,this.db=e.workspace.connectionDBList[t],this.dbOpposite=e.workspace.connectionDBList[ki[t]],this.offsetInBlock=new ye(0,0),this.trackedState=Kt.TrackedState.WILL_TRACK}dispose(){super.dispose(),this.trackedState===Kt.TrackedState.TRACKED&&this.db.removeConnection(this,this.y);let e,t;(t=(e=this.sourceBlock_.pathObject).removeConnectionHighlight)==null||t.call(e,this)}getSourceBlock(){return super.getSourceBlock()}targetBlock(){return super.targetBlock()}distanceFrom(e){const t=this.x-e.x;return e=this.y-e.y,Math.sqrt(t*t+e*e)}bumpAwayFrom(e,t=!1){if(!this.sourceBlock_.workspace.isDragging()){var o=i.config$$module$build$src$core$config.snapRadius+Math.floor(Math.random()*zv),n=i.config$$module$build$src$core$config.snapRadius+Math.floor(Math.random()*zv),u=e.sourceBlock_.getRootBlock(),g=this.sourceBlock_.getRootBlock();if(!u.isInFlyout&&!g.isInFlyout){var I=!0;if(g.isMovable())u.isMovable()&&t&&(n=-n);else if(u.isMovable())I=!1,o=-o,n=-n;else return;t=I?e:this,e=I?this:e,u=I?g:u,(g=j()===u)||u.addSelect(),u.RTL&&(o=-o),u.moveBy(t.x+o-e.x,t.y+n-e.y,["bump"]),g||u.removeSelect()}}}moveTo(e,t){let o=!1;return this.trackedState===Kt.TrackedState.WILL_TRACK?(this.db.addConnection(this,t),this.trackedState=Kt.TrackedState.TRACKED,o=!0):this.trackedState===Kt.TrackedState.TRACKED&&(this.db.removeConnection(this,this.y),this.db.addConnection(this,t),o=!0),this.x=e,this.y=t,o}moveBy(e,t){return this.moveTo(this.x+e,this.y+t)}moveToOffset(e){return this.moveTo(e.x+this.offsetInBlock.x,e.y+this.offsetInBlock.y)}setOffsetInBlock(e,t){this.offsetInBlock.x=e,this.offsetInBlock.y=t}getOffsetInBlock(){return this.offsetInBlock}tightenEfficiently(){var e=this.targetConnection;const t=this.targetBlock();e&&t&&(e=ye.difference(this.offsetInBlock,e.offsetInBlock),t.translate(e.x,e.y))}closest(e,t){return this.dbOpposite.searchForClosest(this,e,t)}highlight(){this.highlighted=!0,this.getSourceBlock().queueRender()}unhighlight(){this.highlighted=!1,this.getSourceBlock().queueRender()}isHighlighted(){return this.highlighted}setTracking(e){e&&this.trackedState===Kt.TrackedState.TRACKED||!e&&this.trackedState===Kt.TrackedState.UNTRACKED||this.sourceBlock_.isInFlyout||(e?(this.db.addConnection(this,this.y),this.trackedState=Kt.TrackedState.TRACKED):(this.trackedState===Kt.TrackedState.TRACKED&&this.db.removeConnection(this,this.y),this.trackedState=Kt.TrackedState.UNTRACKED))}stopTrackingAll(){if(this.setTracking(!1),this.targetConnection){const e=this.targetBlock().getDescendants(!1);for(let t=0;tclearTimeout(e)),this.warningTextDb.clear(),this.getIcons().forEach(e=>e.dispose())}checkAndDelete(){this.workspace.isFlyout||(i.setGroup$$module$build$src$core$events$utils(!0),this.workspace.hideChaff(),this.outputConnection?this.dispose(!1,!0):this.dispose(!0,!0),i.setGroup$$module$build$src$core$events$utils(!1))}toCopyData(){return this.isInsertionMarker_?null:{paster:Rr.TYPE,blockState:os(this,{addCoordinates:!0,addNextBlocks:!1}),typeCounts:Ie(this,!0)}}applyColour(){this.pathObject.applyColour(this);const e=this.getIcons();for(let t=0;t{this.isDeadOrDying()||(this.warningTextDb.delete(t),this.setWarningText(e,t))},100));else if(this.isInFlyout&&(e=null),o=this.getIcon(wo.TYPE),e){let n=this.getSurroundParent(),u=null;for(;n;)n.isCollapsed()&&(u=n),n=n.getSurroundParent();u&&u.setWarningText(i.Msg$$module$build$src$core$msg.COLLAPSED_WARNINGS_WARNING,$s.COLLAPSED_WARNING_ID),o?o.addMessage(e,t):this.addIcon(new wo(this).addMessage(e,t))}else o&&(t?(o.addMessage("",t),o.getText()||this.removeIcon(wo.TYPE)):this.removeIcon(wo.TYPE))}setMutator(e){this.removeIcon(i.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE),e&&this.addIcon(e)}addIcon(e){return super.addIcon(e),e instanceof i.MutatorIcon$$module$build$src$core$icons$mutator_icon&&(this.mutator=e),e.initView(this.createIconPointerDownListener(e)),e.applyColour(),e.updateEditable(),this.queueRender(),e}createIconPointerDownListener(e){return t=>{this.isDeadOrDying()||(t=this.workspace.getGesture(t))&&t.setStartIcon(e)}}removeIcon(e){const t=super.removeIcon(e);return e.equals(i.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE)&&(this.mutator=null),this.queueRender(),t}setEnabled(e){w("setEnabled","v11","v12","the setDisabledReason method of BlockSvg");const t=this.isEnabled();super.setEnabled(e),this.isEnabled()===t||this.getInheritedDisabled()||this.updateDisabled()}setDisabledReason(e,t){const o=this.isEnabled();super.setDisabledReason(e,t),this.isEnabled()===o||this.getInheritedDisabled()||this.updateDisabled()}setHighlighted(e){this.pathObject.updateHighlighted(e)}addSelect(){this.pathObject.updateSelected(!0)}removeSelect(){this.pathObject.updateSelected(!1)}setDeleteStyle(e){this.pathObject.updateDraggingDelete(e)}getColour(){return this.style.colourPrimary}setColour(e){super.setColour(e),e=this.workspace.getRenderer().getConstants().getBlockStyleForColour(this.colour_),this.pathObject.setStyle(e.style),this.style=e.style,this.styleName_=e.name,this.applyColour()}setStyle(e){const t=this.workspace.getRenderer().getConstants().getBlockStyle(e);if(this.styleName_=e,t)this.hat=t.hat,this.pathObject.setStyle(t),this.colour_=t.colourPrimary,this.style=t,this.applyColour();else throw Error("Invalid style name: "+e)}getStyle(){return this.style}bringToFront(e=!1){let t=this;if(!t.isDeadOrDying())do{const o=t.getSvgRoot(),n=o.parentNode,u=n.childNodes;if(u[u.length-1]!==o&&n.appendChild(o),e)break;t=t.getParent()}while(t)}setPreviousStatement(e,t){super.setPreviousStatement(e,t),this.queueRender()}setNextStatement(e,t){super.setNextStatement(e,t),this.queueRender()}setOutput(e,t){super.setOutput(e,t),this.queueRender()}setInputsInline(e){super.setInputsInline(e),this.queueRender()}removeInput(e,t){return e=super.removeInput(e,t),this.queueRender(),e}moveNumberedInputBefore(e,t){super.moveNumberedInputBefore(e,t),this.queueRender()}appendInput(e){return super.appendInput(e),this.queueRender(),e}setConnectionTracking(e){if(this.previousConnection&&this.previousConnection.setTracking(e),this.outputConnection&&this.outputConnection.setTracking(e),this.nextConnection){this.nextConnection.setTracking(e);var t=this.nextConnection.targetBlock();t&&t.setConnectionTracking(e)}if(!this.collapsed_)for(t=0;t=this.workspace.options.maxTrashcanContents||(e=new gs({scrollbars:!0,parentWorkspace:this.workspace,rtl:this.workspace.RTL,oneBasedIndex:this.workspace.options.oneBasedIndex,renderer:this.workspace.options.renderer,rendererOverrides:this.workspace.options.rendererOverrides,move:{scrollbars:!0}}),this.workspace.horizontalLayout?(e.toolboxPosition=this.workspace.toolboxPosition===Ge.TOP?Ge.BOTTOM:Ge.TOP,this.flyout=new(y($e.FLYOUTS_HORIZONTAL_TOOLBOX,this.workspace.options,!0))(e)):(e.toolboxPosition=this.workspace.toolboxPosition===Ge.RIGHT?Ge.LEFT:Ge.RIGHT,this.flyout=new(y($e.FLYOUTS_VERTICAL_TOOLBOX,this.workspace.options,!0))(e)),this.workspace.addChangeListener(this.onDelete.bind(this)))}createDom(){this.svgGroup=ie(J.G,{class:"blocklyTrash"});let e;const t=String(Math.random()).substring(2);e=ie(J.CLIPPATH,{id:"blocklyTrashBodyClipPath"+t},this.svgGroup),ie(J.RECT,{width:mn,height:Hl,y:fn},e);const o=ie(J.IMAGE,{width:Wt.width,x:-Cp,height:Wt.height,y:-Tp,"clip-path":"url(#blocklyTrashBodyClipPath"+t+")"},this.svgGroup);return o.setAttributeNS(is,"xlink:href",this.workspace.options.pathToMedia+Wt.url),e=ie(J.CLIPPATH,{id:"blocklyTrashLidClipPath"+t},this.svgGroup),ie(J.RECT,{width:mn,height:fn},e),this.svgLid=ie(J.IMAGE,{width:Wt.width,x:-Cp,height:Wt.height,y:-Tp,"clip-path":"url(#blocklyTrashLidClipPath"+t+")"},this.svgGroup),this.svgLid.setAttributeNS(is,"xlink:href",this.workspace.options.pathToMedia+Wt.url),ue(this.svgGroup,"pointerdown",this,this.blockMouseDownWhenOpenable),ue(this.svgGroup,"pointerup",this,this.click),ue(o,"pointerover",this,this.mouseOver),ue(o,"pointerout",this,this.mouseOut),this.animateLid(),this.svgGroup}init(){0{let o;(o=this.flyout)==null||o.show(e),t.cursor="";let n;(n=this.workspace.scrollbar)==null||n.setVisible(!1)},10),this.fireUiEvent(!0)}}closeFlyout(){if(this.contentsIsOpen()){var e;(e=this.flyout)==null||e.hide();var t;(t=this.workspace.scrollbar)==null||t.setVisible(!0),this.fireUiEvent(!1),this.workspace.recordDragTargets()}}autoHide(e){!e&&this.flyout&&this.closeFlyout()}emptyContents(){this.hasContents()&&(this.contents.length=0,this.setMinOpenness(0),this.closeFlyout())}position(e,t){if(this.initialized){var o=wa(this.workspace,e);e=_a(o,new Xe(mn,Hl+fn),rT,Wv,e,this.workspace),t=ka(e,Wv,o.vertical===$o.TOP?Po.DOWN:Po.UP,t),this.top=t.top,this.left=t.left;var n;(n=this.svgGroup)==null||n.setAttribute("transform","translate("+this.left+","+this.top+")");var u;(u=this.flyout)==null||u.position()}}getBoundingRectangle(){return new rt(this.top,this.top+Hl+fn,this.left,this.left+mn)}getClientRect(){if(!this.svgGroup)return null;var e=this.svgGroup.getBoundingClientRect();const t=e.top+Tp-Wl;return e=e.left+Cp-Wl,new rt(t,t+fn+Hl+2*Wl,e,e+mn+2*Wl)}onDragOver(e){this.setLidOpen(this.wouldDelete_)}onDragExit(e){this.setLidOpen(!1)}onDrop(e){setTimeout(this.setLidOpen.bind(this,!1),100)}setLidOpen(e){this.isLidOpen!==e&&(this.lidTask&&clearTimeout(this.lidTask),this.isLidOpen=e,this.animateLid())}animateLid(){const e=cT;var t=1/(e+1);this.lidOpen+=this.isLidOpen?t:-t,this.lidOpen=Math.min(Math.max(this.lidOpen,this.minOpenness),1),this.setLidAngle(this.lidOpen*Vv),t=Gv+this.lidOpen*(uT-Gv),this.svgGroup&&(this.svgGroup.style.opacity=`${t}`),this.lidOpen>this.minOpenness&&1>this.lidOpen&&(this.lidTask=setTimeout(this.animateLid.bind(this),lT/e))}setLidAngle(e){const t=this.workspace.toolboxPosition===Ge.RIGHT||this.workspace.horizontalLayout&&this.workspace.RTL;let o;(o=this.svgLid)==null||o.setAttribute("transform","rotate("+(t?-e:e)+","+(t?4:mn-4)+","+(fn-2)+")")}setMinOpenness(e){this.minOpenness=e,this.isLidOpen||this.setLidAngle(e*Vv)}closeLid(){this.setLidOpen(!1)}click(){this.hasContents()&&!this.workspace.isDragging()&&this.openFlyout()}fireUiEvent(e){e=new(ne(ee.TRASHCAN_OPEN))(e,this.workspace.id),z(e)}blockMouseDownWhenOpenable(e){!this.contentsIsOpen()&&this.hasContents()&&e.stopPropagation()}mouseOver(){this.hasContents()&&this.setLidOpen(!0)}mouseOut(){this.setLidOpen(!1)}onDelete(e){if(!(0>=this.workspace.options.maxTrashcanContents||!S(e)||e.wasShadow)){if(!e.oldJson)throw Error("Encountered a delete event without proper oldJson");if(e=JSON.stringify(this.cleanBlockJson(e.oldJson)),!this.contents.includes(e)){for(this.contents.unshift(e);this.contents.length>this.workspace.options.maxTrashcanContents;)this.contents.pop();this.setMinOpenness(aT)}}}cleanBlockJson(e){function t(o){if(o){if(delete o.id,delete o.x,delete o.y,delete o.enabled,delete o.disabledReasons,o.icons&&o.icons.comment){var n=o.icons.comment;delete n.height,delete n.width,delete n.pinned}n=o.inputs;for(var u in n){var g=n[u];const I=g.block;g=g.shadow,I&&t(I),g&&t(g)}o.next&&(u=o.next,o=u.block,u=u.shadow,o&&t(o),u&&t(u))}}return e=JSON.parse(JSON.stringify(e)),t(e),Object.assign({},{kind:"BLOCK"},e)}},mn=47,Hl=44,fn=16,Wv=20,rT=20,Wl=10,Cp=0,Tp=32,aT=.1,lT=80,cT=4,Gv=.4,uT=.8,Vv=45,st=class{constructor(){this.shortcuts=new Map,this.keyMap=new Map,this.reset()}reset(){this.shortcuts.clear(),this.keyMap.clear()}register(e,t){if(this.shortcuts.get(e.name)&&!t)throw Error(`Shortcut named "${e.name}" already exists.`);if(this.shortcuts.set(e.name,e),t=e.keyCodes,t!=null&&t.length)for(const o of t)this.addKeyMapping(o,e.name,!!e.allowCollision)}unregister(e){return this.shortcuts.get(e)?(this.removeAllKeyMappings(e),this.shortcuts.delete(e),!0):(console.warn(`Keyboard shortcut named "${e}" not found.`),!1)}addKeyMapping(e,t,o){e=`${e}`;const n=this.keyMap.get(e);if(n&&!o)throw Error(`Shortcut named "${t}" collides with shortcuts "${n}"`);n&&o?n.unshift(t):this.keyMap.set(e,[t])}removeKeyMapping(e,t,o){const n=this.keyMap.get(e);if(!n)return o||console.warn(`No keyboard shortcut named "${t}" registered with key code "${e}"`),!1;const u=n.indexOf(t);return-1Yd(t)),e.length?e:null}load(e,t){const o=t.getProcedureMap();for(const n of e)o.add(Jd(this.procedureModelClass,this.parameterModelClass,n,t))}clear(e){e.getProcedureMap().clear()}},Gl={};Gl.ProcedureSerializer=hT,Gl.loadProcedure=Jd,Gl.saveProcedure=Yd;var Kv=class{constructor(){this.priority=Ub}save(e){const t=[];for(const o of e.getAllVariables())e={name:o.name,id:o.getId()},o.type&&(e.type=o.type),t.push(e);return t.length?t:null}load(e,t){for(const o of e)t.createVariable(o.name,o.type,o.id)}clear(e){e.getVariableMap().clear()}};Vn("variables",new Kv);var Yv={};Yv.VariableSerializer=Kv;var Ip={};Ip.load=J$,Ip.save=Y$;var pT={blocks:_r,exceptions:pi,priorities:UC,procedures:Gl,registry:Dh,variables:Yv,workspaceComments:hl,workspaces:Ip},xp=class{constructor(e,t,o,n,u){this.workspace=e,this.oldHostMetrics=this.corner_=this.vScroll=this.hScroll=null,t=t===void 0?!0:t,o=o===void 0?!0:o;const g=t&&o;t&&(this.hScroll=new yt(e,!0,g,n,u)),o&&(this.vScroll=new yt(e,!1,g,n,u)),g&&(this.corner_=ie(J.RECT,{height:yt.scrollbarThickness,width:yt.scrollbarThickness,class:"blocklyScrollbarBackground"}),At(this.corner_,e.getBubbleCanvas()))}dispose(){Ze(this.corner_),this.oldHostMetrics=this.corner_=null,this.hScroll&&(this.hScroll.dispose(),this.hScroll=null),this.vScroll&&(this.vScroll.dispose(),this.vScroll=null)}resize(){const e=this.workspace.getMetrics();if(e){var t=!1,o=!1;if(this.oldHostMetrics&&this.oldHostMetrics.viewWidth===e.viewWidth&&this.oldHostMetrics.viewHeight===e.viewHeight&&this.oldHostMetrics.absoluteTop===e.absoluteTop&&this.oldHostMetrics.absoluteLeft===e.absoluteLeft?(this.oldHostMetrics&&this.oldHostMetrics.scrollWidth===e.scrollWidth&&this.oldHostMetrics.viewLeft===e.viewLeft&&this.oldHostMetrics.scrollLeft===e.scrollLeft||(t=!0),this.oldHostMetrics&&this.oldHostMetrics.scrollHeight===e.scrollHeight&&this.oldHostMetrics.viewTop===e.viewTop&&this.oldHostMetrics.scrollTop===e.scrollTop||(o=!0)):o=t=!0,t||o){try{i.disable$$module$build$src$core$events$utils(),this.hScroll&&t&&this.hScroll.resize(e),this.vScroll&&o&&this.vScroll.resize(e)}finally{i.enable$$module$build$src$core$events$utils()}this.workspace.maybeFireViewportChangeEvent()}if(this.hScroll&&this.vScroll){if(!this.oldHostMetrics||this.oldHostMetrics.viewWidth!==e.viewWidth||this.oldHostMetrics.absoluteLeft!==e.absoluteLeft){let n;(n=this.corner_)==null||n.setAttribute("x",String(this.vScroll.position.x))}if(!this.oldHostMetrics||this.oldHostMetrics.viewHeight!==e.viewHeight||this.oldHostMetrics.absoluteTop!==e.absoluteTop){let n;(n=this.corner_)==null||n.setAttribute("y",String(this.hScroll.position.y))}}this.oldHostMetrics=e}}canScrollHorizontally(){return!!this.hScroll}canScrollVertically(){return!!this.vScroll}setOrigin(e,t){this.hScroll&&this.hScroll.setOrigin(e,t),this.vScroll&&this.vScroll.setOrigin(e,t)}set(e,t,o){this.hScroll&&this.hScroll.set(e,!1),this.vScroll&&this.vScroll.set(t,!1),(o||o===void 0)&&(e={},this.hScroll&&(e.x=this.hScroll.getRatio_()),this.vScroll&&(e.y=this.vScroll.getRatio_()),this.workspace.setMetrics(e))}setX(e){this.hScroll&&this.hScroll.set(e,!0)}setY(e){this.vScroll&&this.vScroll.set(e,!0)}setContainerVisible(e){this.hScroll&&this.hScroll.setContainerVisible(e),this.vScroll&&this.vScroll.setContainerVisible(e)}isVisible(){let e=!1;return this.hScroll&&(e=this.hScroll.isVisible()),this.vScroll&&(e=e||this.vScroll.isVisible()),e}setVisible(e){this.hScroll&&this.hScroll.setVisibleInternal(e),this.vScroll&&this.vScroll.setVisibleInternal(e)}resizeContent(e){this.hScroll&&this.hScroll.resizeContentHorizontal(e),this.vScroll&&this.vScroll.resizeContentVertical(e)}resizeView(e){this.hScroll&&this.hScroll.resizeViewHorizontal(e),this.vScroll&&this.vScroll.resizeViewVertical(e)}},Dp=class{constructor(e){this.workspace_=e}getDimensionsPx_(e){let t=0,o=0;return e&&(t=e.getWidth(),o=e.getHeight()),new Xe(t,o)}getFlyoutMetrics(e){return e=this.getDimensionsPx_(this.workspace_.getFlyout(e)),{width:e.width,height:e.height,position:this.workspace_.toolboxPosition}}getToolboxMetrics(){const e=this.getDimensionsPx_(this.workspace_.getToolbox());return{width:e.width,height:e.height,position:this.workspace_.toolboxPosition}}getSvgMetrics(){return this.workspace_.getCachedParentSvgSize()}getAbsoluteMetrics(){let e=0,t=0;const o=this.getToolboxMetrics(),n=this.getFlyoutMetrics(),u=!!this.workspace_.getToolbox();var g;const I=!((g=this.workspace_.getFlyout())!=null&&g.autoClose);g=u?o.position:n.position;const L=g===Ge.TOP;return g===Ge.LEFT&&(u&&(e+=o.width),I&&(e+=n.width)),L&&(u&&(t+=o.height),I&&(t+=n.height)),{top:t,left:e}}getViewMetrics(e){e=e?this.workspace_.scale:1;const t=this.getSvgMetrics(),o=this.getToolboxMetrics(),n=this.getFlyoutMetrics(),u=!!this.workspace_.getToolbox();var g;const I=!((g=this.workspace_.getFlyout())!=null&&g.autoClose);g=u?o.position:n.position;const L=g===Ge.LEFT||g===Ge.RIGHT;return(g===Ge.TOP||g===Ge.BOTTOM)&&(u&&(t.height-=o.height),I&&(t.height-=n.height)),L&&(u&&(t.width-=o.width),I&&(t.width-=n.width)),{height:t.height/e,width:t.width/e,top:-this.workspace_.scrollY/e,left:-this.workspace_.scrollX/e}}getContentMetrics(e){e=e?1:this.workspace_.scale;const t=this.workspace_.getBlocksBoundingBox();return{height:(t.bottom-t.top)*e,width:(t.right-t.left)*e,top:t.top*e,left:t.left*e}}hasFixedEdges(){return!this.workspace_.isMovableHorizontally()||!this.workspace_.isMovableVertically()}getComputedFixedEdges_(e){if(!this.hasFixedEdges())return{};const t=this.workspace_.isMovableHorizontally(),o=this.workspace_.isMovableVertically();e=e||this.getViewMetrics(!1);const n={};return o||(n.top=e.top,n.bottom=e.top+e.height),t||(n.left=e.left,n.right=e.left+e.width),n}getPaddedContent_(e,t){const o=t.top+t.height,n=t.left+t.width,u=e.width;e=e.height;const g=u/2,I=e/2;return{top:Math.min(t.top-I,o-e),bottom:Math.max(o+I,t.top+e),left:Math.min(t.left-g,n-u),right:Math.max(n+g,t.left+u)}}getScrollMetrics(e,t,o){e=e?this.workspace_.scale:1,t=t||this.getViewMetrics(!1);var n=o||this.getContentMetrics();o=this.getComputedFixedEdges_(t),t=this.getPaddedContent_(t,n),n=o.top!==void 0?o.top:t.top;const u=o.left!==void 0?o.left:t.left;return{top:n/e,left:u/e,width:((o.right!==void 0?o.right:t.right)-u)/e,height:((o.bottom!==void 0?o.bottom:t.bottom)-n)/e}}getUiMetrics(){return{viewMetrics:this.getViewMetrics(),absoluteMetrics:this.getAbsoluteMetrics(),toolboxMetrics:this.getToolboxMetrics()}}getMetrics(){const e=this.getToolboxMetrics(),t=this.getFlyoutMetrics(!0),o=this.getSvgMetrics(),n=this.getAbsoluteMetrics(),u=this.getViewMetrics(),g=this.getContentMetrics(),I=this.getScrollMetrics(!1,u,g);return{contentHeight:g.height,contentWidth:g.width,contentTop:g.top,contentLeft:g.left,scrollHeight:I.height,scrollWidth:I.width,scrollTop:I.top,scrollLeft:I.left,viewHeight:u.height,viewWidth:u.width,viewTop:u.top,viewLeft:u.left,absoluteTop:n.top,absoluteLeft:n.left,svgHeight:o.height,svgWidth:o.width,toolboxWidth:e.width,toolboxHeight:e.height,toolboxPosition:e.position,flyoutWidth:t.width,flyoutHeight:t.height}}};r($e.METRICS_MANAGER,Ws,Dp),"Blockly"in globalThis||(globalThis.Blockly={Msg:Zb});var Jv=class extends Pl{constructor(){super(),this.GRID_UNIT=4,this.CURSOR_COLOUR="#ffa200",this.CURSOR_RADIUS=5,this.JAGGED_TEETH_WIDTH=this.JAGGED_TEETH_HEIGHT=0,this.START_HAT_HEIGHT=22,this.START_HAT_WIDTH=96,this.SHAPES={HEXAGONAL:1,ROUND:2,SQUARE:3,PUZZLE:4,NOTCH:5},this.SHAPE_IN_SHAPE_PADDING={1:{0:5*this.GRID_UNIT,1:2*this.GRID_UNIT,2:5*this.GRID_UNIT,3:5*this.GRID_UNIT},2:{0:3*this.GRID_UNIT,1:3*this.GRID_UNIT,2:1*this.GRID_UNIT,3:2*this.GRID_UNIT},3:{0:2*this.GRID_UNIT,1:2*this.GRID_UNIT,2:2*this.GRID_UNIT,3:2*this.GRID_UNIT}},this.FULL_BLOCK_FIELDS=!0,this.FIELD_TEXT_FONTWEIGHT="bold",this.FIELD_TEXT_FONTFAMILY='"Helvetica Neue", "Segoe UI", Helvetica, sans-serif',this.FIELD_COLOUR_FULL_BLOCK=this.FIELD_TEXTINPUT_BOX_SHADOW=this.FIELD_DROPDOWN_SVG_ARROW=this.FIELD_DROPDOWN_COLOURED_DIV=this.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW=!0,this.SELECTED_GLOW_COLOUR="#fff200",this.SELECTED_GLOW_SIZE=.5,this.REPLACEMENT_GLOW_COLOUR="#fff200",this.REPLACEMENT_GLOW_SIZE=2,this.selectedGlowFilterId="",this.selectedGlowFilter=null,this.replacementGlowFilterId="",this.SQUARED=this.ROUNDED=this.HEXAGONAL=this.replacementGlowFilter=null,this.SMALL_PADDING=this.GRID_UNIT,this.MEDIUM_PADDING=2*this.GRID_UNIT,this.MEDIUM_LARGE_PADDING=3*this.GRID_UNIT,this.LARGE_PADDING=4*this.GRID_UNIT,this.CORNER_RADIUS=1*this.GRID_UNIT,this.NOTCH_WIDTH=9*this.GRID_UNIT,this.NOTCH_HEIGHT=2*this.GRID_UNIT,this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT=3*this.GRID_UNIT,this.MIN_BLOCK_WIDTH=2*this.GRID_UNIT,this.MIN_BLOCK_HEIGHT=12*this.GRID_UNIT,this.EMPTY_STATEMENT_INPUT_HEIGHT=6*this.GRID_UNIT,this.TOP_ROW_MIN_HEIGHT=this.CORNER_RADIUS,this.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING,this.BOTTOM_ROW_MIN_HEIGHT=this.CORNER_RADIUS,this.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT=6*this.GRID_UNIT,this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT,this.STATEMENT_INPUT_SPACER_MIN_WIDTH=40*this.GRID_UNIT,this.STATEMENT_INPUT_PADDING_LEFT=4*this.GRID_UNIT,this.EMPTY_INLINE_INPUT_PADDING=4*this.GRID_UNIT,this.EMPTY_INLINE_INPUT_HEIGHT=8*this.GRID_UNIT,this.DUMMY_INPUT_MIN_HEIGHT=8*this.GRID_UNIT,this.DUMMY_INPUT_SHADOW_MIN_HEIGHT=6*this.GRID_UNIT,this.CURSOR_WS_WIDTH=20*this.GRID_UNIT,this.FIELD_TEXT_FONTSIZE=3*this.GRID_UNIT,this.FIELD_BORDER_RECT_RADIUS=this.CORNER_RADIUS,this.FIELD_BORDER_RECT_X_PADDING=2*this.GRID_UNIT,this.FIELD_BORDER_RECT_Y_PADDING=1.625*this.GRID_UNIT,this.FIELD_BORDER_RECT_HEIGHT=8*this.GRID_UNIT,this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=8*this.GRID_UNIT,this.FIELD_DROPDOWN_SVG_ARROW_PADDING=this.FIELD_BORDER_RECT_X_PADDING,this.FIELD_COLOUR_DEFAULT_WIDTH=6*this.GRID_UNIT,this.FIELD_COLOUR_DEFAULT_HEIGHT=8*this.GRID_UNIT,this.FIELD_CHECKBOX_X_OFFSET=1*this.GRID_UNIT,this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH=12*this.GRID_UNIT}setFontConstants_(e){super.setFontConstants_(e),this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT=this.FIELD_TEXT_HEIGHT+2*this.FIELD_BORDER_RECT_Y_PADDING}init(){super.init(),this.HEXAGONAL=this.makeHexagonal(),this.ROUNDED=this.makeRounded(),this.SQUARED=this.makeSquared(),this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT+this.INSIDE_CORNERS.rightWidth}setDynamicProperties_(e){super.setDynamicProperties_(e),this.SELECTED_GLOW_COLOUR=e.getComponentStyle("selectedGlowColour")||this.SELECTED_GLOW_COLOUR;const t=Number(e.getComponentStyle("selectedGlowSize"));this.SELECTED_GLOW_SIZE=t&&!isNaN(t)?t:this.SELECTED_GLOW_SIZE,this.REPLACEMENT_GLOW_COLOUR=e.getComponentStyle("replacementGlowColour")||this.REPLACEMENT_GLOW_COLOUR,this.REPLACEMENT_GLOW_SIZE=(e=Number(e.getComponentStyle("replacementGlowSize")))&&!isNaN(e)?e:this.REPLACEMENT_GLOW_SIZE}dispose(){super.dispose(),this.selectedGlowFilter&&Ze(this.selectedGlowFilter),this.replacementGlowFilter&&Ze(this.replacementGlowFilter)}makeStartHat(){const e=this.START_HAT_HEIGHT,t=this.START_HAT_WIDTH,o=Xt("c",[Me(25,-e),Me(71,-e),Me(t,0)]);return{height:e,width:t,path:o}}makeHexagonal(){function e(o,n,u){var g=o/2;return g=g>t?t:g,u=u?-1:1,o=(n?-1:1)*o/2,Hs(-u*g,o)+Hs(u*g,o)}const t=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH;return{type:this.SHAPES.HEXAGONAL,isDynamic:!0,width(o){return o/=2,o>t?t:o},height(o){return o},connectionOffsetY(o){return o/2},connectionOffsetX(o){return-o},pathDown(o){return e(o,!1,!1)},pathUp(o){return e(o,!0,!1)},pathRightDown(o){return e(o,!1,!0)},pathRightUp(o){return e(o,!1,!0)}}}makeRounded(){function e(n,u,g){const I=n>o?n-o:0;n=(n>o?o:n)/2;const L=g===u?"0":"1";return vt("a","0 0,"+L,n,Me((g?1:-1)*n,(u?-1:1)*n))+De("v",(u?-1:1)*I)+vt("a","0 0,"+L,n,Me((g?-1:1)*n,(u?-1:1)*n))}const t=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH,o=2*t;return{type:this.SHAPES.ROUND,isDynamic:!0,width(n){return n/=2,n>t?t:n},height(n){return n},connectionOffsetY(n){return n/2},connectionOffsetX(n){return-n},pathDown(n){return e(n,!1,!1)},pathUp(n){return e(n,!0,!1)},pathRightDown(n){return e(n,!1,!0)},pathRightUp(n){return e(n,!1,!0)}}}makeSquared(){function e(o,n,u){o-=2*t;const g=u===n?"0":"1";return vt("a","0 0,"+g,t,Me((u?1:-1)*t,(n?-1:1)*t))+De("v",(n?-1:1)*o)+vt("a","0 0,"+g,t,Me((u?-1:1)*t,(n?-1:1)*t))}const t=this.CORNER_RADIUS;return{type:this.SHAPES.SQUARE,isDynamic:!0,width(o){return t},height(o){return o},connectionOffsetY(o){return o/2},connectionOffsetX(o){return-o},pathDown(o){return e(o,!1,!1)},pathUp(o){return e(o,!0,!1)},pathRightDown(o){return e(o,!1,!0)},pathRightUp(o){return e(o,!1,!0)}}}shapeFor(e){let t=e.getCheck();switch(!t&&e.targetConnection&&(t=e.targetConnection.getCheck()),e.type){case xe.INPUT_VALUE:case xe.OUTPUT_VALUE:if(e=e.getSourceBlock().getOutputShape(),e!==null)switch(e){case this.SHAPES.HEXAGONAL:return this.HEXAGONAL;case this.SHAPES.ROUND:return this.ROUNDED;case this.SHAPES.SQUARE:return this.SQUARED}return t&&t.includes("Boolean")?this.HEXAGONAL:t&&t.includes("Number")?this.ROUNDED:(t&&t.includes("String"),this.ROUNDED);case xe.PREVIOUS_STATEMENT:case xe.NEXT_STATEMENT:return this.NOTCH;default:throw Error("Unknown type")}}makeNotch(){function e(Ee){return Xt("c",[Me(Ee*u/2,0),Me(Ee*u*3/4,I/2),Me(Ee*u,I)])+Yi([Me(Ee*u,g)])+Xt("c",[Me(Ee*u/4,I/2),Me(Ee*u/2,I),Me(Ee*u,I)])+De("h",Ee*n)+Xt("c",[Me(Ee*u/2,0),Me(Ee*u*3/4,-(I/2)),Me(Ee*u,-I)])+Yi([Me(Ee*u,-g)])+Xt("c",[Me(Ee*u/4,-(I/2)),Me(Ee*u/2,-I),Me(Ee*u,-I)])}const t=this.NOTCH_WIDTH,o=this.NOTCH_HEIGHT,n=t/3,u=n/3,g=o/2,I=g/2,L=e(1),le=e(-1);return{type:this.SHAPES.NOTCH,width:t,height:o,pathLeft:L,pathRight:le}}makeInsideCorners(){const e=this.CORNER_RADIUS,t=vt("a","0 0,0",e,Me(-e,e)),o=vt("a","0 0,1",e,Me(-e,e)),n=vt("a","0 0,0",e,Me(e,e)),u=vt("a","0 0,1",e,Me(e,e));return{width:e,height:e,pathTop:t,pathBottom:n,rightWidth:e,rightHeight:e,pathTopRight:o,pathBottomRight:u}}generateSecondaryColour_(e){return si("#000",e,.15)||e}generateTertiaryColour_(e){return si("#000",e,.25)||e}createDom(e,t,o){super.createDom(e,t,o),e=ie(J.DEFS,{},e),t=ie(J.FILTER,{id:"blocklySelectedGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},e),ie(J.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.SELECTED_GLOW_SIZE},t),o=ie(J.FECOMPONENTTRANSFER,{result:"outBlur"},t),ie(J.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},o),ie(J.FEFLOOD,{"flood-color":this.SELECTED_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},t),ie(J.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},t),this.selectedGlowFilterId=t.id,this.selectedGlowFilter=t,e=ie(J.FILTER,{id:"blocklyReplacementGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},e),ie(J.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.REPLACEMENT_GLOW_SIZE},e),t=ie(J.FECOMPONENTTRANSFER,{result:"outBlur"},e),ie(J.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},t),ie(J.FEFLOOD,{"flood-color":this.REPLACEMENT_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},e),ie(J.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},e),ie(J.FECOMPOSITE,{in:"SourceGraphic",in2:"outGlow",operator:"over"},e),this.replacementGlowFilterId=e.id,this.replacementGlowFilter=e}getCSS_(e){return[`${e} .blocklyText,`,`${e} .blocklyFlyoutLabelText {`,`font: ${this.FIELD_TEXT_FONTWEIGHT} ${this.FIELD_TEXT_FONTSIZE}pt ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${e} .blocklyTextInputBubble textarea {`,"font-weight: normal;","}",`${e} .blocklyText {`,"fill: #fff;","}",`${e} .blocklyNonEditableText>rect:not(.blocklyDropdownRect),`,`${e} .blocklyEditableText>rect:not(.blocklyDropdownRect) {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"}",`${e} .blocklyNonEditableText>text,`,`${e} .blocklyEditableText>text,`,`${e} .blocklyNonEditableText>g>text,`,`${e} .blocklyEditableText>g>text {`,"fill: #575E75;","}",`${e} .blocklyFlyoutLabelText {`,"fill: #575E75;","}",`${e} .blocklyText.blocklyBubbleText {`,"fill: #575E75;","}",`${e} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableText:not(.editing):hover>rect,",`${e} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableText:not(.editing):hover>.blocklyPath {","stroke: #fff;","stroke-width: 2;","}",`${e} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,"color: #575E75;","}",`${e} .blocklyDropdownText {`,"fill: #fff !important;","}",`${e}.blocklyWidgetDiv .blocklyMenuItem,`,`${e}.blocklyDropDownDiv .blocklyMenuItem {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${e}.blocklyDropDownDiv .blocklyMenuItemContent {`,"color: #fff;","}",`${e} .blocklyHighlightedConnectionPath {`,`stroke: ${this.SELECTED_GLOW_COLOUR};`,"}",`${e} .blocklyDisabled > .blocklyOutlinePath {`,`fill: url(#blocklyDisabledPattern${this.randomIdentifier})`,"}",`${e} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"]}},qv=class extends Bl{constructor(e,t){super(e,t)}draw(){const e=this.block_.pathObject;e.beginDrawing(),this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights(),e.setPath(this.outlinePath_+` -`+this.inlinePath_),this.info_.RTL&&e.flipRTL(),this.recordSizeOnBlock_(),this.info_.outputConnection&&(e.outputShapeType=this.info_.outputConnection.shape.type),e.endDrawing()}drawOutline_(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape&&!this.info_.hasStatementInput&&!this.info_.bottomRow.hasNextConnection?(this.drawFlatTop_(),this.drawRightDynamicConnection_(),this.drawFlatBottom_(),this.drawLeftDynamicConnection_()):super.drawOutline_()}drawLeft_(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape?this.drawLeftDynamicConnection_():super.drawLeft_()}drawRightSideRow_(e){if(!(0>=e.height)){if(F.isSpacer(e)){const n=e.precedesStatement;var t=e.followsStatement;if(n||t){const u=this.constants_.INSIDE_CORNERS;var o=u.rightHeight;o=e.height-(n?o:0),t=t?u.pathBottomRight:"",e=0=o||0>=t)throw Error("Height and width values of an image field must be greater than 0.");this.size_=new Xe(t,o+Ci.Y_PADDING),this.imageHeight=o,typeof u=="function"&&(this.clickHandler=u),e!==lt.SKIP_SETUP&&(I?this.configure_(I):(this.flipRtl=!!g,this.altText=bt(n)||""),this.setValue(bt(e)))}configure_(e){super.configure_(e),e.flipRtl&&(this.flipRtl=e.flipRtl),e.alt&&(this.altText=bt(e.alt))}initView(){this.imageElement=ie(J.IMAGE,{height:this.imageHeight+"px",width:this.size_.width+"px",alt:this.altText},this.fieldGroup_),this.imageElement.setAttributeNS(is,"xlink:href",this.value_),this.clickHandler&&(this.imageElement.style.cursor="pointer")}updateSize_(){}doClassValidation_(e){return typeof e!="string"?null:e}doValueUpdate_(e){this.value_=e,this.imageElement&&this.imageElement.setAttributeNS(is,"xlink:href",this.value_)}getFlipRtl(){return this.flipRtl}setAlt(e){e!==this.altText&&(this.altText=e||"",this.imageElement&&this.imageElement.setAttribute("alt",this.altText))}showEditor_(){this.clickHandler&&this.clickHandler(this)}setOnClickHandler(e){this.clickHandler=e}getText_(){return this.altText}static fromJson(e){if(!e.src||!e.width||!e.height)throw Error("src, width, and height values for an image field arerequired. The width and height must be non-zero.");return new this(e.src,e.width,e.height,void 0,void 0,void 0,e)}};Ci.Y_PADDING=1,Us("field_image",Ci),Ci.prototype.DEFAULT_VALUE="";var Vl=class extends lt{constructor(e,t,o){super(lt.SKIP_SETUP),this.spellcheck_=!0,this.htmlInput_=null,this.isTextValid_=this.isBeingEdited_=!1,this.onKeyInputWrapper=this.onKeyDownWrapper=this.valueWhenEditorWasOpened_=null,this.fullBlockClickTarget_=!1,this.workspace_=null,this.SERIALIZABLE=!0,this.CURSOR="text",e!==lt.SKIP_SETUP&&(o&&this.configure_(o),this.setValue(e),t&&this.setValidator(t))}configure_(e){super.configure_(e),e.spellcheck!==void 0&&(this.spellcheck_=e.spellcheck)}initView(){if(!this.getSourceBlock())throw new _t;super.initView(),this.isFullBlockField()&&(this.clickTarget_=this.sourceBlock_.getSvgRoot())}isFullBlockField(){const e=this.getSourceBlock();if(!e)throw new _t;let t;return this.fullBlockClickTarget_=!((t=this.getConstants())==null||!t.FULL_BLOCK_FIELDS)&&e.isSimpleReporter()}doValueInvalid_(e,t=!0){this.isBeingEdited_&&(this.isDirty_=!0,this.isTextValid_=!1,e=this.value_,this.value_=this.valueWhenEditorWasOpened_,this.sourceBlock_&&C()&&this.value_!==e&&t&&z(new(ne(ee.BLOCK_CHANGE))(this.sourceBlock_,"field",this.name||null,e,this.value_)))}doValueUpdate_(e){this.isTextValid_=this.isDirty_=!0,this.value_=e}applyColour(){const e=this.getSourceBlock();if(!e)throw new _t;this.getConstants().FULL_BLOCK_FIELDS&&this.fieldGroup_&&(!this.isFullBlockField()&&this.borderRect_?(this.borderRect_.style.display="block",this.borderRect_.setAttribute("stroke",e.getColourTertiary())):(this.borderRect_.style.display="none",e.pathObject.svgPath.setAttribute("fill",this.getConstants().FIELD_BORDER_RECT_COLOUR)))}getSize(){let e;return(e=this.getConstants())!=null&&e.FULL_BLOCK_FIELDS&&(this.render_(),this.isDirty_=!1),super.getSize()}onLocationChange(){this.isBeingEdited_&&this.resizeEditor_()}render_(){if(super.render_(),this.isBeingEdited_){var e=this.htmlInput_;this.isTextValid_?(ze(e,"blocklyInvalidInput"),xt(e,Et.INVALID,!1)):(Oe(e,"blocklyInvalidInput"),xt(e,Et.INVALID,!0))}if(e=this.getSourceBlock(),!e)throw new _t;this.getConstants().FULL_BLOCK_FIELDS&&e.applyColour()}setSpellcheck(e){e!==this.spellcheck_&&(this.spellcheck_=e,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))}showEditor_(e,t=!1){this.workspace_=this.sourceBlock_.workspace,!t&&this.workspace_.options.modalInputs&&(Ab||wh||ll)?this.showPromptEditor():this.showInlineEditor(t)}showPromptEditor(){Ea(i.Msg$$module$build$src$core$msg.CHANGE_VALUE_TITLE,this.getText(),e=>{e!==null&&this.setValue(this.getValueFromEditorText_(e)),this.onFinishEditing_(this.value_)})}showInlineEditor(e){const t=this.getSourceBlock();if(!t)throw new _t;ja(this,t.RTL,this.widgetDispose_.bind(this),this.workspace_),this.htmlInput_=this.widgetCreate_(),this.isBeingEdited_=!0,this.valueWhenEditorWasOpened_=this.value_,e||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())}widgetCreate_(){var e=this.getSourceBlock();if(!e)throw new _t;i.setGroup$$module$build$src$core$events$utils(!0);const t=oi();var o=this.getClickTarget_();if(!o)throw Error("A click target has not been set.");Oe(o,"editing"),o=document.createElement("input"),o.className="blocklyHtmlInput",o.setAttribute("spellcheck",this.spellcheck_);const n=this.workspace_.getScale();var u=this.getConstants().FIELD_TEXT_FONTSIZE*n+"pt";return t.style.fontSize=u,o.style.fontSize=u,u=Vl.BORDERRADIUS*n+"px",this.isFullBlockField()&&(u=this.getScaledBBox(),u=(u.bottom-u.top)/2+"px",e=e.getParent()?e.getParent().getColourTertiary():this.sourceBlock_.getColourTertiary(),o.style.border=1*n+"px solid "+e,t.style.borderRadius=u,t.style.transition="box-shadow 0.25s ease 0s",this.getConstants().FIELD_TEXTINPUT_BOX_SHADOW&&(t.style.boxShadow="rgba(255, 255, 255, 0.3) 0 0 0 "+4*n+"px")),o.style.borderRadius=u,t.appendChild(o),o.value=o.defaultValue=this.getEditorText_(this.value_),o.setAttribute("data-untyped-default-value",String(this.value_)),this.resizeEditor_(),this.bindInputEvents_(o),o}widgetDispose_(){this.isBeingEdited_=!1,this.isTextValid_=!0,this.forceRerender(),this.onFinishEditing_(this.value_),this.sourceBlock_&&C()&&this.valueWhenEditorWasOpened_!==null&&this.valueWhenEditorWasOpened_!==this.value_&&(z(new(ne(ee.BLOCK_CHANGE))(this.sourceBlock_,"field",this.name||null,this.valueWhenEditorWasOpened_,this.value_)),this.valueWhenEditorWasOpened_=null),i.setGroup$$module$build$src$core$events$utils(!1),this.unbindInputEvents_();var e=oi().style;if(e.width="auto",e.height="auto",e.fontSize="",e.transition="",e.boxShadow="",this.htmlInput_=null,e=this.getClickTarget_(),!e)throw Error("A click target has not been set.");ze(e,"editing")}onFinishEditing_(e){}bindInputEvents_(e){this.onKeyDownWrapper=H(e,"keydown",this,this.onHtmlInputKeyDown_),this.onKeyInputWrapper=H(e,"input",this,this.onHtmlInputChange)}unbindInputEvents_(){this.onKeyDownWrapper&&(V(this.onKeyDownWrapper),this.onKeyDownWrapper=null),this.onKeyInputWrapper&&(V(this.onKeyInputWrapper),this.onKeyInputWrapper=null)}onHtmlInputKeyDown_(e){e.key==="Enter"?(ii(this),js()):e.key==="Escape"?(this.setValue(this.htmlInput_.getAttribute("data-untyped-default-value"),!1),ii(this),js()):e.key==="Tab"&&(ii(this),js(),this.sourceBlock_.tab(this,!e.shiftKey),e.preventDefault())}onHtmlInputChange(e){e=this.value_,this.setValue(this.getValueFromEditorText_(this.htmlInput_.value),!1),this.sourceBlock_&&C()&&this.value_!==e&&z(new(ne(ee.BLOCK_FIELD_INTERMEDIATE_CHANGE))(this.sourceBlock_,this.name||null,e,this.value_))}setEditorValue_(e,t=!0){this.isDirty_=!0,this.isBeingEdited_&&(this.htmlInput_.value=this.getEditorText_(e)),this.setValue(e,t)}resizeEditor_(){Ts().then(()=>{const e=this.getSourceBlock();if(!e)throw new _t;const t=oi(),o=this.getScaledBBox();t.style.width=o.right-o.left+"px",t.style.height=o.bottom-o.top+"px";const n=o.top;t.style.left=`${e.RTL?o.right-t.offsetWidth:o.left}px`,t.style.top=`${n}px`})}repositionForWindowResize(){let e;const t=(e=this.getSourceBlock())==null?void 0:e.getRootBlock();return t instanceof $s?(Ji(this.workspace_,this.workspace_.getMetricsManager().getViewMetrics(!0),t)||this.resizeEditor_(),!0):!1}isTabNavigable(){return!0}getText_(){return this.isBeingEdited_&&this.htmlInput_?this.htmlInput_.value:null}getEditorText_(e){return`${e}`}getValueFromEditorText_(e){return e}};Vl.BORDERRADIUS=4;var Kl=class extends Vl{constructor(e,t,o){super(e,t,o)}doClassValidation_(e){return e===void 0?null:`${e}`}static fromJson(e){return new this(bt(e.text),void 0,e)}};Us("field_input",Kl),Kl.prototype.DEFAULT_VALUE="";var Xv=class extends rp{constructor(e){super(e)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(e){return!!e.outputConnection}hasRightSquareCorner(e){return!!e.outputConnection&&!e.statementInputCount&&!e.nextConnection}},Yl=class extends xr{constructor(e,t){if(super(e,t),this.connectedBottomNextConnection=!1,this.connectedBlock){for(e=this.connectedBlock;t=e.getNextBlock();)e=t;e.nextConnection||(this.height=this.connectedBlockHeight,this.connectedBottomNextConnection=!0)}}},Zv=class extends Vs{constructor(e){super(e),this.width=this.height=0,this.type|=F.getType("RIGHT_CONNECTION")}},Qv=class extends dp{constructor(e){super(e)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(e){const t=(e.hat?e.hat==="cap":this.constants_.ADD_START_HATS)&&!e.outputConnection&&!e.previousConnection;return!!e.outputConnection||t}hasRightSquareCorner(e){return!!e.outputConnection&&!e.statementInputCount&&!e.nextConnection}},ey=class extends Or{constructor(e,t){super(e,t),this.isInline=!0,this.renderer_=e,this.constants_=this.renderer_.getConstants(),this.topRow=new Qv(this.constants_),this.bottomRow=new Xv(this.constants_),this.isMultiRow=!t.getInputsInline()||t.isCollapsed(),this.hasStatementInput=0=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!n.precedesStatement,F.isInputRow(g)&&g.hasStatement){g.measure();let I,L;t=g.width-((L=(I=g.getLastInput())==null?void 0:I.width)!=null?L:0)+e}else if(o&&(u===2||n)&&F.isInputRow(g)&&!g.hasStatement){n=g.xPos,o=null;for(let I=0;Io?o:this.height/2,t-o*(1-Math.sin(Math.acos((o-this.constants_.SMALL_PADDING)/o)))):0;if(F.isInlineInput(e)&&e instanceof zo){const u=e.connectedBlock;return e=u?u.pathObject.outputShapeType:e.shape.type,e==null||u&&u.outputConnection&&(u.statementInputCount||u.nextConnection)||o===n.SHAPES.HEXAGONAL&&o!==e?0:t-this.constants_.SHAPE_IN_SHAPE_PADDING[o][e]}return F.isField(e)&&e instanceof hn?o===n.SHAPES.ROUND&&e.field instanceof Kl?t-2.75*n.GRID_UNIT:t-this.constants_.SHAPE_IN_SHAPE_PADDING[o][0]:F.isIcon(e)?this.constants_.SMALL_PADDING:0}finalizeVerticalAlignment_(){if(!this.outputConnection)for(let n=2;n=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!I.precedesStatement;if(e?this.topRow.hasPreviousConnection:u.followsStatement){var o=g.elements[1];if(o=g.elements.length===3&&o instanceof hn&&(o.field instanceof _i||o.field instanceof Ci),!e&&o)u.height-=this.constants_.SMALL_PADDING,I.height-=this.constants_.SMALL_PADDING,g.height-=this.constants_.MEDIUM_PADDING;else if(!e&&!t)u.height+=this.constants_.SMALL_PADDING;else if(t){for(e=!1,t=0;t{if(!n.isDeadOrDying()){i.disable$$module$build$src$core$events$utils();try{n==null||n.positionNearConnection(u,g,I),n==null||n.getSvgRoot().setAttribute("visibility","visible")}finally{i.enable$$module$build$src$core$events$utils()}}}),u}createInsertionMarker(e){const t=os(e,{addCoordinates:!1,addInputBlocks:!1,addNextBlocks:!1,doFullSerialization:!1});if(!t)throw Error(`Failed to serialize source block. ${e.toDevString()}`);e=lo(t,this.workspace);for(const o of e.getDescendants(!1))o.setInsertionMarker(!0);return e.initSvg(),e.getSvgRoot().setAttribute("visibility","hidden"),e}getMatchingConnection(e,t,o){if(e=e.getConnections_(!0),t=t.getConnections_(!0),e.length!==t.length)return null;for(let n=0;nt instanceof Uo&&u.block===t||t instanceof ms&&u.button===t);return 0>n?null:(o=o?n+1:n-1,o===-1||o===e.length?null:e[o])}findTopASTNodeForBlock(e){const t=rr(e);return t?de.createConnectionNode(t):de.createBlockNode(e)}getOutAstNodeForBlock(e){if(!e)return null;e=e.getTopStackBlock();const t=rr(e);return t&&t.targetConnection&&t.targetConnection.getParentInput()?de.createInputNode(t.targetConnection.getParentInput()):de.createStackNode(e)}findFirstFieldOrInput(e){e=e.inputList;for(let t=0;t{Ga(o.getSourceBlock()),setTimeout(()=>{n.bringToFront()},0)})}}update(e,t){const o=this.getCandidate(e);((this.wouldDeleteBlock=this.shouldDelete(!!o,t))||this.shouldUpdatePreviews(o,e))&&(i.disable$$module$build$src$core$events$utils(),this.maybeHidePreview(o),this.maybeShowPreview(o),i.enable$$module$build$src$core$events$utils())}createMarkerBlock(e){i.disable$$module$build$src$core$events$utils();let t;try{const o=os(e,{addCoordinates:!1,addInputBlocks:!1,addNextBlocks:!1,doFullSerialization:!1});if(!o)throw Error(`Failed to serialize source block. ${e.toDevString()}`);t=lo(o,this.workspace);for(const n of t.getDescendants(!1))n.setInsertionMarker(!0);t.initSvg(),t.getSvgRoot().setAttribute("visibility","hidden")}finally{i.enable$$module$build$src$core$events$utils()}return t}initAvailableConnections(){const e=this.topBlock.getConnections_(!1),t=this.topBlock.lastConnectionInStack(!0);return t&&t!==this.topBlock.nextConnection&&(e.push(t),this.lastOnStack=t),e}shouldUpdatePreviews(e,t){if(!e)return!!this.activeCandidate;if(!this.activeCandidate)return!0;const{local:o,closest:n}=this.activeCandidate;if(n===e.closest&&o===e.local)return!1;const u=o.x+t.x-n.x;return t=o.y+t.y-n.y,e.radius{let le;(le=n)==null||le.positionNearConnection(L,g,I);let Ee;(Ee=n)==null||Ee.getSvgRoot().setAttribute("visibility","visible")}),this.markerConnection=u}hideInsertionMarker(){if(this.markerConnection){var e=this.markerConnection,t=e.getSourceBlock(),o=t.outputConnection,n;if((n=t.previousConnection)!=null&&n.targetConnection||o!=null&&o.targetConnection)t.unplug(!0);else{let u;(u=e.targetBlock())==null||u.unplug(!1)}if(e.targetConnection)throw Error("markerConnection still connected at the end of disconnectInsertionMarker");this.markerConnection=null,(e=t.getSvgRoot())&&e.setAttribute("visibility","hidden")}}showInsertionInputOutline(e){e=e.closest,this.highlightedBlock=e.getSourceBlock(),this.highlightedBlock.highlightShapeForInput(e,!0)}hideInsertionInputOutline(){if(this.highlightedBlock){if(!this.activeCandidate)throw Error("Cannot hide the insertion marker outline because there is no active candidate");this.highlightedBlock.highlightShapeForInput(this.activeCandidate.closest,!1),this.highlightedBlock=null}}showReplacementFade(e){if(this.fadedBlock=e.closest.targetBlock(),!this.fadedBlock)throw Error("Cannot show the replacement fade because the closest connection does not have a target block");this.fadedBlock.fadeForReplacement(!0)}hideReplacementFade(){this.fadedBlock&&(this.fadedBlock.fadeForReplacement(!1),this.fadedBlock=null)}getInsertionMarkers(){const e=[];return this.firstMarker&&e.push(this.firstMarker),this.lastMarker&&e.push(this.lastMarker),e}disposeInsertionMarker(e){if(e){i.disable$$module$build$src$core$events$utils();try{e.dispose()}finally{i.enable$$module$build$src$core$events$utils()}}}};(function(e){e=e.PREVIEW_TYPE||(e.PREVIEW_TYPE={}),e[e.INSERTION_MARKER=0]="INSERTION_MARKER",e[e.INPUT_OUTLINE=1]="INPUT_OUTLINE",e[e.REPLACEMENT_FADE=2]="REPLACEMENT_FADE"})(fs||(fs={})),fs.PREVIEW_TYPE;var jl=class{constructor(e){this.overrides=null,this.name=e}getClassName(){return this.name+"-renderer"}init(e,t){this.constants_=this.makeConstants_(),t&&(this.overrides=t,Object.assign(this.constants_,t)),this.constants_.setTheme(e),this.constants_.init()}createDom(e,t){this.constants_.createDom(e,this.name+"-"+t.name,"."+this.getClassName()+"."+t.getClassName())}refreshDom(e,t){const o=this.getConstants();o.dispose(),this.constants_=this.makeConstants_(),this.overrides&&Object.assign(this.constants_,this.overrides),this.constants_.randomIdentifier=o.randomIdentifier,this.constants_.setTheme(t),this.constants_.init(),this.createDom(e,t)}dispose(){this.constants_&&this.constants_.dispose()}makeConstants_(){return new Pl}makeRenderInfo_(e){return new Or(this,e)}makeDrawer_(e,t){return new Bl(e,t)}makeMarkerDrawer(e,t){return new gp(e,this.getConstants(),t)}makePathObject(e,t){return new Fl(e,t,this.constants_)}getConstants(){return this.constants_}shouldHighlightConnection(e){return!0}orphanCanConnectAtEnd(e,t,o){return!!Qe.getConnectionForOrphanedConnection(e,o===xe.OUTPUT_VALUE?t.outputConnection:t.previousConnection)}getConnectionPreviewMethod(e,t,o){return w("getConnectionPreviewMethod","v10","v12","an IConnectionPreviewer, if it fulfills your use case."),t.type===xe.OUTPUT_VALUE||t.type===xe.PREVIOUS_STATEMENT?!e.isConnected()||this.orphanCanConnectAtEnd(o,e.targetBlock(),t.type)?fs.PREVIEW_TYPE.INSERTION_MARKER:fs.PREVIEW_TYPE.REPLACEMENT_FADE:fs.PREVIEW_TYPE.INSERTION_MARKER}render(e){const t=this.makeRenderInfo_(e);t.measure(),this.makeDrawer_(e,t).draw()}},ot={};ot.BottomRow=rp,ot.Connection=ko,ot.ConstantProvider=Pl,ot.Drawer=Bl,ot.ExternalValueInput=Ll,ot.Field=hn,ot.Hat=ap,ot.Icon=Dv,ot.InRowSpacer=as,ot.InlineInput=lp,ot.InputConnection=zo,ot.InputRow=cp,ot.JaggedEdge=Av,ot.MarkerSvg=gp,ot.Measurable=Vs,ot.NextConnection=Ov,ot.OutputConnection=Rv,ot.PathObject=Fl,ot.PreviousConnection=Nv,ot.RenderInfo=Or,ot.Renderer=jl,ot.RoundCorner=Dr,ot.Row=Ir,ot.SpacerRow=up,ot.SquareCorner=Ar,ot.StatementInput=xr,ot.TopRow=dp,ot.Types=F,ot.init=Rd,ot.register=ar,ot.unregister=H$;var Lv=class{constructor(e,t){this.workspace=e,this.theme=t,this.subscribedWorkspaces=[],this.componentDB=new Map}getTheme(){return this.theme}setTheme(e){var t=this.theme;this.theme=e,(e=this.workspace.getInjectionDiv())&&(t&&(t=t.getClassName())&&ze(e,t),(t=this.theme.getClassName())&&Oe(e,t));for(let o=0,n;n=this.subscribedWorkspaces[o];o++)n.refreshTheme();for(const[o,n]of this.componentDB)for(const u of n){e=u.element,t=u.propertyName;const g=this.theme&&this.theme.getComponentStyle(o);e.style.setProperty(t,g||"")}for(const o of this.subscribedWorkspaces)o.hideChaff()}subscribeWorkspace(e){this.subscribedWorkspaces.push(e)}unsubscribeWorkspace(e){if(!Ue(this.subscribedWorkspaces,e))throw Error("Cannot unsubscribe a workspace that hasn't been subscribed.")}subscribe(e,t,o){this.componentDB.has(t)||this.componentDB.set(t,[]),this.componentDB.get(t).push({element:e,propertyName:o}),t=this.theme&&this.theme.getComponentStyle(t),e.style.setProperty(o,t||"")}unsubscribe(e){if(e)for(const[t,o]of this.componentDB){for(let n=o.length-1;0<=n;n--)o[n].element===e&&o.splice(n,1);o.length||this.componentDB.delete(t)}}dispose(){this.subscribedWorkspaces.length=0,this.componentDB.clear()}},mp="VARIABLE_DYNAMIC",wi={CATEGORY_NAME:mp};wi.flyoutCategory=Qa,wi.flyoutCategoryBlocks=Pd,wi.onCreateVariableButtonClick_Colour=Ld,wi.onCreateVariableButtonClick_Number=Md,wi.onCreateVariableButtonClick_String=Nd;var Pv=30,ki=[];ki[xe.INPUT_VALUE]=xe.OUTPUT_VALUE,ki[xe.OUTPUT_VALUE]=xe.INPUT_VALUE,ki[xe.NEXT_STATEMENT]=xe.PREVIOUS_STATEMENT,ki[xe.PREVIOUS_STATEMENT]=xe.NEXT_STATEMENT;var fp="RENAME_VARIABLE_ID",$p="DELETE_VARIABLE_ID",Bv=class{canConnect(e,t,o,n){return this.canConnectWithReason(e,t,o,n)===Qe.CAN_CONNECT}canConnectWithReason(e,t,o,n){const u=this.doSafetyChecks(e,t);return u!==Qe.CAN_CONNECT?u:this.doTypeChecks(e,t)?o&&!this.doDragChecks(e,t,n||0)?Qe.REASON_DRAG_CHECKS_FAILED:Qe.CAN_CONNECT:Qe.REASON_CHECKS_FAILED}getErrorMessage(e,t,o){switch(e){case Qe.REASON_SELF_CONNECTION:return"Attempted to connect a block to itself.";case Qe.REASON_DIFFERENT_WORKSPACES:return"Blocks not on same workspace.";case Qe.REASON_WRONG_TYPE:return"Attempt to connect incompatible types.";case Qe.REASON_TARGET_NULL:return"Target connection is null.";case Qe.REASON_CHECKS_FAILED:return"Connection checks failed. "+(t+" expected "+t.getCheck()+", found "+o.getCheck());case Qe.REASON_SHADOW_PARENT:return"Connecting non-shadow to shadow block.";case Qe.REASON_DRAG_CHECKS_FAILED:return"Drag checks failed.";case Qe.REASON_PREVIOUS_AND_OUTPUT:return"Block would have an output and a previous connection.";default:return"Unknown connection failure: this should never happen!"}}doSafetyChecks(e,t){if(!e||!t)return Qe.REASON_TARGET_NULL;let o,n,u;return e.isSuperior()?(o=e.getSourceBlock(),n=t.getSourceBlock(),u=t):(n=e.getSourceBlock(),o=t.getSourceBlock(),u=e,e=t),o===n?Qe.REASON_SELF_CONNECTION:u.type!==ki[e.type]?Qe.REASON_WRONG_TYPE:o.workspace!==n.workspace?Qe.REASON_DIFFERENT_WORKSPACES:o.isShadow()&&!n.isShadow()?Qe.REASON_SHADOW_PARENT:u.type===xe.OUTPUT_VALUE&&n.previousConnection&&n.previousConnection.isConnected()||u.type===xe.PREVIOUS_STATEMENT&&n.outputConnection&&n.outputConnection.isConnected()?Qe.REASON_PREVIOUS_AND_OUTPUT:Qe.CAN_CONNECT}doTypeChecks(e,t){if(e=e.getCheck(),t=t.getCheck(),!e||!t)return!0;for(let o=0;oo||t.getSourceBlock().isInsertionMarker())return!1;switch(t.type){case xe.PREVIOUS_STATEMENT:return this.canConnectToPrevious_(e,t);case xe.OUTPUT_VALUE:if(t.isConnected()&&!t.targetBlock().isInsertionMarker()||e.isConnected())return!1;break;case xe.INPUT_VALUE:if(t.isConnected()&&!t.targetBlock().isMovable()&&!t.targetBlock().isShadow())return!1;break;case xe.NEXT_STATEMENT:if(t.isConnected()&&!e.getSourceBlock().nextConnection&&!t.targetBlock().isShadow()&&t.targetBlock().nextConnection||t.targetBlock()&&!t.targetBlock().isMovable()&&!t.targetBlock().isShadow())return!1;break;default:return!1}return!hr.includes(t)}canConnectToPrevious_(e,t){return e.targetConnection||hr.includes(t)?!1:t.targetConnection?(e=t.targetBlock(),e.isInsertionMarker()?!e.getPreviousBlock():!1):!0}};r($e.CONNECTION_CHECKER,Ws,Bv);var bp=class extends br{constructor(e){super(e),this.type=ee.VAR_DELETE,e&&(this.varType=e.type,this.varName=e.name)}toJson(){const e=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");return e.varType=this.varType,e.varName=this.varName,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new bp),t.varType=e.varType,t.varName=e.varName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");e?t.deleteVariableById(this.varId):t.createVariable(this.varName,this.varType,this.varId)}};r($e.EVENT,ee.VAR_DELETE,bp);var vp=class extends br{constructor(e,t){super(e),this.type=ee.VAR_RENAME,e&&(this.oldName=e.name,this.newName=typeof t>"u"?"":t)}toJson(){const e=super.toJson();if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson");return e.oldName=this.oldName,e.newName=this.newName,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new vp),t.oldName=e.oldName,t.newName=e.newName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson");e?t.renameVariableById(this.varId,this.newName):t.renameVariableById(this.varId,this.oldName)}};r($e.EVENT,ee.VAR_RENAME,vp);var yp=class{constructor(e){this.workspace=e,this.variableMap=new Map}clear(){for(const e of this.variableMap.values())for(;0{u&&t&&this.deleteVariableInternal(t,n)})):this.deleteVariableInternal(t,n)}else console.warn("Can't delete non-existent variable: "+e)}deleteVariableInternal(e,t){const o=i.getGroup$$module$build$src$core$events$utils();o||i.setGroup$$module$build$src$core$events$utils(!0);try{for(let n=0;ne.name)}getVariableUsesById(e){const t=[],o=this.workspace.getAllBlocks(!1);for(let n=0;n!o.isInsertionMarker())):[]}addTopComment(e){this.topComments.push(e),this.commentDB.has(e.id)&&console.warn('Overriding an existing comment on this workspace, with id "'+e.id+'"'),this.commentDB.set(e.id,e)}removeTopComment(e){if(!Ue(this.topComments,e))throw Error("Comment not present in workspace's list of top-most comments.");this.commentDB.delete(e.id)}getTopComments(e=!1){const t=[].concat(this.topComments);return e&&1!o.isInsertionMarker())}clear(){this.isClearing=!0;try{const e=i.getGroup$$module$build$src$core$events$utils();for(e||i.setGroup$$module$build$src$core$events$utils(!0);this.topBlocks.length;)this.topBlocks[0].dispose(!1);for(;this.topComments.length;)this.topComments[this.topComments.length-1].dispose();i.setGroup$$module$build$src$core$events$utils(e),this.variableMap.clear(),this.potentialVariableMap&&this.potentialVariableMap.clear()}finally{this.isClearing=!1}}renameVariableById(e,t){this.variableMap.renameVariableById(e,t)}createVariable(e,t,o){return this.variableMap.createVariable(e,t,o)}getVariableUsesById(e){return this.variableMap.getVariableUsesById(e)}deleteVariableById(e){this.variableMap.deleteVariableById(e)}getVariable(e,t){return this.variableMap.getVariable(e,t)}getVariableById(e){return this.variableMap.getVariableById(e)}getVariablesOfType(e){return this.variableMap.getVariablesOfType(e)}getVariableTypes(){return this.variableMap.getVariableTypes(this)}getAllVariables(){return this.variableMap.getAllVariables()}getAllVariableNames(){return this.variableMap.getAllVariableNames()}getWidth(){return 0}newBlock(e,t){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts")}newComment(e){throw Error("The implementation of newComment should be monkey-patched in by blockly.ts")}remainingCapacity(){return isNaN(this.options.maxBlocks)?1/0:this.options.maxBlocks-this.getAllBlocks(!1).length}remainingCapacityOfType(e){return this.options.maxInstances?(this.options.maxInstances[e]!==void 0?this.options.maxInstances[e]:1/0)-this.getBlocksByType(e,!1).length:1/0}isCapacityAvailable(e){if(!this.hasBlockLimits())return!0;let t=0;for(const o in e){if(e[o]>this.remainingCapacityOfType(o))return!1;t+=e[o]}return!(t>this.remainingCapacity())}hasBlockLimits(){return this.options.maxBlocks!==1/0||!!this.options.maxInstances}getUndoStack(){return this.undoStack_}getRedoStack(){return this.redoStack_}undo(e){var t=e?this.redoStack_:this.undoStack_,o=e?this.undoStack_:this.redoStack_;const n=t.pop();if(n){for(var u=[n];t.length&&n.group&&n.group===t[t.length-1].group;){const g=t.pop();g&&u.push(g)}for(t=0;tthis.MAX_UNDO&&0<=this.MAX_UNDO;)this.undoStack_.shift();for(let t=0;t!!t.getStyleName())),this.refreshToolboxSelection(),this.toolbox&&this.toolbox.refreshTheme(),this.isVisible()&&this.setVisible(!0);const e=new(ne(ee.THEME_CHANGE))(this.getTheme().name,this.id);z(e)}updateBlockStyles(e){for(let t=0,o;o=e[t];t++){const n=o.getStyleName();n&&o.setStyle(n)}}getInverseScreenCTM(){if(this.inverseScreenCTMDirty){const e=this.getParentSvg().getScreenCTM();e&&(this.inverseScreenCTM=e.inverse(),this.inverseScreenCTMDirty=!1)}return this.inverseScreenCTM}updateInverseScreenCTM(){this.inverseScreenCTMDirty=!0}isVisible(){return this.visible}getSvgXY(e){let t=0,o=0,n=1;(this.getCanvas().contains(e)||this.getBubbleCanvas().contains(e))&&(n=this.scale);do{const u=Wn(e);(e===this.getCanvas()||e===this.getBubbleCanvas())&&(n=1),t+=u.x*n,o+=u.y*n,e=e.parentNode}while(e&&e!==this.getParentSvg()&&e!==this.getInjectionDiv());return new ye(t,o)}getCachedParentSvgSize(){const e=this.cachedParentSvgSize;return new Xe(e.width,e.height)}getOriginOffsetInPixels(){return fa(this.getCanvas())}getInjectionDiv(){if(!this.injectionDiv){let e=this.svgGroup_;for(;e;){if((" "+(e.getAttribute("class")||"")+" ").includes(" injectionDiv ")){this.injectionDiv=e;break}e=e.parentNode}}return this.injectionDiv}getSvgGroup(){return this.svgGroup_}getBlockCanvas(){return this.getCanvas()}setResizeHandlerWrapper(e){this.resizeHandlerWrapper=e}createDom(e,t){return this.injectionDiv||(this.injectionDiv=t??null),this.svgGroup_=ie(J.G,{class:"blocklyWorkspace"}),e&&(this.svgBackground_=ie(J.RECT,{height:"100%",width:"100%",class:e},this.svgGroup_),e==="blocklyMainBackground"&&this.grid?this.svgBackground_.style.fill="url(#"+this.grid.getPatternId()+")":this.themeManager_.subscribe(this.svgBackground_,"workspaceBackgroundColour","fill")),this.layerManager=new qC(this),this.svgBlockCanvas_=this.layerManager.getBlockLayer(),this.svgBubbleCanvas_=this.layerManager.getBubbleLayer(),this.isFlyout||(H(this.svgGroup_,"pointerdown",this,this.onMouseDown,!1),this.dummyWheelListener=()=>{},document.body.addEventListener("wheel",this.dummyWheelListener),H(this.svgGroup_,"wheel",this,this.onMouseWheel)),this.options.hasCategories&&(this.toolbox=new(y($e.TOOLBOX,this.options,!0))(this)),this.grid&&this.grid.update(this.scale),this.recordDragTargets(),(e=y($e.CURSOR,this.options))&&this.markerManager.setCursor(new e),this.renderer.createDom(this.svgGroup_,this.getTheme()),this.svgGroup_}dispose(){if(this.rendered=!1,this.currentGesture_&&this.currentGesture_.cancel(),this.svgGroup_&&Ze(this.svgGroup_),this.toolbox&&(this.toolbox.dispose(),this.toolbox=null),this.flyout&&(this.flyout.dispose(),this.flyout=null),this.trashcan&&(this.trashcan.dispose(),this.trashcan=null),this.scrollbar&&(this.scrollbar.dispose(),this.scrollbar=null),this.zoomControls_&&this.zoomControls_.dispose(),this.audioManager&&this.audioManager.dispose(),this.grid&&(this.grid=null),this.renderer.dispose(),this.markerManager&&this.markerManager.dispose(),super.dispose(),this.themeManager_&&(this.themeManager_.unsubscribeWorkspace(this),this.themeManager_.unsubscribe(this.svgBackground_),this.options.parentWorkspace||this.themeManager_.dispose()),this.connectionDBList.length=0,this.toolboxCategoryCallbacks.clear(),this.flyoutButtonCallbacks.clear(),!this.options.parentWorkspace){const e=this.getParentSvg();e&&e.parentNode&&Ze(e.parentNode)}this.resizeHandlerWrapper&&(V(this.resizeHandlerWrapper),this.resizeHandlerWrapper=null),this.dummyWheelListener&&(document.body.removeEventListener("wheel",this.dummyWheelListener),this.dummyWheelListener=null)}addTrashcan(){this.trashcan=cs.newTrashcan(this);const e=this.trashcan.createDom();this.svgGroup_.insertBefore(e,this.getCanvas())}static newTrashcan(e){throw Error("The implementation of newTrashcan should be monkey-patched in by blockly.ts")}addZoomControls(){this.zoomControls_=new Hb(this);const e=this.zoomControls_.createDom();this.svgGroup_.appendChild(e)}addFlyout(e){const t=new gs({parentWorkspace:this,rtl:this.RTL,oneBasedIndex:this.options.oneBasedIndex,horizontalLayout:this.horizontalLayout,renderer:this.options.renderer,rendererOverrides:this.options.rendererOverrides,move:{scrollbars:!0}});return t.toolboxPosition=this.options.toolboxPosition,this.flyout=this.horizontalLayout?new(y($e.FLYOUTS_HORIZONTAL_TOOLBOX,this.options,!0))(t):new(y($e.FLYOUTS_VERTICAL_TOOLBOX,this.options,!0))(t),this.flyout.autoClose=!1,this.flyout.getWorkspace().setVisible(!0),this.flyout.createDom(e)}getFlyout(e){return this.flyout||e?this.flyout:this.toolbox?this.toolbox.getFlyout():null}getToolbox(){return this.toolbox}updateScreenCalculations(){this.updateInverseScreenCTM(),this.recordDragTargets()}resizeContents(){this.resizesEnabled&&this.rendered&&(this.scrollbar&&this.scrollbar.resize(),this.updateInverseScreenCTM())}resize(){this.toolbox&&this.toolbox.position(),this.flyout&&this.flyout.position();const e=this.componentManager.getComponents(gt.Capability.POSITIONABLE,!0),t=this.getMetricsManager().getUiMetrics(),o=[];for(let n=0,u;u=e[n];n++){u.position(t,o);const g=u.getBoundingRectangle();g&&o.push(g)}this.scrollbar&&this.scrollbar.resize(),this.updateScreenCalculations()}updateScreenCalculationsIfScrolled(){const e=bu();ye.equals(this.lastRecordedPageScroll,e)||(this.lastRecordedPageScroll=e,this.updateScreenCalculations())}getLayerManager(){return this.layerManager}getCanvas(){return this.layerManager.getBlockLayer()}setCachedParentSvgSize(e,t){const o=this.getParentSvg();e!=null&&(this.cachedParentSvgSize.width=e,o.setAttribute("data-cached-width",`${e}`)),t!=null&&(this.cachedParentSvgSize.height=t,o.setAttribute("data-cached-height",`${t}`))}getBubbleCanvas(){return this.layerManager.getBubbleLayer()}getParentSvg(){if(!this.cachedParentSvg){let e=this.svgGroup_;for(;e;){if(e.tagName==="svg"){this.cachedParentSvg=e;break}e=e.parentNode}}return this.cachedParentSvg}maybeFireViewportChangeEvent(){if(C()){var e=this.scale,t=-this.scrollY,o=-this.scrollX;if(!(e===this.oldScale&&1>Math.abs(t-this.oldTop)&&1>Math.abs(o-this.oldLeft))){var n=new(ne(ee.VIEWPORT_CHANGE))(t,o,e,this.id,this.oldScale);this.oldScale=e,this.oldTop=t,this.oldLeft=o,z(n)}}}translate(e,t){let o;(o=this.layerManager)==null||o.translateLayers(new ye(e,t),this.scale);let n;(n=this.grid)==null||n.moveTo(e,t),this.maybeFireViewportChangeEvent()}getWidth(){const e=this.getMetrics();return e?e.viewWidth/this.scale:0}setVisible(e){this.visible=e,this.svgGroup_&&(this.scrollbar&&this.scrollbar.setContainerVisible(e),this.getFlyout()&&this.getFlyout().setContainerVisible(e),this.getParentSvg().style.display=e?"block":"none",this.toolbox&&this.toolbox.setVisible(e),e||this.hideChaff(!0))}render(){const e=this.getAllBlocks(!1);for(let t=e.length-1;0<=t;t--)e[t].queueRender();this.getTopBlocks().flatMap(t=>t.getDescendants(!1)).filter(t=>t.isInsertionMarker()).forEach(t=>t.queueRender()),Ts().then(()=>{this.markerManager.updateMarkers()})}highlightBlock(e,t){if(t===void 0){for(let o=0,n;n=this.highlightedBlocks[o];o++)n.setHighlighted(!1);this.highlightedBlocks.length=0}(e=e?this.getBlockById(e):null)&&((t=t===void 0||t)?this.highlightedBlocks.includes(e)||this.highlightedBlocks.push(e):Ue(this.highlightedBlocks,e),e.setHighlighted(t))}refreshToolboxSelection(){const e=this.isFlyout?this.targetWorkspace:this;e&&!e.currentGesture_&&e.toolbox&&e.toolbox.getFlyout()&&e.toolbox.refreshSelection()}renameVariableById(e,t){super.renameVariableById(e,t),this.refreshToolboxSelection()}deleteVariableById(e){super.deleteVariableById(e),this.refreshToolboxSelection()}createVariable(e,t,o){return e=super.createVariable(e,t,o),this.refreshToolboxSelection(),e}recordDragTargets(){const e=this.componentManager.getComponents(gt.Capability.DRAG_TARGET,!0);this.dragTargetAreas=[];for(let t=0,o;o=e[t];t++){const n=o.getClientRect();n&&this.dragTargetAreas.push({component:o,clientRect:n})}}newBlock(e,t){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts")}newComment(e){throw Error("The implementation of newComment should be monkey-patched in by blockly.ts")}getDragTarget(e){for(let t=0,o;o=this.dragTargetAreas[t];t++)if(o.clientRect.contains(e.clientX,e.clientY))return o.component;return null}onMouseDown(e){const t=this.getGesture(e);t&&t.handleWsStart(e,this)}startDrag(e,t){za(this,e,t)}moveDrag(e){return Ua(this,e)}isDragging(){return this.currentGesture_!==null&&this.currentGesture_.isDragging()}isDraggable(){return this.options.moveOptions&&this.options.moveOptions.drag}isMovable(){return this.options.moveOptions&&!!this.options.moveOptions.scrollbars||this.options.moveOptions&&this.options.moveOptions.wheel||this.options.moveOptions&&this.options.moveOptions.drag||this.options.zoomOptions&&this.options.zoomOptions.wheel||this.options.zoomOptions&&this.options.zoomOptions.pinch}isMovableHorizontally(){const e=!!this.scrollbar;return this.isMovable()&&(!e||e&&this.scrollbar.canScrollHorizontally())}isMovableVertically(){const e=!!this.scrollbar;return this.isMovable()&&(!e||e&&this.scrollbar.canScrollVertically())}onMouseWheel(e){if(bo.inProgress())e.preventDefault(),e.stopPropagation();else{var t=this.options.zoomOptions&&this.options.zoomOptions.wheel,o=this.options.moveOptions&&this.options.moveOptions.wheel;if(t||o){var n=Le(e);if(kh)var u=e.metaKey;t&&(e.ctrlKey||u||!o)?(n=-n.y/50,t=fe(e,this.getParentSvg(),this.getInverseScreenCTM()),this.zoom(t.x,t.y,n)):(t=this.scrollX-n.x,o=this.scrollY-n.y,e.shiftKey&&!n.x&&(t=this.scrollX-n.y,o=this.scrollY),this.scroll(t,o)),e.preventDefault()}}}getBlocksBoundingBox(){const e=this.getTopBoundedElements();if(!e.length)return new rt(0,0,0,0);const t=e[0].getBoundingRectangle();for(let n=1;nt.bottom&&(t.bottom=o.bottom),o.leftt.right&&(t.right=o.right))}return t}cleanUp(){this.setResizesEnabled(!1),i.setGroup$$module$build$src$core$events$utils(!0);var e=this.getTopBlocks(!0),t=e.filter(g=>g.isMovable());const o=e.filter(g=>!g.isMovable()).map(g=>g.getBoundingRectangle());e=function(g){for(const I of o)if(g.intersects(I))return I;return null};var n=0;const u=this.renderer.getConstants().MIN_BLOCK_HEIGHT;for(const g of t){for(t=g.getBoundingRectangle(),g.moveBy(-t.left,n-t.top,["cleanup"]),g.snapToGrid(),t=g.getBoundingRectangle(),n=e(t);n!=null;)n=n.top+n.getHeight()+u,g.moveBy(0,n-t.top,["cleanup"]),g.snapToGrid(),t=g.getBoundingRectangle(),n=e(t);n=g.getRelativeToSurfaceXY().y+g.getHeightWidth().height+u}i.setGroup$$module$build$src$core$events$utils(!1),this.setResizesEnabled(!0)}showContextMenu(e){if(!this.options.readOnly&&!this.isFlyout){var t=Ke.registry.getContextMenuOptions(Ke.ScopeType.WORKSPACE,{workspace:this});this.configureContextMenu&&this.configureContextMenu(t,e),sr(e,t,this.RTL,this)}}updateToolbox(e){if(e=$a(e)){if(!this.options.languageTree)throw Error("Existing toolbox is null. Can't create new toolbox.");if(ba(e)){if(!this.toolbox)throw Error("Existing toolbox has no categories. Can't change mode.");this.options.languageTree=e,this.toolbox.render(e)}else{if(!this.flyout)throw Error("Existing toolbox has categories. Can't change mode.");this.options.languageTree=e,this.flyout.show(e)}}else if(this.options.languageTree)throw Error("Can't nullify an existing toolbox.")}markFocused(){this.options.parentWorkspace?this.options.parentWorkspace.markFocused():(se(this),this.getParentSvg().focus({preventScroll:!0}))}zoom(e,t,o){o=Math.pow(this.options.zoomOptions.scaleSpeed,o);const n=this.scale*o;if(this.scale!==n){n>this.options.zoomOptions.maxScale?o=this.options.zoomOptions.maxScale/this.scale:nthis.options.zoomOptions.maxScale?e=this.options.zoomOptions.maxScale:this.options.zoomOptions.minScale&&et.autoHide(e))}static setTopLevelWorkspaceMetrics(e){const t=this.getMetrics();typeof e.x=="number"&&(this.scrollX=-(t.scrollLeft+(t.scrollWidth-t.viewWidth)*e.x)),typeof e.y=="number"&&(this.scrollY=-(t.scrollTop+(t.scrollHeight-t.viewHeight)*e.y)),this.translate(this.scrollX+t.absoluteLeft,this.scrollY+t.absoluteTop)}},_p=class extends Ss{constructor(e,t,o){super(o),this.type=ee.SELECTED,this.oldElementId=e??void 0,this.newElementId=t??void 0}toJson(){const e=super.toJson();return e.oldElementId=this.oldElementId,e.newElementId=this.newElementId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new _p),t.oldElementId=e.oldElementId,t.newElementId=e.newElementId,t}};r($e.EVENT,ee.SELECTED,_p);var Rr=class{paste(e,t,o){if(!t.isCapacityAvailable(e.typeCounts))return null;o&&(e.blockState.x=o.x,e.blockState.y=o.y),o=o||new ye(e.blockState.x||0,e.blockState.y||0),i.disable$$module$build$src$core$events$utils();let n;try{n=lo(e.blockState,t),W$(n,o)}finally{i.enable$$module$build$src$core$events$utils()}return n&&(C()&&!n.isShadow()&&z(new(ne(ee.BLOCK_CREATE))(n)),i.setSelected$$module$build$src$core$common(n),n)}};Rr.TYPE="block",Ca(Rr.TYPE,new Rr);var zl={};zl.bumpIntoBounds=Ji,zl.bumpIntoBoundsHandler=Bd,zl.bumpTopObjectsIntoBounds=el;var jv=class{constructor(e){this.block=e,this.connectionPreviewer=this.connectionCandidate=this.startLoc=this.startChildConn=this.startParentConn=null,this.dragging=!1,this.dragOffset=new ye(0,0),this.inGroup=!1,this.workspace=e.workspace}isMovable(){if(this.block.isShadow()){let e,t;return(t=(e=this.block.getParent())==null?void 0:e.isMovable())!=null?t:!1}return this.block.isOwnMovable()&&!this.block.isDeadOrDying()&&!this.workspace.options.readOnly&&!this.block.isInFlyout}startDrag(e){if(this.block.isShadow())this.startDraggingShadow(e);else{this.dragging=!0,(this.inGroup=!!i.getGroup$$module$build$src$core$events$utils())||i.setGroup$$module$build$src$core$events$utils(!0),this.fireDragStartEvent(),this.startLoc=this.block.getRelativeToSurfaceXY(),this.connectionCandidate=null,this.connectionPreviewer=new(y($e.CONNECTION_PREVIEWER,this.workspace.options))(this.block),io(),this.workspace.setResizesEnabled(!1),Ki(),e=!!e&&(e.altKey||e.ctrlKey||e.metaKey),this.shouldDisconnect(e)&&this.disconnectBlock(e),this.block.setDragging(!0);var t;(t=this.workspace.getLayerManager())==null||t.moveToDragLayer(this.block)}}startDraggingShadow(e){const t=this.block.getParent();if(!t)throw Error("Tried to drag a shadow block with no parent. Shadow blocks should always have parents.");this.dragOffset=ye.difference(t.getRelativeToSurfaceXY(),this.block.getRelativeToSurfaceXY()),t.startDrag(e)}shouldDisconnect(e){return!!(this.block.getParent()||e&&this.block.nextConnection&&this.block.nextConnection.targetBlock())}disconnectBlock(e){let t,o,n;if(this.startParentConn=(n=(t=this.block.outputConnection)==null?void 0:t.targetConnection)!=null?n:(o=this.block.previousConnection)==null?void 0:o.targetConnection,e){let u;this.startChildConn=(u=this.block.nextConnection)==null?void 0:u.targetConnection}this.block.unplug(e),_d(this.block)}fireDragStartEvent(){const e=new(ne(ee.BLOCK_DRAG))(this.block,!0,this.block.getDescendants(!1));z(e)}fireDragEndEvent(){const e=new(ne(ee.BLOCK_DRAG))(this.block,!1,this.block.getDescendants(!1));z(e)}fireMoveEvent(){if(!this.block.isDeadOrDying()){var e=new(ne(ee.BLOCK_MOVE))(this.block);e.setReason(["drag"]),e.oldCoordinate=this.startLoc,e.recordNew(),z(e)}}drag(e){if(this.block.isShadow()){let t;(t=this.block.getParent())==null||t.drag(ye.sum(e,this.dragOffset))}else this.block.moveDuringDrag(e),this.updateConnectionPreview(this.block,ye.difference(e,this.startLoc))}updateConnectionPreview(e,t){var o=this.connectionCandidate;const n=this.getConnectionCandidate(e,t);if(n){this.connectionCandidate=t=o&&this.currCandidateIsBetter(o,t,n)?o:n;var{local:u,neighbour:g}=t;t=u.type===xe.OUTPUT_VALUE||u.type===xe.PREVIOUS_STATEMENT,o=g.isConnected()&&!g.targetBlock().isInsertionMarker(),t&&o&&!this.orphanCanConnectAtEnd(e,g.targetBlock(),u.type)?this.connectionPreviewer.previewReplacement(u,g,g.targetBlock()):this.connectionPreviewer.previewConnection(u,g)}else this.connectionPreviewer.hidePreview(),this.connectionCandidate=null}orphanCanConnectAtEnd(e,t,o){return!!Qe.getConnectionForOrphanedConnection(e,o===xe.OUTPUT_VALUE?t.outputConnection:t.previousConnection)}currCandidateIsBetter(e,t,o){const{local:n,neighbour:u}=e;e=new ye(n.x,n.y);const g=new ye(u.x,u.y);return t=ye.distance(ye.sum(e,t),g),o.distance>t-i.config$$module$build$src$core$config.currentConnectionPreference}getConnectionCandidate(e,t){e=this.getLocalConnections(e);let o=this.connectionCandidate?i.config$$module$build$src$core$config.connectingSnapRadius:i.config$$module$build$src$core$config.snapRadius,n=null;for(const u of e){const{connection:g,radius:I}=u.closest(o,t);g&&(n={local:u,neighbour:g,distance:I},o=I)}return n}getLocalConnections(e){const t=e.getConnections_(!1),o=e.lastConnectionInStack(!0);return o&&o!==e.nextConnection&&t.push(o),t}endDrag(e){if(this.block.isShadow()){let t;(t=this.block.getParent())==null||t.endDrag(e)}else{if(this.fireDragEndEvent(),this.fireMoveEvent(),no(),Ki(),this.connectionPreviewer.hidePreview(),!this.block.isDeadOrDying()&&this.dragging){let t;(t=this.workspace.getLayerManager())==null||t.moveOffDragLayer(this.block,Fo),this.block.setDragging(!1)}this.connectionCandidate?(this.applyConnections(this.connectionCandidate),this.disposeStep()):this.block.queueRender().then(()=>this.disposeStep()),this.inGroup||i.setGroup$$module$build$src$core$events$utils(!1)}}disposeStep(){this.block.snapToGrid(),this.connectionPreviewer.dispose(),this.workspace.setResizesEnabled(!0)}applyConnections(e){const{local:t,neighbour:o}=e;t.connect(o);const n=t.isSuperior()?o:t,u=this.block.getRootBlock();Ts().then(()=>{Ga(n.getSourceBlock()),setTimeout(()=>{u.bringToFront()},0)})}revertDrag(){if(this.block.isShadow()){let t;(t=this.block.getParent())==null||t.revertDrag()}else{var e;if((e=this.startChildConn)==null||e.connect(this.block.nextConnection),this.startParentConn)switch(this.startParentConn.type){case xe.INPUT_VALUE:this.startParentConn.connect(this.block.outputConnection);break;case xe.NEXT_STATEMENT:this.startParentConn.connect(this.block.previousConnection)}else{this.block.moveTo(this.startLoc,["drag"]);let t;(t=this.workspace.getLayerManager())==null||t.moveOffDragLayer(this.block,Fo),Ji(this.workspace,this.workspace.getMetricsManager().getScrollMetrics(!0),this.block)}this.startParentConn=this.startChildConn=null,this.connectionPreviewer.hidePreview(),this.connectionCandidate=null,this.block.setDragging(!1),this.dragging=!1}}},zv=class{constructor(){this.drawer=this.curNode=this.colour=null,this.type="marker"}setDrawer(e){this.drawer=e}getDrawer(){return this.drawer}getCurNode(){return this.curNode}setCurNode(e){const t=this.curNode;this.curNode=e,this.drawer&&this.drawer.draw(t,this.curNode)}draw(){this.drawer&&this.drawer.draw(this.curNode,this.curNode)}hide(){this.drawer&&this.drawer.hide()}dispose(){this.getDrawer()&&this.getDrawer().dispose()}},wp=class extends zv{constructor(){super(),this.type="cursor"}next(){var e=this.getCurNode();if(!e)return null;for(e=e.next();e&&e.next()&&(e.getType()===de.types.NEXT||e.getType()===de.types.BLOCK);)e=e.next();return e&&this.setCurNode(e),e}in(){var e=this.getCurNode();if(!e)return null;(e.getType()===de.types.PREVIOUS||e.getType()===de.types.OUTPUT)&&(e=e.next());let t,o;return(e=(o=(t=e)==null?void 0:t.in())!=null?o:null)&&this.setCurNode(e),e}prev(){var e=this.getCurNode();if(!e)return null;for(e=e.prev();e&&e.prev()&&(e.getType()===de.types.NEXT||e.getType()===de.types.BLOCK);)e=e.prev();return e&&this.setCurNode(e),e}out(){var e=this.getCurNode();return e?((e=e.out())&&e.getType()===de.types.BLOCK&&(e=e.prev()||e),e&&this.setCurNode(e),e):null}};r($e.CURSOR,Ws,wp);var Nr=class extends wp{constructor(){super()}next(){var e=this.getCurNode();return e?((e=this.getNextNode_(e,this.validNode_))&&this.setCurNode(e),e):null}in(){return this.next()}prev(){var e=this.getCurNode();return e?((e=this.getPreviousNode_(e,this.validNode_))&&this.setCurNode(e),e):null}out(){return this.prev()}getNextNode_(e,t){if(!e)return null;const o=e.in()||e.next();return t(o)?o:o?this.getNextNode_(o,t):(e=this.findSiblingOrParent(e.out()),t(e)?e:e?this.getNextNode_(e,t):null)}getPreviousNode_(e,t){if(!e)return null;let o=e.prev();return o=o?this.getRightMostChild(o):e.out(),t(o)?o:o?this.getPreviousNode_(o,t):null}validNode_(e){let t=!1;return e=e&&e.getType(),(e===de.types.OUTPUT||e===de.types.INPUT||e===de.types.FIELD||e===de.types.NEXT||e===de.types.PREVIOUS||e===de.types.WORKSPACE)&&(t=!0),t}findSiblingOrParent(e){if(!e)return null;const t=e.next();return t||this.findSiblingOrParent(e.out())}getRightMostChild(e){if(!e.in())return e;for(e=e.in();e&&e.next();)e=e.next();return this.getRightMostChild(e)}};Nr.registrationName="basicCursor",r($e.CURSOR,Nr.registrationName,Nr);var Uv=class extends Nr{validNode_(e){let t=!1;const o=e&&e.getType();return e&&(e=e.getLocation(),o===de.types.FIELD&&e&&e.isTabNavigable()&&e.isClickable()&&(t=!0)),t}},Hv=10,Kt=class extends Qe{constructor(e,t){super(e,t),this.highlighted=!1,this.targetConnection=null,this.db=e.workspace.connectionDBList[t],this.dbOpposite=e.workspace.connectionDBList[ki[t]],this.offsetInBlock=new ye(0,0),this.trackedState=Kt.TrackedState.WILL_TRACK}dispose(){super.dispose(),this.trackedState===Kt.TrackedState.TRACKED&&this.db.removeConnection(this,this.y);let e,t;(t=(e=this.sourceBlock_.pathObject).removeConnectionHighlight)==null||t.call(e,this)}getSourceBlock(){return super.getSourceBlock()}targetBlock(){return super.targetBlock()}distanceFrom(e){const t=this.x-e.x;return e=this.y-e.y,Math.sqrt(t*t+e*e)}bumpAwayFrom(e,t=!1){if(!this.sourceBlock_.workspace.isDragging()){var o=i.config$$module$build$src$core$config.snapRadius+Math.floor(Math.random()*Hv),n=i.config$$module$build$src$core$config.snapRadius+Math.floor(Math.random()*Hv),u=e.sourceBlock_.getRootBlock(),g=this.sourceBlock_.getRootBlock();if(!u.isInFlyout&&!g.isInFlyout){var I=!0;if(g.isMovable())u.isMovable()&&t&&(n=-n);else if(u.isMovable())I=!1,o=-o,n=-n;else return;t=I?e:this,e=I?this:e,u=I?g:u,(g=j()===u)||u.addSelect(),u.RTL&&(o=-o),u.moveBy(t.x+o-e.x,t.y+n-e.y,["bump"]),g||u.removeSelect()}}}moveTo(e,t){let o=!1;return this.trackedState===Kt.TrackedState.WILL_TRACK?(this.db.addConnection(this,t),this.trackedState=Kt.TrackedState.TRACKED,o=!0):this.trackedState===Kt.TrackedState.TRACKED&&(this.db.removeConnection(this,this.y),this.db.addConnection(this,t),o=!0),this.x=e,this.y=t,o}moveBy(e,t){return this.moveTo(this.x+e,this.y+t)}moveToOffset(e){return this.moveTo(e.x+this.offsetInBlock.x,e.y+this.offsetInBlock.y)}setOffsetInBlock(e,t){this.offsetInBlock.x=e,this.offsetInBlock.y=t}getOffsetInBlock(){return this.offsetInBlock}tightenEfficiently(){var e=this.targetConnection;const t=this.targetBlock();e&&t&&(e=ye.difference(this.offsetInBlock,e.offsetInBlock),t.translate(e.x,e.y))}closest(e,t){return this.dbOpposite.searchForClosest(this,e,t)}highlight(){this.highlighted=!0,this.getSourceBlock().queueRender()}unhighlight(){this.highlighted=!1,this.getSourceBlock().queueRender()}isHighlighted(){return this.highlighted}setTracking(e){e&&this.trackedState===Kt.TrackedState.TRACKED||!e&&this.trackedState===Kt.TrackedState.UNTRACKED||this.sourceBlock_.isInFlyout||(e?(this.db.addConnection(this,this.y),this.trackedState=Kt.TrackedState.TRACKED):(this.trackedState===Kt.TrackedState.TRACKED&&this.db.removeConnection(this,this.y),this.trackedState=Kt.TrackedState.UNTRACKED))}stopTrackingAll(){if(this.setTracking(!1),this.targetConnection){const e=this.targetBlock().getDescendants(!1);for(let t=0;tclearTimeout(e)),this.warningTextDb.clear(),this.getIcons().forEach(e=>e.dispose())}checkAndDelete(){this.workspace.isFlyout||(i.setGroup$$module$build$src$core$events$utils(!0),this.workspace.hideChaff(),this.outputConnection?this.dispose(!1,!0):this.dispose(!0,!0),i.setGroup$$module$build$src$core$events$utils(!1))}toCopyData(){return this.isInsertionMarker_?null:{paster:Rr.TYPE,blockState:os(this,{addCoordinates:!0,addNextBlocks:!1}),typeCounts:Ie(this,!0)}}applyColour(){this.pathObject.applyColour(this);const e=this.getIcons();for(let t=0;t{this.isDeadOrDying()||(this.warningTextDb.delete(t),this.setWarningText(e,t))},100));else if(this.isInFlyout&&(e=null),o=this.getIcon(wo.TYPE),e){let n=this.getSurroundParent(),u=null;for(;n;)n.isCollapsed()&&(u=n),n=n.getSurroundParent();u&&u.setWarningText(i.Msg$$module$build$src$core$msg.COLLAPSED_WARNINGS_WARNING,$s.COLLAPSED_WARNING_ID),o?o.addMessage(e,t):this.addIcon(new wo(this).addMessage(e,t))}else o&&(t?(o.addMessage("",t),o.getText()||this.removeIcon(wo.TYPE)):this.removeIcon(wo.TYPE))}setMutator(e){this.removeIcon(i.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE),e&&this.addIcon(e)}addIcon(e){return super.addIcon(e),e instanceof i.MutatorIcon$$module$build$src$core$icons$mutator_icon&&(this.mutator=e),e.initView(this.createIconPointerDownListener(e)),e.applyColour(),e.updateEditable(),this.queueRender(),e}createIconPointerDownListener(e){return t=>{this.isDeadOrDying()||(t=this.workspace.getGesture(t))&&t.setStartIcon(e)}}removeIcon(e){const t=super.removeIcon(e);return e.equals(i.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE)&&(this.mutator=null),this.queueRender(),t}setEnabled(e){w("setEnabled","v11","v12","the setDisabledReason method of BlockSvg");const t=this.isEnabled();super.setEnabled(e),this.isEnabled()===t||this.getInheritedDisabled()||this.updateDisabled()}setDisabledReason(e,t){const o=this.isEnabled();super.setDisabledReason(e,t),this.isEnabled()===o||this.getInheritedDisabled()||this.updateDisabled()}setHighlighted(e){this.pathObject.updateHighlighted(e)}addSelect(){this.pathObject.updateSelected(!0)}removeSelect(){this.pathObject.updateSelected(!1)}setDeleteStyle(e){this.pathObject.updateDraggingDelete(e)}getColour(){return this.style.colourPrimary}setColour(e){super.setColour(e),e=this.workspace.getRenderer().getConstants().getBlockStyleForColour(this.colour_),this.pathObject.setStyle(e.style),this.style=e.style,this.styleName_=e.name,this.applyColour()}setStyle(e){const t=this.workspace.getRenderer().getConstants().getBlockStyle(e);if(this.styleName_=e,t)this.hat=t.hat,this.pathObject.setStyle(t),this.colour_=t.colourPrimary,this.style=t,this.applyColour();else throw Error("Invalid style name: "+e)}getStyle(){return this.style}bringToFront(e=!1){let t=this;if(!t.isDeadOrDying())do{const o=t.getSvgRoot(),n=o.parentNode,u=n.childNodes;if(u[u.length-1]!==o&&n.appendChild(o),e)break;t=t.getParent()}while(t)}setPreviousStatement(e,t){super.setPreviousStatement(e,t),this.queueRender()}setNextStatement(e,t){super.setNextStatement(e,t),this.queueRender()}setOutput(e,t){super.setOutput(e,t),this.queueRender()}setInputsInline(e){super.setInputsInline(e),this.queueRender()}removeInput(e,t){return e=super.removeInput(e,t),this.queueRender(),e}moveNumberedInputBefore(e,t){super.moveNumberedInputBefore(e,t),this.queueRender()}appendInput(e){return super.appendInput(e),this.queueRender(),e}setConnectionTracking(e){if(this.previousConnection&&this.previousConnection.setTracking(e),this.outputConnection&&this.outputConnection.setTracking(e),this.nextConnection){this.nextConnection.setTracking(e);var t=this.nextConnection.targetBlock();t&&t.setConnectionTracking(e)}if(!this.collapsed_)for(t=0;t=this.workspace.options.maxTrashcanContents||(e=new gs({scrollbars:!0,parentWorkspace:this.workspace,rtl:this.workspace.RTL,oneBasedIndex:this.workspace.options.oneBasedIndex,renderer:this.workspace.options.renderer,rendererOverrides:this.workspace.options.rendererOverrides,move:{scrollbars:!0}}),this.workspace.horizontalLayout?(e.toolboxPosition=this.workspace.toolboxPosition===Ge.TOP?Ge.BOTTOM:Ge.TOP,this.flyout=new(y($e.FLYOUTS_HORIZONTAL_TOOLBOX,this.workspace.options,!0))(e)):(e.toolboxPosition=this.workspace.toolboxPosition===Ge.RIGHT?Ge.LEFT:Ge.RIGHT,this.flyout=new(y($e.FLYOUTS_VERTICAL_TOOLBOX,this.workspace.options,!0))(e)),this.workspace.addChangeListener(this.onDelete.bind(this)))}createDom(){this.svgGroup=ie(J.G,{class:"blocklyTrash"});let e;const t=String(Math.random()).substring(2);e=ie(J.CLIPPATH,{id:"blocklyTrashBodyClipPath"+t},this.svgGroup),ie(J.RECT,{width:mn,height:Hl,y:fn},e);const o=ie(J.IMAGE,{width:Wt.width,x:-Cp,height:Wt.height,y:-Tp,"clip-path":"url(#blocklyTrashBodyClipPath"+t+")"},this.svgGroup);return o.setAttributeNS(is,"xlink:href",this.workspace.options.pathToMedia+Wt.url),e=ie(J.CLIPPATH,{id:"blocklyTrashLidClipPath"+t},this.svgGroup),ie(J.RECT,{width:mn,height:fn},e),this.svgLid=ie(J.IMAGE,{width:Wt.width,x:-Cp,height:Wt.height,y:-Tp,"clip-path":"url(#blocklyTrashLidClipPath"+t+")"},this.svgGroup),this.svgLid.setAttributeNS(is,"xlink:href",this.workspace.options.pathToMedia+Wt.url),ue(this.svgGroup,"pointerdown",this,this.blockMouseDownWhenOpenable),ue(this.svgGroup,"pointerup",this,this.click),ue(o,"pointerover",this,this.mouseOver),ue(o,"pointerout",this,this.mouseOut),this.animateLid(),this.svgGroup}init(){0{let o;(o=this.flyout)==null||o.show(e),t.cursor="";let n;(n=this.workspace.scrollbar)==null||n.setVisible(!1)},10),this.fireUiEvent(!0)}}closeFlyout(){if(this.contentsIsOpen()){var e;(e=this.flyout)==null||e.hide();var t;(t=this.workspace.scrollbar)==null||t.setVisible(!0),this.fireUiEvent(!1),this.workspace.recordDragTargets()}}autoHide(e){!e&&this.flyout&&this.closeFlyout()}emptyContents(){this.hasContents()&&(this.contents.length=0,this.setMinOpenness(0),this.closeFlyout())}position(e,t){if(this.initialized){var o=wa(this.workspace,e);e=_a(o,new Xe(mn,Hl+fn),rT,Vv,e,this.workspace),t=ka(e,Vv,o.vertical===$o.TOP?Po.DOWN:Po.UP,t),this.top=t.top,this.left=t.left;var n;(n=this.svgGroup)==null||n.setAttribute("transform","translate("+this.left+","+this.top+")");var u;(u=this.flyout)==null||u.position()}}getBoundingRectangle(){return new rt(this.top,this.top+Hl+fn,this.left,this.left+mn)}getClientRect(){if(!this.svgGroup)return null;var e=this.svgGroup.getBoundingClientRect();const t=e.top+Tp-Wl;return e=e.left+Cp-Wl,new rt(t,t+fn+Hl+2*Wl,e,e+mn+2*Wl)}onDragOver(e){this.setLidOpen(this.wouldDelete_)}onDragExit(e){this.setLidOpen(!1)}onDrop(e){setTimeout(this.setLidOpen.bind(this,!1),100)}setLidOpen(e){this.isLidOpen!==e&&(this.lidTask&&clearTimeout(this.lidTask),this.isLidOpen=e,this.animateLid())}animateLid(){const e=cT;var t=1/(e+1);this.lidOpen+=this.isLidOpen?t:-t,this.lidOpen=Math.min(Math.max(this.lidOpen,this.minOpenness),1),this.setLidAngle(this.lidOpen*Yv),t=Kv+this.lidOpen*(uT-Kv),this.svgGroup&&(this.svgGroup.style.opacity=`${t}`),this.lidOpen>this.minOpenness&&1>this.lidOpen&&(this.lidTask=setTimeout(this.animateLid.bind(this),lT/e))}setLidAngle(e){const t=this.workspace.toolboxPosition===Ge.RIGHT||this.workspace.horizontalLayout&&this.workspace.RTL;let o;(o=this.svgLid)==null||o.setAttribute("transform","rotate("+(t?-e:e)+","+(t?4:mn-4)+","+(fn-2)+")")}setMinOpenness(e){this.minOpenness=e,this.isLidOpen||this.setLidAngle(e*Yv)}closeLid(){this.setLidOpen(!1)}click(){this.hasContents()&&!this.workspace.isDragging()&&this.openFlyout()}fireUiEvent(e){e=new(ne(ee.TRASHCAN_OPEN))(e,this.workspace.id),z(e)}blockMouseDownWhenOpenable(e){!this.contentsIsOpen()&&this.hasContents()&&e.stopPropagation()}mouseOver(){this.hasContents()&&this.setLidOpen(!0)}mouseOut(){this.setLidOpen(!1)}onDelete(e){if(!(0>=this.workspace.options.maxTrashcanContents||!S(e)||e.wasShadow)){if(!e.oldJson)throw Error("Encountered a delete event without proper oldJson");if(e=JSON.stringify(this.cleanBlockJson(e.oldJson)),!this.contents.includes(e)){for(this.contents.unshift(e);this.contents.length>this.workspace.options.maxTrashcanContents;)this.contents.pop();this.setMinOpenness(aT)}}}cleanBlockJson(e){function t(o){if(o){if(delete o.id,delete o.x,delete o.y,delete o.enabled,delete o.disabledReasons,o.icons&&o.icons.comment){var n=o.icons.comment;delete n.height,delete n.width,delete n.pinned}n=o.inputs;for(var u in n){var g=n[u];const I=g.block;g=g.shadow,I&&t(I),g&&t(g)}o.next&&(u=o.next,o=u.block,u=u.shadow,o&&t(o),u&&t(u))}}return e=JSON.parse(JSON.stringify(e)),t(e),Object.assign({},{kind:"BLOCK"},e)}},mn=47,Hl=44,fn=16,Vv=20,rT=20,Wl=10,Cp=0,Tp=32,aT=.1,lT=80,cT=4,Kv=.4,uT=.8,Yv=45,st=class{constructor(){this.shortcuts=new Map,this.keyMap=new Map,this.reset()}reset(){this.shortcuts.clear(),this.keyMap.clear()}register(e,t){if(this.shortcuts.get(e.name)&&!t)throw Error(`Shortcut named "${e.name}" already exists.`);if(this.shortcuts.set(e.name,e),t=e.keyCodes,t!=null&&t.length)for(const o of t)this.addKeyMapping(o,e.name,!!e.allowCollision)}unregister(e){return this.shortcuts.get(e)?(this.removeAllKeyMappings(e),this.shortcuts.delete(e),!0):(console.warn(`Keyboard shortcut named "${e}" not found.`),!1)}addKeyMapping(e,t,o){e=`${e}`;const n=this.keyMap.get(e);if(n&&!o)throw Error(`Shortcut named "${t}" collides with shortcuts "${n}"`);n&&o?n.unshift(t):this.keyMap.set(e,[t])}removeKeyMapping(e,t,o){const n=this.keyMap.get(e);if(!n)return o||console.warn(`No keyboard shortcut named "${t}" registered with key code "${e}"`),!1;const u=n.indexOf(t);return-1Yd(t)),e.length?e:null}load(e,t){const o=t.getProcedureMap();for(const n of e)o.add(Jd(this.procedureModelClass,this.parameterModelClass,n,t))}clear(e){e.getProcedureMap().clear()}},Gl={};Gl.ProcedureSerializer=hT,Gl.loadProcedure=Jd,Gl.saveProcedure=Yd;var Jv=class{constructor(){this.priority=Wb}save(e){const t=[];for(const o of e.getAllVariables())e={name:o.name,id:o.getId()},o.type&&(e.type=o.type),t.push(e);return t.length?t:null}load(e,t){for(const o of e)t.createVariable(o.name,o.type,o.id)}clear(e){e.getVariableMap().clear()}};Vn("variables",new Jv);var qv={};qv.VariableSerializer=Jv;var Ip={};Ip.load=X$,Ip.save=q$;var pT={blocks:_r,exceptions:pi,priorities:UC,procedures:Gl,registry:Dh,variables:qv,workspaceComments:hl,workspaces:Ip},xp=class{constructor(e,t,o,n,u){this.workspace=e,this.oldHostMetrics=this.corner_=this.vScroll=this.hScroll=null,t=t===void 0?!0:t,o=o===void 0?!0:o;const g=t&&o;t&&(this.hScroll=new yt(e,!0,g,n,u)),o&&(this.vScroll=new yt(e,!1,g,n,u)),g&&(this.corner_=ie(J.RECT,{height:yt.scrollbarThickness,width:yt.scrollbarThickness,class:"blocklyScrollbarBackground"}),At(this.corner_,e.getBubbleCanvas()))}dispose(){Ze(this.corner_),this.oldHostMetrics=this.corner_=null,this.hScroll&&(this.hScroll.dispose(),this.hScroll=null),this.vScroll&&(this.vScroll.dispose(),this.vScroll=null)}resize(){const e=this.workspace.getMetrics();if(e){var t=!1,o=!1;if(this.oldHostMetrics&&this.oldHostMetrics.viewWidth===e.viewWidth&&this.oldHostMetrics.viewHeight===e.viewHeight&&this.oldHostMetrics.absoluteTop===e.absoluteTop&&this.oldHostMetrics.absoluteLeft===e.absoluteLeft?(this.oldHostMetrics&&this.oldHostMetrics.scrollWidth===e.scrollWidth&&this.oldHostMetrics.viewLeft===e.viewLeft&&this.oldHostMetrics.scrollLeft===e.scrollLeft||(t=!0),this.oldHostMetrics&&this.oldHostMetrics.scrollHeight===e.scrollHeight&&this.oldHostMetrics.viewTop===e.viewTop&&this.oldHostMetrics.scrollTop===e.scrollTop||(o=!0)):o=t=!0,t||o){try{i.disable$$module$build$src$core$events$utils(),this.hScroll&&t&&this.hScroll.resize(e),this.vScroll&&o&&this.vScroll.resize(e)}finally{i.enable$$module$build$src$core$events$utils()}this.workspace.maybeFireViewportChangeEvent()}if(this.hScroll&&this.vScroll){if(!this.oldHostMetrics||this.oldHostMetrics.viewWidth!==e.viewWidth||this.oldHostMetrics.absoluteLeft!==e.absoluteLeft){let n;(n=this.corner_)==null||n.setAttribute("x",String(this.vScroll.position.x))}if(!this.oldHostMetrics||this.oldHostMetrics.viewHeight!==e.viewHeight||this.oldHostMetrics.absoluteTop!==e.absoluteTop){let n;(n=this.corner_)==null||n.setAttribute("y",String(this.hScroll.position.y))}}this.oldHostMetrics=e}}canScrollHorizontally(){return!!this.hScroll}canScrollVertically(){return!!this.vScroll}setOrigin(e,t){this.hScroll&&this.hScroll.setOrigin(e,t),this.vScroll&&this.vScroll.setOrigin(e,t)}set(e,t,o){this.hScroll&&this.hScroll.set(e,!1),this.vScroll&&this.vScroll.set(t,!1),(o||o===void 0)&&(e={},this.hScroll&&(e.x=this.hScroll.getRatio_()),this.vScroll&&(e.y=this.vScroll.getRatio_()),this.workspace.setMetrics(e))}setX(e){this.hScroll&&this.hScroll.set(e,!0)}setY(e){this.vScroll&&this.vScroll.set(e,!0)}setContainerVisible(e){this.hScroll&&this.hScroll.setContainerVisible(e),this.vScroll&&this.vScroll.setContainerVisible(e)}isVisible(){let e=!1;return this.hScroll&&(e=this.hScroll.isVisible()),this.vScroll&&(e=e||this.vScroll.isVisible()),e}setVisible(e){this.hScroll&&this.hScroll.setVisibleInternal(e),this.vScroll&&this.vScroll.setVisibleInternal(e)}resizeContent(e){this.hScroll&&this.hScroll.resizeContentHorizontal(e),this.vScroll&&this.vScroll.resizeContentVertical(e)}resizeView(e){this.hScroll&&this.hScroll.resizeViewHorizontal(e),this.vScroll&&this.vScroll.resizeViewVertical(e)}},Dp=class{constructor(e){this.workspace_=e}getDimensionsPx_(e){let t=0,o=0;return e&&(t=e.getWidth(),o=e.getHeight()),new Xe(t,o)}getFlyoutMetrics(e){return e=this.getDimensionsPx_(this.workspace_.getFlyout(e)),{width:e.width,height:e.height,position:this.workspace_.toolboxPosition}}getToolboxMetrics(){const e=this.getDimensionsPx_(this.workspace_.getToolbox());return{width:e.width,height:e.height,position:this.workspace_.toolboxPosition}}getSvgMetrics(){return this.workspace_.getCachedParentSvgSize()}getAbsoluteMetrics(){let e=0,t=0;const o=this.getToolboxMetrics(),n=this.getFlyoutMetrics(),u=!!this.workspace_.getToolbox();var g;const I=!((g=this.workspace_.getFlyout())!=null&&g.autoClose);g=u?o.position:n.position;const L=g===Ge.TOP;return g===Ge.LEFT&&(u&&(e+=o.width),I&&(e+=n.width)),L&&(u&&(t+=o.height),I&&(t+=n.height)),{top:t,left:e}}getViewMetrics(e){e=e?this.workspace_.scale:1;const t=this.getSvgMetrics(),o=this.getToolboxMetrics(),n=this.getFlyoutMetrics(),u=!!this.workspace_.getToolbox();var g;const I=!((g=this.workspace_.getFlyout())!=null&&g.autoClose);g=u?o.position:n.position;const L=g===Ge.LEFT||g===Ge.RIGHT;return(g===Ge.TOP||g===Ge.BOTTOM)&&(u&&(t.height-=o.height),I&&(t.height-=n.height)),L&&(u&&(t.width-=o.width),I&&(t.width-=n.width)),{height:t.height/e,width:t.width/e,top:-this.workspace_.scrollY/e,left:-this.workspace_.scrollX/e}}getContentMetrics(e){e=e?1:this.workspace_.scale;const t=this.workspace_.getBlocksBoundingBox();return{height:(t.bottom-t.top)*e,width:(t.right-t.left)*e,top:t.top*e,left:t.left*e}}hasFixedEdges(){return!this.workspace_.isMovableHorizontally()||!this.workspace_.isMovableVertically()}getComputedFixedEdges_(e){if(!this.hasFixedEdges())return{};const t=this.workspace_.isMovableHorizontally(),o=this.workspace_.isMovableVertically();e=e||this.getViewMetrics(!1);const n={};return o||(n.top=e.top,n.bottom=e.top+e.height),t||(n.left=e.left,n.right=e.left+e.width),n}getPaddedContent_(e,t){const o=t.top+t.height,n=t.left+t.width,u=e.width;e=e.height;const g=u/2,I=e/2;return{top:Math.min(t.top-I,o-e),bottom:Math.max(o+I,t.top+e),left:Math.min(t.left-g,n-u),right:Math.max(n+g,t.left+u)}}getScrollMetrics(e,t,o){e=e?this.workspace_.scale:1,t=t||this.getViewMetrics(!1);var n=o||this.getContentMetrics();o=this.getComputedFixedEdges_(t),t=this.getPaddedContent_(t,n),n=o.top!==void 0?o.top:t.top;const u=o.left!==void 0?o.left:t.left;return{top:n/e,left:u/e,width:((o.right!==void 0?o.right:t.right)-u)/e,height:((o.bottom!==void 0?o.bottom:t.bottom)-n)/e}}getUiMetrics(){return{viewMetrics:this.getViewMetrics(),absoluteMetrics:this.getAbsoluteMetrics(),toolboxMetrics:this.getToolboxMetrics()}}getMetrics(){const e=this.getToolboxMetrics(),t=this.getFlyoutMetrics(!0),o=this.getSvgMetrics(),n=this.getAbsoluteMetrics(),u=this.getViewMetrics(),g=this.getContentMetrics(),I=this.getScrollMetrics(!1,u,g);return{contentHeight:g.height,contentWidth:g.width,contentTop:g.top,contentLeft:g.left,scrollHeight:I.height,scrollWidth:I.width,scrollTop:I.top,scrollLeft:I.left,viewHeight:u.height,viewWidth:u.width,viewTop:u.top,viewLeft:u.left,absoluteTop:n.top,absoluteLeft:n.left,svgHeight:o.height,svgWidth:o.width,toolboxWidth:e.width,toolboxHeight:e.height,toolboxPosition:e.position,flyoutWidth:t.width,flyoutHeight:t.height}}};r($e.METRICS_MANAGER,Ws,Dp),"Blockly"in globalThis||(globalThis.Blockly={Msg:ev});var Xv=class extends Pl{constructor(){super(),this.GRID_UNIT=4,this.CURSOR_COLOUR="#ffa200",this.CURSOR_RADIUS=5,this.JAGGED_TEETH_WIDTH=this.JAGGED_TEETH_HEIGHT=0,this.START_HAT_HEIGHT=22,this.START_HAT_WIDTH=96,this.SHAPES={HEXAGONAL:1,ROUND:2,SQUARE:3,PUZZLE:4,NOTCH:5},this.SHAPE_IN_SHAPE_PADDING={1:{0:5*this.GRID_UNIT,1:2*this.GRID_UNIT,2:5*this.GRID_UNIT,3:5*this.GRID_UNIT},2:{0:3*this.GRID_UNIT,1:3*this.GRID_UNIT,2:1*this.GRID_UNIT,3:2*this.GRID_UNIT},3:{0:2*this.GRID_UNIT,1:2*this.GRID_UNIT,2:2*this.GRID_UNIT,3:2*this.GRID_UNIT}},this.FULL_BLOCK_FIELDS=!0,this.FIELD_TEXT_FONTWEIGHT="bold",this.FIELD_TEXT_FONTFAMILY='"Helvetica Neue", "Segoe UI", Helvetica, sans-serif',this.FIELD_COLOUR_FULL_BLOCK=this.FIELD_TEXTINPUT_BOX_SHADOW=this.FIELD_DROPDOWN_SVG_ARROW=this.FIELD_DROPDOWN_COLOURED_DIV=this.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW=!0,this.SELECTED_GLOW_COLOUR="#fff200",this.SELECTED_GLOW_SIZE=.5,this.REPLACEMENT_GLOW_COLOUR="#fff200",this.REPLACEMENT_GLOW_SIZE=2,this.selectedGlowFilterId="",this.selectedGlowFilter=null,this.replacementGlowFilterId="",this.SQUARED=this.ROUNDED=this.HEXAGONAL=this.replacementGlowFilter=null,this.SMALL_PADDING=this.GRID_UNIT,this.MEDIUM_PADDING=2*this.GRID_UNIT,this.MEDIUM_LARGE_PADDING=3*this.GRID_UNIT,this.LARGE_PADDING=4*this.GRID_UNIT,this.CORNER_RADIUS=1*this.GRID_UNIT,this.NOTCH_WIDTH=9*this.GRID_UNIT,this.NOTCH_HEIGHT=2*this.GRID_UNIT,this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT=3*this.GRID_UNIT,this.MIN_BLOCK_WIDTH=2*this.GRID_UNIT,this.MIN_BLOCK_HEIGHT=12*this.GRID_UNIT,this.EMPTY_STATEMENT_INPUT_HEIGHT=6*this.GRID_UNIT,this.TOP_ROW_MIN_HEIGHT=this.CORNER_RADIUS,this.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING,this.BOTTOM_ROW_MIN_HEIGHT=this.CORNER_RADIUS,this.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT=6*this.GRID_UNIT,this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT,this.STATEMENT_INPUT_SPACER_MIN_WIDTH=40*this.GRID_UNIT,this.STATEMENT_INPUT_PADDING_LEFT=4*this.GRID_UNIT,this.EMPTY_INLINE_INPUT_PADDING=4*this.GRID_UNIT,this.EMPTY_INLINE_INPUT_HEIGHT=8*this.GRID_UNIT,this.DUMMY_INPUT_MIN_HEIGHT=8*this.GRID_UNIT,this.DUMMY_INPUT_SHADOW_MIN_HEIGHT=6*this.GRID_UNIT,this.CURSOR_WS_WIDTH=20*this.GRID_UNIT,this.FIELD_TEXT_FONTSIZE=3*this.GRID_UNIT,this.FIELD_BORDER_RECT_RADIUS=this.CORNER_RADIUS,this.FIELD_BORDER_RECT_X_PADDING=2*this.GRID_UNIT,this.FIELD_BORDER_RECT_Y_PADDING=1.625*this.GRID_UNIT,this.FIELD_BORDER_RECT_HEIGHT=8*this.GRID_UNIT,this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=8*this.GRID_UNIT,this.FIELD_DROPDOWN_SVG_ARROW_PADDING=this.FIELD_BORDER_RECT_X_PADDING,this.FIELD_COLOUR_DEFAULT_WIDTH=6*this.GRID_UNIT,this.FIELD_COLOUR_DEFAULT_HEIGHT=8*this.GRID_UNIT,this.FIELD_CHECKBOX_X_OFFSET=1*this.GRID_UNIT,this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH=12*this.GRID_UNIT}setFontConstants_(e){super.setFontConstants_(e),this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT=this.FIELD_TEXT_HEIGHT+2*this.FIELD_BORDER_RECT_Y_PADDING}init(){super.init(),this.HEXAGONAL=this.makeHexagonal(),this.ROUNDED=this.makeRounded(),this.SQUARED=this.makeSquared(),this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT+this.INSIDE_CORNERS.rightWidth}setDynamicProperties_(e){super.setDynamicProperties_(e),this.SELECTED_GLOW_COLOUR=e.getComponentStyle("selectedGlowColour")||this.SELECTED_GLOW_COLOUR;const t=Number(e.getComponentStyle("selectedGlowSize"));this.SELECTED_GLOW_SIZE=t&&!isNaN(t)?t:this.SELECTED_GLOW_SIZE,this.REPLACEMENT_GLOW_COLOUR=e.getComponentStyle("replacementGlowColour")||this.REPLACEMENT_GLOW_COLOUR,this.REPLACEMENT_GLOW_SIZE=(e=Number(e.getComponentStyle("replacementGlowSize")))&&!isNaN(e)?e:this.REPLACEMENT_GLOW_SIZE}dispose(){super.dispose(),this.selectedGlowFilter&&Ze(this.selectedGlowFilter),this.replacementGlowFilter&&Ze(this.replacementGlowFilter)}makeStartHat(){const e=this.START_HAT_HEIGHT,t=this.START_HAT_WIDTH,o=Xt("c",[Me(25,-e),Me(71,-e),Me(t,0)]);return{height:e,width:t,path:o}}makeHexagonal(){function e(o,n,u){var g=o/2;return g=g>t?t:g,u=u?-1:1,o=(n?-1:1)*o/2,Hs(-u*g,o)+Hs(u*g,o)}const t=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH;return{type:this.SHAPES.HEXAGONAL,isDynamic:!0,width(o){return o/=2,o>t?t:o},height(o){return o},connectionOffsetY(o){return o/2},connectionOffsetX(o){return-o},pathDown(o){return e(o,!1,!1)},pathUp(o){return e(o,!0,!1)},pathRightDown(o){return e(o,!1,!0)},pathRightUp(o){return e(o,!1,!0)}}}makeRounded(){function e(n,u,g){const I=n>o?n-o:0;n=(n>o?o:n)/2;const L=g===u?"0":"1";return vt("a","0 0,"+L,n,Me((g?1:-1)*n,(u?-1:1)*n))+De("v",(u?-1:1)*I)+vt("a","0 0,"+L,n,Me((g?-1:1)*n,(u?-1:1)*n))}const t=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH,o=2*t;return{type:this.SHAPES.ROUND,isDynamic:!0,width(n){return n/=2,n>t?t:n},height(n){return n},connectionOffsetY(n){return n/2},connectionOffsetX(n){return-n},pathDown(n){return e(n,!1,!1)},pathUp(n){return e(n,!0,!1)},pathRightDown(n){return e(n,!1,!0)},pathRightUp(n){return e(n,!1,!0)}}}makeSquared(){function e(o,n,u){o-=2*t;const g=u===n?"0":"1";return vt("a","0 0,"+g,t,Me((u?1:-1)*t,(n?-1:1)*t))+De("v",(n?-1:1)*o)+vt("a","0 0,"+g,t,Me((u?-1:1)*t,(n?-1:1)*t))}const t=this.CORNER_RADIUS;return{type:this.SHAPES.SQUARE,isDynamic:!0,width(o){return t},height(o){return o},connectionOffsetY(o){return o/2},connectionOffsetX(o){return-o},pathDown(o){return e(o,!1,!1)},pathUp(o){return e(o,!0,!1)},pathRightDown(o){return e(o,!1,!0)},pathRightUp(o){return e(o,!1,!0)}}}shapeFor(e){let t=e.getCheck();switch(!t&&e.targetConnection&&(t=e.targetConnection.getCheck()),e.type){case xe.INPUT_VALUE:case xe.OUTPUT_VALUE:if(e=e.getSourceBlock().getOutputShape(),e!==null)switch(e){case this.SHAPES.HEXAGONAL:return this.HEXAGONAL;case this.SHAPES.ROUND:return this.ROUNDED;case this.SHAPES.SQUARE:return this.SQUARED}return t&&t.includes("Boolean")?this.HEXAGONAL:t&&t.includes("Number")?this.ROUNDED:(t&&t.includes("String"),this.ROUNDED);case xe.PREVIOUS_STATEMENT:case xe.NEXT_STATEMENT:return this.NOTCH;default:throw Error("Unknown type")}}makeNotch(){function e(Ee){return Xt("c",[Me(Ee*u/2,0),Me(Ee*u*3/4,I/2),Me(Ee*u,I)])+Yi([Me(Ee*u,g)])+Xt("c",[Me(Ee*u/4,I/2),Me(Ee*u/2,I),Me(Ee*u,I)])+De("h",Ee*n)+Xt("c",[Me(Ee*u/2,0),Me(Ee*u*3/4,-(I/2)),Me(Ee*u,-I)])+Yi([Me(Ee*u,-g)])+Xt("c",[Me(Ee*u/4,-(I/2)),Me(Ee*u/2,-I),Me(Ee*u,-I)])}const t=this.NOTCH_WIDTH,o=this.NOTCH_HEIGHT,n=t/3,u=n/3,g=o/2,I=g/2,L=e(1),le=e(-1);return{type:this.SHAPES.NOTCH,width:t,height:o,pathLeft:L,pathRight:le}}makeInsideCorners(){const e=this.CORNER_RADIUS,t=vt("a","0 0,0",e,Me(-e,e)),o=vt("a","0 0,1",e,Me(-e,e)),n=vt("a","0 0,0",e,Me(e,e)),u=vt("a","0 0,1",e,Me(e,e));return{width:e,height:e,pathTop:t,pathBottom:n,rightWidth:e,rightHeight:e,pathTopRight:o,pathBottomRight:u}}generateSecondaryColour_(e){return si("#000",e,.15)||e}generateTertiaryColour_(e){return si("#000",e,.25)||e}createDom(e,t,o){super.createDom(e,t,o),e=ie(J.DEFS,{},e),t=ie(J.FILTER,{id:"blocklySelectedGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},e),ie(J.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.SELECTED_GLOW_SIZE},t),o=ie(J.FECOMPONENTTRANSFER,{result:"outBlur"},t),ie(J.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},o),ie(J.FEFLOOD,{"flood-color":this.SELECTED_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},t),ie(J.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},t),this.selectedGlowFilterId=t.id,this.selectedGlowFilter=t,e=ie(J.FILTER,{id:"blocklyReplacementGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},e),ie(J.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.REPLACEMENT_GLOW_SIZE},e),t=ie(J.FECOMPONENTTRANSFER,{result:"outBlur"},e),ie(J.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},t),ie(J.FEFLOOD,{"flood-color":this.REPLACEMENT_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},e),ie(J.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},e),ie(J.FECOMPOSITE,{in:"SourceGraphic",in2:"outGlow",operator:"over"},e),this.replacementGlowFilterId=e.id,this.replacementGlowFilter=e}getCSS_(e){return[`${e} .blocklyText,`,`${e} .blocklyFlyoutLabelText {`,`font: ${this.FIELD_TEXT_FONTWEIGHT} ${this.FIELD_TEXT_FONTSIZE}pt ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${e} .blocklyTextInputBubble textarea {`,"font-weight: normal;","}",`${e} .blocklyText {`,"fill: #fff;","}",`${e} .blocklyNonEditableText>rect:not(.blocklyDropdownRect),`,`${e} .blocklyEditableText>rect:not(.blocklyDropdownRect) {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"}",`${e} .blocklyNonEditableText>text,`,`${e} .blocklyEditableText>text,`,`${e} .blocklyNonEditableText>g>text,`,`${e} .blocklyEditableText>g>text {`,"fill: #575E75;","}",`${e} .blocklyFlyoutLabelText {`,"fill: #575E75;","}",`${e} .blocklyText.blocklyBubbleText {`,"fill: #575E75;","}",`${e} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableText:not(.editing):hover>rect,",`${e} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableText:not(.editing):hover>.blocklyPath {","stroke: #fff;","stroke-width: 2;","}",`${e} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,"color: #575E75;","}",`${e} .blocklyDropdownText {`,"fill: #fff !important;","}",`${e}.blocklyWidgetDiv .blocklyMenuItem,`,`${e}.blocklyDropDownDiv .blocklyMenuItem {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${e}.blocklyDropDownDiv .blocklyMenuItemContent {`,"color: #fff;","}",`${e} .blocklyHighlightedConnectionPath {`,`stroke: ${this.SELECTED_GLOW_COLOUR};`,"}",`${e} .blocklyDisabled > .blocklyOutlinePath {`,`fill: url(#blocklyDisabledPattern${this.randomIdentifier})`,"}",`${e} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"]}},Zv=class extends Bl{constructor(e,t){super(e,t)}draw(){const e=this.block_.pathObject;e.beginDrawing(),this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights(),e.setPath(this.outlinePath_+` +`+this.inlinePath_),this.info_.RTL&&e.flipRTL(),this.recordSizeOnBlock_(),this.info_.outputConnection&&(e.outputShapeType=this.info_.outputConnection.shape.type),e.endDrawing()}drawOutline_(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape&&!this.info_.hasStatementInput&&!this.info_.bottomRow.hasNextConnection?(this.drawFlatTop_(),this.drawRightDynamicConnection_(),this.drawFlatBottom_(),this.drawLeftDynamicConnection_()):super.drawOutline_()}drawLeft_(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape?this.drawLeftDynamicConnection_():super.drawLeft_()}drawRightSideRow_(e){if(!(0>=e.height)){if(F.isSpacer(e)){const n=e.precedesStatement;var t=e.followsStatement;if(n||t){const u=this.constants_.INSIDE_CORNERS;var o=u.rightHeight;o=e.height-(n?o:0),t=t?u.pathBottomRight:"",e=0=o||0>=t)throw Error("Height and width values of an image field must be greater than 0.");this.size_=new Xe(t,o+Ci.Y_PADDING),this.imageHeight=o,typeof u=="function"&&(this.clickHandler=u),e!==lt.SKIP_SETUP&&(I?this.configure_(I):(this.flipRtl=!!g,this.altText=bt(n)||""),this.setValue(bt(e)))}configure_(e){super.configure_(e),e.flipRtl&&(this.flipRtl=e.flipRtl),e.alt&&(this.altText=bt(e.alt))}initView(){this.imageElement=ie(J.IMAGE,{height:this.imageHeight+"px",width:this.size_.width+"px",alt:this.altText},this.fieldGroup_),this.imageElement.setAttributeNS(is,"xlink:href",this.value_),this.clickHandler&&(this.imageElement.style.cursor="pointer")}updateSize_(){}doClassValidation_(e){return typeof e!="string"?null:e}doValueUpdate_(e){this.value_=e,this.imageElement&&this.imageElement.setAttributeNS(is,"xlink:href",this.value_)}getFlipRtl(){return this.flipRtl}setAlt(e){e!==this.altText&&(this.altText=e||"",this.imageElement&&this.imageElement.setAttribute("alt",this.altText))}showEditor_(){this.clickHandler&&this.clickHandler(this)}setOnClickHandler(e){this.clickHandler=e}getText_(){return this.altText}static fromJson(e){if(!e.src||!e.width||!e.height)throw Error("src, width, and height values for an image field arerequired. The width and height must be non-zero.");return new this(e.src,e.width,e.height,void 0,void 0,void 0,e)}};Ci.Y_PADDING=1,Us("field_image",Ci),Ci.prototype.DEFAULT_VALUE="";var Vl=class extends lt{constructor(e,t,o){super(lt.SKIP_SETUP),this.spellcheck_=!0,this.htmlInput_=null,this.isTextValid_=this.isBeingEdited_=!1,this.onKeyInputWrapper=this.onKeyDownWrapper=this.valueWhenEditorWasOpened_=null,this.fullBlockClickTarget_=!1,this.workspace_=null,this.SERIALIZABLE=!0,this.CURSOR="text",e!==lt.SKIP_SETUP&&(o&&this.configure_(o),this.setValue(e),t&&this.setValidator(t))}configure_(e){super.configure_(e),e.spellcheck!==void 0&&(this.spellcheck_=e.spellcheck)}initView(){if(!this.getSourceBlock())throw new _t;super.initView(),this.isFullBlockField()&&(this.clickTarget_=this.sourceBlock_.getSvgRoot())}isFullBlockField(){const e=this.getSourceBlock();if(!e)throw new _t;let t;return this.fullBlockClickTarget_=!((t=this.getConstants())==null||!t.FULL_BLOCK_FIELDS)&&e.isSimpleReporter()}doValueInvalid_(e,t=!0){this.isBeingEdited_&&(this.isDirty_=!0,this.isTextValid_=!1,e=this.value_,this.value_=this.valueWhenEditorWasOpened_,this.sourceBlock_&&C()&&this.value_!==e&&t&&z(new(ne(ee.BLOCK_CHANGE))(this.sourceBlock_,"field",this.name||null,e,this.value_)))}doValueUpdate_(e){this.isTextValid_=this.isDirty_=!0,this.value_=e}applyColour(){const e=this.getSourceBlock();if(!e)throw new _t;this.getConstants().FULL_BLOCK_FIELDS&&this.fieldGroup_&&(!this.isFullBlockField()&&this.borderRect_?(this.borderRect_.style.display="block",this.borderRect_.setAttribute("stroke",e.getColourTertiary())):(this.borderRect_.style.display="none",e.pathObject.svgPath.setAttribute("fill",this.getConstants().FIELD_BORDER_RECT_COLOUR)))}getSize(){let e;return(e=this.getConstants())!=null&&e.FULL_BLOCK_FIELDS&&(this.render_(),this.isDirty_=!1),super.getSize()}onLocationChange(){this.isBeingEdited_&&this.resizeEditor_()}render_(){if(super.render_(),this.isBeingEdited_){var e=this.htmlInput_;this.isTextValid_?(ze(e,"blocklyInvalidInput"),xt(e,Et.INVALID,!1)):(Oe(e,"blocklyInvalidInput"),xt(e,Et.INVALID,!0))}if(e=this.getSourceBlock(),!e)throw new _t;this.getConstants().FULL_BLOCK_FIELDS&&e.applyColour()}setSpellcheck(e){e!==this.spellcheck_&&(this.spellcheck_=e,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))}showEditor_(e,t=!1){this.workspace_=this.sourceBlock_.workspace,!t&&this.workspace_.options.modalInputs&&(Rb||wh||ll)?this.showPromptEditor():this.showInlineEditor(t)}showPromptEditor(){Ea(i.Msg$$module$build$src$core$msg.CHANGE_VALUE_TITLE,this.getText(),e=>{e!==null&&this.setValue(this.getValueFromEditorText_(e)),this.onFinishEditing_(this.value_)})}showInlineEditor(e){const t=this.getSourceBlock();if(!t)throw new _t;ja(this,t.RTL,this.widgetDispose_.bind(this),this.workspace_),this.htmlInput_=this.widgetCreate_(),this.isBeingEdited_=!0,this.valueWhenEditorWasOpened_=this.value_,e||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())}widgetCreate_(){var e=this.getSourceBlock();if(!e)throw new _t;i.setGroup$$module$build$src$core$events$utils(!0);const t=oi();var o=this.getClickTarget_();if(!o)throw Error("A click target has not been set.");Oe(o,"editing"),o=document.createElement("input"),o.className="blocklyHtmlInput",o.setAttribute("spellcheck",this.spellcheck_);const n=this.workspace_.getScale();var u=this.getConstants().FIELD_TEXT_FONTSIZE*n+"pt";return t.style.fontSize=u,o.style.fontSize=u,u=Vl.BORDERRADIUS*n+"px",this.isFullBlockField()&&(u=this.getScaledBBox(),u=(u.bottom-u.top)/2+"px",e=e.getParent()?e.getParent().getColourTertiary():this.sourceBlock_.getColourTertiary(),o.style.border=1*n+"px solid "+e,t.style.borderRadius=u,t.style.transition="box-shadow 0.25s ease 0s",this.getConstants().FIELD_TEXTINPUT_BOX_SHADOW&&(t.style.boxShadow="rgba(255, 255, 255, 0.3) 0 0 0 "+4*n+"px")),o.style.borderRadius=u,t.appendChild(o),o.value=o.defaultValue=this.getEditorText_(this.value_),o.setAttribute("data-untyped-default-value",String(this.value_)),this.resizeEditor_(),this.bindInputEvents_(o),o}widgetDispose_(){this.isBeingEdited_=!1,this.isTextValid_=!0,this.forceRerender(),this.onFinishEditing_(this.value_),this.sourceBlock_&&C()&&this.valueWhenEditorWasOpened_!==null&&this.valueWhenEditorWasOpened_!==this.value_&&(z(new(ne(ee.BLOCK_CHANGE))(this.sourceBlock_,"field",this.name||null,this.valueWhenEditorWasOpened_,this.value_)),this.valueWhenEditorWasOpened_=null),i.setGroup$$module$build$src$core$events$utils(!1),this.unbindInputEvents_();var e=oi().style;if(e.width="auto",e.height="auto",e.fontSize="",e.transition="",e.boxShadow="",this.htmlInput_=null,e=this.getClickTarget_(),!e)throw Error("A click target has not been set.");ze(e,"editing")}onFinishEditing_(e){}bindInputEvents_(e){this.onKeyDownWrapper=H(e,"keydown",this,this.onHtmlInputKeyDown_),this.onKeyInputWrapper=H(e,"input",this,this.onHtmlInputChange)}unbindInputEvents_(){this.onKeyDownWrapper&&(V(this.onKeyDownWrapper),this.onKeyDownWrapper=null),this.onKeyInputWrapper&&(V(this.onKeyInputWrapper),this.onKeyInputWrapper=null)}onHtmlInputKeyDown_(e){e.key==="Enter"?(ii(this),js()):e.key==="Escape"?(this.setValue(this.htmlInput_.getAttribute("data-untyped-default-value"),!1),ii(this),js()):e.key==="Tab"&&(ii(this),js(),this.sourceBlock_.tab(this,!e.shiftKey),e.preventDefault())}onHtmlInputChange(e){e=this.value_,this.setValue(this.getValueFromEditorText_(this.htmlInput_.value),!1),this.sourceBlock_&&C()&&this.value_!==e&&z(new(ne(ee.BLOCK_FIELD_INTERMEDIATE_CHANGE))(this.sourceBlock_,this.name||null,e,this.value_))}setEditorValue_(e,t=!0){this.isDirty_=!0,this.isBeingEdited_&&(this.htmlInput_.value=this.getEditorText_(e)),this.setValue(e,t)}resizeEditor_(){Ts().then(()=>{const e=this.getSourceBlock();if(!e)throw new _t;const t=oi(),o=this.getScaledBBox();t.style.width=o.right-o.left+"px",t.style.height=o.bottom-o.top+"px";const n=o.top;t.style.left=`${e.RTL?o.right-t.offsetWidth:o.left}px`,t.style.top=`${n}px`})}repositionForWindowResize(){let e;const t=(e=this.getSourceBlock())==null?void 0:e.getRootBlock();return t instanceof $s?(Ji(this.workspace_,this.workspace_.getMetricsManager().getViewMetrics(!0),t)||this.resizeEditor_(),!0):!1}isTabNavigable(){return!0}getText_(){return this.isBeingEdited_&&this.htmlInput_?this.htmlInput_.value:null}getEditorText_(e){return`${e}`}getValueFromEditorText_(e){return e}};Vl.BORDERRADIUS=4;var Kl=class extends Vl{constructor(e,t,o){super(e,t,o)}doClassValidation_(e){return e===void 0?null:`${e}`}static fromJson(e){return new this(bt(e.text),void 0,e)}};Us("field_input",Kl),Kl.prototype.DEFAULT_VALUE="";var Qv=class extends rp{constructor(e){super(e)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(e){return!!e.outputConnection}hasRightSquareCorner(e){return!!e.outputConnection&&!e.statementInputCount&&!e.nextConnection}},Yl=class extends xr{constructor(e,t){if(super(e,t),this.connectedBottomNextConnection=!1,this.connectedBlock){for(e=this.connectedBlock;t=e.getNextBlock();)e=t;e.nextConnection||(this.height=this.connectedBlockHeight,this.connectedBottomNextConnection=!0)}}},ey=class extends Vs{constructor(e){super(e),this.width=this.height=0,this.type|=F.getType("RIGHT_CONNECTION")}},ty=class extends dp{constructor(e){super(e)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(e){const t=(e.hat?e.hat==="cap":this.constants_.ADD_START_HATS)&&!e.outputConnection&&!e.previousConnection;return!!e.outputConnection||t}hasRightSquareCorner(e){return!!e.outputConnection&&!e.statementInputCount&&!e.nextConnection}},sy=class extends Or{constructor(e,t){super(e,t),this.isInline=!0,this.renderer_=e,this.constants_=this.renderer_.getConstants(),this.topRow=new ty(this.constants_),this.bottomRow=new Qv(this.constants_),this.isMultiRow=!t.getInputsInline()||t.isCollapsed(),this.hasStatementInput=0=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!n.precedesStatement,F.isInputRow(g)&&g.hasStatement){g.measure();let I,L;t=g.width-((L=(I=g.getLastInput())==null?void 0:I.width)!=null?L:0)+e}else if(o&&(u===2||n)&&F.isInputRow(g)&&!g.hasStatement){n=g.xPos,o=null;for(let I=0;Io?o:this.height/2,t-o*(1-Math.sin(Math.acos((o-this.constants_.SMALL_PADDING)/o)))):0;if(F.isInlineInput(e)&&e instanceof zo){const u=e.connectedBlock;return e=u?u.pathObject.outputShapeType:e.shape.type,e==null||u&&u.outputConnection&&(u.statementInputCount||u.nextConnection)||o===n.SHAPES.HEXAGONAL&&o!==e?0:t-this.constants_.SHAPE_IN_SHAPE_PADDING[o][e]}return F.isField(e)&&e instanceof hn?o===n.SHAPES.ROUND&&e.field instanceof Kl?t-2.75*n.GRID_UNIT:t-this.constants_.SHAPE_IN_SHAPE_PADDING[o][0]:F.isIcon(e)?this.constants_.SMALL_PADDING:0}finalizeVerticalAlignment_(){if(!this.outputConnection)for(let n=2;n=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!I.precedesStatement;if(e?this.topRow.hasPreviousConnection:u.followsStatement){var o=g.elements[1];if(o=g.elements.length===3&&o instanceof hn&&(o.field instanceof _i||o.field instanceof Ci),!e&&o)u.height-=this.constants_.SMALL_PADDING,I.height-=this.constants_.SMALL_PADDING,g.height-=this.constants_.MEDIUM_PADDING;else if(!e&&!t)u.height+=this.constants_.SMALL_PADDING;else if(t){for(e=!1,t=0;t{if(!n.isDeadOrDying()){i.disable$$module$build$src$core$events$utils();try{n==null||n.positionNearConnection(u,g,I),n==null||n.getSvgRoot().setAttribute("visibility","visible")}finally{i.enable$$module$build$src$core$events$utils()}}}),u}createInsertionMarker(e){const t=os(e,{addCoordinates:!1,addInputBlocks:!1,addNextBlocks:!1,doFullSerialization:!1});if(!t)throw Error(`Failed to serialize source block. ${e.toDevString()}`);e=lo(t,this.workspace);for(const o of e.getDescendants(!1))o.setInsertionMarker(!0);return e.initSvg(),e.getSvgRoot().setAttribute("visibility","hidden"),e}getMatchingConnection(e,t,o){if(e=e.getConnections_(!0),t=t.getConnections_(!0),e.length!==t.length)return null;for(let n=0;n{this.targetWorkspace.isDragging()||t.addSelect()})),this.listeners.push(ue(e,"pointerleave",t,()=>{this.targetWorkspace.isDragging()||t.removeSelect()})),this.listeners.push(ue(o,"pointerenter",t,()=>{this.targetWorkspace.isDragging()||t.addSelect()})),this.listeners.push(ue(o,"pointerleave",t,()=>{this.targetWorkspace.isDragging()||t.removeSelect()}))}blockMouseDown(e){return t=>{const o=this.targetWorkspace.getGesture(t);o&&(o.setStartBlock(e),o.handleFlyoutStart(t,this))}}onMouseDown(e){const t=this.targetWorkspace.getGesture(e);t&&t.handleFlyoutStart(e,this)}isBlockCreatable(e){return e.isEnabled()}createBlock(e){let t=null;i.disable$$module$build$src$core$events$utils();var o=this.targetWorkspace.getAllVariables();this.targetWorkspace.setResizesEnabled(!1);try{t=this.placeNewBlock(e)}finally{i.enable$$module$build$src$core$events$utils()}if(this.targetWorkspace.hideChaff(),e=qn(this.targetWorkspace,o),C()){for(i.setGroup$$module$build$src$core$events$utils(!0),o=0;o-t||e<-180+t||e>180-t}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const e=this.svgGroup_.getBoundingClientRect(),t=e.left;return this.toolboxPosition_===Ge.LEFT?new rt(-1e9,1e9,-1e9,t+e.width):new rt(-1e9,1e9,t,1e9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let e=0;var t=this.workspace_.getTopBlocks(!1);for(let n=0,u;u=t[n];n++){var o=u.getHeightWidth().width;u.outputConnection&&(o-=this.tabWidth_),e=Math.max(e,o)}for(let n=0,u;u=this.buttons_[n];n++)e=Math.max(e,u.width);if(e+=1.5*this.MARGIN+this.tabWidth_,e*=this.workspace_.scale,e+=yt.scrollbarThickness,this.width_!==e){for(let n=0,u;u=t[n];n++){if(this.RTL){o=u.getRelativeToSurfaceXY().x;let g=e/this.workspace_.scale-this.MARGIN;u.outputConnection||(g-=this.tabWidth_),u.moveBy(g-o,0)}this.rectMap_.has(u)&&this.moveRectToBlock_(this.rectMap_.get(u),u)}if(this.RTL)for(let n=0,u;u=this.buttons_[n];n++)t=u.getPosition().y,u.moveTo(e/this.workspace_.scale-u.width-this.MARGIN-this.tabWidth_,t);this.targetWorkspace.scrollbar||this.autoClose||this.targetWorkspace.getFlyout()!==this||this.toolboxPosition_!==Ge.LEFT||this.targetWorkspace.translate(this.targetWorkspace.scrollX+e,this.targetWorkspace.scrollY),this.width_=e,this.position(),this.targetWorkspace.resizeContents(),this.targetWorkspace.recordDragTargets()}}};Op.registryName="verticalFlyout",r($e.FLYOUTS_VERTICAL_TOOLBOX,Ws,Op);var ay=class extends Jl{constructor(e){super(e),this.horizontalLayout=!0}setMetrics_(e){if(this.isVisible()){var t=this.workspace_.getMetricsManager(),o=t.getScrollMetrics(),n=t.getViewMetrics();t=t.getAbsoluteMetrics(),typeof e.x=="number"&&(this.workspace_.scrollX=-(o.left+(o.width-n.width)*e.x)),this.workspace_.translate(this.workspace_.scrollX+t.left,this.workspace_.scrollY+t.top)}}getX(){return 0}getY(){if(!this.isVisible())return 0;var e=this.targetWorkspace.getMetricsManager();const t=e.getAbsoluteMetrics(),o=e.getViewMetrics();e=e.getToolboxMetrics();const n=this.toolboxPosition_===Ge.TOP;return this.targetWorkspace.toolboxPosition===this.toolboxPosition_?this.targetWorkspace.getToolbox()?n?e.height:o.height-this.height_:n?0:o.height:n?0:o.height+t.top-this.height_}position(){if(this.isVisible()&&this.targetWorkspace.isVisible()){var e=this.targetWorkspace.getMetricsManager().getViewMetrics();this.width_=e.width,this.setBackgroundPath(e.width-2*this.CORNER_RADIUS,this.height_-this.CORNER_RADIUS),e=this.getX();var t=this.getY();this.positionAt_(this.width_,this.height_,e,t)}}setBackgroundPath(e,t){const o=this.toolboxPosition_===Ge.TOP,n=["M 0,"+(o?0:this.CORNER_RADIUS)];o?(n.push("h",e+2*this.CORNER_RADIUS),n.push("v",t),n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,-this.CORNER_RADIUS,this.CORNER_RADIUS),n.push("h",-e),n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,-this.CORNER_RADIUS,-this.CORNER_RADIUS)):(n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,this.CORNER_RADIUS,-this.CORNER_RADIUS),n.push("h",e),n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,this.CORNER_RADIUS,this.CORNER_RADIUS),n.push("v",t),n.push("h",-e-2*this.CORNER_RADIUS)),n.push("z"),this.svgBackground_.setAttribute("d",n.join(" "))}scrollToStart(){let e;(e=this.workspace_.scrollbar)==null||e.setX(this.RTL?1/0:0)}wheel_(e){var t=Le(e);if(t=t.x||t.y){const o=this.workspace_.getMetricsManager(),n=o.getScrollMetrics();t=o.getViewMetrics().left-n.left+t;let u;(u=this.workspace_.scrollbar)==null||u.setX(t),tr(this.workspace_),js()}e.preventDefault(),e.stopPropagation()}layout_(e,t){this.workspace_.scale=this.targetWorkspace.scale;const o=this.MARGIN;let n=o+this.tabWidth_;this.RTL&&(e=e.reverse());for(let L=0,le;le=e[L];L++)if(le.type==="block"){var u=le.block;if(u==null)continue;var g=u.getDescendants(!1);for(let dt=0,ut;ut=g[dt];dt++)ut.isInFlyout=!0;g=u.getSvgRoot();const Ee=u.getHeightWidth();var I=u.outputConnection?this.tabWidth_:0;I=this.RTL?n+Ee.width:n-I,u.moveBy(I,o),I=this.createRect_(u,I,o,Ee,L),n+=Ee.width+t[L],this.addBlockListeners_(g,u,I)}else le.type==="button"&&(u=le.button,this.initFlyoutButton_(u,n,o),n+=u.width+t[L])}isDragTowardWorkspace(e){e=Math.atan2(e.y,e.x)/Math.PI*180;const t=this.dragAngleRange_;return e<90+t&&e>90-t||e>-90-t&&e<-90+t}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const e=this.svgGroup_.getBoundingClientRect(),t=e.top;return this.toolboxPosition_===Ge.TOP?new rt(-1e9,t+e.height,-1e9,1e9):new rt(t,1e9,-1e9,1e9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let e=0;const t=this.workspace_.getTopBlocks(!1);for(let n=0,u;u=t[n];n++)e=Math.max(e,u.getHeightWidth().height);const o=this.buttons_;for(let n=0,u;u=o[n];n++)e=Math.max(e,u.height);if(e+=1.5*this.MARGIN,e*=this.workspace_.scale,e+=yt.scrollbarThickness,this.height_!==e){for(let n=0,u;u=t[n];n++)this.rectMap_.has(u)&&this.moveRectToBlock_(this.rectMap_.get(u),u);this.targetWorkspace.scrollbar||this.autoClose||this.targetWorkspace.getFlyout()!==this||this.toolboxPosition_!==Ge.TOP||this.targetWorkspace.translate(this.targetWorkspace.scrollX,this.targetWorkspace.scrollY+e),this.height_=e,this.position(),this.targetWorkspace.resizeContents(),this.targetWorkspace.recordDragTargets()}}};r($e.FLYOUTS_HORIZONTAL_TOOLBOX,Ws,ay);var Lr=class extends Qt{constructor(e,t,o,n,u){super(lt.SKIP_SETUP),this.defaultType="",this.variableTypes=[],this.variable=null,this.SERIALIZABLE=!0,this.menuGenerator_=Lr.dropdownCreate,this.defaultVariableName=typeof e=="string"?e:"",this.size_=new Xe(0,0),e!==lt.SKIP_SETUP&&(u?this.configure_(u):this.setTypes(o,n),t&&this.setValidator(t))}configure_(e){super.configure_(e),this.setTypes(e.variableTypes,e.defaultType)}initModel(){var e=this.getSourceBlock();if(!e)throw new _t;this.variable||(e=i.getOrCreateVariablePackage$$module$build$src$core$variables(e.workspace,null,this.defaultVariableName,this.defaultType),this.doValueUpdate_(e.getId()))}shouldAddBorderRect_(){const e=this.getSourceBlock();if(!e)throw new _t;return super.shouldAddBorderRect_()&&(!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||e.type!=="variables_get")}fromXml(e){var t=this.getSourceBlock();if(!t)throw new _t;const o=e.getAttribute("id"),n=e.textContent,u=e.getAttribute("variabletype")||e.getAttribute("variableType")||"";if(t=i.getOrCreateVariablePackage$$module$build$src$core$variables(t.workspace,o,n,u),u!==null&&u!==t.type)throw Error("Serialized variable type with id '"+t.getId()+"' had type "+t.type+", and does not match variable field that references it: "+zs(e)+".");this.setValue(t.getId())}toXml(e){return this.initModel(),e.id=this.variable.getId(),e.textContent=this.variable.name,this.variable.type&&e.setAttribute("variabletype",this.variable.type),e}saveState(e){var t=this.saveLegacyState(Lr);return t!==null||(this.initModel(),t={id:this.variable.getId()},e&&(t.name=this.variable.name,t.type=this.variable.type)),t}loadState(e){const t=this.getSourceBlock();if(!t)throw new _t;this.loadLegacyState(Lr,e)||(e=i.getOrCreateVariablePackage$$module$build$src$core$variables(t.workspace,e.id||null,e.name,e.type||""),this.setValue(e.getId()))}setSourceBlock(e){if(e.isShadow())throw Error("Variable fields are not allowed to exist on shadow blocks.");super.setSourceBlock(e)}getValue(){return this.variable?this.variable.getId():null}getText(){return this.variable?this.variable.name:""}getVariable(){return this.variable}getValidator(){return this.variable?this.validator_:null}doClassValidation_(e){if(e===null)return null;var t=this.getSourceBlock();if(!t)throw new _t;return t=i.getVariable$$module$build$src$core$variables(t.workspace,e),t?(t=t.type,this.typeIsAllowed(t)?e:(console.warn("Variable type doesn't match this field! Type was "+t),null)):(console.warn("Variable id doesn't point to a real variable! ID was "+e),null)}doValueUpdate_(e){const t=this.getSourceBlock();if(!t)throw new _t;this.variable=i.getVariable$$module$build$src$core$variables(t.workspace,e),super.doValueUpdate_(e)}typeIsAllowed(e){const t=this.getVariableTypes();if(!t)return!0;for(let o=0;othis.max_&&(e.max=`${this.max_}`,xt(e,Et.VALUEMAX,this.max_)),e}static fromJson(e){return new this(e.value,void 0,void 0,void 0,void 0,e)}};Us("field_number",Rp),Rp.prototype.DEFAULT_VALUE=0;var ly=class extends _i{constructor(e,t,o){super(String(e??""),t,o),this.EDITABLE=!1,this.SERIALIZABLE=!0}static fromJson(e){return new this(bt(e.text),void 0,e)}};Us("field_label_serializable",ly);var Ti=class extends lt{constructor(e,t,o){super(lt.SKIP_SETUP),this.SERIALIZABLE=!0,this.CURSOR="default",this.value_=this.value_,this.checkChar=Ti.CHECK_CHAR,e!==lt.SKIP_SETUP&&(o&&this.configure_(o),this.setValue(e),t&&this.setValidator(t))}configure_(e){super.configure_(e),e.checkCharacter&&(this.checkChar=e.checkCharacter)}saveState(){const e=this.saveLegacyState(Ti);return e!==null?e:this.getValueBoolean()}initView(){super.initView();const e=this.getTextElement();Oe(e,"blocklyCheckbox"),e.style.display=this.value_?"block":"none"}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_(this.getConstants().FIELD_CHECKBOX_X_OFFSET)}getDisplayText_(){return this.checkChar}setCheckCharacter(e){this.checkChar=e||Ti.CHECK_CHAR,this.forceRerender()}showEditor_(){this.setValue(!this.value_)}doClassValidation_(e){return e===!0||e==="TRUE"?"TRUE":e===!1||e==="FALSE"?"FALSE":null}doValueUpdate_(e){this.value_=this.convertValueToBool(e),this.textElement_&&(this.textElement_.style.display=this.value_?"block":"none")}getValue(){return this.value_?"TRUE":"FALSE"}getValueBoolean(){return this.value_}getText(){return String(this.convertValueToBool(this.value_))}convertValueToBool(e){return typeof e=="string"?e==="TRUE":!!e}static fromJson(e){return new this(e.checked,void 0,e)}};Ti.CHECK_CHAR="✓",Us("field_checkbox",Ti),Ti.prototype.DEFAULT_VALUE=!1;var cy=class{constructor(e,t){this.draggable=e,this.workspace=t,this.dragTarget=null,this.startLoc=e.getRelativeToSurfaceXY()}onDragStart(e){this.draggable.startDrag(e)}onDrag(e,t){this.moveDraggable(e,t),t=this.getRoot(this.draggable),ds(t)&&t.setDeleteStyle(this.wouldDeleteDraggable(e,t)),this.updateDragTarget(e)}updateDragTarget(e){e=this.workspace.getDragTarget(e);const t=this.getRoot(this.draggable);if(this.dragTarget!==e){let o;(o=this.dragTarget)==null||o.onDragExit(t),e==null||e.onDragEnter(t)}e==null||e.onDragOver(t),this.dragTarget=e}moveDraggable(e,t){t=this.pixelsToWorkspaceUnits(t),t=ye.sum(this.startLoc,t),this.draggable.drag(t,e)}wouldDeleteDraggable(e,t){return(e=this.workspace.getDragTarget(e))&&this.workspace.getComponentManager().hasCapability(e.id,gt.Capability.DELETE_AREA)?e.wouldDelete(t):!1}onDragEnd(e){const t=i.getGroup$$module$build$src$core$events$utils();var o=this.workspace.getDragTarget(e);const n=this.getRoot(this.draggable);if(o){let u;(u=this.dragTarget)==null||u.onDrop(n)}this.shouldReturnToStart(e,n)&&this.draggable.revertDrag(),(o=ds(n)&&this.wouldDeleteDraggable(e,n))&&this.draggable instanceof $s&&Wa(this.draggable.getRootBlock()),this.draggable.endDrag(e),o&&ds(n)&&(e=i.getGroup$$module$build$src$core$events$utils(),i.setGroup$$module$build$src$core$events$utils(t),n.dispose(),i.setGroup$$module$build$src$core$events$utils(e))}getRoot(e){return e instanceof $s?e.getRootBlock():e}shouldReturnToStart(e,t){return(e=this.workspace.getDragTarget(e))?e.shouldPreventMove(t):!1}pixelsToWorkspaceUnits(e){return e=new ye(e.x/this.workspace.scale,e.y/this.workspace.scale),this.workspace.isMutator&&e.scale(1/this.workspace.options.parentWorkspace.scale),e}};r($e.BLOCK_DRAGGER,Ws,cy);var Pr={};Pr.BlockDragStrategy=Bv,Pr.BubbleDragStrategy=yv,Pr.CommentDragStrategy=gv,Pr.Dragger=cy;var Np=class extends Ss{constructor(e,t,o){super(e?e.workspace.id:void 0),this.type=ee.BLOCK_DRAG,e&&(this.blockId=e.id,this.isStart=t,this.blocks=o)}toJson(){const e=super.toJson();if(this.isStart===void 0)throw Error("Whether this event is the start of a drag is undefined. Either pass the value to the constructor, or call fromJson");if(this.blockId===void 0)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");return e.isStart=this.isStart,e.blockId=this.blockId,e.blocks=this.blocks,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Np),t.isStart=e.isStart,t.blockId=e.blockId,t.blocks=e.blocks,t}};r($e.EVENT,ee.BLOCK_DRAG,Np);var Mp=class extends gi{constructor(e,t,o,n){super(e),this.type=ee.BLOCK_FIELD_INTERMEDIATE_CHANGE,this.recordUndo=!1,e&&(this.name=t,this.oldValue=o,this.newValue=n)}toJson(){const e=super.toJson();if(!this.name)throw Error("The changed field name is undefined. Either pass a name to the constructor, or call fromJson.");return e.name=this.name,e.oldValue=this.oldValue,e.newValue=this.newValue,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Mp),t.name=e.name,t.oldValue=e.oldValue,t.newValue=e.newValue,t}isNull(){return this.oldValue===this.newValue}run(e){var t=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");if(t=t.getBlockById(this.blockId),!t)throw Error("The associated block is undefined. Either pass a block to the constructor, or call fromJson");e=e?this.newValue:this.oldValue,(t=t.getField(this.name))?t.setValue(e):console.warn("Can't set non-existent field: "+this.name)}};r($e.EVENT,ee.BLOCK_FIELD_INTERMEDIATE_CHANGE,Mp);var Lp=class extends gi{constructor(e){super(e),this.type=ee.BLOCK_MOVE,e&&(e.isShadow()&&(this.recordUndo=!1),e=this.currentLocation(),this.oldParentId=e.parentId,this.oldInputName=e.inputName,this.oldCoordinate=e.coordinate)}toJson(){const e=super.toJson();return e.oldParentId=this.oldParentId,e.oldInputName=this.oldInputName,this.oldCoordinate&&(e.oldCoordinate=`${Math.round(this.oldCoordinate.x)}, ${Math.round(this.oldCoordinate.y)}`),e.newParentId=this.newParentId,e.newInputName=this.newInputName,this.newCoordinate&&(e.newCoordinate=`${Math.round(this.newCoordinate.x)}, ${Math.round(this.newCoordinate.y)}`),this.reason&&(e.reason=this.reason),this.recordUndo||(e.recordUndo=this.recordUndo),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Lp),t.oldParentId=e.oldParentId,t.oldInputName=e.oldInputName,e.oldCoordinate&&(o=e.oldCoordinate.split(","),t.oldCoordinate=new ye(Number(o[0]),Number(o[1]))),t.newParentId=e.newParentId,t.newInputName=e.newInputName,e.newCoordinate&&(o=e.newCoordinate.split(","),t.newCoordinate=new ye(Number(o[0]),Number(o[1]))),e.reason!==void 0&&(t.reason=e.reason),e.recordUndo!==void 0&&(t.recordUndo=e.recordUndo),t}recordNew(){const e=this.currentLocation();this.newParentId=e.parentId,this.newInputName=e.inputName,this.newCoordinate=e.coordinate}setReason(e){this.reason=e}currentLocation(){var e=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");var t=e.getBlockById(this.blockId);if(!t)throw Error("The block associated with the block move event could not be found");e={};const o=t.getParent();return o?(e.parentId=o.id,(t=o.getInputWithBlock(t))&&(e.inputName=t.name)):e.coordinate=t.getRelativeToSurfaceXY(),e}isNull(){return this.oldParentId===this.newParentId&&this.oldInputName===this.newInputName&&ye.equals(this.oldCoordinate,this.newCoordinate)}run(e){var t=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");var o=t.getBlockById(this.blockId);if(o){var n=e?this.newParentId:this.oldParentId,u=e?this.newInputName:this.oldInputName;if(e=e?this.newCoordinate:this.oldCoordinate,n){var g=t.getBlockById(n);if(!g){console.warn("Can't connect to non-existent block: "+n);return}}if(o.getParent()&&o.unplug(),e)u=o.getRelativeToSurfaceXY(),o.moveBy(e.x-u.x,e.y-u.y,this.reason);else{t=o.outputConnection,(!t||o.previousConnection&&o.previousConnection.isConnected())&&(t=o.previousConnection);let I,L;o=(L=t)==null?void 0:L.type,u?(o=g.getInput(u))&&(I=o.connection):o===xe.PREVIOUS_STATEMENT&&(I=g.nextConnection),I&&t?t.connect(I):console.warn("Can't connect to non-existent input: "+u)}}else console.warn("Can't move non-existent block: "+this.blockId)}};r($e.EVENT,ee.BLOCK_MOVE,Lp);var Pp=class extends Ss{constructor(e,t,o){super(e?e.workspace.id:void 0),this.type=ee.BUBBLE_OPEN,e&&(this.blockId=e.id,this.isOpen=t,this.bubbleType=o)}toJson(){const e=super.toJson();if(this.isOpen===void 0)throw Error("Whether this event is for opening the bubble is undefined. Either pass the value to the constructor, or call fromJson");if(!this.bubbleType)throw Error("The type of bubble is undefined. Either pass the value to the constructor, or call fromJson");return e.isOpen=this.isOpen,e.bubbleType=this.bubbleType,e.blockId=this.blockId||"",e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Pp),t.isOpen=e.isOpen,t.bubbleType=e.bubbleType,t.blockId=e.blockId,t}},Bp;(function(e){e.MUTATOR="mutator",e.COMMENT="comment",e.WARNING="warning"})(Bp||(Bp={})),r($e.EVENT,ee.BUBBLE_OPEN,Pp);var qs=class extends qi{constructor(e){super(),this.isBlank=!e,e&&(this.commentId=e.id,this.workspaceId=e.workspace.id,this.group=i.getGroup$$module$build$src$core$events$utils(),this.recordUndo=G())}toJson(){const e=super.toJson();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");return e.commentId=this.commentId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new qs),t.commentId=e.commentId,t}static CommentCreateDeleteHelper(e,t){const o=e.getEventWorkspace_();if(t){if(!e.json)throw Error("Encountered a comment event without proper json");Kn(e.json,o)}else{if(!e.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");(t=o.getCommentById(e.commentId))?t.dispose():console.warn("Can't delete non-existent comment: "+e.commentId)}}},Fp=class extends qs{constructor(e,t,o){super(e),this.type=ee.COMMENT_CHANGE,e&&(this.oldContents_=typeof t>"u"?"":t,this.newContents_=typeof o>"u"?"":o)}toJson(){const e=super.toJson();if(!this.oldContents_)throw Error("The old contents is undefined. Either pass a value to the constructor, or call fromJson");if(!this.newContents_)throw Error("The new contents is undefined. Either pass a value to the constructor, or call fromJson");return e.oldContents=this.oldContents_,e.newContents=this.newContents_,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Fp),t.oldContents_=e.oldContents,t.newContents_=e.newContents,t}isNull(){return this.oldContents_===this.newContents_}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(t=t.getCommentById(this.commentId)){var o=e?this.newContents_:this.oldContents_;if(o===void 0)throw Error(e?"The new contents is undefined. Either pass a value to the constructor, or call fromJson":"The old contents is undefined. Either pass a value to the constructor, or call fromJson");t.setText(o)}else console.warn("Can't change non-existent comment: "+this.commentId)}};r($e.EVENT,ee.COMMENT_CHANGE,Fp);var jp=class extends qs{constructor(e,t){super(e),this.newCollapsed=t,this.type=ee.COMMENT_COLLAPSE}toJson(){const e=super.toJson();if(this.newCollapsed===void 0)throw Error("The new collapse value undefined. Either call recordNew, or call fromJson");return e.newCollapsed=this.newCollapsed,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new jp),t.newCollapsed=e.newCollapsed,t}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");(t=t.getCommentById(this.commentId))?t.setCollapsed(e?!!this.newCollapsed:!this.newCollapsed):console.warn("Can't collapse or uncollapse non-existent comment: "+this.commentId)}};r($e.EVENT,ee.COMMENT_COLLAPSE,jp);var zp=class extends qs{constructor(e){super(e),this.type=ee.COMMENT_CREATE,e&&(this.xml=ir(e),this.json=Pi(e,{addCoordinates:!0}))}toJson(){const e=super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.json)throw Error("The comment JSON is undefined. Either pass a block to the constructor, or call fromJson");return e.xml=zs(this.xml),e.json=this.json,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new zp),t.xml=i.textToDom$$module$build$src$core$utils$xml(e.xml),t.json=e.json,t}run(e){qs.CommentCreateDeleteHelper(this,e)}};r($e.EVENT,ee.COMMENT_CREATE,zp);var Up=class extends qs{constructor(e){super(e),this.type=ee.COMMENT_DELETE,e&&(this.xml=ir(e),this.json=Pi(e,{addCoordinates:!0}))}run(e){qs.CommentCreateDeleteHelper(this,!e)}toJson(){const e=super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.json)throw Error("The comment JSON is undefined. Either pass a block to the constructor, or call fromJson");return e.xml=zs(this.xml),e.json=this.json,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Up),t.xml=i.textToDom$$module$build$src$core$utils$xml(e.xml),t.json=e.json,t}};r($e.EVENT,ee.COMMENT_DELETE,Up);var Hp=class extends Ss{constructor(e,t){super(e?e.workspace.id:void 0),this.type=ee.COMMENT_DRAG,e&&(this.commentId=e.id,this.isStart=t)}toJson(){const e=super.toJson();if(this.isStart===void 0)throw Error("Whether this event is the start of a drag is undefined. Either pass the value to the constructor, or call fromJson");if(this.commentId===void 0)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");return e.isStart=this.isStart,e.commentId=this.commentId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Hp),t.isStart=e.isStart,t.commentId=e.commentId,t}};r($e.EVENT,ee.COMMENT_DRAG,Hp);var Wp=class extends qs{constructor(e){super(e),this.type=ee.COMMENT_MOVE,e&&(this.comment_=e,this.oldCoordinate_=e.getRelativeToSurfaceXY())}recordNew(){if(this.newCoordinate_)throw Error("Tried to record the new position of a comment on the same event twice.");if(!this.comment_)throw Error("The comment is undefined. Pass a comment to the constructor if you want to use the record functionality");this.newCoordinate_=this.comment_.getRelativeToSurfaceXY()}setReason(e){this.reason=e}setOldCoordinate(e){this.oldCoordinate_=e}toJson(){const e=super.toJson();if(!this.oldCoordinate_)throw Error("The old comment position is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.newCoordinate_)throw Error("The new comment position is undefined. Either call recordNew, or call fromJson");return e.oldCoordinate=`${Math.round(this.oldCoordinate_.x)}, ${Math.round(this.oldCoordinate_.y)}`,e.newCoordinate=Math.round(this.newCoordinate_.x)+","+Math.round(this.newCoordinate_.y),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Wp),o=e.oldCoordinate.split(","),t.oldCoordinate_=new ye(Number(o[0]),Number(o[1])),o=e.newCoordinate.split(","),t.newCoordinate_=new ye(Number(o[0]),Number(o[1])),t}isNull(){return ye.equals(this.oldCoordinate_,this.newCoordinate_)}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(t=t.getCommentById(this.commentId)){if(e=e?this.newCoordinate_:this.oldCoordinate_,!e)throw Error("Either oldCoordinate_ or newCoordinate_ is undefined. Either pass a comment to the constructor and call recordNew, or call fromJson");t.moveTo(e)}else console.warn("Can't move non-existent comment: "+this.commentId)}};r($e.EVENT,ee.COMMENT_MOVE,Wp);var Gp=class extends qs{constructor(e){super(e),this.type=ee.COMMENT_RESIZE,e&&(this.oldSize=e.getSize())}recordCurrentSizeAsNewSize(){if(this.newSize)throw Error("Tried to record the new size of a comment on the same event twice.");var e=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(e=e.getCommentById(this.commentId),!e)throw Error("The comment associated with the comment resize event could not be found");this.newSize=e.getSize()}toJson(){const e=super.toJson();if(!this.oldSize)throw Error("The old comment size is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.newSize)throw Error("The new comment size is undefined. Either call recordCurrentSizeAsNewSize, or call fromJson");return e.oldWidth=Math.round(this.oldSize.width),e.oldHeight=Math.round(this.oldSize.height),e.newWidth=Math.round(this.newSize.width),e.newHeight=Math.round(this.newSize.height),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Gp),t.oldSize=new Xe(e.oldWidth,e.oldHeight),t.newSize=new Xe(e.newWidth,e.newHeight),t}isNull(){return Xe.equals(this.oldSize,this.newSize)}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(t=t.getCommentById(this.commentId)){if(e=e?this.newSize:this.oldSize,!e)throw Error("Either oldSize or newSize is undefined. Either pass a comment to the constructor and call recordCurrentSizeAsNewSize, or call fromJson");t.setSize(e)}else console.warn("Can't resize non-existent comment: "+this.commentId)}};r($e.EVENT,ee.COMMENT_RESIZE,Gp);var Vp=class extends Ss{constructor(e,t,o){super(o),this.type=ee.TOOLBOX_ITEM_SELECT,this.oldItem=e??void 0,this.newItem=t??void 0}toJson(){const e=super.toJson();return e.oldItem=this.oldItem,e.newItem=this.newItem,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Vp),t.oldItem=e.oldItem,t.newItem=e.newItem,t}};r($e.EVENT,ee.TOOLBOX_ITEM_SELECT,Vp);var uy=class extends qi{constructor(e){super(),this.isBlank=!0,this.recordUndo=!1,this.type=ee.FINISHED_LOADING,this.isBlank=!!e,e&&(this.workspaceId=e.id)}};r($e.EVENT,ee.FINISHED_LOADING,uy);var dy,hy,py,gy,my,fy,$y,by,vy,yy,_y,wy,ky,Cy,Ty,Sy,Ey,Iy,xy,Dy,Ay,Oy,Ry,Ny,My,Se;i.BLOCK_CHANGE$$module$build$src$core$events$events=ee.BLOCK_CHANGE,i.BLOCK_CREATE$$module$build$src$core$events$events=ee.BLOCK_CREATE,i.BLOCK_DELETE$$module$build$src$core$events$events=ee.BLOCK_DELETE,dy=ee.BLOCK_DRAG,i.BLOCK_MOVE$$module$build$src$core$events$events=ee.BLOCK_MOVE,hy=ee.BLOCK_FIELD_INTERMEDIATE_CHANGE,py=ee.BUBBLE_OPEN,gy=ee.BLOCK_CHANGE,my=ee.CLICK,fy=ee.COMMENT_CHANGE,$y=ee.COMMENT_CREATE,by=ee.COMMENT_DELETE,vy=ee.COMMENT_MOVE,yy=ee.COMMENT_RESIZE,_y=ee.COMMENT_DRAG,wy=ee.BLOCK_CREATE,ky=ee.BLOCK_DELETE,Cy=ee.FINISHED_LOADING,Ty=ee.MARKER_MOVE,Sy=ee.BLOCK_MOVE,Ey=ee.SELECTED,Iy=ee.THEME_CHANGE,xy=ee.TOOLBOX_ITEM_SELECT,Dy=ee.TRASHCAN_OPEN,Ay=ee.UI,Oy=ee.VAR_CREATE,Ry=ee.VAR_DELETE,Ny=ee.VAR_RENAME,My=ee.VIEWPORT_CHANGE,Se={},Se.Abstract=qi,Se.BLOCK_CHANGE=i.BLOCK_CHANGE$$module$build$src$core$events$events,Se.BLOCK_CREATE=i.BLOCK_CREATE$$module$build$src$core$events$events,Se.BLOCK_DELETE=i.BLOCK_DELETE$$module$build$src$core$events$events,Se.BLOCK_DRAG=dy,Se.BLOCK_FIELD_INTERMEDIATE_CHANGE=hy,Se.BLOCK_MOVE=i.BLOCK_MOVE$$module$build$src$core$events$events,Se.BUBBLE_OPEN=py,Se.BUMP_EVENTS=db,Se.BlockBase=gi,Se.BlockChange=mi,Se.BlockCreate=Qh,Se.BlockDelete=hp,Se.BlockDrag=Np,Se.BlockFieldIntermediateChange=Mp,Se.BlockMove=Lp,Se.BubbleOpen=Pp,Se.BubbleType=Bp,Se.CHANGE=gy,Se.CLICK=my,Se.COMMENT_CHANGE=fy,Se.COMMENT_CREATE=$y,Se.COMMENT_DELETE=by,Se.COMMENT_DRAG=_y,Se.COMMENT_MOVE=vy,Se.COMMENT_RESIZE=yy,Se.CREATE=wy,Se.Click=bh,Se.ClickTarget=vh,Se.CommentBase=qs,Se.CommentChange=Fp,Se.CommentCollapse=jp,Se.CommentCreate=zp,Se.CommentDelete=Up,Se.CommentDrag=Hp,Se.CommentMove=Wp,Se.CommentResize=Gp,Se.DELETE=ky,Se.FINISHED_LOADING=Cy,Se.FinishedLoading=uy,Se.MARKER_MOVE=Ty,Se.MOVE=Sy,Se.MarkerMove=pp,Se.SELECTED=Ey,Se.Selected=_p,Se.THEME_CHANGE=Iy,Se.TOOLBOX_ITEM_SELECT=xy,Se.TRASHCAN_OPEN=Dy,Se.ThemeChange=ep,Se.ToolboxItemSelect=Vp,Se.TrashcanOpen=kp,Se.UI=Ay,Se.UiBase=Ss,Se.VAR_CREATE=Oy,Se.VAR_DELETE=Ry,Se.VAR_RENAME=Ny,Se.VIEWPORT_CHANGE=My,Se.VarBase=br,Se.VarCreate=Fh,Se.VarDelete=bp,Se.VarRename=vp,Se.ViewportChange=tp,Se.clearPendingUndo=K,Se.disable=i.disable$$module$build$src$core$events$utils,Se.disableOrphans=me,Se.enable=i.enable$$module$build$src$core$events$utils,Se.filter=R,Se.fire=z,Se.fromJson=ce,Se.get=ne,Se.getDescendantIds=ve,Se.getGroup=i.getGroup$$module$build$src$core$events$utils,Se.getRecordUndo=G,Se.isEnabled=C,Se.setGroup=i.setGroup$$module$build$src$core$events$utils,Se.setRecordUndo=i.setRecordUndo$$module$build$src$core$events$utils;var Os={};Os.BottomRow=Xv,Os.ConstantProvider=Jv,Os.Drawer=qv,Os.MarkerSvg=ty,Os.PathObject=sy,Os.RenderInfo=ey,Os.Renderer=Ap,Os.RightConnectionShape=Zv,Os.StatementInput=Yl,Os.TopRow=Qv,gh();var It={};It.registerCleanup=Zd,It.registerCollapse=eh,It.registerCollapseExpandBlock=ah,It.registerComment=nh,It.registerCommentCreate=ph,It.registerCommentDelete=dh,It.registerCommentDuplicate=hh,It.registerCommentOptions=nb,It.registerDefaultOptions=gh,It.registerDelete=ch,It.registerDeleteAll=oh,It.registerDisable=lh,It.registerDuplicate=ih,It.registerExpand=th,It.registerHelp=uh,It.registerInline=rh,It.registerRedo=Xd,It.registerUndo=qd;var ql={};ql.CommentView=fv,ql.RenderedWorkspaceComment=Il,ql.WorkspaceComment=El;var Br={};Br.Bubble=nt,Br.MiniWorkspaceBubble=vo,Br.TextBubble=Sv,Br.TextInputBubble=_v;var Ly=class extends Pl{constructor(){super(),this.FIELD_TEXT_BASELINE_CENTER=!1,this.DARK_PATH_OFFSET=1,this.MAX_BOTTOM_WIDTH=30,this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT/2}getCSS_(e){return super.getCSS_(e).concat([`${e} .blocklyInsertionMarker>.blocklyPathLight,`,`${e} .blocklyInsertionMarker>.blocklyPathDark {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"])}},Py=class{constructor(e){this.inlineSteps_=this.steps_="",this.info_=e,this.RTL_=this.info_.RTL,e=e.getRenderer(),this.constants_=e.getConstants(),this.highlightConstants_=e.getHighlightConstants(),this.highlightOffset=this.highlightConstants_.OFFSET,this.outsideCornerPaths_=this.highlightConstants_.OUTSIDE_CORNER,this.insideCornerPaths_=this.highlightConstants_.INSIDE_CORNER,this.puzzleTabPaths_=this.highlightConstants_.PUZZLE_TAB,this.notchPaths_=this.highlightConstants_.NOTCH,this.startPaths_=this.highlightConstants_.START_HAT,this.jaggedTeethPaths_=this.highlightConstants_.JAGGED_TEETH}getPath(){return this.steps_+` -`+this.inlineSteps_}drawTopCorner(e){this.steps_+=pt(e.xPos,this.info_.startY);for(let t=0,o;o=e.elements[t];t++)F.isLeftSquareCorner(o)?this.steps_+=this.highlightConstants_.START_POINT:F.isLeftRoundedCorner(o)?this.steps_+=this.outsideCornerPaths_.topLeft(this.RTL_):F.isPreviousConnection(o)?this.steps_+=this.notchPaths_.pathLeft:F.isHat(o)?this.steps_+=this.startPaths_.path(this.RTL_):F.isSpacer(o)&&o.width!==0&&(this.steps_+=De("H",o.xPos+o.width-this.highlightOffset));this.steps_+=De("H",e.xPos+e.width-this.highlightOffset)}drawJaggedEdge_(e){this.info_.RTL&&(this.steps_+=this.jaggedTeethPaths_.pathLeft+De("v",e.height-this.jaggedTeethPaths_.height-this.highlightOffset))}drawValueInput(e){const t=e.getLastInput();if(this.RTL_){const o=e.height-t.connectionHeight;this.steps_+=St(t.xPos+t.width-this.highlightOffset,e.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)+De("v",o)}else this.steps_+=St(t.xPos+t.width,e.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)}drawStatementInput(e){const t=e.getLastInput();if(t)if(this.RTL_){const o=e.height-2*this.insideCornerPaths_.height;this.steps_+=St(t.xPos,e.yPos)+this.insideCornerPaths_.pathTop(this.RTL_)+De("v",o)+this.insideCornerPaths_.pathBottom(this.RTL_)+Hs(e.width-t.xPos-this.insideCornerPaths_.width,0)}else this.steps_+=St(t.xPos,e.yPos+e.height)+this.insideCornerPaths_.pathBottom(this.RTL_)+Hs(e.width-t.xPos-this.insideCornerPaths_.width,0)}drawRightSideRow(e){const t=e.xPos+e.width-this.highlightOffset;e instanceof up&&e.followsStatement&&(this.steps_+=De("H",t)),this.RTL_&&(this.steps_+=De("H",t),e.height>this.highlightOffset&&(this.steps_+=De("V",e.yPos+e.height-this.highlightOffset)))}drawBottomRow(e){if(this.RTL_)this.steps_+=De("V",e.baseline-this.highlightOffset);else{const t=this.info_.bottomRow.elements[0];F.isLeftSquareCorner(t)?this.steps_+=St(e.xPos+this.highlightOffset,e.baseline-this.highlightOffset):F.isLeftRoundedCorner(t)&&(this.steps_+=St(e.xPos,e.baseline),this.steps_+=this.outsideCornerPaths_.bottomLeft())}}drawLeft(){var e=this.info_.outputConnection;e&&(e=e.connectionOffsetY+e.height,this.RTL_?this.steps_+=St(this.info_.startX,e):(this.steps_+=St(this.info_.startX+this.highlightOffset,this.info_.bottomRow.baseline-this.highlightOffset),this.steps_+=De("V",e)),this.steps_+=this.puzzleTabPaths_.pathUp(this.RTL_)),this.RTL_||(e=this.info_.topRow,F.isLeftRoundedCorner(e.elements[0])?this.steps_+=De("V",this.outsideCornerPaths_.height):this.steps_+=De("V",e.capline+this.highlightOffset))}drawInlineInput(e){const t=this.highlightOffset,o=e.xPos+e.connectionWidth;var n=e.centerline-e.height/2;const u=e.width-e.connectionWidth,g=n+t;this.RTL_?(n=e.connectionOffsetY-t,e=e.height-(e.connectionOffsetY+e.connectionHeight)+t,this.inlineSteps_+=St(o-t,g)+De("v",n)+this.puzzleTabPaths_.pathDown(this.RTL_)+De("v",e)+De("h",u)):this.inlineSteps_+=St(e.xPos+e.width+t,g)+De("v",e.height)+De("h",-u)+St(o,n+e.connectionOffsetY)+this.puzzleTabPaths_.pathDown(this.RTL_)}},By=class extends Bl{constructor(e,t){super(e,t),this.highlighter_=new Py(t)}draw(){this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights();const e=this.block_.pathObject;e.setPath(this.outlinePath_+` -`+this.inlinePath_),e.setHighlightPath(this.highlighter_.getPath()),this.info_.RTL&&e.flipRTL(),this.recordSizeOnBlock_()}drawTop_(){this.highlighter_.drawTopCorner(this.info_.topRow),this.highlighter_.drawRightSideRow(this.info_.topRow),super.drawTop_()}drawJaggedEdge_(e){this.highlighter_.drawJaggedEdge_(e),super.drawJaggedEdge_(e)}drawValueInput_(e){this.highlighter_.drawValueInput(e),super.drawValueInput_(e)}drawStatementInput_(e){this.highlighter_.drawStatementInput(e),super.drawStatementInput_(e)}drawRightSideRow_(e){this.highlighter_.drawRightSideRow(e),this.outlinePath_+=De("H",e.xPos+e.width)+De("V",e.yPos+e.height)}drawBottom_(){this.highlighter_.drawBottomRow(this.info_.bottomRow),super.drawBottom_()}drawLeft_(){this.highlighter_.drawLeft(),super.drawLeft_()}drawInlineInput_(e){this.highlighter_.drawInlineInput(e),super.drawInlineInput_(e)}positionInlineInputConnection_(e){const t=e.centerline-e.height/2;if(e.connectionModel){let o=e.xPos+e.connectionWidth+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(o*=-1),e.connectionModel.setOffsetInBlock(o,t+e.connectionOffsetY+this.constants_.DARK_PATH_OFFSET)}}positionStatementInputConnection_(e){const t=e.getLastInput();if(t!=null&&t.connectionModel){let o=e.xPos+e.statementEdge+t.notchOffset;o=this.info_.RTL?-1*o:o+this.constants_.DARK_PATH_OFFSET,t.connectionModel.setOffsetInBlock(o,e.yPos+this.constants_.DARK_PATH_OFFSET)}}positionExternalValueConnection_(e){const t=e.getLastInput();if(t&&t.connectionModel){let o=e.xPos+e.width+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(o*=-1),t.connectionModel.setOffsetInBlock(o,e.yPos)}}positionNextConnection_(){const e=this.info_.bottomRow;if(e.connection){const t=e.connection,o=t.xPos;t.connectionModel.setOffsetInBlock((this.info_.RTL?-o:o)+this.constants_.DARK_PATH_OFFSET/2,e.baseline+this.constants_.DARK_PATH_OFFSET)}}},Fy=class{constructor(e){this.OFFSET=.5,this.constantProvider=e,this.START_POINT=pt(this.OFFSET,this.OFFSET)}init(){this.INSIDE_CORNER=this.makeInsideCorner(),this.OUTSIDE_CORNER=this.makeOutsideCorner(),this.PUZZLE_TAB=this.makePuzzleTab(),this.NOTCH=this.makeNotch(),this.JAGGED_TEETH=this.makeJaggedTeeth(),this.START_HAT=this.makeStartHat()}makeInsideCorner(){const e=this.constantProvider.CORNER_RADIUS,t=this.OFFSET,o=(1-Math.SQRT1_2)*(e+t)-t,n=pt(o,o)+vt("a","0 0,0",e,Me(-o-t,e-o)),u=vt("a","0 0,0",e+t,Me(e+t,e+t)),g=pt(o,-o)+vt("a","0 0,0",e+t,Me(e-o,o+t));return{width:e+t,height:e,pathTop(I){return I?n:""},pathBottom(I){return I?u:g}}}makeOutsideCorner(){const e=this.constantProvider.CORNER_RADIUS,t=this.OFFSET,o=(1-Math.SQRT1_2)*(e-t)+t,n=pt(o,o)+vt("a","0 0,1",e-t,Me(e-o,-o+t)),u=pt(t,e)+vt("a","0 0,1",e-t,Me(e,-e+t)),g=-o,I=pt(o,g)+vt("a","0 0,1",e-t,Me(-o+t,-g-e));return{height:e,topLeft(L){return L?n:u},bottomLeft(){return I}}}makePuzzleTab(){const e=this.constantProvider.TAB_WIDTH,t=this.constantProvider.TAB_HEIGHT,o=pt(-2,-t+3.4)+Hs(-.45*e,-2.1),n=De("v",2.5)+pt(.97*-e,2.5)+Xt("q",[Me(.05*-e,10),Me(.3*e,9.5)])+pt(.67*e,-1.9)+De("v",2.5),u=De("v",-1.5)+pt(-.92*e,-.5)+Xt("q",[Me(-.19*e,-5.5),Me(0,-11)])+pt(.92*e,1),g=pt(-5,t-.7)+Hs(.46*e,-2.1);return{width:e,height:t,pathUp(I){return I?o:u},pathDown(I){return I?n:g}}}makeNotch(){return{pathLeft:De("h",this.OFFSET)+this.constantProvider.NOTCH.pathLeft}}makeJaggedTeeth(){return{pathLeft:Hs(5.1,2.6)+pt(-10.2,6.8)+Hs(5.1,2.6),height:12,width:10.2}}makeStartHat(){const e=this.constantProvider.START_HAT.height,t=pt(25,-8.7)+Xt("c",[Me(29.7,-6.2),Me(57.2,-.5),Me(75,8.7)]),o=Xt("c",[Me(17.8,-9.2),Me(45.3,-14.9),Me(75,-8.7)])+St(100.5,e+.5);return{path(n){return n?t:o}}}},jy=class extends lp{constructor(e,t){super(e,t),this.constants_=e,this.connectedBlock&&(this.width+=this.constants_.DARK_PATH_OFFSET,this.height+=this.constants_.DARK_PATH_OFFSET)}},zy=class extends xr{constructor(e,t){super(e,t),this.constants_=e,this.connectedBlock&&(this.height+=this.constants_.DARK_PATH_OFFSET)}},Uy=class extends Or{constructor(e,t){super(e,t),this.renderer_=e}getRenderer(){return this.renderer_}populateBottomRow_(){super.populateBottomRow_(),this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1]instanceof ls||(this.bottomRow.minHeight=this.constants_.MEDIUM_PADDING-this.constants_.DARK_PATH_OFFSET)}addInput_(e,t){this.isInline&&e instanceof i.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new jy(this.constants_,e)),t.hasInlineInput=!0):e instanceof ls?(t.elements.push(new zy(this.constants_,e)),t.hasStatement=!0):e instanceof i.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new Ll(this.constants_,e)),t.hasExternalInput=!0):(e instanceof Ks||e instanceof Co)&&(t.minHeight=Math.max(t.minHeight,this.constants_.DUMMY_INPUT_MIN_HEIGHT),t.hasDummyInput=!0),this.isInline||t.align!==null||(t.align=e.align)}addElemSpacing_(){let e=!1;for(let o=0,n;n=this.rows[o];o++)n.hasExternalInput&&(e=!0);for(let o=0,n;n=this.rows[o];o++){var t=n.elements;if(n.elements=[],n.startsWithElemSpacer()&&n.elements.push(new as(this.constants_,this.getInRowSpacing_(null,t[0]))),t.length){for(let u=0;u{this.targetWorkspace.isDragging()||t.addSelect()})),this.listeners.push(ue(e,"pointerleave",t,()=>{this.targetWorkspace.isDragging()||t.removeSelect()})),this.listeners.push(ue(o,"pointerenter",t,()=>{this.targetWorkspace.isDragging()||t.addSelect()})),this.listeners.push(ue(o,"pointerleave",t,()=>{this.targetWorkspace.isDragging()||t.removeSelect()}))}blockMouseDown(e){return t=>{const o=this.targetWorkspace.getGesture(t);o&&(o.setStartBlock(e),o.handleFlyoutStart(t,this))}}onMouseDown(e){const t=this.targetWorkspace.getGesture(e);t&&t.handleFlyoutStart(e,this)}isBlockCreatable(e){return e.isEnabled()}createBlock(e){let t=null;i.disable$$module$build$src$core$events$utils();var o=this.targetWorkspace.getAllVariables();this.targetWorkspace.setResizesEnabled(!1);try{t=this.placeNewBlock(e)}finally{i.enable$$module$build$src$core$events$utils()}if(this.targetWorkspace.hideChaff(),e=qn(this.targetWorkspace,o),C()){for(i.setGroup$$module$build$src$core$events$utils(!0),o=0;o-t||e<-180+t||e>180-t}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const e=this.svgGroup_.getBoundingClientRect(),t=e.left;return this.toolboxPosition_===Ge.LEFT?new rt(-1e9,1e9,-1e9,t+e.width):new rt(-1e9,1e9,t,1e9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let e=0;var t=this.workspace_.getTopBlocks(!1);for(let n=0,u;u=t[n];n++){var o=u.getHeightWidth().width;u.outputConnection&&(o-=this.tabWidth_),e=Math.max(e,o)}for(let n=0,u;u=this.buttons_[n];n++)e=Math.max(e,u.width);if(e+=1.5*this.MARGIN+this.tabWidth_,e*=this.workspace_.scale,e+=yt.scrollbarThickness,this.width_!==e){for(let n=0,u;u=t[n];n++){if(this.RTL){o=u.getRelativeToSurfaceXY().x;let g=e/this.workspace_.scale-this.MARGIN;u.outputConnection||(g-=this.tabWidth_),u.moveBy(g-o,0)}this.rectMap_.has(u)&&this.moveRectToBlock_(this.rectMap_.get(u),u)}if(this.RTL)for(let n=0,u;u=this.buttons_[n];n++)t=u.getPosition().y,u.moveTo(e/this.workspace_.scale-u.width-this.MARGIN-this.tabWidth_,t);this.targetWorkspace.scrollbar||this.autoClose||this.targetWorkspace.getFlyout()!==this||this.toolboxPosition_!==Ge.LEFT||this.targetWorkspace.translate(this.targetWorkspace.scrollX+e,this.targetWorkspace.scrollY),this.width_=e,this.position(),this.targetWorkspace.resizeContents(),this.targetWorkspace.recordDragTargets()}}};Op.registryName="verticalFlyout",r($e.FLYOUTS_VERTICAL_TOOLBOX,Ws,Op);var cy=class extends Jl{constructor(e){super(e),this.horizontalLayout=!0}setMetrics_(e){if(this.isVisible()){var t=this.workspace_.getMetricsManager(),o=t.getScrollMetrics(),n=t.getViewMetrics();t=t.getAbsoluteMetrics(),typeof e.x=="number"&&(this.workspace_.scrollX=-(o.left+(o.width-n.width)*e.x)),this.workspace_.translate(this.workspace_.scrollX+t.left,this.workspace_.scrollY+t.top)}}getX(){return 0}getY(){if(!this.isVisible())return 0;var e=this.targetWorkspace.getMetricsManager();const t=e.getAbsoluteMetrics(),o=e.getViewMetrics();e=e.getToolboxMetrics();const n=this.toolboxPosition_===Ge.TOP;return this.targetWorkspace.toolboxPosition===this.toolboxPosition_?this.targetWorkspace.getToolbox()?n?e.height:o.height-this.height_:n?0:o.height:n?0:o.height+t.top-this.height_}position(){if(this.isVisible()&&this.targetWorkspace.isVisible()){var e=this.targetWorkspace.getMetricsManager().getViewMetrics();this.width_=e.width,this.setBackgroundPath(e.width-2*this.CORNER_RADIUS,this.height_-this.CORNER_RADIUS),e=this.getX();var t=this.getY();this.positionAt_(this.width_,this.height_,e,t)}}setBackgroundPath(e,t){const o=this.toolboxPosition_===Ge.TOP,n=["M 0,"+(o?0:this.CORNER_RADIUS)];o?(n.push("h",e+2*this.CORNER_RADIUS),n.push("v",t),n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,-this.CORNER_RADIUS,this.CORNER_RADIUS),n.push("h",-e),n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,-this.CORNER_RADIUS,-this.CORNER_RADIUS)):(n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,this.CORNER_RADIUS,-this.CORNER_RADIUS),n.push("h",e),n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,this.CORNER_RADIUS,this.CORNER_RADIUS),n.push("v",t),n.push("h",-e-2*this.CORNER_RADIUS)),n.push("z"),this.svgBackground_.setAttribute("d",n.join(" "))}scrollToStart(){let e;(e=this.workspace_.scrollbar)==null||e.setX(this.RTL?1/0:0)}wheel_(e){var t=Le(e);if(t=t.x||t.y){const o=this.workspace_.getMetricsManager(),n=o.getScrollMetrics();t=o.getViewMetrics().left-n.left+t;let u;(u=this.workspace_.scrollbar)==null||u.setX(t),tr(this.workspace_),js()}e.preventDefault(),e.stopPropagation()}layout_(e,t){this.workspace_.scale=this.targetWorkspace.scale;const o=this.MARGIN;let n=o+this.tabWidth_;this.RTL&&(e=e.reverse());for(let L=0,le;le=e[L];L++)if(le.type==="block"){var u=le.block;if(u==null)continue;var g=u.getDescendants(!1);for(let dt=0,ut;ut=g[dt];dt++)ut.isInFlyout=!0;g=u.getSvgRoot();const Ee=u.getHeightWidth();var I=u.outputConnection?this.tabWidth_:0;I=this.RTL?n+Ee.width:n-I,u.moveBy(I,o),I=this.createRect_(u,I,o,Ee,L),n+=Ee.width+t[L],this.addBlockListeners_(g,u,I)}else le.type==="button"&&(u=le.button,this.initFlyoutButton_(u,n,o),n+=u.width+t[L])}isDragTowardWorkspace(e){e=Math.atan2(e.y,e.x)/Math.PI*180;const t=this.dragAngleRange_;return e<90+t&&e>90-t||e>-90-t&&e<-90+t}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const e=this.svgGroup_.getBoundingClientRect(),t=e.top;return this.toolboxPosition_===Ge.TOP?new rt(-1e9,t+e.height,-1e9,1e9):new rt(t,1e9,-1e9,1e9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let e=0;const t=this.workspace_.getTopBlocks(!1);for(let n=0,u;u=t[n];n++)e=Math.max(e,u.getHeightWidth().height);const o=this.buttons_;for(let n=0,u;u=o[n];n++)e=Math.max(e,u.height);if(e+=1.5*this.MARGIN,e*=this.workspace_.scale,e+=yt.scrollbarThickness,this.height_!==e){for(let n=0,u;u=t[n];n++)this.rectMap_.has(u)&&this.moveRectToBlock_(this.rectMap_.get(u),u);this.targetWorkspace.scrollbar||this.autoClose||this.targetWorkspace.getFlyout()!==this||this.toolboxPosition_!==Ge.TOP||this.targetWorkspace.translate(this.targetWorkspace.scrollX,this.targetWorkspace.scrollY+e),this.height_=e,this.position(),this.targetWorkspace.resizeContents(),this.targetWorkspace.recordDragTargets()}}};r($e.FLYOUTS_HORIZONTAL_TOOLBOX,Ws,cy);var Lr=class extends Qt{constructor(e,t,o,n,u){super(lt.SKIP_SETUP),this.defaultType="",this.variableTypes=[],this.variable=null,this.SERIALIZABLE=!0,this.menuGenerator_=Lr.dropdownCreate,this.defaultVariableName=typeof e=="string"?e:"",this.size_=new Xe(0,0),e!==lt.SKIP_SETUP&&(u?this.configure_(u):this.setTypes(o,n),t&&this.setValidator(t))}configure_(e){super.configure_(e),this.setTypes(e.variableTypes,e.defaultType)}initModel(){var e=this.getSourceBlock();if(!e)throw new _t;this.variable||(e=i.getOrCreateVariablePackage$$module$build$src$core$variables(e.workspace,null,this.defaultVariableName,this.defaultType),this.doValueUpdate_(e.getId()))}shouldAddBorderRect_(){const e=this.getSourceBlock();if(!e)throw new _t;return super.shouldAddBorderRect_()&&(!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||e.type!=="variables_get")}fromXml(e){var t=this.getSourceBlock();if(!t)throw new _t;const o=e.getAttribute("id"),n=e.textContent,u=e.getAttribute("variabletype")||e.getAttribute("variableType")||"";if(t=i.getOrCreateVariablePackage$$module$build$src$core$variables(t.workspace,o,n,u),u!==null&&u!==t.type)throw Error("Serialized variable type with id '"+t.getId()+"' had type "+t.type+", and does not match variable field that references it: "+zs(e)+".");this.setValue(t.getId())}toXml(e){return this.initModel(),e.id=this.variable.getId(),e.textContent=this.variable.name,this.variable.type&&e.setAttribute("variabletype",this.variable.type),e}saveState(e){var t=this.saveLegacyState(Lr);return t!==null||(this.initModel(),t={id:this.variable.getId()},e&&(t.name=this.variable.name,t.type=this.variable.type)),t}loadState(e){const t=this.getSourceBlock();if(!t)throw new _t;this.loadLegacyState(Lr,e)||(e=i.getOrCreateVariablePackage$$module$build$src$core$variables(t.workspace,e.id||null,e.name,e.type||""),this.setValue(e.getId()))}setSourceBlock(e){if(e.isShadow())throw Error("Variable fields are not allowed to exist on shadow blocks.");super.setSourceBlock(e)}getValue(){return this.variable?this.variable.getId():null}getText(){return this.variable?this.variable.name:""}getVariable(){return this.variable}getValidator(){return this.variable?this.validator_:null}doClassValidation_(e){if(e===null)return null;var t=this.getSourceBlock();if(!t)throw new _t;return t=i.getVariable$$module$build$src$core$variables(t.workspace,e),t?(t=t.type,this.typeIsAllowed(t)?e:(console.warn("Variable type doesn't match this field! Type was "+t),null)):(console.warn("Variable id doesn't point to a real variable! ID was "+e),null)}doValueUpdate_(e){const t=this.getSourceBlock();if(!t)throw new _t;this.variable=i.getVariable$$module$build$src$core$variables(t.workspace,e),super.doValueUpdate_(e)}typeIsAllowed(e){const t=this.getVariableTypes();if(!t)return!0;for(let o=0;othis.max_&&(e.max=`${this.max_}`,xt(e,Et.VALUEMAX,this.max_)),e}static fromJson(e){return new this(e.value,void 0,void 0,void 0,void 0,e)}};Us("field_number",Rp),Rp.prototype.DEFAULT_VALUE=0;var uy=class extends _i{constructor(e,t,o){super(String(e??""),t,o),this.EDITABLE=!1,this.SERIALIZABLE=!0}static fromJson(e){return new this(bt(e.text),void 0,e)}};Us("field_label_serializable",uy);var Ti=class extends lt{constructor(e,t,o){super(lt.SKIP_SETUP),this.SERIALIZABLE=!0,this.CURSOR="default",this.value_=this.value_,this.checkChar=Ti.CHECK_CHAR,e!==lt.SKIP_SETUP&&(o&&this.configure_(o),this.setValue(e),t&&this.setValidator(t))}configure_(e){super.configure_(e),e.checkCharacter&&(this.checkChar=e.checkCharacter)}saveState(){const e=this.saveLegacyState(Ti);return e!==null?e:this.getValueBoolean()}initView(){super.initView();const e=this.getTextElement();Oe(e,"blocklyCheckbox"),e.style.display=this.value_?"block":"none"}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_(this.getConstants().FIELD_CHECKBOX_X_OFFSET)}getDisplayText_(){return this.checkChar}setCheckCharacter(e){this.checkChar=e||Ti.CHECK_CHAR,this.forceRerender()}showEditor_(){this.setValue(!this.value_)}doClassValidation_(e){return e===!0||e==="TRUE"?"TRUE":e===!1||e==="FALSE"?"FALSE":null}doValueUpdate_(e){this.value_=this.convertValueToBool(e),this.textElement_&&(this.textElement_.style.display=this.value_?"block":"none")}getValue(){return this.value_?"TRUE":"FALSE"}getValueBoolean(){return this.value_}getText(){return String(this.convertValueToBool(this.value_))}convertValueToBool(e){return typeof e=="string"?e==="TRUE":!!e}static fromJson(e){return new this(e.checked,void 0,e)}};Ti.CHECK_CHAR="✓",Us("field_checkbox",Ti),Ti.prototype.DEFAULT_VALUE=!1;var dy=class{constructor(e,t){this.draggable=e,this.workspace=t,this.dragTarget=null,this.startLoc=e.getRelativeToSurfaceXY()}onDragStart(e){this.draggable.startDrag(e)}onDrag(e,t){this.moveDraggable(e,t),t=this.getRoot(this.draggable),ds(t)&&t.setDeleteStyle(this.wouldDeleteDraggable(e,t)),this.updateDragTarget(e)}updateDragTarget(e){e=this.workspace.getDragTarget(e);const t=this.getRoot(this.draggable);if(this.dragTarget!==e){let o;(o=this.dragTarget)==null||o.onDragExit(t),e==null||e.onDragEnter(t)}e==null||e.onDragOver(t),this.dragTarget=e}moveDraggable(e,t){t=this.pixelsToWorkspaceUnits(t),t=ye.sum(this.startLoc,t),this.draggable.drag(t,e)}wouldDeleteDraggable(e,t){return(e=this.workspace.getDragTarget(e))&&this.workspace.getComponentManager().hasCapability(e.id,gt.Capability.DELETE_AREA)?e.wouldDelete(t):!1}onDragEnd(e){const t=i.getGroup$$module$build$src$core$events$utils();var o=this.workspace.getDragTarget(e);const n=this.getRoot(this.draggable);if(o){let u;(u=this.dragTarget)==null||u.onDrop(n)}this.shouldReturnToStart(e,n)&&this.draggable.revertDrag(),(o=ds(n)&&this.wouldDeleteDraggable(e,n))&&this.draggable instanceof $s&&Wa(this.draggable.getRootBlock()),this.draggable.endDrag(e),o&&ds(n)&&(e=i.getGroup$$module$build$src$core$events$utils(),i.setGroup$$module$build$src$core$events$utils(t),n.dispose(),i.setGroup$$module$build$src$core$events$utils(e))}getRoot(e){return e instanceof $s?e.getRootBlock():e}shouldReturnToStart(e,t){return(e=this.workspace.getDragTarget(e))?e.shouldPreventMove(t):!1}pixelsToWorkspaceUnits(e){return e=new ye(e.x/this.workspace.scale,e.y/this.workspace.scale),this.workspace.isMutator&&e.scale(1/this.workspace.options.parentWorkspace.scale),e}};r($e.BLOCK_DRAGGER,Ws,dy);var Pr={};Pr.BlockDragStrategy=jv,Pr.BubbleDragStrategy=wv,Pr.CommentDragStrategy=fv,Pr.Dragger=dy;var Np=class extends Ss{constructor(e,t,o){super(e?e.workspace.id:void 0),this.type=ee.BLOCK_DRAG,e&&(this.blockId=e.id,this.isStart=t,this.blocks=o)}toJson(){const e=super.toJson();if(this.isStart===void 0)throw Error("Whether this event is the start of a drag is undefined. Either pass the value to the constructor, or call fromJson");if(this.blockId===void 0)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");return e.isStart=this.isStart,e.blockId=this.blockId,e.blocks=this.blocks,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Np),t.isStart=e.isStart,t.blockId=e.blockId,t.blocks=e.blocks,t}};r($e.EVENT,ee.BLOCK_DRAG,Np);var Mp=class extends gi{constructor(e,t,o,n){super(e),this.type=ee.BLOCK_FIELD_INTERMEDIATE_CHANGE,this.recordUndo=!1,e&&(this.name=t,this.oldValue=o,this.newValue=n)}toJson(){const e=super.toJson();if(!this.name)throw Error("The changed field name is undefined. Either pass a name to the constructor, or call fromJson.");return e.name=this.name,e.oldValue=this.oldValue,e.newValue=this.newValue,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Mp),t.name=e.name,t.oldValue=e.oldValue,t.newValue=e.newValue,t}isNull(){return this.oldValue===this.newValue}run(e){var t=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");if(t=t.getBlockById(this.blockId),!t)throw Error("The associated block is undefined. Either pass a block to the constructor, or call fromJson");e=e?this.newValue:this.oldValue,(t=t.getField(this.name))?t.setValue(e):console.warn("Can't set non-existent field: "+this.name)}};r($e.EVENT,ee.BLOCK_FIELD_INTERMEDIATE_CHANGE,Mp);var Lp=class extends gi{constructor(e){super(e),this.type=ee.BLOCK_MOVE,e&&(e.isShadow()&&(this.recordUndo=!1),e=this.currentLocation(),this.oldParentId=e.parentId,this.oldInputName=e.inputName,this.oldCoordinate=e.coordinate)}toJson(){const e=super.toJson();return e.oldParentId=this.oldParentId,e.oldInputName=this.oldInputName,this.oldCoordinate&&(e.oldCoordinate=`${Math.round(this.oldCoordinate.x)}, ${Math.round(this.oldCoordinate.y)}`),e.newParentId=this.newParentId,e.newInputName=this.newInputName,this.newCoordinate&&(e.newCoordinate=`${Math.round(this.newCoordinate.x)}, ${Math.round(this.newCoordinate.y)}`),this.reason&&(e.reason=this.reason),this.recordUndo||(e.recordUndo=this.recordUndo),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Lp),t.oldParentId=e.oldParentId,t.oldInputName=e.oldInputName,e.oldCoordinate&&(o=e.oldCoordinate.split(","),t.oldCoordinate=new ye(Number(o[0]),Number(o[1]))),t.newParentId=e.newParentId,t.newInputName=e.newInputName,e.newCoordinate&&(o=e.newCoordinate.split(","),t.newCoordinate=new ye(Number(o[0]),Number(o[1]))),e.reason!==void 0&&(t.reason=e.reason),e.recordUndo!==void 0&&(t.recordUndo=e.recordUndo),t}recordNew(){const e=this.currentLocation();this.newParentId=e.parentId,this.newInputName=e.inputName,this.newCoordinate=e.coordinate}setReason(e){this.reason=e}currentLocation(){var e=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");var t=e.getBlockById(this.blockId);if(!t)throw Error("The block associated with the block move event could not be found");e={};const o=t.getParent();return o?(e.parentId=o.id,(t=o.getInputWithBlock(t))&&(e.inputName=t.name)):e.coordinate=t.getRelativeToSurfaceXY(),e}isNull(){return this.oldParentId===this.newParentId&&this.oldInputName===this.newInputName&&ye.equals(this.oldCoordinate,this.newCoordinate)}run(e){var t=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");var o=t.getBlockById(this.blockId);if(o){var n=e?this.newParentId:this.oldParentId,u=e?this.newInputName:this.oldInputName;if(e=e?this.newCoordinate:this.oldCoordinate,n){var g=t.getBlockById(n);if(!g){console.warn("Can't connect to non-existent block: "+n);return}}if(o.getParent()&&o.unplug(),e)u=o.getRelativeToSurfaceXY(),o.moveBy(e.x-u.x,e.y-u.y,this.reason);else{t=o.outputConnection,(!t||o.previousConnection&&o.previousConnection.isConnected())&&(t=o.previousConnection);let I,L;o=(L=t)==null?void 0:L.type,u?(o=g.getInput(u))&&(I=o.connection):o===xe.PREVIOUS_STATEMENT&&(I=g.nextConnection),I&&t?t.connect(I):console.warn("Can't connect to non-existent input: "+u)}}else console.warn("Can't move non-existent block: "+this.blockId)}};r($e.EVENT,ee.BLOCK_MOVE,Lp);var Pp=class extends Ss{constructor(e,t,o){super(e?e.workspace.id:void 0),this.type=ee.BUBBLE_OPEN,e&&(this.blockId=e.id,this.isOpen=t,this.bubbleType=o)}toJson(){const e=super.toJson();if(this.isOpen===void 0)throw Error("Whether this event is for opening the bubble is undefined. Either pass the value to the constructor, or call fromJson");if(!this.bubbleType)throw Error("The type of bubble is undefined. Either pass the value to the constructor, or call fromJson");return e.isOpen=this.isOpen,e.bubbleType=this.bubbleType,e.blockId=this.blockId||"",e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Pp),t.isOpen=e.isOpen,t.bubbleType=e.bubbleType,t.blockId=e.blockId,t}},Bp;(function(e){e.MUTATOR="mutator",e.COMMENT="comment",e.WARNING="warning"})(Bp||(Bp={})),r($e.EVENT,ee.BUBBLE_OPEN,Pp);var qs=class extends qi{constructor(e){super(),this.isBlank=!e,e&&(this.commentId=e.id,this.workspaceId=e.workspace.id,this.group=i.getGroup$$module$build$src$core$events$utils(),this.recordUndo=G())}toJson(){const e=super.toJson();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");return e.commentId=this.commentId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new qs),t.commentId=e.commentId,t}static CommentCreateDeleteHelper(e,t){const o=e.getEventWorkspace_();if(t){if(!e.json)throw Error("Encountered a comment event without proper json");Kn(e.json,o)}else{if(!e.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");(t=o.getCommentById(e.commentId))?t.dispose():console.warn("Can't delete non-existent comment: "+e.commentId)}}},Fp=class extends qs{constructor(e,t,o){super(e),this.type=ee.COMMENT_CHANGE,e&&(this.oldContents_=typeof t>"u"?"":t,this.newContents_=typeof o>"u"?"":o)}toJson(){const e=super.toJson();if(!this.oldContents_)throw Error("The old contents is undefined. Either pass a value to the constructor, or call fromJson");if(!this.newContents_)throw Error("The new contents is undefined. Either pass a value to the constructor, or call fromJson");return e.oldContents=this.oldContents_,e.newContents=this.newContents_,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Fp),t.oldContents_=e.oldContents,t.newContents_=e.newContents,t}isNull(){return this.oldContents_===this.newContents_}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(t=t.getCommentById(this.commentId)){var o=e?this.newContents_:this.oldContents_;if(o===void 0)throw Error(e?"The new contents is undefined. Either pass a value to the constructor, or call fromJson":"The old contents is undefined. Either pass a value to the constructor, or call fromJson");t.setText(o)}else console.warn("Can't change non-existent comment: "+this.commentId)}};r($e.EVENT,ee.COMMENT_CHANGE,Fp);var jp=class extends qs{constructor(e,t){super(e),this.newCollapsed=t,this.type=ee.COMMENT_COLLAPSE}toJson(){const e=super.toJson();if(this.newCollapsed===void 0)throw Error("The new collapse value undefined. Either call recordNew, or call fromJson");return e.newCollapsed=this.newCollapsed,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new jp),t.newCollapsed=e.newCollapsed,t}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");(t=t.getCommentById(this.commentId))?t.setCollapsed(e?!!this.newCollapsed:!this.newCollapsed):console.warn("Can't collapse or uncollapse non-existent comment: "+this.commentId)}};r($e.EVENT,ee.COMMENT_COLLAPSE,jp);var zp=class extends qs{constructor(e){super(e),this.type=ee.COMMENT_CREATE,e&&(this.xml=ir(e),this.json=Pi(e,{addCoordinates:!0}))}toJson(){const e=super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.json)throw Error("The comment JSON is undefined. Either pass a block to the constructor, or call fromJson");return e.xml=zs(this.xml),e.json=this.json,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new zp),t.xml=i.textToDom$$module$build$src$core$utils$xml(e.xml),t.json=e.json,t}run(e){qs.CommentCreateDeleteHelper(this,e)}};r($e.EVENT,ee.COMMENT_CREATE,zp);var Up=class extends qs{constructor(e){super(e),this.type=ee.COMMENT_DELETE,e&&(this.xml=ir(e),this.json=Pi(e,{addCoordinates:!0}))}run(e){qs.CommentCreateDeleteHelper(this,!e)}toJson(){const e=super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.json)throw Error("The comment JSON is undefined. Either pass a block to the constructor, or call fromJson");return e.xml=zs(this.xml),e.json=this.json,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Up),t.xml=i.textToDom$$module$build$src$core$utils$xml(e.xml),t.json=e.json,t}};r($e.EVENT,ee.COMMENT_DELETE,Up);var Hp=class extends Ss{constructor(e,t){super(e?e.workspace.id:void 0),this.type=ee.COMMENT_DRAG,e&&(this.commentId=e.id,this.isStart=t)}toJson(){const e=super.toJson();if(this.isStart===void 0)throw Error("Whether this event is the start of a drag is undefined. Either pass the value to the constructor, or call fromJson");if(this.commentId===void 0)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");return e.isStart=this.isStart,e.commentId=this.commentId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Hp),t.isStart=e.isStart,t.commentId=e.commentId,t}};r($e.EVENT,ee.COMMENT_DRAG,Hp);var Wp=class extends qs{constructor(e){super(e),this.type=ee.COMMENT_MOVE,e&&(this.comment_=e,this.oldCoordinate_=e.getRelativeToSurfaceXY())}recordNew(){if(this.newCoordinate_)throw Error("Tried to record the new position of a comment on the same event twice.");if(!this.comment_)throw Error("The comment is undefined. Pass a comment to the constructor if you want to use the record functionality");this.newCoordinate_=this.comment_.getRelativeToSurfaceXY()}setReason(e){this.reason=e}setOldCoordinate(e){this.oldCoordinate_=e}toJson(){const e=super.toJson();if(!this.oldCoordinate_)throw Error("The old comment position is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.newCoordinate_)throw Error("The new comment position is undefined. Either call recordNew, or call fromJson");return e.oldCoordinate=`${Math.round(this.oldCoordinate_.x)}, ${Math.round(this.oldCoordinate_.y)}`,e.newCoordinate=Math.round(this.newCoordinate_.x)+","+Math.round(this.newCoordinate_.y),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Wp),o=e.oldCoordinate.split(","),t.oldCoordinate_=new ye(Number(o[0]),Number(o[1])),o=e.newCoordinate.split(","),t.newCoordinate_=new ye(Number(o[0]),Number(o[1])),t}isNull(){return ye.equals(this.oldCoordinate_,this.newCoordinate_)}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(t=t.getCommentById(this.commentId)){if(e=e?this.newCoordinate_:this.oldCoordinate_,!e)throw Error("Either oldCoordinate_ or newCoordinate_ is undefined. Either pass a comment to the constructor and call recordNew, or call fromJson");t.moveTo(e)}else console.warn("Can't move non-existent comment: "+this.commentId)}};r($e.EVENT,ee.COMMENT_MOVE,Wp);var Gp=class extends qs{constructor(e){super(e),this.type=ee.COMMENT_RESIZE,e&&(this.oldSize=e.getSize())}recordCurrentSizeAsNewSize(){if(this.newSize)throw Error("Tried to record the new size of a comment on the same event twice.");var e=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(e=e.getCommentById(this.commentId),!e)throw Error("The comment associated with the comment resize event could not be found");this.newSize=e.getSize()}toJson(){const e=super.toJson();if(!this.oldSize)throw Error("The old comment size is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.newSize)throw Error("The new comment size is undefined. Either call recordCurrentSizeAsNewSize, or call fromJson");return e.oldWidth=Math.round(this.oldSize.width),e.oldHeight=Math.round(this.oldSize.height),e.newWidth=Math.round(this.newSize.width),e.newHeight=Math.round(this.newSize.height),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Gp),t.oldSize=new Xe(e.oldWidth,e.oldHeight),t.newSize=new Xe(e.newWidth,e.newHeight),t}isNull(){return Xe.equals(this.oldSize,this.newSize)}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(t=t.getCommentById(this.commentId)){if(e=e?this.newSize:this.oldSize,!e)throw Error("Either oldSize or newSize is undefined. Either pass a comment to the constructor and call recordCurrentSizeAsNewSize, or call fromJson");t.setSize(e)}else console.warn("Can't resize non-existent comment: "+this.commentId)}};r($e.EVENT,ee.COMMENT_RESIZE,Gp);var Vp=class extends Ss{constructor(e,t,o){super(o),this.type=ee.TOOLBOX_ITEM_SELECT,this.oldItem=e??void 0,this.newItem=t??void 0}toJson(){const e=super.toJson();return e.oldItem=this.oldItem,e.newItem=this.newItem,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Vp),t.oldItem=e.oldItem,t.newItem=e.newItem,t}};r($e.EVENT,ee.TOOLBOX_ITEM_SELECT,Vp);var hy=class extends qi{constructor(e){super(),this.isBlank=!0,this.recordUndo=!1,this.type=ee.FINISHED_LOADING,this.isBlank=!!e,e&&(this.workspaceId=e.id)}};r($e.EVENT,ee.FINISHED_LOADING,hy);var py,gy,my,fy,$y,by,vy,yy,_y,wy,ky,Cy,Ty,Sy,Ey,Iy,xy,Dy,Ay,Oy,Ry,Ny,My,Ly,Py,Se;i.BLOCK_CHANGE$$module$build$src$core$events$events=ee.BLOCK_CHANGE,i.BLOCK_CREATE$$module$build$src$core$events$events=ee.BLOCK_CREATE,i.BLOCK_DELETE$$module$build$src$core$events$events=ee.BLOCK_DELETE,py=ee.BLOCK_DRAG,i.BLOCK_MOVE$$module$build$src$core$events$events=ee.BLOCK_MOVE,gy=ee.BLOCK_FIELD_INTERMEDIATE_CHANGE,my=ee.BUBBLE_OPEN,fy=ee.BLOCK_CHANGE,$y=ee.CLICK,by=ee.COMMENT_CHANGE,vy=ee.COMMENT_CREATE,yy=ee.COMMENT_DELETE,_y=ee.COMMENT_MOVE,wy=ee.COMMENT_RESIZE,ky=ee.COMMENT_DRAG,Cy=ee.BLOCK_CREATE,Ty=ee.BLOCK_DELETE,Sy=ee.FINISHED_LOADING,Ey=ee.MARKER_MOVE,Iy=ee.BLOCK_MOVE,xy=ee.SELECTED,Dy=ee.THEME_CHANGE,Ay=ee.TOOLBOX_ITEM_SELECT,Oy=ee.TRASHCAN_OPEN,Ry=ee.UI,Ny=ee.VAR_CREATE,My=ee.VAR_DELETE,Ly=ee.VAR_RENAME,Py=ee.VIEWPORT_CHANGE,Se={},Se.Abstract=qi,Se.BLOCK_CHANGE=i.BLOCK_CHANGE$$module$build$src$core$events$events,Se.BLOCK_CREATE=i.BLOCK_CREATE$$module$build$src$core$events$events,Se.BLOCK_DELETE=i.BLOCK_DELETE$$module$build$src$core$events$events,Se.BLOCK_DRAG=py,Se.BLOCK_FIELD_INTERMEDIATE_CHANGE=gy,Se.BLOCK_MOVE=i.BLOCK_MOVE$$module$build$src$core$events$events,Se.BUBBLE_OPEN=my,Se.BUMP_EVENTS=pb,Se.BlockBase=gi,Se.BlockChange=mi,Se.BlockCreate=Qh,Se.BlockDelete=hp,Se.BlockDrag=Np,Se.BlockFieldIntermediateChange=Mp,Se.BlockMove=Lp,Se.BubbleOpen=Pp,Se.BubbleType=Bp,Se.CHANGE=fy,Se.CLICK=$y,Se.COMMENT_CHANGE=by,Se.COMMENT_CREATE=vy,Se.COMMENT_DELETE=yy,Se.COMMENT_DRAG=ky,Se.COMMENT_MOVE=_y,Se.COMMENT_RESIZE=wy,Se.CREATE=Cy,Se.Click=bh,Se.ClickTarget=vh,Se.CommentBase=qs,Se.CommentChange=Fp,Se.CommentCollapse=jp,Se.CommentCreate=zp,Se.CommentDelete=Up,Se.CommentDrag=Hp,Se.CommentMove=Wp,Se.CommentResize=Gp,Se.DELETE=Ty,Se.FINISHED_LOADING=Sy,Se.FinishedLoading=hy,Se.MARKER_MOVE=Ey,Se.MOVE=Iy,Se.MarkerMove=pp,Se.SELECTED=xy,Se.Selected=_p,Se.THEME_CHANGE=Dy,Se.TOOLBOX_ITEM_SELECT=Ay,Se.TRASHCAN_OPEN=Oy,Se.ThemeChange=ep,Se.ToolboxItemSelect=Vp,Se.TrashcanOpen=kp,Se.UI=Ry,Se.UiBase=Ss,Se.VAR_CREATE=Ny,Se.VAR_DELETE=My,Se.VAR_RENAME=Ly,Se.VIEWPORT_CHANGE=Py,Se.VarBase=br,Se.VarCreate=Fh,Se.VarDelete=bp,Se.VarRename=vp,Se.ViewportChange=tp,Se.clearPendingUndo=K,Se.disable=i.disable$$module$build$src$core$events$utils,Se.disableOrphans=me,Se.enable=i.enable$$module$build$src$core$events$utils,Se.filter=R,Se.fire=z,Se.fromJson=ce,Se.get=ne,Se.getDescendantIds=ve,Se.getGroup=i.getGroup$$module$build$src$core$events$utils,Se.getRecordUndo=G,Se.isEnabled=C,Se.setGroup=i.setGroup$$module$build$src$core$events$utils,Se.setRecordUndo=i.setRecordUndo$$module$build$src$core$events$utils;var Os={};Os.BottomRow=Qv,Os.ConstantProvider=Xv,Os.Drawer=Zv,Os.MarkerSvg=oy,Os.PathObject=iy,Os.RenderInfo=sy,Os.Renderer=Ap,Os.RightConnectionShape=ey,Os.StatementInput=Yl,Os.TopRow=ty,gh();var It={};It.registerCleanup=Zd,It.registerCollapse=eh,It.registerCollapseExpandBlock=ah,It.registerComment=nh,It.registerCommentCreate=ph,It.registerCommentDelete=dh,It.registerCommentDuplicate=hh,It.registerCommentOptions=ab,It.registerDefaultOptions=gh,It.registerDelete=ch,It.registerDeleteAll=oh,It.registerDisable=lh,It.registerDuplicate=ih,It.registerExpand=th,It.registerHelp=uh,It.registerInline=rh,It.registerRedo=Xd,It.registerUndo=qd;var ql={};ql.CommentView=bv,ql.RenderedWorkspaceComment=Il,ql.WorkspaceComment=El;var Br={};Br.Bubble=nt,Br.MiniWorkspaceBubble=vo,Br.TextBubble=Iv,Br.TextInputBubble=kv;var By=class extends Pl{constructor(){super(),this.FIELD_TEXT_BASELINE_CENTER=!1,this.DARK_PATH_OFFSET=1,this.MAX_BOTTOM_WIDTH=30,this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT/2}getCSS_(e){return super.getCSS_(e).concat([`${e} .blocklyInsertionMarker>.blocklyPathLight,`,`${e} .blocklyInsertionMarker>.blocklyPathDark {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"])}},Fy=class{constructor(e){this.inlineSteps_=this.steps_="",this.info_=e,this.RTL_=this.info_.RTL,e=e.getRenderer(),this.constants_=e.getConstants(),this.highlightConstants_=e.getHighlightConstants(),this.highlightOffset=this.highlightConstants_.OFFSET,this.outsideCornerPaths_=this.highlightConstants_.OUTSIDE_CORNER,this.insideCornerPaths_=this.highlightConstants_.INSIDE_CORNER,this.puzzleTabPaths_=this.highlightConstants_.PUZZLE_TAB,this.notchPaths_=this.highlightConstants_.NOTCH,this.startPaths_=this.highlightConstants_.START_HAT,this.jaggedTeethPaths_=this.highlightConstants_.JAGGED_TEETH}getPath(){return this.steps_+` +`+this.inlineSteps_}drawTopCorner(e){this.steps_+=pt(e.xPos,this.info_.startY);for(let t=0,o;o=e.elements[t];t++)F.isLeftSquareCorner(o)?this.steps_+=this.highlightConstants_.START_POINT:F.isLeftRoundedCorner(o)?this.steps_+=this.outsideCornerPaths_.topLeft(this.RTL_):F.isPreviousConnection(o)?this.steps_+=this.notchPaths_.pathLeft:F.isHat(o)?this.steps_+=this.startPaths_.path(this.RTL_):F.isSpacer(o)&&o.width!==0&&(this.steps_+=De("H",o.xPos+o.width-this.highlightOffset));this.steps_+=De("H",e.xPos+e.width-this.highlightOffset)}drawJaggedEdge_(e){this.info_.RTL&&(this.steps_+=this.jaggedTeethPaths_.pathLeft+De("v",e.height-this.jaggedTeethPaths_.height-this.highlightOffset))}drawValueInput(e){const t=e.getLastInput();if(this.RTL_){const o=e.height-t.connectionHeight;this.steps_+=St(t.xPos+t.width-this.highlightOffset,e.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)+De("v",o)}else this.steps_+=St(t.xPos+t.width,e.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)}drawStatementInput(e){const t=e.getLastInput();if(t)if(this.RTL_){const o=e.height-2*this.insideCornerPaths_.height;this.steps_+=St(t.xPos,e.yPos)+this.insideCornerPaths_.pathTop(this.RTL_)+De("v",o)+this.insideCornerPaths_.pathBottom(this.RTL_)+Hs(e.width-t.xPos-this.insideCornerPaths_.width,0)}else this.steps_+=St(t.xPos,e.yPos+e.height)+this.insideCornerPaths_.pathBottom(this.RTL_)+Hs(e.width-t.xPos-this.insideCornerPaths_.width,0)}drawRightSideRow(e){const t=e.xPos+e.width-this.highlightOffset;e instanceof up&&e.followsStatement&&(this.steps_+=De("H",t)),this.RTL_&&(this.steps_+=De("H",t),e.height>this.highlightOffset&&(this.steps_+=De("V",e.yPos+e.height-this.highlightOffset)))}drawBottomRow(e){if(this.RTL_)this.steps_+=De("V",e.baseline-this.highlightOffset);else{const t=this.info_.bottomRow.elements[0];F.isLeftSquareCorner(t)?this.steps_+=St(e.xPos+this.highlightOffset,e.baseline-this.highlightOffset):F.isLeftRoundedCorner(t)&&(this.steps_+=St(e.xPos,e.baseline),this.steps_+=this.outsideCornerPaths_.bottomLeft())}}drawLeft(){var e=this.info_.outputConnection;e&&(e=e.connectionOffsetY+e.height,this.RTL_?this.steps_+=St(this.info_.startX,e):(this.steps_+=St(this.info_.startX+this.highlightOffset,this.info_.bottomRow.baseline-this.highlightOffset),this.steps_+=De("V",e)),this.steps_+=this.puzzleTabPaths_.pathUp(this.RTL_)),this.RTL_||(e=this.info_.topRow,F.isLeftRoundedCorner(e.elements[0])?this.steps_+=De("V",this.outsideCornerPaths_.height):this.steps_+=De("V",e.capline+this.highlightOffset))}drawInlineInput(e){const t=this.highlightOffset,o=e.xPos+e.connectionWidth;var n=e.centerline-e.height/2;const u=e.width-e.connectionWidth,g=n+t;this.RTL_?(n=e.connectionOffsetY-t,e=e.height-(e.connectionOffsetY+e.connectionHeight)+t,this.inlineSteps_+=St(o-t,g)+De("v",n)+this.puzzleTabPaths_.pathDown(this.RTL_)+De("v",e)+De("h",u)):this.inlineSteps_+=St(e.xPos+e.width+t,g)+De("v",e.height)+De("h",-u)+St(o,n+e.connectionOffsetY)+this.puzzleTabPaths_.pathDown(this.RTL_)}},jy=class extends Bl{constructor(e,t){super(e,t),this.highlighter_=new Fy(t)}draw(){this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights();const e=this.block_.pathObject;e.setPath(this.outlinePath_+` +`+this.inlinePath_),e.setHighlightPath(this.highlighter_.getPath()),this.info_.RTL&&e.flipRTL(),this.recordSizeOnBlock_()}drawTop_(){this.highlighter_.drawTopCorner(this.info_.topRow),this.highlighter_.drawRightSideRow(this.info_.topRow),super.drawTop_()}drawJaggedEdge_(e){this.highlighter_.drawJaggedEdge_(e),super.drawJaggedEdge_(e)}drawValueInput_(e){this.highlighter_.drawValueInput(e),super.drawValueInput_(e)}drawStatementInput_(e){this.highlighter_.drawStatementInput(e),super.drawStatementInput_(e)}drawRightSideRow_(e){this.highlighter_.drawRightSideRow(e),this.outlinePath_+=De("H",e.xPos+e.width)+De("V",e.yPos+e.height)}drawBottom_(){this.highlighter_.drawBottomRow(this.info_.bottomRow),super.drawBottom_()}drawLeft_(){this.highlighter_.drawLeft(),super.drawLeft_()}drawInlineInput_(e){this.highlighter_.drawInlineInput(e),super.drawInlineInput_(e)}positionInlineInputConnection_(e){const t=e.centerline-e.height/2;if(e.connectionModel){let o=e.xPos+e.connectionWidth+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(o*=-1),e.connectionModel.setOffsetInBlock(o,t+e.connectionOffsetY+this.constants_.DARK_PATH_OFFSET)}}positionStatementInputConnection_(e){const t=e.getLastInput();if(t!=null&&t.connectionModel){let o=e.xPos+e.statementEdge+t.notchOffset;o=this.info_.RTL?-1*o:o+this.constants_.DARK_PATH_OFFSET,t.connectionModel.setOffsetInBlock(o,e.yPos+this.constants_.DARK_PATH_OFFSET)}}positionExternalValueConnection_(e){const t=e.getLastInput();if(t&&t.connectionModel){let o=e.xPos+e.width+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(o*=-1),t.connectionModel.setOffsetInBlock(o,e.yPos)}}positionNextConnection_(){const e=this.info_.bottomRow;if(e.connection){const t=e.connection,o=t.xPos;t.connectionModel.setOffsetInBlock((this.info_.RTL?-o:o)+this.constants_.DARK_PATH_OFFSET/2,e.baseline+this.constants_.DARK_PATH_OFFSET)}}},zy=class{constructor(e){this.OFFSET=.5,this.constantProvider=e,this.START_POINT=pt(this.OFFSET,this.OFFSET)}init(){this.INSIDE_CORNER=this.makeInsideCorner(),this.OUTSIDE_CORNER=this.makeOutsideCorner(),this.PUZZLE_TAB=this.makePuzzleTab(),this.NOTCH=this.makeNotch(),this.JAGGED_TEETH=this.makeJaggedTeeth(),this.START_HAT=this.makeStartHat()}makeInsideCorner(){const e=this.constantProvider.CORNER_RADIUS,t=this.OFFSET,o=(1-Math.SQRT1_2)*(e+t)-t,n=pt(o,o)+vt("a","0 0,0",e,Me(-o-t,e-o)),u=vt("a","0 0,0",e+t,Me(e+t,e+t)),g=pt(o,-o)+vt("a","0 0,0",e+t,Me(e-o,o+t));return{width:e+t,height:e,pathTop(I){return I?n:""},pathBottom(I){return I?u:g}}}makeOutsideCorner(){const e=this.constantProvider.CORNER_RADIUS,t=this.OFFSET,o=(1-Math.SQRT1_2)*(e-t)+t,n=pt(o,o)+vt("a","0 0,1",e-t,Me(e-o,-o+t)),u=pt(t,e)+vt("a","0 0,1",e-t,Me(e,-e+t)),g=-o,I=pt(o,g)+vt("a","0 0,1",e-t,Me(-o+t,-g-e));return{height:e,topLeft(L){return L?n:u},bottomLeft(){return I}}}makePuzzleTab(){const e=this.constantProvider.TAB_WIDTH,t=this.constantProvider.TAB_HEIGHT,o=pt(-2,-t+3.4)+Hs(-.45*e,-2.1),n=De("v",2.5)+pt(.97*-e,2.5)+Xt("q",[Me(.05*-e,10),Me(.3*e,9.5)])+pt(.67*e,-1.9)+De("v",2.5),u=De("v",-1.5)+pt(-.92*e,-.5)+Xt("q",[Me(-.19*e,-5.5),Me(0,-11)])+pt(.92*e,1),g=pt(-5,t-.7)+Hs(.46*e,-2.1);return{width:e,height:t,pathUp(I){return I?o:u},pathDown(I){return I?n:g}}}makeNotch(){return{pathLeft:De("h",this.OFFSET)+this.constantProvider.NOTCH.pathLeft}}makeJaggedTeeth(){return{pathLeft:Hs(5.1,2.6)+pt(-10.2,6.8)+Hs(5.1,2.6),height:12,width:10.2}}makeStartHat(){const e=this.constantProvider.START_HAT.height,t=pt(25,-8.7)+Xt("c",[Me(29.7,-6.2),Me(57.2,-.5),Me(75,8.7)]),o=Xt("c",[Me(17.8,-9.2),Me(45.3,-14.9),Me(75,-8.7)])+St(100.5,e+.5);return{path(n){return n?t:o}}}},Uy=class extends lp{constructor(e,t){super(e,t),this.constants_=e,this.connectedBlock&&(this.width+=this.constants_.DARK_PATH_OFFSET,this.height+=this.constants_.DARK_PATH_OFFSET)}},Hy=class extends xr{constructor(e,t){super(e,t),this.constants_=e,this.connectedBlock&&(this.height+=this.constants_.DARK_PATH_OFFSET)}},Wy=class extends Or{constructor(e,t){super(e,t),this.renderer_=e}getRenderer(){return this.renderer_}populateBottomRow_(){super.populateBottomRow_(),this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1]instanceof ls||(this.bottomRow.minHeight=this.constants_.MEDIUM_PADDING-this.constants_.DARK_PATH_OFFSET)}addInput_(e,t){this.isInline&&e instanceof i.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new Uy(this.constants_,e)),t.hasInlineInput=!0):e instanceof ls?(t.elements.push(new Hy(this.constants_,e)),t.hasStatement=!0):e instanceof i.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new Ll(this.constants_,e)),t.hasExternalInput=!0):(e instanceof Ks||e instanceof Co)&&(t.minHeight=Math.max(t.minHeight,this.constants_.DUMMY_INPUT_MIN_HEIGHT),t.hasDummyInput=!0),this.isInline||t.align!==null||(t.align=e.align)}addElemSpacing_(){let e=!1;for(let o=0,n;n=this.rows[o];o++)n.hasExternalInput&&(e=!0);for(let o=0,n;n=this.rows[o];o++){var t=n.elements;if(n.elements=[],n.startsWithElemSpacer()&&n.elements.push(new as(this.constants_,this.getInRowSpacing_(null,t[0]))),t.length){for(let u=0;u>>/handdelete.cur"), auto; } @@ -1009,13 +1009,13 @@ Blockly.YourGeneratorName.nameDB_.setVariableMap(workspace.getVariableMap());`), .blocklyToolboxContents:focus { outline: none; } -`),r($e.TOOLBOX,Ws,Ky);var vT="11.2.2",yT=xe.INPUT_VALUE,_T=xe.OUTPUT_VALUE,wT=xe.NEXT_STATEMENT,kT=xe.PREVIOUS_STATEMENT,CT=Ge.TOP,TT=Ge.BOTTOM,ST=Ge.LEFT,ET=Ge.RIGHT;gn.prototype.newBlock=function(e,t){return new Uo(this,e,t)},cs.prototype.newBlock=function(e,t){return new $s(this,e,t)},gn.prototype.newComment=function(e){return new El(this,e)},cs.prototype.newComment=function(e){return new Il(this,e)},cs.newTrashcan=function(e){return new Hv(e)},vo.prototype.newWorkspaceSvg=function(e){return new cs(e)},i.Names$$module$build$src$core$names.prototype.populateProcedures=function(e){e=qa(e),e=e[0].concat(e[1]);for(let t=0;t{this.setState({popper:x.I18n.t("Copied"),anchorEl:i}),setTimeout(()=>this.setState({popper:"",anchorEl:null}),1e3)},50)}render(){const s=new Blob([this.props.text],{type:"application/xml"}),i=`${this.props.scriptId.substring(10)}.xml`;return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"lg",sx:{"& .MuiDialog-paper":Wr.dialog},fullWidth:!0,open:!0,"aria-labelledby":"export-dialog-title",children:[m.jsx(ss,{id:"export-dialog-title",children:x.I18n.t("Export selected blocks")}),m.jsx(qt,{style:Wr.overflowY,children:m.jsx("pre",{id:"export-text",style:{...Wr.textArea,...this.props.themeType==="dark"?void 0:Wr.textAreaLight},children:this.props.text})}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",color:"secondary",startIcon:m.jsx(kc,{}),children:m.jsx("a",{download:i,target:"_blank",rel:"noreferrer",href:URL.createObjectURL(s),style:{textDecoration:"inherit",color:"inherit"},children:x.I18n.t("Download as file")})}),m.jsx(He,{variant:"contained",onClick:r=>this.onCopy(r),color:"secondary",startIcon:m.jsx(cx,{}),children:x.I18n.t("Copy to clipboard")}),m.jsx(He,{variant:"contained",onClick:()=>this.handleCancel(),color:"primary",startIcon:m.jsx(so,{}),children:x.I18n.t("Close")}),m.jsx(YT,{id:"popper",style:{zIndex:1e4},open:!!this.state.popper,placement:"top",anchorEl:this.state.anchorEl,transition:!0,children:({TransitionProps:r})=>m.jsx(JT,{...r,timeout:350,children:m.jsx(Ow,{children:m.jsx("p",{style:Wr.typography,children:this.state.popper})})})}),m.jsx("textarea",{id:"copy_input",readOnly:!0,style:{position:"absolute",left:-9999},tabIndex:-1,"aria-hidden":!0,value:this.props.text})]})]},"export-dialog")}}const Mt={textArea:{width:"calc(100% - 10px)",height:"calc(80% - 20px)",resize:"none",fontFamily:"monospace",fontSize:"1em",backgroundColor:"transparent",borderRadius:4,outline:"none"},dropzone:{marginTop:20,width:"100%",borderWidth:5,borderStyle:"dashed",borderColor:"#d0cccc",textAlign:"center",boxSizing:"border-box",paddingTop:45,borderRadius:10,height:"calc(100% - 10px)"},dropzoneDiv:{width:"100%",height:"20%",position:"relative"},dropzoneRejected:{borderColor:"#970000"},dropzoneAccepted:{borderColor:"#17cd02"},icon:{height:"80%",width:"80%",opacity:.3,color:"#eeeeee",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",zIndex:0},iconError:{color:"#ffc3c6"},iconOk:{color:"#aaeebc"},text:{top:"50%",left:"50%",transform:"translate(-50%,-50%)",color:"#868686",position:"absolute",zIndex:1},dialog:{height:"95%"},fullHeight:{height:"100%",overflow:"hidden"}};class Hm extends _e.Component{constructor(s){super(s),this.state={text:"",imageStatus:"",error:""}}componentDidMount(){setTimeout(()=>{var s;try{(s=window.document.getElementById("import-text-area"))==null||s.focus()}catch{}},100)}static readFileDataUrl(s,i){const r=new FileReader;r.onload=()=>{i(null,{data:r.result,name:s.name})},r.onabort=()=>{console.error("file reading was aborted"),i(x.I18n.t("file reading was aborted"))},r.onerror=l=>{console.error("file reading has failed"),i(x.I18n.t("file reading has failed: %s",l))},r.readAsText(s)}handleDropFile(s){if(!(s!=null&&s.length))return;const i=s[s.length-1];i&&Hm.readFileDataUrl(i,(r,l)=>{var c;r||!l?this.setState({error:r||"No data"}):this.setState({text:((c=l.data)==null?void 0:c.toString())||""})})}handleCancel(){this.props.onClose()}handleOk(){this.props.onClose(this.state.text)}onChange(s){this.setState({text:s.target.value})}render(){const s={...Mt.dropzone,...this.state.imageStatus==="accepted"?Mt.dropzoneAccepted:this.state.imageStatus==="rejected"?Mt.dropzoneRejected:void 0};return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"lg",sx:{"& .MuiDialog-paper":Mt.dialog},fullWidth:!0,open:!0,"aria-labelledby":"import-dialog-title",children:[m.jsx(ss,{id:"import-dialog-title",children:x.I18n.t("Import blocks")}),m.jsxs(qt,{style:Mt.fullHeight,children:[m.jsx("textarea",{autoFocus:!0,id:"import-text-area",placeholder:x.I18n.t("Paste your blocks here"),style:{...Mt.textArea,color:this.props.themeType==="dark"?"#ffffff":"#000000"},onChange:i=>this.onChange(i),value:this.state.text}),m.jsx(Lw,{maxSize:5e7,onDrop:(i,r)=>{var l,c,d;i.length?this.handleDropFile(i):window.alert(((d=(c=(l=r==null?void 0:r[0])==null?void 0:l.errors)==null?void 0:c[0])==null?void 0:d.message)||x.I18n.t("ra_Cannot upload"))},multiple:!1,accept:{"text/plain":[],"text/xml":[],"application/xml":[]},children:({getRootProps:i,getInputProps:r,isDragActive:l,isDragReject:c})=>c?(this.state.imageStatus!=="rejected"&&this.setState({imageStatus:"rejected"}),m.jsxs("div",{style:{...s,...Mt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Mt.text,children:x.I18n.t("Some files will be rejected")},"text"),m.jsx(Yc,{style:{...Mt.icon,...Mt.iconError}},"icon")]})):l?(this.state.imageStatus!=="accepted"&&this.setState({imageStatus:"accepted"}),m.jsxs("div",{style:{...s,...Mt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Mt.text,children:x.I18n.t("All files will be accepted")},"text"),m.jsx(Pw,{style:{...Mt.icon,...Mt.iconOk}},"icon")]})):(this.state.imageStatus!=="wait"&&this.setState({imageStatus:"wait"}),m.jsxs("div",{style:{...s,...Mt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Mt.text,children:x.I18n.t("Drop some files here or click...")},"text"),m.jsx(Bw,{style:Mt.icon},"icon")]}))})]}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",disabled:!this.state.text,onClick:()=>this.handleOk(),color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Import")}),m.jsx(He,{color:"grey",variant:"contained",onClick:()=>this.handleCancel(),startIcon:m.jsx(so,{}),children:x.I18n.t("Close")})]})]})}}const Fe=window.Blockly;class $g extends Error{constructor(){super("The field has not yet been attached to its input. Call appendField to attach it.")}}class Oc extends Fe.Field{textGroup=null;borderRect_=null;maxLines_=1/0;isOverflowedY_=!1;constructor(s,i,r){super(s),s!==Symbol("SKIP_SETUP")&&(r&&this.configure_(r),this.SERIALIZABLE=!0,this.setValue((s==null?void 0:s.toString())||""),i&&this.setValidator(i))}configure_(s){super.configure_(s),s.maxLines&&this.setMaxLines(s.maxLines)}toXml(s){return s.textContent=this.getValue().replace(/\n/g," "),s}fromXml(s){this.setValue(s.textContent.replace(/ /g,` +`),r($e.TOOLBOX,Ws,Jy);var vT="11.2.2",yT=xe.INPUT_VALUE,_T=xe.OUTPUT_VALUE,wT=xe.NEXT_STATEMENT,kT=xe.PREVIOUS_STATEMENT,CT=Ge.TOP,TT=Ge.BOTTOM,ST=Ge.LEFT,ET=Ge.RIGHT;gn.prototype.newBlock=function(e,t){return new Uo(this,e,t)},cs.prototype.newBlock=function(e,t){return new $s(this,e,t)},gn.prototype.newComment=function(e){return new El(this,e)},cs.prototype.newComment=function(e){return new Il(this,e)},cs.newTrashcan=function(e){return new Gv(e)},vo.prototype.newWorkspaceSvg=function(e){return new cs(e)},i.Names$$module$build$src$core$names.prototype.populateProcedures=function(e){e=qa(e),e=e[0].concat(e[1]);for(let t=0;t{this.setState({popper:x.I18n.t("Copied"),anchorEl:i}),setTimeout(()=>this.setState({popper:"",anchorEl:null}),1e3)},50)}render(){const s=new Blob([this.props.text],{type:"application/xml"}),i=`${this.props.scriptId.substring(10)}.xml`;return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"lg",sx:{"& .MuiDialog-paper":Wr.dialog},fullWidth:!0,open:!0,"aria-labelledby":"export-dialog-title",children:[m.jsx(ss,{id:"export-dialog-title",children:x.I18n.t("Export selected blocks")}),m.jsx(qt,{style:Wr.overflowY,children:m.jsx("pre",{id:"export-text",style:{...Wr.textArea,...this.props.themeType==="dark"?void 0:Wr.textAreaLight},children:this.props.text})}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",color:"secondary",startIcon:m.jsx(kc,{}),children:m.jsx("a",{download:i,target:"_blank",rel:"noreferrer",href:URL.createObjectURL(s),style:{textDecoration:"inherit",color:"inherit"},children:x.I18n.t("Download as file")})}),m.jsx(He,{variant:"contained",onClick:r=>this.onCopy(r),color:"secondary",startIcon:m.jsx(cx,{}),children:x.I18n.t("Copy to clipboard")}),m.jsx(He,{variant:"contained",onClick:()=>this.handleCancel(),color:"primary",startIcon:m.jsx(so,{}),children:x.I18n.t("Close")}),m.jsx(YT,{id:"popper",style:{zIndex:1e4},open:!!this.state.popper,placement:"top",anchorEl:this.state.anchorEl,transition:!0,children:({TransitionProps:r})=>m.jsx(JT,{...r,timeout:350,children:m.jsx(Ow,{children:m.jsx("p",{style:Wr.typography,children:this.state.popper})})})}),m.jsx("textarea",{id:"copy_input",readOnly:!0,style:{position:"absolute",left:-9999},tabIndex:-1,"aria-hidden":!0,value:this.props.text})]})]},"export-dialog")}}const Mt={textArea:{width:"calc(100% - 10px)",height:"calc(80% - 20px)",resize:"none",fontFamily:"monospace",fontSize:"1em",backgroundColor:"transparent",borderRadius:4,outline:"none"},dropzone:{marginTop:20,width:"100%",borderWidth:5,borderStyle:"dashed",borderColor:"#d0cccc",textAlign:"center",boxSizing:"border-box",paddingTop:45,borderRadius:10,height:"calc(100% - 10px)"},dropzoneDiv:{width:"100%",height:"20%",position:"relative"},dropzoneRejected:{borderColor:"#970000"},dropzoneAccepted:{borderColor:"#17cd02"},icon:{height:"80%",width:"80%",opacity:.3,color:"#eeeeee",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",zIndex:0},iconError:{color:"#ffc3c6"},iconOk:{color:"#aaeebc"},text:{top:"50%",left:"50%",transform:"translate(-50%,-50%)",color:"#868686",position:"absolute",zIndex:1},dialog:{height:"95%"},fullHeight:{height:"100%",overflow:"hidden"}};class Gm extends _e.Component{constructor(s){super(s),this.state={text:"",imageStatus:"",error:""}}componentDidMount(){setTimeout(()=>{var s;try{(s=window.document.getElementById("import-text-area"))==null||s.focus()}catch{}},100)}static readFileDataUrl(s,i){const r=new FileReader;r.onload=()=>{i(null,{data:r.result,name:s.name})},r.onabort=()=>{console.error("file reading was aborted"),i(x.I18n.t("file reading was aborted"))},r.onerror=l=>{console.error("file reading has failed"),i(x.I18n.t("file reading has failed: %s",l))},r.readAsText(s)}handleDropFile(s){if(!(s!=null&&s.length))return;const i=s[s.length-1];i&&Gm.readFileDataUrl(i,(r,l)=>{var c;r||!l?this.setState({error:r||"No data"}):this.setState({text:((c=l.data)==null?void 0:c.toString())||""})})}handleCancel(){this.props.onClose()}handleOk(){this.props.onClose(this.state.text)}onChange(s){this.setState({text:s.target.value})}render(){const s={...Mt.dropzone,...this.state.imageStatus==="accepted"?Mt.dropzoneAccepted:this.state.imageStatus==="rejected"?Mt.dropzoneRejected:void 0};return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"lg",sx:{"& .MuiDialog-paper":Mt.dialog},fullWidth:!0,open:!0,"aria-labelledby":"import-dialog-title",children:[m.jsx(ss,{id:"import-dialog-title",children:x.I18n.t("Import blocks")}),m.jsxs(qt,{style:Mt.fullHeight,children:[m.jsx("textarea",{autoFocus:!0,id:"import-text-area",placeholder:x.I18n.t("Paste your blocks here"),style:{...Mt.textArea,color:this.props.themeType==="dark"?"#ffffff":"#000000"},onChange:i=>this.onChange(i),value:this.state.text}),m.jsx(Lw,{maxSize:5e7,onDrop:(i,r)=>{var l,c,d;i.length?this.handleDropFile(i):window.alert(((d=(c=(l=r==null?void 0:r[0])==null?void 0:l.errors)==null?void 0:c[0])==null?void 0:d.message)||x.I18n.t("ra_Cannot upload"))},multiple:!1,accept:{"text/plain":[],"text/xml":[],"application/xml":[]},children:({getRootProps:i,getInputProps:r,isDragActive:l,isDragReject:c})=>c?(this.state.imageStatus!=="rejected"&&this.setState({imageStatus:"rejected"}),m.jsxs("div",{style:{...s,...Mt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Mt.text,children:x.I18n.t("Some files will be rejected")},"text"),m.jsx(Yc,{style:{...Mt.icon,...Mt.iconError}},"icon")]})):l?(this.state.imageStatus!=="accepted"&&this.setState({imageStatus:"accepted"}),m.jsxs("div",{style:{...s,...Mt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Mt.text,children:x.I18n.t("All files will be accepted")},"text"),m.jsx(Pw,{style:{...Mt.icon,...Mt.iconOk}},"icon")]})):(this.state.imageStatus!=="wait"&&this.setState({imageStatus:"wait"}),m.jsxs("div",{style:{...s,...Mt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Mt.text,children:x.I18n.t("Drop some files here or click...")},"text"),m.jsx(Bw,{style:Mt.icon},"icon")]}))})]}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",disabled:!this.state.text,onClick:()=>this.handleOk(),color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Import")}),m.jsx(He,{color:"grey",variant:"contained",onClick:()=>this.handleCancel(),startIcon:m.jsx(so,{}),children:x.I18n.t("Close")})]})]})}}const Fe=window.Blockly;class vg extends Error{constructor(){super("The field has not yet been attached to its input. Call appendField to attach it.")}}class Oc extends Fe.Field{textGroup=null;borderRect_=null;maxLines_=1/0;isOverflowedY_=!1;constructor(s,i,r){super(s),s!==Symbol("SKIP_SETUP")&&(r&&this.configure_(r),this.SERIALIZABLE=!0,this.setValue((s==null?void 0:s.toString())||""),i&&this.setValidator(i))}configure_(s){super.configure_(s),s.maxLines&&this.setMaxLines(s.maxLines)}toXml(s){return s.textContent=this.getValue().replace(/\n/g," "),s}fromXml(s){this.setValue(s.textContent.replace(/ /g,` `))}saveState(){const s=this.saveLegacyState(Oc);return s!==null?s:this.getValue()}loadState(s){this.loadLegacyState(Fe.Field,s)||this.setValue(s)}initView(){this.createBorderRect_(),this.textGroup=Fe.utils.dom.createSvgElement(Fe.utils.Svg.G,{class:"blocklyEditableText"},this.fieldGroup_)}onHtmlInputKeyDownSuper_(s){s.key==="Enter"?(Fe.WidgetDiv.hideIfOwner(this),Fe.dropDownDiv.hideWithoutAnimation()):s.key==="Escape"?(this.setValue(this.htmlInput_.getAttribute("data-untyped-default-value"),!1),Fe.WidgetDiv.hideIfOwner(this),Fe.dropDownDiv.hideWithoutAnimation()):s.key==="Tab"&&(Fe.WidgetDiv.hideIfOwner(this),Fe.dropDownDiv.hideWithoutAnimation(),this.sourceBlock_.tab(this,!s.shiftKey),s.preventDefault())}onHtmlInputChange_(s){const i=this.value_;this.setValue(this.getValueFromEditorText_(this.htmlInput_.value),!1),this.sourceBlock_&&Fe.Events.isEnabled()&&this.value_!==i&&Fe.Events.fire(new(Fe.Events.get("block_field_intermediate_change"))(this.sourceBlock_,this.name||null,i,this.value_))}onFinishEditing_(s){}getValueFromEditorText_(s){return s}bindInputEvents_(s){this.onKeyDownWrapper_=Fe.browserEvents.conditionalBind(s,"keydown",this,this.onHtmlInputKeyDown_),this.onKeyInputWrapper_=Fe.browserEvents.conditionalBind(s,"input",this,this.onHtmlInputChange_)}getDisplayText_(){const s=this.getSourceBlock();if(!s)throw new Error("The field has not yet been attached to its input. Call appendField to attach it.");let i=this.getText();if(!i)return Fe.Field.NBSP;const r=i.split(` `);i="";const l=this.isOverflowedY_?this.maxLines_:r.length;for(let c=0;cthis.maxDisplayLength?d=`${d.substring(0,this.maxDisplayLength-4)}...`:this.isOverflowedY_&&c===l-1&&(d=`${d.substring(0,d.length-3)}...`),d=d.replace(/\s/g,Fe.Field.NBSP),i+=d,c!==l-1&&(i+=` `)}return s.RTL&&(i+="‏"),i}doValueUpdate_(s){super.doValueUpdate_(s),this.value_!==null&&(this.isOverflowedY_=this.value_.split(` `).length>this.maxLines_)}render_(){const s=this.getSourceBlock();if(!s)throw new Error("The field has not yet been attached to its input. Call appendField to attach it.");let i;const r=this.textGroup;for(;i=r.firstChild;)r.removeChild(i);const l=this.getConstants();if(!l)throw Error("Constants not found");const c=this.getDisplayText_().split(` `);let d=0;for(let h=0;hd&&(d=b),h+=s.FIELD_TEXT_HEIGHT+(p>0?s.FIELD_BORDER_RECT_Y_PADDING:0)}if(this.isBeingEdited_){const p=String(this.value_).split(` -`),f=Fe.utils.dom.createSvgElement(Fe.utils.Svg.TEXT,{class:"blocklyText blocklyMultilineText"});for(let w=0;wthis.maxDisplayLength&&(p[w]=p[w].substring(0,this.maxDisplayLength)),f.textContent=p[w];const v=Fe.utils.dom.getFastTextWidth(f,r,l,c);v>d&&(d=v)}const b=this.htmlInput_,y=b.offsetWidth-b.clientWidth;d+=y}this.borderRect_&&(h+=s.FIELD_BORDER_RECT_Y_PADDING*2,d+=s.FIELD_BORDER_RECT_X_PADDING*2+1,this.borderRect_.setAttribute("width",`${d}`),this.borderRect_.setAttribute("height",`${h}`)),this.size_.width=d,this.size_.height=h,this.positionBorderRect_()}showInlineEditor_(s){const i=this.getSourceBlock();if(!i)throw new $g;Fe.WidgetDiv.show(this,i.RTL,this.widgetDispose_.bind(this),this.workspace_),this.htmlInput_=this.widgetCreate_(),this.isBeingEdited_=!0,this.valueWhenEditorWasOpened_=this.value_,s||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())}getEditorText_(s){return`${s}`}getScaledBBox(){let s,i,r;const l=this.getSourceBlock();if(!l)throw new $g;if(this.isFullBlockField()){const c=this.sourceBlock_.getHeightWidth(),d=l.workspace.scale;r=this.getAbsoluteXY_(),s=(c.width+1)*d,i=(c.height+1)*d,Fe.utils.userAgent.GECKO?(r.x+=1.5*d,r.y+=1.5*d):(r.x-=.5*d,r.y-=.5*d)}else{const c=this.borderRect_.getBoundingClientRect();r=Fe.utils.style.getPageOffset(this.borderRect_),s=c.width,i=c.height}return new Fe.utils.Rect(r.y,r.y+i,r.x,r.x+s)}resizeEditor_(){Fe.renderManagement.finishQueuedRenders().then(()=>{const s=this.getSourceBlock();if(!s)throw new $g;const i=Fe.WidgetDiv.getDiv(),r=this.getScaledBBox();i.style.width=`${r.right-r.left}px`,i.style.height=`${r.bottom-r.top}px`;const l=s.RTL?r.right-i.offsetWidth:r.left,c=r.top;i.style.left=`${l}px`,i.style.top=`${c}px`})}unbindInputEvents_(){this.onKeyDownWrapper_&&(Fe.browserEvents.unbind(this.onKeyDownWrapper_),this.onKeyDownWrapper_=null),this.onKeyInputWrapper_&&(Fe.browserEvents.unbind(this.onKeyInputWrapper_),this.onKeyInputWrapper_=null)}getClickTarget_(){return this.clickTarget_||this.getSvgRoot()}widgetDispose_(){this.isBeingEdited_=!1,this.isTextValid_=!0,this.forceRerender(),this.onFinishEditing_(this.value_),this.sourceBlock_&&Fe.Events.isEnabled()&&this.valueWhenEditorWasOpened_!==null&&this.valueWhenEditorWasOpened_!==this.value_&&(Fe.Events.fire(new(Fe.Events.get("change"))(this.sourceBlock_,"field",this.name||null,this.valueWhenEditorWasOpened_,this.value_)),this.valueWhenEditorWasOpened_=null),Fe.Events.setGroup(!1),this.unbindInputEvents_();const s=Fe.WidgetDiv.getDiv().style;s.width="auto",s.height="auto",s.fontSize="",s.transition="",s.boxShadow="",this.htmlInput_=null;const i=this.getClickTarget_();if(!i)throw new Error("A click target has not been set.");Fe.utils.dom.removeClass(i,"editing")}showEditor_(s,i){this.workspace_=this.sourceBlock_.workspace,!i&&this.workspace_.options.modalInputs&&(Fe.utils.userAgent.MOBILE||Fe.utils.userAgent.ANDROID||Fe.utils.userAgent.IPAD)?this.showPromptEditor_():this.showInlineEditor_(!!i),this.forceRerender()}widgetCreate_(){const s=Fe.WidgetDiv.getDiv(),i=this.workspace_.getScale(),r=this.getConstants();if(!r)throw Error("Constants not found");const l=document.createElement("textarea");l.className="blocklyHtmlInput blocklyHtmlTextAreaInput",l.setAttribute("spellcheck",String(this.spellcheck_));const c=`${r.FIELD_TEXT_FONTSIZE*i}pt`;s.style.fontSize=c,l.style.fontSize=c;const d=`${Fe.FieldTextInput.BORDERRADIUS*i}px`;l.style.borderRadius=d;const h=r.FIELD_BORDER_RECT_X_PADDING*i,p=r.FIELD_BORDER_RECT_Y_PADDING*i/2;l.style.padding=`${p}px ${h}px ${p}px ${h}px`;const f=r.FIELD_TEXT_HEIGHT+r.FIELD_BORDER_RECT_Y_PADDING;return l.style.lineHeight=`${f*i}px`,s.appendChild(l),l.value=l.defaultValue=this.getEditorText_(this.value_),l.setAttribute("data-untyped-default-value",String(this.value_)),l.setAttribute("data-old-value",""),Fe.utils.userAgent.GECKO?setTimeout(this.resizeEditor_.bind(this),0):this.resizeEditor_(),this.bindInputEvents_(l),l}setMaxLines(s){typeof s=="number"&&s>0&&s!==this.maxLines_&&(this.maxLines_=s,this.forceRerender())}getMaxLines(){return this.maxLines_}onHtmlInputKeyDown_(s){s.key!=="Enter"&&this.onHtmlInputKeyDownSuper_(s)}static fromJson(s){const i=Fe.utils.parsing.replaceMessageReferences(s.text);return new this(i,void 0,s)}}Fe.Css.register(` +`),f=Fe.utils.dom.createSvgElement(Fe.utils.Svg.TEXT,{class:"blocklyText blocklyMultilineText"});for(let w=0;wthis.maxDisplayLength&&(p[w]=p[w].substring(0,this.maxDisplayLength)),f.textContent=p[w];const v=Fe.utils.dom.getFastTextWidth(f,r,l,c);v>d&&(d=v)}const b=this.htmlInput_,y=b.offsetWidth-b.clientWidth;d+=y}this.borderRect_&&(h+=s.FIELD_BORDER_RECT_Y_PADDING*2,d+=s.FIELD_BORDER_RECT_X_PADDING*2+1,this.borderRect_.setAttribute("width",`${d}`),this.borderRect_.setAttribute("height",`${h}`)),this.size_.width=d,this.size_.height=h,this.positionBorderRect_()}showInlineEditor_(s){const i=this.getSourceBlock();if(!i)throw new vg;Fe.WidgetDiv.show(this,i.RTL,this.widgetDispose_.bind(this),this.workspace_),this.htmlInput_=this.widgetCreate_(),this.isBeingEdited_=!0,this.valueWhenEditorWasOpened_=this.value_,s||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())}getEditorText_(s){return`${s}`}getScaledBBox(){let s,i,r;const l=this.getSourceBlock();if(!l)throw new vg;if(this.isFullBlockField()){const c=this.sourceBlock_.getHeightWidth(),d=l.workspace.scale;r=this.getAbsoluteXY_(),s=(c.width+1)*d,i=(c.height+1)*d,Fe.utils.userAgent.GECKO?(r.x+=1.5*d,r.y+=1.5*d):(r.x-=.5*d,r.y-=.5*d)}else{const c=this.borderRect_.getBoundingClientRect();r=Fe.utils.style.getPageOffset(this.borderRect_),s=c.width,i=c.height}return new Fe.utils.Rect(r.y,r.y+i,r.x,r.x+s)}resizeEditor_(){Fe.renderManagement.finishQueuedRenders().then(()=>{const s=this.getSourceBlock();if(!s)throw new vg;const i=Fe.WidgetDiv.getDiv(),r=this.getScaledBBox();i.style.width=`${r.right-r.left}px`,i.style.height=`${r.bottom-r.top}px`;const l=s.RTL?r.right-i.offsetWidth:r.left,c=r.top;i.style.left=`${l}px`,i.style.top=`${c}px`})}unbindInputEvents_(){this.onKeyDownWrapper_&&(Fe.browserEvents.unbind(this.onKeyDownWrapper_),this.onKeyDownWrapper_=null),this.onKeyInputWrapper_&&(Fe.browserEvents.unbind(this.onKeyInputWrapper_),this.onKeyInputWrapper_=null)}getClickTarget_(){return this.clickTarget_||this.getSvgRoot()}widgetDispose_(){this.isBeingEdited_=!1,this.isTextValid_=!0,this.forceRerender(),this.onFinishEditing_(this.value_),this.sourceBlock_&&Fe.Events.isEnabled()&&this.valueWhenEditorWasOpened_!==null&&this.valueWhenEditorWasOpened_!==this.value_&&(Fe.Events.fire(new(Fe.Events.get("change"))(this.sourceBlock_,"field",this.name||null,this.valueWhenEditorWasOpened_,this.value_)),this.valueWhenEditorWasOpened_=null),Fe.Events.setGroup(!1),this.unbindInputEvents_();const s=Fe.WidgetDiv.getDiv().style;s.width="auto",s.height="auto",s.fontSize="",s.transition="",s.boxShadow="",this.htmlInput_=null;const i=this.getClickTarget_();if(!i)throw new Error("A click target has not been set.");Fe.utils.dom.removeClass(i,"editing")}showEditor_(s,i){this.workspace_=this.sourceBlock_.workspace,!i&&this.workspace_.options.modalInputs&&(Fe.utils.userAgent.MOBILE||Fe.utils.userAgent.ANDROID||Fe.utils.userAgent.IPAD)?this.showPromptEditor_():this.showInlineEditor_(!!i),this.forceRerender()}widgetCreate_(){const s=Fe.WidgetDiv.getDiv(),i=this.workspace_.getScale(),r=this.getConstants();if(!r)throw Error("Constants not found");const l=document.createElement("textarea");l.className="blocklyHtmlInput blocklyHtmlTextAreaInput",l.setAttribute("spellcheck",String(this.spellcheck_));const c=`${r.FIELD_TEXT_FONTSIZE*i}pt`;s.style.fontSize=c,l.style.fontSize=c;const d=`${Fe.FieldTextInput.BORDERRADIUS*i}px`;l.style.borderRadius=d;const h=r.FIELD_BORDER_RECT_X_PADDING*i,p=r.FIELD_BORDER_RECT_Y_PADDING*i/2;l.style.padding=`${p}px ${h}px ${p}px ${h}px`;const f=r.FIELD_TEXT_HEIGHT+r.FIELD_BORDER_RECT_Y_PADDING;return l.style.lineHeight=`${f*i}px`,s.appendChild(l),l.value=l.defaultValue=this.getEditorText_(this.value_),l.setAttribute("data-untyped-default-value",String(this.value_)),l.setAttribute("data-old-value",""),Fe.utils.userAgent.GECKO?setTimeout(this.resizeEditor_.bind(this),0):this.resizeEditor_(),this.bindInputEvents_(l),l}setMaxLines(s){typeof s=="number"&&s>0&&s!==this.maxLines_&&(this.maxLines_=s,this.forceRerender())}getMaxLines(){return this.maxLines_}onHtmlInputKeyDown_(s){s.key!=="Enter"&&this.onHtmlInputKeyDownSuper_(s)}static fromJson(s){const i=Fe.utils.parsing.replaceMessageReferences(s.text);return new this(i,void 0,s)}}Fe.Css.register(` .blocklyHtmlTextAreaInput { font-family: monospace; resize: none; @@ -1027,7 +1027,7 @@ Blockly.YourGeneratorName.nameDB_.setVariableMap(workspace.getVariableMap());`), .blocklyHtmlTextAreaInputOverflowedY { overflow-y: scroll; } -`);const yC="text_multiline",oO={type:yC,message0:"%1 %2",args0:[{type:"field_image",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAARCAYAAADpPU2iAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAdhgAAHYYBXaITgQAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS42/U4J6AAAAP1JREFUOE+Vks0KQUEYhjmRIja4ABtZ2dm5A3t3Ia6AUm7CylYuQRaUhZSlLZJiQbFAyRnPN33y01HOW08z8873zpwzM4F3GWOCruvGIE4/rLaV+Nq1hVGMBqzhqlxgCys4wJA65xnogMHsQ5lujnYHTejBBCK2mE4abjCgMGhNxHgDFWjDSG07kdfVa2pZMf4ZyMAdWmpZMfYOsLiDMYMjlMB+K613QISRhTnITnsYg5yUd0DETmEoMlkFOeIT/A58iyK5E18BuTBfgYXfwNJv4P9/oEBerLylOnRhygmGdPpTTBZAPkde61lbQe4moWUvYUZYLfUNftIY4zwA5X2Z9AYnQrEAAAAASUVORK5CYII=",width:12,height:17,alt:"¶"},{type:"field_multilinetext",name:"TEXT",text:""}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_TEXT_HELPURL}",tooltip:"%{BKY_TEXT_TEXT_TOOLTIP}",extensions:["parent_tooltip_when_inline"]};function iO(a,s){const i=s.multiline_quote_(a.getFieldValue("TEXT")),r=i.indexOf("+")!==-1?6.2:0;return[i,r]}const nO=window.Blockly.common.createBlockDefinitionsFromJsonArray([oO]);nO[yC];const Je=window.Blockly;class rm extends Je.Field{picker=null;highlightedIndex=null;boundEvents=[];SERIALIZABLE=!0;CURSOR="default";isDirty_=!1;colours=["#ffffff","#cccccc","#c0c0c0","#999999","#666666","#333333","#000000","#ffcccc","#ff6666","#ff0000","#cc0000","#990000","#660000","#330000","#ffcc99","#ff9966","#ff9900","#ff6600","#cc6600","#993300","#663300","#ffff99","#ffff66","#ffcc66","#ffcc33","#cc9933","#996633","#663333","#ffffcc","#ffff33","#ffff00","#ffcc00","#999900","#666600","#333300","#99ff99","#66ff99","#33ff33","#33cc00","#009900","#006600","#003300","#99ffff","#33ffff","#66cccc","#00cccc","#339999","#336666","#003333","#ccffff","#66ffff","#33ccff","#3366ff","#3333ff","#000099","#000066","#ccccff","#9999ff","#6666cc","#6633ff","#6600cc","#333399","#330099","#ffccff","#ff99ff","#cc66cc","#cc33cc","#993399","#663366","#330033"];titles=[];columns=7;constructor(s,i,r){super(s),s!==Symbol("SKIP_SETUP")&&(r&&this.configure_(r),this.setValue(s),i&&this.setValidator(i))}configure_(s){super.configure_(s),s.colourOptions&&(this.colours=s.colourOptions),s.colourTitles&&(this.titles=s.colourTitles),s.columns&&(this.columns=s.columns)}initView(){const s=this.getConstants();if(!s)throw Error("Constants not found");this.size_=new Je.utils.Size(s.FIELD_COLOUR_DEFAULT_WIDTH,s.FIELD_COLOUR_DEFAULT_HEIGHT),this.createBorderRect_(),this.getBorderRect().style.fillOpacity="1",this.getBorderRect().setAttribute("stroke","#fff"),this.isFullBlockField()&&(this.clickTarget_=this.sourceBlock_.getSvgRoot())}isFullBlockField(){if(!this.getSourceBlock())throw new Je.UnattachedFieldError;const i=this.getConstants();return this.blockIsSimpleReporter()&&!!(i!=null&&i.FIELD_COLOUR_FULL_BLOCK)}blockIsSimpleReporter(){const s=this.getSourceBlock();if(!s)throw new Je.UnattachedFieldError;if(!s.outputConnection)return!1;for(const i of s.inputList)if(i.connection||i.fieldRow.length>1)return!1;return!0}applyColour(){const s=this.getSourceBlock();if(!s)throw new Je.UnattachedFieldError;if(!this.fieldGroup_)return;const i=this.borderRect_;if(!i)throw new Error("The border rect has not been initialized");this.isFullBlockField()?(i.style.display="none",s.pathObject.svgPath.setAttribute("fill",this.getValue()),s.pathObject.svgPath.setAttribute("stroke","#fff")):(i.style.display="block",i.style.fill=this.getValue())}getSize(){var s;return(s=this.getConstants())!=null&&s.FIELD_COLOUR_FULL_BLOCK&&(this.render_(),this.isDirty_=!1),super.getSize()}render_(){super.render_();const s=this.getSourceBlock();if(!s)throw new Je.UnattachedFieldError;s.applyColour()}updateSize_(s){const i=this.getConstants();if(!i)return;let r,l;this.isFullBlockField()?(r=(s??0)*2,l=i.FIELD_TEXT_HEIGHT):(r=i.FIELD_COLOUR_DEFAULT_WIDTH,l=i.FIELD_COLOUR_DEFAULT_HEIGHT),this.size_.height=l,this.size_.width=r,this.positionBorderRect_()}doClassValidation_(s){return typeof s!="string"?null:Je.utils.colour.parse(s)}getText(){let s=this.value_;return/^#(.)\1(.)\2(.)\3$/.test(s)&&(s=`#${s[1]}${s[3]}${s[5]}`),s}setColours(s,i){return this.colours=s,i&&(this.titles=i),this}setColumns(s){return this.columns=s,this}showEditor_(){if(this.dropdownCreate(),!this.picker)throw Error("Picker not found");Je.DropDownDiv.getContentDiv().appendChild(this.picker),Je.DropDownDiv.showPositionedByField(this,this.dropdownDispose.bind(this)),this.picker.focus({preventScroll:!0})}onClick(s){const i=s.target,r=i==null?void 0:i.getAttribute("data-colour");r!==null&&(this.setValue(r),Je.DropDownDiv.hideIfOwner(this))}onKeyDown(s){let i=!0,r;switch(s.key){case"ArrowUp":this.moveHighlightBy(0,-1);break;case"ArrowDown":this.moveHighlightBy(0,1);break;case"ArrowLeft":this.moveHighlightBy(-1,0);break;case"ArrowRight":this.moveHighlightBy(1,0);break;case"Enter":if(r=this.getHighlighted(),r){const l=r.getAttribute("data-colour");l!==null&&this.setValue(l)}Je.DropDownDiv.hideWithoutAnimation();break;default:i=!1}i&&s.stopPropagation()}moveHighlightBy(s,i){if(!this.highlightedIndex)return;const r=this.colours,l=this.columns;let c=this.highlightedIndex%l,d=Math.floor(this.highlightedIndex/l);c+=s,d+=i,s<0?c<0&&d>0?(c=l-1,d--):c<0&&(c=0):s>0?c>l-1&&dl-1&&c--:i<0?d<0&&(d=0):i>0&&d>Math.floor(r.length/l)-1&&(d=Math.floor(r.length/l)-1);const h=this.picker.childNodes[d].childNodes[c],p=d*l+c;this.setHighlightedCell(h,p)}onMouseMove(s){const i=s.target,r=i&&Number(i.getAttribute("data-index"));r!==null&&r!==this.highlightedIndex&&this.setHighlightedCell(i,r)}onMouseEnter(){var s;(s=this.picker)==null||s.focus({preventScroll:!0})}onMouseLeave(){var i;(i=this.picker)==null||i.blur();const s=this.getHighlighted();s&&Je.utils.dom.removeClass(s,"blocklyColourHighlighted")}getHighlighted(){var l;if(!this.highlightedIndex)return null;const s=this.highlightedIndex%this.columns,i=Math.floor(this.highlightedIndex/this.columns),r=(l=this.picker)==null?void 0:l.childNodes[i];return r?r.childNodes[s]:null}setHighlightedCell(s,i){const r=this.getHighlighted();r&&Je.utils.dom.removeClass(r,"blocklyColourHighlighted"),Je.utils.dom.addClass(s,"blocklyColourHighlighted"),this.highlightedIndex=i;const l=s.getAttribute("id");l&&this.picker&&Je.utils.aria.setState(this.picker,Je.utils.aria.State.ACTIVEDESCENDANT,l)}dropdownCreate(){const s=this.columns,i=this.colours,r=this.getValue(),l=document.createElement("table");l.className="blocklyColourTable",l.tabIndex=0,l.dir="ltr",Je.utils.aria.setRole(l,Je.utils.aria.Role.GRID),Je.utils.aria.setState(l,Je.utils.aria.State.EXPANDED,!0),Je.utils.aria.setState(l,Je.utils.aria.State.ROWCOUNT,Math.floor(i.length/s)),Je.utils.aria.setState(l,Je.utils.aria.State.COLCOUNT,s);let c=null;for(let d=0;d1)return!1;return!0}applyColour(){const s=this.getSourceBlock();if(!s)throw new Je.UnattachedFieldError;if(!this.fieldGroup_)return;const i=this.borderRect_;if(!i)throw new Error("The border rect has not been initialized");this.isFullBlockField()?(i.style.display="none",s.pathObject.svgPath.setAttribute("fill",this.getValue()),s.pathObject.svgPath.setAttribute("stroke","#fff")):(i.style.display="block",i.style.fill=this.getValue())}getSize(){var s;return(s=this.getConstants())!=null&&s.FIELD_COLOUR_FULL_BLOCK&&(this.render_(),this.isDirty_=!1),super.getSize()}render_(){super.render_();const s=this.getSourceBlock();if(!s)throw new Je.UnattachedFieldError;s.applyColour()}updateSize_(s){const i=this.getConstants();if(!i)return;let r,l;this.isFullBlockField()?(r=(s??0)*2,l=i.FIELD_TEXT_HEIGHT):(r=i.FIELD_COLOUR_DEFAULT_WIDTH,l=i.FIELD_COLOUR_DEFAULT_HEIGHT),this.size_.height=l,this.size_.width=r,this.positionBorderRect_()}doClassValidation_(s){return typeof s!="string"?null:Je.utils.colour.parse(s)}getText(){let s=this.value_;return/^#(.)\1(.)\2(.)\3$/.test(s)&&(s=`#${s[1]}${s[3]}${s[5]}`),s}setColours(s,i){return this.colours=s,i&&(this.titles=i),this}setColumns(s){return this.columns=s,this}showEditor_(){if(this.dropdownCreate(),!this.picker)throw Error("Picker not found");Je.DropDownDiv.getContentDiv().appendChild(this.picker),Je.DropDownDiv.showPositionedByField(this,this.dropdownDispose.bind(this)),this.picker.focus({preventScroll:!0})}onClick(s){const i=s.target,r=i==null?void 0:i.getAttribute("data-colour");r!==null&&(this.setValue(r),Je.DropDownDiv.hideIfOwner(this))}onKeyDown(s){let i=!0,r;switch(s.key){case"ArrowUp":this.moveHighlightBy(0,-1);break;case"ArrowDown":this.moveHighlightBy(0,1);break;case"ArrowLeft":this.moveHighlightBy(-1,0);break;case"ArrowRight":this.moveHighlightBy(1,0);break;case"Enter":if(r=this.getHighlighted(),r){const l=r.getAttribute("data-colour");l!==null&&this.setValue(l)}Je.DropDownDiv.hideWithoutAnimation();break;default:i=!1}i&&s.stopPropagation()}moveHighlightBy(s,i){if(!this.highlightedIndex)return;const r=this.colours,l=this.columns;let c=this.highlightedIndex%l,d=Math.floor(this.highlightedIndex/l);c+=s,d+=i,s<0?c<0&&d>0?(c=l-1,d--):c<0&&(c=0):s>0?c>l-1&&dl-1&&c--:i<0?d<0&&(d=0):i>0&&d>Math.floor(r.length/l)-1&&(d=Math.floor(r.length/l)-1);const h=this.picker.childNodes[d].childNodes[c],p=d*l+c;this.setHighlightedCell(h,p)}onMouseMove(s){const i=s.target,r=i&&Number(i.getAttribute("data-index"));r!==null&&r!==this.highlightedIndex&&this.setHighlightedCell(i,r)}onMouseEnter(){var s;(s=this.picker)==null||s.focus({preventScroll:!0})}onMouseLeave(){var i;(i=this.picker)==null||i.blur();const s=this.getHighlighted();s&&Je.utils.dom.removeClass(s,"blocklyColourHighlighted")}getHighlighted(){var l;if(!this.highlightedIndex)return null;const s=this.highlightedIndex%this.columns,i=Math.floor(this.highlightedIndex/this.columns),r=(l=this.picker)==null?void 0:l.childNodes[i];return r?r.childNodes[s]:null}setHighlightedCell(s,i){const r=this.getHighlighted();r&&Je.utils.dom.removeClass(r,"blocklyColourHighlighted"),Je.utils.dom.addClass(s,"blocklyColourHighlighted"),this.highlightedIndex=i;const l=s.getAttribute("id");l&&this.picker&&Je.utils.aria.setState(this.picker,Je.utils.aria.State.ACTIVEDESCENDANT,l)}dropdownCreate(){const s=this.columns,i=this.colours,r=this.getValue(),l=document.createElement("table");l.className="blocklyColourTable",l.tabIndex=0,l.dir="ltr",Je.utils.aria.setRole(l,Je.utils.aria.Role.GRID),Je.utils.aria.setState(l,Je.utils.aria.State.EXPANDED,!0),Je.utils.aria.setState(l,Je.utils.aria.State.ROWCOUNT,Math.floor(i.length/s)),Je.utils.aria.setState(l,Je.utils.aria.State.COLCOUNT,s);let c=null;for(let d=0;d{typeof a[s]=="function"&&(a.forBlock[s]||(console.log(`Migrating Blockly.JavaScript.${s} to Blockly.JavaScript.forBlock.${s}`),a.forBlock[s]=a[s],delete a[s]))})}let cc=!1,uc=!1,bg=null,vg=null;const hw=[];function TC(a,s,i,r){var l;if(r=r||[],(a.tagName==="BLOCK"||a.tagName==="block")&&(i=a.id),a.tagName==="FIELD"||a.tagName==="field")for(let c=0;cTC(c,s,i,r)),r}class et extends _e.Component{blockly=null;blocklyWorkspace=null;originalCode;someSelected=null;changeTimer=null;someSelectedTime=0;ignoreChanges=!1;blinkBlock;onResizeBind;didUpdate=null;lastCommand="";lastSearch;static Blockly=window.Blockly;constructor(s){super(s),this.state={languageOwnLoaded:uc,languageBlocklyLoaded:cc,changed:!1,message:"",error:"",themeType:this.props.themeType,exportText:"",importText:!1,searchText:this.props.searchText||"",showInputPrompt:null},this.originalCode=s.code||"",this.someSelected=null,this.onResizeBind=this.onResize.bind(this),this.lastSearch=this.props.searchText||"",this.blinkBlock=null,bO(),et.Blockly.dialog.setPrompt(this.onShowNameDialog),this.loadLanguages()}onShowNameDialog=(s,i,r)=>{this.setState({showInputPrompt:{promptText:s,defaultText:i,callback:r,value:i}})};static loadJS(s,i,r){const l=document.createElement("script");try{l.src=s,l.onload=i,l.onerror=i,(r||window.document.body).appendChild(l)}catch(c){console.error(`Cannot load ${s}: ${c}`),i&&i()}}static loadScripts(s,i){if(!(s!=null&&s.length)){i&&i();return}const r=s.pop();r&&!hw.includes(r)?(hw.push(r),et.loadJS(`../../adapter/${r}/blockly.js`,()=>setTimeout(()=>et.loadScripts(s,i),0))):setTimeout(()=>et.loadScripts(s,i),0)}static loadCustomBlockly(s,i){var l;const r=[];for(const c in s)!Object.prototype.hasOwnProperty.call(s,c)||!s[c]||!c.match(/^system\.adapter\./)||s[c].type!=="adapter"||(l=s[c].common)!=null&&l.blockly&&(console.log(`Detected custom blockly: ${s[c].common.name}`),r.push(s[c].common.name));et.loadScripts(r,i)}static loadXMLDoc(s){let i;return window.DOMParser?i=r=>new window.DOMParser().parseFromString(r,"text/xml"):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("Microsoft.XMLDOM")?i=r=>{const l=new window.ActiveXObject("Microsoft.XMLDOM");return l.async="false",l.loadXML(r),l}:i=()=>null,i(s)}searchBlocks(s){if(this.blocklyWorkspace){const i=et.Blockly.Xml.workspaceToDom(this.blocklyWorkspace),r=TC(i,s.toLowerCase());return console.log(`Search "${s}" found blocks: ${r.length?JSON.stringify(r):"none"}`),r}return[]}searchId(){const s=this.lastSearch?this.searchBlocks(this.lastSearch):null;s!=null&&s.length?(this.someSelected=s,this.someSelected.forEach(i=>{var r;return(r=this.blocklyWorkspace)==null?void 0:r.highlightBlock(i,!0)}),this.someSelectedTime=Date.now()):this.someSelected&&(this.someSelected.forEach(i=>{var r;return(r=this.blocklyWorkspace)==null?void 0:r.highlightBlock(i,!1)}),this.someSelected=null)}UNSAFE_componentWillReceiveProps(s){s.command&&this.lastCommand!==s.command&&(this.lastCommand=s.command,setTimeout(()=>this.lastCommand="",300),this.lastCommand==="check"?this.blocklyCheckBlocks((i,r)=>{i?(r&&et.blocklyBlinkBlock(r),this.setState({error:{text:x.I18n.t(i),title:x.I18n.t("Error was found")}}),this.blinkBlock=r):this.setState({message:x.I18n.t("Ok")})}):this.lastCommand==="export"?this.exportBlocks():this.lastCommand==="import"&&this.importBlocks()),s.searchText!==this.lastSearch&&(this.lastSearch=s.searchText,this.searchId()),this.state.themeType!==s.themeType&&this.setState({themeType:s.themeType},()=>this.updateBackground()),this.originalCode!==s.code&&(this.originalCode=s.code||"",this.loadCode(),this.searchId())}loadLanguages(){if(!cc){const s=window.document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("src",`google-blockly/msg/js/${x.I18n.getLanguage()}.js`),s.onload=()=>{cc=!0,this.setState({languageBlocklyLoaded:cc})},window.document.getElementsByTagName("head")[0].appendChild(s)}if(!uc){const s=window.document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("src",`google-blockly/own/msg/${x.I18n.getLanguage()}.js`),s.onload=()=>{uc=!0,this.setState({languageOwnLoaded:uc})},window.document.getElementsByTagName("head")[0].appendChild(s)}}onResize(){this.blocklyWorkspace&&et.Blockly.svgResize(this.blocklyWorkspace)}static jsCode2Blockly(s){s=s||"";const i=s.split(/[\r\n]+|\r|\n/g);let r="";for(let c=i.length-1;c>=0;c--)if(i[c].substring(0,2)==="//"){r=i[c].substring(2);break}if(r.substring(0,4)==="s.select(),i),setTimeout(()=>s.unselect(),i+150)}blocklyRemoveOrphanedShadows(){if(this.blocklyWorkspace){const s=this.blocklyWorkspace.getAllBlocks();let i;for(let r=0;i=s[r];r++)if(i.isShadow()){const l=i.getConnections_(!0);let c;for(let d=0;c=l[d];d++)if(!c.targetConnection){i.dispose();break}}}}blocklyCheckBlocks(s){let i;if(!this.blocklyWorkspace||this.blocklyWorkspace.getAllBlocks().length===0)return s&&s("no blocks found"),!1;let r=this.blocklyGetUnconnectedBlock();return r?i="not properly connected":(r=this.blocklyGetBlockWithWarning(),r&&(i="warning on this block")),r?(s?s(i,r):et.blocklyBlinkBlock(r),!1):(s(),!0)}blocklyGetUnconnectedBlock(){var r;const s=(r=this.blocklyWorkspace)==null?void 0:r.getAllBlocks();let i;if(s)for(let l=0;i=s[l];l++){const c=i.getConnections_(!0);let d;for(let h=0;d=c[h];h++)if(!d.sourceBlock_||(d.type===et.Blockly.INPUT_VALUE||d.type===et.Blockly.OUTPUT_VALUE)&&!d.targetConnection&&!d._optional)return i}return null}blocklyGetBlockWithWarning(){var r;const s=(r=this.blocklyWorkspace)==null?void 0:r.getAllBlocks();let i;if(s){for(let l=0;i=s[l];l++)if(i.warning)return i}return null}blocklyCode2JSCode(s){if(!this.blocklyWorkspace)return"";let i=et.Blockly.JavaScript.workspaceToCode(this.blocklyWorkspace);if(!s){i+=` -`;const r=et.Blockly.Xml.workspaceToDom(this.blocklyWorkspace),l=et.Blockly.Xml.domToText(r);i+=`//${btoa(encodeURIComponent(l))}`}return i}exportBlocks(){if(!this.blocklyWorkspace)return;let s;const i=et.Blockly.getSelected();if(i){const r=et.Blockly.Xml.blockToDom(i),l=i.getRelativeToSurfaceXY();r.setAttribute("x",(i.RTL?-l.x:l.x).toString()),r.setAttribute("y",l.y.toString()),s=et.Blockly.Xml.domToPrettyText(r)}else{const r=et.Blockly.Xml.workspaceToDom(this.blocklyWorkspace);s=et.Blockly.Xml.domToPrettyText(r)}this.setState({exportText:s})}importBlocks(){this.setState({importText:!0})}onImportBlocks(s){if(this.blocklyWorkspace&&(s=(s||"").trim(),s))try{s.startsWith("${s}`),s=s.replace(/[\n\r]/g,"").replace(/.*<\/variables>/g,""),window.scripts.loading=!0;const i=et.Blockly.utils.xml.textToDom(s);et.Blockly.Xml.appendDomToWorkspace(i,this.blocklyWorkspace),window.scripts.loading=!1,this.onBlocklyChanged()}catch(i){this.setState({error:{text:i.toString(),title:x.I18n.t("Import error")}})}}loadCode(){if(this.blocklyWorkspace){this.ignoreChanges=!0,this.blocklyWorkspace.clear();try{const s=et.jsCode2Blockly(this.originalCode)||'';window.scripts.loading=!0;const i=et.Blockly.utils.xml.textToDom(s);et.Blockly.Xml.domToWorkspace(i,this.blocklyWorkspace),window.scripts.loading=!1}catch(s){console.error(s),setTimeout(()=>this.setState({error:x.I18n.t("Cannot extract Blockly code!")}))}setTimeout(()=>this.ignoreChanges=!1,100)}}onBlocklyChanged(){this.blocklyRemoveOrphanedShadows(),this.setState({changed:!0}),this.onChange()}async componentDidUpdate(){if(!this.blockly||(this.didUpdate&&(clearTimeout(this.didUpdate),this.didUpdate=null),this.blocklyWorkspace))return;window.addEventListener("resize",this.onResizeBind,!1),bg=bg||await this.getToolbox(),vg=vg||et.Blockly.utils.xml.textToDom(bg),this.blocklyWorkspace=et.Blockly.inject(this.blockly,{renderer:"thrasos",theme:this.state.themeType==="dark"?dw:"classic",media:"google-blockly/media/",toolbox:vg,zoom:{controls:!0,wheel:!1,startScale:1,maxScale:3,minScale:.3,scaleSpeed:1.2,pinch:!0},move:{scrollbars:{horizontal:!0,vertical:!0},drag:!0,wheel:!0},trashcan:!0,grid:{spacing:25,length:1,snap:!0},sounds:!1}),window.scripts={blocklyWorkspace:this.blocklyWorkspace},this.blocklyWorkspace.registerToolboxCategoryCallback("PROCEDURE",window.Blockly.Procedures.flyoutCategoryNew),this.blocklyWorkspace.addChangeListener(i=>{var r;if(this.someSelected&&Date.now()-this.someSelectedTime>500){const l=(r=this.blocklyWorkspace)==null?void 0:r.getAllBlocks();this.someSelected=null,l==null||l.forEach(c=>c.removeSelect())}[et.Blockly.Events.UI,et.Blockly.Events.CREATE,et.Blockly.Events.VIEWPORT_CHANGE].includes(i.type)||this.ignoreChanges||(this.changeTimer&&clearTimeout(this.changeTimer),this.changeTimer=setTimeout(()=>{this.changeTimer=null,this.onBlocklyChanged()},200))}),this.loadCode(),this.onResize();const s=document.getElementsByClassName("blocklyToolboxDiv")[0];this.blockly.appendChild(s),this.updateBackground(),setTimeout(()=>this.searchId(),200)}updateBackground(){var s;this.state.themeType==="dark"?(s=this.blocklyWorkspace)==null||s.setTheme(dw):this.blocklyWorkspace&&(this.blocklyWorkspace.getThemeManager(),this.blocklyWorkspace.setTheme(et.Blockly.Themes.Classic))}componentWillUnmount(){this.blocklyWorkspace&&(this.blocklyWorkspace.dispose(),this.blocklyWorkspace=null,this.changeTimer&&clearTimeout(this.changeTimer),this.changeTimer=null,window.removeEventListener("resize",this.onResizeBind))}onChange(){this.originalCode=this.blocklyCode2JSCode(),this.props.onChange&&this.props.onChange(this.originalCode)}async getToolbox(s){const i=window.document.getElementById("toolbox");let r=i==null?void 0:i.outerHTML;if(!r)return s?(console.error("Cannot load blocks!"),""):new Promise(l=>{setTimeout(()=>l(this.getToolbox(!0)),500)});if(r=r.replace(/{(\w+)}/g,(l,c)=>window.MSG[c]),window.Blockly.CustomBlocks){let l="";const c=x.I18n.getLanguage();for(let d=0;d`;for(const f in p.blocks)Object.prototype.hasOwnProperty.call(p.blocks,f)&&(l+=p.blocks[f]);l+=""}r=r.replace("%%CUSTOM_BLOCKS%%",l)}return r}renderMessageDialog(){return this.state.message?m.jsx(x.Message,{text:typeof this.state.message=="object"?this.state.message.text:this.state.message,title:typeof this.state.message=="object"?this.state.message.title:"",onClose:()=>this.setState({message:""})},"dialogMessage"):null}renderErrorDialog(){return this.state.error?m.jsx(su,{text:typeof this.state.error=="object"?this.state.error.text.toString():this.state.error,title:typeof this.state.error=="object"?this.state.error.title:"",onClose:()=>{this.blinkBlock&&(et.blocklyBlinkBlock(this.blinkBlock),this.blinkBlock=null),this.setState({error:""})}},"dialogError"):null}renderExportDialog(){return this.state.exportText?m.jsx(sO,{themeType:this.state.themeType,onClose:()=>this.setState({exportText:""}),text:this.state.exportText,scriptId:this.props.scriptId},"dialogExport"):null}renderImportDialog(){return this.state.importText?m.jsx(Hm,{themeType:this.props.themeType,onClose:s=>{this.setState({importText:!1}),this.onImportBlocks(s)}},"dialogImport"):null}renderDialogPrompt(){return this.state.showInputPrompt?m.jsxs(Ut,{onClose:()=>{var i;const s=(i=this.state.showInputPrompt)==null?void 0:i.callback;s&&s(null),this.setState({showInputPrompt:null})},maxWidth:"sm",fullWidth:!0,open:!0,children:[m.jsx(ss,{children:this.state.showInputPrompt.promptText}),m.jsx(qt,{children:m.jsx(Eo,{variant:"standard",fullWidth:!0,autoFocus:!0,value:this.state.showInputPrompt.value,onKeyUp:s=>{var i,r;if(s.key==="Enter"){const l=(i=this.state.showInputPrompt)==null?void 0:i.callback,c=(r=this.state.showInputPrompt)==null?void 0:r.value;l&&l(c===void 0?null:c),this.setState({showInputPrompt:null})}},onChange:s=>{var r,l;const i={...this.state.showInputPrompt};(r=this.state.showInputPrompt)!=null&&r.callback&&(i.callback=(l=this.state.showInputPrompt)==null?void 0:l.callback),i.value=s.target.value,this.setState({showInputPrompt:i})}})}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",disabled:!this.state.showInputPrompt.value,onClick:()=>{var r,l;const s=(r=this.state.showInputPrompt)==null?void 0:r.callback,i=(l=this.state.showInputPrompt)==null?void 0:l.value;s&&s(i===void 0?null:i),this.setState({showInputPrompt:null})},color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Apply")}),m.jsx(He,{color:"grey",variant:"contained",onClick:()=>{var i;const s=(i=this.state.showInputPrompt)==null?void 0:i.callback;s&&s(null),this.setState({showInputPrompt:null})},startIcon:m.jsx(so,{}),children:x.I18n.t("Close")})]})]},"inputDialog"):null}render(){return this.state.languageBlocklyLoaded&&this.state.languageOwnLoaded?(this.didUpdate=setTimeout(()=>{this.didUpdate=null,this.componentDidUpdate()},100),[m.jsx("div",{ref:s=>this.blockly=s,style:{width:"100%",height:"100%",position:"relative"}},"blocklyDOM"),this.renderDialogPrompt(),this.renderMessageDialog(),this.renderErrorDialog(),this.renderExportDialog(),this.renderImportDialog()]):null}}const vO=Object.freeze(Object.defineProperty({__proto__:null,default:et},Symbol.toStringTag,{value:"Module"})),yO="_nameCard_15el3_28",_O="_iconThemCard_15el3_40",wO="_iconThemCardSelectable_15el3_49",kO="_iconHelp_15el3_53",CO="_blockName_15el3_64",TO="_controlMenuTop_15el3_123",SO="_debugInfo_15el3_132",EO="_tagCard_15el3_142",IO="_displayFlex_15el3_161",xO="_blockMarginTop_15el3_166",DO="_nameBlock_15el3_167",AO="_frontText_15el3_171",OO="_backText_15el3_177",RO="_iconTag_15el3_181",NO="_displayItalic_15el3_191",Re={nameCard:yO,iconThemCard:_O,iconThemCardSelectable:wO,iconHelp:kO,blockName:CO,controlMenuTop:TO,debugInfo:SO,tagCard:EO,displayFlex:IO,blockMarginTop:xO,nameBlock:DO,frontText:AO,backText:OO,iconTag:RO,displayItalic:NO},MO="_root_1dr6a_1",LO="_square_1dr6a_11",PO="_icon_1dr6a_16",yg={root:MO,square:LO,icon:PO},Jr=({fullWidth:a,size:s,onClick:i,style:r,className:l,value:c,square:d,icon:h})=>m.jsx(He,{variant:"outlined",color:"primary",onClick:i,fullWidth:a,style:r,className:x.Utils.clsx(yg.root,l,d?yg.square:""),size:s||"medium",children:h?m.jsx(x.Icon,{className:yg.icon,src:h}):c}),BO="_root_1ucda_1",FO={root:BO},jO=({size:a,value:s,title:i,onChange:r,className:l,customValue:c,disabled:d})=>{const[h,p]=kt(!1);return m.jsxs(m.Fragment,{children:[m.jsx(wc,{disabled:d,checked:!!(c?s:h),className:x.Utils.clsx(FO.root,l),onChange:f=>{c&&p(f.target.checked),r&&r(f.target.checked)},size:a||"medium"}),i||null]})},SC=cm(jO),zO="_root_19roy_1",pw={root:zO},Ei=a=>{const[s,i]=kt(""),{value:r,type:l,error:c,className:d,icon:h,label:p,style:f,onChange:b,fullWidth:y,autoComplete:w,customValue:v,autoFocus:_,rows:$,size:S,variant:T,multiline:E,disabled:D}=Object.assign({value:"",type:"text",error:"",className:null,table:!1,native:{},variant:"standard",size:"medium",component:null,styleComponentBlock:null,fullWidth:!1,autoComplete:"",customValue:!1,autoFocus:!1,rows:1},a);return m.jsx(Eo,{error:!!c,autoFocus:_,fullWidth:y,label:p,disabled:D,variant:T,multiline:E,rows:$,value:v?r:s,type:l,helperText:c,style:f,className:x.Utils.clsx(pw.root,d),autoComplete:w,onChange:M=>{!v&&i(M.target.value),b&&b(M.target.value)},slotProps:{input:{endAdornment:h?m.jsx(Aw,{position:"end",children:m.jsx(x.Icon,{className:pw.icon,src:h})}):null}},margin:"normal",size:S})},UO={formControl:{m:"10px 0","& .MuiFormControl-marginNormal":{mt:0,mb:0},"& > *":{color:"#2d0440 !important"},"& .MuiSelect-icon":{color:"#81688c"},"& label.Mui-focused":{color:"#81688c"},"& .MuiInput-underline:after":{borderBottomColor:"#510573"},"& .MuiInput-underline:before":{borderBottomColor:"#81688c"},"& .MuiInput-underline:hover:before":{borderBottomColor:"#81688c"}}},HO=({multiple:a,value:s,customValue:i,socket:r,title:l,attr:c,adapter:d,style:h,onChange:p,onInstanceHide:f})=>{const[b,y]=kt(s||"test1"),[w,v]=kt([]);return Lt(()=>{r==null||r.getAdapterInstances(d).then(_=>{const $=_.map(S=>({value:S._id.replace("system.adapter.",""),title:S._id.replace("system.adapter.","")}));$.length===1?f($[0].value):$.unshift({value:d,title:x.I18n.t("All")}),v($)})},[r,d,f]),m.jsxs(Di,{sx:UO.formControl,fullWidth:!0,style:h,children:[m.jsx(Ai,{variant:"standard",value:(i?s:b)||"_",fullWidth:!0,multiple:a,renderValue:_=>a&&Array.isArray(_)?_.join(", "):_,onChange:_=>{!i&&y(_.target.value),p(_.target.value)},input:c?m.jsx(Pn,{name:c,id:`${c}-helper`}):m.jsx(Pn,{name:c}),children:w.map(_=>m.jsx(it,{style:{placeContent:"space-between"},value:_.value||"_",children:x.I18n.t(_.title)},`key-${_.value}`))}),l?m.jsx(Rw,{children:x.I18n.t(l)}):null]})},WO="_modalWrapper_587ci_33",GO="_modalDialog_587ci_40",gw={modalWrapper:WO,modalDialog:GO},am=({onClose:a,children:s,titleButtonApply:i,titleButtonClose:r,onApply:l,className:c,textInput:d,defaultValue:h,disabled:p})=>{const[f,b]=kt(h||""),[y]=kt(h||"");return m.jsxs(Ut,{open:!0,maxWidth:"md",disableEscapeKeyDown:!1,onClose:a,classes:{paper:gw.modalDialog},className:gw.modalWrapper,children:[m.jsxs(qt,{children:[d&&m.jsx(Ei,{className:c,autoComplete:"off",fullWidth:!0,variant:"outlined",size:"medium",rows:10,multiline:!0,value:f,onChange:b,customValue:!0}),!d&&s]}),m.jsxs(Ht,{children:[m.jsx(He,{disabled:p===void 0?y===f:p,onClick:()=>l(d?f:null),variant:"contained",color:"primary",children:x.I18n.t(i||"Ok")}),m.jsx(He,{color:"grey",onClick:a,variant:"contained",children:x.I18n.t(r||"Cancel")})]})]})},VO="_root_15mo1_1",KO={root:VO},YO=({multiple:a,value:s,customValue:i,title:r,attr:l,options:c,style:d,onChange:h,className:p,doNotTranslate:f,doNotTranslate2:b})=>{const[y,w]=kt(s===void 0?c[0].value:s),v=i?s:y,_=v===""||v===null||v===void 0?"_":v;return m.jsxs(Di,{variant:"standard",className:x.Utils.clsx(KO.root,p),fullWidth:!0,style:d,children:[m.jsxs(Ai,{variant:"standard",value:_,fullWidth:!0,multiple:a,renderValue:$=>{if(a&&Array.isArray($)){$.sort();let T=$.indexOf("0");T!==-1&&($.splice(T,1),$.push("0")),T=$.indexOf("_"),T!==-1&&($.splice(T,1),$.unshift("_"));const E=c.find(M=>M.only);return E&&$.includes(E.value)?E.titleShort?f?E.titleShort:x.I18n.t(E.titleShort):f?E.title:x.I18n.t(E.title):$.map(M=>c.find(P=>P.value===M||M==="_"&&P.value==="")||M).map(M=>typeof M=="object"?M.titleShort?f?M.titleShort:x.I18n.t(M.titleShort):f?M.title:x.I18n.t(M.title):f?M:x.I18n.t(M)).join(", ")}const S=c?c.find(T=>T.value===$||$==="_"&&T.value===""):null;return S!=null&&S.title?f?S==null?void 0:S.title:x.I18n.t(S==null?void 0:S.title):$},onChange:$=>{if(i||w($.target.value),a){const S=$.target.value,T=c.find(E=>E.only);if(T){const E=T.value;if(S.length===c.length-1&&S.includes(E))return h(S.filter(D=>D!==E),l);if(S.includes(E))return h(c.map(D=>D.value),l)}}h($.target.value,l)},input:l?m.jsx(Pn,{name:l,id:`${l}-helper`}):m.jsx(Pn,{name:l}),children:[!a&&(c==null?void 0:c.map($=>m.jsxs(it,{style:{placeContent:"space-between"},value:$.value===""||$.value===null||$.value===void 0?"_":$.value,children:[f?$.title:x.I18n.t($.title),$.title2&&m.jsx("div",{children:b?$.title2:x.I18n.t($.title2)})]},`key-${$.value}`))),a&&(c==null?void 0:c.map($=>m.jsxs(it,{style:{placeContent:"space-between"},value:$.value||"_",children:[f?$.title:x.I18n.t($.title)," ",m.jsx(SC,{customValue:!0,value:s==null?void 0:s.includes($.value)})]},`key-${$.value}`)))]}),r?m.jsx(Rw,{children:x.I18n.t(r)}):null]})},JO="_root_1gt4d_1",qO="_mark_1gt4d_27",mw={root:JO,mark:qO},XO=({size:a,value:s,style:i,onChange:r,className:l,customValue:c,min:d,max:h,step:p,unit:f})=>{const[b,y]=kt(0);d=d!==void 0?d:0,h=h!==void 0?h:0,p=p!==void 0?p:(h-d)/100;const w=[{value:d,label:d+(f||"")},{value:h,label:h+(f||"")}];return m.jsx(qT,{defaultValue:c?s:b,"aria-labelledby":"discrete-slider",valueLabelDisplay:"auto",classes:{mark:mw.mark},marks:w,step:p,min:d,max:h,value:c?s:b,style:i,className:x.Utils.clsx(mw.root,l),onChange:(v,_)=>{Array.isArray(_)?(!c&&y(_[0]),r(_[0])):(!c&&y(_),r(_))},size:a||"medium"})},ZO="_root_rzul6_1",QO={root:ZO},eR=({label:a,size:s,value:i,style:r,onChange:l,className:c,customValue:d})=>{const[h,p]=kt(!1);return m.jsx(Rg,{className:QO.root,control:m.jsx(Nw,{checked:d?i:h,style:r,className:c,onChange:f=>{d||p(f.target.checked),l(f.target.checked)},size:s||"medium"}),label:a??"all"})},tR=cm(eR),sR="_root_135pm_1",oR={root:sR},iR=({value:a,style:s,onChange:i,className:r})=>m.jsx(Eo,{variant:"standard",id:"time",type:"time",onChange:l=>i(l.currentTarget.value),value:a,className:x.Utils.clsx(oR.root,r),fullWidth:!0,style:s,slotProps:{htmlInput:{step:300},inputLabel:{shrink:!0}}}),nR="_root_135pm_1",dc={root:nR},_g=[31,29,31,30,31,30,31,31,30,31,30,31],rR=({value:a,onChange:s,className:i,style:r})=>{const[l,c]=(a||"01.01").toString().split(".");let d=parseInt(c,10)||0,h=parseInt(l,10)||0;h>12?h=12:h<0&&(h=0),d>_g[h]?d=_g[h]:d<0&&(d=0);const p=[];for(let f=0;f<_g[h];f++)p.push(f+1);return m.jsxs("div",{children:[m.jsx(Di,{variant:"standard",className:x.Utils.clsx(dc.root,i),style:r,children:m.jsxs(Ai,{variant:"standard",className:x.Utils.clsx(dc.root,i),margin:"dense",label:x.I18n.t("Month"),onChange:f=>s(`${f.target.value.toString().padStart(2,"0")}.${d.toString().padStart(2,"0")}`),value:h,children:[m.jsx(it,{style:{placeContent:"space-between"},value:0,children:x.I18n.t("Any month")},0),m.jsx(it,{style:{placeContent:"space-between"},value:1,children:x.I18n.t("January")},1),m.jsx(it,{style:{placeContent:"space-between"},value:2,children:x.I18n.t("February")},2),m.jsx(it,{style:{placeContent:"space-between"},value:3,children:x.I18n.t("March")},3),m.jsx(it,{style:{placeContent:"space-between"},value:4,children:x.I18n.t("April")},4),m.jsx(it,{style:{placeContent:"space-between"},value:5,children:x.I18n.t("May")},5),m.jsx(it,{style:{placeContent:"space-between"},value:6,children:x.I18n.t("June")},6),m.jsx(it,{style:{placeContent:"space-between"},value:7,children:x.I18n.t("July")},7),m.jsx(it,{style:{placeContent:"space-between"},value:8,children:x.I18n.t("August")},8),m.jsx(it,{style:{placeContent:"space-between"},value:9,children:x.I18n.t("September")},9),m.jsx(it,{style:{placeContent:"space-between"},value:10,children:x.I18n.t("October")},10),m.jsx(it,{style:{placeContent:"space-between"},value:11,children:x.I18n.t("November")},11),m.jsx(it,{style:{placeContent:"space-between"},value:12,children:x.I18n.t("December")},12)]})}),m.jsx(Di,{variant:"standard",className:x.Utils.clsx(dc.root,i),style:r,children:m.jsxs(Ai,{variant:"standard",className:x.Utils.clsx(dc.root,i),margin:"dense",label:x.I18n.t("Date"),onChange:f=>s(`${h.toString().padStart(2,"0")}.${f.target.value.toString().padStart(2,"0")}`),value:d,children:[m.jsx(it,{style:{placeContent:"space-between"},value:0,children:x.I18n.t("Any")},"A"),p.map(f=>m.jsx(it,{style:{placeContent:"space-between"},value:f,children:f},f))]})})]})},wg={},aR={Shuffle:bx,Apps:rx,Functions:hx,Language:kS,AddBox:nx,Pause:bc,Subject:yx,PlayForWork:fx,Brightness3:ax,HelpOutline:pk,Storage:vx,AccessTime:ix,PlayArrow:Ug,FlashOn:ux};function fw({iconName:a,className:s,adapter:i,socket:r,onClick:l,style:c}){const[d,h]=kt("");if(Lt(()=>{i&&r&&(wg[i]instanceof Promise||(wg[i]=r.getObject(`system.adapter.${i}`)),wg[i].then(f=>{var b;return((b=f==null?void 0:f.common)==null?void 0:b.icon)&&h(`../../adapter/${i}/${f.common.icon}`)}))},[i,r]),i)return m.jsx("img",{onClick:f=>l&&l(f),src:d||"",className:s,style:c,alt:""});const p=a&&aR[a]||CS;return m.jsx(p,{className:s,style:c,onClick:f=>l&&l(f)})}let kg;function lR(a){return kg=kg||x.I18n.getLanguage(),a&&typeof a=="object"?a[kg]||a.en:a||""}function Ln(a){return a===null?"null":a===void 0?"undefined":Array.isArray(a)?a.join(", "):typeof a=="object"?JSON.stringify(a):a.toString()}class at extends xw{debugHideTimeout=null;lastObjectIdChange=0;enableSimulationProcessing=!1;lastDebugMessage=0;debugMessageTimeout=null;static getStaticData(){return{acceptedBy:"actions",name:"Not found",id:"ActionEmpty",icon:"Shuffle"}}static compile(s,i){return""}constructor(s,i){super(s),i||={};const r=s.settings||{tagCard:i.tagCardArray?typeof i.tagCardArray[0]!="string"?i.tagCardArray[0].title:i.tagCardArray[0]:""};!r.tagCard&&i.tagCardArray&&(r.tagCard=typeof i.tagCardArray[0]!="string"?i.tagCardArray[0].title:i.tagCardArray[0]),this.state={inputs:i.inputs||s.inputs||[],name:i.name||s.name||"",icon:i.icon||s.icon||"",adapter:i.adapter||s.adapter||"",helpDialog:i.helpDialog||s.helpDialog||"",tagCardArray:i.tagCardArray||[],openTagMenu:!1,openModal:!1,iconTag:!1,error:"",helpText:"",instanceSelectionOptions:[],instanceSelectionDef:"",hideAttributes:[],settings:r,debugMessage:null,enableSimulation:this.props.enableSimulation}}componentWillUnmount(){this.debugMessageTimeout&&(clearTimeout(this.debugMessageTimeout),this.debugMessageTimeout=null),this.debugHideTimeout&&(clearTimeout(this.debugHideTimeout),this.debugHideTimeout=null)}onTagChange(s,i,r,l,c){let d=!1;const h=JSON.parse(JSON.stringify(this.state.settings));this.state.inputs.forEach(p=>{const f=p.attr,b=p.defaultValue;f&&b!==void 0&&h[f]===void 0&&(d=!0,h[f]=b)}),d?(this.setState({settings:h},()=>i==null?void 0:i()),this.props.onChange(h)):i&&i()}onUpdate(){}onValueChanged(s,i){}renderText(s,i,r){const{className:l}=this.props,{attr:c,frontText:d,backText:h,nameBlock:p,name:f,doNotTranslate:b,doNotTranslateBack:y}=s;return m.jsxs(Ig,{children:[m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),children:[d&&m.jsx("div",{className:Re.frontText,children:b?d:x.I18n.t(d)}),m.jsx(Ei,{className:l,autoComplete:"off",label:lR(f),variant:"outlined",size:"small",fullWidth:!0,value:i,onChange:r,customValue:!0}),h&&m.jsx("div",{className:Re.backText,children:y?h:x.I18n.t(h)})]}),p&&m.jsx("div",{className:Re.nameBlock,children:x.I18n.t(p)})]},c)}renderSwitch(s,i,r){const{className:l}=this.props,{attr:c,frontText:d,backText:h,nameBlock:p,doNotTranslate:f,doNotTranslateBack:b}=s;return m.jsxs("div",{children:[m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),children:[d&&m.jsx("div",{className:Re.frontText,children:f?d:x.I18n.t(d)}),m.jsx(tR,{className:l,label:"",customValue:!0,value:i,onChange:r}),h&&m.jsx("div",{className:Re.backText,children:b?h:x.I18n.t(h)})]}),p&&m.jsx("div",{className:Re.nameBlock,children:x.I18n.t(p)})]},c)}renderNameText({attr:s,signature:i,doNotTranslate:r,defaultValue:l},c){return m.jsx("div",{className:x.Utils.clsx(i?Re.displayItalic:Re.displayFlex,Re.blockMarginTop),children:c?r?c:x.I18n.t(c):r?l:x.I18n.t(l)},s)}renderNumber(s,i,r){const{className:l}=this.props,{settings:c}=this.state,{attr:d,backText:h,frontText:p,openCheckbox:f,doNotTranslate:b,doNotTranslateBack:y}=s;let w=!0;return f&&(w=typeof c.offset=="boolean"?c.offset:!0),w?m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),children:[p&&m.jsx("div",{className:Re.frontText,children:b?p:x.I18n.t(p)}),m.jsx(Ei,{className:x.Utils.clsx(l,s.className),fullWidth:!0,autoComplete:"off",label:s.noHelperText?"":"number",variant:"outlined",size:"small",type:"number",value:i,onChange:r,customValue:!0}),h&&m.jsx("div",{className:Re.backText,children:y?h:x.I18n.t(h)})]},d):null}renderColor(s,i,r){const{className:l}=this.props,{attr:c,backText:d,frontText:h,doNotTranslate:p,doNotTranslateBack:f}=s;return m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),children:[h&&m.jsx("div",{className:Re.frontText,children:p?h:x.I18n.t(h)}),m.jsx(Ei,{className:l,autoComplete:"off",fullWidth:!0,variant:"outlined",size:"small",type:"color",value:i,onChange:r}),d&&m.jsx("div",{className:Re.backText,children:f?d:x.I18n.t(d)})]},c)}renderCheckbox(s,i,r){const{className:l}=this.props,{settings:c}=this.state,{attr:d,backText:h,frontText:p,defaultValue:f,doNotTranslate:b,doNotTranslateBack:y}=s;return m.jsxs("div",{className:Re.displayFlex,children:[p&&m.jsx("div",{className:Re.frontText,children:b?p:x.I18n.t(p)}),m.jsx(SC,{className:l,size:"small",value:typeof c[d]=="boolean"?!!c[d]:!!f,customValue:!0,onChange:r}),h&&m.jsx("div",{onClick:()=>r(typeof c[d]=="boolean"?!c[d]:!f),className:Re.backText,children:y?h:x.I18n.t(h)})]},d)}renderSlider(s,i,r){const{className:l}=this.props,{attr:c,frontText:d,backText:h,nameBlock:p,min:f,max:b,step:y,unit:w,doNotTranslate:v,doNotTranslateBack:_}=s;return m.jsxs("div",{children:[m.jsxs("div",{className:Re.displayFlex,style:{marginRight:20},children:[d&&m.jsx("div",{className:Re.frontText,children:v?d:x.I18n.t(d)}),m.jsx(XO,{customValue:!0,min:f,max:b,step:y,unit:w,className:l,autoComplete:"off",label:"number",variant:"outlined",size:"small",value:i,onChange:$=>{console.log($),r($)}}),h&&m.jsx("div",{style:{marginLeft:20},className:Re.backText,children:_?h:x.I18n.t(h)})]}),p&&m.jsx("div",{className:Re.nameBlock,children:x.I18n.t(p)})]},c)}renderButton(s,i,r){const{className:l}=this.props,{attr:c,frontText:d,backText:h,doNotTranslate:p,doNotTranslateBack:f}=s;return m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),children:[d&&m.jsx("div",{className:Re.frontText,children:p?d:x.I18n.t(d)}),m.jsx(Jr,{fullWidth:!0,value:i.toString(),className:l,onClick:()=>r(i)}),h&&m.jsx("div",{className:Re.backText,children:f?h:x.I18n.t(h)})]},c)}async findIcon(s){var i;if(!s)return null;if((i=s.common)!=null&&i.icon)return x.getSelectIdIcon(s,"../..");if(s.type==="state"||s.type==="channel"){const r=s._id.split(".");r.pop();const l=r.join(".");try{const c=await this.props.socket.getObject(l);return await this.findIcon(c)}catch{return null}}return null}renderObjectID(s,i,r){const{attr:l,openCheckbox:c,checkReadOnly:d}=s,{settings:h}=this.state,p=this.state[`showSelectId${l}`],{className:f,socket:b,style:y}=this.props;let w=!0;c&&(w=typeof h.offset=="boolean"?h.offset:!0);const v=h[l],_=v?this.state[v]:void 0;return v&&!_&&_!==!1&&setTimeout(async $=>{var D;const S=await b.getObject(i),T=await this.findIcon(S),E={[$]:S||!1,[`${$}___icon`]:T,error:d&&this.lastObjectIdChange&&Date.now()-this.lastObjectIdChange<1e3&&((D=S==null?void 0:S.common)==null?void 0:D.write)===!1?x.I18n.t("Read only ID selected: %s",h[$]):""};this.setState(E)},0,v),w?m.jsxs("div",{className:Re.blockMarginTop,children:[m.jsxs("div",{className:Re.displayFlex,children:[s.title?m.jsx("div",{children:x.I18n.t(s.title)}):null,m.jsx(Ei,{className:f,style:y,autoComplete:"off",fullWidth:!0,disabled:!0,variant:"outlined",size:"small",value:i,customValue:!0}),m.jsx(Jr,{icon:this.state[`${v}___icon`],square:!0,style:{...y||void 0,marginLeft:7},value:"...",className:f,onClick:()=>{const $={};$[`showSelectId${l}`]=!0,this.setState($)}})]}),_?m.jsx("div",{className:x.Utils.clsx(Re.nameBlock,Re.displayItalic),children:x.Utils.getObjectNameFromObj(_,x.I18n.getLanguage())}):null,p?m.jsx(x.DialogSelectID,{theme:this.props.theme,imagePrefix:"../..",dialogName:"javascript",themeType:x.Utils.getThemeName(),socket:b,selected:i,onClose:()=>{const $={};$[`showSelectId${l}`]=!1,this.setState($)},onOk:($,S)=>{const T={};T[`showSelectId${l}`]=!1;const E=Array.isArray($)?$[0]:$;this.setState(T,async()=>{var M,P,W,G,z,Z,he,Ce,R,K;const D=E?await b.getObject(E):void 0;this.lastObjectIdChange=Date.now(),r({[l]:$,[`${l}Role`]:(M=D==null?void 0:D.common)==null?void 0:M.role,[`${l}Type`]:(P=D==null?void 0:D.common)==null?void 0:P.type,[`${l}Unit`]:(W=D==null?void 0:D.common)==null?void 0:W.unit,[`${l}States`]:(G=D==null?void 0:D.common)==null?void 0:G.states,[`${l}Min`]:(z=D==null?void 0:D.common)==null?void 0:z.min,[`${l}Max`]:(Z=D==null?void 0:D.common)==null?void 0:Z.max,[`${l}Step`]:(he=D==null?void 0:D.common)==null?void 0:he.step,[`${l}Def`]:(Ce=D==null?void 0:D.common)==null?void 0:Ce.def,[`${l}Write`]:(R=D==null?void 0:D.common)==null?void 0:R.write,[`${l}Read`]:(K=D==null?void 0:D.common)==null?void 0:K.read},()=>this.props.setOnUpdate&&this.props.setOnUpdate(!0))})}}):null]},l):null}renderIconTag(){return m.jsx("div",{className:Re.iconTag,onClick:s=>{this.state.settings.tagCard&&(this.state.tagCardArray.length<3?this.onChangeTag():this.setState({openTagMenu:s.currentTarget}))},children:this.state.settings.tagCard})}renderTime(s,i,r){const{attr:l,backText:c,frontText:d,doNotTranslate:h,doNotTranslateBack:p}=s;return m.jsxs("div",{className:Re.displayFlex,style:{whiteSpace:"nowrap"},children:[d&&m.jsx("div",{className:Re.frontText,children:h?d:x.I18n.t(d)}),m.jsx(iR,{value:i,onChange:r}),c&&m.jsx("div",{className:Re.backText,children:p?c:x.I18n.t(c)})]},l)}renderSelect(s,i,r){const{className:l,style:c}=this.props,{name:d,options:h,frontText:p,backText:f,attr:b,multiple:y,doNotTranslate:w,doNotTranslate2:v,doNotTranslateBack:_}=s;return m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),style:{whiteSpace:"nowrap"},children:[p&&m.jsx("div",{className:Re.frontText,children:x.I18n.t(p)}),m.jsx(YO,{attr:b,doNotTranslate:w,doNotTranslate2:v,title:d,className:l,style:c,options:h,value:i,onChange:r,multiple:y,customValue:!0}),f&&m.jsx("div",{className:Re.backText,children:_?f:x.I18n.t(f)})]},b)}renderInstance(s,i,r){const{socket:l}=this.props,{name:c,frontText:d,backText:h,attr:p,adapter:f,doNotTranslate:b,doNotTranslateBack:y}=s;return this.state.hideAttributes.includes(p)?null:m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),style:{whiteSpace:"nowrap"},children:[d&&m.jsx("div",{className:Re.frontText,children:b?d:x.I18n.t(d)}),m.jsx(HO,{attr:p,socket:l,adapter:f,title:c,value:i,onChange:w=>{r(Array.isArray(w)?w[0]:w)},customValue:!0,onInstanceHide:w=>this.setState({hideAttributes:[...this.state.hideAttributes,p]},()=>r(w))}),h&&m.jsx("div",{className:Re.backText,children:y?h:x.I18n.t(h)})]},p)}renderDialog(s){const{onShowDialog:i,frontText:r,backText:l,attr:c,icon:d,doNotTranslate:h,doNotTranslateBack:p}=s;return m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),style:{whiteSpace:"nowrap"},children:[r&&m.jsx("div",{className:Re.frontText,children:h?r:x.I18n.t(r)}),m.jsx(fw,{iconName:d,className:x.Utils.clsx(Re.iconDialog),onClick:()=>i&&i()}),l&&m.jsx("div",{className:Re.backText,children:p?l:x.I18n.t(l)})]},c)}renderModalInput(s,i,r){const{openModal:l}=this.state,{className:c}=this.props,{attr:d,nameBlock:h,frontText:p,backText:f,noTextEdit:b,doNotTranslate:y,doNotTranslateBack:w}=s;return m.jsxs("div",{children:[m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),children:[p&&m.jsx("div",{className:Re.frontText,children:y?p:x.I18n.t(p)}),m.jsx(Ei,{disabled:!!b,className:c,autoComplete:"off",fullWidth:!0,variant:"outlined",size:"small",value:i,onChange:r,customValue:!0}),m.jsx(Jr,{square:!0,style:{marginLeft:5},value:"...",className:c,onClick:()=>this.setState({openModal:!0})}),f&&m.jsx("div",{className:Re.backText,children:w?f:x.I18n.t(f)})]}),l?m.jsx(am,{onApply:v=>this.setState({openModal:!1},()=>v!=null&&r(v)),onClose:()=>this.setState({openModal:!1}),defaultValue:i,textInput:!0}):null,h&&m.jsx("div",{className:Re.nameBlock,children:x.I18n.t(h)})]},d)}renderDate(s,i,r){const{attr:l,backText:c,frontText:d,doNotTranslate:h,doNotTranslateBack:p}=s;return m.jsxs("div",{className:Re.displayFlex,style:{whiteSpace:"nowrap"},children:[d&&m.jsx("div",{className:Re.frontText,children:h?d:x.I18n.t(d)}),m.jsx(rR,{value:i,onChange:r}),c&&m.jsx("div",{className:Re.backText,children:p?c:x.I18n.t(c)})]},l)}static getReplacesInText(s){var r;let i="";return(r=s.trigger)!=null&&r.oidType?i=".replace(/%s/g, obj.state.val).replace(/%id/g, obj.id).replace(/%name/g, obj.common && obj.common.name).replace(/%old/g, obj.oldState.val)":s.conditionsStates.length&&(i=`.replace(/%s/g, ${s.conditionsStates[0].name}).replace(/%id/g, "${s.conditionsStates[0].id}")`),i}renderTags(){const{tagCardArray:s,openTagMenu:i}=this.state,{tagCard:r}=this.state.settings;let l=r!=="="&&r!=="<>"&&r!==">="&&r!=="()"&&r!=="."&&r!=="<="&&r!=="<"&&r!==">"&&r?x.I18n.t(r):r;return s.length>=3&&(l=m.jsxs("div",{children:[m.jsx("div",{"aria-controls":"simple-menu","aria-haspopup":"true",onClick:c=>{this.setState({openTagMenu:c.currentTarget},()=>{this.props.isTourOpen&&this.props.tourStep===Ns.openTagsMenu&&setTimeout(()=>this.props.setTourStep&&this.props.setTourStep(Ns.selectIntervalTag),300)})},children:l}),m.jsx(dm,{id:"simple-menu",anchorEl:i,keepMounted:!0,open:!!i,onClose:()=>this.setState({openTagMenu:null}),children:s.map((c,d)=>{let h;return typeof c!="string"?h=c.title:h=c,m.jsxs(it,{selected:h===r,className:`tag-card-${h}`,style:{placeContent:"space-between"},onClick:p=>{p.stopPropagation(),this.props.isTourOpen&&(this.props.tourStep===Ns.openTagsMenu||this.props.tourStep===Ns.selectIntervalTag)&&h==="interval"&&setTimeout(()=>{var b,y;return(y=(b=this.props).setTourStep)==null?void 0:y.call(b,Ns.selectActions)},500);const f=JSON.parse(JSON.stringify(this.state.settings));f.tagCard=h,this.setState({openTagMenu:null,settings:f},()=>{this.props.onChange(this.state.settings),this.onTagChange(this.state.settings.tagCard)})},children:[h.search(/>|<|<>|<=|>=|=/)!==-1?h:x.I18n.t(h),typeof c!="string"&&c.title2&&m.jsx("div",{style:{marginLeft:4},children:x.I18n.t(c.title2)})]},`${h}_${d}`)})})]})),l}getData(){return{acceptedBy:"triggers",name:"",id:""}}onChangeTag(){const{tagCardArray:s,settings:i,settings:{tagCard:r}}=this.state;let l;if(typeof s[0]!="string"?l=s.map(c=>c.title):l=[...s],r&&l.length<3){const c={...i},d=l[(l.indexOf(r)+1)%l.length];c.tagCard=d,this.setState({settings:c},()=>{this.props.onChange(c),this.onTagChange(d)})}}componentDidMount(){this.onTagChange()}componentDidUpdate(){this.props.acceptedBy!=="triggers"&&this.props.onUpdate&&setTimeout(()=>this.onUpdate(),0)}onChangeInput(s){return(i,r,l)=>{const c=JSON.parse(JSON.stringify(this.state.settings));typeof i=="object"&&(!r||typeof r=="function")?(Object.keys(i).forEach(d=>c[d]=i[d]),typeof r=="function"&&(l=r,r=void 0)):c[r||s]=i,c.id=this.getData().id,c._id=this.props._id,this.setState({settings:c},()=>{this.onValueChanged(i,r||s),this.props.onChange(c),l==null||l()})}}renderSpecific(){return null}renderDebug(s){return""}renderDebugInfo(){return this.state.debugMessage?m.jsx("div",{className:Re.debugInfo,style:{opacity:1,height:22,bottom:-22},children:this.renderDebug?this.renderDebug(this.state.debugMessage):x.I18n.t("executed")},this.state.debugMessage.ts):null}renderCron(s,i,r){return null}renderWizard(s,i,r){return null}renderWriteState(){return null}renderInputElement(s,i){const{nameRender:r,defaultValue:l,attr:c}=s,{settings:d}=this.state;let h=c?d[c]:void 0;switch(h===void 0&&(h=l),r){case"renderTime":return c?this.renderTime(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderTime")},`invalid_${i}`);case"renderNameText":return this.renderNameText(s,l);case"renderSelect":return c?this.renderSelect(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderSelect")},`invalid_${i}`);case"renderModalInput":return c?this.renderModalInput(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderModalInput")},`invalid_${i}`);case"renderObjectID":return c?this.renderObjectID(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderObjectID")},`invalid_${i}`);case"renderDialog":return c?this.renderDialog(s):m.jsx("div",{children:x.I18n.t("Invalid renderDialog")},`invalid_${i}`);case"renderInstance":return c?this.renderInstance(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderInstance")},`invalid_${i}`);case"renderText":return c?this.renderText(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderText")},`invalid_${i}`);case"renderSlider":return c?this.renderSlider(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderSlider")},`invalid_${i}`);case"renderCheckbox":return c?this.renderCheckbox(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderCheckbox")},`invalid_${i}`);case"renderButton":return c?this.renderButton(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderButton")},`invalid_${i}`);case"renderColor":return c?this.renderColor(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderColor")},`invalid_${i}`);case"renderSwitch":return c?this.renderSwitch(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderSwitch")},`invalid_${i}`);case"renderDate":return c?this.renderDate(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderDate")},`invalid_${i}`);case"renderCron":return c?this.renderCron(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderCron")},`invalid_${i}`);case"renderWizard":return c?this.renderWizard(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderWizard")},`invalid_${i}`);case"renderWriteState":return this.renderWriteState();case"renderNumber":return c?this.renderNumber(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderNumber")},`invalid_${i}`);default:return this[r]?this[r](s,h,c?this.onChangeInput(c):null):m.jsx("div",{children:x.I18n.t("Invalid input type: %s",r)},`invalid_${i}`)}}render(){var w;const{inputs:s,name:i,icon:r,iconTag:l,settings:c,adapter:d,settings:{tagCard:h},helpDialog:p}=this.state,{socket:f,notFound:b}=this.props;this.state.settings&&!this.state.settings.tagCard&&((w=this.state.tagCardArray)!=null&&w.length)&&setTimeout(()=>{const v=JSON.parse(JSON.stringify(this.state.settings));v.tagCard=typeof this.state.tagCardArray[0]!="string"?this.state.tagCardArray[0].title:this.state.tagCardArray[0],this.setState({settings:v})},50),this.state.enableSimulation!==this.props.enableSimulation&&!this.enableSimulationProcessing&&(this.enableSimulationProcessing=!0,setTimeout(()=>{this.setState({enableSimulation:this.props.enableSimulation},()=>{this.enableSimulationProcessing=!1})},50));let y;if(this.props.onDebugMessage)for(let v=this.props.onDebugMessage.length-1;v>=0;v--){const _=this.props.onDebugMessage[v];if(_.blockId===this.props._id&&_.ts>this.lastDebugMessage&&_.ts>Date.now()-1e3){y=_;break}}return y&&(this.lastDebugMessage=y.ts,this.debugMessageTimeout&&clearTimeout(this.debugMessageTimeout),this.debugHideTimeout&&(clearTimeout(this.debugHideTimeout),this.debugHideTimeout=null),this.debugMessageTimeout=setTimeout(v=>{const _=JSON.parse(v),$=_.hideTimeout||5e3;this.debugMessageTimeout=null,this.setState({debugMessage:_},()=>{this.debugHideTimeout&&clearTimeout(this.debugHideTimeout),this.debugHideTimeout=setTimeout(()=>{this.debugHideTimeout=null,this.setState({debugMessage:null})},$)})},50,JSON.stringify(y))),m.jsxs(Ig,{children:[l?this.renderIconTag():m.jsx(fw,{iconName:r,className:x.Utils.clsx(Re.iconThemCard,h&&this.state.tagCardArray.length&&Re.iconThemCardSelectable),adapter:d,socket:f,onClick:v=>{h&&(this.state.tagCardArray.length<3?this.onChangeTag():this.setState({openTagMenu:v.currentTarget}))}}),m.jsxs("div",{className:Re.blockName,children:[m.jsxs("span",{className:Re.nameCard,children:[x.I18n.t(i),b?x.I18n.t("%s not found",c.id):"",p?m.jsx(qe,{className:Re.iconHelp,size:"small",onClick:()=>this.setState({helpText:x.I18n.t(p)}),children:m.jsx(pk,{})}):null]}),s.map((v,_)=>this.renderInputElement(v,_))]}),h&&m.jsx("div",{className:Re.controlMenuTop,style:{opacity:1,height:22,top:-22},children:m.jsx("div",{onClick:()=>this.onChangeTag(),className:x.Utils.clsx(Re.tagCard,"tag-card"),children:this.renderTags()})}),this.renderDebugInfo(),this.state.error?m.jsx(x.DialogError,{title:x.I18n.t("Warning"),text:this.state.error,onClose:()=>this.setState({error:""})}):null,this.state.helpText?m.jsx(x.DialogMessage,{title:x.I18n.t("Instructions"),text:this.state.helpText,onClose:()=>this.setState({helpText:""})}):null,this.renderSpecific()]})}}const $w={en:{name:"Google - English",engine:"google",params:[]},de:{name:"Google - Deutsch",engine:"google",params:[]},ru:{name:"Google - Русский",engine:"google",params:[]},it:{name:"Google - Italiano",engine:"google",params:[]},es:{name:"Google - Espaniol",engine:"google",params:[]},fr:{name:"Google - Français",engine:"google",params:[]},ru_YA:{name:"Yandex - Русский",engine:"yandex",params:["key","voice","emotion","ill","drunk","robot"],voice:["jane","zahar"],emotion:["none","good","neutral","evil","mixed"]},ru_YA_CLOUD:{name:"Yandex Cloud - Русский",engine:"yandexCloud",params:["key","folderID","voice","emotion"],voice:["alyss","oksana","jane","zahar"],emotion:["good","neutral","evil"]},"en-US":{name:"PicoTTS - Englisch US",engine:"PicoTTS",params:[]},"en-GB":{name:"PicoTTS - Englisch GB",engine:"PicoTTS",params:[]},"de-DE":{name:"PicoTTS - Deutsch",engine:"PicoTTS",params:[]},"it-IT":{name:"PicoTTS - Italiano",engine:"PicoTTS",params:[]},"es-ES":{name:"PicoTTS - Espaniol",engine:"PicoTTS",params:[]},"fr-FR":{name:"PicoTTS - Français",engine:"PicoTTS",params:[]},"ru-RU_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"ru-RU",ename:"Tatyana",ssml:!0,name:"Cloud - Русский - Татьяна"},"ru-RU_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"ru-RU",ename:"Maxim",ssml:!0,name:"Cloud - Русский - Максим"},"de-DE_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"de-DE",ename:"Marlene",ssml:!0,name:"Cloud - Deutsch - Marlene"},"de-DE_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"de-DE",ename:"Hans",ssml:!0,name:"Cloud - Deutsch - Hans"},"en-US_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Salli",ssml:!0,name:"Cloud - en-US - Female - Salli"},"en-US_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-US",ename:"Joey",ssml:!0,name:"Cloud - en-US - Male - Joey"},"da-DK_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"da-DK",ename:"Naja",ssml:!0,name:"Cloud - da-DK - Female - Naja"},"da-DK_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"da-DK",ename:"Mads",ssml:!0,name:"Cloud - da-DK - Male - Mads"},"en-AU_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-AU",ename:"Nicole",ssml:!0,name:"Cloud - en-AU - Female - Nicole"},"en-AU_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-AU",ename:"Russell",ssml:!0,name:"Cloud - en-AU - Male - Russell"},"en-GB_CLOUD_Female_Amy":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-GB",ename:"Amy",ssml:!0,name:"Cloud - en-GB - Female - Amy"},"en-GB_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-GB",ename:"Brian",ssml:!0,name:"Cloud - en-GB - Male - Brian"},"en-GB_CLOUD_Female_Emma":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-GB",ename:"Emma",ssml:!0,name:"Cloud - en-GB - Female - Emma"},"en-GB-WLS_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-GB-WLS",ename:"Gwyneth",ssml:!0,name:"Cloud - en-GB-WLS - Female - Gwyneth"},"en-GB-WLS_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-GB-WLS",ename:"Geraint",ssml:!0,name:"Cloud - en-GB-WLS - Male - Geraint"},"cy-GB_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"cy-GB",ename:"Gwyneth",ssml:!0,name:"Cloud - cy-GB - Female - Gwyneth"},"cy-GB_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"cy-GB",ename:"Geraint",ssml:!0,name:"Cloud - cy-GB - Male - Geraint"},"en-IN_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-IN",ename:"Raveena",ssml:!0,name:"Cloud - en-IN - Female - Raveena"},"en-US_CLOUD_Male_Chipmunk":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-US",ename:"Chipmunk",ssml:!0,name:"Cloud - en-US - Male - Chipmunk"},"en-US_CLOUD_Male_Eric":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-US",ename:"Eric",ssml:!0,name:"Cloud - en-US - Male - Eric"},"en-US_CLOUD_Female_Ivy":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Ivy",ssml:!0,name:"Cloud - en-US - Female - Ivy"},"en-US_CLOUD_Female_Jennifer":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Jennifer",ssml:!0,name:"Cloud - en-US - Female - Jennifer"},"en-US_CLOUD_Male_Justin":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-US",ename:"Justin",ssml:!0,name:"Cloud - en-US - Male - Justin"},"en-US_CLOUD_Female_Kendra":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Kendra",ssml:!0,name:"Cloud - en-US - Female - Kendra"},"en-US_CLOUD_Female_Kimberly":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Kimberly",ssml:!0,name:"Cloud - en-US - Female - Kimberly"},"es-ES_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"es-ES",ename:"Conchita",ssml:!0,name:"Cloud - es-ES - Female - Conchita"},"es-ES_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"es-ES",ename:"Enrique",ssml:!0,name:"Cloud - es-ES - Male - Enrique"},"es-US_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"es-US",ename:"Penelope",ssml:!0,name:"Cloud - es-US - Female - Penelope"},"es-US_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"es-US",ename:"Miguel",ssml:!0,name:"Cloud - es-US - Male - Miguel"},"fr-CA_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"fr-CA",ename:"Chantal",ssml:!0,name:"Cloud - fr-CA - Female - Chantal"},"fr-FR_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"fr-FR",ename:"Celine",ssml:!0,name:"Cloud - fr-FR - Female - Celine"},"fr-FR_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"fr-FR",ename:"Mathieu",ssml:!0,name:"Cloud - fr-FR - Male - Mathieu"},"is-IS_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"is-IS",ename:"Dora",ssml:!0,name:"Cloud - is-IS - Female - Dora"},"is-IS_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"is-IS",ename:"Karl",ssml:!0,name:"Cloud - is-IS - Male - Karl"},"it-IT_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"it-IT",ename:"Carla",ssml:!0,name:"Cloud - it-IT - Female - Carla"},"it-IT_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"it-IT",ename:"Giorgio",ssml:!0,name:"Cloud - it-IT - Male - Giorgio"},"nb-NO_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"nb-NO",ename:"Liv",ssml:!0,name:"Cloud - nb-NO - Female - Liv"},"nl-NL_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"nl-NL",ename:"Lotte",ssml:!0,name:"Cloud - nl-NL - Female - Lotte"},"nl-NL_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"nl-NL",ename:"Ruben",ssml:!0,name:"Cloud - nl-NL - Male - Ruben"},"pl-PL_CLOUD_Female_Agnieszka":{gender:"Female",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Agnieszka",ssml:!0,name:"Cloud - pl-PL - Female - Agnieszka"},"pl-PL_CLOUD_Male_Jacek":{gender:"Male",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Jacek",ssml:!0,name:"Cloud - pl-PL - Male - Jacek"},"pl-PL_CLOUD_Female_Ewa":{gender:"Female",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Ewa",ssml:!0,name:"Cloud - pl-PL - Female - Ewa"},"pl-PL_CLOUD_Male_Jan":{gender:"Male",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Jan",ssml:!0,name:"Cloud - pl-PL - Male - Jan"},"pl-PL_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Maja",ssml:!0,name:"Cloud - pl-PL - Female - Maja"},"pt-BR_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"pt-BR",ename:"Vitoria",ssml:!0,name:"Cloud - pt-BR - Female - Vitoria"},"pt-BR_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"pt-BR",ename:"Ricardo",ssml:!0,name:"Cloud - pt-BR - Male - Ricardo"},"pt-PT_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"pt-PT",ename:"Cristiano",ssml:!0,name:"Cloud - pt-PT - Male - Cristiano"},"pt-PT_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"pt-PT",ename:"Ines",ssml:!0,name:"Cloud - pt-PT - Female - Ines"},"ro-RO_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"ro-RO",ename:"Carmen",ssml:!0,name:"Cloud - ro-RO - Female - Carmen"},"sv-SE_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"sv-SE",ename:"Astrid",ssml:!0,name:"Cloud - sv-SE - Female - Astrid"},"tr-TR_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"tr-TR",ename:"Filiz",ssml:!0,name:"Cloud - tr-TR - Female - Filiz"},"ru-RU_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"ru-RU",ename:"Tatyana",ssml:!0,name:"AWS Polly - Русский - Татьяна"},"ru-RU_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"ru-RU",ename:"Maxim",ssml:!0,name:"AWS Polly - Русский - Максим"},"de-DE_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"de-DE",ename:"Marlene",ssml:!0,name:"AWS Polly - Deutsch - Marlene"},"de-DE_AP_Female_Vicky":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"de-DE",ename:"Vicky",ssml:!0,name:"AWS Polly - Deutsch - Vicky"},"de-DE_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"de-DE",ename:"Hans",ssml:!0,name:"AWS Polly - Deutsch - Hans"},"en-US_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Salli",ssml:!0,name:"AWS Polly - en-US - Female - Salli"},"en-US_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Joey",ssml:!0,name:"AWS Polly - en-US - Male - Joey"},"da-DK_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"da-DK",ename:"Naja",ssml:!0,name:"AWS Polly - da-DK - Female - Naja"},"da-DK_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"da-DK",ename:"Mads",ssml:!0,name:"AWS Polly - da-DK - Male - Mads"},"en-AU_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-AU",ename:"Nicole",ssml:!0,name:"AWS Polly - en-AU - Female - Nicole"},"en-AU_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-AU",ename:"Russell",ssml:!0,name:"AWS Polly - en-AU - Male - Russell"},"en-GB_AP_Female_Amy":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB",ename:"Amy",ssml:!0,name:"AWS Polly - en-GB - Female - Amy"},"en-GB_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB",ename:"Brian",ssml:!0,name:"AWS Polly - en-GB - Male - Brian"},"en-GB_AP_Female_Emma":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB",ename:"Emma",ssml:!0,name:"AWS Polly - en-GB - Female - Emma"},"en-GB-WLS_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB-WLS",ename:"Gwyneth",ssml:!0,name:"AWS Polly - en-GB-WLS - Female - Gwyneth"},"en-GB-WLS_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB-WLS",ename:"Geraint",ssml:!0,name:"AWS Polly - en-GB-WLS - Male - Geraint"},"cy-GB_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"cy-GB",ename:"Gwyneth",ssml:!0,name:"AWS Polly - cy-GB - Female - Gwyneth"},"cy-GB_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"cy-GB",ename:"Geraint",ssml:!0,name:"AWS Polly - cy-GB - Male - Geraint"},"en-IN_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-IN",ename:"Raveena",ssml:!0,name:"AWS Polly - en-IN - Female - Raveena"},"en-US_AP_Male_Chipmunk":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Chipmunk",ssml:!0,name:"AWS Polly - en-US - Male - Chipmunk"},"en-US_AP_Male_Eric":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Eric",ssml:!0,name:"AWS Polly - en-US - Male - Eric"},"en-US_AP_Female_Ivy":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Ivy",ssml:!0,name:"AWS Polly - en-US - Female - Ivy"},"en-US_AP_Female_Jennifer":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Jennifer",ssml:!0,name:"AWS Polly - en-US - Female - Jennifer"},"en-US_AP_Male_Justin":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Justin",ssml:!0,name:"AWS Polly - en-US - Male - Justin"},"en-US_AP_Female_Kendra":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Kendra",ssml:!0,name:"AWS Polly - en-US - Female - Kendra"},"en-US_AP_Female_Kimberly":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Kimberly",ssml:!0,name:"AWS Polly - en-US - Female - Kimberly"},"es-ES_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"es-ES",ename:"Conchita",ssml:!0,name:"AWS Polly - es-ES - Female - Conchita"},"es-ES_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"es-ES",ename:"Enrique",ssml:!0,name:"AWS Polly - es-ES - Male - Enrique"},"es-US_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"es-US",ename:"Penelope",ssml:!0,name:"AWS Polly - es-US - Female - Penelope"},"es-US_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"es-US",ename:"Miguel",ssml:!0,name:"AWS Polly - es-US - Male - Miguel"},"fr-CA_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"fr-CA",ename:"Chantal",ssml:!0,name:"AWS Polly - fr-CA - Female - Chantal"},"fr-FR_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"fr-FR",ename:"Celine",ssml:!0,name:"AWS Polly - fr-FR - Female - Celine"},"fr-FR_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"fr-FR",ename:"Mathieu",ssml:!0,name:"AWS Polly - fr-FR - Male - Mathieu"},"is-IS_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"is-IS",ename:"Dora",ssml:!0,name:"AWS Polly - is-IS - Female - Dora"},"is-IS_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"is-IS",ename:"Karl",ssml:!0,name:"AWS Polly - is-IS - Male - Karl"},"it-IT_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"it-IT",ename:"Carla",ssml:!0,name:"AWS Polly - it-IT - Female - Carla"},"it-IT_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"it-IT",ename:"Giorgio",ssml:!0,name:"AWS Polly - it-IT - Male - Giorgio"},"nb-NO_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"nb-NO",ename:"Liv",ssml:!0,name:"AWS Polly - nb-NO - Female - Liv"},"nl-NL_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"nl-NL",ename:"Lotte",ssml:!0,name:"AWS Polly - nl-NL - Female - Lotte"},"nl-NL_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"nl-NL",ename:"Ruben",ssml:!0,name:"AWS Polly - nl-NL - Male - Ruben"},"pl-PL_AP_Female_Agnieszka":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Agnieszka",ssml:!0,name:"AWS Polly - pl-PL - Female - Agnieszka"},"pl-PL_AP_Male_Jacek":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Jacek",ssml:!0,name:"AWS Polly - pl-PL - Male - Jacek"},"pl-PL_AP_Female_Ewa":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Ewa",ssml:!0,name:"AWS Polly - pl-PL - Female - Ewa"},"pl-PL_AP_Male_Jan":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Jan",ssml:!0,name:"AWS Polly - pl-PL - Male - Jan"},"pl-PL_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Maja",ssml:!0,name:"AWS Polly - pl-PL - Female - Maja"},"pt-BR_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pt-BR",ename:"Vitoria",ssml:!0,name:"AWS Polly - pt-BR - Female - Vitoria"},"pt-BR_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"pt-BR",ename:"Ricardo",ssml:!0,name:"AWS Polly - pt-BR - Male - Ricardo"},"pt-PT_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"pt-PT",ename:"Cristiano",ssml:!0,name:"AWS Polly - pt-PT - Male - Cristiano"},"pt-PT_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pt-PT",ename:"Ines",ssml:!0,name:"AWS Polly - pt-PT - Female - Ines"},"ro-RO_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"ro-RO",ename:"Carmen",ssml:!0,name:"AWS Polly - ro-RO - Female - Carmen"},"sv-SE_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"sv-SE",ename:"Astrid",ssml:!0,name:"AWS Polly - sv-SE - Female - Astrid"},"tr-TR_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"tr-TR",ename:"Filiz",ssml:!0,name:"AWS Polly - tr-TR - Female - Filiz"}};class Rc extends at{constructor(s){super(s,Rc.getStaticData())}static compile(s,i){return s.text?`// Sayit ${s.text||""} +`)}(${i}, ${r}, ${l})`,2]}const $O=window.Blockly.common.createBlockDefinitionsFromJsonArray([mO]);$O[CC];function bO(){window.Blockly.FieldMultilineInput||(window.Blockly.fieldRegistry.register("field_multilinetext",Oc),window.Blockly.JavaScript.forBlock.text_multiline=iO,window.Blockly.FieldMultilineInput=Oc,Object.assign(window.Blockly.Blocks,window.Blockly.common.createBlockDefinitionsFromJsonArray([{type:"text_multiline",message0:"%1 %2",args0:[{type:"field_image",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAARCAYAAADpPU2iAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAdhgAAHYYBXaITgQAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS42/U4J6AAAAP1JREFUOE+Vks0KQUEYhjmRIja4ABtZ2dm5A3t3Ia6AUm7CylYuQRaUhZSlLZJiQbFAyRnPN33y01HOW08z8873zpwzM4F3GWOCruvGIE4/rLaV+Nq1hVGMBqzhqlxgCys4wJA65xnogMHsQ5lujnYHTejBBCK2mE4abjCgMGhNxHgDFWjDSG07kdfVa2pZMf4ZyMAdWmpZMfYOsLiDMYMjlMB+K613QISRhTnITnsYg5yUd0DETmEoMlkFOeIT/A58iyK5E18BuTBfgYXfwNJv4P9/oEBerLylOnRhygmGdPpTTBZAPkde61lbQe4moWUvYUZYLfUNftIY4zwA5X2Z9AYnQrEAAAAASUVORK5CYII=",width:12,height:17,alt:"¶"},{type:"field_multilinetext",name:"TEXT",text:""}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_TEXT_HELPURL}",tooltip:"%{BKY_TEXT_TEXT_TOOLTIP}",extensions:["parent_tooltip_when_inline"]}]))),window.Blockly.FieldColour||(window.Blockly.fieldRegistry.register("field_colour",lm),window.Blockly.JavaScript.forBlock.colour_picker=aO,window.Blockly.JavaScript.forBlock.colour_blend=fO,window.Blockly.JavaScript.forBlock.colour_random=uO,window.Blockly.JavaScript.forBlock.colour_rgb=pO,window.Blockly.FieldColour=lm,Object.assign(window.Blockly.Blocks,window.Blockly.common.createBlockDefinitionsFromJsonArray([{type:"colour_picker",message0:"%1",args0:[{type:"field_colour",name:"COLOUR",colour:"#ff0000"}],output:"Colour",helpUrl:"%{BKY_COLOUR_PICKER_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_PICKER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]}])),Object.assign(window.Blockly.Blocks,window.Blockly.common.createBlockDefinitionsFromJsonArray([{type:"colour_random",message0:"%{BKY_COLOUR_RANDOM_TITLE}",output:"Colour",helpUrl:"%{BKY_COLOUR_RANDOM_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_RANDOM_TOOLTIP}"}])),Object.assign(window.Blockly.Blocks,window.Blockly.common.createBlockDefinitionsFromJsonArray([{type:"colour_rgb",message0:"%{BKY_COLOUR_RGB_TITLE} %{BKY_COLOUR_RGB_RED} %1 %{BKY_COLOUR_RGB_GREEN} %2 %{BKY_COLOUR_RGB_BLUE} %3",args0:[{type:"input_value",name:"RED",check:"Number",align:"RIGHT"},{type:"input_value",name:"GREEN",check:"Number",align:"RIGHT"},{type:"input_value",name:"BLUE",check:"Number",align:"RIGHT"}],output:"Colour",helpUrl:"%{BKY_COLOUR_RGB_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_RGB_TOOLTIP}"}])),Object.assign(window.Blockly.Blocks,window.Blockly.common.createBlockDefinitionsFromJsonArray([{type:"colour_blend",message0:"%{BKY_COLOUR_BLEND_TITLE} %{BKY_COLOUR_BLEND_COLOUR1} %1 %{BKY_COLOUR_BLEND_COLOUR2} %2 %{BKY_COLOUR_BLEND_RATIO} %3",args0:[{type:"input_value",name:"COLOUR1",check:"Colour",align:"RIGHT"},{type:"input_value",name:"COLOUR2",check:"Colour",align:"RIGHT"},{type:"input_value",name:"RATIO",check:"Number",align:"RIGHT"}],output:"Colour",helpUrl:"%{BKY_COLOUR_BLEND_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_BLEND_TOOLTIP}"}])));const a=window.Blockly.JavaScript;a.forBlock&&Object.keys(a).forEach(s=>{typeof a[s]=="function"&&(a.forBlock[s]||(console.log(`Migrating Blockly.JavaScript.${s} to Blockly.JavaScript.forBlock.${s}`),a.forBlock[s]=a[s],delete a[s]))})}let cc=!1,uc=!1,yg=null,_g=null;const hw=[];function TC(a,s,i,r){var l;if(r=r||[],(a.tagName==="BLOCK"||a.tagName==="block")&&(i=a.id),a.tagName==="FIELD"||a.tagName==="field")for(let c=0;cTC(c,s,i,r)),r}class et extends _e.Component{blockly=null;blocklyWorkspace=null;originalCode;someSelected=null;changeTimer=null;someSelectedTime=0;ignoreChanges=!1;blinkBlock;onResizeBind;didUpdate=null;lastCommand="";lastSearch;static Blockly=window.Blockly;constructor(s){super(s),this.state={languageOwnLoaded:uc,languageBlocklyLoaded:cc,changed:!1,message:"",error:"",themeType:this.props.themeType,exportText:"",importText:!1,searchText:this.props.searchText||"",showInputPrompt:null},this.originalCode=s.code||"",this.someSelected=null,this.onResizeBind=this.onResize.bind(this),this.lastSearch=this.props.searchText||"",this.blinkBlock=null,bO(),et.Blockly.dialog.setPrompt(this.onShowNameDialog),this.loadLanguages()}onShowNameDialog=(s,i,r)=>{this.setState({showInputPrompt:{promptText:s,defaultText:i,callback:r,value:i}})};static loadJS(s,i,r){const l=document.createElement("script");try{l.src=s,l.onload=i,l.onerror=i,(r||window.document.body).appendChild(l)}catch(c){console.error(`Cannot load ${s}: ${c}`),i&&i()}}static loadScripts(s,i){if(!(s!=null&&s.length)){i&&i();return}const r=s.pop();r&&!hw.includes(r)?(hw.push(r),et.loadJS(`../../adapter/${r}/blockly.js`,()=>setTimeout(()=>et.loadScripts(s,i),0))):setTimeout(()=>et.loadScripts(s,i),0)}static loadCustomBlockly(s,i){var l;const r=[];for(const c in s)!Object.prototype.hasOwnProperty.call(s,c)||!s[c]||!c.match(/^system\.adapter\./)||s[c].type!=="adapter"||(l=s[c].common)!=null&&l.blockly&&(console.log(`Detected custom blockly: ${s[c].common.name}`),r.push(s[c].common.name));et.loadScripts(r,i)}static loadXMLDoc(s){let i;return window.DOMParser?i=r=>new window.DOMParser().parseFromString(r,"text/xml"):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("Microsoft.XMLDOM")?i=r=>{const l=new window.ActiveXObject("Microsoft.XMLDOM");return l.async="false",l.loadXML(r),l}:i=()=>null,i(s)}searchBlocks(s){if(this.blocklyWorkspace){const i=et.Blockly.Xml.workspaceToDom(this.blocklyWorkspace),r=TC(i,s.toLowerCase());return console.log(`Search "${s}" found blocks: ${r.length?JSON.stringify(r):"none"}`),r}return[]}searchId(){const s=this.lastSearch?this.searchBlocks(this.lastSearch):null;s!=null&&s.length?(this.someSelected=s,this.someSelected.forEach(i=>{var r;return(r=this.blocklyWorkspace)==null?void 0:r.highlightBlock(i,!0)}),this.someSelectedTime=Date.now()):this.someSelected&&(this.someSelected.forEach(i=>{var r;return(r=this.blocklyWorkspace)==null?void 0:r.highlightBlock(i,!1)}),this.someSelected=null)}UNSAFE_componentWillReceiveProps(s){s.command&&this.lastCommand!==s.command&&(this.lastCommand=s.command,setTimeout(()=>this.lastCommand="",300),this.lastCommand==="check"?this.blocklyCheckBlocks((i,r)=>{i?(r&&et.blocklyBlinkBlock(r),this.setState({error:{text:x.I18n.t(i),title:x.I18n.t("Error was found")}}),this.blinkBlock=r):this.setState({message:x.I18n.t("Ok")})}):this.lastCommand==="export"?this.exportBlocks():this.lastCommand==="import"&&this.importBlocks()),s.searchText!==this.lastSearch&&(this.lastSearch=s.searchText,this.searchId()),this.state.themeType!==s.themeType&&this.setState({themeType:s.themeType},()=>this.updateBackground()),this.originalCode!==s.code&&(this.originalCode=s.code||"",this.loadCode(),this.searchId())}loadLanguages(){if(!cc){const s=window.document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("src",`google-blockly/msg/js/${x.I18n.getLanguage()}.js`),s.onload=()=>{cc=!0,this.setState({languageBlocklyLoaded:cc})},window.document.getElementsByTagName("head")[0].appendChild(s)}if(!uc){const s=window.document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("src",`google-blockly/own/msg/${x.I18n.getLanguage()}.js`),s.onload=()=>{uc=!0,this.setState({languageOwnLoaded:uc})},window.document.getElementsByTagName("head")[0].appendChild(s)}}onResize(){this.blocklyWorkspace&&et.Blockly.svgResize(this.blocklyWorkspace)}static jsCode2Blockly(s){s=s||"";const i=s.split(/[\r\n]+|\r|\n/g);let r="";for(let c=i.length-1;c>=0;c--)if(i[c].substring(0,2)==="//"){r=i[c].substring(2);break}if(r.substring(0,4)==="s.select(),i),setTimeout(()=>s.unselect(),i+150)}blocklyRemoveOrphanedShadows(){if(this.blocklyWorkspace){const s=this.blocklyWorkspace.getAllBlocks();let i;for(let r=0;i=s[r];r++)if(i.isShadow()){const l=i.getConnections_(!0);let c;for(let d=0;c=l[d];d++)if(!c.targetConnection){i.dispose();break}}}}blocklyCheckBlocks(s){let i;if(!this.blocklyWorkspace||this.blocklyWorkspace.getAllBlocks().length===0)return s&&s("no blocks found"),!1;let r=this.blocklyGetUnconnectedBlock();return r?i="not properly connected":(r=this.blocklyGetBlockWithWarning(),r&&(i="warning on this block")),r?(s?s(i,r):et.blocklyBlinkBlock(r),!1):(s(),!0)}blocklyGetUnconnectedBlock(){var r;const s=(r=this.blocklyWorkspace)==null?void 0:r.getAllBlocks();let i;if(s)for(let l=0;i=s[l];l++){const c=i.getConnections_(!0);let d;for(let h=0;d=c[h];h++)if(!d.sourceBlock_||(d.type===et.Blockly.INPUT_VALUE||d.type===et.Blockly.OUTPUT_VALUE)&&!d.targetConnection&&!d._optional)return i}return null}blocklyGetBlockWithWarning(){var r;const s=(r=this.blocklyWorkspace)==null?void 0:r.getAllBlocks();let i;if(s){for(let l=0;i=s[l];l++)if(i.warning)return i}return null}blocklyCode2JSCode(s){if(!this.blocklyWorkspace)return"";let i=et.Blockly.JavaScript.workspaceToCode(this.blocklyWorkspace);if(!s){i+=` +`;const r=et.Blockly.Xml.workspaceToDom(this.blocklyWorkspace),l=et.Blockly.Xml.domToText(r);i+=`//${btoa(encodeURIComponent(l))}`}return i}exportBlocks(){if(!this.blocklyWorkspace)return;let s;const i=et.Blockly.getSelected();if(i){const r=et.Blockly.Xml.blockToDom(i),l=i.getRelativeToSurfaceXY();r.setAttribute("x",(i.RTL?-l.x:l.x).toString()),r.setAttribute("y",l.y.toString()),s=et.Blockly.Xml.domToPrettyText(r)}else{const r=et.Blockly.Xml.workspaceToDom(this.blocklyWorkspace);s=et.Blockly.Xml.domToPrettyText(r)}this.setState({exportText:s})}importBlocks(){this.setState({importText:!0})}onImportBlocks(s){if(this.blocklyWorkspace&&(s=(s||"").trim(),s))try{s.startsWith("${s}`),s=s.replace(/[\n\r]/g,"").replace(/.*<\/variables>/g,""),window.scripts.loading=!0;const i=et.Blockly.utils.xml.textToDom(s);et.Blockly.Xml.appendDomToWorkspace(i,this.blocklyWorkspace),window.scripts.loading=!1,this.onBlocklyChanged()}catch(i){this.setState({error:{text:i.toString(),title:x.I18n.t("Import error")}})}}loadCode(){if(this.blocklyWorkspace){this.ignoreChanges=!0,this.blocklyWorkspace.clear();try{const s=et.jsCode2Blockly(this.originalCode)||'';window.scripts.loading=!0;const i=et.Blockly.utils.xml.textToDom(s);et.Blockly.Xml.domToWorkspace(i,this.blocklyWorkspace),window.scripts.loading=!1}catch(s){console.error(s),setTimeout(()=>this.setState({error:x.I18n.t("Cannot extract Blockly code!")}))}setTimeout(()=>this.ignoreChanges=!1,100)}}onBlocklyChanged(){this.blocklyRemoveOrphanedShadows(),this.setState({changed:!0}),this.onChange()}async componentDidUpdate(){if(!this.blockly||(this.didUpdate&&(clearTimeout(this.didUpdate),this.didUpdate=null),this.blocklyWorkspace))return;window.addEventListener("resize",this.onResizeBind,!1),yg=yg||await this.getToolbox(),_g=_g||et.Blockly.utils.xml.textToDom(yg),this.blocklyWorkspace=et.Blockly.inject(this.blockly,{renderer:"thrasos",theme:this.state.themeType==="dark"?dw:"classic",media:"google-blockly/media/",toolbox:_g,zoom:{controls:!0,wheel:!1,startScale:1,maxScale:3,minScale:.3,scaleSpeed:1.2,pinch:!0},move:{scrollbars:{horizontal:!0,vertical:!0},drag:!0,wheel:!0},trashcan:!0,grid:{spacing:25,length:1,snap:!0},sounds:!1}),window.scripts={blocklyWorkspace:this.blocklyWorkspace},this.blocklyWorkspace.registerToolboxCategoryCallback("PROCEDURE",window.Blockly.Procedures.flyoutCategoryNew),this.blocklyWorkspace.addChangeListener(i=>{var r;if(this.someSelected&&Date.now()-this.someSelectedTime>500){const l=(r=this.blocklyWorkspace)==null?void 0:r.getAllBlocks();this.someSelected=null,l==null||l.forEach(c=>c.removeSelect())}[et.Blockly.Events.UI,et.Blockly.Events.CREATE,et.Blockly.Events.VIEWPORT_CHANGE].includes(i.type)||this.ignoreChanges||(this.changeTimer&&clearTimeout(this.changeTimer),this.changeTimer=setTimeout(()=>{this.changeTimer=null,this.onBlocklyChanged()},200))}),this.loadCode(),this.onResize();const s=document.getElementsByClassName("blocklyToolboxDiv")[0];this.blockly.appendChild(s),this.updateBackground(),setTimeout(()=>this.searchId(),200)}updateBackground(){var s;this.state.themeType==="dark"?(s=this.blocklyWorkspace)==null||s.setTheme(dw):this.blocklyWorkspace&&(this.blocklyWorkspace.getThemeManager(),this.blocklyWorkspace.setTheme(et.Blockly.Themes.Classic))}componentWillUnmount(){this.blocklyWorkspace&&(this.blocklyWorkspace.dispose(),this.blocklyWorkspace=null,this.changeTimer&&clearTimeout(this.changeTimer),this.changeTimer=null,window.removeEventListener("resize",this.onResizeBind))}onChange(){this.originalCode=this.blocklyCode2JSCode(),this.props.onChange&&this.props.onChange(this.originalCode)}async getToolbox(s){const i=window.document.getElementById("toolbox");let r=i==null?void 0:i.outerHTML;if(!r)return s?(console.error("Cannot load blocks!"),""):new Promise(l=>{setTimeout(()=>l(this.getToolbox(!0)),500)});if(r=r.replace(/{(\w+)}/g,(l,c)=>window.MSG[c]),window.Blockly.CustomBlocks){let l="";const c=x.I18n.getLanguage();for(let d=0;d`;for(const f in p.blocks)Object.prototype.hasOwnProperty.call(p.blocks,f)&&(l+=p.blocks[f]);l+=""}r=r.replace("%%CUSTOM_BLOCKS%%",l)}return r}renderMessageDialog(){return this.state.message?m.jsx(x.Message,{text:typeof this.state.message=="object"?this.state.message.text:this.state.message,title:typeof this.state.message=="object"?this.state.message.title:"",onClose:()=>this.setState({message:""})},"dialogMessage"):null}renderErrorDialog(){return this.state.error?m.jsx(su,{text:typeof this.state.error=="object"?this.state.error.text.toString():this.state.error,title:typeof this.state.error=="object"?this.state.error.title:"",onClose:()=>{this.blinkBlock&&(et.blocklyBlinkBlock(this.blinkBlock),this.blinkBlock=null),this.setState({error:""})}},"dialogError"):null}renderExportDialog(){return this.state.exportText?m.jsx(sO,{themeType:this.state.themeType,onClose:()=>this.setState({exportText:""}),text:this.state.exportText,scriptId:this.props.scriptId},"dialogExport"):null}renderImportDialog(){return this.state.importText?m.jsx(Gm,{themeType:this.props.themeType,onClose:s=>{this.setState({importText:!1}),this.onImportBlocks(s)}},"dialogImport"):null}renderDialogPrompt(){return this.state.showInputPrompt?m.jsxs(Ut,{onClose:()=>{var i;const s=(i=this.state.showInputPrompt)==null?void 0:i.callback;s&&s(null),this.setState({showInputPrompt:null})},maxWidth:"sm",fullWidth:!0,open:!0,children:[m.jsx(ss,{children:this.state.showInputPrompt.promptText}),m.jsx(qt,{children:m.jsx(Eo,{variant:"standard",fullWidth:!0,autoFocus:!0,value:this.state.showInputPrompt.value,onKeyUp:s=>{var i,r;if(s.key==="Enter"){const l=(i=this.state.showInputPrompt)==null?void 0:i.callback,c=(r=this.state.showInputPrompt)==null?void 0:r.value;l&&l(c===void 0?null:c),this.setState({showInputPrompt:null})}},onChange:s=>{var r,l;const i={...this.state.showInputPrompt};(r=this.state.showInputPrompt)!=null&&r.callback&&(i.callback=(l=this.state.showInputPrompt)==null?void 0:l.callback),i.value=s.target.value,this.setState({showInputPrompt:i})}})}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",disabled:!this.state.showInputPrompt.value,onClick:()=>{var r,l;const s=(r=this.state.showInputPrompt)==null?void 0:r.callback,i=(l=this.state.showInputPrompt)==null?void 0:l.value;s&&s(i===void 0?null:i),this.setState({showInputPrompt:null})},color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Apply")}),m.jsx(He,{color:"grey",variant:"contained",onClick:()=>{var i;const s=(i=this.state.showInputPrompt)==null?void 0:i.callback;s&&s(null),this.setState({showInputPrompt:null})},startIcon:m.jsx(so,{}),children:x.I18n.t("Close")})]})]},"inputDialog"):null}render(){return this.state.languageBlocklyLoaded&&this.state.languageOwnLoaded?(this.didUpdate=setTimeout(()=>{this.didUpdate=null,this.componentDidUpdate()},100),[m.jsx("div",{ref:s=>this.blockly=s,style:{width:"100%",height:"100%",position:"relative"}},"blocklyDOM"),this.renderDialogPrompt(),this.renderMessageDialog(),this.renderErrorDialog(),this.renderExportDialog(),this.renderImportDialog()]):null}}const vO=Object.freeze(Object.defineProperty({__proto__:null,default:et},Symbol.toStringTag,{value:"Module"})),yO="_nameCard_15el3_28",_O="_iconThemCard_15el3_40",wO="_iconThemCardSelectable_15el3_49",kO="_iconHelp_15el3_53",CO="_blockName_15el3_64",TO="_controlMenuTop_15el3_123",SO="_debugInfo_15el3_132",EO="_tagCard_15el3_142",IO="_displayFlex_15el3_161",xO="_blockMarginTop_15el3_166",DO="_nameBlock_15el3_167",AO="_frontText_15el3_171",OO="_backText_15el3_177",RO="_iconTag_15el3_181",NO="_displayItalic_15el3_191",Re={nameCard:yO,iconThemCard:_O,iconThemCardSelectable:wO,iconHelp:kO,blockName:CO,controlMenuTop:TO,debugInfo:SO,tagCard:EO,displayFlex:IO,blockMarginTop:xO,nameBlock:DO,frontText:AO,backText:OO,iconTag:RO,displayItalic:NO},MO="_root_1dr6a_1",LO="_square_1dr6a_11",PO="_icon_1dr6a_16",wg={root:MO,square:LO,icon:PO},Jr=({fullWidth:a,size:s,onClick:i,style:r,className:l,value:c,square:d,icon:h})=>m.jsx(He,{variant:"outlined",color:"primary",onClick:i,fullWidth:a,style:r,className:x.Utils.clsx(wg.root,l,d?wg.square:""),size:s||"medium",children:h?m.jsx(x.Icon,{className:wg.icon,src:h}):c}),BO="_root_1ucda_1",FO={root:BO},jO=({size:a,value:s,title:i,onChange:r,className:l,customValue:c,disabled:d})=>{const[h,p]=kt(!1);return m.jsxs(m.Fragment,{children:[m.jsx(wc,{disabled:d,checked:!!(c?s:h),className:x.Utils.clsx(FO.root,l),onChange:f=>{c&&p(f.target.checked),r&&r(f.target.checked)},size:a||"medium"}),i||null]})},SC=dm(jO),zO="_root_19roy_1",pw={root:zO},Ei=a=>{const[s,i]=kt(""),{value:r,type:l,error:c,className:d,icon:h,label:p,style:f,onChange:b,fullWidth:y,autoComplete:w,customValue:v,autoFocus:_,rows:$,size:S,variant:T,multiline:E,disabled:D}=Object.assign({value:"",type:"text",error:"",className:null,table:!1,native:{},variant:"standard",size:"medium",component:null,styleComponentBlock:null,fullWidth:!1,autoComplete:"",customValue:!1,autoFocus:!1,rows:1},a);return m.jsx(Eo,{error:!!c,autoFocus:_,fullWidth:y,label:p,disabled:D,variant:T,multiline:E,rows:$,value:v?r:s,type:l,helperText:c,style:f,className:x.Utils.clsx(pw.root,d),autoComplete:w,onChange:M=>{!v&&i(M.target.value),b&&b(M.target.value)},slotProps:{input:{endAdornment:h?m.jsx(Aw,{position:"end",children:m.jsx(x.Icon,{className:pw.icon,src:h})}):null}},margin:"normal",size:S})},UO={formControl:{m:"10px 0","& .MuiFormControl-marginNormal":{mt:0,mb:0},"& > *":{color:"#2d0440 !important"},"& .MuiSelect-icon":{color:"#81688c"},"& label.Mui-focused":{color:"#81688c"},"& .MuiInput-underline:after":{borderBottomColor:"#510573"},"& .MuiInput-underline:before":{borderBottomColor:"#81688c"},"& .MuiInput-underline:hover:before":{borderBottomColor:"#81688c"}}},HO=({multiple:a,value:s,customValue:i,socket:r,title:l,attr:c,adapter:d,style:h,onChange:p,onInstanceHide:f})=>{const[b,y]=kt(s||"test1"),[w,v]=kt([]);return Lt(()=>{r==null||r.getAdapterInstances(d).then(_=>{const $=_.map(S=>({value:S._id.replace("system.adapter.",""),title:S._id.replace("system.adapter.","")}));$.length===1?f($[0].value):$.unshift({value:d,title:x.I18n.t("All")}),v($)})},[r,d,f]),m.jsxs(Di,{sx:UO.formControl,fullWidth:!0,style:h,children:[m.jsx(Ai,{variant:"standard",value:(i?s:b)||"_",fullWidth:!0,multiple:a,renderValue:_=>a&&Array.isArray(_)?_.join(", "):_,onChange:_=>{!i&&y(_.target.value),p(_.target.value)},input:c?m.jsx(Pn,{name:c,id:`${c}-helper`}):m.jsx(Pn,{name:c}),children:w.map(_=>m.jsx(it,{style:{placeContent:"space-between"},value:_.value||"_",children:x.I18n.t(_.title)},`key-${_.value}`))}),l?m.jsx(Rw,{children:x.I18n.t(l)}):null]})},WO="_modalWrapper_587ci_33",GO="_modalDialog_587ci_40",gw={modalWrapper:WO,modalDialog:GO},cm=({onClose:a,children:s,titleButtonApply:i,titleButtonClose:r,onApply:l,className:c,textInput:d,defaultValue:h,disabled:p})=>{const[f,b]=kt(h||""),[y]=kt(h||"");return m.jsxs(Ut,{open:!0,maxWidth:"md",disableEscapeKeyDown:!1,onClose:a,classes:{paper:gw.modalDialog},className:gw.modalWrapper,children:[m.jsxs(qt,{children:[d&&m.jsx(Ei,{className:c,autoComplete:"off",fullWidth:!0,variant:"outlined",size:"medium",rows:10,multiline:!0,value:f,onChange:b,customValue:!0}),!d&&s]}),m.jsxs(Ht,{children:[m.jsx(He,{disabled:p===void 0?y===f:p,onClick:()=>l(d?f:null),variant:"contained",color:"primary",children:x.I18n.t(i||"Ok")}),m.jsx(He,{color:"grey",onClick:a,variant:"contained",children:x.I18n.t(r||"Cancel")})]})]})},VO="_root_15mo1_1",KO={root:VO},YO=({multiple:a,value:s,customValue:i,title:r,attr:l,options:c,style:d,onChange:h,className:p,doNotTranslate:f,doNotTranslate2:b})=>{const[y,w]=kt(s===void 0?c[0].value:s),v=i?s:y,_=v===""||v===null||v===void 0?"_":v;return m.jsxs(Di,{variant:"standard",className:x.Utils.clsx(KO.root,p),fullWidth:!0,style:d,children:[m.jsxs(Ai,{variant:"standard",value:_,fullWidth:!0,multiple:a,renderValue:$=>{if(a&&Array.isArray($)){$.sort();let T=$.indexOf("0");T!==-1&&($.splice(T,1),$.push("0")),T=$.indexOf("_"),T!==-1&&($.splice(T,1),$.unshift("_"));const E=c.find(M=>M.only);return E&&$.includes(E.value)?E.titleShort?f?E.titleShort:x.I18n.t(E.titleShort):f?E.title:x.I18n.t(E.title):$.map(M=>c.find(P=>P.value===M||M==="_"&&P.value==="")||M).map(M=>typeof M=="object"?M.titleShort?f?M.titleShort:x.I18n.t(M.titleShort):f?M.title:x.I18n.t(M.title):f?M:x.I18n.t(M)).join(", ")}const S=c?c.find(T=>T.value===$||$==="_"&&T.value===""):null;return S!=null&&S.title?f?S==null?void 0:S.title:x.I18n.t(S==null?void 0:S.title):$},onChange:$=>{if(i||w($.target.value),a){const S=$.target.value,T=c.find(E=>E.only);if(T){const E=T.value;if(S.length===c.length-1&&S.includes(E))return h(S.filter(D=>D!==E),l);if(S.includes(E))return h(c.map(D=>D.value),l)}}h($.target.value,l)},input:l?m.jsx(Pn,{name:l,id:`${l}-helper`}):m.jsx(Pn,{name:l}),children:[!a&&(c==null?void 0:c.map($=>m.jsxs(it,{style:{placeContent:"space-between"},value:$.value===""||$.value===null||$.value===void 0?"_":$.value,children:[f?$.title:x.I18n.t($.title),$.title2&&m.jsx("div",{children:b?$.title2:x.I18n.t($.title2)})]},`key-${$.value}`))),a&&(c==null?void 0:c.map($=>m.jsxs(it,{style:{placeContent:"space-between"},value:$.value||"_",children:[f?$.title:x.I18n.t($.title)," ",m.jsx(SC,{customValue:!0,value:s==null?void 0:s.includes($.value)})]},`key-${$.value}`)))]}),r?m.jsx(Rw,{children:x.I18n.t(r)}):null]})},JO="_root_1gt4d_1",qO="_mark_1gt4d_27",mw={root:JO,mark:qO},XO=({size:a,value:s,style:i,onChange:r,className:l,customValue:c,min:d,max:h,step:p,unit:f})=>{const[b,y]=kt(0);d=d!==void 0?d:0,h=h!==void 0?h:0,p=p!==void 0?p:(h-d)/100;const w=[{value:d,label:d+(f||"")},{value:h,label:h+(f||"")}];return m.jsx(qT,{defaultValue:c?s:b,"aria-labelledby":"discrete-slider",valueLabelDisplay:"auto",classes:{mark:mw.mark},marks:w,step:p,min:d,max:h,value:c?s:b,style:i,className:x.Utils.clsx(mw.root,l),onChange:(v,_)=>{Array.isArray(_)?(!c&&y(_[0]),r(_[0])):(!c&&y(_),r(_))},size:a||"medium"})},ZO="_root_rzul6_1",QO={root:ZO},eR=({label:a,size:s,value:i,style:r,onChange:l,className:c,customValue:d})=>{const[h,p]=kt(!1);return m.jsx(Mg,{className:QO.root,control:m.jsx(Nw,{checked:d?i:h,style:r,className:c,onChange:f=>{d||p(f.target.checked),l(f.target.checked)},size:s||"medium"}),label:a??"all"})},tR=dm(eR),sR="_root_135pm_1",oR={root:sR},iR=({value:a,style:s,onChange:i,className:r})=>m.jsx(Eo,{variant:"standard",id:"time",type:"time",onChange:l=>i(l.currentTarget.value),value:a,className:x.Utils.clsx(oR.root,r),fullWidth:!0,style:s,slotProps:{htmlInput:{step:300},inputLabel:{shrink:!0}}}),nR="_root_135pm_1",dc={root:nR},kg=[31,29,31,30,31,30,31,31,30,31,30,31],rR=({value:a,onChange:s,className:i,style:r})=>{const[l,c]=(a||"01.01").toString().split(".");let d=parseInt(c,10)||0,h=parseInt(l,10)||0;h>12?h=12:h<0&&(h=0),d>kg[h]?d=kg[h]:d<0&&(d=0);const p=[];for(let f=0;fs(`${f.target.value.toString().padStart(2,"0")}.${d.toString().padStart(2,"0")}`),value:h,children:[m.jsx(it,{style:{placeContent:"space-between"},value:0,children:x.I18n.t("Any month")},0),m.jsx(it,{style:{placeContent:"space-between"},value:1,children:x.I18n.t("January")},1),m.jsx(it,{style:{placeContent:"space-between"},value:2,children:x.I18n.t("February")},2),m.jsx(it,{style:{placeContent:"space-between"},value:3,children:x.I18n.t("March")},3),m.jsx(it,{style:{placeContent:"space-between"},value:4,children:x.I18n.t("April")},4),m.jsx(it,{style:{placeContent:"space-between"},value:5,children:x.I18n.t("May")},5),m.jsx(it,{style:{placeContent:"space-between"},value:6,children:x.I18n.t("June")},6),m.jsx(it,{style:{placeContent:"space-between"},value:7,children:x.I18n.t("July")},7),m.jsx(it,{style:{placeContent:"space-between"},value:8,children:x.I18n.t("August")},8),m.jsx(it,{style:{placeContent:"space-between"},value:9,children:x.I18n.t("September")},9),m.jsx(it,{style:{placeContent:"space-between"},value:10,children:x.I18n.t("October")},10),m.jsx(it,{style:{placeContent:"space-between"},value:11,children:x.I18n.t("November")},11),m.jsx(it,{style:{placeContent:"space-between"},value:12,children:x.I18n.t("December")},12)]})}),m.jsx(Di,{variant:"standard",className:x.Utils.clsx(dc.root,i),style:r,children:m.jsxs(Ai,{variant:"standard",className:x.Utils.clsx(dc.root,i),margin:"dense",label:x.I18n.t("Date"),onChange:f=>s(`${h.toString().padStart(2,"0")}.${f.target.value.toString().padStart(2,"0")}`),value:d,children:[m.jsx(it,{style:{placeContent:"space-between"},value:0,children:x.I18n.t("Any")},"A"),p.map(f=>m.jsx(it,{style:{placeContent:"space-between"},value:f,children:f},f))]})})]})},Cg={},aR={Shuffle:bx,Apps:rx,Functions:hx,Language:kS,AddBox:nx,Pause:bc,Subject:yx,PlayForWork:fx,Brightness3:ax,HelpOutline:pk,Storage:vx,AccessTime:ix,PlayArrow:Wg,FlashOn:ux};function fw({iconName:a,className:s,adapter:i,socket:r,onClick:l,style:c}){const[d,h]=kt("");if(Lt(()=>{i&&r&&(Cg[i]instanceof Promise||(Cg[i]=r.getObject(`system.adapter.${i}`)),Cg[i].then(f=>{var b;return((b=f==null?void 0:f.common)==null?void 0:b.icon)&&h(`../../adapter/${i}/${f.common.icon}`)}))},[i,r]),i)return m.jsx("img",{onClick:f=>l&&l(f),src:d||"",className:s,style:c,alt:""});const p=a&&aR[a]||CS;return m.jsx(p,{className:s,style:c,onClick:f=>l&&l(f)})}let Tg;function lR(a){return Tg=Tg||x.I18n.getLanguage(),a&&typeof a=="object"?a[Tg]||a.en:a||""}function Ln(a){return a===null?"null":a===void 0?"undefined":Array.isArray(a)?a.join(", "):typeof a=="object"?JSON.stringify(a):a.toString()}class at extends xw{debugHideTimeout=null;lastObjectIdChange=0;enableSimulationProcessing=!1;lastDebugMessage=0;debugMessageTimeout=null;static getStaticData(){return{acceptedBy:"actions",name:"Not found",id:"ActionEmpty",icon:"Shuffle"}}static compile(s,i){return""}constructor(s,i){super(s),i||={};const r=s.settings||{tagCard:i.tagCardArray?typeof i.tagCardArray[0]!="string"?i.tagCardArray[0].title:i.tagCardArray[0]:""};!r.tagCard&&i.tagCardArray&&(r.tagCard=typeof i.tagCardArray[0]!="string"?i.tagCardArray[0].title:i.tagCardArray[0]),this.state={inputs:i.inputs||s.inputs||[],name:i.name||s.name||"",icon:i.icon||s.icon||"",adapter:i.adapter||s.adapter||"",helpDialog:i.helpDialog||s.helpDialog||"",tagCardArray:i.tagCardArray||[],openTagMenu:!1,openModal:!1,iconTag:!1,error:"",helpText:"",instanceSelectionOptions:[],instanceSelectionDef:"",hideAttributes:[],settings:r,debugMessage:null,enableSimulation:this.props.enableSimulation}}componentWillUnmount(){this.debugMessageTimeout&&(clearTimeout(this.debugMessageTimeout),this.debugMessageTimeout=null),this.debugHideTimeout&&(clearTimeout(this.debugHideTimeout),this.debugHideTimeout=null)}onTagChange(s,i,r,l,c){let d=!1;const h=JSON.parse(JSON.stringify(this.state.settings));this.state.inputs.forEach(p=>{const f=p.attr,b=p.defaultValue;f&&b!==void 0&&h[f]===void 0&&(d=!0,h[f]=b)}),d?(this.setState({settings:h},()=>i==null?void 0:i()),this.props.onChange(h)):i&&i()}onUpdate(){}onValueChanged(s,i){}renderText(s,i,r){const{className:l}=this.props,{attr:c,frontText:d,backText:h,nameBlock:p,name:f,doNotTranslate:b,doNotTranslateBack:y}=s;return m.jsxs(Dg,{children:[m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),children:[d&&m.jsx("div",{className:Re.frontText,children:b?d:x.I18n.t(d)}),m.jsx(Ei,{className:l,autoComplete:"off",label:lR(f),variant:"outlined",size:"small",fullWidth:!0,value:i,onChange:r,customValue:!0}),h&&m.jsx("div",{className:Re.backText,children:y?h:x.I18n.t(h)})]}),p&&m.jsx("div",{className:Re.nameBlock,children:x.I18n.t(p)})]},c)}renderSwitch(s,i,r){const{className:l}=this.props,{attr:c,frontText:d,backText:h,nameBlock:p,doNotTranslate:f,doNotTranslateBack:b}=s;return m.jsxs("div",{children:[m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),children:[d&&m.jsx("div",{className:Re.frontText,children:f?d:x.I18n.t(d)}),m.jsx(tR,{className:l,label:"",customValue:!0,value:i,onChange:r}),h&&m.jsx("div",{className:Re.backText,children:b?h:x.I18n.t(h)})]}),p&&m.jsx("div",{className:Re.nameBlock,children:x.I18n.t(p)})]},c)}renderNameText({attr:s,signature:i,doNotTranslate:r,defaultValue:l},c){return m.jsx("div",{className:x.Utils.clsx(i?Re.displayItalic:Re.displayFlex,Re.blockMarginTop),children:c?r?c:x.I18n.t(c):r?l:x.I18n.t(l)},s)}renderNumber(s,i,r){const{className:l}=this.props,{settings:c}=this.state,{attr:d,backText:h,frontText:p,openCheckbox:f,doNotTranslate:b,doNotTranslateBack:y}=s;let w=!0;return f&&(w=typeof c.offset=="boolean"?c.offset:!0),w?m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),children:[p&&m.jsx("div",{className:Re.frontText,children:b?p:x.I18n.t(p)}),m.jsx(Ei,{className:x.Utils.clsx(l,s.className),fullWidth:!0,autoComplete:"off",label:s.noHelperText?"":"number",variant:"outlined",size:"small",type:"number",value:i,onChange:r,customValue:!0}),h&&m.jsx("div",{className:Re.backText,children:y?h:x.I18n.t(h)})]},d):null}renderColor(s,i,r){const{className:l}=this.props,{attr:c,backText:d,frontText:h,doNotTranslate:p,doNotTranslateBack:f}=s;return m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),children:[h&&m.jsx("div",{className:Re.frontText,children:p?h:x.I18n.t(h)}),m.jsx(Ei,{className:l,autoComplete:"off",fullWidth:!0,variant:"outlined",size:"small",type:"color",value:i,onChange:r}),d&&m.jsx("div",{className:Re.backText,children:f?d:x.I18n.t(d)})]},c)}renderCheckbox(s,i,r){const{className:l}=this.props,{settings:c}=this.state,{attr:d,backText:h,frontText:p,defaultValue:f,doNotTranslate:b,doNotTranslateBack:y}=s;return m.jsxs("div",{className:Re.displayFlex,children:[p&&m.jsx("div",{className:Re.frontText,children:b?p:x.I18n.t(p)}),m.jsx(SC,{className:l,size:"small",value:typeof c[d]=="boolean"?!!c[d]:!!f,customValue:!0,onChange:r}),h&&m.jsx("div",{onClick:()=>r(typeof c[d]=="boolean"?!c[d]:!f),className:Re.backText,children:y?h:x.I18n.t(h)})]},d)}renderSlider(s,i,r){const{className:l}=this.props,{attr:c,frontText:d,backText:h,nameBlock:p,min:f,max:b,step:y,unit:w,doNotTranslate:v,doNotTranslateBack:_}=s;return m.jsxs("div",{children:[m.jsxs("div",{className:Re.displayFlex,style:{marginRight:20},children:[d&&m.jsx("div",{className:Re.frontText,children:v?d:x.I18n.t(d)}),m.jsx(XO,{customValue:!0,min:f,max:b,step:y,unit:w,className:l,autoComplete:"off",label:"number",variant:"outlined",size:"small",value:i,onChange:$=>{console.log($),r($)}}),h&&m.jsx("div",{style:{marginLeft:20},className:Re.backText,children:_?h:x.I18n.t(h)})]}),p&&m.jsx("div",{className:Re.nameBlock,children:x.I18n.t(p)})]},c)}renderButton(s,i,r){const{className:l}=this.props,{attr:c,frontText:d,backText:h,doNotTranslate:p,doNotTranslateBack:f}=s;return m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),children:[d&&m.jsx("div",{className:Re.frontText,children:p?d:x.I18n.t(d)}),m.jsx(Jr,{fullWidth:!0,value:i.toString(),className:l,onClick:()=>r(i)}),h&&m.jsx("div",{className:Re.backText,children:f?h:x.I18n.t(h)})]},c)}async findIcon(s){var i;if(!s)return null;if((i=s.common)!=null&&i.icon)return x.getSelectIdIcon(s,"../..");if(s.type==="state"||s.type==="channel"){const r=s._id.split(".");r.pop();const l=r.join(".");try{const c=await this.props.socket.getObject(l);return await this.findIcon(c)}catch{return null}}return null}renderObjectID(s,i,r){const{attr:l,openCheckbox:c,checkReadOnly:d}=s,{settings:h}=this.state,p=this.state[`showSelectId${l}`],{className:f,socket:b,style:y}=this.props;let w=!0;c&&(w=typeof h.offset=="boolean"?h.offset:!0);const v=h[l],_=v?this.state[v]:void 0;return v&&!_&&_!==!1&&setTimeout(async $=>{var D;const S=await b.getObject(i),T=await this.findIcon(S),E={[$]:S||!1,[`${$}___icon`]:T,error:d&&this.lastObjectIdChange&&Date.now()-this.lastObjectIdChange<1e3&&((D=S==null?void 0:S.common)==null?void 0:D.write)===!1?x.I18n.t("Read only ID selected: %s",h[$]):""};this.setState(E)},0,v),w?m.jsxs("div",{className:Re.blockMarginTop,children:[m.jsxs("div",{className:Re.displayFlex,children:[s.title?m.jsx("div",{children:x.I18n.t(s.title)}):null,m.jsx(Ei,{className:f,style:y,autoComplete:"off",fullWidth:!0,disabled:!0,variant:"outlined",size:"small",value:i,customValue:!0}),m.jsx(Jr,{icon:this.state[`${v}___icon`],square:!0,style:{...y||void 0,marginLeft:7},value:"...",className:f,onClick:()=>{const $={};$[`showSelectId${l}`]=!0,this.setState($)}})]}),_?m.jsx("div",{className:x.Utils.clsx(Re.nameBlock,Re.displayItalic),children:x.Utils.getObjectNameFromObj(_,x.I18n.getLanguage())}):null,p?m.jsx(x.DialogSelectID,{theme:this.props.theme,imagePrefix:"../..",dialogName:"javascript",themeType:x.Utils.getThemeName(),socket:b,selected:i,onClose:()=>{const $={};$[`showSelectId${l}`]=!1,this.setState($)},onOk:($,S)=>{const T={};T[`showSelectId${l}`]=!1;const E=Array.isArray($)?$[0]:$;this.setState(T,async()=>{var M,P,W,G,z,Z,he,Ce,R,K;const D=E?await b.getObject(E):void 0;this.lastObjectIdChange=Date.now(),r({[l]:$,[`${l}Role`]:(M=D==null?void 0:D.common)==null?void 0:M.role,[`${l}Type`]:(P=D==null?void 0:D.common)==null?void 0:P.type,[`${l}Unit`]:(W=D==null?void 0:D.common)==null?void 0:W.unit,[`${l}States`]:(G=D==null?void 0:D.common)==null?void 0:G.states,[`${l}Min`]:(z=D==null?void 0:D.common)==null?void 0:z.min,[`${l}Max`]:(Z=D==null?void 0:D.common)==null?void 0:Z.max,[`${l}Step`]:(he=D==null?void 0:D.common)==null?void 0:he.step,[`${l}Def`]:(Ce=D==null?void 0:D.common)==null?void 0:Ce.def,[`${l}Write`]:(R=D==null?void 0:D.common)==null?void 0:R.write,[`${l}Read`]:(K=D==null?void 0:D.common)==null?void 0:K.read},()=>this.props.setOnUpdate&&this.props.setOnUpdate(!0))})}}):null]},l):null}renderIconTag(){return m.jsx("div",{className:Re.iconTag,onClick:s=>{this.state.settings.tagCard&&(this.state.tagCardArray.length<3?this.onChangeTag():this.setState({openTagMenu:s.currentTarget}))},children:this.state.settings.tagCard})}renderTime(s,i,r){const{attr:l,backText:c,frontText:d,doNotTranslate:h,doNotTranslateBack:p}=s;return m.jsxs("div",{className:Re.displayFlex,style:{whiteSpace:"nowrap"},children:[d&&m.jsx("div",{className:Re.frontText,children:h?d:x.I18n.t(d)}),m.jsx(iR,{value:i,onChange:r}),c&&m.jsx("div",{className:Re.backText,children:p?c:x.I18n.t(c)})]},l)}renderSelect(s,i,r){const{className:l,style:c}=this.props,{name:d,options:h,frontText:p,backText:f,attr:b,multiple:y,doNotTranslate:w,doNotTranslate2:v,doNotTranslateBack:_}=s;return m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),style:{whiteSpace:"nowrap"},children:[p&&m.jsx("div",{className:Re.frontText,children:x.I18n.t(p)}),m.jsx(YO,{attr:b,doNotTranslate:w,doNotTranslate2:v,title:d,className:l,style:c,options:h,value:i,onChange:r,multiple:y,customValue:!0}),f&&m.jsx("div",{className:Re.backText,children:_?f:x.I18n.t(f)})]},b)}renderInstance(s,i,r){const{socket:l}=this.props,{name:c,frontText:d,backText:h,attr:p,adapter:f,doNotTranslate:b,doNotTranslateBack:y}=s;return this.state.hideAttributes.includes(p)?null:m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),style:{whiteSpace:"nowrap"},children:[d&&m.jsx("div",{className:Re.frontText,children:b?d:x.I18n.t(d)}),m.jsx(HO,{attr:p,socket:l,adapter:f,title:c,value:i,onChange:w=>{r(Array.isArray(w)?w[0]:w)},customValue:!0,onInstanceHide:w=>this.setState({hideAttributes:[...this.state.hideAttributes,p]},()=>r(w))}),h&&m.jsx("div",{className:Re.backText,children:y?h:x.I18n.t(h)})]},p)}renderDialog(s){const{onShowDialog:i,frontText:r,backText:l,attr:c,icon:d,doNotTranslate:h,doNotTranslateBack:p}=s;return m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),style:{whiteSpace:"nowrap"},children:[r&&m.jsx("div",{className:Re.frontText,children:h?r:x.I18n.t(r)}),m.jsx(fw,{iconName:d,className:x.Utils.clsx(Re.iconDialog),onClick:()=>i&&i()}),l&&m.jsx("div",{className:Re.backText,children:p?l:x.I18n.t(l)})]},c)}renderModalInput(s,i,r){const{openModal:l}=this.state,{className:c}=this.props,{attr:d,nameBlock:h,frontText:p,backText:f,noTextEdit:b,doNotTranslate:y,doNotTranslateBack:w}=s;return m.jsxs("div",{children:[m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),children:[p&&m.jsx("div",{className:Re.frontText,children:y?p:x.I18n.t(p)}),m.jsx(Ei,{disabled:!!b,className:c,autoComplete:"off",fullWidth:!0,variant:"outlined",size:"small",value:i,onChange:r,customValue:!0}),m.jsx(Jr,{square:!0,style:{marginLeft:5},value:"...",className:c,onClick:()=>this.setState({openModal:!0})}),f&&m.jsx("div",{className:Re.backText,children:w?f:x.I18n.t(f)})]}),l?m.jsx(cm,{onApply:v=>this.setState({openModal:!1},()=>v!=null&&r(v)),onClose:()=>this.setState({openModal:!1}),defaultValue:i,textInput:!0}):null,h&&m.jsx("div",{className:Re.nameBlock,children:x.I18n.t(h)})]},d)}renderDate(s,i,r){const{attr:l,backText:c,frontText:d,doNotTranslate:h,doNotTranslateBack:p}=s;return m.jsxs("div",{className:Re.displayFlex,style:{whiteSpace:"nowrap"},children:[d&&m.jsx("div",{className:Re.frontText,children:h?d:x.I18n.t(d)}),m.jsx(rR,{value:i,onChange:r}),c&&m.jsx("div",{className:Re.backText,children:p?c:x.I18n.t(c)})]},l)}static getReplacesInText(s){var r;let i="";return(r=s.trigger)!=null&&r.oidType?i=".replace(/%s/g, obj.state.val).replace(/%id/g, obj.id).replace(/%name/g, obj.common && obj.common.name).replace(/%old/g, obj.oldState.val)":s.conditionsStates.length&&(i=`.replace(/%s/g, ${s.conditionsStates[0].name}).replace(/%id/g, "${s.conditionsStates[0].id}")`),i}renderTags(){const{tagCardArray:s,openTagMenu:i}=this.state,{tagCard:r}=this.state.settings;let l=r!=="="&&r!=="<>"&&r!==">="&&r!=="()"&&r!=="."&&r!=="<="&&r!=="<"&&r!==">"&&r?x.I18n.t(r):r;return s.length>=3&&(l=m.jsxs("div",{children:[m.jsx("div",{"aria-controls":"simple-menu","aria-haspopup":"true",onClick:c=>{this.setState({openTagMenu:c.currentTarget},()=>{this.props.isTourOpen&&this.props.tourStep===Ns.openTagsMenu&&setTimeout(()=>this.props.setTourStep&&this.props.setTourStep(Ns.selectIntervalTag),300)})},children:l}),m.jsx(pm,{id:"simple-menu",anchorEl:i,keepMounted:!0,open:!!i,onClose:()=>this.setState({openTagMenu:null}),children:s.map((c,d)=>{let h;return typeof c!="string"?h=c.title:h=c,m.jsxs(it,{selected:h===r,className:`tag-card-${h}`,style:{placeContent:"space-between"},onClick:p=>{p.stopPropagation(),this.props.isTourOpen&&(this.props.tourStep===Ns.openTagsMenu||this.props.tourStep===Ns.selectIntervalTag)&&h==="interval"&&setTimeout(()=>{var b,y;return(y=(b=this.props).setTourStep)==null?void 0:y.call(b,Ns.selectActions)},500);const f=JSON.parse(JSON.stringify(this.state.settings));f.tagCard=h,this.setState({openTagMenu:null,settings:f},()=>{this.props.onChange(this.state.settings),this.onTagChange(this.state.settings.tagCard)})},children:[h.search(/>|<|<>|<=|>=|=/)!==-1?h:x.I18n.t(h),typeof c!="string"&&c.title2&&m.jsx("div",{style:{marginLeft:4},children:x.I18n.t(c.title2)})]},`${h}_${d}`)})})]})),l}getData(){return{acceptedBy:"triggers",name:"",id:""}}onChangeTag(){const{tagCardArray:s,settings:i,settings:{tagCard:r}}=this.state;let l;if(typeof s[0]!="string"?l=s.map(c=>c.title):l=[...s],r&&l.length<3){const c={...i},d=l[(l.indexOf(r)+1)%l.length];c.tagCard=d,this.setState({settings:c},()=>{this.props.onChange(c),this.onTagChange(d)})}}componentDidMount(){this.onTagChange()}componentDidUpdate(){this.props.acceptedBy!=="triggers"&&this.props.onUpdate&&setTimeout(()=>this.onUpdate(),0)}onChangeInput(s){return(i,r,l)=>{const c=JSON.parse(JSON.stringify(this.state.settings));typeof i=="object"&&(!r||typeof r=="function")?(Object.keys(i).forEach(d=>c[d]=i[d]),typeof r=="function"&&(l=r,r=void 0)):c[r||s]=i,c.id=this.getData().id,c._id=this.props._id,this.setState({settings:c},()=>{this.onValueChanged(i,r||s),this.props.onChange(c),l==null||l()})}}renderSpecific(){return null}renderDebug(s){return""}renderDebugInfo(){return this.state.debugMessage?m.jsx("div",{className:Re.debugInfo,style:{opacity:1,height:22,bottom:-22},children:this.renderDebug?this.renderDebug(this.state.debugMessage):x.I18n.t("executed")},this.state.debugMessage.ts):null}renderCron(s,i,r){return null}renderWizard(s,i,r){return null}renderWriteState(){return null}renderInputElement(s,i){const{nameRender:r,defaultValue:l,attr:c}=s,{settings:d}=this.state;let h=c?d[c]:void 0;switch(h===void 0&&(h=l),r){case"renderTime":return c?this.renderTime(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderTime")},`invalid_${i}`);case"renderNameText":return this.renderNameText(s,l);case"renderSelect":return c?this.renderSelect(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderSelect")},`invalid_${i}`);case"renderModalInput":return c?this.renderModalInput(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderModalInput")},`invalid_${i}`);case"renderObjectID":return c?this.renderObjectID(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderObjectID")},`invalid_${i}`);case"renderDialog":return c?this.renderDialog(s):m.jsx("div",{children:x.I18n.t("Invalid renderDialog")},`invalid_${i}`);case"renderInstance":return c?this.renderInstance(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderInstance")},`invalid_${i}`);case"renderText":return c?this.renderText(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderText")},`invalid_${i}`);case"renderSlider":return c?this.renderSlider(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderSlider")},`invalid_${i}`);case"renderCheckbox":return c?this.renderCheckbox(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderCheckbox")},`invalid_${i}`);case"renderButton":return c?this.renderButton(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderButton")},`invalid_${i}`);case"renderColor":return c?this.renderColor(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderColor")},`invalid_${i}`);case"renderSwitch":return c?this.renderSwitch(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderSwitch")},`invalid_${i}`);case"renderDate":return c?this.renderDate(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderDate")},`invalid_${i}`);case"renderCron":return c?this.renderCron(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderCron")},`invalid_${i}`);case"renderWizard":return c?this.renderWizard(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderWizard")},`invalid_${i}`);case"renderWriteState":return this.renderWriteState();case"renderNumber":return c?this.renderNumber(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderNumber")},`invalid_${i}`);default:return this[r]?this[r](s,h,c?this.onChangeInput(c):null):m.jsx("div",{children:x.I18n.t("Invalid input type: %s",r)},`invalid_${i}`)}}render(){var w;const{inputs:s,name:i,icon:r,iconTag:l,settings:c,adapter:d,settings:{tagCard:h},helpDialog:p}=this.state,{socket:f,notFound:b}=this.props;this.state.settings&&!this.state.settings.tagCard&&((w=this.state.tagCardArray)!=null&&w.length)&&setTimeout(()=>{const v=JSON.parse(JSON.stringify(this.state.settings));v.tagCard=typeof this.state.tagCardArray[0]!="string"?this.state.tagCardArray[0].title:this.state.tagCardArray[0],this.setState({settings:v})},50),this.state.enableSimulation!==this.props.enableSimulation&&!this.enableSimulationProcessing&&(this.enableSimulationProcessing=!0,setTimeout(()=>{this.setState({enableSimulation:this.props.enableSimulation},()=>{this.enableSimulationProcessing=!1})},50));let y;if(this.props.onDebugMessage)for(let v=this.props.onDebugMessage.length-1;v>=0;v--){const _=this.props.onDebugMessage[v];if(_.blockId===this.props._id&&_.ts>this.lastDebugMessage&&_.ts>Date.now()-1e3){y=_;break}}return y&&(this.lastDebugMessage=y.ts,this.debugMessageTimeout&&clearTimeout(this.debugMessageTimeout),this.debugHideTimeout&&(clearTimeout(this.debugHideTimeout),this.debugHideTimeout=null),this.debugMessageTimeout=setTimeout(v=>{const _=JSON.parse(v),$=_.hideTimeout||5e3;this.debugMessageTimeout=null,this.setState({debugMessage:_},()=>{this.debugHideTimeout&&clearTimeout(this.debugHideTimeout),this.debugHideTimeout=setTimeout(()=>{this.debugHideTimeout=null,this.setState({debugMessage:null})},$)})},50,JSON.stringify(y))),m.jsxs(Dg,{children:[l?this.renderIconTag():m.jsx(fw,{iconName:r,className:x.Utils.clsx(Re.iconThemCard,h&&this.state.tagCardArray.length&&Re.iconThemCardSelectable),adapter:d,socket:f,onClick:v=>{h&&(this.state.tagCardArray.length<3?this.onChangeTag():this.setState({openTagMenu:v.currentTarget}))}}),m.jsxs("div",{className:Re.blockName,children:[m.jsxs("span",{className:Re.nameCard,children:[x.I18n.t(i),b?x.I18n.t("%s not found",c.id):"",p?m.jsx(qe,{className:Re.iconHelp,size:"small",onClick:()=>this.setState({helpText:x.I18n.t(p)}),children:m.jsx(pk,{})}):null]}),s.map((v,_)=>this.renderInputElement(v,_))]}),h&&m.jsx("div",{className:Re.controlMenuTop,style:{opacity:1,height:22,top:-22},children:m.jsx("div",{onClick:()=>this.onChangeTag(),className:x.Utils.clsx(Re.tagCard,"tag-card"),children:this.renderTags()})}),this.renderDebugInfo(),this.state.error?m.jsx(x.DialogError,{title:x.I18n.t("Warning"),text:this.state.error,onClose:()=>this.setState({error:""})}):null,this.state.helpText?m.jsx(x.DialogMessage,{title:x.I18n.t("Instructions"),text:this.state.helpText,onClose:()=>this.setState({helpText:""})}):null,this.renderSpecific()]})}}const $w={en:{name:"Google - English",engine:"google",params:[]},de:{name:"Google - Deutsch",engine:"google",params:[]},ru:{name:"Google - Русский",engine:"google",params:[]},it:{name:"Google - Italiano",engine:"google",params:[]},es:{name:"Google - Espaniol",engine:"google",params:[]},fr:{name:"Google - Français",engine:"google",params:[]},ru_YA:{name:"Yandex - Русский",engine:"yandex",params:["key","voice","emotion","ill","drunk","robot"],voice:["jane","zahar"],emotion:["none","good","neutral","evil","mixed"]},ru_YA_CLOUD:{name:"Yandex Cloud - Русский",engine:"yandexCloud",params:["key","folderID","voice","emotion"],voice:["alyss","oksana","jane","zahar"],emotion:["good","neutral","evil"]},"en-US":{name:"PicoTTS - Englisch US",engine:"PicoTTS",params:[]},"en-GB":{name:"PicoTTS - Englisch GB",engine:"PicoTTS",params:[]},"de-DE":{name:"PicoTTS - Deutsch",engine:"PicoTTS",params:[]},"it-IT":{name:"PicoTTS - Italiano",engine:"PicoTTS",params:[]},"es-ES":{name:"PicoTTS - Espaniol",engine:"PicoTTS",params:[]},"fr-FR":{name:"PicoTTS - Français",engine:"PicoTTS",params:[]},"ru-RU_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"ru-RU",ename:"Tatyana",ssml:!0,name:"Cloud - Русский - Татьяна"},"ru-RU_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"ru-RU",ename:"Maxim",ssml:!0,name:"Cloud - Русский - Максим"},"de-DE_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"de-DE",ename:"Marlene",ssml:!0,name:"Cloud - Deutsch - Marlene"},"de-DE_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"de-DE",ename:"Hans",ssml:!0,name:"Cloud - Deutsch - Hans"},"en-US_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Salli",ssml:!0,name:"Cloud - en-US - Female - Salli"},"en-US_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-US",ename:"Joey",ssml:!0,name:"Cloud - en-US - Male - Joey"},"da-DK_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"da-DK",ename:"Naja",ssml:!0,name:"Cloud - da-DK - Female - Naja"},"da-DK_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"da-DK",ename:"Mads",ssml:!0,name:"Cloud - da-DK - Male - Mads"},"en-AU_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-AU",ename:"Nicole",ssml:!0,name:"Cloud - en-AU - Female - Nicole"},"en-AU_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-AU",ename:"Russell",ssml:!0,name:"Cloud - en-AU - Male - Russell"},"en-GB_CLOUD_Female_Amy":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-GB",ename:"Amy",ssml:!0,name:"Cloud - en-GB - Female - Amy"},"en-GB_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-GB",ename:"Brian",ssml:!0,name:"Cloud - en-GB - Male - Brian"},"en-GB_CLOUD_Female_Emma":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-GB",ename:"Emma",ssml:!0,name:"Cloud - en-GB - Female - Emma"},"en-GB-WLS_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-GB-WLS",ename:"Gwyneth",ssml:!0,name:"Cloud - en-GB-WLS - Female - Gwyneth"},"en-GB-WLS_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-GB-WLS",ename:"Geraint",ssml:!0,name:"Cloud - en-GB-WLS - Male - Geraint"},"cy-GB_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"cy-GB",ename:"Gwyneth",ssml:!0,name:"Cloud - cy-GB - Female - Gwyneth"},"cy-GB_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"cy-GB",ename:"Geraint",ssml:!0,name:"Cloud - cy-GB - Male - Geraint"},"en-IN_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-IN",ename:"Raveena",ssml:!0,name:"Cloud - en-IN - Female - Raveena"},"en-US_CLOUD_Male_Chipmunk":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-US",ename:"Chipmunk",ssml:!0,name:"Cloud - en-US - Male - Chipmunk"},"en-US_CLOUD_Male_Eric":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-US",ename:"Eric",ssml:!0,name:"Cloud - en-US - Male - Eric"},"en-US_CLOUD_Female_Ivy":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Ivy",ssml:!0,name:"Cloud - en-US - Female - Ivy"},"en-US_CLOUD_Female_Jennifer":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Jennifer",ssml:!0,name:"Cloud - en-US - Female - Jennifer"},"en-US_CLOUD_Male_Justin":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-US",ename:"Justin",ssml:!0,name:"Cloud - en-US - Male - Justin"},"en-US_CLOUD_Female_Kendra":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Kendra",ssml:!0,name:"Cloud - en-US - Female - Kendra"},"en-US_CLOUD_Female_Kimberly":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Kimberly",ssml:!0,name:"Cloud - en-US - Female - Kimberly"},"es-ES_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"es-ES",ename:"Conchita",ssml:!0,name:"Cloud - es-ES - Female - Conchita"},"es-ES_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"es-ES",ename:"Enrique",ssml:!0,name:"Cloud - es-ES - Male - Enrique"},"es-US_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"es-US",ename:"Penelope",ssml:!0,name:"Cloud - es-US - Female - Penelope"},"es-US_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"es-US",ename:"Miguel",ssml:!0,name:"Cloud - es-US - Male - Miguel"},"fr-CA_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"fr-CA",ename:"Chantal",ssml:!0,name:"Cloud - fr-CA - Female - Chantal"},"fr-FR_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"fr-FR",ename:"Celine",ssml:!0,name:"Cloud - fr-FR - Female - Celine"},"fr-FR_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"fr-FR",ename:"Mathieu",ssml:!0,name:"Cloud - fr-FR - Male - Mathieu"},"is-IS_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"is-IS",ename:"Dora",ssml:!0,name:"Cloud - is-IS - Female - Dora"},"is-IS_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"is-IS",ename:"Karl",ssml:!0,name:"Cloud - is-IS - Male - Karl"},"it-IT_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"it-IT",ename:"Carla",ssml:!0,name:"Cloud - it-IT - Female - Carla"},"it-IT_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"it-IT",ename:"Giorgio",ssml:!0,name:"Cloud - it-IT - Male - Giorgio"},"nb-NO_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"nb-NO",ename:"Liv",ssml:!0,name:"Cloud - nb-NO - Female - Liv"},"nl-NL_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"nl-NL",ename:"Lotte",ssml:!0,name:"Cloud - nl-NL - Female - Lotte"},"nl-NL_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"nl-NL",ename:"Ruben",ssml:!0,name:"Cloud - nl-NL - Male - Ruben"},"pl-PL_CLOUD_Female_Agnieszka":{gender:"Female",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Agnieszka",ssml:!0,name:"Cloud - pl-PL - Female - Agnieszka"},"pl-PL_CLOUD_Male_Jacek":{gender:"Male",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Jacek",ssml:!0,name:"Cloud - pl-PL - Male - Jacek"},"pl-PL_CLOUD_Female_Ewa":{gender:"Female",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Ewa",ssml:!0,name:"Cloud - pl-PL - Female - Ewa"},"pl-PL_CLOUD_Male_Jan":{gender:"Male",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Jan",ssml:!0,name:"Cloud - pl-PL - Male - Jan"},"pl-PL_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Maja",ssml:!0,name:"Cloud - pl-PL - Female - Maja"},"pt-BR_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"pt-BR",ename:"Vitoria",ssml:!0,name:"Cloud - pt-BR - Female - Vitoria"},"pt-BR_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"pt-BR",ename:"Ricardo",ssml:!0,name:"Cloud - pt-BR - Male - Ricardo"},"pt-PT_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"pt-PT",ename:"Cristiano",ssml:!0,name:"Cloud - pt-PT - Male - Cristiano"},"pt-PT_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"pt-PT",ename:"Ines",ssml:!0,name:"Cloud - pt-PT - Female - Ines"},"ro-RO_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"ro-RO",ename:"Carmen",ssml:!0,name:"Cloud - ro-RO - Female - Carmen"},"sv-SE_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"sv-SE",ename:"Astrid",ssml:!0,name:"Cloud - sv-SE - Female - Astrid"},"tr-TR_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"tr-TR",ename:"Filiz",ssml:!0,name:"Cloud - tr-TR - Female - Filiz"},"ru-RU_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"ru-RU",ename:"Tatyana",ssml:!0,name:"AWS Polly - Русский - Татьяна"},"ru-RU_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"ru-RU",ename:"Maxim",ssml:!0,name:"AWS Polly - Русский - Максим"},"de-DE_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"de-DE",ename:"Marlene",ssml:!0,name:"AWS Polly - Deutsch - Marlene"},"de-DE_AP_Female_Vicky":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"de-DE",ename:"Vicky",ssml:!0,name:"AWS Polly - Deutsch - Vicky"},"de-DE_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"de-DE",ename:"Hans",ssml:!0,name:"AWS Polly - Deutsch - Hans"},"en-US_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Salli",ssml:!0,name:"AWS Polly - en-US - Female - Salli"},"en-US_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Joey",ssml:!0,name:"AWS Polly - en-US - Male - Joey"},"da-DK_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"da-DK",ename:"Naja",ssml:!0,name:"AWS Polly - da-DK - Female - Naja"},"da-DK_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"da-DK",ename:"Mads",ssml:!0,name:"AWS Polly - da-DK - Male - Mads"},"en-AU_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-AU",ename:"Nicole",ssml:!0,name:"AWS Polly - en-AU - Female - Nicole"},"en-AU_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-AU",ename:"Russell",ssml:!0,name:"AWS Polly - en-AU - Male - Russell"},"en-GB_AP_Female_Amy":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB",ename:"Amy",ssml:!0,name:"AWS Polly - en-GB - Female - Amy"},"en-GB_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB",ename:"Brian",ssml:!0,name:"AWS Polly - en-GB - Male - Brian"},"en-GB_AP_Female_Emma":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB",ename:"Emma",ssml:!0,name:"AWS Polly - en-GB - Female - Emma"},"en-GB-WLS_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB-WLS",ename:"Gwyneth",ssml:!0,name:"AWS Polly - en-GB-WLS - Female - Gwyneth"},"en-GB-WLS_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB-WLS",ename:"Geraint",ssml:!0,name:"AWS Polly - en-GB-WLS - Male - Geraint"},"cy-GB_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"cy-GB",ename:"Gwyneth",ssml:!0,name:"AWS Polly - cy-GB - Female - Gwyneth"},"cy-GB_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"cy-GB",ename:"Geraint",ssml:!0,name:"AWS Polly - cy-GB - Male - Geraint"},"en-IN_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-IN",ename:"Raveena",ssml:!0,name:"AWS Polly - en-IN - Female - Raveena"},"en-US_AP_Male_Chipmunk":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Chipmunk",ssml:!0,name:"AWS Polly - en-US - Male - Chipmunk"},"en-US_AP_Male_Eric":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Eric",ssml:!0,name:"AWS Polly - en-US - Male - Eric"},"en-US_AP_Female_Ivy":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Ivy",ssml:!0,name:"AWS Polly - en-US - Female - Ivy"},"en-US_AP_Female_Jennifer":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Jennifer",ssml:!0,name:"AWS Polly - en-US - Female - Jennifer"},"en-US_AP_Male_Justin":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Justin",ssml:!0,name:"AWS Polly - en-US - Male - Justin"},"en-US_AP_Female_Kendra":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Kendra",ssml:!0,name:"AWS Polly - en-US - Female - Kendra"},"en-US_AP_Female_Kimberly":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Kimberly",ssml:!0,name:"AWS Polly - en-US - Female - Kimberly"},"es-ES_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"es-ES",ename:"Conchita",ssml:!0,name:"AWS Polly - es-ES - Female - Conchita"},"es-ES_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"es-ES",ename:"Enrique",ssml:!0,name:"AWS Polly - es-ES - Male - Enrique"},"es-US_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"es-US",ename:"Penelope",ssml:!0,name:"AWS Polly - es-US - Female - Penelope"},"es-US_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"es-US",ename:"Miguel",ssml:!0,name:"AWS Polly - es-US - Male - Miguel"},"fr-CA_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"fr-CA",ename:"Chantal",ssml:!0,name:"AWS Polly - fr-CA - Female - Chantal"},"fr-FR_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"fr-FR",ename:"Celine",ssml:!0,name:"AWS Polly - fr-FR - Female - Celine"},"fr-FR_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"fr-FR",ename:"Mathieu",ssml:!0,name:"AWS Polly - fr-FR - Male - Mathieu"},"is-IS_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"is-IS",ename:"Dora",ssml:!0,name:"AWS Polly - is-IS - Female - Dora"},"is-IS_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"is-IS",ename:"Karl",ssml:!0,name:"AWS Polly - is-IS - Male - Karl"},"it-IT_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"it-IT",ename:"Carla",ssml:!0,name:"AWS Polly - it-IT - Female - Carla"},"it-IT_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"it-IT",ename:"Giorgio",ssml:!0,name:"AWS Polly - it-IT - Male - Giorgio"},"nb-NO_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"nb-NO",ename:"Liv",ssml:!0,name:"AWS Polly - nb-NO - Female - Liv"},"nl-NL_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"nl-NL",ename:"Lotte",ssml:!0,name:"AWS Polly - nl-NL - Female - Lotte"},"nl-NL_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"nl-NL",ename:"Ruben",ssml:!0,name:"AWS Polly - nl-NL - Male - Ruben"},"pl-PL_AP_Female_Agnieszka":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Agnieszka",ssml:!0,name:"AWS Polly - pl-PL - Female - Agnieszka"},"pl-PL_AP_Male_Jacek":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Jacek",ssml:!0,name:"AWS Polly - pl-PL - Male - Jacek"},"pl-PL_AP_Female_Ewa":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Ewa",ssml:!0,name:"AWS Polly - pl-PL - Female - Ewa"},"pl-PL_AP_Male_Jan":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Jan",ssml:!0,name:"AWS Polly - pl-PL - Male - Jan"},"pl-PL_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Maja",ssml:!0,name:"AWS Polly - pl-PL - Female - Maja"},"pt-BR_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pt-BR",ename:"Vitoria",ssml:!0,name:"AWS Polly - pt-BR - Female - Vitoria"},"pt-BR_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"pt-BR",ename:"Ricardo",ssml:!0,name:"AWS Polly - pt-BR - Male - Ricardo"},"pt-PT_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"pt-PT",ename:"Cristiano",ssml:!0,name:"AWS Polly - pt-PT - Male - Cristiano"},"pt-PT_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pt-PT",ename:"Ines",ssml:!0,name:"AWS Polly - pt-PT - Female - Ines"},"ro-RO_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"ro-RO",ename:"Carmen",ssml:!0,name:"AWS Polly - ro-RO - Female - Carmen"},"sv-SE_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"sv-SE",ename:"Astrid",ssml:!0,name:"AWS Polly - sv-SE - Female - Astrid"},"tr-TR_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"tr-TR",ename:"Filiz",ssml:!0,name:"AWS Polly - tr-TR - Female - Filiz"}};class Rc extends at{constructor(s){super(s,Rc.getStaticData())}static compile(s,i){return s.text?`// Sayit ${s.text||""} const subActionVar${s._id} = "${s.language&&s.language!=="_"?`${s.language};`:""}${s.volume?`${s.volume};`:""}${(s.text||"").replace(/"/g,'\\"')}"${at.getReplacesInText(i)}; _sendToFrontEnd(${s._id}, {text: subActionVar${s._id}}); await setStateAsync("${s.instance}.tts.text", subActionVar${s._id});`:`// no text defined @@ -1152,7 +1152,7 @@ if (_cond) { __%%THEN%%__ } else { __%%ELSE%%__ -}`,Cg={triggers:[],conditions:[[]],justCheck:!1,actions:{then:[],else:[]}};function uR(a,s,i){const r=[];let l=a.triggers;l.length||(l=[{id:"TriggerScriptSave"}]);const c=[],d=[],h=a.conditions.find(f=>f.find(b=>b.tagCard==="()"));l.forEach((f,b)=>{var w;const y=Wm(f.id,i);if(y){const v={trigger:f,condition:{index:0},justCheck:h?!1:a.justCheck||!a.conditions.length||!a.conditions[0].length,conditionsDebug:[],conditionsVars:[],conditionsStates:[]},_=y.compile(f,v),$=dR(a.conditions,v,i),S=bw(a.actions.then,v,i),T=bw(a.actions.else,v,i);c.push(`cond${b}`),(w=v.prelines)!=null&&w.length&&v.prelines.forEach(E=>d.push(E)),_.includes(" __%%CONDITIONS_VARS%%__")&&(v.conditionsVars=v.conditionsVars.map((E,D)=>D?` ${E}`:E),v.conditionsDebug=v.conditionsDebug.map((E,D)=>D?` ${E}`:E)),r.push(_.replace("__%%CONDITIONS_VARS%%__",v.conditionsVars.join(` +}`,Sg={triggers:[],conditions:[[]],justCheck:!1,actions:{then:[],else:[]}};function uR(a,s,i){const r=[];let l=a.triggers;l.length||(l=[{id:"TriggerScriptSave"}]);const c=[],d=[],h=a.conditions.find(f=>f.find(b=>b.tagCard==="()"));l.forEach((f,b)=>{var w;const y=Vm(f.id,i);if(y){const v={trigger:f,condition:{index:0},justCheck:h?!1:a.justCheck||!a.conditions.length||!a.conditions[0].length,conditionsDebug:[],conditionsVars:[],conditionsStates:[]},_=y.compile(f,v),$=dR(a.conditions,v,i),S=bw(a.actions.then,v,i),T=bw(a.actions.else,v,i);c.push(`cond${b}`),(w=v.prelines)!=null&&w.length&&v.prelines.forEach(E=>d.push(E)),_.includes(" __%%CONDITIONS_VARS%%__")&&(v.conditionsVars=v.conditionsVars.map((E,D)=>D?` ${E}`:E),v.conditionsDebug=v.conditionsDebug.map((E,D)=>D?` ${E}`:E)),r.push(_.replace("__%%CONDITIONS_VARS%%__",v.conditionsVars.join(` `)).replace('"__%%DEBUG_CONDITIONS%%__";',v.conditionsDebug.join(` `)).replace("__%%CONDITION%%__",$).replace("__%%THEN%%__",S||"// ignore").replace("__%%ELSE%%__",T||"// ignore").replace(/__%%STATE%%__/g,`cond${b}`))}});let p=r.join(` @@ -1162,16 +1162,16 @@ __%%ELSE%%__ ${p}`),d&&(p=`${d.join(` `)} -${p}`),p}function Wm(a,s){return s.find(i=>i.getStaticData&&i.getStaticData().id===a)}function bw(a,s,i){const r=[];return a==null||a.forEach(l=>{const c=Wm(l.id,i);c&&r.push(c.compile(l,s))}),` ${r.join(` +${p}`),p}function Vm(a,s){return s.find(i=>i.getStaticData&&i.getStaticData().id===a)}function bw(a,s,i){const r=[];return a==null||a.forEach(l=>{const c=Vm(l.id,i);c&&r.push(c.compile(l,s))}),` ${r.join(` - `)}`}function dR(a,s,i){const r=[];let l=0;return a==null||a.forEach(c=>{const d=[];c!=null&&c.length&&(c.forEach(h=>{const p=Wm(h.id,i);p&&(s.condition.index=l++,d.push(p.compile(h,s)))}),r.push(`(${d.join(`) && - (`)})`))}),r.length?r.length===1?r[0]||"true":`(${r.join(") || (")})`:"true"}function hR(a,s){return uR(a,null,s)}function pne(a){if(!a)return Cg;const s=a.split(` -`);try{const i=(s.pop()||"").replace(/^\/\//,"");let r=JSON.parse(i);return r.triggers||(r=Cg),r}catch{return Cg}}function gne(a,s){let i="";const r=hR(a,s);return i+=r,i+=` + `)}`}function dR(a,s,i){const r=[];let l=0;return a==null||a.forEach(c=>{const d=[];c!=null&&c.length&&(c.forEach(h=>{const p=Vm(h.id,i);p&&(s.condition.index=l++,d.push(p.compile(h,s)))}),r.push(`(${d.join(`) && + (`)})`))}),r.length?r.length===1?r[0]||"true":`(${r.join(") || (")})`:"true"}function hR(a,s){return uR(a,null,s)}function pne(a){if(!a)return Sg;const s=a.split(` +`);try{const i=(s.pop()||"").replace(/^\/\//,"");let r=JSON.parse(i);return r.triggers||(r=Sg),r}catch{return Sg}}function gne(a,s){let i="";const r=hR(a,s);return i+=r,i+=` /* const demo = ${JSON.stringify(a,null,2).replace(/\*\//g,"* /")}; */ `,`${i} -//${JSON.stringify(a)}`}class Pc extends at{constructor(s){super(s,Pc.getStaticData())}static compile(s,i){return cR.replace('"__%%DEBUG_TRIGGER%%__"',`_sendToFrontEnd(${s._id}, {trigger: true})`)}renderDebug(){return x.I18n.t("Triggered")}onTagChange(s){this.setState({inputs:[{nameRender:"renderNameText",defaultValue:"On script save or adapter start",attr:"script"}]},()=>super.onTagChange())}static getStaticData(){return{acceptedBy:"triggers",name:"Start script",id:"TriggerScriptSave",icon:"PlayArrow",title:"Triggers the on script saving or the javascript instance restart"}}getData(){return Pc.getStaticData()}}var xC={exports:{}};(function(a,s){(function(){var i=Math.PI,r=Math.sin,l=Math.cos,c=Math.tan,d=Math.asin,h=Math.atan2,p=Math.acos,f=i/180,b=1e3*60*60*24,y=2440588,w=2451545;function v(re){return re.valueOf()/b-.5+y}function _(re){return new Date((re+.5-y)*b)}function $(re){return v(re)-w}var S=f*23.4397;function T(re,B){return h(r(re)*l(S)-c(B)*r(S),l(re))}function E(re,B){return d(r(B)*l(S)+l(B)*r(S)*r(re))}function D(re,B,N){return h(r(re),l(re)*r(B)-c(N)*l(B))}function M(re,B,N){return d(r(B)*r(N)+l(B)*l(N)*l(re))}function P(re,B){return f*(280.16+360.9856235*re)-B}function W(re){return re<0&&(re=0),2967e-7/Math.tan(re+.00312536/(re+.08901179))}function G(re){return f*(357.5291+.98560028*re)}function z(re){var B=f*(1.9148*r(re)+.02*r(2*re)+3e-4*r(3*re)),N=f*102.9372;return re+B+N+i}function Z(re){var B=G(re),N=z(B);return{dec:E(N,0),ra:T(N,0)}}var he={};he.getPosition=function(re,B,N){var te=f*-N,q=f*B,se=$(re),j=Z(se),Te=P(se,te)-j.ra;return{azimuth:D(Te,q,j.dec),altitude:M(Te,q,j.dec)}};var Ce=he.times=[[-.833,"sunrise","sunset"],[-.3,"sunriseEnd","sunsetStart"],[-6,"dawn","dusk"],[-12,"nauticalDawn","nauticalDusk"],[-18,"nightEnd","night"],[6,"goldenHourEnd","goldenHour"]];he.addTime=function(re,B,N){Ce.push([re,B,N])};var R=9e-4;function K(re,B){return Math.round(re-R-B/(2*i))}function C(re,B,N){return R+(re+B)/(2*i)+N}function Q(re,B,N){return w+re+.0053*r(B)-.0069*r(2*N)}function ve(re,B,N){return p((r(re)-r(B)*r(N))/(l(B)*l(N)))}function ce(re,B,N,te,q,se,j){var Te=ve(re,N,te),ae=C(Te,B,q);return Q(ae,se,j)}he.getTimes=function(re,B,N){var te=f*-N,q=f*B,se=$(re),j=K(se,te),Te=C(0,te,j),ae=G(Te),we=z(ae),Ie=E(we,0),Ne=Q(Te,ae,we),Ae,We,k,X,Y,O={solarNoon:_(Ne),nadir:_(Ne+.5)};for(Ae=0,We=Ce.length;Ae=0&&(U=Math.sqrt(X)/(Math.abs(Ne)*2),O=We-U,A=We+U,Math.abs(O)<=1&&Y++,Math.abs(A)<=1&&Y++,O<-1&&(O=A)),Y===1?j<0?we=H+O:Ie=H+O:Y===2&&(we=H+(k<0?A:O),Ie=H+(k<0?O:A)),!(we&&Ie));H+=2)j=ae;var ue={};return we&&(ue.rise=me(q,we)),Ie&&(ue.set=me(q,Ie)),!we&&!Ie&&(ue[k>0?"alwaysUp":"alwaysDown"]=!0),ue},a.exports=he})()})(xC);var pR=xC.exports;const DC=Xo(pR),gR='{"time":{"start":"00:00","end":"24:00","mode":"hours","interval":1},"period":{"days":1}}';class Ii extends at{coordinates=null;constructor(s){super(s,Ii.getStaticData())}static compile(s,i){var c;let r="",l=i.justCheck?EC:IC;if(l=l.replace('"__%%DEBUG_TRIGGER%%__"',`_sendToFrontEnd(${s._id}, {trigger: true})`),s.tagCard==="interval")r=`setInterval(${l}, ${s.interval||1} * ${s.unit==="s"?1e3:s.unit==="m"?6e4:36e5});`;else if(s.tagCard==="cron")r=`schedule("${s.cron}", ${l});`;else if(s.tagCard==="at"){const[d,h]=(s.at||"").split(":");let p="*";if((c=s==null?void 0:s.dow)!=null&&c.length&&!s.dow.includes("_")){const f=[...s.dow].map(v=>parseInt(v,10));f.sort();const b=[];let y=f[0],w=1;for(;w1?(y===f[w-1]?b.push(y.toString()):f[w-1]-y===1?b.push(`${y},${f[w-1]}`):b.push(`${y}-${f[w-1]}`),y=f[w]):w===f.length-1&&(y===f[w-1]||f[w]-y===1?b.push(`${y},${f[w]}`):b.push(`${y}-${f[w]}`));p=b.join(",")}r=`schedule("${h||"0"} ${d||"0"} * * ${p}", ${l});`}else s.tagCard==="astro"?r=`schedule({astro: "${s.astro}", shift: ${s.offset?s.offsetValue:0}}, ${l});`:s.tagCard==="wizard"&&(r=`schedule('${s.wizard}', ${l});`);return r}static _time2String(s){return s?`${s.getHours().toString().padStart(2,"0")}:${s.getMinutes().toString().padStart(2,"0")}`:"--:--"}async _setAstro(s,i,r){var p,f;if(s||=this.state.settings.astro||"solarNoon",i??=this.state.settings.offset,r??=this.state.settings.offsetValue,r=parseInt(r,10)||0,!this.coordinates){const b=await this.props.socket.getObject("system.adapter.javascript.0"),y=(p=b==null?void 0:b.native)==null?void 0:p.latitude,w=(f=b==null?void 0:b.native)==null?void 0:f.longitude;if(!y&&!w){const v=await this.props.socket.getObject("system.config");v!=null&&v.common&&(v.common.latitude||v.common.longitude)?this.coordinates={latitude:parseFloat(v.common.latitude),longitude:parseFloat(v.common.longitude)}:this.coordinates=null}else this.coordinates={latitude:parseFloat(y),longitude:parseFloat(w)}}const l=this.coordinates&&DC.getTimes(new Date,this.coordinates.latitude,this.coordinates.longitude),c=l?Object.keys(l).map(b=>({value:b,title:b,title2:`[${Ii._time2String(l[b])}]`,order:l?Ii._time2String(l[b]):"??:??"})):[];c.sort((b,y)=>b.order>y.order?1:b.ordersuper.onTagChange())}_setInterval(s){s=parseInt(s||this.state.settings.interval,10)||30;let i;s===1?i=[{value:"s",title:"second"},{value:"m",title:"minute"},{value:"h",title:"hour"}]:i=[{value:"s",title:"seconds"},{value:"m",title:"minutes"},{value:"h",title:"hours"}],this.setState({inputs:[{nameRender:"renderNumber",attr:"interval",frontText:"every",defaultValue:30,className:"block-input-interval"},{nameRender:"renderSelect",attr:"unit",defaultValue:"s",options:i}]},()=>super.onTagChange())}renderDebug(s){return x.I18n.t("Triggered")}onValueChanged(s,i){this.state.settings.tagCard==="astro"?i==="astro"?this._setAstro(s):i==="offset"?this._setAstro(void 0,s):i==="offsetValue"&&this._setAstro(void 0,void 0,s):this.state.settings.tagCard==="interval"&&i==="interval"&&this._setInterval(s)}renderCron(s,i,r){const{className:l}=this.props;return m.jsxs("div",{children:[m.jsxs("div",{style:{display:"flex",alignItems:"baseline"},children:[m.jsx("div",{style:{width:"100%"},children:this.renderText({nameRender:"renderText",attr:"cron",defaultValue:i},this.state.settings.cron||i,r)}),m.jsx(Jr,{square:!0,style:{marginLeft:7},value:"...",className:l,onClick:()=>this.setState({openDialog:!0,textCron:this.state.settings.cron})})]}),this.state.openDialog?m.jsx(am,{disabled:this.state.settings.cron===this.state.textCron,onApply:()=>{const c=this.state.textCron;r(c,"cron",()=>{r(x.convertCronToText(c,x.I18n.getLanguage()),"addText"),this.setState({openDialog:!1})})},onClose:()=>this.setState({openDialog:!1,textCron:""}),children:m.jsx(x.ComplexCron,{cronExpression:this.state.settings.cron,onChange:c=>this.setState({textCron:c}),language:x.I18n.getLanguage()})}):null,this.renderNameText({nameRender:"renderNameText",defaultValue:x.I18n.t("every hour at 0 minutes"),attr:"addText",signature:!0,doNotTranslate:!0},this.state.settings.addText||x.I18n.t("every hour at 0 minutes"))]},"cron")}renderWizard(s,i,r){const{className:l}=this.props;return m.jsxs("div",{children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:7},children:[m.jsx(Ei,{className:l,autoComplete:"off",fullWidth:!0,variant:"outlined",size:"small",multiline:!0,rows:2,value:this.state.settings.wizardText,onChange:c=>r(c),customValue:!0}),m.jsx(Jr,{square:!0,style:{marginLeft:7},value:"...",className:l,onClick:()=>this.setState({openDialog:!0,wizard:this.state.settings.wizard,wizardText:x.Schedule.state2text(this.state.settings.wizard)})})]}),this.state.openDialog?m.jsx(am,{disabled:this.state.settings.wizard===this.state.wizard,onApply:()=>this.setState({openDialog:!1},()=>{const c=JSON.parse(this.state.wizard);c.valid||={from:x.Schedule.now2string()},c.valid.from||=x.Schedule.now2string(),r({wizardText:this.state.wizardText,wizard:JSON.stringify(c)})}),onClose:()=>this.setState({openDialog:!1}),children:m.jsx(x.Schedule,{theme:this.props.theme,schedule:i,onChange:(c,d)=>this.setState({wizardText:d||"",wizard:c})})}):null]},"wizard")}onTagChange(s){switch(s||=this.state.settings.tagCard,s){case"interval":this._setInterval();break;case"cron":this.setState({inputs:[{nameRender:"renderCron",attr:"cron",defaultValue:"0 * * * *"}]},()=>super.onTagChange());break;case"wizard":{const i=JSON.parse(gR);i.valid||={from:x.Schedule.now2string()},i.valid.from||=x.Schedule.now2string(),this.setState({inputs:[{nameRender:"renderWizard",attr:"wizard",defaultValue:JSON.stringify(i)}]},()=>super.onTagChange(null,()=>{const r=x.Schedule.state2text(this.state.settings.wizard||i);if(this.state.settings.wizard!==r){const l=JSON.parse(JSON.stringify(this.state.settings));l.wizardText=r,this.setState({settings:l}),this.props.onChange(l)}}));break}case"at":this.setState({inputs:[{nameRender:"renderTime",prefix:"at",attr:"at",defaultValue:"07:30"},{nameRender:"renderSelect",attr:"dow",default:"",multiple:!0,defaultValue:["_","1","2","3","4","5","6","0"],options:[{value:"_",title:"Every day",only:!0},{value:"1",title:"Monday",titleShort:"Mo"},{value:"2",title:"Tuesday",titleShort:"Tu"},{value:"3",title:"Wednesday",titleShort:"We"},{value:"4",title:"Thursday",titleShort:"Th"},{value:"5",title:"Friday",titleShort:"Fr"},{value:"6",title:"Saturday",titleShort:"Sa"},{value:"0",title:"Sunday",titleShort:"Su"}]}]},()=>super.onTagChange());break;case"astro":this._setAstro();break}}static getStaticData(){return{acceptedBy:"triggers",name:"Schedule",id:"TriggerScheduleBlock",icon:"AccessTime",tagCardArray:["cron","wizard","interval","at","astro"],title:"Triggers the rule periodically or on some specific time"}}getData(){return Ii.getStaticData()}}const In={valueAck:{color:"#b02323"},valueNotAck:{color:"#12ac15"}},AC=_e.forwardRef((a,s)=>m.jsx(XT,{direction:"up",ref:s,...a}));AC.displayName="Transition";class Bc extends at{inputRef;constructor(s){super(s,Bc.getStaticData()),this.inputRef=_e.createRef()}static compile(s,i){let r=i.justCheck?EC:IC;return r=r.replace('"__%%DEBUG_TRIGGER%%__"',`_sendToFrontEnd(${s._id}, {val: obj.state.val, ack: obj.state.ack, valOld: obj.oldState && obj.oldState.val, ackOld: obj.oldState && obj.oldState.ack})`),`on({id: "${s.oid||""}", change: "${s.tagCard==="on update"?"any":"ne"}"}, ${r});`}renderDebug(s){return s.data.valOld!==void 0?m.jsxs("span",{children:[x.I18n.t("Triggered")," ",m.jsx("span",{style:s.data.ackOld?In.valueAck:In.valueNotAck,children:Ln(s.data.valOld)})," ","→"," ",m.jsx("span",{style:s.data.ack?In.valueAck:In.valueNotAck,children:Ln(s.data.val)})]}):m.jsxs("span",{children:[x.I18n.t("Triggered")," ",m.jsx("span",{style:s.data.ack?In.valueAck:In.valueNotAck,children:Ln(s.data.val)})]})}onWriteValue(){this.setState({openSimulate:!1});let s=this.state.simulateValue;window.localStorage.setItem(`javascript.app.${this.state.settings.oid}_ack`,this.state.simulateAck?"true":"false"),this.state.settings.oidType==="boolean"?(s=s===!0||s==="true"||s==="1",window.localStorage.setItem(`javascript.app.${this.state.settings.oid}`,s?"true":"false")):this.state.settings.oidType==="number"?(s=parseFloat(s)||0,window.localStorage.setItem(`javascript.app.${this.state.settings.oid}`,s.toString())):window.localStorage.setItem(`javascript.app.${this.state.settings.oid}`,(s==null?void 0:s.toString())||""),this.props.socket.setState(this.state.settings.oid,{val:s,ack:!!this.state.simulateAck})}renderWriteState(){return[m.jsx(He,{disabled:!this.state.settings.oid||!this.state.enableSimulation,variant:"contained",color:"primary",onClick:()=>{this.setState({openSimulate:!0,simulateValue:this.state.settings.oidType==="boolean"?window.localStorage.getItem(`javascript.app.${this.state.settings.oid}`)==="true":window.localStorage.getItem(`javascript.app.${this.state.settings.oid}`)||"",simulateAck:window.localStorage.getItem(`javascript.app.${this.state.settings.oid}_ack`)==="true"}),setTimeout(()=>{var s;return(s=this.inputRef.current)==null?void 0:s.focus()},200)},children:x.I18n.t("Simulate")},"buttonWrite"),m.jsxs(Ut,{open:!!this.state.openSimulate,TransitionComponent:AC,keepMounted:!0,onClose:()=>this.setState({openSimulate:!1}),"aria-labelledby":"simulate-dialog-slide-title","aria-describedby":"simulate-dialog-slide-description",children:[m.jsx(ss,{id:"simulate-dialog-slide-title",children:x.I18n.t("Trigger with value")}),m.jsxs(qt,{children:[this.state.settings.oidType==="boolean"?m.jsx(Rg,{control:m.jsx(Nw,{inputRef:this.inputRef,onKeyUp:s=>s.key==="Enter"&&this.onWriteValue(),value:!!this.state.simulateValue,onChange:s=>this.setState({simulateValue:s.target.checked})}),label:x.I18n.t("Value")}):m.jsx(Eo,{variant:"standard",inputRef:this.inputRef,label:x.I18n.t("Value"),fullWidth:!0,onKeyUp:s=>s.key==="Enter"&&this.onWriteValue(),value:!this.state.simulateValue&&this.state.simulateValue!==0?"":this.state.simulateValue,onChange:s=>this.setState({simulateValue:s.target.value})}),m.jsx("br",{}),m.jsx(Rg,{control:m.jsx(wc,{checked:!!this.state.simulateAck,onChange:s=>this.setState({simulateAck:s.target.checked}),color:"primary"}),label:x.I18n.t("Ack")})]}),m.jsxs(Ht,{children:[m.jsxs(He,{variant:"contained",onClick:()=>this.onWriteValue(),color:"primary",children:[m.jsx(TS,{}),x.I18n.t("Write")]}),m.jsxs(He,{color:"grey",variant:"contained",onClick:()=>this.setState({openSimulate:!1}),children:[m.jsx(Yc,{}),x.I18n.t("Close")]})]})]},"dialogWrite")]}onTagChange(s){this.setState({inputs:[{nameRender:"renderObjectID",attr:"oid",defaultValue:""},{nameRender:"renderWriteState"}]},()=>{super.onTagChange()})}static getStaticData(){return{acceptedBy:"triggers",name:"State",id:"TriggerState",icon:"FlashOn",tagCardArray:["on change","on update"],title:"Triggers the rule on update or change of some state"}}getData(){return Bc.getStaticData()}}const mR=""+new URL("hysteresis-CLhhemcG.png",import.meta.url).href,vw=`function __hysteresis(val, limit, state, hist, comp) { +//${JSON.stringify(a)}`}class Pc extends at{constructor(s){super(s,Pc.getStaticData())}static compile(s,i){return cR.replace('"__%%DEBUG_TRIGGER%%__"',`_sendToFrontEnd(${s._id}, {trigger: true})`)}renderDebug(){return x.I18n.t("Triggered")}onTagChange(s){this.setState({inputs:[{nameRender:"renderNameText",defaultValue:"On script save or adapter start",attr:"script"}]},()=>super.onTagChange())}static getStaticData(){return{acceptedBy:"triggers",name:"Start script",id:"TriggerScriptSave",icon:"PlayArrow",title:"Triggers the on script saving or the javascript instance restart"}}getData(){return Pc.getStaticData()}}var xC={exports:{}};(function(a,s){(function(){var i=Math.PI,r=Math.sin,l=Math.cos,c=Math.tan,d=Math.asin,h=Math.atan2,p=Math.acos,f=i/180,b=1e3*60*60*24,y=2440588,w=2451545;function v(re){return re.valueOf()/b-.5+y}function _(re){return new Date((re+.5-y)*b)}function $(re){return v(re)-w}var S=f*23.4397;function T(re,B){return h(r(re)*l(S)-c(B)*r(S),l(re))}function E(re,B){return d(r(B)*l(S)+l(B)*r(S)*r(re))}function D(re,B,N){return h(r(re),l(re)*r(B)-c(N)*l(B))}function M(re,B,N){return d(r(B)*r(N)+l(B)*l(N)*l(re))}function P(re,B){return f*(280.16+360.9856235*re)-B}function W(re){return re<0&&(re=0),2967e-7/Math.tan(re+.00312536/(re+.08901179))}function G(re){return f*(357.5291+.98560028*re)}function z(re){var B=f*(1.9148*r(re)+.02*r(2*re)+3e-4*r(3*re)),N=f*102.9372;return re+B+N+i}function Z(re){var B=G(re),N=z(B);return{dec:E(N,0),ra:T(N,0)}}var he={};he.getPosition=function(re,B,N){var te=f*-N,q=f*B,se=$(re),j=Z(se),Te=P(se,te)-j.ra;return{azimuth:D(Te,q,j.dec),altitude:M(Te,q,j.dec)}};var Ce=he.times=[[-.833,"sunrise","sunset"],[-.3,"sunriseEnd","sunsetStart"],[-6,"dawn","dusk"],[-12,"nauticalDawn","nauticalDusk"],[-18,"nightEnd","night"],[6,"goldenHourEnd","goldenHour"]];he.addTime=function(re,B,N){Ce.push([re,B,N])};var R=9e-4;function K(re,B){return Math.round(re-R-B/(2*i))}function C(re,B,N){return R+(re+B)/(2*i)+N}function Q(re,B,N){return w+re+.0053*r(B)-.0069*r(2*N)}function ve(re,B,N){return p((r(re)-r(B)*r(N))/(l(B)*l(N)))}function ce(re,B,N,te,q,se,j){var Te=ve(re,N,te),ae=C(Te,B,q);return Q(ae,se,j)}he.getTimes=function(re,B,N){var te=f*-N,q=f*B,se=$(re),j=K(se,te),Te=C(0,te,j),ae=G(Te),we=z(ae),Ie=E(we,0),Ne=Q(Te,ae,we),Ae,We,k,X,Y,O={solarNoon:_(Ne),nadir:_(Ne+.5)};for(Ae=0,We=Ce.length;Ae=0&&(U=Math.sqrt(X)/(Math.abs(Ne)*2),O=We-U,A=We+U,Math.abs(O)<=1&&Y++,Math.abs(A)<=1&&Y++,O<-1&&(O=A)),Y===1?j<0?we=H+O:Ie=H+O:Y===2&&(we=H+(k<0?A:O),Ie=H+(k<0?O:A)),!(we&&Ie));H+=2)j=ae;var ue={};return we&&(ue.rise=me(q,we)),Ie&&(ue.set=me(q,Ie)),!we&&!Ie&&(ue[k>0?"alwaysUp":"alwaysDown"]=!0),ue},a.exports=he})()})(xC);var pR=xC.exports;const DC=Xo(pR),gR='{"time":{"start":"00:00","end":"24:00","mode":"hours","interval":1},"period":{"days":1}}';class Ii extends at{coordinates=null;constructor(s){super(s,Ii.getStaticData())}static compile(s,i){var c;let r="",l=i.justCheck?EC:IC;if(l=l.replace('"__%%DEBUG_TRIGGER%%__"',`_sendToFrontEnd(${s._id}, {trigger: true})`),s.tagCard==="interval")r=`setInterval(${l}, ${s.interval||1} * ${s.unit==="s"?1e3:s.unit==="m"?6e4:36e5});`;else if(s.tagCard==="cron")r=`schedule("${s.cron}", ${l});`;else if(s.tagCard==="at"){const[d,h]=(s.at||"").split(":");let p="*";if((c=s==null?void 0:s.dow)!=null&&c.length&&!s.dow.includes("_")){const f=[...s.dow].map(v=>parseInt(v,10));f.sort();const b=[];let y=f[0],w=1;for(;w1?(y===f[w-1]?b.push(y.toString()):f[w-1]-y===1?b.push(`${y},${f[w-1]}`):b.push(`${y}-${f[w-1]}`),y=f[w]):w===f.length-1&&(y===f[w-1]||f[w]-y===1?b.push(`${y},${f[w]}`):b.push(`${y}-${f[w]}`));p=b.join(",")}r=`schedule("${h||"0"} ${d||"0"} * * ${p}", ${l});`}else s.tagCard==="astro"?r=`schedule({astro: "${s.astro}", shift: ${s.offset?s.offsetValue:0}}, ${l});`:s.tagCard==="wizard"&&(r=`schedule('${s.wizard}', ${l});`);return r}static _time2String(s){return s?`${s.getHours().toString().padStart(2,"0")}:${s.getMinutes().toString().padStart(2,"0")}`:"--:--"}async _setAstro(s,i,r){var p,f;if(s||=this.state.settings.astro||"solarNoon",i??=this.state.settings.offset,r??=this.state.settings.offsetValue,r=parseInt(r,10)||0,!this.coordinates){const b=await this.props.socket.getObject("system.adapter.javascript.0"),y=(p=b==null?void 0:b.native)==null?void 0:p.latitude,w=(f=b==null?void 0:b.native)==null?void 0:f.longitude;if(!y&&!w){const v=await this.props.socket.getObject("system.config");v!=null&&v.common&&(v.common.latitude||v.common.longitude)?this.coordinates={latitude:parseFloat(v.common.latitude),longitude:parseFloat(v.common.longitude)}:this.coordinates=null}else this.coordinates={latitude:parseFloat(y),longitude:parseFloat(w)}}const l=this.coordinates&&DC.getTimes(new Date,this.coordinates.latitude,this.coordinates.longitude),c=l?Object.keys(l).map(b=>({value:b,title:b,title2:`[${Ii._time2String(l[b])}]`,order:l?Ii._time2String(l[b]):"??:??"})):[];c.sort((b,y)=>b.order>y.order?1:b.ordersuper.onTagChange())}_setInterval(s){s=parseInt(s||this.state.settings.interval,10)||30;let i;s===1?i=[{value:"s",title:"second"},{value:"m",title:"minute"},{value:"h",title:"hour"}]:i=[{value:"s",title:"seconds"},{value:"m",title:"minutes"},{value:"h",title:"hours"}],this.setState({inputs:[{nameRender:"renderNumber",attr:"interval",frontText:"every",defaultValue:30,className:"block-input-interval"},{nameRender:"renderSelect",attr:"unit",defaultValue:"s",options:i}]},()=>super.onTagChange())}renderDebug(s){return x.I18n.t("Triggered")}onValueChanged(s,i){this.state.settings.tagCard==="astro"?i==="astro"?this._setAstro(s):i==="offset"?this._setAstro(void 0,s):i==="offsetValue"&&this._setAstro(void 0,void 0,s):this.state.settings.tagCard==="interval"&&i==="interval"&&this._setInterval(s)}renderCron(s,i,r){const{className:l}=this.props;return m.jsxs("div",{children:[m.jsxs("div",{style:{display:"flex",alignItems:"baseline"},children:[m.jsx("div",{style:{width:"100%"},children:this.renderText({nameRender:"renderText",attr:"cron",defaultValue:i},this.state.settings.cron||i,r)}),m.jsx(Jr,{square:!0,style:{marginLeft:7},value:"...",className:l,onClick:()=>this.setState({openDialog:!0,textCron:this.state.settings.cron})})]}),this.state.openDialog?m.jsx(cm,{disabled:this.state.settings.cron===this.state.textCron,onApply:()=>{const c=this.state.textCron;r(c,"cron",()=>{r(x.convertCronToText(c,x.I18n.getLanguage()),"addText"),this.setState({openDialog:!1})})},onClose:()=>this.setState({openDialog:!1,textCron:""}),children:m.jsx(x.ComplexCron,{cronExpression:this.state.settings.cron,onChange:c=>this.setState({textCron:c}),language:x.I18n.getLanguage()})}):null,this.renderNameText({nameRender:"renderNameText",defaultValue:x.I18n.t("every hour at 0 minutes"),attr:"addText",signature:!0,doNotTranslate:!0},this.state.settings.addText||x.I18n.t("every hour at 0 minutes"))]},"cron")}renderWizard(s,i,r){const{className:l}=this.props;return m.jsxs("div",{children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:7},children:[m.jsx(Ei,{className:l,autoComplete:"off",fullWidth:!0,variant:"outlined",size:"small",multiline:!0,rows:2,value:this.state.settings.wizardText,onChange:c=>r(c),customValue:!0}),m.jsx(Jr,{square:!0,style:{marginLeft:7},value:"...",className:l,onClick:()=>this.setState({openDialog:!0,wizard:this.state.settings.wizard,wizardText:x.Schedule.state2text(this.state.settings.wizard)})})]}),this.state.openDialog?m.jsx(cm,{disabled:this.state.settings.wizard===this.state.wizard,onApply:()=>this.setState({openDialog:!1},()=>{const c=JSON.parse(this.state.wizard);c.valid||={from:x.Schedule.now2string()},c.valid.from||=x.Schedule.now2string(),r({wizardText:this.state.wizardText,wizard:JSON.stringify(c)})}),onClose:()=>this.setState({openDialog:!1}),children:m.jsx(x.Schedule,{theme:this.props.theme,schedule:i,onChange:(c,d)=>this.setState({wizardText:d||"",wizard:c})})}):null]},"wizard")}onTagChange(s){switch(s||=this.state.settings.tagCard,s){case"interval":this._setInterval();break;case"cron":this.setState({inputs:[{nameRender:"renderCron",attr:"cron",defaultValue:"0 * * * *"}]},()=>super.onTagChange());break;case"wizard":{const i=JSON.parse(gR);i.valid||={from:x.Schedule.now2string()},i.valid.from||=x.Schedule.now2string(),this.setState({inputs:[{nameRender:"renderWizard",attr:"wizard",defaultValue:JSON.stringify(i)}]},()=>super.onTagChange(null,()=>{const r=x.Schedule.state2text(this.state.settings.wizard||i);if(this.state.settings.wizard!==r){const l=JSON.parse(JSON.stringify(this.state.settings));l.wizardText=r,this.setState({settings:l}),this.props.onChange(l)}}));break}case"at":this.setState({inputs:[{nameRender:"renderTime",prefix:"at",attr:"at",defaultValue:"07:30"},{nameRender:"renderSelect",attr:"dow",default:"",multiple:!0,defaultValue:["_","1","2","3","4","5","6","0"],options:[{value:"_",title:"Every day",only:!0},{value:"1",title:"Monday",titleShort:"Mo"},{value:"2",title:"Tuesday",titleShort:"Tu"},{value:"3",title:"Wednesday",titleShort:"We"},{value:"4",title:"Thursday",titleShort:"Th"},{value:"5",title:"Friday",titleShort:"Fr"},{value:"6",title:"Saturday",titleShort:"Sa"},{value:"0",title:"Sunday",titleShort:"Su"}]}]},()=>super.onTagChange());break;case"astro":this._setAstro();break}}static getStaticData(){return{acceptedBy:"triggers",name:"Schedule",id:"TriggerScheduleBlock",icon:"AccessTime",tagCardArray:["cron","wizard","interval","at","astro"],title:"Triggers the rule periodically or on some specific time"}}getData(){return Ii.getStaticData()}}const In={valueAck:{color:"#b02323"},valueNotAck:{color:"#12ac15"}},AC=_e.forwardRef((a,s)=>m.jsx(XT,{direction:"up",ref:s,...a}));AC.displayName="Transition";class Bc extends at{inputRef;constructor(s){super(s,Bc.getStaticData()),this.inputRef=_e.createRef()}static compile(s,i){let r=i.justCheck?EC:IC;return r=r.replace('"__%%DEBUG_TRIGGER%%__"',`_sendToFrontEnd(${s._id}, {val: obj.state.val, ack: obj.state.ack, valOld: obj.oldState && obj.oldState.val, ackOld: obj.oldState && obj.oldState.ack})`),`on({id: "${s.oid||""}", change: "${s.tagCard==="on update"?"any":"ne"}"}, ${r});`}renderDebug(s){return s.data.valOld!==void 0?m.jsxs("span",{children:[x.I18n.t("Triggered")," ",m.jsx("span",{style:s.data.ackOld?In.valueAck:In.valueNotAck,children:Ln(s.data.valOld)})," ","→"," ",m.jsx("span",{style:s.data.ack?In.valueAck:In.valueNotAck,children:Ln(s.data.val)})]}):m.jsxs("span",{children:[x.I18n.t("Triggered")," ",m.jsx("span",{style:s.data.ack?In.valueAck:In.valueNotAck,children:Ln(s.data.val)})]})}onWriteValue(){this.setState({openSimulate:!1});let s=this.state.simulateValue;window.localStorage.setItem(`javascript.app.${this.state.settings.oid}_ack`,this.state.simulateAck?"true":"false"),this.state.settings.oidType==="boolean"?(s=s===!0||s==="true"||s==="1",window.localStorage.setItem(`javascript.app.${this.state.settings.oid}`,s?"true":"false")):this.state.settings.oidType==="number"?(s=parseFloat(s)||0,window.localStorage.setItem(`javascript.app.${this.state.settings.oid}`,s.toString())):window.localStorage.setItem(`javascript.app.${this.state.settings.oid}`,(s==null?void 0:s.toString())||""),this.props.socket.setState(this.state.settings.oid,{val:s,ack:!!this.state.simulateAck})}renderWriteState(){return[m.jsx(He,{disabled:!this.state.settings.oid||!this.state.enableSimulation,variant:"contained",color:"primary",onClick:()=>{this.setState({openSimulate:!0,simulateValue:this.state.settings.oidType==="boolean"?window.localStorage.getItem(`javascript.app.${this.state.settings.oid}`)==="true":window.localStorage.getItem(`javascript.app.${this.state.settings.oid}`)||"",simulateAck:window.localStorage.getItem(`javascript.app.${this.state.settings.oid}_ack`)==="true"}),setTimeout(()=>{var s;return(s=this.inputRef.current)==null?void 0:s.focus()},200)},children:x.I18n.t("Simulate")},"buttonWrite"),m.jsxs(Ut,{open:!!this.state.openSimulate,TransitionComponent:AC,keepMounted:!0,onClose:()=>this.setState({openSimulate:!1}),"aria-labelledby":"simulate-dialog-slide-title","aria-describedby":"simulate-dialog-slide-description",children:[m.jsx(ss,{id:"simulate-dialog-slide-title",children:x.I18n.t("Trigger with value")}),m.jsxs(qt,{children:[this.state.settings.oidType==="boolean"?m.jsx(Mg,{control:m.jsx(Nw,{inputRef:this.inputRef,onKeyUp:s=>s.key==="Enter"&&this.onWriteValue(),value:!!this.state.simulateValue,onChange:s=>this.setState({simulateValue:s.target.checked})}),label:x.I18n.t("Value")}):m.jsx(Eo,{variant:"standard",inputRef:this.inputRef,label:x.I18n.t("Value"),fullWidth:!0,onKeyUp:s=>s.key==="Enter"&&this.onWriteValue(),value:!this.state.simulateValue&&this.state.simulateValue!==0?"":this.state.simulateValue,onChange:s=>this.setState({simulateValue:s.target.value})}),m.jsx("br",{}),m.jsx(Mg,{control:m.jsx(wc,{checked:!!this.state.simulateAck,onChange:s=>this.setState({simulateAck:s.target.checked}),color:"primary"}),label:x.I18n.t("Ack")})]}),m.jsxs(Ht,{children:[m.jsxs(He,{variant:"contained",onClick:()=>this.onWriteValue(),color:"primary",children:[m.jsx(TS,{}),x.I18n.t("Write")]}),m.jsxs(He,{color:"grey",variant:"contained",onClick:()=>this.setState({openSimulate:!1}),children:[m.jsx(Yc,{}),x.I18n.t("Close")]})]})]},"dialogWrite")]}onTagChange(s){this.setState({inputs:[{nameRender:"renderObjectID",attr:"oid",defaultValue:""},{nameRender:"renderWriteState"}]},()=>{super.onTagChange()})}static getStaticData(){return{acceptedBy:"triggers",name:"State",id:"TriggerState",icon:"FlashOn",tagCardArray:["on change","on update"],title:"Triggers the rule on update or change of some state"}}getData(){return Bc.getStaticData()}}const mR=""+new URL("hysteresis-CLhhemcG.png",import.meta.url).href,vw=`function __hysteresis(val, limit, state, hist, comp) { let cond1, cond2; if (comp === '>') { cond1 = val > limit + hist; @@ -1226,9 +1226,9 @@ const demo = ${JSON.stringify(a,null,2).replace(/\*\//g,"* /")}; ${i} ${r} _sendToFrontEnd(${s._id}, {val: val1_${s._id} ${s.operation} val2_${s._id}, ack: ${s.tagCard==="update"}}); - await setStateAsync("${s.oidResult}", val1_${s._id} ${s.operation} val2_${s._id}, ${s.tagCard==="update"});`}renderDebug(s){var i,r;return m.jsxs("span",{children:[x.I18n.t("Set:")," ",m.jsx("span",{className:s.data.ack?(i=this.props.classes)==null?void 0:i.valueAck:(r=this.props.classes)==null?void 0:r.valueNotAck,children:Ln(s.data.val)})]})}onTagChange(){const s=[];s.push({nameRender:"renderObjectID",title:"ID1",attr:"oid1",defaultValue:"",checkReadOnly:!1}),s.push({nameRender:"renderSelect",options:[{value:"+",title:"+"},{value:"-",title:"-"},{value:"*",title:"*"},{value:"/",title:"/"}],doNotTranslate:!0,defaultValue:"+",attr:"operation"}),s.push({nameRender:"renderObjectID",title:"ID2",attr:"oid2",defaultValue:"",checkReadOnly:!1}),s.push({nameRender:"renderNameText",defaultValue:"store in",attr:"textEqual"}),s.push({nameRender:"renderObjectID",attr:"oidResult",defaultValue:"",checkReadOnly:!0}),this.setState({inputs:s},()=>super.onTagChange(null,()=>{const i=JSON.parse(JSON.stringify(this.state.settings));this.props.onChange(i)}))}onValueChanged(s,i){this.onTagChange()}onUpdate(){this.onTagChange()}static getStaticData(){return{acceptedBy:"actions",name:"Operate two states",id:"ActionOperateStates",icon:"AddBox",tagCardArray:["control","update"],title:"Operations with two states"}}getData(){return Vc.getStaticData()}}const fR=[Ii,Pc,Bc,qr,Xr,Vo,Fc,jc,zc,Uc,Hc,Wc,Gc,Vc],hc={sayit:Rc,pushover:Nc,"whatsapp-cmb":Mc,pushsafer:Lc},$R=lm({blocks:null,socket:null,onUpdate:!1,setOnUpdate:a=>{},setOnDebugMessage:a=>{},onDebugMessage:[],enableSimulation:!1,setEnableSimulation:a=>{},changedScripts:{},setChangedScripts:a=>{}}),bR=({children:a,socket:s})=>{const[i,r]=kt(null),[l,c]=kt(!1),[d,h]=kt([]),[p,f]=kt(!1),[b,y]=kt({});return Lt(()=>{l&&c(!1)},[l]),Lt(()=>{(async()=>{const w=await s.getAdapterInstances(),v=Object.keys(hc).filter(E=>w.find(D=>{var M;return((M=D==null?void 0:D.common)==null?void 0:M.name)===E})),_=[],$=w.filter(E=>E.common.javascriptRules),S=[];for(const E of $){if(S.includes(E.common.name)||!E.common.javascriptRules)continue;let D;if(E.common.javascriptRules.url.startsWith("http:")||E.common.javascriptRules.url.startsWith("https:")?D=E.common.javascriptRules.url:E.common.javascriptRules.url.startsWith("./")?D=`${window.location.protocol}//${window.location.host}${E.common.javascriptRules.url.replace(/^\./,"")}`:D=`${window.location.protocol}//${window.location.host}/adapter/${E.common.name}/${E.common.javascriptRules.url}`,E.common.javascriptRules.i18n===!0){const M=D.lastIndexOf("/");let P;M!==-1?P=D.substring(0,M):P=D;const W=x.I18n.getLanguage(),G=`${P}/i18n/${W}.json`;await fetch(G).then(z=>z.json()).then(z=>x.I18n.extendTranslations(z,W)).catch(z=>{if(W!=="en")return fetch(`${P}/i18n/en.json`).then(Z=>Z.json()).then(Z=>x.I18n.extendTranslations(Z,W)).catch(Z=>console.error(`Cannot load i18n "${G}": ${Z}`));console.log(`Cannot load i18n "${G}": ${z}`)})}else if(E.common.javascriptRules.i18n&&typeof E.common.javascriptRules.i18n=="object")try{x.I18n.extendTranslations(E.common.javascriptRules.i18n)}catch(M){console.error(`Cannot import i18n for "${E.common.javascriptRules.name}": ${M}`)}try{Zy.registerRemotes([{name:E.common.javascriptRules.name,entry:D,type:E.common.javascriptRules.type}]);const M=(await Zy.loadRemote(`${E.common.javascriptRules.name}/${E.common.javascriptRules.name}`)).default;M&&(_.push(M),S.push(E.common.name),hc[E.common.name]=null)}catch(M){console.error(`Cannot load component "${E.common.javascriptRules.name}": ${M}`)}}const T=v.filter(E=>hc[E]).map(E=>hc[E]);r([...fR,...T,..._])})()},[]),m.jsx($R.Provider,{value:{blocks:i,socket:s,onUpdate:l,setOnUpdate:c,onDebugMessage:d,setOnDebugMessage:h,enableSimulation:p,setEnableSimulation:f,changedScripts:b,setChangedScripts:y},children:a})},vR="Acknowledged",yR="Actions",_R="Add",wR="All",kR="Any",CR="Apply",TR="April",SR="Ask",ER="Astronomical",IR="August",xR="Cancel",DR="Close",AR="Condition",OR="Conditions",RR="Console",NR="Copied",MR="December",LR="Default",PR="Delay",BR="Delete",FR="Description",jR="Done",zR="Exec shell",UR="Explanation",HR="Export",WR="Februar",GR="February",VR="Filter",KR="Folder",YR="Fr",JR="Friday",qR="ID",XR="ID1",ZR="ID2",QR="Import",e1="Instance",t1="Instances",s1="Instructions",o1="Januar",i1="January",n1="July",r1="June",a1="Limit",l1="March",c1="May",u1="Menu",d1="Message",h1="Mo",p1="Model",g1="Monday",m1="Month",f1="More",$1="Name",b1="November",v1="OK",y1="October",_1="Ok",w1="Pause",k1="Pushover",C1="Pushsafer",T1="Rename",S1="Repeat",E1="Restart",I1="Result",x1="Sa",D1="Saturday",A1="Save",O1="Schedule",R1="Script",N1="September",M1="Simulate",L1="Stack",P1="Start",B1="State",F1="Su",j1="Sunday",z1="Telegram",U1="Th",H1="Thursday",W1="Time",G1="Triggered",V1="Triggers",K1="Tu",Y1="Tuesday",J1="URL",q1="Value",X1="Volume",Z1="We",Q1="Wednesday",eN="Write",tN="Yes",sN="acknowledgment",oN="all",iN="and",nN="Astro",rN="at",aN="control",lN="copy",cN="CRON",uN="Dawn",dN="This is a special mode in which states and objects will not change. But only information about each planned change will be displayed in the protocol.",hN="Debug",pN="Dusk",gN="easy",mN="every",fN="Function",$N="ID",bN="Name",vN="Role",yN="Room",_N="Golden hour",wN="End of golden hour",kN='The code will be executed only every time when condition is true. E.g. if triggering on the temperature sensor value and the condition is "if temperature is greater than 20°C", the "then" actions will be executed every time when sensor sends the temperature and it is over 20°C. By 21°C, by 22°C and so on.',CN='The code will be executed only if the condition result changes. E.g. if triggering on the temperature sensor value and the condition is "if temperature is greater than 20°C", the "then" actions will be executed once when temperature is over 20. Next time the "then" actions will be executed when the temperature fails under 20 and then rises over 20 again.',TN="hours",SN="includes",EN="interval",IN="magic",xN="milliseconds",DN="minutes",AN="ms",ON="Nadir",RN="Nautical dawn",NN="Nautical dusk",MN="Next Sunrise",LN="Next sunset",PN="Night",BN="Night end",FN="normal",jN="offset",zN="one",UN="or",HN="quiet",WN="search",GN="seconds",VN="Solar noon",KN="sunrise",YN="Sunrise end",JN="Sunset",qN="Sunset start",XN="then",ZN="Acknowledge",QN="From",eM="Last changed",tM="Quality",sM="Timestamp",oM="User",iM="Value",nM="two",rM="update",aM="Adds debug output to the log for many system commands",lM="Verbose log outputs",cM="when",uM="Wizard",dM="Retry",hM={"%s not found":"%s not found","()":"()","(at %s)":"(at %s)","(optional)":"(optional)","-":"-",".":".","AI code generator":"AI code generator",Ack:vR,Actions:yR,"Actual time of day":"Actual time of day",Add:_R,"Add new script":"Add new script",All:wR,"All files will be accepted":"All files will be accepted",Any:kR,"Any month":"Any month",Apply:CR,April:TR,"Are you sure?":"Are you sure?",Ask:SR,Astronomical:ER,"Astronomical events today":"Astronomical events today",August:IR,"Blockly description":"Creating rules by graphic blocks","Body:":"Body:",Cancel:xR,"Cannot delete non empty item!":"Cannot delete non empty item!","Change layout":"Change layout",'Change theme (actual "%s")':'Change theme (now - "%s")',"Check blocks":"Check blocks","Check is not active, because javascript adapter is disabled":"Check is not active, because Javascript adapter is disabled","Clear search input":"Clear search input","Click on this icon":"Click on this icon",Close:DR,"Close all but current":"Close all but current","Collapse all":"Collapse all","Compares current time with astronomical event":"Compares current time with astronomical event","Compares current time with the user specific time":"Compares current time with the user specific time","Compares the state value with user defined value":"Compares the state value with user defined value",Condition:AR,Conditions:OR,"Configuration not saved.":"Configuration not saved.",Console:RR,"Control or update some state":"Control or update some state","Control or update some state with delay":"Control or update some state with delay","Convert blockly to javascript for ever.":"Permanently convert Blockly to Javascript.",Copied:NR,"Copy script":"Copy script","Copy to clipboard":"Copy to clipboard","Create new":"Create new","Create new folder":"Create new folder","Create new script":"Create new script","Create or edit CRON or time wizard":"Create or edit CRON or time wizard","Dark Theme":"Dark theme","Dark style":"Dark style",Date:"Date","Debug instance":"Debug instance","Debug options":"Debug options",December:MR,Default:LR,"Define cron...":"Define cron...","Define schedule...":"Define schedule...",Delay:PR,Delete:BR,"Delete %s":"Delete %s...","Delete folder":"Delete folder","Delete script":"Delete script",Description:FR,"Deselect all":"Deselect all","Discard changes for %s":"Discard changes for %s",Done:jR,"Double click to write value":"Double click to write value","Download as file":"Download as file","Drop some files here or click...":"Drop some files here or click...","Duplicate name":"Duplicate name","Edit script or just double click":"Edit script or just double click","Empty name is not allowed":"Empty name is not allowed","End search mode":"End search mode","Enter your question":"Enter your request",Error:"Error","Error formatting code":"Error formatting code","Error was found":"Error was found","Every day":"Every day",Exec:zR,"Executes some shell command":"Executes some shell command","Existing scripts will be overwritten.":"Existing scripts will be overwritten.","Expand all":"Expand all","Expert mode":"Expert mode",Explanation:UR,Export:HR,"Export all scripts":"Export all scripts","Export blocks":"Export blocks","Export selected blocks":"Export selected blocks",Februar:WR,February:GR,Filter:VR,Folder:KR,Fr:YR,Friday:JR,Function:"Function","Function editor":"Function editor","Function: executed":"Function: executed","Go to next line":"Go to next line","HTTP Call":"HTTP Call","Hide logs":"Hide logs",ID:qR,ID1:XR,ID2:ZR,Import:QR,"Import blocks":"Import blocks","Import error":"Import error","Import scripts":"Import scripts","Insert object ID":"Insert object ID",Instance:e1,"Instance is disabled":"Instance is disabled","Instance:":"Instance:",Instances:t1,Instructions:s1,"Invalid CRON":"Invalid CRON","It will not be possible to revert this operation.":"It will not be possible to revert this operation.","JS description":"Creating rules by writing Javascript",Januar:o1,January:i1,July:n1,June:r1,"Just check":"Just check","Language:":"Language:","Learn More":"Learn More","Light style":"Light style",Limit:a1,"Local time":"Local time","Locate file":"Locate file","Log outputs":"Log outputs","Log text":"Log text","Log: %s":"Log: %s","Make a HTTP get request":"Make a HTTP get request","Make a pause between actions":"Make a pause between actions",March:l1,"March ":"March ",May:c1,Menu:u1,Message:d1,Mo:h1,Model:p1,Monday:g1,Month:m1,More:f1,Name:$1,"No API key found":"No API key found","No Chat GPT Key found":"No Chat GPT Key found","No active host found":"No active host found","Nothing found":"Nothing found",November:b1,OK:v1,October:y1,Ok:_1,"On condition change":"On condition result change","On script save or adapter start":"On script save or adapter start","On weekdays":"On weekdays","Open configuration":"Open configuration","Operate two states":"Operate two states","Operations with two states":"Operations with two states","Paste your blocks here":"Paste your blocks here",Pause:w1,"Pause execution":"Pause execution","Pause script":"Pause script","Phone:":"Phone:","Please select object ID...":"Please select object ID...","Press Ctrl+Enter to get the answer":"Press Ctrl+Enter to get the answer","Prettify the script":"Prettify the script","Print some text in log":"Print some text in log","Priority:":"Priority:",Pushover:k1,Pushsafer:C1,"Read only ID selected: %s":"Read only ID selected: %s",Rename:T1,"Reorder scripts in folders":"Reorder scripts in folders",Repeat:S1,Restart:E1,Result:I1,"Resume execution":"Resume execution","Root folder":"Root folder","Rules description":"Create rules with IF, THEN, ELSE blocks","Run script":"Run script",Sa:x1,Saturday:D1,Save:A1,"Save all":"Save all","Say It":"Say It","Say some text via sayit adapter":"Say some text via sayit adapter",Schedule:O1,Script:R1,"Script %s was modified on disk":"Script %s was modified on disk","Script is not running":"Script is not running","Search in scripts":"Search in scripts","Search...":"Search...","Select all":"Select all","Send email":"Send email","Sends an email":"Sends an email","Sends message via Pushsafer":"Sends message via Pushsafer","Sends message via pushover":"Sends message via pushover","Sends message via telegram":"Sends message via telegram","Sends message via whatsapp-cmb":"Sends message via whatsapp-cmb",September:N1,"Server time":"Server time","Set state action":"Set state action","Set with delay":"Set with delay","Shell command":"Shell command","Show astronomical events":"Show astronomical events","Show javascript code":"Show Javascript code","Show logs":"Show logs","Show only paused scripts":"Show only paused scripts","Show only running scripts":"Show only running scripts","Show only scripts with problems":"Show only scripts with problems",Simulate:M1,"Some files will be rejected":"Some files will be rejected","Sound:":"Sound:",Stack:L1,Start:P1,"Start script":"Start script",State:B1,"State condition":"State condition","Step into function":"Step into function","Step out from function":"Step out from function","Stop on exception":"Stop on exception",Su:F1,"Subject:":"Subject:",Sunday:j1,"TS description":"Creating rules by writing Typescript",Telegram:z1,"Text:":"Text:",Th:U1,"The script will be stopped and must be activated manually after debugging. Continue?":"The script will be stopped and must be activated manually after debugging. Continue?","This is advances option. You can write your own code here and it will be executed on trigger":"This is advances option. You can write your own code here and it will be executed on trigger",Thursday:H1,Time:W1,"Time condition":"Time condition","Title:":"Title:","To:":"To:","Trigger with value":"Trigger with value",Triggered:G1,Triggers:V1,"Triggers the on script saving or the javascript instance restart":"Triggers the on script saving or the javascript instance restart","Triggers the rule on update or change of some state":"Triggers the rule on update or change of some state","Triggers the rule periodically or on some specific time":"Triggers the rule periodically or on some specific time",Tu:K1,Tuesday:Y1,URL:J1,"Unknown error":"Unknown error","Unknown error!":"Unknown error!","Use generated code":"Use generated code","User function":"User function","User:":"User:",Value:q1,"Vibration:":"Vibration:",Volume:X1,We:Z1,Wednesday:Q1,"Whatsapp-cmb":"Whatsapp-cmb",Write:eN,"Write your own code":"Write your own code",Yes:tN,"Yet exists!":"Yet exists!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"You can use %s in the URL to use current trigger value, %id to use the triggered object ID, %name to show triggered object ID name or %old to use old trigger value","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"You can use %s in the command to use current trigger value, %id to use the triggered object ID, %name to show triggered object ID name or %old to use old trigger value","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"You can use %s in the text to display current trigger value, %id to use the triggered object ID, %name to show triggered object ID name or %old to use old trigger value","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"You can use %s in the value to use the current trigger value, %id to use the triggered object ID, %name to show triggered object ID name or %old to use old trigger value","You have to enter OpenAI API key in the configuration of javascript adapter.":"You have to enter OpenAI API key in the configuration of javascript adapter.","You have to enter at least one API key in the configuration of javascript adapter.":"You have to enter at least one API key (OpenAI, Anthropic or Gemini) in the configuration of javascript adapter.","Please select a valid model":"Please select a valid model","[equal]":"[equal]","[greater or equal]":"[greater or equal]","[greater]":"[greater]","[hysteresis]":"[hysteresis]","[includes]":"[includes]","[less or equal]":"[less or equal]","[less]":"[less]","[not equal]":"[not equal]",acknowledgment:sN,all:oN,and:iN,"as JSON":"as JSON","as plain text":"as plain text",astro:nN,at:rN,"clear running":"clear running",control:aN,copy:lN,cron:cN,dawn:uN,debug_help:dN,debug_label:hN,default:"default",dusk:pN,easy:gN,else:"else","equal to":"equal to",every:mN,"every hour at 0 minutes":"every hour at 0 minutes",false:"false","file reading has failed: %s":"file reading has failed: %s","file reading was aborted":"file reading was aborted",filter_func:fN,filter_id:$N,filter_name:bN,filter_role:vN,filter_room:yN,"for edit or create script":"for edit or create a new script","for professionals":"for professionals","for programmers":"for programmers",goldenHour:_N,goldenHourEnd:wN,"greater or equal":"greater or equal","greater or equal to":"greater or equal to","greater than":"greater than",help_just_check:kN,help_on_change:CN,"high priority":"high priority","high-priority":"high-priority","highest priority":"highest priority",hours:TN,includes:SN,interval:EN,"just check":"just check","less or equal":"less or equal","less or equal to":"less or equal to","less than":"less than","lower priority":"lower priority","lowest priority":"lowest priority",magic:IN,milliseconds:xN,minutes:DN,ms:AN,nadir:ON,nauticalDawn:RN,nauticalDusk:NN,nextSunrise:MN,nextSunset:LN,night:PN,nightEnd:BN,"no blocks found":"No blocks found","no group":"NO GROUP",normal:FN,"normal priority":"normal priority","not equal to":"not equal to","not properly connected":"This block is not properly connected to other blocks.",offset:jN,"on change":"on change","on condition change":"on condition change","on update":"on update",one:zN,or:UN,quiet:HN,"reset search":"reset search",search:WN,seconds:GN,solarNoon:VN,"store in":"store in",sunrise:KN,sunriseEnd:YN,sunset:JN,sunsetStart:qN,then:XN,"toggle value":"toggle value",tooltip_ack:ZN,tooltip_from:QN,tooltip_lc:eM,tooltip_quality:tM,tooltip_ts:sM,tooltip_user:oM,tooltip_value:iM,true:"true",two:nM,undefined:"undefined",update:rM,"use seconds":"use seconds","use trigger value":"use trigger value",verbose_help:aM,verbose_label:lM,when:cM,with:"with","with date":"with date","with offset":"with offset",wizard:uM,"Loading models...":"Loading models...","Could not connect to API at %s":"Could not connect to API at %s","Invalid API key":"Invalid API key","Access denied by API":"Access denied by API","API error: %s":"API error: %s",'Model "%s" not found':'Model "%s" not found',"Request failed: %s":"Request failed: %s",Retry:dM,"No running javascript instance found":"No running javascript instance found"},pM="Bestätigt",gM="Aktionen",mM="Hinzufügen",fM="Alle",$M="Egal",bM="Anwenden",vM="April",yM="Fragen",_M="Astronomisch",wM="August",kM="Abbrechen",CM="Schließen",TM="Bedingung",SM="Bedingungen",EM="Konsole",IM="Kopiert",xM="Dezember",DM="Standard",AM="Verzögerung",OM="Löschen",RM="Beschreibung",NM="Fertig",MM="Exec shell",LM="Erläuterung",PM="Export",BM="Februar",FM="Februar",jM="Filter",zM="Ordner",UM="Fr",HM="Freitag",WM="ID",GM="ID1",VM="ID2",KM="Import",YM="Instanz",JM="Instanzen",qM="Anleitung",XM="Januar",ZM="Januar",QM="Juli",eL="Juni",tL="Grenze",sL="März",oL="Mai",iL="Menü",nL="Nachricht",rL="Mo",aL="Modell",lL="Montag",cL="Monat",uL="Mehr",dL="Name",hL="November",pL="OK",gL="Oktober",mL="Ok",fL="Pause",$L="Pushover",bL="Pushsafer",vL="Umbenennen",yL="Wiederholen",_L="Neustart",wL="Ergebnis",kL="Sa",CL="Samstag",TL="Speichern",SL="Zeitplan",EL="Skript",IL="September",xL="Simulieren",DL="Stack",AL="Start",OL="Zustand",RL="So",NL="Sonntag",ML="Telegram",LL="Do",PL="Donnerstag",BL="Zeit",FL="Ausgelöst",jL="Löst aus",zL="Di",UL="Dienstag",HL="URL",WL="Wert",GL="Volumen",VL="Mi",KL="Mittwoch",YL="Schreiben",JL="Ja",qL="Wissen",XL="alle",ZL="und",QL="Astro",eP="um",tP="Steuerung",sP="Kopie",oP="CRON",iP="Morgendämmerung",nP="Dies ist ein spezieller Modus, in dem sich Zustände und Objekte nicht ändern. Im Protokoll werden jedoch nur Informationen zu jeder geplanten Änderung angezeigt.",rP="Debuggen",aP="Abenddämmerung",lP="einfach",cP="jeder",uP="Funktion",dP="ID",hP="Name",pP="Rolle",gP="Raum",mP="Goldene Abendstunde",fP="Vormittag",$P='Der Code wird jedes Mal ausgeführt, wenn die Bedingung erfüllt ist. z.B. wenn der Temperatur wert sich ändert und die Bedingung "Wenn die Temperatur größer als 20°C ist" lautet, werden die "Dann" -Aktionen jedes Mal ausgeführt, wenn der Sensor die Temperatur sendet und diese über 20°C liegt. Bei 21°C, bei 22°C und so weiter.',bP='Der Code wird nur ausgeführt, wenn sich das Ergebnis der Bedingung ändert. z.B. wenn sich der Temperatur wert ändert und die Bedingung "Wenn die Temperatur größer als 20°C ist" lautet, werden die "Dann" -Aktionen einmal ausgeführt, wenn die Temperatur über 20°C liegt. Das nächste Mal werden die "Dann" -Aktionen ausgeführt, wenn die Temperatur unter 20°C gefallen ist und dann wieder über 20°C ansteigt.',vP="Stunden",yP="beinhaltet",_P="Intervall",wP="Magie",kP="Millisekunden",CP="Minuten",TP="ms",SP="Nadir",EP="nautische Morgendämmerung",IP="nautische Abenddämmerung",xP="Nächster Sonnenaufgang",DP="Nächster Sonnenuntergang",AP="Nacht",OP="astronomische Morgendämmerung",RP="Normal",NP="Versatz",MP="einer",LP="oder",PP="ruhig",BP="Suche",FP="Sekunden",jP="(Nach-)Mittag",zP="Sonnenaufgang",UP="Goldene Morgenstunde",HP="Sonnenuntergang",WP="Sonnenuntergang (Anfang)",GP="dann",VP="Bestätigen",KP="Von",YP="Zuletzt geändert",JP="Qualität",qP="Zeitstempel",XP="Benutzer",ZP="Wert",QP="zwei",eB="Aktualisieren",tB="Fügt Debug-Ausgaben für viele Systembefehle zum Protokoll hinzu",sB="Ausführliche Protokollausgaben",oB="falls",iB="Assistent",nB="Erneut versuchen",rB={"%s not found":"%s nicht gefunden","()":"()","(at %s)":"(um %s)","(optional)":"(optional)","-":"-",".":".","AI code generator":"KI-Codegenerator",Ack:pM,Actions:gM,"Actual time of day":"Tatsächliche Tageszeit",Add:mM,"Add new script":"Neues Skript hinzufügen",All:fM,"All files will be accepted":"Alle Dateien werden akzeptiert",Any:$M,"Any month":"Jeden Monat",Apply:bM,April:vM,"Are you sure?":"Wirklich sicher?",Ask:yM,Astronomical:_M,"Astronomical events today":"Astronomische Ereignisse heute",August:wM,"Blockly description":"Erstellen von Regeln durch Grafikblöcke","Body:":"Körper:",Cancel:kM,"Cannot delete non empty item!":"Kann nicht gelöscht werden, weil noch einige Elementen darin sind!","Change layout":"Layout ändern",'Change theme (actual "%s")':'Thema ändern (jetzt - "%s")',"Check blocks":"Blöcke prüfen","Check is not active, because javascript adapter is disabled":"Syntax-Check ist nicht aktiv, weil der Javascript Adapter nicht aktiv ist.","Clear search input":"Sucheingabe löschen","Click on this icon":"Auf dieses Symbol klicken",Close:CM,"Close all but current":"Alle anderen außer dem Aktiven schließen","Collapse all":"Alles einklappen","Compares current time with astronomical event":"Vergleicht die aktuelle Zeit mit einem astronomischen Ereignis","Compares current time with the user specific time":"Vergleicht die aktuelle Zeit mit der benutzerspezifischen Zeit","Compares the state value with user defined value":"Vergleicht den Zustandswert mit dem benutzerdefinierten Wert",Condition:TM,Conditions:SM,"Configuration not saved.":"Die Konfiguration ist nicht gespeichert.",Console:EM,"Control or update some state":"Zustand steuern oder aktualisieren","Control or update some state with delay":"Zustand mit Verzögerung steuern oder aktualisieren","Convert blockly to javascript for ever.":"Blockly dauerhaft in Javascript konvertieren.",Copied:IM,"Copy script":"Skript kopieren","Copy to clipboard":"In die Zwischenablage kopieren","Create new":"Neu erstellen","Create new folder":"Neuen Ordner erstellen","Create new script":"Neues Skript erstellen","Create or edit CRON or time wizard":"CRON- oder Zeit-Assistenten erstellen oder bearbeiten","Dark Theme":"Dunkles Thema","Dark style":"Dunkler Stil",Date:"Datum","Debug instance":"Debug-Instanz","Debug options":"Debug-Optionen",December:xM,Default:DM,"Define cron...":"Cron definieren ...","Define schedule...":"Zeitplan definieren ...",Delay:AM,Delete:OM,"Delete %s":"Löschen %s...","Delete folder":"Ordner löschen","Delete script":"Skript löschen",Description:RM,"Deselect all":"Alles abwählen","Discard changes for %s":"Änderungen für %s verwerfen",Done:NM,"Double click to write value":"Doppelklick zum Schreiben des Wertes","Download as file":"Download als Datei","Drop some files here or click...":"Dateien hier ablegen oder klicken ...","Duplicate name":"Doppelter Name","Edit script or just double click":"Skript bearbeiten oder einfach doppelklicken","Empty name is not allowed":"Leerer Name ist nicht zulässig","End search mode":"Suchmodus beenden","Enter your question":"Anfrage eingeben",Error:"Fehler","Error formatting code":"Fehler beim Formatieren des Codes","Error was found":"Fehler wurde gefunden","Every day":"Täglich",Exec:MM,"Executes some shell command":"Führt einen Shell-Befehl aus","Existing scripts will be overwritten.":"Vorhandene Skripte werden überschrieben.","Expand all":"Alle erweitern","Expert mode":"Expertenmodus",Explanation:LM,Export:PM,"Export all scripts":"Alle Skripte exportieren","Export blocks":"Blöcke exportieren","Export selected blocks":"Ausgewählte Blöcke exportieren",Februar:BM,February:FM,Filter:jM,Folder:zM,Fr:UM,Friday:HM,Function:"Funktion","Function editor":"Funktions-Editor","Function: executed":"Funktion: ausgeführt","Go to next line":"Gehe zur nächsten Zeile","HTTP Call":"HTTP-Aufruf","Hide logs":"Protokoll ausblenden",ID:WM,ID1:GM,ID2:VM,Import:KM,"Import blocks":"Blöcke importieren","Import error":"Fehler beim Importieren","Import scripts":"Skripte importieren","Insert object ID":"Objekt-ID einfügen",Instance:YM,"Instance is disabled":"Instanz ist deaktiviert","Instance:":"Instanz:",Instances:JM,Instructions:qM,"Invalid CRON":"Ungültiger CRON","It will not be possible to revert this operation.":"Dieser Vorgang kann nicht rückgängig gemacht werden.","JS description":"Regeln erstellen mit JavaScript",Januar:XM,January:ZM,July:QM,June:eL,"Just check":"Einfach überprüfen","Language:":"Sprache:","Learn More":"Mehr erfahren","Light style":"Heller Stil",Limit:tL,"Local time":"Lokale Zeit","Locate file":"Datei zeigen","Log outputs":"Protokoll","Log text":"Protokolltext","Log: %s":"Log: %s","Make a HTTP get request":"Eine HTTP-Abrufanforderung stellen","Make a pause between actions":"Eine Pause zwischen den Aktionen machen",March:sL,"March ":"März ",May:oL,Menu:iL,Message:nL,Mo:rL,Model:aL,Monday:lL,Month:cL,More:uL,Name:dL,"No API key found":"Kein API-Schlüssel gefunden","No Chat GPT Key found":"Kein Chat-GPT-Schlüssel gefunden","No active host found":"Kein aktiver Host gefunden","Nothing found":"Nichts gefunden",November:hL,OK:pL,October:gL,Ok:mL,"On condition change":"Bei Änderung des Ergebnis der Bedingung","On script save or adapter start":"Beim Speichern des Skripts oder beim Starten des Adapters","On weekdays":"An Wochentagen","Open configuration":"Konfiguration öffnen","Operate two states":"Zwei Zustände operieren","Operations with two states":"Operationen mit zwei Zuständen","Paste your blocks here":"Fügen Sie Ihre Blöcke hier ein",Pause:fL,"Pause execution":"Ausführung pausieren","Pause script":"Skript anhalten","Phone:":"Telefon:","Please select object ID...":"Objekt-ID auswählen ...","Press Ctrl+Enter to get the answer":"Strg+Eingabetaste, um die Antwort zu erhalten","Prettify the script":"Verschönern Sie das Skript","Print some text in log":"Einen Text im Protokoll ausdrucken","Priority:":"Priorität:",Pushover:$L,Pushsafer:bL,"Read only ID selected: %s":"Schreibgeschützte ID ausgewählt: %s",Rename:vL,"Reorder scripts in folders":"Skripte in Ordnern neu ordnen",Repeat:yL,Restart:_L,Result:wL,"Resume execution":"Ausführung fortsetzen","Root folder":"Root-Verzeichnis","Rules description":"Regeln erstellen mit WENN-, DANN- und SONST-Blöcken","Run script":"Skript ausführen",Sa:kL,Saturday:CL,Save:TL,"Save all":"Alle speichern","Say It":"Say It","Say some text via sayit adapter":"Einen Text über den Sayit-Adapter sagen",Schedule:SL,Script:EL,"Script %s was modified on disk":'Skript "%s" wurde auf der Festplatte geändert',"Script is not running":"Skript läuft nicht","Search in scripts":"Suche in Skripten","Search...":"Suche...","Select all":"Alles auswählen","Send email":"E-Mail senden","Sends an email":"Sendet eine E-Mail","Sends message via Pushsafer":"Sendet eine Nachricht über Pushsafer","Sends message via pushover":"Sendet eine Nachricht per Pushover","Sends message via telegram":"Sendet eine Nachricht per telegram","Sends message via whatsapp-cmb":"Sendet eine Nachricht über WhatsApp-Cmb",September:IL,"Server time":"Server-Zeit","Set state action":"Zustand setzten","Set with delay":"Setzen mit Verzögerung","Shell command":"Shell-Befehl","Show astronomical events":"Astronomische Ereignisse anzeigen","Show javascript code":"Javascript-Code zeigen","Show logs":"Protokoll anzeigen","Show only paused scripts":"Nur angehaltene Skripte zeigen","Show only running scripts":"Nur laufende Skripte zeigen","Show only scripts with problems":"Nur Skripte mit Problemen zeigen",Simulate:xL,"Some files will be rejected":"Einige Dateien werden abgelehnt","Sound:":"Klang:",Stack:DL,Start:AL,"Start script":"Skript starten",State:OL,"State condition":"Zustandsbedingung","Step into function":"Schritt in die Funktion","Step out from function":"Raus aus der Funktion","Stop on exception":"Bei Ausnahme anhalten",Su:RL,"Subject:":"Gegenstand:",Sunday:NL,"TS description":"Regeln erstellen mit TypeScript",Telegram:ML,"Text:":"Text:",Th:LL,"The script will be stopped and must be activated manually after debugging. Continue?":"Das Skript wird gestoppt und muss nach dem Debuggen manuell aktiviert werden. Fortsetzen?","This is advances option. You can write your own code here and it will be executed on trigger":"Dies ist eine erweiterte Option. Sie können hier Ihren eigenen Code schreiben, der beim Auslösen ausgeführt wird",Thursday:PL,Time:BL,"Time condition":"Zeitbedingung","Title:":"Titel:","To:":"Zu:","Trigger with value":"Trigger mit Wert",Triggered:FL,Triggers:jL,"Triggers the on script saving or the javascript instance restart":"Löst das Speichern des Skripts oder den Neustart der Javascript-Instanz aus","Triggers the rule on update or change of some state":"Löst die Regel beim Aktualisieren oder Ändern eines Zustands aus","Triggers the rule periodically or on some specific time":"Löst periodisch oder zu einem bestimmten Zeitpunkt aus",Tu:zL,Tuesday:UL,URL:HL,"Unknown error":"Unbekannter Fehler","Unknown error!":"Unbekannter Fehler!","Use generated code":"Code verwenden","User function":"Benutzerfunktion","User:":"Benutzer:",Value:WL,"Vibration:":"Vibration:",Volume:GL,We:VL,Wednesday:KL,"Whatsapp-cmb":"WhatsApp-cmb",Write:YL,"Write your own code":"Eigenen Code schreiben",Yes:JL,"Yet exists!":"Existiert schon!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Sie können %s in der URL verwenden, um den aktuellen Triggerwert zu verwenden, %id, um die ausgelöste Objekt-ID zu verwenden, %name, um den ID-Namen des ausgelösten Objekts anzuzeigen, oder %old, um den alten Triggerwert zu verwenden","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Sie können %s im Befehl verwenden, um den aktuellen Triggerwert zu verwenden, %id, um die ausgelöste Objekt-ID zu verwenden, %name, um den ID-Namen des ausgelösten Objekts anzuzeigen, oder %old, um den alten Triggerwert zu verwenden","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Sie können %s im Text verwenden, um den aktuellen Triggerwert anzuzeigen, %id, um die ausgelöste Objekt-ID zu verwenden, %name, um den ID-Namen des ausgelösten Objekts anzuzeigen, oder %old, um den alten Triggerwert zu verwenden","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Sie können %s im Wert verwenden, um den aktuellen Triggerwert zu verwenden, %id, um die ID des ausgelösten Objekts zu verwenden, %name, um den ID-Namen des ausgelösten Objekts anzuzeigen, oder %old, um den alten Triggerwert zu verwenden","You have to enter OpenAI API key in the configuration of javascript adapter.":"Sie müssen den OpenAI-API-Schlüssel in der Konfiguration des Javascript-Adapters eingeben.","You have to enter at least one API key in the configuration of javascript adapter.":"Sie müssen mindestens einen API-Schlüssel (OpenAI, Anthropic oder Gemini) in der Konfiguration des Javascript-Adapters eingeben.","Please select a valid model":"Bitte wählen Sie ein gültiges Modell aus","[equal]":"[gleich]","[greater or equal]":"[größer oder gleich]","[greater]":"[größer]","[hysteresis]":"[Hysterese]","[includes]":"[enthält]","[less or equal]":"[kleiner oder gleich]","[less]":"[kleiner]","[not equal]":"[ungleich]",acknowledgment:qL,all:XL,and:ZL,"as JSON":"als JSON","as plain text":"als Klartext",astro:QL,at:eP,"clear running":"laufende abbrechen",control:tP,copy:sP,cron:oP,dawn:iP,debug_help:nP,debug_label:rP,default:"Standard",dusk:aP,easy:lP,else:"sonst","equal to":"gleich",every:cP,"every hour at 0 minutes":"jede Stunde bei 0 Minuten",false:"falsch","file reading has failed: %s":"Das Lesen der Datei ist fehlgeschlagen: %s","file reading was aborted":"Das Lesen der Datei wurde abgebrochen",filter_func:uP,filter_id:dP,filter_name:hP,filter_role:pP,filter_room:gP,"for edit or create script":"zum Bearbeiten oder zum Erstellen eines neues Skripts","for professionals":"für Profis","for programmers":"für Programmierer",goldenHour:mP,goldenHourEnd:fP,"greater or equal":"größer oder gleich","greater or equal to":"größer oder gleich","greater than":"größer als",help_just_check:$P,help_on_change:bP,"high priority":"hohe Priorität","high-priority":"hohe Priorität","highest priority":"höchste Priorität",hours:vP,includes:yP,interval:_P,"just check":"einfach prüfen","less or equal":"kleiner oder gleich","less or equal to":"kleiner oder gleich","less than":"kleiner als","lower priority":"geringere Priorität","lowest priority":"niedrigste Priorität",magic:wP,milliseconds:kP,minutes:CP,ms:TP,nadir:SP,nauticalDawn:EP,nauticalDusk:IP,nextSunrise:xP,nextSunset:DP,night:AP,nightEnd:OP,"no blocks found":"Keine Blöcke gefunden","no group":"KEINE GRUPPE",normal:RP,"normal priority":"normale Priorität","not equal to":"ungleich","not properly connected":"Dieser Block ist mit anderen nicht richtig verbunden.",offset:NP,"on change":"bei Änderung","on condition change":"bei Zustandsänderung","on update":"beim Aktualisieren",one:MP,or:LP,quiet:PP,"reset search":"Suche zurücksetzen",search:BP,seconds:FP,solarNoon:jP,"store in":"speichern in",sunrise:zP,sunriseEnd:UP,sunset:HP,sunsetStart:WP,then:GP,"toggle value":"Wert umschalten",tooltip_ack:VP,tooltip_from:KP,tooltip_lc:YP,tooltip_quality:JP,tooltip_ts:qP,tooltip_user:XP,tooltip_value:ZP,true:"wahr",two:QP,undefined:"nicht definiert",update:eB,"use seconds":"Sekunden verwenden","use trigger value":"Triggerwert benutzen",verbose_help:tB,verbose_label:sB,when:oB,with:"mit","with date":"mit Datum","with offset":"mit Versatz",wizard:iB,"Loading models...":"Modelle werden geladen...","Could not connect to API at %s":"Verbindung zur API unter %s nicht möglich","Invalid API key":"Ungültiger API-Schlüssel","Access denied by API":"Zugriff von der API verweigert","API error: %s":"API-Fehler: %s",'Model "%s" not found':'Modell "%s" nicht gefunden',"Request failed: %s":"Anfrage fehlgeschlagen: %s",Retry:nB,"No running javascript instance found":"Keine laufende JavaScript-Instanz gefunden"},aB="Admitido",lB="Comportamiento",cB="Añadir",uB="Todos",dB="Alguna",hB="Apply",pB="abril",gB="Preguntar",mB="Astronómico",fB="agosto",$B="Cancelar",bB="Cerrar",vB="Condición",yB="Condiciones",_B="Consola",wB="Copiado",kB="diciembre",CB="Defecto",TB="Demora",SB="Eliminar",EB="Descripción",IB="Hecho",xB="Ejecutivo shell",DB="Explicación",AB="Exportar",OB="Februar",RB="febrero",NB="Filtrar",MB="Carpeta",LB="P.",PB="viernes",BB="CARNÉ DE IDENTIDAD",FB="ID1",jB="ID2",zB="Importar",UB="Ejemplo",HB="Instancias",WB="Instrucciones",GB="Enero",VB="enero",KB="julio",YB="junio",JB="Límite",qB="marzo",XB="Mayo",ZB="Menú",QB="Mensaje",e2="Mes",t2="Modelo",s2="lunes",o2="Mes",i2="Más",n2="Nombre",r2="noviembre",a2="OK",l2="octubre",c2="Okay",u2="Pausa",d2="Persona fácil de convencer",h2="Pushsafer",p2="Rebautizar",g2="Repetir",m2="Reiniciar",f2="Resultado",$2="Sa",b2="sábado",v2="Salvar",y2="Calendario",_2="Guión",w2="septiembre",k2="Simular",C2="Stack",T2="Comienzo",S2="Expresar",E2="Su",I2="domingo",x2="Telegrama",D2="4",A2="jueves",O2="Tiempo",R2="Motivado",N2="Disparadores",M2="Tu",L2="martes",P2="URL",B2="Valor",F2="Volumen",j2="3",z2="miércoles",U2="Escribir",H2="sí",W2="Reconocimiento",G2="todos",V2="y",K2="astro",Y2="a",J2="control",q2="Copiar",X2="CRON",Z2="Amanecer",Q2="Este es un modo especial en el que los estados y los objetos no cambiarán. Pero solo se mostrará información sobre cada cambio planificado en el protocolo.",eF="Depurar",tF="Oscuridad",sF="fácil",oF="cada",iF="Función",nF="CARNÉ DE IDENTIDAD",rF="Nombre",aF="Papel",lF="Habitación",cF="hora dorada",uF="Fin de la hora dorada",dF='El código se ejecutará solo cada vez que la condición sea verdadera. P.ej. si se activa en el valor del sensor de temperatura y la condición es "si la temperatura es superior a 20 ° C", las acciones "entonces" se ejecutarán cada vez que el sensor envíe la temperatura y supere los 20 ° C. Por 21 ° C, por 22 ° C y así sucesivamente.',hF='El código se ejecutará solo si cambia el resultado de la condición. P.ej. si se activa en el valor del sensor de temperatura y la condición es "si la temperatura es superior a 20 ° C", las acciones "entonces" se ejecutarán una vez cuando la temperatura sea superior a 20. La próxima vez, las acciones "entonces" se ejecutarán cuando la temperatura falla por debajo de 20 y luego sube por encima de 20 nuevamente.',pF="horas",gF="incluye",mF="intervalo",fF="magia",$F="milisegundos",bF="minutos",vF="ms",yF="nadir",_F="Amanecer náutico",wF="Atardecer náutico",kF="próximo amanecer",CF="Próxima puesta de sol",TF="Noche",SF="Fin de la noche",EF="normal",IF="compensar",xF="uno",DF="o",AF="tranquilo",OF="buscar",RF="segundos",NF="Mediodía solar",MF="amanecer",LF="Final del amanecer",PF="puesta de sol",BF="Inicio al atardecer",FF="entonces",jF="Reconocer",zF="De",UF="Último cambio",HF="Calidad",WF="Marca de tiempo",GF="Usuario",VF="Valor",KF="dos",YF="actualizar",JF="Agrega salida de depuración al registro para muchos comandos del sistema",qF="Salidas de registro detalladas",XF="cuando",ZF="Wizard",QF="Reintentar",ej={"%s not found":"%s no encontrado","()":"()","(at %s)":"(en %s)","(optional)":"(Opcional)","-":"-",".":".","AI code generator":"Generador de código de IA",Ack:aB,Actions:lB,"Actual time of day":"Hora real del día",Add:cB,"Add new script":"Agregar nuevo script",All:uB,"All files will be accepted":"Todos los archivos serán aceptados.",Any:dB,"Any month":"Cualquier mes",Apply:hB,April:pB,"Are you sure?":"¿Estás seguro?",Ask:gB,Astronomical:mB,"Astronomical events today":"Eventos astronómicos hoy",August:fB,"Blockly description":"Crear reglas por bloques gráficos","Body:":"Cuerpo:",Cancel:$B,"Cannot delete non empty item!":"¡No se puede eliminar un elemento no vacío!","Change layout":"Cambia el diseño",'Change theme (actual "%s")':'Cambiar tema (ahora - "%s")',"Check blocks":"Comprobar bloques","Check is not active, because javascript adapter is disabled":"La comprobación no está activa porque el adaptador Javascript está desactivado","Clear search input":"Borrar entrada de búsqueda","Click on this icon":"Haga clic en este ícono",Close:bB,"Close all but current":"Cerrar todo menos el actual","Collapse all":"Desplegar todo","Compares current time with astronomical event":"Compara la hora actual con un evento astronómico","Compares current time with the user specific time":"Compara la hora actual con la hora específica del usuario","Compares the state value with user defined value":"Compara el valor del estado con el valor definido por el usuario",Condition:vB,Conditions:yB,"Configuration not saved.":"Configuración no guardada.",Console:_B,"Control or update some state":"Controlar o actualizar algún estado","Control or update some state with delay":"Controlar o actualizar algún estado con retraso","Convert blockly to javascript for ever.":"Convierta instantáneamente en bloque a Javascript.",Copied:wB,"Copy script":"Copiar guion","Copy to clipboard":"Copiar al portapapeles","Create new":"Crear nuevo","Create new folder":"Crear nueva carpeta","Create new script":"Crear nuevo script","Create or edit CRON or time wizard":"Crear o editar CRON o asistente de tiempo","Dark Theme":"Tema oscuro","Dark style":"Estilo oscuro",Date:"Fecha","Debug instance":"Instancia de depuración","Debug options":"Opciones de depuración",December:kB,Default:CB,"Define cron...":"Definir cron ...","Define schedule...":"Definir horario ...",Delay:TB,Delete:SB,"Delete %s":"Eliminar %s ...","Delete folder":"Eliminar carpeta","Delete script":"Eliminar guión",Description:EB,"Deselect all":"Deseleccionar todo","Discard changes for %s":"Descartar cambios para %s",Done:IB,"Double click to write value":"Doble clic para escribir el valor","Download as file":"Descargar como archivo","Drop some files here or click...":"Suelta algunos archivos aquí o haz clic ...","Duplicate name":"Nombre duplicado","Edit script or just double click":"Editar guión o simplemente hacer doble clic","Empty name is not allowed":"No se permite el nombre vacío","End search mode":"Fin del modo de búsqueda","Enter your question":"Ingrese su solicitud",Error:"Error","Error formatting code":"Código de formato de error","Error was found":"Error encontrado","Every day":"Diario",Exec:xB,"Executes some shell command":"Ejecuta algún comando de shell","Existing scripts will be overwritten.":"Los guiones existentes se sobrescribirán.","Expand all":"Expandir todo","Expert mode":"Modo experto",Explanation:DB,Export:AB,"Export all scripts":"Exportar todos los scripts","Export blocks":"Exportar bloques","Export selected blocks":"Exportar bloques seleccionados",Februar:OB,February:RB,Filter:NB,Folder:MB,Fr:LB,Friday:PB,Function:"Función","Function editor":"Editor de funciones","Function: executed":"Función: ejecutada","Go to next line":"Ir a la siguiente línea","HTTP Call":"Llamada HTTP","Hide logs":"Ocultar registros",ID:BB,ID1:FB,ID2:jB,Import:zB,"Import blocks":"Importar bloques","Import error":"Error de importación","Import scripts":"Importar guiones","Insert object ID":"Insertar ID de objeto",Instance:UB,"Instance is disabled":"La instancia está deshabilitada","Instance:":"Ejemplo:",Instances:HB,Instructions:WB,"Invalid CRON":"CRON inválido","It will not be possible to revert this operation.":"No será posible revertir esta operación.","JS description":"Crear reglas escribiendo Javascript",Januar:GB,January:VB,July:KB,June:YB,"Just check":"Sólo revisa","Language:":"Idioma:","Learn More":"Aprende más","Light style":"Estilo ligero",Limit:JB,"Local time":"Hora local","Locate file":"Localizar el archivo","Log outputs":"Salidas de registro","Log text":"Texto de registro","Log: %s":"Log: %s","Make a HTTP get request":"Realizar una solicitud de obtención HTTP","Make a pause between actions":"Hacer una pausa entre acciones",March:qB,"March ":"marzo",May:XB,Menu:ZB,Message:QB,Mo:e2,Model:t2,Monday:s2,Month:o2,More:i2,Name:n2,"No API key found":"No se encontró ninguna clave API","No Chat GPT Key found":"No se ha encontrado ninguna clave GPT de chat","No active host found":"No se encontró un host activo","Nothing found":"Nada Encontrado",November:r2,OK:a2,October:l2,Ok:c2,"On condition change":"En condición de cambio","On script save or adapter start":"Al guardar el script o al iniciar el adaptador","On weekdays":"De lunes a viernes","Open configuration":"Configuración abierta","Operate two states":"Operar dos estados","Operations with two states":"Operaciones con dos estados","Paste your blocks here":"Pega tus bloques aquí",Pause:u2,"Pause execution":"Pausar ejecución","Pause script":"Pausar guion","Phone:":"Teléfono:","Please select object ID...":"Por favor, seleccione la ID del objeto ...","Press Ctrl+Enter to get the answer":"Presiona Ctrl+Enter para obtener la respuesta","Prettify the script":"Embellecer el guión","Print some text in log":"Imprime texto en el registro","Priority:":"Prioridad:",Pushover:d2,Pushsafer:h2,"Read only ID selected: %s":"ID de solo lectura seleccionado: %s",Rename:p2,"Reorder scripts in folders":"Reordenar guiones en carpetas",Repeat:g2,Restart:m2,Result:f2,"Resume execution":"Reanudar ejecución","Root folder":"Carpeta raíz","Rules description":"Crea reglas con bloques IF, THEN, ELSE","Run script":"Ejecutar guión",Sa:$2,Saturday:b2,Save:v2,"Save all":"Salvar a todos","Say It":"Say It","Say some text via sayit adapter":"Di un mensaje de texto a través del adaptador sayit",Schedule:y2,Script:_2,"Script %s was modified on disk":"El script %s fue modificado en el disco","Script is not running":"El script no se está ejecutando","Search in scripts":"Buscar en guiones","Search...":"Buscar...","Select all":"Seleccionar todo","Send email":"Enviar correo electrónico","Sends an email":"Envía un correo electrónico","Sends message via Pushsafer":"Envía mensaje a través de Pushsafer","Sends message via pushover":"Envía un mensaje a través de un pushover","Sends message via telegram":"Envía mensaje por telegrama","Sends message via whatsapp-cmb":"Envía mensaje vía whatsapp-cmb",September:w2,"Server time":"Tiempo del servidor","Set state action":"Establecer acción estatal","Set with delay":"Establecer con retraso","Shell command":"Comando de Shell","Show astronomical events":"Mostrar eventos astronómicos","Show javascript code":"Mostrar código Javascript","Show logs":"Mostrar registros","Show only paused scripts":"Mostrar solo secuencias de comandos pausadas","Show only running scripts":"Mostrar solo scripts en ejecución","Show only scripts with problems":"Mostrar solo guiones con problemas",Simulate:k2,"Some files will be rejected":"Algunos archivos serán rechazados","Sound:":"Sonido:",Stack:C2,Start:T2,"Start script":"Iniciar guion",State:S2,"State condition":"Condición del estado","Step into function":"Entra en función","Step out from function":"Sal de la función","Stop on exception":"Deténgase en excepción",Su:E2,"Subject:":"Sujeto:",Sunday:I2,"TS description":"Crear reglas escribiendo el mecanografiado",Telegram:x2,"Text:":"Texto:",Th:D2,"The script will be stopped and must be activated manually after debugging. Continue?":"El script se detendrá y deberá activarse manualmente después de la depuración. ¿Continuar?","This is advances option. You can write your own code here and it will be executed on trigger":"Esta es la opción de avances. Puede escribir su propio código aquí y se ejecutará en el disparador",Thursday:A2,Time:O2,"Time condition":"Condición de tiempo","Title:":"Título:","To:":"A:","Trigger with value":"Activar con valor",Triggered:R2,Triggers:N2,"Triggers the on script saving or the javascript instance restart":"Activa el guardado de la secuencia de comandos o el reinicio de la instancia de JavaScript","Triggers the rule on update or change of some state":"Activa la regla de actualización o cambio de algún estado","Triggers the rule periodically or on some specific time":"Activa la regla periódicamente o en un momento específico",Tu:M2,Tuesday:L2,URL:P2,"Unknown error":"Error desconocido","Unknown error!":"¡Error desconocido!","Use generated code":"Usar código generado","User function":"Función de usuario","User:":"Usuario:",Value:B2,"Vibration:":"Vibración:",Volume:F2,We:j2,Wednesday:z2,"Whatsapp-cmb":"Whatsapp-cmb",Write:U2,"Write your own code":"Escribe tu propio código",Yes:H2,"Yet exists!":"¡Sin embargo existe!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Puede usar %s en la URL para usar el valor de activación actual, %id para usar el ID de objeto activado, %name para mostrar el nombre de ID de objeto activado o %old para usar el valor de activación antiguo","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Puede usar %s en el comando para usar el valor de activación actual, %id para usar el ID de objeto activado, %name para mostrar el nombre de ID de objeto activado o %old para usar el valor de activación anterior","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Puede usar %s en el texto para mostrar el valor de activación actual, %id para usar el ID de objeto activado, %name para mostrar el nombre de ID de objeto activado o %old para usar el valor de activación antiguo","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Puede usar %s en el valor para usar el valor de activación actual, %id para usar el ID de objeto activado, %name para mostrar el nombre de ID de objeto activado o %old para usar el valor de activación antiguo","You have to enter OpenAI API key in the configuration of javascript adapter.":"Debe ingresar la clave API de OpenAI en la configuración del adaptador de JavaScript.","You have to enter at least one API key in the configuration of javascript adapter.":"Debe ingresar al menos una clave API (OpenAI, Anthropic o Gemini) en la configuración del adaptador de JavaScript.","Please select a valid model":"Seleccione un modelo válido","[equal]":"[igual]","[greater or equal]":"[mayor o igual]","[greater]":"[mayor que]","[hysteresis]":"[histéresis]","[includes]":"[incluye]","[less or equal]":"[menor o igual]","[less]":"[menos]","[not equal]":"[no es igual]",acknowledgment:W2,all:G2,and:V2,"as JSON":"como JSON","as plain text":"como texto plano",astro:K2,at:Y2,"clear running":"carrera clara",control:J2,copy:q2,cron:X2,dawn:Z2,debug_help:Q2,debug_label:eF,default:"defecto",dusk:tF,easy:sF,else:"demás","equal to":"igual a",every:oF,"every hour at 0 minutes":"cada hora a los 0 minutos",false:"falso","file reading has failed: %s":"la lectura del archivo ha fallado: %s","file reading was aborted":"la lectura del archivo fue abortada",filter_func:iF,filter_id:nF,filter_name:rF,filter_role:aF,filter_room:lF,"for edit or create script":"para editar o crear un nuevo script","for professionals":"para profesionales","for programmers":"para programadores",goldenHour:cF,goldenHourEnd:uF,"greater or equal":"mayor o igual","greater or equal to":"mayor o igual a","greater than":"mas grande que",help_just_check:dF,help_on_change:hF,"high priority":"alta prioridad","high-priority":"alta prioridad","highest priority":"más alta prioridad",hours:pF,includes:gF,interval:mF,"just check":"Sólo revisa","less or equal":"menor o igual","less or equal to":"menor o igual a","less than":"menos que","lower priority":"prioridad más baja","lowest priority":"prioridad más baja",magic:fF,milliseconds:$F,minutes:bF,ms:vF,nadir:yF,nauticalDawn:_F,nauticalDusk:wF,nextSunrise:kF,nextSunset:CF,night:TF,nightEnd:SF,"no blocks found":"No se encontraron bloques","no group":"NO GRUPO",normal:EF,"normal priority":"prioridad normal","not equal to":"no igual a","not properly connected":"Este bloque no está conectado correctamente a otros bloques.",offset:IF,"on change":"en el cambio","on condition change":"con cambio de condición","on update":"en actualización",one:xF,or:DF,quiet:AF,"reset search":"restablecer la búsqueda",search:OF,seconds:RF,solarNoon:NF,"store in":"almacenar en",sunrise:MF,sunriseEnd:LF,sunset:PF,sunsetStart:BF,then:FF,"toggle value":"alternar valor",tooltip_ack:jF,tooltip_from:zF,tooltip_lc:UF,tooltip_quality:HF,tooltip_ts:WF,tooltip_user:GF,tooltip_value:VF,true:"cierto",two:KF,undefined:"indefinido",update:YF,"use seconds":"usar segundos","use trigger value":"usar valor de activación",verbose_help:JF,verbose_label:qF,when:XF,with:"con","with date":"con fecha","with offset":"con desplazamiento",wizard:ZF,"Loading models...":"Cargando modelos...","Could not connect to API at %s":"No se pudo conectar a la API en %s","Invalid API key":"Clave API no válida","Access denied by API":"Acceso denegado por la API","API error: %s":"Error de API: %s",'Model "%s" not found':'Modelo "%s" no encontrado',"Request failed: %s":"Solicitud fallida: %s",Retry:QF,"No running javascript instance found":"No se encontró ninguna instancia de JavaScript en ejecución"},tj="Reconnu",sj="Actions",oj="Ajouter",ij="Tout",nj="Tout",rj="Postuler",aj="avril",lj="Demander",cj="Astronomique",uj="août",dj="Annuler",hj="proche",pj="État",gj="Conditions",mj="Console",fj="Copié",$j="décembre",bj="Défaut",vj="Retard",yj="Effacer",_j="Description",wj="Terminé",kj="Exec shell",Cj="Explication",Tj="Exportation",Sj="Février",Ej="février",Ij="Filtre",xj="Dossier",Dj="Fr",Aj="Vendredi",Oj="ID",Rj="ID1",Nj="ID2",Mj="Importation",Lj="Exemple",Pj="Instances",Bj="Instructions",Fj="Janvier",jj="janvier",zj="juillet",Uj="juin",Hj="Limite",Wj="Mars",Gj="Mai",Vj="M e n u",Kj="Message",Yj="Mo",Jj="Modèle",qj="Lundi",Xj="Mois",Zj="Plus",Qj="Nom",ez="novembre",tz="OK",sz="octobre",oz="D'accord",iz="Pause",nz="Pushover",rz="Pushsafer",az="Renommer",lz="Répéter",cz="Redémarrer",uz="Résultat",dz="Sa",hz="samedi",pz="sauver",gz="Horaire",mz="Scénario",fz="septembre",$z="Simuler",bz="Stack",vz="Début",yz="État",_z="Su",wz="dimanche",kz="Télégramme",Cz="4",Tz="Jeudi",Sz="Temps",Ez="Déclenché",Iz="Déclencheurs",xz="Tu",Dz="Mardi",Az="URL",Oz="Valeur",Rz="Le volume",Nz="3",Mz="Mercredi",Lz="Écrivez",Pz="Oui",Bz="reconnaissance",Fz="tout",jz="et",zz="astro",Uz="à",Hz="contrôler",Wz="copie",Gz="CRON",Vz="Aube",Kz="Il s'agit d'un mode spécial dans lequel les états et les objets ne changeront pas. Mais seules les informations sur chaque changement prévu seront affichées dans le protocole.",Yz="Déboguer",Jz="Crépuscule",qz="facile",Xz="chaque",Zz="Une fonction",Qz="ID",eU="Nom",tU="Rôle",sU="Pièce",oU="Heure d'or",iU="Fin de l'heure d'or",nU="Le code ne sera exécuté que chaque fois que la condition est vraie. Par exemple. si déclenchement sur la valeur du capteur de température et que la condition est «si la température est supérieure à 20 ° C», les actions «alors» seront exécutées à chaque fois que le capteur envoie la température et qu'elle est supérieure à 20 ° C. À 21 ° C, à 22 ° C et ainsi de suite.",rU="Le code ne sera exécuté que si le résultat de la condition change. Par exemple. si le déclenchement sur la valeur du capteur de température et que la condition est «si la température est supérieure à 20 ° C», les actions «alors» seront exécutées une fois lorsque la température est supérieure à 20. La prochaine fois, les actions «alors» seront exécutées lorsque la température échoue sous 20 puis remonte au-dessus de 20.",aU="les heures",lU="comprend",cU="intervalle",uU="la magie",dU="millisecondes",hU="minutes",pU="ms",gU="nadir",mU="Aube nautique",fU="Crépuscule nautique",$U="Prochain lever de soleil",bU="Prochain coucher de soleil",vU="Nuit",yU="Fin de nuit",_U="Ordinaire",wU="décalage",kU="une",CU="ou",TU="calmer",SU="chercher",EU="secondes",IU="Midi solaire",xU="lever du soleil",DU="Fin du lever du soleil",AU="le coucher du soleil",OU="Début du coucher du soleil",RU="alors",NU="Reconnaître",MU="De",LU="Dernière modification",PU="Qualité",BU="Horodatage",FU="Utilisateur",jU="Valeur",zU="deux",UU="mettre à jour",HU="Ajoute une sortie de débogage au journal pour de nombreuses commandes système",WU="Sorties de journal détaillées",GU="lorsque",VU="Wizard",KU="Réessayer",YU={"%s not found":"%s non trouvé","()":"()","(at %s)":"(à %s)","(optional)":"(optionnel)","-":"-",".":".","AI code generator":"Générateur de code IA",Ack:tj,Actions:sj,"Actual time of day":"Heure réelle de la journée",Add:oj,"Add new script":"Ajouter un nouveau script",All:ij,"All files will be accepted":"Tous les fichiers seront acceptés",Any:nj,"Any month":"N'importe quel mois",Apply:rj,April:aj,"Are you sure?":"Êtes-vous sûr?",Ask:lj,Astronomical:cj,"Astronomical events today":"Événements astronomiques aujourd'hui",August:uj,"Blockly description":"Création de règles par blocs graphiques","Body:":"Corps:",Cancel:dj,"Cannot delete non empty item!":"Impossible de supprimer un élément non vide!","Change layout":"Changer la disposition",'Change theme (actual "%s")':'Changer de thème (maintenant - "%s")',"Check blocks":"Vérifier les blocs","Check is not active, because javascript adapter is disabled":"La vérification n'est pas active, car l'adaptateur Javascript est désactivé","Clear search input":"Effacer la recherche","Click on this icon":"Cliquez sur cette icône",Close:hj,"Close all but current":"Ferme tout sauf courant","Collapse all":"Réduire tout","Compares current time with astronomical event":"Compare l'heure actuelle avec un événement astronomique","Compares current time with the user specific time":"Compare l'heure actuelle avec l'heure spécifique de l'utilisateur","Compares the state value with user defined value":"Compare la valeur d'état avec la valeur définie par l'utilisateur",Condition:pj,Conditions:gj,"Configuration not saved.":"Configuration non enregistrée.",Console:mj,"Control or update some state":"Contrôler ou mettre à jour un état","Control or update some state with delay":"Contrôler ou mettre à jour un état avec un délai","Convert blockly to javascript for ever.":"Convertissez instantanément en Javascript.",Copied:fj,"Copy script":"Copier le script","Copy to clipboard":"Copier dans le presse-papier","Create new":"Créer un nouveau","Create new folder":"Créer un nouveau dossier","Create new script":"Créer un nouveau script","Create or edit CRON or time wizard":"Créer ou éditer CRON ou un assistant de temps","Dark Theme":"Thème sombre","Dark style":"Style sombre",Date:"Date","Debug instance":"Instance de débogage","Debug options":"Options de débogage",December:$j,Default:bj,"Define cron...":"Définir le cron ...","Define schedule...":"Définir le calendrier ...",Delay:vj,Delete:yj,"Delete %s":"Supprimer %s ...","Delete folder":"Supprimer le dossier","Delete script":"Supprimer le script",Description:_j,"Deselect all":"Tout déselectionner","Discard changes for %s":"Ignorer les modifications pour %s",Done:wj,"Double click to write value":"Double clic pour écrire la valeur","Download as file":"Télécharger le fichier","Drop some files here or click...":"Déposer des fichiers ici ou cliquez sur ...","Duplicate name":"Nom en double","Edit script or just double click":"Modifiez le script ou double-cliquez simplement sur","Empty name is not allowed":"Le nom vide n'est pas autorisé","End search mode":"Fin du mode de recherche","Enter your question":"Entrez votre demande",Error:"Erreur","Error formatting code":"Erreur lors du formatage du code","Error was found":"Une erreur a été trouvée","Every day":"Tous les jours",Exec:kj,"Executes some shell command":"Exécute une commande shell","Existing scripts will be overwritten.":"Les scripts existants seront écrasés.","Expand all":"Développer tout","Expert mode":"Mode expert",Explanation:Cj,Export:Tj,"Export all scripts":"Exporter tous les scripts","Export blocks":"Blocs d'exportation","Export selected blocks":"Exporter les blocs sélectionnés",Februar:Sj,February:Ej,Filter:Ij,Folder:xj,Fr:Dj,Friday:Aj,Function:"Fonction","Function editor":"Éditeur de fonction","Function: executed":"Fonction : exécutée","Go to next line":"Aller à la ligne suivante","HTTP Call":"Appel HTTP","Hide logs":"Masquer les journaux",ID:Oj,ID1:Rj,ID2:Nj,Import:Mj,"Import blocks":"Blocs d'importation","Import error":"Erreur d'importation","Import scripts":"Importer des scripts","Insert object ID":"Insérer un identifiant d'objet",Instance:Lj,"Instance is disabled":"L'instance est désactivée","Instance:":"Exemple:",Instances:Pj,Instructions:Bj,"Invalid CRON":"CRON invalide","It will not be possible to revert this operation.":"Il ne sera pas possible de revenir sur cette opération.","JS description":"Créer des règles en écrivant du Javascript",Januar:Fj,January:jj,July:zj,June:Uj,"Just check":"Vérifiez simplement","Language:":"Langue:","Learn More":"Apprendre encore plus","Light style":"Style de lumière",Limit:Hj,"Local time":"Heure locale","Locate file":"Localiser le fichier","Log outputs":"Journal des sorties","Log text":"Texte du journal","Log: %s":"Log : %s","Make a HTTP get request":"Faire une requête HTTP Get","Make a pause between actions":"Faites une pause entre les actions",March:Wj,"March ":"mars",May:Gj,Menu:Vj,Message:Kj,Mo:Yj,Model:Jj,Monday:qj,Month:Xj,More:Zj,Name:Qj,"No API key found":"Aucune clé API trouvée","No Chat GPT Key found":"Aucune clé GPT de chat trouvée","No active host found":"Aucun hôte actif trouvé","Nothing found":"Rien n'a été trouvé",November:ez,OK:tz,October:sz,Ok:oz,"On condition change":"En cas de changement de condition","On script save or adapter start":"Lors de l'enregistrement du script ou du démarrage de l'adaptateur","On weekdays":"En semaine","Open configuration":"Configuration ouverte","Operate two states":"Opérer deux états","Operations with two states":"Opérations à deux états","Paste your blocks here":"Collez vos blocs ici",Pause:iz,"Pause execution":"Suspendre l'exécution","Pause script":"Script de pause","Phone:":"Téléphone:","Please select object ID...":"Veuillez sélectionner l'ID d'objet ...","Press Ctrl+Enter to get the answer":"Appuyez sur Ctrl+Entrée pour obtenir la réponse","Prettify the script":"Embellir le scénario","Print some text in log":"Imprimer du texte dans le journal","Priority:":"Priorité:",Pushover:nz,Pushsafer:rz,"Read only ID selected: %s":"ID en lecture seule sélectionné: %s",Rename:az,"Reorder scripts in folders":"Réorganiser les scripts dans des dossiers",Repeat:lz,Restart:cz,Result:uz,"Resume execution":"Reprendre l'exécution","Root folder":"Dossier racine","Rules description":"Créer des règles avec des blocs IF, THEN, ELSE","Run script":"Script de lancement",Sa:dz,Saturday:hz,Save:pz,"Save all":"Sauver tous","Say It":"Say It","Say some text via sayit adapter":"Dites du texte via l'adaptateur sayit",Schedule:gz,Script:mz,"Script %s was modified on disk":"Le script %s a été modifié sur le disque","Script is not running":"Le script n'est pas en cours d'exécution","Search in scripts":"Rechercher dans les scripts","Search...":"Chercher...","Select all":"Tout sélectionner","Send email":"Envoyer un e-mail","Sends an email":"Envoie un e-mail","Sends message via Pushsafer":"Envoie un message via Pushsafer","Sends message via pushover":"Envoie un message via pushover","Sends message via telegram":"Envoie un message par télégramme","Sends message via whatsapp-cmb":"Envoie un message via whatsapp-cmb",September:fz,"Server time":"Heure du serveur","Set state action":"Définir l'action de l'état","Set with delay":"Set avec retard","Shell command":"Commande Shell","Show astronomical events":"Afficher les événements astronomiques","Show javascript code":"Afficher le code Javascript","Show logs":"Afficher les journaux","Show only paused scripts":"Afficher uniquement les scripts en pause","Show only running scripts":"Afficher uniquement les scripts en cours d'exécution","Show only scripts with problems":"Afficher uniquement les scripts avec des problèmes",Simulate:$z,"Some files will be rejected":"Certains fichiers seront rejetés","Sound:":"Sonner:",Stack:bz,Start:vz,"Start script":"Lancer le script",State:yz,"State condition":"État condition","Step into function":"Entrez dans la fonction","Step out from function":"Sortez de la fonction","Stop on exception":"Arrêt sur exception",Su:_z,"Subject:":"Sujet:",Sunday:wz,"TS description":"Créer des règles en écrivant des caractères dactylographiés",Telegram:kz,"Text:":"Texte:",Th:Cz,"The script will be stopped and must be activated manually after debugging. Continue?":"Le script sera arrêté et doit être activé manuellement après le débogage. Continuez?","This is advances option. You can write your own code here and it will be executed on trigger":"C'est une option avancée. Vous pouvez écrire votre propre code ici et il sera exécuté au déclenchement",Thursday:Tz,Time:Sz,"Time condition":"Condition de temps","Title:":"Titre:","To:":"À:","Trigger with value":"Déclencheur avec valeur",Triggered:Ez,Triggers:Iz,"Triggers the on script saving or the javascript instance restart":"Déclenche l'enregistrement du script ou le redémarrage de l'instance javascript","Triggers the rule on update or change of some state":"Déclenche la règle sur la mise à jour ou le changement d'un état","Triggers the rule periodically or on some specific time":"Déclenche la règle périodiquement ou à une heure précise",Tu:xz,Tuesday:Dz,URL:Az,"Unknown error":"Erreur inconnue","Unknown error!":"Erreur inconnue!","Use generated code":"Utiliser le code généré","User function":"Fonction utilisateur","User:":"Utilisateur:",Value:Oz,"Vibration:":"Vibration:",Volume:Rz,We:Nz,Wednesday:Mz,"Whatsapp-cmb":"Whatsapp-cmb",Write:Lz,"Write your own code":"Écrivez votre propre code",Yes:Pz,"Yet exists!":"Pourtant existe!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Vous pouvez utiliser %s dans l'URL pour utiliser la valeur de déclenchement actuelle, %id pour utiliser l'ID de l'objet déclenché, %name pour afficher le nom de l'ID de l'objet déclenché ou %old pour utiliser l'ancienne valeur de déclenchement","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Vous pouvez utiliser %s dans la commande pour utiliser la valeur de déclenchement actuelle, %id pour utiliser l'ID de l'objet déclenché, %name pour afficher le nom de l'ID de l'objet déclenché ou %old pour utiliser l'ancienne valeur de déclenchement","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Vous pouvez utiliser %s dans le texte pour afficher la valeur de déclenchement actuelle, %id pour utiliser l'ID de l'objet déclenché, %name pour afficher le nom de l'ID de l'objet déclenché ou %old pour utiliser l'ancienne valeur de déclenchement","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Vous pouvez utiliser %s dans la valeur pour utiliser la valeur de déclenchement actuelle, %id pour utiliser l'ID de l'objet déclenché, %name pour afficher le nom de l'ID de l'objet déclenché ou %old pour utiliser l'ancienne valeur de déclenchement","You have to enter OpenAI API key in the configuration of javascript adapter.":"Vous devez entrer la clé API OpenAI dans la configuration de l'adaptateur javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Vous devez entrer au moins une clé API (OpenAI, Anthropic ou Gemini) dans la configuration de l'adaptateur javascript.","Please select a valid model":"Veuillez sélectionner un modèle valide","[equal]":"[égal]","[greater or equal]":"[supérieur ou égal]","[greater]":"[plus grand]","[hysteresis]":"[hystérèse]","[includes]":"[comprend]","[less or equal]":"[inférieur ou égal]","[less]":"[moins]","[not equal]":"[inégal]",acknowledgment:Bz,all:Fz,and:jz,"as JSON":"en JSON","as plain text":"en texte brut",astro:zz,at:Uz,"clear running":"course claire",control:Hz,copy:Wz,cron:Gz,dawn:Vz,debug_help:Kz,debug_label:Yz,default:"défaut",dusk:Jz,easy:qz,else:"autre","equal to":"égal à",every:Xz,"every hour at 0 minutes":"toutes les heures à 0 minute",false:"faux","file reading has failed: %s":"La lecture du fichier a échoué: %s","file reading was aborted":"la lecture du fichier a été abandonnée",filter_func:Zz,filter_id:Qz,filter_name:eU,filter_role:tU,filter_room:sU,"for edit or create script":"pour éditer ou créer un nouveau script","for professionals":"pour les professionnels","for programmers":"pour les programmeurs",goldenHour:oU,goldenHourEnd:iU,"greater or equal":"supérieur ou égal","greater or equal to":"supérieur ou égal à","greater than":"plus grand que",help_just_check:nU,help_on_change:rU,"high priority":"haute priorité","high-priority":"haute priorité","highest priority":"priorité la plus élevée",hours:aU,includes:lU,interval:cU,"just check":"Vérifiez simplement","less or equal":"inférieur ou égal","less or equal to":"inférieur ou égal à","less than":"moins que","lower priority":"priorité inférieure","lowest priority":"priorité la plus basse",magic:uU,milliseconds:dU,minutes:hU,ms:pU,nadir:gU,nauticalDawn:mU,nauticalDusk:fU,nextSunrise:$U,nextSunset:bU,night:vU,nightEnd:yU,"no blocks found":"Aucun bloc trouvé","no group":"PAS DE GROUPE",normal:_U,"normal priority":"priorité normale","not equal to":"pas égal à","not properly connected":"Ce bloc n'est pas correctement connecté à d'autres blocs.",offset:wU,"on change":"sur le changement","on condition change":"sur changement de condition","on update":"sur mise à jour",one:kU,or:CU,quiet:TU,"reset search":"Réinitialiser la recherche",search:SU,seconds:EU,solarNoon:IU,"store in":"stocker dans",sunrise:xU,sunriseEnd:DU,sunset:AU,sunsetStart:OU,then:RU,"toggle value":"valeur de bascule",tooltip_ack:NU,tooltip_from:MU,tooltip_lc:LU,tooltip_quality:PU,tooltip_ts:BU,tooltip_user:FU,tooltip_value:jU,true:"vrai",two:zU,undefined:"indéfini",update:UU,"use seconds":"utiliser les secondes","use trigger value":"use trigger value",verbose_help:HU,verbose_label:WU,when:GU,with:"avec","with date":"avec date","with offset":"avec offset",wizard:VU,"Loading models...":"Chargement des modèles...","Could not connect to API at %s":"Impossible de se connecter à l'API sur %s","Invalid API key":"Clé API invalide","Access denied by API":"Accès refusé par l'API","API error: %s":"Erreur API : %s",'Model "%s" not found':'Modèle "%s" introuvable',"Request failed: %s":"Requête échouée : %s",Retry:KU,"No running javascript instance found":"Aucune instance JavaScript en cours d'exécution trouvée"},JU="Riconosciuto",qU="Azioni",XU="Inserisci",ZU="Tutti",QU="Qualunque",eH="Applica",tH="aprile",sH="Chiedere",oH="Astronomico",iH="agosto",nH="Annulla",rH="Vicino",aH="Condizione",lH="Condizioni",cH="Console",uH="Copiato",dH="dicembre",hH="Predefinito",pH="Ritardo",gH="Elimina",mH="Descrizione",fH="Fatto",$H="Execshell",bH="Spiegazione",vH="Esportare",yH="Februar",_H="febbraio",wH="Filtro",kH="Cartella",CH="P",TH="Venerdì",SH="ID",EH="ID1",IH="ID2",xH="Importare",DH="Esempio",AH="istanze",OH="Istruzioni",RH="Januar",NH="gennaio",MH="luglio",LH="giugno",PH="Limite",BH="marzo",FH="Maggio",jH="Menu",zH="Messaggio",UH="Mo",HH="Modello",WH="Lunedi",GH="Mese",VH="Di più",KH="Nome",YH="novembre",JH="OK",qH="ottobre",XH="Ok",ZH="Pausa",QH="Pushover",eW="Pushsafer",tW="Rinominare",sW="Ripetere",oW="Ricomincia",iW="Risultato",nW="Sa",rW="Sabato",aW="Salva",lW="Programma",cW="copione",uW="settembre",dW="Simulare",hW="Stack",pW="Cominciare",gW="Stato",mW="Su",fW="Domenica",$W="Telegramma",bW="4",vW="giovedi",yW="Tempo",_W="Innescato",wW="Trigger",kW="Tu",CW="martedì",TW="URL",SW="Valore",EW="Volume",IW="3",xW="mercoledì",DW="Scrivi",AW="sì",OW="riconoscimento",RW="tutti",NW="e",MW="astro",LW="a",PW="controllo",BW="copia",FW="CRON",jW="alba",zW="Questa è una modalità speciale in cui gli stati e gli oggetti non cambieranno. Ma nel protocollo verranno visualizzate solo le informazioni su ogni modifica pianificata.",UW="Debug",HW="crepuscolo",WW="facile",GW="ogni",VW="Funzione",KW="ID",YW="Nome",JW="Ruolo",qW="Camera",XW="Ora d'oro",ZW="Fine dell'ora d'oro",QW='Il codice verrà eseguito solo ogni volta che la condizione è vera. Per esempio. se si attiva il valore del sensore di temperatura e la condizione è "se la temperatura è maggiore di 20 ° C", le azioni "allora" verranno eseguite ogni volta che il sensore invia la temperatura e questa è superiore a 20 ° C. Di 21 ° C, di 22 ° C e così via.',e5='Il codice verrà eseguito solo se il risultato della condizione cambia. Per esempio. se si attiva il valore del sensore di temperatura e la condizione è "se la temperatura è maggiore di 20 ° C", le azioni "allora" verranno eseguite una volta quando la temperatura è superiore a 20. La prossima volta le azioni "allora" verranno eseguite quando la temperatura fallisce sotto 20 e poi sale di nuovo oltre 20.',t5="ore",s5="include",o5="intervallo",i5="Magia",n5="millisecondi",r5="minuti",a5="ms",l5="nadir",c5="Alba nautica",u5="Crepuscolo nautico",d5="Prossima alba",h5="Prossimo tramonto",p5="Notte",g5="Fine della notte",m5="normale",f5="compensare",$5="uno",b5="o",v5="silenzioso",y5="ricerca",_5="secondi",w5="Mezzogiorno solare",k5="Alba",C5="Fine dell'alba",T5="tramonto",S5="Inizio del tramonto",E5="poi",I5="Riconoscere",x5="A partire dal",D5="Ultima modifica",A5="Qualità",O5="timestamp",R5="Utente",N5="Valore",M5="Due",L5="aggiornare",P5="Aggiunge l'output di debug al registro per molti comandi di sistema",B5="Output di log dettagliati",F5="quando",j5="procedura guidata",z5="Riprova",U5={"%s not found":"%s non trovato","()":"()","(at %s)":"(a %s)","(optional)":"(opzionale)","-":"-",".":".","AI code generator":"Generatore di codice AI",Ack:JU,Actions:qU,"Actual time of day":"Ora effettiva della giornata",Add:XU,"Add new script":"Aggiungi nuovo script",All:ZU,"All files will be accepted":"Tutti i file saranno accettati",Any:QU,"Any month":"Ogni mese",Apply:eH,April:tH,"Are you sure?":"Sei sicuro?",Ask:sH,Astronomical:oH,"Astronomical events today":"Eventi astronomici oggi",August:iH,"Blockly description":"Creazione di regole tramite blocchi grafici","Body:":"Corpo:",Cancel:nH,"Cannot delete non empty item!":"Impossibile eliminare l'elemento non vuoto!","Change layout":"Cambia layout",'Change theme (actual "%s")':'Cambia tema (ora - "%s")',"Check blocks":"Controlla i blocchi","Check is not active, because javascript adapter is disabled":"Il controllo non è attivo perché l'adattatore Javascript è disabilitato","Clear search input":"Cancella input di ricerca","Click on this icon":"Clicca su questa icona",Close:rH,"Close all but current":"Chiudi tutto tranne corrente","Collapse all":"Comprimi tutto","Compares current time with astronomical event":"Confronta l'ora corrente con l'evento astronomico","Compares current time with the user specific time":"Confronta l'ora corrente con l'ora specifica dell'utente","Compares the state value with user defined value":"Confronta il valore dello stato con il valore definito dall'utente",Condition:aH,Conditions:lH,"Configuration not saved.":"Configurazione non salvata.",Console:cH,"Control or update some state":"Controlla o aggiorna uno stato","Control or update some state with delay":"Controlla o aggiorna uno stato con ritardo","Convert blockly to javascript for ever.":"Converti istantaneamente a blocchi in Javascript.",Copied:uH,"Copy script":"Copia script","Copy to clipboard":"Copia negli appunti","Create new":"Creare nuovo","Create new folder":"Crea una nuova cartella","Create new script":"Crea nuovo script","Create or edit CRON or time wizard":"Crea o modifica la procedura guidata CRON o time","Dark Theme":"Tema scuro","Dark style":"Stile scuro",Date:"Data","Debug instance":"Istanza di debug","Debug options":"Opzioni di debug",December:dH,Default:hH,"Define cron...":"Definisci cron ...","Define schedule...":"Definisci programma ...",Delay:pH,Delete:gH,"Delete %s":"Elimina %s ...","Delete folder":"Elimina cartella","Delete script":"Elimina script",Description:mH,"Deselect all":"Deselezionare tutto","Discard changes for %s":"Annulla modifiche per %s",Done:fH,"Double click to write value":"Doppio clic per scrivere il valore","Download as file":"Scarica come file","Drop some files here or click...":"Trascina alcuni file qui o fai clic su ...","Duplicate name":"Nome duplicato","Edit script or just double click":"Modifica lo script o fai doppio clic","Empty name is not allowed":"Il nome vuoto non è consentito","End search mode":"Termina la modalità di ricerca","Enter your question":"Inserisci la tua richiesta",Error:"Errore","Error formatting code":"Errore di formattazione del codice","Error was found":"Errore trovato","Every day":"Ogni giorno",Exec:$H,"Executes some shell command":"Esegue alcuni comandi della shell","Existing scripts will be overwritten.":"Gli script esistenti verranno sovrascritti.","Expand all":"Espandi tutto","Expert mode":"Modalità esperto",Explanation:bH,Export:vH,"Export all scripts":"Esporta tutti gli script","Export blocks":"Esporta blocchi","Export selected blocks":"Esporta i blocchi selezionati",Februar:yH,February:_H,Filter:wH,Folder:kH,Fr:CH,Friday:TH,Function:"Funzione","Function editor":"Editor di funzioni","Function: executed":"Funzione: eseguita","Go to next line":"Vai alla riga successiva","HTTP Call":"Chiamata HTTP","Hide logs":"Nascondi i registri",ID:SH,ID1:EH,ID2:IH,Import:xH,"Import blocks":"Importa blocchi","Import error":"Errore di importazione","Import scripts":"Importa script","Insert object ID":"Inserisci l'ID oggetto",Instance:DH,"Instance is disabled":"L'istanza è disabilitata","Instance:":"Esempio:",Instances:AH,Instructions:OH,"Invalid CRON":"CRON non valido","It will not be possible to revert this operation.":"Non sarà possibile ripristinare questa operazione.","JS description":"Creare regole scrivendo Javascript",Januar:RH,January:NH,July:MH,June:LH,"Just check":"Controlla solamente","Language:":"Linguaggio:","Learn More":"Per saperne di più","Light style":"Stile leggero",Limit:PH,"Local time":"Ora locale","Locate file":"Localizza file","Log outputs":"Registra le uscite","Log text":"Testo del registro","Log: %s":"Log: %s","Make a HTTP get request":"Effettua una richiesta get HTTP","Make a pause between actions":"Fai una pausa tra le azioni",March:BH,"March ":"marzo",May:FH,Menu:jH,Message:zH,Mo:UH,Model:HH,Monday:WH,Month:GH,More:VH,Name:KH,"No API key found":"Nessuna chiave API trovata","No Chat GPT Key found":"Nessuna chiave GPT chat trovata","No active host found":"Nessun host attivo trovato","Nothing found":"Non abbiamo trovato nulla",November:YH,OK:JH,October:qH,Ok:XH,"On condition change":"A condizione che cambino","On script save or adapter start":"Al salvataggio dello script o all'avvio dell'adattatore","On weekdays":"Nei giorni della settimana","Open configuration":"Configurazione aperta","Operate two states":"Gestisci due stati","Operations with two states":"Operazioni con due stati","Paste your blocks here":"Incolla qui i tuoi blocchi",Pause:ZH,"Pause execution":"Metti in pausa l'esecuzione","Pause script":"Metti in pausa lo script","Phone:":"Telefono:","Please select object ID...":"Seleziona l'ID oggetto ...","Press Ctrl+Enter to get the answer":"Premi Ctrl+Invio per ottenere la risposta","Prettify the script":"Abbellire la sceneggiatura","Print some text in log":"Stampa del testo nel registro","Priority:":"Priorità:",Pushover:QH,Pushsafer:eW,"Read only ID selected: %s":"ID di sola lettura selezionato: %s",Rename:tW,"Reorder scripts in folders":"Riordina gli script nelle cartelle",Repeat:sW,Restart:oW,Result:iW,"Resume execution":"Riprendi esecuzione","Root folder":"Cartella root","Rules description":"Crea regole con i blocchi IF, THEN, ELSE","Run script":"Esegui script",Sa:nW,Saturday:rW,Save:aW,"Save all":"Salva tutto","Say It":"Say It","Say some text via sayit adapter":"Pronuncia del testo tramite l'adattatore sayit",Schedule:lW,Script:cW,"Script %s was modified on disk":"Lo script %s è stato modificato sul disco","Script is not running":"Lo script non è in esecuzione","Search in scripts":"Cerca negli script","Search...":"Ricerca...","Select all":"Seleziona tutto","Send email":"Invia una email","Sends an email":"Invia un'e-mail","Sends message via Pushsafer":"Invia messaggio tramite Pushsafer","Sends message via pushover":"Invia messaggio tramite pushover","Sends message via telegram":"Invia messaggio tramite telegramma","Sends message via whatsapp-cmb":"Invia messaggio tramite whatsapp-cmb",September:uW,"Server time":"Ora del server","Set state action":"Imposta l'azione dello stato","Set with delay":"Impostato con ritardo","Shell command":"Comando Shell","Show astronomical events":"Mostra eventi astronomici","Show javascript code":"Mostra codice Javascript","Show logs":"Mostra i log","Show only paused scripts":"Mostra solo script in pausa","Show only running scripts":"Mostra solo gli script in esecuzione","Show only scripts with problems":"Mostra solo script con problemi",Simulate:dW,"Some files will be rejected":"Alcuni file verranno rifiutati","Sound:":"Suono:",Stack:hW,Start:pW,"Start script":"Avvia script",State:gW,"State condition":"Condizione dello stato","Step into function":"Entra in funzione","Step out from function":"Esci dalla funzione","Stop on exception":"Ferma in caso di eccezione",Su:mW,"Subject:":"Soggetto:",Sunday:fW,"TS description":"Creare regole scrivendo dattiloscritto",Telegram:$W,"Text:":"Testo:",Th:bW,"The script will be stopped and must be activated manually after debugging. Continue?":"Lo script verrà interrotto e dovrà essere attivato manualmente dopo il debug. Continua?","This is advances option. You can write your own code here and it will be executed on trigger":"Questa è un'opzione anticipata. Puoi scrivere il tuo codice qui e verrà eseguito al trigger",Thursday:vW,Time:yW,"Time condition":"Condizione temporale","Title:":"Titolo:","To:":"Per:","Trigger with value":"Trigger con valore",Triggered:_W,Triggers:wW,"Triggers the on script saving or the javascript instance restart":"Attiva il salvataggio dello script o il riavvio dell'istanza javascript","Triggers the rule on update or change of some state":"Attiva la regola in caso di aggiornamento o modifica di uno stato","Triggers the rule periodically or on some specific time":"Attiva la regola periodicamente o in un momento specifico",Tu:kW,Tuesday:CW,URL:TW,"Unknown error":"Errore sconosciuto","Unknown error!":"Errore sconosciuto!","Use generated code":"Usa il codice generato","User function":"Funzione utente","User:":"Utente:",Value:SW,"Vibration:":"Vibrazione:",Volume:EW,We:IW,Wednesday:xW,"Whatsapp-cmb":"Whatsapp-cmb",Write:DW,"Write your own code":"Scrivi il tuo codice",Yes:AW,"Yet exists!":"Esiste ancora!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"È possibile utilizzare %s nell'URL per utilizzare il valore di trigger corrente, %id per utilizzare l'ID dell'oggetto attivato, %name per mostrare il nome dell'ID dell'oggetto attivato o %old per utilizzare il vecchio valore di trigger","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"È possibile utilizzare %s nel comando per utilizzare il valore di trigger corrente, %id per utilizzare l'ID dell'oggetto attivato, %name per mostrare il nome dell'ID dell'oggetto attivato o %old per utilizzare il vecchio valore di trigger","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"È possibile utilizzare %s nel testo per visualizzare il valore di trigger corrente, %id per utilizzare l'ID dell'oggetto attivato, %name per mostrare il nome dell'ID dell'oggetto attivato o %old per utilizzare il vecchio valore di trigger","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"È possibile utilizzare %s nel valore per utilizzare il valore di trigger corrente, %id per utilizzare l'ID dell'oggetto attivato, %name per mostrare il nome dell'ID dell'oggetto attivato o %old per utilizzare il vecchio valore di trigger","You have to enter OpenAI API key in the configuration of javascript adapter.":"Devi inserire la chiave API OpenAI nella configurazione dell'adattatore javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Devi inserire almeno una chiave API (OpenAI, Anthropic o Gemini) nella configurazione dell'adattatore javascript.","Please select a valid model":"Seleziona un modello valido","[equal]":"[pari]","[greater or equal]":"[maggiore o uguale]","[greater]":"[maggiore]","[hysteresis]":"[isteresi]","[includes]":"[include]","[less or equal]":"[minore o uguale]","[less]":"[Di meno]","[not equal]":"[non uguale]",acknowledgment:OW,all:RW,and:NW,"as JSON":"come JSON","as plain text":"come testo",astro:MW,at:LW,"clear running":"chiara esecuzione",control:PW,copy:BW,cron:FW,dawn:jW,debug_help:zW,debug_label:UW,default:"predefinito",dusk:HW,easy:WW,else:"altro","equal to":"uguale a",every:GW,"every hour at 0 minutes":"ogni ora a 0 minuti",false:"falso","file reading has failed: %s":"lettura file non riuscita: %s","file reading was aborted":"la lettura del file è stata interrotta",filter_func:VW,filter_id:KW,filter_name:YW,filter_role:JW,filter_room:qW,"for edit or create script":"per modificare o creare un nuovo script","for professionals":"per i professionisti","for programmers":"per i programmatori",goldenHour:XW,goldenHourEnd:ZW,"greater or equal":"maggiore o uguale","greater or equal to":"maggiore o uguale a","greater than":"più grande di",help_just_check:QW,help_on_change:e5,"high priority":"priorità alta","high-priority":"priorità alta","highest priority":"massima priorità",hours:t5,includes:s5,interval:o5,"just check":"controlla solamente","less or equal":"inferiore o uguale","less or equal to":"minore o uguale a","less than":"meno di","lower priority":"priorità inferiore","lowest priority":"priorità più bassa",magic:i5,milliseconds:n5,minutes:r5,ms:a5,nadir:l5,nauticalDawn:c5,nauticalDusk:u5,nextSunrise:d5,nextSunset:h5,night:p5,nightEnd:g5,"no blocks found":"Nessun blocco trovato","no group":"NESSUN GRUPPO",normal:m5,"normal priority":"priorità normale","not equal to":"non uguale a","not properly connected":"Questo blocco non è correttamente collegato ad altri blocchi.",offset:f5,"on change":"sul cambiamento","on condition change":"a cambio di condizione","on update":"in aggiornamento",one:$5,or:b5,quiet:v5,"reset search":"resetta la ricerca",search:y5,seconds:_5,solarNoon:w5,"store in":"conservare in",sunrise:k5,sunriseEnd:C5,sunset:T5,sunsetStart:S5,then:E5,"toggle value":"alterna valore",tooltip_ack:I5,tooltip_from:x5,tooltip_lc:D5,tooltip_quality:A5,tooltip_ts:O5,tooltip_user:R5,tooltip_value:N5,true:"vero",two:M5,undefined:"non definito",update:L5,"use seconds":"usa i secondi","use trigger value":"usa il trigger",verbose_help:P5,verbose_label:B5,when:F5,with:"con","with date":"con data","with offset":"con offset",wizard:j5,"Loading models...":"Caricamento modelli...","Could not connect to API at %s":"Impossibile connettersi all'API su %s","Invalid API key":"Chiave API non valida","Access denied by API":"Accesso negato dall'API","API error: %s":"Errore API: %s",'Model "%s" not found':'Modello "%s" non trovato',"Request failed: %s":"Richiesta fallita: %s",Retry:z5,"No running javascript instance found":"Nessuna istanza JavaScript in esecuzione trovata"},H5="Erkend",W5="Acties",G5="Toevoegen",V5="Alle",K5="Ieder",Y5="Solliciteer",J5="april",q5="Vragen",X5="Astronomisch",Z5="augustus",Q5="annuleren",e3="Dichtbij",t3="Staat",s3="Voorwaarden",o3="Troosten",i3="Gekopieerd",n3="december",r3="Standaard",a3="Vertraging",l3="Verwijder",c3="Beschrijving",u3="Gedaan",d3="Exec shell",h3="Uitleg",p3="Exporteren",g3="Februari",m3="februari",f3="Filter",$3="Map",b3="Vr",v3="vrijdag",y3="ID kaart",_3="ID1",w3="ID2",k3="Importeren",C3="Voorbeeld",T3="Instanties",S3="Instructies",E3="Januar",I3="januari",x3="juli",D3="juni",A3="Begrenzing",O3="maart",R3="mei",N3="Menu",M3="Bericht",L3="Ma",P3="Model",B3="maandag",F3="Maand",j3="Meer",z3="Naam",U3="november",H3="OK",W3="oktober",G3="OK",V3="Pauze",K3="Pushover",Y3="Duwijzer",J3="andere naam geven",q3="Herhaling",X3="Herstarten",Z3="Resultaat",Q3="Za",eG="zaterdag",tG="Opslaan",sG="Schema",oG="Script",iG="september",nG="Simuleren",rG="Stack",aG="Begin",lG="Staat",cG="Zo",uG="zondag",dG="Telegram",hG="4",pG="donderdag",gG="Tijd",mG="Veroorzaakt",fG="Triggers",$G="Di",bG="dinsdag",vG="URL",yG="Waarde",_G="Volume",wG="3",kG="woensdag",CG="Schrijven",TG="Ja",SG="erkenning",EG="alle",IG="en",xG="astro",DG="Bij",AG="controle",OG="kopiëren",RG="cron",NG="dageraad",MG="Dit is een speciale modus waarin toestanden en objecten niet veranderen. Maar alleen informatie over elke geplande wijziging wordt in het protocol weergegeven.",LG="Debuggen",PG="schemer",BG="eenvoudig",FG="elke",jG="Functie",zG="ID kaart",UG="Naam",HG="Rol",WG="Kamer",GG="gouden uur",VG="Einde van gouden uur",KG='De code wordt alleen uitgevoerd als de voorwaarde waar is. Bijv. als het triggeren op de temperatuursensorwaarde en de conditie is "als de temperatuur hoger is dan 20 ° C", zullen de "dan" acties worden uitgevoerd elke keer dat de sensor de temperatuur verzendt en deze hoger is dan 20 ° C. Bij 21 ° C, bij 22 ° C enzovoort.',YG='De code wordt alleen uitgevoerd als het conditieresultaat verandert. Bijv. als de temperatuursensor wordt geactiveerd en de conditie is "als de temperatuur hoger is dan 20 ° C", worden de "dan" -acties eenmaal uitgevoerd wanneer de temperatuur hoger is dan 20. De volgende keer worden de "dan" -acties uitgevoerd wanneer de temperatuur faalt onder de 20 en stijgt dan weer boven de 20.',JG="uren",qG="omvat",XG="interval",ZG="magie",QG="milliseconden",eV="minuten",tV="ms",sV="nadir",oV="Nautische dageraad",iV="Nautische schemering",nV="Volgende zonsopgang",rV="Volgende zonsondergang",aV="nacht",lV="Einde van de nacht",cV="normaal",uV="compensatie",dV="een",hV="of",pV="stil",gV="zoeken",mV="seconden",fV="Zonne-middag",$V="zonsopkomst",bV="Einde zonsopgang",vV="zonsondergang",yV="Begin van de zonsondergang",_V="vervolgens",wV="Erkennen",kV="Van",CV="Laatst gewijzigd",TV="Kwaliteit",SV="tijdstempel",EV="Gebruiker",IV="Waarde",xV="twee",DV="bijwerken",AV="Voegt foutopsporingsuitvoer toe aan het logboek voor veel systeemopdrachten",OV="Uitgebreide log-uitgangen",RV="wanneer",NV="tovenaar",MV="Opnieuw proberen",LV={"%s not found":"%s niet gevonden","()":"()","(at %s)":"(op %s)","(optional)":"(optioneel)","-":"-",".":".","AI code generator":"AI-codegenerator",Ack:H5,Actions:W5,"Actual time of day":"Werkelijke tijd van de dag",Add:G5,"Add new script":"Nieuw script toevoegen",All:V5,"All files will be accepted":"Alle bestanden worden geaccepteerd",Any:K5,"Any month":"Elke maand",Apply:Y5,April:J5,"Are you sure?":"Weet je zeker dat?",Ask:q5,Astronomical:X5,"Astronomical events today":"Astronomische gebeurtenissen vandaag",August:Z5,"Blockly description":"Regels maken door grafische blokken","Body:":"Lichaam:",Cancel:Q5,"Cannot delete non empty item!":"Kan niet leeg item niet verwijderen!","Change layout":"Opmaak veranderen",'Change theme (actual "%s")':'Thema wijzigen (nu - "%s")',"Check blocks":"Controleer blokken","Check is not active, because javascript adapter is disabled":"Controle is niet actief, omdat Javascript-adapter is uitgeschakeld","Clear search input":"Zoekopdracht wissen","Click on this icon":"Klik op dit pictogram",Close:e3,"Close all but current":"Alles sluiten behalve huidig","Collapse all":"Alles inklappen","Compares current time with astronomical event":"Vergelijkt huidige tijd met astronomische gebeurtenis","Compares current time with the user specific time":"Vergelijkt de huidige tijd met de gebruikerspecifieke tijd","Compares the state value with user defined value":"Vergelijkt de statuswaarde met de door de gebruiker gedefinieerde waarde",Condition:t3,Conditions:s3,"Configuration not saved.":"Configuratie niet opgeslagen.",Console:o3,"Control or update some state":"Beheer of update een bepaalde staat","Control or update some state with delay":"Beheer of update een bepaalde staat met vertraging","Convert blockly to javascript for ever.":"Converteer direct blockly naar Javascript.",Copied:i3,"Copy script":"Kopieer script","Copy to clipboard":"Kopieer naar klembord","Create new":"Maak nieuw","Create new folder":"Maak een nieuwe map","Create new script":"Maak een nieuw script","Create or edit CRON or time wizard":"Creëer of bewerk CRON of tijdwizard","Dark Theme":"Donker thema","Dark style":"Donkere stijl",Date:"Datum","Debug instance":"Debug-instantie","Debug options":"Foutopsporingsopties",December:n3,Default:r3,"Define cron...":"Definieer cron ...","Define schedule...":"Definieer schema ...",Delay:a3,Delete:l3,"Delete %s":"%s verwijderen ...","Delete folder":"Verwijder map","Delete script":"Script verwijderen",Description:c3,"Deselect all":"Deselecteer alles","Discard changes for %s":"Wijzigingen voor %s annuleren",Done:u3,"Double click to write value":"Dubbelklikken om waarde te schrijven","Download as file":"Download","Drop some files here or click...":"Zet hier enkele bestanden neer of klik op ...","Duplicate name":"Dubbele naam","Edit script or just double click":"Bewerk het script of dubbelklik erop","Empty name is not allowed":"Lege naam is niet toegestaan","End search mode":"Zoekmodus beëindigen","Enter your question":"Voer uw verzoek in",Error:"Fout","Error formatting code":"Fout bij het opmaken van de code","Error was found":"Er is een fout gevonden","Every day":"Elke dag",Exec:d3,"Executes some shell command":"Voert een shell-commando uit","Existing scripts will be overwritten.":"Bestaande scripts worden overschreven.","Expand all":"Alles uitvouwen","Expert mode":"Expert modus",Explanation:h3,Export:p3,"Export all scripts":"Exporteer alle scripts","Export blocks":"Blokken exporteren","Export selected blocks":"Exporteer geselecteerde blokken",Februar:g3,February:m3,Filter:f3,Folder:$3,Fr:b3,Friday:v3,Function:"Functie","Function editor":"Functie-editor","Function: executed":"Functie: uitgevoerd","Go to next line":"Ga naar de volgende regel","HTTP Call":"HTTP-oproep","Hide logs":"Verberg logboeken",ID:y3,ID1:_3,ID2:w3,Import:k3,"Import blocks":"Blokken importeren","Import error":"Importfout","Import scripts":"Scripts importeren","Insert object ID":"Object-ID invoegen",Instance:C3,"Instance is disabled":"Exemplaar is uitgeschakeld","Instance:":"Voorbeeld:",Instances:T3,Instructions:S3,"Invalid CRON":"Ongeldige CRON","It will not be possible to revert this operation.":"Het is niet mogelijk om deze bewerking terug te zetten.","JS description":"Regels maken door Javascript te schrijven",Januar:E3,January:I3,July:x3,June:D3,"Just check":"Kijk maar","Language:":"Taal:","Learn More":"Leer meer","Light style":"Lichte stijl",Limit:A3,"Local time":"Lokale tijd","Locate file":"Vind het bestand","Log outputs":"Log uitgangen","Log text":"Log tekst","Log: %s":"Logboek: %s","Make a HTTP get request":"Maak een HTTP-ophaalverzoek","Make a pause between actions":"Pauzeer tussen acties",March:O3,"March ":"maart",May:R3,Menu:N3,Message:M3,Mo:L3,Model:P3,Monday:B3,Month:F3,More:j3,Name:z3,"No API key found":"Geen API-sleutel gevonden","No Chat GPT Key found":"Geen Chat GPT-sleutel gevonden","No active host found":"Geen actieve host gevonden","Nothing found":"Niets gevonden",November:U3,OK:H3,October:W3,Ok:G3,"On condition change":"Op voorwaarde verandering","On script save or adapter start":"Bij het opslaan van het script of het starten van de adapter","On weekdays":"Op weekdagen","Open configuration":"Configuratie openen","Operate two states":"Bedien twee toestanden:","Operations with two states":"Bewerkingen met twee toestanden","Paste your blocks here":"Plak hier je blokken",Pause:V3,"Pause execution":"Uitvoering pauzeren","Pause script":"Pauzeer script","Phone:":"Telefoon:","Please select object ID...":"Selecteer object-ID ...","Press Ctrl+Enter to get the answer":"Druk op Ctrl+Enter om het antwoord te krijgen","Prettify the script":"Maak het script mooier","Print some text in log":"Druk wat tekst af in het logboek","Priority:":"Prioriteit:",Pushover:K3,Pushsafer:Y3,"Read only ID selected: %s":"Alleen-lezen ID geselecteerd: %s",Rename:J3,"Reorder scripts in folders":"Sorteer scripts in mappen opnieuw",Repeat:q3,Restart:X3,Result:Z3,"Resume execution":"Uitvoering hervatten","Root folder":"Hoofdmap","Rules description":"Maak regels met IF, THEN, ELSE blokken","Run script":"Voer script uit",Sa:Q3,Saturday:eG,Save:tG,"Save all":"Sla alles op","Say It":"Say It","Say some text via sayit adapter":"Zeg wat tekst via de sayit-adapter",Schedule:sG,Script:oG,"Script %s was modified on disk":"Script %s is gewijzigd op schijf","Script is not running":"Script is niet actief","Search in scripts":"Zoeken in scripts","Search...":"Zoeken...","Select all":"Selecteer alles","Send email":"E-mail verzenden","Sends an email":"Stuurt een e-mail","Sends message via Pushsafer":"Stuurt bericht via Pushsafer","Sends message via pushover":"Stuurt bericht via pushover","Sends message via telegram":"Verzendt bericht via telegram","Sends message via whatsapp-cmb":"Stuurt bericht via whatsapp-cmb",September:iG,"Server time":"Servertijd","Set state action":"Stel statusactie in","Set with delay":"Met vertraging ingesteld","Shell command":"Shell-opdracht","Show astronomical events":"Laat astronomische gebeurtenissen zien","Show javascript code":"Javascript-code weergeven","Show logs":"Toon logboeken","Show only paused scripts":"Toon alleen onderbroken scripts","Show only running scripts":"Toon alleen actieve scripts","Show only scripts with problems":"Toon alleen scripts met problemen",Simulate:nG,"Some files will be rejected":"Sommige bestanden worden geweigerd","Sound:":"Geluid:",Stack:rG,Start:aG,"Start script":"Start het script",State:lG,"State condition":"Staat staat","Step into function":"Stap in functie","Step out from function":"Stap uit de functie","Stop on exception":"Stop bij uitzondering",Su:cG,"Subject:":"Onderwerpen:",Sunday:uG,"TS description":"Regels maken door Typescript te schrijven",Telegram:dG,"Text:":"Tekst:",Th:hG,"The script will be stopped and must be activated manually after debugging. Continue?":"Het script wordt gestopt en moet na het debuggen handmatig worden geactiveerd. Doorgaan met?","This is advances option. You can write your own code here and it will be executed on trigger":"Dit is een voorschotoptie. U kunt hier uw eigen code schrijven en deze wordt bij een trigger uitgevoerd",Thursday:pG,Time:gG,"Time condition":"Tijdsvoorwaarde","Title:":"Titel:","To:":"Naar:","Trigger with value":"Trigger met waarde",Triggered:mG,Triggers:fG,"Triggers the on script saving or the javascript instance restart":"Activeert het opslaan van het script of het opnieuw opstarten van de JavaScript-instantie","Triggers the rule on update or change of some state":"Activeert de regel voor het bijwerken of wijzigen van een bepaalde staat","Triggers the rule periodically or on some specific time":"Activeert de regel periodiek of op een specifieke tijd",Tu:$G,Tuesday:bG,URL:vG,"Unknown error":"Onbekende fout","Unknown error!":"Onbekende fout!","Use generated code":"Gebruik gegenereerde code","User function":"Gebruikersfunctie","User:":"Gebruiker:",Value:yG,"Vibration:":"Trilling:",Volume:_G,We:wG,Wednesday:kG,"Whatsapp-cmb":"Whatsapp-cmb",Write:CG,"Write your own code":"Schrijf je eigen code",Yes:TG,"Yet exists!":"Toch bestaat!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"U kunt %s in de URL gebruiken om de huidige triggerwaarde te gebruiken, %id om de geactiveerde object-ID te gebruiken, %name om de geactiveerde object-ID-naam te tonen of %old om de oude triggerwaarde te gebruiken","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"U kunt %s in de opdracht gebruiken om de huidige triggerwaarde te gebruiken, %id om de getriggerde object-ID te gebruiken, %name om de getriggerde object-ID-naam te tonen of %old om de oude triggerwaarde te gebruiken","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"U kunt %s in de tekst gebruiken om de huidige triggerwaarde weer te geven, %id om de geactiveerde object-ID te gebruiken, %name om de geactiveerde object-ID-naam weer te geven of %old om de oude triggerwaarde te gebruiken","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"U kunt %s in de waarde gebruiken om de huidige triggerwaarde te gebruiken, %id om de geactiveerde object-ID te gebruiken, %name om de geactiveerde object-ID-naam te tonen of %old om de oude triggerwaarde te gebruiken","You have to enter OpenAI API key in the configuration of javascript adapter.":"U moet de OpenAI API-sleutel invoeren in de configuratie van de javascript-adapter.","You have to enter at least one API key in the configuration of javascript adapter.":"U moet ten minste één API-sleutel (OpenAI, Anthropic of Gemini) invoeren in de configuratie van de javascript-adapter.","Please select a valid model":"Selecteer een geldig model","[equal]":"[Gelijk]","[greater or equal]":"[groter of gelijk]","[greater]":"[groter]","[hysteresis]":"[hysterese]","[includes]":"[inclusief]","[less or equal]":"[minder of gelijk]","[less]":"[minder]","[not equal]":"[niet gelijk]",acknowledgment:SG,all:EG,and:IG,"as JSON":"als JSON","as plain text":"als platte tekst",astro:xG,at:DG,"clear running":"duidelijk rennen",control:AG,copy:OG,cron:RG,dawn:NG,debug_help:MG,debug_label:LG,default:"standaard",dusk:PG,easy:BG,else:"anders","equal to":"gelijk aan",every:FG,"every hour at 0 minutes":"elk uur op 0 minuten",false:"false","file reading has failed: %s":"bestands lezen is mislukt: %s","file reading was aborted":"bestands lezen is afgebroken",filter_func:jG,filter_id:zG,filter_name:UG,filter_role:HG,filter_room:WG,"for edit or create script":"voor bewerken of een nieuw script maken","for professionals":"voor professionals","for programmers":"voor programmeurs",goldenHour:GG,goldenHourEnd:VG,"greater or equal":"groter of gelijk","greater or equal to":"groter of gelijk aan","greater than":"groter dan",help_just_check:KG,help_on_change:YG,"high priority":"hoge prioriteit","high-priority":"hoge prioriteit","highest priority":"hoogste prioriteit",hours:JG,includes:qG,interval:XG,"just check":"kijk maar","less or equal":"minder of gelijk","less or equal to":"minder of gelijk aan","less than":"minder dan","lower priority":"lagere prioriteit","lowest priority":"laagste prioriteit",magic:ZG,milliseconds:QG,minutes:eV,ms:tV,nadir:sV,nauticalDawn:oV,nauticalDusk:iV,nextSunrise:nV,nextSunset:rV,night:aV,nightEnd:lV,"no blocks found":"Geen blokken gevonden","no group":"GEEN GROEP",normal:cV,"normal priority":"normale prioriteit","not equal to":"niet gelijk aan","not properly connected":"Dit blok is niet correct verbonden met andere blokken.",offset:uV,"on change":"bij verandering","on condition change":"op voorwaarde verandering","on update":"bij update",one:dV,or:hV,quiet:pV,"reset search":"reset zoeken",search:gV,seconds:mV,solarNoon:fV,"store in":"opslaan in",sunrise:$V,sunriseEnd:bV,sunset:vV,sunsetStart:yV,then:_V,"toggle value":"schakelwaarde",tooltip_ack:wV,tooltip_from:kV,tooltip_lc:CV,tooltip_quality:TV,tooltip_ts:SV,tooltip_user:EV,tooltip_value:IV,true:"waar",two:xV,undefined:"ongedefinieerd",update:DV,"use seconds":"gebruik seconden","use trigger value":"triggerwaarde gebruiken",verbose_help:AV,verbose_label:OV,when:RV,with:"met","with date":"met datum","with offset":"met offset",wizard:NV,"Loading models...":"Modellen laden...","Could not connect to API at %s":"Kan geen verbinding maken met API op %s","Invalid API key":"Ongeldige API-sleutel","Access denied by API":"Toegang geweigerd door API","API error: %s":"API-fout: %s",'Model "%s" not found':'Model "%s" niet gevonden',"Request failed: %s":"Verzoek mislukt: %s",Retry:MV,"No running javascript instance found":"Geen draaiende JavaScript-instantie gevonden"},PV="Potwierdzony",BV="Działania",FV="Dodaj",jV="Wszystko",zV="Każdy",UV="Zastosuj",HV="Kwiecień",WV="Zapytać",GV="Astronomiczny",VV="Sierpień",KV="Odwołaj",YV="Zamknij",JV="Stan",qV="Warunki",XV="Konsola",ZV="Skopiowano",QV="Grudzień",e4="Domyślna",t4="Opóźnienie",s4="Usuń",o4="Opis",i4="Gotowe",n4="Uruchom shell",r4="Wyjaśnienie",a4="Eksport",l4="Luty",c4="Luty",u4="Filtr",d4="Folder",h4="Pt",p4="Piątek",g4="ID",m4="ID1",f4="ID2",$4="Import",b4="Instancja",v4="Instancje",y4="Instrukcje",_4="Styczeń",w4="Styczeń",k4="Lipiec",C4="Czerwiec",T4="Limit",S4="Marzec",E4="Maj",I4="Menu",x4="Wiadomość",D4="Po",A4="Model",O4="Poniedziałek",R4="Miesiąc",N4="Więcej",M4="Nazwa",L4="Listopad",P4="OK",B4="Październik",F4="Ok",j4="Pauza",z4="Pushover",U4="Pushsafer",H4="Przemianuj",W4="Powtórz",G4="Uruchom ponownie",V4="Wynik",K4="So",Y4="Sobota",J4="Zapisz",q4="Harmonogram",X4="Skrypt",Z4="Wrzesień",Q4="Symulacja",e8="Stos",t8="Początek",s8="Stan",o8="Nd",i8="Niedziela",n8="Telegram",r8="Cz",a8="Czwartek",l8="Czas",c8="Wyzwolony",u8="Wyzwalacze",d8="Wt",h8="Wtorek",p8="URL",g8="Wartość",m8="Wolumen",f8="Śr",$8="Środa",b8="Pisać",v8="Tak",y8="potwierdzenie",_8="wszystko",w8="i",k8="Astro",C8="w",T8="kontrola",S8="Kopiuj",E8="CRON",I8="Świt",x8="Jest to specjalny tryb, w którym stany i obiekty się nie zmieniają. Jednak w protokole będą wyświetlane tylko informacje o każdej planowanej zmianie.",D8="Odpluskwić",A8="Zmierzch",O8="łatwy",R8="każdy",N8="Funkcja",M8="ID",L8="Nazwa",P8="Rola",B8="Pokój",F8="Złota godzina",j8="Koniec złotej godziny",z8="Kod zostanie wykonany tylko za każdym razem, gdy warunek będzie spełniony. Na przykład. jeśli wyzwalanie na wartość czujnika temperatury i warunek to „jeśli temperatura jest wyższa niż 20 ° C”, to działania „następnie” będą wykonywane za każdym razem, gdy czujnik wyśle temperaturę i jest powyżej 20 ° C. O 21 ° C, o 22 ° C i tak dalej.",U8="Kod zostanie wykonany tylko wtedy, gdy wynik warunku ulegnie zmianie. Na przykład. jeśli wyzwalanie na wartość czujnika temperatury i warunek „jeśli temperatura jest wyższa niż 20 ° C”, to akcje „następnie” zostaną wykonane raz, gdy temperatura przekroczy 20. Następnym razem działania „następnie” zostaną wykonane, gdy temperatura nie udaje się poniżej 20, a następnie ponownie wzrasta powyżej 20.",H8="godziny",W8="zawiera",G8="interwał",V8="magia",K8="milisekund",Y8="minuty",J8="ms",q8="Północ słoneczna",X8="Żeglarski świt",Z8="Żeglarski zmierzch",Q8="Następny wschód słońca",e6="Następny zachód słońca",t6="Noc",s6="Koniec nocy",o6="normalny",i6="przesunięcie",n6="jeden",r6="lub",a6="cisza",l6="Szukaj",c6="sekundy",u6="Południe słoneczne",d6="Wschód słońca",h6="Koniec wschodu słońca",p6="Zachód słońca",g6="Początek zachodu słońca",m6="następnie",f6="Akceptuj",$6="Od",b6="Ostatnia zmiana",v6="Jakość",y6="Znacznik czasu",_6="Użytkownik",w6="Wartość",k6="dwa",C6="aktualizacja",T6="Dodaje wyniki debugowania do dziennika dla wielu poleceń systemowych",S6="Pełne dane wyjściowe dziennika",E6="gdy",I6="Wizard",x6="Ponów próbę",D6={"%s not found":"%s nie znaleziono","()":"()","(at %s)":"(w %s)","(optional)":"(opcjonalny)","-":"-",".":".","AI code generator":"Generator kodu AI",Ack:PV,Actions:BV,"Actual time of day":"Aktualna pora dnia",Add:FV,"Add new script":"Dodaj nowy skrypt",All:jV,"All files will be accepted":"Wszystkie pliki zostaną zaakceptowane",Any:zV,"Any month":"Dowolny miesiąc",Apply:UV,April:HV,"Are you sure?":"Jesteś pewny?",Ask:WV,Astronomical:GV,"Astronomical events today":"Wydarzenia astronomiczne dzisiaj",August:VV,"Blockly description":"Tworzenie reguł za pomocą bloków graficznych","Body:":"Treść:",Cancel:KV,"Cannot delete non empty item!":"Nie można usunąć niepustego elementu!","Change layout":"Zmiana układu",'Change theme (actual "%s")':"Zmień motyw (obecnie - „%s”)","Check blocks":"Sprawdź bloki","Check is not active, because javascript adapter is disabled":"Sprawdzanie nie jest aktywne, ponieważ adapter Javascript jest wyłączony","Clear search input":"Wyczyść dane wyszukiwania","Click on this icon":"Kliknij tę ikonę",Close:YV,"Close all but current":"Zamknij wszystkie oprócz bieżących","Collapse all":"Zwinąć wszystkie","Compares current time with astronomical event":"Porównuje aktualny czas z wydarzeniem astronomicznym","Compares current time with the user specific time":"Porównuje aktualny czas z czasem określonym przez użytkownika","Compares the state value with user defined value":"Porównuje wartość stanu z wartością zdefiniowaną przez użytkownika",Condition:JV,Conditions:qV,"Configuration not saved.":"Konfiguracja nie została zapisana.",Console:XV,"Control or update some state":"Kontroluj lub aktualizuj stan","Control or update some state with delay":"Kontroluj lub aktualizuj jakiś stan z opóźnieniem","Convert blockly to javascript for ever.":"Bezpowrotna konwersja Blockly na Javascript.",Copied:ZV,"Copy script":"Skopiuj skrypt","Copy to clipboard":"Skopiuj do schowka","Create new":"Utwórz nowy","Create new folder":"Utwórz nowy folder","Create new script":"Utwórz nowy skrypt","Create or edit CRON or time wizard":"Utwórz lub edytuj CRON lub kreator czasu","Dark Theme":"Ciemny schemat","Dark style":"Ciemny styl",Date:"Data","Debug instance":"Debuguj instancję","Debug options":"Opcje debugowania",December:QV,Default:e4,"Define cron...":"Zdefiniuj CRON ...","Define schedule...":"Zdefiniuj harmonogram ...",Delay:t4,Delete:s4,"Delete %s":"Usuń %s ...","Delete folder":"Usuń folder","Delete script":"Usuń skrypt",Description:o4,"Deselect all":"Odznacz wszystkie","Discard changes for %s":"Odrzuć zmiany dla %s",Done:i4,"Double click to write value":"Kliknij dwukrotnie, aby zapisać wartość","Download as file":"Download jako plik plik","Drop some files here or click...":"Upuść niektóre pliki tutaj lub kliknij ...","Duplicate name":"Duplikat nazwy","Edit script or just double click":"Edytuj skrypt lub po prostu kliknij dwukrotnie","Empty name is not allowed":"Pusta nazwa jest niedozwolona","End search mode":"Zakończ tryb wyszukiwania","Enter your question":"Wpisz swoją prośbę",Error:"Błąd","Error formatting code":"Błąd formatowania kodu","Error was found":"Błąd został znaleziony","Every day":"Codziennie",Exec:n4,"Executes some shell command":"Wykonuje polecenie powłoki","Existing scripts will be overwritten.":"Istniejące skrypty zostaną zastąpione.","Expand all":"Rozwiń wszystkie","Expert mode":"Tryb ekspercki",Explanation:r4,Export:a4,"Export all scripts":"Wyeksportuj wszystkie skrypty","Export blocks":"Eksportuj bloki","Export selected blocks":"Eksportuj wybrane bloki",Februar:l4,February:c4,Filter:u4,Folder:d4,Fr:h4,Friday:p4,Function:"Funkcja","Function editor":"Edytor funkcji","Function: executed":"Funkcja: wykonywana","Go to next line":"Przejdź do następnej linii","HTTP Call":"Połączenie HTTP","Hide logs":"Ukryj dzienniki",ID:g4,ID1:m4,ID2:f4,Import:$4,"Import blocks":"Importuj bloki","Import error":"Błąd importowania","Import scripts":"Importuj skrypty","Insert object ID":"Wstaw identyfikator obiektu",Instance:b4,"Instance is disabled":"Instancja jest wyłączona","Instance:":"Instancja:",Instances:v4,Instructions:y4,"Invalid CRON":"Nieprawidłowy CRON","It will not be possible to revert this operation.":"Cofnięcie tej operacji nie będzie możliwe.","JS description":"Tworzenie reguł w Javascript",Januar:_4,January:w4,July:k4,June:C4,"Just check":"Po prostu sprawdź","Language:":"Język:","Learn More":"Ucz się więcej","Light style":"Lekki styl",Limit:T4,"Local time":"Czas lokalny","Locate file":"Znajdź plik","Log outputs":"Log dziennika","Log text":"Tekst dziennika","Log: %s":"Dziennik: %s","Make a HTTP get request":"Złóż żądanie HTTP get","Make a pause between actions":"Zrób przerwę między czynnościami",March:S4,"March ":"Marzec ",May:E4,Menu:I4,Message:x4,Mo:D4,Model:A4,Monday:O4,Month:R4,More:N4,Name:M4,"No API key found":"Nie znaleziono klucza API","No Chat GPT Key found":"Nie znaleziono klucza GPT czatu","No active host found":"Nie znaleziono aktywnego hosta","Nothing found":"Nic nie znaleziono",November:L4,OK:P4,October:B4,Ok:F4,"On condition change":"W przypadku zmiany warunków","On script save or adapter start":"Podczas zapisywania skryptu lub uruchamiania adaptera","On weekdays":"W dni powszednie","Open configuration":"Otwarta konfiguracja","Operate two states":"Obsługuj dwa stany","Operations with two states":"Operacje z dwoma stanami","Paste your blocks here":"Wklej tutaj swoje bloki",Pause:j4,"Pause execution":"Wstrzymaj wykonanie","Pause script":"Wstrzymaj skrypt","Phone:":"Telefon:","Please select object ID...":"Wybierz identyfikator obiektu ...","Press Ctrl+Enter to get the answer":"Naciśnij klawisze Ctrl+Enter, aby uzyskać odpowiedź","Prettify the script":"Upiększ skrypt","Print some text in log":"Wydrukuj tekst w dzienniku","Priority:":"Priorytet:",Pushover:z4,Pushsafer:U4,"Read only ID selected: %s":"Wybrano identyfikator tylko do odczytu: %s",Rename:H4,"Reorder scripts in folders":"Zmień kolejność skryptów w folderach",Repeat:W4,Restart:G4,Result:V4,"Resume execution":"Wznów wykonanie","Root folder":"Folder główny","Rules description":"Twórz reguły z blokami IF, THEN, ELSE","Run script":"Uruchom skrypt",Sa:K4,Saturday:Y4,Save:J4,"Save all":"Zapisz wszystko","Say It":"Wypowiedz","Say some text via sayit adapter":"Powiedz tekst przez adapter sayit",Schedule:q4,Script:X4,"Script %s was modified on disk":"Skrypt %s został zmodyfikowany na dysku","Script is not running":"Skrypt nie działa","Search in scripts":"Szukaj w skryptach","Search...":"Szukaj...","Select all":"Zaznacz wszystko","Send email":"Wysłać email","Sends an email":"Wysyła e-mail","Sends message via Pushsafer":"Wysyła wiadomość przez Pushsafer","Sends message via pushover":"Wysyła wiadomość przez pushover","Sends message via telegram":"Wysyła wiadomość telegramem","Sends message via whatsapp-cmb":"Wysyła wiadomość przez WhatsApp-cmb",September:Z4,"Server time":"Czas serwera","Set state action":"Ustaw stan działania","Set with delay":"Ustaw z opóźnieniem","Shell command":"Polecenie powłoki","Show astronomical events":"Pokaż wydarzenia astronomiczne","Show javascript code":"Pokaż kod JavaScript","Show logs":"Pokaż dzienniki","Show only paused scripts":"Pokaż tylko wstrzymane skrypty","Show only running scripts":"Pokaż tylko działające skrypty","Show only scripts with problems":"Pokaż tylko skrypty z problemami",Simulate:Q4,"Some files will be rejected":"Niektóre pliki zostaną odrzucone","Sound:":"Dźwięk:",Stack:e8,Start:t8,"Start script":"Uruchom skrypt",State:s8,"State condition":"Warunek stanu","Step into function":"Wejdź do funkcji","Step out from function":"Wyjdź z funkcji","Stop on exception":"Zatrzymaj się na wyjątku",Su:o8,"Subject:":"Temat:",Sunday:i8,"TS description":"Tworzenie reguł w Typescript",Telegram:n8,"Text:":"Tekst:",Th:r8,"The script will be stopped and must be activated manually after debugging. Continue?":"Skrypt zostanie zatrzymany i należy go aktywować ręcznie po debugowaniu. Kontyntynuj?","This is advances option. You can write your own code here and it will be executed on trigger":"To jest opcja zaawansowana. Możesz tutaj napisać własny kod, który zostanie wykonany po wyzwoleniu",Thursday:a8,Time:l8,"Time condition":"Warunek czasowy","Title:":"Tytuł:","To:":"Do:","Trigger with value":"Wyzwalacz z wartością",Triggered:c8,Triggers:u8,"Triggers the on script saving or the javascript instance restart":"Uruchamia zapisywanie skryptu lub restart instancji javascript","Triggers the rule on update or change of some state":"Uruchamia regułę przy aktualizacji lub zmianie jakiegoś stanu","Triggers the rule periodically or on some specific time":"Uruchamia regułę okresowo lub w określonym czasie",Tu:d8,Tuesday:h8,URL:p8,"Unknown error":"Nieznany błąd","Unknown error!":"Nieznany błąd!","Use generated code":"Użyj wygenerowanego kodu","User function":"Funkcja użytkownika","User:":"Użytkownik:",Value:g8,"Vibration:":"Wibracja:",Volume:m8,We:f8,Wednesday:$8,"Whatsapp-cmb":"Whatsapp-cmb",Write:b8,"Write your own code":"Napisz swój własny kod",Yes:v8,"Yet exists!":"A jednak istnieje!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Możesz użyć %s w adresie URL, aby użyć bieżącej wartości wyzwalacza, %id, aby użyć wyzwalanego identyfikatora obiektu, %name, aby wyświetlić nazwę identyfikatora wyzwalanego obiektu, lub %old, aby użyć starej wartości wyzwalacza","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Możesz użyć %s w poleceniu, aby użyć bieżącej wartości wyzwalającej, %id, aby użyć identyfikatora wyzwalanego obiektu, %name, aby wyświetlić nazwę identyfikatora wyzwalanego obiektu, lub %old, aby użyć starej wartości wyzwalającej","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Możesz użyć %s w tekście, aby wyświetlić aktualną wartość wyzwalającą, %id, aby użyć identyfikatora wyzwolonego obiektu, %name, aby wyświetlić nazwę identyfikatora wyzwolonego obiektu lub %old, aby użyć starej wartości wyzwalającej","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Możesz użyć %s w wartości, aby użyć bieżącej wartości wyzwalacza, %id, aby użyć identyfikatora wyzwalanego obiektu, %name, aby wyświetlić nazwę identyfikatora wyzwalanego obiektu, lub %old, aby użyć starej wartości wyzwalacza","You have to enter OpenAI API key in the configuration of javascript adapter.":"Należy wprowadzić klucz OpenAI API w konfiguracji adaptera javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Musisz wprowadzić co najmniej jeden klucz API (OpenAI, Anthropic lub Gemini) w konfiguracji adaptera javascript.","Please select a valid model":"Wybierz prawidłowy model","[equal]":"[równy]","[greater or equal]":"[większe lub równe]","[greater]":"[większe]","[hysteresis]":"[histereza]","[includes]":"[obejmuje]","[less or equal]":"[mniejsze lub równe]","[less]":"[mniejsze]","[not equal]":"[nie równe]",acknowledgment:y8,all:_8,and:w8,"as JSON":"jako JSON","as plain text":"jako zwykły tekst",astro:k8,at:C8,"clear running":"czyste uruchomienie",control:T8,copy:S8,cron:E8,dawn:I8,debug_help:x8,debug_label:D8,default:"domyślna",dusk:A8,easy:O8,else:"inaczej","equal to":"równy",every:R8,"every hour at 0 minutes":"co godzinę po 0 minutach",false:"fałsz","file reading has failed: %s":"odczyt pliku nie powiódł się: %s","file reading was aborted":"odczyt pliku został przerwany",filter_func:N8,filter_id:M8,filter_name:L8,filter_role:P8,filter_room:B8,"for edit or create script":"do edycji lub utwórz nowy skrypt","for professionals":"dla profesjonalistów","for programmers":"dla programistów",goldenHour:F8,goldenHourEnd:j8,"greater or equal":"większe lub równe","greater or equal to":"więcej lub równo","greater than":"więcej niż",help_just_check:z8,help_on_change:U8,"high priority":"wysoki priorytet","high-priority":"wysoki priorytet","highest priority":"najwyższy priorytet",hours:H8,includes:W8,interval:G8,"just check":"po prostu sprawdź","less or equal":"mniejsze lub równe","less or equal to":"mniej lub równo","less than":"mniej niż","lower priority":"niższy priorytet","lowest priority":"najniższy priorytet",magic:V8,milliseconds:K8,minutes:Y8,ms:J8,nadir:q8,nauticalDawn:X8,nauticalDusk:Z8,nextSunrise:Q8,nextSunset:e6,night:t6,nightEnd:s6,"no blocks found":"Nie znaleziono bloków","no group":"BRAK GRUPY",normal:o6,"normal priority":"normalny priorytet","not equal to":"nie równa się","not properly connected":"Ten blok nie jest poprawnie podłączony do innych bloków.",offset:i6,"on change":"na zmianę","on condition change":"pod warunkiem zmiany warunków","on update":"po aktualizacji",one:n6,or:r6,quiet:a6,"reset search":"zresetuj wyszukiwanie",search:l6,seconds:c6,solarNoon:u6,"store in":"przechowaj w",sunrise:d6,sunriseEnd:h6,sunset:p6,sunsetStart:g6,then:m6,"toggle value":"wartość przełączania",tooltip_ack:f6,tooltip_from:$6,tooltip_lc:b6,tooltip_quality:v6,tooltip_ts:y6,tooltip_user:_6,tooltip_value:w6,true:"prawda",two:k6,undefined:"nieokreślony",update:C6,"use seconds":"użyj sekund","use trigger value":"użyj wartości wyzwalającej",verbose_help:T6,verbose_label:S6,when:E6,with:"z","with date":"z datą","with offset":"z przesunięciem",wizard:I6,"Loading models...":"Ładowanie modeli...","Could not connect to API at %s":"Nie można połączyć się z API pod adresem %s","Invalid API key":"Nieprawidłowy klucz API","Access denied by API":"Odmowa dostępu przez API","API error: %s":"Błąd API: %s",'Model "%s" not found':'Model "%s" nie znaleziony',"Request failed: %s":"Żądanie nie powiodło się: %s",Retry:x6,"No running javascript instance found":"Nie znaleziono uruchomionej instancji JavaScript"},A6="Reconhecido",O6="Ações",R6="Adicionar",N6="Todos",M6="Nenhum",L6="Aplique",P6="abril",B6="Perguntar",F6="Astronômico",j6="agosto",z6="Cancelar",U6="Fechar",H6="Doença",W6="Condições",G6="Console",V6="Copiado",K6="dezembro",Y6="Predefinição",J6="Atraso",q6="Deletar",X6="Descrição",Z6="Pronto",Q6="Exec shell",e9="Explicação",t9="Exportação",s9="Februar",o9="fevereiro",i9="Filtro",n9="Pasta",r9="Fr",a9="Sexta-feira",l9="ID",c9="ID1",u9="ID2",d9="Importar",h9="Instância",p9="Instâncias",g9="Instruções",m9="Januar",f9="janeiro",$9="julho",b9="junho",v9="Limite",y9="março",_9="maio",w9="Menu",k9="mensagem",C9="Mo",T9="Modelo",S9="Segunda-feira",E9="Mês",I9="Mais",x9="Nome",D9="novembro",A9="OK",O9="outubro",R9="Ok",N9="Pausa",M9="Pushover",L9="Pushsafer",P9="Renomear",B9="Repetir",F9="Reiniciar",j9="Resultado",z9="Sá",U9="Sábado",H9="Salve",W9="Cronograma",G9="Script",V9="setembro",K9="Simular",Y9="Pilha",J9="Começar",q9="Estado",X9="Su",Z9="Domingo",Q9="Telegrama",eK="4",tK="Quinta-feira",sK="Tempo",oK="Provocado",iK="Gatilhos",nK="Tu",rK="terça",aK="URL",lK="Valor",cK="Volume",uK="3",dK="quarta",hK="Escrever",pK="sim",gK="reconhecimento",mK="todos",fK="e",$K="astro",bK="no",vK="ao controle",yK="copiar",_K="CRON",wK="alvorecer",kK="Este é um modo especial no qual estados e objetos não serão alterados. Mas apenas as informações sobre cada mudança planejada serão exibidas no protocolo.",CK="Depurar",TK="Crepúsculo",SK="fácil",EK="cada",IK="Função",xK="ID",DK="Nome",AK="Tipo",OK="Quarto",RK="Hora dourada",NK="Fim da hora de ouro",MK='O código será executado apenas sempre que a condição for verdadeira. Por exemplo. se disparar no valor do sensor de temperatura e a condição for "se a temperatura for maior que 20 ° C", as ações "então" serão executadas toda vez que o sensor enviar a temperatura e ela estiver acima de 20 ° C. Por 21 ° C, por 22 ° C e assim por diante.',LK='O código será executado apenas se o resultado da condição mudar. Por exemplo. se disparar no valor do sensor de temperatura e a condição for "se a temperatura for maior que 20 ° C", as ações "então" serão executadas uma vez quando a temperatura estiver acima de 20. Na próxima vez, as ações "então" serão executadas quando a temperatura falha abaixo de 20 e sobe acima de 20 novamente.',PK="horas",BK="inclui",FK="intervalo",jK="Magia",zK="milissegundos",UK="minutos",HK="ms",WK="nadir",GK="Madrugada náutica",VK="Crepúsculo náutico",KK="próximo nascer do sol",YK="Próximo pôr do sol",JK="Noite",qK="Fim de noite",XK="normal",ZK="Deslocamento",QK="1",e7="ou",t7="quieto",s7="procurar",o7="segundos",i7="Meio-dia solar",n7="nascer do sol",r7="Fim do nascer do sol",a7="pôr do sol",l7="Começo do pôr do sol",c7="então",u7="reconhecer",d7="de",h7="Última alteração",p7="Qualidade",g7="timestamp",m7="usuário",f7="valor",$7="dois",b7="atualizar",v7="Adiciona saída de depuração ao log para muitos comandos do sistema",y7="Saídas de log detalhadas",_7="quando",w7="Wizard",k7="Tentar novamente",C7={"%s not found":"%s não encontrado","()":"()","(at %s)":"(em %s)","(optional)":"(opcional)","-":"-",".":".","AI code generator":"Gerador de código de IA",Ack:A6,Actions:O6,"Actual time of day":"Hora real do dia",Add:R6,"Add new script":"Adicionar novo script",All:N6,"All files will be accepted":"Todos os arquivos serão aceitos",Any:M6,"Any month":"Qualquer mês",Apply:L6,April:P6,"Are you sure?":"Você tem certeza?",Ask:B6,Astronomical:F6,"Astronomical events today":"Eventos astronômicos hoje",August:j6,"Blockly description":"Criando regras por blocos gráficos","Body:":"Corpo:",Cancel:z6,"Cannot delete non empty item!":"Não pode ser deletar, porque não está vazio!","Change layout":"Alterar layout",'Change theme (actual "%s")':'Alterar tema (agora - "%s")',"Check blocks":"Verificar blocos","Check is not active, because javascript adapter is disabled":"A verificação de sintaxe não está ativa porque o adaptador javascript não está rodando.","Clear search input":"Limpar entrada de pesquisa","Click on this icon":"Clique neste ícone",Close:U6,"Close all but current":"Fechar tudo, menos atual","Collapse all":"Recolher todos","Compares current time with astronomical event":"Compara o tempo atual com o evento astronômico","Compares current time with the user specific time":"Compara a hora atual com a hora específica do usuário","Compares the state value with user defined value":"Compara o valor do estado com o valor definido pelo usuário",Condition:H6,Conditions:W6,"Configuration not saved.":"Configuração não esta salva.",Console:G6,"Control or update some state":"Controlar ou atualizar algum estado","Control or update some state with delay":"Controlar ou atualizar algum estado com atraso","Convert blockly to javascript for ever.":"Converter Blockly em Javascript permanentemente.",Copied:V6,"Copy script":"Copiar script","Copy to clipboard":"Copiar para área de transferência","Create new":"Crie um novo","Create new folder":"Criar nova pasta","Create new script":"Criar novo script","Create or edit CRON or time wizard":"Criar ou editar o assistente cron ou o assistente de horário","Dark Theme":"Layout escuro","Dark style":"Estilo escuro",Date:"Encontro","Debug instance":"Instância de depuração","Debug options":"Opções de depuração",December:K6,Default:Y6,"Define cron...":"Definir cron...","Define schedule...":"Definir agendamento ...",Delay:J6,Delete:q6,"Delete %s":"Deletar %s...","Delete folder":"Deletar pasta","Delete script":"Deletar script",Description:X6,"Deselect all":"Desmarcar todos","Discard changes for %s":"Descartar alterações para %s",Done:Z6,"Double click to write value":"Clique duas vezes para escrever o valor","Download as file":"Baixar como arquivo","Drop some files here or click...":"Solte alguns arquivos aqui ou clique em...","Duplicate name":"Nome duplicado","Edit script or just double click":"Edite o script ou clique duas vezes","Empty name is not allowed":"Nome vazio não é permitido","End search mode":"Finalizar modo de pesquisa","Enter your question":"Digite sua solicitação",Error:"Erro","Error formatting code":"Erro de formatação de código","Error was found":"Erro foi encontrado","Every day":"Todos os dias",Exec:Q6,"Executes some shell command":"Executa algum comando shell","Existing scripts will be overwritten.":"Os scripts existentes serão substituídos.","Expand all":"Expandir todos","Expert mode":"Modo de especialista",Explanation:e9,Export:t9,"Export all scripts":"Exportar todos os scripts","Export blocks":"Exportar blocos","Export selected blocks":"Exportar blocos selecionados",Februar:s9,February:o9,Filter:i9,Folder:n9,Fr:r9,Friday:a9,Function:"Função","Function editor":"Editor de funções","Function: executed":"Função: executado","Go to next line":"Vá para a próxima linha","HTTP Call":"Chamada HTTP","Hide logs":"Ocultar logs",ID:l9,ID1:c9,ID2:u9,Import:d9,"Import blocks":"Importar blocos","Import error":"Erro de importação","Import scripts":"Importar script","Insert object ID":"Inserir ID do objeto",Instance:h9,"Instance is disabled":"Instância está desativada","Instance:":"Instância:",Instances:p9,Instructions:g9,"Invalid CRON":"CRON inválido","It will not be possible to revert this operation.":"Não será possível reverter esta operação.","JS description":"Criando regras escrevendo Javascript",Januar:m9,January:f9,July:$9,June:b9,"Just check":"Apenas verifique","Language:":"Língua:","Learn More":"Aprender mais","Light style":"Estilo claro",Limit:v9,"Local time":"Hora local","Locate file":"Localize o arquivo","Log outputs":"Saídas de log","Log text":"Texto de registro","Log: %s":"Log: %s","Make a HTTP get request":"Faça uma solicitação HTTP get","Make a pause between actions":"Faça uma pausa entre as ações",March:y9,"March ":"Março",May:_9,Menu:w9,Message:k9,Mo:C9,Model:T9,Monday:S9,Month:E9,More:I9,Name:x9,"No API key found":"Nenhuma chave API encontrada","No Chat GPT Key found":"Nenhuma chave GPT de bate-papo encontrada","No active host found":"Nenhum host ativo encontrado","Nothing found":"Nada encontrado",November:D9,OK:A9,October:O9,Ok:R9,"On condition change":"Na mudança de condição","On script save or adapter start":"Ao salvar o script ou iniciar o adaptador","On weekdays":"Nos dias úteis","Open configuration":"Configuração aberta","Operate two states":"Operar dois estados","Operations with two states":"Operações com dois estados","Paste your blocks here":"Cole seus blocos aqui",Pause:N9,"Pause execution":"Pausar a execução","Pause script":"Pausar script","Phone:":"Telefone:","Please select object ID...":"Selecione o ID do objeto...","Press Ctrl+Enter to get the answer":"Pressione Ctrl+Enter para obter a resposta","Prettify the script":"Embeleze o roteiro","Print some text in log":"Imprimir algum texto no log","Priority:":"Prioridade:",Pushover:M9,Pushsafer:L9,"Read only ID selected: %s":"ID somente leitura selecionada: %s",Rename:P9,"Reorder scripts in folders":"Reordenar scripts em pastas",Repeat:B9,Restart:F9,Result:j9,"Resume execution":"Retomar execução","Root folder":"Pasta principal","Rules description":"Crie regras com blocos IF, THEN, ELSE","Run script":"Executar script",Sa:z9,Saturday:U9,Save:H9,"Save all":"Salvar tudo","Say It":"Say It","Say some text via sayit adapter":"Diga algum texto através do adaptador sayit",Schedule:W9,Script:G9,"Script %s was modified on disk":'O script "%s" foi modificado no disco rígido',"Script is not running":"Script não está sendo executado","Search in scripts":"Pesquisa em scripts","Search...":"Procurar...","Select all":"Selecionar tudo","Send email":"Enviar email","Sends an email":"Envia um email","Sends message via Pushsafer":"Envia mensagem via Pushsafer","Sends message via pushover":"Envia mensagem via pushover","Sends message via telegram":"Envia mensagem via telegrama","Sends message via whatsapp-cmb":"Envia mensagem via whatsapp-cmb",September:V9,"Server time":"Tempo de servidor","Set state action":"Definir ação de estado","Set with delay":"Definido com atraso","Shell command":"Comando shell","Show astronomical events":"Mostrar eventos astronômicos","Show javascript code":"Mostrar código Javascript","Show logs":"Mostrar logs","Show only paused scripts":"Mostrar apenas scripts pausados","Show only running scripts":"Mostrar apenas scripts em execução","Show only scripts with problems":"Mostrar apenas scripts com problemas",Simulate:K9,"Some files will be rejected":"Alguns arquivos serão rejeitados","Sound:":"Som:",Stack:Y9,Start:J9,"Start script":"Iniciar script",State:q9,"State condition":"Condição de estado","Step into function":"Entre na função","Step out from function":"Saia da função","Stop on exception":"Pare na exceção",Su:X9,"Subject:":"Sujeito:",Sunday:Z9,"TS description":"Criando regras escrevendo Typecript",Telegram:Q9,"Text:":"Texto:",Th:eK,"The script will be stopped and must be activated manually after debugging. Continue?":"O script será interrompido e deve ser ativado manualmente após a depuração. Continuar?","This is advances option. You can write your own code here and it will be executed on trigger":"Esta é a opção de avanços. Você pode escrever seu próprio código aqui e ele será executado no gatilho",Thursday:tK,Time:sK,"Time condition":"Condição de tempo","Title:":"Título:","To:":"Para:","Trigger with value":"Trigger com valor",Triggered:oK,Triggers:iK,"Triggers the on script saving or the javascript instance restart":"Aciona o salvamento do script ou a reinicialização da instância javascript","Triggers the rule on update or change of some state":"Aciona a regra na atualização ou mudança de algum estado","Triggers the rule periodically or on some specific time":"Aciona a regra periodicamente ou em algum momento específico",Tu:nK,Tuesday:rK,URL:aK,"Unknown error":"Erro desconhecido","Unknown error!":"Erro desconhecido!","Use generated code":"Usar código gerado","User function":"Função do usuário","User:":"Do utilizador:",Value:lK,"Vibration:":"Vibração:",Volume:cK,We:uK,Wednesday:dK,"Whatsapp-cmb":"Whatsapp-cmb",Write:hK,"Write your own code":"Escreva seu próprio código",Yes:pK,"Yet exists!":"Ainda existe!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Você pode usar %s na URL para usar o valor do gatilho atual, %id para usar o ID do objeto acionado, %name para mostrar o nome do ID do objeto acionado ou %old para usar o valor do gatilho antigo","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Você pode usar %s no comando para usar o valor do acionador atual, %id para usar o ID do objeto acionado, %name para mostrar o nome do ID do objeto acionado ou %old para usar o valor do acionador antigo","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Você pode usar %s no texto para exibir o valor do acionador atual, %id para usar o ID do objeto acionado, %name para mostrar o nome do ID do objeto acionado ou %old para usar o valor do acionador antigo","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Você pode usar %s no valor para usar o valor do acionador atual, %id para usar o ID do objeto acionado, %name para mostrar o nome do ID do objeto acionado ou %old para usar o valor do acionador antigo","You have to enter OpenAI API key in the configuration of javascript adapter.":"Você deve inserir a chave da API OpenAI na configuração do adaptador javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Você deve inserir pelo menos uma chave API (OpenAI, Anthropic ou Gemini) na configuração do adaptador javascript.","Please select a valid model":"Selecione um modelo válido","[equal]":"[igual]","[greater or equal]":"[maior ou igual]","[greater]":"[maior]","[hysteresis]":"[histerese]","[includes]":"[inclui]","[less or equal]":"[menor ou igual]","[less]":"[menos]","[not equal]":"[não igual]",acknowledgment:gK,all:mK,and:fK,"as JSON":"como JSON","as plain text":"como texto simples",astro:$K,at:bK,"clear running":"corrida limpa",control:vK,copy:yK,cron:_K,dawn:wK,debug_help:kK,debug_label:CK,default:"predefinição",dusk:TK,easy:SK,else:"outro","equal to":"igual a",every:EK,"every hour at 0 minutes":"a cada hora em 0 minutos",false:"falso","file reading has failed: %s":"a leitura do arquivo falhou: %s","file reading was aborted":"a leitura do arquivo foi abortada",filter_func:IK,filter_id:xK,filter_name:DK,filter_role:AK,filter_room:OK,"for edit or create script":"para editar ou criar um novo script","for professionals":"para profissionais","for programmers":"para programadores",goldenHour:RK,goldenHourEnd:NK,"greater or equal":"maior ou igual","greater or equal to":"maior ou igual a","greater than":"Maior que",help_just_check:MK,help_on_change:LK,"high priority":"prioridade máxima","high-priority":"prioridade máxima","highest priority":"Prioridade máxima",hours:PK,includes:BK,interval:FK,"just check":"Apenas verifique","less or equal":"menor ou igual","less or equal to":"menor ou igual a","less than":"Menor que","lower priority":"prioridade mais baixa","lowest priority":"prioridade mais baixa",magic:jK,milliseconds:zK,minutes:UK,ms:HK,nadir:WK,nauticalDawn:GK,nauticalDusk:VK,nextSunrise:KK,nextSunset:YK,night:JK,nightEnd:qK,"no blocks found":"Nenhum bloco encontrado","no group":"SEM GRUPO",normal:XK,"normal priority":"prioridade normal","not equal to":"não é igual a","not properly connected":"Este bloco não está conectado corretamente com outros blocos.",offset:ZK,"on change":"em mudança","on condition change":"na mudança de condição","on update":"em atualização",one:QK,or:e7,quiet:t7,"reset search":"redefinir pesquisa",search:s7,seconds:o7,solarNoon:i7,"store in":"armazenar em",sunrise:n7,sunriseEnd:r7,sunset:a7,sunsetStart:l7,then:c7,"toggle value":"valor de alternância",tooltip_ack:u7,tooltip_from:d7,tooltip_lc:h7,tooltip_quality:p7,tooltip_ts:g7,tooltip_user:m7,tooltip_value:f7,true:"verdade",two:$7,undefined:"Indefinido",update:b7,"use seconds":"use segundos","use trigger value":"use o gatilho",verbose_help:v7,verbose_label:y7,when:_7,with:"com","with date":"com data","with offset":"com deslocamento",wizard:w7,"Loading models...":"Carregando modelos...","Could not connect to API at %s":"Não foi possível conectar à API em %s","Invalid API key":"Chave API inválida","Access denied by API":"Acesso negado pela API","API error: %s":"Erro de API: %s",'Model "%s" not found':'Modelo "%s" não encontrado',"Request failed: %s":"Solicitação falhou: %s",Retry:k7,"No running javascript instance found":"Nenhuma instância JavaScript em execução encontrada"},T7="Подтверждение",S7="Действия",E7="Добавить",I7="Все",x7="Любая",D7="Применить",A7="Апрель",O7="Спросить",R7="Aстрономический",N7="Август",M7="Отмена",L7="Закрыть",P7="Условие",B7="Условия",F7="Приставка",j7="Скопировано",z7="Декабрь",U7="Дефолт",H7="Задержка",W7="Удалить",G7="Описание",V7="Готово",K7="Исполнить shell",Y7="Объяснение",J7="Экспорт",q7="Февраль",X7="Февраль",Z7="Фильтр",Q7="Папка",eY="Пт",tY="пятница",sY="ID",oY="ID1",iY="ID2",nY="Импорт",rY="Экземпляр",aY="Экземпляры",lY="Инструкции",cY="Январь",uY="Январь",dY="Июль",hY="Июнь",pY="Предел",gY="Март",mY="Май",fY="Меню",$Y="Сообщение",bY="Пн",vY="Модель",yY="понедельник",_Y="Месяц",wY="Более",kY="Имя",CY="Ноябрь",TY="Ок",SY="Октябрь",EY="Ok",IY="Пауза",xY="Pushover",DY="Pushsafer",AY="Переименовать",OY="Повторение",RY="Перезапустить",NY="Результат",MY="Сб",LY="суббота",PY="Сохранить",BY="Расписание",FY="скрипт",jY="Сентябрь",zY="Симулировать",UY="Stack",HY="Начинать",WY="Состояние",GY="Вс",VY="Воскресенье",KY="Telegram",YY="Чт",JY="Четверг",qY="Время",XY="Срабатывает",ZY="Триггеры",QY="Вт",eJ="вторник",tJ="URL",sJ="Значение",oJ="Громкость",iJ="Ср",nJ="среда",rJ="Напишите",aJ="Да",lJ="подтверждение",cJ="все",uJ="и",dJ="Астро",hJ="в",pJ="контроль",gJ="копия",mJ="CRON",fJ="Рассвет",$J="Это особый режим, в котором состояния и объекты не будут меняться. Но в протоколе будет отображаться только информация о каждом планируемом изменении.",bJ="Отлаживать",vJ="Сумерки",yJ="легкий",_J="каждые(ый)",wJ="Функция",kJ="ID",CJ="Название",TJ="Роль",SJ="Комната",EJ="Золотой час",IJ="Конец золотого часа",xJ="Код будет выполняться только каждый раз, когда условие истинно. Например. при срабатывании по значению датчика температуры и условию «если температура выше 20°C», действия «затем» будут выполняться каждый раз, когда датчик отправляет значение температуры, и оно превышает 20°C. На 21°С, на 22°С и так далее.",DJ="Код будет выполнен только в случае изменения результата условия. Например, при срабатывании по значению датчика температуры и условию «если температура больше 20°C», действия «затем» будут выполнены один раз, когда температура превысит 20°C. В следующий раз действия «затем» будут выполнены, когда температура опустится ниже 20°C, а затем снова поднимается выше 20°C.",AJ="час(ов)",OJ="содержит",RJ="интервал",NJ="магия",MJ="миллисекунды",LJ="минут(у)",PJ="мс",BJ="Надир",FJ="Морской рассвет",jJ="Морские сумерки",zJ="Следующий восход",UJ="Следующий закат",HJ="Ночь",WJ="Конец ночи",GJ="нормальный",VJ="сдвиг",KJ="один",YJ="или",JJ="тихий",qJ="поиск",XJ="секунд",ZJ="Солнечный полдень",QJ="Восход солнца",eq="Конец восхода",tq="Закат солнца",sq="Начало заката",oq="тогда",iq="Подтверждено",nq="От",rq="Последнее изменение",aq="Качественный",lq="Время",cq="Пользователь",uq="Значение",dq="два",hq="обновить",pq="Добавляет вывод отладки в журнал для многих системных команд.",gq="Подробный протокол",mq="если",fq="Мастер",$q="Повторить",bq={"%s not found":"%s не найден","()":"()","(at %s)":"(в %s)","(optional)":"(необязательный)","-":"-",".":".","AI code generator":"ИИ Генератор кода",Ack:T7,Actions:S7,"Actual time of day":"Фактическое время суток",Add:E7,"Add new script":"Добавить новый скрипт",All:I7,"All files will be accepted":"Все файлы будут приняты",Any:x7,"Any month":"В любой месяц",Apply:D7,April:A7,"Are you sure?":"Вы уверены?",Ask:O7,Astronomical:R7,"Astronomical events today":"Астрономические события сегодня",August:N7,"Blockly description":"Создание правил графическими блоками","Body:":"Тело:",Cancel:M7,"Cannot delete non empty item!":"Не удается удалить непустой элемент!","Change layout":"Изменить макет",'Change theme (actual "%s")':'Сменить тему (сейчас - "%s")',"Check blocks":"Проверить блоки","Check is not active, because javascript adapter is disabled":"Проверка неактивна, потому что адаптер Javascript отключен","Clear search input":"Очистить ввод","Click on this icon":"Нажмите на этот значок",Close:L7,"Close all but current":"Закрыть все кроме текущего","Collapse all":"Свернуть все","Compares current time with astronomical event":"Сравнивает текущее время с астрономическим событием","Compares current time with the user specific time":"Сравнивает текущее время с конкретным временем пользователя","Compares the state value with user defined value":"Сравнивает значение состояния с пользовательским значением",Condition:P7,Conditions:B7,"Configuration not saved.":"Конфигурация не сохранена.",Console:F7,"Control or update some state":"Контролировать или обновлять какое-то состояние","Control or update some state with delay":"Контролировать или обновлять какое-либо состояние с задержкой","Convert blockly to javascript for ever.":"Преобразовать blockly в Javascript навсегда.",Copied:j7,"Copy script":"Скопировать скрипт","Copy to clipboard":"Скопировать в буфер обмена","Create new":"Создать новый","Create new folder":"Создать новую папку","Create new script":"Создать новый скрипт","Create or edit CRON or time wizard":"Создание или редактирование CRON или мастера времени","Dark Theme":"Тёмная тема","Dark style":"Темный стиль",Date:"Дата","Debug instance":"Экземпляр отладки","Debug options":"Варианты отладки",December:z7,Default:U7,"Define cron...":"Задать правило ...","Define schedule...":"Задать расписание...",Delay:H7,Delete:W7,"Delete %s":"Удалить %s...","Delete folder":"Удалить папку","Delete script":"Удалить скрипт",Description:G7,"Deselect all":"Снять выбор со всех","Discard changes for %s":"Отменить изменения для %s",Done:V7,"Double click to write value":"Двойной щелчок для записи значения","Download as file":"Скачать как файл","Drop some files here or click...":"Перетыщите сюда файлы или нажмите ...","Duplicate name":"Повторяющееся имя","Edit script or just double click":"Редактировать скрипт или просто дважды щелкнуть","Empty name is not allowed":"Пустое имя не допускается","End search mode":"Закончить поиск","Enter your question":"Введи свою просьбу",Error:"Ошибка","Error formatting code":"Ошибка форматирования кода","Error was found":"Ошибка была найдена","Every day":"Каждый день",Exec:K7,"Executes some shell command":"Выполняет некоторую команду оболочки","Existing scripts will be overwritten.":"Существующие скрипты будут перезаписаны.","Expand all":"Открыть все","Expert mode":"Экспертный режим",Explanation:Y7,Export:J7,"Export all scripts":"Экспорт всех скриптов","Export blocks":"Экспортировать блоки","Export selected blocks":"Экспортировать выбранные блоки",Februar:q7,February:X7,Filter:Z7,Folder:Q7,Fr:eY,Friday:tY,Function:"Функция","Function editor":"Редактор функции","Function: executed":"Функция: выполнено","Go to next line":"Перейти к следующей строке","HTTP Call":"HTTP-вызов","Hide logs":"Скрыть журналы",ID:sY,ID1:oY,ID2:iY,Import:nY,"Import blocks":"Импортировать блоки","Import error":"Ошибка импорта","Import scripts":"Импорт скриптов","Insert object ID":"Вставить ID объекта",Instance:rY,"Instance is disabled":"Экземпляр отключен","Instance:":"Пример:",Instances:aY,Instructions:lY,"Invalid CRON":"Неправильный CRON","It will not be possible to revert this operation.":"Невозможно вернуть эту операцию.","JS description":"Создание правил путём написания Javascript",Januar:cY,January:uY,July:dY,June:hY,"Just check":"Просто проверить","Language:":"Язык:","Learn More":"Узнать больше","Light style":"Светлый стиль",Limit:pY,"Local time":"Местное время","Locate file":"Показать файл в дереве","Log outputs":"Журнал","Log text":"Текст журнала","Log: %s":"Журнал: %s","Make a HTTP get request":"Сделайте HTTP-запрос на получение","Make a pause between actions":"Сделайте паузу между действиями",March:gY,"March ":"Март ",May:mY,Menu:fY,Message:$Y,Mo:bY,Model:vY,Monday:yY,Month:_Y,More:wY,Name:kY,"No API key found":"API-ключ не найден","No Chat GPT Key found":"Ключ GPT для чата не найден","No active host found":"Активный host не найден","Nothing found":"Ничего не найдено",November:CY,OK:TY,October:SY,Ok:EY,"On condition change":"При изменении реузльтата условий","On script save or adapter start":"При сохранении скрипта или запуске адаптера","On weekdays":"По дням недели","Open configuration":"Открыть настройки","Operate two states":"Операции над двумя состояниями","Operations with two states":"Операции с двумя состояниями","Paste your blocks here":"Вставьте свои блоки сюда",Pause:IY,"Pause execution":"Приостановить выполнение","Pause script":"Остановить скрипт","Phone:":"Телефон:","Please select object ID...":"Пожалуйста, выберите ID объекта ...","Press Ctrl+Enter to get the answer":"Нажмите Ctrl+Enter, чтобы получить ответ","Prettify the script":"Украсьте сценарий","Print some text in log":"Напечатать текст в журнале","Priority:":"Приоритет:",Pushover:xY,Pushsafer:DY,"Read only ID selected: %s":"Выбран идентификатор только для чтения: %s",Rename:AY,"Reorder scripts in folders":"Сортировать скрипты в папках",Repeat:OY,Restart:RY,Result:NY,"Resume execution":"Возобновить выполнение","Root folder":"Корневая папка","Rules description":"Создавайте правила с блоками ЕСЛИ, ТО, ИНАЧЕ","Run script":"Запустить скрипт",Sa:MY,Saturday:LY,Save:PY,"Save all":"Сохранить все","Say It":"Say It","Say some text via sayit adapter":"Произнесите текст через адаптер Sayit",Schedule:BY,Script:FY,"Script %s was modified on disk":'Скрипт "%s" был изменен на диске',"Script is not running":"Сценарий не запущен","Search in scripts":"Поиск в скриптах","Search...":"Поиск...","Select all":"Выбрать все","Send email":"Отправить email","Sends an email":"Отправляет электронное письмо","Sends message via Pushsafer":"Отправляет сообщение через Pushsafer","Sends message via pushover":"Отправляет сообщение через пустышку","Sends message via telegram":"Отправляет сообщение в телеграмме","Sends message via whatsapp-cmb":"Отправляет сообщение через whatsapp-cmb",September:jY,"Server time":"Время сервера","Set state action":"Установить состояние","Set with delay":"Установить с задержкой","Shell command":"Команда оболочки","Show astronomical events":"Показать астрономические события","Show javascript code":"Показать код Javascript","Show logs":"Показать журналы","Show only paused scripts":"Показывать только приостановленные сценарии","Show only running scripts":"Показывать только запущенные скрипты","Show only scripts with problems":"Показывать только скрипты с проблемами",Simulate:zY,"Some files will be rejected":"Некоторые файлы будут отклонены","Sound:":"Звук:",Stack:UY,Start:HY,"Start script":"Старт скрипта",State:WY,"State condition":"Сравнение состояния","Step into function":"Шаг в функционирование","Step out from function":"Выйти из функции","Stop on exception":"Остановить при исключении",Su:GY,"Subject:":"Предмет:",Sunday:VY,"TS description":"Создание правил путём написания Typescript",Telegram:KY,"Text:":"Текст:",Th:YY,"The script will be stopped and must be activated manually after debugging. Continue?":"Cкрипт будет остановлен и должен быть активирован вручную после отладки. Продолжать?","This is advances option. You can write your own code here and it will be executed on trigger":"Это расширеный вариант. Вы можете написать здесь свой код и он будет выполняться по триггеру",Thursday:JY,Time:qY,"Time condition":"Условие времени","Title:":"Заголовок:","To:":"К:","Trigger with value":"Триггер со значением",Triggered:XY,Triggers:ZY,"Triggers the on script saving or the javascript instance restart":"Запускает при сохранении скрипта или перезапуске экземпляра javascript","Triggers the rule on update or change of some state":"Запускает правило при обновлении или изменении какого-либо состояния","Triggers the rule periodically or on some specific time":"Срабатывает правило периодически или в определенное время",Tu:QY,Tuesday:eJ,URL:tJ,"Unknown error":"Неизвестная ошибка","Unknown error!":"Неизвестная ошибка!","Use generated code":"Использовать сгенерированный код","User function":"Функция пользователя","User:":"Пользователь:",Value:sJ,"Vibration:":"Вибрация:",Volume:oJ,We:iJ,Wednesday:nJ,"Whatsapp-cmb":"Whatsapp-cmb",Write:rJ,"Write your own code":"Напишите свой код",Yes:aJ,"Yet exists!":"Имя уже существует!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Вы можете использовать %s в URL-адресе, чтобы использовать текущее значение триггера, %id, чтобы использовать идентификатор инициированного объекта, %name, чтобы показать имя идентификатора инициированного объекта, или %old, чтобы использовать старое значение триггера.","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Вы можете использовать %s в команде, чтобы использовать текущее значение триггера, %id, чтобы использовать идентификатор сработавшего объекта, %name, чтобы показать имя сработавшего идентификатора объекта, или %old, чтобы использовать старое значение триггера.","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Вы можете использовать %s в тексте для отображения текущего значения триггера, %id для использования идентификатора сработавшего объекта, %name для отображения имени сработавшего идентификатора объекта или %old для использования старого значения триггера.","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Вы можете использовать %s в значении, чтобы использовать текущее значение триггера, %id, чтобы использовать идентификатор инициированного объекта, %name, чтобы показать имя идентификатора инициированного объекта, или %old, чтобы использовать старое значение триггера.","You have to enter OpenAI API key in the configuration of javascript adapter.":"Вы должны ввести ключ OpenAI API в конфигурации адаптера javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Необходимо ввести хотя бы один API-ключ (OpenAI, Anthropic или Gemini) в конфигурации адаптера javascript.","Please select a valid model":"Пожалуйста, выберите допустимую модель","[equal]":"[равно]","[greater or equal]":"[больше или равно]","[greater]":"[больше]","[hysteresis]":"[гистерезис]","[includes]":"[содержит]","[less or equal]":"[меньше или равно]","[less]":"[меньше]","[not equal]":"[не равно]",acknowledgment:lJ,all:cJ,and:uJ,"as JSON":"как JSON","as plain text":"как текст",astro:dJ,at:hJ,"clear running":"остановить уже бегущие",control:pJ,copy:gJ,cron:mJ,dawn:fJ,debug_help:$J,debug_label:bJ,default:"дефолт",dusk:vJ,easy:yJ,else:"иначе","equal to":"равно",every:_J,"every hour at 0 minutes":"каждый час через 0 минут",false:"false","file reading has failed: %s":"Ошибка чтения файла: %s","file reading was aborted":"Чтение файла было прервано",filter_func:wJ,filter_id:kJ,filter_name:CJ,filter_role:TJ,filter_room:SJ,"for edit or create script":"для редактирования или создайте новый скрипт","for professionals":"для профессионалов","for programmers":"для программистов",goldenHour:EJ,goldenHourEnd:IJ,"greater or equal":"больше или равно","greater or equal to":"больше или равно","greater than":"больше чем",help_just_check:xJ,help_on_change:DJ,"high priority":"высокий приоритет","high-priority":"высокий-приоритет","highest priority":"высший приоритет",hours:AJ,includes:OJ,interval:RJ,"just check":"просто проверить","less or equal":"меньше или равно","less or equal to":"меньше или равно","less than":"меньше, чем","lower priority":"более низкий приоритет","lowest priority":"самый низкий приоритет",magic:NJ,milliseconds:MJ,minutes:LJ,ms:PJ,nadir:BJ,nauticalDawn:FJ,nauticalDusk:jJ,nextSunrise:zJ,nextSunset:UJ,night:HJ,nightEnd:WJ,"no blocks found":"Блоков нет","no group":"Нет группы",normal:GJ,"normal priority":"нормальный приоритет","not equal to":"не равно","not properly connected":"Этот блок неправильно соединён или не соединён с другими блоками.",offset:VJ,"on change":"по изменению","on condition change":"при изменении результата условия","on update":"при обновлении",one:KJ,or:YJ,quiet:JJ,"reset search":"Cбросить поиск",search:qJ,seconds:XJ,solarNoon:ZJ,"store in":"сохранить в",sunrise:QJ,sunriseEnd:eq,sunset:tq,sunsetStart:sq,then:oq,"toggle value":"инвертировать текщее значение",tooltip_ack:iq,tooltip_from:nq,tooltip_lc:rq,tooltip_quality:aq,tooltip_ts:lq,tooltip_user:cq,tooltip_value:uq,true:"true",two:dq,undefined:"неопределенный",update:hq,"use seconds":"использовать секунды","use trigger value":"использовать значение триггера",verbose_help:pq,verbose_label:gq,when:mq,with:"с","with date":"с датой","with offset":"со сдвигом",wizard:fq,"Loading models...":"Загрузка моделей...","Could not connect to API at %s":"Не удалось подключиться к API по адресу %s","Invalid API key":"Недействительный ключ API","Access denied by API":"Доступ запрещён API","API error: %s":"Ошибка API: %s",'Model "%s" not found':'Модель "%s" не найдена',"Request failed: %s":"Запрос не удался: %s",Retry:$q,"No running javascript instance found":"Не найден работающий экземпляр JavaScript"},vq="Визнано",yq="Дії",_q="додати",wq="все",kq="Будь-який",Cq="Застосувати",Tq="квітень",Sq="Запитуйте",Eq="Астрономічний",Iq="серпень",xq="Скасувати",Dq="Закрити",Aq="Хвороба",Oq="Умови",Rq="Консоль",Nq="Скопійовано",Mq="Грудень",Lq="За замовчуванням",Pq="Затримка",Bq="Видалити",Fq="опис",jq="Готово",zq="Виконавча оболонка",Uq="Пояснення",Hq="Експорт",Wq="Лютий",Gq="Лютий",Vq="фільтр",Kq="Папка",Yq="О",Jq="П'ятниця",qq="ID",Xq="ID1",Zq="ID2",Qq="Імпорт",eX="Екземпляр",tX="Примірники",sX="Інструкції",oX="січень",iX="січня",nX="липень",rX="червень",aX="Ліміт",lX="березень",cX="Може",uX="Меню",dX="повідомлення",hX="пн",pX="Модель",gX="понеділок",mX="місяць",fX="Більше",$X="Ім'я",bX="Листопад",vX="в порядку",yX="жовтень",_X="В порядку",wX="Пауза",kX="Pushover",CX="Pushsafer",TX="Перейменувати",SX="Повторіть",EX="Перезапустіть",IX="Результат",xX="Sa",DX="Субота",AX="зберегти",OX="розклад",RX="Сценарій",NX="Вересень",MX="Симулювати",LX="Стек",PX="старт",BX="Держава",FX="Нд",jX="неділя",zX="Телеграма",UX="чт",HX="четвер",WX="час",GX="Спрацьовує",VX="Тригери",KX="вт",YX="вівторок",JX="URL",qX="Значення",XX="Обсяг",ZX="ми",QX="Середа",eZ="Напишіть",tZ="Так",sZ="підтвердження",oZ="все",iZ="і",nZ="Астро",rZ="в",aZ="КОНТРОЛЬ",lZ="копія",cZ="CRON",uZ="Світанок",dZ="Це особливий режим, в якому стану та об'єкти не змінюватимуться. Але в протоколі відображатиметься лише інформація про кожну заплановану зміну.",hZ="Відлагоджувати",pZ="Сутінки",gZ="легко",mZ="кожен",fZ="функція",$Z="ID",bZ="Ім'я",vZ="Роль",yZ="Кімната",_Z="Золота година",wZ="Кінець золотої години",kZ="Код буде виконуватися лише щоразу, коли умова виконується. наприклад якщо спрацьовує значення датчика температури та умова «якщо температура перевищує 20°C», дії «тоді» виконуватимуться щоразу, коли датчик надсилає температуру, і вона перевищує 20°C. На 21°C, на 22°C і так далі.",CZ="Код буде виконано лише у разі зміни результату умови. наприклад якщо спрацьовує значення датчика температури та умова «якщо температура перевищує 20°C», дії «тоді» будуть виконані один раз, коли температура буде вище 20. Наступного разу дії «тоді» буде виконано, коли температура падає нижче 20, а потім знову піднімається вище 20.",TZ="години",SZ="включає в себе",EZ="інтервал",IZ="магія",xZ="мілісекунд",DZ="хвилин",AZ="РС",OZ="Надір",RZ="Морський світанок",NZ="Морські сутінки",MZ="Наступний схід сонця",LZ="Наступний захід сонця",PZ="ніч",BZ="Кінець ночі",FZ="нормально",jZ="зсув",zZ="один",UZ="або",HZ="тихо",WZ="пошук",GZ="секунд",VZ="Сонячний полудень",KZ="схід сонця",YZ="Кінець сходу сонця",JZ="Захід сонця",qZ="Початок заходу сонця",XZ="потім",ZZ="Визнати",QZ="Від",eQ="Востаннє змінено",tQ="якість",sQ="Мітка часу",oQ="Користувач",iQ="Значення",nQ="два",rQ="оновлення",aQ="Додає вихідні дані налагодження до журналу для багатьох системних команд",lQ="Докладні результати журналу",cQ="коли",uQ="майстер",dQ="Повторити",hQ={"%s not found":"%s не знайдено","()":"()","(at %s)":"(у %s)","(optional)":"(необов'язково)","-":"-",".":".","AI code generator":"Генератор коду ШІ",Ack:vq,Actions:yq,"Actual time of day":"Фактичний час доби",Add:_q,"Add new script":"Додати новий сценарій",All:wq,"All files will be accepted":"Усі файли будуть прийняті",Any:kq,"Any month":"Будь-який місяць",Apply:Cq,April:Tq,"Are you sure?":"Ти впевнений?",Ask:Sq,Astronomical:Eq,"Astronomical events today":"Астрономічні події сьогодні",August:Iq,"Blockly description":"Створення правил за графічними блоками","Body:":"Тіло:",Cancel:xq,"Cannot delete non empty item!":"Неможливо видалити непорожній елемент!","Change layout":"Змінити макет",'Change theme (actual "%s")':'Змінити тему (тепер - "%s")',"Check blocks":"Перевірте блоки","Check is not active, because javascript adapter is disabled":"Перевірка не активна, оскільки адаптер Javascript вимкнено","Clear search input":"Очистити пошуковий запит","Click on this icon":"Натисніть на цей значок",Close:Dq,"Close all but current":"Закрити всі, крім поточних","Collapse all":"Закрити всі","Compares current time with astronomical event":"Порівнює поточний час з астрономічною подією","Compares current time with the user specific time":"Порівнює поточний час із конкретним часом користувача","Compares the state value with user defined value":"Порівнює значення стану з визначеним користувачем значенням",Condition:Aq,Conditions:Oq,"Configuration not saved.":"Конфігурація не збережена.",Console:Rq,"Control or update some state":"Контролюйте або оновлюйте певний стан","Control or update some state with delay":"Контролюйте або оновлюйте деякий стан із затримкою","Convert blockly to javascript for ever.":"Назавжди конвертуйте Blockly у Javascript.",Copied:Nq,"Copy script":"Копіювати сценарій","Copy to clipboard":"Копіювати в буфер обміну","Create new":"Створити новий","Create new folder":"Створити нову папку","Create new script":"Створіть новий сценарій","Create or edit CRON or time wizard":"Створення або редагування CRON або майстра часу","Dark Theme":"Темна тема","Dark style":"Темний стиль",Date:"Дата","Debug instance":"Екземпляр налагодження","Debug options":"Параметри налагодження",December:Mq,Default:Lq,"Define cron...":"Визначити cron...","Define schedule...":"Визначити розклад...",Delay:Pq,Delete:Bq,"Delete %s":"Видалити %s...","Delete folder":"Видалити папку","Delete script":"Видалити сценарій",Description:Fq,"Deselect all":"Зняти вибір із усіх","Discard changes for %s":"Скасувати зміни для %s",Done:jq,"Double click to write value":"Двічі клацніть, щоб записати значення","Download as file":"Завантажити файл","Drop some files here or click...":"Перетягніть кілька файлів сюди або натисніть...","Duplicate name":"Повторюване ім'я","Edit script or just double click":"Відредагуйте сценарій або просто двічі клацніть","Empty name is not allowed":"Порожнє ім'я не допускається","End search mode":"Завершити режим пошуку","Enter your question":"Введи своє прохання",Error:"Помилка","Error formatting code":"Помилка форматування коду","Error was found":"Виявлено помилку","Every day":"Кожен день",Exec:zq,"Executes some shell command":"Виконує певну команду оболонки","Existing scripts will be overwritten.":"Існуючі сценарії буде перезаписано.","Expand all":"Розгорнути все","Expert mode":"Експертний режим",Explanation:Uq,Export:Hq,"Export all scripts":"Експортувати всі сценарії","Export blocks":"Експорт блоків","Export selected blocks":"Експортувати вибрані блоки",Februar:Wq,February:Gq,Filter:Vq,Folder:Kq,Fr:Yq,Friday:Jq,Function:"функція","Function editor":"Редактор функцій","Function: executed":"Функція: виконано","Go to next line":"Перейти до наступного рядка","HTTP Call":"Виклик HTTP","Hide logs":"Приховати журнали",ID:qq,ID1:Xq,ID2:Zq,Import:Qq,"Import blocks":"Імпорт блоків","Import error":"Помилка імпорту","Import scripts":"Імпорт скриптів","Insert object ID":"Вставте ID об'єкта",Instance:eX,"Instance is disabled":"Примірник вимкнено","Instance:":"екземпляр:",Instances:tX,Instructions:sX,"Invalid CRON":"Недійсний CRON","It will not be possible to revert this operation.":"Скасувати цю операцію буде неможливо.","JS description":"Створення правил шляхом написання Javascript",Januar:oX,January:iX,July:nX,June:rX,"Just check":"Просто перевірте","Language:":"Мову:","Learn More":"Вивчайте більше","Light style":"Легкий стиль",Limit:aX,"Local time":"Місцевий час","Locate file":"Знайти файл","Log outputs":"Виходи журналу","Log text":"Текст журналу","Log: %s":"Журнал: %s","Make a HTTP get request":"Зробіть HTTP-запит на отримання","Make a pause between actions":"Між діями робіть паузу",March:lX,"March ":"березень",May:cX,Menu:uX,Message:dX,Mo:hX,Model:pX,Monday:gX,Month:mX,More:fX,Name:$X,"No API key found":"API-ключ не знайдено","No Chat GPT Key found":"Ключ GPT для чату не знайдено","No active host found":"Активний хост не знайдено","Nothing found":"Нічого не знайдено",November:bX,OK:vX,October:yX,Ok:_X,"On condition change":"За умови зміни результату","On script save or adapter start":"Під час збереження сценарію або запуску адаптера","On weekdays":"В будні дні","Open configuration":"Відкрита конфігурація","Operate two states":"Керуйте двома станами","Operations with two states":"Операції з двома станами","Paste your blocks here":"Вставте сюди свої блоки",Pause:wX,"Pause execution":"Призупинити виконання","Pause script":"Призупинити сценарій","Phone:":"телефон:","Please select object ID...":"Виберіть ідентифікатор об'єкта...","Press Ctrl+Enter to get the answer":"Натисніть Ctrl+Enter, щоб отримати відповідь","Prettify the script":"Прикрасьте сценарій","Print some text in log":"Надрукувати текст у журналі","Priority:":"Пріоритет:",Pushover:kX,Pushsafer:CX,"Read only ID selected: %s":"Вибрано ідентифікатор лише для читання: %s",Rename:TX,"Reorder scripts in folders":"Зміна порядку сценаріїв у папках",Repeat:SX,Restart:EX,Result:IX,"Resume execution":"Відновити виконання","Root folder":"Коренева папка","Rules description":"Створюйте правила з блоками IF, THEN, ELSE","Run script":"Запустіть сценарій",Sa:xX,Saturday:DX,Save:AX,"Save all":"Зберегти все","Say It":"Скажи це","Say some text via sayit adapter":"Скажіть текст через адаптер sayit",Schedule:OX,Script:RX,"Script %s was modified on disk":"Сценарій %s змінено на диску","Script is not running":"Сценарій не працює","Search in scripts":"Пошук у скриптах","Search...":"пошук...","Select all":"Вибрати все","Send email":"Відправити лист","Sends an email":"Надсилає електронний лист","Sends message via Pushsafer":"Надсилає повідомлення через Pushsafer","Sends message via pushover":"Надсилає повідомлення через pushover","Sends message via telegram":"Надсилає повідомлення через телеграм","Sends message via whatsapp-cmb":"Надсилає повідомлення через whatsapp-cmb",September:NX,"Server time":"Час сервера","Set state action":"Встановити дію стану","Set with delay":"Встановити із затримкою","Shell command":"Команда оболонки","Show astronomical events":"Показати астрономічні події","Show javascript code":"Показати код Javascript","Show logs":"Показати журнали","Show only paused scripts":"Показувати лише призупинені сценарії","Show only running scripts":"Показувати лише запущені сценарії","Show only scripts with problems":"Показувати лише сценарії з проблемами",Simulate:MX,"Some files will be rejected":"Деякі файли буде відхилено","Sound:":"звук:",Stack:LX,Start:PX,"Start script":"Запустити сценарій",State:BX,"State condition":"Стан стану","Step into function":"Крок у функції","Step out from function":"Вийти з функції","Stop on exception":"Зупинка на винятках",Su:FX,"Subject:":"Тема:",Sunday:jX,"TS description":"Створення правил шляхом написання Typescript",Telegram:zX,"Text:":"Текст:",Th:UX,"The script will be stopped and must be activated manually after debugging. Continue?":"Сценарій буде зупинено, і його необхідно активувати вручну після налагодження. Продовжити?","This is advances option. You can write your own code here and it will be executed on trigger":"Це авансовий варіант. Ви можете написати тут свій власний код, і він буде виконано на тригері",Thursday:HX,Time:WX,"Time condition":"Умова часу","Title:":"Назва:","To:":"до:","Trigger with value":"Тригер зі значенням",Triggered:GX,Triggers:VX,"Triggers the on script saving or the javascript instance restart":"Ініціює збереження сценарію або перезапуск екземпляра JavaScript","Triggers the rule on update or change of some state":"Запускає правило при оновленні або зміні якогось стану","Triggers the rule periodically or on some specific time":"Спрацьовує правило періодично або в певний час",Tu:KX,Tuesday:YX,URL:JX,"Unknown error":"Невідома помилка","Unknown error!":"Невідома помилка!","Use generated code":"Використовуйте згенерований код","User function":"Функція користувача","User:":"Користувач:",Value:qX,"Vibration:":"Вібрація:",Volume:XX,We:ZX,Wednesday:QX,"Whatsapp-cmb":"Whatsapp-cmb",Write:eZ,"Write your own code":"Напишіть власний код",Yes:tZ,"Yet exists!":"Все ж існує!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Ви можете використовувати %s в URL-адресі, щоб використовувати поточне значення тригера, %id, щоб використовувати ідентифікатор активованого об’єкта, %name, щоб показати назву ідентифікатора активованого об’єкта, або %old, щоб використовувати старе значення тригера","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Ви можете використовувати %s у команді, щоб використовувати поточне значення тригера, %id, щоб використовувати ідентифікатор активованого об’єкта, %name, щоб показати назву ідентифікатора активованого об’єкта, або %old, щоб використовувати старе значення тригера","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Ви можете використовувати %s у тексті для відображення поточного значення тригера, %id для використання ідентифікатора активованого об’єкта, %name для відображення імені ідентифікатора активованого об’єкта або %old для використання старого значення тригера","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Ви можете використовувати %s у значенні, щоб використовувати поточне значення тригера, %id, щоб використовувати ідентифікатор активованого об’єкта, %name, щоб показати назву ідентифікатора активованого об’єкта, або %old, щоб використовувати старе значення тригера","You have to enter OpenAI API key in the configuration of javascript adapter.":"Ви повинні ввести ключ OpenAI API у конфігурації адаптера JavaScript.","You have to enter at least one API key in the configuration of javascript adapter.":"Необхідно ввести хоча б один API-ключ (OpenAI, Anthropic або Gemini) у конфігурації адаптера JavaScript.","Please select a valid model":"Будь ласка, виберіть дійсну модель","[equal]":"[рівний]","[greater or equal]":"[більше або дорівнює]","[greater]":"[більший]","[hysteresis]":"[гістерезис]","[includes]":"[включає]","[less or equal]":"[менше або рівно]","[less]":"[менше]","[not equal]":"[не дорівнює]",acknowledgment:sZ,all:oZ,and:iZ,"as JSON":"як JSON","as plain text":"як текст",astro:nZ,at:rZ,"clear running":"чіткий біг",control:aZ,copy:lZ,cron:cZ,dawn:uZ,debug_help:dZ,debug_label:hZ,default:"за замовчуванням",dusk:pZ,easy:gZ,else:"інше","equal to":"дорівнює",every:mZ,"every hour at 0 minutes":"щогодини о 0 хвилин",false:"помилковий","file reading has failed: %s":"не вдалося прочитати файл: %s","file reading was aborted":"читання файлу було перервано",filter_func:fZ,filter_id:$Z,filter_name:bZ,filter_role:vZ,filter_room:yZ,"for edit or create script":"для редагування або створення нового сценарію","for professionals":"для професіоналів","for programmers":"для програмістів",goldenHour:_Z,goldenHourEnd:wZ,"greater or equal":"більший або рівний","greater or equal to":"більше або дорівнює","greater than":"більше, ніж, величніше ніж, крутіший за",help_just_check:kZ,help_on_change:CZ,"high priority":"високий пріоритет","high-priority":"високий пріоритет","highest priority":"найвищий пріоритет",hours:TZ,includes:SZ,interval:EZ,"just check":"просто перевірте","less or equal":"менше або дорівнює","less or equal to":"менше або дорівнює","less than":"менше ніж","lower priority":"нижчий пріоритет","lowest priority":"найнижчий пріоритет",magic:IZ,milliseconds:xZ,minutes:DZ,ms:AZ,nadir:OZ,nauticalDawn:RZ,nauticalDusk:NZ,nextSunrise:MZ,nextSunset:LZ,night:PZ,nightEnd:BZ,"no blocks found":"Блоків не знайдено","no group":"НЕМАЄ ГРУПИ",normal:FZ,"normal priority":"нормальний пріоритет","not equal to":"не дорівнює","not properly connected":"Цей блок неправильно з’єднаний з іншими блоками.",offset:jZ,"on change":"на зміну","on condition change":"про зміну умов","on update":"на оновлення",one:zZ,or:UZ,quiet:HZ,"reset search":"скинути пошук",search:WZ,seconds:GZ,solarNoon:VZ,"store in":"зберігати в",sunrise:KZ,sunriseEnd:YZ,sunset:JZ,sunsetStart:qZ,then:XZ,"toggle value":"значення перемикання",tooltip_ack:ZZ,tooltip_from:QZ,tooltip_lc:eQ,tooltip_quality:tQ,tooltip_ts:sQ,tooltip_user:oQ,tooltip_value:iQ,true:"правда",two:nQ,undefined:"невизначений",update:rQ,"use seconds":"використовуйте секунди","use trigger value":"використовувати значення тригера",verbose_help:aQ,verbose_label:lQ,when:cQ,with:"з","with date":"з датою","with offset":"зі зміщенням",wizard:uQ,"Loading models...":"Завантаження моделей...","Could not connect to API at %s":"Не вдалося підключитися до API за адресою %s","Invalid API key":"Недійсний ключ API","Access denied by API":"Доступ заборонено API","API error: %s":"Помилка API: %s",'Model "%s" not found':'Модель "%s" не знайдено',"Request failed: %s":"Запит не вдався: %s",Retry:dQ,"No running javascript instance found":"Не знайдено запущеного екземпляра JavaScript"},pQ="确认",gQ="动作",mQ="添加",fQ="所有",$Q="任何",bQ="申请",vQ="四月",yQ="问",_Q="天文",wQ="八月",kQ="取消",CQ="关闭",TQ="健康)状况",SQ="情况",EQ="安慰",IQ="复制的",xQ="十二月",DQ="默认",AQ="延迟",OQ="删除",RQ="描述",NQ="完成",MQ="执行力",LQ="解释",PQ="导出",BQ="二月",FQ="二月",jQ="筛选",zQ="文件夹",UQ="r",HQ="星期五",WQ="ID",GQ="ID1",VQ="ID2",KQ="导入",YQ="实例",JQ="实例",qQ="指示",XQ="亚努尔",ZQ="一月",QQ="七月",eee="六月",tee="限制",see="三月",oee="五月",iee="菜单",nee="信息",ree="莫",aee="模型",lee="星期一",cee="月",uee="更多的",dee="名称",hee="十一月",pee="好的",gee="十月",mee="确定",fee="暂停",$ee="俯卧撑",bee="推安全",vee="重命名",yee="重复",_ee="重启",wee="结果",kee="萨",Cee="星期六",Tee="保存",See="日程",Eee="脚本",Iee="九月",xee="模拟",Dee="堆",Aee="开始",Oee="状态",Ree="苏",Nee="星期日",Mee="电报",Lee="4",Pee="星期四",Bee="时间",Fee="触发",jee="扳机",zee="涂",Uee="星期二",Hee="网址",Wee="价值",Gee="体积",Vee="3",Kee="星期三",Yee="写",Jee="是的",qee="致谢",Xee="全部",Zee="和",Qee="天文",ete="在",tte="控制",ste="复制",ote="克朗",ite="黎明",nte="这是一种特殊模式,其中状态和对象不会改变。但只有有关每个计划更改的信息才会显示在协议中。",rte="调试",ate="黄昏",lte="简单的",cte="每一个",ute="功能",dte="ID",hte="名字",pte="角色",gte="房间",mte="黄金时段",fte="黄金时段结束",$te="仅在条件为真时才执行代码。例如。如果触发温度传感器值并且条件为“如果温度大于20°C”,则每次传感器发送温度且温度超过20°C时,将执行“然后”动作。 21°C,22°C等。",bte="仅当条件结果更改时,代码才会执行。例如。如果触发温度传感器值且条件为“如果温度大于20°C”,则温度超过20时将执行一次“则”动作,下一次,当温度超过20时将执行“则”动作低于20失败,然后再次超过20。",vte="小时",yte="包括",_te="间隔",wte="魔法",kte="毫秒",Cte="分钟",Tte="毫秒",Ste="最低点",Ete="航海黎明",Ite="航海黄昏",xte="下一个日出",Dte="下一个日落",Ate="夜晚",Ote="夜晚结束",Rte="普通的",Nte="抵消",Mte="一",Lte="或",Pte="安静的",Bte="搜索",Fte="秒",jte="星期日正午",zte="日出",Ute="日出结束",Hte="日落",Wte="日落开始",Gte="然后",Vte="确认",Kte="从",Yte="上一次改变",Jte="质量",qte="时间戳",Xte="用户",Zte="值",Qte="二",ese="更新",tse="将调试输出添加到许多系统命令的日志中",sse="详细日志输出",ose="什么时候",ise="巫师",nse="重试",rse={"%s not found":"%s 未找到","()":"()","(at %s)":"(在 %s)","(optional)":"(选修的)","-":"-",".":".","AI code generator":"AI代码生成器",Ack:pQ,Actions:gQ,"Actual time of day":"一天中的实际时间",Add:mQ,"Add new script":"添加新脚本",All:fQ,"All files will be accepted":"所有文件都将被接受",Any:$Q,"Any month":"任何月份",Apply:bQ,April:vQ,"Are you sure?":"你确定吗?",Ask:yQ,Astronomical:_Q,"Astronomical events today":"今天的天文事件",August:wQ,"Blockly description":"按图形块创建规则","Body:":"身体:",Cancel:kQ,"Cannot delete non empty item!":"无法删除非空项目!","Change layout":"变更版面",'Change theme (actual "%s")':"更改主题(现在为“%s”)","Check blocks":"检查块","Check is not active, because javascript adapter is disabled":"检查未激活,因为禁用了Javascript适配器","Clear search input":"清除搜索输入","Click on this icon":"单击此图标",Close:CQ,"Close all but current":"关闭所有(当前除外)","Collapse all":"全部收缩","Compares current time with astronomical event":"将当前时间与天文事件进行比较","Compares current time with the user specific time":"将当前时间与用户特定时间进行比较","Compares the state value with user defined value":"比较状态值和用户定义的值",Condition:TQ,Conditions:SQ,"Configuration not saved.":"配置未保存。",Console:EQ,"Control or update some state":"控制或更新某些状态","Control or update some state with delay":"延迟控制或更新某些状态","Convert blockly to javascript for ever.":"立即将blockly转换为Javascript。",Copied:IQ,"Copy script":"复制脚本","Copy to clipboard":"复制到剪贴板","Create new":"创建新的","Create new folder":"创建新文件夹","Create new script":"创建新脚本","Create or edit CRON or time wizard":"创建或编辑周期任务或时间向导","Dark Theme":"深色调主题","Dark style":"深色调风格",Date:"日期","Debug instance":"调试实例","Debug options":"调试选项",December:xQ,Default:DQ,"Define cron...":"定义周期任务...","Define schedule...":"定义调度器......",Delay:AQ,Delete:OQ,"Delete %s":"删除%s...","Delete folder":"删除文件夹","Delete script":"删除脚本",Description:RQ,"Deselect all":"取消全选","Discard changes for %s":"放弃%s的更改",Done:NQ,"Double click to write value":"Double click to write value","Download as file":"档案","Drop some files here or click...":"将文件拖拽到这里或单击......","Duplicate name":"重名","Edit script or just double click":"双击编辑脚本","Empty name is not allowed":"不允许使用空名称","End search mode":"结束搜索模式","Enter your question":"输入您的要求",Error:"错误","Error formatting code":"代码格式错误","Error was found":"发现错误","Every day":"每天",Exec:MQ,"Executes some shell command":"执行一些shell命令","Existing scripts will be overwritten.":"现有脚本将被覆盖。","Expand all":"展开全部","Expert mode":"专家模式",Explanation:LQ,Export:PQ,"Export all scripts":"导出所有脚本","Export blocks":"导出块","Export selected blocks":"导出选定的块",Februar:BQ,February:FQ,Filter:jQ,Folder:zQ,Fr:UQ,Friday:HQ,Function:"功能","Function editor":"功能编辑器","Function: executed":"功能:执行","Go to next line":"转到下一行","HTTP Call":"HTTP呼叫","Hide logs":"隐藏日志",ID:WQ,ID1:GQ,ID2:VQ,Import:KQ,"Import blocks":"导入块","Import error":"导入错误","Import scripts":"导入脚本","Insert object ID":"插入对象ID",Instance:YQ,"Instance is disabled":"实例已禁用","Instance:":"实例:",Instances:JQ,Instructions:qQ,"Invalid CRON":"无效的周期任务","It will not be possible to revert this operation.":"无法恢复此操作。","JS description":"通过编写Javascript来创建规则",Januar:XQ,January:ZQ,July:QQ,June:eee,"Just check":"只是检查","Language:":"语言:","Learn More":"了解更多","Light style":"浅色调风格",Limit:tee,"Local time":"当地时间","Locate file":"定位文件","Log outputs":"记录输出","Log text":"记录文字","Log: %s":"日志:%s","Make a HTTP get request":"发出HTTP获取请求","Make a pause between actions":"在动作之间暂停",March:see,"March ":"行进",May:oee,Menu:iee,Message:nee,Mo:ree,Model:aee,Monday:lee,Month:cee,More:uee,Name:dee,"No API key found":"未找到 API 密钥","No Chat GPT Key found":"找不到聊天 GPT 密钥","No active host found":"找不到活动主机","Nothing found":"没有发现",November:hee,OK:pee,October:gee,Ok:mee,"On condition change":"条件变化时","On script save or adapter start":"在脚本保存或适配器启动时","On weekdays":"在工作日","Open configuration":"开放配置","Operate two states":"操作两种状态","Operations with two states":"具有两种状态的操作","Paste your blocks here":"在此处粘贴您的区块",Pause:fee,"Pause execution":"暂停执行","Pause script":"暂停脚本","Phone:":"电话:","Please select object ID...":"请选择对象ID...","Press Ctrl+Enter to get the answer":"按 Ctrl+Enter 即可得到答案","Prettify the script":"美化脚本","Print some text in log":"在日志中打印一些文本","Priority:":"优先:",Pushover:$ee,Pushsafer:bee,"Read only ID selected: %s":"选择的只读ID:%s",Rename:vee,"Reorder scripts in folders":"重新排序文件夹中的脚本",Repeat:yee,Restart:_ee,Result:wee,"Resume execution":"恢复执行","Root folder":"根文件夹","Rules description":"使用IF,THEN,ELSE块创建规则","Run script":"运行脚本",Sa:kee,Saturday:Cee,Save:Tee,"Save all":"保存全部","Say It":"Say It","Say some text via sayit adapter":"通过sayit适配器说一些文字",Schedule:See,Script:Eee,"Script %s was modified on disk":"脚本%s已在磁盘上修改","Script is not running":"脚本没有运行","Search in scripts":"在脚本中搜索","Search...":"搜索...","Select all":"全选","Send email":"发送电子邮件","Sends an email":"发送邮件","Sends message via Pushsafer":"通过Pushsafer发送消息","Sends message via pushover":"通过推播发送消息","Sends message via telegram":"通过电报发送消息","Sends message via whatsapp-cmb":"通过whatsapp-cmb发送消息",September:Iee,"Server time":"服务器时间","Set state action":"设定状态动作","Set with delay":"延迟设置","Shell command":"Shell命令","Show astronomical events":"显示天文事件","Show javascript code":"显示Javascript代码","Show logs":"显示记录","Show only paused scripts":"仅显示暂停的脚本","Show only running scripts":"仅显示正在运行的脚本","Show only scripts with problems":"仅显示有问题的脚本",Simulate:xee,"Some files will be rejected":"有些文件将被拒绝","Sound:":"声音:",Stack:Dee,Start:Aee,"Start script":"启动脚本",State:Oee,"State condition":"状态条件","Step into function":"进入功能","Step out from function":"退出函数","Stop on exception":"异常停止",Su:Ree,"Subject:":"学科:",Sunday:Nee,"TS description":"通过编写Typescript来创建规则",Telegram:Mee,"Text:":"文本:",Th:Lee,"The script will be stopped and must be activated manually after debugging. Continue?":"该脚本将停止,并且必须在调试后手动激活。继续?","This is advances option. You can write your own code here and it will be executed on trigger":"这是高级选项。您可以在此处编写自己的代码,它将在触发器上执行",Thursday:Pee,Time:Bee,"Time condition":"时间条件","Title:":"标题:","To:":"到:","Trigger with value":"用值触发",Triggered:Fee,Triggers:jee,"Triggers the on script saving or the javascript instance restart":"触发脚本保存或javascript实例重启","Triggers the rule on update or change of some state":"在某些状态的更新或更改时触发规则","Triggers the rule periodically or on some specific time":"定期或在特定时间触发规则",Tu:zee,Tuesday:Uee,URL:Hee,"Unknown error":"未知错误","Unknown error!":"未知错误!","Use generated code":"使用生成的代码","User function":"用户功能","User:":"用户:",Value:Wee,"Vibration:":"振动:",Volume:Gee,We:Vee,Wednesday:Kee,"Whatsapp-cmb":"Whatsapp的cmb",Write:Yee,"Write your own code":"编写自己的代码",Yes:Jee,"Yet exists!":"不存在!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"您可以在 URL 中使用 %s 以使用当前触发值,%id 以使用触发对象 ID,%name 以显示触发对象 ID 名称或 %old 以使用旧触发值","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"您可以在命令中使用 %s 以使用当前触发值,%id 使用触发对象 ID,%name 显示触发对象 ID 名称或 %old 使用旧触发值","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"您可以在文本中使用 %s 显示当前触发值,%id 使用触发对象 ID,%name 显示触发对象 ID 名称或 %old 使用旧触发值","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"您可以在值中使用 %s 以使用当前触发器值,%id 使用触发对象 ID,%name 显示触发对象 ID 名称或 %old 使用旧触发器值","You have to enter OpenAI API key in the configuration of javascript adapter.":"您必须在 javascript 适配器的配置中输入 OpenAI API 密钥。","You have to enter at least one API key in the configuration of javascript adapter.":"您必须在 javascript 适配器的配置中输入至少一个 API 密钥(OpenAI、Anthropic 或 Gemini)。","Please select a valid model":"请选择一个有效的模型","[equal]":"[平等的]","[greater or equal]":"[大于等于]","[greater]":"[更大]","[hysteresis]":"[磁滞]","[includes]":"[包括]","[less or equal]":"[小于或等于]","[less]":"[较少的]","[not equal]":"[不相等]",acknowledgment:qee,all:Xee,and:Zee,"as JSON":"为 JSON","as plain text":"为纯文本",astro:Qee,at:ete,"clear running":"畅通无阻",control:tte,copy:ste,cron:ote,dawn:ite,debug_help:nte,debug_label:rte,default:"默认",dusk:ate,easy:lte,else:"别的","equal to":"等于",every:cte,"every hour at 0 minutes":"每小时0分钟",false:"错误的","file reading has failed: %s":"文件读取失败:%s","file reading was aborted":"文件读取中止",filter_func:ute,filter_id:dte,filter_name:hte,filter_role:pte,filter_room:gte,"for edit or create script":"用于编辑或创建脚本","for professionals":"对于专业人士","for programmers":"对于程序员",goldenHour:mte,goldenHourEnd:fte,"greater or equal":"大于或等于","greater or equal to":"大于或等于","greater than":"比...更棒",help_just_check:$te,help_on_change:bte,"high priority":"高优先级","high-priority":"高优先级","highest priority":"最高优先级",hours:vte,includes:yte,interval:_te,"just check":"只是检查","less or equal":"小于或等于","less or equal to":"小于或等于","less than":"少于","lower priority":"低优先级","lowest priority":"最低优先级",magic:wte,milliseconds:kte,minutes:Cte,ms:Tte,nadir:Ste,nauticalDawn:Ete,nauticalDusk:Ite,nextSunrise:xte,nextSunset:Dte,night:Ate,nightEnd:Ote,"no blocks found":"找不到块","no group":"没有组",normal:Rte,"normal priority":"正常优先","not equal to":"不等于","not properly connected":"此块未正确连接到其他块。",offset:Nte,"on change":"在变化","on condition change":"在条件变化时","on update":"更新时",one:Mte,or:Lte,quiet:Pte,"reset search":"重置搜索",search:Bte,seconds:Fte,solarNoon:jte,"store in":"存放在",sunrise:zte,sunriseEnd:Ute,sunset:Hte,sunsetStart:Wte,then:Gte,"toggle value":"切换值",tooltip_ack:Vte,tooltip_from:Kte,tooltip_lc:Yte,tooltip_quality:Jte,tooltip_ts:qte,tooltip_user:Xte,tooltip_value:Zte,true:"真的",two:Qte,undefined:"不明确的",update:ese,"use seconds":"精确到秒","use trigger value":"使用触发值",verbose_help:tse,verbose_label:sse,when:ose,with:"和","with date":"有日期","with offset":"带偏移",wizard:ise,"Loading models...":"加载模型...","Could not connect to API at %s":"无法连接到 %s 的 API","Invalid API key":"无效的 API 密钥","Access denied by API":"API 拒绝访问","API error: %s":"API 错误:%s",'Model "%s" not found':'未找到模型 "%s"',"Request failed: %s":"请求失败:%s",Retry:nse,"No running javascript instance found":"未找到正在运行的 JavaScript 实例"};function pc(a){throw new Error('Could not dynamically require "'+a+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var OC={exports:{}};(function(a,s){(function(i){a.exports=i()})(function(){return(function i(r,l,c){function d(f,b){if(!l[f]){if(!r[f]){var y=typeof pc=="function"&&pc;if(!b&&y)return y(f,!0);if(h)return h(f,!0);var w=new Error("Cannot find module '"+f+"'");throw w.code="MODULE_NOT_FOUND",w}var v=l[f]={exports:{}};r[f][0].call(v.exports,function(_){var $=r[f][1][_];return d($||_)},v,v.exports,i,r,l,c)}return l[f].exports}for(var h=typeof pc=="function"&&pc,p=0;p>2,v=(3&f)<<4|b>>4,_=1>6:64,$=2>4,b=(15&w)<<4|(v=h.indexOf(p.charAt($++)))>>2,y=(3&v)<<6|(_=h.indexOf(p.charAt($++))),E[S++]=f,v!==64&&(E[S++]=b),_!==64&&(E[S++]=y);return E}},{"./support":30,"./utils":32}],2:[function(i,r,l){var c=i("./external"),d=i("./stream/DataWorker"),h=i("./stream/Crc32Probe"),p=i("./stream/DataLengthProbe");function f(b,y,w,v,_){this.compressedSize=b,this.uncompressedSize=y,this.crc32=w,this.compression=v,this.compressedContent=_}f.prototype={getContentWorker:function(){var b=new d(c.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new p("data_length")),y=this;return b.on("end",function(){if(this.streamInfo.data_length!==y.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),b},getCompressedWorker:function(){return new d(c.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},f.createWorkerFrom=function(b,y,w){return b.pipe(new h).pipe(new p("uncompressedSize")).pipe(y.compressWorker(w)).pipe(new p("compressedSize")).withStreamInfo("compression",y)},r.exports=f},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(i,r,l){var c=i("./stream/GenericWorker");l.STORE={magic:"\0\0",compressWorker:function(){return new c("STORE compression")},uncompressWorker:function(){return new c("STORE decompression")}},l.DEFLATE=i("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(i,r,l){var c=i("./utils"),d=(function(){for(var h,p=[],f=0;f<256;f++){h=f;for(var b=0;b<8;b++)h=1&h?3988292384^h>>>1:h>>>1;p[f]=h}return p})();r.exports=function(h,p){return h!==void 0&&h.length?c.getTypeOf(h)!=="string"?(function(f,b,y,w){var v=d,_=w+y;f^=-1;for(var $=w;$<_;$++)f=f>>>8^v[255&(f^b[$])];return-1^f})(0|p,h,h.length,0):(function(f,b,y,w){var v=d,_=w+y;f^=-1;for(var $=w;$<_;$++)f=f>>>8^v[255&(f^b.charCodeAt($))];return-1^f})(0|p,h,h.length,0):0}},{"./utils":32}],5:[function(i,r,l){l.base64=!1,l.binary=!1,l.dir=!1,l.createFolders=!0,l.date=null,l.compression=null,l.compressionOptions=null,l.comment=null,l.unixPermissions=null,l.dosPermissions=null},{}],6:[function(i,r,l){var c=null;c=typeof Promise<"u"?Promise:i("lie"),r.exports={Promise:c}},{lie:37}],7:[function(i,r,l){var c=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",d=i("pako"),h=i("./utils"),p=i("./stream/GenericWorker"),f=c?"uint8array":"array";function b(y,w){p.call(this,"FlateWorker/"+y),this._pako=null,this._pakoAction=y,this._pakoOptions=w,this.meta={}}l.magic="\b\0",h.inherits(b,p),b.prototype.processChunk=function(y){this.meta=y.meta,this._pako===null&&this._createPako(),this._pako.push(h.transformTo(f,y.data),!1)},b.prototype.flush=function(){p.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},b.prototype.cleanUp=function(){p.prototype.cleanUp.call(this),this._pako=null},b.prototype._createPako=function(){this._pako=new d[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var y=this;this._pako.onData=function(w){y.push({data:w,meta:y.meta})}},l.compressWorker=function(y){return new b("Deflate",y)},l.uncompressWorker=function(){return new b("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(i,r,l){function c(v,_){var $,S="";for($=0;$<_;$++)S+=String.fromCharCode(255&v),v>>>=8;return S}function d(v,_,$,S,T,E){var D,M,P=v.file,W=v.compression,G=E!==f.utf8encode,z=h.transformTo("string",E(P.name)),Z=h.transformTo("string",f.utf8encode(P.name)),he=P.comment,Ce=h.transformTo("string",E(he)),R=h.transformTo("string",f.utf8encode(he)),K=Z.length!==P.name.length,C=R.length!==he.length,Q="",ve="",ce="",ne=P.dir,me=P.date,re={crc32:0,compressedSize:0,uncompressedSize:0};_&&!$||(re.crc32=v.crc32,re.compressedSize=v.compressedSize,re.uncompressedSize=v.uncompressedSize);var B=0;_&&(B|=8),G||!K&&!C||(B|=2048);var N=0,te=0;ne&&(N|=16),T==="UNIX"?(te=798,N|=(function(se,j){var Te=se;return se||(Te=j?16893:33204),(65535&Te)<<16})(P.unixPermissions,ne)):(te=20,N|=(function(se){return 63&(se||0)})(P.dosPermissions)),D=me.getUTCHours(),D<<=6,D|=me.getUTCMinutes(),D<<=5,D|=me.getUTCSeconds()/2,M=me.getUTCFullYear()-1980,M<<=4,M|=me.getUTCMonth()+1,M<<=5,M|=me.getUTCDate(),K&&(ve=c(1,1)+c(b(z),4)+Z,Q+="up"+c(ve.length,2)+ve),C&&(ce=c(1,1)+c(b(Ce),4)+R,Q+="uc"+c(ce.length,2)+ce);var q="";return q+=` + await setStateAsync("${s.oidResult}", val1_${s._id} ${s.operation} val2_${s._id}, ${s.tagCard==="update"});`}renderDebug(s){var i,r;return m.jsxs("span",{children:[x.I18n.t("Set:")," ",m.jsx("span",{className:s.data.ack?(i=this.props.classes)==null?void 0:i.valueAck:(r=this.props.classes)==null?void 0:r.valueNotAck,children:Ln(s.data.val)})]})}onTagChange(){const s=[];s.push({nameRender:"renderObjectID",title:"ID1",attr:"oid1",defaultValue:"",checkReadOnly:!1}),s.push({nameRender:"renderSelect",options:[{value:"+",title:"+"},{value:"-",title:"-"},{value:"*",title:"*"},{value:"/",title:"/"}],doNotTranslate:!0,defaultValue:"+",attr:"operation"}),s.push({nameRender:"renderObjectID",title:"ID2",attr:"oid2",defaultValue:"",checkReadOnly:!1}),s.push({nameRender:"renderNameText",defaultValue:"store in",attr:"textEqual"}),s.push({nameRender:"renderObjectID",attr:"oidResult",defaultValue:"",checkReadOnly:!0}),this.setState({inputs:s},()=>super.onTagChange(null,()=>{const i=JSON.parse(JSON.stringify(this.state.settings));this.props.onChange(i)}))}onValueChanged(s,i){this.onTagChange()}onUpdate(){this.onTagChange()}static getStaticData(){return{acceptedBy:"actions",name:"Operate two states",id:"ActionOperateStates",icon:"AddBox",tagCardArray:["control","update"],title:"Operations with two states"}}getData(){return Vc.getStaticData()}}const fR=[Ii,Pc,Bc,qr,Xr,Vo,Fc,jc,zc,Uc,Hc,Wc,Gc,Vc],hc={sayit:Rc,pushover:Nc,"whatsapp-cmb":Mc,pushsafer:Lc},$R=um({blocks:null,socket:null,onUpdate:!1,setOnUpdate:a=>{},setOnDebugMessage:a=>{},onDebugMessage:[],enableSimulation:!1,setEnableSimulation:a=>{},changedScripts:{},setChangedScripts:a=>{}}),bR=({children:a,socket:s})=>{const[i,r]=kt(null),[l,c]=kt(!1),[d,h]=kt([]),[p,f]=kt(!1),[b,y]=kt({});return Lt(()=>{l&&c(!1)},[l]),Lt(()=>{(async()=>{const w=await s.getAdapterInstances(),v=Object.keys(hc).filter(E=>w.find(D=>{var M;return((M=D==null?void 0:D.common)==null?void 0:M.name)===E})),_=[],$=w.filter(E=>E.common.javascriptRules),S=[];for(const E of $){if(S.includes(E.common.name)||!E.common.javascriptRules)continue;let D;if(E.common.javascriptRules.url.startsWith("http:")||E.common.javascriptRules.url.startsWith("https:")?D=E.common.javascriptRules.url:E.common.javascriptRules.url.startsWith("./")?D=`${window.location.protocol}//${window.location.host}${E.common.javascriptRules.url.replace(/^\./,"")}`:D=`${window.location.protocol}//${window.location.host}/adapter/${E.common.name}/${E.common.javascriptRules.url}`,E.common.javascriptRules.i18n===!0){const M=D.lastIndexOf("/");let P;M!==-1?P=D.substring(0,M):P=D;const W=x.I18n.getLanguage(),G=`${P}/i18n/${W}.json`;await fetch(G).then(z=>z.json()).then(z=>x.I18n.extendTranslations(z,W)).catch(z=>{if(W!=="en")return fetch(`${P}/i18n/en.json`).then(Z=>Z.json()).then(Z=>x.I18n.extendTranslations(Z,W)).catch(Z=>console.error(`Cannot load i18n "${G}": ${Z}`));console.log(`Cannot load i18n "${G}": ${z}`)})}else if(E.common.javascriptRules.i18n&&typeof E.common.javascriptRules.i18n=="object")try{x.I18n.extendTranslations(E.common.javascriptRules.i18n)}catch(M){console.error(`Cannot import i18n for "${E.common.javascriptRules.name}": ${M}`)}try{e_.registerRemotes([{name:E.common.javascriptRules.name,entry:D,type:E.common.javascriptRules.type}]);const M=(await e_.loadRemote(`${E.common.javascriptRules.name}/${E.common.javascriptRules.name}`)).default;M&&(_.push(M),S.push(E.common.name),hc[E.common.name]=null)}catch(M){console.error(`Cannot load component "${E.common.javascriptRules.name}": ${M}`)}}const T=v.filter(E=>hc[E]).map(E=>hc[E]);r([...fR,...T,..._])})()},[]),m.jsx($R.Provider,{value:{blocks:i,socket:s,onUpdate:l,setOnUpdate:c,onDebugMessage:d,setOnDebugMessage:h,enableSimulation:p,setEnableSimulation:f,changedScripts:b,setChangedScripts:y},children:a})},vR="Acknowledged",yR="Actions",_R="Add",wR="All",kR="Any",CR="Apply",TR="April",SR="Ask",ER="Astronomical",IR="August",xR="Cancel",DR="Close",AR="Condition",OR="Conditions",RR="Console",NR="Copied",MR="December",LR="Default",PR="Delay",BR="Delete",FR="Description",jR="Done",zR="Exec shell",UR="Explanation",HR="Export",WR="Februar",GR="February",VR="Filter",KR="Folder",YR="Fr",JR="Friday",qR="ID",XR="ID1",ZR="ID2",QR="Import",e1="Instance",t1="Instances",s1="Instructions",o1="Januar",i1="January",n1="July",r1="June",a1="Limit",l1="March",c1="May",u1="Menu",d1="Message",h1="Mo",p1="Model",g1="Monday",m1="Month",f1="More",$1="Name",b1="November",v1="OK",y1="October",_1="Ok",w1="Pause",k1="Pushover",C1="Pushsafer",T1="Rename",S1="Repeat",E1="Restart",I1="Result",x1="Sa",D1="Saturday",A1="Save",O1="Schedule",R1="Script",N1="September",M1="Simulate",L1="Stack",P1="Start",B1="State",F1="Su",j1="Sunday",z1="Telegram",U1="Th",H1="Thursday",W1="Time",G1="Triggered",V1="Triggers",K1="Tu",Y1="Tuesday",J1="URL",q1="Value",X1="Volume",Z1="We",Q1="Wednesday",eN="Write",tN="Yes",sN="acknowledgment",oN="all",iN="and",nN="Astro",rN="at",aN="control",lN="copy",cN="CRON",uN="Dawn",dN="This is a special mode in which states and objects will not change. But only information about each planned change will be displayed in the protocol.",hN="Debug",pN="Dusk",gN="easy",mN="every",fN="Function",$N="ID",bN="Name",vN="Role",yN="Room",_N="Golden hour",wN="End of golden hour",kN='The code will be executed only every time when condition is true. E.g. if triggering on the temperature sensor value and the condition is "if temperature is greater than 20°C", the "then" actions will be executed every time when sensor sends the temperature and it is over 20°C. By 21°C, by 22°C and so on.',CN='The code will be executed only if the condition result changes. E.g. if triggering on the temperature sensor value and the condition is "if temperature is greater than 20°C", the "then" actions will be executed once when temperature is over 20. Next time the "then" actions will be executed when the temperature fails under 20 and then rises over 20 again.',TN="hours",SN="includes",EN="interval",IN="magic",xN="milliseconds",DN="minutes",AN="ms",ON="Nadir",RN="Nautical dawn",NN="Nautical dusk",MN="Next Sunrise",LN="Next sunset",PN="Night",BN="Night end",FN="normal",jN="offset",zN="one",UN="or",HN="quiet",WN="search",GN="seconds",VN="Solar noon",KN="sunrise",YN="Sunrise end",JN="Sunset",qN="Sunset start",XN="then",ZN="Acknowledge",QN="From",eM="Last changed",tM="Quality",sM="Timestamp",oM="User",iM="Value",nM="two",rM="update",aM="Adds debug output to the log for many system commands",lM="Verbose log outputs",cM="when",uM="Wizard",dM="Retry",hM={"%s not found":"%s not found","()":"()","(at %s)":"(at %s)","(optional)":"(optional)","-":"-",".":".","AI code generator":"AI code generator",Ack:vR,Actions:yR,"Actual time of day":"Actual time of day",Add:_R,"Add new script":"Add new script",All:wR,"All files will be accepted":"All files will be accepted",Any:kR,"Any month":"Any month",Apply:CR,April:TR,"Are you sure?":"Are you sure?",Ask:SR,Astronomical:ER,"Astronomical events today":"Astronomical events today",August:IR,"Blockly description":"Creating rules by graphic blocks","Body:":"Body:",Cancel:xR,"Cannot delete non empty item!":"Cannot delete non empty item!","Change layout":"Change layout",'Change theme (actual "%s")':'Change theme (now - "%s")',"Check blocks":"Check blocks","Check is not active, because javascript adapter is disabled":"Check is not active, because Javascript adapter is disabled","Clear search input":"Clear search input","Click on this icon":"Click on this icon",Close:DR,"Close all but current":"Close all but current","Collapse all":"Collapse all","Compares current time with astronomical event":"Compares current time with astronomical event","Compares current time with the user specific time":"Compares current time with the user specific time","Compares the state value with user defined value":"Compares the state value with user defined value",Condition:AR,Conditions:OR,"Configuration not saved.":"Configuration not saved.",Console:RR,"Control or update some state":"Control or update some state","Control or update some state with delay":"Control or update some state with delay","Convert blockly to javascript for ever.":"Permanently convert Blockly to Javascript.",Copied:NR,"Copy script":"Copy script","Copy to clipboard":"Copy to clipboard","Create new":"Create new","Create new folder":"Create new folder","Create new script":"Create new script","Create or edit CRON or time wizard":"Create or edit CRON or time wizard","Dark Theme":"Dark theme","Dark style":"Dark style",Date:"Date","Debug instance":"Debug instance","Debug options":"Debug options",December:MR,Default:LR,"Define cron...":"Define cron...","Define schedule...":"Define schedule...",Delay:PR,Delete:BR,"Delete %s":"Delete %s...","Delete folder":"Delete folder","Delete script":"Delete script",Description:FR,"Deselect all":"Deselect all","Discard changes for %s":"Discard changes for %s",Done:jR,"Double click to write value":"Double click to write value","Download as file":"Download as file","Drop some files here or click...":"Drop some files here or click...","Duplicate name":"Duplicate name","Edit script or just double click":"Edit script or just double click","Empty name is not allowed":"Empty name is not allowed","End search mode":"End search mode","Enter your question":"Enter your request",Error:"Error","Error formatting code":"Error formatting code","Error was found":"Error was found","Every day":"Every day",Exec:zR,"Executes some shell command":"Executes some shell command","Existing scripts will be overwritten.":"Existing scripts will be overwritten.","Expand all":"Expand all","Expert mode":"Expert mode",Explanation:UR,Export:HR,"Export all scripts":"Export all scripts","Export blocks":"Export blocks","Export selected blocks":"Export selected blocks",Februar:WR,February:GR,Filter:VR,Folder:KR,Fr:YR,Friday:JR,Function:"Function","Function editor":"Function editor","Function: executed":"Function: executed","Go to next line":"Go to next line","HTTP Call":"HTTP Call","Hide logs":"Hide logs",ID:qR,ID1:XR,ID2:ZR,Import:QR,"Import blocks":"Import blocks","Import error":"Import error","Import scripts":"Import scripts","Insert object ID":"Insert object ID",Instance:e1,"Instance is disabled":"Instance is disabled","Instance:":"Instance:",Instances:t1,Instructions:s1,"Invalid CRON":"Invalid CRON","It will not be possible to revert this operation.":"It will not be possible to revert this operation.","JS description":"Creating rules by writing Javascript",Januar:o1,January:i1,July:n1,June:r1,"Just check":"Just check","Language:":"Language:","Learn More":"Learn More","Light style":"Light style",Limit:a1,"Local time":"Local time","Locate file":"Locate file","Log outputs":"Log outputs","Log text":"Log text","Log: %s":"Log: %s","Make a HTTP get request":"Make a HTTP get request","Make a pause between actions":"Make a pause between actions",March:l1,"March ":"March ",May:c1,Menu:u1,Message:d1,Mo:h1,Model:p1,Monday:g1,Month:m1,More:f1,Name:$1,"No API key found":"No API key found","No Chat GPT Key found":"No Chat GPT Key found","No active host found":"No active host found","Nothing found":"Nothing found",November:b1,OK:v1,October:y1,Ok:_1,"On condition change":"On condition result change","On script save or adapter start":"On script save or adapter start","On weekdays":"On weekdays","Open configuration":"Open configuration","Operate two states":"Operate two states","Operations with two states":"Operations with two states","Paste your blocks here":"Paste your blocks here",Pause:w1,"Pause execution":"Pause execution","Pause script":"Pause script","Phone:":"Phone:","Please select object ID...":"Please select object ID...","Press Ctrl+Enter to get the answer":"Press Ctrl+Enter to get the answer","Prettify the script":"Prettify the script","Print some text in log":"Print some text in log","Priority:":"Priority:",Pushover:k1,Pushsafer:C1,"Read only ID selected: %s":"Read only ID selected: %s",Rename:T1,"Reorder scripts in folders":"Reorder scripts in folders",Repeat:S1,Restart:E1,Result:I1,"Resume execution":"Resume execution","Root folder":"Root folder","Rules description":"Create rules with IF, THEN, ELSE blocks","Run script":"Run script",Sa:x1,Saturday:D1,Save:A1,"Save all":"Save all","Say It":"Say It","Say some text via sayit adapter":"Say some text via sayit adapter",Schedule:O1,Script:R1,"Script %s was modified on disk":"Script %s was modified on disk","Script is not running":"Script is not running","Search in scripts":"Search in scripts","Search...":"Search...","Select all":"Select all","Send email":"Send email","Sends an email":"Sends an email","Sends message via Pushsafer":"Sends message via Pushsafer","Sends message via pushover":"Sends message via pushover","Sends message via telegram":"Sends message via telegram","Sends message via whatsapp-cmb":"Sends message via whatsapp-cmb",September:N1,"Server time":"Server time","Set state action":"Set state action","Set with delay":"Set with delay","Shell command":"Shell command","Show astronomical events":"Show astronomical events","Show javascript code":"Show Javascript code","Show logs":"Show logs","Show only paused scripts":"Show only paused scripts","Show only running scripts":"Show only running scripts","Show only scripts with problems":"Show only scripts with problems",Simulate:M1,"Some files will be rejected":"Some files will be rejected","Sound:":"Sound:",Stack:L1,Start:P1,"Start script":"Start script",State:B1,"State condition":"State condition","Step into function":"Step into function","Step out from function":"Step out from function","Stop on exception":"Stop on exception",Su:F1,"Subject:":"Subject:",Sunday:j1,"TS description":"Creating rules by writing Typescript",Telegram:z1,"Text:":"Text:",Th:U1,"The script will be stopped and must be activated manually after debugging. Continue?":"The script will be stopped and must be activated manually after debugging. Continue?","This is advances option. You can write your own code here and it will be executed on trigger":"This is advances option. You can write your own code here and it will be executed on trigger",Thursday:H1,Time:W1,"Time condition":"Time condition","Title:":"Title:","To:":"To:","Trigger with value":"Trigger with value",Triggered:G1,Triggers:V1,"Triggers the on script saving or the javascript instance restart":"Triggers the on script saving or the javascript instance restart","Triggers the rule on update or change of some state":"Triggers the rule on update or change of some state","Triggers the rule periodically or on some specific time":"Triggers the rule periodically or on some specific time",Tu:K1,Tuesday:Y1,URL:J1,"Unknown error":"Unknown error","Unknown error!":"Unknown error!","Use generated code":"Use generated code","User function":"User function","User:":"User:",Value:q1,"Vibration:":"Vibration:",Volume:X1,We:Z1,Wednesday:Q1,"Whatsapp-cmb":"Whatsapp-cmb",Write:eN,"Write your own code":"Write your own code",Yes:tN,"Yet exists!":"Yet exists!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"You can use %s in the URL to use current trigger value, %id to use the triggered object ID, %name to show triggered object ID name or %old to use old trigger value","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"You can use %s in the command to use current trigger value, %id to use the triggered object ID, %name to show triggered object ID name or %old to use old trigger value","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"You can use %s in the text to display current trigger value, %id to use the triggered object ID, %name to show triggered object ID name or %old to use old trigger value","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"You can use %s in the value to use the current trigger value, %id to use the triggered object ID, %name to show triggered object ID name or %old to use old trigger value","You have to enter OpenAI API key in the configuration of javascript adapter.":"You have to enter OpenAI API key in the configuration of javascript adapter.","You have to enter at least one API key in the configuration of javascript adapter.":"You have to enter at least one API key (OpenAI, Anthropic or Gemini) in the configuration of javascript adapter.","Please select a valid model":"Please select a valid model","[equal]":"[equal]","[greater or equal]":"[greater or equal]","[greater]":"[greater]","[hysteresis]":"[hysteresis]","[includes]":"[includes]","[less or equal]":"[less or equal]","[less]":"[less]","[not equal]":"[not equal]",acknowledgment:sN,all:oN,and:iN,"as JSON":"as JSON","as plain text":"as plain text",astro:nN,at:rN,"clear running":"clear running",control:aN,copy:lN,cron:cN,dawn:uN,debug_help:dN,debug_label:hN,default:"default",dusk:pN,easy:gN,else:"else","equal to":"equal to",every:mN,"every hour at 0 minutes":"every hour at 0 minutes",false:"false","file reading has failed: %s":"file reading has failed: %s","file reading was aborted":"file reading was aborted",filter_func:fN,filter_id:$N,filter_name:bN,filter_role:vN,filter_room:yN,"for edit or create script":"for edit or create a new script","for professionals":"for professionals","for programmers":"for programmers",goldenHour:_N,goldenHourEnd:wN,"greater or equal":"greater or equal","greater or equal to":"greater or equal to","greater than":"greater than",help_just_check:kN,help_on_change:CN,"high priority":"high priority","high-priority":"high-priority","highest priority":"highest priority",hours:TN,includes:SN,interval:EN,"just check":"just check","less or equal":"less or equal","less or equal to":"less or equal to","less than":"less than","lower priority":"lower priority","lowest priority":"lowest priority",magic:IN,milliseconds:xN,minutes:DN,ms:AN,nadir:ON,nauticalDawn:RN,nauticalDusk:NN,nextSunrise:MN,nextSunset:LN,night:PN,nightEnd:BN,"no blocks found":"No blocks found","no group":"NO GROUP",normal:FN,"normal priority":"normal priority","not running":"not running","not equal to":"not equal to","not properly connected":"This block is not properly connected to other blocks.",offset:jN,"on change":"on change","on condition change":"on condition change","on update":"on update",one:zN,or:UN,quiet:HN,"reset search":"reset search",search:WN,seconds:GN,solarNoon:VN,"store in":"store in",sunrise:KN,sunriseEnd:YN,sunset:JN,sunsetStart:qN,then:XN,"toggle value":"toggle value",tooltip_ack:ZN,tooltip_from:QN,tooltip_lc:eM,tooltip_quality:tM,tooltip_ts:sM,tooltip_user:oM,tooltip_value:iM,true:"true",two:nM,undefined:"undefined",update:rM,"use seconds":"use seconds","use trigger value":"use trigger value",verbose_help:aM,verbose_label:lM,when:cM,with:"with","with date":"with date","with offset":"with offset",wizard:uM,"Loading models...":"Loading models...","Could not connect to API at %s":"Could not connect to API at %s","Invalid API key":"Invalid API key","Access denied by API":"Access denied by API","API error: %s":"API error: %s",'Model "%s" not found':'Model "%s" not found',"Request failed: %s":"Request failed: %s",Retry:dM,"No running javascript instance found":"No running javascript instance found"},pM="Bestätigt",gM="Aktionen",mM="Hinzufügen",fM="Alle",$M="Egal",bM="Anwenden",vM="April",yM="Fragen",_M="Astronomisch",wM="August",kM="Abbrechen",CM="Schließen",TM="Bedingung",SM="Bedingungen",EM="Konsole",IM="Kopiert",xM="Dezember",DM="Standard",AM="Verzögerung",OM="Löschen",RM="Beschreibung",NM="Fertig",MM="Exec shell",LM="Erläuterung",PM="Export",BM="Februar",FM="Februar",jM="Filter",zM="Ordner",UM="Fr",HM="Freitag",WM="ID",GM="ID1",VM="ID2",KM="Import",YM="Instanz",JM="Instanzen",qM="Anleitung",XM="Januar",ZM="Januar",QM="Juli",eL="Juni",tL="Grenze",sL="März",oL="Mai",iL="Menü",nL="Nachricht",rL="Mo",aL="Modell",lL="Montag",cL="Monat",uL="Mehr",dL="Name",hL="November",pL="OK",gL="Oktober",mL="Ok",fL="Pause",$L="Pushover",bL="Pushsafer",vL="Umbenennen",yL="Wiederholen",_L="Neustart",wL="Ergebnis",kL="Sa",CL="Samstag",TL="Speichern",SL="Zeitplan",EL="Skript",IL="September",xL="Simulieren",DL="Stack",AL="Start",OL="Zustand",RL="So",NL="Sonntag",ML="Telegram",LL="Do",PL="Donnerstag",BL="Zeit",FL="Ausgelöst",jL="Löst aus",zL="Di",UL="Dienstag",HL="URL",WL="Wert",GL="Volumen",VL="Mi",KL="Mittwoch",YL="Schreiben",JL="Ja",qL="Wissen",XL="alle",ZL="und",QL="Astro",eP="um",tP="Steuerung",sP="Kopie",oP="CRON",iP="Morgendämmerung",nP="Dies ist ein spezieller Modus, in dem sich Zustände und Objekte nicht ändern. Im Protokoll werden jedoch nur Informationen zu jeder geplanten Änderung angezeigt.",rP="Debuggen",aP="Abenddämmerung",lP="einfach",cP="jeder",uP="Funktion",dP="ID",hP="Name",pP="Rolle",gP="Raum",mP="Goldene Abendstunde",fP="Vormittag",$P='Der Code wird jedes Mal ausgeführt, wenn die Bedingung erfüllt ist. z.B. wenn der Temperatur wert sich ändert und die Bedingung "Wenn die Temperatur größer als 20°C ist" lautet, werden die "Dann" -Aktionen jedes Mal ausgeführt, wenn der Sensor die Temperatur sendet und diese über 20°C liegt. Bei 21°C, bei 22°C und so weiter.',bP='Der Code wird nur ausgeführt, wenn sich das Ergebnis der Bedingung ändert. z.B. wenn sich der Temperatur wert ändert und die Bedingung "Wenn die Temperatur größer als 20°C ist" lautet, werden die "Dann" -Aktionen einmal ausgeführt, wenn die Temperatur über 20°C liegt. Das nächste Mal werden die "Dann" -Aktionen ausgeführt, wenn die Temperatur unter 20°C gefallen ist und dann wieder über 20°C ansteigt.',vP="Stunden",yP="beinhaltet",_P="Intervall",wP="Magie",kP="Millisekunden",CP="Minuten",TP="ms",SP="Nadir",EP="nautische Morgendämmerung",IP="nautische Abenddämmerung",xP="Nächster Sonnenaufgang",DP="Nächster Sonnenuntergang",AP="Nacht",OP="astronomische Morgendämmerung",RP="Normal",NP="Versatz",MP="einer",LP="oder",PP="ruhig",BP="Suche",FP="Sekunden",jP="(Nach-)Mittag",zP="Sonnenaufgang",UP="Goldene Morgenstunde",HP="Sonnenuntergang",WP="Sonnenuntergang (Anfang)",GP="dann",VP="Bestätigen",KP="Von",YP="Zuletzt geändert",JP="Qualität",qP="Zeitstempel",XP="Benutzer",ZP="Wert",QP="zwei",eB="Aktualisieren",tB="Fügt Debug-Ausgaben für viele Systembefehle zum Protokoll hinzu",sB="Ausführliche Protokollausgaben",oB="falls",iB="Assistent",nB="Erneut versuchen",rB={"%s not found":"%s nicht gefunden","()":"()","(at %s)":"(um %s)","(optional)":"(optional)","-":"-",".":".","AI code generator":"KI-Codegenerator",Ack:pM,Actions:gM,"Actual time of day":"Tatsächliche Tageszeit",Add:mM,"Add new script":"Neues Skript hinzufügen",All:fM,"All files will be accepted":"Alle Dateien werden akzeptiert",Any:$M,"Any month":"Jeden Monat",Apply:bM,April:vM,"Are you sure?":"Wirklich sicher?",Ask:yM,Astronomical:_M,"Astronomical events today":"Astronomische Ereignisse heute",August:wM,"Blockly description":"Erstellen von Regeln durch Grafikblöcke","Body:":"Körper:",Cancel:kM,"Cannot delete non empty item!":"Kann nicht gelöscht werden, weil noch einige Elementen darin sind!","Change layout":"Layout ändern",'Change theme (actual "%s")':'Thema ändern (jetzt - "%s")',"Check blocks":"Blöcke prüfen","Check is not active, because javascript adapter is disabled":"Syntax-Check ist nicht aktiv, weil der Javascript Adapter nicht aktiv ist.","Clear search input":"Sucheingabe löschen","Click on this icon":"Auf dieses Symbol klicken",Close:CM,"Close all but current":"Alle anderen außer dem Aktiven schließen","Collapse all":"Alles einklappen","Compares current time with astronomical event":"Vergleicht die aktuelle Zeit mit einem astronomischen Ereignis","Compares current time with the user specific time":"Vergleicht die aktuelle Zeit mit der benutzerspezifischen Zeit","Compares the state value with user defined value":"Vergleicht den Zustandswert mit dem benutzerdefinierten Wert",Condition:TM,Conditions:SM,"Configuration not saved.":"Die Konfiguration ist nicht gespeichert.",Console:EM,"Control or update some state":"Zustand steuern oder aktualisieren","Control or update some state with delay":"Zustand mit Verzögerung steuern oder aktualisieren","Convert blockly to javascript for ever.":"Blockly dauerhaft in Javascript konvertieren.",Copied:IM,"Copy script":"Skript kopieren","Copy to clipboard":"In die Zwischenablage kopieren","Create new":"Neu erstellen","Create new folder":"Neuen Ordner erstellen","Create new script":"Neues Skript erstellen","Create or edit CRON or time wizard":"CRON- oder Zeit-Assistenten erstellen oder bearbeiten","Dark Theme":"Dunkles Thema","Dark style":"Dunkler Stil",Date:"Datum","Debug instance":"Debug-Instanz","Debug options":"Debug-Optionen",December:xM,Default:DM,"Define cron...":"Cron definieren ...","Define schedule...":"Zeitplan definieren ...",Delay:AM,Delete:OM,"Delete %s":"Löschen %s...","Delete folder":"Ordner löschen","Delete script":"Skript löschen",Description:RM,"Deselect all":"Alles abwählen","Discard changes for %s":"Änderungen für %s verwerfen",Done:NM,"Double click to write value":"Doppelklick zum Schreiben des Wertes","Download as file":"Download als Datei","Drop some files here or click...":"Dateien hier ablegen oder klicken ...","Duplicate name":"Doppelter Name","Edit script or just double click":"Skript bearbeiten oder einfach doppelklicken","Empty name is not allowed":"Leerer Name ist nicht zulässig","End search mode":"Suchmodus beenden","Enter your question":"Anfrage eingeben",Error:"Fehler","Error formatting code":"Fehler beim Formatieren des Codes","Error was found":"Fehler wurde gefunden","Every day":"Täglich",Exec:MM,"Executes some shell command":"Führt einen Shell-Befehl aus","Existing scripts will be overwritten.":"Vorhandene Skripte werden überschrieben.","Expand all":"Alle erweitern","Expert mode":"Expertenmodus",Explanation:LM,Export:PM,"Export all scripts":"Alle Skripte exportieren","Export blocks":"Blöcke exportieren","Export selected blocks":"Ausgewählte Blöcke exportieren",Februar:BM,February:FM,Filter:jM,Folder:zM,Fr:UM,Friday:HM,Function:"Funktion","Function editor":"Funktions-Editor","Function: executed":"Funktion: ausgeführt","Go to next line":"Gehe zur nächsten Zeile","HTTP Call":"HTTP-Aufruf","Hide logs":"Protokoll ausblenden",ID:WM,ID1:GM,ID2:VM,Import:KM,"Import blocks":"Blöcke importieren","Import error":"Fehler beim Importieren","Import scripts":"Skripte importieren","Insert object ID":"Objekt-ID einfügen",Instance:YM,"Instance is disabled":"Instanz ist deaktiviert","Instance:":"Instanz:",Instances:JM,Instructions:qM,"Invalid CRON":"Ungültiger CRON","It will not be possible to revert this operation.":"Dieser Vorgang kann nicht rückgängig gemacht werden.","JS description":"Regeln erstellen mit JavaScript",Januar:XM,January:ZM,July:QM,June:eL,"Just check":"Einfach überprüfen","Language:":"Sprache:","Learn More":"Mehr erfahren","Light style":"Heller Stil",Limit:tL,"Local time":"Lokale Zeit","Locate file":"Datei zeigen","Log outputs":"Protokoll","Log text":"Protokolltext","Log: %s":"Log: %s","Make a HTTP get request":"Eine HTTP-Abrufanforderung stellen","Make a pause between actions":"Eine Pause zwischen den Aktionen machen",March:sL,"March ":"März ",May:oL,Menu:iL,Message:nL,Mo:rL,Model:aL,Monday:lL,Month:cL,More:uL,Name:dL,"No API key found":"Kein API-Schlüssel gefunden","No Chat GPT Key found":"Kein Chat-GPT-Schlüssel gefunden","No active host found":"Kein aktiver Host gefunden","Nothing found":"Nichts gefunden",November:hL,OK:pL,October:gL,Ok:mL,"On condition change":"Bei Änderung des Ergebnis der Bedingung","On script save or adapter start":"Beim Speichern des Skripts oder beim Starten des Adapters","On weekdays":"An Wochentagen","Open configuration":"Konfiguration öffnen","Operate two states":"Zwei Zustände operieren","Operations with two states":"Operationen mit zwei Zuständen","Paste your blocks here":"Fügen Sie Ihre Blöcke hier ein",Pause:fL,"Pause execution":"Ausführung pausieren","Pause script":"Skript anhalten","Phone:":"Telefon:","Please select object ID...":"Objekt-ID auswählen ...","Press Ctrl+Enter to get the answer":"Strg+Eingabetaste, um die Antwort zu erhalten","Prettify the script":"Verschönern Sie das Skript","Print some text in log":"Einen Text im Protokoll ausdrucken","Priority:":"Priorität:",Pushover:$L,Pushsafer:bL,"Read only ID selected: %s":"Schreibgeschützte ID ausgewählt: %s",Rename:vL,"Reorder scripts in folders":"Skripte in Ordnern neu ordnen",Repeat:yL,Restart:_L,Result:wL,"Resume execution":"Ausführung fortsetzen","Root folder":"Root-Verzeichnis","Rules description":"Regeln erstellen mit WENN-, DANN- und SONST-Blöcken","Run script":"Skript ausführen",Sa:kL,Saturday:CL,Save:TL,"Save all":"Alle speichern","Say It":"Say It","Say some text via sayit adapter":"Einen Text über den Sayit-Adapter sagen",Schedule:SL,Script:EL,"Script %s was modified on disk":'Skript "%s" wurde auf der Festplatte geändert',"Script is not running":"Skript läuft nicht","Search in scripts":"Suche in Skripten","Search...":"Suche...","Select all":"Alles auswählen","Send email":"E-Mail senden","Sends an email":"Sendet eine E-Mail","Sends message via Pushsafer":"Sendet eine Nachricht über Pushsafer","Sends message via pushover":"Sendet eine Nachricht per Pushover","Sends message via telegram":"Sendet eine Nachricht per telegram","Sends message via whatsapp-cmb":"Sendet eine Nachricht über WhatsApp-Cmb",September:IL,"Server time":"Server-Zeit","Set state action":"Zustand setzten","Set with delay":"Setzen mit Verzögerung","Shell command":"Shell-Befehl","Show astronomical events":"Astronomische Ereignisse anzeigen","Show javascript code":"Javascript-Code zeigen","Show logs":"Protokoll anzeigen","Show only paused scripts":"Nur angehaltene Skripte zeigen","Show only running scripts":"Nur laufende Skripte zeigen","Show only scripts with problems":"Nur Skripte mit Problemen zeigen",Simulate:xL,"Some files will be rejected":"Einige Dateien werden abgelehnt","Sound:":"Klang:",Stack:DL,Start:AL,"Start script":"Skript starten",State:OL,"State condition":"Zustandsbedingung","Step into function":"Schritt in die Funktion","Step out from function":"Raus aus der Funktion","Stop on exception":"Bei Ausnahme anhalten",Su:RL,"Subject:":"Gegenstand:",Sunday:NL,"TS description":"Regeln erstellen mit TypeScript",Telegram:ML,"Text:":"Text:",Th:LL,"The script will be stopped and must be activated manually after debugging. Continue?":"Das Skript wird gestoppt und muss nach dem Debuggen manuell aktiviert werden. Fortsetzen?","This is advances option. You can write your own code here and it will be executed on trigger":"Dies ist eine erweiterte Option. Sie können hier Ihren eigenen Code schreiben, der beim Auslösen ausgeführt wird",Thursday:PL,Time:BL,"Time condition":"Zeitbedingung","Title:":"Titel:","To:":"Zu:","Trigger with value":"Trigger mit Wert",Triggered:FL,Triggers:jL,"Triggers the on script saving or the javascript instance restart":"Löst das Speichern des Skripts oder den Neustart der Javascript-Instanz aus","Triggers the rule on update or change of some state":"Löst die Regel beim Aktualisieren oder Ändern eines Zustands aus","Triggers the rule periodically or on some specific time":"Löst periodisch oder zu einem bestimmten Zeitpunkt aus",Tu:zL,Tuesday:UL,URL:HL,"Unknown error":"Unbekannter Fehler","Unknown error!":"Unbekannter Fehler!","Use generated code":"Code verwenden","User function":"Benutzerfunktion","User:":"Benutzer:",Value:WL,"Vibration:":"Vibration:",Volume:GL,We:VL,Wednesday:KL,"Whatsapp-cmb":"WhatsApp-cmb",Write:YL,"Write your own code":"Eigenen Code schreiben",Yes:JL,"Yet exists!":"Existiert schon!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Sie können %s in der URL verwenden, um den aktuellen Triggerwert zu verwenden, %id, um die ausgelöste Objekt-ID zu verwenden, %name, um den ID-Namen des ausgelösten Objekts anzuzeigen, oder %old, um den alten Triggerwert zu verwenden","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Sie können %s im Befehl verwenden, um den aktuellen Triggerwert zu verwenden, %id, um die ausgelöste Objekt-ID zu verwenden, %name, um den ID-Namen des ausgelösten Objekts anzuzeigen, oder %old, um den alten Triggerwert zu verwenden","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Sie können %s im Text verwenden, um den aktuellen Triggerwert anzuzeigen, %id, um die ausgelöste Objekt-ID zu verwenden, %name, um den ID-Namen des ausgelösten Objekts anzuzeigen, oder %old, um den alten Triggerwert zu verwenden","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Sie können %s im Wert verwenden, um den aktuellen Triggerwert zu verwenden, %id, um die ID des ausgelösten Objekts zu verwenden, %name, um den ID-Namen des ausgelösten Objekts anzuzeigen, oder %old, um den alten Triggerwert zu verwenden","You have to enter OpenAI API key in the configuration of javascript adapter.":"Sie müssen den OpenAI-API-Schlüssel in der Konfiguration des Javascript-Adapters eingeben.","You have to enter at least one API key in the configuration of javascript adapter.":"Sie müssen mindestens einen API-Schlüssel (OpenAI, Anthropic oder Gemini) in der Konfiguration des Javascript-Adapters eingeben.","Please select a valid model":"Bitte wählen Sie ein gültiges Modell aus","[equal]":"[gleich]","[greater or equal]":"[größer oder gleich]","[greater]":"[größer]","[hysteresis]":"[Hysterese]","[includes]":"[enthält]","[less or equal]":"[kleiner oder gleich]","[less]":"[kleiner]","[not equal]":"[ungleich]",acknowledgment:qL,all:XL,and:ZL,"as JSON":"als JSON","as plain text":"als Klartext",astro:QL,at:eP,"clear running":"laufende abbrechen",control:tP,copy:sP,cron:oP,dawn:iP,debug_help:nP,debug_label:rP,default:"Standard",dusk:aP,easy:lP,else:"sonst","equal to":"gleich",every:cP,"every hour at 0 minutes":"jede Stunde bei 0 Minuten",false:"falsch","file reading has failed: %s":"Das Lesen der Datei ist fehlgeschlagen: %s","file reading was aborted":"Das Lesen der Datei wurde abgebrochen",filter_func:uP,filter_id:dP,filter_name:hP,filter_role:pP,filter_room:gP,"for edit or create script":"zum Bearbeiten oder zum Erstellen eines neues Skripts","for professionals":"für Profis","for programmers":"für Programmierer",goldenHour:mP,goldenHourEnd:fP,"greater or equal":"größer oder gleich","greater or equal to":"größer oder gleich","greater than":"größer als",help_just_check:$P,help_on_change:bP,"high priority":"hohe Priorität","high-priority":"hohe Priorität","highest priority":"höchste Priorität",hours:vP,includes:yP,interval:_P,"just check":"einfach prüfen","less or equal":"kleiner oder gleich","less or equal to":"kleiner oder gleich","less than":"kleiner als","lower priority":"geringere Priorität","lowest priority":"niedrigste Priorität",magic:wP,milliseconds:kP,minutes:CP,ms:TP,nadir:SP,nauticalDawn:EP,nauticalDusk:IP,nextSunrise:xP,nextSunset:DP,night:AP,nightEnd:OP,"no blocks found":"Keine Blöcke gefunden","no group":"KEINE GRUPPE",normal:RP,"normal priority":"normale Priorität","not running":"nicht gestartet","not equal to":"ungleich","not properly connected":"Dieser Block ist mit anderen nicht richtig verbunden.",offset:NP,"on change":"bei Änderung","on condition change":"bei Zustandsänderung","on update":"beim Aktualisieren",one:MP,or:LP,quiet:PP,"reset search":"Suche zurücksetzen",search:BP,seconds:FP,solarNoon:jP,"store in":"speichern in",sunrise:zP,sunriseEnd:UP,sunset:HP,sunsetStart:WP,then:GP,"toggle value":"Wert umschalten",tooltip_ack:VP,tooltip_from:KP,tooltip_lc:YP,tooltip_quality:JP,tooltip_ts:qP,tooltip_user:XP,tooltip_value:ZP,true:"wahr",two:QP,undefined:"nicht definiert",update:eB,"use seconds":"Sekunden verwenden","use trigger value":"Triggerwert benutzen",verbose_help:tB,verbose_label:sB,when:oB,with:"mit","with date":"mit Datum","with offset":"mit Versatz",wizard:iB,"Loading models...":"Modelle werden geladen...","Could not connect to API at %s":"Verbindung zur API unter %s nicht möglich","Invalid API key":"Ungültiger API-Schlüssel","Access denied by API":"Zugriff von der API verweigert","API error: %s":"API-Fehler: %s",'Model "%s" not found':'Modell "%s" nicht gefunden',"Request failed: %s":"Anfrage fehlgeschlagen: %s",Retry:nB,"No running javascript instance found":"Keine laufende JavaScript-Instanz gefunden"},aB="Admitido",lB="Comportamiento",cB="Añadir",uB="Todos",dB="Alguna",hB="Apply",pB="abril",gB="Preguntar",mB="Astronómico",fB="agosto",$B="Cancelar",bB="Cerrar",vB="Condición",yB="Condiciones",_B="Consola",wB="Copiado",kB="diciembre",CB="Defecto",TB="Demora",SB="Eliminar",EB="Descripción",IB="Hecho",xB="Ejecutivo shell",DB="Explicación",AB="Exportar",OB="Februar",RB="febrero",NB="Filtrar",MB="Carpeta",LB="P.",PB="viernes",BB="CARNÉ DE IDENTIDAD",FB="ID1",jB="ID2",zB="Importar",UB="Ejemplo",HB="Instancias",WB="Instrucciones",GB="Enero",VB="enero",KB="julio",YB="junio",JB="Límite",qB="marzo",XB="Mayo",ZB="Menú",QB="Mensaje",e2="Mes",t2="Modelo",s2="lunes",o2="Mes",i2="Más",n2="Nombre",r2="noviembre",a2="OK",l2="octubre",c2="Okay",u2="Pausa",d2="Persona fácil de convencer",h2="Pushsafer",p2="Rebautizar",g2="Repetir",m2="Reiniciar",f2="Resultado",$2="Sa",b2="sábado",v2="Salvar",y2="Calendario",_2="Guión",w2="septiembre",k2="Simular",C2="Stack",T2="Comienzo",S2="Expresar",E2="Su",I2="domingo",x2="Telegrama",D2="4",A2="jueves",O2="Tiempo",R2="Motivado",N2="Disparadores",M2="Tu",L2="martes",P2="URL",B2="Valor",F2="Volumen",j2="3",z2="miércoles",U2="Escribir",H2="sí",W2="Reconocimiento",G2="todos",V2="y",K2="astro",Y2="a",J2="control",q2="Copiar",X2="CRON",Z2="Amanecer",Q2="Este es un modo especial en el que los estados y los objetos no cambiarán. Pero solo se mostrará información sobre cada cambio planificado en el protocolo.",eF="Depurar",tF="Oscuridad",sF="fácil",oF="cada",iF="Función",nF="CARNÉ DE IDENTIDAD",rF="Nombre",aF="Papel",lF="Habitación",cF="hora dorada",uF="Fin de la hora dorada",dF='El código se ejecutará solo cada vez que la condición sea verdadera. P.ej. si se activa en el valor del sensor de temperatura y la condición es "si la temperatura es superior a 20 ° C", las acciones "entonces" se ejecutarán cada vez que el sensor envíe la temperatura y supere los 20 ° C. Por 21 ° C, por 22 ° C y así sucesivamente.',hF='El código se ejecutará solo si cambia el resultado de la condición. P.ej. si se activa en el valor del sensor de temperatura y la condición es "si la temperatura es superior a 20 ° C", las acciones "entonces" se ejecutarán una vez cuando la temperatura sea superior a 20. La próxima vez, las acciones "entonces" se ejecutarán cuando la temperatura falla por debajo de 20 y luego sube por encima de 20 nuevamente.',pF="horas",gF="incluye",mF="intervalo",fF="magia",$F="milisegundos",bF="minutos",vF="ms",yF="nadir",_F="Amanecer náutico",wF="Atardecer náutico",kF="próximo amanecer",CF="Próxima puesta de sol",TF="Noche",SF="Fin de la noche",EF="normal",IF="compensar",xF="uno",DF="o",AF="tranquilo",OF="buscar",RF="segundos",NF="Mediodía solar",MF="amanecer",LF="Final del amanecer",PF="puesta de sol",BF="Inicio al atardecer",FF="entonces",jF="Reconocer",zF="De",UF="Último cambio",HF="Calidad",WF="Marca de tiempo",GF="Usuario",VF="Valor",KF="dos",YF="actualizar",JF="Agrega salida de depuración al registro para muchos comandos del sistema",qF="Salidas de registro detalladas",XF="cuando",ZF="Wizard",QF="Reintentar",ej={"%s not found":"%s no encontrado","()":"()","(at %s)":"(en %s)","(optional)":"(Opcional)","-":"-",".":".","AI code generator":"Generador de código de IA",Ack:aB,Actions:lB,"Actual time of day":"Hora real del día",Add:cB,"Add new script":"Agregar nuevo script",All:uB,"All files will be accepted":"Todos los archivos serán aceptados.",Any:dB,"Any month":"Cualquier mes",Apply:hB,April:pB,"Are you sure?":"¿Estás seguro?",Ask:gB,Astronomical:mB,"Astronomical events today":"Eventos astronómicos hoy",August:fB,"Blockly description":"Crear reglas por bloques gráficos","Body:":"Cuerpo:",Cancel:$B,"Cannot delete non empty item!":"¡No se puede eliminar un elemento no vacío!","Change layout":"Cambia el diseño",'Change theme (actual "%s")':'Cambiar tema (ahora - "%s")',"Check blocks":"Comprobar bloques","Check is not active, because javascript adapter is disabled":"La comprobación no está activa porque el adaptador Javascript está desactivado","Clear search input":"Borrar entrada de búsqueda","Click on this icon":"Haga clic en este ícono",Close:bB,"Close all but current":"Cerrar todo menos el actual","Collapse all":"Desplegar todo","Compares current time with astronomical event":"Compara la hora actual con un evento astronómico","Compares current time with the user specific time":"Compara la hora actual con la hora específica del usuario","Compares the state value with user defined value":"Compara el valor del estado con el valor definido por el usuario",Condition:vB,Conditions:yB,"Configuration not saved.":"Configuración no guardada.",Console:_B,"Control or update some state":"Controlar o actualizar algún estado","Control or update some state with delay":"Controlar o actualizar algún estado con retraso","Convert blockly to javascript for ever.":"Convierta instantáneamente en bloque a Javascript.",Copied:wB,"Copy script":"Copiar guion","Copy to clipboard":"Copiar al portapapeles","Create new":"Crear nuevo","Create new folder":"Crear nueva carpeta","Create new script":"Crear nuevo script","Create or edit CRON or time wizard":"Crear o editar CRON o asistente de tiempo","Dark Theme":"Tema oscuro","Dark style":"Estilo oscuro",Date:"Fecha","Debug instance":"Instancia de depuración","Debug options":"Opciones de depuración",December:kB,Default:CB,"Define cron...":"Definir cron ...","Define schedule...":"Definir horario ...",Delay:TB,Delete:SB,"Delete %s":"Eliminar %s ...","Delete folder":"Eliminar carpeta","Delete script":"Eliminar guión",Description:EB,"Deselect all":"Deseleccionar todo","Discard changes for %s":"Descartar cambios para %s",Done:IB,"Double click to write value":"Doble clic para escribir el valor","Download as file":"Descargar como archivo","Drop some files here or click...":"Suelta algunos archivos aquí o haz clic ...","Duplicate name":"Nombre duplicado","Edit script or just double click":"Editar guión o simplemente hacer doble clic","Empty name is not allowed":"No se permite el nombre vacío","End search mode":"Fin del modo de búsqueda","Enter your question":"Ingrese su solicitud",Error:"Error","Error formatting code":"Código de formato de error","Error was found":"Error encontrado","Every day":"Diario",Exec:xB,"Executes some shell command":"Ejecuta algún comando de shell","Existing scripts will be overwritten.":"Los guiones existentes se sobrescribirán.","Expand all":"Expandir todo","Expert mode":"Modo experto",Explanation:DB,Export:AB,"Export all scripts":"Exportar todos los scripts","Export blocks":"Exportar bloques","Export selected blocks":"Exportar bloques seleccionados",Februar:OB,February:RB,Filter:NB,Folder:MB,Fr:LB,Friday:PB,Function:"Función","Function editor":"Editor de funciones","Function: executed":"Función: ejecutada","Go to next line":"Ir a la siguiente línea","HTTP Call":"Llamada HTTP","Hide logs":"Ocultar registros",ID:BB,ID1:FB,ID2:jB,Import:zB,"Import blocks":"Importar bloques","Import error":"Error de importación","Import scripts":"Importar guiones","Insert object ID":"Insertar ID de objeto",Instance:UB,"Instance is disabled":"La instancia está deshabilitada","Instance:":"Ejemplo:",Instances:HB,Instructions:WB,"Invalid CRON":"CRON inválido","It will not be possible to revert this operation.":"No será posible revertir esta operación.","JS description":"Crear reglas escribiendo Javascript",Januar:GB,January:VB,July:KB,June:YB,"Just check":"Sólo revisa","Language:":"Idioma:","Learn More":"Aprende más","Light style":"Estilo ligero",Limit:JB,"Local time":"Hora local","Locate file":"Localizar el archivo","Log outputs":"Salidas de registro","Log text":"Texto de registro","Log: %s":"Log: %s","Make a HTTP get request":"Realizar una solicitud de obtención HTTP","Make a pause between actions":"Hacer una pausa entre acciones",March:qB,"March ":"marzo",May:XB,Menu:ZB,Message:QB,Mo:e2,Model:t2,Monday:s2,Month:o2,More:i2,Name:n2,"No API key found":"No se encontró ninguna clave API","No Chat GPT Key found":"No se ha encontrado ninguna clave GPT de chat","No active host found":"No se encontró un host activo","Nothing found":"Nada Encontrado",November:r2,OK:a2,October:l2,Ok:c2,"On condition change":"En condición de cambio","On script save or adapter start":"Al guardar el script o al iniciar el adaptador","On weekdays":"De lunes a viernes","Open configuration":"Configuración abierta","Operate two states":"Operar dos estados","Operations with two states":"Operaciones con dos estados","Paste your blocks here":"Pega tus bloques aquí",Pause:u2,"Pause execution":"Pausar ejecución","Pause script":"Pausar guion","Phone:":"Teléfono:","Please select object ID...":"Por favor, seleccione la ID del objeto ...","Press Ctrl+Enter to get the answer":"Presiona Ctrl+Enter para obtener la respuesta","Prettify the script":"Embellecer el guión","Print some text in log":"Imprime texto en el registro","Priority:":"Prioridad:",Pushover:d2,Pushsafer:h2,"Read only ID selected: %s":"ID de solo lectura seleccionado: %s",Rename:p2,"Reorder scripts in folders":"Reordenar guiones en carpetas",Repeat:g2,Restart:m2,Result:f2,"Resume execution":"Reanudar ejecución","Root folder":"Carpeta raíz","Rules description":"Crea reglas con bloques IF, THEN, ELSE","Run script":"Ejecutar guión",Sa:$2,Saturday:b2,Save:v2,"Save all":"Salvar a todos","Say It":"Say It","Say some text via sayit adapter":"Di un mensaje de texto a través del adaptador sayit",Schedule:y2,Script:_2,"Script %s was modified on disk":"El script %s fue modificado en el disco","Script is not running":"El script no se está ejecutando","Search in scripts":"Buscar en guiones","Search...":"Buscar...","Select all":"Seleccionar todo","Send email":"Enviar correo electrónico","Sends an email":"Envía un correo electrónico","Sends message via Pushsafer":"Envía mensaje a través de Pushsafer","Sends message via pushover":"Envía un mensaje a través de un pushover","Sends message via telegram":"Envía mensaje por telegrama","Sends message via whatsapp-cmb":"Envía mensaje vía whatsapp-cmb",September:w2,"Server time":"Tiempo del servidor","Set state action":"Establecer acción estatal","Set with delay":"Establecer con retraso","Shell command":"Comando de Shell","Show astronomical events":"Mostrar eventos astronómicos","Show javascript code":"Mostrar código Javascript","Show logs":"Mostrar registros","Show only paused scripts":"Mostrar solo secuencias de comandos pausadas","Show only running scripts":"Mostrar solo scripts en ejecución","Show only scripts with problems":"Mostrar solo guiones con problemas",Simulate:k2,"Some files will be rejected":"Algunos archivos serán rechazados","Sound:":"Sonido:",Stack:C2,Start:T2,"Start script":"Iniciar guion",State:S2,"State condition":"Condición del estado","Step into function":"Entra en función","Step out from function":"Sal de la función","Stop on exception":"Deténgase en excepción",Su:E2,"Subject:":"Sujeto:",Sunday:I2,"TS description":"Crear reglas escribiendo el mecanografiado",Telegram:x2,"Text:":"Texto:",Th:D2,"The script will be stopped and must be activated manually after debugging. Continue?":"El script se detendrá y deberá activarse manualmente después de la depuración. ¿Continuar?","This is advances option. You can write your own code here and it will be executed on trigger":"Esta es la opción de avances. Puede escribir su propio código aquí y se ejecutará en el disparador",Thursday:A2,Time:O2,"Time condition":"Condición de tiempo","Title:":"Título:","To:":"A:","Trigger with value":"Activar con valor",Triggered:R2,Triggers:N2,"Triggers the on script saving or the javascript instance restart":"Activa el guardado de la secuencia de comandos o el reinicio de la instancia de JavaScript","Triggers the rule on update or change of some state":"Activa la regla de actualización o cambio de algún estado","Triggers the rule periodically or on some specific time":"Activa la regla periódicamente o en un momento específico",Tu:M2,Tuesday:L2,URL:P2,"Unknown error":"Error desconocido","Unknown error!":"¡Error desconocido!","Use generated code":"Usar código generado","User function":"Función de usuario","User:":"Usuario:",Value:B2,"Vibration:":"Vibración:",Volume:F2,We:j2,Wednesday:z2,"Whatsapp-cmb":"Whatsapp-cmb",Write:U2,"Write your own code":"Escribe tu propio código",Yes:H2,"Yet exists!":"¡Sin embargo existe!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Puede usar %s en la URL para usar el valor de activación actual, %id para usar el ID de objeto activado, %name para mostrar el nombre de ID de objeto activado o %old para usar el valor de activación antiguo","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Puede usar %s en el comando para usar el valor de activación actual, %id para usar el ID de objeto activado, %name para mostrar el nombre de ID de objeto activado o %old para usar el valor de activación anterior","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Puede usar %s en el texto para mostrar el valor de activación actual, %id para usar el ID de objeto activado, %name para mostrar el nombre de ID de objeto activado o %old para usar el valor de activación antiguo","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Puede usar %s en el valor para usar el valor de activación actual, %id para usar el ID de objeto activado, %name para mostrar el nombre de ID de objeto activado o %old para usar el valor de activación antiguo","You have to enter OpenAI API key in the configuration of javascript adapter.":"Debe ingresar la clave API de OpenAI en la configuración del adaptador de JavaScript.","You have to enter at least one API key in the configuration of javascript adapter.":"Debe ingresar al menos una clave API (OpenAI, Anthropic o Gemini) en la configuración del adaptador de JavaScript.","Please select a valid model":"Seleccione un modelo válido","[equal]":"[igual]","[greater or equal]":"[mayor o igual]","[greater]":"[mayor que]","[hysteresis]":"[histéresis]","[includes]":"[incluye]","[less or equal]":"[menor o igual]","[less]":"[menos]","[not equal]":"[no es igual]",acknowledgment:W2,all:G2,and:V2,"as JSON":"como JSON","as plain text":"como texto plano",astro:K2,at:Y2,"clear running":"carrera clara",control:J2,copy:q2,cron:X2,dawn:Z2,debug_help:Q2,debug_label:eF,default:"defecto",dusk:tF,easy:sF,else:"demás","equal to":"igual a",every:oF,"every hour at 0 minutes":"cada hora a los 0 minutos",false:"falso","file reading has failed: %s":"la lectura del archivo ha fallado: %s","file reading was aborted":"la lectura del archivo fue abortada",filter_func:iF,filter_id:nF,filter_name:rF,filter_role:aF,filter_room:lF,"for edit or create script":"para editar o crear un nuevo script","for professionals":"para profesionales","for programmers":"para programadores",goldenHour:cF,goldenHourEnd:uF,"greater or equal":"mayor o igual","greater or equal to":"mayor o igual a","greater than":"mas grande que",help_just_check:dF,help_on_change:hF,"high priority":"alta prioridad","high-priority":"alta prioridad","highest priority":"más alta prioridad",hours:pF,includes:gF,interval:mF,"just check":"Sólo revisa","less or equal":"menor o igual","less or equal to":"menor o igual a","less than":"menos que","lower priority":"prioridad más baja","lowest priority":"prioridad más baja",magic:fF,milliseconds:$F,minutes:bF,ms:vF,nadir:yF,nauticalDawn:_F,nauticalDusk:wF,nextSunrise:kF,nextSunset:CF,night:TF,nightEnd:SF,"no blocks found":"No se encontraron bloques","no group":"NO GRUPO",normal:EF,"normal priority":"prioridad normal","not running":"no está en ejecución","not equal to":"no igual a","not properly connected":"Este bloque no está conectado correctamente a otros bloques.",offset:IF,"on change":"en el cambio","on condition change":"con cambio de condición","on update":"en actualización",one:xF,or:DF,quiet:AF,"reset search":"restablecer la búsqueda",search:OF,seconds:RF,solarNoon:NF,"store in":"almacenar en",sunrise:MF,sunriseEnd:LF,sunset:PF,sunsetStart:BF,then:FF,"toggle value":"alternar valor",tooltip_ack:jF,tooltip_from:zF,tooltip_lc:UF,tooltip_quality:HF,tooltip_ts:WF,tooltip_user:GF,tooltip_value:VF,true:"cierto",two:KF,undefined:"indefinido",update:YF,"use seconds":"usar segundos","use trigger value":"usar valor de activación",verbose_help:JF,verbose_label:qF,when:XF,with:"con","with date":"con fecha","with offset":"con desplazamiento",wizard:ZF,"Loading models...":"Cargando modelos...","Could not connect to API at %s":"No se pudo conectar a la API en %s","Invalid API key":"Clave API no válida","Access denied by API":"Acceso denegado por la API","API error: %s":"Error de API: %s",'Model "%s" not found':'Modelo "%s" no encontrado',"Request failed: %s":"Solicitud fallida: %s",Retry:QF,"No running javascript instance found":"No se encontró ninguna instancia de JavaScript en ejecución"},tj="Reconnu",sj="Actions",oj="Ajouter",ij="Tout",nj="Tout",rj="Postuler",aj="avril",lj="Demander",cj="Astronomique",uj="août",dj="Annuler",hj="proche",pj="État",gj="Conditions",mj="Console",fj="Copié",$j="décembre",bj="Défaut",vj="Retard",yj="Effacer",_j="Description",wj="Terminé",kj="Exec shell",Cj="Explication",Tj="Exportation",Sj="Février",Ej="février",Ij="Filtre",xj="Dossier",Dj="Fr",Aj="Vendredi",Oj="ID",Rj="ID1",Nj="ID2",Mj="Importation",Lj="Exemple",Pj="Instances",Bj="Instructions",Fj="Janvier",jj="janvier",zj="juillet",Uj="juin",Hj="Limite",Wj="Mars",Gj="Mai",Vj="M e n u",Kj="Message",Yj="Mo",Jj="Modèle",qj="Lundi",Xj="Mois",Zj="Plus",Qj="Nom",ez="novembre",tz="OK",sz="octobre",oz="D'accord",iz="Pause",nz="Pushover",rz="Pushsafer",az="Renommer",lz="Répéter",cz="Redémarrer",uz="Résultat",dz="Sa",hz="samedi",pz="sauver",gz="Horaire",mz="Scénario",fz="septembre",$z="Simuler",bz="Stack",vz="Début",yz="État",_z="Su",wz="dimanche",kz="Télégramme",Cz="4",Tz="Jeudi",Sz="Temps",Ez="Déclenché",Iz="Déclencheurs",xz="Tu",Dz="Mardi",Az="URL",Oz="Valeur",Rz="Le volume",Nz="3",Mz="Mercredi",Lz="Écrivez",Pz="Oui",Bz="reconnaissance",Fz="tout",jz="et",zz="astro",Uz="à",Hz="contrôler",Wz="copie",Gz="CRON",Vz="Aube",Kz="Il s'agit d'un mode spécial dans lequel les états et les objets ne changeront pas. Mais seules les informations sur chaque changement prévu seront affichées dans le protocole.",Yz="Déboguer",Jz="Crépuscule",qz="facile",Xz="chaque",Zz="Une fonction",Qz="ID",eU="Nom",tU="Rôle",sU="Pièce",oU="Heure d'or",iU="Fin de l'heure d'or",nU="Le code ne sera exécuté que chaque fois que la condition est vraie. Par exemple. si déclenchement sur la valeur du capteur de température et que la condition est «si la température est supérieure à 20 ° C», les actions «alors» seront exécutées à chaque fois que le capteur envoie la température et qu'elle est supérieure à 20 ° C. À 21 ° C, à 22 ° C et ainsi de suite.",rU="Le code ne sera exécuté que si le résultat de la condition change. Par exemple. si le déclenchement sur la valeur du capteur de température et que la condition est «si la température est supérieure à 20 ° C», les actions «alors» seront exécutées une fois lorsque la température est supérieure à 20. La prochaine fois, les actions «alors» seront exécutées lorsque la température échoue sous 20 puis remonte au-dessus de 20.",aU="les heures",lU="comprend",cU="intervalle",uU="la magie",dU="millisecondes",hU="minutes",pU="ms",gU="nadir",mU="Aube nautique",fU="Crépuscule nautique",$U="Prochain lever de soleil",bU="Prochain coucher de soleil",vU="Nuit",yU="Fin de nuit",_U="Ordinaire",wU="décalage",kU="une",CU="ou",TU="calmer",SU="chercher",EU="secondes",IU="Midi solaire",xU="lever du soleil",DU="Fin du lever du soleil",AU="le coucher du soleil",OU="Début du coucher du soleil",RU="alors",NU="Reconnaître",MU="De",LU="Dernière modification",PU="Qualité",BU="Horodatage",FU="Utilisateur",jU="Valeur",zU="deux",UU="mettre à jour",HU="Ajoute une sortie de débogage au journal pour de nombreuses commandes système",WU="Sorties de journal détaillées",GU="lorsque",VU="Wizard",KU="Réessayer",YU={"%s not found":"%s non trouvé","()":"()","(at %s)":"(à %s)","(optional)":"(optionnel)","-":"-",".":".","AI code generator":"Générateur de code IA",Ack:tj,Actions:sj,"Actual time of day":"Heure réelle de la journée",Add:oj,"Add new script":"Ajouter un nouveau script",All:ij,"All files will be accepted":"Tous les fichiers seront acceptés",Any:nj,"Any month":"N'importe quel mois",Apply:rj,April:aj,"Are you sure?":"Êtes-vous sûr?",Ask:lj,Astronomical:cj,"Astronomical events today":"Événements astronomiques aujourd'hui",August:uj,"Blockly description":"Création de règles par blocs graphiques","Body:":"Corps:",Cancel:dj,"Cannot delete non empty item!":"Impossible de supprimer un élément non vide!","Change layout":"Changer la disposition",'Change theme (actual "%s")':'Changer de thème (maintenant - "%s")',"Check blocks":"Vérifier les blocs","Check is not active, because javascript adapter is disabled":"La vérification n'est pas active, car l'adaptateur Javascript est désactivé","Clear search input":"Effacer la recherche","Click on this icon":"Cliquez sur cette icône",Close:hj,"Close all but current":"Ferme tout sauf courant","Collapse all":"Réduire tout","Compares current time with astronomical event":"Compare l'heure actuelle avec un événement astronomique","Compares current time with the user specific time":"Compare l'heure actuelle avec l'heure spécifique de l'utilisateur","Compares the state value with user defined value":"Compare la valeur d'état avec la valeur définie par l'utilisateur",Condition:pj,Conditions:gj,"Configuration not saved.":"Configuration non enregistrée.",Console:mj,"Control or update some state":"Contrôler ou mettre à jour un état","Control or update some state with delay":"Contrôler ou mettre à jour un état avec un délai","Convert blockly to javascript for ever.":"Convertissez instantanément en Javascript.",Copied:fj,"Copy script":"Copier le script","Copy to clipboard":"Copier dans le presse-papier","Create new":"Créer un nouveau","Create new folder":"Créer un nouveau dossier","Create new script":"Créer un nouveau script","Create or edit CRON or time wizard":"Créer ou éditer CRON ou un assistant de temps","Dark Theme":"Thème sombre","Dark style":"Style sombre",Date:"Date","Debug instance":"Instance de débogage","Debug options":"Options de débogage",December:$j,Default:bj,"Define cron...":"Définir le cron ...","Define schedule...":"Définir le calendrier ...",Delay:vj,Delete:yj,"Delete %s":"Supprimer %s ...","Delete folder":"Supprimer le dossier","Delete script":"Supprimer le script",Description:_j,"Deselect all":"Tout déselectionner","Discard changes for %s":"Ignorer les modifications pour %s",Done:wj,"Double click to write value":"Double clic pour écrire la valeur","Download as file":"Télécharger le fichier","Drop some files here or click...":"Déposer des fichiers ici ou cliquez sur ...","Duplicate name":"Nom en double","Edit script or just double click":"Modifiez le script ou double-cliquez simplement sur","Empty name is not allowed":"Le nom vide n'est pas autorisé","End search mode":"Fin du mode de recherche","Enter your question":"Entrez votre demande",Error:"Erreur","Error formatting code":"Erreur lors du formatage du code","Error was found":"Une erreur a été trouvée","Every day":"Tous les jours",Exec:kj,"Executes some shell command":"Exécute une commande shell","Existing scripts will be overwritten.":"Les scripts existants seront écrasés.","Expand all":"Développer tout","Expert mode":"Mode expert",Explanation:Cj,Export:Tj,"Export all scripts":"Exporter tous les scripts","Export blocks":"Blocs d'exportation","Export selected blocks":"Exporter les blocs sélectionnés",Februar:Sj,February:Ej,Filter:Ij,Folder:xj,Fr:Dj,Friday:Aj,Function:"Fonction","Function editor":"Éditeur de fonction","Function: executed":"Fonction : exécutée","Go to next line":"Aller à la ligne suivante","HTTP Call":"Appel HTTP","Hide logs":"Masquer les journaux",ID:Oj,ID1:Rj,ID2:Nj,Import:Mj,"Import blocks":"Blocs d'importation","Import error":"Erreur d'importation","Import scripts":"Importer des scripts","Insert object ID":"Insérer un identifiant d'objet",Instance:Lj,"Instance is disabled":"L'instance est désactivée","Instance:":"Exemple:",Instances:Pj,Instructions:Bj,"Invalid CRON":"CRON invalide","It will not be possible to revert this operation.":"Il ne sera pas possible de revenir sur cette opération.","JS description":"Créer des règles en écrivant du Javascript",Januar:Fj,January:jj,July:zj,June:Uj,"Just check":"Vérifiez simplement","Language:":"Langue:","Learn More":"Apprendre encore plus","Light style":"Style de lumière",Limit:Hj,"Local time":"Heure locale","Locate file":"Localiser le fichier","Log outputs":"Journal des sorties","Log text":"Texte du journal","Log: %s":"Log : %s","Make a HTTP get request":"Faire une requête HTTP Get","Make a pause between actions":"Faites une pause entre les actions",March:Wj,"March ":"mars",May:Gj,Menu:Vj,Message:Kj,Mo:Yj,Model:Jj,Monday:qj,Month:Xj,More:Zj,Name:Qj,"No API key found":"Aucune clé API trouvée","No Chat GPT Key found":"Aucune clé GPT de chat trouvée","No active host found":"Aucun hôte actif trouvé","Nothing found":"Rien n'a été trouvé",November:ez,OK:tz,October:sz,Ok:oz,"On condition change":"En cas de changement de condition","On script save or adapter start":"Lors de l'enregistrement du script ou du démarrage de l'adaptateur","On weekdays":"En semaine","Open configuration":"Configuration ouverte","Operate two states":"Opérer deux états","Operations with two states":"Opérations à deux états","Paste your blocks here":"Collez vos blocs ici",Pause:iz,"Pause execution":"Suspendre l'exécution","Pause script":"Script de pause","Phone:":"Téléphone:","Please select object ID...":"Veuillez sélectionner l'ID d'objet ...","Press Ctrl+Enter to get the answer":"Appuyez sur Ctrl+Entrée pour obtenir la réponse","Prettify the script":"Embellir le scénario","Print some text in log":"Imprimer du texte dans le journal","Priority:":"Priorité:",Pushover:nz,Pushsafer:rz,"Read only ID selected: %s":"ID en lecture seule sélectionné: %s",Rename:az,"Reorder scripts in folders":"Réorganiser les scripts dans des dossiers",Repeat:lz,Restart:cz,Result:uz,"Resume execution":"Reprendre l'exécution","Root folder":"Dossier racine","Rules description":"Créer des règles avec des blocs IF, THEN, ELSE","Run script":"Script de lancement",Sa:dz,Saturday:hz,Save:pz,"Save all":"Sauver tous","Say It":"Say It","Say some text via sayit adapter":"Dites du texte via l'adaptateur sayit",Schedule:gz,Script:mz,"Script %s was modified on disk":"Le script %s a été modifié sur le disque","Script is not running":"Le script n'est pas en cours d'exécution","Search in scripts":"Rechercher dans les scripts","Search...":"Chercher...","Select all":"Tout sélectionner","Send email":"Envoyer un e-mail","Sends an email":"Envoie un e-mail","Sends message via Pushsafer":"Envoie un message via Pushsafer","Sends message via pushover":"Envoie un message via pushover","Sends message via telegram":"Envoie un message par télégramme","Sends message via whatsapp-cmb":"Envoie un message via whatsapp-cmb",September:fz,"Server time":"Heure du serveur","Set state action":"Définir l'action de l'état","Set with delay":"Set avec retard","Shell command":"Commande Shell","Show astronomical events":"Afficher les événements astronomiques","Show javascript code":"Afficher le code Javascript","Show logs":"Afficher les journaux","Show only paused scripts":"Afficher uniquement les scripts en pause","Show only running scripts":"Afficher uniquement les scripts en cours d'exécution","Show only scripts with problems":"Afficher uniquement les scripts avec des problèmes",Simulate:$z,"Some files will be rejected":"Certains fichiers seront rejetés","Sound:":"Sonner:",Stack:bz,Start:vz,"Start script":"Lancer le script",State:yz,"State condition":"État condition","Step into function":"Entrez dans la fonction","Step out from function":"Sortez de la fonction","Stop on exception":"Arrêt sur exception",Su:_z,"Subject:":"Sujet:",Sunday:wz,"TS description":"Créer des règles en écrivant des caractères dactylographiés",Telegram:kz,"Text:":"Texte:",Th:Cz,"The script will be stopped and must be activated manually after debugging. Continue?":"Le script sera arrêté et doit être activé manuellement après le débogage. Continuez?","This is advances option. You can write your own code here and it will be executed on trigger":"C'est une option avancée. Vous pouvez écrire votre propre code ici et il sera exécuté au déclenchement",Thursday:Tz,Time:Sz,"Time condition":"Condition de temps","Title:":"Titre:","To:":"À:","Trigger with value":"Déclencheur avec valeur",Triggered:Ez,Triggers:Iz,"Triggers the on script saving or the javascript instance restart":"Déclenche l'enregistrement du script ou le redémarrage de l'instance javascript","Triggers the rule on update or change of some state":"Déclenche la règle sur la mise à jour ou le changement d'un état","Triggers the rule periodically or on some specific time":"Déclenche la règle périodiquement ou à une heure précise",Tu:xz,Tuesday:Dz,URL:Az,"Unknown error":"Erreur inconnue","Unknown error!":"Erreur inconnue!","Use generated code":"Utiliser le code généré","User function":"Fonction utilisateur","User:":"Utilisateur:",Value:Oz,"Vibration:":"Vibration:",Volume:Rz,We:Nz,Wednesday:Mz,"Whatsapp-cmb":"Whatsapp-cmb",Write:Lz,"Write your own code":"Écrivez votre propre code",Yes:Pz,"Yet exists!":"Pourtant existe!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Vous pouvez utiliser %s dans l'URL pour utiliser la valeur de déclenchement actuelle, %id pour utiliser l'ID de l'objet déclenché, %name pour afficher le nom de l'ID de l'objet déclenché ou %old pour utiliser l'ancienne valeur de déclenchement","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Vous pouvez utiliser %s dans la commande pour utiliser la valeur de déclenchement actuelle, %id pour utiliser l'ID de l'objet déclenché, %name pour afficher le nom de l'ID de l'objet déclenché ou %old pour utiliser l'ancienne valeur de déclenchement","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Vous pouvez utiliser %s dans le texte pour afficher la valeur de déclenchement actuelle, %id pour utiliser l'ID de l'objet déclenché, %name pour afficher le nom de l'ID de l'objet déclenché ou %old pour utiliser l'ancienne valeur de déclenchement","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Vous pouvez utiliser %s dans la valeur pour utiliser la valeur de déclenchement actuelle, %id pour utiliser l'ID de l'objet déclenché, %name pour afficher le nom de l'ID de l'objet déclenché ou %old pour utiliser l'ancienne valeur de déclenchement","You have to enter OpenAI API key in the configuration of javascript adapter.":"Vous devez entrer la clé API OpenAI dans la configuration de l'adaptateur javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Vous devez entrer au moins une clé API (OpenAI, Anthropic ou Gemini) dans la configuration de l'adaptateur javascript.","Please select a valid model":"Veuillez sélectionner un modèle valide","[equal]":"[égal]","[greater or equal]":"[supérieur ou égal]","[greater]":"[plus grand]","[hysteresis]":"[hystérèse]","[includes]":"[comprend]","[less or equal]":"[inférieur ou égal]","[less]":"[moins]","[not equal]":"[inégal]",acknowledgment:Bz,all:Fz,and:jz,"as JSON":"en JSON","as plain text":"en texte brut",astro:zz,at:Uz,"clear running":"course claire",control:Hz,copy:Wz,cron:Gz,dawn:Vz,debug_help:Kz,debug_label:Yz,default:"défaut",dusk:Jz,easy:qz,else:"autre","equal to":"égal à",every:Xz,"every hour at 0 minutes":"toutes les heures à 0 minute",false:"faux","file reading has failed: %s":"La lecture du fichier a échoué: %s","file reading was aborted":"la lecture du fichier a été abandonnée",filter_func:Zz,filter_id:Qz,filter_name:eU,filter_role:tU,filter_room:sU,"for edit or create script":"pour éditer ou créer un nouveau script","for professionals":"pour les professionnels","for programmers":"pour les programmeurs",goldenHour:oU,goldenHourEnd:iU,"greater or equal":"supérieur ou égal","greater or equal to":"supérieur ou égal à","greater than":"plus grand que",help_just_check:nU,help_on_change:rU,"high priority":"haute priorité","high-priority":"haute priorité","highest priority":"priorité la plus élevée",hours:aU,includes:lU,interval:cU,"just check":"Vérifiez simplement","less or equal":"inférieur ou égal","less or equal to":"inférieur ou égal à","less than":"moins que","lower priority":"priorité inférieure","lowest priority":"priorité la plus basse",magic:uU,milliseconds:dU,minutes:hU,ms:pU,nadir:gU,nauticalDawn:mU,nauticalDusk:fU,nextSunrise:$U,nextSunset:bU,night:vU,nightEnd:yU,"no blocks found":"Aucun bloc trouvé","no group":"PAS DE GROUPE",normal:_U,"normal priority":"priorité normale","not running":"pas en cours d'exécution","not equal to":"pas égal à","not properly connected":"Ce bloc n'est pas correctement connecté à d'autres blocs.",offset:wU,"on change":"sur le changement","on condition change":"sur changement de condition","on update":"sur mise à jour",one:kU,or:CU,quiet:TU,"reset search":"Réinitialiser la recherche",search:SU,seconds:EU,solarNoon:IU,"store in":"stocker dans",sunrise:xU,sunriseEnd:DU,sunset:AU,sunsetStart:OU,then:RU,"toggle value":"valeur de bascule",tooltip_ack:NU,tooltip_from:MU,tooltip_lc:LU,tooltip_quality:PU,tooltip_ts:BU,tooltip_user:FU,tooltip_value:jU,true:"vrai",two:zU,undefined:"indéfini",update:UU,"use seconds":"utiliser les secondes","use trigger value":"use trigger value",verbose_help:HU,verbose_label:WU,when:GU,with:"avec","with date":"avec date","with offset":"avec offset",wizard:VU,"Loading models...":"Chargement des modèles...","Could not connect to API at %s":"Impossible de se connecter à l'API sur %s","Invalid API key":"Clé API invalide","Access denied by API":"Accès refusé par l'API","API error: %s":"Erreur API : %s",'Model "%s" not found':'Modèle "%s" introuvable',"Request failed: %s":"Requête échouée : %s",Retry:KU,"No running javascript instance found":"Aucune instance JavaScript en cours d'exécution trouvée"},JU="Riconosciuto",qU="Azioni",XU="Inserisci",ZU="Tutti",QU="Qualunque",eH="Applica",tH="aprile",sH="Chiedere",oH="Astronomico",iH="agosto",nH="Annulla",rH="Vicino",aH="Condizione",lH="Condizioni",cH="Console",uH="Copiato",dH="dicembre",hH="Predefinito",pH="Ritardo",gH="Elimina",mH="Descrizione",fH="Fatto",$H="Execshell",bH="Spiegazione",vH="Esportare",yH="Februar",_H="febbraio",wH="Filtro",kH="Cartella",CH="P",TH="Venerdì",SH="ID",EH="ID1",IH="ID2",xH="Importare",DH="Esempio",AH="istanze",OH="Istruzioni",RH="Januar",NH="gennaio",MH="luglio",LH="giugno",PH="Limite",BH="marzo",FH="Maggio",jH="Menu",zH="Messaggio",UH="Mo",HH="Modello",WH="Lunedi",GH="Mese",VH="Di più",KH="Nome",YH="novembre",JH="OK",qH="ottobre",XH="Ok",ZH="Pausa",QH="Pushover",eW="Pushsafer",tW="Rinominare",sW="Ripetere",oW="Ricomincia",iW="Risultato",nW="Sa",rW="Sabato",aW="Salva",lW="Programma",cW="copione",uW="settembre",dW="Simulare",hW="Stack",pW="Cominciare",gW="Stato",mW="Su",fW="Domenica",$W="Telegramma",bW="4",vW="giovedi",yW="Tempo",_W="Innescato",wW="Trigger",kW="Tu",CW="martedì",TW="URL",SW="Valore",EW="Volume",IW="3",xW="mercoledì",DW="Scrivi",AW="sì",OW="riconoscimento",RW="tutti",NW="e",MW="astro",LW="a",PW="controllo",BW="copia",FW="CRON",jW="alba",zW="Questa è una modalità speciale in cui gli stati e gli oggetti non cambieranno. Ma nel protocollo verranno visualizzate solo le informazioni su ogni modifica pianificata.",UW="Debug",HW="crepuscolo",WW="facile",GW="ogni",VW="Funzione",KW="ID",YW="Nome",JW="Ruolo",qW="Camera",XW="Ora d'oro",ZW="Fine dell'ora d'oro",QW='Il codice verrà eseguito solo ogni volta che la condizione è vera. Per esempio. se si attiva il valore del sensore di temperatura e la condizione è "se la temperatura è maggiore di 20 ° C", le azioni "allora" verranno eseguite ogni volta che il sensore invia la temperatura e questa è superiore a 20 ° C. Di 21 ° C, di 22 ° C e così via.',e5='Il codice verrà eseguito solo se il risultato della condizione cambia. Per esempio. se si attiva il valore del sensore di temperatura e la condizione è "se la temperatura è maggiore di 20 ° C", le azioni "allora" verranno eseguite una volta quando la temperatura è superiore a 20. La prossima volta le azioni "allora" verranno eseguite quando la temperatura fallisce sotto 20 e poi sale di nuovo oltre 20.',t5="ore",s5="include",o5="intervallo",i5="Magia",n5="millisecondi",r5="minuti",a5="ms",l5="nadir",c5="Alba nautica",u5="Crepuscolo nautico",d5="Prossima alba",h5="Prossimo tramonto",p5="Notte",g5="Fine della notte",m5="normale",f5="compensare",$5="uno",b5="o",v5="silenzioso",y5="ricerca",_5="secondi",w5="Mezzogiorno solare",k5="Alba",C5="Fine dell'alba",T5="tramonto",S5="Inizio del tramonto",E5="poi",I5="Riconoscere",x5="A partire dal",D5="Ultima modifica",A5="Qualità",O5="timestamp",R5="Utente",N5="Valore",M5="Due",L5="aggiornare",P5="Aggiunge l'output di debug al registro per molti comandi di sistema",B5="Output di log dettagliati",F5="quando",j5="procedura guidata",z5="Riprova",U5={"%s not found":"%s non trovato","()":"()","(at %s)":"(a %s)","(optional)":"(opzionale)","-":"-",".":".","AI code generator":"Generatore di codice AI",Ack:JU,Actions:qU,"Actual time of day":"Ora effettiva della giornata",Add:XU,"Add new script":"Aggiungi nuovo script",All:ZU,"All files will be accepted":"Tutti i file saranno accettati",Any:QU,"Any month":"Ogni mese",Apply:eH,April:tH,"Are you sure?":"Sei sicuro?",Ask:sH,Astronomical:oH,"Astronomical events today":"Eventi astronomici oggi",August:iH,"Blockly description":"Creazione di regole tramite blocchi grafici","Body:":"Corpo:",Cancel:nH,"Cannot delete non empty item!":"Impossibile eliminare l'elemento non vuoto!","Change layout":"Cambia layout",'Change theme (actual "%s")':'Cambia tema (ora - "%s")',"Check blocks":"Controlla i blocchi","Check is not active, because javascript adapter is disabled":"Il controllo non è attivo perché l'adattatore Javascript è disabilitato","Clear search input":"Cancella input di ricerca","Click on this icon":"Clicca su questa icona",Close:rH,"Close all but current":"Chiudi tutto tranne corrente","Collapse all":"Comprimi tutto","Compares current time with astronomical event":"Confronta l'ora corrente con l'evento astronomico","Compares current time with the user specific time":"Confronta l'ora corrente con l'ora specifica dell'utente","Compares the state value with user defined value":"Confronta il valore dello stato con il valore definito dall'utente",Condition:aH,Conditions:lH,"Configuration not saved.":"Configurazione non salvata.",Console:cH,"Control or update some state":"Controlla o aggiorna uno stato","Control or update some state with delay":"Controlla o aggiorna uno stato con ritardo","Convert blockly to javascript for ever.":"Converti istantaneamente a blocchi in Javascript.",Copied:uH,"Copy script":"Copia script","Copy to clipboard":"Copia negli appunti","Create new":"Creare nuovo","Create new folder":"Crea una nuova cartella","Create new script":"Crea nuovo script","Create or edit CRON or time wizard":"Crea o modifica la procedura guidata CRON o time","Dark Theme":"Tema scuro","Dark style":"Stile scuro",Date:"Data","Debug instance":"Istanza di debug","Debug options":"Opzioni di debug",December:dH,Default:hH,"Define cron...":"Definisci cron ...","Define schedule...":"Definisci programma ...",Delay:pH,Delete:gH,"Delete %s":"Elimina %s ...","Delete folder":"Elimina cartella","Delete script":"Elimina script",Description:mH,"Deselect all":"Deselezionare tutto","Discard changes for %s":"Annulla modifiche per %s",Done:fH,"Double click to write value":"Doppio clic per scrivere il valore","Download as file":"Scarica come file","Drop some files here or click...":"Trascina alcuni file qui o fai clic su ...","Duplicate name":"Nome duplicato","Edit script or just double click":"Modifica lo script o fai doppio clic","Empty name is not allowed":"Il nome vuoto non è consentito","End search mode":"Termina la modalità di ricerca","Enter your question":"Inserisci la tua richiesta",Error:"Errore","Error formatting code":"Errore di formattazione del codice","Error was found":"Errore trovato","Every day":"Ogni giorno",Exec:$H,"Executes some shell command":"Esegue alcuni comandi della shell","Existing scripts will be overwritten.":"Gli script esistenti verranno sovrascritti.","Expand all":"Espandi tutto","Expert mode":"Modalità esperto",Explanation:bH,Export:vH,"Export all scripts":"Esporta tutti gli script","Export blocks":"Esporta blocchi","Export selected blocks":"Esporta i blocchi selezionati",Februar:yH,February:_H,Filter:wH,Folder:kH,Fr:CH,Friday:TH,Function:"Funzione","Function editor":"Editor di funzioni","Function: executed":"Funzione: eseguita","Go to next line":"Vai alla riga successiva","HTTP Call":"Chiamata HTTP","Hide logs":"Nascondi i registri",ID:SH,ID1:EH,ID2:IH,Import:xH,"Import blocks":"Importa blocchi","Import error":"Errore di importazione","Import scripts":"Importa script","Insert object ID":"Inserisci l'ID oggetto",Instance:DH,"Instance is disabled":"L'istanza è disabilitata","Instance:":"Esempio:",Instances:AH,Instructions:OH,"Invalid CRON":"CRON non valido","It will not be possible to revert this operation.":"Non sarà possibile ripristinare questa operazione.","JS description":"Creare regole scrivendo Javascript",Januar:RH,January:NH,July:MH,June:LH,"Just check":"Controlla solamente","Language:":"Linguaggio:","Learn More":"Per saperne di più","Light style":"Stile leggero",Limit:PH,"Local time":"Ora locale","Locate file":"Localizza file","Log outputs":"Registra le uscite","Log text":"Testo del registro","Log: %s":"Log: %s","Make a HTTP get request":"Effettua una richiesta get HTTP","Make a pause between actions":"Fai una pausa tra le azioni",March:BH,"March ":"marzo",May:FH,Menu:jH,Message:zH,Mo:UH,Model:HH,Monday:WH,Month:GH,More:VH,Name:KH,"No API key found":"Nessuna chiave API trovata","No Chat GPT Key found":"Nessuna chiave GPT chat trovata","No active host found":"Nessun host attivo trovato","Nothing found":"Non abbiamo trovato nulla",November:YH,OK:JH,October:qH,Ok:XH,"On condition change":"A condizione che cambino","On script save or adapter start":"Al salvataggio dello script o all'avvio dell'adattatore","On weekdays":"Nei giorni della settimana","Open configuration":"Configurazione aperta","Operate two states":"Gestisci due stati","Operations with two states":"Operazioni con due stati","Paste your blocks here":"Incolla qui i tuoi blocchi",Pause:ZH,"Pause execution":"Metti in pausa l'esecuzione","Pause script":"Metti in pausa lo script","Phone:":"Telefono:","Please select object ID...":"Seleziona l'ID oggetto ...","Press Ctrl+Enter to get the answer":"Premi Ctrl+Invio per ottenere la risposta","Prettify the script":"Abbellire la sceneggiatura","Print some text in log":"Stampa del testo nel registro","Priority:":"Priorità:",Pushover:QH,Pushsafer:eW,"Read only ID selected: %s":"ID di sola lettura selezionato: %s",Rename:tW,"Reorder scripts in folders":"Riordina gli script nelle cartelle",Repeat:sW,Restart:oW,Result:iW,"Resume execution":"Riprendi esecuzione","Root folder":"Cartella root","Rules description":"Crea regole con i blocchi IF, THEN, ELSE","Run script":"Esegui script",Sa:nW,Saturday:rW,Save:aW,"Save all":"Salva tutto","Say It":"Say It","Say some text via sayit adapter":"Pronuncia del testo tramite l'adattatore sayit",Schedule:lW,Script:cW,"Script %s was modified on disk":"Lo script %s è stato modificato sul disco","Script is not running":"Lo script non è in esecuzione","Search in scripts":"Cerca negli script","Search...":"Ricerca...","Select all":"Seleziona tutto","Send email":"Invia una email","Sends an email":"Invia un'e-mail","Sends message via Pushsafer":"Invia messaggio tramite Pushsafer","Sends message via pushover":"Invia messaggio tramite pushover","Sends message via telegram":"Invia messaggio tramite telegramma","Sends message via whatsapp-cmb":"Invia messaggio tramite whatsapp-cmb",September:uW,"Server time":"Ora del server","Set state action":"Imposta l'azione dello stato","Set with delay":"Impostato con ritardo","Shell command":"Comando Shell","Show astronomical events":"Mostra eventi astronomici","Show javascript code":"Mostra codice Javascript","Show logs":"Mostra i log","Show only paused scripts":"Mostra solo script in pausa","Show only running scripts":"Mostra solo gli script in esecuzione","Show only scripts with problems":"Mostra solo script con problemi",Simulate:dW,"Some files will be rejected":"Alcuni file verranno rifiutati","Sound:":"Suono:",Stack:hW,Start:pW,"Start script":"Avvia script",State:gW,"State condition":"Condizione dello stato","Step into function":"Entra in funzione","Step out from function":"Esci dalla funzione","Stop on exception":"Ferma in caso di eccezione",Su:mW,"Subject:":"Soggetto:",Sunday:fW,"TS description":"Creare regole scrivendo dattiloscritto",Telegram:$W,"Text:":"Testo:",Th:bW,"The script will be stopped and must be activated manually after debugging. Continue?":"Lo script verrà interrotto e dovrà essere attivato manualmente dopo il debug. Continua?","This is advances option. You can write your own code here and it will be executed on trigger":"Questa è un'opzione anticipata. Puoi scrivere il tuo codice qui e verrà eseguito al trigger",Thursday:vW,Time:yW,"Time condition":"Condizione temporale","Title:":"Titolo:","To:":"Per:","Trigger with value":"Trigger con valore",Triggered:_W,Triggers:wW,"Triggers the on script saving or the javascript instance restart":"Attiva il salvataggio dello script o il riavvio dell'istanza javascript","Triggers the rule on update or change of some state":"Attiva la regola in caso di aggiornamento o modifica di uno stato","Triggers the rule periodically or on some specific time":"Attiva la regola periodicamente o in un momento specifico",Tu:kW,Tuesday:CW,URL:TW,"Unknown error":"Errore sconosciuto","Unknown error!":"Errore sconosciuto!","Use generated code":"Usa il codice generato","User function":"Funzione utente","User:":"Utente:",Value:SW,"Vibration:":"Vibrazione:",Volume:EW,We:IW,Wednesday:xW,"Whatsapp-cmb":"Whatsapp-cmb",Write:DW,"Write your own code":"Scrivi il tuo codice",Yes:AW,"Yet exists!":"Esiste ancora!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"È possibile utilizzare %s nell'URL per utilizzare il valore di trigger corrente, %id per utilizzare l'ID dell'oggetto attivato, %name per mostrare il nome dell'ID dell'oggetto attivato o %old per utilizzare il vecchio valore di trigger","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"È possibile utilizzare %s nel comando per utilizzare il valore di trigger corrente, %id per utilizzare l'ID dell'oggetto attivato, %name per mostrare il nome dell'ID dell'oggetto attivato o %old per utilizzare il vecchio valore di trigger","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"È possibile utilizzare %s nel testo per visualizzare il valore di trigger corrente, %id per utilizzare l'ID dell'oggetto attivato, %name per mostrare il nome dell'ID dell'oggetto attivato o %old per utilizzare il vecchio valore di trigger","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"È possibile utilizzare %s nel valore per utilizzare il valore di trigger corrente, %id per utilizzare l'ID dell'oggetto attivato, %name per mostrare il nome dell'ID dell'oggetto attivato o %old per utilizzare il vecchio valore di trigger","You have to enter OpenAI API key in the configuration of javascript adapter.":"Devi inserire la chiave API OpenAI nella configurazione dell'adattatore javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Devi inserire almeno una chiave API (OpenAI, Anthropic o Gemini) nella configurazione dell'adattatore javascript.","Please select a valid model":"Seleziona un modello valido","[equal]":"[pari]","[greater or equal]":"[maggiore o uguale]","[greater]":"[maggiore]","[hysteresis]":"[isteresi]","[includes]":"[include]","[less or equal]":"[minore o uguale]","[less]":"[Di meno]","[not equal]":"[non uguale]",acknowledgment:OW,all:RW,and:NW,"as JSON":"come JSON","as plain text":"come testo",astro:MW,at:LW,"clear running":"chiara esecuzione",control:PW,copy:BW,cron:FW,dawn:jW,debug_help:zW,debug_label:UW,default:"predefinito",dusk:HW,easy:WW,else:"altro","equal to":"uguale a",every:GW,"every hour at 0 minutes":"ogni ora a 0 minuti",false:"falso","file reading has failed: %s":"lettura file non riuscita: %s","file reading was aborted":"la lettura del file è stata interrotta",filter_func:VW,filter_id:KW,filter_name:YW,filter_role:JW,filter_room:qW,"for edit or create script":"per modificare o creare un nuovo script","for professionals":"per i professionisti","for programmers":"per i programmatori",goldenHour:XW,goldenHourEnd:ZW,"greater or equal":"maggiore o uguale","greater or equal to":"maggiore o uguale a","greater than":"più grande di",help_just_check:QW,help_on_change:e5,"high priority":"priorità alta","high-priority":"priorità alta","highest priority":"massima priorità",hours:t5,includes:s5,interval:o5,"just check":"controlla solamente","less or equal":"inferiore o uguale","less or equal to":"minore o uguale a","less than":"meno di","lower priority":"priorità inferiore","lowest priority":"priorità più bassa",magic:i5,milliseconds:n5,minutes:r5,ms:a5,nadir:l5,nauticalDawn:c5,nauticalDusk:u5,nextSunrise:d5,nextSunset:h5,night:p5,nightEnd:g5,"no blocks found":"Nessun blocco trovato","no group":"NESSUN GRUPPO",normal:m5,"normal priority":"priorità normale","not running":"non in esecuzione","not equal to":"non uguale a","not properly connected":"Questo blocco non è correttamente collegato ad altri blocchi.",offset:f5,"on change":"sul cambiamento","on condition change":"a cambio di condizione","on update":"in aggiornamento",one:$5,or:b5,quiet:v5,"reset search":"resetta la ricerca",search:y5,seconds:_5,solarNoon:w5,"store in":"conservare in",sunrise:k5,sunriseEnd:C5,sunset:T5,sunsetStart:S5,then:E5,"toggle value":"alterna valore",tooltip_ack:I5,tooltip_from:x5,tooltip_lc:D5,tooltip_quality:A5,tooltip_ts:O5,tooltip_user:R5,tooltip_value:N5,true:"vero",two:M5,undefined:"non definito",update:L5,"use seconds":"usa i secondi","use trigger value":"usa il trigger",verbose_help:P5,verbose_label:B5,when:F5,with:"con","with date":"con data","with offset":"con offset",wizard:j5,"Loading models...":"Caricamento modelli...","Could not connect to API at %s":"Impossibile connettersi all'API su %s","Invalid API key":"Chiave API non valida","Access denied by API":"Accesso negato dall'API","API error: %s":"Errore API: %s",'Model "%s" not found':'Modello "%s" non trovato',"Request failed: %s":"Richiesta fallita: %s",Retry:z5,"No running javascript instance found":"Nessuna istanza JavaScript in esecuzione trovata"},H5="Erkend",W5="Acties",G5="Toevoegen",V5="Alle",K5="Ieder",Y5="Solliciteer",J5="april",q5="Vragen",X5="Astronomisch",Z5="augustus",Q5="annuleren",e3="Dichtbij",t3="Staat",s3="Voorwaarden",o3="Troosten",i3="Gekopieerd",n3="december",r3="Standaard",a3="Vertraging",l3="Verwijder",c3="Beschrijving",u3="Gedaan",d3="Exec shell",h3="Uitleg",p3="Exporteren",g3="Februari",m3="februari",f3="Filter",$3="Map",b3="Vr",v3="vrijdag",y3="ID kaart",_3="ID1",w3="ID2",k3="Importeren",C3="Voorbeeld",T3="Instanties",S3="Instructies",E3="Januar",I3="januari",x3="juli",D3="juni",A3="Begrenzing",O3="maart",R3="mei",N3="Menu",M3="Bericht",L3="Ma",P3="Model",B3="maandag",F3="Maand",j3="Meer",z3="Naam",U3="november",H3="OK",W3="oktober",G3="OK",V3="Pauze",K3="Pushover",Y3="Duwijzer",J3="andere naam geven",q3="Herhaling",X3="Herstarten",Z3="Resultaat",Q3="Za",eG="zaterdag",tG="Opslaan",sG="Schema",oG="Script",iG="september",nG="Simuleren",rG="Stack",aG="Begin",lG="Staat",cG="Zo",uG="zondag",dG="Telegram",hG="4",pG="donderdag",gG="Tijd",mG="Veroorzaakt",fG="Triggers",$G="Di",bG="dinsdag",vG="URL",yG="Waarde",_G="Volume",wG="3",kG="woensdag",CG="Schrijven",TG="Ja",SG="erkenning",EG="alle",IG="en",xG="astro",DG="Bij",AG="controle",OG="kopiëren",RG="cron",NG="dageraad",MG="Dit is een speciale modus waarin toestanden en objecten niet veranderen. Maar alleen informatie over elke geplande wijziging wordt in het protocol weergegeven.",LG="Debuggen",PG="schemer",BG="eenvoudig",FG="elke",jG="Functie",zG="ID kaart",UG="Naam",HG="Rol",WG="Kamer",GG="gouden uur",VG="Einde van gouden uur",KG='De code wordt alleen uitgevoerd als de voorwaarde waar is. Bijv. als het triggeren op de temperatuursensorwaarde en de conditie is "als de temperatuur hoger is dan 20 ° C", zullen de "dan" acties worden uitgevoerd elke keer dat de sensor de temperatuur verzendt en deze hoger is dan 20 ° C. Bij 21 ° C, bij 22 ° C enzovoort.',YG='De code wordt alleen uitgevoerd als het conditieresultaat verandert. Bijv. als de temperatuursensor wordt geactiveerd en de conditie is "als de temperatuur hoger is dan 20 ° C", worden de "dan" -acties eenmaal uitgevoerd wanneer de temperatuur hoger is dan 20. De volgende keer worden de "dan" -acties uitgevoerd wanneer de temperatuur faalt onder de 20 en stijgt dan weer boven de 20.',JG="uren",qG="omvat",XG="interval",ZG="magie",QG="milliseconden",eV="minuten",tV="ms",sV="nadir",oV="Nautische dageraad",iV="Nautische schemering",nV="Volgende zonsopgang",rV="Volgende zonsondergang",aV="nacht",lV="Einde van de nacht",cV="normaal",uV="compensatie",dV="een",hV="of",pV="stil",gV="zoeken",mV="seconden",fV="Zonne-middag",$V="zonsopkomst",bV="Einde zonsopgang",vV="zonsondergang",yV="Begin van de zonsondergang",_V="vervolgens",wV="Erkennen",kV="Van",CV="Laatst gewijzigd",TV="Kwaliteit",SV="tijdstempel",EV="Gebruiker",IV="Waarde",xV="twee",DV="bijwerken",AV="Voegt foutopsporingsuitvoer toe aan het logboek voor veel systeemopdrachten",OV="Uitgebreide log-uitgangen",RV="wanneer",NV="tovenaar",MV="Opnieuw proberen",LV={"%s not found":"%s niet gevonden","()":"()","(at %s)":"(op %s)","(optional)":"(optioneel)","-":"-",".":".","AI code generator":"AI-codegenerator",Ack:H5,Actions:W5,"Actual time of day":"Werkelijke tijd van de dag",Add:G5,"Add new script":"Nieuw script toevoegen",All:V5,"All files will be accepted":"Alle bestanden worden geaccepteerd",Any:K5,"Any month":"Elke maand",Apply:Y5,April:J5,"Are you sure?":"Weet je zeker dat?",Ask:q5,Astronomical:X5,"Astronomical events today":"Astronomische gebeurtenissen vandaag",August:Z5,"Blockly description":"Regels maken door grafische blokken","Body:":"Lichaam:",Cancel:Q5,"Cannot delete non empty item!":"Kan niet leeg item niet verwijderen!","Change layout":"Opmaak veranderen",'Change theme (actual "%s")':'Thema wijzigen (nu - "%s")',"Check blocks":"Controleer blokken","Check is not active, because javascript adapter is disabled":"Controle is niet actief, omdat Javascript-adapter is uitgeschakeld","Clear search input":"Zoekopdracht wissen","Click on this icon":"Klik op dit pictogram",Close:e3,"Close all but current":"Alles sluiten behalve huidig","Collapse all":"Alles inklappen","Compares current time with astronomical event":"Vergelijkt huidige tijd met astronomische gebeurtenis","Compares current time with the user specific time":"Vergelijkt de huidige tijd met de gebruikerspecifieke tijd","Compares the state value with user defined value":"Vergelijkt de statuswaarde met de door de gebruiker gedefinieerde waarde",Condition:t3,Conditions:s3,"Configuration not saved.":"Configuratie niet opgeslagen.",Console:o3,"Control or update some state":"Beheer of update een bepaalde staat","Control or update some state with delay":"Beheer of update een bepaalde staat met vertraging","Convert blockly to javascript for ever.":"Converteer direct blockly naar Javascript.",Copied:i3,"Copy script":"Kopieer script","Copy to clipboard":"Kopieer naar klembord","Create new":"Maak nieuw","Create new folder":"Maak een nieuwe map","Create new script":"Maak een nieuw script","Create or edit CRON or time wizard":"Creëer of bewerk CRON of tijdwizard","Dark Theme":"Donker thema","Dark style":"Donkere stijl",Date:"Datum","Debug instance":"Debug-instantie","Debug options":"Foutopsporingsopties",December:n3,Default:r3,"Define cron...":"Definieer cron ...","Define schedule...":"Definieer schema ...",Delay:a3,Delete:l3,"Delete %s":"%s verwijderen ...","Delete folder":"Verwijder map","Delete script":"Script verwijderen",Description:c3,"Deselect all":"Deselecteer alles","Discard changes for %s":"Wijzigingen voor %s annuleren",Done:u3,"Double click to write value":"Dubbelklikken om waarde te schrijven","Download as file":"Download","Drop some files here or click...":"Zet hier enkele bestanden neer of klik op ...","Duplicate name":"Dubbele naam","Edit script or just double click":"Bewerk het script of dubbelklik erop","Empty name is not allowed":"Lege naam is niet toegestaan","End search mode":"Zoekmodus beëindigen","Enter your question":"Voer uw verzoek in",Error:"Fout","Error formatting code":"Fout bij het opmaken van de code","Error was found":"Er is een fout gevonden","Every day":"Elke dag",Exec:d3,"Executes some shell command":"Voert een shell-commando uit","Existing scripts will be overwritten.":"Bestaande scripts worden overschreven.","Expand all":"Alles uitvouwen","Expert mode":"Expert modus",Explanation:h3,Export:p3,"Export all scripts":"Exporteer alle scripts","Export blocks":"Blokken exporteren","Export selected blocks":"Exporteer geselecteerde blokken",Februar:g3,February:m3,Filter:f3,Folder:$3,Fr:b3,Friday:v3,Function:"Functie","Function editor":"Functie-editor","Function: executed":"Functie: uitgevoerd","Go to next line":"Ga naar de volgende regel","HTTP Call":"HTTP-oproep","Hide logs":"Verberg logboeken",ID:y3,ID1:_3,ID2:w3,Import:k3,"Import blocks":"Blokken importeren","Import error":"Importfout","Import scripts":"Scripts importeren","Insert object ID":"Object-ID invoegen",Instance:C3,"Instance is disabled":"Exemplaar is uitgeschakeld","Instance:":"Voorbeeld:",Instances:T3,Instructions:S3,"Invalid CRON":"Ongeldige CRON","It will not be possible to revert this operation.":"Het is niet mogelijk om deze bewerking terug te zetten.","JS description":"Regels maken door Javascript te schrijven",Januar:E3,January:I3,July:x3,June:D3,"Just check":"Kijk maar","Language:":"Taal:","Learn More":"Leer meer","Light style":"Lichte stijl",Limit:A3,"Local time":"Lokale tijd","Locate file":"Vind het bestand","Log outputs":"Log uitgangen","Log text":"Log tekst","Log: %s":"Logboek: %s","Make a HTTP get request":"Maak een HTTP-ophaalverzoek","Make a pause between actions":"Pauzeer tussen acties",March:O3,"March ":"maart",May:R3,Menu:N3,Message:M3,Mo:L3,Model:P3,Monday:B3,Month:F3,More:j3,Name:z3,"No API key found":"Geen API-sleutel gevonden","No Chat GPT Key found":"Geen Chat GPT-sleutel gevonden","No active host found":"Geen actieve host gevonden","Nothing found":"Niets gevonden",November:U3,OK:H3,October:W3,Ok:G3,"On condition change":"Op voorwaarde verandering","On script save or adapter start":"Bij het opslaan van het script of het starten van de adapter","On weekdays":"Op weekdagen","Open configuration":"Configuratie openen","Operate two states":"Bedien twee toestanden:","Operations with two states":"Bewerkingen met twee toestanden","Paste your blocks here":"Plak hier je blokken",Pause:V3,"Pause execution":"Uitvoering pauzeren","Pause script":"Pauzeer script","Phone:":"Telefoon:","Please select object ID...":"Selecteer object-ID ...","Press Ctrl+Enter to get the answer":"Druk op Ctrl+Enter om het antwoord te krijgen","Prettify the script":"Maak het script mooier","Print some text in log":"Druk wat tekst af in het logboek","Priority:":"Prioriteit:",Pushover:K3,Pushsafer:Y3,"Read only ID selected: %s":"Alleen-lezen ID geselecteerd: %s",Rename:J3,"Reorder scripts in folders":"Sorteer scripts in mappen opnieuw",Repeat:q3,Restart:X3,Result:Z3,"Resume execution":"Uitvoering hervatten","Root folder":"Hoofdmap","Rules description":"Maak regels met IF, THEN, ELSE blokken","Run script":"Voer script uit",Sa:Q3,Saturday:eG,Save:tG,"Save all":"Sla alles op","Say It":"Say It","Say some text via sayit adapter":"Zeg wat tekst via de sayit-adapter",Schedule:sG,Script:oG,"Script %s was modified on disk":"Script %s is gewijzigd op schijf","Script is not running":"Script is niet actief","Search in scripts":"Zoeken in scripts","Search...":"Zoeken...","Select all":"Selecteer alles","Send email":"E-mail verzenden","Sends an email":"Stuurt een e-mail","Sends message via Pushsafer":"Stuurt bericht via Pushsafer","Sends message via pushover":"Stuurt bericht via pushover","Sends message via telegram":"Verzendt bericht via telegram","Sends message via whatsapp-cmb":"Stuurt bericht via whatsapp-cmb",September:iG,"Server time":"Servertijd","Set state action":"Stel statusactie in","Set with delay":"Met vertraging ingesteld","Shell command":"Shell-opdracht","Show astronomical events":"Laat astronomische gebeurtenissen zien","Show javascript code":"Javascript-code weergeven","Show logs":"Toon logboeken","Show only paused scripts":"Toon alleen onderbroken scripts","Show only running scripts":"Toon alleen actieve scripts","Show only scripts with problems":"Toon alleen scripts met problemen",Simulate:nG,"Some files will be rejected":"Sommige bestanden worden geweigerd","Sound:":"Geluid:",Stack:rG,Start:aG,"Start script":"Start het script",State:lG,"State condition":"Staat staat","Step into function":"Stap in functie","Step out from function":"Stap uit de functie","Stop on exception":"Stop bij uitzondering",Su:cG,"Subject:":"Onderwerpen:",Sunday:uG,"TS description":"Regels maken door Typescript te schrijven",Telegram:dG,"Text:":"Tekst:",Th:hG,"The script will be stopped and must be activated manually after debugging. Continue?":"Het script wordt gestopt en moet na het debuggen handmatig worden geactiveerd. Doorgaan met?","This is advances option. You can write your own code here and it will be executed on trigger":"Dit is een voorschotoptie. U kunt hier uw eigen code schrijven en deze wordt bij een trigger uitgevoerd",Thursday:pG,Time:gG,"Time condition":"Tijdsvoorwaarde","Title:":"Titel:","To:":"Naar:","Trigger with value":"Trigger met waarde",Triggered:mG,Triggers:fG,"Triggers the on script saving or the javascript instance restart":"Activeert het opslaan van het script of het opnieuw opstarten van de JavaScript-instantie","Triggers the rule on update or change of some state":"Activeert de regel voor het bijwerken of wijzigen van een bepaalde staat","Triggers the rule periodically or on some specific time":"Activeert de regel periodiek of op een specifieke tijd",Tu:$G,Tuesday:bG,URL:vG,"Unknown error":"Onbekende fout","Unknown error!":"Onbekende fout!","Use generated code":"Gebruik gegenereerde code","User function":"Gebruikersfunctie","User:":"Gebruiker:",Value:yG,"Vibration:":"Trilling:",Volume:_G,We:wG,Wednesday:kG,"Whatsapp-cmb":"Whatsapp-cmb",Write:CG,"Write your own code":"Schrijf je eigen code",Yes:TG,"Yet exists!":"Toch bestaat!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"U kunt %s in de URL gebruiken om de huidige triggerwaarde te gebruiken, %id om de geactiveerde object-ID te gebruiken, %name om de geactiveerde object-ID-naam te tonen of %old om de oude triggerwaarde te gebruiken","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"U kunt %s in de opdracht gebruiken om de huidige triggerwaarde te gebruiken, %id om de getriggerde object-ID te gebruiken, %name om de getriggerde object-ID-naam te tonen of %old om de oude triggerwaarde te gebruiken","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"U kunt %s in de tekst gebruiken om de huidige triggerwaarde weer te geven, %id om de geactiveerde object-ID te gebruiken, %name om de geactiveerde object-ID-naam weer te geven of %old om de oude triggerwaarde te gebruiken","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"U kunt %s in de waarde gebruiken om de huidige triggerwaarde te gebruiken, %id om de geactiveerde object-ID te gebruiken, %name om de geactiveerde object-ID-naam te tonen of %old om de oude triggerwaarde te gebruiken","You have to enter OpenAI API key in the configuration of javascript adapter.":"U moet de OpenAI API-sleutel invoeren in de configuratie van de javascript-adapter.","You have to enter at least one API key in the configuration of javascript adapter.":"U moet ten minste één API-sleutel (OpenAI, Anthropic of Gemini) invoeren in de configuratie van de javascript-adapter.","Please select a valid model":"Selecteer een geldig model","[equal]":"[Gelijk]","[greater or equal]":"[groter of gelijk]","[greater]":"[groter]","[hysteresis]":"[hysterese]","[includes]":"[inclusief]","[less or equal]":"[minder of gelijk]","[less]":"[minder]","[not equal]":"[niet gelijk]",acknowledgment:SG,all:EG,and:IG,"as JSON":"als JSON","as plain text":"als platte tekst",astro:xG,at:DG,"clear running":"duidelijk rennen",control:AG,copy:OG,cron:RG,dawn:NG,debug_help:MG,debug_label:LG,default:"standaard",dusk:PG,easy:BG,else:"anders","equal to":"gelijk aan",every:FG,"every hour at 0 minutes":"elk uur op 0 minuten",false:"false","file reading has failed: %s":"bestands lezen is mislukt: %s","file reading was aborted":"bestands lezen is afgebroken",filter_func:jG,filter_id:zG,filter_name:UG,filter_role:HG,filter_room:WG,"for edit or create script":"voor bewerken of een nieuw script maken","for professionals":"voor professionals","for programmers":"voor programmeurs",goldenHour:GG,goldenHourEnd:VG,"greater or equal":"groter of gelijk","greater or equal to":"groter of gelijk aan","greater than":"groter dan",help_just_check:KG,help_on_change:YG,"high priority":"hoge prioriteit","high-priority":"hoge prioriteit","highest priority":"hoogste prioriteit",hours:JG,includes:qG,interval:XG,"just check":"kijk maar","less or equal":"minder of gelijk","less or equal to":"minder of gelijk aan","less than":"minder dan","lower priority":"lagere prioriteit","lowest priority":"laagste prioriteit",magic:ZG,milliseconds:QG,minutes:eV,ms:tV,nadir:sV,nauticalDawn:oV,nauticalDusk:iV,nextSunrise:nV,nextSunset:rV,night:aV,nightEnd:lV,"no blocks found":"Geen blokken gevonden","no group":"GEEN GROEP",normal:cV,"normal priority":"normale prioriteit","not running":"niet actief","not equal to":"niet gelijk aan","not properly connected":"Dit blok is niet correct verbonden met andere blokken.",offset:uV,"on change":"bij verandering","on condition change":"op voorwaarde verandering","on update":"bij update",one:dV,or:hV,quiet:pV,"reset search":"reset zoeken",search:gV,seconds:mV,solarNoon:fV,"store in":"opslaan in",sunrise:$V,sunriseEnd:bV,sunset:vV,sunsetStart:yV,then:_V,"toggle value":"schakelwaarde",tooltip_ack:wV,tooltip_from:kV,tooltip_lc:CV,tooltip_quality:TV,tooltip_ts:SV,tooltip_user:EV,tooltip_value:IV,true:"waar",two:xV,undefined:"ongedefinieerd",update:DV,"use seconds":"gebruik seconden","use trigger value":"triggerwaarde gebruiken",verbose_help:AV,verbose_label:OV,when:RV,with:"met","with date":"met datum","with offset":"met offset",wizard:NV,"Loading models...":"Modellen laden...","Could not connect to API at %s":"Kan geen verbinding maken met API op %s","Invalid API key":"Ongeldige API-sleutel","Access denied by API":"Toegang geweigerd door API","API error: %s":"API-fout: %s",'Model "%s" not found':'Model "%s" niet gevonden',"Request failed: %s":"Verzoek mislukt: %s",Retry:MV,"No running javascript instance found":"Geen draaiende JavaScript-instantie gevonden"},PV="Potwierdzony",BV="Działania",FV="Dodaj",jV="Wszystko",zV="Każdy",UV="Zastosuj",HV="Kwiecień",WV="Zapytać",GV="Astronomiczny",VV="Sierpień",KV="Odwołaj",YV="Zamknij",JV="Stan",qV="Warunki",XV="Konsola",ZV="Skopiowano",QV="Grudzień",e4="Domyślna",t4="Opóźnienie",s4="Usuń",o4="Opis",i4="Gotowe",n4="Uruchom shell",r4="Wyjaśnienie",a4="Eksport",l4="Luty",c4="Luty",u4="Filtr",d4="Folder",h4="Pt",p4="Piątek",g4="ID",m4="ID1",f4="ID2",$4="Import",b4="Instancja",v4="Instancje",y4="Instrukcje",_4="Styczeń",w4="Styczeń",k4="Lipiec",C4="Czerwiec",T4="Limit",S4="Marzec",E4="Maj",I4="Menu",x4="Wiadomość",D4="Po",A4="Model",O4="Poniedziałek",R4="Miesiąc",N4="Więcej",M4="Nazwa",L4="Listopad",P4="OK",B4="Październik",F4="Ok",j4="Pauza",z4="Pushover",U4="Pushsafer",H4="Przemianuj",W4="Powtórz",G4="Uruchom ponownie",V4="Wynik",K4="So",Y4="Sobota",J4="Zapisz",q4="Harmonogram",X4="Skrypt",Z4="Wrzesień",Q4="Symulacja",e8="Stos",t8="Początek",s8="Stan",o8="Nd",i8="Niedziela",n8="Telegram",r8="Cz",a8="Czwartek",l8="Czas",c8="Wyzwolony",u8="Wyzwalacze",d8="Wt",h8="Wtorek",p8="URL",g8="Wartość",m8="Wolumen",f8="Śr",$8="Środa",b8="Pisać",v8="Tak",y8="potwierdzenie",_8="wszystko",w8="i",k8="Astro",C8="w",T8="kontrola",S8="Kopiuj",E8="CRON",I8="Świt",x8="Jest to specjalny tryb, w którym stany i obiekty się nie zmieniają. Jednak w protokole będą wyświetlane tylko informacje o każdej planowanej zmianie.",D8="Odpluskwić",A8="Zmierzch",O8="łatwy",R8="każdy",N8="Funkcja",M8="ID",L8="Nazwa",P8="Rola",B8="Pokój",F8="Złota godzina",j8="Koniec złotej godziny",z8="Kod zostanie wykonany tylko za każdym razem, gdy warunek będzie spełniony. Na przykład. jeśli wyzwalanie na wartość czujnika temperatury i warunek to „jeśli temperatura jest wyższa niż 20 ° C”, to działania „następnie” będą wykonywane za każdym razem, gdy czujnik wyśle temperaturę i jest powyżej 20 ° C. O 21 ° C, o 22 ° C i tak dalej.",U8="Kod zostanie wykonany tylko wtedy, gdy wynik warunku ulegnie zmianie. Na przykład. jeśli wyzwalanie na wartość czujnika temperatury i warunek „jeśli temperatura jest wyższa niż 20 ° C”, to akcje „następnie” zostaną wykonane raz, gdy temperatura przekroczy 20. Następnym razem działania „następnie” zostaną wykonane, gdy temperatura nie udaje się poniżej 20, a następnie ponownie wzrasta powyżej 20.",H8="godziny",W8="zawiera",G8="interwał",V8="magia",K8="milisekund",Y8="minuty",J8="ms",q8="Północ słoneczna",X8="Żeglarski świt",Z8="Żeglarski zmierzch",Q8="Następny wschód słońca",e6="Następny zachód słońca",t6="Noc",s6="Koniec nocy",o6="normalny",i6="przesunięcie",n6="jeden",r6="lub",a6="cisza",l6="Szukaj",c6="sekundy",u6="Południe słoneczne",d6="Wschód słońca",h6="Koniec wschodu słońca",p6="Zachód słońca",g6="Początek zachodu słońca",m6="następnie",f6="Akceptuj",$6="Od",b6="Ostatnia zmiana",v6="Jakość",y6="Znacznik czasu",_6="Użytkownik",w6="Wartość",k6="dwa",C6="aktualizacja",T6="Dodaje wyniki debugowania do dziennika dla wielu poleceń systemowych",S6="Pełne dane wyjściowe dziennika",E6="gdy",I6="Wizard",x6="Ponów próbę",D6={"%s not found":"%s nie znaleziono","()":"()","(at %s)":"(w %s)","(optional)":"(opcjonalny)","-":"-",".":".","AI code generator":"Generator kodu AI",Ack:PV,Actions:BV,"Actual time of day":"Aktualna pora dnia",Add:FV,"Add new script":"Dodaj nowy skrypt",All:jV,"All files will be accepted":"Wszystkie pliki zostaną zaakceptowane",Any:zV,"Any month":"Dowolny miesiąc",Apply:UV,April:HV,"Are you sure?":"Jesteś pewny?",Ask:WV,Astronomical:GV,"Astronomical events today":"Wydarzenia astronomiczne dzisiaj",August:VV,"Blockly description":"Tworzenie reguł za pomocą bloków graficznych","Body:":"Treść:",Cancel:KV,"Cannot delete non empty item!":"Nie można usunąć niepustego elementu!","Change layout":"Zmiana układu",'Change theme (actual "%s")':"Zmień motyw (obecnie - „%s”)","Check blocks":"Sprawdź bloki","Check is not active, because javascript adapter is disabled":"Sprawdzanie nie jest aktywne, ponieważ adapter Javascript jest wyłączony","Clear search input":"Wyczyść dane wyszukiwania","Click on this icon":"Kliknij tę ikonę",Close:YV,"Close all but current":"Zamknij wszystkie oprócz bieżących","Collapse all":"Zwinąć wszystkie","Compares current time with astronomical event":"Porównuje aktualny czas z wydarzeniem astronomicznym","Compares current time with the user specific time":"Porównuje aktualny czas z czasem określonym przez użytkownika","Compares the state value with user defined value":"Porównuje wartość stanu z wartością zdefiniowaną przez użytkownika",Condition:JV,Conditions:qV,"Configuration not saved.":"Konfiguracja nie została zapisana.",Console:XV,"Control or update some state":"Kontroluj lub aktualizuj stan","Control or update some state with delay":"Kontroluj lub aktualizuj jakiś stan z opóźnieniem","Convert blockly to javascript for ever.":"Bezpowrotna konwersja Blockly na Javascript.",Copied:ZV,"Copy script":"Skopiuj skrypt","Copy to clipboard":"Skopiuj do schowka","Create new":"Utwórz nowy","Create new folder":"Utwórz nowy folder","Create new script":"Utwórz nowy skrypt","Create or edit CRON or time wizard":"Utwórz lub edytuj CRON lub kreator czasu","Dark Theme":"Ciemny schemat","Dark style":"Ciemny styl",Date:"Data","Debug instance":"Debuguj instancję","Debug options":"Opcje debugowania",December:QV,Default:e4,"Define cron...":"Zdefiniuj CRON ...","Define schedule...":"Zdefiniuj harmonogram ...",Delay:t4,Delete:s4,"Delete %s":"Usuń %s ...","Delete folder":"Usuń folder","Delete script":"Usuń skrypt",Description:o4,"Deselect all":"Odznacz wszystkie","Discard changes for %s":"Odrzuć zmiany dla %s",Done:i4,"Double click to write value":"Kliknij dwukrotnie, aby zapisać wartość","Download as file":"Download jako plik plik","Drop some files here or click...":"Upuść niektóre pliki tutaj lub kliknij ...","Duplicate name":"Duplikat nazwy","Edit script or just double click":"Edytuj skrypt lub po prostu kliknij dwukrotnie","Empty name is not allowed":"Pusta nazwa jest niedozwolona","End search mode":"Zakończ tryb wyszukiwania","Enter your question":"Wpisz swoją prośbę",Error:"Błąd","Error formatting code":"Błąd formatowania kodu","Error was found":"Błąd został znaleziony","Every day":"Codziennie",Exec:n4,"Executes some shell command":"Wykonuje polecenie powłoki","Existing scripts will be overwritten.":"Istniejące skrypty zostaną zastąpione.","Expand all":"Rozwiń wszystkie","Expert mode":"Tryb ekspercki",Explanation:r4,Export:a4,"Export all scripts":"Wyeksportuj wszystkie skrypty","Export blocks":"Eksportuj bloki","Export selected blocks":"Eksportuj wybrane bloki",Februar:l4,February:c4,Filter:u4,Folder:d4,Fr:h4,Friday:p4,Function:"Funkcja","Function editor":"Edytor funkcji","Function: executed":"Funkcja: wykonywana","Go to next line":"Przejdź do następnej linii","HTTP Call":"Połączenie HTTP","Hide logs":"Ukryj dzienniki",ID:g4,ID1:m4,ID2:f4,Import:$4,"Import blocks":"Importuj bloki","Import error":"Błąd importowania","Import scripts":"Importuj skrypty","Insert object ID":"Wstaw identyfikator obiektu",Instance:b4,"Instance is disabled":"Instancja jest wyłączona","Instance:":"Instancja:",Instances:v4,Instructions:y4,"Invalid CRON":"Nieprawidłowy CRON","It will not be possible to revert this operation.":"Cofnięcie tej operacji nie będzie możliwe.","JS description":"Tworzenie reguł w Javascript",Januar:_4,January:w4,July:k4,June:C4,"Just check":"Po prostu sprawdź","Language:":"Język:","Learn More":"Ucz się więcej","Light style":"Lekki styl",Limit:T4,"Local time":"Czas lokalny","Locate file":"Znajdź plik","Log outputs":"Log dziennika","Log text":"Tekst dziennika","Log: %s":"Dziennik: %s","Make a HTTP get request":"Złóż żądanie HTTP get","Make a pause between actions":"Zrób przerwę między czynnościami",March:S4,"March ":"Marzec ",May:E4,Menu:I4,Message:x4,Mo:D4,Model:A4,Monday:O4,Month:R4,More:N4,Name:M4,"No API key found":"Nie znaleziono klucza API","No Chat GPT Key found":"Nie znaleziono klucza GPT czatu","No active host found":"Nie znaleziono aktywnego hosta","Nothing found":"Nic nie znaleziono",November:L4,OK:P4,October:B4,Ok:F4,"On condition change":"W przypadku zmiany warunków","On script save or adapter start":"Podczas zapisywania skryptu lub uruchamiania adaptera","On weekdays":"W dni powszednie","Open configuration":"Otwarta konfiguracja","Operate two states":"Obsługuj dwa stany","Operations with two states":"Operacje z dwoma stanami","Paste your blocks here":"Wklej tutaj swoje bloki",Pause:j4,"Pause execution":"Wstrzymaj wykonanie","Pause script":"Wstrzymaj skrypt","Phone:":"Telefon:","Please select object ID...":"Wybierz identyfikator obiektu ...","Press Ctrl+Enter to get the answer":"Naciśnij klawisze Ctrl+Enter, aby uzyskać odpowiedź","Prettify the script":"Upiększ skrypt","Print some text in log":"Wydrukuj tekst w dzienniku","Priority:":"Priorytet:",Pushover:z4,Pushsafer:U4,"Read only ID selected: %s":"Wybrano identyfikator tylko do odczytu: %s",Rename:H4,"Reorder scripts in folders":"Zmień kolejność skryptów w folderach",Repeat:W4,Restart:G4,Result:V4,"Resume execution":"Wznów wykonanie","Root folder":"Folder główny","Rules description":"Twórz reguły z blokami IF, THEN, ELSE","Run script":"Uruchom skrypt",Sa:K4,Saturday:Y4,Save:J4,"Save all":"Zapisz wszystko","Say It":"Wypowiedz","Say some text via sayit adapter":"Powiedz tekst przez adapter sayit",Schedule:q4,Script:X4,"Script %s was modified on disk":"Skrypt %s został zmodyfikowany na dysku","Script is not running":"Skrypt nie działa","Search in scripts":"Szukaj w skryptach","Search...":"Szukaj...","Select all":"Zaznacz wszystko","Send email":"Wysłać email","Sends an email":"Wysyła e-mail","Sends message via Pushsafer":"Wysyła wiadomość przez Pushsafer","Sends message via pushover":"Wysyła wiadomość przez pushover","Sends message via telegram":"Wysyła wiadomość telegramem","Sends message via whatsapp-cmb":"Wysyła wiadomość przez WhatsApp-cmb",September:Z4,"Server time":"Czas serwera","Set state action":"Ustaw stan działania","Set with delay":"Ustaw z opóźnieniem","Shell command":"Polecenie powłoki","Show astronomical events":"Pokaż wydarzenia astronomiczne","Show javascript code":"Pokaż kod JavaScript","Show logs":"Pokaż dzienniki","Show only paused scripts":"Pokaż tylko wstrzymane skrypty","Show only running scripts":"Pokaż tylko działające skrypty","Show only scripts with problems":"Pokaż tylko skrypty z problemami",Simulate:Q4,"Some files will be rejected":"Niektóre pliki zostaną odrzucone","Sound:":"Dźwięk:",Stack:e8,Start:t8,"Start script":"Uruchom skrypt",State:s8,"State condition":"Warunek stanu","Step into function":"Wejdź do funkcji","Step out from function":"Wyjdź z funkcji","Stop on exception":"Zatrzymaj się na wyjątku",Su:o8,"Subject:":"Temat:",Sunday:i8,"TS description":"Tworzenie reguł w Typescript",Telegram:n8,"Text:":"Tekst:",Th:r8,"The script will be stopped and must be activated manually after debugging. Continue?":"Skrypt zostanie zatrzymany i należy go aktywować ręcznie po debugowaniu. Kontyntynuj?","This is advances option. You can write your own code here and it will be executed on trigger":"To jest opcja zaawansowana. Możesz tutaj napisać własny kod, który zostanie wykonany po wyzwoleniu",Thursday:a8,Time:l8,"Time condition":"Warunek czasowy","Title:":"Tytuł:","To:":"Do:","Trigger with value":"Wyzwalacz z wartością",Triggered:c8,Triggers:u8,"Triggers the on script saving or the javascript instance restart":"Uruchamia zapisywanie skryptu lub restart instancji javascript","Triggers the rule on update or change of some state":"Uruchamia regułę przy aktualizacji lub zmianie jakiegoś stanu","Triggers the rule periodically or on some specific time":"Uruchamia regułę okresowo lub w określonym czasie",Tu:d8,Tuesday:h8,URL:p8,"Unknown error":"Nieznany błąd","Unknown error!":"Nieznany błąd!","Use generated code":"Użyj wygenerowanego kodu","User function":"Funkcja użytkownika","User:":"Użytkownik:",Value:g8,"Vibration:":"Wibracja:",Volume:m8,We:f8,Wednesday:$8,"Whatsapp-cmb":"Whatsapp-cmb",Write:b8,"Write your own code":"Napisz swój własny kod",Yes:v8,"Yet exists!":"A jednak istnieje!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Możesz użyć %s w adresie URL, aby użyć bieżącej wartości wyzwalacza, %id, aby użyć wyzwalanego identyfikatora obiektu, %name, aby wyświetlić nazwę identyfikatora wyzwalanego obiektu, lub %old, aby użyć starej wartości wyzwalacza","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Możesz użyć %s w poleceniu, aby użyć bieżącej wartości wyzwalającej, %id, aby użyć identyfikatora wyzwalanego obiektu, %name, aby wyświetlić nazwę identyfikatora wyzwalanego obiektu, lub %old, aby użyć starej wartości wyzwalającej","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Możesz użyć %s w tekście, aby wyświetlić aktualną wartość wyzwalającą, %id, aby użyć identyfikatora wyzwolonego obiektu, %name, aby wyświetlić nazwę identyfikatora wyzwolonego obiektu lub %old, aby użyć starej wartości wyzwalającej","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Możesz użyć %s w wartości, aby użyć bieżącej wartości wyzwalacza, %id, aby użyć identyfikatora wyzwalanego obiektu, %name, aby wyświetlić nazwę identyfikatora wyzwalanego obiektu, lub %old, aby użyć starej wartości wyzwalacza","You have to enter OpenAI API key in the configuration of javascript adapter.":"Należy wprowadzić klucz OpenAI API w konfiguracji adaptera javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Musisz wprowadzić co najmniej jeden klucz API (OpenAI, Anthropic lub Gemini) w konfiguracji adaptera javascript.","Please select a valid model":"Wybierz prawidłowy model","[equal]":"[równy]","[greater or equal]":"[większe lub równe]","[greater]":"[większe]","[hysteresis]":"[histereza]","[includes]":"[obejmuje]","[less or equal]":"[mniejsze lub równe]","[less]":"[mniejsze]","[not equal]":"[nie równe]",acknowledgment:y8,all:_8,and:w8,"as JSON":"jako JSON","as plain text":"jako zwykły tekst",astro:k8,at:C8,"clear running":"czyste uruchomienie",control:T8,copy:S8,cron:E8,dawn:I8,debug_help:x8,debug_label:D8,default:"domyślna",dusk:A8,easy:O8,else:"inaczej","equal to":"równy",every:R8,"every hour at 0 minutes":"co godzinę po 0 minutach",false:"fałsz","file reading has failed: %s":"odczyt pliku nie powiódł się: %s","file reading was aborted":"odczyt pliku został przerwany",filter_func:N8,filter_id:M8,filter_name:L8,filter_role:P8,filter_room:B8,"for edit or create script":"do edycji lub utwórz nowy skrypt","for professionals":"dla profesjonalistów","for programmers":"dla programistów",goldenHour:F8,goldenHourEnd:j8,"greater or equal":"większe lub równe","greater or equal to":"więcej lub równo","greater than":"więcej niż",help_just_check:z8,help_on_change:U8,"high priority":"wysoki priorytet","high-priority":"wysoki priorytet","highest priority":"najwyższy priorytet",hours:H8,includes:W8,interval:G8,"just check":"po prostu sprawdź","less or equal":"mniejsze lub równe","less or equal to":"mniej lub równo","less than":"mniej niż","lower priority":"niższy priorytet","lowest priority":"najniższy priorytet",magic:V8,milliseconds:K8,minutes:Y8,ms:J8,nadir:q8,nauticalDawn:X8,nauticalDusk:Z8,nextSunrise:Q8,nextSunset:e6,night:t6,nightEnd:s6,"no blocks found":"Nie znaleziono bloków","no group":"BRAK GRUPY",normal:o6,"normal priority":"normalny priorytet","not running":"nie uruchomiony","not equal to":"nie równa się","not properly connected":"Ten blok nie jest poprawnie podłączony do innych bloków.",offset:i6,"on change":"na zmianę","on condition change":"pod warunkiem zmiany warunków","on update":"po aktualizacji",one:n6,or:r6,quiet:a6,"reset search":"zresetuj wyszukiwanie",search:l6,seconds:c6,solarNoon:u6,"store in":"przechowaj w",sunrise:d6,sunriseEnd:h6,sunset:p6,sunsetStart:g6,then:m6,"toggle value":"wartość przełączania",tooltip_ack:f6,tooltip_from:$6,tooltip_lc:b6,tooltip_quality:v6,tooltip_ts:y6,tooltip_user:_6,tooltip_value:w6,true:"prawda",two:k6,undefined:"nieokreślony",update:C6,"use seconds":"użyj sekund","use trigger value":"użyj wartości wyzwalającej",verbose_help:T6,verbose_label:S6,when:E6,with:"z","with date":"z datą","with offset":"z przesunięciem",wizard:I6,"Loading models...":"Ładowanie modeli...","Could not connect to API at %s":"Nie można połączyć się z API pod adresem %s","Invalid API key":"Nieprawidłowy klucz API","Access denied by API":"Odmowa dostępu przez API","API error: %s":"Błąd API: %s",'Model "%s" not found':'Model "%s" nie znaleziony',"Request failed: %s":"Żądanie nie powiodło się: %s",Retry:x6,"No running javascript instance found":"Nie znaleziono uruchomionej instancji JavaScript"},A6="Reconhecido",O6="Ações",R6="Adicionar",N6="Todos",M6="Nenhum",L6="Aplique",P6="abril",B6="Perguntar",F6="Astronômico",j6="agosto",z6="Cancelar",U6="Fechar",H6="Doença",W6="Condições",G6="Console",V6="Copiado",K6="dezembro",Y6="Predefinição",J6="Atraso",q6="Deletar",X6="Descrição",Z6="Pronto",Q6="Exec shell",e9="Explicação",t9="Exportação",s9="Februar",o9="fevereiro",i9="Filtro",n9="Pasta",r9="Fr",a9="Sexta-feira",l9="ID",c9="ID1",u9="ID2",d9="Importar",h9="Instância",p9="Instâncias",g9="Instruções",m9="Januar",f9="janeiro",$9="julho",b9="junho",v9="Limite",y9="março",_9="maio",w9="Menu",k9="mensagem",C9="Mo",T9="Modelo",S9="Segunda-feira",E9="Mês",I9="Mais",x9="Nome",D9="novembro",A9="OK",O9="outubro",R9="Ok",N9="Pausa",M9="Pushover",L9="Pushsafer",P9="Renomear",B9="Repetir",F9="Reiniciar",j9="Resultado",z9="Sá",U9="Sábado",H9="Salve",W9="Cronograma",G9="Script",V9="setembro",K9="Simular",Y9="Pilha",J9="Começar",q9="Estado",X9="Su",Z9="Domingo",Q9="Telegrama",eK="4",tK="Quinta-feira",sK="Tempo",oK="Provocado",iK="Gatilhos",nK="Tu",rK="terça",aK="URL",lK="Valor",cK="Volume",uK="3",dK="quarta",hK="Escrever",pK="sim",gK="reconhecimento",mK="todos",fK="e",$K="astro",bK="no",vK="ao controle",yK="copiar",_K="CRON",wK="alvorecer",kK="Este é um modo especial no qual estados e objetos não serão alterados. Mas apenas as informações sobre cada mudança planejada serão exibidas no protocolo.",CK="Depurar",TK="Crepúsculo",SK="fácil",EK="cada",IK="Função",xK="ID",DK="Nome",AK="Tipo",OK="Quarto",RK="Hora dourada",NK="Fim da hora de ouro",MK='O código será executado apenas sempre que a condição for verdadeira. Por exemplo. se disparar no valor do sensor de temperatura e a condição for "se a temperatura for maior que 20 ° C", as ações "então" serão executadas toda vez que o sensor enviar a temperatura e ela estiver acima de 20 ° C. Por 21 ° C, por 22 ° C e assim por diante.',LK='O código será executado apenas se o resultado da condição mudar. Por exemplo. se disparar no valor do sensor de temperatura e a condição for "se a temperatura for maior que 20 ° C", as ações "então" serão executadas uma vez quando a temperatura estiver acima de 20. Na próxima vez, as ações "então" serão executadas quando a temperatura falha abaixo de 20 e sobe acima de 20 novamente.',PK="horas",BK="inclui",FK="intervalo",jK="Magia",zK="milissegundos",UK="minutos",HK="ms",WK="nadir",GK="Madrugada náutica",VK="Crepúsculo náutico",KK="próximo nascer do sol",YK="Próximo pôr do sol",JK="Noite",qK="Fim de noite",XK="normal",ZK="Deslocamento",QK="1",e7="ou",t7="quieto",s7="procurar",o7="segundos",i7="Meio-dia solar",n7="nascer do sol",r7="Fim do nascer do sol",a7="pôr do sol",l7="Começo do pôr do sol",c7="então",u7="reconhecer",d7="de",h7="Última alteração",p7="Qualidade",g7="timestamp",m7="usuário",f7="valor",$7="dois",b7="atualizar",v7="Adiciona saída de depuração ao log para muitos comandos do sistema",y7="Saídas de log detalhadas",_7="quando",w7="Wizard",k7="Tentar novamente",C7={"%s not found":"%s não encontrado","()":"()","(at %s)":"(em %s)","(optional)":"(opcional)","-":"-",".":".","AI code generator":"Gerador de código de IA",Ack:A6,Actions:O6,"Actual time of day":"Hora real do dia",Add:R6,"Add new script":"Adicionar novo script",All:N6,"All files will be accepted":"Todos os arquivos serão aceitos",Any:M6,"Any month":"Qualquer mês",Apply:L6,April:P6,"Are you sure?":"Você tem certeza?",Ask:B6,Astronomical:F6,"Astronomical events today":"Eventos astronômicos hoje",August:j6,"Blockly description":"Criando regras por blocos gráficos","Body:":"Corpo:",Cancel:z6,"Cannot delete non empty item!":"Não pode ser deletar, porque não está vazio!","Change layout":"Alterar layout",'Change theme (actual "%s")':'Alterar tema (agora - "%s")',"Check blocks":"Verificar blocos","Check is not active, because javascript adapter is disabled":"A verificação de sintaxe não está ativa porque o adaptador javascript não está rodando.","Clear search input":"Limpar entrada de pesquisa","Click on this icon":"Clique neste ícone",Close:U6,"Close all but current":"Fechar tudo, menos atual","Collapse all":"Recolher todos","Compares current time with astronomical event":"Compara o tempo atual com o evento astronômico","Compares current time with the user specific time":"Compara a hora atual com a hora específica do usuário","Compares the state value with user defined value":"Compara o valor do estado com o valor definido pelo usuário",Condition:H6,Conditions:W6,"Configuration not saved.":"Configuração não esta salva.",Console:G6,"Control or update some state":"Controlar ou atualizar algum estado","Control or update some state with delay":"Controlar ou atualizar algum estado com atraso","Convert blockly to javascript for ever.":"Converter Blockly em Javascript permanentemente.",Copied:V6,"Copy script":"Copiar script","Copy to clipboard":"Copiar para área de transferência","Create new":"Crie um novo","Create new folder":"Criar nova pasta","Create new script":"Criar novo script","Create or edit CRON or time wizard":"Criar ou editar o assistente cron ou o assistente de horário","Dark Theme":"Layout escuro","Dark style":"Estilo escuro",Date:"Encontro","Debug instance":"Instância de depuração","Debug options":"Opções de depuração",December:K6,Default:Y6,"Define cron...":"Definir cron...","Define schedule...":"Definir agendamento ...",Delay:J6,Delete:q6,"Delete %s":"Deletar %s...","Delete folder":"Deletar pasta","Delete script":"Deletar script",Description:X6,"Deselect all":"Desmarcar todos","Discard changes for %s":"Descartar alterações para %s",Done:Z6,"Double click to write value":"Clique duas vezes para escrever o valor","Download as file":"Baixar como arquivo","Drop some files here or click...":"Solte alguns arquivos aqui ou clique em...","Duplicate name":"Nome duplicado","Edit script or just double click":"Edite o script ou clique duas vezes","Empty name is not allowed":"Nome vazio não é permitido","End search mode":"Finalizar modo de pesquisa","Enter your question":"Digite sua solicitação",Error:"Erro","Error formatting code":"Erro de formatação de código","Error was found":"Erro foi encontrado","Every day":"Todos os dias",Exec:Q6,"Executes some shell command":"Executa algum comando shell","Existing scripts will be overwritten.":"Os scripts existentes serão substituídos.","Expand all":"Expandir todos","Expert mode":"Modo de especialista",Explanation:e9,Export:t9,"Export all scripts":"Exportar todos os scripts","Export blocks":"Exportar blocos","Export selected blocks":"Exportar blocos selecionados",Februar:s9,February:o9,Filter:i9,Folder:n9,Fr:r9,Friday:a9,Function:"Função","Function editor":"Editor de funções","Function: executed":"Função: executado","Go to next line":"Vá para a próxima linha","HTTP Call":"Chamada HTTP","Hide logs":"Ocultar logs",ID:l9,ID1:c9,ID2:u9,Import:d9,"Import blocks":"Importar blocos","Import error":"Erro de importação","Import scripts":"Importar script","Insert object ID":"Inserir ID do objeto",Instance:h9,"Instance is disabled":"Instância está desativada","Instance:":"Instância:",Instances:p9,Instructions:g9,"Invalid CRON":"CRON inválido","It will not be possible to revert this operation.":"Não será possível reverter esta operação.","JS description":"Criando regras escrevendo Javascript",Januar:m9,January:f9,July:$9,June:b9,"Just check":"Apenas verifique","Language:":"Língua:","Learn More":"Aprender mais","Light style":"Estilo claro",Limit:v9,"Local time":"Hora local","Locate file":"Localize o arquivo","Log outputs":"Saídas de log","Log text":"Texto de registro","Log: %s":"Log: %s","Make a HTTP get request":"Faça uma solicitação HTTP get","Make a pause between actions":"Faça uma pausa entre as ações",March:y9,"March ":"Março",May:_9,Menu:w9,Message:k9,Mo:C9,Model:T9,Monday:S9,Month:E9,More:I9,Name:x9,"No API key found":"Nenhuma chave API encontrada","No Chat GPT Key found":"Nenhuma chave GPT de bate-papo encontrada","No active host found":"Nenhum host ativo encontrado","Nothing found":"Nada encontrado",November:D9,OK:A9,October:O9,Ok:R9,"On condition change":"Na mudança de condição","On script save or adapter start":"Ao salvar o script ou iniciar o adaptador","On weekdays":"Nos dias úteis","Open configuration":"Configuração aberta","Operate two states":"Operar dois estados","Operations with two states":"Operações com dois estados","Paste your blocks here":"Cole seus blocos aqui",Pause:N9,"Pause execution":"Pausar a execução","Pause script":"Pausar script","Phone:":"Telefone:","Please select object ID...":"Selecione o ID do objeto...","Press Ctrl+Enter to get the answer":"Pressione Ctrl+Enter para obter a resposta","Prettify the script":"Embeleze o roteiro","Print some text in log":"Imprimir algum texto no log","Priority:":"Prioridade:",Pushover:M9,Pushsafer:L9,"Read only ID selected: %s":"ID somente leitura selecionada: %s",Rename:P9,"Reorder scripts in folders":"Reordenar scripts em pastas",Repeat:B9,Restart:F9,Result:j9,"Resume execution":"Retomar execução","Root folder":"Pasta principal","Rules description":"Crie regras com blocos IF, THEN, ELSE","Run script":"Executar script",Sa:z9,Saturday:U9,Save:H9,"Save all":"Salvar tudo","Say It":"Say It","Say some text via sayit adapter":"Diga algum texto através do adaptador sayit",Schedule:W9,Script:G9,"Script %s was modified on disk":'O script "%s" foi modificado no disco rígido',"Script is not running":"Script não está sendo executado","Search in scripts":"Pesquisa em scripts","Search...":"Procurar...","Select all":"Selecionar tudo","Send email":"Enviar email","Sends an email":"Envia um email","Sends message via Pushsafer":"Envia mensagem via Pushsafer","Sends message via pushover":"Envia mensagem via pushover","Sends message via telegram":"Envia mensagem via telegrama","Sends message via whatsapp-cmb":"Envia mensagem via whatsapp-cmb",September:V9,"Server time":"Tempo de servidor","Set state action":"Definir ação de estado","Set with delay":"Definido com atraso","Shell command":"Comando shell","Show astronomical events":"Mostrar eventos astronômicos","Show javascript code":"Mostrar código Javascript","Show logs":"Mostrar logs","Show only paused scripts":"Mostrar apenas scripts pausados","Show only running scripts":"Mostrar apenas scripts em execução","Show only scripts with problems":"Mostrar apenas scripts com problemas",Simulate:K9,"Some files will be rejected":"Alguns arquivos serão rejeitados","Sound:":"Som:",Stack:Y9,Start:J9,"Start script":"Iniciar script",State:q9,"State condition":"Condição de estado","Step into function":"Entre na função","Step out from function":"Saia da função","Stop on exception":"Pare na exceção",Su:X9,"Subject:":"Sujeito:",Sunday:Z9,"TS description":"Criando regras escrevendo Typecript",Telegram:Q9,"Text:":"Texto:",Th:eK,"The script will be stopped and must be activated manually after debugging. Continue?":"O script será interrompido e deve ser ativado manualmente após a depuração. Continuar?","This is advances option. You can write your own code here and it will be executed on trigger":"Esta é a opção de avanços. Você pode escrever seu próprio código aqui e ele será executado no gatilho",Thursday:tK,Time:sK,"Time condition":"Condição de tempo","Title:":"Título:","To:":"Para:","Trigger with value":"Trigger com valor",Triggered:oK,Triggers:iK,"Triggers the on script saving or the javascript instance restart":"Aciona o salvamento do script ou a reinicialização da instância javascript","Triggers the rule on update or change of some state":"Aciona a regra na atualização ou mudança de algum estado","Triggers the rule periodically or on some specific time":"Aciona a regra periodicamente ou em algum momento específico",Tu:nK,Tuesday:rK,URL:aK,"Unknown error":"Erro desconhecido","Unknown error!":"Erro desconhecido!","Use generated code":"Usar código gerado","User function":"Função do usuário","User:":"Do utilizador:",Value:lK,"Vibration:":"Vibração:",Volume:cK,We:uK,Wednesday:dK,"Whatsapp-cmb":"Whatsapp-cmb",Write:hK,"Write your own code":"Escreva seu próprio código",Yes:pK,"Yet exists!":"Ainda existe!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Você pode usar %s na URL para usar o valor do gatilho atual, %id para usar o ID do objeto acionado, %name para mostrar o nome do ID do objeto acionado ou %old para usar o valor do gatilho antigo","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Você pode usar %s no comando para usar o valor do acionador atual, %id para usar o ID do objeto acionado, %name para mostrar o nome do ID do objeto acionado ou %old para usar o valor do acionador antigo","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Você pode usar %s no texto para exibir o valor do acionador atual, %id para usar o ID do objeto acionado, %name para mostrar o nome do ID do objeto acionado ou %old para usar o valor do acionador antigo","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Você pode usar %s no valor para usar o valor do acionador atual, %id para usar o ID do objeto acionado, %name para mostrar o nome do ID do objeto acionado ou %old para usar o valor do acionador antigo","You have to enter OpenAI API key in the configuration of javascript adapter.":"Você deve inserir a chave da API OpenAI na configuração do adaptador javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Você deve inserir pelo menos uma chave API (OpenAI, Anthropic ou Gemini) na configuração do adaptador javascript.","Please select a valid model":"Selecione um modelo válido","[equal]":"[igual]","[greater or equal]":"[maior ou igual]","[greater]":"[maior]","[hysteresis]":"[histerese]","[includes]":"[inclui]","[less or equal]":"[menor ou igual]","[less]":"[menos]","[not equal]":"[não igual]",acknowledgment:gK,all:mK,and:fK,"as JSON":"como JSON","as plain text":"como texto simples",astro:$K,at:bK,"clear running":"corrida limpa",control:vK,copy:yK,cron:_K,dawn:wK,debug_help:kK,debug_label:CK,default:"predefinição",dusk:TK,easy:SK,else:"outro","equal to":"igual a",every:EK,"every hour at 0 minutes":"a cada hora em 0 minutos",false:"falso","file reading has failed: %s":"a leitura do arquivo falhou: %s","file reading was aborted":"a leitura do arquivo foi abortada",filter_func:IK,filter_id:xK,filter_name:DK,filter_role:AK,filter_room:OK,"for edit or create script":"para editar ou criar um novo script","for professionals":"para profissionais","for programmers":"para programadores",goldenHour:RK,goldenHourEnd:NK,"greater or equal":"maior ou igual","greater or equal to":"maior ou igual a","greater than":"Maior que",help_just_check:MK,help_on_change:LK,"high priority":"prioridade máxima","high-priority":"prioridade máxima","highest priority":"Prioridade máxima",hours:PK,includes:BK,interval:FK,"just check":"Apenas verifique","less or equal":"menor ou igual","less or equal to":"menor ou igual a","less than":"Menor que","lower priority":"prioridade mais baixa","lowest priority":"prioridade mais baixa",magic:jK,milliseconds:zK,minutes:UK,ms:HK,nadir:WK,nauticalDawn:GK,nauticalDusk:VK,nextSunrise:KK,nextSunset:YK,night:JK,nightEnd:qK,"no blocks found":"Nenhum bloco encontrado","no group":"SEM GRUPO",normal:XK,"normal priority":"prioridade normal","not running":"não está em execução","not equal to":"não é igual a","not properly connected":"Este bloco não está conectado corretamente com outros blocos.",offset:ZK,"on change":"em mudança","on condition change":"na mudança de condição","on update":"em atualização",one:QK,or:e7,quiet:t7,"reset search":"redefinir pesquisa",search:s7,seconds:o7,solarNoon:i7,"store in":"armazenar em",sunrise:n7,sunriseEnd:r7,sunset:a7,sunsetStart:l7,then:c7,"toggle value":"valor de alternância",tooltip_ack:u7,tooltip_from:d7,tooltip_lc:h7,tooltip_quality:p7,tooltip_ts:g7,tooltip_user:m7,tooltip_value:f7,true:"verdade",two:$7,undefined:"Indefinido",update:b7,"use seconds":"use segundos","use trigger value":"use o gatilho",verbose_help:v7,verbose_label:y7,when:_7,with:"com","with date":"com data","with offset":"com deslocamento",wizard:w7,"Loading models...":"Carregando modelos...","Could not connect to API at %s":"Não foi possível conectar à API em %s","Invalid API key":"Chave API inválida","Access denied by API":"Acesso negado pela API","API error: %s":"Erro de API: %s",'Model "%s" not found':'Modelo "%s" não encontrado',"Request failed: %s":"Solicitação falhou: %s",Retry:k7,"No running javascript instance found":"Nenhuma instância JavaScript em execução encontrada"},T7="Подтверждение",S7="Действия",E7="Добавить",I7="Все",x7="Любая",D7="Применить",A7="Апрель",O7="Спросить",R7="Aстрономический",N7="Август",M7="Отмена",L7="Закрыть",P7="Условие",B7="Условия",F7="Приставка",j7="Скопировано",z7="Декабрь",U7="Дефолт",H7="Задержка",W7="Удалить",G7="Описание",V7="Готово",K7="Исполнить shell",Y7="Объяснение",J7="Экспорт",q7="Февраль",X7="Февраль",Z7="Фильтр",Q7="Папка",eY="Пт",tY="пятница",sY="ID",oY="ID1",iY="ID2",nY="Импорт",rY="Экземпляр",aY="Экземпляры",lY="Инструкции",cY="Январь",uY="Январь",dY="Июль",hY="Июнь",pY="Предел",gY="Март",mY="Май",fY="Меню",$Y="Сообщение",bY="Пн",vY="Модель",yY="понедельник",_Y="Месяц",wY="Более",kY="Имя",CY="Ноябрь",TY="Ок",SY="Октябрь",EY="Ok",IY="Пауза",xY="Pushover",DY="Pushsafer",AY="Переименовать",OY="Повторение",RY="Перезапустить",NY="Результат",MY="Сб",LY="суббота",PY="Сохранить",BY="Расписание",FY="скрипт",jY="Сентябрь",zY="Симулировать",UY="Stack",HY="Начинать",WY="Состояние",GY="Вс",VY="Воскресенье",KY="Telegram",YY="Чт",JY="Четверг",qY="Время",XY="Срабатывает",ZY="Триггеры",QY="Вт",eJ="вторник",tJ="URL",sJ="Значение",oJ="Громкость",iJ="Ср",nJ="среда",rJ="Напишите",aJ="Да",lJ="подтверждение",cJ="все",uJ="и",dJ="Астро",hJ="в",pJ="контроль",gJ="копия",mJ="CRON",fJ="Рассвет",$J="Это особый режим, в котором состояния и объекты не будут меняться. Но в протоколе будет отображаться только информация о каждом планируемом изменении.",bJ="Отлаживать",vJ="Сумерки",yJ="легкий",_J="каждые(ый)",wJ="Функция",kJ="ID",CJ="Название",TJ="Роль",SJ="Комната",EJ="Золотой час",IJ="Конец золотого часа",xJ="Код будет выполняться только каждый раз, когда условие истинно. Например. при срабатывании по значению датчика температуры и условию «если температура выше 20°C», действия «затем» будут выполняться каждый раз, когда датчик отправляет значение температуры, и оно превышает 20°C. На 21°С, на 22°С и так далее.",DJ="Код будет выполнен только в случае изменения результата условия. Например, при срабатывании по значению датчика температуры и условию «если температура больше 20°C», действия «затем» будут выполнены один раз, когда температура превысит 20°C. В следующий раз действия «затем» будут выполнены, когда температура опустится ниже 20°C, а затем снова поднимается выше 20°C.",AJ="час(ов)",OJ="содержит",RJ="интервал",NJ="магия",MJ="миллисекунды",LJ="минут(у)",PJ="мс",BJ="Надир",FJ="Морской рассвет",jJ="Морские сумерки",zJ="Следующий восход",UJ="Следующий закат",HJ="Ночь",WJ="Конец ночи",GJ="нормальный",VJ="сдвиг",KJ="один",YJ="или",JJ="тихий",qJ="поиск",XJ="секунд",ZJ="Солнечный полдень",QJ="Восход солнца",eq="Конец восхода",tq="Закат солнца",sq="Начало заката",oq="тогда",iq="Подтверждено",nq="От",rq="Последнее изменение",aq="Качественный",lq="Время",cq="Пользователь",uq="Значение",dq="два",hq="обновить",pq="Добавляет вывод отладки в журнал для многих системных команд.",gq="Подробный протокол",mq="если",fq="Мастер",$q="Повторить",bq={"%s not found":"%s не найден","()":"()","(at %s)":"(в %s)","(optional)":"(необязательный)","-":"-",".":".","AI code generator":"ИИ Генератор кода",Ack:T7,Actions:S7,"Actual time of day":"Фактическое время суток",Add:E7,"Add new script":"Добавить новый скрипт",All:I7,"All files will be accepted":"Все файлы будут приняты",Any:x7,"Any month":"В любой месяц",Apply:D7,April:A7,"Are you sure?":"Вы уверены?",Ask:O7,Astronomical:R7,"Astronomical events today":"Астрономические события сегодня",August:N7,"Blockly description":"Создание правил графическими блоками","Body:":"Тело:",Cancel:M7,"Cannot delete non empty item!":"Не удается удалить непустой элемент!","Change layout":"Изменить макет",'Change theme (actual "%s")':'Сменить тему (сейчас - "%s")',"Check blocks":"Проверить блоки","Check is not active, because javascript adapter is disabled":"Проверка неактивна, потому что адаптер Javascript отключен","Clear search input":"Очистить ввод","Click on this icon":"Нажмите на этот значок",Close:L7,"Close all but current":"Закрыть все кроме текущего","Collapse all":"Свернуть все","Compares current time with astronomical event":"Сравнивает текущее время с астрономическим событием","Compares current time with the user specific time":"Сравнивает текущее время с конкретным временем пользователя","Compares the state value with user defined value":"Сравнивает значение состояния с пользовательским значением",Condition:P7,Conditions:B7,"Configuration not saved.":"Конфигурация не сохранена.",Console:F7,"Control or update some state":"Контролировать или обновлять какое-то состояние","Control or update some state with delay":"Контролировать или обновлять какое-либо состояние с задержкой","Convert blockly to javascript for ever.":"Преобразовать blockly в Javascript навсегда.",Copied:j7,"Copy script":"Скопировать скрипт","Copy to clipboard":"Скопировать в буфер обмена","Create new":"Создать новый","Create new folder":"Создать новую папку","Create new script":"Создать новый скрипт","Create or edit CRON or time wizard":"Создание или редактирование CRON или мастера времени","Dark Theme":"Тёмная тема","Dark style":"Темный стиль",Date:"Дата","Debug instance":"Экземпляр отладки","Debug options":"Варианты отладки",December:z7,Default:U7,"Define cron...":"Задать правило ...","Define schedule...":"Задать расписание...",Delay:H7,Delete:W7,"Delete %s":"Удалить %s...","Delete folder":"Удалить папку","Delete script":"Удалить скрипт",Description:G7,"Deselect all":"Снять выбор со всех","Discard changes for %s":"Отменить изменения для %s",Done:V7,"Double click to write value":"Двойной щелчок для записи значения","Download as file":"Скачать как файл","Drop some files here or click...":"Перетыщите сюда файлы или нажмите ...","Duplicate name":"Повторяющееся имя","Edit script or just double click":"Редактировать скрипт или просто дважды щелкнуть","Empty name is not allowed":"Пустое имя не допускается","End search mode":"Закончить поиск","Enter your question":"Введи свою просьбу",Error:"Ошибка","Error formatting code":"Ошибка форматирования кода","Error was found":"Ошибка была найдена","Every day":"Каждый день",Exec:K7,"Executes some shell command":"Выполняет некоторую команду оболочки","Existing scripts will be overwritten.":"Существующие скрипты будут перезаписаны.","Expand all":"Открыть все","Expert mode":"Экспертный режим",Explanation:Y7,Export:J7,"Export all scripts":"Экспорт всех скриптов","Export blocks":"Экспортировать блоки","Export selected blocks":"Экспортировать выбранные блоки",Februar:q7,February:X7,Filter:Z7,Folder:Q7,Fr:eY,Friday:tY,Function:"Функция","Function editor":"Редактор функции","Function: executed":"Функция: выполнено","Go to next line":"Перейти к следующей строке","HTTP Call":"HTTP-вызов","Hide logs":"Скрыть журналы",ID:sY,ID1:oY,ID2:iY,Import:nY,"Import blocks":"Импортировать блоки","Import error":"Ошибка импорта","Import scripts":"Импорт скриптов","Insert object ID":"Вставить ID объекта",Instance:rY,"Instance is disabled":"Экземпляр отключен","Instance:":"Пример:",Instances:aY,Instructions:lY,"Invalid CRON":"Неправильный CRON","It will not be possible to revert this operation.":"Невозможно вернуть эту операцию.","JS description":"Создание правил путём написания Javascript",Januar:cY,January:uY,July:dY,June:hY,"Just check":"Просто проверить","Language:":"Язык:","Learn More":"Узнать больше","Light style":"Светлый стиль",Limit:pY,"Local time":"Местное время","Locate file":"Показать файл в дереве","Log outputs":"Журнал","Log text":"Текст журнала","Log: %s":"Журнал: %s","Make a HTTP get request":"Сделайте HTTP-запрос на получение","Make a pause between actions":"Сделайте паузу между действиями",March:gY,"March ":"Март ",May:mY,Menu:fY,Message:$Y,Mo:bY,Model:vY,Monday:yY,Month:_Y,More:wY,Name:kY,"No API key found":"API-ключ не найден","No Chat GPT Key found":"Ключ GPT для чата не найден","No active host found":"Активный host не найден","Nothing found":"Ничего не найдено",November:CY,OK:TY,October:SY,Ok:EY,"On condition change":"При изменении реузльтата условий","On script save or adapter start":"При сохранении скрипта или запуске адаптера","On weekdays":"По дням недели","Open configuration":"Открыть настройки","Operate two states":"Операции над двумя состояниями","Operations with two states":"Операции с двумя состояниями","Paste your blocks here":"Вставьте свои блоки сюда",Pause:IY,"Pause execution":"Приостановить выполнение","Pause script":"Остановить скрипт","Phone:":"Телефон:","Please select object ID...":"Пожалуйста, выберите ID объекта ...","Press Ctrl+Enter to get the answer":"Нажмите Ctrl+Enter, чтобы получить ответ","Prettify the script":"Украсьте сценарий","Print some text in log":"Напечатать текст в журнале","Priority:":"Приоритет:",Pushover:xY,Pushsafer:DY,"Read only ID selected: %s":"Выбран идентификатор только для чтения: %s",Rename:AY,"Reorder scripts in folders":"Сортировать скрипты в папках",Repeat:OY,Restart:RY,Result:NY,"Resume execution":"Возобновить выполнение","Root folder":"Корневая папка","Rules description":"Создавайте правила с блоками ЕСЛИ, ТО, ИНАЧЕ","Run script":"Запустить скрипт",Sa:MY,Saturday:LY,Save:PY,"Save all":"Сохранить все","Say It":"Say It","Say some text via sayit adapter":"Произнесите текст через адаптер Sayit",Schedule:BY,Script:FY,"Script %s was modified on disk":'Скрипт "%s" был изменен на диске',"Script is not running":"Сценарий не запущен","Search in scripts":"Поиск в скриптах","Search...":"Поиск...","Select all":"Выбрать все","Send email":"Отправить email","Sends an email":"Отправляет электронное письмо","Sends message via Pushsafer":"Отправляет сообщение через Pushsafer","Sends message via pushover":"Отправляет сообщение через пустышку","Sends message via telegram":"Отправляет сообщение в телеграмме","Sends message via whatsapp-cmb":"Отправляет сообщение через whatsapp-cmb",September:jY,"Server time":"Время сервера","Set state action":"Установить состояние","Set with delay":"Установить с задержкой","Shell command":"Команда оболочки","Show astronomical events":"Показать астрономические события","Show javascript code":"Показать код Javascript","Show logs":"Показать журналы","Show only paused scripts":"Показывать только приостановленные сценарии","Show only running scripts":"Показывать только запущенные скрипты","Show only scripts with problems":"Показывать только скрипты с проблемами",Simulate:zY,"Some files will be rejected":"Некоторые файлы будут отклонены","Sound:":"Звук:",Stack:UY,Start:HY,"Start script":"Старт скрипта",State:WY,"State condition":"Сравнение состояния","Step into function":"Шаг в функционирование","Step out from function":"Выйти из функции","Stop on exception":"Остановить при исключении",Su:GY,"Subject:":"Предмет:",Sunday:VY,"TS description":"Создание правил путём написания Typescript",Telegram:KY,"Text:":"Текст:",Th:YY,"The script will be stopped and must be activated manually after debugging. Continue?":"Cкрипт будет остановлен и должен быть активирован вручную после отладки. Продолжать?","This is advances option. You can write your own code here and it will be executed on trigger":"Это расширеный вариант. Вы можете написать здесь свой код и он будет выполняться по триггеру",Thursday:JY,Time:qY,"Time condition":"Условие времени","Title:":"Заголовок:","To:":"К:","Trigger with value":"Триггер со значением",Triggered:XY,Triggers:ZY,"Triggers the on script saving or the javascript instance restart":"Запускает при сохранении скрипта или перезапуске экземпляра javascript","Triggers the rule on update or change of some state":"Запускает правило при обновлении или изменении какого-либо состояния","Triggers the rule periodically or on some specific time":"Срабатывает правило периодически или в определенное время",Tu:QY,Tuesday:eJ,URL:tJ,"Unknown error":"Неизвестная ошибка","Unknown error!":"Неизвестная ошибка!","Use generated code":"Использовать сгенерированный код","User function":"Функция пользователя","User:":"Пользователь:",Value:sJ,"Vibration:":"Вибрация:",Volume:oJ,We:iJ,Wednesday:nJ,"Whatsapp-cmb":"Whatsapp-cmb",Write:rJ,"Write your own code":"Напишите свой код",Yes:aJ,"Yet exists!":"Имя уже существует!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Вы можете использовать %s в URL-адресе, чтобы использовать текущее значение триггера, %id, чтобы использовать идентификатор инициированного объекта, %name, чтобы показать имя идентификатора инициированного объекта, или %old, чтобы использовать старое значение триггера.","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Вы можете использовать %s в команде, чтобы использовать текущее значение триггера, %id, чтобы использовать идентификатор сработавшего объекта, %name, чтобы показать имя сработавшего идентификатора объекта, или %old, чтобы использовать старое значение триггера.","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Вы можете использовать %s в тексте для отображения текущего значения триггера, %id для использования идентификатора сработавшего объекта, %name для отображения имени сработавшего идентификатора объекта или %old для использования старого значения триггера.","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Вы можете использовать %s в значении, чтобы использовать текущее значение триггера, %id, чтобы использовать идентификатор инициированного объекта, %name, чтобы показать имя идентификатора инициированного объекта, или %old, чтобы использовать старое значение триггера.","You have to enter OpenAI API key in the configuration of javascript adapter.":"Вы должны ввести ключ OpenAI API в конфигурации адаптера javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Необходимо ввести хотя бы один API-ключ (OpenAI, Anthropic или Gemini) в конфигурации адаптера javascript.","Please select a valid model":"Пожалуйста, выберите допустимую модель","[equal]":"[равно]","[greater or equal]":"[больше или равно]","[greater]":"[больше]","[hysteresis]":"[гистерезис]","[includes]":"[содержит]","[less or equal]":"[меньше или равно]","[less]":"[меньше]","[not equal]":"[не равно]",acknowledgment:lJ,all:cJ,and:uJ,"as JSON":"как JSON","as plain text":"как текст",astro:dJ,at:hJ,"clear running":"остановить уже бегущие",control:pJ,copy:gJ,cron:mJ,dawn:fJ,debug_help:$J,debug_label:bJ,default:"дефолт",dusk:vJ,easy:yJ,else:"иначе","equal to":"равно",every:_J,"every hour at 0 minutes":"каждый час через 0 минут",false:"false","file reading has failed: %s":"Ошибка чтения файла: %s","file reading was aborted":"Чтение файла было прервано",filter_func:wJ,filter_id:kJ,filter_name:CJ,filter_role:TJ,filter_room:SJ,"for edit or create script":"для редактирования или создайте новый скрипт","for professionals":"для профессионалов","for programmers":"для программистов",goldenHour:EJ,goldenHourEnd:IJ,"greater or equal":"больше или равно","greater or equal to":"больше или равно","greater than":"больше чем",help_just_check:xJ,help_on_change:DJ,"high priority":"высокий приоритет","high-priority":"высокий-приоритет","highest priority":"высший приоритет",hours:AJ,includes:OJ,interval:RJ,"just check":"просто проверить","less or equal":"меньше или равно","less or equal to":"меньше или равно","less than":"меньше, чем","lower priority":"более низкий приоритет","lowest priority":"самый низкий приоритет",magic:NJ,milliseconds:MJ,minutes:LJ,ms:PJ,nadir:BJ,nauticalDawn:FJ,nauticalDusk:jJ,nextSunrise:zJ,nextSunset:UJ,night:HJ,nightEnd:WJ,"no blocks found":"Блоков нет","no group":"Нет группы",normal:GJ,"normal priority":"нормальный приоритет","not running":"не запущен","not equal to":"не равно","not properly connected":"Этот блок неправильно соединён или не соединён с другими блоками.",offset:VJ,"on change":"по изменению","on condition change":"при изменении результата условия","on update":"при обновлении",one:KJ,or:YJ,quiet:JJ,"reset search":"Cбросить поиск",search:qJ,seconds:XJ,solarNoon:ZJ,"store in":"сохранить в",sunrise:QJ,sunriseEnd:eq,sunset:tq,sunsetStart:sq,then:oq,"toggle value":"инвертировать текщее значение",tooltip_ack:iq,tooltip_from:nq,tooltip_lc:rq,tooltip_quality:aq,tooltip_ts:lq,tooltip_user:cq,tooltip_value:uq,true:"true",two:dq,undefined:"неопределенный",update:hq,"use seconds":"использовать секунды","use trigger value":"использовать значение триггера",verbose_help:pq,verbose_label:gq,when:mq,with:"с","with date":"с датой","with offset":"со сдвигом",wizard:fq,"Loading models...":"Загрузка моделей...","Could not connect to API at %s":"Не удалось подключиться к API по адресу %s","Invalid API key":"Недействительный ключ API","Access denied by API":"Доступ запрещён API","API error: %s":"Ошибка API: %s",'Model "%s" not found':'Модель "%s" не найдена',"Request failed: %s":"Запрос не удался: %s",Retry:$q,"No running javascript instance found":"Не найден работающий экземпляр JavaScript"},vq="Визнано",yq="Дії",_q="додати",wq="все",kq="Будь-який",Cq="Застосувати",Tq="квітень",Sq="Запитуйте",Eq="Астрономічний",Iq="серпень",xq="Скасувати",Dq="Закрити",Aq="Хвороба",Oq="Умови",Rq="Консоль",Nq="Скопійовано",Mq="Грудень",Lq="За замовчуванням",Pq="Затримка",Bq="Видалити",Fq="опис",jq="Готово",zq="Виконавча оболонка",Uq="Пояснення",Hq="Експорт",Wq="Лютий",Gq="Лютий",Vq="фільтр",Kq="Папка",Yq="О",Jq="П'ятниця",qq="ID",Xq="ID1",Zq="ID2",Qq="Імпорт",eX="Екземпляр",tX="Примірники",sX="Інструкції",oX="січень",iX="січня",nX="липень",rX="червень",aX="Ліміт",lX="березень",cX="Може",uX="Меню",dX="повідомлення",hX="пн",pX="Модель",gX="понеділок",mX="місяць",fX="Більше",$X="Ім'я",bX="Листопад",vX="в порядку",yX="жовтень",_X="В порядку",wX="Пауза",kX="Pushover",CX="Pushsafer",TX="Перейменувати",SX="Повторіть",EX="Перезапустіть",IX="Результат",xX="Sa",DX="Субота",AX="зберегти",OX="розклад",RX="Сценарій",NX="Вересень",MX="Симулювати",LX="Стек",PX="старт",BX="Держава",FX="Нд",jX="неділя",zX="Телеграма",UX="чт",HX="четвер",WX="час",GX="Спрацьовує",VX="Тригери",KX="вт",YX="вівторок",JX="URL",qX="Значення",XX="Обсяг",ZX="ми",QX="Середа",eZ="Напишіть",tZ="Так",sZ="підтвердження",oZ="все",iZ="і",nZ="Астро",rZ="в",aZ="КОНТРОЛЬ",lZ="копія",cZ="CRON",uZ="Світанок",dZ="Це особливий режим, в якому стану та об'єкти не змінюватимуться. Але в протоколі відображатиметься лише інформація про кожну заплановану зміну.",hZ="Відлагоджувати",pZ="Сутінки",gZ="легко",mZ="кожен",fZ="функція",$Z="ID",bZ="Ім'я",vZ="Роль",yZ="Кімната",_Z="Золота година",wZ="Кінець золотої години",kZ="Код буде виконуватися лише щоразу, коли умова виконується. наприклад якщо спрацьовує значення датчика температури та умова «якщо температура перевищує 20°C», дії «тоді» виконуватимуться щоразу, коли датчик надсилає температуру, і вона перевищує 20°C. На 21°C, на 22°C і так далі.",CZ="Код буде виконано лише у разі зміни результату умови. наприклад якщо спрацьовує значення датчика температури та умова «якщо температура перевищує 20°C», дії «тоді» будуть виконані один раз, коли температура буде вище 20. Наступного разу дії «тоді» буде виконано, коли температура падає нижче 20, а потім знову піднімається вище 20.",TZ="години",SZ="включає в себе",EZ="інтервал",IZ="магія",xZ="мілісекунд",DZ="хвилин",AZ="РС",OZ="Надір",RZ="Морський світанок",NZ="Морські сутінки",MZ="Наступний схід сонця",LZ="Наступний захід сонця",PZ="ніч",BZ="Кінець ночі",FZ="нормально",jZ="зсув",zZ="один",UZ="або",HZ="тихо",WZ="пошук",GZ="секунд",VZ="Сонячний полудень",KZ="схід сонця",YZ="Кінець сходу сонця",JZ="Захід сонця",qZ="Початок заходу сонця",XZ="потім",ZZ="Визнати",QZ="Від",eQ="Востаннє змінено",tQ="якість",sQ="Мітка часу",oQ="Користувач",iQ="Значення",nQ="два",rQ="оновлення",aQ="Додає вихідні дані налагодження до журналу для багатьох системних команд",lQ="Докладні результати журналу",cQ="коли",uQ="майстер",dQ="Повторити",hQ={"%s not found":"%s не знайдено","()":"()","(at %s)":"(у %s)","(optional)":"(необов'язково)","-":"-",".":".","AI code generator":"Генератор коду ШІ",Ack:vq,Actions:yq,"Actual time of day":"Фактичний час доби",Add:_q,"Add new script":"Додати новий сценарій",All:wq,"All files will be accepted":"Усі файли будуть прийняті",Any:kq,"Any month":"Будь-який місяць",Apply:Cq,April:Tq,"Are you sure?":"Ти впевнений?",Ask:Sq,Astronomical:Eq,"Astronomical events today":"Астрономічні події сьогодні",August:Iq,"Blockly description":"Створення правил за графічними блоками","Body:":"Тіло:",Cancel:xq,"Cannot delete non empty item!":"Неможливо видалити непорожній елемент!","Change layout":"Змінити макет",'Change theme (actual "%s")':'Змінити тему (тепер - "%s")',"Check blocks":"Перевірте блоки","Check is not active, because javascript adapter is disabled":"Перевірка не активна, оскільки адаптер Javascript вимкнено","Clear search input":"Очистити пошуковий запит","Click on this icon":"Натисніть на цей значок",Close:Dq,"Close all but current":"Закрити всі, крім поточних","Collapse all":"Закрити всі","Compares current time with astronomical event":"Порівнює поточний час з астрономічною подією","Compares current time with the user specific time":"Порівнює поточний час із конкретним часом користувача","Compares the state value with user defined value":"Порівнює значення стану з визначеним користувачем значенням",Condition:Aq,Conditions:Oq,"Configuration not saved.":"Конфігурація не збережена.",Console:Rq,"Control or update some state":"Контролюйте або оновлюйте певний стан","Control or update some state with delay":"Контролюйте або оновлюйте деякий стан із затримкою","Convert blockly to javascript for ever.":"Назавжди конвертуйте Blockly у Javascript.",Copied:Nq,"Copy script":"Копіювати сценарій","Copy to clipboard":"Копіювати в буфер обміну","Create new":"Створити новий","Create new folder":"Створити нову папку","Create new script":"Створіть новий сценарій","Create or edit CRON or time wizard":"Створення або редагування CRON або майстра часу","Dark Theme":"Темна тема","Dark style":"Темний стиль",Date:"Дата","Debug instance":"Екземпляр налагодження","Debug options":"Параметри налагодження",December:Mq,Default:Lq,"Define cron...":"Визначити cron...","Define schedule...":"Визначити розклад...",Delay:Pq,Delete:Bq,"Delete %s":"Видалити %s...","Delete folder":"Видалити папку","Delete script":"Видалити сценарій",Description:Fq,"Deselect all":"Зняти вибір із усіх","Discard changes for %s":"Скасувати зміни для %s",Done:jq,"Double click to write value":"Двічі клацніть, щоб записати значення","Download as file":"Завантажити файл","Drop some files here or click...":"Перетягніть кілька файлів сюди або натисніть...","Duplicate name":"Повторюване ім'я","Edit script or just double click":"Відредагуйте сценарій або просто двічі клацніть","Empty name is not allowed":"Порожнє ім'я не допускається","End search mode":"Завершити режим пошуку","Enter your question":"Введи своє прохання",Error:"Помилка","Error formatting code":"Помилка форматування коду","Error was found":"Виявлено помилку","Every day":"Кожен день",Exec:zq,"Executes some shell command":"Виконує певну команду оболонки","Existing scripts will be overwritten.":"Існуючі сценарії буде перезаписано.","Expand all":"Розгорнути все","Expert mode":"Експертний режим",Explanation:Uq,Export:Hq,"Export all scripts":"Експортувати всі сценарії","Export blocks":"Експорт блоків","Export selected blocks":"Експортувати вибрані блоки",Februar:Wq,February:Gq,Filter:Vq,Folder:Kq,Fr:Yq,Friday:Jq,Function:"функція","Function editor":"Редактор функцій","Function: executed":"Функція: виконано","Go to next line":"Перейти до наступного рядка","HTTP Call":"Виклик HTTP","Hide logs":"Приховати журнали",ID:qq,ID1:Xq,ID2:Zq,Import:Qq,"Import blocks":"Імпорт блоків","Import error":"Помилка імпорту","Import scripts":"Імпорт скриптів","Insert object ID":"Вставте ID об'єкта",Instance:eX,"Instance is disabled":"Примірник вимкнено","Instance:":"екземпляр:",Instances:tX,Instructions:sX,"Invalid CRON":"Недійсний CRON","It will not be possible to revert this operation.":"Скасувати цю операцію буде неможливо.","JS description":"Створення правил шляхом написання Javascript",Januar:oX,January:iX,July:nX,June:rX,"Just check":"Просто перевірте","Language:":"Мову:","Learn More":"Вивчайте більше","Light style":"Легкий стиль",Limit:aX,"Local time":"Місцевий час","Locate file":"Знайти файл","Log outputs":"Виходи журналу","Log text":"Текст журналу","Log: %s":"Журнал: %s","Make a HTTP get request":"Зробіть HTTP-запит на отримання","Make a pause between actions":"Між діями робіть паузу",March:lX,"March ":"березень",May:cX,Menu:uX,Message:dX,Mo:hX,Model:pX,Monday:gX,Month:mX,More:fX,Name:$X,"No API key found":"API-ключ не знайдено","No Chat GPT Key found":"Ключ GPT для чату не знайдено","No active host found":"Активний хост не знайдено","Nothing found":"Нічого не знайдено",November:bX,OK:vX,October:yX,Ok:_X,"On condition change":"За умови зміни результату","On script save or adapter start":"Під час збереження сценарію або запуску адаптера","On weekdays":"В будні дні","Open configuration":"Відкрита конфігурація","Operate two states":"Керуйте двома станами","Operations with two states":"Операції з двома станами","Paste your blocks here":"Вставте сюди свої блоки",Pause:wX,"Pause execution":"Призупинити виконання","Pause script":"Призупинити сценарій","Phone:":"телефон:","Please select object ID...":"Виберіть ідентифікатор об'єкта...","Press Ctrl+Enter to get the answer":"Натисніть Ctrl+Enter, щоб отримати відповідь","Prettify the script":"Прикрасьте сценарій","Print some text in log":"Надрукувати текст у журналі","Priority:":"Пріоритет:",Pushover:kX,Pushsafer:CX,"Read only ID selected: %s":"Вибрано ідентифікатор лише для читання: %s",Rename:TX,"Reorder scripts in folders":"Зміна порядку сценаріїв у папках",Repeat:SX,Restart:EX,Result:IX,"Resume execution":"Відновити виконання","Root folder":"Коренева папка","Rules description":"Створюйте правила з блоками IF, THEN, ELSE","Run script":"Запустіть сценарій",Sa:xX,Saturday:DX,Save:AX,"Save all":"Зберегти все","Say It":"Скажи це","Say some text via sayit adapter":"Скажіть текст через адаптер sayit",Schedule:OX,Script:RX,"Script %s was modified on disk":"Сценарій %s змінено на диску","Script is not running":"Сценарій не працює","Search in scripts":"Пошук у скриптах","Search...":"пошук...","Select all":"Вибрати все","Send email":"Відправити лист","Sends an email":"Надсилає електронний лист","Sends message via Pushsafer":"Надсилає повідомлення через Pushsafer","Sends message via pushover":"Надсилає повідомлення через pushover","Sends message via telegram":"Надсилає повідомлення через телеграм","Sends message via whatsapp-cmb":"Надсилає повідомлення через whatsapp-cmb",September:NX,"Server time":"Час сервера","Set state action":"Встановити дію стану","Set with delay":"Встановити із затримкою","Shell command":"Команда оболонки","Show astronomical events":"Показати астрономічні події","Show javascript code":"Показати код Javascript","Show logs":"Показати журнали","Show only paused scripts":"Показувати лише призупинені сценарії","Show only running scripts":"Показувати лише запущені сценарії","Show only scripts with problems":"Показувати лише сценарії з проблемами",Simulate:MX,"Some files will be rejected":"Деякі файли буде відхилено","Sound:":"звук:",Stack:LX,Start:PX,"Start script":"Запустити сценарій",State:BX,"State condition":"Стан стану","Step into function":"Крок у функції","Step out from function":"Вийти з функції","Stop on exception":"Зупинка на винятках",Su:FX,"Subject:":"Тема:",Sunday:jX,"TS description":"Створення правил шляхом написання Typescript",Telegram:zX,"Text:":"Текст:",Th:UX,"The script will be stopped and must be activated manually after debugging. Continue?":"Сценарій буде зупинено, і його необхідно активувати вручну після налагодження. Продовжити?","This is advances option. You can write your own code here and it will be executed on trigger":"Це авансовий варіант. Ви можете написати тут свій власний код, і він буде виконано на тригері",Thursday:HX,Time:WX,"Time condition":"Умова часу","Title:":"Назва:","To:":"до:","Trigger with value":"Тригер зі значенням",Triggered:GX,Triggers:VX,"Triggers the on script saving or the javascript instance restart":"Ініціює збереження сценарію або перезапуск екземпляра JavaScript","Triggers the rule on update or change of some state":"Запускає правило при оновленні або зміні якогось стану","Triggers the rule periodically or on some specific time":"Спрацьовує правило періодично або в певний час",Tu:KX,Tuesday:YX,URL:JX,"Unknown error":"Невідома помилка","Unknown error!":"Невідома помилка!","Use generated code":"Використовуйте згенерований код","User function":"Функція користувача","User:":"Користувач:",Value:qX,"Vibration:":"Вібрація:",Volume:XX,We:ZX,Wednesday:QX,"Whatsapp-cmb":"Whatsapp-cmb",Write:eZ,"Write your own code":"Напишіть власний код",Yes:tZ,"Yet exists!":"Все ж існує!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Ви можете використовувати %s в URL-адресі, щоб використовувати поточне значення тригера, %id, щоб використовувати ідентифікатор активованого об’єкта, %name, щоб показати назву ідентифікатора активованого об’єкта, або %old, щоб використовувати старе значення тригера","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Ви можете використовувати %s у команді, щоб використовувати поточне значення тригера, %id, щоб використовувати ідентифікатор активованого об’єкта, %name, щоб показати назву ідентифікатора активованого об’єкта, або %old, щоб використовувати старе значення тригера","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Ви можете використовувати %s у тексті для відображення поточного значення тригера, %id для використання ідентифікатора активованого об’єкта, %name для відображення імені ідентифікатора активованого об’єкта або %old для використання старого значення тригера","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Ви можете використовувати %s у значенні, щоб використовувати поточне значення тригера, %id, щоб використовувати ідентифікатор активованого об’єкта, %name, щоб показати назву ідентифікатора активованого об’єкта, або %old, щоб використовувати старе значення тригера","You have to enter OpenAI API key in the configuration of javascript adapter.":"Ви повинні ввести ключ OpenAI API у конфігурації адаптера JavaScript.","You have to enter at least one API key in the configuration of javascript adapter.":"Необхідно ввести хоча б один API-ключ (OpenAI, Anthropic або Gemini) у конфігурації адаптера JavaScript.","Please select a valid model":"Будь ласка, виберіть дійсну модель","[equal]":"[рівний]","[greater or equal]":"[більше або дорівнює]","[greater]":"[більший]","[hysteresis]":"[гістерезис]","[includes]":"[включає]","[less or equal]":"[менше або рівно]","[less]":"[менше]","[not equal]":"[не дорівнює]",acknowledgment:sZ,all:oZ,and:iZ,"as JSON":"як JSON","as plain text":"як текст",astro:nZ,at:rZ,"clear running":"чіткий біг",control:aZ,copy:lZ,cron:cZ,dawn:uZ,debug_help:dZ,debug_label:hZ,default:"за замовчуванням",dusk:pZ,easy:gZ,else:"інше","equal to":"дорівнює",every:mZ,"every hour at 0 minutes":"щогодини о 0 хвилин",false:"помилковий","file reading has failed: %s":"не вдалося прочитати файл: %s","file reading was aborted":"читання файлу було перервано",filter_func:fZ,filter_id:$Z,filter_name:bZ,filter_role:vZ,filter_room:yZ,"for edit or create script":"для редагування або створення нового сценарію","for professionals":"для професіоналів","for programmers":"для програмістів",goldenHour:_Z,goldenHourEnd:wZ,"greater or equal":"більший або рівний","greater or equal to":"більше або дорівнює","greater than":"більше, ніж, величніше ніж, крутіший за",help_just_check:kZ,help_on_change:CZ,"high priority":"високий пріоритет","high-priority":"високий пріоритет","highest priority":"найвищий пріоритет",hours:TZ,includes:SZ,interval:EZ,"just check":"просто перевірте","less or equal":"менше або дорівнює","less or equal to":"менше або дорівнює","less than":"менше ніж","lower priority":"нижчий пріоритет","lowest priority":"найнижчий пріоритет",magic:IZ,milliseconds:xZ,minutes:DZ,ms:AZ,nadir:OZ,nauticalDawn:RZ,nauticalDusk:NZ,nextSunrise:MZ,nextSunset:LZ,night:PZ,nightEnd:BZ,"no blocks found":"Блоків не знайдено","no group":"НЕМАЄ ГРУПИ",normal:FZ,"normal priority":"нормальний пріоритет","not running":"не запущено","not equal to":"не дорівнює","not properly connected":"Цей блок неправильно з’єднаний з іншими блоками.",offset:jZ,"on change":"на зміну","on condition change":"про зміну умов","on update":"на оновлення",one:zZ,or:UZ,quiet:HZ,"reset search":"скинути пошук",search:WZ,seconds:GZ,solarNoon:VZ,"store in":"зберігати в",sunrise:KZ,sunriseEnd:YZ,sunset:JZ,sunsetStart:qZ,then:XZ,"toggle value":"значення перемикання",tooltip_ack:ZZ,tooltip_from:QZ,tooltip_lc:eQ,tooltip_quality:tQ,tooltip_ts:sQ,tooltip_user:oQ,tooltip_value:iQ,true:"правда",two:nQ,undefined:"невизначений",update:rQ,"use seconds":"використовуйте секунди","use trigger value":"використовувати значення тригера",verbose_help:aQ,verbose_label:lQ,when:cQ,with:"з","with date":"з датою","with offset":"зі зміщенням",wizard:uQ,"Loading models...":"Завантаження моделей...","Could not connect to API at %s":"Не вдалося підключитися до API за адресою %s","Invalid API key":"Недійсний ключ API","Access denied by API":"Доступ заборонено API","API error: %s":"Помилка API: %s",'Model "%s" not found':'Модель "%s" не знайдено',"Request failed: %s":"Запит не вдався: %s",Retry:dQ,"No running javascript instance found":"Не знайдено запущеного екземпляра JavaScript"},pQ="确认",gQ="动作",mQ="添加",fQ="所有",$Q="任何",bQ="申请",vQ="四月",yQ="问",_Q="天文",wQ="八月",kQ="取消",CQ="关闭",TQ="健康)状况",SQ="情况",EQ="安慰",IQ="复制的",xQ="十二月",DQ="默认",AQ="延迟",OQ="删除",RQ="描述",NQ="完成",MQ="执行力",LQ="解释",PQ="导出",BQ="二月",FQ="二月",jQ="筛选",zQ="文件夹",UQ="r",HQ="星期五",WQ="ID",GQ="ID1",VQ="ID2",KQ="导入",YQ="实例",JQ="实例",qQ="指示",XQ="亚努尔",ZQ="一月",QQ="七月",eee="六月",tee="限制",see="三月",oee="五月",iee="菜单",nee="信息",ree="莫",aee="模型",lee="星期一",cee="月",uee="更多的",dee="名称",hee="十一月",pee="好的",gee="十月",mee="确定",fee="暂停",$ee="俯卧撑",bee="推安全",vee="重命名",yee="重复",_ee="重启",wee="结果",kee="萨",Cee="星期六",Tee="保存",See="日程",Eee="脚本",Iee="九月",xee="模拟",Dee="堆",Aee="开始",Oee="状态",Ree="苏",Nee="星期日",Mee="电报",Lee="4",Pee="星期四",Bee="时间",Fee="触发",jee="扳机",zee="涂",Uee="星期二",Hee="网址",Wee="价值",Gee="体积",Vee="3",Kee="星期三",Yee="写",Jee="是的",qee="致谢",Xee="全部",Zee="和",Qee="天文",ete="在",tte="控制",ste="复制",ote="克朗",ite="黎明",nte="这是一种特殊模式,其中状态和对象不会改变。但只有有关每个计划更改的信息才会显示在协议中。",rte="调试",ate="黄昏",lte="简单的",cte="每一个",ute="功能",dte="ID",hte="名字",pte="角色",gte="房间",mte="黄金时段",fte="黄金时段结束",$te="仅在条件为真时才执行代码。例如。如果触发温度传感器值并且条件为“如果温度大于20°C”,则每次传感器发送温度且温度超过20°C时,将执行“然后”动作。 21°C,22°C等。",bte="仅当条件结果更改时,代码才会执行。例如。如果触发温度传感器值且条件为“如果温度大于20°C”,则温度超过20时将执行一次“则”动作,下一次,当温度超过20时将执行“则”动作低于20失败,然后再次超过20。",vte="小时",yte="包括",_te="间隔",wte="魔法",kte="毫秒",Cte="分钟",Tte="毫秒",Ste="最低点",Ete="航海黎明",Ite="航海黄昏",xte="下一个日出",Dte="下一个日落",Ate="夜晚",Ote="夜晚结束",Rte="普通的",Nte="抵消",Mte="一",Lte="或",Pte="安静的",Bte="搜索",Fte="秒",jte="星期日正午",zte="日出",Ute="日出结束",Hte="日落",Wte="日落开始",Gte="然后",Vte="确认",Kte="从",Yte="上一次改变",Jte="质量",qte="时间戳",Xte="用户",Zte="值",Qte="二",ese="更新",tse="将调试输出添加到许多系统命令的日志中",sse="详细日志输出",ose="什么时候",ise="巫师",nse="重试",rse={"%s not found":"%s 未找到","()":"()","(at %s)":"(在 %s)","(optional)":"(选修的)","-":"-",".":".","AI code generator":"AI代码生成器",Ack:pQ,Actions:gQ,"Actual time of day":"一天中的实际时间",Add:mQ,"Add new script":"添加新脚本",All:fQ,"All files will be accepted":"所有文件都将被接受",Any:$Q,"Any month":"任何月份",Apply:bQ,April:vQ,"Are you sure?":"你确定吗?",Ask:yQ,Astronomical:_Q,"Astronomical events today":"今天的天文事件",August:wQ,"Blockly description":"按图形块创建规则","Body:":"身体:",Cancel:kQ,"Cannot delete non empty item!":"无法删除非空项目!","Change layout":"变更版面",'Change theme (actual "%s")':"更改主题(现在为“%s”)","Check blocks":"检查块","Check is not active, because javascript adapter is disabled":"检查未激活,因为禁用了Javascript适配器","Clear search input":"清除搜索输入","Click on this icon":"单击此图标",Close:CQ,"Close all but current":"关闭所有(当前除外)","Collapse all":"全部收缩","Compares current time with astronomical event":"将当前时间与天文事件进行比较","Compares current time with the user specific time":"将当前时间与用户特定时间进行比较","Compares the state value with user defined value":"比较状态值和用户定义的值",Condition:TQ,Conditions:SQ,"Configuration not saved.":"配置未保存。",Console:EQ,"Control or update some state":"控制或更新某些状态","Control or update some state with delay":"延迟控制或更新某些状态","Convert blockly to javascript for ever.":"立即将blockly转换为Javascript。",Copied:IQ,"Copy script":"复制脚本","Copy to clipboard":"复制到剪贴板","Create new":"创建新的","Create new folder":"创建新文件夹","Create new script":"创建新脚本","Create or edit CRON or time wizard":"创建或编辑周期任务或时间向导","Dark Theme":"深色调主题","Dark style":"深色调风格",Date:"日期","Debug instance":"调试实例","Debug options":"调试选项",December:xQ,Default:DQ,"Define cron...":"定义周期任务...","Define schedule...":"定义调度器......",Delay:AQ,Delete:OQ,"Delete %s":"删除%s...","Delete folder":"删除文件夹","Delete script":"删除脚本",Description:RQ,"Deselect all":"取消全选","Discard changes for %s":"放弃%s的更改",Done:NQ,"Double click to write value":"Double click to write value","Download as file":"档案","Drop some files here or click...":"将文件拖拽到这里或单击......","Duplicate name":"重名","Edit script or just double click":"双击编辑脚本","Empty name is not allowed":"不允许使用空名称","End search mode":"结束搜索模式","Enter your question":"输入您的要求",Error:"错误","Error formatting code":"代码格式错误","Error was found":"发现错误","Every day":"每天",Exec:MQ,"Executes some shell command":"执行一些shell命令","Existing scripts will be overwritten.":"现有脚本将被覆盖。","Expand all":"展开全部","Expert mode":"专家模式",Explanation:LQ,Export:PQ,"Export all scripts":"导出所有脚本","Export blocks":"导出块","Export selected blocks":"导出选定的块",Februar:BQ,February:FQ,Filter:jQ,Folder:zQ,Fr:UQ,Friday:HQ,Function:"功能","Function editor":"功能编辑器","Function: executed":"功能:执行","Go to next line":"转到下一行","HTTP Call":"HTTP呼叫","Hide logs":"隐藏日志",ID:WQ,ID1:GQ,ID2:VQ,Import:KQ,"Import blocks":"导入块","Import error":"导入错误","Import scripts":"导入脚本","Insert object ID":"插入对象ID",Instance:YQ,"Instance is disabled":"实例已禁用","Instance:":"实例:",Instances:JQ,Instructions:qQ,"Invalid CRON":"无效的周期任务","It will not be possible to revert this operation.":"无法恢复此操作。","JS description":"通过编写Javascript来创建规则",Januar:XQ,January:ZQ,July:QQ,June:eee,"Just check":"只是检查","Language:":"语言:","Learn More":"了解更多","Light style":"浅色调风格",Limit:tee,"Local time":"当地时间","Locate file":"定位文件","Log outputs":"记录输出","Log text":"记录文字","Log: %s":"日志:%s","Make a HTTP get request":"发出HTTP获取请求","Make a pause between actions":"在动作之间暂停",March:see,"March ":"行进",May:oee,Menu:iee,Message:nee,Mo:ree,Model:aee,Monday:lee,Month:cee,More:uee,Name:dee,"No API key found":"未找到 API 密钥","No Chat GPT Key found":"找不到聊天 GPT 密钥","No active host found":"找不到活动主机","Nothing found":"没有发现",November:hee,OK:pee,October:gee,Ok:mee,"On condition change":"条件变化时","On script save or adapter start":"在脚本保存或适配器启动时","On weekdays":"在工作日","Open configuration":"开放配置","Operate two states":"操作两种状态","Operations with two states":"具有两种状态的操作","Paste your blocks here":"在此处粘贴您的区块",Pause:fee,"Pause execution":"暂停执行","Pause script":"暂停脚本","Phone:":"电话:","Please select object ID...":"请选择对象ID...","Press Ctrl+Enter to get the answer":"按 Ctrl+Enter 即可得到答案","Prettify the script":"美化脚本","Print some text in log":"在日志中打印一些文本","Priority:":"优先:",Pushover:$ee,Pushsafer:bee,"Read only ID selected: %s":"选择的只读ID:%s",Rename:vee,"Reorder scripts in folders":"重新排序文件夹中的脚本",Repeat:yee,Restart:_ee,Result:wee,"Resume execution":"恢复执行","Root folder":"根文件夹","Rules description":"使用IF,THEN,ELSE块创建规则","Run script":"运行脚本",Sa:kee,Saturday:Cee,Save:Tee,"Save all":"保存全部","Say It":"Say It","Say some text via sayit adapter":"通过sayit适配器说一些文字",Schedule:See,Script:Eee,"Script %s was modified on disk":"脚本%s已在磁盘上修改","Script is not running":"脚本没有运行","Search in scripts":"在脚本中搜索","Search...":"搜索...","Select all":"全选","Send email":"发送电子邮件","Sends an email":"发送邮件","Sends message via Pushsafer":"通过Pushsafer发送消息","Sends message via pushover":"通过推播发送消息","Sends message via telegram":"通过电报发送消息","Sends message via whatsapp-cmb":"通过whatsapp-cmb发送消息",September:Iee,"Server time":"服务器时间","Set state action":"设定状态动作","Set with delay":"延迟设置","Shell command":"Shell命令","Show astronomical events":"显示天文事件","Show javascript code":"显示Javascript代码","Show logs":"显示记录","Show only paused scripts":"仅显示暂停的脚本","Show only running scripts":"仅显示正在运行的脚本","Show only scripts with problems":"仅显示有问题的脚本",Simulate:xee,"Some files will be rejected":"有些文件将被拒绝","Sound:":"声音:",Stack:Dee,Start:Aee,"Start script":"启动脚本",State:Oee,"State condition":"状态条件","Step into function":"进入功能","Step out from function":"退出函数","Stop on exception":"异常停止",Su:Ree,"Subject:":"学科:",Sunday:Nee,"TS description":"通过编写Typescript来创建规则",Telegram:Mee,"Text:":"文本:",Th:Lee,"The script will be stopped and must be activated manually after debugging. Continue?":"该脚本将停止,并且必须在调试后手动激活。继续?","This is advances option. You can write your own code here and it will be executed on trigger":"这是高级选项。您可以在此处编写自己的代码,它将在触发器上执行",Thursday:Pee,Time:Bee,"Time condition":"时间条件","Title:":"标题:","To:":"到:","Trigger with value":"用值触发",Triggered:Fee,Triggers:jee,"Triggers the on script saving or the javascript instance restart":"触发脚本保存或javascript实例重启","Triggers the rule on update or change of some state":"在某些状态的更新或更改时触发规则","Triggers the rule periodically or on some specific time":"定期或在特定时间触发规则",Tu:zee,Tuesday:Uee,URL:Hee,"Unknown error":"未知错误","Unknown error!":"未知错误!","Use generated code":"使用生成的代码","User function":"用户功能","User:":"用户:",Value:Wee,"Vibration:":"振动:",Volume:Gee,We:Vee,Wednesday:Kee,"Whatsapp-cmb":"Whatsapp的cmb",Write:Yee,"Write your own code":"编写自己的代码",Yes:Jee,"Yet exists!":"不存在!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"您可以在 URL 中使用 %s 以使用当前触发值,%id 以使用触发对象 ID,%name 以显示触发对象 ID 名称或 %old 以使用旧触发值","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"您可以在命令中使用 %s 以使用当前触发值,%id 使用触发对象 ID,%name 显示触发对象 ID 名称或 %old 使用旧触发值","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"您可以在文本中使用 %s 显示当前触发值,%id 使用触发对象 ID,%name 显示触发对象 ID 名称或 %old 使用旧触发值","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"您可以在值中使用 %s 以使用当前触发器值,%id 使用触发对象 ID,%name 显示触发对象 ID 名称或 %old 使用旧触发器值","You have to enter OpenAI API key in the configuration of javascript adapter.":"您必须在 javascript 适配器的配置中输入 OpenAI API 密钥。","You have to enter at least one API key in the configuration of javascript adapter.":"您必须在 javascript 适配器的配置中输入至少一个 API 密钥(OpenAI、Anthropic 或 Gemini)。","Please select a valid model":"请选择一个有效的模型","[equal]":"[平等的]","[greater or equal]":"[大于等于]","[greater]":"[更大]","[hysteresis]":"[磁滞]","[includes]":"[包括]","[less or equal]":"[小于或等于]","[less]":"[较少的]","[not equal]":"[不相等]",acknowledgment:qee,all:Xee,and:Zee,"as JSON":"为 JSON","as plain text":"为纯文本",astro:Qee,at:ete,"clear running":"畅通无阻",control:tte,copy:ste,cron:ote,dawn:ite,debug_help:nte,debug_label:rte,default:"默认",dusk:ate,easy:lte,else:"别的","equal to":"等于",every:cte,"every hour at 0 minutes":"每小时0分钟",false:"错误的","file reading has failed: %s":"文件读取失败:%s","file reading was aborted":"文件读取中止",filter_func:ute,filter_id:dte,filter_name:hte,filter_role:pte,filter_room:gte,"for edit or create script":"用于编辑或创建脚本","for professionals":"对于专业人士","for programmers":"对于程序员",goldenHour:mte,goldenHourEnd:fte,"greater or equal":"大于或等于","greater or equal to":"大于或等于","greater than":"比...更棒",help_just_check:$te,help_on_change:bte,"high priority":"高优先级","high-priority":"高优先级","highest priority":"最高优先级",hours:vte,includes:yte,interval:_te,"just check":"只是检查","less or equal":"小于或等于","less or equal to":"小于或等于","less than":"少于","lower priority":"低优先级","lowest priority":"最低优先级",magic:wte,milliseconds:kte,minutes:Cte,ms:Tte,nadir:Ste,nauticalDawn:Ete,nauticalDusk:Ite,nextSunrise:xte,nextSunset:Dte,night:Ate,nightEnd:Ote,"no blocks found":"找不到块","no group":"没有组",normal:Rte,"normal priority":"正常优先","not running":"未运行","not equal to":"不等于","not properly connected":"此块未正确连接到其他块。",offset:Nte,"on change":"在变化","on condition change":"在条件变化时","on update":"更新时",one:Mte,or:Lte,quiet:Pte,"reset search":"重置搜索",search:Bte,seconds:Fte,solarNoon:jte,"store in":"存放在",sunrise:zte,sunriseEnd:Ute,sunset:Hte,sunsetStart:Wte,then:Gte,"toggle value":"切换值",tooltip_ack:Vte,tooltip_from:Kte,tooltip_lc:Yte,tooltip_quality:Jte,tooltip_ts:qte,tooltip_user:Xte,tooltip_value:Zte,true:"真的",two:Qte,undefined:"不明确的",update:ese,"use seconds":"精确到秒","use trigger value":"使用触发值",verbose_help:tse,verbose_label:sse,when:ose,with:"和","with date":"有日期","with offset":"带偏移",wizard:ise,"Loading models...":"加载模型...","Could not connect to API at %s":"无法连接到 %s 的 API","Invalid API key":"无效的 API 密钥","Access denied by API":"API 拒绝访问","API error: %s":"API 错误:%s",'Model "%s" not found':'未找到模型 "%s"',"Request failed: %s":"请求失败:%s",Retry:nse,"No running javascript instance found":"未找到正在运行的 JavaScript 实例"};function pc(a){throw new Error('Could not dynamically require "'+a+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var OC={exports:{}};(function(a,s){(function(i){a.exports=i()})(function(){return(function i(r,l,c){function d(f,b){if(!l[f]){if(!r[f]){var y=typeof pc=="function"&&pc;if(!b&&y)return y(f,!0);if(h)return h(f,!0);var w=new Error("Cannot find module '"+f+"'");throw w.code="MODULE_NOT_FOUND",w}var v=l[f]={exports:{}};r[f][0].call(v.exports,function(_){var $=r[f][1][_];return d($||_)},v,v.exports,i,r,l,c)}return l[f].exports}for(var h=typeof pc=="function"&&pc,p=0;p>2,v=(3&f)<<4|b>>4,_=1>6:64,$=2>4,b=(15&w)<<4|(v=h.indexOf(p.charAt($++)))>>2,y=(3&v)<<6|(_=h.indexOf(p.charAt($++))),E[S++]=f,v!==64&&(E[S++]=b),_!==64&&(E[S++]=y);return E}},{"./support":30,"./utils":32}],2:[function(i,r,l){var c=i("./external"),d=i("./stream/DataWorker"),h=i("./stream/Crc32Probe"),p=i("./stream/DataLengthProbe");function f(b,y,w,v,_){this.compressedSize=b,this.uncompressedSize=y,this.crc32=w,this.compression=v,this.compressedContent=_}f.prototype={getContentWorker:function(){var b=new d(c.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new p("data_length")),y=this;return b.on("end",function(){if(this.streamInfo.data_length!==y.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),b},getCompressedWorker:function(){return new d(c.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},f.createWorkerFrom=function(b,y,w){return b.pipe(new h).pipe(new p("uncompressedSize")).pipe(y.compressWorker(w)).pipe(new p("compressedSize")).withStreamInfo("compression",y)},r.exports=f},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(i,r,l){var c=i("./stream/GenericWorker");l.STORE={magic:"\0\0",compressWorker:function(){return new c("STORE compression")},uncompressWorker:function(){return new c("STORE decompression")}},l.DEFLATE=i("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(i,r,l){var c=i("./utils"),d=(function(){for(var h,p=[],f=0;f<256;f++){h=f;for(var b=0;b<8;b++)h=1&h?3988292384^h>>>1:h>>>1;p[f]=h}return p})();r.exports=function(h,p){return h!==void 0&&h.length?c.getTypeOf(h)!=="string"?(function(f,b,y,w){var v=d,_=w+y;f^=-1;for(var $=w;$<_;$++)f=f>>>8^v[255&(f^b[$])];return-1^f})(0|p,h,h.length,0):(function(f,b,y,w){var v=d,_=w+y;f^=-1;for(var $=w;$<_;$++)f=f>>>8^v[255&(f^b.charCodeAt($))];return-1^f})(0|p,h,h.length,0):0}},{"./utils":32}],5:[function(i,r,l){l.base64=!1,l.binary=!1,l.dir=!1,l.createFolders=!0,l.date=null,l.compression=null,l.compressionOptions=null,l.comment=null,l.unixPermissions=null,l.dosPermissions=null},{}],6:[function(i,r,l){var c=null;c=typeof Promise<"u"?Promise:i("lie"),r.exports={Promise:c}},{lie:37}],7:[function(i,r,l){var c=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",d=i("pako"),h=i("./utils"),p=i("./stream/GenericWorker"),f=c?"uint8array":"array";function b(y,w){p.call(this,"FlateWorker/"+y),this._pako=null,this._pakoAction=y,this._pakoOptions=w,this.meta={}}l.magic="\b\0",h.inherits(b,p),b.prototype.processChunk=function(y){this.meta=y.meta,this._pako===null&&this._createPako(),this._pako.push(h.transformTo(f,y.data),!1)},b.prototype.flush=function(){p.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},b.prototype.cleanUp=function(){p.prototype.cleanUp.call(this),this._pako=null},b.prototype._createPako=function(){this._pako=new d[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var y=this;this._pako.onData=function(w){y.push({data:w,meta:y.meta})}},l.compressWorker=function(y){return new b("Deflate",y)},l.uncompressWorker=function(){return new b("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(i,r,l){function c(v,_){var $,S="";for($=0;$<_;$++)S+=String.fromCharCode(255&v),v>>>=8;return S}function d(v,_,$,S,T,E){var D,M,P=v.file,W=v.compression,G=E!==f.utf8encode,z=h.transformTo("string",E(P.name)),Z=h.transformTo("string",f.utf8encode(P.name)),he=P.comment,Ce=h.transformTo("string",E(he)),R=h.transformTo("string",f.utf8encode(he)),K=Z.length!==P.name.length,C=R.length!==he.length,Q="",ve="",ce="",ne=P.dir,me=P.date,re={crc32:0,compressedSize:0,uncompressedSize:0};_&&!$||(re.crc32=v.crc32,re.compressedSize=v.compressedSize,re.uncompressedSize=v.uncompressedSize);var B=0;_&&(B|=8),G||!K&&!C||(B|=2048);var N=0,te=0;ne&&(N|=16),T==="UNIX"?(te=798,N|=(function(se,j){var Te=se;return se||(Te=j?16893:33204),(65535&Te)<<16})(P.unixPermissions,ne)):(te=20,N|=(function(se){return 63&(se||0)})(P.dosPermissions)),D=me.getUTCHours(),D<<=6,D|=me.getUTCMinutes(),D<<=5,D|=me.getUTCSeconds()/2,M=me.getUTCFullYear()-1980,M<<=4,M|=me.getUTCMonth()+1,M<<=5,M|=me.getUTCDate(),K&&(ve=c(1,1)+c(b(z),4)+Z,Q+="up"+c(ve.length,2)+ve),C&&(ce=c(1,1)+c(b(Ce),4)+R,Q+="uc"+c(ce.length,2)+ce);var q="";return q+=` \0`,q+=c(B,2),q+=W.magic,q+=c(D,2),q+=c(M,2),q+=c(re.crc32,4),q+=c(re.compressedSize,4),q+=c(re.uncompressedSize,4),q+=c(z.length,2),q+=c(Q.length,2),{fileRecord:y.LOCAL_FILE_HEADER+q+z+Q,dirRecord:y.CENTRAL_FILE_HEADER+c(te,2)+q+c(Ce.length,2)+"\0\0\0\0"+c(N,4)+c(S,4)+z+Q+Ce}}var h=i("../utils"),p=i("../stream/GenericWorker"),f=i("../utf8"),b=i("../crc32"),y=i("../signature");function w(v,_,$,S){p.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=_,this.zipPlatform=$,this.encodeFileName=S,this.streamFiles=v,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}h.inherits(w,p),w.prototype.push=function(v){var _=v.meta.percent||0,$=this.entriesCount,S=this._sources.length;this.accumulate?this.contentBuffer.push(v):(this.bytesWritten+=v.data.length,p.prototype.push.call(this,{data:v.data,meta:{currentFile:this.currentFile,percent:$?(_+100*($-S-1))/$:100}}))},w.prototype.openedSource=function(v){this.currentSourceOffset=this.bytesWritten,this.currentFile=v.file.name;var _=this.streamFiles&&!v.file.dir;if(_){var $=d(v,_,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:$.fileRecord,meta:{percent:0}})}else this.accumulate=!0},w.prototype.closedSource=function(v){this.accumulate=!1;var _=this.streamFiles&&!v.file.dir,$=d(v,_,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push($.dirRecord),_)this.push({data:(function(S){return y.DATA_DESCRIPTOR+c(S.crc32,4)+c(S.compressedSize,4)+c(S.uncompressedSize,4)})(v),meta:{percent:100}});else for(this.push({data:$.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},w.prototype.flush=function(){for(var v=this.bytesWritten,_=0;_=this.index;p--)f=(f<<8)+this.byteAt(p);return this.index+=h,f},readString:function(h){return c.transformTo("string",this.readData(h))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var h=this.readInt(4);return new Date(Date.UTC(1980+(h>>25&127),(h>>21&15)-1,h>>16&31,h>>11&31,h>>5&63,(31&h)<<1))}},r.exports=d},{"../utils":32}],19:[function(i,r,l){var c=i("./Uint8ArrayReader");function d(h){c.call(this,h)}i("../utils").inherits(d,c),d.prototype.readData=function(h){this.checkOffset(h);var p=this.data.slice(this.zero+this.index,this.zero+this.index+h);return this.index+=h,p},r.exports=d},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(i,r,l){var c=i("./DataReader");function d(h){c.call(this,h)}i("../utils").inherits(d,c),d.prototype.byteAt=function(h){return this.data.charCodeAt(this.zero+h)},d.prototype.lastIndexOfSignature=function(h){return this.data.lastIndexOf(h)-this.zero},d.prototype.readAndCheckSignature=function(h){return h===this.readData(4)},d.prototype.readData=function(h){this.checkOffset(h);var p=this.data.slice(this.zero+this.index,this.zero+this.index+h);return this.index+=h,p},r.exports=d},{"../utils":32,"./DataReader":18}],21:[function(i,r,l){var c=i("./ArrayReader");function d(h){c.call(this,h)}i("../utils").inherits(d,c),d.prototype.readData=function(h){if(this.checkOffset(h),h===0)return new Uint8Array(0);var p=this.data.subarray(this.zero+this.index,this.zero+this.index+h);return this.index+=h,p},r.exports=d},{"../utils":32,"./ArrayReader":17}],22:[function(i,r,l){var c=i("../utils"),d=i("../support"),h=i("./ArrayReader"),p=i("./StringReader"),f=i("./NodeBufferReader"),b=i("./Uint8ArrayReader");r.exports=function(y){var w=c.getTypeOf(y);return c.checkSupport(w),w!=="string"||d.uint8array?w==="nodebuffer"?new f(y):d.uint8array?new b(c.transformTo("uint8array",y)):new h(c.transformTo("array",y)):new p(y)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(i,r,l){l.LOCAL_FILE_HEADER="PK",l.CENTRAL_FILE_HEADER="PK",l.CENTRAL_DIRECTORY_END="PK",l.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",l.ZIP64_CENTRAL_DIRECTORY_END="PK",l.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(i,r,l){var c=i("./GenericWorker"),d=i("../utils");function h(p){c.call(this,"ConvertWorker to "+p),this.destType=p}d.inherits(h,c),h.prototype.processChunk=function(p){this.push({data:d.transformTo(this.destType,p.data),meta:p.meta})},r.exports=h},{"../utils":32,"./GenericWorker":28}],25:[function(i,r,l){var c=i("./GenericWorker"),d=i("../crc32");function h(){c.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}i("../utils").inherits(h,c),h.prototype.processChunk=function(p){this.streamInfo.crc32=d(p.data,this.streamInfo.crc32||0),this.push(p)},r.exports=h},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(i,r,l){var c=i("../utils"),d=i("./GenericWorker");function h(p){d.call(this,"DataLengthProbe for "+p),this.propName=p,this.withStreamInfo(p,0)}c.inherits(h,d),h.prototype.processChunk=function(p){if(p){var f=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=f+p.data.length}d.prototype.processChunk.call(this,p)},r.exports=h},{"../utils":32,"./GenericWorker":28}],27:[function(i,r,l){var c=i("../utils"),d=i("./GenericWorker");function h(p){d.call(this,"DataWorker");var f=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,p.then(function(b){f.dataIsReady=!0,f.data=b,f.max=b&&b.length||0,f.type=c.getTypeOf(b),f.isPaused||f._tickAndRepeat()},function(b){f.error(b)})}c.inherits(h,d),h.prototype.cleanUp=function(){d.prototype.cleanUp.call(this),this.data=null},h.prototype.resume=function(){return!!d.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,c.delay(this._tickAndRepeat,[],this)),!0)},h.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(c.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},h.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var p=null,f=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":p=this.data.substring(this.index,f);break;case"uint8array":p=this.data.subarray(this.index,f);break;case"array":case"nodebuffer":p=this.data.slice(this.index,f)}return this.index=f,this.push({data:p,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=h},{"../utils":32,"./GenericWorker":28}],28:[function(i,r,l){function c(d){this.name=d||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}c.prototype={push:function(d){this.emit("data",d)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(d){this.emit("error",d)}return!0},error:function(d){return!this.isFinished&&(this.isPaused?this.generatedError=d:(this.isFinished=!0,this.emit("error",d),this.previous&&this.previous.error(d),this.cleanUp()),!0)},on:function(d,h){return this._listeners[d].push(h),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(d,h){if(this._listeners[d])for(var p=0;p "+d:d}},r.exports=c},{}],29:[function(i,r,l){var c=i("../utils"),d=i("./ConvertWorker"),h=i("./GenericWorker"),p=i("../base64"),f=i("../support"),b=i("../external"),y=null;if(f.nodestream)try{y=i("../nodejs/NodejsStreamOutputAdapter")}catch{}function w(_,$){return new b.Promise(function(S,T){var E=[],D=_._internalType,M=_._outputType,P=_._mimeType;_.on("data",function(W,G){E.push(W),$&&$(G)}).on("error",function(W){E=[],T(W)}).on("end",function(){try{var W=(function(G,z,Z){switch(G){case"blob":return c.newBlob(c.transformTo("arraybuffer",z),Z);case"base64":return p.encode(z);default:return c.transformTo(G,z)}})(M,(function(G,z){var Z,he=0,Ce=null,R=0;for(Z=0;Z"u")l.blob=!1;else{var c=new ArrayBuffer(0);try{l.blob=new Blob([c],{type:"application/zip"}).size===0}catch{try{var d=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);d.append(c),l.blob=d.getBlob("application/zip").size===0}catch{l.blob=!1}}}try{l.nodestream=!!i("readable-stream").Readable}catch{l.nodestream=!1}},{"readable-stream":16}],31:[function(i,r,l){for(var c=i("./utils"),d=i("./support"),h=i("./nodejsUtils"),p=i("./stream/GenericWorker"),f=new Array(256),b=0;b<256;b++)f[b]=252<=b?6:248<=b?5:240<=b?4:224<=b?3:192<=b?2:1;f[254]=f[254]=1;function y(){p.call(this,"utf-8 decode"),this.leftOver=null}function w(){p.call(this,"utf-8 encode")}l.utf8encode=function(v){return d.nodebuffer?h.newBufferFrom(v,"utf-8"):(function(_){var $,S,T,E,D,M=_.length,P=0;for(E=0;E>>6:(S<65536?$[D++]=224|S>>>12:($[D++]=240|S>>>18,$[D++]=128|S>>>12&63),$[D++]=128|S>>>6&63),$[D++]=128|63&S);return $})(v)},l.utf8decode=function(v){return d.nodebuffer?c.transformTo("nodebuffer",v).toString("utf-8"):(function(_){var $,S,T,E,D=_.length,M=new Array(2*D);for($=S=0;$>10&1023,M[S++]=56320|1023&T)}return M.length!==S&&(M.subarray?M=M.subarray(0,S):M.length=S),c.applyFromCharCode(M)})(v=c.transformTo(d.uint8array?"uint8array":"array",v))},c.inherits(y,p),y.prototype.processChunk=function(v){var _=c.transformTo(d.uint8array?"uint8array":"array",v.data);if(this.leftOver&&this.leftOver.length){if(d.uint8array){var $=_;(_=new Uint8Array($.length+this.leftOver.length)).set(this.leftOver,0),_.set($,this.leftOver.length)}else _=this.leftOver.concat(_);this.leftOver=null}var S=(function(E,D){var M;for((D=D||E.length)>E.length&&(D=E.length),M=D-1;0<=M&&(192&E[M])==128;)M--;return M<0||M===0?D:M+f[E[M]]>D?M:D})(_),T=_;S!==_.length&&(d.uint8array?(T=_.subarray(0,S),this.leftOver=_.subarray(S,_.length)):(T=_.slice(0,S),this.leftOver=_.slice(S,_.length))),this.push({data:l.utf8decode(T),meta:v.meta})},y.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:l.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},l.Utf8DecodeWorker=y,c.inherits(w,p),w.prototype.processChunk=function(v){this.push({data:l.utf8encode(v.data),meta:v.meta})},l.Utf8EncodeWorker=w},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(i,r,l){var c=i("./support"),d=i("./base64"),h=i("./nodejsUtils"),p=i("./external");function f($){return $}function b($,S){for(var T=0;T<$.length;++T)S[T]=255&$.charCodeAt(T);return S}i("setimmediate"),l.newBlob=function($,S){l.checkSupport("blob");try{return new Blob([$],{type:S})}catch{try{var T=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return T.append($),T.getBlob(S)}catch{throw new Error("Bug : can't construct the Blob.")}}};var y={stringifyByChunk:function($,S,T){var E=[],D=0,M=$.length;if(M<=T)return String.fromCharCode.apply(null,$);for(;D>8;this.dir=!!(16&this.externalFileAttributes),v==0&&(this.dosPermissions=63&this.externalFileAttributes),v==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var v=c(this.extraFields[1].value);this.uncompressedSize===d.MAX_VALUE_32BITS&&(this.uncompressedSize=v.readInt(8)),this.compressedSize===d.MAX_VALUE_32BITS&&(this.compressedSize=v.readInt(8)),this.localHeaderOffset===d.MAX_VALUE_32BITS&&(this.localHeaderOffset=v.readInt(8)),this.diskNumberStart===d.MAX_VALUE_32BITS&&(this.diskNumberStart=v.readInt(4))}},readExtraFields:function(v){var _,$,S,T=v.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});v.index+4>>6:(v<65536?w[S++]=224|v>>>12:(w[S++]=240|v>>>18,w[S++]=128|v>>>12&63),w[S++]=128|v>>>6&63),w[S++]=128|63&v);return w},l.buf2binstring=function(y){return b(y,y.length)},l.binstring2buf=function(y){for(var w=new c.Buf8(y.length),v=0,_=w.length;v<_;v++)w[v]=y.charCodeAt(v);return w},l.buf2string=function(y,w){var v,_,$,S,T=w||y.length,E=new Array(2*T);for(v=_=0;v>10&1023,E[_++]=56320|1023&$)}return b(E,_)},l.utf8border=function(y,w){var v;for((w=w||y.length)>y.length&&(w=y.length),v=w-1;0<=v&&(192&y[v])==128;)v--;return v<0||v===0?w:v+p[y[v]]>w?v:w}},{"./common":41}],43:[function(i,r,l){r.exports=function(c,d,h,p){for(var f=65535&c|0,b=c>>>16&65535|0,y=0;h!==0;){for(h-=y=2e3>>1:d>>>1;h[p]=d}return h})();r.exports=function(d,h,p,f){var b=c,y=f+p;d^=-1;for(var w=f;w>>8^b[255&(d^h[w])];return-1^d}},{}],46:[function(i,r,l){var c,d=i("../utils/common"),h=i("./trees"),p=i("./adler32"),f=i("./crc32"),b=i("./messages"),y=0,w=4,v=0,_=-2,$=-1,S=4,T=2,E=8,D=9,M=286,P=30,W=19,G=2*M+1,z=15,Z=3,he=258,Ce=he+Z+1,R=42,K=113,C=1,Q=2,ve=3,ce=4;function ne(k,X){return k.msg=b[X],X}function me(k){return(k<<1)-(4k.avail_out&&(Y=k.avail_out),Y!==0&&(d.arraySet(k.output,X.pending_buf,X.pending_out,Y,k.next_out),k.next_out+=Y,X.pending_out+=Y,k.total_out+=Y,k.avail_out-=Y,X.pending-=Y,X.pending===0&&(X.pending_out=0))}function N(k,X){h._tr_flush_block(k,0<=k.block_start?k.block_start:-1,k.strstart-k.block_start,X),k.block_start=k.strstart,B(k.strm)}function te(k,X){k.pending_buf[k.pending++]=X}function q(k,X){k.pending_buf[k.pending++]=X>>>8&255,k.pending_buf[k.pending++]=255&X}function se(k,X){var Y,O,A=k.max_chain_length,U=k.strstart,H=k.prev_length,ue=k.nice_match,V=k.strstart>k.w_size-Ce?k.strstart-(k.w_size-Ce):0,be=k.window,pe=k.w_mask,fe=k.prev,Le=k.strstart+he,Ue=be[U+H-1],Be=be[U+H];k.prev_length>=k.good_match&&(A>>=2),ue>k.lookahead&&(ue=k.lookahead);do if(be[(Y=X)+H]===Be&&be[Y+H-1]===Ue&&be[Y]===be[U]&&be[++Y]===be[U+1]){U+=2,Y++;do;while(be[++U]===be[++Y]&&be[++U]===be[++Y]&&be[++U]===be[++Y]&&be[++U]===be[++Y]&&be[++U]===be[++Y]&&be[++U]===be[++Y]&&be[++U]===be[++Y]&&be[++U]===be[++Y]&&UV&&--A!=0);return H<=k.lookahead?H:k.lookahead}function j(k){var X,Y,O,A,U,H,ue,V,be,pe,fe=k.w_size;do{if(A=k.window_size-k.lookahead-k.strstart,k.strstart>=fe+(fe-Ce)){for(d.arraySet(k.window,k.window,fe,fe,0),k.match_start-=fe,k.strstart-=fe,k.block_start-=fe,X=Y=k.hash_size;O=k.head[--X],k.head[X]=fe<=O?O-fe:0,--Y;);for(X=Y=fe;O=k.prev[--X],k.prev[X]=fe<=O?O-fe:0,--Y;);A+=fe}if(k.strm.avail_in===0)break;if(H=k.strm,ue=k.window,V=k.strstart+k.lookahead,be=A,pe=void 0,pe=H.avail_in,be=Z)for(U=k.strstart-k.insert,k.ins_h=k.window[U],k.ins_h=(k.ins_h<=Z&&(k.ins_h=(k.ins_h<=Z)if(O=h._tr_tally(k,k.strstart-k.match_start,k.match_length-Z),k.lookahead-=k.match_length,k.match_length<=k.max_lazy_match&&k.lookahead>=Z){for(k.match_length--;k.strstart++,k.ins_h=(k.ins_h<=Z&&(k.ins_h=(k.ins_h<=Z&&k.match_length<=k.prev_length){for(A=k.strstart+k.lookahead-Z,O=h._tr_tally(k,k.strstart-1-k.prev_match,k.prev_length-Z),k.lookahead-=k.prev_length-1,k.prev_length-=2;++k.strstart<=A&&(k.ins_h=(k.ins_h<k.pending_buf_size-5&&(Y=k.pending_buf_size-5);;){if(k.lookahead<=1){if(j(k),k.lookahead===0&&X===y)return C;if(k.lookahead===0)break}k.strstart+=k.lookahead,k.lookahead=0;var O=k.block_start+Y;if((k.strstart===0||k.strstart>=O)&&(k.lookahead=k.strstart-O,k.strstart=O,N(k,!1),k.strm.avail_out===0)||k.strstart-k.block_start>=k.w_size-Ce&&(N(k,!1),k.strm.avail_out===0))return C}return k.insert=0,X===w?(N(k,!0),k.strm.avail_out===0?ve:ce):(k.strstart>k.block_start&&(N(k,!1),k.strm.avail_out),C)}),new we(4,4,8,4,Te),new we(4,5,16,8,Te),new we(4,6,32,32,Te),new we(4,4,16,16,ae),new we(8,16,32,32,ae),new we(8,16,128,128,ae),new we(8,32,128,256,ae),new we(32,128,258,1024,ae),new we(32,258,258,4096,ae)],l.deflateInit=function(k,X){return We(k,X,E,15,8,0)},l.deflateInit2=We,l.deflateReset=Ae,l.deflateResetKeep=Ne,l.deflateSetHeader=function(k,X){return k&&k.state?k.state.wrap!==2?_:(k.state.gzhead=X,v):_},l.deflate=function(k,X){var Y,O,A,U;if(!k||!k.state||5>8&255),te(O,O.gzhead.time>>16&255),te(O,O.gzhead.time>>24&255),te(O,O.level===9?2:2<=O.strategy||O.level<2?4:0),te(O,255&O.gzhead.os),O.gzhead.extra&&O.gzhead.extra.length&&(te(O,255&O.gzhead.extra.length),te(O,O.gzhead.extra.length>>8&255)),O.gzhead.hcrc&&(k.adler=f(k.adler,O.pending_buf,O.pending,0)),O.gzindex=0,O.status=69):(te(O,0),te(O,0),te(O,0),te(O,0),te(O,0),te(O,O.level===9?2:2<=O.strategy||O.level<2?4:0),te(O,3),O.status=K);else{var H=E+(O.w_bits-8<<4)<<8;H|=(2<=O.strategy||O.level<2?0:O.level<6?1:O.level===6?2:3)<<6,O.strstart!==0&&(H|=32),H+=31-H%31,O.status=K,q(O,H),O.strstart!==0&&(q(O,k.adler>>>16),q(O,65535&k.adler)),k.adler=1}if(O.status===69)if(O.gzhead.extra){for(A=O.pending;O.gzindex<(65535&O.gzhead.extra.length)&&(O.pending!==O.pending_buf_size||(O.gzhead.hcrc&&O.pending>A&&(k.adler=f(k.adler,O.pending_buf,O.pending-A,A)),B(k),A=O.pending,O.pending!==O.pending_buf_size));)te(O,255&O.gzhead.extra[O.gzindex]),O.gzindex++;O.gzhead.hcrc&&O.pending>A&&(k.adler=f(k.adler,O.pending_buf,O.pending-A,A)),O.gzindex===O.gzhead.extra.length&&(O.gzindex=0,O.status=73)}else O.status=73;if(O.status===73)if(O.gzhead.name){A=O.pending;do{if(O.pending===O.pending_buf_size&&(O.gzhead.hcrc&&O.pending>A&&(k.adler=f(k.adler,O.pending_buf,O.pending-A,A)),B(k),A=O.pending,O.pending===O.pending_buf_size)){U=1;break}U=O.gzindexA&&(k.adler=f(k.adler,O.pending_buf,O.pending-A,A)),U===0&&(O.gzindex=0,O.status=91)}else O.status=91;if(O.status===91)if(O.gzhead.comment){A=O.pending;do{if(O.pending===O.pending_buf_size&&(O.gzhead.hcrc&&O.pending>A&&(k.adler=f(k.adler,O.pending_buf,O.pending-A,A)),B(k),A=O.pending,O.pending===O.pending_buf_size)){U=1;break}U=O.gzindexA&&(k.adler=f(k.adler,O.pending_buf,O.pending-A,A)),U===0&&(O.status=103)}else O.status=103;if(O.status===103&&(O.gzhead.hcrc?(O.pending+2>O.pending_buf_size&&B(k),O.pending+2<=O.pending_buf_size&&(te(O,255&k.adler),te(O,k.adler>>8&255),k.adler=0,O.status=K)):O.status=K),O.pending!==0){if(B(k),k.avail_out===0)return O.last_flush=-1,v}else if(k.avail_in===0&&me(X)<=me(Y)&&X!==w)return ne(k,-5);if(O.status===666&&k.avail_in!==0)return ne(k,-5);if(k.avail_in!==0||O.lookahead!==0||X!==y&&O.status!==666){var ue=O.strategy===2?(function(V,be){for(var pe;;){if(V.lookahead===0&&(j(V),V.lookahead===0)){if(be===y)return C;break}if(V.match_length=0,pe=h._tr_tally(V,0,V.window[V.strstart]),V.lookahead--,V.strstart++,pe&&(N(V,!1),V.strm.avail_out===0))return C}return V.insert=0,be===w?(N(V,!0),V.strm.avail_out===0?ve:ce):V.last_lit&&(N(V,!1),V.strm.avail_out===0)?C:Q})(O,X):O.strategy===3?(function(V,be){for(var pe,fe,Le,Ue,Be=V.window;;){if(V.lookahead<=he){if(j(V),V.lookahead<=he&&be===y)return C;if(V.lookahead===0)break}if(V.match_length=0,V.lookahead>=Z&&0V.lookahead&&(V.match_length=V.lookahead)}if(V.match_length>=Z?(pe=h._tr_tally(V,1,V.match_length-Z),V.lookahead-=V.match_length,V.strstart+=V.match_length,V.match_length=0):(pe=h._tr_tally(V,0,V.window[V.strstart]),V.lookahead--,V.strstart++),pe&&(N(V,!1),V.strm.avail_out===0))return C}return V.insert=0,be===w?(N(V,!0),V.strm.avail_out===0?ve:ce):V.last_lit&&(N(V,!1),V.strm.avail_out===0)?C:Q})(O,X):c[O.level].func(O,X);if(ue!==ve&&ue!==ce||(O.status=666),ue===C||ue===ve)return k.avail_out===0&&(O.last_flush=-1),v;if(ue===Q&&(X===1?h._tr_align(O):X!==5&&(h._tr_stored_block(O,0,0,!1),X===3&&(re(O.head),O.lookahead===0&&(O.strstart=0,O.block_start=0,O.insert=0))),B(k),k.avail_out===0))return O.last_flush=-1,v}return X!==w?v:O.wrap<=0?1:(O.wrap===2?(te(O,255&k.adler),te(O,k.adler>>8&255),te(O,k.adler>>16&255),te(O,k.adler>>24&255),te(O,255&k.total_in),te(O,k.total_in>>8&255),te(O,k.total_in>>16&255),te(O,k.total_in>>24&255)):(q(O,k.adler>>>16),q(O,65535&k.adler)),B(k),0=Y.w_size&&(U===0&&(re(Y.head),Y.strstart=0,Y.block_start=0,Y.insert=0),be=new d.Buf8(Y.w_size),d.arraySet(be,X,pe-Y.w_size,Y.w_size,0),X=be,pe=Y.w_size),H=k.avail_in,ue=k.next_in,V=k.input,k.avail_in=pe,k.next_in=0,k.input=X,j(Y);Y.lookahead>=Z;){for(O=Y.strstart,A=Y.lookahead-(Z-1);Y.ins_h=(Y.ins_h<>>=Z=z>>>24,D-=Z,(Z=z>>>16&255)===0)Q[b++]=65535&z;else{if(!(16&Z)){if((64&Z)==0){z=M[(65535&z)+(E&(1<>>=Z,D-=Z),D<15&&(E+=C[p++]<>>=Z=z>>>24,D-=Z,!(16&(Z=z>>>16&255))){if((64&Z)==0){z=P[(65535&z)+(E&(1<>>=Z,D-=Z,(Z=b-y)>3,E&=(1<<(D-=he<<3))-1,c.next_in=p,c.next_out=b,c.avail_in=p>>24&255)+(R>>>8&65280)+((65280&R)<<8)+((255&R)<<24)}function E(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new c.Buf16(320),this.work=new c.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function D(R){var K;return R&&R.state?(K=R.state,R.total_in=R.total_out=K.total=0,R.msg="",K.wrap&&(R.adler=1&K.wrap),K.mode=_,K.last=0,K.havedict=0,K.dmax=32768,K.head=null,K.hold=0,K.bits=0,K.lencode=K.lendyn=new c.Buf32($),K.distcode=K.distdyn=new c.Buf32(S),K.sane=1,K.back=-1,w):v}function M(R){var K;return R&&R.state?((K=R.state).wsize=0,K.whave=0,K.wnext=0,D(R)):v}function P(R,K){var C,Q;return R&&R.state?(Q=R.state,K<0?(C=0,K=-K):(C=1+(K>>4),K<48&&(K&=15)),K&&(K<8||15=ce.wsize?(c.arraySet(ce.window,K,C-ce.wsize,ce.wsize,0),ce.wnext=0,ce.whave=ce.wsize):(Q<(ve=ce.wsize-ce.wnext)&&(ve=Q),c.arraySet(ce.window,K,C-Q,ve,ce.wnext),(Q-=ve)?(c.arraySet(ce.window,K,C-Q,Q,0),ce.wnext=Q,ce.whave=ce.wsize):(ce.wnext+=ve,ce.wnext===ce.wsize&&(ce.wnext=0),ce.whave>>8&255,C.check=h(C.check,U,2,0),N=B=0,C.mode=2;break}if(C.flags=0,C.head&&(C.head.done=!1),!(1&C.wrap)||(((255&B)<<8)+(B>>8))%31){R.msg="incorrect header check",C.mode=30;break}if((15&B)!=8){R.msg="unknown compression method",C.mode=30;break}if(N-=4,k=8+(15&(B>>>=4)),C.wbits===0)C.wbits=k;else if(k>C.wbits){R.msg="invalid window size",C.mode=30;break}C.dmax=1<>8&1),512&C.flags&&(U[0]=255&B,U[1]=B>>>8&255,C.check=h(C.check,U,2,0)),N=B=0,C.mode=3;case 3:for(;N<32;){if(me===0)break e;me--,B+=Q[ce++]<>>8&255,U[2]=B>>>16&255,U[3]=B>>>24&255,C.check=h(C.check,U,4,0)),N=B=0,C.mode=4;case 4:for(;N<16;){if(me===0)break e;me--,B+=Q[ce++]<>8),512&C.flags&&(U[0]=255&B,U[1]=B>>>8&255,C.check=h(C.check,U,2,0)),N=B=0,C.mode=5;case 5:if(1024&C.flags){for(;N<16;){if(me===0)break e;me--,B+=Q[ce++]<>>8&255,C.check=h(C.check,U,2,0)),N=B=0}else C.head&&(C.head.extra=null);C.mode=6;case 6:if(1024&C.flags&&(me<(se=C.length)&&(se=me),se&&(C.head&&(k=C.head.extra_len-C.length,C.head.extra||(C.head.extra=new Array(C.head.extra_len)),c.arraySet(C.head.extra,Q,ce,se,k)),512&C.flags&&(C.check=h(C.check,Q,se,ce)),me-=se,ce+=se,C.length-=se),C.length))break e;C.length=0,C.mode=7;case 7:if(2048&C.flags){if(me===0)break e;for(se=0;k=Q[ce+se++],C.head&&k&&C.length<65536&&(C.head.name+=String.fromCharCode(k)),k&&se>9&1,C.head.done=!0),R.adler=C.check=0,C.mode=12;break;case 10:for(;N<32;){if(me===0)break e;me--,B+=Q[ce++]<>>=7&N,N-=7&N,C.mode=27;break}for(;N<3;){if(me===0)break e;me--,B+=Q[ce++]<>>=1)){case 0:C.mode=14;break;case 1:if(he(C),C.mode=20,K!==6)break;B>>>=2,N-=2;break e;case 2:C.mode=17;break;case 3:R.msg="invalid block type",C.mode=30}B>>>=2,N-=2;break;case 14:for(B>>>=7&N,N-=7&N;N<32;){if(me===0)break e;me--,B+=Q[ce++]<>>16^65535)){R.msg="invalid stored block lengths",C.mode=30;break}if(C.length=65535&B,N=B=0,C.mode=15,K===6)break e;case 15:C.mode=16;case 16:if(se=C.length){if(me>>=5,N-=5,C.ndist=1+(31&B),B>>>=5,N-=5,C.ncode=4+(15&B),B>>>=4,N-=4,286>>=3,N-=3}for(;C.have<19;)C.lens[H[C.have++]]=0;if(C.lencode=C.lendyn,C.lenbits=7,Y={bits:C.lenbits},X=f(0,C.lens,0,19,C.lencode,0,C.work,Y),C.lenbits=Y.bits,X){R.msg="invalid code lengths set",C.mode=30;break}C.have=0,C.mode=19;case 19:for(;C.have>>16&255,Ie=65535&A,!((ae=A>>>24)<=N);){if(me===0)break e;me--,B+=Q[ce++]<>>=ae,N-=ae,C.lens[C.have++]=Ie;else{if(Ie===16){for(O=ae+2;N>>=ae,N-=ae,C.have===0){R.msg="invalid bit length repeat",C.mode=30;break}k=C.lens[C.have-1],se=3+(3&B),B>>>=2,N-=2}else if(Ie===17){for(O=ae+3;N>>=ae)),B>>>=3,N-=3}else{for(O=ae+7;N>>=ae)),B>>>=7,N-=7}if(C.have+se>C.nlen+C.ndist){R.msg="invalid bit length repeat",C.mode=30;break}for(;se--;)C.lens[C.have++]=k}}if(C.mode===30)break;if(C.lens[256]===0){R.msg="invalid code -- missing end-of-block",C.mode=30;break}if(C.lenbits=9,Y={bits:C.lenbits},X=f(b,C.lens,0,C.nlen,C.lencode,0,C.work,Y),C.lenbits=Y.bits,X){R.msg="invalid literal/lengths set",C.mode=30;break}if(C.distbits=6,C.distcode=C.distdyn,Y={bits:C.distbits},X=f(y,C.lens,C.nlen,C.ndist,C.distcode,0,C.work,Y),C.distbits=Y.bits,X){R.msg="invalid distances set",C.mode=30;break}if(C.mode=20,K===6)break e;case 20:C.mode=21;case 21:if(6<=me&&258<=re){R.next_out=ne,R.avail_out=re,R.next_in=ce,R.avail_in=me,C.hold=B,C.bits=N,p(R,q),ne=R.next_out,ve=R.output,re=R.avail_out,ce=R.next_in,Q=R.input,me=R.avail_in,B=C.hold,N=C.bits,C.mode===12&&(C.back=-1);break}for(C.back=0;we=(A=C.lencode[B&(1<>>16&255,Ie=65535&A,!((ae=A>>>24)<=N);){if(me===0)break e;me--,B+=Q[ce++]<>Ne)])>>>16&255,Ie=65535&A,!(Ne+(ae=A>>>24)<=N);){if(me===0)break e;me--,B+=Q[ce++]<>>=Ne,N-=Ne,C.back+=Ne}if(B>>>=ae,N-=ae,C.back+=ae,C.length=Ie,we===0){C.mode=26;break}if(32&we){C.back=-1,C.mode=12;break}if(64&we){R.msg="invalid literal/length code",C.mode=30;break}C.extra=15&we,C.mode=22;case 22:if(C.extra){for(O=C.extra;N>>=C.extra,N-=C.extra,C.back+=C.extra}C.was=C.length,C.mode=23;case 23:for(;we=(A=C.distcode[B&(1<>>16&255,Ie=65535&A,!((ae=A>>>24)<=N);){if(me===0)break e;me--,B+=Q[ce++]<>Ne)])>>>16&255,Ie=65535&A,!(Ne+(ae=A>>>24)<=N);){if(me===0)break e;me--,B+=Q[ce++]<>>=Ne,N-=Ne,C.back+=Ne}if(B>>>=ae,N-=ae,C.back+=ae,64&we){R.msg="invalid distance code",C.mode=30;break}C.offset=Ie,C.extra=15&we,C.mode=24;case 24:if(C.extra){for(O=C.extra;N>>=C.extra,N-=C.extra,C.back+=C.extra}if(C.offset>C.dmax){R.msg="invalid distance too far back",C.mode=30;break}C.mode=25;case 25:if(re===0)break e;if(se=q-re,C.offset>se){if((se=C.offset-se)>C.whave&&C.sane){R.msg="invalid distance too far back",C.mode=30;break}j=se>C.wnext?(se-=C.wnext,C.wsize-se):C.wnext-se,se>C.length&&(se=C.length),Te=C.window}else Te=ve,j=ne-C.offset,se=C.length;for(reG?(Z=j[Te+S[K]],N[te+S[K]]):(Z=96,0),E=1<>ne)+(D-=E)]=z<<24|Z<<16|he|0,D!==0;);for(E=1<>=1;if(E!==0?(B&=E-1,B+=E):B=0,K++,--q[R]==0){if(R===Q)break;R=y[w+S[K]]}if(ve>>7)]}function te(A,U){A.pending_buf[A.pending++]=255&U,A.pending_buf[A.pending++]=U>>>8&255}function q(A,U,H){A.bi_valid>T-H?(A.bi_buf|=U<>T-A.bi_valid,A.bi_valid+=H-T):(A.bi_buf|=U<>>=1,H<<=1,0<--U;);return H>>>1}function Te(A,U,H){var ue,V,be=new Array(S+1),pe=0;for(ue=1;ue<=S;ue++)be[ue]=pe=pe+H[ue-1]<<1;for(V=0;V<=U;V++){var fe=A[2*V+1];fe!==0&&(A[2*V]=j(be[fe]++,fe))}}function ae(A){var U;for(U=0;U>1;1<=H;H--)Ne(A,be,H);for(V=Le;H=A.heap[1],A.heap[1]=A.heap[A.heap_len--],Ne(A,be,1),ue=A.heap[1],A.heap[--A.heap_max]=H,A.heap[--A.heap_max]=ue,be[2*V]=be[2*H]+be[2*ue],A.depth[V]=(A.depth[H]>=A.depth[ue]?A.depth[H]:A.depth[ue])+1,be[2*H+1]=be[2*ue+1]=V,A.heap[1]=V++,Ne(A,be,1),2<=A.heap_len;);A.heap[--A.heap_max]=A.heap[1],(function(Be,Pt){var ie,Oe,Ps,ze,Zo,Ze,At=Pt.dyn_tree,Qo=Pt.max_code,io=Pt.stat_desc.static_tree,no=Pt.stat_desc.has_stree,Un=Pt.stat_desc.extra_bits,Io=Pt.stat_desc.extra_base,Bs=Pt.stat_desc.max_length,ro=0;for(ze=0;ze<=S;ze++)Be.bl_count[ze]=0;for(At[2*Be.heap[Be.heap_max]+1]=0,ie=Be.heap_max+1;ie<$;ie++)Bs<(ze=At[2*At[2*(Oe=Be.heap[ie])+1]+1]+1)&&(ze=Bs,ro++),At[2*Oe+1]=ze,Qo>=7;V>>=1)if(1&Ue&&fe.dyn_ltree[2*Le]!==0)return d;if(fe.dyn_ltree[18]!==0||fe.dyn_ltree[20]!==0||fe.dyn_ltree[26]!==0)return h;for(Le=32;Le>>3,(be=A.static_len+3+7>>>3)<=V&&(V=be)):V=be=H+5,H+4<=V&&U!==-1?O(A,U,H,ue):A.strategy===4||be===V?(q(A,2+(ue?1:0),3),Ae(A,Ce,R)):(q(A,4+(ue?1:0),3),(function(fe,Le,Ue,Be){var Pt;for(q(fe,Le-257,5),q(fe,Ue-1,5),q(fe,Be-4,4),Pt=0;Pt>>8&255,A.pending_buf[A.d_buf+2*A.last_lit+1]=255&U,A.pending_buf[A.l_buf+A.last_lit]=255&H,A.last_lit++,U===0?A.dyn_ltree[2*H]++:(A.matches++,U--,A.dyn_ltree[2*(C[H]+y+1)]++,A.dyn_dtree[2*N(U)]++),A.last_lit===A.lit_bufsize-1},l._tr_align=function(A){q(A,2,3),se(A,D,Ce),(function(U){U.bi_valid===16?(te(U,U.bi_buf),U.bi_buf=0,U.bi_valid=0):8<=U.bi_valid&&(U.pending_buf[U.pending++]=255&U.bi_buf,U.bi_buf>>=8,U.bi_valid-=8)})(A)}},{"../utils/common":41}],53:[function(i,r,l){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(i,r,l){(function(c){(function(d,h){if(!d.setImmediate){var p,f,b,y,w=1,v={},_=!1,$=d.document,S=Object.getPrototypeOf&&Object.getPrototypeOf(d);S=S&&S.setTimeout?S:d,p={}.toString.call(d.process)==="[object process]"?function(M){process.nextTick(function(){E(M)})}:(function(){if(d.postMessage&&!d.importScripts){var M=!0,P=d.onmessage;return d.onmessage=function(){M=!1},d.postMessage("","*"),d.onmessage=P,M}})()?(y="setImmediate$"+Math.random()+"$",d.addEventListener?d.addEventListener("message",D,!1):d.attachEvent("onmessage",D),function(M){d.postMessage(y+M,"*")}):d.MessageChannel?((b=new MessageChannel).port1.onmessage=function(M){E(M.data)},function(M){b.port2.postMessage(M)}):$&&"onreadystatechange"in $.createElement("script")?(f=$.documentElement,function(M){var P=$.createElement("script");P.onreadystatechange=function(){E(M),P.onreadystatechange=null,f.removeChild(P),P=null},f.appendChild(P)}):function(M){setTimeout(E,0,M)},S.setImmediate=function(M){typeof M!="function"&&(M=new Function(""+M));for(var P=new Array(arguments.length-1),W=0;W"u"?c===void 0?this:c:self)}).call(this,typeof eo<"u"?eo:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(OC);var ase=OC.exports;const ww=Xo(ase);function lse(a){const[s,i]=_e.useState(""),[r,l]=_e.useState("");return Lt(()=>{a.socket.decrypt(a.systemConfig.native.javascriptPassword).then(c=>l(c))},[a.systemConfig,a.socket]),m.jsxs(Ut,{open:!0,onClose:()=>a.onEntered(null),fullWidth:!0,maxWidth:"sm",children:[m.jsx(ss,{children:x.I18n.t("Please enter a password for expert mode")}),m.jsx(qt,{children:m.jsx(Eo,{autoFocus:!0,margin:"dense",variant:"standard",label:x.I18n.t("Password"),type:"password",fullWidth:!0,value:s,onKeyDown:c=>{c.key==="Enter"&&s&&(c.preventDefault(),c.stopPropagation(),r===s?a.onEntered(s):a.onEntered(""))},onChange:c=>i(c.target.value)})}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",disabled:!s,onClick:()=>{r===s?a.onEntered(s):a.onEntered("")},startIcon:m.jsx(qo,{}),children:x.I18n.t("Ok")}),m.jsx(He,{color:"grey",variant:"contained",onClick:()=>a.onEntered(null),startIcon:m.jsx(so,{}),children:x.I18n.t("Cancel")})]})]})}const Gr={root:{flexGrow:1,display:"flex",width:"100%",height:"100%"},mainDiv:{width:"100%",height:"100%",overflow:"hidden"},content:a=>({width:"100%",height:"100%",backgroundColor:a.palette.background&&a.palette.background.default,position:"relative"}),menuOpenCloseButton:a=>({position:"absolute",left:0,borderRadius:"0 5px 5px 0",top:6,pt:1,cursor:"pointer",zIndex:1,height:25,width:20,background:a.palette.secondary.main,color:a.palette.primary.main,pl:"3px","&:hover":{color:"white"}}),showLogButton:a=>({position:"absolute",right:3,borderRadius:"5px 5px 0 0",bottom:0,pt:"3px",cursor:"pointer",zIndex:10,height:20,width:25,background:a.palette.secondary.main,color:a.palette.primary.main,pl:1,"&:hover":{color:"white"}})};class cse extends x.GenericApp{hosts=[];importFile=null;importFileName=null;scripts={};confirmCallback=null;changedScripts={};javascriptPassword="";constructor(s){super(s,{Connection:x.AdminConnection,translations:{en:hM,de:rB,es:ej,fr:YU,it:U5,nl:LV,pl:D6,pt:C7,ru:bq,uk:hQ,"zh-cn":rse},bottomButtons:!1,socket:{autoSubscribeLog:!0},sentryDSN:window.sentryDSN});const i=window.localStorage.getItem("JS.logSizes");let r=[80,20];if(i)try{r=JSON.parse(i)}catch{}const l=window.localStorage.getItem("JS.splitSizes");let c=[20,80];if(l)try{c=JSON.parse(l)}catch{}this.state={...this.state,splitSizes:c,logSizes:r},window.alert=d=>{console.error(d),this.showJsError(d.toString())}}onScriptsChanged=(s,i)=>{if(!s)return;let r=!1;const l={};s.startsWith("script.js.")&&(i?JSON.stringify(this.scripts[s])!==JSON.stringify(i)&&(this.scripts[s]=i,r=!0,l.scriptsHash=this.state.scriptsHash+1):this.scripts[s]&&(delete this.scripts[s],r=!0,l.scriptsHash=this.state.scriptsHash+1)),r&&this.setState(l)};onInstanceChanged=(s,i)=>{var c;if(!s)return;let r=!1;const l={};if(s.match(/^system\.adapter\.[-_\w\d]+\$/)){if(s.startsWith(`system.adapter.${this.adapterName}.`)){const d=parseInt(s.split(".").pop()||"0",10)||0;if((i==null?void 0:i.type)==="instance")this.state.instances.includes(d)||(l.instances=[...this.state.instances],l.instances.push(d),l.instances.sort(),r=!0,this.socket.subscribeState(`${i._id}.alive`,this.onInstanceAliveChange));else if(!i&&this.state.instances.includes(d)){this.socket.unsubscribeState(`${s}.alive`,this.onInstanceAliveChange),l.instances=[...this.state.instances];const h=l.instances.indexOf(d);l.instances.splice(h,1),r=!0}}(c=i==null?void 0:i.common)!=null&&c.blockly&&(this.confirmCallback=d=>d&&window.location.reload(),l.confirm=x.I18n.t("Some blocks were updated. Reload admin?"),r=!0)}r&&this.setState(l)};onHostChanged=(s,i)=>{if(s&&s.startsWith("system.host.")){if((i==null?void 0:i.type)==="host")this.hosts.includes(s)||(this.hosts.push(s),this.hosts.sort());else if(!i&&this.hosts.includes(s)){const r=this.hosts.indexOf(s);this.hosts.splice(r,1)}}};onConnectionReady(){window.systemLang=this.socket.systemLang,this.setState({ready:!1,scriptsHash:0,instances:[],updating:!1,resizing:!1,selected:null,logMessage:{},editing:[],menuOpened:window.localStorage.getItem("App.menuOpened")!=="false",menuSelectId:"",expertMode:window.localStorage.getItem("App.expertMode")==="true",logHorzLayout:window.localStorage.getItem("App.logHorzLayout")==="true",runningInstances:{},confirm:"",importFile:!1,message:"",searchText:"",hideLog:window.localStorage.getItem("App.hideLog")==="true",debugMode:!1,debugInstance:null,splitSizes:[20,80],password:""},async()=>{var d;const s={},i=await this.subscribeOnInstances();s.instances=i.instances,s.runningInstances=i.runningInstances,this.javascriptPassword=((d=this.socket.systemConfig)==null?void 0:d.native.javascriptPassword)||"",await this.readAdaptersWithBlockly();const r=await this.socket.getHosts();this.hosts=r.map(h=>h._id);const l=await this.readAllScripts();window.localStorage.getItem("App.expertMode")!=="true"&&window.localStorage.getItem("App.expertMode")!=="false"&&!this.javascriptPassword?Object.keys(l).find(h=>h.startsWith("script.js.global.")&&l[h].type==="script")&&(s.expertMode=!0):this.javascriptPassword&&(s.expertMode=!1),this.scripts=l;let c=this.state.scriptsHash;this.compareScripts(l)&&c++,s.scriptsHash=c,s.ready=!0,this.setState(s),await this.socket.subscribeObject("script.*",this.onScriptsChanged),await this.socket.subscribeObject("system.adapter.*",this.onInstanceChanged),await this.socket.subscribeObject("system.host.*",this.onHostChanged)})}async subscribeOnInstances(){const i=(await this.socket.getAdapterInstances(this.adapterName)).map(l=>parseInt(l._id.split(".").pop()||"0")).sort(),r={};i.forEach(l=>r[`system.adapter.${this.adapterName}.${l}`]=!1);for(let l=0;ls[r]=i[r]),s}async readAdaptersWithBlockly(){const s=await this.socket.getObjectViewSystem("adapter","system.adapter.","system.adapter.香");return new Promise(i=>et.loadCustomBlockly(s,()=>i()))}onInstanceAliveChange=(s,i)=>{if(s&&(s=s?s.substring(0,s.length-6):"",this.state.runningInstances[s]!==(i?i.val:!1))){const r=JSON.parse(JSON.stringify(this.state.runningInstances));r[s]=i?!!i.val:!1,this.setState({runningInstances:r})}};compareScripts(s){const i=Object.keys(this.scripts),r=Object.keys(s);if(i.length!==r.length)return this.scripts=s,!0;if(JSON.stringify(i)!==JSON.stringify(r))return this.scripts=s,!0;for(let l=0;l ${i}`),this.setState({updating:!0});try{if(((c=this.scripts[s])==null?void 0:c.type)==="script"){const d=JSON.parse(JSON.stringify(this.scripts[s].common));d.name=r||d.name,l!==void 0&&(d.engine=`system.adapter.javascript.${l}`);const h=i.split(".");h.pop();const p=h.join(".");this.scripts[p]&&this.scripts[p].type==="script"&&(h.pop(),i=`${h.join(".")}.${i.split(".").pop()}`),await this.updateScript(s,i,d)}else await this.renameGroup(s,i,r)}catch(d){d.toString().includes("canceled")||this.showJsError(d)}this.setState({updating:!1})}async renameGroup(s,i,r,l){if(l){if(l.length){let c=l.pop();if(c){const d=await this.socket.getObject(c);if(d){try{await this.socket.delObject(c)}catch{}c=i+c.substring(s.length),d._id=c,d.common=d.common||{},d.common.expert=!0,await this.socket.setObject(c,d),await this.renameGroup(s,i,r,l)}}}}else{l=[],l=Object.keys(this.scripts).filter(d=>d.startsWith(`${s}.`));let c=await this.socket.getObject(s);c=c||{common:{},type:"channel"},c.common.name=r||c.common.name||s.split(".").pop()||"",c._id=i;try{await this.socket.delObject(s)}catch{}try{await this.socket.setObject(i,c),await this.renameGroup(s,i,r,l)}catch(d){console.log(d);const h={_id:i,type:"channel",common:{name:r||s.split(".").pop()||"",expert:!0},native:{}};await this.socket.setObject(i,h),await this.renameGroup(s,i,r,l)}}}async onUpdateScript(s,i){var r;if(((r=this.scripts[s])==null?void 0:r.type)==="script")try{await this.updateScript(s,s,i)}catch(l){l.toString().includes("canceled")||this.showJsError(l)}}onSelect(s){this.scripts[s]&&this.scripts[s].common&&this.scripts[s].type==="script"&&this.setState({selected:s,menuSelectId:s},()=>setTimeout(()=>this.setState({menuSelectId:""}),300))}renderPasswordDialog(){return this.state.showPasswordDialog?m.jsx(lse,{socket:this.socket,systemConfig:this.socket.systemConfig,onEntered:s=>{s===null?this.setState({showPasswordDialog:!1,expertMode:!1,password:""}):s?this.setState({expertMode:!0,showPasswordDialog:!1,password:s}):this.setState({showPasswordDialog:!1,expertMode:!1,message:x.I18n.t("Wrong password"),password:""})}},"passwordDialog"):null}onExpertModeChange(s){var i;if(this.state.expertMode!==s)if(s&&this.javascriptPassword)this.setState({showPasswordDialog:!0});else{let r=this.state.selected;r&&!s&&((i=this.scripts[r].native)!=null&&i.protected)&&(r=this.state.editing.find(l=>{var c;return this.scripts[l]&&!((c=this.scripts[l].native)!=null&&c.protected)})||null),window.localStorage.setItem("App.expertMode",s?"true":"false"),this.setState({expertMode:s,password:"",selected:r})}}showJsError(s){this.setState({errorText:s?s.toString():""})}showMessage(s){this.setState({message:s?s.toString():""})}onDelete(s){this.socket.delObject(s).catch(i=>this.showJsError(i))}onEdit(s){this.state.selected!==s&&this.setState({selected:s})}onAddNew(s,i,r,l,c,d){const h=new RegExp(`^${s}\\.`);if(Object.keys(this.scripts).find(p=>s===p||h.test(s)))return this.showJsError(x.I18n.t("Yet exists!"));r?this.socket.setObject(s,{_id:s,type:"channel",common:{name:i,expert:!0},native:{}}).then(()=>setTimeout(()=>this.setState({menuSelectId:s},()=>setTimeout(()=>this.setState({menuSelectId:""}),300)),1e3)).catch(p=>this.showJsError(p)):(c==="Blockly"&&!d&&(d=` //${btoa(encodeURIComponent(''))}`),this.socket.setObject(s,{_id:s,type:"script",common:{name:i,expert:!0,engineType:c||"Javascript/js",enabled:!1,engine:`system.adapter.javascript.${l||0}`,source:d||"",debug:!1,verbose:!1},native:{}}).then(()=>setTimeout(()=>this.onSelect(s),1e3)).catch(p=>this.showJsError(p)))}async updateScript(s,i,r){let l=await this.socket.getObject(s);const c={common:{}};if(r.engine!==void 0&&(c.common.engine=r.engine),r.enabled!==void 0&&(c.common.enabled=r.enabled),r.source!==void 0&&(c.common.source=r.source),r.debug!==void 0&&(c.common.debug=r.debug),r.verbose!==void 0&&(c.common.verbose=r.verbose),c.from="system.adapter.admin.0",s===i&&(l!=null&&l.common)&&r.name===l.common.name){(!r.engineType||r.engineType!==l.common.engineType)&&r.engineType!==void 0&&(c.common.engineType=r.engineType||"Javascript/js"),c.type="script",await this.socket.extendObject(s,c);return}if(l!=null&&l.common){l.common.engineType=r.engineType||l.common.engineType||"Javascript/js",await this.socket.delObject(s),c.common.engine!==void 0&&(l.common.engine=c.common.engine),c.common.enabled!==void 0&&(l.common.enabled=c.common.enabled),c.common.source!==void 0&&(l.common.source=c.common.source),c.common.name!==void 0&&(l.common.name=c.common.name),c.common.debug!==void 0&&(l.common.debug=c.common.debug),c.common.verbose!==void 0&&(l.common.verbose=c.common.verbose),l._rev!==void 0&&delete l._rev,l.common.name=r.name,l.common.expert=!0,l.type="script",l._id=i,await this.socket.setObject(i,l);return}l=c,l.common.name=r.name,l.common.expert=!0,l.type="script",l._id=i,await this.socket.setObject(i,l)}onEnableDisable(s,i){var r;if(((r=this.scripts[s])==null?void 0:r.type)==="script"){const l=this.scripts[s].common;l.enabled=i,l.expert=!0,this.updateScript(s,s,l).catch(c=>c!=="canceled"&&this.showJsError(c))}}async getLiveHost(){for(let s=0;s{if(typeof d=="string"){const h=document.createElement("a");h.href=`../../files/${d}`,document.body.appendChild(h),h.click(),h.remove()}else if(d.error&&this.showJsError(d.error),d.data){const h=document.createElement("a");h.href=`data: application/zip;base64,${d.data}`,h.download=`${r}scripts.zip`,document.body.appendChild(h),h.click(),h.remove()}})}else{const c=new ww;for(const[d,h]of Object.entries(this.scripts))if(h.type==="script"){const p=h,f=p.common.engineType==="TypeScript/ts"?"ts":p.common.engineType==="Blockly"?"blockly":p.common.engineType==="Rules"?"rules":"js";let b=`/******* (ext=${f}/engine=${p.common.engine}/debug=${p.common.debug}/verbose=${p.common.verbose}/enabled=${p.common.enabled}) *******/ `;b+=p.common.source||"";const y=`${d.substring(10).replace(/\./g,"/")}.${f}`;c.file(y,b)}c.generateAsync({type:"blob"}).then(d=>{const h=document.createElement("a");h.href=URL.createObjectURL(d),h.download=`${r}scripts_plain.zip`,document.body.appendChild(h),h.click(),h.remove(),URL.revokeObjectURL(h.href)})}}onImport(s,i){this.importFile=s||null,this.importFileName=i||null,s?(this.confirmCallback=this.onImportConfirmed.bind(this),this.setState({importFile:!1,confirm:x.I18n.t("Existing scripts will be overwritten.")})):this.setState({importFile:!1})}async onImportConfirmed(s){let i=this.importFile;const r=this.importFileName;if(this.importFile=null,this.importFileName=null,s&&i)if(r&&/_(plain|text)\.zip$/i.test(r)){i=i.split(",")[1];try{const c=await ww.loadAsync(i,{base64:!0}),d=[];c.forEach((h,p)=>{p.dir||d.push(p.async("string").then(async f=>{const b=f.split(` `),y=b[0]||"",w=b.slice(1).join(` -`),v=y.match(/\/\*{7}\s*\(ext=(\w+)\/engine=([^/]+)\/debug=(\w+)\/verbose=(\w+)\/enabled=(\w+)\)\s*\*{7}\//);let _="Javascript/js",$="system.adapter.javascript.0",S=!1,T=!1,E=!1;if(v){const G=v[1];$=v[2],S=v[3]==="true",T=v[4]==="true",E=v[5]==="true",G==="ts"?_="TypeScript/ts":G==="blockly"?_="Blockly":G==="rules"&&(_="Rules")}const D=h.replace(/\.\w+$/,"").replace(/\//g,"."),M=`script.js.${D}`,P=D.split(".").pop()||D,W=M.split(".");for(let G=3;G{d==="permissionError"?this.showJsError(x.I18n.t(d)):!d||d.error?this.showJsError(d?x.I18n.t(d.error||""):x.I18n.t("Unknown error")):this.showMessage(x.I18n.t("Done"))})}}toggleLogLayout(){window.localStorage.setItem("App.logHorzLayout",this.state.logHorzLayout?"false":"true"),this.setState({logHorzLayout:!this.state.logHorzLayout})}renderEditor(){var i;const s=Object.keys(this.scripts).reduce((r,l)=>r+(this.scripts[l].common.engineType==="Rules"?1:0),0);return m.jsx(On,{scriptsHash:this.state.scriptsHash,debugMode:this.state.debugMode,onDebugModeChange:r=>{r?this.setState({debugMode:!0}):this.setState({debugMode:!1,debugInstance:null})},visible:!this.state.resizing,socket:this.socket,adapterName:this.adapterName,onLocate:r=>this.setState({menuSelectId:r}),password:this.state.password,runningInstances:this.state.runningInstances,menuOpened:this.state.menuOpened,searchText:this.state.searchText,themeType:this.state.themeType,themeName:this.state.themeName,theme:this.state.theme,expertMode:this.state.expertMode,onChange:(r,l)=>this.onUpdateScript(r,l),isAnyRulesExists:s,debugInstance:this.state.debugInstance,onSelectedChange:(r,l)=>{const c={};let d=!1;r!==this.state.selected&&(d=!0,c.selected=r),JSON.stringify(l)!==JSON.stringify(this.state.editing)&&(d=!0,c.editing=[...l]),d&&this.setState(c)},onRestart:r=>this.socket.extendObject(r,{common:{enabled:!0}}),selected:this.state.selected&&((i=this.scripts[this.state.selected])==null?void 0:i.type)==="script"?this.state.selected:"",objects:this.scripts,resizing:this.state.resizing,onChangedChanged:r=>this.changedScripts=r},"editor")}showLogButton(){return m.jsx(wt,{title:x.I18n.t("Show logs"),sx:Gr.showLogButton,onClick:()=>{window.localStorage.setItem("App.hideLog","false"),this.setState({hideLog:!1,resizing:!0}),setTimeout(()=>this.setState({resizing:!1}),300)},children:m.jsx(SS,{})},"showLog")}renderErrorDialog(){return this.state.errorText?m.jsx(su,{onClose:()=>this.setState({errorText:""}),text:this.state.errorText},"dialogError"):null}renderMain(){let s;return this.state.debugMode||this.state.hideLog?s=m.jsxs(m.Fragment,{children:[!this.state.debugMode&&this.state.hideLog?this.showLogButton():void 0,this.renderEditor()]}):s=m.jsxs(c_,{direction:this.state.logHorzLayout?ft.Horizontal:ft.Vertical,initialSizes:this.state.logSizes,minWidths:[500,100],minHeights:[150,50],onResizeStarted:()=>this.setState({resizing:!0}),onResizeFinished:(i,r)=>{this.setState({logSizes:r,resizing:!1}),window.localStorage.setItem("JS.logSizes",JSON.stringify(r))},gutterClassName:this.state.themeType==="dark"?"Dark visGutter":"Light visGutter",children:[this.renderEditor(),m.jsx(ym,{verticalLayout:!this.state.logHorzLayout,onLayoutChange:()=>this.toggleLogLayout(),editing:this.state.editing,socket:this.socket,selected:this.state.selected,onHideLog:()=>{window.localStorage.setItem("App.hideLog","true"),this.setState({hideLog:!0,resizing:!0}),setTimeout(()=>this.setState({resizing:!1}),300)}},"log")]}),m.jsxs(wt,{sx:Gr.content,className:"iobVerticalSplitter",children:[m.jsx(wt,{sx:Gr.menuOpenCloseButton,onClick:()=>{window.localStorage.setItem("App.menuOpened",this.state.menuOpened?"false":"true"),this.setState({menuOpened:!this.state.menuOpened,resizing:!0}),setTimeout(()=>this.setState({resizing:!1}),300)},children:this.state.menuOpened?m.jsx(ES,{}):m.jsx(IS,{})},"closeMenu"),this.state.message?m.jsx(x.Message,{onClose:()=>this.setState({message:""}),text:this.state.message},"dialogMessage"):null,this.renderErrorDialog(),this.state.importFile?m.jsx(zm,{onClose:(i,r)=>this.onImport(i,r)},"dialogImportFile"):null,this.state.confirm?m.jsx(x.Confirm,{onClose:i=>{this.state.confirm&&this.setState({confirm:""}),this.confirmCallback&&this.confirmCallback(i),this.confirmCallback=null},text:this.state.confirm},"dialogConfirm"):null,this.renderPasswordDialog(),s]},"main")}render(){if(!this.state.ready)return m.jsx(n_,{injectFirst:!0,children:m.jsx(r_,{theme:this.state.theme,children:m.jsx(x.Loader,{themeType:this.state.themeType})})});let s;return this.state.menuOpened?s=m.jsxs(c_,{direction:ft.Horizontal,initialSizes:this.state.splitSizes,minWidths:[270,400],onResizeFinished:(i,r)=>{this.setState({splitSizes:r}),window.localStorage.setItem("JS.splitSizes",JSON.stringify(r))},gutterClassName:this.state.themeType==="dark"?"Dark visGutter":"Light visGutter",children:[m.jsx("div",{style:Gr.mainDiv,children:m.jsx(So,{password:this.state.password,debugMode:this.state.debugMode,onDebugInstance:i=>this.setState({debugInstance:i,debugMode:!!i}),scripts:this.scripts,scriptsHash:this.state.scriptsHash,instances:this.state.instances,onRename:this.onRename.bind(this),socket:this.socket,selectId:this.state.menuSelectId,onEdit:this.onEdit.bind(this),expertMode:this.state.expertMode,themeName:this.state.themeName,onThemeChange:i=>{x.Utils.setThemeName(i);const r=x.Utils.getThemeType(i);this.setState({themeName:i,themeType:r},()=>this.toggleTheme(i))},runningInstances:this.state.runningInstances,onExpertModeChange:i=>this.onExpertModeChange(i),onDelete:this.onDelete.bind(this),onAddNew:this.onAddNew.bind(this),onEnableDisable:this.onEnableDisable.bind(this),onExport:this.onExport.bind(this),width:500,onImport:()=>this.setState({importFile:!0}),onSearch:i=>this.setState({searchText:i}),version:this.props.version,changedScripts:this.changedScripts},"sidemenu")},"menu"),this.renderMain()]}):s=this.renderMain(),m.jsx(n_,{injectFirst:!0,children:m.jsx(r_,{theme:this.state.theme,children:m.jsx("div",{style:Gr.root,children:m.jsx(bR,{socket:this.socket,children:s})})})})}}window.location.hostname==="localhost"||window.location.hostname==="[::1]"||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/);function use(){"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(a=>{a.unregister()})}const dse="9.1.1",RC={version:dse};var Jo;(function(a){a.mouse="mouse",a.touch="touch",a.keyboard="keyboard"})(Jo||(Jo={}));class hse{get delay(){var s;return(s=this.args.delay)!==null&&s!==void 0?s:0}get scrollAngleRanges(){return this.args.scrollAngleRanges}get getDropTargetElementsAtPoint(){return this.args.getDropTargetElementsAtPoint}get ignoreContextMenu(){var s;return(s=this.args.ignoreContextMenu)!==null&&s!==void 0?s:!1}get enableHoverOutsideTarget(){var s;return(s=this.args.enableHoverOutsideTarget)!==null&&s!==void 0?s:!1}get enableKeyboardEvents(){var s;return(s=this.args.enableKeyboardEvents)!==null&&s!==void 0?s:!1}get enableMouseEvents(){var s;return(s=this.args.enableMouseEvents)!==null&&s!==void 0?s:!1}get enableTouchEvents(){var s;return(s=this.args.enableTouchEvents)!==null&&s!==void 0?s:!0}get touchSlop(){return this.args.touchSlop||0}get delayTouchStart(){var s,i,r,l;return(l=(r=(s=this.args)===null||s===void 0?void 0:s.delayTouchStart)!==null&&r!==void 0?r:(i=this.args)===null||i===void 0?void 0:i.delay)!==null&&l!==void 0?l:0}get delayMouseStart(){var s,i,r,l;return(l=(r=(s=this.args)===null||s===void 0?void 0:s.delayMouseStart)!==null&&r!==void 0?r:(i=this.args)===null||i===void 0?void 0:i.delay)!==null&&l!==void 0?l:0}get window(){if(this.context&&this.context.window)return this.context.window;if(typeof window<"u")return window}get document(){var s;if(!((s=this.context)===null||s===void 0)&&s.document)return this.context.document;if(this.window)return this.window.document}get rootElement(){var s;return((s=this.args)===null||s===void 0?void 0:s.rootElement)||this.document}constructor(s,i){this.args=s,this.context=i}}function pse(a,s,i,r){return Math.sqrt(Math.pow(Math.abs(i-a),2)+Math.pow(Math.abs(r-s),2))}function gse(a,s,i,r,l){if(!l)return!1;const c=Math.atan2(r-s,i-a)*180/Math.PI+180;for(let d=0;d=h.start)&&(h.end==null||c<=h.end))return!0}return!1}const mse={Left:1},fse={Left:0};function Tg(a){return a.button===void 0||a.button===fse.Left}function $se(a){return a.buttons===void 0||(a.buttons&mse.Left)===0}function NC(a){return!!a.targetTouches}const bse=1;function vse(a){const s=a.nodeType===bse?a:a.parentElement;if(!s)return;const{top:i,left:r}=s.getBoundingClientRect();return{x:r,y:i}}function yse(a,s){if(a.targetTouches.length===1)return Kc(a.targetTouches[0]);if(s&&a.touches.length===1&&a.touches[0].target===s.target)return Kc(a.touches[0])}function Kc(a,s){return NC(a)?yse(a,s):{x:a.clientX,y:a.clientY}}const kw=(()=>{let a=!1;try{addEventListener("test",()=>{},Object.defineProperty({},"passive",{get(){return a=!0,!0}}))}catch{}return a})(),Vr={[Jo.mouse]:{start:"mousedown",move:"mousemove",end:"mouseup",contextmenu:"contextmenu"},[Jo.touch]:{start:"touchstart",move:"touchmove",end:"touchend"},[Jo.keyboard]:{keydown:"keydown"}};class Zr{profile(){var s;return{sourceNodes:this.sourceNodes.size,sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,targetNodes:this.targetNodes.size,dragOverTargetIds:((s=this.dragOverTargetIds)===null||s===void 0?void 0:s.length)||0}}get document(){return this.options.document}setup(){const s=this.options.rootElement;s&&(Ve(!Zr.isSetUp,"Cannot have two Touch backends at the same time."),Zr.isSetUp=!0,this.addEventListener(s,"start",this.getTopMoveStartHandler()),this.addEventListener(s,"start",this.handleTopMoveStartCapture,!0),this.addEventListener(s,"move",this.handleTopMove),this.addEventListener(s,"move",this.handleTopMoveCapture,!0),this.addEventListener(s,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.addEventListener(s,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.addEventListener(s,"keydown",this.handleCancelOnEscape,!0))}teardown(){const s=this.options.rootElement;s&&(Zr.isSetUp=!1,this._mouseClientOffset={},this.removeEventListener(s,"start",this.handleTopMoveStartCapture,!0),this.removeEventListener(s,"start",this.handleTopMoveStart),this.removeEventListener(s,"move",this.handleTopMoveCapture,!0),this.removeEventListener(s,"move",this.handleTopMove),this.removeEventListener(s,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.removeEventListener(s,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.removeEventListener(s,"keydown",this.handleCancelOnEscape,!0),this.uninstallSourceNodeRemovalObserver())}addEventListener(s,i,r,l=!1){const c=kw?{capture:l,passive:!1}:l;this.listenerTypes.forEach(function(d){const h=Vr[d][i];h&&s.addEventListener(h,r,c)})}removeEventListener(s,i,r,l=!1){const c=kw?{capture:l,passive:!1}:l;this.listenerTypes.forEach(function(d){const h=Vr[d][i];h&&s.removeEventListener(h,r,c)})}connectDragSource(s,i){const r=this.handleMoveStart.bind(this,s);return this.sourceNodes.set(s,i),this.addEventListener(i,"start",r),()=>{this.sourceNodes.delete(s),this.removeEventListener(i,"start",r)}}connectDragPreview(s,i,r){return this.sourcePreviewNodeOptions.set(s,r),this.sourcePreviewNodes.set(s,i),()=>{this.sourcePreviewNodes.delete(s),this.sourcePreviewNodeOptions.delete(s)}}connectDropTarget(s,i){const r=this.options.rootElement;if(!this.document||!r)return()=>{};const l=c=>{if(!this.document||!r||!this.monitor.isDragging())return;let d;switch(c.type){case Vr.mouse.move:d={x:c.clientX,y:c.clientY};break;case Vr.touch.move:var h,p;d={x:((h=c.touches[0])===null||h===void 0?void 0:h.clientX)||0,y:((p=c.touches[0])===null||p===void 0?void 0:p.clientY)||0};break}const f=d!=null?this.document.elementFromPoint(d.x,d.y):void 0,b=f&&i.contains(f);if(f===i||b)return this.handleMove(c,s)};return this.addEventListener(this.document.body,"move",l),this.targetNodes.set(s,i),()=>{this.document&&(this.targetNodes.delete(s),this.removeEventListener(this.document.body,"move",l))}}getTopMoveStartHandler(){return!this.options.delayTouchStart&&!this.options.delayMouseStart?this.handleTopMoveStart:this.handleTopMoveStartDelay}installSourceNodeRemovalObserver(s){this.uninstallSourceNodeRemovalObserver(),this.draggedSourceNode=s,this.draggedSourceNodeRemovalObserver=new MutationObserver(()=>{s&&!s.parentElement&&(this.resurrectSourceNode(),this.uninstallSourceNodeRemovalObserver())}),!(!s||!s.parentElement)&&this.draggedSourceNodeRemovalObserver.observe(s.parentElement,{childList:!0})}resurrectSourceNode(){this.document&&this.draggedSourceNode&&(this.draggedSourceNode.style.display="none",this.draggedSourceNode.removeAttribute("data-reactid"),this.document.body.appendChild(this.draggedSourceNode))}uninstallSourceNodeRemovalObserver(){this.draggedSourceNodeRemovalObserver&&this.draggedSourceNodeRemovalObserver.disconnect(),this.draggedSourceNodeRemovalObserver=void 0,this.draggedSourceNode=void 0}constructor(s,i,r){this.getSourceClientOffset=l=>{const c=this.sourceNodes.get(l);return c&&vse(c)},this.handleTopMoveStartCapture=l=>{Tg(l)&&(this.moveStartSourceIds=[])},this.handleMoveStart=l=>{Array.isArray(this.moveStartSourceIds)&&this.moveStartSourceIds.unshift(l)},this.handleTopMoveStart=l=>{if(!Tg(l))return;const c=Kc(l);c&&(NC(l)&&(this.lastTargetTouchFallback=l.targetTouches[0]),this._mouseClientOffset=c),this.waitingForDelay=!1},this.handleTopMoveStartDelay=l=>{if(!Tg(l))return;const c=l.type===Vr.touch.start?this.options.delayTouchStart:this.options.delayMouseStart;this.timeout=setTimeout(this.handleTopMoveStart.bind(this,l),c),this.waitingForDelay=!0},this.handleTopMoveCapture=()=>{this.dragOverTargetIds=[]},this.handleMove=(l,c)=>{this.dragOverTargetIds&&this.dragOverTargetIds.unshift(c)},this.handleTopMove=l=>{if(this.timeout&&clearTimeout(this.timeout),!this.document||this.waitingForDelay)return;const{moveStartSourceIds:c,dragOverTargetIds:d}=this,h=this.options.enableHoverOutsideTarget,p=Kc(l,this.lastTargetTouchFallback);if(!p)return;if(this._isScrolling||!this.monitor.isDragging()&&gse(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,p.x,p.y,this.options.scrollAngleRanges)){this._isScrolling=!0;return}if(!this.monitor.isDragging()&&this._mouseClientOffset.hasOwnProperty("x")&&c&&pse(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,p.x,p.y)>(this.options.touchSlop?this.options.touchSlop:0)&&(this.moveStartSourceIds=void 0,this.actions.beginDrag(c,{clientOffset:this._mouseClientOffset,getSourceClientOffset:this.getSourceClientOffset,publishSource:!1})),!this.monitor.isDragging())return;const f=this.sourceNodes.get(this.monitor.getSourceId());this.installSourceNodeRemovalObserver(f),this.actions.publishDragSource(),l.cancelable&&l.preventDefault();const b=(d||[]).map(_=>this.targetNodes.get(_)).filter(_=>!!_),y=this.options.getDropTargetElementsAtPoint?this.options.getDropTargetElementsAtPoint(p.x,p.y,b):this.document.elementsFromPoint(p.x,p.y),w=[];for(const _ in y){if(!y.hasOwnProperty(_))continue;let $=y[_];for($!=null&&w.push($);$;)$=$.parentElement,$&&w.indexOf($)===-1&&w.push($)}const v=w.filter(_=>b.indexOf(_)>-1).map(_=>this._getDropTargetId(_)).filter(_=>!!_).filter((_,$,S)=>S.indexOf(_)===$);if(h)for(const _ in this.targetNodes){const $=this.targetNodes.get(_);if(f&&$&&$.contains(f)&&v.indexOf(_)===-1){v.unshift(_);break}}v.reverse(),this.actions.hover(v,{clientOffset:p})},this._getDropTargetId=l=>{const c=this.targetNodes.keys();let d=c.next();for(;d.done===!1;){const h=d.value;if(l===this.targetNodes.get(h))return h;d=c.next()}},this.handleTopMoveEndCapture=l=>{if(this._isScrolling=!1,this.lastTargetTouchFallback=void 0,!!$se(l)){if(!this.monitor.isDragging()||this.monitor.didDrop()){this.moveStartSourceIds=void 0;return}l.cancelable&&l.preventDefault(),this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.drop(),this.actions.endDrag()}},this.handleCancelOnEscape=l=>{l.key==="Escape"&&this.monitor.isDragging()&&(this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.endDrag())},this.options=new hse(r,i),this.actions=s.getActions(),this.monitor=s.getMonitor(),this.sourceNodes=new Map,this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.targetNodes=new Map,this.listenerTypes=[],this._mouseClientOffset={},this._isScrolling=!1,this.options.enableMouseEvents&&this.listenerTypes.push(Jo.mouse),this.options.enableTouchEvents&&this.listenerTypes.push(Jo.touch),this.options.enableKeyboardEvents&&this.listenerTypes.push(Jo.keyboard)}}const _se=function(s,i={},r={}){return new Zr(s,i,r)};window.GenericBlock=at;window.adapterName="javascript";window.sentryDSN="https://504499a725eb4898930d3b9e9da95740@sentry.iobroker.net/56";console.log(`iobroker.${window.adapterName}@${RC.version}`);const wse=window.innerWidth<600,Cw=document.getElementById("root");Cw&&Fw(Cw).render(m.jsx(ek,{backend:wse?_se:hk,children:m.jsx(cse,{version:RC.version})}));use();const gc=window.loadDynamicScript;gc&&gc(window.location.port==="3000"?`${window.location.protocol}//${window.location.hostname}:8081/lib/js/socket.io.js`:"./../../lib/js/socket.io.js",()=>gc("vs/loader.js",()=>gc("vs/configure.js",()=>typeof window.socketLoadedHandler=="function"&&window.socketLoadedHandler())));export{$R as C,sO as D,at as G,pk as I,fw as M,Ns as S,$I as a,LI as b,WI as c,Ei as d,pne as e,Hm as f,su as g,cx as h,gne as j,c_ as m,zn as u,ft as z}; +`),v=y.match(/\/\*{7}\s*\(ext=(\w+)\/engine=([^/]+)\/debug=(\w+)\/verbose=(\w+)\/enabled=(\w+)\)\s*\*{7}\//);let _="Javascript/js",$="system.adapter.javascript.0",S=!1,T=!1,E=!1;if(v){const G=v[1];$=v[2],S=v[3]==="true",T=v[4]==="true",E=v[5]==="true",G==="ts"?_="TypeScript/ts":G==="blockly"?_="Blockly":G==="rules"&&(_="Rules")}const D=h.replace(/\.\w+$/,"").replace(/\//g,"."),M=`script.js.${D}`,P=D.split(".").pop()||D,W=M.split(".");for(let G=3;G{d==="permissionError"?this.showJsError(x.I18n.t(d)):!d||d.error?this.showJsError(d?x.I18n.t(d.error||""):x.I18n.t("Unknown error")):this.showMessage(x.I18n.t("Done"))})}}toggleLogLayout(){window.localStorage.setItem("App.logHorzLayout",this.state.logHorzLayout?"false":"true"),this.setState({logHorzLayout:!this.state.logHorzLayout})}renderEditor(){var i;const s=Object.keys(this.scripts).reduce((r,l)=>r+(this.scripts[l].common.engineType==="Rules"?1:0),0);return m.jsx(On,{scriptsHash:this.state.scriptsHash,debugMode:this.state.debugMode,onDebugModeChange:r=>{r?this.setState({debugMode:!0}):this.setState({debugMode:!1,debugInstance:null})},visible:!this.state.resizing,socket:this.socket,adapterName:this.adapterName,onLocate:r=>this.setState({menuSelectId:r}),password:this.state.password,runningInstances:this.state.runningInstances,menuOpened:this.state.menuOpened,searchText:this.state.searchText,themeType:this.state.themeType,themeName:this.state.themeName,theme:this.state.theme,expertMode:this.state.expertMode,onChange:(r,l)=>this.onUpdateScript(r,l),isAnyRulesExists:s,debugInstance:this.state.debugInstance,onSelectedChange:(r,l)=>{const c={};let d=!1;r!==this.state.selected&&(d=!0,c.selected=r),JSON.stringify(l)!==JSON.stringify(this.state.editing)&&(d=!0,c.editing=[...l]),d&&this.setState(c)},onRestart:r=>this.socket.extendObject(r,{common:{enabled:!0}}),selected:this.state.selected&&((i=this.scripts[this.state.selected])==null?void 0:i.type)==="script"?this.state.selected:"",objects:this.scripts,resizing:this.state.resizing,onChangedChanged:r=>this.changedScripts=r},"editor")}showLogButton(){return m.jsx(wt,{title:x.I18n.t("Show logs"),sx:Gr.showLogButton,onClick:()=>{window.localStorage.setItem("App.hideLog","false"),this.setState({hideLog:!1,resizing:!0}),setTimeout(()=>this.setState({resizing:!1}),300)},children:m.jsx(SS,{})},"showLog")}renderErrorDialog(){return this.state.errorText?m.jsx(su,{onClose:()=>this.setState({errorText:""}),text:this.state.errorText},"dialogError"):null}renderMain(){let s;return this.state.debugMode||this.state.hideLog?s=m.jsxs(m.Fragment,{children:[!this.state.debugMode&&this.state.hideLog?this.showLogButton():void 0,this.renderEditor()]}):s=m.jsxs(d_,{direction:this.state.logHorzLayout?ft.Horizontal:ft.Vertical,initialSizes:this.state.logSizes,minWidths:[500,100],minHeights:[150,50],onResizeStarted:()=>this.setState({resizing:!0}),onResizeFinished:(i,r)=>{this.setState({logSizes:r,resizing:!1}),window.localStorage.setItem("JS.logSizes",JSON.stringify(r))},gutterClassName:this.state.themeType==="dark"?"Dark visGutter":"Light visGutter",children:[this.renderEditor(),m.jsx(wm,{verticalLayout:!this.state.logHorzLayout,onLayoutChange:()=>this.toggleLogLayout(),editing:this.state.editing,socket:this.socket,selected:this.state.selected,onHideLog:()=>{window.localStorage.setItem("App.hideLog","true"),this.setState({hideLog:!0,resizing:!0}),setTimeout(()=>this.setState({resizing:!1}),300)}},"log")]}),m.jsxs(wt,{sx:Gr.content,className:"iobVerticalSplitter",children:[m.jsx(wt,{sx:Gr.menuOpenCloseButton,onClick:()=>{window.localStorage.setItem("App.menuOpened",this.state.menuOpened?"false":"true"),this.setState({menuOpened:!this.state.menuOpened,resizing:!0}),setTimeout(()=>this.setState({resizing:!1}),300)},children:this.state.menuOpened?m.jsx(ES,{}):m.jsx(IS,{})},"closeMenu"),this.state.message?m.jsx(x.Message,{onClose:()=>this.setState({message:""}),text:this.state.message},"dialogMessage"):null,this.renderErrorDialog(),this.state.importFile?m.jsx(Hm,{onClose:(i,r)=>this.onImport(i,r)},"dialogImportFile"):null,this.state.confirm?m.jsx(x.Confirm,{onClose:i=>{this.state.confirm&&this.setState({confirm:""}),this.confirmCallback&&this.confirmCallback(i),this.confirmCallback=null},text:this.state.confirm},"dialogConfirm"):null,this.renderPasswordDialog(),s]},"main")}render(){if(!this.state.ready)return m.jsx(a_,{injectFirst:!0,children:m.jsx(l_,{theme:this.state.theme,children:m.jsx(x.Loader,{themeType:this.state.themeType})})});let s;return this.state.menuOpened?s=m.jsxs(d_,{direction:ft.Horizontal,initialSizes:this.state.splitSizes,minWidths:[270,400],onResizeFinished:(i,r)=>{this.setState({splitSizes:r}),window.localStorage.setItem("JS.splitSizes",JSON.stringify(r))},gutterClassName:this.state.themeType==="dark"?"Dark visGutter":"Light visGutter",children:[m.jsx("div",{style:Gr.mainDiv,children:m.jsx(So,{password:this.state.password,debugMode:this.state.debugMode,onDebugInstance:i=>this.setState({debugInstance:i,debugMode:!!i}),scripts:this.scripts,scriptsHash:this.state.scriptsHash,instances:this.state.instances,onRename:this.onRename.bind(this),socket:this.socket,selectId:this.state.menuSelectId,onEdit:this.onEdit.bind(this),expertMode:this.state.expertMode,themeName:this.state.themeName,onThemeChange:i=>{x.Utils.setThemeName(i);const r=x.Utils.getThemeType(i);this.setState({themeName:i,themeType:r},()=>this.toggleTheme(i))},runningInstances:this.state.runningInstances,onExpertModeChange:i=>this.onExpertModeChange(i),onDelete:this.onDelete.bind(this),onAddNew:this.onAddNew.bind(this),onEnableDisable:this.onEnableDisable.bind(this),onExport:this.onExport.bind(this),width:500,onImport:()=>this.setState({importFile:!0}),onSearch:i=>this.setState({searchText:i}),version:this.props.version,changedScripts:this.changedScripts},"sidemenu")},"menu"),this.renderMain()]}):s=this.renderMain(),m.jsx(a_,{injectFirst:!0,children:m.jsx(l_,{theme:this.state.theme,children:m.jsx("div",{style:Gr.root,children:m.jsx(bR,{socket:this.socket,children:s})})})})}}window.location.hostname==="localhost"||window.location.hostname==="[::1]"||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/);function use(){"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(a=>{a.unregister()})}const dse="9.1.1",RC={version:dse};var Jo;(function(a){a.mouse="mouse",a.touch="touch",a.keyboard="keyboard"})(Jo||(Jo={}));class hse{get delay(){var s;return(s=this.args.delay)!==null&&s!==void 0?s:0}get scrollAngleRanges(){return this.args.scrollAngleRanges}get getDropTargetElementsAtPoint(){return this.args.getDropTargetElementsAtPoint}get ignoreContextMenu(){var s;return(s=this.args.ignoreContextMenu)!==null&&s!==void 0?s:!1}get enableHoverOutsideTarget(){var s;return(s=this.args.enableHoverOutsideTarget)!==null&&s!==void 0?s:!1}get enableKeyboardEvents(){var s;return(s=this.args.enableKeyboardEvents)!==null&&s!==void 0?s:!1}get enableMouseEvents(){var s;return(s=this.args.enableMouseEvents)!==null&&s!==void 0?s:!1}get enableTouchEvents(){var s;return(s=this.args.enableTouchEvents)!==null&&s!==void 0?s:!0}get touchSlop(){return this.args.touchSlop||0}get delayTouchStart(){var s,i,r,l;return(l=(r=(s=this.args)===null||s===void 0?void 0:s.delayTouchStart)!==null&&r!==void 0?r:(i=this.args)===null||i===void 0?void 0:i.delay)!==null&&l!==void 0?l:0}get delayMouseStart(){var s,i,r,l;return(l=(r=(s=this.args)===null||s===void 0?void 0:s.delayMouseStart)!==null&&r!==void 0?r:(i=this.args)===null||i===void 0?void 0:i.delay)!==null&&l!==void 0?l:0}get window(){if(this.context&&this.context.window)return this.context.window;if(typeof window<"u")return window}get document(){var s;if(!((s=this.context)===null||s===void 0)&&s.document)return this.context.document;if(this.window)return this.window.document}get rootElement(){var s;return((s=this.args)===null||s===void 0?void 0:s.rootElement)||this.document}constructor(s,i){this.args=s,this.context=i}}function pse(a,s,i,r){return Math.sqrt(Math.pow(Math.abs(i-a),2)+Math.pow(Math.abs(r-s),2))}function gse(a,s,i,r,l){if(!l)return!1;const c=Math.atan2(r-s,i-a)*180/Math.PI+180;for(let d=0;d=h.start)&&(h.end==null||c<=h.end))return!0}return!1}const mse={Left:1},fse={Left:0};function Eg(a){return a.button===void 0||a.button===fse.Left}function $se(a){return a.buttons===void 0||(a.buttons&mse.Left)===0}function NC(a){return!!a.targetTouches}const bse=1;function vse(a){const s=a.nodeType===bse?a:a.parentElement;if(!s)return;const{top:i,left:r}=s.getBoundingClientRect();return{x:r,y:i}}function yse(a,s){if(a.targetTouches.length===1)return Kc(a.targetTouches[0]);if(s&&a.touches.length===1&&a.touches[0].target===s.target)return Kc(a.touches[0])}function Kc(a,s){return NC(a)?yse(a,s):{x:a.clientX,y:a.clientY}}const kw=(()=>{let a=!1;try{addEventListener("test",()=>{},Object.defineProperty({},"passive",{get(){return a=!0,!0}}))}catch{}return a})(),Vr={[Jo.mouse]:{start:"mousedown",move:"mousemove",end:"mouseup",contextmenu:"contextmenu"},[Jo.touch]:{start:"touchstart",move:"touchmove",end:"touchend"},[Jo.keyboard]:{keydown:"keydown"}};class Zr{profile(){var s;return{sourceNodes:this.sourceNodes.size,sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,targetNodes:this.targetNodes.size,dragOverTargetIds:((s=this.dragOverTargetIds)===null||s===void 0?void 0:s.length)||0}}get document(){return this.options.document}setup(){const s=this.options.rootElement;s&&(Ve(!Zr.isSetUp,"Cannot have two Touch backends at the same time."),Zr.isSetUp=!0,this.addEventListener(s,"start",this.getTopMoveStartHandler()),this.addEventListener(s,"start",this.handleTopMoveStartCapture,!0),this.addEventListener(s,"move",this.handleTopMove),this.addEventListener(s,"move",this.handleTopMoveCapture,!0),this.addEventListener(s,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.addEventListener(s,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.addEventListener(s,"keydown",this.handleCancelOnEscape,!0))}teardown(){const s=this.options.rootElement;s&&(Zr.isSetUp=!1,this._mouseClientOffset={},this.removeEventListener(s,"start",this.handleTopMoveStartCapture,!0),this.removeEventListener(s,"start",this.handleTopMoveStart),this.removeEventListener(s,"move",this.handleTopMoveCapture,!0),this.removeEventListener(s,"move",this.handleTopMove),this.removeEventListener(s,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.removeEventListener(s,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.removeEventListener(s,"keydown",this.handleCancelOnEscape,!0),this.uninstallSourceNodeRemovalObserver())}addEventListener(s,i,r,l=!1){const c=kw?{capture:l,passive:!1}:l;this.listenerTypes.forEach(function(d){const h=Vr[d][i];h&&s.addEventListener(h,r,c)})}removeEventListener(s,i,r,l=!1){const c=kw?{capture:l,passive:!1}:l;this.listenerTypes.forEach(function(d){const h=Vr[d][i];h&&s.removeEventListener(h,r,c)})}connectDragSource(s,i){const r=this.handleMoveStart.bind(this,s);return this.sourceNodes.set(s,i),this.addEventListener(i,"start",r),()=>{this.sourceNodes.delete(s),this.removeEventListener(i,"start",r)}}connectDragPreview(s,i,r){return this.sourcePreviewNodeOptions.set(s,r),this.sourcePreviewNodes.set(s,i),()=>{this.sourcePreviewNodes.delete(s),this.sourcePreviewNodeOptions.delete(s)}}connectDropTarget(s,i){const r=this.options.rootElement;if(!this.document||!r)return()=>{};const l=c=>{if(!this.document||!r||!this.monitor.isDragging())return;let d;switch(c.type){case Vr.mouse.move:d={x:c.clientX,y:c.clientY};break;case Vr.touch.move:var h,p;d={x:((h=c.touches[0])===null||h===void 0?void 0:h.clientX)||0,y:((p=c.touches[0])===null||p===void 0?void 0:p.clientY)||0};break}const f=d!=null?this.document.elementFromPoint(d.x,d.y):void 0,b=f&&i.contains(f);if(f===i||b)return this.handleMove(c,s)};return this.addEventListener(this.document.body,"move",l),this.targetNodes.set(s,i),()=>{this.document&&(this.targetNodes.delete(s),this.removeEventListener(this.document.body,"move",l))}}getTopMoveStartHandler(){return!this.options.delayTouchStart&&!this.options.delayMouseStart?this.handleTopMoveStart:this.handleTopMoveStartDelay}installSourceNodeRemovalObserver(s){this.uninstallSourceNodeRemovalObserver(),this.draggedSourceNode=s,this.draggedSourceNodeRemovalObserver=new MutationObserver(()=>{s&&!s.parentElement&&(this.resurrectSourceNode(),this.uninstallSourceNodeRemovalObserver())}),!(!s||!s.parentElement)&&this.draggedSourceNodeRemovalObserver.observe(s.parentElement,{childList:!0})}resurrectSourceNode(){this.document&&this.draggedSourceNode&&(this.draggedSourceNode.style.display="none",this.draggedSourceNode.removeAttribute("data-reactid"),this.document.body.appendChild(this.draggedSourceNode))}uninstallSourceNodeRemovalObserver(){this.draggedSourceNodeRemovalObserver&&this.draggedSourceNodeRemovalObserver.disconnect(),this.draggedSourceNodeRemovalObserver=void 0,this.draggedSourceNode=void 0}constructor(s,i,r){this.getSourceClientOffset=l=>{const c=this.sourceNodes.get(l);return c&&vse(c)},this.handleTopMoveStartCapture=l=>{Eg(l)&&(this.moveStartSourceIds=[])},this.handleMoveStart=l=>{Array.isArray(this.moveStartSourceIds)&&this.moveStartSourceIds.unshift(l)},this.handleTopMoveStart=l=>{if(!Eg(l))return;const c=Kc(l);c&&(NC(l)&&(this.lastTargetTouchFallback=l.targetTouches[0]),this._mouseClientOffset=c),this.waitingForDelay=!1},this.handleTopMoveStartDelay=l=>{if(!Eg(l))return;const c=l.type===Vr.touch.start?this.options.delayTouchStart:this.options.delayMouseStart;this.timeout=setTimeout(this.handleTopMoveStart.bind(this,l),c),this.waitingForDelay=!0},this.handleTopMoveCapture=()=>{this.dragOverTargetIds=[]},this.handleMove=(l,c)=>{this.dragOverTargetIds&&this.dragOverTargetIds.unshift(c)},this.handleTopMove=l=>{if(this.timeout&&clearTimeout(this.timeout),!this.document||this.waitingForDelay)return;const{moveStartSourceIds:c,dragOverTargetIds:d}=this,h=this.options.enableHoverOutsideTarget,p=Kc(l,this.lastTargetTouchFallback);if(!p)return;if(this._isScrolling||!this.monitor.isDragging()&&gse(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,p.x,p.y,this.options.scrollAngleRanges)){this._isScrolling=!0;return}if(!this.monitor.isDragging()&&this._mouseClientOffset.hasOwnProperty("x")&&c&&pse(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,p.x,p.y)>(this.options.touchSlop?this.options.touchSlop:0)&&(this.moveStartSourceIds=void 0,this.actions.beginDrag(c,{clientOffset:this._mouseClientOffset,getSourceClientOffset:this.getSourceClientOffset,publishSource:!1})),!this.monitor.isDragging())return;const f=this.sourceNodes.get(this.monitor.getSourceId());this.installSourceNodeRemovalObserver(f),this.actions.publishDragSource(),l.cancelable&&l.preventDefault();const b=(d||[]).map(_=>this.targetNodes.get(_)).filter(_=>!!_),y=this.options.getDropTargetElementsAtPoint?this.options.getDropTargetElementsAtPoint(p.x,p.y,b):this.document.elementsFromPoint(p.x,p.y),w=[];for(const _ in y){if(!y.hasOwnProperty(_))continue;let $=y[_];for($!=null&&w.push($);$;)$=$.parentElement,$&&w.indexOf($)===-1&&w.push($)}const v=w.filter(_=>b.indexOf(_)>-1).map(_=>this._getDropTargetId(_)).filter(_=>!!_).filter((_,$,S)=>S.indexOf(_)===$);if(h)for(const _ in this.targetNodes){const $=this.targetNodes.get(_);if(f&&$&&$.contains(f)&&v.indexOf(_)===-1){v.unshift(_);break}}v.reverse(),this.actions.hover(v,{clientOffset:p})},this._getDropTargetId=l=>{const c=this.targetNodes.keys();let d=c.next();for(;d.done===!1;){const h=d.value;if(l===this.targetNodes.get(h))return h;d=c.next()}},this.handleTopMoveEndCapture=l=>{if(this._isScrolling=!1,this.lastTargetTouchFallback=void 0,!!$se(l)){if(!this.monitor.isDragging()||this.monitor.didDrop()){this.moveStartSourceIds=void 0;return}l.cancelable&&l.preventDefault(),this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.drop(),this.actions.endDrag()}},this.handleCancelOnEscape=l=>{l.key==="Escape"&&this.monitor.isDragging()&&(this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.endDrag())},this.options=new hse(r,i),this.actions=s.getActions(),this.monitor=s.getMonitor(),this.sourceNodes=new Map,this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.targetNodes=new Map,this.listenerTypes=[],this._mouseClientOffset={},this._isScrolling=!1,this.options.enableMouseEvents&&this.listenerTypes.push(Jo.mouse),this.options.enableTouchEvents&&this.listenerTypes.push(Jo.touch),this.options.enableKeyboardEvents&&this.listenerTypes.push(Jo.keyboard)}}const _se=function(s,i={},r={}){return new Zr(s,i,r)};window.GenericBlock=at;window.adapterName="javascript";window.sentryDSN="https://504499a725eb4898930d3b9e9da95740@sentry.iobroker.net/56";console.log(`iobroker.${window.adapterName}@${RC.version}`);const wse=window.innerWidth<600,Cw=document.getElementById("root");Cw&&Fw(Cw).render(m.jsx(ek,{backend:wse?_se:hk,children:m.jsx(cse,{version:RC.version})}));use();const gc=window.loadDynamicScript;gc&&gc(window.location.port==="3000"?`${window.location.protocol}//${window.location.hostname}:8081/lib/js/socket.io.js`:"./../../lib/js/socket.io.js",()=>gc("vs/loader.js",()=>gc("vs/configure.js",()=>typeof window.socketLoadedHandler=="function"&&window.socketLoadedHandler())));export{$R as C,sO as D,at as G,pk as I,fw as M,Ns as S,$I as a,LI as b,WI as c,Ei as d,pne as e,Gm as f,su as g,cx as h,gne as j,d_ as m,zn as u,ft as z}; diff --git a/admin/assets/index-DnqTM0A3.js b/admin/assets/index-C9EIOjDT.js similarity index 99% rename from admin/assets/index-DnqTM0A3.js rename to admin/assets/index-C9EIOjDT.js index c169b4807..72e08a5c7 100644 --- a/admin/assets/index-DnqTM0A3.js +++ b/admin/assets/index-C9EIOjDT.js @@ -1,4 +1,4 @@ -import{j as M}from"./createSvgIcon-DPvF8xqu.js";import{a as ft}from"./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js";import{m as Rt,z as Bt,g as Ut}from"./index-_UYoIw1I.js";import{z as Ze,o as Te,v as Nt,w as Mt,s as Lt,u as Vt,r as zt,_ as Ht,a as Gt,C as Pt,D as _t,F as Yt,G as wt,H as Qt}from"./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js";import{M as Zt,k as Xt,l as ea,O as Tt,S as ta,J as aa,n as ra,t as na,v as sa,u as oa,T as ia,U as la,V as ca,W as ua}from"./index-C49cpVll.js";import{_ as we}from"./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js";import pa from"./ScriptEditorVanillaMonaco-DSYvOslZ.js";import{r as fa}from"./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js";function da(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}import"./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js";import"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js";import"./preload-helper-BDBacUwf.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js";import"./inheritsLoose-B0Ba5G9z.js";const ba={editorDiv:{height:"100%",width:"100%",overflow:"hidden",position:"relative"}};class ha extends ft.Component{constructor(v){super(v),this.state={lines:(this.props.script||"").split(/\r\n|\n/)}}render(){return M.jsx("div",{style:ba.editorDiv,children:M.jsx(pa,{triggerPrettier:1,name:this.props.scriptName,adapterName:this.props.adapterName,readOnly:!0,code:this.props.script||"",isDark:this.props.themeType==="dark",socket:this.props.socket,runningInstances:this.props.runningInstances,language:"javascript",breakpoints:this.props.breakpoints,location:this.props.paused?this.props.location:null,onToggleBreakpoint:v=>this.props.onToggleBreakpoint(v)},"scriptEditor2")},"scriptEditorDiv2")}}const Dt=34,Ke={logBox:{width:"100%",height:"100%",position:"relative",overflow:"hidden"},logBoxInner:Z=>({display:"inline-block",color:Z.palette.mode==="dark"?"white":"black",width:`calc(100% - ${Dt}px)`,height:"100%",overflow:"auto",position:"relative",verticalAlign:"top"}),info:Z=>({background:Z.palette.mode==="dark"?"darkgrey":"lightgrey",color:(Z.palette.mode==="dark","black")}),error:Z=>({background:"#FF0000",color:Z.palette.mode==="dark"?"black":"white"}),warn:Z=>({background:"#FF8000",color:Z.palette.mode==="dark"?"black":"white"}),debug:Z=>({background:"gray",opacity:.8,color:Z.palette.mode==="dark"?"black":"white"}),silly:Z=>({background:"gray",opacity:.6,color:Z.palette.mode==="dark"?"black":"white"}),table:{fontFamily:"monospace",width:"100%"},toolbox:{width:Dt,height:"100%",boxShadow:"2px 0px 4px -1px rgba(0, 0, 0, 0.2), 4px 0px 5px 0px rgba(0, 0, 0, 0.14), 1px 0px 10px 0px rgba(0, 0, 0, 0.12)",display:"inline-block",verticalAlign:"top",overflow:"hidden"},trTime:{width:90},trSeverity:{width:40,fontWeight:"bold"},iconButtons:{width:32,height:32,padding:4}};function ma(Z){let v,g=Z.getHours();return g<10&&(g=`0${g.toString()}`),v=`${g}:`,g=Z.getMinutes(),g<10&&(g=`0${g.toString()}`),v+=`${g}:`,g=Z.getSeconds(),g<10&&(g=`0${g.toString()}`),v+=`${g}.`,g=Z.getMilliseconds(),g<10?g=`00${g.toString()}`:g<100&&(g=`0${g.toString()}`),v+=g,v}class Ct extends ft.Component{messagesEnd;constructor(v){super(v),this.state={goBottom:!0},this.messagesEnd=ft.createRef()}static generateLine(v){return M.jsxs(Ze,{component:"tr",sx:Ke[v.severity],children:[M.jsx("td",{style:Ke.trTime,children:ma(new Date(v.ts))}),M.jsx("td",{style:Ke.trSeverity,children:v.severity}),M.jsx("td",{children:v.text})]},`tr_${v.ts}_${v.text.substring(v.text.length-10,v.text.length)}`)}renderLogList(v){return v!=null&&v.length?M.jsxs(Ze,{sx:Ke.logBoxInner,children:[M.jsx("table",{style:Ke.table,children:M.jsx("tbody",{children:v.map(g=>Ct.generateLine(g))})},"logTable"),M.jsx("div",{ref:this.messagesEnd,style:{float:"left",clear:"both"}},"logScrollPoint")]},"logList"):M.jsx(Ze,{sx:Ke.logBoxInner,style:{paddingLeft:10},children:we.I18n.t("Log outputs")},"logList")}onCopy(){we.Utils.copyToClipboard(this.props.console.join(` +import{j as M}from"./createSvgIcon-DPvF8xqu.js";import{a as ft}from"./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js";import{m as Rt,z as Bt,g as Ut}from"./index-Bm6wEaaB.js";import{z as Ze,o as Te,v as Nt,w as Mt,s as Lt,u as Vt,r as zt,_ as Ht,a as Gt,C as Pt,D as _t,F as Yt,G as wt,H as Qt}from"./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js";import{M as Zt,k as Xt,l as ea,O as Tt,S as ta,J as aa,n as ra,t as na,v as sa,u as oa,T as ia,U as la,V as ca,W as ua}from"./index-C49cpVll.js";import{_ as we}from"./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js";import pa from"./ScriptEditorVanillaMonaco-DSYvOslZ.js";import{r as fa}from"./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js";function da(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}import"./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js";import"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js";import"./preload-helper-BDBacUwf.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js";import"./inheritsLoose-B0Ba5G9z.js";const ba={editorDiv:{height:"100%",width:"100%",overflow:"hidden",position:"relative"}};class ha extends ft.Component{constructor(v){super(v),this.state={lines:(this.props.script||"").split(/\r\n|\n/)}}render(){return M.jsx("div",{style:ba.editorDiv,children:M.jsx(pa,{triggerPrettier:1,name:this.props.scriptName,adapterName:this.props.adapterName,readOnly:!0,code:this.props.script||"",isDark:this.props.themeType==="dark",socket:this.props.socket,runningInstances:this.props.runningInstances,language:"javascript",breakpoints:this.props.breakpoints,location:this.props.paused?this.props.location:null,onToggleBreakpoint:v=>this.props.onToggleBreakpoint(v)},"scriptEditor2")},"scriptEditorDiv2")}}const Dt=34,Ke={logBox:{width:"100%",height:"100%",position:"relative",overflow:"hidden"},logBoxInner:Z=>({display:"inline-block",color:Z.palette.mode==="dark"?"white":"black",width:`calc(100% - ${Dt}px)`,height:"100%",overflow:"auto",position:"relative",verticalAlign:"top"}),info:Z=>({background:Z.palette.mode==="dark"?"darkgrey":"lightgrey",color:(Z.palette.mode==="dark","black")}),error:Z=>({background:"#FF0000",color:Z.palette.mode==="dark"?"black":"white"}),warn:Z=>({background:"#FF8000",color:Z.palette.mode==="dark"?"black":"white"}),debug:Z=>({background:"gray",opacity:.8,color:Z.palette.mode==="dark"?"black":"white"}),silly:Z=>({background:"gray",opacity:.6,color:Z.palette.mode==="dark"?"black":"white"}),table:{fontFamily:"monospace",width:"100%"},toolbox:{width:Dt,height:"100%",boxShadow:"2px 0px 4px -1px rgba(0, 0, 0, 0.2), 4px 0px 5px 0px rgba(0, 0, 0, 0.14), 1px 0px 10px 0px rgba(0, 0, 0, 0.12)",display:"inline-block",verticalAlign:"top",overflow:"hidden"},trTime:{width:90},trSeverity:{width:40,fontWeight:"bold"},iconButtons:{width:32,height:32,padding:4}};function ma(Z){let v,g=Z.getHours();return g<10&&(g=`0${g.toString()}`),v=`${g}:`,g=Z.getMinutes(),g<10&&(g=`0${g.toString()}`),v+=`${g}:`,g=Z.getSeconds(),g<10&&(g=`0${g.toString()}`),v+=`${g}.`,g=Z.getMilliseconds(),g<10?g=`00${g.toString()}`:g<100&&(g=`0${g.toString()}`),v+=g,v}class Ct extends ft.Component{messagesEnd;constructor(v){super(v),this.state={goBottom:!0},this.messagesEnd=ft.createRef()}static generateLine(v){return M.jsxs(Ze,{component:"tr",sx:Ke[v.severity],children:[M.jsx("td",{style:Ke.trTime,children:ma(new Date(v.ts))}),M.jsx("td",{style:Ke.trSeverity,children:v.severity}),M.jsx("td",{children:v.text})]},`tr_${v.ts}_${v.text.substring(v.text.length-10,v.text.length)}`)}renderLogList(v){return v!=null&&v.length?M.jsxs(Ze,{sx:Ke.logBoxInner,children:[M.jsx("table",{style:Ke.table,children:M.jsx("tbody",{children:v.map(g=>Ct.generateLine(g))})},"logTable"),M.jsx("div",{ref:this.messagesEnd,style:{float:"left",clear:"both"}},"logScrollPoint")]},"logList"):M.jsx(Ze,{sx:Ke.logBoxInner,style:{paddingLeft:10},children:we.I18n.t("Log outputs")},"logList")}onCopy(){we.Utils.copyToClipboard(this.props.console.join(` `))}scrollToBottom(){var v,g;(g=(v=this.messagesEnd)==null?void 0:v.current)==null||g.scrollIntoView({behavior:"smooth"})}componentDidUpdate(){this.state.goBottom&&this.scrollToBottom()}render(){const v=this.props.console;return M.jsxs("div",{style:Ke.logBox,children:[M.jsxs("div",{style:Ke.toolbox,children:[M.jsx(Te,{style:Ke.iconButtons,onClick:()=>this.setState({goBottom:!this.state.goBottom}),color:this.state.goBottom?"secondary":void 0,size:"medium",children:M.jsx(Zt,{})}),v!=null&&v.length?M.jsx(Te,{style:Ke.iconButtons,onClick:()=>this.props.onClearAllLogs(),size:"medium",children:M.jsx(Xt,{})}):null,v!=null&&v.length?M.jsx(Te,{style:Ke.iconButtons,onClick:()=>this.onCopy(),size:"medium",children:M.jsx(ea,{})}):null]},"toolbox"),this.renderLogList(v)]})}}var It={exports:{}},va=It.exports;(function(Z,v){(function(g,a){Z.exports=a(fa)})(va,(function(g){return(function(a){var t={};function e(s){if(t[s])return t[s].exports;var c=t[s]={i:s,l:!1,exports:{}};return a[s].call(c.exports,c,c.exports,e),c.l=!0,c.exports}return e.m=a,e.c=t,e.d=function(s,c,d){e.o(s,c)||Object.defineProperty(s,c,{enumerable:!0,get:d})},e.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},e.t=function(s,c){if(1&c&&(s=e(s)),8&c||4&c&&typeof s=="object"&&s&&s.__esModule)return s;var d=Object.create(null);if(e.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:s}),2&c&&typeof s!="string")for(var p in s)e.d(d,p,function(f){return s[f]}.bind(null,p));return d},e.n=function(s){var c=s&&s.__esModule?function(){return s.default}:function(){return s};return e.d(c,"a",c),c},e.o=function(s,c){return Object.prototype.hasOwnProperty.call(s,c)},e.p="",e(e.s=48)})([function(a,t){a.exports=g},function(a,t){var e=a.exports={version:"2.6.12"};typeof __e=="number"&&(__e=e)},function(a,t,e){var s=e(26)("wks"),c=e(17),d=e(3).Symbol,p=typeof d=="function";(a.exports=function(f){return s[f]||(s[f]=p&&d[f]||(p?d:c)("Symbol."+f))}).store=s},function(a,t){var e=a.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=e)},function(a,t,e){a.exports=!e(8)((function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7}))},function(a,t){var e={}.hasOwnProperty;a.exports=function(s,c){return e.call(s,c)}},function(a,t,e){var s=e(7),c=e(16);a.exports=e(4)?function(d,p,f){return s.f(d,p,c(1,f))}:function(d,p,f){return d[p]=f,d}},function(a,t,e){var s=e(10),c=e(35),d=e(23),p=Object.defineProperty;t.f=e(4)?Object.defineProperty:function(f,h,S){if(s(f),h=d(h,!0),s(S),c)try{return p(f,h,S)}catch{}if("get"in S||"set"in S)throw TypeError("Accessors not supported!");return"value"in S&&(f[h]=S.value),f}},function(a,t){a.exports=function(e){try{return!!e()}catch{return!0}}},function(a,t,e){var s=e(40),c=e(22);a.exports=function(d){return s(c(d))}},function(a,t,e){var s=e(11);a.exports=function(c){if(!s(c))throw TypeError(c+" is not an object!");return c}},function(a,t){a.exports=function(e){return typeof e=="object"?e!==null:typeof e=="function"}},function(a,t){a.exports={}},function(a,t,e){var s=e(39),c=e(27);a.exports=Object.keys||function(d){return s(d,c)}},function(a,t){a.exports=!0},function(a,t,e){var s=e(3),c=e(1),d=e(53),p=e(6),f=e(5),h=function(S,b,w){var I,R,H,L=S&h.F,X=S&h.G,r=S&h.S,D=S&h.P,V=S&h.B,z=S&h.W,q=X?c:c[b]||(c[b]={}),k=q.prototype,A=X?s:r?s[b]:(s[b]||{}).prototype;for(I in X&&(w=b),w)(R=!L&&A&&A[I]!==void 0)&&f(q,I)||(H=R?A[I]:w[I],q[I]=X&&typeof A[I]!="function"?w[I]:V&&R?d(H,s):z&&A[I]==H?(function(T){var W=function(E,ee,J){if(this instanceof T){switch(arguments.length){case 0:return new T;case 1:return new T(E);case 2:return new T(E,ee)}return new T(E,ee,J)}return T.apply(this,arguments)};return W.prototype=T.prototype,W})(H):D&&typeof H=="function"?d(Function.call,H):H,D&&((q.virtual||(q.virtual={}))[I]=H,S&h.R&&k&&!k[I]&&p(k,I,H)))};h.F=1,h.G=2,h.S=4,h.P=8,h.B=16,h.W=32,h.U=64,h.R=128,a.exports=h},function(a,t){a.exports=function(e,s){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:s}}},function(a,t){var e=0,s=Math.random();a.exports=function(c){return"Symbol(".concat(c===void 0?"":c,")_",(++e+s).toString(36))}},function(a,t,e){var s=e(22);a.exports=function(c){return Object(s(c))}},function(a,t){t.f={}.propertyIsEnumerable},function(a,t,e){var s=e(52)(!0);e(34)(String,"String",(function(c){this._t=String(c),this._i=0}),(function(){var c,d=this._t,p=this._i;return p>=d.length?{value:void 0,done:!0}:(c=s(d,p),this._i+=c.length,{value:c,done:!1})}))},function(a,t){var e=Math.ceil,s=Math.floor;a.exports=function(c){return isNaN(c=+c)?0:(c>0?s:e)(c)}},function(a,t){a.exports=function(e){if(e==null)throw TypeError("Can't call method on "+e);return e}},function(a,t,e){var s=e(11);a.exports=function(c,d){if(!s(c))return c;var p,f;if(d&&typeof(p=c.toString)=="function"&&!s(f=p.call(c))||typeof(p=c.valueOf)=="function"&&!s(f=p.call(c))||!d&&typeof(p=c.toString)=="function"&&!s(f=p.call(c)))return f;throw TypeError("Can't convert object to primitive value")}},function(a,t){var e={}.toString;a.exports=function(s){return e.call(s).slice(8,-1)}},function(a,t,e){var s=e(26)("keys"),c=e(17);a.exports=function(d){return s[d]||(s[d]=c(d))}},function(a,t,e){var s=e(1),c=e(3),d=c["__core-js_shared__"]||(c["__core-js_shared__"]={});(a.exports=function(p,f){return d[p]||(d[p]=f!==void 0?f:{})})("versions",[]).push({version:s.version,mode:e(14)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(a,t){a.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(a,t,e){var s=e(7).f,c=e(5),d=e(2)("toStringTag");a.exports=function(p,f,h){p&&!c(p=h?p:p.prototype,d)&&s(p,d,{configurable:!0,value:f})}},function(a,t,e){e(62);for(var s=e(3),c=e(6),d=e(12),p=e(2)("toStringTag"),f="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),h=0;hdocument.F=Object<\/script>"),S.close(),h=S.F;w--;)delete h.prototype[d[w]];return h()};a.exports=Object.create||function(S,b){var w;return S!==null?(f.prototype=s(S),w=new f,f.prototype=null,w[p]=S):w=h(),b===void 0?w:c(w,b)}},function(a,t,e){var s=e(5),c=e(9),d=e(57)(!1),p=e(25)("IE_PROTO");a.exports=function(f,h){var S,b=c(f),w=0,I=[];for(S in b)S!=p&&s(b,S)&&I.push(S);for(;h.length>w;)s(b,S=h[w++])&&(~d(I,S)||I.push(S));return I}},function(a,t,e){var s=e(24);a.exports=Object("z").propertyIsEnumerable(0)?Object:function(c){return s(c)=="String"?c.split(""):Object(c)}},function(a,t,e){var s=e(39),c=e(27).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(d){return s(d,c)}},function(a,t,e){var s=e(24),c=e(2)("toStringTag"),d=s((function(){return arguments})())=="Arguments";a.exports=function(p){var f,h,S;return p===void 0?"Undefined":p===null?"Null":typeof(h=(function(b,w){try{return b[w]}catch{}})(f=Object(p),c))=="string"?h:d?s(f):(S=s(f))=="Object"&&typeof f.callee=="function"?"Arguments":S}},function(a,t){var e;e=(function(){return this})();try{e=e||new Function("return this")()}catch{typeof window=="object"&&(e=window)}a.exports=e},function(a,t){var e=/-?\d+(\.\d+)?%?/g;a.exports=function(s){return s.match(e)}},function(a,t,e){Object.defineProperty(t,"__esModule",{value:!0}),t.getBase16Theme=t.createStyling=t.invertTheme=void 0;var s=R(e(49)),c=R(e(76)),d=R(e(81)),p=R(e(89)),f=R(e(93)),h=(function(k){if(k&&k.__esModule)return k;var A={};if(k!=null)for(var T in k)Object.prototype.hasOwnProperty.call(k,T)&&(A[T]=k[T]);return A.default=k,A})(e(94)),S=R(e(132)),b=R(e(133)),w=R(e(138)),I=e(139);function R(k){return k&&k.__esModule?k:{default:k}}var H=h.default,L=(0,p.default)(H),X=(0,w.default)(b.default,I.rgb2yuv,(function(k){var A,T=(0,d.default)(k,3),W=T[0],E=T[1],ee=T[2];return[(A=W,A<.25?1:A<.5?.9-A:1.1-A),E,ee]}),I.yuv2rgb,S.default),r=function(k){return function(A){return{className:[A.className,k.className].filter(Boolean).join(" "),style:(0,c.default)({},A.style||{},k.style||{})}}},D=function(k,A){var T=(0,p.default)(A);for(var W in k)T.indexOf(W)===-1&&T.push(W);return T.reduce((function(E,ee){return E[ee]=(function(J,C){if(J===void 0)return C;if(C===void 0)return J;var Y=J===void 0?"undefined":(0,s.default)(J),be=C===void 0?"undefined":(0,s.default)(C);switch(Y){case"string":switch(be){case"string":return[C,J].filter(Boolean).join(" ");case"object":return r({className:J,style:C});case"function":return function(ce){for(var U=arguments.length,le=Array(U>1?U-1:0),Q=1;Q1?U-1:0),Q=1;Q1?U-1:0),Q=1;Q1?U-1:0),Q=1;Q1?U-1:0),Q=1;Q2?T-2:0),E=2;E3?A-3:0),W=3;W1&&arguments[1]!==void 0?arguments[1]:{},ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},J=E.defaultBase16,C=J===void 0?H:J,Y=E.base16Themes,be=Y===void 0?null:Y,ce=q(ee,be);ce&&(ee=(0,c.default)({},ce,ee));var U=L.reduce((function(ve,Ne){return ve[Ne]=ee[Ne]||C[Ne],ve}),{}),le=(0,p.default)(ee).reduce((function(ve,Ne){return L.indexOf(Ne)===-1&&(ve[Ne]=ee[Ne]),ve}),{}),Q=k(U),he=D(le,Q);return(0,f.default)(V,2).apply(void 0,[he].concat(T))}),3),t.getBase16Theme=function(k,A){if(k&&k.extend&&(k=k.extend),typeof k=="string"){var T=k.split(":"),W=(0,d.default)(T,2),E=W[0],ee=W[1];k=(A||{})[E]||h[E],ee==="inverted"&&(k=z(k))}return k&&k.hasOwnProperty("base00")?k:void 0})},function(a,t,e){var s,c=typeof Reflect=="object"?Reflect:null,d=c&&typeof c.apply=="function"?c.apply:function(r,D,V){return Function.prototype.apply.call(r,D,V)};s=c&&typeof c.ownKeys=="function"?c.ownKeys:Object.getOwnPropertySymbols?function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:function(r){return Object.getOwnPropertyNames(r)};var p=Number.isNaN||function(r){return r!=r};function f(){f.init.call(this)}a.exports=f,a.exports.once=function(r,D){return new Promise((function(V,z){function q(){k!==void 0&&r.removeListener("error",k),V([].slice.call(arguments))}var k;D!=="error"&&(k=function(A){r.removeListener(D,q),z(A)},r.once("error",k)),r.once(D,q)}))},f.EventEmitter=f,f.prototype._events=void 0,f.prototype._eventsCount=0,f.prototype._maxListeners=void 0;var h=10;function S(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}function b(r){return r._maxListeners===void 0?f.defaultMaxListeners:r._maxListeners}function w(r,D,V,z){var q,k,A,T;if(S(V),(k=r._events)===void 0?(k=r._events=Object.create(null),r._eventsCount=0):(k.newListener!==void 0&&(r.emit("newListener",D,V.listener?V.listener:V),k=r._events),A=k[D]),A===void 0)A=k[D]=V,++r._eventsCount;else if(typeof A=="function"?A=k[D]=z?[V,A]:[A,V]:z?A.unshift(V):A.push(V),(q=b(r))>0&&A.length>q&&!A.warned){A.warned=!0;var W=new Error("Possible EventEmitter memory leak detected. "+A.length+" "+String(D)+" listeners added. Use emitter.setMaxListeners() to increase limit");W.name="MaxListenersExceededWarning",W.emitter=r,W.type=D,W.count=A.length,T=W,console&&console.warn&&console.warn(T)}return r}function I(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function R(r,D,V){var z={fired:!1,wrapFn:void 0,target:r,type:D,listener:V},q=I.bind(z);return q.listener=V,z.wrapFn=q,q}function H(r,D,V){var z=r._events;if(z===void 0)return[];var q=z[D];return q===void 0?[]:typeof q=="function"?V?[q.listener||q]:[q]:V?(function(k){for(var A=new Array(k.length),T=0;T0&&(k=D[0]),k instanceof Error)throw k;var A=new Error("Unhandled error."+(k?" ("+k.message+")":""));throw A.context=k,A}var T=q[r];if(T===void 0)return!1;if(typeof T=="function")d(T,this,D);else{var W=T.length,E=X(T,W);for(V=0;V=0;k--)if(V[k]===D||V[k].listener===D){A=V[k].listener,q=k;break}if(q<0)return this;q===0?V.shift():(function(T,W){for(;W+1=0;z--)this.removeListener(r,D[z]);return this},f.prototype.listeners=function(r){return H(this,r,!0)},f.prototype.rawListeners=function(r){return H(this,r,!1)},f.listenerCount=function(r,D){return typeof r.listenerCount=="function"?r.listenerCount(D):L.call(r,D)},f.prototype.listenerCount=L,f.prototype.eventNames=function(){return this._eventsCount>0?s(this._events):[]}},function(a,t,e){a.exports.Dispatcher=e(140)},function(a,t,e){a.exports=e(142)},function(a,t,e){t.__esModule=!0;var s=p(e(50)),c=p(e(65)),d=typeof c.default=="function"&&typeof s.default=="symbol"?function(f){return typeof f}:function(f){return f&&typeof c.default=="function"&&f.constructor===c.default&&f!==c.default.prototype?"symbol":typeof f};function p(f){return f&&f.__esModule?f:{default:f}}t.default=typeof c.default=="function"&&d(s.default)==="symbol"?function(f){return f===void 0?"undefined":d(f)}:function(f){return f&&typeof c.default=="function"&&f.constructor===c.default&&f!==c.default.prototype?"symbol":f===void 0?"undefined":d(f)}},function(a,t,e){a.exports={default:e(51),__esModule:!0}},function(a,t,e){e(20),e(29),a.exports=e(30).f("iterator")},function(a,t,e){var s=e(21),c=e(22);a.exports=function(d){return function(p,f){var h,S,b=String(c(p)),w=s(f),I=b.length;return w<0||w>=I?d?"":void 0:(h=b.charCodeAt(w))<55296||h>56319||w+1===I||(S=b.charCodeAt(w+1))<56320||S>57343?d?b.charAt(w):h:d?b.slice(w,w+2):S-56320+(h-55296<<10)+65536}}},function(a,t,e){var s=e(54);a.exports=function(c,d,p){if(s(c),d===void 0)return c;switch(p){case 1:return function(f){return c.call(d,f)};case 2:return function(f,h){return c.call(d,f,h)};case 3:return function(f,h,S){return c.call(d,f,h,S)}}return function(){return c.apply(d,arguments)}}},function(a,t){a.exports=function(e){if(typeof e!="function")throw TypeError(e+" is not a function!");return e}},function(a,t,e){var s=e(38),c=e(16),d=e(28),p={};e(6)(p,e(2)("iterator"),(function(){return this})),a.exports=function(f,h,S){f.prototype=s(p,{next:c(1,S)}),d(f,h+" Iterator")}},function(a,t,e){var s=e(7),c=e(10),d=e(13);a.exports=e(4)?Object.defineProperties:function(p,f){c(p);for(var h,S=d(f),b=S.length,w=0;b>w;)s.f(p,h=S[w++],f[h]);return p}},function(a,t,e){var s=e(9),c=e(58),d=e(59);a.exports=function(p){return function(f,h,S){var b,w=s(f),I=c(w.length),R=d(S,I);if(p&&h!=h){for(;I>R;)if((b=w[R++])!=b)return!0}else for(;I>R;R++)if((p||R in w)&&w[R]===h)return p||R||0;return!p&&-1}}},function(a,t,e){var s=e(21),c=Math.min;a.exports=function(d){return d>0?c(s(d),9007199254740991):0}},function(a,t,e){var s=e(21),c=Math.max,d=Math.min;a.exports=function(p,f){return(p=s(p))<0?c(p+f,0):d(p,f)}},function(a,t,e){var s=e(3).document;a.exports=s&&s.documentElement},function(a,t,e){var s=e(5),c=e(18),d=e(25)("IE_PROTO"),p=Object.prototype;a.exports=Object.getPrototypeOf||function(f){return f=c(f),s(f,d)?f[d]:typeof f.constructor=="function"&&f instanceof f.constructor?f.constructor.prototype:f instanceof Object?p:null}},function(a,t,e){var s=e(63),c=e(64),d=e(12),p=e(9);a.exports=e(34)(Array,"Array",(function(f,h){this._t=p(f),this._i=0,this._k=h}),(function(){var f=this._t,h=this._k,S=this._i++;return!f||S>=f.length?(this._t=void 0,c(1)):c(0,h=="keys"?S:h=="values"?f[S]:[S,f[S]])}),"values"),d.Arguments=d.Array,s("keys"),s("values"),s("entries")},function(a,t){a.exports=function(){}},function(a,t){a.exports=function(e,s){return{value:s,done:!!e}}},function(a,t,e){a.exports={default:e(66),__esModule:!0}},function(a,t,e){e(67),e(73),e(74),e(75),a.exports=e(1).Symbol},function(a,t,e){var s=e(3),c=e(5),d=e(4),p=e(15),f=e(37),h=e(68).KEY,S=e(8),b=e(26),w=e(28),I=e(17),R=e(2),H=e(30),L=e(31),X=e(69),r=e(70),D=e(10),V=e(11),z=e(18),q=e(9),k=e(23),A=e(16),T=e(38),W=e(71),E=e(72),ee=e(32),J=e(7),C=e(13),Y=E.f,be=J.f,ce=W.f,U=s.Symbol,le=s.JSON,Q=le&&le.stringify,he=R("_hidden"),ve=R("toPrimitive"),Ne={}.propertyIsEnumerable,Ee=b("symbol-registry"),Oe=b("symbols"),fe=b("op-symbols"),ge=Object.prototype,De=typeof U=="function"&&!!ee.f,Ue=s.QObject,Xe=!Ue||!Ue.prototype||!Ue.prototype.findChild,et=d&&S((function(){return T(be({},"a",{get:function(){return be(this,"a",{value:7}).a}})).a!=7}))?function(j,N,B){var K=Y(ge,N);K&&delete ge[N],be(j,N,B),K&&j!==ge&&be(ge,N,K)}:be,tt=function(j){var N=Oe[j]=T(U.prototype);return N._k=j,N},at=De&&typeof U.iterator=="symbol"?function(j){return typeof j=="symbol"}:function(j){return j instanceof U},He=function(j,N,B){return j===ge&&He(fe,N,B),D(j),N=k(N,!0),D(B),c(Oe,N)?(B.enumerable?(c(j,he)&&j[he][N]&&(j[he][N]=!1),B=T(B,{enumerable:A(0,!1)})):(c(j,he)||be(j,he,A(1,{})),j[he][N]=!0),et(j,N,B)):be(j,N,B)},st=function(j,N){D(j);for(var B,K=X(N=q(N)),re=0,te=K.length;te>re;)He(j,B=K[re++],N[B]);return j},ot=function(j){var N=Ne.call(this,j=k(j,!0));return!(this===ge&&c(Oe,j)&&!c(fe,j))&&(!(N||!c(this,j)||!c(Oe,j)||c(this,he)&&this[he][j])||N)},rt=function(j,N){if(j=q(j),N=k(N,!0),j!==ge||!c(Oe,N)||c(fe,N)){var B=Y(j,N);return!B||!c(Oe,N)||c(j,he)&&j[he][N]||(B.enumerable=!0),B}},it=function(j){for(var N,B=ce(q(j)),K=[],re=0;B.length>re;)c(Oe,N=B[re++])||N==he||N==h||K.push(N);return K},Ge=function(j){for(var N,B=j===ge,K=ce(B?fe:q(j)),re=[],te=0;K.length>te;)!c(Oe,N=K[te++])||B&&!c(ge,N)||re.push(Oe[N]);return re};De||(f((U=function(){if(this instanceof U)throw TypeError("Symbol is not a constructor!");var j=I(arguments.length>0?arguments[0]:void 0),N=function(B){this===ge&&N.call(fe,B),c(this,he)&&c(this[he],j)&&(this[he][j]=!1),et(this,j,A(1,B))};return d&&Xe&&et(ge,j,{configurable:!0,set:N}),tt(j)}).prototype,"toString",(function(){return this._k})),E.f=rt,J.f=He,e(41).f=W.f=it,e(19).f=ot,ee.f=Ge,d&&!e(14)&&f(ge,"propertyIsEnumerable",ot,!0),H.f=function(j){return tt(R(j))}),p(p.G+p.W+p.F*!De,{Symbol:U});for(var Ve="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),Ce=0;Ve.length>Ce;)R(Ve[Ce++]);for(var nt=C(R.store),F=0;nt.length>F;)L(nt[F++]);p(p.S+p.F*!De,"Symbol",{for:function(j){return c(Ee,j+="")?Ee[j]:Ee[j]=U(j)},keyFor:function(j){if(!at(j))throw TypeError(j+" is not a symbol!");for(var N in Ee)if(Ee[N]===j)return N},useSetter:function(){Xe=!0},useSimple:function(){Xe=!1}}),p(p.S+p.F*!De,"Object",{create:function(j,N){return N===void 0?T(j):st(T(j),N)},defineProperty:He,defineProperties:st,getOwnPropertyDescriptor:rt,getOwnPropertyNames:it,getOwnPropertySymbols:Ge});var x=S((function(){ee.f(1)}));p(p.S+p.F*x,"Object",{getOwnPropertySymbols:function(j){return ee.f(z(j))}}),le&&p(p.S+p.F*(!De||S((function(){var j=U();return Q([j])!="[null]"||Q({a:j})!="{}"||Q(Object(j))!="{}"}))),"JSON",{stringify:function(j){for(var N,B,K=[j],re=1;arguments.length>re;)K.push(arguments[re++]);if(B=N=K[1],(V(N)||j!==void 0)&&!at(j))return r(N)||(N=function(te,ue){if(typeof B=="function"&&(ue=B.call(this,te,ue)),!at(ue))return ue}),K[1]=N,Q.apply(le,K)}}),U.prototype[ve]||e(6)(U.prototype,ve,U.prototype.valueOf),w(U,"Symbol"),w(Math,"Math",!0),w(s.JSON,"JSON",!0)},function(a,t,e){var s=e(17)("meta"),c=e(11),d=e(5),p=e(7).f,f=0,h=Object.isExtensible||function(){return!0},S=!e(8)((function(){return h(Object.preventExtensions({}))})),b=function(I){p(I,s,{value:{i:"O"+ ++f,w:{}}})},w=a.exports={KEY:s,NEED:!1,fastKey:function(I,R){if(!c(I))return typeof I=="symbol"?I:(typeof I=="string"?"S":"P")+I;if(!d(I,s)){if(!h(I))return"F";if(!R)return"E";b(I)}return I[s].i},getWeak:function(I,R){if(!d(I,s)){if(!h(I))return!0;if(!R)return!1;b(I)}return I[s].w},onFreeze:function(I){return S&&w.NEED&&h(I)&&!d(I,s)&&b(I),I}}},function(a,t,e){var s=e(13),c=e(32),d=e(19);a.exports=function(p){var f=s(p),h=c.f;if(h)for(var S,b=h(p),w=d.f,I=0;b.length>I;)w.call(p,S=b[I++])&&f.push(S);return f}},function(a,t,e){var s=e(24);a.exports=Array.isArray||function(c){return s(c)=="Array"}},function(a,t,e){var s=e(9),c=e(41).f,d={}.toString,p=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];a.exports.f=function(f){return p&&d.call(f)=="[object Window]"?(function(h){try{return c(h)}catch{return p.slice()}})(f):c(s(f))}},function(a,t,e){var s=e(19),c=e(16),d=e(9),p=e(23),f=e(5),h=e(35),S=Object.getOwnPropertyDescriptor;t.f=e(4)?S:function(b,w){if(b=d(b),w=p(w,!0),h)try{return S(b,w)}catch{}if(f(b,w))return c(!s.f.call(b,w),b[w])}},function(a,t){},function(a,t,e){e(31)("asyncIterator")},function(a,t,e){e(31)("observable")},function(a,t,e){t.__esModule=!0;var s,c=e(77),d=(s=c)&&s.__esModule?s:{default:s};t.default=d.default||function(p){for(var f=1;fH;)for(var r,D=h(arguments[H++]),V=L?c(D).concat(L(D)):c(D),z=V.length,q=0;z>q;)r=V[q++],s&&!X.call(D,r)||(I[r]=D[r]);return I}:S},function(a,t,e){t.__esModule=!0;var s=d(e(82)),c=d(e(85));function d(p){return p&&p.__esModule?p:{default:p}}t.default=function(p,f){if(Array.isArray(p))return p;if((0,s.default)(Object(p)))return(function(h,S){var b=[],w=!0,I=!1,R=void 0;try{for(var H,L=(0,c.default)(h);!(w=(H=L.next()).done)&&(b.push(H.value),!S||b.length!==S);w=!0);}catch(X){I=!0,R=X}finally{try{!w&&L.return&&L.return()}finally{if(I)throw R}}return b})(p,f);throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(a,t,e){a.exports={default:e(83),__esModule:!0}},function(a,t,e){e(29),e(20),a.exports=e(84)},function(a,t,e){var s=e(42),c=e(2)("iterator"),d=e(12);a.exports=e(1).isIterable=function(p){var f=Object(p);return f[c]!==void 0||"@@iterator"in f||d.hasOwnProperty(s(f))}},function(a,t,e){a.exports={default:e(86),__esModule:!0}},function(a,t,e){e(29),e(20),a.exports=e(87)},function(a,t,e){var s=e(10),c=e(88);a.exports=e(1).getIterator=function(d){var p=c(d);if(typeof p!="function")throw TypeError(d+" is not iterable!");return s(p.call(d))}},function(a,t,e){var s=e(42),c=e(2)("iterator"),d=e(12);a.exports=e(1).getIteratorMethod=function(p){if(p!=null)return p[c]||p["@@iterator"]||d[s(p)]}},function(a,t,e){a.exports={default:e(90),__esModule:!0}},function(a,t,e){e(91),a.exports=e(1).Object.keys},function(a,t,e){var s=e(18),c=e(13);e(92)("keys",(function(){return function(d){return c(s(d))}}))},function(a,t,e){var s=e(15),c=e(1),d=e(8);a.exports=function(p,f){var h=(c.Object||{})[p]||Object[p],S={};S[p]=f(h),s(s.S+s.F*d((function(){h(1)})),"Object",S)}},function(a,t,e){(function(s){var c=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],d=/^\s+|\s+$/g,p=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,f=/\{\n\/\* \[wrapped with (.+)\] \*/,h=/,? & /,S=/^[-+]0x[0-9a-f]+$/i,b=/^0b[01]+$/i,w=/^\[object .+?Constructor\]$/,I=/^0o[0-7]+$/i,R=/^(?:0|[1-9]\d*)$/,H=parseInt,L=typeof s=="object"&&s&&s.Object===Object&&s,X=typeof self=="object"&&self&&self.Object===Object&&self,r=L||X||Function("return this")();function D(F,x,j){switch(j.length){case 0:return F.call(x);case 1:return F.call(x,j[0]);case 2:return F.call(x,j[0],j[1]);case 3:return F.call(x,j[0],j[1],j[2])}return F.apply(x,j)}function V(F,x){return!!(F&&F.length)&&(function(j,N,B){if(N!=N)return(function(te,ue,ye,xe){for(var Ie=te.length,me=ye+-1;++me-1}function z(F){return F!=F}function q(F,x){for(var j=F.length,N=0;j--;)F[j]===x&&N++;return N}function k(F,x){for(var j=-1,N=F.length,B=0,K=[];++j2?T:void 0);function Ne(F){return Ve(F)?le(F):{}}function Ee(F){return!(!Ve(F)||(function(x){return!!C&&C in x})(F))&&((function(x){var j=Ve(x)?ce.call(x):"";return j=="[object Function]"||j=="[object GeneratorFunction]"})(F)||(function(x){var j=!1;if(x!=null&&typeof x.toString!="function")try{j=!!(x+"")}catch{}return j})(F)?U:w).test((function(x){if(x!=null){try{return Y.call(x)}catch{}try{return x+""}catch{}}return""})(F))}function Oe(F,x,j,N){for(var B=-1,K=F.length,re=j.length,te=-1,ue=x.length,ye=Q(K-re,0),xe=Array(ue+ye),Ie=!N;++te1&&se.reverse(),xe&&ue1?"& ":"")+x[N],x=x.join(j>2?", ":" "),F.replace(p,`{ /* [wrapped with `+x+`] */ `)}function st(F,x){return!!(x=x??9007199254740991)&&(typeof F=="number"||R.test(F))&&F>-1&&F%1==0&&F1&&d--,f=6*d<1?s+6*(c-s)*d:2*d<1?c:3*d<2?s+(c-s)*(2/3-d)*6:s,p[w]=255*f;return p}},function(a,t,e){(function(s){var c=typeof s=="object"&&s&&s.Object===Object&&s,d=typeof self=="object"&&self&&self.Object===Object&&self,p=c||d||Function("return this")();function f(k,A,T){switch(T.length){case 0:return k.call(A);case 1:return k.call(A,T[0]);case 2:return k.call(A,T[0],T[1]);case 3:return k.call(A,T[0],T[1],T[2])}return k.apply(A,T)}function h(k,A){for(var T=-1,W=A.length,E=k.length;++T-1&&E%1==0&&E<=9007199254740991})(W.length)&&!(function(E){var ee=(function(J){var C=typeof J;return!!J&&(C=="object"||C=="function")})(E)?w.call(E):"";return ee=="[object Function]"||ee=="[object GeneratorFunction]"})(W)})(T)})(A)&&b.call(A,"callee")&&(!R.call(A,"callee")||w.call(A)=="[object Arguments]")})(k)||!!(H&&k&&k[H])}var r=Array.isArray,D,V,z,q=(V=function(k){var A=(k=(function(E,ee,J,C,Y){var be=-1,ce=E.length;for(J||(J=X),Y||(Y=[]);++be2?d-2:0),f=2;f"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch{return!1}})();return function(){var n,o=w(l);if(u){var i=w(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return H(this,n)}}e.r(t);var X=e(0),r=e.n(X);function D(){var l=this.constructor.getDerivedStateFromProps(this.props,this.state);l!=null&&this.setState(l)}function V(l){this.setState(function(u){var n=this.constructor.getDerivedStateFromProps(l,u);return n??null}.bind(this))}function z(l,u){try{var n=this.props,o=this.state;this.props=l,this.state=u,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,o)}finally{this.props=n,this.state=o}}function q(l){var u=l.prototype;if(!u||!u.isReactComponent)throw new Error("Can only polyfill class components");if(typeof l.getDerivedStateFromProps!="function"&&typeof u.getSnapshotBeforeUpdate!="function")return l;var n=null,o=null,i=null;if(typeof u.componentWillMount=="function"?n="componentWillMount":typeof u.UNSAFE_componentWillMount=="function"&&(n="UNSAFE_componentWillMount"),typeof u.componentWillReceiveProps=="function"?o="componentWillReceiveProps":typeof u.UNSAFE_componentWillReceiveProps=="function"&&(o="UNSAFE_componentWillReceiveProps"),typeof u.componentWillUpdate=="function"?i="componentWillUpdate":typeof u.UNSAFE_componentWillUpdate=="function"&&(i="UNSAFE_componentWillUpdate"),n!==null||o!==null||i!==null){var y=l.displayName||l.name,O=typeof l.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs. diff --git a/admin/assets/index-vgcfJH38.js b/admin/assets/index-DWalwvIj.js similarity index 99% rename from admin/assets/index-vgcfJH38.js rename to admin/assets/index-DWalwvIj.js index 51905dd8c..c882da958 100644 --- a/admin/assets/index-vgcfJH38.js +++ b/admin/assets/index-DWalwvIj.js @@ -1 +1 @@ -import{j as n}from"./createSvgIcon-DPvF8xqu.js";import{c as E,h as yt,j as M,m as nt,k as lt,l as Dt,b as ut,o as xt}from"./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js";import{_ as u}from"./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js";import{u as kt,a as St,M as Y,C as et,G as Nt,b as $t,c as bt,I as qt,S as J,d as Bt,e as ft,j as Mt,D as Ht,f as Wt}from"./index-_UYoIw1I.js";import{_ as wt,b as Ct,h as vt,i as jt,p as Tt,f as Et,g as mt,o as Pt,Y as Ut,Z as Ft,C as Jt,D as st}from"./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js";import{I as Lt}from"./index-C49cpVll.js";import"./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js";import"./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js";import"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js";import"./preload-helper-BDBacUwf.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js";import"./inheritsLoose-B0Ba5G9z.js";function zt(e){const s=kt().getMonitor(),[i,a]=St(s,e);return E(()=>s.subscribeToOffsetChange(a)),E(()=>s.subscribeToStateChange(a)),i}let V;function Gt(){return V||(V=new Image,V.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),V}const Kt="_wrapperRules_nnott_1",Qt="_rootWrapper_nnott_9",Yt="_addClass_nnott_14",ot={wrapperRules:Kt,rootWrapper:Qt,addClass:Yt},Zt="_switchesItem_10ls3_1",Xt="_switchesItemActive_10ls3_28",Vt="_iconTheme_10ls3_36",it={switchesItem:Zt,switchesItemActive:Xt,iconTheme:Vt},It=({name:e,id:t,active:s,icon:i,adapter:a,socket:o,onDoubleClick:c,title:l,onTouchMove:d,style:j})=>n.jsxs("div",{onDoubleClick:c,onTouchMove:d,title:l?u.I18n.t(l):void 0,className:u.Utils.clsx(it.switchesItem,s&&it.switchesItemActive,`block-${t}`),children:[n.jsx(Y,{iconName:i,className:it.iconTheme,adapter:a,socket:o,style:j}),n.jsx("span",{children:e?u.I18n.t(e):""})]},t),Rt="_cardStyle_8rq8v_1",tn="_cardStyleActive_8rq8v_17",nn="_controlMenu_8rq8v_22",en="_closeBtn_8rq8v_31",sn="_isDelete_8rq8v_73",on="_drag_mobile_8rq8v_90",G={cardStyle:Rt,cardStyleActive:tn,controlMenu:nn,closeBtn:en,isDelete:sn,drag_mobile:on};function K(e,t,s){let i;switch(e){case"actions":if(s==="else")return i={...t,actions:{...t[e],else:[...t[e].else]}},i;if(s==="then")return i={...t,actions:{...t[e],then:[...t[e].then]}},i;throw console.error(`Unknown additionalParameter: ${s}`),new Error(`Unknown additionalParameter: ${s}`);case"triggers":return i={...t,triggers:[...t.triggers]},i;case"conditions":return i={...t,conditions:[...t.conditions]},i;default:throw new Error(`Unknown name: ${e}`)}}function z(e,t,s,i){var a;switch(e){case"actions":return t.actions[s]=t.actions[s].filter(o=>o._id!==i),t;case"conditions":return t.conditions[s]=(a=t.conditions[s])==null?void 0:a.filter(o=>o._id!==i),t;default:return t.triggers=t.triggers.filter(o=>o._id!==i),t}}function cn(e,t,s){const{_id:i,acceptedBy:a}=e;let o;if(!a||!t[a])return console.warn(`Cannot find ${a}`),t;switch(a){case"actions":if(o=t.actions[s].find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=t.actions[s].indexOf(o);t.actions[s][c]=e}return t;case"conditions":if(o=t.conditions[s].find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=t.conditions[s].indexOf(o);t.conditions[s][c]=e}return t;default:if(o=t.triggers.find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=t.triggers.indexOf(o);t.triggers[c]=e}return t}}const Ot=yt(e=>{var N;const{setUserRules:t,userRules:s,_id:i,id:a,blockValue:o,active:c,acceptedBy:l,isTourOpen:d,setTourStep:j,tourStep:O}=e,[I,_]=M(null),{blocks:r,socket:k,onUpdate:H,setOnUpdate:w,onDebugMessage:f,enableSimulation:x}=nt(et),p=lt(h=>r==null?void 0:r.find(b=>b.getStaticData().id===h),[r]),g=lt(h=>{const b=cn(h,s,o);b&&t(b)},[s]),C=h=>{h.currentTarget!==I&&_(h.currentTarget)},q=()=>_(null),T=Dt(()=>{const h=p(a)||Nt;return n.jsx(h,{...e,notFound:!p(a),isTourOpen:d,setTourStep:j,tourStep:O,onUpdate:H,setOnUpdate:w,enableSimulation:x,onDebugMessage:f,onChange:g,className:void 0,socket:k})},[s,H,f,x]),[S,B]=M(!1);return n.jsxs("div",{onMouseMove:C,onMouseEnter:C,onMouseLeave:q,onMouseDown:h=>{if(h.ctrlKey){let b;const v=K(l,s,o);l==="conditions"?(b=v.conditions[o].find(m=>m._id===i),b&&v.conditions[o].splice(v.conditions[o].indexOf(b),0,{...b,_id:Date.now()})):l==="actions"?(b=v.actions[o].find(m=>m._id===i),b&&v.actions[o].splice(v.actions[o].indexOf(b),0,{...b,_id:Date.now()})):(b=v.triggers.find(m=>m._id===i),b&&v.triggers.splice(v[l].indexOf(b),0,{...b,_id:Date.now()})),t(v)}},id:"height",style:c?{width:(((N=document.getElementById("width"))==null?void 0:N.clientWidth)||0)-70}:void 0,className:`${G.cardStyle} ${c?G.cardStyleActive:null} ${S?G.isDelete:null}`,children:[n.jsx("div",{className:G.drag_mobile}),T,t&&n.jsx("div",{className:G.controlMenu,style:I?{opacity:1}:{opacity:0},children:n.jsx("div",{onClick:()=>{let h=K(l,s,o);h=z(l,h,o,i),B(!0),setTimeout(()=>{l==="triggers"&&w(!0),t(h)},300)},className:G.closeBtn})})]})}),rn={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},an=(e,t,s)=>{if(!e||!t)return{display:"none"};let{x:i,y:a}=t;const o=`translate(${i}px, ${a}px)`;return{transform:o,WebkitTransform:o}},ln=e=>{const{itemType:t,isDragging:s,item:i,initialOffset:a,currentOffset:o,targetIds:c}=zt(d=>({item:d.getItem(),itemType:d.getItemType(),initialOffset:d.getInitialSourceClientOffset(),currentOffset:d.getSourceClientOffset(),isDragging:d.isDragging(),targetIds:d.getTargetIds()})),l=()=>t==="box"?c.length?n.jsx(Ot,{active:!0,...i,allBlocks:e.allBlocks}):n.jsx(It,{active:!0,...i,socket:e.socket}):null;return s?n.jsx("div",{style:rn,children:n.jsx("div",{style:an(a,o),children:l()})}):null},dn="_border_wrpm3_1",fn="_emptyBlockStyle_wrpm3_6",mn="_emptyBlock_wrpm3_6",gn="_selectOnChange_wrpm3_22",hn="_selectOnChangeHelp_wrpm3_28",_n="_selectOnChangeHelpIcon_wrpm3_34",pn="_emptyBlockNone_wrpm3_49",un="_mainBlockItemRules_wrpm3_55",xn="_nameBlockItems_wrpm3_63",bn="_contentBlockItem_wrpm3_73",wn="_wrapperMargin_wrpm3_81",Cn="_contentHeightOn_wrpm3_87",vn="_contentHeightOff_wrpm3_99",jn="_cardAdd_wrpm3_105",In="_blockCardAdd_wrpm3_125",On="_addClassOverflow_wrpm3_136",An="_addClassHeight_wrpm3_140",D={border:dn,emptyBlockStyle:fn,emptyBlock:mn,selectOnChange:gn,selectOnChangeHelp:hn,selectOnChangeHelpIcon:_n,emptyBlockNone:pn,mainBlockItemRules:un,nameBlockItems:xn,contentBlockItem:bn,wrapperMargin:wn,contentHeightOn:Cn,contentHeightOff:vn,cardAdd:jn,blockCardAdd:In,addClassOverflow:On,addClassHeight:An};function dt(e,t){const[s,i]=M(window.localStorage.getItem(t)?JSON.parse(window.localStorage.getItem(t)||""):e);return[s,o=>{window.localStorage.setItem(t,JSON.stringify(o)),i(o)},!!window.localStorage.getItem(t)]}function yn(e,t){let s=0,i=null,a;return function(...o){const c=Date.now();a=o,c-s>=t?(s=c,e.apply(this,o)):i||(i=setTimeout(()=>{s=Date.now(),i=null,e.apply(this,a)},t-(c-s)))}}function tt(e){if(Array.isArray(e))return e.map(t=>tt(t));if(typeof e=="function")return e.bind(null);if(e&&typeof e=="object"){const t={};return Object.keys(e).forEach(s=>{t[s]=tt(e[s])}),t}return e}const ct=yn((e,t)=>e(t),0);function R(e,t){const s=t.find(i=>i._id===e);return{card:s,index:s?t.indexOf(s):-1}}function rt(e,t,s,i,a,o,c,l,d){const{card:j,index:O}=R(e,s);if(!(Ot&&l>d)&&j&&O!==t){const I=tt(s);I.splice(O,1),I.splice(t,0,j);const _=tt(a);switch(o){case"actions":_.actions[c]=I,ct(i,_);return;case"conditions":_.conditions[c]=I,ct(i,_);return;default:_.triggers=I,ct(i,_);return}}}const Dn="_drag_7xfhc_1",kn="_root_7xfhc_11",gt={drag:Dn,root:kn},At=({typeBlock:e,allProperties:t,id:s,isActive:i,setUserRules:a,userRules:o,children:c,_id:l,blockValue:d})=>{const{setOnUpdate:j}=nt(et),[{opacity:O},I,_]=$t({type:"box",item:()=>({...t,id:s,isActive:i,_id:l}),end:(w,f)=>{const{acceptedBy:x}=w,p=f.getDropResult();let g;if(!p)return typeof l=="number"&&!f.getTargetIds().length&&(g=K(x,o,d),g=z(x,g,d,l),a(g)),null;if(p.blockValue!==d){const C=typeof l=="number"?l:Date.now();g=K(x,o,p.blockValue);const q={id:w.id,acceptedBy:w.acceptedBy};switch(x){case"actions":return d&&(g=z("actions",g,d,C)),g=z("actions",g,p.blockValue,C),g.actions[p.blockValue].push({...q,_id:C}),a(g);case"conditions":return typeof d=="number"&&(g=z("conditions",g,d,C)),g=z("conditions",g,p.blockValue,C),g.conditions[p.blockValue].push({...q,_id:C}),a(g);default:return j(!0),g=z("triggers",g,p.blockValue,C),g.triggers.push({...q,_id:C}),a(g)}}},collect:w=>({opacity:w.isDragging()?.4:1,isDragging:w.isDragging()})}),r=ut(null),[,k]=bt({accept:"box",canDrop:()=>!1,hover({_id:w,acceptedBy:f},x){var T;if(!r.current||e!==f)return;const p=(T=r.current)==null?void 0:T.getBoundingClientRect(),g=(p.bottom-p.top)/2,C=x.getClientOffset(),q=((C==null?void 0:C.y)||0)-p.top;if(l&&w!==l)switch(f){case"actions":if(d==="then"||d==="else"){const{index:S}=R(l,o.actions[d]);S!==w&&rt(w,S,o[f][d],a,o,f,d,q,g)}return;case"conditions":if(typeof d=="number"){const{index:S}=R(l,o[f][d]);S!==w&&rt(w,S,o[f][d],a,o,f,d,q,g)}return;default:{const{index:S}=R(l,o[f]);S!==w&&rt(w,S,o[f],a,o,f,void 0,q,g);return}}}});E(()=>{_(Gt(),{captureDraggingState:!0})},[]),I(k(r));const H=window.innerWidth<600;return n.jsxs("div",{ref:H&&l?null:r,className:gt.root,style:{opacity:O},children:[n.jsx("div",{className:l?gt.drag:null,ref:l&&H?r:null}),c]})},Sn=({onClose:e,open:t})=>n.jsxs(wt,{open:t,onClose:e,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[n.jsx(Ct,{children:n.jsxs("div",{style:{fontSize:"1rem",fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif',fontWeight:400,lineHeight:1.5,letterSpacing:"0.00938em"},children:[n.jsx("h3",{children:u.I18n.t("On condition change")}),n.jsx("div",{children:u.I18n.t("help_on_change")}),n.jsx("h3",{children:u.I18n.t("Just check")}),n.jsx("div",{children:u.I18n.t("help_just_check")})]})}),n.jsx(vt,{children:n.jsx(jt,{onClick:e,color:"primary",autoFocus:!0,startIcon:n.jsx(Lt,{}),children:u.I18n.t("OK")})})]}),Nn=({onClose:e,open:t})=>n.jsxs(wt,{open:t,onClose:e,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[n.jsx(Ct,{children:n.jsxs(Tt,{id:"alert-dialog-description",children:[n.jsx("h3",{children:u.I18n.t("On condition change")}),n.jsx("div",{children:u.I18n.t("help_on_change")}),n.jsx("h3",{children:u.I18n.t("Just check")}),n.jsx("div",{children:u.I18n.t("help_just_check")})]})}),n.jsx(vt,{children:n.jsx(jt,{onClick:e,color:"primary",autoFocus:!0,children:u.I18n.t("OK")})})]}),ht=({size:e,blockValue:t,boolean:s,typeBlock:i,userRules:a,setUserRules:o,animation:c,setTourStep:l,tourStep:d,isTourOpen:j,theme:O,themeType:I,themeName:_})=>{var W;const[r,k]=M(!1),[H,w]=M(!1),[f,x]=M(!1),[p,g]=M("");s===void 0&&(s=!0);const C=bt({accept:"box",drop:()=>({blockValue:t}),hover:({acceptedBy:A,_id:L},Z)=>{k(A===i),x(!!L),g(Z.getHandlerId()||"")},canDrop:({acceptedBy:A})=>(w(A===i),A===i),collect:A=>{var L;return{isOver:A.isOver(),canDrop:((L=A.getItem())==null?void 0:L.acceptedBy)===i,offset:A.getClientOffset(),targetId:A.getHandlerId()}}}),q=C[0],{canDrop:T,isOver:S,offset:B,targetId:N}=q,h=C[1];E(()=>{g("")},[B]);const b=T&&S;let v="";b?v=r?"#00fb003d":"#fb00002e":T?v=H?"#00fb003d":"#fb00002e":B&&(v=N===p?"#fb00002e":"");let m;return i==="actions"?m=a.actions[t]:i==="conditions"?m=a.conditions[t]:m=a.triggers,n.jsx("div",{ref:h,style:{backgroundColor:v},className:`${u.Utils.clsx(D.contentBlockItem,e&&D.addClassHeight)} ${s?c?D.contentHeightOn:null:D.contentHeightOff}`,children:n.jsxs("div",{className:D.wrapperMargin,children:[m.map(A=>n.jsx(At,{typeBlock:i,...A,blockValue:t,allProperties:A,userRules:a,setUserRules:o,children:n.jsx(Ot,{...A,isTourOpen:j,setTourStep:l,tourStep:d,settings:A,blockValue:t,userRules:a,setUserRules:o,theme:O,themeType:I,themeName:_})},A._id)),n.jsx("div",{style:b&&r&&!f?{height:((W=document.getElementById("height"))==null?void 0:W.clientHeight)||200}:void 0,className:`${D.emptyBlockStyle} ${b&&r&&!f?D.emptyBlock:D.emptyBlockNone}`})]})})},at=({size:e,typeBlock:t,name:s,nameAdditionally:i,additionally:a,border:o,userRules:c,setUserRules:l,iconName:d,adapter:j,socket:O,setTourStep:I,tourStep:_,isTourOpen:r,theme:k,themeType:H,themeName:w})=>{const[f,x,p]=dt(t==="actions"?!1:[],`additionallyClickItems_${t}`),[g,C]=M(!1),[q,T]=M(!1);E(()=>{if(t==="conditions"&&(f==null?void 0:f.length)!==c.conditions.length-1){const N=[];c.conditions.forEach((h,b)=>{b>0&&N.push({_id:Date.now(),open:!0})}),x([...f,...N])}t==="actions"&&!p&&c.actions.else.length&&x(!0)},[]);const[S,B]=M(!1);return n.jsxs("div",{className:`${u.Utils.clsx(D.mainBlockItemRules,e&&D.addClassOverflow)} ${o&&!e?D.border:null}`,children:[n.jsxs("span",{id:"width",className:D.nameBlockItems,children:[n.jsx(Y,{iconName:d,className:D.iconThemCard,adapter:j,socket:O}),s]}),t==="conditions"?n.jsxs("div",{style:{width:"100%"},children:[n.jsxs(Et,{variant:"standard",className:D.selectOnChange,value:c.justCheck||!1,onChange:N=>{const h=K("conditions",c);h.justCheck=N.target.value==="true",l(h)},children:[n.jsx(mt,{value:"false",children:u.I18n.t("on condition change")}),n.jsx(mt,{value:"true",children:u.I18n.t("just check")})]}),n.jsx(Pt,{size:"small",title:u.I18n.t("Explanation"),className:D.selectOnChangeHelp,onClick:()=>C(!0),children:n.jsx(qt,{className:D.selectOnChangeHelpIcon})})]}):null,n.jsx(ht,{setTourStep:I,tourStep:_,isTourOpen:r,blockValue:t==="actions"?"then":t==="conditions"?0:t,typeBlock:t,setUserRules:l,userRules:c,theme:k,themeName:w,themeType:H,size:e}),a&&[...Array(t==="actions"?1:c.conditions.length-1)].map((N,h)=>{const b=(v=h)=>t==="actions"?!!f:!!f.find((m,W)=>W===v&&m.open);return n.jsxs(xt,{children:[n.jsxs("div",{onClick:()=>{if(t==="actions")return x(!f),null;let v=JSON.parse(JSON.stringify(f));if(c.conditions[h+1].length)return v[h].open=!v[h].open,x(v),null;v=v.filter((m,W)=>W!==h),x(v),B(h),setTimeout(()=>{B(!1),l({...c,conditions:[...c.conditions.filter((m,W)=>W!==h+1)]})},250)},className:D.blockCardAdd,children:[b()?"-":"+",n.jsx("div",{className:D.cardAdd,children:i})]},h),n.jsx(ht,{blockValue:t==="actions"?"else":t==="conditions"?h+1:t,typeBlock:t,setUserRules:l,userRules:c,boolean:b(),animation:S===h,size:e,theme:k,themeName:w,themeType:H})]},`${h}_block_${t}`)}),a&&t==="conditions"&&n.jsxs("div",{onClick:()=>{x([...f,{_id:Date.now(),open:!0}]),l({...c,conditions:[...c.conditions,[]]}),B(c.conditions.length-1),setTimeout(()=>B(!1),1e3)},className:D.blockCardAdd,children:["+",n.jsx("div",{className:D.cardAdd,children:i})]}),n.jsx(Sn,{open:g,onClose:()=>C(!1)}),n.jsx(Nn,{open:q,onClose:()=>T(!1)})]})},$n="_menuRules_1qqcb_1",qn="_switchesRenderWrapper_1qqcb_13",Bn="_menuOff_1qqcb_22",Mn="_menuTitle_1qqcb_28",Hn="_marginAuto_1qqcb_42",Wn="_inputWidth_1qqcb_47",Tn="_menuWrapper_1qqcb_52",En="_hamburgerWrapper_1qqcb_57",Pn="_hamburgerOff_1qqcb_74",Un="_nothingFound_1qqcb_82",Fn="_resetSearch_1qqcb_89",Jn="_controlPanel_1qqcb_101",Ln="_controlPanelAppBar_1qqcb_112",zn="_addClassMenu_1qqcb_126",Gn="_addClassBackground_1qqcb_132",Kn="_addClassPosition_1qqcb_136",$={menuRules:$n,switchesRenderWrapper:qn,menuOff:Bn,menuTitle:Mn,marginAuto:Hn,inputWidth:Wn,menuWrapper:Tn,hamburgerWrapper:En,hamburgerOff:Pn,nothingFound:Un,resetSearch:Fn,controlPanel:Jn,controlPanelAppBar:Ln,addClassMenu:zn,addClassBackground:Gn,addClassPosition:Kn},Qn=e=>{const{allProperties:t,allProperties:{acceptedBy:s,id:i},setUserRules:a,userRules:o,setTourStep:c,tourStep:l,isTourOpen:d,onTouchMove:j,isActive:O}=e;return n.jsx(At,{allProperties:t,id:t.id,isActive:O,setUserRules:a,userRules:o,children:n.jsx(It,{onDoubleClick:()=>{d&&l===J.addScheduleByDoubleClick&&i==="TriggerScheduleBlock"&&c(J.openTagsMenu),d&&l===J.addActionPrintText&&i==="ActionPrintText"&&c(J.showJavascript);const I=Date.now();let _;switch(s){case"actions":_="then";break;case"conditions":_=o[s].length-1;break}const r=K(s,o,_),k={id:i,_id:I,acceptedBy:s};_!==void 0?s==="actions"?r.actions[_].push({...k}):s==="conditions"&&r.conditions[_].push({...k}):r.triggers.push({...k}),a(r)},...e,...t,onTouchMove:j})})},Yn="_hamburgerMenu_hqnsm_8",Zn="_animate_hqnsm_21",_t={hamburgerMenu:Yn,animate:Zn};function Xn({bool:e}){return n.jsx("div",{className:`${_t.hamburgerMenu} ${e?_t.animate:""}`})}const Vn=({addClass:e,setAllBlocks:t,allBlocks:s,userRules:i,onChangeBlocks:a,setTourStep:o,tourStep:c,isTourOpen:l})=>{const{blocks:d,socket:j}=nt(et),[O,I]=dt(!1,"hamburgerOnOff"),[_,r]=dt({text:"",type:"triggers",index:0},"filterControlPanel"),k=(f=_.text,x=_.type)=>{if(!d)return;let p=[...d];p=p.filter(g=>{if(!f)return!0;const{name:C}=g.getStaticData();return C&&u.I18n.t(C).toLowerCase().includes(f.toLowerCase())}),p=p.filter(g=>x===g.getStaticData().acceptedBy),t(p)},H=(f,x)=>{l&&x===0&&c===J.selectTriggers&&o(J.addScheduleByDoubleClick),l&&x===2&&c===J.selectActions&&o(J.addActionPrintText),r({..._,index:x,type:["triggers","conditions","actions"][x]}),k(_.text,["triggers","conditions","actions"][x])},w=f=>({id:`scrollable-force-tab-${f}`,"aria-controls":`scrollable-force-tabpanel-${f}`});return E(()=>{k()},[d]),n.jsx(Ut,{mouseEvent:!1,touchEvent:"onTouchStart",onClickAway:()=>I(!0),children:n.jsxs("div",{className:u.Utils.clsx($.menuWrapper,e[1035]&&$.addClassMenu),children:[n.jsx("div",{className:`${$.hamburgerWrapper} ${O?$.hamburgerOff:null}`,onClick:()=>I(!O),children:n.jsx(Xn,{bool:!O})}),n.jsxs("div",{className:`${u.Utils.clsx($.menuRules,e[1035]&&$.addClassBackground,e[835]&&$.addClassPosition)} ${O?$.menuOff:null}`,children:[n.jsx("div",{className:$.controlPanel,children:n.jsx(Ft,{className:$.controlPanelAppBar,position:"static",children:n.jsxs(Jt,{value:_.index,onChange:H,children:[n.jsx(st,{className:"blocks-triggers",title:u.I18n.t("Triggers"),icon:n.jsx(Y,{iconName:"FlashOn"}),...w(0)}),n.jsx(st,{title:u.I18n.t("Conditions"),className:"blocks-conditions",icon:n.jsx(Y,{iconName:"Help"}),...w(1)}),n.jsx(st,{title:u.I18n.t("Actions"),className:"blocks-actions",icon:n.jsx(Y,{iconName:"PlayForWork"}),...w(2)})]})})}),n.jsx("div",{className:$.switchesRenderWrapper,children:n.jsxs("span",{children:[s.map(f=>{const{name:x,id:p,icon:g,adapter:C}=f.getStaticData();return n.jsx(xt,{children:n.jsx(Qn,{adapter:C,allProperties:f.getStaticData(),icon:g,id:p,isActive:!1,isTourOpen:l,name:x,onTouchMove:()=>I(!0),setTourStep:o,setUserRules:a,socket:j,tourStep:c,userRules:i})},p)}),!s.length&&n.jsxs("div",{className:$.nothingFound,children:[u.I18n.t("Nothing found"),"...",n.jsx("div",{className:$.resetSearch,onClick:()=>{r({..._,text:""}),k("")},children:u.I18n.t("reset search")})]})]})}),n.jsx("div",{className:u.Utils.clsx($.menuTitle,$.marginAuto)}),n.jsx(Bt,{className:$.inputWidth,fullWidth:!0,customValue:!0,value:_.text,size:"small",autoComplete:"off",label:u.I18n.t("search"),variant:"outlined",onChange:f=>{r({..._,text:f}),k(f)}})]})]})})};let pt=[];const me=({code:e,onChange:t,themeName:s,themeType:i,theme:a,setTourStep:o,tourStep:c,isTourOpen:l,command:d,scriptId:j,changed:O,running:I})=>{var v;const{blocks:_,socket:r,setOnUpdate:k,setOnDebugMessage:H,setEnableSimulation:w}=nt(et),[f,x]=M([]),[p,g]=M(ft(e)),[C,q]=M(""),[T,S]=M(!1);E(()=>{let m,W;const A=(P,y)=>{P===`${m}.alive`&&W!==(y==null?void 0:y.val)&&(W=!!(y!=null&&y.val),W&&m&&(r==null||r.sendTo(m.replace(/^system\.adapter\./,""),"rulesOn",j)))},L=(P,y)=>{var U,Q;r&&m!==((U=y==null?void 0:y.common)==null?void 0:U.engine)&&(m&&(r.unsubscribeState(`${m}.alive`,A),W&&r.sendTo(m.replace(/^system\.adapter\./,""),"rulesOn",j)),m=(Q=y==null?void 0:y.common)==null?void 0:Q.engine,m&&m&&r.subscribeState(`${m}.alive`,A))},Z=(P,y)=>{if(y)try{const U=JSON.parse(y.val),Q=Date.now();if(U.ruleId===j&&Q-U.ts<1e3){const F=[...pt,{blockId:U.blockId,data:U.data,ts:U.ts}];F.length>200&&F.splice(0,200-F.length);for(let X=F.length-1;X>=0;X--)if(F[X].ts{var y;m=(y=P==null?void 0:P.common)==null?void 0:y.engine,r.subscribeObject(j,L),m&&(r.subscribeState(`${m}.alive`,A),r.subscribeState(`${m.replace(/^system\.adapter\./,"")}.debug.rules`,Z))}),function(){r==null||r.unsubscribeObject(j,L),m&&(r==null||r.unsubscribeState(`${m}.alive`,A),W&&(r==null||r.sendTo(m.replace(/^system\.adapter\./,""),"rulesOff",j)),r==null||r.unsubscribeState(`${m.replace(/^system\.adapter\./,"")}.debug.rules`,Z))}},[]),E(()=>{w(!O&&I)},[O,I,w]),E(()=>{d&&(q(d),T||S(!0))},[d]),E(()=>{const m=ft(e);JSON.stringify(m)!==JSON.stringify(p)&&(g(m),k(!0))},[e]),E(()=>{document.getElementsByTagName("HTML")[0].className=s||"blue"},[s]);const B=lt(m=>{g(m),_&&t(Mt(m,_))},[_,t]),N=ut(null),[h,b]=M({835:!1,1035:!1});return E(()=>{N.current&&(N.current.clientWidth<=1035&&b({835:!1,1035:!0}),N.current.clientWidth<=835&&b({1035:!0,835:!0}),N.current.clientWidth>1035&&b({835:!1,1035:!1}))},[((v=N.current)==null?void 0:v.clientWidth)||0]),!_||!r?null:n.jsxs("div",{className:ot.wrapperRules,ref:N,children:[n.jsx(ln,{allBlocks:f,socket:r}),T?C==="export"?n.jsx(Ht,{scriptId:j,themeType:i,onClose:()=>S(!1),text:JSON.stringify(p,null,2)}):n.jsx(Wt,{themeType:i,onClose:m=>{S(!1),m&&B(JSON.parse(m))}}):null,n.jsxs("div",{className:u.Utils.clsx(ot.rootWrapper,h[835]&&ot.addClass),children:[n.jsx(Vn,{setAllBlocks:x,allBlocks:f,userRules:p,onChangeBlocks:B,setTourStep:o,tourStep:c,addClass:h,isTourOpen:l}),n.jsx(at,{socket:r,setUserRules:B,userRules:p,isTourOpen:l,setTourStep:o,tourStep:c,name:`${u.I18n.t("when")}...`,typeBlock:"triggers",iconName:"FlashOn",size:h[835],themeType:i,themeName:s,theme:a}),n.jsx(at,{socket:r,setUserRules:B,isTourOpen:l,setTourStep:o,tourStep:c,userRules:p,name:`...${u.I18n.t("and")}...`,typeBlock:"conditions",iconName:"Help",nameAdditionally:u.I18n.t("or"),additionally:!0,border:!0,size:h[835],themeType:i,themeName:s,theme:a}),n.jsx(at,{socket:r,setUserRules:B,isTourOpen:l,setTourStep:o,tourStep:c,userRules:p,name:`...${u.I18n.t("then")}`,typeBlock:"actions",iconName:"PlayForWork",nameAdditionally:u.I18n.t("else"),additionally:!0,size:h[835],themeType:i,themeName:s,theme:a})]})]},"rulesEditor")};export{me as default}; +import{j as n}from"./createSvgIcon-DPvF8xqu.js";import{c as E,h as yt,j as M,m as nt,k as lt,l as Dt,b as ut,o as xt}from"./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js";import{_ as u}from"./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js";import{u as kt,a as St,M as Y,C as et,G as Nt,b as $t,c as bt,I as qt,S as J,d as Bt,e as ft,j as Mt,D as Ht,f as Wt}from"./index-Bm6wEaaB.js";import{_ as wt,b as Ct,h as vt,i as jt,p as Tt,f as Et,g as mt,o as Pt,Y as Ut,Z as Ft,C as Jt,D as st}from"./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js";import{I as Lt}from"./index-C49cpVll.js";import"./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js";import"./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js";import"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js";import"./preload-helper-BDBacUwf.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js";import"./inheritsLoose-B0Ba5G9z.js";function zt(e){const s=kt().getMonitor(),[i,a]=St(s,e);return E(()=>s.subscribeToOffsetChange(a)),E(()=>s.subscribeToStateChange(a)),i}let V;function Gt(){return V||(V=new Image,V.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),V}const Kt="_wrapperRules_nnott_1",Qt="_rootWrapper_nnott_9",Yt="_addClass_nnott_14",ot={wrapperRules:Kt,rootWrapper:Qt,addClass:Yt},Zt="_switchesItem_10ls3_1",Xt="_switchesItemActive_10ls3_28",Vt="_iconTheme_10ls3_36",it={switchesItem:Zt,switchesItemActive:Xt,iconTheme:Vt},It=({name:e,id:t,active:s,icon:i,adapter:a,socket:o,onDoubleClick:c,title:l,onTouchMove:d,style:j})=>n.jsxs("div",{onDoubleClick:c,onTouchMove:d,title:l?u.I18n.t(l):void 0,className:u.Utils.clsx(it.switchesItem,s&&it.switchesItemActive,`block-${t}`),children:[n.jsx(Y,{iconName:i,className:it.iconTheme,adapter:a,socket:o,style:j}),n.jsx("span",{children:e?u.I18n.t(e):""})]},t),Rt="_cardStyle_8rq8v_1",tn="_cardStyleActive_8rq8v_17",nn="_controlMenu_8rq8v_22",en="_closeBtn_8rq8v_31",sn="_isDelete_8rq8v_73",on="_drag_mobile_8rq8v_90",G={cardStyle:Rt,cardStyleActive:tn,controlMenu:nn,closeBtn:en,isDelete:sn,drag_mobile:on};function K(e,t,s){let i;switch(e){case"actions":if(s==="else")return i={...t,actions:{...t[e],else:[...t[e].else]}},i;if(s==="then")return i={...t,actions:{...t[e],then:[...t[e].then]}},i;throw console.error(`Unknown additionalParameter: ${s}`),new Error(`Unknown additionalParameter: ${s}`);case"triggers":return i={...t,triggers:[...t.triggers]},i;case"conditions":return i={...t,conditions:[...t.conditions]},i;default:throw new Error(`Unknown name: ${e}`)}}function z(e,t,s,i){var a;switch(e){case"actions":return t.actions[s]=t.actions[s].filter(o=>o._id!==i),t;case"conditions":return t.conditions[s]=(a=t.conditions[s])==null?void 0:a.filter(o=>o._id!==i),t;default:return t.triggers=t.triggers.filter(o=>o._id!==i),t}}function cn(e,t,s){const{_id:i,acceptedBy:a}=e;let o;if(!a||!t[a])return console.warn(`Cannot find ${a}`),t;switch(a){case"actions":if(o=t.actions[s].find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=t.actions[s].indexOf(o);t.actions[s][c]=e}return t;case"conditions":if(o=t.conditions[s].find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=t.conditions[s].indexOf(o);t.conditions[s][c]=e}return t;default:if(o=t.triggers.find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=t.triggers.indexOf(o);t.triggers[c]=e}return t}}const Ot=yt(e=>{var N;const{setUserRules:t,userRules:s,_id:i,id:a,blockValue:o,active:c,acceptedBy:l,isTourOpen:d,setTourStep:j,tourStep:O}=e,[I,_]=M(null),{blocks:r,socket:k,onUpdate:H,setOnUpdate:w,onDebugMessage:f,enableSimulation:x}=nt(et),p=lt(h=>r==null?void 0:r.find(b=>b.getStaticData().id===h),[r]),g=lt(h=>{const b=cn(h,s,o);b&&t(b)},[s]),C=h=>{h.currentTarget!==I&&_(h.currentTarget)},q=()=>_(null),T=Dt(()=>{const h=p(a)||Nt;return n.jsx(h,{...e,notFound:!p(a),isTourOpen:d,setTourStep:j,tourStep:O,onUpdate:H,setOnUpdate:w,enableSimulation:x,onDebugMessage:f,onChange:g,className:void 0,socket:k})},[s,H,f,x]),[S,B]=M(!1);return n.jsxs("div",{onMouseMove:C,onMouseEnter:C,onMouseLeave:q,onMouseDown:h=>{if(h.ctrlKey){let b;const v=K(l,s,o);l==="conditions"?(b=v.conditions[o].find(m=>m._id===i),b&&v.conditions[o].splice(v.conditions[o].indexOf(b),0,{...b,_id:Date.now()})):l==="actions"?(b=v.actions[o].find(m=>m._id===i),b&&v.actions[o].splice(v.actions[o].indexOf(b),0,{...b,_id:Date.now()})):(b=v.triggers.find(m=>m._id===i),b&&v.triggers.splice(v[l].indexOf(b),0,{...b,_id:Date.now()})),t(v)}},id:"height",style:c?{width:(((N=document.getElementById("width"))==null?void 0:N.clientWidth)||0)-70}:void 0,className:`${G.cardStyle} ${c?G.cardStyleActive:null} ${S?G.isDelete:null}`,children:[n.jsx("div",{className:G.drag_mobile}),T,t&&n.jsx("div",{className:G.controlMenu,style:I?{opacity:1}:{opacity:0},children:n.jsx("div",{onClick:()=>{let h=K(l,s,o);h=z(l,h,o,i),B(!0),setTimeout(()=>{l==="triggers"&&w(!0),t(h)},300)},className:G.closeBtn})})]})}),rn={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},an=(e,t,s)=>{if(!e||!t)return{display:"none"};let{x:i,y:a}=t;const o=`translate(${i}px, ${a}px)`;return{transform:o,WebkitTransform:o}},ln=e=>{const{itemType:t,isDragging:s,item:i,initialOffset:a,currentOffset:o,targetIds:c}=zt(d=>({item:d.getItem(),itemType:d.getItemType(),initialOffset:d.getInitialSourceClientOffset(),currentOffset:d.getSourceClientOffset(),isDragging:d.isDragging(),targetIds:d.getTargetIds()})),l=()=>t==="box"?c.length?n.jsx(Ot,{active:!0,...i,allBlocks:e.allBlocks}):n.jsx(It,{active:!0,...i,socket:e.socket}):null;return s?n.jsx("div",{style:rn,children:n.jsx("div",{style:an(a,o),children:l()})}):null},dn="_border_wrpm3_1",fn="_emptyBlockStyle_wrpm3_6",mn="_emptyBlock_wrpm3_6",gn="_selectOnChange_wrpm3_22",hn="_selectOnChangeHelp_wrpm3_28",_n="_selectOnChangeHelpIcon_wrpm3_34",pn="_emptyBlockNone_wrpm3_49",un="_mainBlockItemRules_wrpm3_55",xn="_nameBlockItems_wrpm3_63",bn="_contentBlockItem_wrpm3_73",wn="_wrapperMargin_wrpm3_81",Cn="_contentHeightOn_wrpm3_87",vn="_contentHeightOff_wrpm3_99",jn="_cardAdd_wrpm3_105",In="_blockCardAdd_wrpm3_125",On="_addClassOverflow_wrpm3_136",An="_addClassHeight_wrpm3_140",D={border:dn,emptyBlockStyle:fn,emptyBlock:mn,selectOnChange:gn,selectOnChangeHelp:hn,selectOnChangeHelpIcon:_n,emptyBlockNone:pn,mainBlockItemRules:un,nameBlockItems:xn,contentBlockItem:bn,wrapperMargin:wn,contentHeightOn:Cn,contentHeightOff:vn,cardAdd:jn,blockCardAdd:In,addClassOverflow:On,addClassHeight:An};function dt(e,t){const[s,i]=M(window.localStorage.getItem(t)?JSON.parse(window.localStorage.getItem(t)||""):e);return[s,o=>{window.localStorage.setItem(t,JSON.stringify(o)),i(o)},!!window.localStorage.getItem(t)]}function yn(e,t){let s=0,i=null,a;return function(...o){const c=Date.now();a=o,c-s>=t?(s=c,e.apply(this,o)):i||(i=setTimeout(()=>{s=Date.now(),i=null,e.apply(this,a)},t-(c-s)))}}function tt(e){if(Array.isArray(e))return e.map(t=>tt(t));if(typeof e=="function")return e.bind(null);if(e&&typeof e=="object"){const t={};return Object.keys(e).forEach(s=>{t[s]=tt(e[s])}),t}return e}const ct=yn((e,t)=>e(t),0);function R(e,t){const s=t.find(i=>i._id===e);return{card:s,index:s?t.indexOf(s):-1}}function rt(e,t,s,i,a,o,c,l,d){const{card:j,index:O}=R(e,s);if(!(Ot&&l>d)&&j&&O!==t){const I=tt(s);I.splice(O,1),I.splice(t,0,j);const _=tt(a);switch(o){case"actions":_.actions[c]=I,ct(i,_);return;case"conditions":_.conditions[c]=I,ct(i,_);return;default:_.triggers=I,ct(i,_);return}}}const Dn="_drag_7xfhc_1",kn="_root_7xfhc_11",gt={drag:Dn,root:kn},At=({typeBlock:e,allProperties:t,id:s,isActive:i,setUserRules:a,userRules:o,children:c,_id:l,blockValue:d})=>{const{setOnUpdate:j}=nt(et),[{opacity:O},I,_]=$t({type:"box",item:()=>({...t,id:s,isActive:i,_id:l}),end:(w,f)=>{const{acceptedBy:x}=w,p=f.getDropResult();let g;if(!p)return typeof l=="number"&&!f.getTargetIds().length&&(g=K(x,o,d),g=z(x,g,d,l),a(g)),null;if(p.blockValue!==d){const C=typeof l=="number"?l:Date.now();g=K(x,o,p.blockValue);const q={id:w.id,acceptedBy:w.acceptedBy};switch(x){case"actions":return d&&(g=z("actions",g,d,C)),g=z("actions",g,p.blockValue,C),g.actions[p.blockValue].push({...q,_id:C}),a(g);case"conditions":return typeof d=="number"&&(g=z("conditions",g,d,C)),g=z("conditions",g,p.blockValue,C),g.conditions[p.blockValue].push({...q,_id:C}),a(g);default:return j(!0),g=z("triggers",g,p.blockValue,C),g.triggers.push({...q,_id:C}),a(g)}}},collect:w=>({opacity:w.isDragging()?.4:1,isDragging:w.isDragging()})}),r=ut(null),[,k]=bt({accept:"box",canDrop:()=>!1,hover({_id:w,acceptedBy:f},x){var T;if(!r.current||e!==f)return;const p=(T=r.current)==null?void 0:T.getBoundingClientRect(),g=(p.bottom-p.top)/2,C=x.getClientOffset(),q=((C==null?void 0:C.y)||0)-p.top;if(l&&w!==l)switch(f){case"actions":if(d==="then"||d==="else"){const{index:S}=R(l,o.actions[d]);S!==w&&rt(w,S,o[f][d],a,o,f,d,q,g)}return;case"conditions":if(typeof d=="number"){const{index:S}=R(l,o[f][d]);S!==w&&rt(w,S,o[f][d],a,o,f,d,q,g)}return;default:{const{index:S}=R(l,o[f]);S!==w&&rt(w,S,o[f],a,o,f,void 0,q,g);return}}}});E(()=>{_(Gt(),{captureDraggingState:!0})},[]),I(k(r));const H=window.innerWidth<600;return n.jsxs("div",{ref:H&&l?null:r,className:gt.root,style:{opacity:O},children:[n.jsx("div",{className:l?gt.drag:null,ref:l&&H?r:null}),c]})},Sn=({onClose:e,open:t})=>n.jsxs(wt,{open:t,onClose:e,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[n.jsx(Ct,{children:n.jsxs("div",{style:{fontSize:"1rem",fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif',fontWeight:400,lineHeight:1.5,letterSpacing:"0.00938em"},children:[n.jsx("h3",{children:u.I18n.t("On condition change")}),n.jsx("div",{children:u.I18n.t("help_on_change")}),n.jsx("h3",{children:u.I18n.t("Just check")}),n.jsx("div",{children:u.I18n.t("help_just_check")})]})}),n.jsx(vt,{children:n.jsx(jt,{onClick:e,color:"primary",autoFocus:!0,startIcon:n.jsx(Lt,{}),children:u.I18n.t("OK")})})]}),Nn=({onClose:e,open:t})=>n.jsxs(wt,{open:t,onClose:e,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[n.jsx(Ct,{children:n.jsxs(Tt,{id:"alert-dialog-description",children:[n.jsx("h3",{children:u.I18n.t("On condition change")}),n.jsx("div",{children:u.I18n.t("help_on_change")}),n.jsx("h3",{children:u.I18n.t("Just check")}),n.jsx("div",{children:u.I18n.t("help_just_check")})]})}),n.jsx(vt,{children:n.jsx(jt,{onClick:e,color:"primary",autoFocus:!0,children:u.I18n.t("OK")})})]}),ht=({size:e,blockValue:t,boolean:s,typeBlock:i,userRules:a,setUserRules:o,animation:c,setTourStep:l,tourStep:d,isTourOpen:j,theme:O,themeType:I,themeName:_})=>{var W;const[r,k]=M(!1),[H,w]=M(!1),[f,x]=M(!1),[p,g]=M("");s===void 0&&(s=!0);const C=bt({accept:"box",drop:()=>({blockValue:t}),hover:({acceptedBy:A,_id:L},Z)=>{k(A===i),x(!!L),g(Z.getHandlerId()||"")},canDrop:({acceptedBy:A})=>(w(A===i),A===i),collect:A=>{var L;return{isOver:A.isOver(),canDrop:((L=A.getItem())==null?void 0:L.acceptedBy)===i,offset:A.getClientOffset(),targetId:A.getHandlerId()}}}),q=C[0],{canDrop:T,isOver:S,offset:B,targetId:N}=q,h=C[1];E(()=>{g("")},[B]);const b=T&&S;let v="";b?v=r?"#00fb003d":"#fb00002e":T?v=H?"#00fb003d":"#fb00002e":B&&(v=N===p?"#fb00002e":"");let m;return i==="actions"?m=a.actions[t]:i==="conditions"?m=a.conditions[t]:m=a.triggers,n.jsx("div",{ref:h,style:{backgroundColor:v},className:`${u.Utils.clsx(D.contentBlockItem,e&&D.addClassHeight)} ${s?c?D.contentHeightOn:null:D.contentHeightOff}`,children:n.jsxs("div",{className:D.wrapperMargin,children:[m.map(A=>n.jsx(At,{typeBlock:i,...A,blockValue:t,allProperties:A,userRules:a,setUserRules:o,children:n.jsx(Ot,{...A,isTourOpen:j,setTourStep:l,tourStep:d,settings:A,blockValue:t,userRules:a,setUserRules:o,theme:O,themeType:I,themeName:_})},A._id)),n.jsx("div",{style:b&&r&&!f?{height:((W=document.getElementById("height"))==null?void 0:W.clientHeight)||200}:void 0,className:`${D.emptyBlockStyle} ${b&&r&&!f?D.emptyBlock:D.emptyBlockNone}`})]})})},at=({size:e,typeBlock:t,name:s,nameAdditionally:i,additionally:a,border:o,userRules:c,setUserRules:l,iconName:d,adapter:j,socket:O,setTourStep:I,tourStep:_,isTourOpen:r,theme:k,themeType:H,themeName:w})=>{const[f,x,p]=dt(t==="actions"?!1:[],`additionallyClickItems_${t}`),[g,C]=M(!1),[q,T]=M(!1);E(()=>{if(t==="conditions"&&(f==null?void 0:f.length)!==c.conditions.length-1){const N=[];c.conditions.forEach((h,b)=>{b>0&&N.push({_id:Date.now(),open:!0})}),x([...f,...N])}t==="actions"&&!p&&c.actions.else.length&&x(!0)},[]);const[S,B]=M(!1);return n.jsxs("div",{className:`${u.Utils.clsx(D.mainBlockItemRules,e&&D.addClassOverflow)} ${o&&!e?D.border:null}`,children:[n.jsxs("span",{id:"width",className:D.nameBlockItems,children:[n.jsx(Y,{iconName:d,className:D.iconThemCard,adapter:j,socket:O}),s]}),t==="conditions"?n.jsxs("div",{style:{width:"100%"},children:[n.jsxs(Et,{variant:"standard",className:D.selectOnChange,value:c.justCheck||!1,onChange:N=>{const h=K("conditions",c);h.justCheck=N.target.value==="true",l(h)},children:[n.jsx(mt,{value:"false",children:u.I18n.t("on condition change")}),n.jsx(mt,{value:"true",children:u.I18n.t("just check")})]}),n.jsx(Pt,{size:"small",title:u.I18n.t("Explanation"),className:D.selectOnChangeHelp,onClick:()=>C(!0),children:n.jsx(qt,{className:D.selectOnChangeHelpIcon})})]}):null,n.jsx(ht,{setTourStep:I,tourStep:_,isTourOpen:r,blockValue:t==="actions"?"then":t==="conditions"?0:t,typeBlock:t,setUserRules:l,userRules:c,theme:k,themeName:w,themeType:H,size:e}),a&&[...Array(t==="actions"?1:c.conditions.length-1)].map((N,h)=>{const b=(v=h)=>t==="actions"?!!f:!!f.find((m,W)=>W===v&&m.open);return n.jsxs(xt,{children:[n.jsxs("div",{onClick:()=>{if(t==="actions")return x(!f),null;let v=JSON.parse(JSON.stringify(f));if(c.conditions[h+1].length)return v[h].open=!v[h].open,x(v),null;v=v.filter((m,W)=>W!==h),x(v),B(h),setTimeout(()=>{B(!1),l({...c,conditions:[...c.conditions.filter((m,W)=>W!==h+1)]})},250)},className:D.blockCardAdd,children:[b()?"-":"+",n.jsx("div",{className:D.cardAdd,children:i})]},h),n.jsx(ht,{blockValue:t==="actions"?"else":t==="conditions"?h+1:t,typeBlock:t,setUserRules:l,userRules:c,boolean:b(),animation:S===h,size:e,theme:k,themeName:w,themeType:H})]},`${h}_block_${t}`)}),a&&t==="conditions"&&n.jsxs("div",{onClick:()=>{x([...f,{_id:Date.now(),open:!0}]),l({...c,conditions:[...c.conditions,[]]}),B(c.conditions.length-1),setTimeout(()=>B(!1),1e3)},className:D.blockCardAdd,children:["+",n.jsx("div",{className:D.cardAdd,children:i})]}),n.jsx(Sn,{open:g,onClose:()=>C(!1)}),n.jsx(Nn,{open:q,onClose:()=>T(!1)})]})},$n="_menuRules_1qqcb_1",qn="_switchesRenderWrapper_1qqcb_13",Bn="_menuOff_1qqcb_22",Mn="_menuTitle_1qqcb_28",Hn="_marginAuto_1qqcb_42",Wn="_inputWidth_1qqcb_47",Tn="_menuWrapper_1qqcb_52",En="_hamburgerWrapper_1qqcb_57",Pn="_hamburgerOff_1qqcb_74",Un="_nothingFound_1qqcb_82",Fn="_resetSearch_1qqcb_89",Jn="_controlPanel_1qqcb_101",Ln="_controlPanelAppBar_1qqcb_112",zn="_addClassMenu_1qqcb_126",Gn="_addClassBackground_1qqcb_132",Kn="_addClassPosition_1qqcb_136",$={menuRules:$n,switchesRenderWrapper:qn,menuOff:Bn,menuTitle:Mn,marginAuto:Hn,inputWidth:Wn,menuWrapper:Tn,hamburgerWrapper:En,hamburgerOff:Pn,nothingFound:Un,resetSearch:Fn,controlPanel:Jn,controlPanelAppBar:Ln,addClassMenu:zn,addClassBackground:Gn,addClassPosition:Kn},Qn=e=>{const{allProperties:t,allProperties:{acceptedBy:s,id:i},setUserRules:a,userRules:o,setTourStep:c,tourStep:l,isTourOpen:d,onTouchMove:j,isActive:O}=e;return n.jsx(At,{allProperties:t,id:t.id,isActive:O,setUserRules:a,userRules:o,children:n.jsx(It,{onDoubleClick:()=>{d&&l===J.addScheduleByDoubleClick&&i==="TriggerScheduleBlock"&&c(J.openTagsMenu),d&&l===J.addActionPrintText&&i==="ActionPrintText"&&c(J.showJavascript);const I=Date.now();let _;switch(s){case"actions":_="then";break;case"conditions":_=o[s].length-1;break}const r=K(s,o,_),k={id:i,_id:I,acceptedBy:s};_!==void 0?s==="actions"?r.actions[_].push({...k}):s==="conditions"&&r.conditions[_].push({...k}):r.triggers.push({...k}),a(r)},...e,...t,onTouchMove:j})})},Yn="_hamburgerMenu_hqnsm_8",Zn="_animate_hqnsm_21",_t={hamburgerMenu:Yn,animate:Zn};function Xn({bool:e}){return n.jsx("div",{className:`${_t.hamburgerMenu} ${e?_t.animate:""}`})}const Vn=({addClass:e,setAllBlocks:t,allBlocks:s,userRules:i,onChangeBlocks:a,setTourStep:o,tourStep:c,isTourOpen:l})=>{const{blocks:d,socket:j}=nt(et),[O,I]=dt(!1,"hamburgerOnOff"),[_,r]=dt({text:"",type:"triggers",index:0},"filterControlPanel"),k=(f=_.text,x=_.type)=>{if(!d)return;let p=[...d];p=p.filter(g=>{if(!f)return!0;const{name:C}=g.getStaticData();return C&&u.I18n.t(C).toLowerCase().includes(f.toLowerCase())}),p=p.filter(g=>x===g.getStaticData().acceptedBy),t(p)},H=(f,x)=>{l&&x===0&&c===J.selectTriggers&&o(J.addScheduleByDoubleClick),l&&x===2&&c===J.selectActions&&o(J.addActionPrintText),r({..._,index:x,type:["triggers","conditions","actions"][x]}),k(_.text,["triggers","conditions","actions"][x])},w=f=>({id:`scrollable-force-tab-${f}`,"aria-controls":`scrollable-force-tabpanel-${f}`});return E(()=>{k()},[d]),n.jsx(Ut,{mouseEvent:!1,touchEvent:"onTouchStart",onClickAway:()=>I(!0),children:n.jsxs("div",{className:u.Utils.clsx($.menuWrapper,e[1035]&&$.addClassMenu),children:[n.jsx("div",{className:`${$.hamburgerWrapper} ${O?$.hamburgerOff:null}`,onClick:()=>I(!O),children:n.jsx(Xn,{bool:!O})}),n.jsxs("div",{className:`${u.Utils.clsx($.menuRules,e[1035]&&$.addClassBackground,e[835]&&$.addClassPosition)} ${O?$.menuOff:null}`,children:[n.jsx("div",{className:$.controlPanel,children:n.jsx(Ft,{className:$.controlPanelAppBar,position:"static",children:n.jsxs(Jt,{value:_.index,onChange:H,children:[n.jsx(st,{className:"blocks-triggers",title:u.I18n.t("Triggers"),icon:n.jsx(Y,{iconName:"FlashOn"}),...w(0)}),n.jsx(st,{title:u.I18n.t("Conditions"),className:"blocks-conditions",icon:n.jsx(Y,{iconName:"Help"}),...w(1)}),n.jsx(st,{title:u.I18n.t("Actions"),className:"blocks-actions",icon:n.jsx(Y,{iconName:"PlayForWork"}),...w(2)})]})})}),n.jsx("div",{className:$.switchesRenderWrapper,children:n.jsxs("span",{children:[s.map(f=>{const{name:x,id:p,icon:g,adapter:C}=f.getStaticData();return n.jsx(xt,{children:n.jsx(Qn,{adapter:C,allProperties:f.getStaticData(),icon:g,id:p,isActive:!1,isTourOpen:l,name:x,onTouchMove:()=>I(!0),setTourStep:o,setUserRules:a,socket:j,tourStep:c,userRules:i})},p)}),!s.length&&n.jsxs("div",{className:$.nothingFound,children:[u.I18n.t("Nothing found"),"...",n.jsx("div",{className:$.resetSearch,onClick:()=>{r({..._,text:""}),k("")},children:u.I18n.t("reset search")})]})]})}),n.jsx("div",{className:u.Utils.clsx($.menuTitle,$.marginAuto)}),n.jsx(Bt,{className:$.inputWidth,fullWidth:!0,customValue:!0,value:_.text,size:"small",autoComplete:"off",label:u.I18n.t("search"),variant:"outlined",onChange:f=>{r({..._,text:f}),k(f)}})]})]})})};let pt=[];const me=({code:e,onChange:t,themeName:s,themeType:i,theme:a,setTourStep:o,tourStep:c,isTourOpen:l,command:d,scriptId:j,changed:O,running:I})=>{var v;const{blocks:_,socket:r,setOnUpdate:k,setOnDebugMessage:H,setEnableSimulation:w}=nt(et),[f,x]=M([]),[p,g]=M(ft(e)),[C,q]=M(""),[T,S]=M(!1);E(()=>{let m,W;const A=(P,y)=>{P===`${m}.alive`&&W!==(y==null?void 0:y.val)&&(W=!!(y!=null&&y.val),W&&m&&(r==null||r.sendTo(m.replace(/^system\.adapter\./,""),"rulesOn",j)))},L=(P,y)=>{var U,Q;r&&m!==((U=y==null?void 0:y.common)==null?void 0:U.engine)&&(m&&(r.unsubscribeState(`${m}.alive`,A),W&&r.sendTo(m.replace(/^system\.adapter\./,""),"rulesOn",j)),m=(Q=y==null?void 0:y.common)==null?void 0:Q.engine,m&&m&&r.subscribeState(`${m}.alive`,A))},Z=(P,y)=>{if(y)try{const U=JSON.parse(y.val),Q=Date.now();if(U.ruleId===j&&Q-U.ts<1e3){const F=[...pt,{blockId:U.blockId,data:U.data,ts:U.ts}];F.length>200&&F.splice(0,200-F.length);for(let X=F.length-1;X>=0;X--)if(F[X].ts{var y;m=(y=P==null?void 0:P.common)==null?void 0:y.engine,r.subscribeObject(j,L),m&&(r.subscribeState(`${m}.alive`,A),r.subscribeState(`${m.replace(/^system\.adapter\./,"")}.debug.rules`,Z))}),function(){r==null||r.unsubscribeObject(j,L),m&&(r==null||r.unsubscribeState(`${m}.alive`,A),W&&(r==null||r.sendTo(m.replace(/^system\.adapter\./,""),"rulesOff",j)),r==null||r.unsubscribeState(`${m.replace(/^system\.adapter\./,"")}.debug.rules`,Z))}},[]),E(()=>{w(!O&&I)},[O,I,w]),E(()=>{d&&(q(d),T||S(!0))},[d]),E(()=>{const m=ft(e);JSON.stringify(m)!==JSON.stringify(p)&&(g(m),k(!0))},[e]),E(()=>{document.getElementsByTagName("HTML")[0].className=s||"blue"},[s]);const B=lt(m=>{g(m),_&&t(Mt(m,_))},[_,t]),N=ut(null),[h,b]=M({835:!1,1035:!1});return E(()=>{N.current&&(N.current.clientWidth<=1035&&b({835:!1,1035:!0}),N.current.clientWidth<=835&&b({1035:!0,835:!0}),N.current.clientWidth>1035&&b({835:!1,1035:!1}))},[((v=N.current)==null?void 0:v.clientWidth)||0]),!_||!r?null:n.jsxs("div",{className:ot.wrapperRules,ref:N,children:[n.jsx(ln,{allBlocks:f,socket:r}),T?C==="export"?n.jsx(Ht,{scriptId:j,themeType:i,onClose:()=>S(!1),text:JSON.stringify(p,null,2)}):n.jsx(Wt,{themeType:i,onClose:m=>{S(!1),m&&B(JSON.parse(m))}}):null,n.jsxs("div",{className:u.Utils.clsx(ot.rootWrapper,h[835]&&ot.addClass),children:[n.jsx(Vn,{setAllBlocks:x,allBlocks:f,userRules:p,onChangeBlocks:B,setTourStep:o,tourStep:c,addClass:h,isTourOpen:l}),n.jsx(at,{socket:r,setUserRules:B,userRules:p,isTourOpen:l,setTourStep:o,tourStep:c,name:`${u.I18n.t("when")}...`,typeBlock:"triggers",iconName:"FlashOn",size:h[835],themeType:i,themeName:s,theme:a}),n.jsx(at,{socket:r,setUserRules:B,isTourOpen:l,setTourStep:o,tourStep:c,userRules:p,name:`...${u.I18n.t("and")}...`,typeBlock:"conditions",iconName:"Help",nameAdditionally:u.I18n.t("or"),additionally:!0,border:!0,size:h[835],themeType:i,themeName:s,theme:a}),n.jsx(at,{socket:r,setUserRules:B,isTourOpen:l,setTourStep:o,tourStep:c,userRules:p,name:`...${u.I18n.t("then")}`,typeBlock:"actions",iconName:"PlayForWork",nameAdditionally:u.I18n.t("else"),additionally:!0,size:h[835],themeType:i,themeName:s,theme:a})]})]},"rulesEditor")};export{me as default}; diff --git a/admin/tab.html b/admin/tab.html index c4c4f9c51..480af2523 100644 --- a/admin/tab.html +++ b/admin/tab.html @@ -115,7 +115,7 @@ type="text/javascript" src="google-blockly/own/blocks_object.js" > - + diff --git a/build/lib/sandbox.js b/build/lib/sandbox.js index f4d2c814b..c2947e027 100644 --- a/build/lib/sandbox.js +++ b/build/lib/sandbox.js @@ -2154,6 +2154,7 @@ function sandBox(script, name, verbose, debug, context) { state.ack !== undefined ? state.ack : isAck, + scriptName: name, }); return context.timerId; }, diff --git a/build/lib/sandbox.js.map b/build/lib/sandbox.js.map index 3ba99ed44..74f7aa3bf 100644 --- a/build/lib/sandbox.js.map +++ b/build/lib/sandbox.js.map @@ -1 +1 @@ -{"version":3,"file":"sandbox.js","sourceRoot":"","sources":["../../src/lib/sandbox.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,0BAgjLC;AAxlLD,oDAAsC;AAItC,yDAAqD;AAErD,mCAA6E;AAmB7E,oDAAsC;AACtC,kDAAoC;AACpC,wDAA0C;AAC1C,uEAGmC;AAKnC,MAAM,kBAAkB,GAAG,YAAY,CAAC;AAExC,MAAM,aAAa,GAAG,0BAAW,CAAC,aAAa,CAAC;AAEhD,SAAgB,OAAO,CACnB,MAAgB,EAChB,IAAY,EACZ,OAA4B,EAC5B,KAA0B,EAC1B,OAA0B;IAE1B,MAAM,MAAM,GAAG,SAAS,CAAC;IACzB,MAAM,KAAK,GAAG,QAAQ,CAAC;IACvB,MAAM,QAAQ,GAAG,WAAW,CAAC;IAC7B,MAAM,uBAAuB,GAAG,iDAA0B,CAAC;IAC3D,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;IAEnC,MAAM,OAAO,GAAqB,OAAO,CAAC,OAAO,CAAC;IAClD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAC1B,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC9B,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAChC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC9B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC5B,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAEpC,wCAAwC;IACxC,IAAI,OAAoB,CAAC;IAEzB,SAAS,eAAe,CAAC,CAAQ;QA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AC,aAAa,GAAG,IAAA,iBAAS,EAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEpD,uFAAuF;IACvF,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACtC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE;YACjC,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,KAAK;SAClB,CAAC,CAAC;IACP,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC","sourcesContent":["import type { ChildProcess, ExecOptions } from 'node:child_process';\nimport * as jsonataMod from 'jsonata';\nimport type { SendMailOptions } from 'nodemailer';\nimport type { AxiosError, AxiosHeaderValue, AxiosResponse, ResponseType } from 'axios';\n\nimport { commonTools } from '@iobroker/adapter-core';\n\nimport { isObject, isArray, promisify, getHttpRequestConfig } from './tools';\nimport type {\n JavaScriptAdapterConfig,\n AstroRule,\n ChangeType,\n CommonAlias,\n FileSubscriptionResult,\n IobSchedule,\n JavascriptContext,\n JsScript,\n LogMessage,\n Pattern,\n PushoverOptions,\n SandboxType,\n Selector,\n SubscribeObject,\n SubscriptionResult,\n TimeRule,\n} from '../types';\nimport * as constsMod from './consts';\nimport * as wordsMod from './words';\nimport * as eventObjMod from './eventObj';\nimport {\n patternCompareFunctions as patternCompareFunctionsMod,\n type PatternEventCompareFunction,\n} from './patternCompareFunctions';\nimport type { ScheduleName, SchedulerRule } from './scheduler';\nimport type { EventObj } from './eventObj';\nimport type { AstroEvent } from './consts';\n\nconst SCRIPT_CODE_MARKER = 'script.js.';\n\nconst pattern2RegEx = commonTools.pattern2RegEx;\n\nexport function sandBox(\n script: JsScript,\n name: string,\n verbose: boolean | undefined,\n debug: boolean | undefined,\n context: JavascriptContext,\n): SandboxType {\n const consts = constsMod;\n const words = wordsMod;\n const eventObj = eventObjMod;\n const patternCompareFunctions = patternCompareFunctionsMod;\n const jsonata = jsonataMod.default;\n\n const adapter: ioBroker.Adapter = context.adapter;\n const mods = context.mods;\n const states = context.states;\n const objects = context.objects;\n const timers = context.timers;\n const enums = context.enums;\n const debugMode = context.debugMode;\n\n // eslint-disable-next-line prefer-const\n let sandbox: SandboxType;\n\n function errorInCallback(e: Error): void {\n void adapter.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: true,\n ack: true,\n c: 'errorInCallback',\n });\n context.logError(name, 'Error in callback:', e);\n context.debugMode && console.log(`error$$${name}$$Exception in callback: ${e}`, Date.now());\n }\n\n function subscribePattern(script: JsScript, pattern: string): void {\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n if (!script.subscribes[pattern]) {\n script.subscribes[pattern] = 1;\n } else {\n script.subscribes[pattern]++;\n }\n\n if (!context.subscribedPatterns[pattern]) {\n context.subscribedPatterns[pattern] = 1;\n\n if (sandbox.verbose) {\n sandbox.log(`subscribePattern(pattern=${pattern})`, 'info');\n }\n adapter.subscribeForeignStates(pattern);\n\n // request current value to deliver old value on change.\n if (typeof pattern === 'string' && !pattern.includes('*')) {\n void adapter.getForeignState(pattern, (_err, state) => {\n if (state) {\n states[pattern] = state;\n }\n });\n } else {\n adapter.getForeignStates(\n pattern,\n (_err, _states) => _states && Object.keys(_states).forEach(id => (states[id] = _states[id])),\n );\n }\n } else {\n context.subscribedPatterns[pattern]++;\n }\n }\n }\n\n function unsubscribePattern(script: JsScript, pattern: string): void {\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n if (script.subscribes[pattern]) {\n script.subscribes[pattern]--;\n if (!script.subscribes[pattern]) {\n delete script.subscribes[pattern];\n }\n }\n\n if (context.subscribedPatterns[pattern]) {\n context.subscribedPatterns[pattern]--;\n if (!context.subscribedPatterns[pattern]) {\n adapter.unsubscribeForeignStates(pattern);\n delete context.subscribedPatterns[pattern];\n\n // if the pattern was regex or with * some states will stay in RAM, but it is OK.\n if (states[pattern]) {\n delete states[pattern];\n }\n }\n }\n }\n }\n\n function subscribeFile(script: JsScript, id: string, fileNamePattern: string): void {\n const key = `${id}$%$${fileNamePattern}`;\n if (!script.subscribesFile[key]) {\n script.subscribesFile[key] = 1;\n } else {\n script.subscribesFile[key]++;\n }\n\n if (!context.subscribedPatternsFile[key]) {\n context.subscribedPatternsFile[key] = 1;\n void adapter.subscribeForeignFiles(id, fileNamePattern);\n } else {\n context.subscribedPatternsFile[key]++;\n }\n }\n\n function unsubscribeFile(script: JsScript, id: string, fileNamePattern: string): void {\n const key = `${id}$%$${fileNamePattern}`;\n if (script.subscribesFile[key]) {\n script.subscribesFile[key]--;\n if (!script.subscribesFile[key]) {\n delete script.subscribesFile[key];\n }\n }\n\n if (context.subscribedPatternsFile[key]) {\n context.subscribedPatternsFile[key]--;\n if (!context.subscribedPatternsFile[key]) {\n void adapter.unsubscribeForeignFiles(id, fileNamePattern);\n delete context.subscribedPatternsFile[key];\n }\n }\n }\n\n function getPatternCompareFunctions(pattern: Pattern): PatternEventCompareFunction[] & { logic?: 'and' | 'or' } {\n let func: PatternEventCompareFunction;\n const functions: PatternEventCompareFunction[] & { logic?: 'and' | 'or' } = [];\n functions.logic = pattern.logic || 'and';\n\n for (const key in pattern) {\n if (!Object.prototype.hasOwnProperty.call(pattern, key)) {\n continue;\n }\n if (key === 'logic') {\n continue;\n }\n if (key === 'change' && pattern.change === 'any') {\n continue;\n }\n const _func: (pattern: Pattern) => PatternEventCompareFunction = (\n patternCompareFunctions as unknown as Record PatternEventCompareFunction>\n )[key];\n if (!_func) {\n continue;\n }\n func = _func(pattern);\n if (typeof func !== 'function') {\n continue;\n }\n functions.push(func);\n }\n return functions;\n }\n\n /**\n * Splits a selector string into attribute and value\n *\n * @param selector The selector string to split\n */\n function splitSelectorString(selector: string): Selector {\n const parts = selector.split('=', 2);\n if (parts[1] && parts[1][0] === '\"') {\n parts[1] = parts[1].substring(1);\n const len = parts[1].length;\n if (parts[1] && parts[1][len - 1] === '\"') {\n parts[1] = parts[1].substring(0, len - 1);\n }\n }\n if (parts[1] && parts[1][0] === \"'\") {\n parts[1] = parts[1].substring(1);\n const len = parts[1].length;\n if (parts[1] && parts[1][len - 1] === \"'\") {\n parts[1] = parts[1].substring(0, len - 1);\n }\n }\n\n if (parts[1]) {\n parts[1] = parts[1].trim();\n }\n parts[0] = parts[0].trim();\n\n return { attr: parts[0], value: parts[1] };\n }\n\n /**\n * Transforms a selector string with wildcards into a regular expression\n *\n * @param str The selector string to transform into a regular expression\n */\n function selectorStringToRegExp(str: string): RegExp {\n const startsWithWildcard = str[0] === '*';\n const endsWithWildcard = str[str.length - 1] === '*';\n\n // Sanitize the selector, so it is safe to use in a RegEx\n // Taken from https://stackoverflow.com/a/3561711/10179833 but modified\n // since * has a special meaning in our selector and should not be escaped\n // eslint-disable-next-line no-useless-escape\n str = str.replace(/[-\\/\\\\^$+?.()|[\\]{}]/g, '\\\\$&').replace(/\\*/g, '.*');\n\n return new RegExp((startsWithWildcard ? '' : '^') + str + (endsWithWildcard ? '' : '$'));\n }\n\n /**\n * Adds a regular expression for selectors targeting the state ID\n *\n * @param selector The selector to apply the transform to\n */\n function addRegExpToIdAttrSelectors(selector: Selector): Selector {\n if ((selector.attr === 'id' || selector.attr === 'state.id') && !selector.idRegExp && selector.value) {\n return {\n attr: selector.attr,\n value: selector.value,\n idRegExp: selectorStringToRegExp(selector.value),\n };\n }\n return selector;\n }\n\n /**\n * Tests if a value loosely equals (==) the reference string.\n * In contrast to the equality operator, this treats true == \"true\" as well\n * so we can test common and native attributes for boolean values\n *\n * @param value The value to compare with the reference\n * @param reference The reference to compare the value to\n */\n function looselyEqualsString(value: string | number | boolean | undefined, reference: string): boolean {\n // For booleans, compare the string representation\n // For other types do a loose comparison\n return typeof value === 'boolean'\n ? (value && reference === 'true') || (!value && reference === 'false')\n : value == reference;\n }\n\n /**\n * Returns the `common.type` for a given variable\n */\n function getCommonTypeOf(value: any): ioBroker.CommonType {\n return isArray(value) ? 'array' : isObject(value) ? 'object' : (typeof value as ioBroker.CommonType);\n }\n\n /**\n * Returns if an id is in an allowed namespace for automatic object creations\n *\n * @param id id to check\n */\n function validIdForAutomaticFolderCreation(id: string): boolean {\n return id.startsWith('javascript.') || id.startsWith('0_userdata.0.') || id.startsWith('alias.0.');\n }\n\n /**\n * Iterate through object structure to create missing folder objects\n */\n async function ensureObjectStructure(id: string): Promise {\n if (!validIdForAutomaticFolderCreation(id)) {\n return;\n }\n if (context.folderCreationVerifiedObjects[id] === true) {\n return;\n }\n const idArr = id.split('.');\n idArr.pop(); // the last is created as an object in any way\n if (idArr.length < 3) {\n return; // Nothing to do\n }\n // We just create sublevel projects\n let idToCheck = idArr.splice(0, 2).join('.');\n\n context.folderCreationVerifiedObjects[id] = true;\n for (const part of idArr) {\n idToCheck += `.${part}`;\n if (context.folderCreationVerifiedObjects[idToCheck] === true || objects[idToCheck]) {\n continue;\n }\n context.folderCreationVerifiedObjects[idToCheck] = true;\n let obj: ioBroker.Object | null | undefined;\n try {\n obj = await adapter.getForeignObjectAsync(idToCheck);\n } catch {\n // ignore\n }\n if (!obj?.common) {\n sandbox.log(`Create folder object for ${idToCheck}`, 'debug');\n try {\n await adapter.setForeignObjectAsync(idToCheck, {\n _id: idToCheck,\n type: 'folder',\n common: {\n name: part,\n },\n native: {\n autocreated: 'by automatic ensure logic',\n },\n } as ioBroker.FolderObject);\n } catch (err: any) {\n sandbox.log(`Could not automatically create folder object ${idToCheck}: ${err.message}`, 'info');\n }\n } else {\n //sandbox.log(` already existing \"${idToCheck}\": ${JSON.stringify(obj)}`, 'debug');\n }\n }\n }\n\n function setStateHelper(\n sandbox: SandboxType,\n isCreate: boolean,\n isChanged: boolean,\n id: string,\n state: null | ioBroker.SettableState | ioBroker.StateValue,\n isAck: boolean | 'true' | 'false' | undefined | ((error?: Error | null) => void),\n callback?: (error?: Error | null) => void,\n ): void {\n if (typeof isAck === 'function') {\n callback = isAck;\n isAck = undefined;\n }\n\n let stateNotNull: ioBroker.SettableState | ioBroker.StateValue;\n\n if (isAck === true || isAck === false || isAck === 'true' || isAck === 'false') {\n if (state && typeof state === 'object' && state.val !== undefined) {\n stateNotNull = state;\n // we assume that we were given a state object if\n // state is an object that contains a `val` property\n if (!Object.prototype.hasOwnProperty.call(state, 'ack')) {\n stateNotNull.ack = isAck === true || isAck === 'true';\n }\n } else if (state === null) {\n stateNotNull = { val: null, ack: isAck === true || isAck === 'true' };\n } else {\n // otherwise, assume that the given state is the value to be set\n stateNotNull = { val: state as ioBroker.StateValue, ack: isAck === true || isAck === 'true' };\n }\n } else if (state === null) {\n stateNotNull = { val: null };\n } else {\n stateNotNull = state;\n }\n\n // Check a type of state\n if (!objects[id] && objects[`${adapter.namespace}.${id}`]) {\n id = `${adapter.namespace}.${id}`;\n }\n\n if (isCreate) {\n if (id.match(/^javascript\\.\\d+\\.scriptEnabled/)) {\n sandbox.log(\n `Own states (${id}) should not be used in javascript.X.scriptEnabled.*! Please move the states to 0_userdata.0.*`,\n 'info',\n );\n } else if (id.match(/^javascript\\.\\d+\\.scriptProblem/)) {\n sandbox.log(\n `Own states (${id}) should not be used in javascript.X.scriptProblem.*! Please move the states to 0_userdata.0.*`,\n 'info',\n );\n }\n }\n\n const common = objects[id] ? objects[id].common : null;\n if (common?.type && common.type !== 'mixed' && common.type !== 'json') {\n // Find out which type the value has\n let actualCommonType: ioBroker.CommonType | undefined;\n if (typeof stateNotNull === 'object') {\n if (stateNotNull && stateNotNull.val !== undefined && stateNotNull.val !== null) {\n actualCommonType = getCommonTypeOf(stateNotNull.val);\n }\n } else if (stateNotNull !== null && stateNotNull !== undefined) {\n actualCommonType = getCommonTypeOf(stateNotNull);\n }\n // If this is not the expected one, issue a warning\n if (actualCommonType && actualCommonType !== common.type) {\n context.logWithLineInfo(\n `You are assigning a ${actualCommonType} to the state \"${id}\" which expects a ${common.type}. ` +\n `Please fix your code to use a ${common.type} or change the state type to ${actualCommonType}. ` +\n `This warning might become an error in future versions.`,\n );\n }\n\n if (actualCommonType === 'array' || actualCommonType === 'object') {\n try {\n if (typeof stateNotNull === 'object' && typeof stateNotNull.val !== 'undefined') {\n stateNotNull.val = JSON.stringify(stateNotNull.val);\n } else {\n stateNotNull = JSON.stringify(stateNotNull);\n }\n } catch (err: any) {\n context.logWithLineInfo(\n `Could not stringify value for type ${actualCommonType} and id ${id}: ${err.message}`,\n );\n if (typeof callback === 'function') {\n try {\n callback.call(\n sandbox,\n new Error(\n `Could not stringify value for type ${actualCommonType} and id ${id}: ${err.message}`,\n ),\n );\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n }\n }\n }\n // Check min and max of value\n if (typeof stateNotNull === 'object') {\n if (common && typeof stateNotNull.val === 'number') {\n const num: number = stateNotNull.val;\n if (common.min !== undefined && num < common.min) {\n stateNotNull.val = common.min;\n } else if (common.max !== undefined && num > common.max) {\n stateNotNull.val = common.max;\n }\n }\n } else if (common && typeof stateNotNull === 'number') {\n const num: number = stateNotNull;\n if (common.min !== undefined && num < common.min) {\n stateNotNull = common.min;\n }\n if (common.max !== undefined && num > common.max) {\n stateNotNull = common.max;\n }\n }\n\n let stateAsObject: ioBroker.State;\n // modify state here, to make it available in callback\n if (\n stateNotNull === null ||\n typeof stateNotNull !== 'object' ||\n (stateNotNull as ioBroker.SettableState).val === undefined\n ) {\n stateAsObject = context.prepareStateObject(id, {\n val: stateNotNull as ioBroker.StateValue,\n ack: isAck === true || isAck === 'true',\n });\n } else {\n stateAsObject = context.prepareStateObject(id, stateNotNull as ioBroker.SettableState);\n }\n\n // set as comment: from which script this state was set.\n stateAsObject.c = sandbox.scriptName;\n\n if (objects[id]) {\n script.setStatePerMinuteCounter++;\n if (sandbox.verbose) {\n sandbox.log(`setForeignState(id=${id}, state=${JSON.stringify(stateAsObject)})`, 'info');\n }\n\n if (debug) {\n sandbox.log(\n `setForeignState(id=${id}, state=${JSON.stringify(stateAsObject)}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n\n if (typeof callback === 'function') {\n setImmediate(() => {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n });\n }\n } else {\n if (!(adapter.config as JavaScriptAdapterConfig).subscribe) {\n // store actual state to make possible to process value in callback\n // risk that there will be an error on setState is very low,\n // but we will not store new state if the setStateChanged is called\n if (!isChanged) {\n context.interimStateValues[id] = stateAsObject;\n }\n }\n const errHandler = (err: Error | null | undefined, funcId: string): void => {\n err && sandbox.log(`${funcId}: ${err}`, 'error');\n // If adapter holds all states\n if (err && !(adapter.config as JavaScriptAdapterConfig).subscribe) {\n delete context.interimStateValues[id];\n }\n\n if (typeof callback === 'function') {\n setImmediate(() => {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n });\n }\n };\n if (isChanged) {\n if (!(adapter.config as JavaScriptAdapterConfig).subscribe && context.interimStateValues[id]) {\n // if the state is changed, we will compare it with interimStateValues\n const oldState = context.interimStateValues[id];\n const attrs: string[] = Object.keys(stateAsObject).filter(\n attr => attr !== 'ts' && (stateAsObject as Record)[attr] !== undefined,\n );\n if (\n !attrs.every(\n attr =>\n (stateAsObject as Record)[attr] ===\n (oldState as Record)[attr],\n )\n ) {\n // state is changed for sure, and we will call setForeignState\n // and store new state to interimStateValues\n context.interimStateValues[id] = stateAsObject;\n adapter.setForeignState(id, stateAsObject, err => errHandler(err, 'setForeignState'));\n } else {\n // otherwise - do nothing as we have cached state, except callback\n errHandler(null, 'setForeignStateCached');\n }\n } else {\n // adapter doesn't hold all states, or it has not cached then we will simply call setForeignStateChanged\n adapter.setForeignStateChanged(id, { ...stateAsObject, ts: undefined }, err =>\n errHandler(err, 'setForeignStateChanged'),\n );\n }\n } else {\n adapter.setForeignState(id, stateAsObject, err => errHandler(err, 'setForeignState'));\n }\n }\n } else {\n context.logWithLineInfo(`State \"${id}\" not found`);\n if (typeof callback === 'function') {\n setImmediate(() => {\n try {\n callback.call(sandbox, new Error(`State \"${id}\" not found`));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n });\n }\n }\n }\n\n sandbox = {\n mods,\n _id: script._id,\n // @deprecated use scriptName\n name,\n scriptName: name,\n instance: adapter.instance || 0,\n defaultDataDir: context.getAbsoluteDefaultDataDir(),\n verbose,\n exports: {}, // Polyfill for the export object in TypeScript modules\n require: function (md: string): any {\n if (typeof md === 'string' && md.startsWith('node:')) {\n md = md.replace(/^node:/, '');\n }\n\n if (md === 'request') {\n if (!sandbox.__engine.__deprecatedWarnings.includes(md)) {\n sandbox.log(\n `request package is deprecated - please use httpGet (or a stable lib like axios) instead!`,\n 'warn',\n );\n sandbox.__engine.__deprecatedWarnings.push(md);\n }\n }\n\n if (mods[md]) {\n return mods[md];\n }\n\n let error: Error | undefined;\n\n try {\n mods[md] = require(\n adapter.getAdapterScopedPackageIdentifier ? adapter.getAdapterScopedPackageIdentifier(md) : md,\n );\n return mods[md];\n } catch (e: any) {\n error = e as Error;\n }\n\n try {\n // the user requires a module which is not specified in the additional node modules\n // for backward compatibility we check if the module can simply be required directly before we fail (e.g., direct dependencies of JavaScript adapter)\n adapter.log.debug(`Try direct require of \"${md}\" as not specified in the additional dependencies`);\n mods[md] = require(md);\n\n return mods[md];\n } catch (e: any) {\n context.logError(name, `Error by loading module \"${md}\":`, error || e, 6);\n\n void adapter.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: true,\n ack: true,\n c: 'require',\n });\n }\n },\n Buffer: Buffer,\n __engine: {\n __deprecatedWarnings: [],\n __subscriptionsObject: 0,\n __subscriptions: 0,\n __subscriptionsMessage: 0,\n __subscriptionsFile: 0,\n __subscriptionsLog: 0,\n __schedules: 0,\n },\n\n $: function (selector: string): iobJS.QueryResult {\n // following is supported\n // 'type[commonAttr=something]', 'id[commonAttr=something]', id(enumName=\"something\")', id{nativeName=\"something\"}\n // Type can be state, channel or device\n // Attr can be any of the common attributes and can have wildcards *\n // E.g. \"state[id='hm-rpc.0.*]\" or \"hm-rpc.0.*\" returns all states of adapter instance hm-rpc.0\n // channel(room=\"Living room\") => all states in room \"Living room\"\n // channel{TYPE=BLIND}[state.id=*.LEVEL]\n // Switch all states with .STATE of channels with role \"switch\" in \"Wohnzimmer\" to false\n // $('channel[role=switch][state.id=*.STATE](rooms=Wohnzimmer)').setState(false);\n //\n // Following functions are possible, setValue, getValue (only from first), on, each\n\n // Todo CACHE!!!\n\n const result: iobJS.QueryResult = {} as iobJS.QueryResult;\n\n let name = '';\n const commonStrings: string[] = [];\n const enumStrings: string[] = [];\n const nativeStrings: string[] = [];\n let isInsideName = true;\n let isInsideCommonString = false;\n let isInsideEnumString = false;\n let isInsideNativeString = false;\n let currentCommonString = '';\n let currentNativeString = '';\n let currentEnumString = '';\n\n // parse string\n let selectorHasInvalidType = false;\n if (typeof selector === 'string') {\n for (let i = 0; i < selector.length; i++) {\n if (selector[i] === '{') {\n isInsideName = false;\n if (isInsideCommonString || isInsideEnumString || isInsideNativeString) {\n // Error\n break;\n }\n isInsideNativeString = true;\n } else if (selector[i] === '}') {\n isInsideNativeString = false;\n nativeStrings.push(currentNativeString);\n currentNativeString = '';\n } else if (selector[i] === '[') {\n isInsideName = false;\n if (isInsideCommonString || isInsideEnumString || isInsideNativeString) {\n // Error\n break;\n }\n isInsideCommonString = true;\n } else if (selector[i] === ']') {\n isInsideCommonString = false;\n commonStrings.push(currentCommonString);\n currentCommonString = '';\n } else if (selector[i] === '(') {\n isInsideName = false;\n if (isInsideCommonString || isInsideEnumString || isInsideNativeString) {\n // Error\n break;\n }\n isInsideEnumString = true;\n } else if (selector[i] === ')') {\n isInsideEnumString = false;\n enumStrings.push(currentEnumString);\n currentEnumString = '';\n } else if (isInsideName) {\n name += selector[i];\n } else if (isInsideCommonString) {\n currentCommonString += selector[i];\n } else if (isInsideEnumString) {\n currentEnumString += selector[i];\n } else if (isInsideNativeString) {\n currentNativeString += selector[i];\n } //else {\n // some error\n //}\n }\n } else {\n selectorHasInvalidType = true;\n }\n\n // If some error in the selector\n if (selectorHasInvalidType || isInsideEnumString || isInsideCommonString || isInsideNativeString) {\n result.length = 0;\n result.toArray = function () {\n return [];\n };\n result.each = function () {\n return this;\n };\n result.getState = function () {\n return null;\n };\n result.setState = function () {\n return this;\n };\n result.on = function () {\n return this;\n };\n }\n\n if (isInsideEnumString) {\n sandbox.log(`Invalid selector: enum close bracket \")\" cannot be found in \"${selector}\"`, 'warn');\n result.error = 'Invalid selector: enum close bracket \")\" cannot be found';\n return result;\n } else if (isInsideCommonString) {\n sandbox.log(`Invalid selector: common close bracket \"]\" cannot be found in \"${selector}\"`, 'warn');\n result.error = 'Invalid selector: common close bracket \"]\" cannot be found';\n return result;\n } else if (isInsideNativeString) {\n sandbox.log(`Invalid selector: native close bracket \"}\" cannot be found in \"${selector}\"`, 'warn');\n result.error = 'Invalid selector: native close bracket \"}\" cannot be found';\n return result;\n } else if (selectorHasInvalidType) {\n const message = `Invalid selector: selector must be a string but is of type ${typeof selector}`;\n sandbox.log(message, 'warn');\n result.error = message;\n return result;\n }\n\n let commonSelectors: Selector[] = commonStrings.map(selector => splitSelectorString(selector));\n let nativeSelectors: Selector[] = nativeStrings.map(selector => splitSelectorString(selector));\n const enumSelectorObjects: Selector[] = enumStrings.map(_enum => splitSelectorString(_enum));\n const allSelectors: Selector[] = commonSelectors.concat(nativeSelectors, enumSelectorObjects);\n\n // These selectors match the state or object ID and don't belong in the common/native selectors\n // Also use RegExp for the ID matching\n const stateIdSelectors: Selector[] = allSelectors\n .filter(selector => selector.attr === 'state.id')\n .map(selector => addRegExpToIdAttrSelectors(selector));\n const objectIdSelectors: Selector[] = allSelectors\n .filter(selector => selector.attr === 'id')\n .map(selector => addRegExpToIdAttrSelectors(selector));\n commonSelectors = commonSelectors.filter(\n selector => selector.attr !== 'state.id' && selector.attr !== 'id',\n );\n nativeSelectors = nativeSelectors.filter(\n selector => selector.attr !== 'state.id' && selector.attr !== 'id',\n );\n const enumSelectors: string[] = enumSelectorObjects\n .filter(selector => selector.attr !== 'state.id' && selector.attr !== 'id')\n // enums are filtered by their enum id, so transform the selector into that\n .map(selector => `enum.${selector.attr}.${selector.value}`);\n\n name = name.trim();\n\n if (name === 'channel' || name === 'device') {\n // Fill the channels and devices objects with the IDs of all their states,\n // so we can loop over them afterward\n if (!context.channels || !context.devices) {\n context.channels = {};\n context.devices = {};\n for (const _id in objects) {\n if (Object.prototype.hasOwnProperty.call(objects, _id) && objects[_id].type === 'state') {\n const parts = _id.split('.');\n parts.pop();\n const chn = parts.join('.');\n\n parts.pop();\n const dev = parts.join('.');\n\n context.devices[dev] = context.devices[dev] || [];\n context.devices[dev].push(_id);\n\n context.channels[chn] = context.channels[chn] || [];\n context.channels[chn].push(_id);\n }\n }\n }\n }\n\n if (name === 'schedule') {\n if (!context.schedules) {\n context.schedules = [];\n for (const _id in objects) {\n if (Object.prototype.hasOwnProperty.call(objects, _id) && objects[_id].type === 'schedule') {\n context.schedules.push(_id);\n }\n }\n }\n }\n\n /**\n * applies all selectors targeting an object or state ID\n */\n function applyIDSelectors(objId: string, selectors: Selector[]): boolean {\n // Only keep the ID if it matches every ID selector\n return selectors.every(selector => !selector.idRegExp || selector.idRegExp.test(objId));\n }\n\n /**\n * Applies all selectors targeting the Object common properties\n *\n * @param objId - The ID of the object in question\n */\n function applyCommonSelectors(objId: string): boolean {\n const obj = objects[objId];\n if (!obj?.common) {\n return false;\n }\n const objCommon = obj.common;\n\n // make sure this object satisfies all selectors\n return commonSelectors.every(\n selector =>\n // ensure a property exists\n (selector.value === undefined && objCommon[selector.attr] !== undefined) ||\n // or match exact values\n looselyEqualsString(objCommon[selector.attr], selector.value),\n );\n }\n\n /**\n * Applies all selectors targeting the Object native properties\n *\n * @param objId - The ID of the object in question\n */\n function applyNativeSelectors(objId: string): boolean {\n const obj = objects[objId];\n if (!obj || !obj.native) {\n return false;\n }\n const objNative = obj.native;\n // make sure this object satisfies all selectors\n return nativeSelectors.every(\n selector =>\n // ensure a property exists\n (selector.value === undefined && objNative[selector.attr] !== undefined) ||\n // or match exact values\n looselyEqualsString(objNative[selector.attr], selector.value),\n );\n }\n\n /**\n * Applies all selectors targeting the Objects enums\n *\n * @param objId - The ID of the object in question\n */\n function applyEnumSelectors(objId: string): boolean {\n const enumIds: string[] = [];\n eventObj.getObjectEnumsSync(context, objId, enumIds);\n // make sure this object satisfies all selectors\n return enumSelectors.every(_enum => enumIds.includes(_enum));\n }\n\n let res: string[];\n\n if (name === 'schedule') {\n res = context.schedules || [];\n if (objectIdSelectors.length) {\n res = res.filter(channelId => applyIDSelectors(channelId, objectIdSelectors));\n }\n\n // filter out those that don't match every common selector\n if (commonSelectors.length) {\n res = res.filter(id => applyCommonSelectors(id));\n }\n\n // filter out those that don't match every native selector\n if (nativeSelectors.length) {\n res = res.filter(id => applyNativeSelectors(id));\n }\n\n // filter out those that don't match every enum selector\n if (enumSelectors.length) {\n res = res.filter(channelId => applyEnumSelectors(channelId));\n }\n } else if (name === 'channel') {\n if (!context.channels) {\n // TODO: fill the channels and maintain them on all places where context.stateIds will be changed\n }\n const channels = context.channels || {};\n\n // go through all channels\n res = Object.keys(channels);\n // filter out those that don't match every ID selector for the channel ID\n if (objectIdSelectors.length) {\n res = res.filter(channelId => applyIDSelectors(channelId, objectIdSelectors));\n }\n // filter out those that don't match every common selector\n if (commonSelectors.length) {\n res = res.filter(channelId => applyCommonSelectors(channelId));\n }\n // filter out those that don't match every native selector\n if (nativeSelectors.length) {\n res = res.filter(channelId => applyNativeSelectors(channelId));\n }\n // filter out those that don't match every enum selector\n if (enumSelectors.length) {\n res = res.filter(channelId => applyEnumSelectors(channelId));\n }\n\n // retrieve the state ID collection for all remaining channels\n res = res\n .map(id => channels[id])\n // and flatten the array to get only the state IDs\n .reduce((acc, next) => acc.concat(next), []);\n\n // now filter out those that don't match every ID selector for the state ID\n if (stateIdSelectors.length) {\n res = res.filter(stateId => applyIDSelectors(stateId, stateIdSelectors));\n }\n } else if (name === 'device') {\n if (!context.devices) {\n // TODO: fill the devices and maintain them on all places where context.stateIds will be changed\n }\n\n const devices = context.devices || {};\n\n // go through all devices\n res = Object.keys(devices);\n // filter out those that don't match every ID selector for the channel ID\n if (objectIdSelectors.length) {\n res = res.filter(deviceId => applyIDSelectors(deviceId, objectIdSelectors));\n }\n\n // filter out those that don't match every common selector\n if (commonSelectors.length) {\n res = res.filter(deviceId => applyCommonSelectors(deviceId));\n }\n\n // filter out those that don't match every native selector\n if (nativeSelectors.length) {\n res = res.filter(deviceId => applyNativeSelectors(deviceId));\n }\n\n // filter out those that don't match every enum selector\n if (enumSelectors.length) {\n res = res.filter(deviceId => applyEnumSelectors(deviceId));\n }\n\n // retrieve the state ID collection for all remaining devices\n res = res\n .map(id => devices[id])\n // and flatten the array to get only the state IDs\n .reduce((acc, next) => acc.concat(next), []);\n\n // now filter out those that don't match every ID selector for the state ID\n if (stateIdSelectors.length) {\n res = res.filter(stateId => applyIDSelectors(stateId, stateIdSelectors));\n }\n } else {\n // go through all states\n res = context.stateIds;\n // if the \"name\" is not state, then we filter for the ID as well\n if (name && name !== 'state') {\n const r = new RegExp(`^${name.replace(/\\./g, '\\\\.').replace(/\\*/g, '.*')}$`);\n res = res.filter(id => r.test(id));\n }\n\n // filter out those that don't match every ID selector for the object ID or the state ID\n if (objectIdSelectors.length) {\n res = res.filter(id => applyIDSelectors(id, objectIdSelectors));\n }\n\n // filter out those that don't match every ID selector for the state ID\n if (stateIdSelectors.length) {\n res = res.filter(id => applyIDSelectors(id, stateIdSelectors));\n }\n\n // filter out those that don't match every common selector\n if (commonSelectors.length) {\n res = res.filter(id => applyCommonSelectors(id));\n }\n\n // filter out those that don't match every native selector\n if (nativeSelectors.length) {\n res = res.filter(id => applyNativeSelectors(id));\n }\n\n // filter out those that don't match every enum selector\n if (enumSelectors.length) {\n res = res.filter(id => applyEnumSelectors(id));\n }\n }\n\n const resUnique: string[] = [];\n for (let i = 0; i < res.length; i++) {\n if (!resUnique.includes(res[i])) {\n resUnique.push(res[i]);\n }\n }\n\n for (let i = 0; i < resUnique.length; i++) {\n result[i] = resUnique[i];\n }\n result.length = resUnique.length;\n\n // Implementing the Symbol.iterator contract makes the query result iterable\n result[Symbol.iterator] = function* () {\n for (let i = 0; i < result.length; i++) {\n yield result[i];\n }\n };\n result.toArray = function (): string[] {\n return [...resUnique];\n };\n result.each = function (callback: (id: string, index: number) => void | false): iobJS.QueryResult {\n if (typeof callback === 'function') {\n let r: boolean | void;\n for (let i = 0; i < this.length; i++) {\n r = callback(result[i], i);\n if (r === false) {\n break;\n }\n }\n }\n return this;\n };\n // @ts-expect-error fix later\n result.getState = function (\n callback?: iobJS.GetStateCallback,\n ): void | null | undefined | iobJS.TypedState | iobJS.AbsentState {\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n if (typeof callback !== 'function') {\n sandbox.log('You cannot use this function synchronous', 'error');\n } else {\n void adapter.getForeignState(\n this[0],\n (err: Error | null | undefined, state?: ioBroker.State | null): void => {\n void callback(\n err,\n context.convertBackStringifiedValues(this[0], state) as\n | iobJS.TypedState\n | iobJS.AbsentState,\n );\n },\n );\n }\n } else {\n if (!this[0]) {\n return null;\n }\n if (context.interimStateValues[this[0]] !== undefined) {\n return context.convertBackStringifiedValues(this[0], context.interimStateValues[this[0]]) as\n | iobJS.TypedState\n | iobJS.AbsentState;\n }\n return context.convertBackStringifiedValues(this[0], states[this[0]]) as\n | iobJS.TypedState\n | iobJS.AbsentState;\n }\n };\n result.getStateAsync = async function (): Promise<\n iobJS.TypedState | iobJS.AbsentState | null | undefined\n > {\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n const state = await adapter.getForeignStateAsync(this[0]);\n return context.convertBackStringifiedValues(this[0], state) as\n | iobJS.TypedState\n | iobJS.AbsentState\n | null;\n }\n if (!this[0]) {\n return null;\n }\n if (context.interimStateValues[this[0]] !== undefined) {\n return context.convertBackStringifiedValues(this[0], context.interimStateValues[this[0]]) as\n | iobJS.TypedState\n | iobJS.AbsentState\n | null;\n }\n return context.convertBackStringifiedValues(this[0], states[this[0]]) as\n | iobJS.TypedState\n | iobJS.AbsentState\n | null;\n };\n result.setState = function (\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean | 'false' | 'true' | null | iobJS.SetStateCallback,\n callback?: iobJS.SetStateCallback,\n ) {\n if (typeof isAck === 'function') {\n callback = isAck;\n isAck = undefined;\n }\n void result\n .setStateAsync(state, isAck as boolean | 'false' | 'true')\n .then(() => typeof callback === 'function' && callback());\n return this;\n };\n result.setStateAsync = async function (\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean,\n ): Promise {\n for (let i = 0; i < this.length; i++) {\n await sandbox.setStateAsync(this[i], state, isAck);\n }\n };\n result.setStateChanged = function (\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean,\n callback?: () => void,\n ) {\n if (typeof isAck === 'function') {\n callback = isAck;\n isAck = undefined;\n }\n void result.setStateChangedAsync(state, isAck).then(() => typeof callback === 'function' && callback());\n return this;\n };\n result.setStateChangedAsync = async function (\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean,\n ): Promise {\n for (let i = 0; i < this.length; i++) {\n await sandbox.setStateChangedAsync(this[i], state, isAck);\n }\n };\n result.setStateDelayed = function (\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck: boolean | number | undefined,\n delay?: number | boolean,\n clearRunning?: boolean | (() => void),\n callback?: () => void,\n ) {\n if (typeof isAck !== 'boolean') {\n callback = clearRunning as () => void;\n clearRunning = delay as boolean;\n delay = isAck as number;\n isAck = undefined;\n }\n if (typeof delay !== 'number') {\n callback = clearRunning as () => void;\n clearRunning = delay;\n delay = 0;\n }\n if (typeof clearRunning !== 'boolean') {\n callback = clearRunning;\n clearRunning = true;\n }\n let count = this.length;\n for (let i = 0; i < this.length; i++) {\n sandbox.setStateDelayed(this[i], state, isAck as boolean, delay, clearRunning, () => {\n if (!--count && typeof callback === 'function') {\n callback();\n }\n });\n }\n return this;\n };\n result.on = function (callbackOrId: string | ((data: any) => void), value?: any) {\n for (let i = 0; i < this.length; i++) {\n sandbox.subscribe(this[i], callbackOrId, value);\n }\n return this;\n };\n return result;\n },\n log: function (msg: string, severity?: ioBroker.LogLevel): void {\n severity = severity || 'info';\n\n // disable log in log handler (prevent endless loops)\n if (sandbox.logHandler && (sandbox.logHandler === severity || sandbox.logHandler === '*')) {\n return;\n }\n\n if (!adapter.log[severity]) {\n msg = `Unknown severity level \"${severity}\" by log of [${msg}]`;\n severity = 'warn';\n }\n\n if (msg && typeof msg !== 'string') {\n msg = mods.util.format(msg);\n }\n\n if (debugMode) {\n console.log(`${severity}$$${name}$$${msg}`, Date.now());\n } else {\n adapter.log[severity](`${name}: ${msg}`);\n }\n },\n onLog: function (severity: ioBroker.LogLevel, callback: (info: LogMessage) => void): number {\n if (!['info', 'error', 'debug', 'silly', 'warn', '*'].includes(severity)) {\n sandbox.log(`Unknown severity \"${severity}\"`, 'warn');\n return 0;\n }\n if (typeof callback !== 'function') {\n sandbox.log(`Invalid callback for onLog`, 'warn');\n return 0;\n }\n\n const handler = { id: Date.now() + Math.floor(Math.random() * 10000), cb: callback, sandbox, severity };\n context.logSubscriptions[sandbox.scriptName] = context.logSubscriptions[sandbox.scriptName] || [];\n context.logSubscriptions[sandbox.scriptName].push(handler);\n context.updateLogSubscriptions();\n\n sandbox.__engine.__subscriptionsLog += 1;\n\n sandbox.verbose &&\n sandbox.log(\n `onLog(severity=${severity}, id=${handler.id}) - logSubscriptions=${sandbox.__engine.__subscriptionsLog}`,\n 'info',\n );\n\n if (\n sandbox.__engine.__subscriptionsLog %\n (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__subscriptionsLog} log subscriptions registered. Check your script!`,\n 'warn',\n );\n }\n\n return handler.id;\n },\n onLogUnregister: function (\n idOrCallbackOrSeverity: number | ioBroker.LogLevel | ((info: LogMessage) => void),\n ): boolean {\n let found = false;\n\n if (context.logSubscriptions?.[sandbox.scriptName]) {\n sandbox.verbose &&\n sandbox.log(\n `onLogUnregister(idOrCallbackOrSeverity=${JSON.stringify(idOrCallbackOrSeverity)}) - logSubscriptions=${sandbox.__engine.__subscriptionsLog}`,\n 'info',\n );\n\n for (let i = 0; i < context.logSubscriptions[sandbox.scriptName].length; i++) {\n if (\n context.logSubscriptions[sandbox.scriptName][i].cb === idOrCallbackOrSeverity ||\n context.logSubscriptions[sandbox.scriptName][i].id === idOrCallbackOrSeverity ||\n context.logSubscriptions[sandbox.scriptName][i].severity === idOrCallbackOrSeverity\n ) {\n sandbox.verbose &&\n sandbox.log(\n `onLogUnregister(idOrCallbackOrSeverity=${JSON.stringify(idOrCallbackOrSeverity)}, removing id=${context.logSubscriptions[sandbox.scriptName][i].id})`,\n 'info',\n );\n\n context.logSubscriptions[sandbox.scriptName].splice(i, 1);\n i--;\n sandbox.__engine.__subscriptionsLog--;\n\n found = true;\n\n // if deletion via ID\n if (typeof idOrCallbackOrSeverity === 'number') {\n break;\n }\n } else {\n sandbox.verbose &&\n sandbox.log(\n `onLogUnregister(idOrCallbackOrSeverity=${JSON.stringify(idOrCallbackOrSeverity)}) NOT = ${JSON.stringify(context.logSubscriptions[sandbox.scriptName][i])}`,\n 'info',\n );\n }\n }\n }\n\n context.updateLogSubscriptions();\n\n return found;\n },\n exec: function (\n cmd: string,\n options?: ExecOptions | ((error: Error | null | string, stdout?: string, stderr?: string) => void),\n callback?: (error: Error | null | string, stdout?: string, stderr?: string) => void,\n ): undefined | ChildProcess {\n if (typeof options === 'function') {\n callback = options as (error: Error | null | string, stdout?: string, stderr?: string) => void;\n options = {};\n }\n if (!(adapter.config as JavaScriptAdapterConfig).enableExec) {\n const error = 'exec is not available. Please enable \"Enable Exec\" option in instance settings';\n sandbox.log(error, 'error');\n\n if (typeof callback === 'function') {\n setImmediate(callback, error, undefined, undefined);\n }\n } else {\n if (sandbox.verbose) {\n sandbox.log(`exec(cmd=${cmd})`, 'info');\n }\n\n if (debug) {\n sandbox.log(words._('Command %s was not executed, while debug mode is active', cmd), 'warn');\n if (typeof callback === 'function') {\n setImmediate(function () {\n callback(null, '', '');\n });\n }\n } else {\n return mods.child_process.exec(\n cmd,\n options,\n (error: Error | null, stdout: string, stderr: string): void => {\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, error, stdout, stderr);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n },\n );\n }\n }\n },\n email: function (msg: string | SendMailOptions): void {\n if (sandbox.verbose) {\n sandbox.log(`email(msg=${JSON.stringify(msg)})`, 'info');\n }\n sandbox.log(`email(msg=${JSON.stringify(msg)}) is deprecated. Please use sendTo instead!`, 'warn');\n adapter.sendTo('email', msg);\n },\n pushover: function (msg: string | PushoverOptions): void {\n if (sandbox.verbose) {\n sandbox.log(`pushover(msg=${JSON.stringify(msg)})`, 'info');\n }\n sandbox.log(`pushover(msg=${JSON.stringify(msg)}) is deprecated. Please use sendTo instead!`, 'warn');\n adapter.sendTo('pushover', msg);\n },\n httpGet: function (\n url: string,\n options:\n | {\n timeout?: number;\n responseType?: ResponseType;\n headers?: Record;\n basicAuth?: { user: string; password: string } | null;\n bearerAuth?: string;\n validateCertificate?: boolean;\n }\n | ((\n error: Error | null,\n result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n },\n ) => void),\n callback?: (\n error: Error | null,\n result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n },\n ) => void,\n ): void {\n if (typeof options === 'function') {\n callback = options as (\n error: Error | null,\n result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n },\n ) => void;\n options = {};\n }\n\n const config = {\n ...getHttpRequestConfig(url, options, context.allowSelfSignedCerts),\n method: 'get',\n };\n\n if (sandbox.verbose) {\n sandbox.log(`httpGet(config=${JSON.stringify(config)})`, 'info');\n }\n\n const startTime = Date.now();\n\n mods.axios\n .default(config)\n .then((response: AxiosResponse) => {\n const responseTime = Date.now() - startTime;\n\n if (sandbox.verbose) {\n sandbox.log(`httpGet(url=${url}, responseTime=${responseTime}ms)`, 'info');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, null, {\n statusCode: response.status,\n data: response.data,\n headers: response.headers as Record,\n responseTime,\n });\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n })\n .catch((error: any) => {\n const responseTime = Date.now() - startTime;\n\n sandbox.log(`httpGet(url=${url}, error=${error.message})`, 'error');\n\n if (typeof callback === 'function') {\n let result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n } = {\n statusCode: null,\n data: null,\n headers: {},\n responseTime,\n };\n\n if (error.response) {\n result = {\n statusCode: error.response.status,\n data: error.response.data,\n headers: error.response.headers,\n responseTime,\n };\n }\n\n try {\n callback.call(sandbox, error.message, result);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n });\n },\n httpPost: function (\n url: string,\n data: any,\n options:\n | {\n timeout?: number;\n responseType?: ResponseType;\n headers?: Record;\n basicAuth?: { user: string; password: string } | null;\n bearerAuth?: string;\n validateCertificate?: boolean;\n }\n | ((\n error: Error | null,\n result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n },\n ) => void),\n callback?: (\n error: Error | null,\n result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n },\n ) => void,\n ): void {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n\n const config = {\n ...getHttpRequestConfig(\n url,\n options as {\n timeout?: number;\n responseType?: ResponseType;\n headers?: Record;\n basicAuth?: { user: string; password: string } | null;\n bearerAuth?: string;\n validateCertificate?: boolean;\n },\n context.allowSelfSignedCerts,\n ),\n method: 'post',\n data,\n };\n\n if (sandbox.verbose) {\n sandbox.log(`httpPost(config=${JSON.stringify(config)}, data=${data})`, 'info');\n }\n\n const startTime = Date.now();\n\n mods.axios\n .default(config)\n .then((response: AxiosResponse) => {\n const responseTime = Date.now() - startTime;\n\n if (sandbox.verbose) {\n sandbox.log(`httpPost(url=${url}, responseTime=${responseTime}ms)`, 'info');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, null, {\n statusCode: response.status,\n data: response.data,\n headers: response.headers,\n responseTime,\n });\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n })\n .catch((error: unknown) => {\n const responseTime = Date.now() - startTime;\n\n sandbox.log(`httpPost(url=${url}, error=${(error as Error).message})`, 'error');\n\n if (typeof callback === 'function') {\n let result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n } = {\n statusCode: null,\n data: null,\n headers: {},\n responseTime,\n };\n const response: AxiosResponse | undefined = (error as AxiosError).response;\n\n if (response) {\n result = {\n statusCode: response.status,\n data: response.data,\n headers: response.headers,\n responseTime,\n };\n }\n\n try {\n callback.call(sandbox, new Error((error as AxiosError).message), result);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n });\n },\n createTempFile: function (fileName: string, data: Buffer | string): undefined | string {\n const os = mods.os;\n const path = mods.path;\n const fs = mods.fs;\n\n let tempDirPath = context.tempDirectories?.[sandbox.scriptName];\n\n if (!tempDirPath) {\n // create temp directory\n tempDirPath = fs.mkdtempSync(\n path.join(os.tmpdir(), `${sandbox.scriptName.substring(SCRIPT_CODE_MARKER.length)}-`),\n );\n context.tempDirectories[sandbox.scriptName] = tempDirPath;\n\n sandbox.verbose &&\n sandbox.log(\n `createTempFile(fileName=${fileName}, tempDirPath=${tempDirPath}) created temp directory in ${os.tmpdir()}`,\n 'info',\n );\n }\n\n const filePath = path.join(tempDirPath, fileName);\n\n // is sub dir?\n const fileDir = path.dirname(filePath);\n if (!fs.existsSync(fileDir)) {\n fs.mkdirSync(fileDir, { recursive: true });\n }\n\n if (typeof data === 'undefined') {\n sandbox.log(\n `createTempFile(fileName=${fileName}, fileDir=${fileDir}, filePath=${filePath}) data is undefined, file not created!`,\n 'error',\n );\n\n return undefined;\n }\n\n fs.writeFileSync(filePath, data);\n sandbox.verbose &&\n sandbox.log(`createTempFile(fileName=${fileName}, fileDir=${fileDir}, filePath=${filePath})`, 'info');\n\n return filePath;\n },\n subscribe: function (\n pattern:\n | TimeRule\n | AstroRule\n | Pattern\n | SchedulerRule\n | string\n | (TimeRule | AstroRule | Pattern | SchedulerRule | string)[],\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n callbackOrChangeTypeOrId: string | ChangeType | ((event?: EventObj) => void),\n value?: any,\n ):\n | SubscriptionResult\n | IobSchedule\n | string\n | null\n | undefined\n | (SubscriptionResult | IobSchedule | string | null | undefined)[] {\n // If a schedule object is given\n if (\n (typeof pattern === 'string' && pattern[0] === '{') ||\n (typeof pattern === 'object' && (pattern as SchedulerRule).period)\n ) {\n return sandbox.schedule(pattern as SchedulerRule, callbackOrChangeTypeOrId as () => void);\n }\n // If an array of schedules is given\n if (pattern && Array.isArray(pattern)) {\n const result: (IobSchedule | string | null | undefined)[] = [];\n for (const p of pattern) {\n result.push(\n sandbox.subscribe(p as SchedulerRule | string, callbackOrChangeTypeOrId, value) as\n | IobSchedule\n | string\n | null\n | undefined,\n );\n }\n return result;\n }\n\n // detect subscribe('id', 'any', (obj) => {})\n let oPattern: Pattern;\n if (\n (typeof pattern === 'string' || pattern instanceof RegExp) &&\n typeof callbackOrChangeTypeOrId === 'string' &&\n typeof value === 'function'\n ) {\n oPattern = { id: pattern, change: callbackOrChangeTypeOrId as ChangeType };\n callbackOrChangeTypeOrId = value;\n value = undefined;\n } else {\n oPattern = pattern as Pattern;\n }\n\n if (oPattern?.id && Array.isArray(oPattern.id)) {\n const result: (IobSchedule | string | null | undefined)[] = [];\n for (let t = 0; t < oPattern.id.length; t++) {\n const pa: Pattern = JSON.parse(JSON.stringify(oPattern));\n pa.id = oPattern.id[t];\n result.push(\n sandbox.subscribe(pa, callbackOrChangeTypeOrId, value) as\n | IobSchedule\n | string\n | null\n | undefined,\n );\n }\n return result;\n }\n\n // try to detect astro or cron (by spaces)\n if (isObject(pattern) || (typeof pattern === 'string' && pattern.match(/[,/\\d*]+\\s[,/\\d*]+\\s[,/\\d*]+/))) {\n if ((pattern as AstroRule).astro) {\n return sandbox.schedule(pattern as AstroRule, callbackOrChangeTypeOrId as () => void);\n } else if ((pattern as TimeRule).time) {\n return sandbox.schedule(\n (pattern as TimeRule).time as string,\n callbackOrChangeTypeOrId as () => void,\n );\n }\n }\n\n let callback: undefined | ((obj: EventObj) => void);\n\n // source is set by regexp if defined as /regexp/\n if (!isObject(pattern) || pattern instanceof RegExp || (pattern as RegExp).source) {\n oPattern = { id: pattern as string | RegExp, change: 'ne' };\n }\n\n if (oPattern.id !== undefined && !oPattern.id) {\n sandbox.log(`Error by subscription (trigger): empty ID defined. All states matched.`, 'error');\n return;\n } else if (typeof oPattern.id === 'boolean' || typeof oPattern.id === 'number') {\n sandbox.log(`Error by subscription (trigger): Wrong ID of type boolean or number.`, 'error');\n return;\n }\n\n sandbox.__engine.__subscriptions += 1;\n\n if (\n sandbox.__engine.__subscriptions % (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__subscriptions} subscriptions registered. Check your script!`,\n 'warn',\n );\n }\n\n if (oPattern.q === undefined) {\n oPattern.q = 0;\n }\n\n // add adapter namespace if nothing given\n if (oPattern.id && typeof oPattern.id === 'string' && !oPattern.id.includes('.')) {\n oPattern.id = `${adapter.namespace}.${oPattern.id}`;\n }\n\n if (typeof callbackOrChangeTypeOrId === 'function') {\n callback = callbackOrChangeTypeOrId;\n } else {\n if (typeof value === 'undefined') {\n callback = function (obj: EventObj) {\n sandbox.setState(callbackOrChangeTypeOrId, obj.newState.val);\n };\n } else {\n callback = function (/* obj */) {\n sandbox.setState(callbackOrChangeTypeOrId, value);\n };\n }\n }\n\n const subs: SubscriptionResult = {\n pattern: oPattern,\n callback: (obj: EventObj) => {\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, obj);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n },\n name,\n };\n\n // try to extract adapter\n if (oPattern.id && typeof oPattern.id === 'string') {\n const parts = oPattern.id.split('.');\n const a = `${parts[0]}.${parts[1]}`;\n const _adapter = `system.adapter.${a}`;\n\n if (objects[_adapter] && objects[_adapter].common && objects[_adapter].common.subscribable) {\n const alive = `system.adapter.${a}.alive`;\n context.adapterSubs[alive] = context.adapterSubs[alive] || [];\n\n const subExists = context.adapterSubs[alive].filter(sub => sub === oPattern.id).length > 0;\n\n if (!subExists) {\n context.adapterSubs[alive].push(oPattern.id);\n adapter.sendTo(a, 'subscribe', oPattern.id);\n }\n }\n }\n if (sandbox.verbose) {\n sandbox.log(`subscribe: ${JSON.stringify(subs)}`, 'info');\n }\n\n subscribePattern(script, oPattern.id as string);\n\n subs.patternCompareFunctions = getPatternCompareFunctions(oPattern);\n context.subscriptions.push(subs);\n\n if (oPattern.enumName || oPattern.enumId) {\n context.isEnums = true;\n }\n return subs;\n },\n getSubscriptions: function (): Record {\n const result: Record = {};\n for (let s = 0; s < context.subscriptions.length; s++) {\n result[context.subscriptions[s].pattern.id as string] =\n result[context.subscriptions[s].pattern.id as string] || [];\n result[context.subscriptions[s].pattern.id as string].push({\n name: context.subscriptions[s].name,\n pattern: context.subscriptions[s].pattern,\n });\n }\n if (sandbox.verbose) {\n sandbox.log(`getSubscriptions() => ${JSON.stringify(result)}`, 'info');\n }\n return result;\n },\n getFileSubscriptions: function (): Record {\n const result: Record = {};\n for (let s = 0; s < context.subscriptionsFile.length; s++) {\n const key = `${context.subscriptionsFile[s].id}$%$${context.subscriptionsFile[s].fileNamePattern}`;\n result[key] = result[key] || [];\n result[key].push({\n name: context.subscriptionsFile[s].name,\n id: context.subscriptionsFile[s].id,\n fileNamePattern: context.subscriptionsFile[s].fileNamePattern,\n });\n }\n if (sandbox.verbose) {\n sandbox.log(`getFileSubscriptions() => ${JSON.stringify(result)}`, 'info');\n }\n return result;\n },\n adapterSubscribe: function (id: string): void {\n if (typeof id !== 'string') {\n sandbox.log(`adapterSubscribe: invalid type of id ${typeof id}`, 'error');\n return;\n }\n const parts = id.split('.');\n const _adapter = `system.adapter.${parts[0]}.${parts[1]}`;\n if (objects[_adapter]?.common?.subscribable) {\n const a = `${parts[0]}.${parts[1]}`;\n const alive = `system.adapter.${a}.alive`;\n context.adapterSubs[alive] = context.adapterSubs[alive] || [];\n context.adapterSubs[alive].push(id);\n if (sandbox.verbose) {\n sandbox.log(`adapterSubscribe: ${a} - ${id}`, 'info');\n }\n adapter.sendTo(a, 'subscribe', id);\n }\n },\n adapterUnsubscribe: function (\n idOrObject: string | SubscriptionResult | (string | SubscriptionResult)[],\n ): boolean | boolean[] {\n // todo: BF - it could be an error\n return sandbox.unsubscribe(idOrObject);\n },\n unsubscribe: function (\n idOrObject: string | SubscriptionResult | (string | SubscriptionResult)[],\n ): boolean | boolean[] {\n if (idOrObject && Array.isArray(idOrObject)) {\n const result: boolean[] = [];\n for (let t = 0; t < idOrObject.length; t++) {\n result.push(sandbox.unsubscribe(idOrObject[t]) as boolean);\n }\n return result;\n }\n\n if (sandbox.verbose) {\n sandbox.log(`adapterUnsubscribe(id=${JSON.stringify(idOrObject)})`, 'info');\n }\n\n if (isObject(idOrObject)) {\n for (let i = context.subscriptions.length - 1; i >= 0; i--) {\n if (context.subscriptions[i] === idOrObject) {\n unsubscribePattern(script, context.subscriptions[i].pattern.id as string);\n context.subscriptions.splice(i, 1);\n sandbox.__engine.__subscriptions--;\n return true;\n }\n }\n return false;\n }\n let deleted = 0;\n for (let i = context.subscriptions.length - 1; i >= 0; i--) {\n if (context.subscriptions[i].name === name && context.subscriptions[i].pattern.id === idOrObject) {\n deleted++;\n unsubscribePattern(script, context.subscriptions[i].pattern.id as string);\n context.subscriptions.splice(i, 1);\n sandbox.__engine.__subscriptions--;\n }\n }\n return !!deleted;\n },\n on: function (\n pattern:\n | TimeRule\n | AstroRule\n | Pattern\n | SchedulerRule\n | string\n | (TimeRule | AstroRule | Pattern | SchedulerRule | string)[],\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n callbackOrChangeTypeOrId: string | ChangeType | ((event?: EventObj) => void),\n value?: any,\n ):\n | SubscriptionResult\n | IobSchedule\n | string\n | null\n | undefined\n | (SubscriptionResult | IobSchedule | string | null | undefined)[] {\n return sandbox.subscribe(pattern, callbackOrChangeTypeOrId, value);\n },\n onEnumMembers: function (enumId: string, callback: (event?: EventObj) => void): void {\n if (enums.includes(enumId)) {\n const subscriptions: Record = {};\n\n const init = (): void => {\n const obj: ioBroker.EnumObject = objects[enumId] as ioBroker.EnumObject;\n const common: ioBroker.EnumCommon = obj?.common ?? {};\n const members: string[] = common?.members ?? [];\n\n // Remove old subscriptions\n for (const [objId, subscription] of Object.entries(subscriptions)) {\n if (!members.includes(objId)) {\n sandbox.unsubscribe(subscription);\n delete subscriptions[objId];\n }\n }\n\n // Subscribe to all members of enum\n for (const objId of members) {\n if (!Object.keys(subscriptions).includes(objId)) {\n if (objects?.[objId]?.type === 'state') {\n // Just subscribe to states\n subscriptions[objId] = sandbox.subscribe(objId, callback) as\n | string\n | SubscriptionResult; // TODO: more features\n }\n }\n }\n\n sandbox.verbose &&\n sandbox.log(\n `onEnumMembers(id=${enumId}, members=${JSON.stringify(Object.keys(subscriptions))})`,\n 'info',\n );\n };\n\n init();\n\n sandbox.subscribeObject(enumId, obj => obj && init());\n } else {\n sandbox.log(`onEnumMembers: enum with id \"${enumId}\" doesn't exists`, 'error');\n }\n },\n onFile: function (\n id: string,\n fileNamePattern: string | string[],\n withFileOrCallback:\n | boolean\n | ((id: string, fileName: string, size: number, file?: string | Buffer, mimeType?: string) => void),\n callback?: (\n id: string,\n fileName: string,\n size: number | null,\n file?: string | Buffer,\n mimeType?: string,\n ) => void,\n ): undefined | FileSubscriptionResult | (undefined | FileSubscriptionResult)[] {\n if (typeof withFileOrCallback === 'function') {\n callback = withFileOrCallback as (\n id: string,\n fileName: string,\n size: number | null,\n file?: string | Buffer,\n mimeType?: string,\n ) => void;\n withFileOrCallback = false;\n }\n\n if (!adapter.subscribeForeignFiles) {\n sandbox.log(\n 'onFile: your js-controller does not support yet onFile subscribes. Please update to js-controller@4.1.x or newer',\n 'warn',\n );\n return;\n }\n if (!id || !fileNamePattern) {\n sandbox.log(\n 'onFile: invalid parameters. Usage: onFile(\"vis.0\", \"main/*\", true, (id, fileName, size, file, mimeType) => {});',\n 'error',\n );\n return;\n }\n if (typeof callback !== 'function') {\n sandbox.offFile(id, fileNamePattern);\n return;\n }\n\n if (Array.isArray(fileNamePattern)) {\n return fileNamePattern.map(\n filePattern =>\n sandbox.onFile(id, filePattern, withFileOrCallback, callback) as\n | undefined\n | FileSubscriptionResult,\n );\n }\n\n sandbox.__engine.__subscriptionsFile += 1;\n\n sandbox.verbose &&\n sandbox.log(\n `onFile(id=${id}, fileNamePattern=${fileNamePattern}) - fileSubscriptions=${sandbox.__engine.__subscriptionsFile}`,\n 'info',\n );\n\n if (\n sandbox.__engine.__subscriptionsFile %\n (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__subscriptionsFile} file subscriptions registered. Check your script!`,\n 'warn',\n );\n }\n\n let idRegEx: RegExp | undefined;\n let fileRegEx: RegExp | undefined;\n if (id.includes('*')) {\n idRegEx = new RegExp(pattern2RegEx(id));\n }\n if (fileNamePattern.includes('*')) {\n fileRegEx = new RegExp(pattern2RegEx(fileNamePattern));\n }\n\n const subs: FileSubscriptionResult = {\n id,\n fileNamePattern,\n withFile: withFileOrCallback,\n idRegEx,\n fileRegEx,\n callback: (id: string, fileName: string, size: number | null, withFile: boolean): void => {\n try {\n sandbox.verbose &&\n sandbox.log(`onFile changed(id=${id}, fileName=${fileName}, size=${size})`, 'info');\n\n if (withFile && (size || 0) > 0) {\n adapter\n .readFileAsync(id, fileName)\n .then(data => {\n try {\n callback.call(sandbox, id, fileName, size, data.file, data.mimeType);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n })\n .catch(error => errorInCallback(error));\n } else {\n callback.call(sandbox, id, fileName, size);\n }\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n },\n name,\n };\n\n context.subscriptionsFile.push(subs);\n subscribeFile(script, id, fileNamePattern);\n return subs;\n },\n offFile: function (\n idOrObject: FileSubscriptionResult | string | (FileSubscriptionResult | string)[],\n fileNamePattern?: string | string[],\n ): boolean | boolean[] {\n if (!adapter.unsubscribeForeignFiles) {\n sandbox.log(\n 'offFile: your js-controller does not support yet file unsubscribes. Please update to js-controller@4.1.x or newer',\n 'warn',\n );\n return false;\n }\n\n sandbox.verbose &&\n sandbox.log(\n `offFile(idOrObject=${JSON.stringify(idOrObject)}, fileNamePattern=${JSON.stringify(fileNamePattern)}) - fileSubscriptions=${sandbox.__engine.__subscriptionsFile}`,\n 'info',\n );\n\n if (idOrObject && typeof idOrObject === 'object') {\n if (Array.isArray(idOrObject)) {\n const result: boolean[] = [];\n for (let t = 0; t < idOrObject.length; t++) {\n result.push(sandbox.offFile(idOrObject[t]) as boolean);\n }\n return result;\n }\n for (let i = context.subscriptionsFile.length - 1; i >= 0; i--) {\n if (context.subscriptionsFile[i] === idOrObject) {\n unsubscribeFile(\n script,\n context.subscriptionsFile[i].id,\n context.subscriptionsFile[i].fileNamePattern,\n );\n\n sandbox.verbose &&\n sandbox.log(\n `offFile(type=object, fileNamePattern=${JSON.stringify(fileNamePattern)}, removing id=${context.subscriptionsFile[i].id})`,\n 'info',\n );\n\n context.subscriptionsFile.splice(i, 1);\n sandbox.__engine.__subscriptionsFile--;\n return true;\n }\n }\n return false;\n }\n\n if (fileNamePattern && Array.isArray(fileNamePattern)) {\n const result: boolean[] = [];\n for (let t = 0; t < fileNamePattern.length; t++) {\n result.push(sandbox.offFile(idOrObject, fileNamePattern[t]) as boolean);\n }\n return result;\n }\n\n let deleted = 0;\n for (let i = context.subscriptionsFile.length - 1; i >= 0; i--) {\n if (\n context.subscriptionsFile[i].id === idOrObject &&\n context.subscriptionsFile[i].fileNamePattern === fileNamePattern\n ) {\n deleted++;\n unsubscribeFile(\n script,\n context.subscriptionsFile[i].id,\n context.subscriptionsFile[i].fileNamePattern,\n );\n\n sandbox.verbose &&\n sandbox.log(\n `offFile(type=string, fileNamePattern=${fileNamePattern}, removing id=${context.subscriptionsFile[i].id})`,\n 'info',\n );\n\n context.subscriptionsFile.splice(i, 1);\n sandbox.__engine.__subscriptionsFile--;\n }\n }\n return !!deleted;\n },\n /** Registers a one-time subscription which automatically unsubscribes after the first invocation */\n once: function (\n pattern:\n | TimeRule\n | AstroRule\n | Pattern\n | SchedulerRule\n | string\n | (TimeRule | AstroRule | Pattern | SchedulerRule | string)[],\n callback?: (event?: EventObj) => void,\n ): string | SubscriptionResult | Promise {\n function _once(cb: (obj?: EventObj) => void): string | SubscriptionResult {\n // eslint-disable-next-line prefer-const\n let subscription: string | SubscriptionResult;\n const handler = (obj?: EventObj): void => {\n subscription && sandbox.unsubscribe(subscription);\n typeof cb === 'function' && cb(obj);\n };\n subscription = sandbox.subscribe(pattern, handler) as string | SubscriptionResult;\n return subscription;\n }\n if (typeof callback === 'function') {\n // Callback-style: once(\"id\", (obj) => { ... })\n return _once(callback);\n }\n\n // Promise-style: once(\"id\").then(obj => { ... })\n return new Promise(resolve => _once(resolve));\n },\n schedule: function (\n pattern: SchedulerRule | AstroRule | Date | string,\n callback: () => void,\n ): IobSchedule | string | null | undefined {\n if (typeof callback !== 'function') {\n sandbox.log(`schedule callback missing`, 'error');\n return null;\n }\n\n if (\n (typeof pattern === 'string' && pattern[0] === '{') ||\n (typeof pattern === 'object' && (pattern as SchedulerRule).period)\n ) {\n sandbox.verbose &&\n sandbox.log(\n `schedule(wizard=${typeof pattern === 'object' ? JSON.stringify(pattern) : pattern})`,\n 'info',\n );\n\n if (!context.scheduler) {\n sandbox.log(\n `Cannot schedule \"${typeof pattern === 'object' ? JSON.stringify(pattern) : pattern}\" because scheduler is not available`,\n 'error',\n );\n return null;\n }\n\n const schedule: string | null = context.scheduler.add(\n pattern as SchedulerRule | string,\n sandbox.scriptName,\n callback,\n );\n if (schedule) {\n script.wizards.push(schedule);\n sandbox.__engine.__schedules += 1;\n\n if (\n sandbox.__engine.__schedules %\n (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__schedules} schedules registered. Check your script!`,\n 'warn',\n );\n }\n }\n\n return schedule;\n }\n\n const adapterConfig: JavaScriptAdapterConfig = adapter.config as JavaScriptAdapterConfig;\n\n if (typeof pattern === 'object' && (pattern as AstroRule).astro) {\n const astroPattern = pattern as AstroRule;\n const nowDate = new Date();\n\n if (\n adapterConfig.latitude === undefined ||\n adapterConfig.longitude === undefined ||\n adapterConfig.latitude === null ||\n adapterConfig.longitude === null\n ) {\n sandbox.log('Longitude or latitude does not set. Cannot use astro.', 'error');\n return null;\n }\n\n // ensure events are calculated independent of current time\n // TODO: use getAstroStartOfDay of adapter?\n const todayNoon = new Date(nowDate);\n todayNoon.setHours(12, 0, 0, 0);\n let ts = mods.suncalc.getTimes(todayNoon, adapterConfig.latitude, adapterConfig.longitude)[\n astroPattern.astro\n ];\n\n // event on the next day, correct or force recalculation at midnight\n if (todayNoon.getDate() !== ts.getDate()) {\n todayNoon.setDate(todayNoon.getDate() - 1);\n ts = mods.suncalc.getTimes(todayNoon, adapterConfig.latitude, adapterConfig.longitude)[\n astroPattern.astro\n ];\n }\n\n if (ts.getTime().toString() === 'NaN') {\n sandbox.log(\n `Cannot calculate \"${astroPattern.astro}\" for ${adapterConfig.latitude}, ${adapterConfig.longitude}`,\n 'warn',\n );\n ts = new Date(nowDate.getTime());\n\n if (\n astroPattern.astro === 'sunriseEnd' ||\n astroPattern.astro === 'goldenHourEnd' ||\n astroPattern.astro === 'sunset' ||\n astroPattern.astro === 'nightEnd' ||\n astroPattern.astro === 'nauticalDusk'\n ) {\n ts.setHours(23);\n ts.setMinutes(59);\n ts.setSeconds(59);\n } else {\n ts.setHours(23);\n ts.setMinutes(59);\n ts.setSeconds(58);\n }\n }\n\n if (ts && astroPattern.shift) {\n ts = new Date(ts.getTime() + astroPattern.shift * 60000);\n }\n\n if (!ts || ts < nowDate) {\n const date = new Date(nowDate);\n // Event doesn't occur today - try again tomorrow\n // Calculate time till 24:00 (local, NOT UTC) and set timeout\n date.setDate(date.getDate() + 1);\n date.setMinutes(0); // Sometimes timer fires at 23:59:59\n date.setHours(0);\n date.setSeconds(1);\n date.setMilliseconds(0);\n\n sandbox.__engine.__schedules += 1;\n\n if (sandbox.__engine.__schedules % adapterConfig.maxTriggersPerScript === 0) {\n sandbox.log(\n `More than ${sandbox.__engine.__schedules} schedules registered. Check your script!`,\n 'warn',\n );\n }\n\n sandbox.verbose &&\n sandbox.log(\n `schedule(astro=${astroPattern.astro}, offset=${astroPattern.shift}) is tomorrow, waiting until ${date.toISOString()}`,\n 'info',\n );\n\n // Calculate new schedule in the next day\n sandbox.setTimeout(() => {\n if (sandbox.__engine.__schedules > 0) {\n sandbox.__engine.__schedules--;\n }\n sandbox.schedule(astroPattern, callback);\n }, date.getTime() - Date.now());\n\n return;\n }\n\n sandbox.__engine.__schedules += 1;\n\n if (sandbox.__engine.__schedules % adapterConfig.maxTriggersPerScript === 0) {\n sandbox.log(\n `More than ${sandbox.__engine.__schedules} schedules registered. Check your script!`,\n 'warn',\n );\n }\n\n sandbox.setTimeout(() => {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n // Reschedule in 2 seconds\n sandbox.setTimeout(() => {\n if (sandbox.__engine.__schedules > 0) {\n sandbox.__engine.__schedules--;\n }\n sandbox.schedule(astroPattern, callback);\n }, 2000);\n }, ts.getTime() - Date.now());\n\n sandbox.verbose &&\n sandbox.log(\n `schedule(astro=${astroPattern.astro}, offset=${astroPattern.shift}) is today, waiting until ${ts.toISOString()}`,\n 'info',\n );\n } else {\n // fix a problem with sunday and 7\n if (typeof pattern === 'string') {\n // this could be a CRON\n const parts = pattern.replace(/\\s+/g, ' ').split(' ');\n if (parts.length >= 5 && parseInt(parts[5], 10) >= 7) {\n parts[5] = '0';\n }\n pattern = parts.join(' ');\n }\n // created in VM the date object: pattern instanceof Date => false\n // so fix it\n if (typeof pattern === 'object' && (pattern as Date).getDate) {\n pattern = new Date(pattern as Date);\n }\n\n const schedule: IobSchedule = mods.nodeSchedule.scheduleJob(pattern, (): void => {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n });\n if (schedule) {\n sandbox.__engine.__schedules += 1;\n\n if (\n sandbox.__engine.__schedules %\n (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__schedules} schedules registered. Check your script!`,\n 'warn',\n );\n }\n\n schedule._ioBroker = {\n type: 'cron',\n pattern: pattern as string | Date,\n scriptName: sandbox.scriptName,\n id: `cron_${Date.now()}_${Math.round(Math.random() * 100000)}`,\n };\n\n script.schedules.push(schedule);\n } else {\n sandbox.log(`schedule(cron=${JSON.stringify(pattern)}): cannot create schedule`, 'error');\n }\n\n if (sandbox.verbose) {\n sandbox.log(`schedule(cron=${JSON.stringify(pattern)})`, 'info');\n }\n\n return schedule;\n }\n },\n scheduleById: function (id: string, ack: boolean | (() => void) | undefined, callback?: () => void): void {\n let scheduleId: IobSchedule | string | null | undefined = null;\n let currentExp: string | null = null; // current cron expression\n\n if (typeof ack === 'function') {\n callback = ack;\n ack = undefined;\n }\n\n const rhms = /^(2[0-3]|[01]?[0-9]):([0-5]?[0-9]):([0-5]?[0-9])$/; // hh:mm:ss\n const rhm = /^(2[0-3]|[01]?[0-9]):([0-5]?[0-9])$/; // hh:mm\n\n const init = (time: string): void => {\n if (typeof time === 'string') {\n let h: number | undefined = undefined;\n let m: number | undefined = undefined;\n let s: number | undefined = undefined;\n\n let isValid = false;\n\n let result = time.match(rhms);\n if (result) {\n [, h, m, s] = result.map(v => parseInt(v));\n isValid = true;\n } else {\n result = time.match(rhm);\n if (result) {\n [, h, m] = result.map(v => parseInt(v));\n isValid = true;\n }\n }\n\n if (isValid) {\n const cronExp = `${s ?? '0'} ${m ?? '0'} ${h ?? '0'} * * *`;\n\n if (cronExp !== currentExp) {\n sandbox.verbose &&\n sandbox.log(\n `scheduleById(id=${id}): Init with expression ${cronExp} from ${time}`,\n 'info',\n );\n currentExp = cronExp;\n\n if (scheduleId) {\n sandbox.clearSchedule(scheduleId);\n scheduleId = null;\n }\n\n scheduleId = sandbox.schedule(cronExp, () => {\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n });\n }\n } else {\n sandbox.log(\n `scheduleById(id=${id},time=${time}): cannot create schedule - invalid format (HH:MM:SS or H:M:S required)`,\n 'error',\n );\n }\n } else {\n sandbox.log(\n `scheduleById(id=${id}): cannot create schedule - invalid var type (no string)`,\n 'error',\n );\n }\n };\n\n sandbox.getState(id, (err, state) => {\n if (!err && state?.val) {\n if (sandbox.verbose) {\n sandbox.log(`scheduleById(id=${id}): Init with value ${state.val}`, 'info');\n }\n init(state.val.toString());\n }\n });\n\n const triggerDef: Pattern = { id, change: 'any' };\n if (ack !== undefined) {\n triggerDef.ack = ack;\n }\n\n sandbox.on(triggerDef, obj => {\n if (obj?.state?.val) {\n sandbox.verbose &&\n sandbox.log(`scheduleById(id=${id}): Update with value ${obj.state.val}`, 'info');\n init(obj.state.val.toString());\n }\n });\n },\n getAstroDate: function (pattern: AstroEvent, date?: Date | number, offsetMinutes?: number): Date | undefined {\n if (date === undefined) {\n date = new Date();\n }\n if (typeof date === 'number') {\n date = new Date(date);\n } else {\n date = new Date(date.getTime());\n }\n\n if (!consts.astroList.includes(pattern)) {\n const pos = consts.astroListLow.indexOf(pattern.toLowerCase());\n if (pos !== -1) {\n pattern = consts.astroList[pos];\n }\n }\n\n if (\n (!(adapter.config as JavaScriptAdapterConfig).latitude &&\n ((adapter.config as JavaScriptAdapterConfig).latitude as unknown as number) !== 0) ||\n (!(adapter.config as JavaScriptAdapterConfig).longitude &&\n ((adapter.config as JavaScriptAdapterConfig).longitude as unknown as number) !== 0)\n ) {\n sandbox.log('Longitude or latitude does not set. Cannot use astro.', 'error');\n return;\n }\n\n // ensure events are calculated independent of current time\n date.setHours(12, 0, 0, 0);\n let ts = mods.suncalc.getTimes(\n date,\n (adapter.config as JavaScriptAdapterConfig).latitude,\n (adapter.config as JavaScriptAdapterConfig).longitude,\n )[pattern];\n\n if (ts === undefined || ts.getTime().toString() === 'NaN') {\n sandbox.log(\n `Cannot calculate astro date \"${pattern}\" for ${(adapter.config as JavaScriptAdapterConfig).latitude}, ${(adapter.config as JavaScriptAdapterConfig).longitude}`,\n 'warn',\n );\n }\n\n if (sandbox.verbose) {\n sandbox.log(`getAstroDate(pattern=${pattern}, date=${date.toString()}) => ${ts}`, 'info');\n }\n\n if (offsetMinutes !== undefined) {\n ts = new Date(ts.getTime() + offsetMinutes * 60000);\n }\n return ts;\n },\n isAstroDay: function (): boolean | undefined {\n const nowDate = new Date();\n const dayBegin = sandbox.getAstroDate('sunrise');\n const dayEnd = sandbox.getAstroDate('sunset');\n\n if (dayBegin === undefined || dayEnd === undefined) {\n return;\n }\n\n if (sandbox.verbose) {\n sandbox.log(`isAstroDay() => ${nowDate >= dayBegin && nowDate <= dayEnd}`, 'info');\n }\n\n return nowDate >= dayBegin && nowDate <= dayEnd;\n },\n clearSchedule: function (schedule: IobSchedule | ScheduleName | string): boolean {\n if (context.scheduler?.get(schedule as string | ScheduleName)) {\n if (sandbox.verbose) {\n sandbox.log('clearSchedule() => wizard cleared', 'info');\n }\n const pos = script.wizards.indexOf(schedule as string);\n if (pos !== -1) {\n script.wizards.splice(pos, 1);\n if (sandbox.__engine.__schedules > 0) {\n sandbox.__engine.__schedules--;\n }\n }\n context.scheduler.remove(schedule as string | ScheduleName);\n return true;\n }\n for (let i = 0; i < script.schedules.length; i++) {\n if (schedule && typeof schedule === 'object' && (schedule as IobSchedule)._ioBroker?.type === 'cron') {\n if (script.schedules[i]._ioBroker.id === (schedule as IobSchedule)._ioBroker.id) {\n if (!mods.nodeSchedule.cancelJob(script.schedules[i])) {\n sandbox.log('Error by canceling scheduled job', 'error');\n }\n script.schedules.splice(i, 1);\n if (sandbox.__engine.__schedules > 0) {\n sandbox.__engine.__schedules--;\n }\n\n if (sandbox.verbose) {\n sandbox.log('clearSchedule() => cleared', 'info');\n }\n return true;\n }\n } else if (script.schedules[i] === schedule) {\n if (!mods.nodeSchedule.cancelJob(script.schedules[i])) {\n sandbox.log('Error by canceling scheduled job', 'error');\n }\n script.schedules.splice(i, 1);\n if (sandbox.__engine.__schedules > 0) {\n sandbox.__engine.__schedules--;\n }\n\n if (sandbox.verbose) {\n sandbox.log('clearSchedule() => cleared', 'info');\n }\n return true;\n }\n }\n\n if (sandbox.verbose) {\n sandbox.log('clearSchedule() => invalid handler', 'warn');\n }\n return false;\n },\n getSchedules: function (allScripts?: boolean): ScheduleName[] {\n const schedules = context.scheduler?.getList() || [];\n if (allScripts) {\n Object.keys(context.scripts).forEach(\n name =>\n context.scripts[name].schedules &&\n context.scripts[name].schedules.forEach(s =>\n schedules.push(JSON.parse(JSON.stringify(s._ioBroker))),\n ),\n );\n } else {\n script.schedules &&\n script.schedules.forEach(s => schedules.push(JSON.parse(JSON.stringify(s._ioBroker))));\n }\n return schedules;\n },\n setState: function (\n id: string,\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean | 'true' | 'false' | ((err?: Error | null) => void),\n callback?: (err?: Error | null) => void,\n ): void {\n return setStateHelper(sandbox, false, false, id, state, isAck, callback);\n },\n setStateChanged: function (\n id: string,\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean | ((err?: Error | null) => void),\n callback?: (err?: Error | null) => void,\n ): void {\n return setStateHelper(sandbox, false, true, id, state, isAck, callback);\n },\n setStateDelayed: function (\n id: string,\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck: boolean | number | undefined,\n delay?: number | boolean,\n clearRunning?: boolean | ((err?: Error | null) => void),\n callback?: (err?: Error | null) => void,\n ): number | null {\n // find arguments\n if (typeof isAck !== 'boolean') {\n callback = clearRunning as (err?: Error | null) => void;\n clearRunning = delay as boolean;\n delay = isAck as number;\n isAck = undefined;\n }\n if (typeof delay !== 'number') {\n callback = clearRunning as (err?: Error | null) => void;\n clearRunning = delay as boolean;\n delay = 0;\n }\n if (typeof clearRunning !== 'boolean') {\n callback = clearRunning;\n clearRunning = true;\n }\n\n // Check a type of state\n if (!objects[id] && objects[`${adapter.namespace}.${id}`]) {\n id = `${adapter.namespace}.${id}`;\n }\n\n sandbox.verbose &&\n sandbox.log(\n `setStateDelayed(id=${id}, state=${JSON.stringify(state)}, isAck=${isAck}, delay=${delay}, clearRunning=${clearRunning})`,\n 'info',\n );\n\n if (clearRunning) {\n if (timers[id]) {\n sandbox.verbose &&\n sandbox.log(`setStateDelayed: clear ${timers[id].length} running timers`, 'info');\n\n for (let i = 0; i < timers[id].length; i++) {\n clearTimeout(timers[id][i].t);\n }\n delete timers[id];\n } else {\n if (sandbox.verbose) {\n sandbox.log('setStateDelayed: no running timers', 'info');\n }\n }\n }\n // If no delay => starts immediately\n if (!delay) {\n sandbox.setState(id, state, isAck, callback);\n return null;\n }\n // If delay\n timers[id] = timers[id] || [];\n\n // calculate timerId\n context.timerId++;\n if (context.timerId > 0xfffffffe) {\n context.timerId = 0;\n }\n\n // Start timeout\n const timer = setTimeout(\n function (_timerId, _id, _state, _isAck) {\n sandbox.setState(_id, _state, _isAck, callback);\n // delete timer handler\n if (timers[_id]) {\n // optimisation\n if (timers[_id].length === 1) {\n delete timers[_id];\n } else {\n for (let t = 0; t < timers[_id].length; t++) {\n if (timers[_id][t].id === _timerId) {\n timers[_id].splice(t, 1);\n break;\n }\n }\n if (!timers[_id].length) {\n delete timers[_id];\n }\n }\n }\n },\n delay,\n context.timerId,\n id,\n state,\n isAck,\n );\n\n // add timer handler\n timers[id].push({\n t: timer,\n id: context.timerId,\n ts: Date.now(),\n delay: delay,\n val:\n isObject(state) && (state as ioBroker.SettableState).val !== undefined\n ? ((state as ioBroker.SettableState).val as ioBroker.StateValue)\n : (state as ioBroker.StateValue),\n ack:\n isObject(state) &&\n (state as ioBroker.SettableState).val !== undefined &&\n (state as ioBroker.SettableState).ack !== undefined\n ? (state as ioBroker.SettableState).ack\n : isAck,\n });\n\n return context.timerId;\n },\n clearStateDelayed: function (id: string, timerId: number): boolean {\n // Check a type of state\n if (!objects[id] && objects[`${adapter.namespace}.${id}`]) {\n id = `${adapter.namespace}.${id}`;\n }\n\n if (sandbox.verbose) {\n sandbox.log(`clearStateDelayed(id=${id}, timerId=${timerId})`, 'info');\n }\n\n if (timers[id]) {\n for (let i = timers[id].length - 1; i >= 0; i--) {\n if (timerId === undefined || timers[id][i].id === timerId) {\n clearTimeout(timers[id][i].t);\n if (timerId !== undefined) {\n timers[id].splice(i, 1);\n }\n if (sandbox.verbose) {\n sandbox.log(`clearStateDelayed: clear timer ${timers[id][i].id}`, 'info');\n }\n }\n }\n if (timerId === undefined) {\n delete timers[id];\n } else {\n if (!timers[id].length) {\n delete timers[id];\n }\n }\n return true;\n }\n return false;\n },\n getStateDelayed: function (\n id: string | number,\n ):\n | null\n | { timerId: number; left: number; delay: number; val: ioBroker.StateValue; ack?: boolean }\n | { timerId: number; left: number; delay: number; val: ioBroker.StateValue; ack?: boolean }[]\n | Record<\n string,\n { timerId: number; left: number; delay: number; val: ioBroker.StateValue; ack?: boolean }[]\n > {\n const now = Date.now();\n if (id) {\n // Check a type of state\n if (!objects[id] && objects[`${adapter.namespace}.${id}`]) {\n id = `${adapter.namespace}.${id}`;\n }\n // If timerId given\n if (typeof id === 'number') {\n for (const _id_ in timers) {\n if (Object.prototype.hasOwnProperty.call(timers, _id_)) {\n for (let ttt = 0; ttt < timers[_id_].length; ttt++) {\n if (timers[_id_][ttt].id === id) {\n return {\n timerId: id,\n left: timers[_id_][ttt].delay - (now - timers[_id_][ttt].ts),\n delay: timers[_id_][ttt].delay,\n val: timers[_id_][ttt].val,\n ack: timers[_id_][ttt].ack,\n };\n }\n }\n }\n }\n return null;\n }\n\n const result: {\n timerId: number;\n left: number;\n delay: number;\n val: ioBroker.StateValue;\n ack?: boolean;\n }[] = [];\n if (Object.prototype.hasOwnProperty.call(timers, id) && timers[id] && timers[id].length) {\n for (let tt = 0; tt < timers[id].length; tt++) {\n result.push({\n timerId: timers[id][tt].id,\n left: timers[id][tt].delay - (now - timers[id][tt].ts),\n delay: timers[id][tt].delay,\n val: timers[id][tt].val,\n ack: timers[id][tt].ack,\n });\n }\n }\n return result;\n }\n const result: Record<\n string,\n { timerId: number; left: number; delay: number; val: ioBroker.StateValue; ack?: boolean }[]\n > = {};\n for (const _id in timers) {\n if (Object.prototype.hasOwnProperty.call(timers, _id) && timers[_id] && timers[_id].length) {\n result[_id] = [];\n for (let t = 0; t < timers[_id].length; t++) {\n result[_id].push({\n timerId: timers[_id][t].id,\n left: timers[_id][t].delay - (now - timers[_id][t].ts),\n delay: timers[_id][t].delay,\n val: timers[_id][t].val,\n ack: timers[_id][t].ack,\n });\n }\n }\n }\n return result;\n },\n getStateAsync: async function (id: string): Promise {\n let state: ioBroker.State | null | undefined;\n if (id.includes('.')) {\n state = await adapter.getForeignStateAsync(id);\n } else {\n state = await adapter.getStateAsync(id);\n }\n return context.convertBackStringifiedValues(id, state);\n },\n setStateAsync: function (\n id: string,\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean,\n ): Promise {\n return new Promise((resolve, reject) =>\n setStateHelper(sandbox, false, false, id, state, isAck, err => (err ? reject(err) : resolve())),\n );\n },\n setStateChangedAsync: function (\n id: string,\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean,\n ): Promise {\n return new Promise((resolve, reject) =>\n setStateHelper(sandbox, false, true, id, state, isAck, err => (err ? reject(err) : resolve())),\n );\n },\n getState: function (\n id: string,\n callback?: (err: Error | null | undefined, state?: ioBroker.State | null) => void,\n ): undefined | void | (ioBroker.State & { notExist?: true }) | null {\n if (typeof id !== 'string') {\n sandbox.log(`getState has been called with id of type \"${typeof id}\" but expects a string`, 'error');\n return undefined;\n }\n\n if (typeof callback === 'function') {\n if (!id.includes('.')) {\n adapter.getState(id, (err, state) =>\n callback(err, context.convertBackStringifiedValues(id, state)),\n );\n } else {\n void adapter.getForeignState(id, (err, state) =>\n callback(err, context.convertBackStringifiedValues(id, state)),\n );\n }\n } else {\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n sandbox.log(\n 'The \"getState\" method cannot be used synchronously, because the adapter setting \"Do not subscribe to all states on start\" is enabled.',\n 'error',\n );\n sandbox.log(\n `Please disable that setting or use \"getState\" with a callback, e.g.: getState('${id}', (err, state) => { ... });`,\n 'error',\n );\n } else {\n if (states[id]) {\n sandbox.verbose &&\n sandbox.log(\n `getState(id=${id}, timerId=${JSON.stringify(timers[id])}) => ${JSON.stringify(states[id])}`,\n 'info',\n );\n if (context.interimStateValues[id] !== undefined) {\n return context.convertBackStringifiedValues(id, context.interimStateValues[id]);\n }\n return context.convertBackStringifiedValues(id, states[id]);\n } else if (states[`${adapter.namespace}.${id}`]) {\n sandbox.verbose &&\n sandbox.log(\n `getState(id=${id}, timerId=${JSON.stringify(timers[id])}) => ${JSON.stringify(states[`${adapter.namespace}.${id}`])}`,\n 'info',\n );\n if (context.interimStateValues[`${adapter.namespace}.${id}`] !== undefined) {\n return context.convertBackStringifiedValues(\n id,\n context.interimStateValues[`${adapter.namespace}.${id}`],\n );\n }\n return context.convertBackStringifiedValues(id, states[`${adapter.namespace}.${id}`]);\n }\n\n if (sandbox.verbose) {\n sandbox.log(`getState(id=${id}, timerId=${JSON.stringify(timers[id])}) => not found`, 'info');\n }\n\n context.logWithLineInfo(\n `getState \"${id}\" not found (3)${states[id] !== undefined ? ` states[id]=${JSON.stringify(states[id])}` : ''}`,\n ); ///xxx\n return { val: null, notExist: true } as ioBroker.State & { notExist?: true };\n }\n }\n },\n existsState: function (\n id: string,\n callback?: (err: Error | null | undefined, stateExists?: boolean) => void,\n ): void | boolean {\n if (typeof id !== 'string') {\n sandbox.log(`existsState has been called with id of type \"${typeof id}\" but expects a string`, 'error');\n return false;\n }\n\n if (typeof callback === 'function') {\n void adapter.getForeignObject(id, (err, obj) => {\n if (!obj || obj.type !== 'state') {\n callback(err, false);\n return;\n }\n\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n void adapter.getForeignState(id, (err, state) => {\n callback(err, !!state);\n });\n } else {\n callback(err, !!states[id]);\n }\n });\n } else {\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n sandbox.log(\n 'The \"existsState\" method cannot be used synchronously, because the adapter setting \"Do not subscribe to all states on start\" is enabled.',\n 'error',\n );\n sandbox.log(\n `Please disable that setting or use \"existsState\" with a callback, e.g.: existsState('${id}', (err, stateExists) => { ... });`,\n 'error',\n );\n } else {\n return !!states[id];\n }\n }\n },\n existsObject: function (\n id: string,\n callback?: (err: Error | null | undefined, objectExists?: boolean) => void,\n ): void | boolean {\n if (typeof id !== 'string') {\n sandbox.log(\n `existsObject has been called with id of type \"${typeof id}\" but expects a string`,\n 'error',\n );\n return false;\n }\n\n if (typeof callback === 'function') {\n void adapter.getForeignObject(id, (err, obj) => callback(err, !!obj));\n } else {\n return !!objects[id];\n }\n },\n getIdByName: function (name: string, alwaysArray?: boolean): string | string[] | null {\n sandbox.verbose &&\n sandbox.log(\n `getIdByName(name=${name}, alwaysArray=${alwaysArray}) => ${JSON.stringify(context.names[name])}`,\n 'info',\n );\n if (Object.prototype.hasOwnProperty.call(context.names, name)) {\n if (alwaysArray) {\n return !Array.isArray(context.names[name]) ? [context.names[name]] : context.names[name];\n }\n return context.names[name];\n }\n if (alwaysArray) {\n return [];\n }\n return null;\n },\n getObject: function (\n id: string,\n enumName: null | string | ((err: Error | null | undefined, obj?: ioBroker.Object | null) => void),\n cb?: (err: Error | null | undefined, obj?: ioBroker.Object | null) => void,\n ): void | ioBroker.Object | null {\n if (typeof id !== 'string') {\n sandbox.log(`getObject has been called with id of type \"${typeof id}\" but expects a string`, 'error');\n return null;\n }\n\n if (typeof enumName === 'function') {\n cb = enumName;\n enumName = null;\n }\n // with callback\n if (typeof cb === 'function') {\n void adapter.getForeignObject(id, (err, obj) => {\n if (obj) {\n objects[id] = obj;\n } else if (objects[id]) {\n delete objects[id];\n }\n let result: ioBroker.Object | null | undefined;\n try {\n result = JSON.parse(JSON.stringify(objects[id]));\n } catch (err: unknown) {\n void adapter.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: true,\n ack: true,\n c: 'getObject',\n });\n sandbox.log(`Object \"${id}\" can't be copied: ${JSON.stringify(err)}`, 'error');\n return cb(null, null);\n }\n sandbox.verbose &&\n sandbox.log(`getObject(id=${id}, enumName=${enumName}) => ${JSON.stringify(result)}`, 'info');\n cb(err, result);\n });\n } else {\n if (!objects[id]) {\n sandbox.verbose &&\n sandbox.log(`getObject(id=${id}, enumName=${enumName}) => does not exist`, 'info');\n sandbox.log(`Object \"${id}\" does not exist`, 'warn');\n return null;\n }\n if (enumName) {\n const e = eventObj.getObjectEnumsSync(context, id);\n const obj = JSON.parse(JSON.stringify(objects[id]));\n obj.enumIds = JSON.parse(JSON.stringify(e.enumIds));\n obj.enumNames = JSON.parse(JSON.stringify(e.enumNames));\n if (typeof enumName === 'string') {\n const r = new RegExp(`^enum\\\\.${enumName}\\\\.`);\n for (let i = obj.enumIds.length - 1; i >= 0; i--) {\n if (!r.test(obj.enumIds[i])) {\n obj.enumIds.splice(i, 1);\n obj.enumNames.splice(i, 1);\n }\n }\n }\n sandbox.verbose &&\n sandbox.log(`getObject(id=${id}, enumName=${enumName}) => ${JSON.stringify(obj)}`, 'info');\n\n return obj;\n }\n let result: ioBroker.Object | null | undefined;\n try {\n result = JSON.parse(JSON.stringify(objects[id]));\n } catch (err: unknown) {\n void adapter.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: true,\n ack: true,\n c: 'getObject',\n });\n sandbox.log(`Object \"${id}\" can't be copied: ${JSON.stringify(err)}`, 'error');\n return null;\n }\n sandbox.verbose &&\n sandbox.log(`getObject(id=${id}, enumName=${enumName}) => ${JSON.stringify(result)}`, 'info');\n return result;\n }\n },\n // This function will be overloaded later if the modification of objects is allowed\n setObject: function (\n _id: string,\n _obj: ioBroker.Object,\n callback?: (err?: Error | null, res?: { id: string }) => void,\n ): void {\n sandbox.log('Function \"setObject\" is not allowed. Use adapter settings to allow it.', 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(\n sandbox,\n new Error('Function \"setObject\" is not allowed. Use adapter settings to allow it.'),\n );\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n },\n // This function will be overloaded later if the modification of objects is allowed\n extendObject: function (\n _id: string,\n _obj: Partial,\n callback?: (err?: Error | null, res?: { id: string }) => void,\n ): void {\n sandbox.log('Function \"extendObject\" is not allowed. Use adapter settings to allow it.', 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(\n sandbox,\n new Error('Function \"extendObject\" is not allowed. Use adapter settings to allow it.'),\n );\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n },\n // This function will be overloaded later if the modification of objects is allowed\n deleteObject: function (\n _id: string,\n _isRecursive?: boolean | ioBroker.ErrorCallback,\n callback?: ioBroker.ErrorCallback,\n ): void {\n if (typeof _isRecursive === 'function') {\n callback = _isRecursive;\n }\n sandbox.log('Function \"deleteObject\" is not allowed. Use adapter settings to allow it.', 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(\n sandbox,\n new Error('Function \"deleteObject\" is not allowed. Use adapter settings to allow it.'),\n );\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n },\n getEnums: function (enumName?: string): { id: string; members: string[]; name: ioBroker.StringOrTranslated }[] {\n const result: { id: string; members: string[]; name: ioBroker.StringOrTranslated }[] = [];\n const r = enumName ? new RegExp(`^enum\\\\.${enumName}\\\\.`) : false;\n for (let i = 0; i < enums.length; i++) {\n if (!r || r.test(enums[i])) {\n const common: ioBroker.EnumCommon =\n (objects[enums[i]] as ioBroker.EnumObject).common || ({} as ioBroker.EnumCommon);\n result.push({\n id: enums[i],\n members: common.members || [],\n name: common.name || '',\n });\n }\n }\n if (sandbox.verbose) {\n sandbox.log(`getEnums(enumName=${enumName}) => ${JSON.stringify(result)}`, 'info');\n }\n return JSON.parse(JSON.stringify(result));\n },\n createAlias: function (\n name: string,\n alias: string | CommonAlias,\n forceCreation: boolean | Partial | ((err: Error | null) => void) | undefined,\n common?: Partial | Record | ((err: Error | null) => void),\n native?: Record | ((err: Error | null) => void),\n callback?: (err: Error | null) => void,\n ) {\n if (typeof native === 'function') {\n callback = native as (err: Error | null) => void;\n native = {};\n }\n if (typeof common === 'function') {\n callback = common as (err: Error | null) => void;\n common = undefined;\n }\n if (typeof forceCreation === 'function') {\n callback = forceCreation as (err: Error | null) => void;\n forceCreation = undefined;\n }\n if (isObject(forceCreation)) {\n native = common;\n common = forceCreation as Partial;\n forceCreation = undefined;\n }\n\n if (typeof name !== 'string') {\n const err = `Wrong type of name \"${typeof name}\". Expected \"string\".`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n\n if (!name) {\n const err = 'Empty ID is not allowed.';\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n\n if (!name.startsWith('alias.0.')) {\n name = `alias.0.${name}`;\n }\n\n const _common: Partial = (common as Partial) || {};\n if (isObject(_common.alias)) {\n // alias already in common, use this\n } else if (\n isObject(alias) &&\n (typeof (alias as CommonAlias).id === 'string' || isObject((alias as CommonAlias).id))\n ) {\n _common.alias = alias as CommonAlias;\n } else if (typeof alias === 'string') {\n _common.alias = { id: alias };\n } else {\n const err = 'Source ID needs to be provided as string or object with id property.';\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n\n let aliasSourceId = '';\n if (_common.alias) {\n aliasSourceId = isObject(_common.alias.id)\n ? (_common.alias.id as { read: string; write: string }).read\n : (_common.alias.id as string);\n if (!objects[aliasSourceId] && objects[`${adapter.namespace}.${aliasSourceId}`]) {\n aliasSourceId = `${adapter.namespace}.${aliasSourceId}`;\n if (isObject(_common.alias.id)) {\n (_common.alias.id as { read: string; write: string }).read = aliasSourceId;\n } else {\n _common.alias.id = aliasSourceId;\n }\n }\n if (\n isObject(_common.alias.id) &&\n (_common.alias.id as { read: string; write: string }).write &&\n !objects[(_common.alias.id as { read: string; write: string }).write] &&\n objects[`${adapter.namespace}.${(_common.alias.id as { read: string; write: string }).write}`]\n ) {\n (_common.alias.id as { read: string; write: string }).write =\n `${adapter.namespace}.${(_common.alias.id as { read: string; write: string }).write}`;\n }\n }\n const obj = objects[aliasSourceId];\n if (!obj) {\n const err = `Alias source object \"${aliasSourceId}\" does not exist.`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n if (obj.type !== 'state') {\n const err = `Alias source object \"${aliasSourceId}\" must be a state object.`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n if (_common.name === undefined) {\n _common.name = obj.common.name || name;\n }\n if (_common.type === undefined && obj.common.type !== undefined) {\n _common.type = obj.common.type;\n }\n if (_common.role === undefined && obj.common.role !== undefined) {\n _common.role = obj.common.role;\n }\n if (_common.min === undefined && obj.common.min !== undefined) {\n _common.min = obj.common.min;\n }\n if (_common.max === undefined && obj.common.max !== undefined) {\n _common.max = obj.common.max;\n }\n if (_common.step === undefined && obj.common.step !== undefined) {\n _common.step = obj.common.step;\n }\n if (_common.unit === undefined && obj.common.unit !== undefined) {\n _common.unit = obj.common.unit;\n }\n if (_common.desc === undefined && obj.common.desc !== undefined) {\n _common.desc = obj.common.desc;\n }\n\n return sandbox.createState(\n name,\n undefined,\n forceCreation as boolean,\n _common,\n native,\n callback as (err?: Error | null) => void,\n );\n },\n createState: async function (\n name: string,\n initValue: undefined | ioBroker.StateValue | ioBroker.State,\n forceCreation:\n | boolean\n | undefined\n | Record\n | Partial\n | ((err: Error | null) => void),\n common?: Partial | ((err: Error | null) => void),\n native?: Record | ((err: Error | null) => void),\n callback?: (error: Error | null | undefined, id?: string) => void,\n ) {\n if (typeof native === 'function') {\n callback = native as (err?: Error | null) => void;\n native = {};\n }\n if (typeof common === 'function') {\n callback = common as (err?: Error | null) => void;\n common = undefined;\n }\n if (typeof initValue === 'function') {\n callback = initValue as (err?: Error | null) => void;\n initValue = undefined;\n }\n if (typeof forceCreation === 'function') {\n callback = forceCreation as (err?: Error | null) => void;\n forceCreation = undefined;\n }\n if (isObject(initValue)) {\n common = initValue as Partial;\n native = forceCreation as Record;\n forceCreation = undefined;\n initValue = undefined;\n }\n if (isObject(forceCreation)) {\n native = common as Record;\n common = forceCreation as Partial;\n forceCreation = undefined;\n }\n\n if (typeof name !== 'string') {\n const err = `Wrong type of name \"${typeof name}\". Expected \"string\".`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n\n if (!name) {\n const err = 'Empty ID is not allowed.';\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n\n const isAlias = name.startsWith('alias.0.');\n\n const _common: ioBroker.StateCommon = (common || {}) as ioBroker.StateCommon;\n _common.name = _common.name || name;\n _common.role = _common.role || 'state';\n _common.type = _common.type || 'mixed';\n if (!isAlias && initValue === undefined) {\n initValue = _common.def;\n }\n\n native = native || {};\n\n // Check min, max and def values for number\n if (_common.type !== undefined && _common.type === 'number') {\n let min = 0;\n let max = 0;\n let def = 0;\n let err: string | undefined;\n if (_common.min !== undefined) {\n min = _common.min;\n if (typeof min !== 'number') {\n min = parseFloat(min);\n if (isNaN(min)) {\n err = `Wrong type of ${name}.common.min`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n _common.min = min;\n }\n }\n if (_common.max !== undefined) {\n max = _common.max;\n if (typeof max !== 'number') {\n max = parseFloat(max);\n if (isNaN(max)) {\n err = `Wrong type of ${name}.common.max`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n _common.max = max;\n }\n }\n\n if (_common.def !== undefined) {\n if (isAlias) {\n delete _common.def;\n } else {\n def = _common.def;\n if (typeof def !== 'number') {\n def = parseFloat(def);\n if (isNaN(def)) {\n err = `Wrong type of ${name}.common.def`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n _common.def = def;\n }\n }\n }\n\n if (_common.min !== undefined && _common.max !== undefined && min > max) {\n _common.max = min;\n _common.min = max;\n }\n if (_common.def !== undefined && _common.min !== undefined && def < min) {\n _common.def = min;\n }\n if (_common.def !== undefined && _common.max !== undefined && def > max) {\n _common.def = max;\n }\n }\n\n if (sandbox.verbose) {\n sandbox.log(\n `createState(name=${name}, initValue=${JSON.stringify(initValue)}, forceCreation=${JSON.stringify(forceCreation)}, common=${JSON.stringify(common)}, native=${JSON.stringify(native)}, isAlias=${isAlias})`,\n 'debug',\n );\n }\n\n let id = `${adapter.namespace}.${name}`;\n if (name.match(/^javascript\\.\\d+\\./) || name.startsWith('0_userdata.0.') || isAlias) {\n id = name;\n }\n if (id.match(/^javascript\\.\\d+\\.scriptEnabled/)) {\n sandbox.log(\n `Own states (${id}) should not be created in javascript.X.scriptEnabled.*! Please move the states to 0_userdata.0.*`,\n 'info',\n );\n } else if (id.match(/^javascript\\.\\d+\\.scriptProblem/)) {\n sandbox.log(\n `Own states (${id}) should not be created in javascript.X.scriptProblem.*! Please move the states to 0_userdata.0.*`,\n 'info',\n );\n }\n\n // User can create aliases by two ways:\n // - id is starting with \"alias.0.\" and common.alias.id is set, so the state defined in common.alias.id will be created automatically if not exists\n // - id is not starting with \"alias.0.\", but common.alias is set, so the state defined in common.alias will be created automatically if not exists\n if (!isAlias && _common.alias) {\n // check and create if not exists the alias\n let alias: CommonAlias;\n if (typeof _common.alias === 'string') {\n alias = {\n id: _common.alias,\n };\n } else if (typeof _common.alias === 'boolean') {\n const parts = id.split('.');\n parts[0] = 'alias';\n parts[1] = '0';\n\n alias = {\n id: parts.join('.'),\n };\n } else {\n alias = _common.alias;\n }\n delete _common.alias;\n\n if (!(alias.id as string).startsWith('alias.0.')) {\n alias.id = `alias.0.${alias.id as string}`;\n }\n\n let aObj: ioBroker.StateObject | null | undefined;\n try {\n aObj = (await adapter.getForeignObjectAsync(alias.id as string)) as\n | ioBroker.StateObject\n | null\n | undefined;\n } catch {\n // ignore\n }\n if (!aObj) {\n try {\n const _obj: ioBroker.StateObject = {\n _id: alias.id as string,\n type: 'state',\n common: {\n name: `Alias to ${id}`,\n role: 'state',\n type: _common.type,\n read: _common.read,\n write: _common.write,\n unit: _common.unit,\n alias: {\n id,\n read: alias.read,\n write: alias.write,\n },\n },\n native: {},\n };\n\n await adapter.setForeignObjectAsync(alias.id as string, _obj);\n } catch (err: unknown) {\n sandbox.log(`Cannot create alias \"${alias.id as string}\": ${err as Error}`, 'error');\n }\n }\n } else if (isAlias && _common.alias) {\n if (typeof _common.alias === 'string') {\n _common.alias = {\n id: _common.alias,\n };\n }\n const readId = typeof _common.alias.id === 'string' ? _common.alias.id : _common.alias.id.read;\n let writeId: string | undefined =\n typeof _common.alias.id === 'string' ? _common.alias.id : _common.alias.id.write;\n if (writeId === readId) {\n writeId = undefined;\n }\n // try to create the linked states\n let aObj: ioBroker.StateObject | null | undefined;\n try {\n aObj = (await adapter.getForeignObjectAsync(readId)) as ioBroker.StateObject | null | undefined;\n } catch {\n // ignore\n }\n if (!aObj) {\n try {\n await adapter.setForeignObjectAsync(readId, {\n type: 'state',\n common: {\n name: `State for ${id}`,\n role: 'state',\n type: _common.type,\n read: _common.read,\n write: _common.write,\n unit: _common.unit,\n },\n native: {},\n });\n } catch (err: unknown) {\n sandbox.log(`Cannot create alias \"${readId}\": ${err as Error}`, 'error');\n }\n }\n if (writeId && _common.write !== false) {\n try {\n aObj = (await adapter.getForeignObjectAsync(writeId)) as\n | ioBroker.StateObject\n | null\n | undefined;\n } catch {\n // ignore\n }\n if (!aObj) {\n try {\n await adapter.setForeignObjectAsync(writeId, {\n type: 'state',\n common: {\n name: `Write state for ${id}`,\n role: 'state',\n type: _common.type,\n read: _common.read,\n write: _common.write,\n unit: _common.unit,\n },\n native: {},\n });\n } catch (err: unknown) {\n sandbox.log(`Cannot create alias \"${writeId}\": ${err as Error}`, 'error');\n }\n }\n }\n }\n\n let obj: ioBroker.Object | null | undefined;\n try {\n obj = await adapter.getForeignObjectAsync(id);\n } catch {\n // ignore\n }\n\n if (\n obj?._id &&\n validIdForAutomaticFolderCreation(obj._id) &&\n obj.type === 'folder' &&\n obj.native &&\n obj.native.autocreated === 'by automatic ensure logic'\n ) {\n // ignore a default created object because we now have a better defined one\n obj = null;\n }\n\n if (!obj || forceCreation) {\n // create new one\n const newObj: ioBroker.StateObject = {\n _id: id,\n common: _common,\n native,\n type: 'state',\n };\n try {\n await adapter.setForeignObjectAsync(id, newObj);\n } catch (err: unknown) {\n sandbox.log(`Cannot set object \"${id}\": ${err as Error}`, 'warn');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, err as Error);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n\n // Update meta objects\n context.updateObjectContext(id, newObj);\n\n if (!isAlias && initValue !== undefined) {\n if (isObject(initValue) && (initValue as ioBroker.State).ack !== undefined) {\n setStateHelper(sandbox, true, false, id, initValue, callback);\n } else {\n setStateHelper(sandbox, true, false, id, initValue, true, callback);\n }\n } else if (!isAlias && !forceCreation) {\n setStateHelper(sandbox, true, false, id, null, callback);\n } else if (isAlias) {\n try {\n const state = await adapter.getForeignStateAsync(id);\n if (state) {\n states[id] = state;\n }\n } catch {\n // ignore\n }\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, null, id);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n } else if (typeof callback === 'function') {\n try {\n callback.call(sandbox, null, id);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n await ensureObjectStructure(id);\n } else {\n // state yet exists\n if (\n !(adapter.config as JavaScriptAdapterConfig).subscribe &&\n !states[id] &&\n states[`${adapter.namespace}.${id}`] === undefined\n ) {\n states[id] = {\n val: null,\n ack: true,\n lc: Date.now(),\n ts: Date.now(),\n q: 0,\n from: `system.adapter.${adapter.namespace}`,\n };\n }\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, null, id);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n\n await ensureObjectStructure(id);\n }\n },\n deleteState: function (id: string, callback?: (err: Error | null | undefined, found?: boolean) => void): void {\n // todo: check rights\n // todo: also remove from \"names\"\n\n if (sandbox.verbose) {\n sandbox.log(`deleteState(id=${id})`, 'debug');\n }\n\n let found = false;\n if ((id.startsWith('0_userdata.0.') || id.startsWith(adapter.namespace)) && objects[id]) {\n found = true;\n delete objects[id];\n if (states[id]) {\n delete states[id];\n }\n\n adapter.delForeignObject(id, function (err) {\n err && sandbox.log(`Object for state \"${id}\" does not exist: ${err}`, 'warn');\n\n adapter.delForeignState(id, function (err) {\n err && sandbox.log(`Cannot delete state \"${id}\": ${err}`, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, err, found);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n });\n });\n } else if (objects[`${adapter.namespace}.${id}`]) {\n delete objects[`${adapter.namespace}.${id}`];\n found = true;\n if (states[`${adapter.namespace}.${id}`]) {\n delete states[`${adapter.namespace}.${id}`];\n }\n\n adapter.delObject(id, function (err) {\n err && sandbox.log(`Object for state \"${id}\" does not exist: ${err}`, 'warn');\n\n adapter.delState(id, function (err) {\n err && sandbox.log(`Cannot delete state \"${id}\": ${err}`, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, err, found);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n });\n });\n } else {\n const err = 'Not found';\n sandbox.log(`Cannot delete state \"${id}\": ${err}`, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err), found);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n }\n },\n sendTo: function (\n _adapter: string,\n cmd: string,\n msg?: any,\n options?: Record | ((result: any, options: Record, _adapter: string) => void),\n callback?: (result: any, options: Record, _adapter: string) => void,\n ): void {\n const defaultTimeout = 20000;\n\n if (typeof options === 'function') {\n callback = options as (result: any, options: Record, _adapter: string) => void;\n options = { timeout: defaultTimeout };\n }\n\n let timeout: NodeJS.Timeout | null = null;\n if (typeof callback === 'function') {\n const timeoutDuration = parseInt(options?.timeout, 10) || defaultTimeout;\n\n timeout = setTimeout(() => {\n timeout = null;\n\n if (sandbox.verbose) {\n sandbox.log(`sendTo => timeout: ${timeoutDuration}`, 'debug');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, { error: 'timeout' }, options as Record, _adapter);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n callback = undefined;\n }\n }, timeoutDuration);\n }\n\n let cbFunc: undefined | ((result: any) => void);\n if (timeout) {\n cbFunc = function (result: any): void {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n\n if (sandbox.verbose && result) {\n sandbox.log(`sendTo => ${JSON.stringify(result)}`, 'debug');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, result, options as Record, _adapter);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n callback = undefined;\n }\n };\n }\n\n // If specific instance\n if (_adapter.match(/\\.[0-9]+$/)) {\n sandbox.verbose &&\n sandbox.log(\n `sendTo(instance=${_adapter}, cmd=${cmd}, msg=${JSON.stringify(msg)}, hasCallback=${typeof callback === 'function'})`,\n 'info',\n );\n\n adapter.sendTo(_adapter, cmd, msg, cbFunc, options);\n } else {\n // Send it to all instances\n context.adapter.getObjectView(\n 'system',\n 'instance',\n { startkey: `system.adapter.${_adapter}.`, endkey: `system.adapter.${_adapter}.\\u9999` },\n options,\n (err, res) => {\n if (err || !res) {\n sandbox.log(`sendTo failed: ${err?.message}`, 'error');\n return;\n }\n\n const instances = res.rows.map(item => item.id.substring('system.adapter.'.length));\n\n instances.forEach(instance => {\n sandbox.verbose &&\n sandbox.log(\n `sendTo(instance=${instance}, cmd=${cmd}, msg=${JSON.stringify(msg)}, hasCallback=${typeof callback === 'function'})`,\n 'info',\n );\n adapter.sendTo(instance, cmd, msg, cbFunc, options);\n });\n },\n );\n }\n },\n sendto: function (\n _adapter: string,\n cmd: string,\n msg: any,\n callback?: (result: any, options: Record, _adapter: string) => void,\n ): void {\n return sandbox.sendTo(_adapter, cmd, msg, callback);\n },\n sendToAsync: function (_adapter: string, cmd: string, msg?: any, options?: Record): Promise {\n return new Promise((resolve, reject) => {\n sandbox.sendTo(_adapter, cmd, msg, options, res => {\n if (!res || res.error) {\n reject(res ? new Error(res.error) : new Error('Unknown error'));\n } else {\n resolve(res);\n }\n });\n });\n },\n sendToHost: function (host: string, cmd: string, msg?: any, callback?: (result: any) => void): void {\n if (!(adapter.config as JavaScriptAdapterConfig).enableSendToHost) {\n const error =\n 'sendToHost is not available. Please enable \"Enable SendToHost\" option in instance settings';\n sandbox.log(error, 'error');\n\n if (typeof callback === 'function') {\n // leave it as a normal function and not as a lambda, to hide the \"this\" object\n setImmediate(function () {\n callback(error);\n });\n }\n } else {\n sandbox.verbose &&\n sandbox.log(`sendToHost(adapter=${host}, cmd=${cmd}, msg=${JSON.stringify(msg)})`, 'info');\n adapter.sendToHost(host, cmd, msg, callback);\n }\n },\n sendToHostAsync: function (host: string, cmd: string, msg?: any): Promise {\n return new Promise((resolve, reject) => {\n sandbox.sendToHost(host, cmd, msg, res => {\n if (!res || res.error) {\n reject(res ? new Error(res.error) : new Error('Unknown error'));\n } else {\n resolve(res);\n }\n });\n });\n },\n registerNotification: function (msg: string, isAlert?: boolean): void {\n const category = !isAlert ? 'scriptMessage' : 'scriptAlert';\n\n if (sandbox.verbose) {\n sandbox.log(`registerNotification(msg=${msg}, category=${category})`, 'info');\n }\n\n void adapter.registerNotification('javascript', category, msg);\n },\n setInterval: function (callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout | null {\n if (typeof callback === 'function') {\n const int: NodeJS.Timeout = setInterval(() => {\n try {\n callback.call(sandbox, ...args);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, ms);\n script.intervals.push(int);\n\n if (sandbox.verbose) {\n sandbox.log(`setInterval(ms=${ms})`, 'info');\n }\n return int;\n }\n sandbox.log(`Invalid callback for setInterval! - ${typeof callback}`, 'error');\n return null;\n },\n clearInterval: function (id: NodeJS.Timeout): void {\n const pos = script.intervals.indexOf(id);\n if (pos !== -1) {\n if (sandbox.verbose) {\n sandbox.log('clearInterval() => cleared', 'info');\n }\n clearInterval(id);\n script.intervals.splice(pos, 1);\n } else {\n if (sandbox.verbose) {\n sandbox.log('clearInterval() => not found', 'warn');\n }\n }\n },\n setTimeout: function (callback: (args?: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout | null {\n if (typeof callback === 'function') {\n const to = setTimeout(() => {\n // Remove timeout from the list\n const pos = script.timeouts.indexOf(to);\n if (pos !== -1) {\n script.timeouts.splice(pos, 1);\n }\n\n try {\n callback.call(sandbox, ...args);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, ms);\n if (sandbox.verbose) {\n sandbox.log(`setTimeout(ms=${ms})`, 'info');\n }\n\n script.timeouts.push(to);\n return to;\n }\n sandbox.log(`Invalid callback for setTimeout! - ${typeof callback}`, 'error');\n return null;\n },\n clearTimeout: function (id: NodeJS.Timeout): void {\n const pos = script.timeouts.indexOf(id);\n if (pos !== -1) {\n if (sandbox.verbose) {\n sandbox.log('clearTimeout() => cleared', 'info');\n }\n clearTimeout(id);\n script.timeouts.splice(pos, 1);\n } else {\n if (sandbox.verbose) {\n sandbox.log('clearTimeout() => not found', 'warn');\n }\n }\n },\n setImmediate: function (callback: (..._args: any[]) => void, ...args: any[]): void {\n if (typeof callback === 'function') {\n setImmediate(() => {\n try {\n callback.apply(sandbox, args);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n });\n if (sandbox.verbose) {\n sandbox.log('setImmediate()', 'info');\n }\n } else {\n sandbox.log(`Invalid callback for setImmediate! - ${typeof callback}`, 'error');\n }\n },\n cb: function (callback: (..._args: any[]) => void): (...args: any[]) => void {\n return function (args: any[]) {\n if (context.scripts[name]?._id === sandbox._id) {\n if (typeof callback === 'function') {\n try {\n callback.apply(sandbox, args);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n } else {\n sandbox.log(`Callback for old version of script: ${name}`, 'warn');\n }\n };\n },\n compareTime: function (\n startTime: iobJS.AstroDate | string | Date | number,\n endTime: iobJS.AstroDate | string | Date | number | null,\n operation: 'between' | 'not between' | '<' | '<=' | '>' | '>=' | '==' | '<>' | '!=',\n time?: iobJS.AstroDate | string | Date | number,\n ): boolean {\n if (startTime && typeof startTime === 'string') {\n const pos = consts.astroListLow.indexOf(startTime.toLowerCase());\n if (pos !== -1) {\n const aTime = sandbox.getAstroDate(consts.astroList[pos]);\n if (aTime) {\n startTime = aTime.toLocaleTimeString([], {\n hour: '2-digit',\n minute: '2-digit',\n hour12: false,\n });\n } else {\n startTime = 0;\n }\n }\n } else if (startTime && isObject(startTime) && (startTime as iobJS.AstroDate).astro) {\n const aTime = sandbox.getAstroDate(\n (startTime as iobJS.AstroDate).astro,\n (startTime as iobJS.AstroDate).date || new Date(),\n (startTime as iobJS.AstroDate).offset || 0,\n );\n if (aTime) {\n startTime = aTime.toLocaleTimeString([], {\n hour: '2-digit',\n minute: '2-digit',\n hour12: false,\n });\n } else {\n startTime = 0;\n }\n }\n\n if (endTime && typeof endTime === 'string') {\n const pos = consts.astroListLow.indexOf(endTime.toLowerCase());\n if (pos !== -1) {\n const aTime = sandbox.getAstroDate(consts.astroList[pos]);\n endTime =\n aTime?.toLocaleTimeString([], {\n hour: '2-digit',\n minute: '2-digit',\n hour12: false,\n }) || 0;\n }\n } else if (endTime && isObject(endTime) && (endTime as iobJS.AstroDate).astro) {\n const aTime = sandbox.getAstroDate(\n (endTime as iobJS.AstroDate).astro,\n (endTime as iobJS.AstroDate).date || new Date(),\n (endTime as iobJS.AstroDate).offset || 0,\n );\n endTime =\n aTime?.toLocaleTimeString([], {\n hour: '2-digit',\n minute: '2-digit',\n hour12: false,\n }) || 0;\n }\n\n // --- Convert \"time\" to number\n let nTime: number | undefined;\n // maybe it is astro date like 'sunrise' or 'sunset'\n if (time && typeof time === 'string') {\n const pos = consts.astroListLow.indexOf(time.toLowerCase());\n if (pos !== -1) {\n nTime = sandbox.getAstroDate(consts.astroList[pos])?.getTime() || 0;\n }\n } else if (time && isObject(time) && (time as iobJS.AstroDate).astro) {\n nTime =\n sandbox\n .getAstroDate(\n (time as iobJS.AstroDate).astro,\n (time as iobJS.AstroDate).date || new Date(),\n (time as iobJS.AstroDate).offset || 0,\n )\n ?.getTime() || 0;\n }\n\n let daily = true;\n if (time) {\n daily = false;\n }\n // if not astro date\n if (!nTime) {\n if (time && !isObject(time)) {\n if (typeof time === 'string' && !time.includes(' ') && !time.includes('T')) {\n const parts = time.split(':');\n const oTime = new Date();\n oTime.setHours(parseInt(parts[0], 10));\n oTime.setMinutes(parseInt(parts[1], 10));\n oTime.setMilliseconds(0);\n\n if (parts.length === 3) {\n oTime.setSeconds(parseInt(parts[2], 10));\n } else {\n oTime.setSeconds(0);\n }\n nTime = oTime.getTime();\n } else {\n nTime = new Date(time as string | number).getTime();\n }\n } else if (!time) {\n const oTime = new Date();\n oTime.setMilliseconds(0);\n nTime = oTime.getTime();\n } else {\n // If Date\n nTime = (time as Date).getTime();\n }\n }\n // --- End of conversion \"time\" to number\n if (typeof startTime === 'string') {\n if (!startTime.includes(' ') && !startTime.includes('T')) {\n const parts = startTime.split(':');\n startTime = new Date();\n startTime.setHours(parseInt(parts[0], 10));\n startTime.setMinutes(parseInt(parts[1], 10));\n startTime.setMilliseconds(0);\n\n if (parts.length === 3) {\n startTime.setSeconds(parseInt(parts[2], 10));\n } else {\n startTime.setSeconds(0);\n }\n } else {\n daily = false;\n startTime = new Date(startTime);\n }\n } else {\n daily = false;\n startTime = new Date(startTime as number | Date);\n }\n const nStartTime = startTime.getTime();\n\n let nEndTime: number | null;\n if (endTime && typeof endTime === 'string') {\n if (!endTime.includes(' ') && !endTime.includes('T')) {\n const parts = endTime.split(':');\n endTime = new Date();\n endTime.setHours(parseInt(parts[0], 10));\n endTime.setMinutes(parseInt(parts[1], 10));\n endTime.setMilliseconds(0);\n\n if (parts.length === 3) {\n endTime.setSeconds(parseInt(parts[2], 10));\n } else {\n endTime.setSeconds(0);\n }\n } else {\n daily = false;\n endTime = new Date(endTime);\n }\n } else if (endTime) {\n daily = false;\n endTime = new Date(endTime as number | Date);\n } else {\n endTime = null;\n }\n\n if (endTime) {\n nEndTime = endTime.getTime();\n } else {\n nEndTime = null;\n }\n\n if (operation === 'between') {\n if (nEndTime) {\n if (nStartTime > nEndTime && daily) {\n return !(nTime >= nEndTime && nTime < nStartTime);\n }\n return nTime >= nStartTime && nTime < nEndTime;\n }\n sandbox.log(`missing or unrecognized endTime expression: ${JSON.stringify(endTime)}`, 'warn');\n return false;\n }\n\n if (operation === 'not between') {\n if (nEndTime) {\n if (nStartTime > nEndTime && daily) {\n return nTime >= nEndTime && nTime < nStartTime;\n }\n return !(nTime >= nStartTime && nTime < nEndTime);\n }\n sandbox.log(`missing or unrecognized endTime expression: ${JSON.stringify(endTime)}`, 'warn');\n return false;\n }\n\n if (operation === '>') {\n return nTime > nStartTime;\n }\n if (operation === '>=') {\n return nTime >= nStartTime;\n }\n if (operation === '<') {\n return nTime < nStartTime;\n }\n if (operation === '<=') {\n return nTime <= nStartTime;\n }\n if (operation === '==') {\n return nTime === nStartTime;\n }\n if (operation === '<>' || operation === '!=') {\n return nTime !== nStartTime;\n }\n sandbox.log(`Invalid operator: ${operation as string}`, 'warn');\n return false;\n },\n onStop: function (cb: () => void, timeout?: number): void {\n if (sandbox.verbose) {\n sandbox.log(`onStop(timeout=${timeout})`, 'info');\n }\n\n script.onStopCb = cb;\n script.onStopTimeout = timeout || 1000;\n },\n formatValue: function (value: number | string, decimals: number | string, format?: string): string {\n if (typeof decimals === 'string') {\n format = decimals;\n decimals = 0;\n }\n if (!format) {\n if (adapter.isFloatComma !== undefined) {\n format = adapter.isFloatComma ? '.,' : ',.';\n } else if (objects['system.config'] && objects['system.config'].common) {\n format = objects['system.config'].common.isFloatComma ? '.,' : ',.';\n }\n }\n return adapter.formatValue(value, decimals, format);\n },\n formatDate: function (\n date: Date | string | number | iobJS.AstroDate,\n format?: string,\n language?: ioBroker.Languages,\n ): string {\n if (!format) {\n if (adapter.dateFormat) {\n format = adapter.dateFormat;\n } else {\n format =\n objects['system.config'] && objects['system.config'].common\n ? objects['system.config'].common.dateFormat || 'DD.MM.YYYY'\n : 'DD.MM.YYYY';\n }\n format = format || 'DD.MM.YYYY';\n }\n // maybe it is astro date like 'sunrise' or 'sunset'\n if (date && typeof date === 'string') {\n const pos = consts.astroListLow.indexOf(date.toLowerCase());\n if (pos !== -1) {\n date = sandbox.getAstroDate(consts.astroList[pos])?.getTime() || 0;\n }\n } else if (date && isObject(date) && (date as iobJS.AstroDate).astro) {\n date =\n sandbox\n .getAstroDate(\n (date as iobJS.AstroDate).astro,\n (date as iobJS.AstroDate).date || new Date(),\n (date as iobJS.AstroDate).offset || 0,\n )\n ?.getTime() || 0;\n }\n\n if (format.match(/[WНOО]+/)) {\n let text: string = adapter.formatDate(date as Date | string | number, format);\n if (!language || !consts.dayOfWeeksFull[language]) {\n language =\n adapter.language ||\n (objects['system.config'] &&\n objects['system.config'].common &&\n objects['system.config'].common.language) ||\n 'en';\n if (!consts.dayOfWeeksFull[language as ioBroker.Languages]) {\n language = 'en';\n }\n }\n if (typeof date === 'number' || typeof date === 'string') {\n date = new Date(date);\n } else if (typeof (date as Date).getMonth !== 'function') {\n sandbox.log(`Invalid date object provided: ${JSON.stringify(date)}`, 'error');\n return 'Invalid date';\n }\n const d: number = (date as Date).getDay();\n text = text.replace('НН', consts.dayOfWeeksFull[language as ioBroker.Languages][d]);\n let initialText = text;\n text = text.replace('WW', consts.dayOfWeeksFull[language as ioBroker.Languages][d]);\n\n if (initialText === text) {\n text = text.replace('W', consts.dayOfWeeksShort[language as ioBroker.Languages][d]);\n }\n\n text = text.replace('Н', consts.dayOfWeeksShort[language as ioBroker.Languages][d]);\n text = text.replace('Н', consts.dayOfWeeksShort[language as ioBroker.Languages][d]);\n const m: number = (date as Date).getMonth();\n initialText = text;\n text = text.replace('OOO', consts.monthFullGen[language as ioBroker.Languages][m]);\n text = text.replace('ООО', consts.monthFullGen[language as ioBroker.Languages][m]);\n text = text.replace('OO', consts.monthFull[language as ioBroker.Languages][m]);\n text = text.replace('ОО', consts.monthFull[language as ioBroker.Languages][m]);\n\n if (initialText === text) {\n text = text.replace('O', consts.monthShort[language as ioBroker.Languages][m]);\n }\n return text;\n }\n return adapter.formatDate(date as string | number | Date, format);\n },\n formatTimeDiff: function (diff: number, format?: string): string {\n if (!format) {\n format = 'hh:mm:ss';\n }\n\n let text = format;\n\n if (sandbox.verbose) {\n sandbox.log(`formatTimeDiff(format=${format}, diff=${diff})`, 'debug');\n }\n\n const second = 1000;\n const minute = 60 * second;\n const hour = 60 * minute;\n const day = 24 * hour;\n const neg = diff < 0;\n diff = Math.abs(diff);\n\n if (/(? void),\n callback?: (err?: Error | null) => void,\n ): void {\n if (typeof data === 'function' || !data) {\n callback = data as (err?: Error | null) => void;\n data = fileName;\n fileName = _adapter;\n _adapter = '0_userdata.0';\n }\n _adapter = _adapter || '0_userdata.0';\n\n if (debug) {\n sandbox.log(\n `writeFile(adapter=${_adapter}, fileName=${fileName}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n setTimeout(function (): void {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, 0);\n }\n } else {\n if (sandbox.verbose) {\n sandbox.log(`writeFile(adapter=${_adapter}, fileName=${fileName})`, 'info');\n }\n if (callback) {\n adapter.writeFile(_adapter, fileName, data, callback);\n } else {\n // @ts-expect-error should be fixed in js-controller\n adapter.writeFile(_adapter, fileName, data);\n }\n }\n },\n readFile: function (\n _adapter: string,\n fileName: string | ((err: Error | null | undefined, data?: Buffer | string, mimeType?: string) => void),\n callback?: (err: Error | null | undefined, data?: Buffer | string, mimeType?: string) => void,\n ): void {\n if (typeof fileName === 'function') {\n callback = fileName as (\n err: Error | null | undefined,\n data?: Buffer | string,\n mimeType?: string,\n ) => void;\n fileName = _adapter;\n _adapter = '0_userdata.0';\n }\n if (typeof callback !== 'function') {\n sandbox.log(`readFile(adapter=${_adapter}, fileName=${fileName}): no callback`, 'error');\n return;\n }\n _adapter = _adapter || '0_userdata.0';\n if (sandbox.verbose) {\n sandbox.log(`readFile(adapter=${_adapter}, fileName=${fileName})`, 'info');\n }\n\n adapter.fileExists(_adapter, fileName, (error: Error | null | undefined, result?: boolean): void => {\n if (error) {\n callback(error);\n } else if (!result) {\n callback(new Error('Not exists'));\n } else {\n adapter.readFile(_adapter, fileName, callback);\n }\n });\n },\n unlink: function (\n _adapter: string,\n fileName: string | ((err?: Error | null) => void),\n callback?: (err?: Error | null) => void,\n ): void {\n if (typeof fileName === 'function') {\n callback = fileName;\n fileName = _adapter;\n _adapter = '0_userdata.0';\n }\n _adapter = _adapter || '0_userdata.0';\n\n if (debug) {\n sandbox.log(\n `unlink(adapter=${_adapter}, fileName=${fileName}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n setTimeout(function (): void {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, 0);\n }\n } else {\n if (sandbox.verbose) {\n sandbox.log(`unlink(adapter=${_adapter}, fileName=${fileName})`, 'info');\n }\n if (callback) {\n adapter.unlink(_adapter, fileName, callback);\n } else {\n // @ts-expect-error should be fixed in js-controller\n adapter.unlink(_adapter, fileName);\n }\n }\n },\n delFile: function (\n _adapter: string,\n fileName: string | ((err?: Error | null) => void),\n callback?: (err?: Error | null) => void,\n ): void {\n return sandbox.unlink(_adapter, fileName as string, callback);\n },\n rename: function (\n _adapter: string,\n oldName: string,\n newName: string,\n callback?: (err?: Error | null) => void,\n ): void {\n _adapter = _adapter || '0_userdata.0';\n\n if (debug) {\n sandbox.log(\n `rename(adapter=${_adapter}, oldName=${oldName}, newName=${newName}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n setTimeout(function () {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, 0);\n }\n } else {\n sandbox.verbose &&\n sandbox.log(`rename(adapter=${_adapter}, oldName=${oldName}, newName=${newName})`, 'info');\n if (callback) {\n adapter.rename(_adapter, oldName, newName, callback);\n } else {\n // @ts-expect-error should be fixed in js-controller\n adapter.rename(_adapter, oldName, newName);\n }\n }\n },\n renameFile: function (\n _adapter: string,\n oldName: string,\n newName: string,\n callback?: (err?: Error | null) => void,\n ): void {\n return sandbox.rename(_adapter, oldName, newName, callback);\n },\n getHistory: function (\n instance: string | (ioBroker.GetHistoryOptions & { id: string; timeout?: number | string }),\n options:\n | (ioBroker.GetHistoryOptions & { id?: string; timeout?: number | string })\n | ((\n error: Error | null,\n result?: ioBroker.GetHistoryResult | null,\n options?: ioBroker.GetHistoryOptions & { id: string; timeout?: number | string },\n instance?: string,\n ) => void),\n callback?: (\n error: Error | null,\n result?: ioBroker.GetHistoryResult | null,\n options?: ioBroker.GetHistoryOptions & { id: string; timeout?: number | string },\n instance?: string,\n ) => void,\n ): void {\n if (isObject(instance)) {\n callback = options as (\n error: Error | null,\n result?: ioBroker.GetHistoryResult | null,\n options?: ioBroker.GetHistoryOptions & { id: string; timeout?: number | string },\n instance?: string,\n ) => void;\n options = instance as ioBroker.GetHistoryOptions & { id?: string; timeout?: number | string };\n instance = '';\n }\n\n if (typeof callback !== 'function') {\n return sandbox.log('No callback found!', 'error');\n }\n if (!isObject(options)) {\n return sandbox.log('No options found!', 'error');\n }\n if (!(options as ioBroker.GetHistoryOptions & { id?: string; timeout?: number | string }).id) {\n return sandbox.log('No ID found!', 'error');\n }\n const timeoutMs =\n parseInt(\n (options as ioBroker.GetHistoryOptions & { id?: string; timeout?: number })\n ?.timeout as unknown as string,\n 10,\n ) || 20000;\n\n if (!instance) {\n // @ts-expect-error defaultHistory is private attribute of adapter. Fix later\n if (adapter.defaultHistory) {\n // @ts-expect-error defaultHistory is private attribute of adapter. Fix later\n instance = adapter.defaultHistory;\n } else {\n instance = objects['system.config']?.common?.defaultHistory || null;\n }\n }\n\n if (sandbox.verbose) {\n sandbox.log(`getHistory(instance=${instance as string}, options=${JSON.stringify(options)})`, 'info');\n }\n\n if (!instance) {\n sandbox.log('No default history instance found!', 'error');\n try {\n callback.call(sandbox, new Error('No default history instance found!'));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n return;\n }\n if ((instance as string).startsWith('system.adapter.')) {\n instance = (instance as string).substring('system.adapter.'.length);\n }\n\n if (!objects[`system.adapter.${instance as string}`]) {\n sandbox.log(`Instance \"${instance as string}\" not found!`, 'error');\n try {\n callback.call(sandbox, new Error(`Instance \"${instance as string}\" not found!`));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n return;\n }\n\n let _timeout: NodeJS.Timeout | null = setTimeout(() => {\n _timeout = null;\n if (sandbox.verbose) {\n sandbox.log('getHistory => timeout', 'debug');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(\n sandbox,\n new Error('Timeout'),\n null,\n options as ioBroker.GetHistoryOptions & { id: string; timeout?: number | string },\n instance as string,\n );\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n callback = undefined;\n }\n }, timeoutMs);\n\n adapter.sendTo(\n instance as string,\n 'getHistory',\n {\n id: (options as ioBroker.GetHistoryOptions & { id: string; timeout?: number | string }).id,\n options,\n },\n (res: any): void => {\n if (_timeout) {\n clearTimeout(_timeout);\n _timeout = null;\n }\n const result: {\n error?: string;\n result?: ioBroker.GetHistoryResult;\n step?: number;\n sessionId?: string;\n } = res;\n\n if (sandbox.verbose && result?.error) {\n sandbox.log(`getHistory => ${result.error}`, 'error');\n }\n if (sandbox.verbose && result?.result) {\n sandbox.log(`getHistory => ${result.result.length} items`, 'debug');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(\n sandbox,\n result.error ? new Error(result.error) : null,\n result.result,\n options as ioBroker.GetHistoryOptions & { id: string; timeout?: number | string },\n instance as string,\n );\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n callback = undefined;\n }\n },\n );\n },\n runScript: function (scriptName: string, callback?: (err?: Error | null) => void): boolean {\n scriptName = scriptName || name;\n if (!scriptName.match(/^script\\.js\\./)) {\n scriptName = `script.js.${scriptName}`;\n }\n // start another script\n if (!objects[scriptName] || !objects[scriptName].common) {\n sandbox.log(`Cannot start \"${scriptName}\", because not found`, 'error');\n return false;\n }\n if (debug) {\n sandbox.log(\n `runScript(scriptName=${scriptName}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n typeof callback === 'function' && callback();\n return true;\n }\n if (objects[scriptName].common.enabled) {\n objects[scriptName].common.enabled = false;\n adapter.extendForeignObject(scriptName, { common: { enabled: false } }, (/* err, obj */) => {\n adapter.extendForeignObject(\n scriptName,\n { common: { enabled: true } },\n err => typeof callback === 'function' && callback(err),\n );\n });\n return true;\n }\n adapter.extendForeignObject(\n scriptName,\n { common: { enabled: true } },\n err => typeof callback === 'function' && callback(err),\n );\n return true;\n },\n runScriptAsync: function (scriptName: string): Promise {\n let done = false;\n return new Promise((resolve, reject) => {\n const result = sandbox.runScript(scriptName, err => {\n if (err) {\n reject(err);\n done = true;\n } else {\n resolve();\n }\n });\n if (result === false && !done) {\n reject(new Error(`Script ${scriptName} was not found!`));\n }\n });\n },\n startScript: function (\n scriptName: string,\n ignoreIfStarted?: boolean | ((err: Error | null | undefined, started: boolean) => void),\n callback?: (err: Error | null | undefined, started: boolean) => void,\n ): boolean {\n if (typeof ignoreIfStarted === 'function') {\n callback = ignoreIfStarted as (err: Error | null | undefined, started: boolean) => void;\n ignoreIfStarted = false;\n }\n scriptName ||= name;\n if (!scriptName.match(/^script\\.js\\./)) {\n scriptName = `script.js.${scriptName}`;\n }\n // start another script\n if (!objects[scriptName] || !objects[scriptName].common) {\n sandbox.log(`Cannot start \"${scriptName}\", because not found`, 'error');\n return false;\n }\n if (debug) {\n sandbox.log(\n `startScript(scriptName=${scriptName}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n typeof callback === 'function' && callback(null, false);\n return true;\n }\n if (objects[scriptName].common.enabled) {\n if (!ignoreIfStarted) {\n adapter.extendForeignObject(scriptName, { common: { enabled: false } }, () => {\n adapter.extendForeignObject(\n scriptName,\n { common: { enabled: true } },\n err => typeof callback === 'function' && callback(err, true),\n );\n });\n } else if (typeof callback === 'function') {\n callback(null, false);\n }\n return true;\n }\n adapter.extendForeignObject(scriptName, { common: { enabled: true } }, err => {\n typeof callback === 'function' && callback(err, true);\n });\n return true;\n },\n startScriptAsync: function (scriptName: string, ignoreIfStarted?: boolean): Promise {\n return new Promise((resolve, reject) => {\n const result = sandbox.startScript(\n scriptName,\n !!ignoreIfStarted,\n (err: Error | null | undefined, started: boolean): void => {\n if (err) {\n reject(err);\n } else {\n resolve(started);\n }\n },\n );\n if (result === false) {\n reject(new Error(`Script ${scriptName} was not found!`));\n }\n });\n },\n stopScript: function (\n scriptName: string,\n callback?: (err: Error | null | undefined, stopped: boolean) => void,\n ): boolean {\n scriptName = scriptName || name;\n\n if (!scriptName.match(/^script\\.js\\./)) {\n scriptName = `script.js.${scriptName}`;\n }\n\n // stop another script\n if (!objects[scriptName] || !objects[scriptName].common) {\n sandbox.log(`Cannot stop \"${scriptName}\", because not found`, 'error');\n return false;\n }\n if (debug) {\n sandbox.log(\n `stopScript(scriptName=${scriptName}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n callback(null, false);\n }\n return true;\n }\n if (objects[scriptName].common.enabled) {\n objects[scriptName].common.enabled = false;\n adapter.extendForeignObject(scriptName, { common: { enabled: false } }, err => {\n if (typeof callback === 'function') {\n callback(err, true);\n }\n });\n } else if (typeof callback === 'function') {\n callback(null, false);\n }\n return true;\n },\n stopScriptAsync: function (scriptName: string): Promise {\n return new Promise((resolve, reject) => {\n const result = sandbox.stopScript(\n scriptName,\n (err: Error | null | undefined, stopped: boolean): void => {\n if (err) {\n reject(err);\n } else {\n resolve(stopped);\n }\n },\n );\n if (result === false) {\n reject(new Error(`Script ${scriptName} was not found!`));\n }\n });\n },\n isScriptActive: function (scriptName: string): boolean {\n if (!scriptName.match(/^script\\.js\\./)) {\n scriptName = `script.js.${scriptName}`;\n }\n if (!objects[scriptName] || !objects[scriptName].common) {\n sandbox.log('Script does not exist', 'error');\n return false;\n }\n return objects[scriptName].common.enabled;\n },\n startInstanceAsync: async function (instanceName: string): Promise {\n const objInstanceId = `system.adapter.${instanceName}`;\n const exists = await adapter.foreignObjectExists(objInstanceId);\n\n if (exists) {\n const instanceObj = await adapter.getForeignObjectAsync(objInstanceId);\n\n if (instanceObj?.type === 'instance' && !instanceObj.common.enabled) {\n await adapter.extendForeignObjectAsync(objInstanceId, { common: { enabled: true } });\n\n if (sandbox.verbose) {\n sandbox.log(`startInstanceAsync (instanceName=${instanceName})`, 'info');\n }\n\n return true;\n }\n sandbox.log(`Cannot start instance \"${instanceName}\", because already running`, 'warn');\n } else {\n sandbox.log(`Cannot start instance \"${instanceName}\", because not found`, 'error');\n }\n\n return false;\n },\n restartInstanceAsync: async function (instanceName: string): Promise {\n const objInstanceId = `system.adapter.${instanceName}`;\n const exists = await adapter.foreignObjectExists(objInstanceId);\n\n if (exists) {\n const instanceObj = await adapter.getForeignObjectAsync(objInstanceId);\n\n if (instanceObj?.type === 'instance' && instanceObj.common.enabled) {\n await adapter.extendForeignObjectAsync(objInstanceId, {});\n\n if (sandbox.verbose) {\n sandbox.log(`restartInstanceAsync (instanceName=${instanceName})`, 'info');\n }\n\n return true;\n }\n sandbox.log(`Cannot restart instance \"${instanceName}\", because not running`, 'warn');\n } else {\n sandbox.log(`Cannot restart instance \"${instanceName}\", because not found`, 'error');\n }\n\n return false;\n },\n stopInstanceAsync: async function (instanceName: string): Promise {\n const objInstanceId = `system.adapter.${instanceName}`;\n const exists = await adapter.foreignObjectExists(objInstanceId);\n\n if (exists) {\n const instanceObj = await adapter.getForeignObjectAsync(objInstanceId);\n\n if (instanceObj?.type === 'instance' && instanceObj.common.enabled) {\n await adapter.extendForeignObjectAsync(objInstanceId, { common: { enabled: false } });\n\n if (sandbox.verbose) {\n sandbox.log(`stopInstanceAsync (instanceName=${instanceName})`, 'info');\n }\n\n return true;\n }\n sandbox.log(`Cannot stop instance \"${instanceName}\", because not running`, 'warn');\n } else {\n sandbox.log(`Cannot stop instance \"${instanceName}\", because not found`, 'error');\n }\n\n return false;\n },\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n toInt: function (val: boolean | string | number | 'true' | 'false'): number {\n if (val === true || val === 'true') {\n val = 1;\n }\n if (val === false || val === 'false') {\n val = 0;\n }\n val = parseInt(val as unknown as string) || 0;\n return val;\n },\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n toFloat: function (val: boolean | string | number | 'true' | 'false'): number {\n if (val === true || val === 'true') {\n val = 1;\n }\n if (val === false || val === 'false') {\n val = 0;\n }\n val = parseFloat(val as unknown as string) || 0;\n return val;\n },\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n toBoolean: function (val: boolean | string | number | 'true' | 'false'): boolean {\n if (val === '1' || val === 'true') {\n val = true;\n }\n if (val === '0' || val === 'false') {\n val = false;\n }\n return !!val;\n },\n getAttr: function (obj: string | Record, path: string | string[]): any {\n if (typeof path === 'string') {\n path = path.split('.');\n }\n if (typeof obj === 'string') {\n try {\n obj = JSON.parse(obj);\n } catch (err: unknown) {\n void adapter.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: true,\n ack: true,\n c: 'getAttr',\n });\n sandbox.log(`Cannot parse \"${obj.substring(0, 30)}\": ${err as Error}`, 'error');\n\n return null;\n }\n }\n\n const attr: string = path.shift() || '';\n try {\n obj = (obj as Record)[attr];\n } catch (err: unknown) {\n void adapter.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: true,\n ack: true,\n c: 'getAttr',\n });\n sandbox.log(`Cannot get ${attr} of \"${JSON.stringify(obj)}\": ${err as Error}`, 'error');\n\n return null;\n }\n\n if (!path.length) {\n return obj;\n }\n const type = typeof obj;\n if (obj === null || obj === undefined || type === 'boolean' || type === 'number') {\n return null;\n }\n return sandbox.getAttr(obj, path);\n },\n messageTo: function (\n target: string | { instance: string | null | number; script: string | null; message: string },\n data: any,\n options: { timeout?: number | string } | ((result: any, options: { timeout?: number | string }) => void),\n callback?: (result: any, options: { timeout?: number | string }, instance: string | number | null) => void,\n ) {\n const defaultTimeout = 5000;\n\n if (typeof target !== 'object') {\n target = { instance: null, script: null, message: target };\n }\n if (typeof options === 'function') {\n callback = options;\n options = { timeout: defaultTimeout };\n }\n\n let timeout: NodeJS.Timeout | null = null;\n if (typeof callback === 'function') {\n const timeoutDuration = parseInt(options?.timeout as unknown as string, 10) || defaultTimeout;\n\n timeout = setTimeout(() => {\n timeout = null;\n\n if (sandbox.verbose) {\n sandbox.log(`messageTo => timeout: ${timeoutDuration}`, 'debug');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, { error: 'timeout' }, options, target.instance);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n callback = undefined;\n }\n }, timeoutDuration);\n }\n let cbFunc: undefined | ((result: any) => void);\n if (timeout) {\n cbFunc = function (res: any) {\n timeout && clearTimeout(timeout);\n const result: { result?: any; error?: string | null } = res;\n\n if (sandbox.verbose && result?.result) {\n sandbox.log(`messageTo => ${JSON.stringify(result)}`, 'debug');\n }\n if (sandbox.verbose && result?.error) {\n sandbox.log(`messageTo => ${result.error}`, 'error');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, result, options, target.instance);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n callback = undefined;\n }\n };\n }\n\n if (target.instance || target.instance === 0) {\n if (\n typeof target.instance === 'string' &&\n target.instance &&\n target.instance.startsWith('system.adapter.')\n ) {\n target.instance = target.instance.substring('system.adapter.'.length);\n } else if (typeof target.instance === 'number') {\n target.instance = `javascript.${target.instance}`;\n }\n\n adapter.sendTo(\n target.instance,\n 'jsMessageBus',\n { message: target.message, script: target.script, data },\n cbFunc,\n );\n } else {\n // Send it to all instances\n context.adapter.getObjectView(\n 'system',\n 'instance',\n { startkey: 'system.adapter.javascript.', endkey: 'system.adapter.javascript.\\u9999' },\n options,\n (err: Error | null | undefined, res): void => {\n if (err || !res) {\n sandbox.log(`messageTo failed: ${err?.message}`, 'error');\n return;\n }\n const len = 'system.adapter.'.length;\n const instances = res.rows.map(item => item.id.substring(len));\n\n instances.forEach(instance => {\n adapter.sendTo(\n instance,\n 'jsMessageBus',\n { message: target.message, script: target.script, data },\n cbFunc,\n );\n });\n },\n );\n }\n },\n messageToAsync: function (\n target: string | { instance: string | null | number; script: string | null; message: string },\n data: any,\n options?: { timeout?: number | string },\n ): Promise {\n return new Promise((resolve, reject) => {\n sandbox.messageTo(target, data, options, (res: any): void => {\n const result: { error?: string } = res;\n if (sandbox.verbose) {\n sandbox.log(`messageTo result => ${JSON.stringify(res)}`, 'debug');\n }\n if (!res || result.error) {\n reject(result ? new Error(result.error) : new Error('Unknown error'));\n } else {\n resolve(result);\n }\n });\n });\n },\n onMessage: function (\n messageName: string,\n callback: (data: any, cb: (result: any) => void) => void,\n ): null | number {\n if (typeof callback !== 'function') {\n sandbox.log('onMessage callback is not a function', 'error');\n\n return null;\n }\n context.messageBusHandlers[sandbox.scriptName] = context.messageBusHandlers[sandbox.scriptName] || {};\n context.messageBusHandlers[sandbox.scriptName][messageName] =\n context.messageBusHandlers[sandbox.scriptName][messageName] || [];\n\n const handler = { id: Date.now() + Math.floor(Math.random() * 10000), cb: callback, sandbox };\n context.messageBusHandlers[sandbox.scriptName][messageName].push(handler);\n\n sandbox.__engine.__subscriptionsMessage += 1;\n\n if (\n sandbox.__engine.__subscriptionsMessage %\n (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__subscriptionsMessage} message subscriptions registered. Check your script!`,\n 'warn',\n );\n }\n\n return handler.id;\n },\n onMessageUnregister: function (idOrName: number | string): boolean {\n const ctx = context.messageBusHandlers[sandbox.scriptName];\n let found = false;\n if (ctx) {\n if (typeof idOrName === 'number') {\n for (const messageName in ctx) {\n if (Object.prototype.hasOwnProperty.call(ctx, messageName)) {\n for (let i = 0; i < ctx[messageName].length; i++) {\n if (ctx[messageName][i].id === idOrName) {\n ctx[messageName].splice(i, 1);\n if (!ctx[messageName].length) {\n delete ctx[messageName];\n sandbox.__engine.__subscriptionsMessage--;\n }\n found = true;\n break;\n }\n }\n }\n if (found) {\n break;\n }\n }\n } else if (idOrName && ctx[idOrName]) {\n delete ctx[idOrName];\n sandbox.__engine.__subscriptionsMessage--;\n found = true;\n }\n }\n return found;\n },\n console: {\n log: function (msg: string): void {\n sandbox.log(msg, 'info');\n },\n error: function (msg: string): void {\n sandbox.log(msg, 'error');\n },\n warn: function (msg: string): void {\n sandbox.log(msg, 'warn');\n },\n info: function (msg: string): void {\n sandbox.log(msg, 'info');\n },\n debug: function (msg: string): void {\n sandbox.log(msg, 'debug');\n },\n },\n jsonataExpression: function (data: any, expression: string): Promise {\n return jsonata(expression).evaluate(data);\n },\n wait: function (ms: number): Promise {\n return new Promise((resolve: () => void): void => {\n sandbox.setTimeout(resolve, ms);\n });\n },\n sleep: function (ms: number): Promise {\n return sandbox.wait(ms);\n },\n onObject: function (\n pattern: string | string[],\n callback: (id: string, obj?: ioBroker.Object | null) => void,\n ): SubscribeObject | SubscribeObject[] | null {\n return sandbox.subscribeObject(pattern, callback);\n },\n subscribeObject: function (\n pattern: string | string[],\n callback: (id: string, obj?: ioBroker.Object | null) => void,\n ): SubscribeObject | SubscribeObject[] | null {\n if (Array.isArray(pattern)) {\n const result: {\n name: string;\n pattern: string;\n callback: (id: string, obj?: ioBroker.Object | null) => void;\n }[] = [];\n for (let p = 0; p < pattern.length; p++) {\n result.push(\n sandbox.subscribeObject(pattern[p], callback) as {\n name: string;\n pattern: string;\n callback: (id: string, obj?: ioBroker.Object | null) => void;\n },\n );\n }\n return result;\n }\n\n sandbox.__engine.__subscriptionsObject += 1;\n\n if (\n sandbox.__engine.__subscriptionsObject %\n (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__subscriptionsObject} object subscriptions registered. Check your script!`,\n 'warn',\n );\n }\n\n // source is set by regexp if defined as /regexp/\n if (!pattern || typeof pattern !== 'string') {\n sandbox.log('Error by subscribeObject: pattern can be only string or array of strings.', 'error');\n return null;\n }\n\n if (typeof callback !== 'function') {\n sandbox.log('Error by subscribeObject: callback is not a function', 'error');\n return null;\n }\n\n const subs: SubscribeObject = { pattern, callback, name };\n if (sandbox.verbose) {\n sandbox.log(`subscribeObject: ${JSON.stringify(subs)}`, 'info');\n }\n\n adapter.subscribeForeignObjects(pattern);\n\n context.subscriptionsObject.push(subs);\n\n return subs;\n },\n unsubscribeObject: function (subObject: SubscribeObject | SubscribeObject[]): boolean | boolean[] {\n if (subObject && Array.isArray(subObject)) {\n const result: boolean[] = [];\n for (let t = 0; t < subObject.length; t++) {\n result.push(sandbox.unsubscribeObject(subObject[t]) as boolean);\n }\n return result;\n }\n\n if (sandbox.verbose) {\n sandbox.log(`adapterUnsubscribeObject(id=${JSON.stringify(subObject)})`, 'info');\n }\n\n for (let i = context.subscriptionsObject.length - 1; i >= 0; i--) {\n if (context.subscriptionsObject[i] === subObject) {\n adapter.unsubscribeForeignObjects(subObject.pattern);\n context.subscriptionsObject.splice(i, 1);\n sandbox.__engine.__subscriptionsObject--;\n return true;\n }\n }\n let deleted = 0;\n for (let i = context.subscriptionsObject.length - 1; i >= 0; i--) {\n if (\n context.subscriptionsObject[i].name &&\n context.subscriptionsObject[i].pattern === subObject.pattern\n ) {\n deleted++;\n adapter.unsubscribeForeignObjects(subObject.pattern);\n context.subscriptionsObject.splice(i, 1);\n sandbox.__engine.__subscriptionsObject--;\n }\n }\n return !!deleted;\n },\n // internal function to send the block debugging info to the front-end\n _sendToFrontEnd: function (blockId: string, data: any): void {\n if (context.rulesOpened === sandbox.scriptName) {\n void adapter.setState(\n 'debug.rules',\n JSON.stringify({ ruleId: sandbox.scriptName, blockId, data, ts: Date.now() }),\n true,\n );\n }\n },\n existsStateAsync: function (_id: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n existsObjectAsync: function (_id: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n getObjectAsync: function (_id: string, _enumName: null | string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n setObjectAsync: function (_id: string, _obj: ioBroker.Object): Promise<{ id: string }> {\n return Promise.reject(new Error('Not implemented'));\n },\n extendObjectAsync: function (_id: string, _obj: Partial): Promise<{ id: string }> {\n return Promise.reject(new Error('Not implemented'));\n },\n deleteObjectAsync: function (_id: string, _isRecursive?: boolean): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n createStateAsync: function (\n _name: string,\n _initValue: undefined | ioBroker.StateValue | ioBroker.State,\n _forceCreation:\n | boolean\n | undefined\n | Record\n | Partial\n | ((err: Error | null) => void),\n _common?: Partial | ((err: Error | null) => void),\n _native?: Record | ((err: Error | null) => void),\n ): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n createAliasAsync: function (\n _name: string,\n _alias: string | CommonAlias,\n _forceCreation: boolean | Partial | undefined,\n _common?: Partial | Record,\n _native?: Record,\n ): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n deleteStateAsync: function (_id: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n writeFileAsync: function (\n _adapter: string,\n _fileName: string | Buffer,\n _data?: string | Buffer,\n ): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n readFileAsync: function (_adapter: string, _fileName?: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n unlinkAsync: function (_adapter: string, _fileName?: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n delFileAsync: function (_adapter: string, _fileName?: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n renameAsync: function (_adapter: string, _oldName: string, _newName?: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n renameFileAsync: function (_adapter: string, _oldName: string, _newName?: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n getHistoryAsync: function (\n _instance: string | (ioBroker.GetHistoryOptions & { id: string; timeout?: number | string }),\n _options?: ioBroker.GetHistoryOptions & { id?: string; timeout?: number | string },\n ): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n httpGetAsync: function (\n _url: string,\n _options?: {\n timeout?: number;\n responseType?: ResponseType;\n headers?: Record;\n basicAuth?: { user: string; password: string } | null;\n bearerAuth?: string;\n validateCertificate?: boolean;\n },\n ): Promise<{\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n }> {\n return Promise.reject(new Error('Not implemented'));\n },\n httpPostAsync: function (\n _url: string,\n _data: any,\n _options: {\n timeout?: number;\n responseType?: ResponseType;\n headers?: Record;\n basicAuth?: { user: string; password: string } | null;\n bearerAuth?: string;\n validateCertificate?: boolean;\n },\n ): Promise<{\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n }> {\n return Promise.reject(new Error('Not implemented'));\n },\n };\n\n // Create advanced functions that can modify objects\n if ((adapter.config as JavaScriptAdapterConfig).enableSetObject) {\n sandbox.setObject = function (\n id: string,\n obj: ioBroker.Object,\n callback?: (err?: Error | null, res?: { id: string }) => void,\n ): void {\n if (id && typeof id === 'string' && id.startsWith('system.adapter.')) {\n sandbox.log(\n `Using setObject on system object ${id} can be dangerous (protected instance attributes may be lost)`,\n 'info',\n );\n }\n if (debug) {\n sandbox.log(\n `setObject(id=${id}, obj=${JSON.stringify(obj)}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n setImmediate(function () {\n try {\n callback.call(sandbox, null, { id });\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n });\n }\n } else {\n if (sandbox.verbose) {\n sandbox.log(`setObject(id=${id}, obj=${JSON.stringify(obj)})`, 'info');\n }\n adapter.setForeignObject(id, obj, (err, res) => {\n if (!err) {\n // Update meta object data\n context.updateObjectContext(id, obj);\n }\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, err, res);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n });\n }\n };\n sandbox.extendObject = function (\n id: string,\n obj: Partial,\n callback?: (err?: Error | null, obj?: { id: string }) => void,\n ): void {\n if (debug) {\n sandbox.log(\n `extendObject(id=${id}, obj=${JSON.stringify(obj)}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n setTimeout(function () {\n try {\n callback.call(sandbox, null, { id });\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, 0);\n }\n } else {\n if (sandbox.verbose) {\n sandbox.log(`extendObject(id=${id}, obj=${JSON.stringify(obj)})`, 'info');\n }\n if (callback) {\n adapter.extendForeignObject(id, JSON.parse(JSON.stringify(obj)), callback);\n } else {\n void adapter.extendForeignObject(id, JSON.parse(JSON.stringify(obj)));\n }\n }\n };\n sandbox.deleteObject = function (id: string, isRecursive?: boolean, callback?: ioBroker.ErrorCallback): void {\n if (typeof isRecursive === 'function') {\n callback = isRecursive;\n isRecursive = false;\n }\n if (debug) {\n sandbox.log(\n `deleteObject(id=${id}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n setTimeout(function () {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, 0);\n }\n } else {\n if (sandbox.verbose) {\n sandbox.log(`deleteObject(id=${id})`, 'info');\n }\n adapter.delForeignObject(id, { recursive: isRecursive }, callback);\n }\n };\n }\n\n // promisify methods on the sandbox\n sandbox.existsStateAsync = promisify(sandbox.existsState);\n sandbox.existsObjectAsync = promisify(sandbox.existsObject);\n sandbox.getObjectAsync = promisify(sandbox.getObject);\n sandbox.setObjectAsync = promisify(sandbox.setObject);\n sandbox.extendObjectAsync = promisify(sandbox.extendObject);\n sandbox.deleteObjectAsync = promisify(sandbox.deleteObject);\n sandbox.createStateAsync = promisify(sandbox.createState);\n sandbox.createAliasAsync = promisify(sandbox.createAlias);\n sandbox.deleteStateAsync = promisify(sandbox.deleteState);\n sandbox.writeFileAsync = promisify(sandbox.writeFile);\n sandbox.readFileAsync = promisify(sandbox.readFile);\n sandbox.unlinkAsync = promisify(sandbox.unlink);\n sandbox.delFileAsync = promisify(sandbox.delFile);\n sandbox.renameAsync = promisify(sandbox.rename);\n sandbox.renameFileAsync = promisify(sandbox.renameFile);\n sandbox.getHistoryAsync = promisify(sandbox.getHistory);\n sandbox.httpGetAsync = promisify(sandbox.httpGet);\n sandbox.httpPostAsync = promisify(sandbox.httpPost);\n\n // Make all predefined properties and methods readonly so scripts cannot overwrite them\n for (const prop of Object.keys(sandbox)) {\n Object.defineProperty(sandbox, prop, {\n configurable: false,\n writable: false,\n });\n }\n\n return sandbox;\n}\n"]} \ No newline at end of file +{"version":3,"file":"sandbox.js","sourceRoot":"","sources":["../../src/lib/sandbox.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,0BAijLC;AAzlLD,oDAAsC;AAItC,yDAAqD;AAErD,mCAA6E;AAmB7E,oDAAsC;AACtC,kDAAoC;AACpC,wDAA0C;AAC1C,uEAGmC;AAKnC,MAAM,kBAAkB,GAAG,YAAY,CAAC;AAExC,MAAM,aAAa,GAAG,0BAAW,CAAC,aAAa,CAAC;AAEhD,SAAgB,OAAO,CACnB,MAAgB,EAChB,IAAY,EACZ,OAA4B,EAC5B,KAA0B,EAC1B,OAA0B;IAE1B,MAAM,MAAM,GAAG,SAAS,CAAC;IACzB,MAAM,KAAK,GAAG,QAAQ,CAAC;IACvB,MAAM,QAAQ,GAAG,WAAW,CAAC;IAC7B,MAAM,uBAAuB,GAAG,iDAA0B,CAAC;IAC3D,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;IAEnC,MAAM,OAAO,GAAqB,OAAO,CAAC,OAAO,CAAC;IAClD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAC1B,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC9B,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAChC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC9B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC5B,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAEpC,wCAAwC;IACxC,IAAI,OAAoB,CAAC;IAEzB,SAAS,eAAe,CAAC,CAAQ;QAC7B,KAAK,OAAO,CAAC,QAAQ,CAAC,iBAAiB,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,EAAE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IACvF,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACtC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE;YACjC,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,KAAK;SAClB,CAAC,CAAC;IACP,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC","sourcesContent":["import type { ChildProcess, ExecOptions } from 'node:child_process';\nimport * as jsonataMod from 'jsonata';\nimport type { SendMailOptions } from 'nodemailer';\nimport type { AxiosError, AxiosHeaderValue, AxiosResponse, ResponseType } from 'axios';\n\nimport { commonTools } from '@iobroker/adapter-core';\n\nimport { isObject, isArray, promisify, getHttpRequestConfig } from './tools';\nimport type {\n JavaScriptAdapterConfig,\n AstroRule,\n ChangeType,\n CommonAlias,\n FileSubscriptionResult,\n IobSchedule,\n JavascriptContext,\n JsScript,\n LogMessage,\n Pattern,\n PushoverOptions,\n SandboxType,\n Selector,\n SubscribeObject,\n SubscriptionResult,\n TimeRule,\n} from '../types';\nimport * as constsMod from './consts';\nimport * as wordsMod from './words';\nimport * as eventObjMod from './eventObj';\nimport {\n patternCompareFunctions as patternCompareFunctionsMod,\n type PatternEventCompareFunction,\n} from './patternCompareFunctions';\nimport type { ScheduleName, SchedulerRule } from './scheduler';\nimport type { EventObj } from './eventObj';\nimport type { AstroEvent } from './consts';\n\nconst SCRIPT_CODE_MARKER = 'script.js.';\n\nconst pattern2RegEx = commonTools.pattern2RegEx;\n\nexport function sandBox(\n script: JsScript,\n name: string,\n verbose: boolean | undefined,\n debug: boolean | undefined,\n context: JavascriptContext,\n): SandboxType {\n const consts = constsMod;\n const words = wordsMod;\n const eventObj = eventObjMod;\n const patternCompareFunctions = patternCompareFunctionsMod;\n const jsonata = jsonataMod.default;\n\n const adapter: ioBroker.Adapter = context.adapter;\n const mods = context.mods;\n const states = context.states;\n const objects = context.objects;\n const timers = context.timers;\n const enums = context.enums;\n const debugMode = context.debugMode;\n\n // eslint-disable-next-line prefer-const\n let sandbox: SandboxType;\n\n function errorInCallback(e: Error): void {\n void adapter.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: true,\n ack: true,\n c: 'errorInCallback',\n });\n context.logError(name, 'Error in callback:', e);\n context.debugMode && console.log(`error$$${name}$$Exception in callback: ${e}`, Date.now());\n }\n\n function subscribePattern(script: JsScript, pattern: string): void {\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n if (!script.subscribes[pattern]) {\n script.subscribes[pattern] = 1;\n } else {\n script.subscribes[pattern]++;\n }\n\n if (!context.subscribedPatterns[pattern]) {\n context.subscribedPatterns[pattern] = 1;\n\n if (sandbox.verbose) {\n sandbox.log(`subscribePattern(pattern=${pattern})`, 'info');\n }\n adapter.subscribeForeignStates(pattern);\n\n // request current value to deliver old value on change.\n if (typeof pattern === 'string' && !pattern.includes('*')) {\n void adapter.getForeignState(pattern, (_err, state) => {\n if (state) {\n states[pattern] = state;\n }\n });\n } else {\n adapter.getForeignStates(\n pattern,\n (_err, _states) => _states && Object.keys(_states).forEach(id => (states[id] = _states[id])),\n );\n }\n } else {\n context.subscribedPatterns[pattern]++;\n }\n }\n }\n\n function unsubscribePattern(script: JsScript, pattern: string): void {\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n if (script.subscribes[pattern]) {\n script.subscribes[pattern]--;\n if (!script.subscribes[pattern]) {\n delete script.subscribes[pattern];\n }\n }\n\n if (context.subscribedPatterns[pattern]) {\n context.subscribedPatterns[pattern]--;\n if (!context.subscribedPatterns[pattern]) {\n adapter.unsubscribeForeignStates(pattern);\n delete context.subscribedPatterns[pattern];\n\n // if the pattern was regex or with * some states will stay in RAM, but it is OK.\n if (states[pattern]) {\n delete states[pattern];\n }\n }\n }\n }\n }\n\n function subscribeFile(script: JsScript, id: string, fileNamePattern: string): void {\n const key = `${id}$%$${fileNamePattern}`;\n if (!script.subscribesFile[key]) {\n script.subscribesFile[key] = 1;\n } else {\n script.subscribesFile[key]++;\n }\n\n if (!context.subscribedPatternsFile[key]) {\n context.subscribedPatternsFile[key] = 1;\n void adapter.subscribeForeignFiles(id, fileNamePattern);\n } else {\n context.subscribedPatternsFile[key]++;\n }\n }\n\n function unsubscribeFile(script: JsScript, id: string, fileNamePattern: string): void {\n const key = `${id}$%$${fileNamePattern}`;\n if (script.subscribesFile[key]) {\n script.subscribesFile[key]--;\n if (!script.subscribesFile[key]) {\n delete script.subscribesFile[key];\n }\n }\n\n if (context.subscribedPatternsFile[key]) {\n context.subscribedPatternsFile[key]--;\n if (!context.subscribedPatternsFile[key]) {\n void adapter.unsubscribeForeignFiles(id, fileNamePattern);\n delete context.subscribedPatternsFile[key];\n }\n }\n }\n\n function getPatternCompareFunctions(pattern: Pattern): PatternEventCompareFunction[] & { logic?: 'and' | 'or' } {\n let func: PatternEventCompareFunction;\n const functions: PatternEventCompareFunction[] & { logic?: 'and' | 'or' } = [];\n functions.logic = pattern.logic || 'and';\n\n for (const key in pattern) {\n if (!Object.prototype.hasOwnProperty.call(pattern, key)) {\n continue;\n }\n if (key === 'logic') {\n continue;\n }\n if (key === 'change' && pattern.change === 'any') {\n continue;\n }\n const _func: (pattern: Pattern) => PatternEventCompareFunction = (\n patternCompareFunctions as unknown as Record PatternEventCompareFunction>\n )[key];\n if (!_func) {\n continue;\n }\n func = _func(pattern);\n if (typeof func !== 'function') {\n continue;\n }\n functions.push(func);\n }\n return functions;\n }\n\n /**\n * Splits a selector string into attribute and value\n *\n * @param selector The selector string to split\n */\n function splitSelectorString(selector: string): Selector {\n const parts = selector.split('=', 2);\n if (parts[1] && parts[1][0] === '\"') {\n parts[1] = parts[1].substring(1);\n const len = parts[1].length;\n if (parts[1] && parts[1][len - 1] === '\"') {\n parts[1] = parts[1].substring(0, len - 1);\n }\n }\n if (parts[1] && parts[1][0] === \"'\") {\n parts[1] = parts[1].substring(1);\n const len = parts[1].length;\n if (parts[1] && parts[1][len - 1] === \"'\") {\n parts[1] = parts[1].substring(0, len - 1);\n }\n }\n\n if (parts[1]) {\n parts[1] = parts[1].trim();\n }\n parts[0] = parts[0].trim();\n\n return { attr: parts[0], value: parts[1] };\n }\n\n /**\n * Transforms a selector string with wildcards into a regular expression\n *\n * @param str The selector string to transform into a regular expression\n */\n function selectorStringToRegExp(str: string): RegExp {\n const startsWithWildcard = str[0] === '*';\n const endsWithWildcard = str[str.length - 1] === '*';\n\n // Sanitize the selector, so it is safe to use in a RegEx\n // Taken from https://stackoverflow.com/a/3561711/10179833 but modified\n // since * has a special meaning in our selector and should not be escaped\n // eslint-disable-next-line no-useless-escape\n str = str.replace(/[-\\/\\\\^$+?.()|[\\]{}]/g, '\\\\$&').replace(/\\*/g, '.*');\n\n return new RegExp((startsWithWildcard ? '' : '^') + str + (endsWithWildcard ? '' : '$'));\n }\n\n /**\n * Adds a regular expression for selectors targeting the state ID\n *\n * @param selector The selector to apply the transform to\n */\n function addRegExpToIdAttrSelectors(selector: Selector): Selector {\n if ((selector.attr === 'id' || selector.attr === 'state.id') && !selector.idRegExp && selector.value) {\n return {\n attr: selector.attr,\n value: selector.value,\n idRegExp: selectorStringToRegExp(selector.value),\n };\n }\n return selector;\n }\n\n /**\n * Tests if a value loosely equals (==) the reference string.\n * In contrast to the equality operator, this treats true == \"true\" as well\n * so we can test common and native attributes for boolean values\n *\n * @param value The value to compare with the reference\n * @param reference The reference to compare the value to\n */\n function looselyEqualsString(value: string | number | boolean | undefined, reference: string): boolean {\n // For booleans, compare the string representation\n // For other types do a loose comparison\n return typeof value === 'boolean'\n ? (value && reference === 'true') || (!value && reference === 'false')\n : value == reference;\n }\n\n /**\n * Returns the `common.type` for a given variable\n */\n function getCommonTypeOf(value: any): ioBroker.CommonType {\n return isArray(value) ? 'array' : isObject(value) ? 'object' : (typeof value as ioBroker.CommonType);\n }\n\n /**\n * Returns if an id is in an allowed namespace for automatic object creations\n *\n * @param id id to check\n */\n function validIdForAutomaticFolderCreation(id: string): boolean {\n return id.startsWith('javascript.') || id.startsWith('0_userdata.0.') || id.startsWith('alias.0.');\n }\n\n /**\n * Iterate through object structure to create missing folder objects\n */\n async function ensureObjectStructure(id: string): Promise {\n if (!validIdForAutomaticFolderCreation(id)) {\n return;\n }\n if (context.folderCreationVerifiedObjects[id] === true) {\n return;\n }\n const idArr = id.split('.');\n idArr.pop(); // the last is created as an object in any way\n if (idArr.length < 3) {\n return; // Nothing to do\n }\n // We just create sublevel projects\n let idToCheck = idArr.splice(0, 2).join('.');\n\n context.folderCreationVerifiedObjects[id] = true;\n for (const part of idArr) {\n idToCheck += `.${part}`;\n if (context.folderCreationVerifiedObjects[idToCheck] === true || objects[idToCheck]) {\n continue;\n }\n context.folderCreationVerifiedObjects[idToCheck] = true;\n let obj: ioBroker.Object | null | undefined;\n try {\n obj = await adapter.getForeignObjectAsync(idToCheck);\n } catch {\n // ignore\n }\n if (!obj?.common) {\n sandbox.log(`Create folder object for ${idToCheck}`, 'debug');\n try {\n await adapter.setForeignObjectAsync(idToCheck, {\n _id: idToCheck,\n type: 'folder',\n common: {\n name: part,\n },\n native: {\n autocreated: 'by automatic ensure logic',\n },\n } as ioBroker.FolderObject);\n } catch (err: any) {\n sandbox.log(`Could not automatically create folder object ${idToCheck}: ${err.message}`, 'info');\n }\n } else {\n //sandbox.log(` already existing \"${idToCheck}\": ${JSON.stringify(obj)}`, 'debug');\n }\n }\n }\n\n function setStateHelper(\n sandbox: SandboxType,\n isCreate: boolean,\n isChanged: boolean,\n id: string,\n state: null | ioBroker.SettableState | ioBroker.StateValue,\n isAck: boolean | 'true' | 'false' | undefined | ((error?: Error | null) => void),\n callback?: (error?: Error | null) => void,\n ): void {\n if (typeof isAck === 'function') {\n callback = isAck;\n isAck = undefined;\n }\n\n let stateNotNull: ioBroker.SettableState | ioBroker.StateValue;\n\n if (isAck === true || isAck === false || isAck === 'true' || isAck === 'false') {\n if (state && typeof state === 'object' && state.val !== undefined) {\n stateNotNull = state;\n // we assume that we were given a state object if\n // state is an object that contains a `val` property\n if (!Object.prototype.hasOwnProperty.call(state, 'ack')) {\n stateNotNull.ack = isAck === true || isAck === 'true';\n }\n } else if (state === null) {\n stateNotNull = { val: null, ack: isAck === true || isAck === 'true' };\n } else {\n // otherwise, assume that the given state is the value to be set\n stateNotNull = { val: state as ioBroker.StateValue, ack: isAck === true || isAck === 'true' };\n }\n } else if (state === null) {\n stateNotNull = { val: null };\n } else {\n stateNotNull = state;\n }\n\n // Check a type of state\n if (!objects[id] && objects[`${adapter.namespace}.${id}`]) {\n id = `${adapter.namespace}.${id}`;\n }\n\n if (isCreate) {\n if (id.match(/^javascript\\.\\d+\\.scriptEnabled/)) {\n sandbox.log(\n `Own states (${id}) should not be used in javascript.X.scriptEnabled.*! Please move the states to 0_userdata.0.*`,\n 'info',\n );\n } else if (id.match(/^javascript\\.\\d+\\.scriptProblem/)) {\n sandbox.log(\n `Own states (${id}) should not be used in javascript.X.scriptProblem.*! Please move the states to 0_userdata.0.*`,\n 'info',\n );\n }\n }\n\n const common = objects[id] ? objects[id].common : null;\n if (common?.type && common.type !== 'mixed' && common.type !== 'json') {\n // Find out which type the value has\n let actualCommonType: ioBroker.CommonType | undefined;\n if (typeof stateNotNull === 'object') {\n if (stateNotNull && stateNotNull.val !== undefined && stateNotNull.val !== null) {\n actualCommonType = getCommonTypeOf(stateNotNull.val);\n }\n } else if (stateNotNull !== null && stateNotNull !== undefined) {\n actualCommonType = getCommonTypeOf(stateNotNull);\n }\n // If this is not the expected one, issue a warning\n if (actualCommonType && actualCommonType !== common.type) {\n context.logWithLineInfo(\n `You are assigning a ${actualCommonType} to the state \"${id}\" which expects a ${common.type}. ` +\n `Please fix your code to use a ${common.type} or change the state type to ${actualCommonType}. ` +\n `This warning might become an error in future versions.`,\n );\n }\n\n if (actualCommonType === 'array' || actualCommonType === 'object') {\n try {\n if (typeof stateNotNull === 'object' && typeof stateNotNull.val !== 'undefined') {\n stateNotNull.val = JSON.stringify(stateNotNull.val);\n } else {\n stateNotNull = JSON.stringify(stateNotNull);\n }\n } catch (err: any) {\n context.logWithLineInfo(\n `Could not stringify value for type ${actualCommonType} and id ${id}: ${err.message}`,\n );\n if (typeof callback === 'function') {\n try {\n callback.call(\n sandbox,\n new Error(\n `Could not stringify value for type ${actualCommonType} and id ${id}: ${err.message}`,\n ),\n );\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n }\n }\n }\n // Check min and max of value\n if (typeof stateNotNull === 'object') {\n if (common && typeof stateNotNull.val === 'number') {\n const num: number = stateNotNull.val;\n if (common.min !== undefined && num < common.min) {\n stateNotNull.val = common.min;\n } else if (common.max !== undefined && num > common.max) {\n stateNotNull.val = common.max;\n }\n }\n } else if (common && typeof stateNotNull === 'number') {\n const num: number = stateNotNull;\n if (common.min !== undefined && num < common.min) {\n stateNotNull = common.min;\n }\n if (common.max !== undefined && num > common.max) {\n stateNotNull = common.max;\n }\n }\n\n let stateAsObject: ioBroker.State;\n // modify state here, to make it available in callback\n if (\n stateNotNull === null ||\n typeof stateNotNull !== 'object' ||\n (stateNotNull as ioBroker.SettableState).val === undefined\n ) {\n stateAsObject = context.prepareStateObject(id, {\n val: stateNotNull as ioBroker.StateValue,\n ack: isAck === true || isAck === 'true',\n });\n } else {\n stateAsObject = context.prepareStateObject(id, stateNotNull as ioBroker.SettableState);\n }\n\n // set as comment: from which script this state was set.\n stateAsObject.c = sandbox.scriptName;\n\n if (objects[id]) {\n script.setStatePerMinuteCounter++;\n if (sandbox.verbose) {\n sandbox.log(`setForeignState(id=${id}, state=${JSON.stringify(stateAsObject)})`, 'info');\n }\n\n if (debug) {\n sandbox.log(\n `setForeignState(id=${id}, state=${JSON.stringify(stateAsObject)}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n\n if (typeof callback === 'function') {\n setImmediate(() => {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n });\n }\n } else {\n if (!(adapter.config as JavaScriptAdapterConfig).subscribe) {\n // store actual state to make possible to process value in callback\n // risk that there will be an error on setState is very low,\n // but we will not store new state if the setStateChanged is called\n if (!isChanged) {\n context.interimStateValues[id] = stateAsObject;\n }\n }\n const errHandler = (err: Error | null | undefined, funcId: string): void => {\n err && sandbox.log(`${funcId}: ${err}`, 'error');\n // If adapter holds all states\n if (err && !(adapter.config as JavaScriptAdapterConfig).subscribe) {\n delete context.interimStateValues[id];\n }\n\n if (typeof callback === 'function') {\n setImmediate(() => {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n });\n }\n };\n if (isChanged) {\n if (!(adapter.config as JavaScriptAdapterConfig).subscribe && context.interimStateValues[id]) {\n // if the state is changed, we will compare it with interimStateValues\n const oldState = context.interimStateValues[id];\n const attrs: string[] = Object.keys(stateAsObject).filter(\n attr => attr !== 'ts' && (stateAsObject as Record)[attr] !== undefined,\n );\n if (\n !attrs.every(\n attr =>\n (stateAsObject as Record)[attr] ===\n (oldState as Record)[attr],\n )\n ) {\n // state is changed for sure, and we will call setForeignState\n // and store new state to interimStateValues\n context.interimStateValues[id] = stateAsObject;\n adapter.setForeignState(id, stateAsObject, err => errHandler(err, 'setForeignState'));\n } else {\n // otherwise - do nothing as we have cached state, except callback\n errHandler(null, 'setForeignStateCached');\n }\n } else {\n // adapter doesn't hold all states, or it has not cached then we will simply call setForeignStateChanged\n adapter.setForeignStateChanged(id, { ...stateAsObject, ts: undefined }, err =>\n errHandler(err, 'setForeignStateChanged'),\n );\n }\n } else {\n adapter.setForeignState(id, stateAsObject, err => errHandler(err, 'setForeignState'));\n }\n }\n } else {\n context.logWithLineInfo(`State \"${id}\" not found`);\n if (typeof callback === 'function') {\n setImmediate(() => {\n try {\n callback.call(sandbox, new Error(`State \"${id}\" not found`));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n });\n }\n }\n }\n\n sandbox = {\n mods,\n _id: script._id,\n // @deprecated use scriptName\n name,\n scriptName: name,\n instance: adapter.instance || 0,\n defaultDataDir: context.getAbsoluteDefaultDataDir(),\n verbose,\n exports: {}, // Polyfill for the export object in TypeScript modules\n require: function (md: string): any {\n if (typeof md === 'string' && md.startsWith('node:')) {\n md = md.replace(/^node:/, '');\n }\n\n if (md === 'request') {\n if (!sandbox.__engine.__deprecatedWarnings.includes(md)) {\n sandbox.log(\n `request package is deprecated - please use httpGet (or a stable lib like axios) instead!`,\n 'warn',\n );\n sandbox.__engine.__deprecatedWarnings.push(md);\n }\n }\n\n if (mods[md]) {\n return mods[md];\n }\n\n let error: Error | undefined;\n\n try {\n mods[md] = require(\n adapter.getAdapterScopedPackageIdentifier ? adapter.getAdapterScopedPackageIdentifier(md) : md,\n );\n return mods[md];\n } catch (e: any) {\n error = e as Error;\n }\n\n try {\n // the user requires a module which is not specified in the additional node modules\n // for backward compatibility we check if the module can simply be required directly before we fail (e.g., direct dependencies of JavaScript adapter)\n adapter.log.debug(`Try direct require of \"${md}\" as not specified in the additional dependencies`);\n mods[md] = require(md);\n\n return mods[md];\n } catch (e: any) {\n context.logError(name, `Error by loading module \"${md}\":`, error || e, 6);\n\n void adapter.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: true,\n ack: true,\n c: 'require',\n });\n }\n },\n Buffer: Buffer,\n __engine: {\n __deprecatedWarnings: [],\n __subscriptionsObject: 0,\n __subscriptions: 0,\n __subscriptionsMessage: 0,\n __subscriptionsFile: 0,\n __subscriptionsLog: 0,\n __schedules: 0,\n },\n\n $: function (selector: string): iobJS.QueryResult {\n // following is supported\n // 'type[commonAttr=something]', 'id[commonAttr=something]', id(enumName=\"something\")', id{nativeName=\"something\"}\n // Type can be state, channel or device\n // Attr can be any of the common attributes and can have wildcards *\n // E.g. \"state[id='hm-rpc.0.*]\" or \"hm-rpc.0.*\" returns all states of adapter instance hm-rpc.0\n // channel(room=\"Living room\") => all states in room \"Living room\"\n // channel{TYPE=BLIND}[state.id=*.LEVEL]\n // Switch all states with .STATE of channels with role \"switch\" in \"Wohnzimmer\" to false\n // $('channel[role=switch][state.id=*.STATE](rooms=Wohnzimmer)').setState(false);\n //\n // Following functions are possible, setValue, getValue (only from first), on, each\n\n // Todo CACHE!!!\n\n const result: iobJS.QueryResult = {} as iobJS.QueryResult;\n\n let name = '';\n const commonStrings: string[] = [];\n const enumStrings: string[] = [];\n const nativeStrings: string[] = [];\n let isInsideName = true;\n let isInsideCommonString = false;\n let isInsideEnumString = false;\n let isInsideNativeString = false;\n let currentCommonString = '';\n let currentNativeString = '';\n let currentEnumString = '';\n\n // parse string\n let selectorHasInvalidType = false;\n if (typeof selector === 'string') {\n for (let i = 0; i < selector.length; i++) {\n if (selector[i] === '{') {\n isInsideName = false;\n if (isInsideCommonString || isInsideEnumString || isInsideNativeString) {\n // Error\n break;\n }\n isInsideNativeString = true;\n } else if (selector[i] === '}') {\n isInsideNativeString = false;\n nativeStrings.push(currentNativeString);\n currentNativeString = '';\n } else if (selector[i] === '[') {\n isInsideName = false;\n if (isInsideCommonString || isInsideEnumString || isInsideNativeString) {\n // Error\n break;\n }\n isInsideCommonString = true;\n } else if (selector[i] === ']') {\n isInsideCommonString = false;\n commonStrings.push(currentCommonString);\n currentCommonString = '';\n } else if (selector[i] === '(') {\n isInsideName = false;\n if (isInsideCommonString || isInsideEnumString || isInsideNativeString) {\n // Error\n break;\n }\n isInsideEnumString = true;\n } else if (selector[i] === ')') {\n isInsideEnumString = false;\n enumStrings.push(currentEnumString);\n currentEnumString = '';\n } else if (isInsideName) {\n name += selector[i];\n } else if (isInsideCommonString) {\n currentCommonString += selector[i];\n } else if (isInsideEnumString) {\n currentEnumString += selector[i];\n } else if (isInsideNativeString) {\n currentNativeString += selector[i];\n } //else {\n // some error\n //}\n }\n } else {\n selectorHasInvalidType = true;\n }\n\n // If some error in the selector\n if (selectorHasInvalidType || isInsideEnumString || isInsideCommonString || isInsideNativeString) {\n result.length = 0;\n result.toArray = function () {\n return [];\n };\n result.each = function () {\n return this;\n };\n result.getState = function () {\n return null;\n };\n result.setState = function () {\n return this;\n };\n result.on = function () {\n return this;\n };\n }\n\n if (isInsideEnumString) {\n sandbox.log(`Invalid selector: enum close bracket \")\" cannot be found in \"${selector}\"`, 'warn');\n result.error = 'Invalid selector: enum close bracket \")\" cannot be found';\n return result;\n } else if (isInsideCommonString) {\n sandbox.log(`Invalid selector: common close bracket \"]\" cannot be found in \"${selector}\"`, 'warn');\n result.error = 'Invalid selector: common close bracket \"]\" cannot be found';\n return result;\n } else if (isInsideNativeString) {\n sandbox.log(`Invalid selector: native close bracket \"}\" cannot be found in \"${selector}\"`, 'warn');\n result.error = 'Invalid selector: native close bracket \"}\" cannot be found';\n return result;\n } else if (selectorHasInvalidType) {\n const message = `Invalid selector: selector must be a string but is of type ${typeof selector}`;\n sandbox.log(message, 'warn');\n result.error = message;\n return result;\n }\n\n let commonSelectors: Selector[] = commonStrings.map(selector => splitSelectorString(selector));\n let nativeSelectors: Selector[] = nativeStrings.map(selector => splitSelectorString(selector));\n const enumSelectorObjects: Selector[] = enumStrings.map(_enum => splitSelectorString(_enum));\n const allSelectors: Selector[] = commonSelectors.concat(nativeSelectors, enumSelectorObjects);\n\n // These selectors match the state or object ID and don't belong in the common/native selectors\n // Also use RegExp for the ID matching\n const stateIdSelectors: Selector[] = allSelectors\n .filter(selector => selector.attr === 'state.id')\n .map(selector => addRegExpToIdAttrSelectors(selector));\n const objectIdSelectors: Selector[] = allSelectors\n .filter(selector => selector.attr === 'id')\n .map(selector => addRegExpToIdAttrSelectors(selector));\n commonSelectors = commonSelectors.filter(\n selector => selector.attr !== 'state.id' && selector.attr !== 'id',\n );\n nativeSelectors = nativeSelectors.filter(\n selector => selector.attr !== 'state.id' && selector.attr !== 'id',\n );\n const enumSelectors: string[] = enumSelectorObjects\n .filter(selector => selector.attr !== 'state.id' && selector.attr !== 'id')\n // enums are filtered by their enum id, so transform the selector into that\n .map(selector => `enum.${selector.attr}.${selector.value}`);\n\n name = name.trim();\n\n if (name === 'channel' || name === 'device') {\n // Fill the channels and devices objects with the IDs of all their states,\n // so we can loop over them afterward\n if (!context.channels || !context.devices) {\n context.channels = {};\n context.devices = {};\n for (const _id in objects) {\n if (Object.prototype.hasOwnProperty.call(objects, _id) && objects[_id].type === 'state') {\n const parts = _id.split('.');\n parts.pop();\n const chn = parts.join('.');\n\n parts.pop();\n const dev = parts.join('.');\n\n context.devices[dev] = context.devices[dev] || [];\n context.devices[dev].push(_id);\n\n context.channels[chn] = context.channels[chn] || [];\n context.channels[chn].push(_id);\n }\n }\n }\n }\n\n if (name === 'schedule') {\n if (!context.schedules) {\n context.schedules = [];\n for (const _id in objects) {\n if (Object.prototype.hasOwnProperty.call(objects, _id) && objects[_id].type === 'schedule') {\n context.schedules.push(_id);\n }\n }\n }\n }\n\n /**\n * applies all selectors targeting an object or state ID\n */\n function applyIDSelectors(objId: string, selectors: Selector[]): boolean {\n // Only keep the ID if it matches every ID selector\n return selectors.every(selector => !selector.idRegExp || selector.idRegExp.test(objId));\n }\n\n /**\n * Applies all selectors targeting the Object common properties\n *\n * @param objId - The ID of the object in question\n */\n function applyCommonSelectors(objId: string): boolean {\n const obj = objects[objId];\n if (!obj?.common) {\n return false;\n }\n const objCommon = obj.common;\n\n // make sure this object satisfies all selectors\n return commonSelectors.every(\n selector =>\n // ensure a property exists\n (selector.value === undefined && objCommon[selector.attr] !== undefined) ||\n // or match exact values\n looselyEqualsString(objCommon[selector.attr], selector.value),\n );\n }\n\n /**\n * Applies all selectors targeting the Object native properties\n *\n * @param objId - The ID of the object in question\n */\n function applyNativeSelectors(objId: string): boolean {\n const obj = objects[objId];\n if (!obj || !obj.native) {\n return false;\n }\n const objNative = obj.native;\n // make sure this object satisfies all selectors\n return nativeSelectors.every(\n selector =>\n // ensure a property exists\n (selector.value === undefined && objNative[selector.attr] !== undefined) ||\n // or match exact values\n looselyEqualsString(objNative[selector.attr], selector.value),\n );\n }\n\n /**\n * Applies all selectors targeting the Objects enums\n *\n * @param objId - The ID of the object in question\n */\n function applyEnumSelectors(objId: string): boolean {\n const enumIds: string[] = [];\n eventObj.getObjectEnumsSync(context, objId, enumIds);\n // make sure this object satisfies all selectors\n return enumSelectors.every(_enum => enumIds.includes(_enum));\n }\n\n let res: string[];\n\n if (name === 'schedule') {\n res = context.schedules || [];\n if (objectIdSelectors.length) {\n res = res.filter(channelId => applyIDSelectors(channelId, objectIdSelectors));\n }\n\n // filter out those that don't match every common selector\n if (commonSelectors.length) {\n res = res.filter(id => applyCommonSelectors(id));\n }\n\n // filter out those that don't match every native selector\n if (nativeSelectors.length) {\n res = res.filter(id => applyNativeSelectors(id));\n }\n\n // filter out those that don't match every enum selector\n if (enumSelectors.length) {\n res = res.filter(channelId => applyEnumSelectors(channelId));\n }\n } else if (name === 'channel') {\n if (!context.channels) {\n // TODO: fill the channels and maintain them on all places where context.stateIds will be changed\n }\n const channels = context.channels || {};\n\n // go through all channels\n res = Object.keys(channels);\n // filter out those that don't match every ID selector for the channel ID\n if (objectIdSelectors.length) {\n res = res.filter(channelId => applyIDSelectors(channelId, objectIdSelectors));\n }\n // filter out those that don't match every common selector\n if (commonSelectors.length) {\n res = res.filter(channelId => applyCommonSelectors(channelId));\n }\n // filter out those that don't match every native selector\n if (nativeSelectors.length) {\n res = res.filter(channelId => applyNativeSelectors(channelId));\n }\n // filter out those that don't match every enum selector\n if (enumSelectors.length) {\n res = res.filter(channelId => applyEnumSelectors(channelId));\n }\n\n // retrieve the state ID collection for all remaining channels\n res = res\n .map(id => channels[id])\n // and flatten the array to get only the state IDs\n .reduce((acc, next) => acc.concat(next), []);\n\n // now filter out those that don't match every ID selector for the state ID\n if (stateIdSelectors.length) {\n res = res.filter(stateId => applyIDSelectors(stateId, stateIdSelectors));\n }\n } else if (name === 'device') {\n if (!context.devices) {\n // TODO: fill the devices and maintain them on all places where context.stateIds will be changed\n }\n\n const devices = context.devices || {};\n\n // go through all devices\n res = Object.keys(devices);\n // filter out those that don't match every ID selector for the channel ID\n if (objectIdSelectors.length) {\n res = res.filter(deviceId => applyIDSelectors(deviceId, objectIdSelectors));\n }\n\n // filter out those that don't match every common selector\n if (commonSelectors.length) {\n res = res.filter(deviceId => applyCommonSelectors(deviceId));\n }\n\n // filter out those that don't match every native selector\n if (nativeSelectors.length) {\n res = res.filter(deviceId => applyNativeSelectors(deviceId));\n }\n\n // filter out those that don't match every enum selector\n if (enumSelectors.length) {\n res = res.filter(deviceId => applyEnumSelectors(deviceId));\n }\n\n // retrieve the state ID collection for all remaining devices\n res = res\n .map(id => devices[id])\n // and flatten the array to get only the state IDs\n .reduce((acc, next) => acc.concat(next), []);\n\n // now filter out those that don't match every ID selector for the state ID\n if (stateIdSelectors.length) {\n res = res.filter(stateId => applyIDSelectors(stateId, stateIdSelectors));\n }\n } else {\n // go through all states\n res = context.stateIds;\n // if the \"name\" is not state, then we filter for the ID as well\n if (name && name !== 'state') {\n const r = new RegExp(`^${name.replace(/\\./g, '\\\\.').replace(/\\*/g, '.*')}$`);\n res = res.filter(id => r.test(id));\n }\n\n // filter out those that don't match every ID selector for the object ID or the state ID\n if (objectIdSelectors.length) {\n res = res.filter(id => applyIDSelectors(id, objectIdSelectors));\n }\n\n // filter out those that don't match every ID selector for the state ID\n if (stateIdSelectors.length) {\n res = res.filter(id => applyIDSelectors(id, stateIdSelectors));\n }\n\n // filter out those that don't match every common selector\n if (commonSelectors.length) {\n res = res.filter(id => applyCommonSelectors(id));\n }\n\n // filter out those that don't match every native selector\n if (nativeSelectors.length) {\n res = res.filter(id => applyNativeSelectors(id));\n }\n\n // filter out those that don't match every enum selector\n if (enumSelectors.length) {\n res = res.filter(id => applyEnumSelectors(id));\n }\n }\n\n const resUnique: string[] = [];\n for (let i = 0; i < res.length; i++) {\n if (!resUnique.includes(res[i])) {\n resUnique.push(res[i]);\n }\n }\n\n for (let i = 0; i < resUnique.length; i++) {\n result[i] = resUnique[i];\n }\n result.length = resUnique.length;\n\n // Implementing the Symbol.iterator contract makes the query result iterable\n result[Symbol.iterator] = function* () {\n for (let i = 0; i < result.length; i++) {\n yield result[i];\n }\n };\n result.toArray = function (): string[] {\n return [...resUnique];\n };\n result.each = function (callback: (id: string, index: number) => void | false): iobJS.QueryResult {\n if (typeof callback === 'function') {\n let r: boolean | void;\n for (let i = 0; i < this.length; i++) {\n r = callback(result[i], i);\n if (r === false) {\n break;\n }\n }\n }\n return this;\n };\n // @ts-expect-error fix later\n result.getState = function (\n callback?: iobJS.GetStateCallback,\n ): void | null | undefined | iobJS.TypedState | iobJS.AbsentState {\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n if (typeof callback !== 'function') {\n sandbox.log('You cannot use this function synchronous', 'error');\n } else {\n void adapter.getForeignState(\n this[0],\n (err: Error | null | undefined, state?: ioBroker.State | null): void => {\n void callback(\n err,\n context.convertBackStringifiedValues(this[0], state) as\n | iobJS.TypedState\n | iobJS.AbsentState,\n );\n },\n );\n }\n } else {\n if (!this[0]) {\n return null;\n }\n if (context.interimStateValues[this[0]] !== undefined) {\n return context.convertBackStringifiedValues(this[0], context.interimStateValues[this[0]]) as\n | iobJS.TypedState\n | iobJS.AbsentState;\n }\n return context.convertBackStringifiedValues(this[0], states[this[0]]) as\n | iobJS.TypedState\n | iobJS.AbsentState;\n }\n };\n result.getStateAsync = async function (): Promise<\n iobJS.TypedState | iobJS.AbsentState | null | undefined\n > {\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n const state = await adapter.getForeignStateAsync(this[0]);\n return context.convertBackStringifiedValues(this[0], state) as\n | iobJS.TypedState\n | iobJS.AbsentState\n | null;\n }\n if (!this[0]) {\n return null;\n }\n if (context.interimStateValues[this[0]] !== undefined) {\n return context.convertBackStringifiedValues(this[0], context.interimStateValues[this[0]]) as\n | iobJS.TypedState\n | iobJS.AbsentState\n | null;\n }\n return context.convertBackStringifiedValues(this[0], states[this[0]]) as\n | iobJS.TypedState\n | iobJS.AbsentState\n | null;\n };\n result.setState = function (\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean | 'false' | 'true' | null | iobJS.SetStateCallback,\n callback?: iobJS.SetStateCallback,\n ) {\n if (typeof isAck === 'function') {\n callback = isAck;\n isAck = undefined;\n }\n void result\n .setStateAsync(state, isAck as boolean | 'false' | 'true')\n .then(() => typeof callback === 'function' && callback());\n return this;\n };\n result.setStateAsync = async function (\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean,\n ): Promise {\n for (let i = 0; i < this.length; i++) {\n await sandbox.setStateAsync(this[i], state, isAck);\n }\n };\n result.setStateChanged = function (\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean,\n callback?: () => void,\n ) {\n if (typeof isAck === 'function') {\n callback = isAck;\n isAck = undefined;\n }\n void result.setStateChangedAsync(state, isAck).then(() => typeof callback === 'function' && callback());\n return this;\n };\n result.setStateChangedAsync = async function (\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean,\n ): Promise {\n for (let i = 0; i < this.length; i++) {\n await sandbox.setStateChangedAsync(this[i], state, isAck);\n }\n };\n result.setStateDelayed = function (\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck: boolean | number | undefined,\n delay?: number | boolean,\n clearRunning?: boolean | (() => void),\n callback?: () => void,\n ) {\n if (typeof isAck !== 'boolean') {\n callback = clearRunning as () => void;\n clearRunning = delay as boolean;\n delay = isAck as number;\n isAck = undefined;\n }\n if (typeof delay !== 'number') {\n callback = clearRunning as () => void;\n clearRunning = delay;\n delay = 0;\n }\n if (typeof clearRunning !== 'boolean') {\n callback = clearRunning;\n clearRunning = true;\n }\n let count = this.length;\n for (let i = 0; i < this.length; i++) {\n sandbox.setStateDelayed(this[i], state, isAck as boolean, delay, clearRunning, () => {\n if (!--count && typeof callback === 'function') {\n callback();\n }\n });\n }\n return this;\n };\n result.on = function (callbackOrId: string | ((data: any) => void), value?: any) {\n for (let i = 0; i < this.length; i++) {\n sandbox.subscribe(this[i], callbackOrId, value);\n }\n return this;\n };\n return result;\n },\n log: function (msg: string, severity?: ioBroker.LogLevel): void {\n severity = severity || 'info';\n\n // disable log in log handler (prevent endless loops)\n if (sandbox.logHandler && (sandbox.logHandler === severity || sandbox.logHandler === '*')) {\n return;\n }\n\n if (!adapter.log[severity]) {\n msg = `Unknown severity level \"${severity}\" by log of [${msg}]`;\n severity = 'warn';\n }\n\n if (msg && typeof msg !== 'string') {\n msg = mods.util.format(msg);\n }\n\n if (debugMode) {\n console.log(`${severity}$$${name}$$${msg}`, Date.now());\n } else {\n adapter.log[severity](`${name}: ${msg}`);\n }\n },\n onLog: function (severity: ioBroker.LogLevel, callback: (info: LogMessage) => void): number {\n if (!['info', 'error', 'debug', 'silly', 'warn', '*'].includes(severity)) {\n sandbox.log(`Unknown severity \"${severity}\"`, 'warn');\n return 0;\n }\n if (typeof callback !== 'function') {\n sandbox.log(`Invalid callback for onLog`, 'warn');\n return 0;\n }\n\n const handler = { id: Date.now() + Math.floor(Math.random() * 10000), cb: callback, sandbox, severity };\n context.logSubscriptions[sandbox.scriptName] = context.logSubscriptions[sandbox.scriptName] || [];\n context.logSubscriptions[sandbox.scriptName].push(handler);\n context.updateLogSubscriptions();\n\n sandbox.__engine.__subscriptionsLog += 1;\n\n sandbox.verbose &&\n sandbox.log(\n `onLog(severity=${severity}, id=${handler.id}) - logSubscriptions=${sandbox.__engine.__subscriptionsLog}`,\n 'info',\n );\n\n if (\n sandbox.__engine.__subscriptionsLog %\n (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__subscriptionsLog} log subscriptions registered. Check your script!`,\n 'warn',\n );\n }\n\n return handler.id;\n },\n onLogUnregister: function (\n idOrCallbackOrSeverity: number | ioBroker.LogLevel | ((info: LogMessage) => void),\n ): boolean {\n let found = false;\n\n if (context.logSubscriptions?.[sandbox.scriptName]) {\n sandbox.verbose &&\n sandbox.log(\n `onLogUnregister(idOrCallbackOrSeverity=${JSON.stringify(idOrCallbackOrSeverity)}) - logSubscriptions=${sandbox.__engine.__subscriptionsLog}`,\n 'info',\n );\n\n for (let i = 0; i < context.logSubscriptions[sandbox.scriptName].length; i++) {\n if (\n context.logSubscriptions[sandbox.scriptName][i].cb === idOrCallbackOrSeverity ||\n context.logSubscriptions[sandbox.scriptName][i].id === idOrCallbackOrSeverity ||\n context.logSubscriptions[sandbox.scriptName][i].severity === idOrCallbackOrSeverity\n ) {\n sandbox.verbose &&\n sandbox.log(\n `onLogUnregister(idOrCallbackOrSeverity=${JSON.stringify(idOrCallbackOrSeverity)}, removing id=${context.logSubscriptions[sandbox.scriptName][i].id})`,\n 'info',\n );\n\n context.logSubscriptions[sandbox.scriptName].splice(i, 1);\n i--;\n sandbox.__engine.__subscriptionsLog--;\n\n found = true;\n\n // if deletion via ID\n if (typeof idOrCallbackOrSeverity === 'number') {\n break;\n }\n } else {\n sandbox.verbose &&\n sandbox.log(\n `onLogUnregister(idOrCallbackOrSeverity=${JSON.stringify(idOrCallbackOrSeverity)}) NOT = ${JSON.stringify(context.logSubscriptions[sandbox.scriptName][i])}`,\n 'info',\n );\n }\n }\n }\n\n context.updateLogSubscriptions();\n\n return found;\n },\n exec: function (\n cmd: string,\n options?: ExecOptions | ((error: Error | null | string, stdout?: string, stderr?: string) => void),\n callback?: (error: Error | null | string, stdout?: string, stderr?: string) => void,\n ): undefined | ChildProcess {\n if (typeof options === 'function') {\n callback = options as (error: Error | null | string, stdout?: string, stderr?: string) => void;\n options = {};\n }\n if (!(adapter.config as JavaScriptAdapterConfig).enableExec) {\n const error = 'exec is not available. Please enable \"Enable Exec\" option in instance settings';\n sandbox.log(error, 'error');\n\n if (typeof callback === 'function') {\n setImmediate(callback, error, undefined, undefined);\n }\n } else {\n if (sandbox.verbose) {\n sandbox.log(`exec(cmd=${cmd})`, 'info');\n }\n\n if (debug) {\n sandbox.log(words._('Command %s was not executed, while debug mode is active', cmd), 'warn');\n if (typeof callback === 'function') {\n setImmediate(function () {\n callback(null, '', '');\n });\n }\n } else {\n return mods.child_process.exec(\n cmd,\n options,\n (error: Error | null, stdout: string, stderr: string): void => {\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, error, stdout, stderr);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n },\n );\n }\n }\n },\n email: function (msg: string | SendMailOptions): void {\n if (sandbox.verbose) {\n sandbox.log(`email(msg=${JSON.stringify(msg)})`, 'info');\n }\n sandbox.log(`email(msg=${JSON.stringify(msg)}) is deprecated. Please use sendTo instead!`, 'warn');\n adapter.sendTo('email', msg);\n },\n pushover: function (msg: string | PushoverOptions): void {\n if (sandbox.verbose) {\n sandbox.log(`pushover(msg=${JSON.stringify(msg)})`, 'info');\n }\n sandbox.log(`pushover(msg=${JSON.stringify(msg)}) is deprecated. Please use sendTo instead!`, 'warn');\n adapter.sendTo('pushover', msg);\n },\n httpGet: function (\n url: string,\n options:\n | {\n timeout?: number;\n responseType?: ResponseType;\n headers?: Record;\n basicAuth?: { user: string; password: string } | null;\n bearerAuth?: string;\n validateCertificate?: boolean;\n }\n | ((\n error: Error | null,\n result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n },\n ) => void),\n callback?: (\n error: Error | null,\n result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n },\n ) => void,\n ): void {\n if (typeof options === 'function') {\n callback = options as (\n error: Error | null,\n result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n },\n ) => void;\n options = {};\n }\n\n const config = {\n ...getHttpRequestConfig(url, options, context.allowSelfSignedCerts),\n method: 'get',\n };\n\n if (sandbox.verbose) {\n sandbox.log(`httpGet(config=${JSON.stringify(config)})`, 'info');\n }\n\n const startTime = Date.now();\n\n mods.axios\n .default(config)\n .then((response: AxiosResponse) => {\n const responseTime = Date.now() - startTime;\n\n if (sandbox.verbose) {\n sandbox.log(`httpGet(url=${url}, responseTime=${responseTime}ms)`, 'info');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, null, {\n statusCode: response.status,\n data: response.data,\n headers: response.headers as Record,\n responseTime,\n });\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n })\n .catch((error: any) => {\n const responseTime = Date.now() - startTime;\n\n sandbox.log(`httpGet(url=${url}, error=${error.message})`, 'error');\n\n if (typeof callback === 'function') {\n let result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n } = {\n statusCode: null,\n data: null,\n headers: {},\n responseTime,\n };\n\n if (error.response) {\n result = {\n statusCode: error.response.status,\n data: error.response.data,\n headers: error.response.headers,\n responseTime,\n };\n }\n\n try {\n callback.call(sandbox, error.message, result);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n });\n },\n httpPost: function (\n url: string,\n data: any,\n options:\n | {\n timeout?: number;\n responseType?: ResponseType;\n headers?: Record;\n basicAuth?: { user: string; password: string } | null;\n bearerAuth?: string;\n validateCertificate?: boolean;\n }\n | ((\n error: Error | null,\n result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n },\n ) => void),\n callback?: (\n error: Error | null,\n result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n },\n ) => void,\n ): void {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n\n const config = {\n ...getHttpRequestConfig(\n url,\n options as {\n timeout?: number;\n responseType?: ResponseType;\n headers?: Record;\n basicAuth?: { user: string; password: string } | null;\n bearerAuth?: string;\n validateCertificate?: boolean;\n },\n context.allowSelfSignedCerts,\n ),\n method: 'post',\n data,\n };\n\n if (sandbox.verbose) {\n sandbox.log(`httpPost(config=${JSON.stringify(config)}, data=${data})`, 'info');\n }\n\n const startTime = Date.now();\n\n mods.axios\n .default(config)\n .then((response: AxiosResponse) => {\n const responseTime = Date.now() - startTime;\n\n if (sandbox.verbose) {\n sandbox.log(`httpPost(url=${url}, responseTime=${responseTime}ms)`, 'info');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, null, {\n statusCode: response.status,\n data: response.data,\n headers: response.headers,\n responseTime,\n });\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n })\n .catch((error: unknown) => {\n const responseTime = Date.now() - startTime;\n\n sandbox.log(`httpPost(url=${url}, error=${(error as Error).message})`, 'error');\n\n if (typeof callback === 'function') {\n let result: {\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n } = {\n statusCode: null,\n data: null,\n headers: {},\n responseTime,\n };\n const response: AxiosResponse | undefined = (error as AxiosError).response;\n\n if (response) {\n result = {\n statusCode: response.status,\n data: response.data,\n headers: response.headers,\n responseTime,\n };\n }\n\n try {\n callback.call(sandbox, new Error((error as AxiosError).message), result);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n });\n },\n createTempFile: function (fileName: string, data: Buffer | string): undefined | string {\n const os = mods.os;\n const path = mods.path;\n const fs = mods.fs;\n\n let tempDirPath = context.tempDirectories?.[sandbox.scriptName];\n\n if (!tempDirPath) {\n // create temp directory\n tempDirPath = fs.mkdtempSync(\n path.join(os.tmpdir(), `${sandbox.scriptName.substring(SCRIPT_CODE_MARKER.length)}-`),\n );\n context.tempDirectories[sandbox.scriptName] = tempDirPath;\n\n sandbox.verbose &&\n sandbox.log(\n `createTempFile(fileName=${fileName}, tempDirPath=${tempDirPath}) created temp directory in ${os.tmpdir()}`,\n 'info',\n );\n }\n\n const filePath = path.join(tempDirPath, fileName);\n\n // is sub dir?\n const fileDir = path.dirname(filePath);\n if (!fs.existsSync(fileDir)) {\n fs.mkdirSync(fileDir, { recursive: true });\n }\n\n if (typeof data === 'undefined') {\n sandbox.log(\n `createTempFile(fileName=${fileName}, fileDir=${fileDir}, filePath=${filePath}) data is undefined, file not created!`,\n 'error',\n );\n\n return undefined;\n }\n\n fs.writeFileSync(filePath, data);\n sandbox.verbose &&\n sandbox.log(`createTempFile(fileName=${fileName}, fileDir=${fileDir}, filePath=${filePath})`, 'info');\n\n return filePath;\n },\n subscribe: function (\n pattern:\n | TimeRule\n | AstroRule\n | Pattern\n | SchedulerRule\n | string\n | (TimeRule | AstroRule | Pattern | SchedulerRule | string)[],\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n callbackOrChangeTypeOrId: string | ChangeType | ((event?: EventObj) => void),\n value?: any,\n ):\n | SubscriptionResult\n | IobSchedule\n | string\n | null\n | undefined\n | (SubscriptionResult | IobSchedule | string | null | undefined)[] {\n // If a schedule object is given\n if (\n (typeof pattern === 'string' && pattern[0] === '{') ||\n (typeof pattern === 'object' && (pattern as SchedulerRule).period)\n ) {\n return sandbox.schedule(pattern as SchedulerRule, callbackOrChangeTypeOrId as () => void);\n }\n // If an array of schedules is given\n if (pattern && Array.isArray(pattern)) {\n const result: (IobSchedule | string | null | undefined)[] = [];\n for (const p of pattern) {\n result.push(\n sandbox.subscribe(p as SchedulerRule | string, callbackOrChangeTypeOrId, value) as\n | IobSchedule\n | string\n | null\n | undefined,\n );\n }\n return result;\n }\n\n // detect subscribe('id', 'any', (obj) => {})\n let oPattern: Pattern;\n if (\n (typeof pattern === 'string' || pattern instanceof RegExp) &&\n typeof callbackOrChangeTypeOrId === 'string' &&\n typeof value === 'function'\n ) {\n oPattern = { id: pattern, change: callbackOrChangeTypeOrId as ChangeType };\n callbackOrChangeTypeOrId = value;\n value = undefined;\n } else {\n oPattern = pattern as Pattern;\n }\n\n if (oPattern?.id && Array.isArray(oPattern.id)) {\n const result: (IobSchedule | string | null | undefined)[] = [];\n for (let t = 0; t < oPattern.id.length; t++) {\n const pa: Pattern = JSON.parse(JSON.stringify(oPattern));\n pa.id = oPattern.id[t];\n result.push(\n sandbox.subscribe(pa, callbackOrChangeTypeOrId, value) as\n | IobSchedule\n | string\n | null\n | undefined,\n );\n }\n return result;\n }\n\n // try to detect astro or cron (by spaces)\n if (isObject(pattern) || (typeof pattern === 'string' && pattern.match(/[,/\\d*]+\\s[,/\\d*]+\\s[,/\\d*]+/))) {\n if ((pattern as AstroRule).astro) {\n return sandbox.schedule(pattern as AstroRule, callbackOrChangeTypeOrId as () => void);\n } else if ((pattern as TimeRule).time) {\n return sandbox.schedule(\n (pattern as TimeRule).time as string,\n callbackOrChangeTypeOrId as () => void,\n );\n }\n }\n\n let callback: undefined | ((obj: EventObj) => void);\n\n // source is set by regexp if defined as /regexp/\n if (!isObject(pattern) || pattern instanceof RegExp || (pattern as RegExp).source) {\n oPattern = { id: pattern as string | RegExp, change: 'ne' };\n }\n\n if (oPattern.id !== undefined && !oPattern.id) {\n sandbox.log(`Error by subscription (trigger): empty ID defined. All states matched.`, 'error');\n return;\n } else if (typeof oPattern.id === 'boolean' || typeof oPattern.id === 'number') {\n sandbox.log(`Error by subscription (trigger): Wrong ID of type boolean or number.`, 'error');\n return;\n }\n\n sandbox.__engine.__subscriptions += 1;\n\n if (\n sandbox.__engine.__subscriptions % (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__subscriptions} subscriptions registered. Check your script!`,\n 'warn',\n );\n }\n\n if (oPattern.q === undefined) {\n oPattern.q = 0;\n }\n\n // add adapter namespace if nothing given\n if (oPattern.id && typeof oPattern.id === 'string' && !oPattern.id.includes('.')) {\n oPattern.id = `${adapter.namespace}.${oPattern.id}`;\n }\n\n if (typeof callbackOrChangeTypeOrId === 'function') {\n callback = callbackOrChangeTypeOrId;\n } else {\n if (typeof value === 'undefined') {\n callback = function (obj: EventObj) {\n sandbox.setState(callbackOrChangeTypeOrId, obj.newState.val);\n };\n } else {\n callback = function (/* obj */) {\n sandbox.setState(callbackOrChangeTypeOrId, value);\n };\n }\n }\n\n const subs: SubscriptionResult = {\n pattern: oPattern,\n callback: (obj: EventObj) => {\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, obj);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n },\n name,\n };\n\n // try to extract adapter\n if (oPattern.id && typeof oPattern.id === 'string') {\n const parts = oPattern.id.split('.');\n const a = `${parts[0]}.${parts[1]}`;\n const _adapter = `system.adapter.${a}`;\n\n if (objects[_adapter] && objects[_adapter].common && objects[_adapter].common.subscribable) {\n const alive = `system.adapter.${a}.alive`;\n context.adapterSubs[alive] = context.adapterSubs[alive] || [];\n\n const subExists = context.adapterSubs[alive].filter(sub => sub === oPattern.id).length > 0;\n\n if (!subExists) {\n context.adapterSubs[alive].push(oPattern.id);\n adapter.sendTo(a, 'subscribe', oPattern.id);\n }\n }\n }\n if (sandbox.verbose) {\n sandbox.log(`subscribe: ${JSON.stringify(subs)}`, 'info');\n }\n\n subscribePattern(script, oPattern.id as string);\n\n subs.patternCompareFunctions = getPatternCompareFunctions(oPattern);\n context.subscriptions.push(subs);\n\n if (oPattern.enumName || oPattern.enumId) {\n context.isEnums = true;\n }\n return subs;\n },\n getSubscriptions: function (): Record {\n const result: Record = {};\n for (let s = 0; s < context.subscriptions.length; s++) {\n result[context.subscriptions[s].pattern.id as string] =\n result[context.subscriptions[s].pattern.id as string] || [];\n result[context.subscriptions[s].pattern.id as string].push({\n name: context.subscriptions[s].name,\n pattern: context.subscriptions[s].pattern,\n });\n }\n if (sandbox.verbose) {\n sandbox.log(`getSubscriptions() => ${JSON.stringify(result)}`, 'info');\n }\n return result;\n },\n getFileSubscriptions: function (): Record {\n const result: Record = {};\n for (let s = 0; s < context.subscriptionsFile.length; s++) {\n const key = `${context.subscriptionsFile[s].id}$%$${context.subscriptionsFile[s].fileNamePattern}`;\n result[key] = result[key] || [];\n result[key].push({\n name: context.subscriptionsFile[s].name,\n id: context.subscriptionsFile[s].id,\n fileNamePattern: context.subscriptionsFile[s].fileNamePattern,\n });\n }\n if (sandbox.verbose) {\n sandbox.log(`getFileSubscriptions() => ${JSON.stringify(result)}`, 'info');\n }\n return result;\n },\n adapterSubscribe: function (id: string): void {\n if (typeof id !== 'string') {\n sandbox.log(`adapterSubscribe: invalid type of id ${typeof id}`, 'error');\n return;\n }\n const parts = id.split('.');\n const _adapter = `system.adapter.${parts[0]}.${parts[1]}`;\n if (objects[_adapter]?.common?.subscribable) {\n const a = `${parts[0]}.${parts[1]}`;\n const alive = `system.adapter.${a}.alive`;\n context.adapterSubs[alive] = context.adapterSubs[alive] || [];\n context.adapterSubs[alive].push(id);\n if (sandbox.verbose) {\n sandbox.log(`adapterSubscribe: ${a} - ${id}`, 'info');\n }\n adapter.sendTo(a, 'subscribe', id);\n }\n },\n adapterUnsubscribe: function (\n idOrObject: string | SubscriptionResult | (string | SubscriptionResult)[],\n ): boolean | boolean[] {\n // todo: BF - it could be an error\n return sandbox.unsubscribe(idOrObject);\n },\n unsubscribe: function (\n idOrObject: string | SubscriptionResult | (string | SubscriptionResult)[],\n ): boolean | boolean[] {\n if (idOrObject && Array.isArray(idOrObject)) {\n const result: boolean[] = [];\n for (let t = 0; t < idOrObject.length; t++) {\n result.push(sandbox.unsubscribe(idOrObject[t]) as boolean);\n }\n return result;\n }\n\n if (sandbox.verbose) {\n sandbox.log(`adapterUnsubscribe(id=${JSON.stringify(idOrObject)})`, 'info');\n }\n\n if (isObject(idOrObject)) {\n for (let i = context.subscriptions.length - 1; i >= 0; i--) {\n if (context.subscriptions[i] === idOrObject) {\n unsubscribePattern(script, context.subscriptions[i].pattern.id as string);\n context.subscriptions.splice(i, 1);\n sandbox.__engine.__subscriptions--;\n return true;\n }\n }\n return false;\n }\n let deleted = 0;\n for (let i = context.subscriptions.length - 1; i >= 0; i--) {\n if (context.subscriptions[i].name === name && context.subscriptions[i].pattern.id === idOrObject) {\n deleted++;\n unsubscribePattern(script, context.subscriptions[i].pattern.id as string);\n context.subscriptions.splice(i, 1);\n sandbox.__engine.__subscriptions--;\n }\n }\n return !!deleted;\n },\n on: function (\n pattern:\n | TimeRule\n | AstroRule\n | Pattern\n | SchedulerRule\n | string\n | (TimeRule | AstroRule | Pattern | SchedulerRule | string)[],\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n callbackOrChangeTypeOrId: string | ChangeType | ((event?: EventObj) => void),\n value?: any,\n ):\n | SubscriptionResult\n | IobSchedule\n | string\n | null\n | undefined\n | (SubscriptionResult | IobSchedule | string | null | undefined)[] {\n return sandbox.subscribe(pattern, callbackOrChangeTypeOrId, value);\n },\n onEnumMembers: function (enumId: string, callback: (event?: EventObj) => void): void {\n if (enums.includes(enumId)) {\n const subscriptions: Record = {};\n\n const init = (): void => {\n const obj: ioBroker.EnumObject = objects[enumId] as ioBroker.EnumObject;\n const common: ioBroker.EnumCommon = obj?.common ?? {};\n const members: string[] = common?.members ?? [];\n\n // Remove old subscriptions\n for (const [objId, subscription] of Object.entries(subscriptions)) {\n if (!members.includes(objId)) {\n sandbox.unsubscribe(subscription);\n delete subscriptions[objId];\n }\n }\n\n // Subscribe to all members of enum\n for (const objId of members) {\n if (!Object.keys(subscriptions).includes(objId)) {\n if (objects?.[objId]?.type === 'state') {\n // Just subscribe to states\n subscriptions[objId] = sandbox.subscribe(objId, callback) as\n | string\n | SubscriptionResult; // TODO: more features\n }\n }\n }\n\n sandbox.verbose &&\n sandbox.log(\n `onEnumMembers(id=${enumId}, members=${JSON.stringify(Object.keys(subscriptions))})`,\n 'info',\n );\n };\n\n init();\n\n sandbox.subscribeObject(enumId, obj => obj && init());\n } else {\n sandbox.log(`onEnumMembers: enum with id \"${enumId}\" doesn't exists`, 'error');\n }\n },\n onFile: function (\n id: string,\n fileNamePattern: string | string[],\n withFileOrCallback:\n | boolean\n | ((id: string, fileName: string, size: number, file?: string | Buffer, mimeType?: string) => void),\n callback?: (\n id: string,\n fileName: string,\n size: number | null,\n file?: string | Buffer,\n mimeType?: string,\n ) => void,\n ): undefined | FileSubscriptionResult | (undefined | FileSubscriptionResult)[] {\n if (typeof withFileOrCallback === 'function') {\n callback = withFileOrCallback as (\n id: string,\n fileName: string,\n size: number | null,\n file?: string | Buffer,\n mimeType?: string,\n ) => void;\n withFileOrCallback = false;\n }\n\n if (!adapter.subscribeForeignFiles) {\n sandbox.log(\n 'onFile: your js-controller does not support yet onFile subscribes. Please update to js-controller@4.1.x or newer',\n 'warn',\n );\n return;\n }\n if (!id || !fileNamePattern) {\n sandbox.log(\n 'onFile: invalid parameters. Usage: onFile(\"vis.0\", \"main/*\", true, (id, fileName, size, file, mimeType) => {});',\n 'error',\n );\n return;\n }\n if (typeof callback !== 'function') {\n sandbox.offFile(id, fileNamePattern);\n return;\n }\n\n if (Array.isArray(fileNamePattern)) {\n return fileNamePattern.map(\n filePattern =>\n sandbox.onFile(id, filePattern, withFileOrCallback, callback) as\n | undefined\n | FileSubscriptionResult,\n );\n }\n\n sandbox.__engine.__subscriptionsFile += 1;\n\n sandbox.verbose &&\n sandbox.log(\n `onFile(id=${id}, fileNamePattern=${fileNamePattern}) - fileSubscriptions=${sandbox.__engine.__subscriptionsFile}`,\n 'info',\n );\n\n if (\n sandbox.__engine.__subscriptionsFile %\n (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__subscriptionsFile} file subscriptions registered. Check your script!`,\n 'warn',\n );\n }\n\n let idRegEx: RegExp | undefined;\n let fileRegEx: RegExp | undefined;\n if (id.includes('*')) {\n idRegEx = new RegExp(pattern2RegEx(id));\n }\n if (fileNamePattern.includes('*')) {\n fileRegEx = new RegExp(pattern2RegEx(fileNamePattern));\n }\n\n const subs: FileSubscriptionResult = {\n id,\n fileNamePattern,\n withFile: withFileOrCallback,\n idRegEx,\n fileRegEx,\n callback: (id: string, fileName: string, size: number | null, withFile: boolean): void => {\n try {\n sandbox.verbose &&\n sandbox.log(`onFile changed(id=${id}, fileName=${fileName}, size=${size})`, 'info');\n\n if (withFile && (size || 0) > 0) {\n adapter\n .readFileAsync(id, fileName)\n .then(data => {\n try {\n callback.call(sandbox, id, fileName, size, data.file, data.mimeType);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n })\n .catch(error => errorInCallback(error));\n } else {\n callback.call(sandbox, id, fileName, size);\n }\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n },\n name,\n };\n\n context.subscriptionsFile.push(subs);\n subscribeFile(script, id, fileNamePattern);\n return subs;\n },\n offFile: function (\n idOrObject: FileSubscriptionResult | string | (FileSubscriptionResult | string)[],\n fileNamePattern?: string | string[],\n ): boolean | boolean[] {\n if (!adapter.unsubscribeForeignFiles) {\n sandbox.log(\n 'offFile: your js-controller does not support yet file unsubscribes. Please update to js-controller@4.1.x or newer',\n 'warn',\n );\n return false;\n }\n\n sandbox.verbose &&\n sandbox.log(\n `offFile(idOrObject=${JSON.stringify(idOrObject)}, fileNamePattern=${JSON.stringify(fileNamePattern)}) - fileSubscriptions=${sandbox.__engine.__subscriptionsFile}`,\n 'info',\n );\n\n if (idOrObject && typeof idOrObject === 'object') {\n if (Array.isArray(idOrObject)) {\n const result: boolean[] = [];\n for (let t = 0; t < idOrObject.length; t++) {\n result.push(sandbox.offFile(idOrObject[t]) as boolean);\n }\n return result;\n }\n for (let i = context.subscriptionsFile.length - 1; i >= 0; i--) {\n if (context.subscriptionsFile[i] === idOrObject) {\n unsubscribeFile(\n script,\n context.subscriptionsFile[i].id,\n context.subscriptionsFile[i].fileNamePattern,\n );\n\n sandbox.verbose &&\n sandbox.log(\n `offFile(type=object, fileNamePattern=${JSON.stringify(fileNamePattern)}, removing id=${context.subscriptionsFile[i].id})`,\n 'info',\n );\n\n context.subscriptionsFile.splice(i, 1);\n sandbox.__engine.__subscriptionsFile--;\n return true;\n }\n }\n return false;\n }\n\n if (fileNamePattern && Array.isArray(fileNamePattern)) {\n const result: boolean[] = [];\n for (let t = 0; t < fileNamePattern.length; t++) {\n result.push(sandbox.offFile(idOrObject, fileNamePattern[t]) as boolean);\n }\n return result;\n }\n\n let deleted = 0;\n for (let i = context.subscriptionsFile.length - 1; i >= 0; i--) {\n if (\n context.subscriptionsFile[i].id === idOrObject &&\n context.subscriptionsFile[i].fileNamePattern === fileNamePattern\n ) {\n deleted++;\n unsubscribeFile(\n script,\n context.subscriptionsFile[i].id,\n context.subscriptionsFile[i].fileNamePattern,\n );\n\n sandbox.verbose &&\n sandbox.log(\n `offFile(type=string, fileNamePattern=${fileNamePattern}, removing id=${context.subscriptionsFile[i].id})`,\n 'info',\n );\n\n context.subscriptionsFile.splice(i, 1);\n sandbox.__engine.__subscriptionsFile--;\n }\n }\n return !!deleted;\n },\n /** Registers a one-time subscription which automatically unsubscribes after the first invocation */\n once: function (\n pattern:\n | TimeRule\n | AstroRule\n | Pattern\n | SchedulerRule\n | string\n | (TimeRule | AstroRule | Pattern | SchedulerRule | string)[],\n callback?: (event?: EventObj) => void,\n ): string | SubscriptionResult | Promise {\n function _once(cb: (obj?: EventObj) => void): string | SubscriptionResult {\n // eslint-disable-next-line prefer-const\n let subscription: string | SubscriptionResult;\n const handler = (obj?: EventObj): void => {\n subscription && sandbox.unsubscribe(subscription);\n typeof cb === 'function' && cb(obj);\n };\n subscription = sandbox.subscribe(pattern, handler) as string | SubscriptionResult;\n return subscription;\n }\n if (typeof callback === 'function') {\n // Callback-style: once(\"id\", (obj) => { ... })\n return _once(callback);\n }\n\n // Promise-style: once(\"id\").then(obj => { ... })\n return new Promise(resolve => _once(resolve));\n },\n schedule: function (\n pattern: SchedulerRule | AstroRule | Date | string,\n callback: () => void,\n ): IobSchedule | string | null | undefined {\n if (typeof callback !== 'function') {\n sandbox.log(`schedule callback missing`, 'error');\n return null;\n }\n\n if (\n (typeof pattern === 'string' && pattern[0] === '{') ||\n (typeof pattern === 'object' && (pattern as SchedulerRule).period)\n ) {\n sandbox.verbose &&\n sandbox.log(\n `schedule(wizard=${typeof pattern === 'object' ? JSON.stringify(pattern) : pattern})`,\n 'info',\n );\n\n if (!context.scheduler) {\n sandbox.log(\n `Cannot schedule \"${typeof pattern === 'object' ? JSON.stringify(pattern) : pattern}\" because scheduler is not available`,\n 'error',\n );\n return null;\n }\n\n const schedule: string | null = context.scheduler.add(\n pattern as SchedulerRule | string,\n sandbox.scriptName,\n callback,\n );\n if (schedule) {\n script.wizards.push(schedule);\n sandbox.__engine.__schedules += 1;\n\n if (\n sandbox.__engine.__schedules %\n (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__schedules} schedules registered. Check your script!`,\n 'warn',\n );\n }\n }\n\n return schedule;\n }\n\n const adapterConfig: JavaScriptAdapterConfig = adapter.config as JavaScriptAdapterConfig;\n\n if (typeof pattern === 'object' && (pattern as AstroRule).astro) {\n const astroPattern = pattern as AstroRule;\n const nowDate = new Date();\n\n if (\n adapterConfig.latitude === undefined ||\n adapterConfig.longitude === undefined ||\n adapterConfig.latitude === null ||\n adapterConfig.longitude === null\n ) {\n sandbox.log('Longitude or latitude does not set. Cannot use astro.', 'error');\n return null;\n }\n\n // ensure events are calculated independent of current time\n // TODO: use getAstroStartOfDay of adapter?\n const todayNoon = new Date(nowDate);\n todayNoon.setHours(12, 0, 0, 0);\n let ts = mods.suncalc.getTimes(todayNoon, adapterConfig.latitude, adapterConfig.longitude)[\n astroPattern.astro\n ];\n\n // event on the next day, correct or force recalculation at midnight\n if (todayNoon.getDate() !== ts.getDate()) {\n todayNoon.setDate(todayNoon.getDate() - 1);\n ts = mods.suncalc.getTimes(todayNoon, adapterConfig.latitude, adapterConfig.longitude)[\n astroPattern.astro\n ];\n }\n\n if (ts.getTime().toString() === 'NaN') {\n sandbox.log(\n `Cannot calculate \"${astroPattern.astro}\" for ${adapterConfig.latitude}, ${adapterConfig.longitude}`,\n 'warn',\n );\n ts = new Date(nowDate.getTime());\n\n if (\n astroPattern.astro === 'sunriseEnd' ||\n astroPattern.astro === 'goldenHourEnd' ||\n astroPattern.astro === 'sunset' ||\n astroPattern.astro === 'nightEnd' ||\n astroPattern.astro === 'nauticalDusk'\n ) {\n ts.setHours(23);\n ts.setMinutes(59);\n ts.setSeconds(59);\n } else {\n ts.setHours(23);\n ts.setMinutes(59);\n ts.setSeconds(58);\n }\n }\n\n if (ts && astroPattern.shift) {\n ts = new Date(ts.getTime() + astroPattern.shift * 60000);\n }\n\n if (!ts || ts < nowDate) {\n const date = new Date(nowDate);\n // Event doesn't occur today - try again tomorrow\n // Calculate time till 24:00 (local, NOT UTC) and set timeout\n date.setDate(date.getDate() + 1);\n date.setMinutes(0); // Sometimes timer fires at 23:59:59\n date.setHours(0);\n date.setSeconds(1);\n date.setMilliseconds(0);\n\n sandbox.__engine.__schedules += 1;\n\n if (sandbox.__engine.__schedules % adapterConfig.maxTriggersPerScript === 0) {\n sandbox.log(\n `More than ${sandbox.__engine.__schedules} schedules registered. Check your script!`,\n 'warn',\n );\n }\n\n sandbox.verbose &&\n sandbox.log(\n `schedule(astro=${astroPattern.astro}, offset=${astroPattern.shift}) is tomorrow, waiting until ${date.toISOString()}`,\n 'info',\n );\n\n // Calculate new schedule in the next day\n sandbox.setTimeout(() => {\n if (sandbox.__engine.__schedules > 0) {\n sandbox.__engine.__schedules--;\n }\n sandbox.schedule(astroPattern, callback);\n }, date.getTime() - Date.now());\n\n return;\n }\n\n sandbox.__engine.__schedules += 1;\n\n if (sandbox.__engine.__schedules % adapterConfig.maxTriggersPerScript === 0) {\n sandbox.log(\n `More than ${sandbox.__engine.__schedules} schedules registered. Check your script!`,\n 'warn',\n );\n }\n\n sandbox.setTimeout(() => {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n // Reschedule in 2 seconds\n sandbox.setTimeout(() => {\n if (sandbox.__engine.__schedules > 0) {\n sandbox.__engine.__schedules--;\n }\n sandbox.schedule(astroPattern, callback);\n }, 2000);\n }, ts.getTime() - Date.now());\n\n sandbox.verbose &&\n sandbox.log(\n `schedule(astro=${astroPattern.astro}, offset=${astroPattern.shift}) is today, waiting until ${ts.toISOString()}`,\n 'info',\n );\n } else {\n // fix a problem with sunday and 7\n if (typeof pattern === 'string') {\n // this could be a CRON\n const parts = pattern.replace(/\\s+/g, ' ').split(' ');\n if (parts.length >= 5 && parseInt(parts[5], 10) >= 7) {\n parts[5] = '0';\n }\n pattern = parts.join(' ');\n }\n // created in VM the date object: pattern instanceof Date => false\n // so fix it\n if (typeof pattern === 'object' && (pattern as Date).getDate) {\n pattern = new Date(pattern as Date);\n }\n\n const schedule: IobSchedule = mods.nodeSchedule.scheduleJob(pattern, (): void => {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n });\n if (schedule) {\n sandbox.__engine.__schedules += 1;\n\n if (\n sandbox.__engine.__schedules %\n (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__schedules} schedules registered. Check your script!`,\n 'warn',\n );\n }\n\n schedule._ioBroker = {\n type: 'cron',\n pattern: pattern as string | Date,\n scriptName: sandbox.scriptName,\n id: `cron_${Date.now()}_${Math.round(Math.random() * 100000)}`,\n };\n\n script.schedules.push(schedule);\n } else {\n sandbox.log(`schedule(cron=${JSON.stringify(pattern)}): cannot create schedule`, 'error');\n }\n\n if (sandbox.verbose) {\n sandbox.log(`schedule(cron=${JSON.stringify(pattern)})`, 'info');\n }\n\n return schedule;\n }\n },\n scheduleById: function (id: string, ack: boolean | (() => void) | undefined, callback?: () => void): void {\n let scheduleId: IobSchedule | string | null | undefined = null;\n let currentExp: string | null = null; // current cron expression\n\n if (typeof ack === 'function') {\n callback = ack;\n ack = undefined;\n }\n\n const rhms = /^(2[0-3]|[01]?[0-9]):([0-5]?[0-9]):([0-5]?[0-9])$/; // hh:mm:ss\n const rhm = /^(2[0-3]|[01]?[0-9]):([0-5]?[0-9])$/; // hh:mm\n\n const init = (time: string): void => {\n if (typeof time === 'string') {\n let h: number | undefined = undefined;\n let m: number | undefined = undefined;\n let s: number | undefined = undefined;\n\n let isValid = false;\n\n let result = time.match(rhms);\n if (result) {\n [, h, m, s] = result.map(v => parseInt(v));\n isValid = true;\n } else {\n result = time.match(rhm);\n if (result) {\n [, h, m] = result.map(v => parseInt(v));\n isValid = true;\n }\n }\n\n if (isValid) {\n const cronExp = `${s ?? '0'} ${m ?? '0'} ${h ?? '0'} * * *`;\n\n if (cronExp !== currentExp) {\n sandbox.verbose &&\n sandbox.log(\n `scheduleById(id=${id}): Init with expression ${cronExp} from ${time}`,\n 'info',\n );\n currentExp = cronExp;\n\n if (scheduleId) {\n sandbox.clearSchedule(scheduleId);\n scheduleId = null;\n }\n\n scheduleId = sandbox.schedule(cronExp, () => {\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n });\n }\n } else {\n sandbox.log(\n `scheduleById(id=${id},time=${time}): cannot create schedule - invalid format (HH:MM:SS or H:M:S required)`,\n 'error',\n );\n }\n } else {\n sandbox.log(\n `scheduleById(id=${id}): cannot create schedule - invalid var type (no string)`,\n 'error',\n );\n }\n };\n\n sandbox.getState(id, (err, state) => {\n if (!err && state?.val) {\n if (sandbox.verbose) {\n sandbox.log(`scheduleById(id=${id}): Init with value ${state.val}`, 'info');\n }\n init(state.val.toString());\n }\n });\n\n const triggerDef: Pattern = { id, change: 'any' };\n if (ack !== undefined) {\n triggerDef.ack = ack;\n }\n\n sandbox.on(triggerDef, obj => {\n if (obj?.state?.val) {\n sandbox.verbose &&\n sandbox.log(`scheduleById(id=${id}): Update with value ${obj.state.val}`, 'info');\n init(obj.state.val.toString());\n }\n });\n },\n getAstroDate: function (pattern: AstroEvent, date?: Date | number, offsetMinutes?: number): Date | undefined {\n if (date === undefined) {\n date = new Date();\n }\n if (typeof date === 'number') {\n date = new Date(date);\n } else {\n date = new Date(date.getTime());\n }\n\n if (!consts.astroList.includes(pattern)) {\n const pos = consts.astroListLow.indexOf(pattern.toLowerCase());\n if (pos !== -1) {\n pattern = consts.astroList[pos];\n }\n }\n\n if (\n (!(adapter.config as JavaScriptAdapterConfig).latitude &&\n ((adapter.config as JavaScriptAdapterConfig).latitude as unknown as number) !== 0) ||\n (!(adapter.config as JavaScriptAdapterConfig).longitude &&\n ((adapter.config as JavaScriptAdapterConfig).longitude as unknown as number) !== 0)\n ) {\n sandbox.log('Longitude or latitude does not set. Cannot use astro.', 'error');\n return;\n }\n\n // ensure events are calculated independent of current time\n date.setHours(12, 0, 0, 0);\n let ts = mods.suncalc.getTimes(\n date,\n (adapter.config as JavaScriptAdapterConfig).latitude,\n (adapter.config as JavaScriptAdapterConfig).longitude,\n )[pattern];\n\n if (ts === undefined || ts.getTime().toString() === 'NaN') {\n sandbox.log(\n `Cannot calculate astro date \"${pattern}\" for ${(adapter.config as JavaScriptAdapterConfig).latitude}, ${(adapter.config as JavaScriptAdapterConfig).longitude}`,\n 'warn',\n );\n }\n\n if (sandbox.verbose) {\n sandbox.log(`getAstroDate(pattern=${pattern}, date=${date.toString()}) => ${ts}`, 'info');\n }\n\n if (offsetMinutes !== undefined) {\n ts = new Date(ts.getTime() + offsetMinutes * 60000);\n }\n return ts;\n },\n isAstroDay: function (): boolean | undefined {\n const nowDate = new Date();\n const dayBegin = sandbox.getAstroDate('sunrise');\n const dayEnd = sandbox.getAstroDate('sunset');\n\n if (dayBegin === undefined || dayEnd === undefined) {\n return;\n }\n\n if (sandbox.verbose) {\n sandbox.log(`isAstroDay() => ${nowDate >= dayBegin && nowDate <= dayEnd}`, 'info');\n }\n\n return nowDate >= dayBegin && nowDate <= dayEnd;\n },\n clearSchedule: function (schedule: IobSchedule | ScheduleName | string): boolean {\n if (context.scheduler?.get(schedule as string | ScheduleName)) {\n if (sandbox.verbose) {\n sandbox.log('clearSchedule() => wizard cleared', 'info');\n }\n const pos = script.wizards.indexOf(schedule as string);\n if (pos !== -1) {\n script.wizards.splice(pos, 1);\n if (sandbox.__engine.__schedules > 0) {\n sandbox.__engine.__schedules--;\n }\n }\n context.scheduler.remove(schedule as string | ScheduleName);\n return true;\n }\n for (let i = 0; i < script.schedules.length; i++) {\n if (schedule && typeof schedule === 'object' && (schedule as IobSchedule)._ioBroker?.type === 'cron') {\n if (script.schedules[i]._ioBroker.id === (schedule as IobSchedule)._ioBroker.id) {\n if (!mods.nodeSchedule.cancelJob(script.schedules[i])) {\n sandbox.log('Error by canceling scheduled job', 'error');\n }\n script.schedules.splice(i, 1);\n if (sandbox.__engine.__schedules > 0) {\n sandbox.__engine.__schedules--;\n }\n\n if (sandbox.verbose) {\n sandbox.log('clearSchedule() => cleared', 'info');\n }\n return true;\n }\n } else if (script.schedules[i] === schedule) {\n if (!mods.nodeSchedule.cancelJob(script.schedules[i])) {\n sandbox.log('Error by canceling scheduled job', 'error');\n }\n script.schedules.splice(i, 1);\n if (sandbox.__engine.__schedules > 0) {\n sandbox.__engine.__schedules--;\n }\n\n if (sandbox.verbose) {\n sandbox.log('clearSchedule() => cleared', 'info');\n }\n return true;\n }\n }\n\n if (sandbox.verbose) {\n sandbox.log('clearSchedule() => invalid handler', 'warn');\n }\n return false;\n },\n getSchedules: function (allScripts?: boolean): ScheduleName[] {\n const schedules = context.scheduler?.getList() || [];\n if (allScripts) {\n Object.keys(context.scripts).forEach(\n name =>\n context.scripts[name].schedules &&\n context.scripts[name].schedules.forEach(s =>\n schedules.push(JSON.parse(JSON.stringify(s._ioBroker))),\n ),\n );\n } else {\n script.schedules &&\n script.schedules.forEach(s => schedules.push(JSON.parse(JSON.stringify(s._ioBroker))));\n }\n return schedules;\n },\n setState: function (\n id: string,\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean | 'true' | 'false' | ((err?: Error | null) => void),\n callback?: (err?: Error | null) => void,\n ): void {\n return setStateHelper(sandbox, false, false, id, state, isAck, callback);\n },\n setStateChanged: function (\n id: string,\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean | ((err?: Error | null) => void),\n callback?: (err?: Error | null) => void,\n ): void {\n return setStateHelper(sandbox, false, true, id, state, isAck, callback);\n },\n setStateDelayed: function (\n id: string,\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck: boolean | number | undefined,\n delay?: number | boolean,\n clearRunning?: boolean | ((err?: Error | null) => void),\n callback?: (err?: Error | null) => void,\n ): number | null {\n // find arguments\n if (typeof isAck !== 'boolean') {\n callback = clearRunning as (err?: Error | null) => void;\n clearRunning = delay as boolean;\n delay = isAck as number;\n isAck = undefined;\n }\n if (typeof delay !== 'number') {\n callback = clearRunning as (err?: Error | null) => void;\n clearRunning = delay as boolean;\n delay = 0;\n }\n if (typeof clearRunning !== 'boolean') {\n callback = clearRunning;\n clearRunning = true;\n }\n\n // Check a type of state\n if (!objects[id] && objects[`${adapter.namespace}.${id}`]) {\n id = `${adapter.namespace}.${id}`;\n }\n\n sandbox.verbose &&\n sandbox.log(\n `setStateDelayed(id=${id}, state=${JSON.stringify(state)}, isAck=${isAck}, delay=${delay}, clearRunning=${clearRunning})`,\n 'info',\n );\n\n if (clearRunning) {\n if (timers[id]) {\n sandbox.verbose &&\n sandbox.log(`setStateDelayed: clear ${timers[id].length} running timers`, 'info');\n\n for (let i = 0; i < timers[id].length; i++) {\n clearTimeout(timers[id][i].t);\n }\n delete timers[id];\n } else {\n if (sandbox.verbose) {\n sandbox.log('setStateDelayed: no running timers', 'info');\n }\n }\n }\n // If no delay => starts immediately\n if (!delay) {\n sandbox.setState(id, state, isAck, callback);\n return null;\n }\n // If delay\n timers[id] = timers[id] || [];\n\n // calculate timerId\n context.timerId++;\n if (context.timerId > 0xfffffffe) {\n context.timerId = 0;\n }\n\n // Start timeout\n const timer = setTimeout(\n function (_timerId, _id, _state, _isAck) {\n sandbox.setState(_id, _state, _isAck, callback);\n // delete timer handler\n if (timers[_id]) {\n // optimisation\n if (timers[_id].length === 1) {\n delete timers[_id];\n } else {\n for (let t = 0; t < timers[_id].length; t++) {\n if (timers[_id][t].id === _timerId) {\n timers[_id].splice(t, 1);\n break;\n }\n }\n if (!timers[_id].length) {\n delete timers[_id];\n }\n }\n }\n },\n delay,\n context.timerId,\n id,\n state,\n isAck,\n );\n\n // add timer handler\n timers[id].push({\n t: timer,\n id: context.timerId,\n ts: Date.now(),\n delay: delay,\n val:\n isObject(state) && (state as ioBroker.SettableState).val !== undefined\n ? ((state as ioBroker.SettableState).val as ioBroker.StateValue)\n : (state as ioBroker.StateValue),\n ack:\n isObject(state) &&\n (state as ioBroker.SettableState).val !== undefined &&\n (state as ioBroker.SettableState).ack !== undefined\n ? (state as ioBroker.SettableState).ack\n : isAck,\n scriptName: name,\n });\n\n return context.timerId;\n },\n clearStateDelayed: function (id: string, timerId: number): boolean {\n // Check a type of state\n if (!objects[id] && objects[`${adapter.namespace}.${id}`]) {\n id = `${adapter.namespace}.${id}`;\n }\n\n if (sandbox.verbose) {\n sandbox.log(`clearStateDelayed(id=${id}, timerId=${timerId})`, 'info');\n }\n\n if (timers[id]) {\n for (let i = timers[id].length - 1; i >= 0; i--) {\n if (timerId === undefined || timers[id][i].id === timerId) {\n clearTimeout(timers[id][i].t);\n if (timerId !== undefined) {\n timers[id].splice(i, 1);\n }\n if (sandbox.verbose) {\n sandbox.log(`clearStateDelayed: clear timer ${timers[id][i].id}`, 'info');\n }\n }\n }\n if (timerId === undefined) {\n delete timers[id];\n } else {\n if (!timers[id].length) {\n delete timers[id];\n }\n }\n return true;\n }\n return false;\n },\n getStateDelayed: function (\n id: string | number,\n ):\n | null\n | { timerId: number; left: number; delay: number; val: ioBroker.StateValue; ack?: boolean }\n | { timerId: number; left: number; delay: number; val: ioBroker.StateValue; ack?: boolean }[]\n | Record<\n string,\n { timerId: number; left: number; delay: number; val: ioBroker.StateValue; ack?: boolean }[]\n > {\n const now = Date.now();\n if (id) {\n // Check a type of state\n if (!objects[id] && objects[`${adapter.namespace}.${id}`]) {\n id = `${adapter.namespace}.${id}`;\n }\n // If timerId given\n if (typeof id === 'number') {\n for (const _id_ in timers) {\n if (Object.prototype.hasOwnProperty.call(timers, _id_)) {\n for (let ttt = 0; ttt < timers[_id_].length; ttt++) {\n if (timers[_id_][ttt].id === id) {\n return {\n timerId: id,\n left: timers[_id_][ttt].delay - (now - timers[_id_][ttt].ts),\n delay: timers[_id_][ttt].delay,\n val: timers[_id_][ttt].val,\n ack: timers[_id_][ttt].ack,\n };\n }\n }\n }\n }\n return null;\n }\n\n const result: {\n timerId: number;\n left: number;\n delay: number;\n val: ioBroker.StateValue;\n ack?: boolean;\n }[] = [];\n if (Object.prototype.hasOwnProperty.call(timers, id) && timers[id] && timers[id].length) {\n for (let tt = 0; tt < timers[id].length; tt++) {\n result.push({\n timerId: timers[id][tt].id,\n left: timers[id][tt].delay - (now - timers[id][tt].ts),\n delay: timers[id][tt].delay,\n val: timers[id][tt].val,\n ack: timers[id][tt].ack,\n });\n }\n }\n return result;\n }\n const result: Record<\n string,\n { timerId: number; left: number; delay: number; val: ioBroker.StateValue; ack?: boolean }[]\n > = {};\n for (const _id in timers) {\n if (Object.prototype.hasOwnProperty.call(timers, _id) && timers[_id] && timers[_id].length) {\n result[_id] = [];\n for (let t = 0; t < timers[_id].length; t++) {\n result[_id].push({\n timerId: timers[_id][t].id,\n left: timers[_id][t].delay - (now - timers[_id][t].ts),\n delay: timers[_id][t].delay,\n val: timers[_id][t].val,\n ack: timers[_id][t].ack,\n });\n }\n }\n }\n return result;\n },\n getStateAsync: async function (id: string): Promise {\n let state: ioBroker.State | null | undefined;\n if (id.includes('.')) {\n state = await adapter.getForeignStateAsync(id);\n } else {\n state = await adapter.getStateAsync(id);\n }\n return context.convertBackStringifiedValues(id, state);\n },\n setStateAsync: function (\n id: string,\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean,\n ): Promise {\n return new Promise((resolve, reject) =>\n setStateHelper(sandbox, false, false, id, state, isAck, err => (err ? reject(err) : resolve())),\n );\n },\n setStateChangedAsync: function (\n id: string,\n state: ioBroker.SettableState | ioBroker.StateValue,\n isAck?: boolean,\n ): Promise {\n return new Promise((resolve, reject) =>\n setStateHelper(sandbox, false, true, id, state, isAck, err => (err ? reject(err) : resolve())),\n );\n },\n getState: function (\n id: string,\n callback?: (err: Error | null | undefined, state?: ioBroker.State | null) => void,\n ): undefined | void | (ioBroker.State & { notExist?: true }) | null {\n if (typeof id !== 'string') {\n sandbox.log(`getState has been called with id of type \"${typeof id}\" but expects a string`, 'error');\n return undefined;\n }\n\n if (typeof callback === 'function') {\n if (!id.includes('.')) {\n adapter.getState(id, (err, state) =>\n callback(err, context.convertBackStringifiedValues(id, state)),\n );\n } else {\n void adapter.getForeignState(id, (err, state) =>\n callback(err, context.convertBackStringifiedValues(id, state)),\n );\n }\n } else {\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n sandbox.log(\n 'The \"getState\" method cannot be used synchronously, because the adapter setting \"Do not subscribe to all states on start\" is enabled.',\n 'error',\n );\n sandbox.log(\n `Please disable that setting or use \"getState\" with a callback, e.g.: getState('${id}', (err, state) => { ... });`,\n 'error',\n );\n } else {\n if (states[id]) {\n sandbox.verbose &&\n sandbox.log(\n `getState(id=${id}, timerId=${JSON.stringify(timers[id])}) => ${JSON.stringify(states[id])}`,\n 'info',\n );\n if (context.interimStateValues[id] !== undefined) {\n return context.convertBackStringifiedValues(id, context.interimStateValues[id]);\n }\n return context.convertBackStringifiedValues(id, states[id]);\n } else if (states[`${adapter.namespace}.${id}`]) {\n sandbox.verbose &&\n sandbox.log(\n `getState(id=${id}, timerId=${JSON.stringify(timers[id])}) => ${JSON.stringify(states[`${adapter.namespace}.${id}`])}`,\n 'info',\n );\n if (context.interimStateValues[`${adapter.namespace}.${id}`] !== undefined) {\n return context.convertBackStringifiedValues(\n id,\n context.interimStateValues[`${adapter.namespace}.${id}`],\n );\n }\n return context.convertBackStringifiedValues(id, states[`${adapter.namespace}.${id}`]);\n }\n\n if (sandbox.verbose) {\n sandbox.log(`getState(id=${id}, timerId=${JSON.stringify(timers[id])}) => not found`, 'info');\n }\n\n context.logWithLineInfo(\n `getState \"${id}\" not found (3)${states[id] !== undefined ? ` states[id]=${JSON.stringify(states[id])}` : ''}`,\n ); ///xxx\n return { val: null, notExist: true } as ioBroker.State & { notExist?: true };\n }\n }\n },\n existsState: function (\n id: string,\n callback?: (err: Error | null | undefined, stateExists?: boolean) => void,\n ): void | boolean {\n if (typeof id !== 'string') {\n sandbox.log(`existsState has been called with id of type \"${typeof id}\" but expects a string`, 'error');\n return false;\n }\n\n if (typeof callback === 'function') {\n void adapter.getForeignObject(id, (err, obj) => {\n if (!obj || obj.type !== 'state') {\n callback(err, false);\n return;\n }\n\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n void adapter.getForeignState(id, (err, state) => {\n callback(err, !!state);\n });\n } else {\n callback(err, !!states[id]);\n }\n });\n } else {\n if ((adapter.config as JavaScriptAdapterConfig).subscribe) {\n sandbox.log(\n 'The \"existsState\" method cannot be used synchronously, because the adapter setting \"Do not subscribe to all states on start\" is enabled.',\n 'error',\n );\n sandbox.log(\n `Please disable that setting or use \"existsState\" with a callback, e.g.: existsState('${id}', (err, stateExists) => { ... });`,\n 'error',\n );\n } else {\n return !!states[id];\n }\n }\n },\n existsObject: function (\n id: string,\n callback?: (err: Error | null | undefined, objectExists?: boolean) => void,\n ): void | boolean {\n if (typeof id !== 'string') {\n sandbox.log(\n `existsObject has been called with id of type \"${typeof id}\" but expects a string`,\n 'error',\n );\n return false;\n }\n\n if (typeof callback === 'function') {\n void adapter.getForeignObject(id, (err, obj) => callback(err, !!obj));\n } else {\n return !!objects[id];\n }\n },\n getIdByName: function (name: string, alwaysArray?: boolean): string | string[] | null {\n sandbox.verbose &&\n sandbox.log(\n `getIdByName(name=${name}, alwaysArray=${alwaysArray}) => ${JSON.stringify(context.names[name])}`,\n 'info',\n );\n if (Object.prototype.hasOwnProperty.call(context.names, name)) {\n if (alwaysArray) {\n return !Array.isArray(context.names[name]) ? [context.names[name]] : context.names[name];\n }\n return context.names[name];\n }\n if (alwaysArray) {\n return [];\n }\n return null;\n },\n getObject: function (\n id: string,\n enumName: null | string | ((err: Error | null | undefined, obj?: ioBroker.Object | null) => void),\n cb?: (err: Error | null | undefined, obj?: ioBroker.Object | null) => void,\n ): void | ioBroker.Object | null {\n if (typeof id !== 'string') {\n sandbox.log(`getObject has been called with id of type \"${typeof id}\" but expects a string`, 'error');\n return null;\n }\n\n if (typeof enumName === 'function') {\n cb = enumName;\n enumName = null;\n }\n // with callback\n if (typeof cb === 'function') {\n void adapter.getForeignObject(id, (err, obj) => {\n if (obj) {\n objects[id] = obj;\n } else if (objects[id]) {\n delete objects[id];\n }\n let result: ioBroker.Object | null | undefined;\n try {\n result = JSON.parse(JSON.stringify(objects[id]));\n } catch (err: unknown) {\n void adapter.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: true,\n ack: true,\n c: 'getObject',\n });\n sandbox.log(`Object \"${id}\" can't be copied: ${JSON.stringify(err)}`, 'error');\n return cb(null, null);\n }\n sandbox.verbose &&\n sandbox.log(`getObject(id=${id}, enumName=${enumName}) => ${JSON.stringify(result)}`, 'info');\n cb(err, result);\n });\n } else {\n if (!objects[id]) {\n sandbox.verbose &&\n sandbox.log(`getObject(id=${id}, enumName=${enumName}) => does not exist`, 'info');\n sandbox.log(`Object \"${id}\" does not exist`, 'warn');\n return null;\n }\n if (enumName) {\n const e = eventObj.getObjectEnumsSync(context, id);\n const obj = JSON.parse(JSON.stringify(objects[id]));\n obj.enumIds = JSON.parse(JSON.stringify(e.enumIds));\n obj.enumNames = JSON.parse(JSON.stringify(e.enumNames));\n if (typeof enumName === 'string') {\n const r = new RegExp(`^enum\\\\.${enumName}\\\\.`);\n for (let i = obj.enumIds.length - 1; i >= 0; i--) {\n if (!r.test(obj.enumIds[i])) {\n obj.enumIds.splice(i, 1);\n obj.enumNames.splice(i, 1);\n }\n }\n }\n sandbox.verbose &&\n sandbox.log(`getObject(id=${id}, enumName=${enumName}) => ${JSON.stringify(obj)}`, 'info');\n\n return obj;\n }\n let result: ioBroker.Object | null | undefined;\n try {\n result = JSON.parse(JSON.stringify(objects[id]));\n } catch (err: unknown) {\n void adapter.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: true,\n ack: true,\n c: 'getObject',\n });\n sandbox.log(`Object \"${id}\" can't be copied: ${JSON.stringify(err)}`, 'error');\n return null;\n }\n sandbox.verbose &&\n sandbox.log(`getObject(id=${id}, enumName=${enumName}) => ${JSON.stringify(result)}`, 'info');\n return result;\n }\n },\n // This function will be overloaded later if the modification of objects is allowed\n setObject: function (\n _id: string,\n _obj: ioBroker.Object,\n callback?: (err?: Error | null, res?: { id: string }) => void,\n ): void {\n sandbox.log('Function \"setObject\" is not allowed. Use adapter settings to allow it.', 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(\n sandbox,\n new Error('Function \"setObject\" is not allowed. Use adapter settings to allow it.'),\n );\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n },\n // This function will be overloaded later if the modification of objects is allowed\n extendObject: function (\n _id: string,\n _obj: Partial,\n callback?: (err?: Error | null, res?: { id: string }) => void,\n ): void {\n sandbox.log('Function \"extendObject\" is not allowed. Use adapter settings to allow it.', 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(\n sandbox,\n new Error('Function \"extendObject\" is not allowed. Use adapter settings to allow it.'),\n );\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n },\n // This function will be overloaded later if the modification of objects is allowed\n deleteObject: function (\n _id: string,\n _isRecursive?: boolean | ioBroker.ErrorCallback,\n callback?: ioBroker.ErrorCallback,\n ): void {\n if (typeof _isRecursive === 'function') {\n callback = _isRecursive;\n }\n sandbox.log('Function \"deleteObject\" is not allowed. Use adapter settings to allow it.', 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(\n sandbox,\n new Error('Function \"deleteObject\" is not allowed. Use adapter settings to allow it.'),\n );\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n },\n getEnums: function (enumName?: string): { id: string; members: string[]; name: ioBroker.StringOrTranslated }[] {\n const result: { id: string; members: string[]; name: ioBroker.StringOrTranslated }[] = [];\n const r = enumName ? new RegExp(`^enum\\\\.${enumName}\\\\.`) : false;\n for (let i = 0; i < enums.length; i++) {\n if (!r || r.test(enums[i])) {\n const common: ioBroker.EnumCommon =\n (objects[enums[i]] as ioBroker.EnumObject).common || ({} as ioBroker.EnumCommon);\n result.push({\n id: enums[i],\n members: common.members || [],\n name: common.name || '',\n });\n }\n }\n if (sandbox.verbose) {\n sandbox.log(`getEnums(enumName=${enumName}) => ${JSON.stringify(result)}`, 'info');\n }\n return JSON.parse(JSON.stringify(result));\n },\n createAlias: function (\n name: string,\n alias: string | CommonAlias,\n forceCreation: boolean | Partial | ((err: Error | null) => void) | undefined,\n common?: Partial | Record | ((err: Error | null) => void),\n native?: Record | ((err: Error | null) => void),\n callback?: (err: Error | null) => void,\n ) {\n if (typeof native === 'function') {\n callback = native as (err: Error | null) => void;\n native = {};\n }\n if (typeof common === 'function') {\n callback = common as (err: Error | null) => void;\n common = undefined;\n }\n if (typeof forceCreation === 'function') {\n callback = forceCreation as (err: Error | null) => void;\n forceCreation = undefined;\n }\n if (isObject(forceCreation)) {\n native = common;\n common = forceCreation as Partial;\n forceCreation = undefined;\n }\n\n if (typeof name !== 'string') {\n const err = `Wrong type of name \"${typeof name}\". Expected \"string\".`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n\n if (!name) {\n const err = 'Empty ID is not allowed.';\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n\n if (!name.startsWith('alias.0.')) {\n name = `alias.0.${name}`;\n }\n\n const _common: Partial = (common as Partial) || {};\n if (isObject(_common.alias)) {\n // alias already in common, use this\n } else if (\n isObject(alias) &&\n (typeof (alias as CommonAlias).id === 'string' || isObject((alias as CommonAlias).id))\n ) {\n _common.alias = alias as CommonAlias;\n } else if (typeof alias === 'string') {\n _common.alias = { id: alias };\n } else {\n const err = 'Source ID needs to be provided as string or object with id property.';\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n\n let aliasSourceId = '';\n if (_common.alias) {\n aliasSourceId = isObject(_common.alias.id)\n ? (_common.alias.id as { read: string; write: string }).read\n : (_common.alias.id as string);\n if (!objects[aliasSourceId] && objects[`${adapter.namespace}.${aliasSourceId}`]) {\n aliasSourceId = `${adapter.namespace}.${aliasSourceId}`;\n if (isObject(_common.alias.id)) {\n (_common.alias.id as { read: string; write: string }).read = aliasSourceId;\n } else {\n _common.alias.id = aliasSourceId;\n }\n }\n if (\n isObject(_common.alias.id) &&\n (_common.alias.id as { read: string; write: string }).write &&\n !objects[(_common.alias.id as { read: string; write: string }).write] &&\n objects[`${adapter.namespace}.${(_common.alias.id as { read: string; write: string }).write}`]\n ) {\n (_common.alias.id as { read: string; write: string }).write =\n `${adapter.namespace}.${(_common.alias.id as { read: string; write: string }).write}`;\n }\n }\n const obj = objects[aliasSourceId];\n if (!obj) {\n const err = `Alias source object \"${aliasSourceId}\" does not exist.`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n if (obj.type !== 'state') {\n const err = `Alias source object \"${aliasSourceId}\" must be a state object.`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n if (_common.name === undefined) {\n _common.name = obj.common.name || name;\n }\n if (_common.type === undefined && obj.common.type !== undefined) {\n _common.type = obj.common.type;\n }\n if (_common.role === undefined && obj.common.role !== undefined) {\n _common.role = obj.common.role;\n }\n if (_common.min === undefined && obj.common.min !== undefined) {\n _common.min = obj.common.min;\n }\n if (_common.max === undefined && obj.common.max !== undefined) {\n _common.max = obj.common.max;\n }\n if (_common.step === undefined && obj.common.step !== undefined) {\n _common.step = obj.common.step;\n }\n if (_common.unit === undefined && obj.common.unit !== undefined) {\n _common.unit = obj.common.unit;\n }\n if (_common.desc === undefined && obj.common.desc !== undefined) {\n _common.desc = obj.common.desc;\n }\n\n return sandbox.createState(\n name,\n undefined,\n forceCreation as boolean,\n _common,\n native,\n callback as (err?: Error | null) => void,\n );\n },\n createState: async function (\n name: string,\n initValue: undefined | ioBroker.StateValue | ioBroker.State,\n forceCreation:\n | boolean\n | undefined\n | Record\n | Partial\n | ((err: Error | null) => void),\n common?: Partial | ((err: Error | null) => void),\n native?: Record | ((err: Error | null) => void),\n callback?: (error: Error | null | undefined, id?: string) => void,\n ) {\n if (typeof native === 'function') {\n callback = native as (err?: Error | null) => void;\n native = {};\n }\n if (typeof common === 'function') {\n callback = common as (err?: Error | null) => void;\n common = undefined;\n }\n if (typeof initValue === 'function') {\n callback = initValue as (err?: Error | null) => void;\n initValue = undefined;\n }\n if (typeof forceCreation === 'function') {\n callback = forceCreation as (err?: Error | null) => void;\n forceCreation = undefined;\n }\n if (isObject(initValue)) {\n common = initValue as Partial;\n native = forceCreation as Record;\n forceCreation = undefined;\n initValue = undefined;\n }\n if (isObject(forceCreation)) {\n native = common as Record;\n common = forceCreation as Partial;\n forceCreation = undefined;\n }\n\n if (typeof name !== 'string') {\n const err = `Wrong type of name \"${typeof name}\". Expected \"string\".`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n\n if (!name) {\n const err = 'Empty ID is not allowed.';\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n\n const isAlias = name.startsWith('alias.0.');\n\n const _common: ioBroker.StateCommon = (common || {}) as ioBroker.StateCommon;\n _common.name = _common.name || name;\n _common.role = _common.role || 'state';\n _common.type = _common.type || 'mixed';\n if (!isAlias && initValue === undefined) {\n initValue = _common.def;\n }\n\n native = native || {};\n\n // Check min, max and def values for number\n if (_common.type !== undefined && _common.type === 'number') {\n let min = 0;\n let max = 0;\n let def = 0;\n let err: string | undefined;\n if (_common.min !== undefined) {\n min = _common.min;\n if (typeof min !== 'number') {\n min = parseFloat(min);\n if (isNaN(min)) {\n err = `Wrong type of ${name}.common.min`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n _common.min = min;\n }\n }\n if (_common.max !== undefined) {\n max = _common.max;\n if (typeof max !== 'number') {\n max = parseFloat(max);\n if (isNaN(max)) {\n err = `Wrong type of ${name}.common.max`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n _common.max = max;\n }\n }\n\n if (_common.def !== undefined) {\n if (isAlias) {\n delete _common.def;\n } else {\n def = _common.def;\n if (typeof def !== 'number') {\n def = parseFloat(def);\n if (isNaN(def)) {\n err = `Wrong type of ${name}.common.def`;\n sandbox.log(err, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n _common.def = def;\n }\n }\n }\n\n if (_common.min !== undefined && _common.max !== undefined && min > max) {\n _common.max = min;\n _common.min = max;\n }\n if (_common.def !== undefined && _common.min !== undefined && def < min) {\n _common.def = min;\n }\n if (_common.def !== undefined && _common.max !== undefined && def > max) {\n _common.def = max;\n }\n }\n\n if (sandbox.verbose) {\n sandbox.log(\n `createState(name=${name}, initValue=${JSON.stringify(initValue)}, forceCreation=${JSON.stringify(forceCreation)}, common=${JSON.stringify(common)}, native=${JSON.stringify(native)}, isAlias=${isAlias})`,\n 'debug',\n );\n }\n\n let id = `${adapter.namespace}.${name}`;\n if (name.match(/^javascript\\.\\d+\\./) || name.startsWith('0_userdata.0.') || isAlias) {\n id = name;\n }\n if (id.match(/^javascript\\.\\d+\\.scriptEnabled/)) {\n sandbox.log(\n `Own states (${id}) should not be created in javascript.X.scriptEnabled.*! Please move the states to 0_userdata.0.*`,\n 'info',\n );\n } else if (id.match(/^javascript\\.\\d+\\.scriptProblem/)) {\n sandbox.log(\n `Own states (${id}) should not be created in javascript.X.scriptProblem.*! Please move the states to 0_userdata.0.*`,\n 'info',\n );\n }\n\n // User can create aliases by two ways:\n // - id is starting with \"alias.0.\" and common.alias.id is set, so the state defined in common.alias.id will be created automatically if not exists\n // - id is not starting with \"alias.0.\", but common.alias is set, so the state defined in common.alias will be created automatically if not exists\n if (!isAlias && _common.alias) {\n // check and create if not exists the alias\n let alias: CommonAlias;\n if (typeof _common.alias === 'string') {\n alias = {\n id: _common.alias,\n };\n } else if (typeof _common.alias === 'boolean') {\n const parts = id.split('.');\n parts[0] = 'alias';\n parts[1] = '0';\n\n alias = {\n id: parts.join('.'),\n };\n } else {\n alias = _common.alias;\n }\n delete _common.alias;\n\n if (!(alias.id as string).startsWith('alias.0.')) {\n alias.id = `alias.0.${alias.id as string}`;\n }\n\n let aObj: ioBroker.StateObject | null | undefined;\n try {\n aObj = (await adapter.getForeignObjectAsync(alias.id as string)) as\n | ioBroker.StateObject\n | null\n | undefined;\n } catch {\n // ignore\n }\n if (!aObj) {\n try {\n const _obj: ioBroker.StateObject = {\n _id: alias.id as string,\n type: 'state',\n common: {\n name: `Alias to ${id}`,\n role: 'state',\n type: _common.type,\n read: _common.read,\n write: _common.write,\n unit: _common.unit,\n alias: {\n id,\n read: alias.read,\n write: alias.write,\n },\n },\n native: {},\n };\n\n await adapter.setForeignObjectAsync(alias.id as string, _obj);\n } catch (err: unknown) {\n sandbox.log(`Cannot create alias \"${alias.id as string}\": ${err as Error}`, 'error');\n }\n }\n } else if (isAlias && _common.alias) {\n if (typeof _common.alias === 'string') {\n _common.alias = {\n id: _common.alias,\n };\n }\n const readId = typeof _common.alias.id === 'string' ? _common.alias.id : _common.alias.id.read;\n let writeId: string | undefined =\n typeof _common.alias.id === 'string' ? _common.alias.id : _common.alias.id.write;\n if (writeId === readId) {\n writeId = undefined;\n }\n // try to create the linked states\n let aObj: ioBroker.StateObject | null | undefined;\n try {\n aObj = (await adapter.getForeignObjectAsync(readId)) as ioBroker.StateObject | null | undefined;\n } catch {\n // ignore\n }\n if (!aObj) {\n try {\n await adapter.setForeignObjectAsync(readId, {\n type: 'state',\n common: {\n name: `State for ${id}`,\n role: 'state',\n type: _common.type,\n read: _common.read,\n write: _common.write,\n unit: _common.unit,\n },\n native: {},\n });\n } catch (err: unknown) {\n sandbox.log(`Cannot create alias \"${readId}\": ${err as Error}`, 'error');\n }\n }\n if (writeId && _common.write !== false) {\n try {\n aObj = (await adapter.getForeignObjectAsync(writeId)) as\n | ioBroker.StateObject\n | null\n | undefined;\n } catch {\n // ignore\n }\n if (!aObj) {\n try {\n await adapter.setForeignObjectAsync(writeId, {\n type: 'state',\n common: {\n name: `Write state for ${id}`,\n role: 'state',\n type: _common.type,\n read: _common.read,\n write: _common.write,\n unit: _common.unit,\n },\n native: {},\n });\n } catch (err: unknown) {\n sandbox.log(`Cannot create alias \"${writeId}\": ${err as Error}`, 'error');\n }\n }\n }\n }\n\n let obj: ioBroker.Object | null | undefined;\n try {\n obj = await adapter.getForeignObjectAsync(id);\n } catch {\n // ignore\n }\n\n if (\n obj?._id &&\n validIdForAutomaticFolderCreation(obj._id) &&\n obj.type === 'folder' &&\n obj.native &&\n obj.native.autocreated === 'by automatic ensure logic'\n ) {\n // ignore a default created object because we now have a better defined one\n obj = null;\n }\n\n if (!obj || forceCreation) {\n // create new one\n const newObj: ioBroker.StateObject = {\n _id: id,\n common: _common,\n native,\n type: 'state',\n };\n try {\n await adapter.setForeignObjectAsync(id, newObj);\n } catch (err: unknown) {\n sandbox.log(`Cannot set object \"${id}\": ${err as Error}`, 'warn');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, err as Error);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n return;\n }\n\n // Update meta objects\n context.updateObjectContext(id, newObj);\n\n if (!isAlias && initValue !== undefined) {\n if (isObject(initValue) && (initValue as ioBroker.State).ack !== undefined) {\n setStateHelper(sandbox, true, false, id, initValue, callback);\n } else {\n setStateHelper(sandbox, true, false, id, initValue, true, callback);\n }\n } else if (!isAlias && !forceCreation) {\n setStateHelper(sandbox, true, false, id, null, callback);\n } else if (isAlias) {\n try {\n const state = await adapter.getForeignStateAsync(id);\n if (state) {\n states[id] = state;\n }\n } catch {\n // ignore\n }\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, null, id);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n } else if (typeof callback === 'function') {\n try {\n callback.call(sandbox, null, id);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n await ensureObjectStructure(id);\n } else {\n // state yet exists\n if (\n !(adapter.config as JavaScriptAdapterConfig).subscribe &&\n !states[id] &&\n states[`${adapter.namespace}.${id}`] === undefined\n ) {\n states[id] = {\n val: null,\n ack: true,\n lc: Date.now(),\n ts: Date.now(),\n q: 0,\n from: `system.adapter.${adapter.namespace}`,\n };\n }\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, null, id);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n\n await ensureObjectStructure(id);\n }\n },\n deleteState: function (id: string, callback?: (err: Error | null | undefined, found?: boolean) => void): void {\n // todo: check rights\n // todo: also remove from \"names\"\n\n if (sandbox.verbose) {\n sandbox.log(`deleteState(id=${id})`, 'debug');\n }\n\n let found = false;\n if ((id.startsWith('0_userdata.0.') || id.startsWith(adapter.namespace)) && objects[id]) {\n found = true;\n delete objects[id];\n if (states[id]) {\n delete states[id];\n }\n\n adapter.delForeignObject(id, function (err) {\n err && sandbox.log(`Object for state \"${id}\" does not exist: ${err}`, 'warn');\n\n adapter.delForeignState(id, function (err) {\n err && sandbox.log(`Cannot delete state \"${id}\": ${err}`, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, err, found);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n });\n });\n } else if (objects[`${adapter.namespace}.${id}`]) {\n delete objects[`${adapter.namespace}.${id}`];\n found = true;\n if (states[`${adapter.namespace}.${id}`]) {\n delete states[`${adapter.namespace}.${id}`];\n }\n\n adapter.delObject(id, function (err) {\n err && sandbox.log(`Object for state \"${id}\" does not exist: ${err}`, 'warn');\n\n adapter.delState(id, function (err) {\n err && sandbox.log(`Cannot delete state \"${id}\": ${err}`, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, err, found);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n });\n });\n } else {\n const err = 'Not found';\n sandbox.log(`Cannot delete state \"${id}\": ${err}`, 'error');\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, new Error(err), found);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n }\n },\n sendTo: function (\n _adapter: string,\n cmd: string,\n msg?: any,\n options?: Record | ((result: any, options: Record, _adapter: string) => void),\n callback?: (result: any, options: Record, _adapter: string) => void,\n ): void {\n const defaultTimeout = 20000;\n\n if (typeof options === 'function') {\n callback = options as (result: any, options: Record, _adapter: string) => void;\n options = { timeout: defaultTimeout };\n }\n\n let timeout: NodeJS.Timeout | null = null;\n if (typeof callback === 'function') {\n const timeoutDuration = parseInt(options?.timeout, 10) || defaultTimeout;\n\n timeout = setTimeout(() => {\n timeout = null;\n\n if (sandbox.verbose) {\n sandbox.log(`sendTo => timeout: ${timeoutDuration}`, 'debug');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, { error: 'timeout' }, options as Record, _adapter);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n callback = undefined;\n }\n }, timeoutDuration);\n }\n\n let cbFunc: undefined | ((result: any) => void);\n if (timeout) {\n cbFunc = function (result: any): void {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n\n if (sandbox.verbose && result) {\n sandbox.log(`sendTo => ${JSON.stringify(result)}`, 'debug');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, result, options as Record, _adapter);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n callback = undefined;\n }\n };\n }\n\n // If specific instance\n if (_adapter.match(/\\.[0-9]+$/)) {\n sandbox.verbose &&\n sandbox.log(\n `sendTo(instance=${_adapter}, cmd=${cmd}, msg=${JSON.stringify(msg)}, hasCallback=${typeof callback === 'function'})`,\n 'info',\n );\n\n adapter.sendTo(_adapter, cmd, msg, cbFunc, options);\n } else {\n // Send it to all instances\n context.adapter.getObjectView(\n 'system',\n 'instance',\n { startkey: `system.adapter.${_adapter}.`, endkey: `system.adapter.${_adapter}.\\u9999` },\n options,\n (err, res) => {\n if (err || !res) {\n sandbox.log(`sendTo failed: ${err?.message}`, 'error');\n return;\n }\n\n const instances = res.rows.map(item => item.id.substring('system.adapter.'.length));\n\n instances.forEach(instance => {\n sandbox.verbose &&\n sandbox.log(\n `sendTo(instance=${instance}, cmd=${cmd}, msg=${JSON.stringify(msg)}, hasCallback=${typeof callback === 'function'})`,\n 'info',\n );\n adapter.sendTo(instance, cmd, msg, cbFunc, options);\n });\n },\n );\n }\n },\n sendto: function (\n _adapter: string,\n cmd: string,\n msg: any,\n callback?: (result: any, options: Record, _adapter: string) => void,\n ): void {\n return sandbox.sendTo(_adapter, cmd, msg, callback);\n },\n sendToAsync: function (_adapter: string, cmd: string, msg?: any, options?: Record): Promise {\n return new Promise((resolve, reject) => {\n sandbox.sendTo(_adapter, cmd, msg, options, res => {\n if (!res || res.error) {\n reject(res ? new Error(res.error) : new Error('Unknown error'));\n } else {\n resolve(res);\n }\n });\n });\n },\n sendToHost: function (host: string, cmd: string, msg?: any, callback?: (result: any) => void): void {\n if (!(adapter.config as JavaScriptAdapterConfig).enableSendToHost) {\n const error =\n 'sendToHost is not available. Please enable \"Enable SendToHost\" option in instance settings';\n sandbox.log(error, 'error');\n\n if (typeof callback === 'function') {\n // leave it as a normal function and not as a lambda, to hide the \"this\" object\n setImmediate(function () {\n callback(error);\n });\n }\n } else {\n sandbox.verbose &&\n sandbox.log(`sendToHost(adapter=${host}, cmd=${cmd}, msg=${JSON.stringify(msg)})`, 'info');\n adapter.sendToHost(host, cmd, msg, callback);\n }\n },\n sendToHostAsync: function (host: string, cmd: string, msg?: any): Promise {\n return new Promise((resolve, reject) => {\n sandbox.sendToHost(host, cmd, msg, res => {\n if (!res || res.error) {\n reject(res ? new Error(res.error) : new Error('Unknown error'));\n } else {\n resolve(res);\n }\n });\n });\n },\n registerNotification: function (msg: string, isAlert?: boolean): void {\n const category = !isAlert ? 'scriptMessage' : 'scriptAlert';\n\n if (sandbox.verbose) {\n sandbox.log(`registerNotification(msg=${msg}, category=${category})`, 'info');\n }\n\n void adapter.registerNotification('javascript', category, msg);\n },\n setInterval: function (callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout | null {\n if (typeof callback === 'function') {\n const int: NodeJS.Timeout = setInterval(() => {\n try {\n callback.call(sandbox, ...args);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, ms);\n script.intervals.push(int);\n\n if (sandbox.verbose) {\n sandbox.log(`setInterval(ms=${ms})`, 'info');\n }\n return int;\n }\n sandbox.log(`Invalid callback for setInterval! - ${typeof callback}`, 'error');\n return null;\n },\n clearInterval: function (id: NodeJS.Timeout): void {\n const pos = script.intervals.indexOf(id);\n if (pos !== -1) {\n if (sandbox.verbose) {\n sandbox.log('clearInterval() => cleared', 'info');\n }\n clearInterval(id);\n script.intervals.splice(pos, 1);\n } else {\n if (sandbox.verbose) {\n sandbox.log('clearInterval() => not found', 'warn');\n }\n }\n },\n setTimeout: function (callback: (args?: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout | null {\n if (typeof callback === 'function') {\n const to = setTimeout(() => {\n // Remove timeout from the list\n const pos = script.timeouts.indexOf(to);\n if (pos !== -1) {\n script.timeouts.splice(pos, 1);\n }\n\n try {\n callback.call(sandbox, ...args);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, ms);\n if (sandbox.verbose) {\n sandbox.log(`setTimeout(ms=${ms})`, 'info');\n }\n\n script.timeouts.push(to);\n return to;\n }\n sandbox.log(`Invalid callback for setTimeout! - ${typeof callback}`, 'error');\n return null;\n },\n clearTimeout: function (id: NodeJS.Timeout): void {\n const pos = script.timeouts.indexOf(id);\n if (pos !== -1) {\n if (sandbox.verbose) {\n sandbox.log('clearTimeout() => cleared', 'info');\n }\n clearTimeout(id);\n script.timeouts.splice(pos, 1);\n } else {\n if (sandbox.verbose) {\n sandbox.log('clearTimeout() => not found', 'warn');\n }\n }\n },\n setImmediate: function (callback: (..._args: any[]) => void, ...args: any[]): void {\n if (typeof callback === 'function') {\n setImmediate(() => {\n try {\n callback.apply(sandbox, args);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n });\n if (sandbox.verbose) {\n sandbox.log('setImmediate()', 'info');\n }\n } else {\n sandbox.log(`Invalid callback for setImmediate! - ${typeof callback}`, 'error');\n }\n },\n cb: function (callback: (..._args: any[]) => void): (...args: any[]) => void {\n return function (args: any[]) {\n if (context.scripts[name]?._id === sandbox._id) {\n if (typeof callback === 'function') {\n try {\n callback.apply(sandbox, args);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n } else {\n sandbox.log(`Callback for old version of script: ${name}`, 'warn');\n }\n };\n },\n compareTime: function (\n startTime: iobJS.AstroDate | string | Date | number,\n endTime: iobJS.AstroDate | string | Date | number | null,\n operation: 'between' | 'not between' | '<' | '<=' | '>' | '>=' | '==' | '<>' | '!=',\n time?: iobJS.AstroDate | string | Date | number,\n ): boolean {\n if (startTime && typeof startTime === 'string') {\n const pos = consts.astroListLow.indexOf(startTime.toLowerCase());\n if (pos !== -1) {\n const aTime = sandbox.getAstroDate(consts.astroList[pos]);\n if (aTime) {\n startTime = aTime.toLocaleTimeString([], {\n hour: '2-digit',\n minute: '2-digit',\n hour12: false,\n });\n } else {\n startTime = 0;\n }\n }\n } else if (startTime && isObject(startTime) && (startTime as iobJS.AstroDate).astro) {\n const aTime = sandbox.getAstroDate(\n (startTime as iobJS.AstroDate).astro,\n (startTime as iobJS.AstroDate).date || new Date(),\n (startTime as iobJS.AstroDate).offset || 0,\n );\n if (aTime) {\n startTime = aTime.toLocaleTimeString([], {\n hour: '2-digit',\n minute: '2-digit',\n hour12: false,\n });\n } else {\n startTime = 0;\n }\n }\n\n if (endTime && typeof endTime === 'string') {\n const pos = consts.astroListLow.indexOf(endTime.toLowerCase());\n if (pos !== -1) {\n const aTime = sandbox.getAstroDate(consts.astroList[pos]);\n endTime =\n aTime?.toLocaleTimeString([], {\n hour: '2-digit',\n minute: '2-digit',\n hour12: false,\n }) || 0;\n }\n } else if (endTime && isObject(endTime) && (endTime as iobJS.AstroDate).astro) {\n const aTime = sandbox.getAstroDate(\n (endTime as iobJS.AstroDate).astro,\n (endTime as iobJS.AstroDate).date || new Date(),\n (endTime as iobJS.AstroDate).offset || 0,\n );\n endTime =\n aTime?.toLocaleTimeString([], {\n hour: '2-digit',\n minute: '2-digit',\n hour12: false,\n }) || 0;\n }\n\n // --- Convert \"time\" to number\n let nTime: number | undefined;\n // maybe it is astro date like 'sunrise' or 'sunset'\n if (time && typeof time === 'string') {\n const pos = consts.astroListLow.indexOf(time.toLowerCase());\n if (pos !== -1) {\n nTime = sandbox.getAstroDate(consts.astroList[pos])?.getTime() || 0;\n }\n } else if (time && isObject(time) && (time as iobJS.AstroDate).astro) {\n nTime =\n sandbox\n .getAstroDate(\n (time as iobJS.AstroDate).astro,\n (time as iobJS.AstroDate).date || new Date(),\n (time as iobJS.AstroDate).offset || 0,\n )\n ?.getTime() || 0;\n }\n\n let daily = true;\n if (time) {\n daily = false;\n }\n // if not astro date\n if (!nTime) {\n if (time && !isObject(time)) {\n if (typeof time === 'string' && !time.includes(' ') && !time.includes('T')) {\n const parts = time.split(':');\n const oTime = new Date();\n oTime.setHours(parseInt(parts[0], 10));\n oTime.setMinutes(parseInt(parts[1], 10));\n oTime.setMilliseconds(0);\n\n if (parts.length === 3) {\n oTime.setSeconds(parseInt(parts[2], 10));\n } else {\n oTime.setSeconds(0);\n }\n nTime = oTime.getTime();\n } else {\n nTime = new Date(time as string | number).getTime();\n }\n } else if (!time) {\n const oTime = new Date();\n oTime.setMilliseconds(0);\n nTime = oTime.getTime();\n } else {\n // If Date\n nTime = (time as Date).getTime();\n }\n }\n // --- End of conversion \"time\" to number\n if (typeof startTime === 'string') {\n if (!startTime.includes(' ') && !startTime.includes('T')) {\n const parts = startTime.split(':');\n startTime = new Date();\n startTime.setHours(parseInt(parts[0], 10));\n startTime.setMinutes(parseInt(parts[1], 10));\n startTime.setMilliseconds(0);\n\n if (parts.length === 3) {\n startTime.setSeconds(parseInt(parts[2], 10));\n } else {\n startTime.setSeconds(0);\n }\n } else {\n daily = false;\n startTime = new Date(startTime);\n }\n } else {\n daily = false;\n startTime = new Date(startTime as number | Date);\n }\n const nStartTime = startTime.getTime();\n\n let nEndTime: number | null;\n if (endTime && typeof endTime === 'string') {\n if (!endTime.includes(' ') && !endTime.includes('T')) {\n const parts = endTime.split(':');\n endTime = new Date();\n endTime.setHours(parseInt(parts[0], 10));\n endTime.setMinutes(parseInt(parts[1], 10));\n endTime.setMilliseconds(0);\n\n if (parts.length === 3) {\n endTime.setSeconds(parseInt(parts[2], 10));\n } else {\n endTime.setSeconds(0);\n }\n } else {\n daily = false;\n endTime = new Date(endTime);\n }\n } else if (endTime) {\n daily = false;\n endTime = new Date(endTime as number | Date);\n } else {\n endTime = null;\n }\n\n if (endTime) {\n nEndTime = endTime.getTime();\n } else {\n nEndTime = null;\n }\n\n if (operation === 'between') {\n if (nEndTime) {\n if (nStartTime > nEndTime && daily) {\n return !(nTime >= nEndTime && nTime < nStartTime);\n }\n return nTime >= nStartTime && nTime < nEndTime;\n }\n sandbox.log(`missing or unrecognized endTime expression: ${JSON.stringify(endTime)}`, 'warn');\n return false;\n }\n\n if (operation === 'not between') {\n if (nEndTime) {\n if (nStartTime > nEndTime && daily) {\n return nTime >= nEndTime && nTime < nStartTime;\n }\n return !(nTime >= nStartTime && nTime < nEndTime);\n }\n sandbox.log(`missing or unrecognized endTime expression: ${JSON.stringify(endTime)}`, 'warn');\n return false;\n }\n\n if (operation === '>') {\n return nTime > nStartTime;\n }\n if (operation === '>=') {\n return nTime >= nStartTime;\n }\n if (operation === '<') {\n return nTime < nStartTime;\n }\n if (operation === '<=') {\n return nTime <= nStartTime;\n }\n if (operation === '==') {\n return nTime === nStartTime;\n }\n if (operation === '<>' || operation === '!=') {\n return nTime !== nStartTime;\n }\n sandbox.log(`Invalid operator: ${operation as string}`, 'warn');\n return false;\n },\n onStop: function (cb: () => void, timeout?: number): void {\n if (sandbox.verbose) {\n sandbox.log(`onStop(timeout=${timeout})`, 'info');\n }\n\n script.onStopCb = cb;\n script.onStopTimeout = timeout || 1000;\n },\n formatValue: function (value: number | string, decimals: number | string, format?: string): string {\n if (typeof decimals === 'string') {\n format = decimals;\n decimals = 0;\n }\n if (!format) {\n if (adapter.isFloatComma !== undefined) {\n format = adapter.isFloatComma ? '.,' : ',.';\n } else if (objects['system.config'] && objects['system.config'].common) {\n format = objects['system.config'].common.isFloatComma ? '.,' : ',.';\n }\n }\n return adapter.formatValue(value, decimals, format);\n },\n formatDate: function (\n date: Date | string | number | iobJS.AstroDate,\n format?: string,\n language?: ioBroker.Languages,\n ): string {\n if (!format) {\n if (adapter.dateFormat) {\n format = adapter.dateFormat;\n } else {\n format =\n objects['system.config'] && objects['system.config'].common\n ? objects['system.config'].common.dateFormat || 'DD.MM.YYYY'\n : 'DD.MM.YYYY';\n }\n format = format || 'DD.MM.YYYY';\n }\n // maybe it is astro date like 'sunrise' or 'sunset'\n if (date && typeof date === 'string') {\n const pos = consts.astroListLow.indexOf(date.toLowerCase());\n if (pos !== -1) {\n date = sandbox.getAstroDate(consts.astroList[pos])?.getTime() || 0;\n }\n } else if (date && isObject(date) && (date as iobJS.AstroDate).astro) {\n date =\n sandbox\n .getAstroDate(\n (date as iobJS.AstroDate).astro,\n (date as iobJS.AstroDate).date || new Date(),\n (date as iobJS.AstroDate).offset || 0,\n )\n ?.getTime() || 0;\n }\n\n if (format.match(/[WНOО]+/)) {\n let text: string = adapter.formatDate(date as Date | string | number, format);\n if (!language || !consts.dayOfWeeksFull[language]) {\n language =\n adapter.language ||\n (objects['system.config'] &&\n objects['system.config'].common &&\n objects['system.config'].common.language) ||\n 'en';\n if (!consts.dayOfWeeksFull[language as ioBroker.Languages]) {\n language = 'en';\n }\n }\n if (typeof date === 'number' || typeof date === 'string') {\n date = new Date(date);\n } else if (typeof (date as Date).getMonth !== 'function') {\n sandbox.log(`Invalid date object provided: ${JSON.stringify(date)}`, 'error');\n return 'Invalid date';\n }\n const d: number = (date as Date).getDay();\n text = text.replace('НН', consts.dayOfWeeksFull[language as ioBroker.Languages][d]);\n let initialText = text;\n text = text.replace('WW', consts.dayOfWeeksFull[language as ioBroker.Languages][d]);\n\n if (initialText === text) {\n text = text.replace('W', consts.dayOfWeeksShort[language as ioBroker.Languages][d]);\n }\n\n text = text.replace('Н', consts.dayOfWeeksShort[language as ioBroker.Languages][d]);\n text = text.replace('Н', consts.dayOfWeeksShort[language as ioBroker.Languages][d]);\n const m: number = (date as Date).getMonth();\n initialText = text;\n text = text.replace('OOO', consts.monthFullGen[language as ioBroker.Languages][m]);\n text = text.replace('ООО', consts.monthFullGen[language as ioBroker.Languages][m]);\n text = text.replace('OO', consts.monthFull[language as ioBroker.Languages][m]);\n text = text.replace('ОО', consts.monthFull[language as ioBroker.Languages][m]);\n\n if (initialText === text) {\n text = text.replace('O', consts.monthShort[language as ioBroker.Languages][m]);\n }\n return text;\n }\n return adapter.formatDate(date as string | number | Date, format);\n },\n formatTimeDiff: function (diff: number, format?: string): string {\n if (!format) {\n format = 'hh:mm:ss';\n }\n\n let text = format;\n\n if (sandbox.verbose) {\n sandbox.log(`formatTimeDiff(format=${format}, diff=${diff})`, 'debug');\n }\n\n const second = 1000;\n const minute = 60 * second;\n const hour = 60 * minute;\n const day = 24 * hour;\n const neg = diff < 0;\n diff = Math.abs(diff);\n\n if (/(? void),\n callback?: (err?: Error | null) => void,\n ): void {\n if (typeof data === 'function' || !data) {\n callback = data as (err?: Error | null) => void;\n data = fileName;\n fileName = _adapter;\n _adapter = '0_userdata.0';\n }\n _adapter = _adapter || '0_userdata.0';\n\n if (debug) {\n sandbox.log(\n `writeFile(adapter=${_adapter}, fileName=${fileName}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n setTimeout(function (): void {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, 0);\n }\n } else {\n if (sandbox.verbose) {\n sandbox.log(`writeFile(adapter=${_adapter}, fileName=${fileName})`, 'info');\n }\n if (callback) {\n adapter.writeFile(_adapter, fileName, data, callback);\n } else {\n // @ts-expect-error should be fixed in js-controller\n adapter.writeFile(_adapter, fileName, data);\n }\n }\n },\n readFile: function (\n _adapter: string,\n fileName: string | ((err: Error | null | undefined, data?: Buffer | string, mimeType?: string) => void),\n callback?: (err: Error | null | undefined, data?: Buffer | string, mimeType?: string) => void,\n ): void {\n if (typeof fileName === 'function') {\n callback = fileName as (\n err: Error | null | undefined,\n data?: Buffer | string,\n mimeType?: string,\n ) => void;\n fileName = _adapter;\n _adapter = '0_userdata.0';\n }\n if (typeof callback !== 'function') {\n sandbox.log(`readFile(adapter=${_adapter}, fileName=${fileName}): no callback`, 'error');\n return;\n }\n _adapter = _adapter || '0_userdata.0';\n if (sandbox.verbose) {\n sandbox.log(`readFile(adapter=${_adapter}, fileName=${fileName})`, 'info');\n }\n\n adapter.fileExists(_adapter, fileName, (error: Error | null | undefined, result?: boolean): void => {\n if (error) {\n callback(error);\n } else if (!result) {\n callback(new Error('Not exists'));\n } else {\n adapter.readFile(_adapter, fileName, callback);\n }\n });\n },\n unlink: function (\n _adapter: string,\n fileName: string | ((err?: Error | null) => void),\n callback?: (err?: Error | null) => void,\n ): void {\n if (typeof fileName === 'function') {\n callback = fileName;\n fileName = _adapter;\n _adapter = '0_userdata.0';\n }\n _adapter = _adapter || '0_userdata.0';\n\n if (debug) {\n sandbox.log(\n `unlink(adapter=${_adapter}, fileName=${fileName}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n setTimeout(function (): void {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, 0);\n }\n } else {\n if (sandbox.verbose) {\n sandbox.log(`unlink(adapter=${_adapter}, fileName=${fileName})`, 'info');\n }\n if (callback) {\n adapter.unlink(_adapter, fileName, callback);\n } else {\n // @ts-expect-error should be fixed in js-controller\n adapter.unlink(_adapter, fileName);\n }\n }\n },\n delFile: function (\n _adapter: string,\n fileName: string | ((err?: Error | null) => void),\n callback?: (err?: Error | null) => void,\n ): void {\n return sandbox.unlink(_adapter, fileName as string, callback);\n },\n rename: function (\n _adapter: string,\n oldName: string,\n newName: string,\n callback?: (err?: Error | null) => void,\n ): void {\n _adapter = _adapter || '0_userdata.0';\n\n if (debug) {\n sandbox.log(\n `rename(adapter=${_adapter}, oldName=${oldName}, newName=${newName}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n setTimeout(function () {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, 0);\n }\n } else {\n sandbox.verbose &&\n sandbox.log(`rename(adapter=${_adapter}, oldName=${oldName}, newName=${newName})`, 'info');\n if (callback) {\n adapter.rename(_adapter, oldName, newName, callback);\n } else {\n // @ts-expect-error should be fixed in js-controller\n adapter.rename(_adapter, oldName, newName);\n }\n }\n },\n renameFile: function (\n _adapter: string,\n oldName: string,\n newName: string,\n callback?: (err?: Error | null) => void,\n ): void {\n return sandbox.rename(_adapter, oldName, newName, callback);\n },\n getHistory: function (\n instance: string | (ioBroker.GetHistoryOptions & { id: string; timeout?: number | string }),\n options:\n | (ioBroker.GetHistoryOptions & { id?: string; timeout?: number | string })\n | ((\n error: Error | null,\n result?: ioBroker.GetHistoryResult | null,\n options?: ioBroker.GetHistoryOptions & { id: string; timeout?: number | string },\n instance?: string,\n ) => void),\n callback?: (\n error: Error | null,\n result?: ioBroker.GetHistoryResult | null,\n options?: ioBroker.GetHistoryOptions & { id: string; timeout?: number | string },\n instance?: string,\n ) => void,\n ): void {\n if (isObject(instance)) {\n callback = options as (\n error: Error | null,\n result?: ioBroker.GetHistoryResult | null,\n options?: ioBroker.GetHistoryOptions & { id: string; timeout?: number | string },\n instance?: string,\n ) => void;\n options = instance as ioBroker.GetHistoryOptions & { id?: string; timeout?: number | string };\n instance = '';\n }\n\n if (typeof callback !== 'function') {\n return sandbox.log('No callback found!', 'error');\n }\n if (!isObject(options)) {\n return sandbox.log('No options found!', 'error');\n }\n if (!(options as ioBroker.GetHistoryOptions & { id?: string; timeout?: number | string }).id) {\n return sandbox.log('No ID found!', 'error');\n }\n const timeoutMs =\n parseInt(\n (options as ioBroker.GetHistoryOptions & { id?: string; timeout?: number })\n ?.timeout as unknown as string,\n 10,\n ) || 20000;\n\n if (!instance) {\n // @ts-expect-error defaultHistory is private attribute of adapter. Fix later\n if (adapter.defaultHistory) {\n // @ts-expect-error defaultHistory is private attribute of adapter. Fix later\n instance = adapter.defaultHistory;\n } else {\n instance = objects['system.config']?.common?.defaultHistory || null;\n }\n }\n\n if (sandbox.verbose) {\n sandbox.log(`getHistory(instance=${instance as string}, options=${JSON.stringify(options)})`, 'info');\n }\n\n if (!instance) {\n sandbox.log('No default history instance found!', 'error');\n try {\n callback.call(sandbox, new Error('No default history instance found!'));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n return;\n }\n if ((instance as string).startsWith('system.adapter.')) {\n instance = (instance as string).substring('system.adapter.'.length);\n }\n\n if (!objects[`system.adapter.${instance as string}`]) {\n sandbox.log(`Instance \"${instance as string}\" not found!`, 'error');\n try {\n callback.call(sandbox, new Error(`Instance \"${instance as string}\" not found!`));\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n return;\n }\n\n let _timeout: NodeJS.Timeout | null = setTimeout(() => {\n _timeout = null;\n if (sandbox.verbose) {\n sandbox.log('getHistory => timeout', 'debug');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(\n sandbox,\n new Error('Timeout'),\n null,\n options as ioBroker.GetHistoryOptions & { id: string; timeout?: number | string },\n instance as string,\n );\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n callback = undefined;\n }\n }, timeoutMs);\n\n adapter.sendTo(\n instance as string,\n 'getHistory',\n {\n id: (options as ioBroker.GetHistoryOptions & { id: string; timeout?: number | string }).id,\n options,\n },\n (res: any): void => {\n if (_timeout) {\n clearTimeout(_timeout);\n _timeout = null;\n }\n const result: {\n error?: string;\n result?: ioBroker.GetHistoryResult;\n step?: number;\n sessionId?: string;\n } = res;\n\n if (sandbox.verbose && result?.error) {\n sandbox.log(`getHistory => ${result.error}`, 'error');\n }\n if (sandbox.verbose && result?.result) {\n sandbox.log(`getHistory => ${result.result.length} items`, 'debug');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(\n sandbox,\n result.error ? new Error(result.error) : null,\n result.result,\n options as ioBroker.GetHistoryOptions & { id: string; timeout?: number | string },\n instance as string,\n );\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n callback = undefined;\n }\n },\n );\n },\n runScript: function (scriptName: string, callback?: (err?: Error | null) => void): boolean {\n scriptName = scriptName || name;\n if (!scriptName.match(/^script\\.js\\./)) {\n scriptName = `script.js.${scriptName}`;\n }\n // start another script\n if (!objects[scriptName] || !objects[scriptName].common) {\n sandbox.log(`Cannot start \"${scriptName}\", because not found`, 'error');\n return false;\n }\n if (debug) {\n sandbox.log(\n `runScript(scriptName=${scriptName}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n typeof callback === 'function' && callback();\n return true;\n }\n if (objects[scriptName].common.enabled) {\n objects[scriptName].common.enabled = false;\n adapter.extendForeignObject(scriptName, { common: { enabled: false } }, (/* err, obj */) => {\n adapter.extendForeignObject(\n scriptName,\n { common: { enabled: true } },\n err => typeof callback === 'function' && callback(err),\n );\n });\n return true;\n }\n adapter.extendForeignObject(\n scriptName,\n { common: { enabled: true } },\n err => typeof callback === 'function' && callback(err),\n );\n return true;\n },\n runScriptAsync: function (scriptName: string): Promise {\n let done = false;\n return new Promise((resolve, reject) => {\n const result = sandbox.runScript(scriptName, err => {\n if (err) {\n reject(err);\n done = true;\n } else {\n resolve();\n }\n });\n if (result === false && !done) {\n reject(new Error(`Script ${scriptName} was not found!`));\n }\n });\n },\n startScript: function (\n scriptName: string,\n ignoreIfStarted?: boolean | ((err: Error | null | undefined, started: boolean) => void),\n callback?: (err: Error | null | undefined, started: boolean) => void,\n ): boolean {\n if (typeof ignoreIfStarted === 'function') {\n callback = ignoreIfStarted as (err: Error | null | undefined, started: boolean) => void;\n ignoreIfStarted = false;\n }\n scriptName ||= name;\n if (!scriptName.match(/^script\\.js\\./)) {\n scriptName = `script.js.${scriptName}`;\n }\n // start another script\n if (!objects[scriptName] || !objects[scriptName].common) {\n sandbox.log(`Cannot start \"${scriptName}\", because not found`, 'error');\n return false;\n }\n if (debug) {\n sandbox.log(\n `startScript(scriptName=${scriptName}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n typeof callback === 'function' && callback(null, false);\n return true;\n }\n if (objects[scriptName].common.enabled) {\n if (!ignoreIfStarted) {\n adapter.extendForeignObject(scriptName, { common: { enabled: false } }, () => {\n adapter.extendForeignObject(\n scriptName,\n { common: { enabled: true } },\n err => typeof callback === 'function' && callback(err, true),\n );\n });\n } else if (typeof callback === 'function') {\n callback(null, false);\n }\n return true;\n }\n adapter.extendForeignObject(scriptName, { common: { enabled: true } }, err => {\n typeof callback === 'function' && callback(err, true);\n });\n return true;\n },\n startScriptAsync: function (scriptName: string, ignoreIfStarted?: boolean): Promise {\n return new Promise((resolve, reject) => {\n const result = sandbox.startScript(\n scriptName,\n !!ignoreIfStarted,\n (err: Error | null | undefined, started: boolean): void => {\n if (err) {\n reject(err);\n } else {\n resolve(started);\n }\n },\n );\n if (result === false) {\n reject(new Error(`Script ${scriptName} was not found!`));\n }\n });\n },\n stopScript: function (\n scriptName: string,\n callback?: (err: Error | null | undefined, stopped: boolean) => void,\n ): boolean {\n scriptName = scriptName || name;\n\n if (!scriptName.match(/^script\\.js\\./)) {\n scriptName = `script.js.${scriptName}`;\n }\n\n // stop another script\n if (!objects[scriptName] || !objects[scriptName].common) {\n sandbox.log(`Cannot stop \"${scriptName}\", because not found`, 'error');\n return false;\n }\n if (debug) {\n sandbox.log(\n `stopScript(scriptName=${scriptName}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n callback(null, false);\n }\n return true;\n }\n if (objects[scriptName].common.enabled) {\n objects[scriptName].common.enabled = false;\n adapter.extendForeignObject(scriptName, { common: { enabled: false } }, err => {\n if (typeof callback === 'function') {\n callback(err, true);\n }\n });\n } else if (typeof callback === 'function') {\n callback(null, false);\n }\n return true;\n },\n stopScriptAsync: function (scriptName: string): Promise {\n return new Promise((resolve, reject) => {\n const result = sandbox.stopScript(\n scriptName,\n (err: Error | null | undefined, stopped: boolean): void => {\n if (err) {\n reject(err);\n } else {\n resolve(stopped);\n }\n },\n );\n if (result === false) {\n reject(new Error(`Script ${scriptName} was not found!`));\n }\n });\n },\n isScriptActive: function (scriptName: string): boolean {\n if (!scriptName.match(/^script\\.js\\./)) {\n scriptName = `script.js.${scriptName}`;\n }\n if (!objects[scriptName] || !objects[scriptName].common) {\n sandbox.log('Script does not exist', 'error');\n return false;\n }\n return objects[scriptName].common.enabled;\n },\n startInstanceAsync: async function (instanceName: string): Promise {\n const objInstanceId = `system.adapter.${instanceName}`;\n const exists = await adapter.foreignObjectExists(objInstanceId);\n\n if (exists) {\n const instanceObj = await adapter.getForeignObjectAsync(objInstanceId);\n\n if (instanceObj?.type === 'instance' && !instanceObj.common.enabled) {\n await adapter.extendForeignObjectAsync(objInstanceId, { common: { enabled: true } });\n\n if (sandbox.verbose) {\n sandbox.log(`startInstanceAsync (instanceName=${instanceName})`, 'info');\n }\n\n return true;\n }\n sandbox.log(`Cannot start instance \"${instanceName}\", because already running`, 'warn');\n } else {\n sandbox.log(`Cannot start instance \"${instanceName}\", because not found`, 'error');\n }\n\n return false;\n },\n restartInstanceAsync: async function (instanceName: string): Promise {\n const objInstanceId = `system.adapter.${instanceName}`;\n const exists = await adapter.foreignObjectExists(objInstanceId);\n\n if (exists) {\n const instanceObj = await adapter.getForeignObjectAsync(objInstanceId);\n\n if (instanceObj?.type === 'instance' && instanceObj.common.enabled) {\n await adapter.extendForeignObjectAsync(objInstanceId, {});\n\n if (sandbox.verbose) {\n sandbox.log(`restartInstanceAsync (instanceName=${instanceName})`, 'info');\n }\n\n return true;\n }\n sandbox.log(`Cannot restart instance \"${instanceName}\", because not running`, 'warn');\n } else {\n sandbox.log(`Cannot restart instance \"${instanceName}\", because not found`, 'error');\n }\n\n return false;\n },\n stopInstanceAsync: async function (instanceName: string): Promise {\n const objInstanceId = `system.adapter.${instanceName}`;\n const exists = await adapter.foreignObjectExists(objInstanceId);\n\n if (exists) {\n const instanceObj = await adapter.getForeignObjectAsync(objInstanceId);\n\n if (instanceObj?.type === 'instance' && instanceObj.common.enabled) {\n await adapter.extendForeignObjectAsync(objInstanceId, { common: { enabled: false } });\n\n if (sandbox.verbose) {\n sandbox.log(`stopInstanceAsync (instanceName=${instanceName})`, 'info');\n }\n\n return true;\n }\n sandbox.log(`Cannot stop instance \"${instanceName}\", because not running`, 'warn');\n } else {\n sandbox.log(`Cannot stop instance \"${instanceName}\", because not found`, 'error');\n }\n\n return false;\n },\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n toInt: function (val: boolean | string | number | 'true' | 'false'): number {\n if (val === true || val === 'true') {\n val = 1;\n }\n if (val === false || val === 'false') {\n val = 0;\n }\n val = parseInt(val as unknown as string) || 0;\n return val;\n },\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n toFloat: function (val: boolean | string | number | 'true' | 'false'): number {\n if (val === true || val === 'true') {\n val = 1;\n }\n if (val === false || val === 'false') {\n val = 0;\n }\n val = parseFloat(val as unknown as string) || 0;\n return val;\n },\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n toBoolean: function (val: boolean | string | number | 'true' | 'false'): boolean {\n if (val === '1' || val === 'true') {\n val = true;\n }\n if (val === '0' || val === 'false') {\n val = false;\n }\n return !!val;\n },\n getAttr: function (obj: string | Record, path: string | string[]): any {\n if (typeof path === 'string') {\n path = path.split('.');\n }\n if (typeof obj === 'string') {\n try {\n obj = JSON.parse(obj);\n } catch (err: unknown) {\n void adapter.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: true,\n ack: true,\n c: 'getAttr',\n });\n sandbox.log(`Cannot parse \"${obj.substring(0, 30)}\": ${err as Error}`, 'error');\n\n return null;\n }\n }\n\n const attr: string = path.shift() || '';\n try {\n obj = (obj as Record)[attr];\n } catch (err: unknown) {\n void adapter.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: true,\n ack: true,\n c: 'getAttr',\n });\n sandbox.log(`Cannot get ${attr} of \"${JSON.stringify(obj)}\": ${err as Error}`, 'error');\n\n return null;\n }\n\n if (!path.length) {\n return obj;\n }\n const type = typeof obj;\n if (obj === null || obj === undefined || type === 'boolean' || type === 'number') {\n return null;\n }\n return sandbox.getAttr(obj, path);\n },\n messageTo: function (\n target: string | { instance: string | null | number; script: string | null; message: string },\n data: any,\n options: { timeout?: number | string } | ((result: any, options: { timeout?: number | string }) => void),\n callback?: (result: any, options: { timeout?: number | string }, instance: string | number | null) => void,\n ) {\n const defaultTimeout = 5000;\n\n if (typeof target !== 'object') {\n target = { instance: null, script: null, message: target };\n }\n if (typeof options === 'function') {\n callback = options;\n options = { timeout: defaultTimeout };\n }\n\n let timeout: NodeJS.Timeout | null = null;\n if (typeof callback === 'function') {\n const timeoutDuration = parseInt(options?.timeout as unknown as string, 10) || defaultTimeout;\n\n timeout = setTimeout(() => {\n timeout = null;\n\n if (sandbox.verbose) {\n sandbox.log(`messageTo => timeout: ${timeoutDuration}`, 'debug');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, { error: 'timeout' }, options, target.instance);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n callback = undefined;\n }\n }, timeoutDuration);\n }\n let cbFunc: undefined | ((result: any) => void);\n if (timeout) {\n cbFunc = function (res: any) {\n timeout && clearTimeout(timeout);\n const result: { result?: any; error?: string | null } = res;\n\n if (sandbox.verbose && result?.result) {\n sandbox.log(`messageTo => ${JSON.stringify(result)}`, 'debug');\n }\n if (sandbox.verbose && result?.error) {\n sandbox.log(`messageTo => ${result.error}`, 'error');\n }\n\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, result, options, target.instance);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n callback = undefined;\n }\n };\n }\n\n if (target.instance || target.instance === 0) {\n if (\n typeof target.instance === 'string' &&\n target.instance &&\n target.instance.startsWith('system.adapter.')\n ) {\n target.instance = target.instance.substring('system.adapter.'.length);\n } else if (typeof target.instance === 'number') {\n target.instance = `javascript.${target.instance}`;\n }\n\n adapter.sendTo(\n target.instance,\n 'jsMessageBus',\n { message: target.message, script: target.script, data },\n cbFunc,\n );\n } else {\n // Send it to all instances\n context.adapter.getObjectView(\n 'system',\n 'instance',\n { startkey: 'system.adapter.javascript.', endkey: 'system.adapter.javascript.\\u9999' },\n options,\n (err: Error | null | undefined, res): void => {\n if (err || !res) {\n sandbox.log(`messageTo failed: ${err?.message}`, 'error');\n return;\n }\n const len = 'system.adapter.'.length;\n const instances = res.rows.map(item => item.id.substring(len));\n\n instances.forEach(instance => {\n adapter.sendTo(\n instance,\n 'jsMessageBus',\n { message: target.message, script: target.script, data },\n cbFunc,\n );\n });\n },\n );\n }\n },\n messageToAsync: function (\n target: string | { instance: string | null | number; script: string | null; message: string },\n data: any,\n options?: { timeout?: number | string },\n ): Promise {\n return new Promise((resolve, reject) => {\n sandbox.messageTo(target, data, options, (res: any): void => {\n const result: { error?: string } = res;\n if (sandbox.verbose) {\n sandbox.log(`messageTo result => ${JSON.stringify(res)}`, 'debug');\n }\n if (!res || result.error) {\n reject(result ? new Error(result.error) : new Error('Unknown error'));\n } else {\n resolve(result);\n }\n });\n });\n },\n onMessage: function (\n messageName: string,\n callback: (data: any, cb: (result: any) => void) => void,\n ): null | number {\n if (typeof callback !== 'function') {\n sandbox.log('onMessage callback is not a function', 'error');\n\n return null;\n }\n context.messageBusHandlers[sandbox.scriptName] = context.messageBusHandlers[sandbox.scriptName] || {};\n context.messageBusHandlers[sandbox.scriptName][messageName] =\n context.messageBusHandlers[sandbox.scriptName][messageName] || [];\n\n const handler = { id: Date.now() + Math.floor(Math.random() * 10000), cb: callback, sandbox };\n context.messageBusHandlers[sandbox.scriptName][messageName].push(handler);\n\n sandbox.__engine.__subscriptionsMessage += 1;\n\n if (\n sandbox.__engine.__subscriptionsMessage %\n (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__subscriptionsMessage} message subscriptions registered. Check your script!`,\n 'warn',\n );\n }\n\n return handler.id;\n },\n onMessageUnregister: function (idOrName: number | string): boolean {\n const ctx = context.messageBusHandlers[sandbox.scriptName];\n let found = false;\n if (ctx) {\n if (typeof idOrName === 'number') {\n for (const messageName in ctx) {\n if (Object.prototype.hasOwnProperty.call(ctx, messageName)) {\n for (let i = 0; i < ctx[messageName].length; i++) {\n if (ctx[messageName][i].id === idOrName) {\n ctx[messageName].splice(i, 1);\n if (!ctx[messageName].length) {\n delete ctx[messageName];\n sandbox.__engine.__subscriptionsMessage--;\n }\n found = true;\n break;\n }\n }\n }\n if (found) {\n break;\n }\n }\n } else if (idOrName && ctx[idOrName]) {\n delete ctx[idOrName];\n sandbox.__engine.__subscriptionsMessage--;\n found = true;\n }\n }\n return found;\n },\n console: {\n log: function (msg: string): void {\n sandbox.log(msg, 'info');\n },\n error: function (msg: string): void {\n sandbox.log(msg, 'error');\n },\n warn: function (msg: string): void {\n sandbox.log(msg, 'warn');\n },\n info: function (msg: string): void {\n sandbox.log(msg, 'info');\n },\n debug: function (msg: string): void {\n sandbox.log(msg, 'debug');\n },\n },\n jsonataExpression: function (data: any, expression: string): Promise {\n return jsonata(expression).evaluate(data);\n },\n wait: function (ms: number): Promise {\n return new Promise((resolve: () => void): void => {\n sandbox.setTimeout(resolve, ms);\n });\n },\n sleep: function (ms: number): Promise {\n return sandbox.wait(ms);\n },\n onObject: function (\n pattern: string | string[],\n callback: (id: string, obj?: ioBroker.Object | null) => void,\n ): SubscribeObject | SubscribeObject[] | null {\n return sandbox.subscribeObject(pattern, callback);\n },\n subscribeObject: function (\n pattern: string | string[],\n callback: (id: string, obj?: ioBroker.Object | null) => void,\n ): SubscribeObject | SubscribeObject[] | null {\n if (Array.isArray(pattern)) {\n const result: {\n name: string;\n pattern: string;\n callback: (id: string, obj?: ioBroker.Object | null) => void;\n }[] = [];\n for (let p = 0; p < pattern.length; p++) {\n result.push(\n sandbox.subscribeObject(pattern[p], callback) as {\n name: string;\n pattern: string;\n callback: (id: string, obj?: ioBroker.Object | null) => void;\n },\n );\n }\n return result;\n }\n\n sandbox.__engine.__subscriptionsObject += 1;\n\n if (\n sandbox.__engine.__subscriptionsObject %\n (adapter.config as JavaScriptAdapterConfig).maxTriggersPerScript ===\n 0\n ) {\n sandbox.log(\n `More than ${sandbox.__engine.__subscriptionsObject} object subscriptions registered. Check your script!`,\n 'warn',\n );\n }\n\n // source is set by regexp if defined as /regexp/\n if (!pattern || typeof pattern !== 'string') {\n sandbox.log('Error by subscribeObject: pattern can be only string or array of strings.', 'error');\n return null;\n }\n\n if (typeof callback !== 'function') {\n sandbox.log('Error by subscribeObject: callback is not a function', 'error');\n return null;\n }\n\n const subs: SubscribeObject = { pattern, callback, name };\n if (sandbox.verbose) {\n sandbox.log(`subscribeObject: ${JSON.stringify(subs)}`, 'info');\n }\n\n adapter.subscribeForeignObjects(pattern);\n\n context.subscriptionsObject.push(subs);\n\n return subs;\n },\n unsubscribeObject: function (subObject: SubscribeObject | SubscribeObject[]): boolean | boolean[] {\n if (subObject && Array.isArray(subObject)) {\n const result: boolean[] = [];\n for (let t = 0; t < subObject.length; t++) {\n result.push(sandbox.unsubscribeObject(subObject[t]) as boolean);\n }\n return result;\n }\n\n if (sandbox.verbose) {\n sandbox.log(`adapterUnsubscribeObject(id=${JSON.stringify(subObject)})`, 'info');\n }\n\n for (let i = context.subscriptionsObject.length - 1; i >= 0; i--) {\n if (context.subscriptionsObject[i] === subObject) {\n adapter.unsubscribeForeignObjects(subObject.pattern);\n context.subscriptionsObject.splice(i, 1);\n sandbox.__engine.__subscriptionsObject--;\n return true;\n }\n }\n let deleted = 0;\n for (let i = context.subscriptionsObject.length - 1; i >= 0; i--) {\n if (\n context.subscriptionsObject[i].name &&\n context.subscriptionsObject[i].pattern === subObject.pattern\n ) {\n deleted++;\n adapter.unsubscribeForeignObjects(subObject.pattern);\n context.subscriptionsObject.splice(i, 1);\n sandbox.__engine.__subscriptionsObject--;\n }\n }\n return !!deleted;\n },\n // internal function to send the block debugging info to the front-end\n _sendToFrontEnd: function (blockId: string, data: any): void {\n if (context.rulesOpened === sandbox.scriptName) {\n void adapter.setState(\n 'debug.rules',\n JSON.stringify({ ruleId: sandbox.scriptName, blockId, data, ts: Date.now() }),\n true,\n );\n }\n },\n existsStateAsync: function (_id: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n existsObjectAsync: function (_id: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n getObjectAsync: function (_id: string, _enumName: null | string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n setObjectAsync: function (_id: string, _obj: ioBroker.Object): Promise<{ id: string }> {\n return Promise.reject(new Error('Not implemented'));\n },\n extendObjectAsync: function (_id: string, _obj: Partial): Promise<{ id: string }> {\n return Promise.reject(new Error('Not implemented'));\n },\n deleteObjectAsync: function (_id: string, _isRecursive?: boolean): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n createStateAsync: function (\n _name: string,\n _initValue: undefined | ioBroker.StateValue | ioBroker.State,\n _forceCreation:\n | boolean\n | undefined\n | Record\n | Partial\n | ((err: Error | null) => void),\n _common?: Partial | ((err: Error | null) => void),\n _native?: Record | ((err: Error | null) => void),\n ): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n createAliasAsync: function (\n _name: string,\n _alias: string | CommonAlias,\n _forceCreation: boolean | Partial | undefined,\n _common?: Partial | Record,\n _native?: Record,\n ): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n deleteStateAsync: function (_id: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n writeFileAsync: function (\n _adapter: string,\n _fileName: string | Buffer,\n _data?: string | Buffer,\n ): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n readFileAsync: function (_adapter: string, _fileName?: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n unlinkAsync: function (_adapter: string, _fileName?: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n delFileAsync: function (_adapter: string, _fileName?: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n renameAsync: function (_adapter: string, _oldName: string, _newName?: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n renameFileAsync: function (_adapter: string, _oldName: string, _newName?: string): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n getHistoryAsync: function (\n _instance: string | (ioBroker.GetHistoryOptions & { id: string; timeout?: number | string }),\n _options?: ioBroker.GetHistoryOptions & { id?: string; timeout?: number | string },\n ): Promise {\n return Promise.reject(new Error('Not implemented'));\n },\n httpGetAsync: function (\n _url: string,\n _options?: {\n timeout?: number;\n responseType?: ResponseType;\n headers?: Record;\n basicAuth?: { user: string; password: string } | null;\n bearerAuth?: string;\n validateCertificate?: boolean;\n },\n ): Promise<{\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n }> {\n return Promise.reject(new Error('Not implemented'));\n },\n httpPostAsync: function (\n _url: string,\n _data: any,\n _options: {\n timeout?: number;\n responseType?: ResponseType;\n headers?: Record;\n basicAuth?: { user: string; password: string } | null;\n bearerAuth?: string;\n validateCertificate?: boolean;\n },\n ): Promise<{\n statusCode: number | null;\n data: any;\n headers: Record;\n responseTime: number;\n }> {\n return Promise.reject(new Error('Not implemented'));\n },\n };\n\n // Create advanced functions that can modify objects\n if ((adapter.config as JavaScriptAdapterConfig).enableSetObject) {\n sandbox.setObject = function (\n id: string,\n obj: ioBroker.Object,\n callback?: (err?: Error | null, res?: { id: string }) => void,\n ): void {\n if (id && typeof id === 'string' && id.startsWith('system.adapter.')) {\n sandbox.log(\n `Using setObject on system object ${id} can be dangerous (protected instance attributes may be lost)`,\n 'info',\n );\n }\n if (debug) {\n sandbox.log(\n `setObject(id=${id}, obj=${JSON.stringify(obj)}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n setImmediate(function () {\n try {\n callback.call(sandbox, null, { id });\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n });\n }\n } else {\n if (sandbox.verbose) {\n sandbox.log(`setObject(id=${id}, obj=${JSON.stringify(obj)})`, 'info');\n }\n adapter.setForeignObject(id, obj, (err, res) => {\n if (!err) {\n // Update meta object data\n context.updateObjectContext(id, obj);\n }\n if (typeof callback === 'function') {\n try {\n callback.call(sandbox, err, res);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }\n });\n }\n };\n sandbox.extendObject = function (\n id: string,\n obj: Partial,\n callback?: (err?: Error | null, obj?: { id: string }) => void,\n ): void {\n if (debug) {\n sandbox.log(\n `extendObject(id=${id}, obj=${JSON.stringify(obj)}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n setTimeout(function () {\n try {\n callback.call(sandbox, null, { id });\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, 0);\n }\n } else {\n if (sandbox.verbose) {\n sandbox.log(`extendObject(id=${id}, obj=${JSON.stringify(obj)})`, 'info');\n }\n if (callback) {\n adapter.extendForeignObject(id, JSON.parse(JSON.stringify(obj)), callback);\n } else {\n void adapter.extendForeignObject(id, JSON.parse(JSON.stringify(obj)));\n }\n }\n };\n sandbox.deleteObject = function (id: string, isRecursive?: boolean, callback?: ioBroker.ErrorCallback): void {\n if (typeof isRecursive === 'function') {\n callback = isRecursive;\n isRecursive = false;\n }\n if (debug) {\n sandbox.log(\n `deleteObject(id=${id}) - ${words._('was not executed, while debug mode is active')}`,\n 'warn',\n );\n if (typeof callback === 'function') {\n setTimeout(function () {\n try {\n callback.call(sandbox);\n } catch (err: unknown) {\n errorInCallback(err as Error);\n }\n }, 0);\n }\n } else {\n if (sandbox.verbose) {\n sandbox.log(`deleteObject(id=${id})`, 'info');\n }\n adapter.delForeignObject(id, { recursive: isRecursive }, callback);\n }\n };\n }\n\n // promisify methods on the sandbox\n sandbox.existsStateAsync = promisify(sandbox.existsState);\n sandbox.existsObjectAsync = promisify(sandbox.existsObject);\n sandbox.getObjectAsync = promisify(sandbox.getObject);\n sandbox.setObjectAsync = promisify(sandbox.setObject);\n sandbox.extendObjectAsync = promisify(sandbox.extendObject);\n sandbox.deleteObjectAsync = promisify(sandbox.deleteObject);\n sandbox.createStateAsync = promisify(sandbox.createState);\n sandbox.createAliasAsync = promisify(sandbox.createAlias);\n sandbox.deleteStateAsync = promisify(sandbox.deleteState);\n sandbox.writeFileAsync = promisify(sandbox.writeFile);\n sandbox.readFileAsync = promisify(sandbox.readFile);\n sandbox.unlinkAsync = promisify(sandbox.unlink);\n sandbox.delFileAsync = promisify(sandbox.delFile);\n sandbox.renameAsync = promisify(sandbox.rename);\n sandbox.renameFileAsync = promisify(sandbox.renameFile);\n sandbox.getHistoryAsync = promisify(sandbox.getHistory);\n sandbox.httpGetAsync = promisify(sandbox.httpGet);\n sandbox.httpPostAsync = promisify(sandbox.httpPost);\n\n // Make all predefined properties and methods readonly so scripts cannot overwrite them\n for (const prop of Object.keys(sandbox)) {\n Object.defineProperty(sandbox, prop, {\n configurable: false,\n writable: false,\n });\n }\n\n return sandbox;\n}\n"]} \ No newline at end of file diff --git a/build/main.js b/build/main.js index a8c2bf980..533d7c519 100644 --- a/build/main.js +++ b/build/main.js @@ -2228,6 +2228,20 @@ class JavaScript extends adapter_core_1.Adapter { for (let i = 0; i < this.scripts[name].intervals.length; i++) { clearInterval(this.scripts[name].intervals[i]); } + // Stop all delayed states (setStateDelayed timers) + for (const stateId of Object.keys(this.timers)) { + if (this.timers[stateId]) { + for (let i = this.timers[stateId].length - 1; i >= 0; i--) { + if (this.timers[stateId][i].scriptName === name) { + clearTimeout(this.timers[stateId][i].t); + this.timers[stateId].splice(i, 1); + } + } + if (!this.timers[stateId].length) { + delete this.timers[stateId]; + } + } + } // Stop all scheduled jobs for (let i = 0; i < this.scripts[name].schedules.length; i++) { if (this.scripts[name].schedules[i]) { diff --git a/build/main.js.map b/build/main.js.map index 4fe81636d..4f07f8873 100644 --- a/build/main.js.map +++ b/build/main.js.map @@ -1 +1 @@ -{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,qCAAqD;AACrD,qCAAwF;AACxF,yCAAiD;AACjD,2DAA4D;AAC5D,6CAAkE;AAClE,yCAA8C;AAC9C,wDAAgC;AAEhC,kDAAoC;AACpC,oDAAsC;AACtC,8CAAgC;AAChC,oDAAsC;AACtC,gDAAkC;AAClC,kDAAoC;AACpC,kDAAoC;AACpC,8CAAgC;AAChC,4CAA8B;AAC9B,gDAAkC;AAClC,gDAAkC;AAClC,kEAAoD;AACpD,oDAAsC;AACtC,gDAAkC;AAElC,sCAAsC;AACtC,kDAAoC;AACpC,6CAA+B;AAC/B,sCAAsC;AACtC,yDAA2C;AAC3C,4DAA8C;AAE9C,yDAA6G;AAK7G,yCAAsC;AACtC,gEAAwC;AACxC,uCAAuD;AACvD,2CAAwC;AACxC,uEAAqE;AACrE,6CAAkE;AAClE,+CAAiE;AACjE,iEAAwG;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AG,IAAI,CAAC;oBAC7B,OAAO,CAAC,IAAI,CAAC,CAAC;gBAClB,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACX,CAAC;CACJ;AAED,SAAS,eAAe,CACpB,KAAe,EACf,gBAA0E;IAE1E,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,gBAAgB,CAAC,MAAM,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1D,IAAI,gBAAgB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;YAC7B,IAAI,gBAAgB,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;gBAClC,OAAO,IAAI,CAAC;YAChB,CAAC;YACD,OAAO,GAAG,IAAI,CAAC;QACnB,CAAC;aAAM,IAAI,gBAAgB,CAAC,KAAK,KAAK,KAAK,EAAE,CAAC;YAC1C,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC;AAED,uEAAuE;AACvE,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC1B,yCAAyC;IACzC,MAAM,CAAC,OAAO,GAAG,CAAC,OAA4C,EAAE,EAAE,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC;AAC/F,CAAC;KAAM,CAAC;IACJ,wCAAwC;IACxC,CAAC,GAAG,EAAE,CAAC,IAAI,UAAU,EAAE,CAAC,EAAE,CAAC;AAC/B,CAAC","sourcesContent":["/*\n * Javascript adapter\n *\n * The MIT License (MIT)\n *\n * Copyright (c) 2014-2024 bluefox ,\n *\n * Copyright (c) 2014 hobbyquaker\n */\n\nimport { Script, type ScriptOptions } from 'node:vm';\nimport { readFileSync, existsSync, statSync, writeFileSync, type Stats } from 'node:fs';\nimport { join, sep, normalize } from 'node:path';\nimport { fork, type ForkOptions } from 'node:child_process';\nimport { setTypeScriptResolveOptions, Server } from 'virtual-tsc';\nimport { isDeepStrictEqual } from 'node:util';\nimport prettier from 'prettier';\n\nimport * as dgram from 'node:dgram';\nimport * as crypto from 'node:crypto';\nimport * as dns from 'node:dns';\nimport * as events from 'node:events';\nimport * as http from 'node:http';\nimport * as https from 'node:https';\nimport * as http2 from 'node:http2';\nimport * as net from 'node:net';\nimport * as os from 'node:os';\nimport * as path from 'node:path';\nimport * as util from 'node:util';\nimport * as child_process from 'node:child_process';\nimport * as stream from 'node:stream';\nimport * as zlib from 'node:zlib';\n\n// @ts-expect-error no types available\nimport * as suncalc from 'suncalc2';\nimport * as axios from 'axios';\n// @ts-expect-error no types available\nimport * as wake_on_lan from 'wake_on_lan';\nimport * as nodeSchedule from 'node-schedule';\n\nimport { getAbsoluteDefaultDataDir, Adapter, EXIT_CODES, type AdapterOptions } from '@iobroker/adapter-core';\nimport type SentryPlugin from '@iobroker/plugin-sentry';\nimport type { GetTimesResult } from 'suncalc';\nimport type { CompileResult } from 'virtual-tsc/build/util';\n\nimport { Mirror } from './lib/mirror';\nimport ProtectFs from './lib/protectFs';\nimport { setLanguage, getLanguage } from './lib/words';\nimport { sandBox } from './lib/sandbox';\nimport { requestModuleNameByUrl } from './lib/nodeModulesManagement';\nimport { createEventObject, type EventObj } from './lib/eventObj';\nimport { type AstroEventName, Scheduler } from './lib/scheduler';\nimport { targetTsLib, tsCompilerOptions, jsDeclarationCompilerOptions } from './lib/typescriptSettings';\nimport { hashSource } from './lib/tools';\nimport {\n resolveTypescriptLibs,\n resolveTypings,\n scriptIdToTSFilename,\n transformScriptBeforeCompilation,\n transformGlobalDeclarations,\n} from './lib/typescriptTools';\nimport type {\n FileSubscriptionResult,\n JavascriptContext,\n JavaScriptAdapterConfig,\n JsScript,\n ScriptType,\n SubscriptionResult,\n SubscribeObject,\n JavascriptTimer,\n SandboxType,\n LogMessage,\n DebugState,\n} from './types';\nimport type { PatternEventCompareFunction } from './lib/patternCompareFunctions';\nimport { decryptText } from './lib/crypto';\n\ntype MODULES = {\n fs: ProtectFs;\n 'fs/promises': ProtectFs['promises'];\n dgram: typeof dgram;\n crypto: typeof crypto;\n dns: typeof dns;\n events: typeof events;\n http: typeof http;\n https: typeof https;\n http2: typeof http2;\n net: typeof net;\n os: typeof os;\n path: typeof path;\n util: typeof util;\n child_process: typeof child_process;\n stream: typeof stream;\n zlib: typeof zlib;\n suncalc: typeof suncalc;\n axios: typeof axios;\n wake_on_lan: typeof wake_on_lan;\n nodeSchedule: typeof nodeSchedule;\n};\n\n/**\n * List of forbidden Locations for a mirror directory\n * relative to the default data directory\n * ATTENTION: the same list is also located in index_m.html!!\n */\nconst forbiddenMirrorLocations: string[] = [\n 'backup-objects',\n 'files',\n 'backitup',\n '../backups',\n '../node_modules',\n '../log',\n];\n\nconst packageJson: Record = JSON.parse(readFileSync(`${__dirname}/../package.json`).toString());\nconst SCRIPT_CODE_MARKER = 'script.js.';\n\nlet webstormDebug: string | undefined;\n\nconst isCI = !!process.env.CI;\n\n// ambient declarations for typescript\nlet tsAmbient: Record;\n\n// TypeScript's scripts are only recompiled if their source hash changes.\n// If an adapter update fixes the compilation bugs, a user won't notice until the changes and re-save the script.\n// To avoid that, we also include the\n// adapter version and TypeScript version in the hash\nconst tsSourceHashBase = `versions:adapter=${packageJson.version},typescript=${packageJson.dependencies.typescript}`;\n\n// taken from here: https://stackoverflow.com/questions/11887934/how-to-check-if-dst-daylight-saving-time-is-in-effect-and-if-so-the-offset\nfunction dstOffsetAtDate(dateInput: Date): number {\n const fullYear: number = dateInput.getFullYear() | 0;\n // \"Leap Years are any year that can be exactly divided by 4 (2012, 2016, etc.)\n // except if it can be exactly divided by 100, then it isn't (2100, 2200, etc.)\n // except if it can be exactly divided by 400, then it is (2000, 2400)\"\n // (https://www.mathsisfun.com/leap-years.html).\n const isLeapYear: 1 | 0 = ((fullYear & 3) | ((fullYear / 100) & 3)) === 0 ? 1 : 0;\n // (fullYear & 3) = (fullYear % 4), but faster\n //Alternative:var isLeapYear=(new Date(currentYear,1,29,12)).getDate()===29?1:0\n const fullMonth: number = dateInput.getMonth() | 0;\n return (\n // 1. We know what the time since the Epoch really is\n +dateInput - // same as the dateInput.getTime() method\n // 2. We know what the time since the Epoch at the start of the year is\n +new Date(fullYear, 0) - // day defaults to 1 if not explicitly zeroed\n // 3. Now, subtract what we would expect the time to be if daylight savings\n // did not exist. This yields the time-offset due to daylight savings.\n // Calculate the day of the year in the Gregorian calendar\n // The code below works based upon the facts of signed right shifts\n // • (x) >> n: shifts n and fills in the n highest bits with 0s\n // • (-x) >> n: shifts n and fills in the n highest bits with 1s\n // (This assumes that x is a positive integer)\n ((((-1 + // the first day in the year is day 1\n (31 & (-fullMonth >> 4)) + // January // (-11)>>4 = -1\n ((28 + isLeapYear) & ((1 - fullMonth) >> 4)) + // February\n (31 & ((2 - fullMonth) >> 4)) + // March\n (30 & ((3 - fullMonth) >> 4)) + // April\n (31 & ((4 - fullMonth) >> 4)) + // May\n (30 & ((5 - fullMonth) >> 4)) + // June\n (31 & ((6 - fullMonth) >> 4)) + // July\n (31 & ((7 - fullMonth) >> 4)) + // August\n (30 & ((8 - fullMonth) >> 4)) + // September\n (31 & ((9 - fullMonth) >> 4)) + // October\n (30 & ((10 - fullMonth) >> 4)) + // November\n // There are no months past December: the year rolls into the next.\n // Thus, \"fullMonth\" is 0-based, so it will never be 12 in JavaScript\n\n (dateInput.getDate() | 0)) & // get day of the month\n 0xffff) *\n 24 *\n 60 + // 24 hours in a day, 60 minutes in an hour\n (dateInput.getHours() & 0xff) * 60 + // 60 minutes in an hour\n (dateInput.getMinutes() & 0xff)) |\n 0) *\n 60 *\n 1000 - // 60 seconds in a minute * 1000 milliseconds in a second\n (dateInput.getSeconds() & 0xff) * 1000 - // 1000 milliseconds in a second\n dateInput.getMilliseconds()\n );\n}\n\nconst regExGlobalOld = /_global$/;\nconst regExGlobalNew = /script\\.js\\.global\\./;\n\nfunction checkIsGlobal(obj: ioBroker.ScriptObject): boolean {\n return obj?.common && (regExGlobalOld.test(obj.common.name) || regExGlobalNew.test(obj._id));\n}\n\nfunction fileMatching(sub: FileSubscriptionResult, id: string, fileName: string): boolean {\n if (sub.idRegEx) {\n if (!sub.idRegEx.test(id)) {\n return false;\n }\n } else {\n if (sub.id !== id) {\n return false;\n }\n }\n if (sub.fileRegEx) {\n if (!sub.fileRegEx.test(fileName)) {\n return false;\n }\n } else {\n if (sub.fileNamePattern !== fileName) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction getNextTimeEvent(time: string, useNextDay?: boolean): Date {\n const now: Date = getAstroStartOfDay();\n const [timeHours, timeMinutes] = time.split(':');\n const nTimeHours = parseInt(timeHours, 10);\n const nTimeMinutes = parseInt(timeMinutes, 10);\n if (\n useNextDay &&\n (now.getHours() > nTimeHours || (now.getHours() === nTimeHours && now.getMinutes() > nTimeMinutes))\n ) {\n now.setDate(now.getDate() + 1);\n }\n\n now.setHours(nTimeHours);\n now.setMinutes(nTimeMinutes);\n\n return now;\n}\n\nfunction getAstroStartOfDay(): Date {\n const d = new Date();\n d.setMinutes(0);\n d.setSeconds(0);\n d.setMilliseconds(0);\n d.setTime(d.getTime() - d.getTimezoneOffset() * 60 * 1000);\n d.setUTCHours(0);\n\n return d;\n}\n\nfunction formatHoursMinutesSeconds(date: Date): string {\n const h = String(date.getHours());\n const m = String(date.getMinutes());\n const s = String(date.getSeconds());\n\n return `${h.padStart(2, '0')}:${m.padStart(2, '0')}:${s.padStart(2, '0')}`;\n}\n\n// Due to a npm bug, virtual-tsc may be hoisted to the top level node_modules, but\n// TypeScript may still be in the adapter level (https://npm.community/t/packages-with-peerdependencies-are-incorrectly-hoisted/4794),\n// so we need to tell virtual-tsc where TypeScript is\nsetTypeScriptResolveOptions({\n paths: [require.resolve('typescript')],\n});\n\n// compiler instance for global JS declarations\nconst jsDeclarationServer: Server = new Server(jsDeclarationCompilerOptions, isCI ? false : undefined);\n/**\n * Stores the IDs of script objects whose change should be ignored because\n * the compiled source was just updated\n */\n\nclass JavaScript extends Adapter {\n declare public config: JavaScriptAdapterConfig;\n\n private readonly context: JavascriptContext;\n\n private errorLogFunction: {\n error: (msg: string) => void;\n warn: (msg: string) => void;\n info: (msg: string) => void;\n debug: (msg: string) => void;\n silly: (msg: string) => void;\n } = {\n error: (msg: string) => console.error(msg),\n warn: (msg: string) => console.warn(msg),\n info: (msg: string) => console.log(msg),\n debug: (msg: string) => console.debug(msg),\n silly: (msg: string) => console.debug(msg),\n };\n\n private readonly mods: MODULES;\n\n private objectsInitDone = false;\n private statesInitDone = false;\n\n private objects: Record = {};\n private states: Record = {};\n private readonly interimStateValues: Record = {};\n private readonly stateIds: string[] = [];\n private readonly subscriptions: SubscriptionResult[] = [];\n private readonly subscriptionsFile: FileSubscriptionResult[] = [];\n private readonly subscriptionsObject: SubscribeObject[] = [];\n private readonly subscribedPatterns: Record = {};\n private readonly subscribedPatternsFile: Record = {};\n private readonly adapterSubs: Record = {};\n private readonly timers: { [scriptName: string]: JavascriptTimer[] } = {};\n private readonly _enums: string[] = [];\n private readonly names: { [name: string]: string | string[] } = {}; // name: id\n private readonly scripts: Record = {};\n private password: string = '';\n private readonly messageBusHandlers: Record<\n string,\n Record void }[]>\n > = {};\n private readonly logSubscriptions: Record<\n string,\n {\n sandbox: SandboxType;\n cb: (info: LogMessage) => void;\n id: number;\n severity: ioBroker.LogLevel | '*';\n }[]\n > = {};\n private readonly tempDirectories: { [scriptName: string]: string } = {}; // name: path\n private readonly folderCreationVerifiedObjects: Record = {};\n\n /** if logs are subscribed or not */\n private logSubscribed = false;\n\n private timeSettings: {\n format12: boolean;\n leadingZeros: boolean;\n } = { format12: false, leadingZeros: true };\n\n private dayScheduleTimer: NodeJS.Timeout | null = null; // schedule for astrological day\n private sunScheduleTimer: NodeJS.Timeout | null = null; // schedule for sun moment times\n private timeScheduleTimer: NodeJS.Timeout | null = null; // schedule for astrological day\n\n private activeStr = ''; // enabled state prefix\n\n private mirror: Mirror | undefined;\n\n private stopCounters: Record = {};\n\n private setStateCountCheckInterval: NodeJS.Timeout | null = null;\n\n private globalScript = '';\n /** Generated declarations for global TypeScripts */\n private globalDeclarations = '';\n // Remember which definitions the global scripts\n // have access to, because it depends on the compilation order\n private knownGlobalDeclarationsByScript: Record = {};\n private globalScriptLines = 0;\n // compiler instance for typescript\n private tsServer: Server;\n\n private readonly ignoreObjectChange: Set = new Set();\n\n private debugState: DebugState = {\n scriptName: '',\n child: null,\n promiseOnEnd: null,\n paused: false,\n started: 0,\n running: false,\n };\n\n constructor(options: Partial = {}) {\n options = {\n ...options,\n name: 'javascript', // adapter name\n useFormatDate: true,\n /**\n * If the JS-Controller catches an unhandled error, this will be called,\n * so we have a chance to handle it ourselves.\n */\n error: (err: Error): boolean => {\n // Identify unhandled errors originating from callbacks in scripts\n // These are not caught by wrapping the execution code in try-catch\n if (err && typeof err.stack === 'string') {\n const scriptCodeMarkerIndex = err.stack.indexOf(SCRIPT_CODE_MARKER);\n if (scriptCodeMarkerIndex > -1) {\n // This is a script error\n let scriptName = err.stack.substring(scriptCodeMarkerIndex);\n scriptName = scriptName.substring(0, scriptName.indexOf(':'));\n this.logError(scriptName, 'Error:', err);\n\n // Leave the script running for now\n // signal to the JS-Controller that we handled the error ourselves\n return true;\n }\n // check if a path contains adaptername but not own node_module\n // this regex matched \"iobroker.javascript/\" if NOT followed by \"node_modules\"\n if (!err.stack.match(/iobroker\\.javascript[/\\\\](?!.*node_modules).*/g)) {\n // This is an error without any info on origin (mostly async errors like connection errors)\n // also consider it as being from a script\n this.log.error(\n 'An error happened which is most likely from one of your scripts, but the originating script could not be detected.',\n );\n this.log.error(`Error: ${err.message}`);\n this.log.error(err.stack);\n\n // signal to the JS-Controller that we handled the error ourselves\n return true;\n }\n }\n\n return false;\n },\n };\n\n super(options as AdapterOptions);\n\n this.on('objectChange', this.onObjectChange.bind(this));\n this.on('stateChange', this.onStateChange.bind(this));\n this.on('ready', this.onReady.bind(this));\n this.on('message', this.onMessage.bind(this));\n this.on('unload', this.onUnload.bind(this));\n this.on('fileChange', this.onFileChange.bind(this));\n this.on('log', this.onLog.bind(this));\n\n this.mods = {\n fs: {} as ProtectFs,\n 'fs/promises': {} as ProtectFs['promises'],\n dgram,\n crypto,\n dns,\n events,\n http,\n https,\n http2,\n net,\n os,\n path,\n util,\n child_process,\n stream,\n zlib,\n\n suncalc,\n axios,\n wake_on_lan,\n nodeSchedule,\n };\n\n // check the webstorm debug and just debug modes\n let debugMode: string | undefined;\n if (process.argv) {\n for (let a = 1; a < process.argv.length; a++) {\n if (process.argv[a].startsWith('--webstorm')) {\n webstormDebug = process.argv[a].replace(/^(.*?=\\s*)/, '');\n }\n if (process.argv[a] === '--debugScript') {\n if (!process.argv[a + 1]) {\n console.log('No script name provided');\n process.exit(300);\n } else {\n debugMode = process.argv[a + 1];\n }\n }\n }\n }\n\n this.context = {\n mods: this.mods,\n objects: this.objects,\n states: this.states,\n interimStateValues: this.interimStateValues,\n stateIds: this.stateIds,\n errorLogFunction: this.errorLogFunction,\n subscriptions: this.subscriptions,\n subscriptionsFile: this.subscriptionsFile,\n subscriptionsObject: this.subscriptionsObject,\n subscribedPatterns: this.subscribedPatterns,\n subscribedPatternsFile: this.subscribedPatternsFile,\n adapterSubs: this.adapterSubs,\n cacheObjectEnums: {},\n timers: this.timers,\n enums: this._enums,\n names: this.names,\n scripts: this.scripts,\n messageBusHandlers: this.messageBusHandlers,\n logSubscriptions: this.logSubscriptions,\n tempDirectories: this.tempDirectories,\n folderCreationVerifiedObjects: this.folderCreationVerifiedObjects,\n\n isEnums: false, // If some subscription wants enum\n channels: null,\n devices: null,\n logWithLineInfo: this.logWithLineInfo.bind(this),\n scheduler: null,\n timerId: 0,\n rulesOpened: null, // opened rules\n language: this.language || 'en',\n\n updateLogSubscriptions: this.updateLogSubscriptions.bind(this),\n convertBackStringifiedValues: this.convertBackStringifiedValues.bind(this),\n updateObjectContext: this.updateObjectContext.bind(this),\n prepareStateObject: this.prepareStateObject.bind(this),\n debugMode,\n getAbsoluteDefaultDataDir,\n adapter: this as unknown as ioBroker.Adapter,\n logError: this.logError.bind(this),\n allowSelfSignedCerts: false,\n };\n\n this.tsServer = new Server(tsCompilerOptions, this.tsLog);\n }\n\n async onObjectChange(id: string, obj?: ioBroker.Object | null): Promise {\n // Check if we should ignore this change (once!) because we just updated the compiled sources\n if (this.ignoreObjectChange.has(id)) {\n // Update the cached script object and do nothing more\n this.objects[id] = obj as ioBroker.Object;\n this.ignoreObjectChange.delete(id);\n return;\n }\n\n // When still in initializing: already remember current values,\n // but data structures are initialized elsewhere\n if (!this.objectsInitDone) {\n if (obj) {\n this.objects[id] = obj;\n }\n return;\n }\n\n if (id.startsWith('enum.')) {\n // clear cache\n this.context.cacheObjectEnums = {};\n\n // update this._enums array\n if (obj) {\n // If new\n if (!this._enums.includes(id)) {\n this._enums.push(id);\n this._enums.sort();\n }\n } else {\n const pos = this._enums.indexOf(id);\n // if deleted\n if (pos !== -1) {\n this._enums.splice(pos, 1);\n }\n }\n }\n\n if (id === 'system.config' && obj?.common?.language) {\n // set language for debug messages\n setLanguage(obj.common.language);\n this.language = obj.common.language;\n this.context.language = this.language as ioBroker.Languages;\n }\n\n // update stored time format for variables.dayTime\n if (id === `${this.namespace}.variables.dayTime` && obj?.native) {\n this.timeSettings.format12 = obj.native.format12 || false;\n this.timeSettings.leadingZeros = obj.native.leadingZeros === undefined ? true : obj.native.leadingZeros;\n }\n\n // send changes to the disk mirror\n this.mirror?.onObjectChange(id, obj as ioBroker.ScriptObject | null);\n\n const formerObj = this.objects[id];\n\n this.updateObjectContext(id, obj); // Update all Meta object data\n\n // for the alias object changes on the state objects, we need to manually update the\n // state cache value, because the new value is only published on the next change\n if (obj?.type === 'state' && id.startsWith('alias.0.')) {\n // execute async for speed\n this.getForeignStateAsync(id)\n .then(state => {\n if (state) {\n this.states[id] = state;\n } else if (this.states[id] !== undefined) {\n delete this.states[id];\n }\n })\n .catch(() => {\n /* ignore */\n });\n }\n\n this.subscriptionsObject.forEach(sub => {\n // ToDo: implement comparing with id.0.* too\n if (sub.pattern === id) {\n try {\n sub.callback(id, obj);\n } catch (err: any) {\n this.log.error(`Error in callback: ${err.toString()}`);\n }\n }\n });\n\n // handle Script object updates\n if (!obj && formerObj?.type === 'script') {\n // Object Deleted just now\n if (checkIsGlobal(formerObj)) {\n // it was a global Script, and it was enabled and is now deleted => restart adapter\n if (formerObj.common.enabled) {\n this.log.info(`Active global Script ${id} deleted. Restart instance.`);\n this.restart();\n }\n } else if (formerObj.common?.engine === `system.adapter.${this.namespace}`) {\n // It was a non-global Script and deleted => stop and remove it\n await this.stopScript(id);\n\n // delete scriptEnabled.blabla variable\n const idActive = `scriptEnabled.${id.substring(SCRIPT_CODE_MARKER.length)}`;\n await this.delStateAsync(idActive);\n await this.delObjectAsync(idActive);\n\n // delete scriptProblem.blabla variable\n const idProblem = `scriptProblem.${id.substring(SCRIPT_CODE_MARKER.length)}`;\n await this.delStateAsync(idProblem);\n await this.delObjectAsync(idProblem);\n }\n } else if (!formerObj && obj?.type === 'script') {\n // New script that does not exist before\n if (checkIsGlobal(obj)) {\n // new global script added => restart adapter\n if (obj.common.enabled) {\n this.log.info(`Active global Script ${id} created. Restart instance.`);\n this.restart();\n }\n } else if (obj.common?.engine === `system.adapter.${this.namespace}`) {\n // new non-global script - create states for scripts\n await this.createActiveObject(id, !!obj.common.enabled);\n await this.createProblemObject(id);\n if (obj.common.enabled) {\n // if enabled => Start a script\n await this.loadScriptById(id);\n }\n }\n } else if (obj?.type === 'script' && formerObj?.common) {\n // Script changed ...\n if (checkIsGlobal(obj)) {\n if (obj.common.enabled || formerObj.common.enabled) {\n this.log.info(`Global Script ${id} updated. Restart instance.`);\n this.restart();\n }\n } else {\n // No global script\n if (obj.common?.engine === `system.adapter.${this.namespace}`) {\n // create states for scripts\n await this.createActiveObject(id, !!obj.common.enabled);\n await this.createProblemObject(id);\n }\n\n if (\n (formerObj.common.enabled && !obj.common.enabled) ||\n (formerObj.common.engine === `system.adapter.${this.namespace}` &&\n obj.common.engine !== `system.adapter.${this.namespace}`)\n ) {\n // Script disabled\n if (formerObj.common.enabled && formerObj.common.engine === `system.adapter.${this.namespace}`) {\n // Remove it from executing\n await this.stopScript(id);\n }\n } else if (\n (!formerObj.common.enabled && obj.common.enabled) ||\n (formerObj.common.engine !== `system.adapter.${this.namespace}` &&\n obj.common.engine === `system.adapter.${this.namespace}`)\n ) {\n // Script enabled\n\n if (obj.common.enabled && obj.common.engine === `system.adapter.${this.namespace}`) {\n // Start script\n await this.loadScriptById(id);\n }\n } else {\n // if (obj.common.source !== formerObj.common.source) {\n // Source changed => restart the script\n this.stopCounters[id] = this.stopCounters[id] ? this.stopCounters[id] + 1 : 1;\n void this.stopScript(id).then(() => {\n // only start again after stop when \"last\" object change to prevent problems on\n // multiple changes in fast frequency\n if (!--this.stopCounters[id]) {\n void this.loadScriptById(id);\n }\n });\n }\n }\n }\n }\n\n onStateChange(id: string, state?: ioBroker.State | null): void {\n if (this.interimStateValues[id] !== undefined) {\n // any update invalidates the remembered interim value\n delete this.interimStateValues[id];\n }\n if (!id || id.startsWith('messagebox.') || id.startsWith('log.')) {\n return;\n }\n\n if (id === `${this.namespace}.debug.to` && state && !state.ack) {\n if (!this.context.debugMode) {\n this.debugSendToInspector(state.val);\n }\n return;\n }\n\n // When still in initializing: already remember current values,\n // but data structures are initialized elsewhere\n if (!this.statesInitDone) {\n if (state) {\n this.states[id] = state;\n }\n return;\n }\n\n const oldState: ioBroker.State | null | undefined = this.states[id];\n if (state) {\n if (oldState) {\n // enable or disable script\n if (!state.ack && id.startsWith(this.activeStr) && this.objects[id]?.native?.script) {\n void this.extendForeignObject(this.objects[id].native.script, {\n common: { enabled: state.val },\n });\n }\n\n // monitor if the adapter is alive and send all subscriptions once more, after the adapter goes online\n if (/*oldState && */ oldState.val === false && state.val && id.endsWith('.alive')) {\n if (this.adapterSubs[id]) {\n const parts = id.split('.');\n const a = `${parts[2]}.${parts[3]}`;\n for (let t = 0; t < this.adapterSubs[id].length; t++) {\n this.log.info(`Detected coming adapter \"${a}\". Send subscribe: ${this.adapterSubs[id][t]}`);\n this.sendTo(a, 'subscribe', this.adapterSubs[id][t]);\n }\n }\n }\n } else if (/*!oldState && */ !this.stateIds.includes(id)) {\n this.stateIds.push(id);\n this.stateIds.sort();\n }\n this.states[id] = state;\n } else {\n if (oldState) {\n delete this.states[id];\n }\n state = {} as ioBroker.State;\n const pos = this.stateIds.indexOf(id);\n if (pos !== -1) {\n this.stateIds.splice(pos, 1);\n }\n }\n const _eventObj = createEventObject(\n this.context,\n id,\n this.convertBackStringifiedValues(id, state),\n this.convertBackStringifiedValues(id, oldState),\n );\n\n // if this state matches any subscriptions\n for (let i = 0, l = this.subscriptions.length; i < l; i++) {\n const sub = this.subscriptions[i];\n if (sub?.patternCompareFunctions && patternMatching(_eventObj, sub.patternCompareFunctions)) {\n try {\n sub.callback(_eventObj);\n } catch (err: any) {\n this.log.error(`Error in callback: ${err.toString()}`);\n }\n }\n }\n }\n\n onFileChange(id: string, fileName: string, size: number | null): void {\n // if this file matches any subscriptions\n for (let i = 0, l = this.subscriptionsFile.length; i < l; i++) {\n const sub = this.subscriptionsFile[i];\n if (sub && fileMatching(sub, id, fileName)) {\n try {\n sub.callback(id, fileName, size, sub.withFile);\n } catch (err: any) {\n this.log.error(`Error in callback: ${err.toString()}`);\n }\n }\n }\n }\n\n async onUnload(callback: () => void): Promise {\n await this.debugStop();\n this.stopTimeSchedules();\n if (this.setStateCountCheckInterval) {\n clearInterval(this.setStateCountCheckInterval);\n this.setStateCountCheckInterval = null;\n }\n await this.stopAllScripts();\n if (typeof callback === 'function') {\n callback();\n }\n }\n\n async onReady(): Promise {\n this.errorLogFunction = this.log;\n this.context.errorLogFunction = this.log;\n\n this.config.maxSetStatePerMinute = parseInt(this.config.maxSetStatePerMinute as unknown as string, 10) || 1000;\n this.config.maxTriggersPerScript = parseInt(this.config.maxTriggersPerScript as unknown as string, 10) || 100;\n\n if (this.supportsFeature?.('PLUGINS')) {\n const sentryInstance: InstanceType = this.getPluginInstance('sentry') as InstanceType<\n typeof SentryPlugin\n >;\n if (sentryInstance) {\n const Sentry = sentryInstance.getSentryObject();\n Sentry?.withScope(scope => {\n scope.addEventProcessor((event, _hint) => {\n if (event.exception?.values?.[0]) {\n const eventData = event.exception.values[0];\n if (\n eventData.stacktrace?.frames &&\n Array.isArray(eventData.stacktrace.frames) &&\n eventData.stacktrace.frames.length\n ) {\n // Exclude event if script Marker is included\n if (\n eventData.stacktrace.frames.find(frame =>\n frame.filename?.includes(SCRIPT_CODE_MARKER),\n )\n ) {\n return null;\n }\n // Exclude event if own directory is included but not inside own node_modules\n const ownNodeModulesDir = join(__dirname, 'node_modules');\n if (\n !eventData.stacktrace.frames.find(\n frame =>\n frame.filename?.includes(__dirname) &&\n !frame.filename.includes(ownNodeModulesDir),\n )\n ) {\n return null;\n }\n // We have exception data and did not sort it out, so report it\n return event;\n }\n }\n\n // No exception in it ... do not report\n return null;\n });\n });\n }\n }\n\n await this.main();\n }\n\n onMessage(obj: ioBroker.Message): void {\n switch (obj?.command) {\n // process messageTo commands\n case 'toScript':\n case 'jsMessageBus':\n if (\n obj.message &&\n (obj.message.instance === null ||\n obj.message.instance === undefined ||\n `javascript.${obj.message.instance}` === this.namespace ||\n obj.message.instance === this.namespace)\n ) {\n Object.keys(this.messageBusHandlers).forEach(name => {\n // the script name could be script.js.xxx or only xxx\n if (\n (!obj.message.script || obj.message.script === name) &&\n this.messageBusHandlers[name][obj.message.message]\n ) {\n this.messageBusHandlers[name][obj.message.message].forEach(handler => {\n const sandbox = handler.sandbox;\n\n sandbox.verbose && sandbox.log(`onMessage: ${JSON.stringify(obj.message)}`, 'info');\n\n try {\n if (obj.callback) {\n handler.cb.call(sandbox, obj.message.data, (result: any) => {\n if (sandbox.verbose) {\n sandbox.log(`onMessage result: ${JSON.stringify(result)}`, 'info');\n }\n\n this.sendTo(obj.from, obj.command, result, obj.callback);\n });\n } else {\n handler.cb.call(sandbox, obj.message.data, (result: any) => {\n sandbox.verbose &&\n sandbox.log(`onMessage result: ${JSON.stringify(result)}`, 'info');\n });\n }\n } catch (err: unknown) {\n void this.setState(\n `scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`,\n true,\n true,\n );\n this.logError(name, 'Error in callback:', err as Error);\n }\n });\n }\n });\n }\n break;\n\n case 'loadTypings': {\n // Load typings for the editor\n const typings: Record = {};\n\n // try to load TypeScript lib files from disk\n try {\n const typescriptLibs = resolveTypescriptLibs(targetTsLib);\n Object.assign(typings, typescriptLibs);\n } catch {\n /* ok, no lib then */\n }\n\n // provide the already-loaded ioBroker typings and global script declarations\n Object.assign(typings, tsAmbient);\n\n // also provide the known global declarations for each global script\n for (const globalScriptPaths of Object.keys(this.knownGlobalDeclarationsByScript)) {\n typings[`${globalScriptPaths}.d.ts`] = this.knownGlobalDeclarationsByScript[globalScriptPaths];\n }\n\n if (obj.callback) {\n this.sendTo(obj.from, obj.command, { typings }, obj.callback);\n }\n break;\n }\n\n case 'calcAstroAll': {\n if (obj.message) {\n const sunriseOffset =\n parseInt(\n obj.message.sunriseOffset === undefined\n ? this.config.sunriseOffset\n : obj.message.sunriseOffset,\n 10,\n ) || 0;\n const sunsetOffset =\n parseInt(\n obj.message.sunsetOffset === undefined\n ? this.config.sunsetOffset\n : obj.message.sunsetOffset,\n 10,\n ) || 0;\n const longitude =\n parseFloat(\n obj.message.longitude === undefined ? this.config.longitude : obj.message.longitude,\n ) || 0;\n const latitude =\n parseFloat(obj.message.latitude === undefined ? this.config.latitude : obj.message.latitude) ||\n 0;\n const today = getAstroStartOfDay();\n let astroEvents: GetTimesResult & { nextSunrise: Date; nextSunset: Date } = {} as GetTimesResult & {\n nextSunrise: Date;\n nextSunset: Date;\n };\n try {\n astroEvents = this.mods.suncalc.getTimes(today, latitude, longitude);\n } catch (err: unknown) {\n this.log.error(`Cannot calculate astro data: ${err as Error}`);\n }\n if (astroEvents) {\n try {\n astroEvents.nextSunrise = this.getAstroEvent(\n today,\n obj.message.sunriseEvent || this.config.sunriseEvent,\n obj.message.sunriseLimitStart || this.config.sunriseLimitStart,\n obj.message.sunriseLimitEnd || this.config.sunriseLimitEnd,\n sunriseOffset,\n false,\n latitude,\n longitude,\n true,\n );\n astroEvents.nextSunset = this.getAstroEvent(\n today,\n obj.message.sunsetEvent || this.config.sunsetEvent,\n obj.message.sunsetLimitStart || this.config.sunsetLimitStart,\n obj.message.sunsetLimitEnd || this.config.sunsetLimitEnd,\n sunsetOffset,\n true,\n latitude,\n longitude,\n true,\n );\n } catch (err: unknown) {\n this.log.error(`Cannot calculate astro data: ${err as Error}`);\n }\n }\n\n const result: Record = {};\n const keys = Object.keys(astroEvents).sort(\n (a, b) =>\n (astroEvents as unknown as Record)[a] -\n (astroEvents as unknown as Record)[b],\n );\n keys.forEach(key => {\n const validDate =\n (astroEvents as unknown as Record)[key] !== null &&\n !isNaN((astroEvents as unknown as Record)[key].getTime());\n\n result[key] = {\n isValidDate: validDate,\n serverTime: validDate\n ? formatHoursMinutesSeconds((astroEvents as unknown as Record)[key])\n : 'n/a',\n date: validDate\n ? (astroEvents as unknown as Record)[key].toISOString()\n : 'n/a',\n };\n });\n\n if (obj.callback) {\n this.sendTo(obj.from, obj.command, result, obj.callback);\n }\n }\n break;\n }\n\n case 'calcAstro': {\n if (obj.message) {\n const longitude =\n parseFloat(\n obj.message.longitude === undefined ? this.config.longitude : obj.message.longitude,\n ) || 0;\n const latitude =\n parseFloat(obj.message.latitude === undefined ? this.config.latitude : obj.message.latitude) ||\n 0;\n const today = getAstroStartOfDay();\n\n const sunriseEvent = obj.message?.sunriseEvent || this.config.sunriseEvent;\n const sunriseLimitStart = obj.message?.sunriseLimitStart || this.config.sunriseLimitStart;\n const sunriseLimitEnd = obj.message?.sunriseLimitEnd || this.config.sunriseLimitEnd;\n const sunriseOffset =\n parseInt(\n obj.message.sunriseOffset === undefined\n ? this.config.sunriseOffset\n : obj.message.sunriseOffset,\n 10,\n ) || 0;\n const nextSunrise = this.getAstroEvent(\n today,\n sunriseEvent,\n sunriseLimitStart,\n sunriseLimitEnd,\n sunriseOffset,\n false,\n latitude,\n longitude,\n true,\n );\n\n const sunsetEvent = obj.message?.sunsetEvent || this.config.sunsetEvent;\n const sunsetLimitStart = obj.message?.sunsetLimitStart || this.config.sunsetLimitStart;\n const sunsetLimitEnd = obj.message?.sunsetLimitEnd || this.config.sunsetLimitEnd;\n const sunsetOffset =\n parseInt(\n obj.message.sunsetOffset === undefined\n ? this.config.sunsetOffset\n : obj.message.sunsetOffset,\n 10,\n ) || 0;\n const nextSunset = this.getAstroEvent(\n today,\n sunsetEvent,\n sunsetLimitStart,\n sunsetLimitEnd,\n sunsetOffset,\n true,\n latitude,\n longitude,\n true,\n );\n\n const validDateSunrise = nextSunrise !== null && !isNaN(nextSunrise.getTime());\n const validDateSunset = nextSunset !== null && !isNaN(nextSunset.getTime());\n\n this.log.debug(\n `calcAstro sunrise: ${sunriseEvent} -> start ${sunriseLimitStart}, end: ${sunriseLimitEnd}, offset: ${sunriseOffset} - ${validDateSunrise ? nextSunrise.toISOString() : 'n/a'}`,\n );\n this.log.debug(\n `calcAstro sunset: ${sunsetEvent} -> start ${sunsetLimitStart}, end: ${sunsetLimitEnd}, offset: ${sunsetOffset} - ${validDateSunset ? nextSunset.toISOString() : 'n/a'}`,\n );\n\n if (obj.callback) {\n this.sendTo(\n obj.from,\n obj.command,\n {\n nextSunrise: {\n isValidDate: validDateSunrise,\n serverTime: validDateSunrise ? formatHoursMinutesSeconds(nextSunrise) : 'n/a',\n date: nextSunrise.toISOString(),\n },\n nextSunset: {\n isValidDate: validDateSunset,\n serverTime: validDateSunset ? formatHoursMinutesSeconds(nextSunset) : 'n/a',\n date: nextSunset.toISOString(),\n },\n },\n obj.callback,\n );\n }\n }\n break;\n }\n\n case 'debug': {\n if (!this.context.debugMode) {\n this.debugStart(obj.message);\n }\n break;\n }\n\n case 'debugStop': {\n if (!this.context.debugMode) {\n void this.debugStop().then(() => console.log('stopped'));\n }\n break;\n }\n\n case 'rulesOn': {\n this.context.rulesOpened = obj.message;\n console.log(`Enable messaging for ${this.context.rulesOpened}`);\n break;\n }\n\n case 'rulesOff': {\n // maybe if (context.rulesOpened === obj.message)\n console.log(`Disable messaging for ${this.context.rulesOpened}`);\n this.context.rulesOpened = null;\n break;\n }\n\n case 'getIoBrokerDataDir': {\n if (obj.callback) {\n this.sendTo(\n obj.from,\n obj.command,\n {\n dataDir: getAbsoluteDefaultDataDir(),\n sep,\n },\n obj.callback,\n );\n }\n break;\n }\n\n case 'chatCompletion': {\n // Proxy chat completion requests to an OpenAI-compatible API endpoint\n if (obj.callback) {\n const baseUrl = (obj.message?.baseUrl || '').trim();\n const apiKey = (obj.message?.apiKey || '').trim();\n const chatModel = (obj.message?.model || '').trim();\n const messages = obj.message?.messages;\n const provider = (obj.message?.provider || 'openai').trim();\n // Anthropic, Gemini, and DeepSeek always require an API key; OpenAI-compatible allows empty key with custom base URL\n if (\n !apiKey &&\n (provider === 'anthropic' || provider === 'gemini' || provider === 'deepseek' || !baseUrl)\n ) {\n this.sendTo(obj.from, obj.command, { error: 'No API key provided' }, obj.callback);\n break;\n }\n if (!chatModel || !messages) {\n this.sendTo(obj.from, obj.command, { error: 'Model and messages are required' }, obj.callback);\n break;\n }\n\n let url: string;\n const chatHeaders: Record = {\n 'Content-Type': 'application/json',\n };\n let bodyObj: Record;\n\n if (provider === 'anthropic') {\n url = 'https://api.anthropic.com/v1/messages';\n chatHeaders['x-api-key'] = apiKey;\n chatHeaders['anthropic-version'] = '2023-06-01';\n const systemMessages = messages.filter((m: { role: string }) => m.role === 'system');\n const nonSystemMessages = messages.filter((m: { role: string }) => m.role !== 'system');\n const systemText = systemMessages.map((m: { content: string }) => m.content).join('\\n\\n');\n bodyObj = {\n model: chatModel,\n max_tokens: 8192,\n stream: false,\n ...(systemText ? { system: systemText } : {}),\n messages: nonSystemMessages,\n };\n } else if (provider === 'gemini') {\n url = 'https://generativelanguage.googleapis.com/v1beta/openai/chat/completions';\n if (apiKey) {\n chatHeaders.Authorization = `Bearer ${apiKey}`;\n }\n bodyObj = { model: chatModel, messages, stream: false };\n } else if (provider === 'deepseek') {\n url = 'https://api.deepseek.com/chat/completions';\n chatHeaders.Authorization = `Bearer ${apiKey}`;\n bodyObj = { model: chatModel, messages, stream: false };\n } else {\n url = `${baseUrl || 'https://api.openai.com/v1'}/chat/completions`;\n if (apiKey) {\n chatHeaders.Authorization = `Bearer ${apiKey}`;\n }\n bodyObj = { model: chatModel, messages, stream: false };\n }\n\n const body = JSON.stringify(bodyObj);\n const bodyBuffer = Buffer.from(body, 'utf8');\n chatHeaders['Content-Length'] = bodyBuffer.length;\n\n let urlObj: URL;\n try {\n urlObj = new URL(url);\n } catch {\n this.sendTo(obj.from, obj.command, { error: `Invalid API URL: ${url}` }, obj.callback);\n break;\n }\n const isHttps = urlObj.protocol === 'https:';\n const requestModule = isHttps ? https : http;\n\n const req = requestModule.request(\n url,\n {\n method: 'POST',\n headers: chatHeaders,\n timeout: 600000,\n ...(isHttps && this.config.allowSelfSignedCerts ? { rejectUnauthorized: false } : {}),\n },\n res => {\n let data = '';\n res.on('data', (chunk: Buffer) => {\n data += chunk.toString();\n });\n res.on('end', () => {\n if (res.statusCode === 200) {\n try {\n const parsed = JSON.parse(data);\n const content =\n provider === 'anthropic'\n ? parsed.content?.[0]?.text || ''\n : parsed.choices?.[0]?.message?.content || '';\n if (!content) {\n this.sendTo(\n obj.from,\n obj.command,\n { error: 'Empty response from API' },\n obj.callback,\n );\n } else {\n this.sendTo(\n obj.from,\n obj.command,\n { success: true, content },\n obj.callback,\n );\n }\n } catch {\n this.sendTo(\n obj.from,\n obj.command,\n { error: 'Invalid JSON response from API' },\n obj.callback,\n );\n }\n } else {\n let errorMsg = `API returned status ${res.statusCode}`;\n try {\n const parsed = JSON.parse(data);\n if (parsed.error?.message) {\n errorMsg = parsed.error.message;\n }\n } catch {\n // ignore parse error\n }\n this.sendTo(obj.from, obj.command, { error: errorMsg }, obj.callback);\n }\n });\n },\n );\n\n req.on('error', (err: Error) => {\n this.sendTo(\n obj.from,\n obj.command,\n { error: `Connection failed: ${err.message}` },\n obj.callback,\n );\n });\n\n req.on('timeout', () => {\n req.destroy();\n this.sendTo(obj.from, obj.command, { error: 'Connection timeout (600s)' }, obj.callback);\n });\n\n req.write(bodyBuffer);\n req.end();\n }\n break;\n }\n\n case 'testApiConnection': {\n // Test connection to an OpenAI-compatible API endpoint\n if (obj.callback) {\n const baseUrl = (obj.message?.baseUrl || '').trim();\n const apiKey = (obj.message?.apiKey || '').trim();\n const provider = (obj.message?.provider || 'openai').trim();\n // Anthropic, Gemini, and DeepSeek always require an API key; OpenAI-compatible allows empty key with custom base URL\n if (\n !apiKey &&\n (provider === 'anthropic' || provider === 'gemini' || provider === 'deepseek' || !baseUrl)\n ) {\n this.sendTo(obj.from, obj.command, { error: 'No API key provided' }, obj.callback);\n break;\n }\n\n let url: string;\n const testHeaders: Record = {\n 'Content-Type': 'application/json',\n };\n\n if (provider === 'anthropic') {\n url = 'https://api.anthropic.com/v1/models';\n testHeaders['x-api-key'] = apiKey;\n testHeaders['anthropic-version'] = '2023-06-01';\n } else if (provider === 'gemini') {\n url = 'https://generativelanguage.googleapis.com/v1beta/openai/models';\n if (apiKey) {\n testHeaders.Authorization = `Bearer ${apiKey}`;\n }\n } else if (provider === 'deepseek') {\n url = 'https://api.deepseek.com/models';\n testHeaders.Authorization = `Bearer ${apiKey}`;\n } else {\n url = `${baseUrl || 'https://api.openai.com/v1'}/models`;\n if (apiKey) {\n testHeaders.Authorization = `Bearer ${apiKey}`;\n }\n }\n\n let urlObj: URL;\n try {\n urlObj = new URL(url);\n } catch {\n this.sendTo(obj.from, obj.command, { error: `Invalid API URL: ${url}` }, obj.callback);\n break;\n }\n const isHttps = urlObj.protocol === 'https:';\n const requestModule = isHttps ? https : http;\n\n const req = requestModule.request(\n url,\n {\n method: 'GET',\n headers: testHeaders,\n timeout: 10000,\n ...(isHttps && this.config.allowSelfSignedCerts ? { rejectUnauthorized: false } : {}),\n },\n res => {\n let data = '';\n res.on('data', (chunk: Buffer) => {\n data += chunk.toString();\n });\n res.on('end', () => {\n if (res.statusCode === 200) {\n try {\n const parsed = JSON.parse(data);\n const models: string[] = (parsed.data || [])\n .map((m: { id: string }) =>\n m.id.startsWith('models/') ? m.id.substring(7) : m.id,\n )\n .sort();\n this.sendTo(\n obj.from,\n obj.command,\n { success: true, models, count: models.length },\n obj.callback,\n );\n } catch {\n this.sendTo(\n obj.from,\n obj.command,\n { error: 'Invalid JSON response from API' },\n obj.callback,\n );\n }\n } else if (res.statusCode === 401) {\n this.sendTo(\n obj.from,\n obj.command,\n { error: 'Invalid API key (401)' },\n obj.callback,\n );\n } else if (res.statusCode === 403) {\n this.sendTo(obj.from, obj.command, { error: 'Access denied (403)' }, obj.callback);\n } else {\n this.sendTo(\n obj.from,\n obj.command,\n { error: `API returned status ${res.statusCode}` },\n obj.callback,\n );\n }\n });\n },\n );\n\n req.on('error', (err: Error) => {\n this.sendTo(\n obj.from,\n obj.command,\n { error: `Connection failed: ${err.message}` },\n obj.callback,\n );\n });\n\n req.on('timeout', () => {\n req.destroy();\n this.sendTo(obj.from, obj.command, { error: 'Connection timeout (10s)' }, obj.callback);\n });\n\n req.end();\n }\n break;\n }\n\n case 'prettier': {\n // Format the code with Prettier\n if (obj.message && typeof obj.message.code === 'string') {\n try {\n prettier\n .format(obj.message.code, {\n parser: obj.message.type === 'typescript' ? 'babel-ts' : 'babel',\n printWidth: 120,\n semi: true,\n tabWidth: 4,\n useTabs: false,\n trailingComma: 'all',\n singleQuote: true,\n singleAttributePerLine: true,\n endOfLine: 'lf',\n bracketSpacing: true,\n arrowParens: 'avoid',\n quoteProps: 'as-needed',\n })\n .then(formattedCode => {\n if (obj.callback) {\n this.sendTo(obj.from, obj.command, { code: formattedCode }, obj.callback);\n } else {\n this.logWithLineInfo(`Formatted code:\\n${formattedCode}`);\n }\n })\n .catch(e => {\n this.logError('Prettier', 'Error formatting code:', e as Error);\n this.sendTo(obj.from, obj.command, { error: (e as Error).toString() }, obj.callback);\n });\n } catch (e) {\n this.logError('Prettier', 'Error formatting code:', e as Error);\n this.sendTo(obj.from, obj.command, { error: (e as Error).toString() }, obj.callback);\n }\n } else {\n this.sendTo(obj.from, obj.command, { error: 'No code provided' }, obj.callback);\n }\n break;\n }\n }\n }\n\n onLog(msg: any): void {\n Object.keys(this.logSubscriptions).forEach((name: string): void =>\n this.logSubscriptions[name].forEach(handler => {\n if (\n typeof handler.cb === 'function' &&\n (handler.severity === '*' || handler.severity === msg.severity)\n ) {\n handler.sandbox.logHandler = handler.severity || '*';\n handler.cb.call(handler.sandbox, msg);\n handler.sandbox.logHandler = undefined;\n }\n }),\n );\n }\n\n logError(scriptName: string, msg: string, e: Error, offs?: number): void {\n const stack = e.stack ? e.stack.toString().split('\\n') : e ? e.toString() : '';\n if (!msg.includes('\\n')) {\n msg = msg.replace(/[: ]*$/, ': ');\n }\n if (!msg.endsWith(' ')) {\n msg += ':';\n }\n if (!scriptName.startsWith(SCRIPT_CODE_MARKER)) {\n scriptName = SCRIPT_CODE_MARKER + scriptName;\n }\n\n this.errorLogFunction.error(`${scriptName}: ${msg}${this.fixLineNo(stack[0])}`);\n for (let i = offs || 1; i < stack.length; i++) {\n if (!stack[i]) {\n continue;\n }\n if (stack[i].match(/runInNewContext|javascript\\.js:/)) {\n break;\n }\n this.errorLogFunction.error(`${scriptName}: ${this.fixLineNo(stack[i])}`);\n }\n }\n\n logWithLineInfo(msg: string): void {\n this.errorLogFunction.warn(msg);\n\n // get current error stack\n const stack = new Error().stack?.split('\\n');\n\n if (stack) {\n for (let i = 3; i < stack.length; i++) {\n if (!stack[i]) {\n continue;\n }\n if (stack[i].match(/runInContext|runInNewContext|javascript\\.js:/)) {\n break;\n }\n this.errorLogFunction.warn(this.fixLineNo(stack[i]));\n }\n }\n }\n\n async main(): Promise {\n // Patch the font as it sometimes is wrong\n if (!this.context.debugMode) {\n if (await this.patchFont()) {\n this.log.debug('Font patched');\n }\n }\n\n this.log.debug(`config.subscribe (Do not subscribe all states on start): ${this.config.subscribe}`);\n\n // correct jsonConfig for admin\n const instObj: ioBroker.InstanceObject | null | undefined = await this.getForeignObjectAsync(\n `system.adapter.${this.namespace}`,\n );\n if (instObj?.common) {\n if (instObj.common.adminUI?.config !== 'json') {\n if (instObj.common.adminUI) {\n instObj.common.adminUI.config = 'json';\n } else {\n instObj.common.adminUI = { config: 'json' };\n }\n void this.setForeignObject(instObj._id, instObj);\n }\n }\n\n if (webstormDebug) {\n this.errorLogFunction = {\n error: console.error,\n warn: console.warn,\n info: console.info,\n debug: console.log,\n silly: console.log,\n };\n this.context.errorLogFunction = this.errorLogFunction;\n }\n this.activeStr = `${this.namespace}.scriptEnabled.`;\n\n this.mods.fs = new ProtectFs(this.log, getAbsoluteDefaultDataDir());\n this.mods['fs/promises'] = this.mods.fs.promises; // to avoid require('fs/promises');\n\n // try to read TS declarations\n try {\n tsAmbient = {\n 'javascript.d.ts': readFileSync(this.mods.path.join(__dirname, 'lib/javascript.d.ts'), 'utf8'),\n };\n this.tsServer.provideAmbientDeclarations(tsAmbient);\n jsDeclarationServer.provideAmbientDeclarations(tsAmbient);\n } catch (err: unknown) {\n this.log.warn(`Could not read TypeScript ambient declarations: ${err as Error}`);\n // This should not happen, so send an error report to Sentry\n if (this.supportsFeature && this.supportsFeature('PLUGINS')) {\n const sentryInstance = this.getPluginInstance('sentry');\n if (sentryInstance) {\n const sentryObject = sentryInstance.getSentryObject();\n sentryObject?.captureException(err as Error);\n }\n }\n // Keep the adapter from crashing when the included typings cannot be read\n tsAmbient = {};\n }\n\n await this.installLibraries();\n // Load the TS declarations for Node.js and all 3rd party modules\n this.loadTypeScriptDeclarations();\n\n await this.getData();\n this.context.scheduler = new Scheduler(\n this.log,\n Date,\n this.mods.suncalc,\n this.config.latitude,\n this.config.longitude,\n );\n await this.dayTimeSchedules();\n await this.sunTimeSchedules();\n await this.timeSchedule();\n\n // Store allowSelfSignedCerts on the context, so sandbox HTTP functions can use it\n // without setting the global process.env.NODE_TLS_REJECT_UNAUTHORIZED (which affects all adapters in compact mode)\n this.context.allowSelfSignedCerts = this.config.allowSelfSignedCerts;\n\n const doc = await this.getObjectViewAsync('script', 'javascript', {});\n if (doc?.rows?.length) {\n // assemble global script\n for (let g = 0; g < doc.rows.length; g++) {\n const obj = doc.rows[g].value;\n if (checkIsGlobal(obj)) {\n if (obj && obj.common) {\n const engineType = (obj.common.engineType || '').toLowerCase();\n\n if (obj.common.enabled) {\n if (engineType.startsWith('typescript')) {\n // TypeScript\n this.log.info(`${obj._id}: compiling TypeScript source...`);\n // In order to compile global TypeScript, we need to do some transformations\n // 1. For top-level-await, some statements must be wrapped in an immediately-invoked async function\n // 2. If any global script uses `import`, the declarations are no longer visible if they are not exported with `declare global`\n const transformedSource = transformScriptBeforeCompilation(obj.common.source, true);\n // The source code must be transformed in order to support top level await\n // Global scripts must not be treated as a module, otherwise their methods\n // cannot be found by the normal scripts\n // We need to hash both global declarations that are known until now\n // AND the script source, because changing either can change the compilation output\n const sourceHash: string = hashSource(\n tsSourceHashBase + this.globalDeclarations + transformedSource,\n );\n\n let compiled: string | undefined;\n let declarations: string | undefined;\n // If we already stored the compiled source code and the original source hash,\n // use the hash to check whether we can rely on the compiled source code or\n // if we need to compile it again\n if (\n typeof obj.common.compiled === 'string' &&\n typeof obj.common.sourceHash === 'string' &&\n sourceHash === obj.common.sourceHash\n ) {\n // We can reuse the stored source\n compiled = obj.common.compiled;\n declarations = obj.common.declarations;\n this.log.info(\n `${obj._id}: source code did not change, using cached compilation result...`,\n );\n } else {\n // We don't have a hashed source code, or the original source changed, compile it\n const filename = scriptIdToTSFilename(obj._id);\n let tsCompiled: CompileResult;\n try {\n tsCompiled = this.tsServer.compile(filename, transformedSource);\n } catch (err: unknown) {\n this.log.error(`${obj._id}: TypeScript compilation failed:\\n${err as Error}`);\n continue;\n }\n\n const errors = tsCompiled.diagnostics\n .map(diag => `${diag.annotatedSource}\\n`)\n .join('\\n');\n\n if (tsCompiled.success) {\n if (errors.length > 0) {\n this.log.warn(\n `${obj._id}: TypeScript compilation completed with errors:\\n${errors}`,\n );\n } else {\n this.log.info(`${obj._id}: TypeScript compilation successful`);\n }\n compiled = tsCompiled.result;\n // Global scripts that have been transformed to support `import` need to have their declarations transformed aswell\n declarations = transformGlobalDeclarations(tsCompiled.declarations || '');\n\n const newCommon: {\n compiled: string | undefined;\n declarations?: string;\n sourceHash: string;\n } = {\n sourceHash,\n compiled,\n };\n if (declarations) {\n newCommon.declarations = declarations;\n }\n\n // Store the compiled source and the original source hash, so we don't need to do the work again next time\n this.ignoreObjectChange.add(obj._id); // ignore the next change and don't restart scripts\n void this.extendForeignObject(obj._id, {\n common: newCommon,\n });\n } else {\n this.log.error(`${obj._id}: TypeScript compilation failed:\\n${errors}`);\n continue;\n }\n }\n this.globalScript += `${compiled}\\n`;\n // if declarations were generated, remember them\n if (declarations != null) {\n this.provideDeclarationsForGlobalScript(obj._id, declarations);\n }\n } else {\n // javascript\n const sourceCode = obj.common.source;\n this.globalScript += `${sourceCode}\\n`;\n\n // try to compile the declarations so TypeScripts can use\n // functions defined in global JavaScripts\n const filename = scriptIdToTSFilename(obj._id);\n let tsCompiled: CompileResult;\n try {\n tsCompiled = jsDeclarationServer.compile(filename, sourceCode);\n } catch (err: unknown) {\n this.log.warn(\n `${obj._id}: Error while generating type declarations, skipping:\\n${err as Error}`,\n );\n continue;\n }\n // if declarations were generated, remember them\n if (tsCompiled.success && tsCompiled.declarations != null) {\n this.provideDeclarationsForGlobalScript(obj._id, tsCompiled.declarations);\n }\n }\n }\n }\n }\n }\n }\n\n this.globalScript = this.globalScript.replace(/\\r\\n/g, '\\n');\n this.globalScriptLines = this.globalScript.split(/\\n/g).length - 1;\n\n if (doc?.rows?.length) {\n // load all scripts\n for (let i = 0; i < doc.rows.length; i++) {\n if (!checkIsGlobal(doc.rows[i].value)) {\n void this.loadScript(doc.rows[i].value);\n }\n }\n }\n\n if (this.config.mirrorPath?.trim()) {\n this.config.mirrorInstance = parseInt(this.config.mirrorInstance as unknown as string, 10) || 0;\n if (this.instance === this.config.mirrorInstance) {\n const ioBDataDir = getAbsoluteDefaultDataDir() + sep;\n this.config.mirrorPath = normalize(this.config.mirrorPath);\n let mirrorForbidden = false;\n for (let dir of forbiddenMirrorLocations) {\n dir = join(ioBDataDir, dir) + sep;\n if (dir.includes(this.config.mirrorPath) || this.config.mirrorPath.startsWith(dir)) {\n this.log.error(`The Mirror directory is not allowed to be a central ioBroker directory!`);\n this.log.error(`Directory ${this.config.mirrorPath} is not allowed to mirror files!`);\n mirrorForbidden = true;\n break;\n }\n }\n if (!mirrorForbidden) {\n this.mirror = new Mirror({\n adapter: this,\n log: this.log,\n diskRoot: this.config.mirrorPath,\n });\n }\n }\n }\n\n // CHeck setState counter per minute and stop a script if too high\n this.setStateCountCheckInterval = setInterval(() => {\n Object.keys(this.scripts).forEach(id => {\n if (!this.scripts[id]) {\n return;\n }\n const currentSetStatePerMinuteCounter = this.scripts[id].setStatePerMinuteCounter;\n this.scripts[id].setStatePerMinuteCounter = 0;\n if (currentSetStatePerMinuteCounter > this.config.maxSetStatePerMinute) {\n this.scripts[id].setStatePerMinuteProblemCounter++;\n this.log.debug(\n `${id}: Script has reached the maximum of ${this.config.maxSetStatePerMinute} setState calls per minute in ${this.scripts[id].setStatePerMinuteProblemCounter} consecutive minutes`,\n );\n // Allow \"too high counters\" for 1 minute for script starts or such and only\n // stop the script when lasts longer\n if (this.scripts[id].setStatePerMinuteProblemCounter > 1) {\n this.log.error(\n `${id}: Script is calling setState more than ${this.config.maxSetStatePerMinute} times per minute! Stopping Script now! Please check your script!`,\n );\n void this.stopScript(id);\n }\n } else if (this.scripts[id].setStatePerMinuteProblemCounter > 0) {\n this.scripts[id].setStatePerMinuteProblemCounter--;\n this.log.debug(\n `Script ${id} has NOT reached the maximum of ${this.config.maxSetStatePerMinute} setState calls per minute. Decrease problem counter to ${this.scripts[id].setStatePerMinuteProblemCounter}`,\n );\n }\n });\n }, 60000);\n }\n\n private loadTypeScriptDeclarations(): void {\n // try to load the typings on disk for all 3rd party modules\n const packages = [\n 'node', // this provides auto-completion for most builtins\n '@iobroker/types', // this provides auto-completion for most builtins\n ];\n // Also include user-selected libraries (but only those that are also installed)\n if (typeof this.config?.libraries === 'string' && typeof this.config.libraryTypings === 'string') {\n const installedLibs = this.config.libraries\n .split(/[,;\\s]+/)\n .map(s => s.trim().split('@')[0])\n .filter(s => !!s);\n\n const wantsTypings = this.config.libraryTypings\n .split(/[,;\\s]+/)\n .map(s => s.trim())\n .filter(s => !!s);\n // Add all installed libraries the user has requested typings for to the list of packages\n for (const lib of installedLibs) {\n if (wantsTypings.includes(lib) && !packages.includes(lib)) {\n packages.push(lib);\n }\n }\n // Some packages have submodules (e.g., rxjs/operators) that are not exposed through the main entry point\n // If typings are requested for them, also add them if the base module is installed\n for (const lib of wantsTypings) {\n // Extract the package name and check if we need to add it\n if (!lib.includes('/')) {\n continue;\n }\n const pkgName = lib.substring(0, lib.indexOf('/'));\n\n if (installedLibs.includes(pkgName) && !packages.includes(lib)) {\n packages.push(lib);\n }\n }\n }\n for (const pkg of packages) {\n let pkgTypings = resolveTypings(\n pkg,\n this.getAdapterScopedPackageIdentifier ? this.getAdapterScopedPackageIdentifier(pkg) : pkg,\n // node needs ambient typings, so we don't wrap it in declare module\n pkg !== 'node',\n );\n if (!pkgTypings) {\n // Create the empty dummy declarations so users don't get the \"not found\" error\n // for installed packages\n if (pkg.includes('/')) {\n pkgTypings = {\n [`node_modules/${pkg}/index.d.ts`]: `declare module \"${pkg}\";`,\n };\n } else {\n pkgTypings = {\n [`node_modules/@types/${pkg}/index.d.ts`]: `declare module \"${pkg}\";`,\n };\n }\n }\n this.log.debug(`Loaded TypeScript definitions for \"${pkg}\": ${JSON.stringify(Object.keys(pkgTypings))}`);\n // remember the declarations for the editor\n Object.assign(tsAmbient, pkgTypings);\n // and give the language servers access to them\n this.tsServer.provideAmbientDeclarations(pkgTypings);\n jsDeclarationServer.provideAmbientDeclarations(pkgTypings);\n }\n }\n\n updateObjectContext(id: string, obj: ioBroker.Object | null | undefined): void {\n if (obj) {\n // add state to state ID's list\n if (obj.type === 'state') {\n if (!this.stateIds.includes(id)) {\n this.stateIds.push(id);\n this.stateIds.sort();\n }\n if (this.context.devices && this.context.channels) {\n const parts = id.split('.');\n parts.pop();\n const chn = parts.join('.');\n this.context.channels[chn] ||= [];\n this.context.channels[chn].push(id);\n\n parts.pop();\n const dev = parts.join('.');\n this.context.devices[dev] ||= [];\n this.context.devices[dev].push(id);\n }\n }\n } else {\n // delete object from state ID's list\n const pos = this.stateIds.indexOf(id);\n if (pos !== -1) {\n this.stateIds.splice(pos, 1);\n }\n if (this.context.devices && this.context.channels) {\n const parts = id.split('.');\n parts.pop();\n const chn = parts.join('.');\n if (this.context.channels[chn]) {\n const posChn = this.context.channels[chn].indexOf(id);\n posChn !== -1 && this.context.channels[chn].splice(posChn, 1);\n }\n\n parts.pop();\n const dev = parts.join('.');\n if (this.context.devices[dev]) {\n const posDev = this.context.devices[dev].indexOf(id);\n posDev !== -1 && this.context.devices[dev].splice(posDev, 1);\n }\n }\n\n delete this.folderCreationVerifiedObjects[id];\n }\n\n if (!obj && this.objects[id]) {\n // objects were deleted\n this.removeFromNames(id);\n delete this.objects[id];\n } else if (obj && !this.objects[id]) {\n // object was added\n this.objects[id] = obj;\n this.addToNames(obj);\n } else if (obj && this.objects[id].common) {\n // Object just changed\n this.objects[id] = obj;\n\n const n = this.getName(id);\n let nn = this.objects[id].common ? this.objects[id].common.name : '';\n\n if (nn && typeof nn === 'object') {\n nn = nn[getLanguage()] || nn.en;\n }\n\n if (n !== nn) {\n if (n) {\n this.removeFromNames(id);\n }\n if (nn) {\n this.addToNames(obj);\n }\n }\n }\n }\n\n async stopAllScripts(): Promise {\n const scripts = Object.keys(this.scripts);\n const promises: Promise[] = [];\n for (let i = 0; i < scripts.length; i++) {\n promises.push(this.stopScript(scripts[i]));\n }\n return Promise.all(promises).then(() => {});\n }\n\n convertBackStringifiedValues(\n id: string,\n state: ioBroker.State | null | undefined,\n ): ioBroker.State | null | undefined {\n if (\n state &&\n typeof state.val === 'string' &&\n this.objects[id]?.common &&\n (this.objects[id].common.type === 'array' || this.objects[id].common.type === 'object')\n ) {\n try {\n state.val = JSON.parse(state.val);\n } catch (err: any) {\n if (id.startsWith('javascript.') || id.startsWith('0_userdata.0')) {\n this.log.info(\n `Could not parse value for id \"${id}\" into ${this.objects[id].common.type}: ${err.toString()}`,\n );\n } else {\n this.log.debug(\n `Could not parse value for id \"${id}\" into ${this.objects[id].common.type}: ${err.toString()}`,\n );\n }\n }\n }\n return state;\n }\n\n prepareStateObjectSimple(id: string, state: ioBroker.StateValue, isAck: boolean): ioBroker.State {\n // otherwise, assume that the given state is the value to be set\n const oState: ioBroker.State = { val: state, ack: isAck } as ioBroker.State;\n\n return this.prepareStateObject(id, oState);\n }\n\n prepareStateObject(id: string, state: ioBroker.SettableState | null): ioBroker.State {\n let oState: ioBroker.State;\n\n if (state && typeof state === 'object') {\n oState = state as ioBroker.State;\n } else {\n oState = { val: null } as ioBroker.State;\n }\n\n if (this.config.subscribe) {\n return oState;\n }\n // set other values to have a full state object\n // mirrors logic from statesInRedis\n if (oState.ts === undefined) {\n oState.ts = Date.now();\n }\n\n if (oState.q === undefined) {\n oState.q = 0;\n }\n\n oState.from =\n typeof oState.from === 'string' && oState.from !== '' ? oState.from : `system.adapter.${this.namespace}`;\n\n if (oState.lc === undefined) {\n const formerStateValue = this.interimStateValues[id] || this.states[id];\n if (!formerStateValue) {\n oState.lc = oState.ts;\n } else {\n // isDeepStrictEqual works on objects and primitive values\n const hasChanged = !isDeepStrictEqual(formerStateValue.val, oState.val);\n if (!formerStateValue.lc || hasChanged) {\n oState.lc = oState.ts;\n } else {\n oState.lc = formerStateValue.lc;\n }\n }\n }\n\n return oState;\n }\n\n async getData(): Promise {\n await this.subscribeForeignObjectsAsync('*');\n\n if (!this.config.subscribe) {\n await this.subscribeForeignStatesAsync('*');\n } else {\n await this.subscribeStatesAsync('debug.to');\n await this.subscribeStatesAsync('scriptEnabled.*');\n }\n\n this.log.info('requesting all states');\n\n const statesPromise = this.getForeignStatesAsync('*')\n .then(res => {\n if (!res) {\n this.log.error(`Could not initialize states: no result`);\n this.terminate(EXIT_CODES.START_IMMEDIATELY_AFTER_STOP);\n return;\n }\n if (!this.config.subscribe) {\n this.states = Object.assign(res, this.states);\n this.context.states = this.states;\n\n this.addGetProperty(this.states);\n }\n\n // remember all IDs\n for (const id in res) {\n if (Object.prototype.hasOwnProperty.call(res, id)) {\n this.stateIds.push(id);\n }\n }\n this.statesInitDone = true;\n this.log.info('received all states');\n })\n .catch((err: any) => {\n this.log.error(`Could not initialize states: ${err?.message || 'no result'}`);\n this.terminate(EXIT_CODES.START_IMMEDIATELY_AFTER_STOP);\n });\n\n this.log.info('requesting all objects');\n\n const objectsPromise = this.getObjectListAsync({ include_docs: true })\n .then(res => {\n if (!res?.rows) {\n this.log.error(`Could not initialize objects: no result`);\n this.terminate(EXIT_CODES.START_IMMEDIATELY_AFTER_STOP);\n return;\n }\n this.objects = {};\n this.context.objects = this.objects;\n for (let i = 0; i < res.rows.length; i++) {\n if (!res.rows[i].doc) {\n this.log.debug(`Got empty object for index ${i} (${res.rows[i].id})`);\n continue;\n }\n if (this.objects[res.rows[i].doc._id] === undefined) {\n // If was already there, ignore\n this.objects[res.rows[i].doc._id] = res.rows[i].doc;\n }\n this.objects[res.rows[i].doc._id].type === 'enum' && this._enums.push(res.rows[i].doc._id);\n\n // Collect all names\n this.addToNames(this.objects[res.rows[i].doc._id]);\n }\n this.addGetProperty(this.objects);\n\n const systemConfig = this.objects['system.config'];\n this.password = systemConfig?.native?.javascriptPassword\n ? this.decrypt(systemConfig?.native.javascriptPassword)\n : '';\n\n // set language for debug messages\n if (systemConfig?.common?.language) {\n setLanguage(systemConfig.common.language);\n this.language = systemConfig.common.language;\n this.context.language = this.language as ioBroker.Languages;\n } else if (this.language) {\n setLanguage(this.language);\n this.context.language = this.language;\n }\n\n // try to use system coordinates\n if (this.config.useSystemGPS) {\n if (systemConfig?.common?.latitude || systemConfig?.common?.longitude) {\n this.config.latitude = systemConfig.common.latitude;\n this.config.longitude = systemConfig.common.longitude;\n } else if (this.latitude && this.longitude) {\n this.config.latitude = this.latitude;\n this.config.longitude = this.longitude;\n }\n }\n this.config.latitude = parseFloat(this.config.latitude as unknown as string);\n this.config.longitude = parseFloat(this.config.longitude as unknown as string);\n\n if (isNaN(this.config.latitude)) {\n this.log.warn(`Configured latitude is not a number - check (instance/system) configuration`);\n } else if (this.config.latitude < -90 || this.config.latitude > 90) {\n this.log.warn(\n `Configured latitude \"${this.config.latitude}\" is invalid - check (instance/system) configuration`,\n );\n }\n\n if (isNaN(this.config.longitude)) {\n this.log.warn(`Configured longitude is not a number - check (instance/system) configuration`);\n } else if (this.config.longitude < -180 || this.config.longitude > 180) {\n this.log.warn(\n `Configured longitude \"${this.config.longitude}\" is invalid - check (instance/system) configuration`,\n );\n }\n\n this.config.sunriseEvent ||= 'nightEnd';\n this.config.sunriseOffset ||= 0;\n this.config.sunriseLimitStart ||= '06:00';\n this.config.sunriseLimitEnd ||= '12:00';\n\n this.config.sunsetEvent ||= 'dusk';\n this.config.sunsetOffset ||= 0;\n this.config.sunsetLimitStart ||= '18:00';\n this.config.sunsetLimitEnd ||= '23:00';\n\n this.objectsInitDone = true;\n this.log.info('received all objects');\n })\n .catch((err: any) => {\n this.log.error(`Could not initialize objects: ${err?.message || 'no result'}`);\n this.terminate(EXIT_CODES.START_IMMEDIATELY_AFTER_STOP);\n });\n\n return Promise.all([statesPromise, objectsPromise]).then(() => {});\n }\n\n async createActiveObject(id: string, enabled: boolean): Promise {\n const idActive = `${this.namespace}.scriptEnabled.${id.substring(SCRIPT_CODE_MARKER.length)}`;\n\n if (!this.objects[idActive]) {\n this.objects[idActive] = {\n _id: idActive,\n common: {\n name: `scriptEnabled.${id.substring(SCRIPT_CODE_MARKER.length)}`,\n desc: 'controls script activity',\n type: 'boolean',\n write: true,\n read: true,\n role: 'switch.active',\n },\n native: {\n script: id,\n },\n type: 'state',\n };\n try {\n await this.setForeignObjectAsync(idActive, this.objects[idActive]);\n const intermediateStateValue = this.prepareStateObjectSimple(idActive, enabled, true);\n await this.setForeignStateAsync(idActive, enabled, true);\n if (enabled && !this.config.subscribe) {\n this.interimStateValues[idActive] = intermediateStateValue;\n }\n } catch {\n // ignore\n }\n } else {\n const state = await this.getForeignStateAsync(idActive);\n if (state && state.val !== enabled) {\n const intermediateStateValue = this.prepareStateObjectSimple(idActive, enabled, true);\n await this.setForeignStateAsync(idActive, enabled, true);\n if (enabled && !this.config.subscribe) {\n this.interimStateValues[idActive] = intermediateStateValue;\n }\n }\n }\n }\n\n async createProblemObject(id: string): Promise {\n const idProblem = `${this.namespace}.scriptProblem.${id.substring(SCRIPT_CODE_MARKER.length)}`;\n\n if (!this.objects[idProblem]) {\n this.objects[idProblem] = {\n _id: idProblem,\n common: {\n name: `scriptProblem.${id.substring(SCRIPT_CODE_MARKER.length)}`,\n desc: 'Script has a problem',\n type: 'boolean',\n expert: true,\n write: false,\n read: true,\n role: 'indicator.error',\n },\n native: {\n script: id,\n },\n type: 'state',\n };\n try {\n await this.setForeignObjectAsync(idProblem, this.objects[idProblem]);\n await this.setForeignStateAsync(idProblem, false, true);\n } catch {\n // ignore\n }\n } else {\n const state = await this.getForeignStateAsync(idProblem);\n if (state && state.val !== false) {\n await this.setForeignStateAsync(idProblem, false, true);\n }\n }\n }\n\n addToNames(obj: ioBroker.Object): void {\n const id = obj._id;\n\n if (obj.common?.name) {\n let name = obj.common.name;\n if (name && typeof name === 'object') {\n name = name[getLanguage()] || name.en;\n }\n if (!name || typeof name !== 'string') {\n // TODO, take name in current language\n return;\n }\n\n if (!this.names[name]) {\n this.names[name] = id;\n } else {\n // convert to array\n if (!Array.isArray(this.names[name])) {\n this.names[name] = [this.names[name] as string];\n }\n\n (this.names[name] as string[]).push(id);\n }\n }\n }\n\n removeFromNames(id: string): void {\n const n = this.getName(id);\n\n if (n) {\n if (Array.isArray(this.names[n])) {\n const pos = this.names[n].indexOf(id);\n if (pos > -1) {\n this.names[n].splice(pos, 1);\n\n if (this.names[n].length === 1) {\n this.names[n] = this.names[n][0];\n }\n }\n } else {\n delete this.names[n];\n }\n }\n }\n\n getName(id: string): string | null {\n for (const n in this.names) {\n if (this.names[n] && Array.isArray(this.names[n])) {\n if (this.names[n].includes(id)) {\n return n;\n }\n } else if (this.names[n] === id) {\n return n;\n }\n }\n\n return null;\n }\n\n async installNpm(npmLib: string): Promise {\n return new Promise((resolve, reject) => {\n const path = __dirname;\n\n // Also, set the working directory (cwd) of the process instead of using --prefix\n // because that has ugly bugs on Windows\n const cmd = `npm install ${npmLib} --omit=dev`;\n this.log.info(`Installing ${npmLib} into ${__dirname} - cmd: ${cmd}`);\n\n // System call used for update of js-controller itself,\n // because during the installation the npm packet will be deleted too, but some files must be loaded even during the installation process.\n const child = this.mods.child_process.exec(cmd, {\n windowsHide: true,\n cwd: path,\n });\n\n child.stdout?.on('data', buf => this.log.info(buf.toString('utf8')));\n\n child.stderr?.on('data', buf => this.log.error(buf.toString('utf8')));\n\n child.on('err', err => {\n this.log.error(`Cannot install ${npmLib}: ${err}`);\n reject(new Error(`Cannot install ${npmLib}: ${err}`));\n });\n child.on('error', err => {\n this.log.error(`Cannot install ${npmLib}: ${err}`);\n reject(new Error(`Cannot install ${npmLib}: ${err}`));\n });\n\n child.on('exit', (code: number /* , signal */) => {\n if (code) {\n this.log.error(`Cannot install ${npmLib}: ${code}`);\n reject(new Error(`Cannot install ${npmLib}: ${code}`));\n }\n // command succeeded\n resolve(code);\n });\n });\n }\n\n async installLibraries(): Promise {\n if (typeof this.config?.libraries !== 'string') {\n this.config.libraries = '';\n }\n\n const libraries: string[] = this.config.libraries\n .split(/[,;\\s]+/)\n .map(d => d.trim())\n .filter(d => d);\n\n this.log.debug(`Custom libraries in config: \"${this.config.libraries}\": ${JSON.stringify(libraries)}`);\n\n let installedNodeModules: string[] = [];\n const keepModules: string[] = [];\n\n // js-controller >= 6.x\n if (typeof this.listInstalledNodeModules === 'function') {\n installedNodeModules = await this.listInstalledNodeModules();\n\n this.log.debug(`Found installed libraries: ${JSON.stringify(installedNodeModules)}`);\n }\n\n for (const lib of libraries) {\n let depName = lib;\n let version = 'latest';\n\n if (depName.includes('@') && depName.lastIndexOf('@') > 0) {\n const parts = depName.split('@');\n version = parts.pop() ?? 'latest';\n depName = parts.join('@');\n }\n\n /** The real module name, because the dependency can be a URL too */\n let moduleName = depName;\n\n if (URL.canParse(depName)) {\n moduleName = await requestModuleNameByUrl(depName);\n\n this.log.debug(`Found custom library in config: \"${moduleName}@${version}\" (from ${depName})`);\n } else {\n this.log.debug(`Found custom library in config: \"${moduleName}@${version}\"`);\n }\n\n keepModules.push(moduleName);\n\n // js-controller >= 6.x\n if (typeof this.installNodeModule === 'function') {\n try {\n const result = await this.installNodeModule(depName, { version });\n if (result.success) {\n this.log.debug(`Installed custom library: \"${moduleName}@${version}\"`);\n\n const importedModule: any = await this.importNodeModule(moduleName);\n (this.mods as Record)[moduleName] = importedModule.default ?? importedModule;\n } else {\n this.log.warn(`Cannot install custom npm package \"${moduleName}@${version}\"`);\n }\n } catch (err: unknown) {\n this.log.warn(`Cannot install custom npm package \"${moduleName}@${version}\": ${err as Error}`);\n }\n } else if (!existsSync(`${__dirname}/node_modules/${depName}/package.json`)) {\n // js-controller < 6.x\n this.log.info(`Installing custom library (legacy mode): \"${lib}\"`);\n\n try {\n await this.installNpm(lib);\n this.log.info(`Installed custom npm package (legacy mode): \"${lib}\"`);\n } catch (err: any) {\n this.log.warn(`Cannot install custom npm package \"${lib}\" (legacy mode): ${err.toString()}`);\n }\n }\n }\n\n // js-controller >= 6.x\n if (typeof this.uninstallNodeModule === 'function') {\n for (const installedNodeModule of installedNodeModules) {\n if (!keepModules.includes(installedNodeModule)) {\n try {\n await this.uninstallNodeModule(installedNodeModule);\n\n this.log.info(`Removed custom npm package: \"${installedNodeModule}\"`);\n } catch (err: any) {\n this.log.warn(`Cannot remove custom npm package ${installedNodeModule}: ${err.toString()}`);\n }\n }\n }\n }\n }\n\n createVM(source: string, name: string, wrapAsync: boolean): false | JsScript {\n if (this.context.debugMode && name !== this.context.debugMode) {\n return false;\n }\n\n if (!this.context.debugMode) {\n const logSubscriptionsText =\n \"\\n;\\nlog(`registered ${__engine.__subscriptions} subscription${__engine.__subscriptions === 1 ? '' : 's'},\" +\n \" ${__engine.__schedules} schedule${__engine.__schedules === 1 ? '' : 's'},\" +\n \" ${__engine.__subscriptionsMessage} message${__engine.__subscriptionsMessage === 1 ? '' : 's'},\" +\n \" ${__engine.__subscriptionsLog} log${__engine.__subscriptionsLog === 1 ? '' : 's'}\" +\n \" and ${__engine.__subscriptionsFile} file subscription${__engine.__subscriptionsFile === 1 ? '' : 's'}`);\\n\";\n\n if (wrapAsync) {\n source = `(async () => {\\n${source}\\n${logSubscriptionsText}\\n})();`;\n } else {\n if (source.endsWith('export {};\\n')) {\n // If the source ends with \"export {};\" place the log subscriptions before it\n source = source.slice(0, -11); // remove \"export {};\\n\"\n source = `${source}\\n${logSubscriptionsText}\\nexport {};\\n`;\n } else {\n source = `${source}\\n${logSubscriptionsText}`;\n }\n }\n } else {\n if (wrapAsync) {\n source = `(async () => {debugger;\\n${source}\\n})();`;\n } else {\n source = `debugger;${source}`;\n }\n }\n\n try {\n const options: ScriptOptions = {\n filename: name,\n // displayErrors: true,\n // lineOffset: this.globalScriptLines\n };\n return {\n script: new Script(source, options),\n } as JsScript;\n } catch (err: unknown) {\n this.logError(name, `compile failed at`, err as Error);\n return false;\n }\n }\n\n execute(script: JsScript, name: string, engineType: ScriptType, verbose: boolean, debug: boolean): void {\n script.intervals = [];\n script.timeouts = [];\n script.schedules = [];\n script.wizards = [];\n script.name = name;\n script.engineType = engineType;\n script._id = Math.floor(Math.random() * 0xffffffff);\n script.subscribes = {};\n script.subscribesFile = {};\n script.setStatePerMinuteCounter = 0;\n script.setStatePerMinuteProblemCounter = 0;\n void this.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: false,\n ack: true,\n expire: 1000,\n });\n\n const sandbox = sandBox(script, name, verbose, debug, this.context);\n\n try {\n script.script.runInNewContext(sandbox, {\n filename: name,\n displayErrors: true,\n // lineOffset: this.globalScriptLines\n });\n } catch (err: unknown) {\n void this.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: true,\n ack: true,\n c: 'execute',\n });\n this.logError(name, 'Error by run:', err as Error);\n }\n }\n\n unsubscribe(id: string | RegExp | string[]): void {\n if (!id) {\n this.log.warn('unsubscribe: empty name');\n return;\n }\n\n if (Array.isArray(id)) {\n id.forEach(sub => unsubscribe(sub));\n return;\n }\n\n if (id.constructor && id.constructor.name === 'RegExp') {\n // adapter.log.warn('unsubscribe: todo - process regexp');\n return;\n }\n\n if (typeof id !== 'string') {\n this.log.error(`unsubscribe: invalid type of id - ${typeof id}`);\n return;\n }\n const parts = id.split('.');\n const _adapter = `system.adapter.${parts[0]}.${parts[1]}`;\n if (this.objects[_adapter]?.common?.subscribable) {\n const a = `${parts[0]}.${parts[1]}`;\n const alive = `system.adapter.${a}.alive`;\n if (this.adapterSubs[alive]) {\n const pos = this.adapterSubs[alive].indexOf(id);\n if (pos !== -1) {\n this.adapterSubs[alive].splice(pos, 1);\n }\n if (!this.adapterSubs[alive].length) {\n delete this.adapterSubs[alive];\n }\n }\n this.sendTo(a, 'unsubscribe', id);\n }\n }\n\n // Analyze if logs are still required or not\n updateLogSubscriptions(): void {\n let found = false;\n // go through all scripts and check if some script still requires logs\n Object.keys(this.logSubscriptions).forEach(scriptName => {\n if (!this.logSubscriptions?.[scriptName] || !this.logSubscriptions[scriptName].length) {\n delete this.logSubscriptions[scriptName];\n } else {\n found = true;\n }\n });\n\n if (this.requireLog) {\n if (found && !this.logSubscribed) {\n this.logSubscribed = true;\n void this.requireLog(this.logSubscribed);\n this.log.info(`Subscribed to log messages (found logSubscriptions)`);\n } else if (!found && this.logSubscribed) {\n this.logSubscribed = false;\n void this.requireLog(this.logSubscribed);\n this.log.info(`Unsubscribed from log messages (not found logSubscriptions)`);\n }\n }\n }\n\n async stopScript(name: string): Promise {\n this.log.info(`${name}: Stopping script`);\n\n await this.setState(`scriptEnabled.${name.substring(SCRIPT_CODE_MARKER.length)}`, false, true);\n\n if (this.messageBusHandlers[name]) {\n delete this.messageBusHandlers[name];\n }\n\n if (this.tempDirectories[name]) {\n try {\n this.mods.fs.rmSync(this.tempDirectories[name], { recursive: true });\n\n this.log.debug(`${name}: Removed temp directory: ${this.tempDirectories[name]}`);\n } catch {\n this.log.warn(`${name}: Unable to remove temp directory: ${this.tempDirectories[name]}`);\n }\n\n delete this.tempDirectories[name];\n }\n\n if (this.logSubscriptions[name]) {\n delete this.logSubscriptions[name];\n this.updateLogSubscriptions();\n }\n\n if (this.scripts[name]) {\n // Remove from subscriptions\n this.context.isEnums = false;\n if (this.config.subscribe) {\n // check all subscribed IDs\n Object.keys(this.scripts[name].subscribes).forEach(id => {\n if (this.subscribedPatterns[id]) {\n this.subscribedPatterns[id] -= this.scripts[name].subscribes[id];\n if (this.subscribedPatterns[id] <= 0) {\n this.unsubscribeForeignStates(id);\n delete this.subscribedPatterns[id];\n if (this.states[id]) {\n delete this.states[id];\n }\n }\n }\n });\n }\n\n for (let i = this.subscriptions.length - 1; i >= 0; i--) {\n if (this.subscriptions[i].name === name) {\n const sub = this.subscriptions.splice(i, 1)[0];\n if (sub?.pattern.id) {\n this.unsubscribe(sub.pattern.id);\n }\n } else {\n if (\n (!this.context.isEnums && this.subscriptions[i].pattern.enumName) ||\n this.subscriptions[i].pattern.enumId\n ) {\n this.context.isEnums = true;\n }\n }\n }\n\n // check all subscribed files\n Object.keys(this.scripts[name].subscribesFile).forEach(key => {\n if (this.subscribedPatternsFile[key]) {\n this.subscribedPatternsFile[key] -= this.scripts[name].subscribesFile[key];\n if (this.subscribedPatternsFile[key] <= 0) {\n const [id, file] = key.split('$%$');\n void this.unsubscribeForeignFiles(id, file);\n delete this.subscribedPatternsFile[key];\n }\n }\n });\n for (let i = this.subscriptionsFile.length - 1; i >= 0; i--) {\n if (this.subscriptionsFile[i].name === name) {\n this.subscriptionsFile.splice(i, 1);\n }\n }\n\n for (let i = this.subscriptionsObject.length - 1; i >= 0; i--) {\n if (this.subscriptionsObject[i].name === name) {\n const sub = this.subscriptionsObject.splice(i, 1)[0];\n if (sub) {\n this.unsubscribeForeignObjects(sub.pattern);\n }\n }\n }\n\n // Stop all timeouts\n for (let i = 0; i < this.scripts[name].timeouts.length; i++) {\n clearTimeout(this.scripts[name].timeouts[i]);\n }\n // Stop all intervals\n for (let i = 0; i < this.scripts[name].intervals.length; i++) {\n clearInterval(this.scripts[name].intervals[i]);\n }\n // Stop all scheduled jobs\n for (let i = 0; i < this.scripts[name].schedules.length; i++) {\n if (this.scripts[name].schedules[i]) {\n const _name = this.scripts[name].schedules[i].name;\n if (!this.mods.nodeSchedule.cancelJob(this.scripts[name].schedules[i])) {\n this.log.error(`${name}: Error by canceling scheduled job \"${_name}\"`);\n }\n }\n }\n\n // Stop all time wizards jobs\n if (this.context.scheduler) {\n for (let i = 0; i < this.scripts[name].wizards.length; i++) {\n if (this.scripts[name].wizards[i]) {\n this.context.scheduler.remove(this.scripts[name].wizards[i]);\n }\n }\n }\n\n // if callback for on stop\n if (typeof this.scripts[name].onStopCb === 'function') {\n this.scripts[name].onStopTimeout =\n parseInt(this.scripts[name].onStopTimeout as unknown as string, 10) || 1000;\n\n await new Promise(resolve => {\n let timeout: NodeJS.Timeout | null = setTimeout(() => {\n if (timeout) {\n timeout = null;\n resolve(true);\n }\n }, this.scripts[name].onStopTimeout);\n\n try {\n this.scripts[name].onStopCb(() => {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n resolve(true);\n }\n });\n } catch (err: unknown) {\n this.log.error(`${name}: error in onStop callback: ${err as Error}`);\n }\n });\n }\n\n delete this.scripts[name];\n return true;\n }\n return false;\n }\n\n async prepareScript(obj: ioBroker.ScriptObject): Promise {\n if (obj?.common?.enabled && this.debugState.scriptName === obj._id) {\n const id = obj._id;\n await this.debugStop();\n this.log.info(`${id}: Debugging was stopped, because started in normal mode`);\n return this.prepareScript(obj);\n }\n\n if (\n obj?.common?.source &&\n (obj.common.enabled || this.context.debugMode === obj._id) &&\n obj.common.engine === `system.adapter.${this.namespace}`\n ) {\n const name = obj._id;\n\n if (this.password && obj.native?.protected) {\n obj.common.source = decryptText(this.password, obj.common.source);\n }\n\n const nameId = name.substring(SCRIPT_CODE_MARKER.length);\n if (!nameId.length || nameId.endsWith('.')) {\n this.log.error(`${name}: Script name \"${name}\" is invalid!`);\n return false;\n }\n const idActive = `scriptEnabled.${nameId}`;\n if (!this.config.subscribe) {\n this.interimStateValues[idActive] = this.prepareStateObjectSimple(\n `${this.namespace}.${idActive}`,\n true,\n true,\n );\n }\n await this.setState(idActive, true, true);\n obj.common.engineType ||= '' as 'TypeScript/ts' | 'Blockly' | 'Rules' | 'Javascript/js';\n\n if (\n (obj.common.engineType as ScriptType).toLowerCase().startsWith('javascript') ||\n (obj.common.engineType as ScriptType) === 'Blockly' ||\n (obj.common.engineType as ScriptType) === 'Rules'\n ) {\n // Javascript\n this.log.info(`${name}: start JavaScript (${obj.common.engineType})`);\n\n let sourceFn = name;\n if (webstormDebug) {\n const fn = name.replace(/^script\\.js\\./, '').replace(/\\./g, '/');\n sourceFn = this.mods.path.join(webstormDebug, `${fn}.js`);\n }\n const createdScript = this.createVM(`${this.globalScript}\\n${obj.common.source}`, sourceFn, true);\n if (!createdScript) {\n return false;\n }\n this.scripts[name] = createdScript;\n this.execute(\n this.scripts[name],\n sourceFn,\n obj.common.engineType as ScriptType,\n obj.common.verbose,\n obj.common.debug,\n );\n return true;\n }\n\n if (obj.common.engineType.toLowerCase().startsWith('typescript')) {\n // TypeScript\n this.log.info(`${name}: Compiling TypeScript source`);\n // The source code must be transformed in order to support top level await\n // and to force TypeScript to compile the code as a module\n const transformedSource = transformScriptBeforeCompilation(obj.common.source, false);\n // We need to hash both global declarations that are known until now\n // AND the script source, because changing either can change the compilation output\n const sourceHash = hashSource(tsSourceHashBase + this.globalDeclarations + transformedSource);\n\n let compiled: string;\n // If we already stored the compiled source code and the original source hash,\n // use the hash to check whether we can rely on the compiled source code or\n // if we need to compile it again\n if (\n typeof obj.common.compiled === 'string' &&\n typeof obj.common.sourceHash === 'string' &&\n sourceHash === obj.common.sourceHash\n ) {\n // We can reuse the stored source\n compiled = obj.common.compiled;\n this.log.info(`${name}: source code did not change, using cached compilation result...`);\n } else {\n // We don't have a hashed source code, or the original source changed, compile it\n const filename = scriptIdToTSFilename(name);\n let tsCompiled: CompileResult;\n try {\n tsCompiled = this.tsServer.compile(filename, transformedSource);\n } catch (err: unknown) {\n this.log.error(`${obj._id}: TypeScript compilation failed:\\n${err as Error}`);\n return false;\n }\n\n const errors = tsCompiled.diagnostics.map(diag => `${diag.annotatedSource}\\n`).join('\\n');\n\n if (tsCompiled.success) {\n if (errors.length > 0) {\n this.log.warn(`${name}: TypeScript compilation had errors:\\n${errors}`);\n } else {\n this.log.info(`${name}: TypeScript compilation successful`);\n }\n compiled = tsCompiled.result || '';\n\n // Store the compiled source and the original source hash, so we don't need to do the work again next time\n this.ignoreObjectChange.add(name); // ignore the next change and don't restart scripts\n await this.extendForeignObjectAsync(name, {\n common: {\n sourceHash,\n compiled,\n },\n });\n } else {\n this.log.error(`${name}: TypeScript compilation failed:\\n${errors}`);\n return false;\n }\n }\n const createdScript: JsScript | false = this.createVM(`${this.globalScript}\\n${compiled}`, name, false);\n if (!createdScript) {\n return false;\n }\n this.scripts[name] = createdScript;\n this.execute(\n this.scripts[name],\n name,\n obj.common.engineType as ScriptType,\n obj.common.verbose,\n obj.common.debug,\n );\n return true;\n }\n\n this.log.warn(`${obj._id}: Unknown engine type: ${obj.common.engineType}`);\n return false;\n }\n\n let _name: string;\n if (obj?._id) {\n _name = obj._id;\n const scriptIdName = _name.substring(SCRIPT_CODE_MARKER.length);\n\n if (!scriptIdName.length || scriptIdName.endsWith('.')) {\n this.log.error(`${obj._id}: Script name \"${_name}\" is invalid!`);\n return false;\n }\n await this.setState(`scriptEnabled.${scriptIdName}`, false, true);\n }\n if (!obj) {\n this.log.error('Invalid script');\n }\n return false;\n }\n\n async loadScriptById(id: string): Promise {\n let obj: ioBroker.ScriptObject | null | undefined;\n try {\n obj = (await this.getForeignObjectAsync(id)) as ioBroker.ScriptObject | null | undefined;\n } catch (err: any) {\n this.log.error(`${id}: Invalid script: ${err}`);\n }\n if (!obj) {\n return false;\n }\n return this.loadScript(obj);\n }\n\n async loadScript(nameOrObject: ioBroker.ScriptObject): Promise {\n // create states for scripts\n await this.createActiveObject(nameOrObject._id, !!nameOrObject?.common?.enabled);\n await this.createProblemObject(nameOrObject._id);\n return this.prepareScript(nameOrObject);\n }\n\n getAstroEvent(\n date: Date,\n astroEvent: AstroEventName,\n start: string,\n end: string,\n offsetMinutes: number | string,\n isDayEnd: boolean,\n latitude: number,\n longitude: number,\n useNextDay?: boolean,\n ): Date {\n let ts: Date = this.mods.suncalc.getTimes(date, latitude, longitude)[astroEvent];\n\n if (!ts || ts.getTime().toString() === 'NaN') {\n ts = isDayEnd ? getNextTimeEvent(end, useNextDay) : getNextTimeEvent(start, useNextDay);\n }\n ts.setMilliseconds(0);\n ts.setMinutes(ts.getMinutes() + (parseInt(offsetMinutes as unknown as string, 10) || 0));\n\n const [timeHoursStart, timeMinutesStart] = start.split(':');\n const nTimeHoursStart = parseInt(timeHoursStart, 10);\n const nTimeMinutesStart = parseInt(timeMinutesStart, 10) || 0;\n\n if (\n ts.getHours() < nTimeHoursStart ||\n (ts.getHours() === nTimeHoursStart && ts.getMinutes() < nTimeMinutesStart)\n ) {\n ts = getNextTimeEvent(start, useNextDay);\n ts.setSeconds(0);\n }\n\n const [timeHoursEnd, timeMinutesEnd] = end.split(':');\n const nTimeHoursEnd = parseInt(timeHoursEnd, 10);\n const nTimeMinutesEnd = parseInt(timeMinutesEnd, 10) || 0;\n\n if (ts.getHours() > nTimeHoursEnd || (ts.getHours() === nTimeHoursEnd && ts.getMinutes() > nTimeMinutesEnd)) {\n ts = getNextTimeEvent(end, useNextDay);\n ts.setSeconds(0);\n }\n\n // if event in the past\n if (date > ts && useNextDay) {\n // take the next day\n ts.setDate(ts.getDate() + 1);\n }\n return ts;\n }\n\n async timeSchedule(): Promise {\n const now = new Date();\n let hours = now.getHours();\n const minutes = now.getMinutes();\n if (this.timeSettings.format12) {\n if (hours > 12) {\n hours -= 12;\n }\n }\n let sHours: string;\n if (this.timeSettings.leadingZeros) {\n sHours = hours.toString().padStart(2, '0');\n } else {\n sHours = hours.toString();\n }\n\n await this.setState('variables.dayTime', {\n val: `${sHours}:${minutes.toString().padStart(2, '0')}`,\n ack: true,\n });\n\n now.setMinutes(now.getMinutes() + 1);\n now.setSeconds(0);\n now.setMilliseconds(0);\n const interval = now.getTime() - Date.now();\n this.timeScheduleTimer = setTimeout(() => this.timeSchedule(), interval);\n }\n\n async dayTimeSchedules(): Promise {\n // get astrological event\n if (\n this.config.latitude === undefined ||\n this.config.longitude === undefined ||\n (this.config.latitude as unknown as string) === '' ||\n (this.config.longitude as unknown as string) === '' ||\n this.config.latitude === null ||\n this.config.longitude === null\n ) {\n this.log.error('Longitude or latitude does not set. Cannot use astro.');\n return;\n }\n\n // Calculate the next event today\n const todayDate = getAstroStartOfDay();\n const nowDate = new Date();\n\n const todaySunrise = this.getAstroEvent(\n todayDate,\n this.config.sunriseEvent,\n this.config.sunriseLimitStart,\n this.config.sunriseLimitEnd,\n this.config.sunriseOffset,\n false,\n this.config.latitude,\n this.config.longitude,\n );\n const todaySunset = this.getAstroEvent(\n todayDate,\n this.config.sunsetEvent,\n this.config.sunsetLimitStart,\n this.config.sunsetLimitEnd,\n this.config.sunsetOffset,\n true,\n this.config.latitude,\n this.config.longitude,\n );\n\n // Sunrise\n let sunriseTimeout = todaySunrise.getTime() - nowDate.getTime();\n if (sunriseTimeout < 0 || sunriseTimeout > 3600000) {\n sunriseTimeout = 3600000;\n }\n\n // Sunset\n let sunsetTimeout = todaySunset.getTime() - nowDate.getTime();\n if (sunsetTimeout < 0 || sunsetTimeout > 3600000) {\n sunsetTimeout = 3600000;\n }\n\n const isDayTime: ioBroker.State | null | undefined = await this.getStateAsync('variables.isDayTime');\n let isDay: boolean;\n if (sunriseTimeout < 5000) {\n isDay = true;\n } else if (sunsetTimeout < 5000) {\n isDay = false;\n } else {\n // check if in between\n isDay = nowDate.getTime() > todaySunrise.getTime() - 60000 && nowDate <= todaySunset;\n }\n\n const valDayTime = isDayTime ? !!isDayTime.val : false;\n if (valDayTime !== isDay || isDayTime === null) {\n await this.setState('variables.isDayTime', isDay, true);\n }\n\n const dayLightSaving: ioBroker.State | null | undefined =\n await this.getStateAsync('variables.isDaylightSaving');\n const isDayLightSaving = dstOffsetAtDate(nowDate) !== 0;\n const val = dayLightSaving ? !!dayLightSaving.val : false;\n\n if (val !== isDayLightSaving || dayLightSaving === null) {\n await this.setState('variables.isDaylightSaving', isDayLightSaving, true);\n }\n\n let nextTimeout = sunriseTimeout;\n if (sunriseTimeout > sunsetTimeout) {\n nextTimeout = sunsetTimeout;\n }\n nextTimeout = nextTimeout - 3000;\n if (nextTimeout < 3000) {\n nextTimeout = 3000;\n }\n\n this.dayScheduleTimer = setTimeout(() => this.dayTimeSchedules(), nextTimeout);\n }\n\n stopTimeSchedules(): void {\n if (this.dayScheduleTimer) {\n clearTimeout(this.dayScheduleTimer);\n this.dayScheduleTimer = null;\n }\n if (this.sunScheduleTimer) {\n clearTimeout(this.sunScheduleTimer);\n this.sunScheduleTimer = null;\n }\n if (this.timeScheduleTimer) {\n clearTimeout(this.timeScheduleTimer);\n this.timeScheduleTimer = null;\n }\n }\n\n async patchFont(): Promise {\n let stat: Stats | undefined;\n let dbFile: Buffer | undefined;\n let fileName = `${__dirname}/../admin/vs/base/browser/ui/codicons/codicon/codicon.ttf`;\n let jsonFileName = `${__dirname}/../admin/vsFont/codicon.json`;\n try {\n if (existsSync(fileName)) {\n stat = statSync(fileName);\n }\n if (!stat) {\n jsonFileName = `${__dirname}/admin/vsFont/codicon.json`;\n fileName = `${__dirname}/admin/vs/base/browser/ui/codicons/codicon/codicon.ttf`;\n if (existsSync(fileName)) {\n stat = statSync(fileName);\n }\n }\n const _dbFile = await this.readFileAsync(\n 'javascript.admin',\n `vs/base/browser/ui/codicons/codicon/codicon.ttf`,\n );\n if (_dbFile?.file) {\n dbFile = _dbFile.file as Buffer;\n }\n } catch {\n // ignore\n }\n\n if (stat?.size !== 73452 || dbFile?.byteLength !== 73452) {\n try {\n const buffer = Buffer.from(JSON.parse(readFileSync(jsonFileName).toString()), 'base64');\n\n const jszip = await import('jszip');\n const zip = await jszip.loadAsync(buffer);\n let data: ArrayBuffer | undefined;\n if (zip) {\n data = await zip.file('codicon.ttf')?.async('arraybuffer');\n if (data?.byteLength !== 73452) {\n this.log.error(`Cannot patch font: invalid font file!`);\n return false;\n }\n } else {\n this.log.error(`Cannot patch font: invalid font file!`);\n return false;\n }\n writeFileSync(fileName, Buffer.from(data));\n // upload this file\n await this.writeFileAsync(\n 'javascript.admin',\n 'vs/base/browser/ui/codicons/codicon/codicon.ttf',\n Buffer.from(data),\n );\n return true;\n } catch (err: unknown) {\n this.log.error(`Cannot patch font: ${err as Error}`);\n return false;\n }\n }\n return false;\n }\n\n async sunTimeSchedules(): Promise {\n if (this.config.createAstroStates) {\n if (!isNaN(this.config.longitude) && !isNaN(this.config.longitude)) {\n const calcDate = getAstroStartOfDay();\n\n const times = this.mods.suncalc.getTimes(calcDate, this.config.latitude, this.config.longitude);\n\n this.log.debug(`[sunTimeSchedules] Times: ${JSON.stringify(times)}`);\n\n for (const t in times) {\n try {\n const objId = `variables.astro.${t}`;\n\n await this.setObjectNotExistsAsync(objId, {\n type: 'state',\n common: {\n name: `Astro ${t}`,\n type: 'string',\n role: 'value',\n read: true,\n write: false,\n },\n native: {},\n });\n\n if (times[t] !== null && !isNaN(times[t].getTime())) {\n const timeFormatted = formatHoursMinutesSeconds(times[t]);\n await this.setState(objId, {\n val: timeFormatted,\n c: times[t].toISOString(),\n ack: true,\n });\n } else {\n await this.setState(objId, { val: null, c: 'n/a', ack: true, q: 0x01 });\n }\n } catch (err: unknown) {\n this.log.error(\n `[sunTimeSchedules] Unable to set state for astro time \"${t}\" (${times[t].getTime()}): ${err as Error}`,\n );\n }\n }\n\n const todayDate = new Date();\n todayDate.setHours(0);\n todayDate.setMinutes(0);\n todayDate.setSeconds(1);\n todayDate.setMilliseconds(0);\n todayDate.setDate(todayDate.getDate() + 1);\n\n this.log.debug(`[sunTimeSchedules] Next: ${todayDate.toISOString()}`);\n this.sunScheduleTimer = setTimeout(() => this.sunTimeSchedules(), todayDate.getTime() - Date.now());\n }\n } else {\n // remove astro states if disabled\n this.delObject('variables.astro', { recursive: true });\n }\n }\n\n /**\n * Redirects the virtual-tsc log output to the ioBroker log\n */\n tsLog = (message: string, severity?: ioBroker.LogLevel): void => {\n // shift the severities around, we don't care about the small details\n if (!severity || severity === 'info') {\n severity = 'debug';\n } else if (severity === 'debug') {\n // Don't spam build logs on Travis\n if (isCI) {\n return;\n }\n severity = 'silly';\n }\n\n if (this?.log) {\n this.log[severity](message);\n } else {\n console.log(`[${severity.toUpperCase()}] ${message}`);\n }\n };\n\n addGetProperty(object: Record): void {\n try {\n Object.defineProperty(object, 'get', {\n value: function (id: string): any {\n return this[id] || this[`${this.namespace}.${id}`];\n },\n enumerable: false,\n });\n } catch {\n console.error('Cannot install get property');\n }\n }\n\n /**\n * Add declarations for global scripts\n *\n * @param scriptID - The current script the declarations were generated from\n * @param declarations - Declarations from a script\n */\n provideDeclarationsForGlobalScript(scriptID: string, declarations: string): void {\n // Remember which declarations this global script had access to;\n // we need this so the editor doesn't show a duplicate identifier error\n if (this.globalDeclarations != null && this.globalDeclarations !== '') {\n this.knownGlobalDeclarationsByScript[scriptID] = this.globalDeclarations;\n }\n // and concatenate the global declarations for the next scripts\n this.globalDeclarations += `${declarations}\\n`;\n // remember all previously generated global declarations,\n // so global scripts can reference each other\n const globalDeclarationPath = 'global.d.ts';\n tsAmbient[globalDeclarationPath] = this.globalDeclarations;\n // make sure the next script compilation has access to the updated declarations\n this.tsServer.provideAmbientDeclarations({\n [globalDeclarationPath]: this.globalDeclarations,\n });\n jsDeclarationServer.provideAmbientDeclarations({\n [globalDeclarationPath]: this.globalDeclarations,\n });\n }\n\n fixLineNo(line: string): string {\n if (line.includes('javascript.js:')) {\n return line;\n }\n if (!/scripts?\\.js[.\\\\/]/.test(line)) {\n return line;\n }\n if (/:(\\d+):/.test(line)) {\n line = line.replace(\n /:(\\d+):/,\n (_$0, $1) => `:${$1 > this.globalScriptLines + 1 ? $1 - this.globalScriptLines - 1 : $1}:`,\n ); // one line for 'async function ()'\n } else {\n line = line.replace(\n /:(\\d+)$/,\n (_$0, $1) => `:${$1 > this.globalScriptLines + 1 ? $1 - this.globalScriptLines - 1 : $1}`,\n ); // one line for 'async function ()'\n }\n return line;\n }\n\n async debugStop(): Promise {\n if (this.debugState.child) {\n this.debugSendToInspector({ cmd: 'end' });\n this.debugState.endTimeout = setTimeout(() => {\n this.debugState.endTimeout = null;\n this.debugState.child?.kill('SIGTERM');\n }, 500);\n this.debugState.promiseOnEnd ||= Promise.resolve(0);\n } else {\n this.debugState.promiseOnEnd = Promise.resolve(0);\n }\n\n await this.debugState.promiseOnEnd;\n\n this.debugState.child = null;\n this.debugState.running = false;\n this.debugState.scriptName = '';\n if (this.debugState.endTimeout) {\n clearTimeout(this.debugState.endTimeout);\n this.debugState.endTimeout = null;\n }\n }\n\n async debugDisableScript(id: string | undefined): Promise {\n if (id) {\n const obj = this.objects[id];\n if (obj?.common?.enabled) {\n await this.extendForeignObjectAsync(obj._id, { common: { enabled: false } });\n }\n }\n }\n\n debugSendToInspector(message: any): void {\n if (this.debugState.child) {\n try {\n this.log.info(`send to debugger: ${message}`);\n this.debugState.child.send(message);\n } catch {\n void this.debugStop().then(() =>\n this.log.info(\n `${this.debugState.scriptName}: Debugging was stopped, because started in normal mode`,\n ),\n );\n }\n } else {\n this.log.error(`${this.debugState.scriptName}: Cannot send command to terminated inspector`);\n void this.setState(\n 'debug.from',\n JSON.stringify({ cmd: 'error', error: `Cannot send command to terminated inspector`, id: 1 }),\n true,\n );\n }\n }\n\n debugStart(data: { breakOnStart?: boolean; scriptName?: string; adapter?: string }): void {\n if (Date.now() - this.debugState.started < 1000) {\n console.log('Start ignored');\n return;\n }\n\n this.debugState.started = Date.now();\n // stop the script if it's running\n void this.debugDisableScript(data.scriptName)\n .then(() => this.debugStop())\n .then(() => {\n if (data.adapter) {\n this.debugState.adapterInstance = data.adapter;\n this.debugState.scriptName = '';\n } else {\n this.debugState.adapterInstance = '';\n this.debugState.scriptName = data.scriptName as string;\n }\n\n this.debugState.breakOnStart = data.breakOnStart;\n\n this.debugState.promiseOnEnd = new Promise(resolve => {\n const options: ForkOptions = {\n stdio: ['ignore', 'inherit', 'inherit', 'ipc'],\n //stdio: ['pipe', 'pipe', 'pipe', 'ipc']\n };\n const args: string[] = [];\n if (this.debugState.adapterInstance) {\n args.push('--breakOnStart');\n }\n\n this.debugState.child = fork(`${__dirname}/lib/inspect.js`, args, options);\n\n /*debugState.child.stdout.setEncoding('utf8');\n debugState.child.stderr.setEncoding('utf8');\n debugState.child.stdout.on('data', childPrint);\n debugState.child.stderr.on('data', childPrint);*/\n\n this.debugState.child?.on(\n 'message',\n (\n message:\n | string\n | {\n cmd: 'ready' | 'watched' | 'paused' | 'resumed' | 'log' | 'readyToDebug';\n severity?: string;\n text?: string;\n scriptId?: string;\n script?: string;\n },\n ) => {\n let oMessage: {\n cmd: 'ready' | 'watched' | 'paused' | 'resumed' | 'log' | 'readyToDebug';\n severity?: string;\n text?: string;\n scriptId?: string;\n script?: string;\n };\n if (typeof message === 'string') {\n try {\n oMessage = JSON.parse(message);\n } catch {\n return this.log.error(`Cannot parse message from inspector: ${message}`);\n }\n } else {\n oMessage = message;\n }\n\n if (oMessage.cmd !== 'ready') {\n void this.setState('debug.from', JSON.stringify(oMessage), true);\n }\n\n switch (oMessage.cmd) {\n case 'ready': {\n this.debugSendToInspector({\n cmd: 'start',\n scriptName: this.debugState.scriptName,\n adapterInstance: this.debugState.adapterInstance,\n instance: this.instance,\n });\n break;\n }\n\n case 'watched': {\n //console.log(`WATCHED: ${JSON.stringify(oMessage)}`);\n break;\n }\n\n case 'paused': {\n this.debugState.paused = true;\n console.log(`host: PAUSED`);\n break;\n }\n\n case 'resumed': {\n this.debugState.paused = false;\n //console.log(`STARTED`);\n break;\n }\n\n case 'log': {\n console.log(`[${oMessage.severity}] ${oMessage.text}`);\n break;\n }\n\n case 'readyToDebug': {\n console.log(\n `host: readyToDebug (set breakpoints): [${oMessage.scriptId}] ${oMessage.script}`,\n );\n break;\n }\n }\n },\n );\n this.debugState.child?.on('error', error => {\n this.log.error(`Cannot start inspector: ${error}`);\n void this.setState('debug.from', JSON.stringify({ cmd: 'error', error }), true);\n });\n\n this.debugState.child?.on('exit', async (code: number): Promise => {\n if (code) {\n await this.setState(\n 'debug.from',\n JSON.stringify({ cmd: 'error', error: `invalid response code: ${code}` }),\n true,\n );\n }\n await this.setState('debug.from', JSON.stringify({ cmd: 'debugStopped', code }), true);\n this.debugState.child = null;\n resolve(code);\n });\n });\n });\n }\n}\n\nfunction patternMatching(\n event: EventObj,\n patternFunctions: PatternEventCompareFunction[] & { logic?: 'and' | 'or' },\n): boolean {\n let matched = false;\n for (let i = 0, len = patternFunctions.length; i < len; i++) {\n if (patternFunctions[i](event)) {\n if (patternFunctions.logic === 'or') {\n return true;\n }\n matched = true;\n } else if (patternFunctions.logic === 'and') {\n return false;\n }\n }\n return matched;\n}\n\n// If started as allInOne mode => return function to create an instance\nif (require.main !== module) {\n // Export the constructor in compact mode\n module.exports = (options: Partial | undefined) => new JavaScript(options);\n} else {\n // otherwise start the instance directly\n (() => new JavaScript())();\n}\n"]} \ No newline at end of file +{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,qCAAqD;AACrD,qCAAwF;AACxF,yCAAiD;AACjD,2DAA4D;AAC5D,6CAAkE;AAClE,yCAA8C;AAC9C,wDAAgC;AAEhC,kDAAoC;AACpC,oDAAsC;AACtC,8CAAgC;AAChC,oDAAsC;AACtC,gDAAkC;AAClC,kDAAoC;AACpC,kDAAoC;AACpC,8CAAgC;AAChC,4CAA8B;AAC9B,gDAAkC;AAClC,gDAAkC;AAClC,kEAAoD;AACpD,oDAAsC;AACtC,gDAAkC;AAElC,sCAAsC;AACtC,kDAAoC;AACpC,6CAA+B;AAC/B,sCAAsC;AACtC,yDAA2C;AAC3C,4DAA8C;AAE9C,yDAA6G;AAK7G,yCAAsC;AACtC,gEAAwC;AACxC,uCAAuD;AACvD,2CAAwC;AACxC,uEAAqE;AACrE,6CAAkE;AAClE,+CAAiE;AACjE,iEAAwG;AACxG,uCAAyC;AACzC,2DAM+B;AAe/B,yCAA2C;AAyB3C;;;;GAIG;AACH,MAAM,wBAAwB,GAAa;IACvC,gBAAgB;IAChB,OAAO;IACP,UAAU;IACV,YAAY;IACZ,iBAAiB;IACjB,QAAQ;CACX,CAAC;AAEF,MAAM,WAAW,GAAwB,IAAI,CAAC,KAAK,CAAC,IAAA,sBAAY,EAAC,GAAG,SAAS,kBAAkB,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC7G,MAAM,kBAAkB,GAAG,YAAY,CAAC;AAExC,IAAI,aAAiC,CAAC;AAEtC,MAAM,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;AAE9B,sCAAsC;AACtC,IAAI,SAAiC,CAAC;AAEtC,yEAAyE;AACzE,iHAAiH;AACjH,qCAAqC;AACrC,qDAAqD;AACrD,MAAM,gBAA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B,CAAC","sourcesContent":["/*\n * Javascript adapter\n *\n * The MIT License (MIT)\n *\n * Copyright (c) 2014-2024 bluefox ,\n *\n * Copyright (c) 2014 hobbyquaker\n */\n\nimport { Script, type ScriptOptions } from 'node:vm';\nimport { readFileSync, existsSync, statSync, writeFileSync, type Stats } from 'node:fs';\nimport { join, sep, normalize } from 'node:path';\nimport { fork, type ForkOptions } from 'node:child_process';\nimport { setTypeScriptResolveOptions, Server } from 'virtual-tsc';\nimport { isDeepStrictEqual } from 'node:util';\nimport prettier from 'prettier';\n\nimport * as dgram from 'node:dgram';\nimport * as crypto from 'node:crypto';\nimport * as dns from 'node:dns';\nimport * as events from 'node:events';\nimport * as http from 'node:http';\nimport * as https from 'node:https';\nimport * as http2 from 'node:http2';\nimport * as net from 'node:net';\nimport * as os from 'node:os';\nimport * as path from 'node:path';\nimport * as util from 'node:util';\nimport * as child_process from 'node:child_process';\nimport * as stream from 'node:stream';\nimport * as zlib from 'node:zlib';\n\n// @ts-expect-error no types available\nimport * as suncalc from 'suncalc2';\nimport * as axios from 'axios';\n// @ts-expect-error no types available\nimport * as wake_on_lan from 'wake_on_lan';\nimport * as nodeSchedule from 'node-schedule';\n\nimport { getAbsoluteDefaultDataDir, Adapter, EXIT_CODES, type AdapterOptions } from '@iobroker/adapter-core';\nimport type SentryPlugin from '@iobroker/plugin-sentry';\nimport type { GetTimesResult } from 'suncalc';\nimport type { CompileResult } from 'virtual-tsc/build/util';\n\nimport { Mirror } from './lib/mirror';\nimport ProtectFs from './lib/protectFs';\nimport { setLanguage, getLanguage } from './lib/words';\nimport { sandBox } from './lib/sandbox';\nimport { requestModuleNameByUrl } from './lib/nodeModulesManagement';\nimport { createEventObject, type EventObj } from './lib/eventObj';\nimport { type AstroEventName, Scheduler } from './lib/scheduler';\nimport { targetTsLib, tsCompilerOptions, jsDeclarationCompilerOptions } from './lib/typescriptSettings';\nimport { hashSource } from './lib/tools';\nimport {\n resolveTypescriptLibs,\n resolveTypings,\n scriptIdToTSFilename,\n transformScriptBeforeCompilation,\n transformGlobalDeclarations,\n} from './lib/typescriptTools';\nimport type {\n FileSubscriptionResult,\n JavascriptContext,\n JavaScriptAdapterConfig,\n JsScript,\n ScriptType,\n SubscriptionResult,\n SubscribeObject,\n JavascriptTimer,\n SandboxType,\n LogMessage,\n DebugState,\n} from './types';\nimport type { PatternEventCompareFunction } from './lib/patternCompareFunctions';\nimport { decryptText } from './lib/crypto';\n\ntype MODULES = {\n fs: ProtectFs;\n 'fs/promises': ProtectFs['promises'];\n dgram: typeof dgram;\n crypto: typeof crypto;\n dns: typeof dns;\n events: typeof events;\n http: typeof http;\n https: typeof https;\n http2: typeof http2;\n net: typeof net;\n os: typeof os;\n path: typeof path;\n util: typeof util;\n child_process: typeof child_process;\n stream: typeof stream;\n zlib: typeof zlib;\n suncalc: typeof suncalc;\n axios: typeof axios;\n wake_on_lan: typeof wake_on_lan;\n nodeSchedule: typeof nodeSchedule;\n};\n\n/**\n * List of forbidden Locations for a mirror directory\n * relative to the default data directory\n * ATTENTION: the same list is also located in index_m.html!!\n */\nconst forbiddenMirrorLocations: string[] = [\n 'backup-objects',\n 'files',\n 'backitup',\n '../backups',\n '../node_modules',\n '../log',\n];\n\nconst packageJson: Record = JSON.parse(readFileSync(`${__dirname}/../package.json`).toString());\nconst SCRIPT_CODE_MARKER = 'script.js.';\n\nlet webstormDebug: string | undefined;\n\nconst isCI = !!process.env.CI;\n\n// ambient declarations for typescript\nlet tsAmbient: Record;\n\n// TypeScript's scripts are only recompiled if their source hash changes.\n// If an adapter update fixes the compilation bugs, a user won't notice until the changes and re-save the script.\n// To avoid that, we also include the\n// adapter version and TypeScript version in the hash\nconst tsSourceHashBase = `versions:adapter=${packageJson.version},typescript=${packageJson.dependencies.typescript}`;\n\n// taken from here: https://stackoverflow.com/questions/11887934/how-to-check-if-dst-daylight-saving-time-is-in-effect-and-if-so-the-offset\nfunction dstOffsetAtDate(dateInput: Date): number {\n const fullYear: number = dateInput.getFullYear() | 0;\n // \"Leap Years are any year that can be exactly divided by 4 (2012, 2016, etc.)\n // except if it can be exactly divided by 100, then it isn't (2100, 2200, etc.)\n // except if it can be exactly divided by 400, then it is (2000, 2400)\"\n // (https://www.mathsisfun.com/leap-years.html).\n const isLeapYear: 1 | 0 = ((fullYear & 3) | ((fullYear / 100) & 3)) === 0 ? 1 : 0;\n // (fullYear & 3) = (fullYear % 4), but faster\n //Alternative:var isLeapYear=(new Date(currentYear,1,29,12)).getDate()===29?1:0\n const fullMonth: number = dateInput.getMonth() | 0;\n return (\n // 1. We know what the time since the Epoch really is\n +dateInput - // same as the dateInput.getTime() method\n // 2. We know what the time since the Epoch at the start of the year is\n +new Date(fullYear, 0) - // day defaults to 1 if not explicitly zeroed\n // 3. Now, subtract what we would expect the time to be if daylight savings\n // did not exist. This yields the time-offset due to daylight savings.\n // Calculate the day of the year in the Gregorian calendar\n // The code below works based upon the facts of signed right shifts\n // • (x) >> n: shifts n and fills in the n highest bits with 0s\n // • (-x) >> n: shifts n and fills in the n highest bits with 1s\n // (This assumes that x is a positive integer)\n ((((-1 + // the first day in the year is day 1\n (31 & (-fullMonth >> 4)) + // January // (-11)>>4 = -1\n ((28 + isLeapYear) & ((1 - fullMonth) >> 4)) + // February\n (31 & ((2 - fullMonth) >> 4)) + // March\n (30 & ((3 - fullMonth) >> 4)) + // April\n (31 & ((4 - fullMonth) >> 4)) + // May\n (30 & ((5 - fullMonth) >> 4)) + // June\n (31 & ((6 - fullMonth) >> 4)) + // July\n (31 & ((7 - fullMonth) >> 4)) + // August\n (30 & ((8 - fullMonth) >> 4)) + // September\n (31 & ((9 - fullMonth) >> 4)) + // October\n (30 & ((10 - fullMonth) >> 4)) + // November\n // There are no months past December: the year rolls into the next.\n // Thus, \"fullMonth\" is 0-based, so it will never be 12 in JavaScript\n\n (dateInput.getDate() | 0)) & // get day of the month\n 0xffff) *\n 24 *\n 60 + // 24 hours in a day, 60 minutes in an hour\n (dateInput.getHours() & 0xff) * 60 + // 60 minutes in an hour\n (dateInput.getMinutes() & 0xff)) |\n 0) *\n 60 *\n 1000 - // 60 seconds in a minute * 1000 milliseconds in a second\n (dateInput.getSeconds() & 0xff) * 1000 - // 1000 milliseconds in a second\n dateInput.getMilliseconds()\n );\n}\n\nconst regExGlobalOld = /_global$/;\nconst regExGlobalNew = /script\\.js\\.global\\./;\n\nfunction checkIsGlobal(obj: ioBroker.ScriptObject): boolean {\n return obj?.common && (regExGlobalOld.test(obj.common.name) || regExGlobalNew.test(obj._id));\n}\n\nfunction fileMatching(sub: FileSubscriptionResult, id: string, fileName: string): boolean {\n if (sub.idRegEx) {\n if (!sub.idRegEx.test(id)) {\n return false;\n }\n } else {\n if (sub.id !== id) {\n return false;\n }\n }\n if (sub.fileRegEx) {\n if (!sub.fileRegEx.test(fileName)) {\n return false;\n }\n } else {\n if (sub.fileNamePattern !== fileName) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction getNextTimeEvent(time: string, useNextDay?: boolean): Date {\n const now: Date = getAstroStartOfDay();\n const [timeHours, timeMinutes] = time.split(':');\n const nTimeHours = parseInt(timeHours, 10);\n const nTimeMinutes = parseInt(timeMinutes, 10);\n if (\n useNextDay &&\n (now.getHours() > nTimeHours || (now.getHours() === nTimeHours && now.getMinutes() > nTimeMinutes))\n ) {\n now.setDate(now.getDate() + 1);\n }\n\n now.setHours(nTimeHours);\n now.setMinutes(nTimeMinutes);\n\n return now;\n}\n\nfunction getAstroStartOfDay(): Date {\n const d = new Date();\n d.setMinutes(0);\n d.setSeconds(0);\n d.setMilliseconds(0);\n d.setTime(d.getTime() - d.getTimezoneOffset() * 60 * 1000);\n d.setUTCHours(0);\n\n return d;\n}\n\nfunction formatHoursMinutesSeconds(date: Date): string {\n const h = String(date.getHours());\n const m = String(date.getMinutes());\n const s = String(date.getSeconds());\n\n return `${h.padStart(2, '0')}:${m.padStart(2, '0')}:${s.padStart(2, '0')}`;\n}\n\n// Due to a npm bug, virtual-tsc may be hoisted to the top level node_modules, but\n// TypeScript may still be in the adapter level (https://npm.community/t/packages-with-peerdependencies-are-incorrectly-hoisted/4794),\n// so we need to tell virtual-tsc where TypeScript is\nsetTypeScriptResolveOptions({\n paths: [require.resolve('typescript')],\n});\n\n// compiler instance for global JS declarations\nconst jsDeclarationServer: Server = new Server(jsDeclarationCompilerOptions, isCI ? false : undefined);\n/**\n * Stores the IDs of script objects whose change should be ignored because\n * the compiled source was just updated\n */\n\nclass JavaScript extends Adapter {\n declare public config: JavaScriptAdapterConfig;\n\n private readonly context: JavascriptContext;\n\n private errorLogFunction: {\n error: (msg: string) => void;\n warn: (msg: string) => void;\n info: (msg: string) => void;\n debug: (msg: string) => void;\n silly: (msg: string) => void;\n } = {\n error: (msg: string) => console.error(msg),\n warn: (msg: string) => console.warn(msg),\n info: (msg: string) => console.log(msg),\n debug: (msg: string) => console.debug(msg),\n silly: (msg: string) => console.debug(msg),\n };\n\n private readonly mods: MODULES;\n\n private objectsInitDone = false;\n private statesInitDone = false;\n\n private objects: Record = {};\n private states: Record = {};\n private readonly interimStateValues: Record = {};\n private readonly stateIds: string[] = [];\n private readonly subscriptions: SubscriptionResult[] = [];\n private readonly subscriptionsFile: FileSubscriptionResult[] = [];\n private readonly subscriptionsObject: SubscribeObject[] = [];\n private readonly subscribedPatterns: Record = {};\n private readonly subscribedPatternsFile: Record = {};\n private readonly adapterSubs: Record = {};\n private readonly timers: { [scriptName: string]: JavascriptTimer[] } = {};\n private readonly _enums: string[] = [];\n private readonly names: { [name: string]: string | string[] } = {}; // name: id\n private readonly scripts: Record = {};\n private password: string = '';\n private readonly messageBusHandlers: Record<\n string,\n Record void }[]>\n > = {};\n private readonly logSubscriptions: Record<\n string,\n {\n sandbox: SandboxType;\n cb: (info: LogMessage) => void;\n id: number;\n severity: ioBroker.LogLevel | '*';\n }[]\n > = {};\n private readonly tempDirectories: { [scriptName: string]: string } = {}; // name: path\n private readonly folderCreationVerifiedObjects: Record = {};\n\n /** if logs are subscribed or not */\n private logSubscribed = false;\n\n private timeSettings: {\n format12: boolean;\n leadingZeros: boolean;\n } = { format12: false, leadingZeros: true };\n\n private dayScheduleTimer: NodeJS.Timeout | null = null; // schedule for astrological day\n private sunScheduleTimer: NodeJS.Timeout | null = null; // schedule for sun moment times\n private timeScheduleTimer: NodeJS.Timeout | null = null; // schedule for astrological day\n\n private activeStr = ''; // enabled state prefix\n\n private mirror: Mirror | undefined;\n\n private stopCounters: Record = {};\n\n private setStateCountCheckInterval: NodeJS.Timeout | null = null;\n\n private globalScript = '';\n /** Generated declarations for global TypeScripts */\n private globalDeclarations = '';\n // Remember which definitions the global scripts\n // have access to, because it depends on the compilation order\n private knownGlobalDeclarationsByScript: Record = {};\n private globalScriptLines = 0;\n // compiler instance for typescript\n private tsServer: Server;\n\n private readonly ignoreObjectChange: Set = new Set();\n\n private debugState: DebugState = {\n scriptName: '',\n child: null,\n promiseOnEnd: null,\n paused: false,\n started: 0,\n running: false,\n };\n\n constructor(options: Partial = {}) {\n options = {\n ...options,\n name: 'javascript', // adapter name\n useFormatDate: true,\n /**\n * If the JS-Controller catches an unhandled error, this will be called,\n * so we have a chance to handle it ourselves.\n */\n error: (err: Error): boolean => {\n // Identify unhandled errors originating from callbacks in scripts\n // These are not caught by wrapping the execution code in try-catch\n if (err && typeof err.stack === 'string') {\n const scriptCodeMarkerIndex = err.stack.indexOf(SCRIPT_CODE_MARKER);\n if (scriptCodeMarkerIndex > -1) {\n // This is a script error\n let scriptName = err.stack.substring(scriptCodeMarkerIndex);\n scriptName = scriptName.substring(0, scriptName.indexOf(':'));\n this.logError(scriptName, 'Error:', err);\n\n // Leave the script running for now\n // signal to the JS-Controller that we handled the error ourselves\n return true;\n }\n // check if a path contains adaptername but not own node_module\n // this regex matched \"iobroker.javascript/\" if NOT followed by \"node_modules\"\n if (!err.stack.match(/iobroker\\.javascript[/\\\\](?!.*node_modules).*/g)) {\n // This is an error without any info on origin (mostly async errors like connection errors)\n // also consider it as being from a script\n this.log.error(\n 'An error happened which is most likely from one of your scripts, but the originating script could not be detected.',\n );\n this.log.error(`Error: ${err.message}`);\n this.log.error(err.stack);\n\n // signal to the JS-Controller that we handled the error ourselves\n return true;\n }\n }\n\n return false;\n },\n };\n\n super(options as AdapterOptions);\n\n this.on('objectChange', this.onObjectChange.bind(this));\n this.on('stateChange', this.onStateChange.bind(this));\n this.on('ready', this.onReady.bind(this));\n this.on('message', this.onMessage.bind(this));\n this.on('unload', this.onUnload.bind(this));\n this.on('fileChange', this.onFileChange.bind(this));\n this.on('log', this.onLog.bind(this));\n\n this.mods = {\n fs: {} as ProtectFs,\n 'fs/promises': {} as ProtectFs['promises'],\n dgram,\n crypto,\n dns,\n events,\n http,\n https,\n http2,\n net,\n os,\n path,\n util,\n child_process,\n stream,\n zlib,\n\n suncalc,\n axios,\n wake_on_lan,\n nodeSchedule,\n };\n\n // check the webstorm debug and just debug modes\n let debugMode: string | undefined;\n if (process.argv) {\n for (let a = 1; a < process.argv.length; a++) {\n if (process.argv[a].startsWith('--webstorm')) {\n webstormDebug = process.argv[a].replace(/^(.*?=\\s*)/, '');\n }\n if (process.argv[a] === '--debugScript') {\n if (!process.argv[a + 1]) {\n console.log('No script name provided');\n process.exit(300);\n } else {\n debugMode = process.argv[a + 1];\n }\n }\n }\n }\n\n this.context = {\n mods: this.mods,\n objects: this.objects,\n states: this.states,\n interimStateValues: this.interimStateValues,\n stateIds: this.stateIds,\n errorLogFunction: this.errorLogFunction,\n subscriptions: this.subscriptions,\n subscriptionsFile: this.subscriptionsFile,\n subscriptionsObject: this.subscriptionsObject,\n subscribedPatterns: this.subscribedPatterns,\n subscribedPatternsFile: this.subscribedPatternsFile,\n adapterSubs: this.adapterSubs,\n cacheObjectEnums: {},\n timers: this.timers,\n enums: this._enums,\n names: this.names,\n scripts: this.scripts,\n messageBusHandlers: this.messageBusHandlers,\n logSubscriptions: this.logSubscriptions,\n tempDirectories: this.tempDirectories,\n folderCreationVerifiedObjects: this.folderCreationVerifiedObjects,\n\n isEnums: false, // If some subscription wants enum\n channels: null,\n devices: null,\n logWithLineInfo: this.logWithLineInfo.bind(this),\n scheduler: null,\n timerId: 0,\n rulesOpened: null, // opened rules\n language: this.language || 'en',\n\n updateLogSubscriptions: this.updateLogSubscriptions.bind(this),\n convertBackStringifiedValues: this.convertBackStringifiedValues.bind(this),\n updateObjectContext: this.updateObjectContext.bind(this),\n prepareStateObject: this.prepareStateObject.bind(this),\n debugMode,\n getAbsoluteDefaultDataDir,\n adapter: this as unknown as ioBroker.Adapter,\n logError: this.logError.bind(this),\n allowSelfSignedCerts: false,\n };\n\n this.tsServer = new Server(tsCompilerOptions, this.tsLog);\n }\n\n async onObjectChange(id: string, obj?: ioBroker.Object | null): Promise {\n // Check if we should ignore this change (once!) because we just updated the compiled sources\n if (this.ignoreObjectChange.has(id)) {\n // Update the cached script object and do nothing more\n this.objects[id] = obj as ioBroker.Object;\n this.ignoreObjectChange.delete(id);\n return;\n }\n\n // When still in initializing: already remember current values,\n // but data structures are initialized elsewhere\n if (!this.objectsInitDone) {\n if (obj) {\n this.objects[id] = obj;\n }\n return;\n }\n\n if (id.startsWith('enum.')) {\n // clear cache\n this.context.cacheObjectEnums = {};\n\n // update this._enums array\n if (obj) {\n // If new\n if (!this._enums.includes(id)) {\n this._enums.push(id);\n this._enums.sort();\n }\n } else {\n const pos = this._enums.indexOf(id);\n // if deleted\n if (pos !== -1) {\n this._enums.splice(pos, 1);\n }\n }\n }\n\n if (id === 'system.config' && obj?.common?.language) {\n // set language for debug messages\n setLanguage(obj.common.language);\n this.language = obj.common.language;\n this.context.language = this.language as ioBroker.Languages;\n }\n\n // update stored time format for variables.dayTime\n if (id === `${this.namespace}.variables.dayTime` && obj?.native) {\n this.timeSettings.format12 = obj.native.format12 || false;\n this.timeSettings.leadingZeros = obj.native.leadingZeros === undefined ? true : obj.native.leadingZeros;\n }\n\n // send changes to the disk mirror\n this.mirror?.onObjectChange(id, obj as ioBroker.ScriptObject | null);\n\n const formerObj = this.objects[id];\n\n this.updateObjectContext(id, obj); // Update all Meta object data\n\n // for the alias object changes on the state objects, we need to manually update the\n // state cache value, because the new value is only published on the next change\n if (obj?.type === 'state' && id.startsWith('alias.0.')) {\n // execute async for speed\n this.getForeignStateAsync(id)\n .then(state => {\n if (state) {\n this.states[id] = state;\n } else if (this.states[id] !== undefined) {\n delete this.states[id];\n }\n })\n .catch(() => {\n /* ignore */\n });\n }\n\n this.subscriptionsObject.forEach(sub => {\n // ToDo: implement comparing with id.0.* too\n if (sub.pattern === id) {\n try {\n sub.callback(id, obj);\n } catch (err: any) {\n this.log.error(`Error in callback: ${err.toString()}`);\n }\n }\n });\n\n // handle Script object updates\n if (!obj && formerObj?.type === 'script') {\n // Object Deleted just now\n if (checkIsGlobal(formerObj)) {\n // it was a global Script, and it was enabled and is now deleted => restart adapter\n if (formerObj.common.enabled) {\n this.log.info(`Active global Script ${id} deleted. Restart instance.`);\n this.restart();\n }\n } else if (formerObj.common?.engine === `system.adapter.${this.namespace}`) {\n // It was a non-global Script and deleted => stop and remove it\n await this.stopScript(id);\n\n // delete scriptEnabled.blabla variable\n const idActive = `scriptEnabled.${id.substring(SCRIPT_CODE_MARKER.length)}`;\n await this.delStateAsync(idActive);\n await this.delObjectAsync(idActive);\n\n // delete scriptProblem.blabla variable\n const idProblem = `scriptProblem.${id.substring(SCRIPT_CODE_MARKER.length)}`;\n await this.delStateAsync(idProblem);\n await this.delObjectAsync(idProblem);\n }\n } else if (!formerObj && obj?.type === 'script') {\n // New script that does not exist before\n if (checkIsGlobal(obj)) {\n // new global script added => restart adapter\n if (obj.common.enabled) {\n this.log.info(`Active global Script ${id} created. Restart instance.`);\n this.restart();\n }\n } else if (obj.common?.engine === `system.adapter.${this.namespace}`) {\n // new non-global script - create states for scripts\n await this.createActiveObject(id, !!obj.common.enabled);\n await this.createProblemObject(id);\n if (obj.common.enabled) {\n // if enabled => Start a script\n await this.loadScriptById(id);\n }\n }\n } else if (obj?.type === 'script' && formerObj?.common) {\n // Script changed ...\n if (checkIsGlobal(obj)) {\n if (obj.common.enabled || formerObj.common.enabled) {\n this.log.info(`Global Script ${id} updated. Restart instance.`);\n this.restart();\n }\n } else {\n // No global script\n if (obj.common?.engine === `system.adapter.${this.namespace}`) {\n // create states for scripts\n await this.createActiveObject(id, !!obj.common.enabled);\n await this.createProblemObject(id);\n }\n\n if (\n (formerObj.common.enabled && !obj.common.enabled) ||\n (formerObj.common.engine === `system.adapter.${this.namespace}` &&\n obj.common.engine !== `system.adapter.${this.namespace}`)\n ) {\n // Script disabled\n if (formerObj.common.enabled && formerObj.common.engine === `system.adapter.${this.namespace}`) {\n // Remove it from executing\n await this.stopScript(id);\n }\n } else if (\n (!formerObj.common.enabled && obj.common.enabled) ||\n (formerObj.common.engine !== `system.adapter.${this.namespace}` &&\n obj.common.engine === `system.adapter.${this.namespace}`)\n ) {\n // Script enabled\n\n if (obj.common.enabled && obj.common.engine === `system.adapter.${this.namespace}`) {\n // Start script\n await this.loadScriptById(id);\n }\n } else {\n // if (obj.common.source !== formerObj.common.source) {\n // Source changed => restart the script\n this.stopCounters[id] = this.stopCounters[id] ? this.stopCounters[id] + 1 : 1;\n void this.stopScript(id).then(() => {\n // only start again after stop when \"last\" object change to prevent problems on\n // multiple changes in fast frequency\n if (!--this.stopCounters[id]) {\n void this.loadScriptById(id);\n }\n });\n }\n }\n }\n }\n\n onStateChange(id: string, state?: ioBroker.State | null): void {\n if (this.interimStateValues[id] !== undefined) {\n // any update invalidates the remembered interim value\n delete this.interimStateValues[id];\n }\n if (!id || id.startsWith('messagebox.') || id.startsWith('log.')) {\n return;\n }\n\n if (id === `${this.namespace}.debug.to` && state && !state.ack) {\n if (!this.context.debugMode) {\n this.debugSendToInspector(state.val);\n }\n return;\n }\n\n // When still in initializing: already remember current values,\n // but data structures are initialized elsewhere\n if (!this.statesInitDone) {\n if (state) {\n this.states[id] = state;\n }\n return;\n }\n\n const oldState: ioBroker.State | null | undefined = this.states[id];\n if (state) {\n if (oldState) {\n // enable or disable script\n if (!state.ack && id.startsWith(this.activeStr) && this.objects[id]?.native?.script) {\n void this.extendForeignObject(this.objects[id].native.script, {\n common: { enabled: state.val },\n });\n }\n\n // monitor if the adapter is alive and send all subscriptions once more, after the adapter goes online\n if (/*oldState && */ oldState.val === false && state.val && id.endsWith('.alive')) {\n if (this.adapterSubs[id]) {\n const parts = id.split('.');\n const a = `${parts[2]}.${parts[3]}`;\n for (let t = 0; t < this.adapterSubs[id].length; t++) {\n this.log.info(`Detected coming adapter \"${a}\". Send subscribe: ${this.adapterSubs[id][t]}`);\n this.sendTo(a, 'subscribe', this.adapterSubs[id][t]);\n }\n }\n }\n } else if (/*!oldState && */ !this.stateIds.includes(id)) {\n this.stateIds.push(id);\n this.stateIds.sort();\n }\n this.states[id] = state;\n } else {\n if (oldState) {\n delete this.states[id];\n }\n state = {} as ioBroker.State;\n const pos = this.stateIds.indexOf(id);\n if (pos !== -1) {\n this.stateIds.splice(pos, 1);\n }\n }\n const _eventObj = createEventObject(\n this.context,\n id,\n this.convertBackStringifiedValues(id, state),\n this.convertBackStringifiedValues(id, oldState),\n );\n\n // if this state matches any subscriptions\n for (let i = 0, l = this.subscriptions.length; i < l; i++) {\n const sub = this.subscriptions[i];\n if (sub?.patternCompareFunctions && patternMatching(_eventObj, sub.patternCompareFunctions)) {\n try {\n sub.callback(_eventObj);\n } catch (err: any) {\n this.log.error(`Error in callback: ${err.toString()}`);\n }\n }\n }\n }\n\n onFileChange(id: string, fileName: string, size: number | null): void {\n // if this file matches any subscriptions\n for (let i = 0, l = this.subscriptionsFile.length; i < l; i++) {\n const sub = this.subscriptionsFile[i];\n if (sub && fileMatching(sub, id, fileName)) {\n try {\n sub.callback(id, fileName, size, sub.withFile);\n } catch (err: any) {\n this.log.error(`Error in callback: ${err.toString()}`);\n }\n }\n }\n }\n\n async onUnload(callback: () => void): Promise {\n await this.debugStop();\n this.stopTimeSchedules();\n if (this.setStateCountCheckInterval) {\n clearInterval(this.setStateCountCheckInterval);\n this.setStateCountCheckInterval = null;\n }\n await this.stopAllScripts();\n if (typeof callback === 'function') {\n callback();\n }\n }\n\n async onReady(): Promise {\n this.errorLogFunction = this.log;\n this.context.errorLogFunction = this.log;\n\n this.config.maxSetStatePerMinute = parseInt(this.config.maxSetStatePerMinute as unknown as string, 10) || 1000;\n this.config.maxTriggersPerScript = parseInt(this.config.maxTriggersPerScript as unknown as string, 10) || 100;\n\n if (this.supportsFeature?.('PLUGINS')) {\n const sentryInstance: InstanceType = this.getPluginInstance('sentry') as InstanceType<\n typeof SentryPlugin\n >;\n if (sentryInstance) {\n const Sentry = sentryInstance.getSentryObject();\n Sentry?.withScope(scope => {\n scope.addEventProcessor((event, _hint) => {\n if (event.exception?.values?.[0]) {\n const eventData = event.exception.values[0];\n if (\n eventData.stacktrace?.frames &&\n Array.isArray(eventData.stacktrace.frames) &&\n eventData.stacktrace.frames.length\n ) {\n // Exclude event if script Marker is included\n if (\n eventData.stacktrace.frames.find(frame =>\n frame.filename?.includes(SCRIPT_CODE_MARKER),\n )\n ) {\n return null;\n }\n // Exclude event if own directory is included but not inside own node_modules\n const ownNodeModulesDir = join(__dirname, 'node_modules');\n if (\n !eventData.stacktrace.frames.find(\n frame =>\n frame.filename?.includes(__dirname) &&\n !frame.filename.includes(ownNodeModulesDir),\n )\n ) {\n return null;\n }\n // We have exception data and did not sort it out, so report it\n return event;\n }\n }\n\n // No exception in it ... do not report\n return null;\n });\n });\n }\n }\n\n await this.main();\n }\n\n onMessage(obj: ioBroker.Message): void {\n switch (obj?.command) {\n // process messageTo commands\n case 'toScript':\n case 'jsMessageBus':\n if (\n obj.message &&\n (obj.message.instance === null ||\n obj.message.instance === undefined ||\n `javascript.${obj.message.instance}` === this.namespace ||\n obj.message.instance === this.namespace)\n ) {\n Object.keys(this.messageBusHandlers).forEach(name => {\n // the script name could be script.js.xxx or only xxx\n if (\n (!obj.message.script || obj.message.script === name) &&\n this.messageBusHandlers[name][obj.message.message]\n ) {\n this.messageBusHandlers[name][obj.message.message].forEach(handler => {\n const sandbox = handler.sandbox;\n\n sandbox.verbose && sandbox.log(`onMessage: ${JSON.stringify(obj.message)}`, 'info');\n\n try {\n if (obj.callback) {\n handler.cb.call(sandbox, obj.message.data, (result: any) => {\n if (sandbox.verbose) {\n sandbox.log(`onMessage result: ${JSON.stringify(result)}`, 'info');\n }\n\n this.sendTo(obj.from, obj.command, result, obj.callback);\n });\n } else {\n handler.cb.call(sandbox, obj.message.data, (result: any) => {\n sandbox.verbose &&\n sandbox.log(`onMessage result: ${JSON.stringify(result)}`, 'info');\n });\n }\n } catch (err: unknown) {\n void this.setState(\n `scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`,\n true,\n true,\n );\n this.logError(name, 'Error in callback:', err as Error);\n }\n });\n }\n });\n }\n break;\n\n case 'loadTypings': {\n // Load typings for the editor\n const typings: Record = {};\n\n // try to load TypeScript lib files from disk\n try {\n const typescriptLibs = resolveTypescriptLibs(targetTsLib);\n Object.assign(typings, typescriptLibs);\n } catch {\n /* ok, no lib then */\n }\n\n // provide the already-loaded ioBroker typings and global script declarations\n Object.assign(typings, tsAmbient);\n\n // also provide the known global declarations for each global script\n for (const globalScriptPaths of Object.keys(this.knownGlobalDeclarationsByScript)) {\n typings[`${globalScriptPaths}.d.ts`] = this.knownGlobalDeclarationsByScript[globalScriptPaths];\n }\n\n if (obj.callback) {\n this.sendTo(obj.from, obj.command, { typings }, obj.callback);\n }\n break;\n }\n\n case 'calcAstroAll': {\n if (obj.message) {\n const sunriseOffset =\n parseInt(\n obj.message.sunriseOffset === undefined\n ? this.config.sunriseOffset\n : obj.message.sunriseOffset,\n 10,\n ) || 0;\n const sunsetOffset =\n parseInt(\n obj.message.sunsetOffset === undefined\n ? this.config.sunsetOffset\n : obj.message.sunsetOffset,\n 10,\n ) || 0;\n const longitude =\n parseFloat(\n obj.message.longitude === undefined ? this.config.longitude : obj.message.longitude,\n ) || 0;\n const latitude =\n parseFloat(obj.message.latitude === undefined ? this.config.latitude : obj.message.latitude) ||\n 0;\n const today = getAstroStartOfDay();\n let astroEvents: GetTimesResult & { nextSunrise: Date; nextSunset: Date } = {} as GetTimesResult & {\n nextSunrise: Date;\n nextSunset: Date;\n };\n try {\n astroEvents = this.mods.suncalc.getTimes(today, latitude, longitude);\n } catch (err: unknown) {\n this.log.error(`Cannot calculate astro data: ${err as Error}`);\n }\n if (astroEvents) {\n try {\n astroEvents.nextSunrise = this.getAstroEvent(\n today,\n obj.message.sunriseEvent || this.config.sunriseEvent,\n obj.message.sunriseLimitStart || this.config.sunriseLimitStart,\n obj.message.sunriseLimitEnd || this.config.sunriseLimitEnd,\n sunriseOffset,\n false,\n latitude,\n longitude,\n true,\n );\n astroEvents.nextSunset = this.getAstroEvent(\n today,\n obj.message.sunsetEvent || this.config.sunsetEvent,\n obj.message.sunsetLimitStart || this.config.sunsetLimitStart,\n obj.message.sunsetLimitEnd || this.config.sunsetLimitEnd,\n sunsetOffset,\n true,\n latitude,\n longitude,\n true,\n );\n } catch (err: unknown) {\n this.log.error(`Cannot calculate astro data: ${err as Error}`);\n }\n }\n\n const result: Record = {};\n const keys = Object.keys(astroEvents).sort(\n (a, b) =>\n (astroEvents as unknown as Record)[a] -\n (astroEvents as unknown as Record)[b],\n );\n keys.forEach(key => {\n const validDate =\n (astroEvents as unknown as Record)[key] !== null &&\n !isNaN((astroEvents as unknown as Record)[key].getTime());\n\n result[key] = {\n isValidDate: validDate,\n serverTime: validDate\n ? formatHoursMinutesSeconds((astroEvents as unknown as Record)[key])\n : 'n/a',\n date: validDate\n ? (astroEvents as unknown as Record)[key].toISOString()\n : 'n/a',\n };\n });\n\n if (obj.callback) {\n this.sendTo(obj.from, obj.command, result, obj.callback);\n }\n }\n break;\n }\n\n case 'calcAstro': {\n if (obj.message) {\n const longitude =\n parseFloat(\n obj.message.longitude === undefined ? this.config.longitude : obj.message.longitude,\n ) || 0;\n const latitude =\n parseFloat(obj.message.latitude === undefined ? this.config.latitude : obj.message.latitude) ||\n 0;\n const today = getAstroStartOfDay();\n\n const sunriseEvent = obj.message?.sunriseEvent || this.config.sunriseEvent;\n const sunriseLimitStart = obj.message?.sunriseLimitStart || this.config.sunriseLimitStart;\n const sunriseLimitEnd = obj.message?.sunriseLimitEnd || this.config.sunriseLimitEnd;\n const sunriseOffset =\n parseInt(\n obj.message.sunriseOffset === undefined\n ? this.config.sunriseOffset\n : obj.message.sunriseOffset,\n 10,\n ) || 0;\n const nextSunrise = this.getAstroEvent(\n today,\n sunriseEvent,\n sunriseLimitStart,\n sunriseLimitEnd,\n sunriseOffset,\n false,\n latitude,\n longitude,\n true,\n );\n\n const sunsetEvent = obj.message?.sunsetEvent || this.config.sunsetEvent;\n const sunsetLimitStart = obj.message?.sunsetLimitStart || this.config.sunsetLimitStart;\n const sunsetLimitEnd = obj.message?.sunsetLimitEnd || this.config.sunsetLimitEnd;\n const sunsetOffset =\n parseInt(\n obj.message.sunsetOffset === undefined\n ? this.config.sunsetOffset\n : obj.message.sunsetOffset,\n 10,\n ) || 0;\n const nextSunset = this.getAstroEvent(\n today,\n sunsetEvent,\n sunsetLimitStart,\n sunsetLimitEnd,\n sunsetOffset,\n true,\n latitude,\n longitude,\n true,\n );\n\n const validDateSunrise = nextSunrise !== null && !isNaN(nextSunrise.getTime());\n const validDateSunset = nextSunset !== null && !isNaN(nextSunset.getTime());\n\n this.log.debug(\n `calcAstro sunrise: ${sunriseEvent} -> start ${sunriseLimitStart}, end: ${sunriseLimitEnd}, offset: ${sunriseOffset} - ${validDateSunrise ? nextSunrise.toISOString() : 'n/a'}`,\n );\n this.log.debug(\n `calcAstro sunset: ${sunsetEvent} -> start ${sunsetLimitStart}, end: ${sunsetLimitEnd}, offset: ${sunsetOffset} - ${validDateSunset ? nextSunset.toISOString() : 'n/a'}`,\n );\n\n if (obj.callback) {\n this.sendTo(\n obj.from,\n obj.command,\n {\n nextSunrise: {\n isValidDate: validDateSunrise,\n serverTime: validDateSunrise ? formatHoursMinutesSeconds(nextSunrise) : 'n/a',\n date: nextSunrise.toISOString(),\n },\n nextSunset: {\n isValidDate: validDateSunset,\n serverTime: validDateSunset ? formatHoursMinutesSeconds(nextSunset) : 'n/a',\n date: nextSunset.toISOString(),\n },\n },\n obj.callback,\n );\n }\n }\n break;\n }\n\n case 'debug': {\n if (!this.context.debugMode) {\n this.debugStart(obj.message);\n }\n break;\n }\n\n case 'debugStop': {\n if (!this.context.debugMode) {\n void this.debugStop().then(() => console.log('stopped'));\n }\n break;\n }\n\n case 'rulesOn': {\n this.context.rulesOpened = obj.message;\n console.log(`Enable messaging for ${this.context.rulesOpened}`);\n break;\n }\n\n case 'rulesOff': {\n // maybe if (context.rulesOpened === obj.message)\n console.log(`Disable messaging for ${this.context.rulesOpened}`);\n this.context.rulesOpened = null;\n break;\n }\n\n case 'getIoBrokerDataDir': {\n if (obj.callback) {\n this.sendTo(\n obj.from,\n obj.command,\n {\n dataDir: getAbsoluteDefaultDataDir(),\n sep,\n },\n obj.callback,\n );\n }\n break;\n }\n\n case 'chatCompletion': {\n // Proxy chat completion requests to an OpenAI-compatible API endpoint\n if (obj.callback) {\n const baseUrl = (obj.message?.baseUrl || '').trim();\n const apiKey = (obj.message?.apiKey || '').trim();\n const chatModel = (obj.message?.model || '').trim();\n const messages = obj.message?.messages;\n const provider = (obj.message?.provider || 'openai').trim();\n // Anthropic, Gemini, and DeepSeek always require an API key; OpenAI-compatible allows empty key with custom base URL\n if (\n !apiKey &&\n (provider === 'anthropic' || provider === 'gemini' || provider === 'deepseek' || !baseUrl)\n ) {\n this.sendTo(obj.from, obj.command, { error: 'No API key provided' }, obj.callback);\n break;\n }\n if (!chatModel || !messages) {\n this.sendTo(obj.from, obj.command, { error: 'Model and messages are required' }, obj.callback);\n break;\n }\n\n let url: string;\n const chatHeaders: Record = {\n 'Content-Type': 'application/json',\n };\n let bodyObj: Record;\n\n if (provider === 'anthropic') {\n url = 'https://api.anthropic.com/v1/messages';\n chatHeaders['x-api-key'] = apiKey;\n chatHeaders['anthropic-version'] = '2023-06-01';\n const systemMessages = messages.filter((m: { role: string }) => m.role === 'system');\n const nonSystemMessages = messages.filter((m: { role: string }) => m.role !== 'system');\n const systemText = systemMessages.map((m: { content: string }) => m.content).join('\\n\\n');\n bodyObj = {\n model: chatModel,\n max_tokens: 8192,\n stream: false,\n ...(systemText ? { system: systemText } : {}),\n messages: nonSystemMessages,\n };\n } else if (provider === 'gemini') {\n url = 'https://generativelanguage.googleapis.com/v1beta/openai/chat/completions';\n if (apiKey) {\n chatHeaders.Authorization = `Bearer ${apiKey}`;\n }\n bodyObj = { model: chatModel, messages, stream: false };\n } else if (provider === 'deepseek') {\n url = 'https://api.deepseek.com/chat/completions';\n chatHeaders.Authorization = `Bearer ${apiKey}`;\n bodyObj = { model: chatModel, messages, stream: false };\n } else {\n url = `${baseUrl || 'https://api.openai.com/v1'}/chat/completions`;\n if (apiKey) {\n chatHeaders.Authorization = `Bearer ${apiKey}`;\n }\n bodyObj = { model: chatModel, messages, stream: false };\n }\n\n const body = JSON.stringify(bodyObj);\n const bodyBuffer = Buffer.from(body, 'utf8');\n chatHeaders['Content-Length'] = bodyBuffer.length;\n\n let urlObj: URL;\n try {\n urlObj = new URL(url);\n } catch {\n this.sendTo(obj.from, obj.command, { error: `Invalid API URL: ${url}` }, obj.callback);\n break;\n }\n const isHttps = urlObj.protocol === 'https:';\n const requestModule = isHttps ? https : http;\n\n const req = requestModule.request(\n url,\n {\n method: 'POST',\n headers: chatHeaders,\n timeout: 600000,\n ...(isHttps && this.config.allowSelfSignedCerts ? { rejectUnauthorized: false } : {}),\n },\n res => {\n let data = '';\n res.on('data', (chunk: Buffer) => {\n data += chunk.toString();\n });\n res.on('end', () => {\n if (res.statusCode === 200) {\n try {\n const parsed = JSON.parse(data);\n const content =\n provider === 'anthropic'\n ? parsed.content?.[0]?.text || ''\n : parsed.choices?.[0]?.message?.content || '';\n if (!content) {\n this.sendTo(\n obj.from,\n obj.command,\n { error: 'Empty response from API' },\n obj.callback,\n );\n } else {\n this.sendTo(\n obj.from,\n obj.command,\n { success: true, content },\n obj.callback,\n );\n }\n } catch {\n this.sendTo(\n obj.from,\n obj.command,\n { error: 'Invalid JSON response from API' },\n obj.callback,\n );\n }\n } else {\n let errorMsg = `API returned status ${res.statusCode}`;\n try {\n const parsed = JSON.parse(data);\n if (parsed.error?.message) {\n errorMsg = parsed.error.message;\n }\n } catch {\n // ignore parse error\n }\n this.sendTo(obj.from, obj.command, { error: errorMsg }, obj.callback);\n }\n });\n },\n );\n\n req.on('error', (err: Error) => {\n this.sendTo(\n obj.from,\n obj.command,\n { error: `Connection failed: ${err.message}` },\n obj.callback,\n );\n });\n\n req.on('timeout', () => {\n req.destroy();\n this.sendTo(obj.from, obj.command, { error: 'Connection timeout (600s)' }, obj.callback);\n });\n\n req.write(bodyBuffer);\n req.end();\n }\n break;\n }\n\n case 'testApiConnection': {\n // Test connection to an OpenAI-compatible API endpoint\n if (obj.callback) {\n const baseUrl = (obj.message?.baseUrl || '').trim();\n const apiKey = (obj.message?.apiKey || '').trim();\n const provider = (obj.message?.provider || 'openai').trim();\n // Anthropic, Gemini, and DeepSeek always require an API key; OpenAI-compatible allows empty key with custom base URL\n if (\n !apiKey &&\n (provider === 'anthropic' || provider === 'gemini' || provider === 'deepseek' || !baseUrl)\n ) {\n this.sendTo(obj.from, obj.command, { error: 'No API key provided' }, obj.callback);\n break;\n }\n\n let url: string;\n const testHeaders: Record = {\n 'Content-Type': 'application/json',\n };\n\n if (provider === 'anthropic') {\n url = 'https://api.anthropic.com/v1/models';\n testHeaders['x-api-key'] = apiKey;\n testHeaders['anthropic-version'] = '2023-06-01';\n } else if (provider === 'gemini') {\n url = 'https://generativelanguage.googleapis.com/v1beta/openai/models';\n if (apiKey) {\n testHeaders.Authorization = `Bearer ${apiKey}`;\n }\n } else if (provider === 'deepseek') {\n url = 'https://api.deepseek.com/models';\n testHeaders.Authorization = `Bearer ${apiKey}`;\n } else {\n url = `${baseUrl || 'https://api.openai.com/v1'}/models`;\n if (apiKey) {\n testHeaders.Authorization = `Bearer ${apiKey}`;\n }\n }\n\n let urlObj: URL;\n try {\n urlObj = new URL(url);\n } catch {\n this.sendTo(obj.from, obj.command, { error: `Invalid API URL: ${url}` }, obj.callback);\n break;\n }\n const isHttps = urlObj.protocol === 'https:';\n const requestModule = isHttps ? https : http;\n\n const req = requestModule.request(\n url,\n {\n method: 'GET',\n headers: testHeaders,\n timeout: 10000,\n ...(isHttps && this.config.allowSelfSignedCerts ? { rejectUnauthorized: false } : {}),\n },\n res => {\n let data = '';\n res.on('data', (chunk: Buffer) => {\n data += chunk.toString();\n });\n res.on('end', () => {\n if (res.statusCode === 200) {\n try {\n const parsed = JSON.parse(data);\n const models: string[] = (parsed.data || [])\n .map((m: { id: string }) =>\n m.id.startsWith('models/') ? m.id.substring(7) : m.id,\n )\n .sort();\n this.sendTo(\n obj.from,\n obj.command,\n { success: true, models, count: models.length },\n obj.callback,\n );\n } catch {\n this.sendTo(\n obj.from,\n obj.command,\n { error: 'Invalid JSON response from API' },\n obj.callback,\n );\n }\n } else if (res.statusCode === 401) {\n this.sendTo(\n obj.from,\n obj.command,\n { error: 'Invalid API key (401)' },\n obj.callback,\n );\n } else if (res.statusCode === 403) {\n this.sendTo(obj.from, obj.command, { error: 'Access denied (403)' }, obj.callback);\n } else {\n this.sendTo(\n obj.from,\n obj.command,\n { error: `API returned status ${res.statusCode}` },\n obj.callback,\n );\n }\n });\n },\n );\n\n req.on('error', (err: Error) => {\n this.sendTo(\n obj.from,\n obj.command,\n { error: `Connection failed: ${err.message}` },\n obj.callback,\n );\n });\n\n req.on('timeout', () => {\n req.destroy();\n this.sendTo(obj.from, obj.command, { error: 'Connection timeout (10s)' }, obj.callback);\n });\n\n req.end();\n }\n break;\n }\n\n case 'prettier': {\n // Format the code with Prettier\n if (obj.message && typeof obj.message.code === 'string') {\n try {\n prettier\n .format(obj.message.code, {\n parser: obj.message.type === 'typescript' ? 'babel-ts' : 'babel',\n printWidth: 120,\n semi: true,\n tabWidth: 4,\n useTabs: false,\n trailingComma: 'all',\n singleQuote: true,\n singleAttributePerLine: true,\n endOfLine: 'lf',\n bracketSpacing: true,\n arrowParens: 'avoid',\n quoteProps: 'as-needed',\n })\n .then(formattedCode => {\n if (obj.callback) {\n this.sendTo(obj.from, obj.command, { code: formattedCode }, obj.callback);\n } else {\n this.logWithLineInfo(`Formatted code:\\n${formattedCode}`);\n }\n })\n .catch(e => {\n this.logError('Prettier', 'Error formatting code:', e as Error);\n this.sendTo(obj.from, obj.command, { error: (e as Error).toString() }, obj.callback);\n });\n } catch (e) {\n this.logError('Prettier', 'Error formatting code:', e as Error);\n this.sendTo(obj.from, obj.command, { error: (e as Error).toString() }, obj.callback);\n }\n } else {\n this.sendTo(obj.from, obj.command, { error: 'No code provided' }, obj.callback);\n }\n break;\n }\n }\n }\n\n onLog(msg: any): void {\n Object.keys(this.logSubscriptions).forEach((name: string): void =>\n this.logSubscriptions[name].forEach(handler => {\n if (\n typeof handler.cb === 'function' &&\n (handler.severity === '*' || handler.severity === msg.severity)\n ) {\n handler.sandbox.logHandler = handler.severity || '*';\n handler.cb.call(handler.sandbox, msg);\n handler.sandbox.logHandler = undefined;\n }\n }),\n );\n }\n\n logError(scriptName: string, msg: string, e: Error, offs?: number): void {\n const stack = e.stack ? e.stack.toString().split('\\n') : e ? e.toString() : '';\n if (!msg.includes('\\n')) {\n msg = msg.replace(/[: ]*$/, ': ');\n }\n if (!msg.endsWith(' ')) {\n msg += ':';\n }\n if (!scriptName.startsWith(SCRIPT_CODE_MARKER)) {\n scriptName = SCRIPT_CODE_MARKER + scriptName;\n }\n\n this.errorLogFunction.error(`${scriptName}: ${msg}${this.fixLineNo(stack[0])}`);\n for (let i = offs || 1; i < stack.length; i++) {\n if (!stack[i]) {\n continue;\n }\n if (stack[i].match(/runInNewContext|javascript\\.js:/)) {\n break;\n }\n this.errorLogFunction.error(`${scriptName}: ${this.fixLineNo(stack[i])}`);\n }\n }\n\n logWithLineInfo(msg: string): void {\n this.errorLogFunction.warn(msg);\n\n // get current error stack\n const stack = new Error().stack?.split('\\n');\n\n if (stack) {\n for (let i = 3; i < stack.length; i++) {\n if (!stack[i]) {\n continue;\n }\n if (stack[i].match(/runInContext|runInNewContext|javascript\\.js:/)) {\n break;\n }\n this.errorLogFunction.warn(this.fixLineNo(stack[i]));\n }\n }\n }\n\n async main(): Promise {\n // Patch the font as it sometimes is wrong\n if (!this.context.debugMode) {\n if (await this.patchFont()) {\n this.log.debug('Font patched');\n }\n }\n\n this.log.debug(`config.subscribe (Do not subscribe all states on start): ${this.config.subscribe}`);\n\n // correct jsonConfig for admin\n const instObj: ioBroker.InstanceObject | null | undefined = await this.getForeignObjectAsync(\n `system.adapter.${this.namespace}`,\n );\n if (instObj?.common) {\n if (instObj.common.adminUI?.config !== 'json') {\n if (instObj.common.adminUI) {\n instObj.common.adminUI.config = 'json';\n } else {\n instObj.common.adminUI = { config: 'json' };\n }\n void this.setForeignObject(instObj._id, instObj);\n }\n }\n\n if (webstormDebug) {\n this.errorLogFunction = {\n error: console.error,\n warn: console.warn,\n info: console.info,\n debug: console.log,\n silly: console.log,\n };\n this.context.errorLogFunction = this.errorLogFunction;\n }\n this.activeStr = `${this.namespace}.scriptEnabled.`;\n\n this.mods.fs = new ProtectFs(this.log, getAbsoluteDefaultDataDir());\n this.mods['fs/promises'] = this.mods.fs.promises; // to avoid require('fs/promises');\n\n // try to read TS declarations\n try {\n tsAmbient = {\n 'javascript.d.ts': readFileSync(this.mods.path.join(__dirname, 'lib/javascript.d.ts'), 'utf8'),\n };\n this.tsServer.provideAmbientDeclarations(tsAmbient);\n jsDeclarationServer.provideAmbientDeclarations(tsAmbient);\n } catch (err: unknown) {\n this.log.warn(`Could not read TypeScript ambient declarations: ${err as Error}`);\n // This should not happen, so send an error report to Sentry\n if (this.supportsFeature && this.supportsFeature('PLUGINS')) {\n const sentryInstance = this.getPluginInstance('sentry');\n if (sentryInstance) {\n const sentryObject = sentryInstance.getSentryObject();\n sentryObject?.captureException(err as Error);\n }\n }\n // Keep the adapter from crashing when the included typings cannot be read\n tsAmbient = {};\n }\n\n await this.installLibraries();\n // Load the TS declarations for Node.js and all 3rd party modules\n this.loadTypeScriptDeclarations();\n\n await this.getData();\n this.context.scheduler = new Scheduler(\n this.log,\n Date,\n this.mods.suncalc,\n this.config.latitude,\n this.config.longitude,\n );\n await this.dayTimeSchedules();\n await this.sunTimeSchedules();\n await this.timeSchedule();\n\n // Store allowSelfSignedCerts on the context, so sandbox HTTP functions can use it\n // without setting the global process.env.NODE_TLS_REJECT_UNAUTHORIZED (which affects all adapters in compact mode)\n this.context.allowSelfSignedCerts = this.config.allowSelfSignedCerts;\n\n const doc = await this.getObjectViewAsync('script', 'javascript', {});\n if (doc?.rows?.length) {\n // assemble global script\n for (let g = 0; g < doc.rows.length; g++) {\n const obj = doc.rows[g].value;\n if (checkIsGlobal(obj)) {\n if (obj && obj.common) {\n const engineType = (obj.common.engineType || '').toLowerCase();\n\n if (obj.common.enabled) {\n if (engineType.startsWith('typescript')) {\n // TypeScript\n this.log.info(`${obj._id}: compiling TypeScript source...`);\n // In order to compile global TypeScript, we need to do some transformations\n // 1. For top-level-await, some statements must be wrapped in an immediately-invoked async function\n // 2. If any global script uses `import`, the declarations are no longer visible if they are not exported with `declare global`\n const transformedSource = transformScriptBeforeCompilation(obj.common.source, true);\n // The source code must be transformed in order to support top level await\n // Global scripts must not be treated as a module, otherwise their methods\n // cannot be found by the normal scripts\n // We need to hash both global declarations that are known until now\n // AND the script source, because changing either can change the compilation output\n const sourceHash: string = hashSource(\n tsSourceHashBase + this.globalDeclarations + transformedSource,\n );\n\n let compiled: string | undefined;\n let declarations: string | undefined;\n // If we already stored the compiled source code and the original source hash,\n // use the hash to check whether we can rely on the compiled source code or\n // if we need to compile it again\n if (\n typeof obj.common.compiled === 'string' &&\n typeof obj.common.sourceHash === 'string' &&\n sourceHash === obj.common.sourceHash\n ) {\n // We can reuse the stored source\n compiled = obj.common.compiled;\n declarations = obj.common.declarations;\n this.log.info(\n `${obj._id}: source code did not change, using cached compilation result...`,\n );\n } else {\n // We don't have a hashed source code, or the original source changed, compile it\n const filename = scriptIdToTSFilename(obj._id);\n let tsCompiled: CompileResult;\n try {\n tsCompiled = this.tsServer.compile(filename, transformedSource);\n } catch (err: unknown) {\n this.log.error(`${obj._id}: TypeScript compilation failed:\\n${err as Error}`);\n continue;\n }\n\n const errors = tsCompiled.diagnostics\n .map(diag => `${diag.annotatedSource}\\n`)\n .join('\\n');\n\n if (tsCompiled.success) {\n if (errors.length > 0) {\n this.log.warn(\n `${obj._id}: TypeScript compilation completed with errors:\\n${errors}`,\n );\n } else {\n this.log.info(`${obj._id}: TypeScript compilation successful`);\n }\n compiled = tsCompiled.result;\n // Global scripts that have been transformed to support `import` need to have their declarations transformed aswell\n declarations = transformGlobalDeclarations(tsCompiled.declarations || '');\n\n const newCommon: {\n compiled: string | undefined;\n declarations?: string;\n sourceHash: string;\n } = {\n sourceHash,\n compiled,\n };\n if (declarations) {\n newCommon.declarations = declarations;\n }\n\n // Store the compiled source and the original source hash, so we don't need to do the work again next time\n this.ignoreObjectChange.add(obj._id); // ignore the next change and don't restart scripts\n void this.extendForeignObject(obj._id, {\n common: newCommon,\n });\n } else {\n this.log.error(`${obj._id}: TypeScript compilation failed:\\n${errors}`);\n continue;\n }\n }\n this.globalScript += `${compiled}\\n`;\n // if declarations were generated, remember them\n if (declarations != null) {\n this.provideDeclarationsForGlobalScript(obj._id, declarations);\n }\n } else {\n // javascript\n const sourceCode = obj.common.source;\n this.globalScript += `${sourceCode}\\n`;\n\n // try to compile the declarations so TypeScripts can use\n // functions defined in global JavaScripts\n const filename = scriptIdToTSFilename(obj._id);\n let tsCompiled: CompileResult;\n try {\n tsCompiled = jsDeclarationServer.compile(filename, sourceCode);\n } catch (err: unknown) {\n this.log.warn(\n `${obj._id}: Error while generating type declarations, skipping:\\n${err as Error}`,\n );\n continue;\n }\n // if declarations were generated, remember them\n if (tsCompiled.success && tsCompiled.declarations != null) {\n this.provideDeclarationsForGlobalScript(obj._id, tsCompiled.declarations);\n }\n }\n }\n }\n }\n }\n }\n\n this.globalScript = this.globalScript.replace(/\\r\\n/g, '\\n');\n this.globalScriptLines = this.globalScript.split(/\\n/g).length - 1;\n\n if (doc?.rows?.length) {\n // load all scripts\n for (let i = 0; i < doc.rows.length; i++) {\n if (!checkIsGlobal(doc.rows[i].value)) {\n void this.loadScript(doc.rows[i].value);\n }\n }\n }\n\n if (this.config.mirrorPath?.trim()) {\n this.config.mirrorInstance = parseInt(this.config.mirrorInstance as unknown as string, 10) || 0;\n if (this.instance === this.config.mirrorInstance) {\n const ioBDataDir = getAbsoluteDefaultDataDir() + sep;\n this.config.mirrorPath = normalize(this.config.mirrorPath);\n let mirrorForbidden = false;\n for (let dir of forbiddenMirrorLocations) {\n dir = join(ioBDataDir, dir) + sep;\n if (dir.includes(this.config.mirrorPath) || this.config.mirrorPath.startsWith(dir)) {\n this.log.error(`The Mirror directory is not allowed to be a central ioBroker directory!`);\n this.log.error(`Directory ${this.config.mirrorPath} is not allowed to mirror files!`);\n mirrorForbidden = true;\n break;\n }\n }\n if (!mirrorForbidden) {\n this.mirror = new Mirror({\n adapter: this,\n log: this.log,\n diskRoot: this.config.mirrorPath,\n });\n }\n }\n }\n\n // CHeck setState counter per minute and stop a script if too high\n this.setStateCountCheckInterval = setInterval(() => {\n Object.keys(this.scripts).forEach(id => {\n if (!this.scripts[id]) {\n return;\n }\n const currentSetStatePerMinuteCounter = this.scripts[id].setStatePerMinuteCounter;\n this.scripts[id].setStatePerMinuteCounter = 0;\n if (currentSetStatePerMinuteCounter > this.config.maxSetStatePerMinute) {\n this.scripts[id].setStatePerMinuteProblemCounter++;\n this.log.debug(\n `${id}: Script has reached the maximum of ${this.config.maxSetStatePerMinute} setState calls per minute in ${this.scripts[id].setStatePerMinuteProblemCounter} consecutive minutes`,\n );\n // Allow \"too high counters\" for 1 minute for script starts or such and only\n // stop the script when lasts longer\n if (this.scripts[id].setStatePerMinuteProblemCounter > 1) {\n this.log.error(\n `${id}: Script is calling setState more than ${this.config.maxSetStatePerMinute} times per minute! Stopping Script now! Please check your script!`,\n );\n void this.stopScript(id);\n }\n } else if (this.scripts[id].setStatePerMinuteProblemCounter > 0) {\n this.scripts[id].setStatePerMinuteProblemCounter--;\n this.log.debug(\n `Script ${id} has NOT reached the maximum of ${this.config.maxSetStatePerMinute} setState calls per minute. Decrease problem counter to ${this.scripts[id].setStatePerMinuteProblemCounter}`,\n );\n }\n });\n }, 60000);\n }\n\n private loadTypeScriptDeclarations(): void {\n // try to load the typings on disk for all 3rd party modules\n const packages = [\n 'node', // this provides auto-completion for most builtins\n '@iobroker/types', // this provides auto-completion for most builtins\n ];\n // Also include user-selected libraries (but only those that are also installed)\n if (typeof this.config?.libraries === 'string' && typeof this.config.libraryTypings === 'string') {\n const installedLibs = this.config.libraries\n .split(/[,;\\s]+/)\n .map(s => s.trim().split('@')[0])\n .filter(s => !!s);\n\n const wantsTypings = this.config.libraryTypings\n .split(/[,;\\s]+/)\n .map(s => s.trim())\n .filter(s => !!s);\n // Add all installed libraries the user has requested typings for to the list of packages\n for (const lib of installedLibs) {\n if (wantsTypings.includes(lib) && !packages.includes(lib)) {\n packages.push(lib);\n }\n }\n // Some packages have submodules (e.g., rxjs/operators) that are not exposed through the main entry point\n // If typings are requested for them, also add them if the base module is installed\n for (const lib of wantsTypings) {\n // Extract the package name and check if we need to add it\n if (!lib.includes('/')) {\n continue;\n }\n const pkgName = lib.substring(0, lib.indexOf('/'));\n\n if (installedLibs.includes(pkgName) && !packages.includes(lib)) {\n packages.push(lib);\n }\n }\n }\n for (const pkg of packages) {\n let pkgTypings = resolveTypings(\n pkg,\n this.getAdapterScopedPackageIdentifier ? this.getAdapterScopedPackageIdentifier(pkg) : pkg,\n // node needs ambient typings, so we don't wrap it in declare module\n pkg !== 'node',\n );\n if (!pkgTypings) {\n // Create the empty dummy declarations so users don't get the \"not found\" error\n // for installed packages\n if (pkg.includes('/')) {\n pkgTypings = {\n [`node_modules/${pkg}/index.d.ts`]: `declare module \"${pkg}\";`,\n };\n } else {\n pkgTypings = {\n [`node_modules/@types/${pkg}/index.d.ts`]: `declare module \"${pkg}\";`,\n };\n }\n }\n this.log.debug(`Loaded TypeScript definitions for \"${pkg}\": ${JSON.stringify(Object.keys(pkgTypings))}`);\n // remember the declarations for the editor\n Object.assign(tsAmbient, pkgTypings);\n // and give the language servers access to them\n this.tsServer.provideAmbientDeclarations(pkgTypings);\n jsDeclarationServer.provideAmbientDeclarations(pkgTypings);\n }\n }\n\n updateObjectContext(id: string, obj: ioBroker.Object | null | undefined): void {\n if (obj) {\n // add state to state ID's list\n if (obj.type === 'state') {\n if (!this.stateIds.includes(id)) {\n this.stateIds.push(id);\n this.stateIds.sort();\n }\n if (this.context.devices && this.context.channels) {\n const parts = id.split('.');\n parts.pop();\n const chn = parts.join('.');\n this.context.channels[chn] ||= [];\n this.context.channels[chn].push(id);\n\n parts.pop();\n const dev = parts.join('.');\n this.context.devices[dev] ||= [];\n this.context.devices[dev].push(id);\n }\n }\n } else {\n // delete object from state ID's list\n const pos = this.stateIds.indexOf(id);\n if (pos !== -1) {\n this.stateIds.splice(pos, 1);\n }\n if (this.context.devices && this.context.channels) {\n const parts = id.split('.');\n parts.pop();\n const chn = parts.join('.');\n if (this.context.channels[chn]) {\n const posChn = this.context.channels[chn].indexOf(id);\n posChn !== -1 && this.context.channels[chn].splice(posChn, 1);\n }\n\n parts.pop();\n const dev = parts.join('.');\n if (this.context.devices[dev]) {\n const posDev = this.context.devices[dev].indexOf(id);\n posDev !== -1 && this.context.devices[dev].splice(posDev, 1);\n }\n }\n\n delete this.folderCreationVerifiedObjects[id];\n }\n\n if (!obj && this.objects[id]) {\n // objects were deleted\n this.removeFromNames(id);\n delete this.objects[id];\n } else if (obj && !this.objects[id]) {\n // object was added\n this.objects[id] = obj;\n this.addToNames(obj);\n } else if (obj && this.objects[id].common) {\n // Object just changed\n this.objects[id] = obj;\n\n const n = this.getName(id);\n let nn = this.objects[id].common ? this.objects[id].common.name : '';\n\n if (nn && typeof nn === 'object') {\n nn = nn[getLanguage()] || nn.en;\n }\n\n if (n !== nn) {\n if (n) {\n this.removeFromNames(id);\n }\n if (nn) {\n this.addToNames(obj);\n }\n }\n }\n }\n\n async stopAllScripts(): Promise {\n const scripts = Object.keys(this.scripts);\n const promises: Promise[] = [];\n for (let i = 0; i < scripts.length; i++) {\n promises.push(this.stopScript(scripts[i]));\n }\n return Promise.all(promises).then(() => {});\n }\n\n convertBackStringifiedValues(\n id: string,\n state: ioBroker.State | null | undefined,\n ): ioBroker.State | null | undefined {\n if (\n state &&\n typeof state.val === 'string' &&\n this.objects[id]?.common &&\n (this.objects[id].common.type === 'array' || this.objects[id].common.type === 'object')\n ) {\n try {\n state.val = JSON.parse(state.val);\n } catch (err: any) {\n if (id.startsWith('javascript.') || id.startsWith('0_userdata.0')) {\n this.log.info(\n `Could not parse value for id \"${id}\" into ${this.objects[id].common.type}: ${err.toString()}`,\n );\n } else {\n this.log.debug(\n `Could not parse value for id \"${id}\" into ${this.objects[id].common.type}: ${err.toString()}`,\n );\n }\n }\n }\n return state;\n }\n\n prepareStateObjectSimple(id: string, state: ioBroker.StateValue, isAck: boolean): ioBroker.State {\n // otherwise, assume that the given state is the value to be set\n const oState: ioBroker.State = { val: state, ack: isAck } as ioBroker.State;\n\n return this.prepareStateObject(id, oState);\n }\n\n prepareStateObject(id: string, state: ioBroker.SettableState | null): ioBroker.State {\n let oState: ioBroker.State;\n\n if (state && typeof state === 'object') {\n oState = state as ioBroker.State;\n } else {\n oState = { val: null } as ioBroker.State;\n }\n\n if (this.config.subscribe) {\n return oState;\n }\n // set other values to have a full state object\n // mirrors logic from statesInRedis\n if (oState.ts === undefined) {\n oState.ts = Date.now();\n }\n\n if (oState.q === undefined) {\n oState.q = 0;\n }\n\n oState.from =\n typeof oState.from === 'string' && oState.from !== '' ? oState.from : `system.adapter.${this.namespace}`;\n\n if (oState.lc === undefined) {\n const formerStateValue = this.interimStateValues[id] || this.states[id];\n if (!formerStateValue) {\n oState.lc = oState.ts;\n } else {\n // isDeepStrictEqual works on objects and primitive values\n const hasChanged = !isDeepStrictEqual(formerStateValue.val, oState.val);\n if (!formerStateValue.lc || hasChanged) {\n oState.lc = oState.ts;\n } else {\n oState.lc = formerStateValue.lc;\n }\n }\n }\n\n return oState;\n }\n\n async getData(): Promise {\n await this.subscribeForeignObjectsAsync('*');\n\n if (!this.config.subscribe) {\n await this.subscribeForeignStatesAsync('*');\n } else {\n await this.subscribeStatesAsync('debug.to');\n await this.subscribeStatesAsync('scriptEnabled.*');\n }\n\n this.log.info('requesting all states');\n\n const statesPromise = this.getForeignStatesAsync('*')\n .then(res => {\n if (!res) {\n this.log.error(`Could not initialize states: no result`);\n this.terminate(EXIT_CODES.START_IMMEDIATELY_AFTER_STOP);\n return;\n }\n if (!this.config.subscribe) {\n this.states = Object.assign(res, this.states);\n this.context.states = this.states;\n\n this.addGetProperty(this.states);\n }\n\n // remember all IDs\n for (const id in res) {\n if (Object.prototype.hasOwnProperty.call(res, id)) {\n this.stateIds.push(id);\n }\n }\n this.statesInitDone = true;\n this.log.info('received all states');\n })\n .catch((err: any) => {\n this.log.error(`Could not initialize states: ${err?.message || 'no result'}`);\n this.terminate(EXIT_CODES.START_IMMEDIATELY_AFTER_STOP);\n });\n\n this.log.info('requesting all objects');\n\n const objectsPromise = this.getObjectListAsync({ include_docs: true })\n .then(res => {\n if (!res?.rows) {\n this.log.error(`Could not initialize objects: no result`);\n this.terminate(EXIT_CODES.START_IMMEDIATELY_AFTER_STOP);\n return;\n }\n this.objects = {};\n this.context.objects = this.objects;\n for (let i = 0; i < res.rows.length; i++) {\n if (!res.rows[i].doc) {\n this.log.debug(`Got empty object for index ${i} (${res.rows[i].id})`);\n continue;\n }\n if (this.objects[res.rows[i].doc._id] === undefined) {\n // If was already there, ignore\n this.objects[res.rows[i].doc._id] = res.rows[i].doc;\n }\n this.objects[res.rows[i].doc._id].type === 'enum' && this._enums.push(res.rows[i].doc._id);\n\n // Collect all names\n this.addToNames(this.objects[res.rows[i].doc._id]);\n }\n this.addGetProperty(this.objects);\n\n const systemConfig = this.objects['system.config'];\n this.password = systemConfig?.native?.javascriptPassword\n ? this.decrypt(systemConfig?.native.javascriptPassword)\n : '';\n\n // set language for debug messages\n if (systemConfig?.common?.language) {\n setLanguage(systemConfig.common.language);\n this.language = systemConfig.common.language;\n this.context.language = this.language as ioBroker.Languages;\n } else if (this.language) {\n setLanguage(this.language);\n this.context.language = this.language;\n }\n\n // try to use system coordinates\n if (this.config.useSystemGPS) {\n if (systemConfig?.common?.latitude || systemConfig?.common?.longitude) {\n this.config.latitude = systemConfig.common.latitude;\n this.config.longitude = systemConfig.common.longitude;\n } else if (this.latitude && this.longitude) {\n this.config.latitude = this.latitude;\n this.config.longitude = this.longitude;\n }\n }\n this.config.latitude = parseFloat(this.config.latitude as unknown as string);\n this.config.longitude = parseFloat(this.config.longitude as unknown as string);\n\n if (isNaN(this.config.latitude)) {\n this.log.warn(`Configured latitude is not a number - check (instance/system) configuration`);\n } else if (this.config.latitude < -90 || this.config.latitude > 90) {\n this.log.warn(\n `Configured latitude \"${this.config.latitude}\" is invalid - check (instance/system) configuration`,\n );\n }\n\n if (isNaN(this.config.longitude)) {\n this.log.warn(`Configured longitude is not a number - check (instance/system) configuration`);\n } else if (this.config.longitude < -180 || this.config.longitude > 180) {\n this.log.warn(\n `Configured longitude \"${this.config.longitude}\" is invalid - check (instance/system) configuration`,\n );\n }\n\n this.config.sunriseEvent ||= 'nightEnd';\n this.config.sunriseOffset ||= 0;\n this.config.sunriseLimitStart ||= '06:00';\n this.config.sunriseLimitEnd ||= '12:00';\n\n this.config.sunsetEvent ||= 'dusk';\n this.config.sunsetOffset ||= 0;\n this.config.sunsetLimitStart ||= '18:00';\n this.config.sunsetLimitEnd ||= '23:00';\n\n this.objectsInitDone = true;\n this.log.info('received all objects');\n })\n .catch((err: any) => {\n this.log.error(`Could not initialize objects: ${err?.message || 'no result'}`);\n this.terminate(EXIT_CODES.START_IMMEDIATELY_AFTER_STOP);\n });\n\n return Promise.all([statesPromise, objectsPromise]).then(() => {});\n }\n\n async createActiveObject(id: string, enabled: boolean): Promise {\n const idActive = `${this.namespace}.scriptEnabled.${id.substring(SCRIPT_CODE_MARKER.length)}`;\n\n if (!this.objects[idActive]) {\n this.objects[idActive] = {\n _id: idActive,\n common: {\n name: `scriptEnabled.${id.substring(SCRIPT_CODE_MARKER.length)}`,\n desc: 'controls script activity',\n type: 'boolean',\n write: true,\n read: true,\n role: 'switch.active',\n },\n native: {\n script: id,\n },\n type: 'state',\n };\n try {\n await this.setForeignObjectAsync(idActive, this.objects[idActive]);\n const intermediateStateValue = this.prepareStateObjectSimple(idActive, enabled, true);\n await this.setForeignStateAsync(idActive, enabled, true);\n if (enabled && !this.config.subscribe) {\n this.interimStateValues[idActive] = intermediateStateValue;\n }\n } catch {\n // ignore\n }\n } else {\n const state = await this.getForeignStateAsync(idActive);\n if (state && state.val !== enabled) {\n const intermediateStateValue = this.prepareStateObjectSimple(idActive, enabled, true);\n await this.setForeignStateAsync(idActive, enabled, true);\n if (enabled && !this.config.subscribe) {\n this.interimStateValues[idActive] = intermediateStateValue;\n }\n }\n }\n }\n\n async createProblemObject(id: string): Promise {\n const idProblem = `${this.namespace}.scriptProblem.${id.substring(SCRIPT_CODE_MARKER.length)}`;\n\n if (!this.objects[idProblem]) {\n this.objects[idProblem] = {\n _id: idProblem,\n common: {\n name: `scriptProblem.${id.substring(SCRIPT_CODE_MARKER.length)}`,\n desc: 'Script has a problem',\n type: 'boolean',\n expert: true,\n write: false,\n read: true,\n role: 'indicator.error',\n },\n native: {\n script: id,\n },\n type: 'state',\n };\n try {\n await this.setForeignObjectAsync(idProblem, this.objects[idProblem]);\n await this.setForeignStateAsync(idProblem, false, true);\n } catch {\n // ignore\n }\n } else {\n const state = await this.getForeignStateAsync(idProblem);\n if (state && state.val !== false) {\n await this.setForeignStateAsync(idProblem, false, true);\n }\n }\n }\n\n addToNames(obj: ioBroker.Object): void {\n const id = obj._id;\n\n if (obj.common?.name) {\n let name = obj.common.name;\n if (name && typeof name === 'object') {\n name = name[getLanguage()] || name.en;\n }\n if (!name || typeof name !== 'string') {\n // TODO, take name in current language\n return;\n }\n\n if (!this.names[name]) {\n this.names[name] = id;\n } else {\n // convert to array\n if (!Array.isArray(this.names[name])) {\n this.names[name] = [this.names[name] as string];\n }\n\n (this.names[name] as string[]).push(id);\n }\n }\n }\n\n removeFromNames(id: string): void {\n const n = this.getName(id);\n\n if (n) {\n if (Array.isArray(this.names[n])) {\n const pos = this.names[n].indexOf(id);\n if (pos > -1) {\n this.names[n].splice(pos, 1);\n\n if (this.names[n].length === 1) {\n this.names[n] = this.names[n][0];\n }\n }\n } else {\n delete this.names[n];\n }\n }\n }\n\n getName(id: string): string | null {\n for (const n in this.names) {\n if (this.names[n] && Array.isArray(this.names[n])) {\n if (this.names[n].includes(id)) {\n return n;\n }\n } else if (this.names[n] === id) {\n return n;\n }\n }\n\n return null;\n }\n\n async installNpm(npmLib: string): Promise {\n return new Promise((resolve, reject) => {\n const path = __dirname;\n\n // Also, set the working directory (cwd) of the process instead of using --prefix\n // because that has ugly bugs on Windows\n const cmd = `npm install ${npmLib} --omit=dev`;\n this.log.info(`Installing ${npmLib} into ${__dirname} - cmd: ${cmd}`);\n\n // System call used for update of js-controller itself,\n // because during the installation the npm packet will be deleted too, but some files must be loaded even during the installation process.\n const child = this.mods.child_process.exec(cmd, {\n windowsHide: true,\n cwd: path,\n });\n\n child.stdout?.on('data', buf => this.log.info(buf.toString('utf8')));\n\n child.stderr?.on('data', buf => this.log.error(buf.toString('utf8')));\n\n child.on('err', err => {\n this.log.error(`Cannot install ${npmLib}: ${err}`);\n reject(new Error(`Cannot install ${npmLib}: ${err}`));\n });\n child.on('error', err => {\n this.log.error(`Cannot install ${npmLib}: ${err}`);\n reject(new Error(`Cannot install ${npmLib}: ${err}`));\n });\n\n child.on('exit', (code: number /* , signal */) => {\n if (code) {\n this.log.error(`Cannot install ${npmLib}: ${code}`);\n reject(new Error(`Cannot install ${npmLib}: ${code}`));\n }\n // command succeeded\n resolve(code);\n });\n });\n }\n\n async installLibraries(): Promise {\n if (typeof this.config?.libraries !== 'string') {\n this.config.libraries = '';\n }\n\n const libraries: string[] = this.config.libraries\n .split(/[,;\\s]+/)\n .map(d => d.trim())\n .filter(d => d);\n\n this.log.debug(`Custom libraries in config: \"${this.config.libraries}\": ${JSON.stringify(libraries)}`);\n\n let installedNodeModules: string[] = [];\n const keepModules: string[] = [];\n\n // js-controller >= 6.x\n if (typeof this.listInstalledNodeModules === 'function') {\n installedNodeModules = await this.listInstalledNodeModules();\n\n this.log.debug(`Found installed libraries: ${JSON.stringify(installedNodeModules)}`);\n }\n\n for (const lib of libraries) {\n let depName = lib;\n let version = 'latest';\n\n if (depName.includes('@') && depName.lastIndexOf('@') > 0) {\n const parts = depName.split('@');\n version = parts.pop() ?? 'latest';\n depName = parts.join('@');\n }\n\n /** The real module name, because the dependency can be a URL too */\n let moduleName = depName;\n\n if (URL.canParse(depName)) {\n moduleName = await requestModuleNameByUrl(depName);\n\n this.log.debug(`Found custom library in config: \"${moduleName}@${version}\" (from ${depName})`);\n } else {\n this.log.debug(`Found custom library in config: \"${moduleName}@${version}\"`);\n }\n\n keepModules.push(moduleName);\n\n // js-controller >= 6.x\n if (typeof this.installNodeModule === 'function') {\n try {\n const result = await this.installNodeModule(depName, { version });\n if (result.success) {\n this.log.debug(`Installed custom library: \"${moduleName}@${version}\"`);\n\n const importedModule: any = await this.importNodeModule(moduleName);\n (this.mods as Record)[moduleName] = importedModule.default ?? importedModule;\n } else {\n this.log.warn(`Cannot install custom npm package \"${moduleName}@${version}\"`);\n }\n } catch (err: unknown) {\n this.log.warn(`Cannot install custom npm package \"${moduleName}@${version}\": ${err as Error}`);\n }\n } else if (!existsSync(`${__dirname}/node_modules/${depName}/package.json`)) {\n // js-controller < 6.x\n this.log.info(`Installing custom library (legacy mode): \"${lib}\"`);\n\n try {\n await this.installNpm(lib);\n this.log.info(`Installed custom npm package (legacy mode): \"${lib}\"`);\n } catch (err: any) {\n this.log.warn(`Cannot install custom npm package \"${lib}\" (legacy mode): ${err.toString()}`);\n }\n }\n }\n\n // js-controller >= 6.x\n if (typeof this.uninstallNodeModule === 'function') {\n for (const installedNodeModule of installedNodeModules) {\n if (!keepModules.includes(installedNodeModule)) {\n try {\n await this.uninstallNodeModule(installedNodeModule);\n\n this.log.info(`Removed custom npm package: \"${installedNodeModule}\"`);\n } catch (err: any) {\n this.log.warn(`Cannot remove custom npm package ${installedNodeModule}: ${err.toString()}`);\n }\n }\n }\n }\n }\n\n createVM(source: string, name: string, wrapAsync: boolean): false | JsScript {\n if (this.context.debugMode && name !== this.context.debugMode) {\n return false;\n }\n\n if (!this.context.debugMode) {\n const logSubscriptionsText =\n \"\\n;\\nlog(`registered ${__engine.__subscriptions} subscription${__engine.__subscriptions === 1 ? '' : 's'},\" +\n \" ${__engine.__schedules} schedule${__engine.__schedules === 1 ? '' : 's'},\" +\n \" ${__engine.__subscriptionsMessage} message${__engine.__subscriptionsMessage === 1 ? '' : 's'},\" +\n \" ${__engine.__subscriptionsLog} log${__engine.__subscriptionsLog === 1 ? '' : 's'}\" +\n \" and ${__engine.__subscriptionsFile} file subscription${__engine.__subscriptionsFile === 1 ? '' : 's'}`);\\n\";\n\n if (wrapAsync) {\n source = `(async () => {\\n${source}\\n${logSubscriptionsText}\\n})();`;\n } else {\n if (source.endsWith('export {};\\n')) {\n // If the source ends with \"export {};\" place the log subscriptions before it\n source = source.slice(0, -11); // remove \"export {};\\n\"\n source = `${source}\\n${logSubscriptionsText}\\nexport {};\\n`;\n } else {\n source = `${source}\\n${logSubscriptionsText}`;\n }\n }\n } else {\n if (wrapAsync) {\n source = `(async () => {debugger;\\n${source}\\n})();`;\n } else {\n source = `debugger;${source}`;\n }\n }\n\n try {\n const options: ScriptOptions = {\n filename: name,\n // displayErrors: true,\n // lineOffset: this.globalScriptLines\n };\n return {\n script: new Script(source, options),\n } as JsScript;\n } catch (err: unknown) {\n this.logError(name, `compile failed at`, err as Error);\n return false;\n }\n }\n\n execute(script: JsScript, name: string, engineType: ScriptType, verbose: boolean, debug: boolean): void {\n script.intervals = [];\n script.timeouts = [];\n script.schedules = [];\n script.wizards = [];\n script.name = name;\n script.engineType = engineType;\n script._id = Math.floor(Math.random() * 0xffffffff);\n script.subscribes = {};\n script.subscribesFile = {};\n script.setStatePerMinuteCounter = 0;\n script.setStatePerMinuteProblemCounter = 0;\n void this.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: false,\n ack: true,\n expire: 1000,\n });\n\n const sandbox = sandBox(script, name, verbose, debug, this.context);\n\n try {\n script.script.runInNewContext(sandbox, {\n filename: name,\n displayErrors: true,\n // lineOffset: this.globalScriptLines\n });\n } catch (err: unknown) {\n void this.setState(`scriptProblem.${name.substring(SCRIPT_CODE_MARKER.length)}`, {\n val: true,\n ack: true,\n c: 'execute',\n });\n this.logError(name, 'Error by run:', err as Error);\n }\n }\n\n unsubscribe(id: string | RegExp | string[]): void {\n if (!id) {\n this.log.warn('unsubscribe: empty name');\n return;\n }\n\n if (Array.isArray(id)) {\n id.forEach(sub => unsubscribe(sub));\n return;\n }\n\n if (id.constructor && id.constructor.name === 'RegExp') {\n // adapter.log.warn('unsubscribe: todo - process regexp');\n return;\n }\n\n if (typeof id !== 'string') {\n this.log.error(`unsubscribe: invalid type of id - ${typeof id}`);\n return;\n }\n const parts = id.split('.');\n const _adapter = `system.adapter.${parts[0]}.${parts[1]}`;\n if (this.objects[_adapter]?.common?.subscribable) {\n const a = `${parts[0]}.${parts[1]}`;\n const alive = `system.adapter.${a}.alive`;\n if (this.adapterSubs[alive]) {\n const pos = this.adapterSubs[alive].indexOf(id);\n if (pos !== -1) {\n this.adapterSubs[alive].splice(pos, 1);\n }\n if (!this.adapterSubs[alive].length) {\n delete this.adapterSubs[alive];\n }\n }\n this.sendTo(a, 'unsubscribe', id);\n }\n }\n\n // Analyze if logs are still required or not\n updateLogSubscriptions(): void {\n let found = false;\n // go through all scripts and check if some script still requires logs\n Object.keys(this.logSubscriptions).forEach(scriptName => {\n if (!this.logSubscriptions?.[scriptName] || !this.logSubscriptions[scriptName].length) {\n delete this.logSubscriptions[scriptName];\n } else {\n found = true;\n }\n });\n\n if (this.requireLog) {\n if (found && !this.logSubscribed) {\n this.logSubscribed = true;\n void this.requireLog(this.logSubscribed);\n this.log.info(`Subscribed to log messages (found logSubscriptions)`);\n } else if (!found && this.logSubscribed) {\n this.logSubscribed = false;\n void this.requireLog(this.logSubscribed);\n this.log.info(`Unsubscribed from log messages (not found logSubscriptions)`);\n }\n }\n }\n\n async stopScript(name: string): Promise {\n this.log.info(`${name}: Stopping script`);\n\n await this.setState(`scriptEnabled.${name.substring(SCRIPT_CODE_MARKER.length)}`, false, true);\n\n if (this.messageBusHandlers[name]) {\n delete this.messageBusHandlers[name];\n }\n\n if (this.tempDirectories[name]) {\n try {\n this.mods.fs.rmSync(this.tempDirectories[name], { recursive: true });\n\n this.log.debug(`${name}: Removed temp directory: ${this.tempDirectories[name]}`);\n } catch {\n this.log.warn(`${name}: Unable to remove temp directory: ${this.tempDirectories[name]}`);\n }\n\n delete this.tempDirectories[name];\n }\n\n if (this.logSubscriptions[name]) {\n delete this.logSubscriptions[name];\n this.updateLogSubscriptions();\n }\n\n if (this.scripts[name]) {\n // Remove from subscriptions\n this.context.isEnums = false;\n if (this.config.subscribe) {\n // check all subscribed IDs\n Object.keys(this.scripts[name].subscribes).forEach(id => {\n if (this.subscribedPatterns[id]) {\n this.subscribedPatterns[id] -= this.scripts[name].subscribes[id];\n if (this.subscribedPatterns[id] <= 0) {\n this.unsubscribeForeignStates(id);\n delete this.subscribedPatterns[id];\n if (this.states[id]) {\n delete this.states[id];\n }\n }\n }\n });\n }\n\n for (let i = this.subscriptions.length - 1; i >= 0; i--) {\n if (this.subscriptions[i].name === name) {\n const sub = this.subscriptions.splice(i, 1)[0];\n if (sub?.pattern.id) {\n this.unsubscribe(sub.pattern.id);\n }\n } else {\n if (\n (!this.context.isEnums && this.subscriptions[i].pattern.enumName) ||\n this.subscriptions[i].pattern.enumId\n ) {\n this.context.isEnums = true;\n }\n }\n }\n\n // check all subscribed files\n Object.keys(this.scripts[name].subscribesFile).forEach(key => {\n if (this.subscribedPatternsFile[key]) {\n this.subscribedPatternsFile[key] -= this.scripts[name].subscribesFile[key];\n if (this.subscribedPatternsFile[key] <= 0) {\n const [id, file] = key.split('$%$');\n void this.unsubscribeForeignFiles(id, file);\n delete this.subscribedPatternsFile[key];\n }\n }\n });\n for (let i = this.subscriptionsFile.length - 1; i >= 0; i--) {\n if (this.subscriptionsFile[i].name === name) {\n this.subscriptionsFile.splice(i, 1);\n }\n }\n\n for (let i = this.subscriptionsObject.length - 1; i >= 0; i--) {\n if (this.subscriptionsObject[i].name === name) {\n const sub = this.subscriptionsObject.splice(i, 1)[0];\n if (sub) {\n this.unsubscribeForeignObjects(sub.pattern);\n }\n }\n }\n\n // Stop all timeouts\n for (let i = 0; i < this.scripts[name].timeouts.length; i++) {\n clearTimeout(this.scripts[name].timeouts[i]);\n }\n // Stop all intervals\n for (let i = 0; i < this.scripts[name].intervals.length; i++) {\n clearInterval(this.scripts[name].intervals[i]);\n }\n // Stop all delayed states (setStateDelayed timers)\n for (const stateId of Object.keys(this.timers)) {\n if (this.timers[stateId]) {\n for (let i = this.timers[stateId].length - 1; i >= 0; i--) {\n if (this.timers[stateId][i].scriptName === name) {\n clearTimeout(this.timers[stateId][i].t);\n this.timers[stateId].splice(i, 1);\n }\n }\n if (!this.timers[stateId].length) {\n delete this.timers[stateId];\n }\n }\n }\n // Stop all scheduled jobs\n for (let i = 0; i < this.scripts[name].schedules.length; i++) {\n if (this.scripts[name].schedules[i]) {\n const _name = this.scripts[name].schedules[i].name;\n if (!this.mods.nodeSchedule.cancelJob(this.scripts[name].schedules[i])) {\n this.log.error(`${name}: Error by canceling scheduled job \"${_name}\"`);\n }\n }\n }\n\n // Stop all time wizards jobs\n if (this.context.scheduler) {\n for (let i = 0; i < this.scripts[name].wizards.length; i++) {\n if (this.scripts[name].wizards[i]) {\n this.context.scheduler.remove(this.scripts[name].wizards[i]);\n }\n }\n }\n\n // if callback for on stop\n if (typeof this.scripts[name].onStopCb === 'function') {\n this.scripts[name].onStopTimeout =\n parseInt(this.scripts[name].onStopTimeout as unknown as string, 10) || 1000;\n\n await new Promise(resolve => {\n let timeout: NodeJS.Timeout | null = setTimeout(() => {\n if (timeout) {\n timeout = null;\n resolve(true);\n }\n }, this.scripts[name].onStopTimeout);\n\n try {\n this.scripts[name].onStopCb(() => {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n resolve(true);\n }\n });\n } catch (err: unknown) {\n this.log.error(`${name}: error in onStop callback: ${err as Error}`);\n }\n });\n }\n\n delete this.scripts[name];\n return true;\n }\n return false;\n }\n\n async prepareScript(obj: ioBroker.ScriptObject): Promise {\n if (obj?.common?.enabled && this.debugState.scriptName === obj._id) {\n const id = obj._id;\n await this.debugStop();\n this.log.info(`${id}: Debugging was stopped, because started in normal mode`);\n return this.prepareScript(obj);\n }\n\n if (\n obj?.common?.source &&\n (obj.common.enabled || this.context.debugMode === obj._id) &&\n obj.common.engine === `system.adapter.${this.namespace}`\n ) {\n const name = obj._id;\n\n if (this.password && obj.native?.protected) {\n obj.common.source = decryptText(this.password, obj.common.source);\n }\n\n const nameId = name.substring(SCRIPT_CODE_MARKER.length);\n if (!nameId.length || nameId.endsWith('.')) {\n this.log.error(`${name}: Script name \"${name}\" is invalid!`);\n return false;\n }\n const idActive = `scriptEnabled.${nameId}`;\n if (!this.config.subscribe) {\n this.interimStateValues[idActive] = this.prepareStateObjectSimple(\n `${this.namespace}.${idActive}`,\n true,\n true,\n );\n }\n await this.setState(idActive, true, true);\n obj.common.engineType ||= '' as 'TypeScript/ts' | 'Blockly' | 'Rules' | 'Javascript/js';\n\n if (\n (obj.common.engineType as ScriptType).toLowerCase().startsWith('javascript') ||\n (obj.common.engineType as ScriptType) === 'Blockly' ||\n (obj.common.engineType as ScriptType) === 'Rules'\n ) {\n // Javascript\n this.log.info(`${name}: start JavaScript (${obj.common.engineType})`);\n\n let sourceFn = name;\n if (webstormDebug) {\n const fn = name.replace(/^script\\.js\\./, '').replace(/\\./g, '/');\n sourceFn = this.mods.path.join(webstormDebug, `${fn}.js`);\n }\n const createdScript = this.createVM(`${this.globalScript}\\n${obj.common.source}`, sourceFn, true);\n if (!createdScript) {\n return false;\n }\n this.scripts[name] = createdScript;\n this.execute(\n this.scripts[name],\n sourceFn,\n obj.common.engineType as ScriptType,\n obj.common.verbose,\n obj.common.debug,\n );\n return true;\n }\n\n if (obj.common.engineType.toLowerCase().startsWith('typescript')) {\n // TypeScript\n this.log.info(`${name}: Compiling TypeScript source`);\n // The source code must be transformed in order to support top level await\n // and to force TypeScript to compile the code as a module\n const transformedSource = transformScriptBeforeCompilation(obj.common.source, false);\n // We need to hash both global declarations that are known until now\n // AND the script source, because changing either can change the compilation output\n const sourceHash = hashSource(tsSourceHashBase + this.globalDeclarations + transformedSource);\n\n let compiled: string;\n // If we already stored the compiled source code and the original source hash,\n // use the hash to check whether we can rely on the compiled source code or\n // if we need to compile it again\n if (\n typeof obj.common.compiled === 'string' &&\n typeof obj.common.sourceHash === 'string' &&\n sourceHash === obj.common.sourceHash\n ) {\n // We can reuse the stored source\n compiled = obj.common.compiled;\n this.log.info(`${name}: source code did not change, using cached compilation result...`);\n } else {\n // We don't have a hashed source code, or the original source changed, compile it\n const filename = scriptIdToTSFilename(name);\n let tsCompiled: CompileResult;\n try {\n tsCompiled = this.tsServer.compile(filename, transformedSource);\n } catch (err: unknown) {\n this.log.error(`${obj._id}: TypeScript compilation failed:\\n${err as Error}`);\n return false;\n }\n\n const errors = tsCompiled.diagnostics.map(diag => `${diag.annotatedSource}\\n`).join('\\n');\n\n if (tsCompiled.success) {\n if (errors.length > 0) {\n this.log.warn(`${name}: TypeScript compilation had errors:\\n${errors}`);\n } else {\n this.log.info(`${name}: TypeScript compilation successful`);\n }\n compiled = tsCompiled.result || '';\n\n // Store the compiled source and the original source hash, so we don't need to do the work again next time\n this.ignoreObjectChange.add(name); // ignore the next change and don't restart scripts\n await this.extendForeignObjectAsync(name, {\n common: {\n sourceHash,\n compiled,\n },\n });\n } else {\n this.log.error(`${name}: TypeScript compilation failed:\\n${errors}`);\n return false;\n }\n }\n const createdScript: JsScript | false = this.createVM(`${this.globalScript}\\n${compiled}`, name, false);\n if (!createdScript) {\n return false;\n }\n this.scripts[name] = createdScript;\n this.execute(\n this.scripts[name],\n name,\n obj.common.engineType as ScriptType,\n obj.common.verbose,\n obj.common.debug,\n );\n return true;\n }\n\n this.log.warn(`${obj._id}: Unknown engine type: ${obj.common.engineType}`);\n return false;\n }\n\n let _name: string;\n if (obj?._id) {\n _name = obj._id;\n const scriptIdName = _name.substring(SCRIPT_CODE_MARKER.length);\n\n if (!scriptIdName.length || scriptIdName.endsWith('.')) {\n this.log.error(`${obj._id}: Script name \"${_name}\" is invalid!`);\n return false;\n }\n await this.setState(`scriptEnabled.${scriptIdName}`, false, true);\n }\n if (!obj) {\n this.log.error('Invalid script');\n }\n return false;\n }\n\n async loadScriptById(id: string): Promise {\n let obj: ioBroker.ScriptObject | null | undefined;\n try {\n obj = (await this.getForeignObjectAsync(id)) as ioBroker.ScriptObject | null | undefined;\n } catch (err: any) {\n this.log.error(`${id}: Invalid script: ${err}`);\n }\n if (!obj) {\n return false;\n }\n return this.loadScript(obj);\n }\n\n async loadScript(nameOrObject: ioBroker.ScriptObject): Promise {\n // create states for scripts\n await this.createActiveObject(nameOrObject._id, !!nameOrObject?.common?.enabled);\n await this.createProblemObject(nameOrObject._id);\n return this.prepareScript(nameOrObject);\n }\n\n getAstroEvent(\n date: Date,\n astroEvent: AstroEventName,\n start: string,\n end: string,\n offsetMinutes: number | string,\n isDayEnd: boolean,\n latitude: number,\n longitude: number,\n useNextDay?: boolean,\n ): Date {\n let ts: Date = this.mods.suncalc.getTimes(date, latitude, longitude)[astroEvent];\n\n if (!ts || ts.getTime().toString() === 'NaN') {\n ts = isDayEnd ? getNextTimeEvent(end, useNextDay) : getNextTimeEvent(start, useNextDay);\n }\n ts.setMilliseconds(0);\n ts.setMinutes(ts.getMinutes() + (parseInt(offsetMinutes as unknown as string, 10) || 0));\n\n const [timeHoursStart, timeMinutesStart] = start.split(':');\n const nTimeHoursStart = parseInt(timeHoursStart, 10);\n const nTimeMinutesStart = parseInt(timeMinutesStart, 10) || 0;\n\n if (\n ts.getHours() < nTimeHoursStart ||\n (ts.getHours() === nTimeHoursStart && ts.getMinutes() < nTimeMinutesStart)\n ) {\n ts = getNextTimeEvent(start, useNextDay);\n ts.setSeconds(0);\n }\n\n const [timeHoursEnd, timeMinutesEnd] = end.split(':');\n const nTimeHoursEnd = parseInt(timeHoursEnd, 10);\n const nTimeMinutesEnd = parseInt(timeMinutesEnd, 10) || 0;\n\n if (ts.getHours() > nTimeHoursEnd || (ts.getHours() === nTimeHoursEnd && ts.getMinutes() > nTimeMinutesEnd)) {\n ts = getNextTimeEvent(end, useNextDay);\n ts.setSeconds(0);\n }\n\n // if event in the past\n if (date > ts && useNextDay) {\n // take the next day\n ts.setDate(ts.getDate() + 1);\n }\n return ts;\n }\n\n async timeSchedule(): Promise {\n const now = new Date();\n let hours = now.getHours();\n const minutes = now.getMinutes();\n if (this.timeSettings.format12) {\n if (hours > 12) {\n hours -= 12;\n }\n }\n let sHours: string;\n if (this.timeSettings.leadingZeros) {\n sHours = hours.toString().padStart(2, '0');\n } else {\n sHours = hours.toString();\n }\n\n await this.setState('variables.dayTime', {\n val: `${sHours}:${minutes.toString().padStart(2, '0')}`,\n ack: true,\n });\n\n now.setMinutes(now.getMinutes() + 1);\n now.setSeconds(0);\n now.setMilliseconds(0);\n const interval = now.getTime() - Date.now();\n this.timeScheduleTimer = setTimeout(() => this.timeSchedule(), interval);\n }\n\n async dayTimeSchedules(): Promise {\n // get astrological event\n if (\n this.config.latitude === undefined ||\n this.config.longitude === undefined ||\n (this.config.latitude as unknown as string) === '' ||\n (this.config.longitude as unknown as string) === '' ||\n this.config.latitude === null ||\n this.config.longitude === null\n ) {\n this.log.error('Longitude or latitude does not set. Cannot use astro.');\n return;\n }\n\n // Calculate the next event today\n const todayDate = getAstroStartOfDay();\n const nowDate = new Date();\n\n const todaySunrise = this.getAstroEvent(\n todayDate,\n this.config.sunriseEvent,\n this.config.sunriseLimitStart,\n this.config.sunriseLimitEnd,\n this.config.sunriseOffset,\n false,\n this.config.latitude,\n this.config.longitude,\n );\n const todaySunset = this.getAstroEvent(\n todayDate,\n this.config.sunsetEvent,\n this.config.sunsetLimitStart,\n this.config.sunsetLimitEnd,\n this.config.sunsetOffset,\n true,\n this.config.latitude,\n this.config.longitude,\n );\n\n // Sunrise\n let sunriseTimeout = todaySunrise.getTime() - nowDate.getTime();\n if (sunriseTimeout < 0 || sunriseTimeout > 3600000) {\n sunriseTimeout = 3600000;\n }\n\n // Sunset\n let sunsetTimeout = todaySunset.getTime() - nowDate.getTime();\n if (sunsetTimeout < 0 || sunsetTimeout > 3600000) {\n sunsetTimeout = 3600000;\n }\n\n const isDayTime: ioBroker.State | null | undefined = await this.getStateAsync('variables.isDayTime');\n let isDay: boolean;\n if (sunriseTimeout < 5000) {\n isDay = true;\n } else if (sunsetTimeout < 5000) {\n isDay = false;\n } else {\n // check if in between\n isDay = nowDate.getTime() > todaySunrise.getTime() - 60000 && nowDate <= todaySunset;\n }\n\n const valDayTime = isDayTime ? !!isDayTime.val : false;\n if (valDayTime !== isDay || isDayTime === null) {\n await this.setState('variables.isDayTime', isDay, true);\n }\n\n const dayLightSaving: ioBroker.State | null | undefined =\n await this.getStateAsync('variables.isDaylightSaving');\n const isDayLightSaving = dstOffsetAtDate(nowDate) !== 0;\n const val = dayLightSaving ? !!dayLightSaving.val : false;\n\n if (val !== isDayLightSaving || dayLightSaving === null) {\n await this.setState('variables.isDaylightSaving', isDayLightSaving, true);\n }\n\n let nextTimeout = sunriseTimeout;\n if (sunriseTimeout > sunsetTimeout) {\n nextTimeout = sunsetTimeout;\n }\n nextTimeout = nextTimeout - 3000;\n if (nextTimeout < 3000) {\n nextTimeout = 3000;\n }\n\n this.dayScheduleTimer = setTimeout(() => this.dayTimeSchedules(), nextTimeout);\n }\n\n stopTimeSchedules(): void {\n if (this.dayScheduleTimer) {\n clearTimeout(this.dayScheduleTimer);\n this.dayScheduleTimer = null;\n }\n if (this.sunScheduleTimer) {\n clearTimeout(this.sunScheduleTimer);\n this.sunScheduleTimer = null;\n }\n if (this.timeScheduleTimer) {\n clearTimeout(this.timeScheduleTimer);\n this.timeScheduleTimer = null;\n }\n }\n\n async patchFont(): Promise {\n let stat: Stats | undefined;\n let dbFile: Buffer | undefined;\n let fileName = `${__dirname}/../admin/vs/base/browser/ui/codicons/codicon/codicon.ttf`;\n let jsonFileName = `${__dirname}/../admin/vsFont/codicon.json`;\n try {\n if (existsSync(fileName)) {\n stat = statSync(fileName);\n }\n if (!stat) {\n jsonFileName = `${__dirname}/admin/vsFont/codicon.json`;\n fileName = `${__dirname}/admin/vs/base/browser/ui/codicons/codicon/codicon.ttf`;\n if (existsSync(fileName)) {\n stat = statSync(fileName);\n }\n }\n const _dbFile = await this.readFileAsync(\n 'javascript.admin',\n `vs/base/browser/ui/codicons/codicon/codicon.ttf`,\n );\n if (_dbFile?.file) {\n dbFile = _dbFile.file as Buffer;\n }\n } catch {\n // ignore\n }\n\n if (stat?.size !== 73452 || dbFile?.byteLength !== 73452) {\n try {\n const buffer = Buffer.from(JSON.parse(readFileSync(jsonFileName).toString()), 'base64');\n\n const jszip = await import('jszip');\n const zip = await jszip.loadAsync(buffer);\n let data: ArrayBuffer | undefined;\n if (zip) {\n data = await zip.file('codicon.ttf')?.async('arraybuffer');\n if (data?.byteLength !== 73452) {\n this.log.error(`Cannot patch font: invalid font file!`);\n return false;\n }\n } else {\n this.log.error(`Cannot patch font: invalid font file!`);\n return false;\n }\n writeFileSync(fileName, Buffer.from(data));\n // upload this file\n await this.writeFileAsync(\n 'javascript.admin',\n 'vs/base/browser/ui/codicons/codicon/codicon.ttf',\n Buffer.from(data),\n );\n return true;\n } catch (err: unknown) {\n this.log.error(`Cannot patch font: ${err as Error}`);\n return false;\n }\n }\n return false;\n }\n\n async sunTimeSchedules(): Promise {\n if (this.config.createAstroStates) {\n if (!isNaN(this.config.longitude) && !isNaN(this.config.longitude)) {\n const calcDate = getAstroStartOfDay();\n\n const times = this.mods.suncalc.getTimes(calcDate, this.config.latitude, this.config.longitude);\n\n this.log.debug(`[sunTimeSchedules] Times: ${JSON.stringify(times)}`);\n\n for (const t in times) {\n try {\n const objId = `variables.astro.${t}`;\n\n await this.setObjectNotExistsAsync(objId, {\n type: 'state',\n common: {\n name: `Astro ${t}`,\n type: 'string',\n role: 'value',\n read: true,\n write: false,\n },\n native: {},\n });\n\n if (times[t] !== null && !isNaN(times[t].getTime())) {\n const timeFormatted = formatHoursMinutesSeconds(times[t]);\n await this.setState(objId, {\n val: timeFormatted,\n c: times[t].toISOString(),\n ack: true,\n });\n } else {\n await this.setState(objId, { val: null, c: 'n/a', ack: true, q: 0x01 });\n }\n } catch (err: unknown) {\n this.log.error(\n `[sunTimeSchedules] Unable to set state for astro time \"${t}\" (${times[t].getTime()}): ${err as Error}`,\n );\n }\n }\n\n const todayDate = new Date();\n todayDate.setHours(0);\n todayDate.setMinutes(0);\n todayDate.setSeconds(1);\n todayDate.setMilliseconds(0);\n todayDate.setDate(todayDate.getDate() + 1);\n\n this.log.debug(`[sunTimeSchedules] Next: ${todayDate.toISOString()}`);\n this.sunScheduleTimer = setTimeout(() => this.sunTimeSchedules(), todayDate.getTime() - Date.now());\n }\n } else {\n // remove astro states if disabled\n this.delObject('variables.astro', { recursive: true });\n }\n }\n\n /**\n * Redirects the virtual-tsc log output to the ioBroker log\n */\n tsLog = (message: string, severity?: ioBroker.LogLevel): void => {\n // shift the severities around, we don't care about the small details\n if (!severity || severity === 'info') {\n severity = 'debug';\n } else if (severity === 'debug') {\n // Don't spam build logs on Travis\n if (isCI) {\n return;\n }\n severity = 'silly';\n }\n\n if (this?.log) {\n this.log[severity](message);\n } else {\n console.log(`[${severity.toUpperCase()}] ${message}`);\n }\n };\n\n addGetProperty(object: Record): void {\n try {\n Object.defineProperty(object, 'get', {\n value: function (id: string): any {\n return this[id] || this[`${this.namespace}.${id}`];\n },\n enumerable: false,\n });\n } catch {\n console.error('Cannot install get property');\n }\n }\n\n /**\n * Add declarations for global scripts\n *\n * @param scriptID - The current script the declarations were generated from\n * @param declarations - Declarations from a script\n */\n provideDeclarationsForGlobalScript(scriptID: string, declarations: string): void {\n // Remember which declarations this global script had access to;\n // we need this so the editor doesn't show a duplicate identifier error\n if (this.globalDeclarations != null && this.globalDeclarations !== '') {\n this.knownGlobalDeclarationsByScript[scriptID] = this.globalDeclarations;\n }\n // and concatenate the global declarations for the next scripts\n this.globalDeclarations += `${declarations}\\n`;\n // remember all previously generated global declarations,\n // so global scripts can reference each other\n const globalDeclarationPath = 'global.d.ts';\n tsAmbient[globalDeclarationPath] = this.globalDeclarations;\n // make sure the next script compilation has access to the updated declarations\n this.tsServer.provideAmbientDeclarations({\n [globalDeclarationPath]: this.globalDeclarations,\n });\n jsDeclarationServer.provideAmbientDeclarations({\n [globalDeclarationPath]: this.globalDeclarations,\n });\n }\n\n fixLineNo(line: string): string {\n if (line.includes('javascript.js:')) {\n return line;\n }\n if (!/scripts?\\.js[.\\\\/]/.test(line)) {\n return line;\n }\n if (/:(\\d+):/.test(line)) {\n line = line.replace(\n /:(\\d+):/,\n (_$0, $1) => `:${$1 > this.globalScriptLines + 1 ? $1 - this.globalScriptLines - 1 : $1}:`,\n ); // one line for 'async function ()'\n } else {\n line = line.replace(\n /:(\\d+)$/,\n (_$0, $1) => `:${$1 > this.globalScriptLines + 1 ? $1 - this.globalScriptLines - 1 : $1}`,\n ); // one line for 'async function ()'\n }\n return line;\n }\n\n async debugStop(): Promise {\n if (this.debugState.child) {\n this.debugSendToInspector({ cmd: 'end' });\n this.debugState.endTimeout = setTimeout(() => {\n this.debugState.endTimeout = null;\n this.debugState.child?.kill('SIGTERM');\n }, 500);\n this.debugState.promiseOnEnd ||= Promise.resolve(0);\n } else {\n this.debugState.promiseOnEnd = Promise.resolve(0);\n }\n\n await this.debugState.promiseOnEnd;\n\n this.debugState.child = null;\n this.debugState.running = false;\n this.debugState.scriptName = '';\n if (this.debugState.endTimeout) {\n clearTimeout(this.debugState.endTimeout);\n this.debugState.endTimeout = null;\n }\n }\n\n async debugDisableScript(id: string | undefined): Promise {\n if (id) {\n const obj = this.objects[id];\n if (obj?.common?.enabled) {\n await this.extendForeignObjectAsync(obj._id, { common: { enabled: false } });\n }\n }\n }\n\n debugSendToInspector(message: any): void {\n if (this.debugState.child) {\n try {\n this.log.info(`send to debugger: ${message}`);\n this.debugState.child.send(message);\n } catch {\n void this.debugStop().then(() =>\n this.log.info(\n `${this.debugState.scriptName}: Debugging was stopped, because started in normal mode`,\n ),\n );\n }\n } else {\n this.log.error(`${this.debugState.scriptName}: Cannot send command to terminated inspector`);\n void this.setState(\n 'debug.from',\n JSON.stringify({ cmd: 'error', error: `Cannot send command to terminated inspector`, id: 1 }),\n true,\n );\n }\n }\n\n debugStart(data: { breakOnStart?: boolean; scriptName?: string; adapter?: string }): void {\n if (Date.now() - this.debugState.started < 1000) {\n console.log('Start ignored');\n return;\n }\n\n this.debugState.started = Date.now();\n // stop the script if it's running\n void this.debugDisableScript(data.scriptName)\n .then(() => this.debugStop())\n .then(() => {\n if (data.adapter) {\n this.debugState.adapterInstance = data.adapter;\n this.debugState.scriptName = '';\n } else {\n this.debugState.adapterInstance = '';\n this.debugState.scriptName = data.scriptName as string;\n }\n\n this.debugState.breakOnStart = data.breakOnStart;\n\n this.debugState.promiseOnEnd = new Promise(resolve => {\n const options: ForkOptions = {\n stdio: ['ignore', 'inherit', 'inherit', 'ipc'],\n //stdio: ['pipe', 'pipe', 'pipe', 'ipc']\n };\n const args: string[] = [];\n if (this.debugState.adapterInstance) {\n args.push('--breakOnStart');\n }\n\n this.debugState.child = fork(`${__dirname}/lib/inspect.js`, args, options);\n\n /*debugState.child.stdout.setEncoding('utf8');\n debugState.child.stderr.setEncoding('utf8');\n debugState.child.stdout.on('data', childPrint);\n debugState.child.stderr.on('data', childPrint);*/\n\n this.debugState.child?.on(\n 'message',\n (\n message:\n | string\n | {\n cmd: 'ready' | 'watched' | 'paused' | 'resumed' | 'log' | 'readyToDebug';\n severity?: string;\n text?: string;\n scriptId?: string;\n script?: string;\n },\n ) => {\n let oMessage: {\n cmd: 'ready' | 'watched' | 'paused' | 'resumed' | 'log' | 'readyToDebug';\n severity?: string;\n text?: string;\n scriptId?: string;\n script?: string;\n };\n if (typeof message === 'string') {\n try {\n oMessage = JSON.parse(message);\n } catch {\n return this.log.error(`Cannot parse message from inspector: ${message}`);\n }\n } else {\n oMessage = message;\n }\n\n if (oMessage.cmd !== 'ready') {\n void this.setState('debug.from', JSON.stringify(oMessage), true);\n }\n\n switch (oMessage.cmd) {\n case 'ready': {\n this.debugSendToInspector({\n cmd: 'start',\n scriptName: this.debugState.scriptName,\n adapterInstance: this.debugState.adapterInstance,\n instance: this.instance,\n });\n break;\n }\n\n case 'watched': {\n //console.log(`WATCHED: ${JSON.stringify(oMessage)}`);\n break;\n }\n\n case 'paused': {\n this.debugState.paused = true;\n console.log(`host: PAUSED`);\n break;\n }\n\n case 'resumed': {\n this.debugState.paused = false;\n //console.log(`STARTED`);\n break;\n }\n\n case 'log': {\n console.log(`[${oMessage.severity}] ${oMessage.text}`);\n break;\n }\n\n case 'readyToDebug': {\n console.log(\n `host: readyToDebug (set breakpoints): [${oMessage.scriptId}] ${oMessage.script}`,\n );\n break;\n }\n }\n },\n );\n this.debugState.child?.on('error', error => {\n this.log.error(`Cannot start inspector: ${error}`);\n void this.setState('debug.from', JSON.stringify({ cmd: 'error', error }), true);\n });\n\n this.debugState.child?.on('exit', async (code: number): Promise => {\n if (code) {\n await this.setState(\n 'debug.from',\n JSON.stringify({ cmd: 'error', error: `invalid response code: ${code}` }),\n true,\n );\n }\n await this.setState('debug.from', JSON.stringify({ cmd: 'debugStopped', code }), true);\n this.debugState.child = null;\n resolve(code);\n });\n });\n });\n }\n}\n\nfunction patternMatching(\n event: EventObj,\n patternFunctions: PatternEventCompareFunction[] & { logic?: 'and' | 'or' },\n): boolean {\n let matched = false;\n for (let i = 0, len = patternFunctions.length; i < len; i++) {\n if (patternFunctions[i](event)) {\n if (patternFunctions.logic === 'or') {\n return true;\n }\n matched = true;\n } else if (patternFunctions.logic === 'and') {\n return false;\n }\n }\n return matched;\n}\n\n// If started as allInOne mode => return function to create an instance\nif (require.main !== module) {\n // Export the constructor in compact mode\n module.exports = (options: Partial | undefined) => new JavaScript(options);\n} else {\n // otherwise start the instance directly\n (() => new JavaScript())();\n}\n"]} \ No newline at end of file diff --git a/build/types.d.ts b/build/types.d.ts index efc3d5253..ac28e8517 100644 --- a/build/types.d.ts +++ b/build/types.d.ts @@ -61,6 +61,7 @@ export type JavascriptTimer = { delay: number; val: ioBroker.StateValue; ack?: boolean; + scriptName: string; }; export type ScriptType = 'TypeScript/ts' | 'Blockly' | 'Rules' | 'Javascript/js'; diff --git a/io-package.json b/io-package.json index 900a8f125..8cee3bd3f 100644 --- a/io-package.json +++ b/io-package.json @@ -78,45 +78,6 @@ "pl": "Dodano możliwość szyfrowania skryptów hasłem (tylko dla sprzedawców)", "uk": "Додана можливість шифрування сценаріїв з паролем (тільки для постачальників)", "zh-cn": "添加使用密码加密脚本的可能性( 只针对供应商)" - }, - "9.0.16": { - "en": "Added possibility to encrypt scripts with password (only for vendors)", - "de": "Zusätzliche Möglichkeit, Skripte mit Passwort zu verschlüsseln (nur für Hersteller)", - "ru": "Добавлена возможность шифрования скриптов с помощью пароля (только для продавцов)", - "pt": "Adicionada possibilidade de criptografar scripts com senha (somente para fornecedores)", - "nl": "Toegevoegd mogelijkheid om scripts te versleutelen met wachtwoord (alleen voor leveranciers)", - "fr": "Ajout de la possibilité de chiffrer les scripts avec le mot de passe (seulement pour les fournisseurs)", - "it": "Aggiunta possibilità di crittografare gli script con password (solo per i fornitori)", - "es": "Añadido posibilidad de cifrar scripts con contraseña (sólo para proveedores)", - "pl": "Dodano możliwość szyfrowania skryptów hasłem (tylko dla sprzedawców)", - "uk": "Додана можливість шифрування сценаріїв з паролем (тільки для постачальників)", - "zh-cn": "添加使用密码加密脚本的可能性( 只针对供应商)" - }, - "9.0.15": { - "en": "Added possibility to encrypt scripts with password (only for vendors)", - "de": "Zusätzliche Möglichkeit, Skripte mit Passwort zu verschlüsseln (nur für Hersteller)", - "ru": "Добавлена возможность шифрования скриптов с помощью пароля (только для продавцов)", - "pt": "Adicionada possibilidade de criptografar scripts com senha (somente para fornecedores)", - "nl": "Toegevoegd mogelijkheid om scripts te versleutelen met wachtwoord (alleen voor leveranciers)", - "fr": "Ajout de la possibilité de chiffrer les scripts avec le mot de passe (seulement pour les fournisseurs)", - "it": "Aggiunta possibilità di crittografare gli script con password (solo per i fornitori)", - "es": "Añadido posibilidad de cifrar scripts con contraseña (sólo para proveedores)", - "pl": "Dodano możliwość szyfrowania skryptów hasłem (tylko dla sprzedawców)", - "uk": "Додана можливість шифрування сценаріїв з паролем (тільки для постачальників)", - "zh-cn": "添加使用密码加密脚本的可能性( 只针对供应商)" - }, - "9.0.14": { - "en": "Added possibility to encrypt scripts with password (only for vendors)", - "de": "Zusätzliche Möglichkeit, Skripte mit Passwort zu verschlüsseln (nur für Hersteller)", - "ru": "Добавлена возможность шифрования скриптов с помощью пароля (только для продавцов)", - "pt": "Adicionada possibilidade de criptografar scripts com senha (somente para fornecedores)", - "nl": "Toegevoegd mogelijkheid om scripts te versleutelen met wachtwoord (alleen voor leveranciers)", - "fr": "Ajout de la possibilité de chiffrer les scripts avec le mot de passe (seulement pour les fournisseurs)", - "it": "Aggiunta possibilità di crittografare gli script con password (solo per i fornitori)", - "es": "Añadido posibilidad de cifrar scripts con contraseña (sólo para proveedores)", - "pl": "Dodano możliwość szyfrowania skryptów hasłem (tylko dla sprzedawców)", - "uk": "Додана можливість шифрування сценаріїв з паролем (тільки для постачальників)", - "zh-cn": "添加使用密码加密脚本的可能性( 只针对供应商)" } }, "platform": "Javascript/Node.js", @@ -173,7 +134,7 @@ }, "dependencies": [ { - "js-controller": ">=5.0.19" + "js-controller": ">=6.0.11" } ], "globalDependencies": [ diff --git a/package.json b/package.json index 72ba92197..46865578f 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,6 @@ "@iobroker/adapter-dev": "^1.5.0", "@iobroker/build-tools": "^3.0.1", "@iobroker/eslint-config": "^2.2.0", - "@iobroker/plugin-sentry": "^3.0.4", "@iobroker/testing": "^5.2.2", "@iobroker/vis-2-widgets-react-dev": "^4.0.4", "@types/node-schedule": "^2.1.8", diff --git a/src-admin/package-lock.json b/src-admin/package-lock.json index 9228b5845..ea0774479 100644 --- a/src-admin/package-lock.json +++ b/src-admin/package-lock.json @@ -1,12 +1,12 @@ { "name": "iobroker-admin-component-javascript", - "version": "9.1.0", + "version": "9.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "iobroker-admin-component-javascript", - "version": "9.1.0", + "version": "9.1.1", "devDependencies": { "@iobroker/adapter-react-v5": "8.1.3", "@iobroker/json-config": "8.2.8", diff --git a/src-editor/package-lock.json b/src-editor/package-lock.json index ad9b06a27..91a3bc072 100644 --- a/src-editor/package-lock.json +++ b/src-editor/package-lock.json @@ -1,12 +1,12 @@ { "name": "js", - "version": "9.1.0", + "version": "9.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "js", - "version": "9.1.0", + "version": "9.1.1", "dependencies": { "@blockly/field-colour": "^5.0.19", "@blockly/field-multilineinput": "^5.0.17", diff --git a/src-editor/src/SideMenu.tsx b/src-editor/src/SideMenu.tsx index 2ab3c0f8d..a9ea3b3b3 100644 --- a/src-editor/src/SideMenu.tsx +++ b/src-editor/src/SideMenu.tsx @@ -201,8 +201,9 @@ const styles: Record = { color: 'white', }, instances: { - color: 'gray', fontSize: 'smaller', + fontWeight: 'bold', + marginRight: 4, }, childrenCount: { fontSize: 10, @@ -1143,15 +1144,20 @@ export default class SideDrawer extends React.Component{title}, [{item.instance}] , + {title}, ]; } const reorder = this.state.reorder && !this.props.debugMode; diff --git a/src-editor/src/i18n/de.json b/src-editor/src/i18n/de.json index 1df304a38..8dd5bcb65 100644 --- a/src-editor/src/i18n/de.json +++ b/src-editor/src/i18n/de.json @@ -343,6 +343,7 @@ "no group": "KEINE GRUPPE", "normal": "Normal", "normal priority": "normale Priorität", + "not running": "nicht gestartet", "not equal to": "ungleich", "not properly connected": "Dieser Block ist mit anderen nicht richtig verbunden.", "offset": "Versatz", diff --git a/src-editor/src/i18n/en.json b/src-editor/src/i18n/en.json index 5bc6b01ce..b91e30c84 100644 --- a/src-editor/src/i18n/en.json +++ b/src-editor/src/i18n/en.json @@ -343,6 +343,7 @@ "no group": "NO GROUP", "normal": "normal", "normal priority": "normal priority", + "not running": "not running", "not equal to": "not equal to", "not properly connected": "This block is not properly connected to other blocks.", "offset": "offset", diff --git a/src-editor/src/i18n/es.json b/src-editor/src/i18n/es.json index b06f10de2..0b037086a 100644 --- a/src-editor/src/i18n/es.json +++ b/src-editor/src/i18n/es.json @@ -343,6 +343,7 @@ "no group": "NO GRUPO", "normal": "normal", "normal priority": "prioridad normal", + "not running": "no está en ejecución", "not equal to": "no igual a", "not properly connected": "Este bloque no está conectado correctamente a otros bloques.", "offset": "compensar", diff --git a/src-editor/src/i18n/fr.json b/src-editor/src/i18n/fr.json index 7a5c06e55..effcefc90 100644 --- a/src-editor/src/i18n/fr.json +++ b/src-editor/src/i18n/fr.json @@ -343,6 +343,7 @@ "no group": "PAS DE GROUPE", "normal": "Ordinaire", "normal priority": "priorité normale", + "not running": "pas en cours d'exécution", "not equal to": "pas égal à", "not properly connected": "Ce bloc n'est pas correctement connecté à d'autres blocs.", "offset": "décalage", diff --git a/src-editor/src/i18n/it.json b/src-editor/src/i18n/it.json index 8aa27a422..8485d284d 100644 --- a/src-editor/src/i18n/it.json +++ b/src-editor/src/i18n/it.json @@ -343,6 +343,7 @@ "no group": "NESSUN GRUPPO", "normal": "normale", "normal priority": "priorità normale", + "not running": "non in esecuzione", "not equal to": "non uguale a", "not properly connected": "Questo blocco non è correttamente collegato ad altri blocchi.", "offset": "compensare", diff --git a/src-editor/src/i18n/nl.json b/src-editor/src/i18n/nl.json index 7f3335bd8..bd863fc41 100644 --- a/src-editor/src/i18n/nl.json +++ b/src-editor/src/i18n/nl.json @@ -343,6 +343,7 @@ "no group": "GEEN GROEP", "normal": "normaal", "normal priority": "normale prioriteit", + "not running": "niet actief", "not equal to": "niet gelijk aan", "not properly connected": "Dit blok is niet correct verbonden met andere blokken.", "offset": "compensatie", diff --git a/src-editor/src/i18n/pl.json b/src-editor/src/i18n/pl.json index 9e3a5fd02..3b58876d8 100644 --- a/src-editor/src/i18n/pl.json +++ b/src-editor/src/i18n/pl.json @@ -343,6 +343,7 @@ "no group": "BRAK GRUPY", "normal": "normalny", "normal priority": "normalny priorytet", + "not running": "nie uruchomiony", "not equal to": "nie równa się", "not properly connected": "Ten blok nie jest poprawnie podłączony do innych bloków.", "offset": "przesunięcie", diff --git a/src-editor/src/i18n/pt.json b/src-editor/src/i18n/pt.json index 6f07def91..29d1aa371 100644 --- a/src-editor/src/i18n/pt.json +++ b/src-editor/src/i18n/pt.json @@ -343,6 +343,7 @@ "no group": "SEM GRUPO", "normal": "normal", "normal priority": "prioridade normal", + "not running": "não está em execução", "not equal to": "não é igual a", "not properly connected": "Este bloco não está conectado corretamente com outros blocos.", "offset": "Deslocamento", diff --git a/src-editor/src/i18n/ru.json b/src-editor/src/i18n/ru.json index bd5131ba8..938dc1659 100644 --- a/src-editor/src/i18n/ru.json +++ b/src-editor/src/i18n/ru.json @@ -343,6 +343,7 @@ "no group": "Нет группы", "normal": "нормальный", "normal priority": "нормальный приоритет", + "not running": "не запущен", "not equal to": "не равно", "not properly connected": "Этот блок неправильно соединён или не соединён с другими блоками.", "offset": "сдвиг", diff --git a/src-editor/src/i18n/uk.json b/src-editor/src/i18n/uk.json index c9a6b590f..9220aba26 100644 --- a/src-editor/src/i18n/uk.json +++ b/src-editor/src/i18n/uk.json @@ -343,6 +343,7 @@ "no group": "НЕМАЄ ГРУПИ", "normal": "нормально", "normal priority": "нормальний пріоритет", + "not running": "не запущено", "not equal to": "не дорівнює", "not properly connected": "Цей блок неправильно з’єднаний з іншими блоками.", "offset": "зсув", diff --git a/src-editor/src/i18n/zh-cn.json b/src-editor/src/i18n/zh-cn.json index a0a126df7..548c2f084 100644 --- a/src-editor/src/i18n/zh-cn.json +++ b/src-editor/src/i18n/zh-cn.json @@ -343,6 +343,7 @@ "no group": "没有组", "normal": "普通的", "normal priority": "正常优先", + "not running": "未运行", "not equal to": "不等于", "not properly connected": "此块未正确连接到其他块。", "offset": "抵消", diff --git a/src/lib/sandbox.ts b/src/lib/sandbox.ts index 3b6ec4fb7..ff49f3392 100644 --- a/src/lib/sandbox.ts +++ b/src/lib/sandbox.ts @@ -2779,6 +2779,7 @@ export function sandBox( (state as ioBroker.SettableState).ack !== undefined ? (state as ioBroker.SettableState).ack : isAck, + scriptName: name, }); return context.timerId; diff --git a/src/main.ts b/src/main.ts index 7d5c58922..534cf2e8a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2656,6 +2656,20 @@ class JavaScript extends Adapter { for (let i = 0; i < this.scripts[name].intervals.length; i++) { clearInterval(this.scripts[name].intervals[i]); } + // Stop all delayed states (setStateDelayed timers) + for (const stateId of Object.keys(this.timers)) { + if (this.timers[stateId]) { + for (let i = this.timers[stateId].length - 1; i >= 0; i--) { + if (this.timers[stateId][i].scriptName === name) { + clearTimeout(this.timers[stateId][i].t); + this.timers[stateId].splice(i, 1); + } + } + if (!this.timers[stateId].length) { + delete this.timers[stateId]; + } + } + } // Stop all scheduled jobs for (let i = 0; i < this.scripts[name].schedules.length; i++) { if (this.scripts[name].schedules[i]) { diff --git a/src/types.d.ts b/src/types.d.ts index efc3d5253..ac28e8517 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -61,6 +61,7 @@ export type JavascriptTimer = { delay: number; val: ioBroker.StateValue; ack?: boolean; + scriptName: string; }; export type ScriptType = 'TypeScript/ts' | 'Blockly' | 'Rules' | 'Javascript/js'; From a7938cd361bdd3f393ca70b3e9991a418746ba79 Mon Sep 17 00:00:00 2001 From: GermanBluefox Date: Sun, 22 Mar 2026 00:07:49 +0100 Subject: [PATCH 5/7] Check if the file was changed before editing it: https://github.com/ioBroker/ioBroker.javascript/issues/2054 --- src-editor/src/Editor.tsx | 97 +++++++++++++++++++++++++++++++++- src-editor/src/i18n/de.json | 4 ++ src-editor/src/i18n/en.json | 4 ++ src-editor/src/i18n/es.json | 4 ++ src-editor/src/i18n/fr.json | 4 ++ src-editor/src/i18n/it.json | 4 ++ src-editor/src/i18n/nl.json | 4 ++ src-editor/src/i18n/pl.json | 4 ++ src-editor/src/i18n/pt.json | 4 ++ src-editor/src/i18n/ru.json | 4 ++ src-editor/src/i18n/uk.json | 4 ++ src-editor/src/i18n/zh-cn.json | 4 ++ 12 files changed, 140 insertions(+), 1 deletion(-) diff --git a/src-editor/src/Editor.tsx b/src-editor/src/Editor.tsx index 714f0da2c..6863f33e3 100644 --- a/src-editor/src/Editor.tsx +++ b/src-editor/src/Editor.tsx @@ -278,6 +278,7 @@ interface EditorState { menuDebugAnchorEl: null | HTMLElement; triggerPrettier: number; openAiDialog: boolean; + scriptConflict: string; } class Editor extends React.Component { @@ -317,6 +318,8 @@ class Editor extends React.Component { private confirmCallback: null | ((result: boolean) => void) = null; + private lastKnownTs: Record = {}; + constructor(props: EditorProps) { super(props); @@ -362,6 +365,7 @@ class Editor extends React.Component { menuTabsOpened: false, openAiDialog: false, triggerPrettier: 1, + scriptConflict: '', rules: null, runningInstances: this.props.runningInstances || {}, searchText: '', @@ -498,6 +502,34 @@ class Editor extends React.Component { void this.props.socket.unsubscribeObject('system.adapter.*', Editor.onInstanceChanged); } + componentDidUpdate(prevProps: EditorProps): void { + if (prevProps.scriptsHash !== this.props.scriptsHash) { + // Check if any currently editing script was modified externally + for (const id of this.state.editing) { + const obj = this.props.objects[id]; + if (!obj || obj.type !== 'script') { + continue; + } + const newTs = obj.ts || 0; + const knownTs = this.lastKnownTs[id]; + + // Only check scripts we've already loaded (have a known ts) + if (knownTs !== undefined && newTs !== knownTs) { + if (this.state.changed[id]) { + // User has local unsaved changes - show conflict dialog + if (!this.state.scriptConflict) { + this.setState({ scriptConflict: id }); + } + } else { + // No local changes - silently reload the script + this.scripts[id] = this.getScriptFromObject(id)!; + this.lastKnownTs[id] = newTs; + } + } + } + } + } + onBrowserClose = (e: BeforeUnloadEvent): string | void => { const isChanged = Object.keys(this.scripts).find( id => JSON.stringify(this.scripts[id]) !== JSON.stringify(this.getScriptFromObject(id)), @@ -808,6 +840,7 @@ class Editor extends React.Component { onCancel(): void { this.scripts[this.state.selected] = this.getScriptFromObject(this.state.selected)!; + this.lastKnownTs[this.state.selected] = this.props.objects[this.state.selected]?.ts || 0; const changed: { [id: string]: boolean } = { ...this.state.changed }; changed[this.state.selected] = false; @@ -872,6 +905,12 @@ class Editor extends React.Component { } window.localStorage.setItem('Editor.selected', selected); const common = this.scripts[selected] || this.getScriptFromObject(selected); + if (!this.scripts[selected]) { + this.scripts[selected] = common; + } + if (this.lastKnownTs[selected] === undefined && this.props.objects[selected]) { + this.lastKnownTs[selected] = this.props.objects[selected].ts || 0; + } this.setState({ selected, rules: common.engineType === 'Rules', @@ -900,6 +939,7 @@ class Editor extends React.Component { this.showConfirmDialog(I18n.t('Discard changes for %s', this.props.objects[id].common.name), ok => { if (ok) { delete this.scripts[id]; + delete this.lastKnownTs[id]; this.onTabClose(id); } }); @@ -1752,6 +1792,57 @@ class Editor extends React.Component { return null; } + getScriptConflictDialog(): React.JSX.Element | null { + if (!this.state.scriptConflict) { + return null; + } + const id = this.state.scriptConflict; + const scriptName = this.props.objects[id]?.common?.name || id; + + return ( + this.setState({ scriptConflict: '' })} + > + {I18n.t('Script was modified externally')} + + {I18n.t('The script "%s" has been modified by another user or in another window. Do you want to reload the script or keep your local changes?', scriptName)} + + + + + + + ); + } + getConfirmDialog(): React.JSX.Element | null { if (this.state.confirm) { return ( @@ -2106,7 +2197,10 @@ class Editor extends React.Component { this.state.blockly === null && this.state.rules === null ) { - this.scripts[this.state.selected] ||= this.getScriptFromObject(this.state.selected)!; + if (!this.scripts[this.state.selected]) { + this.scripts[this.state.selected] = this.getScriptFromObject(this.state.selected)!; + this.lastKnownTs[this.state.selected] = this.props.objects[this.state.selected]?.ts || 0; + } setTimeout(() => { const newState = { @@ -2163,6 +2257,7 @@ class Editor extends React.Component { this.getRulesEditor(), this.getDebug(), this.getConfirmDialog(), + this.getScriptConflictDialog(), this.getSelectIdDialog(), this.getCronDialog(), this.getEditorDialog(), diff --git a/src-editor/src/i18n/de.json b/src-editor/src/i18n/de.json index 8dd5bcb65..ec5d78ab5 100644 --- a/src-editor/src/i18n/de.json +++ b/src-editor/src/i18n/de.json @@ -125,6 +125,7 @@ "July": "Juli", "June": "Juni", "Just check": "Einfach überprüfen", + "Keep my changes": "Meine Änderungen behalten", "Language:": "Sprache:", "Learn More": "Mehr erfahren", "Light style": "Heller Stil", @@ -174,6 +175,7 @@ "Pushover": "Pushover", "Pushsafer": "Pushsafer", "Read only ID selected: %s": "Schreibgeschützte ID ausgewählt: %s", + "Reload": "Neu laden", "Rename": "Umbenennen", "Reorder scripts in folders": "Skripte in Ordnern neu ordnen", "Repeat": "Wiederholen", @@ -192,6 +194,7 @@ "Schedule": "Zeitplan", "Script": "Skript", "Script %s was modified on disk": "Skript \"%s\" wurde auf der Festplatte geändert", + "Script was modified externally": "Skript wurde extern geändert", "Script is not running": "Skript läuft nicht", "Search in scripts": "Suche in Skripten", "Search...": "Suche...", @@ -231,6 +234,7 @@ "Telegram": "Telegram", "Text:": "Text:", "Th": "Do", + "The script \"%s\" has been modified by another user or in another window. Do you want to reload the script or keep your local changes?": "Das Skript \"%s\" wurde von einem anderen Benutzer oder in einem anderen Fenster geändert. Möchten Sie das Skript neu laden oder Ihre lokalen Änderungen behalten?", "The script will be stopped and must be activated manually after debugging. Continue?": "Das Skript wird gestoppt und muss nach dem Debuggen manuell aktiviert werden. Fortsetzen?", "This is advances option. You can write your own code here and it will be executed on trigger": "Dies ist eine erweiterte Option. Sie können hier Ihren eigenen Code schreiben, der beim Auslösen ausgeführt wird", "Thursday": "Donnerstag", diff --git a/src-editor/src/i18n/en.json b/src-editor/src/i18n/en.json index b91e30c84..45c9e7c08 100644 --- a/src-editor/src/i18n/en.json +++ b/src-editor/src/i18n/en.json @@ -125,6 +125,7 @@ "July": "July", "June": "June", "Just check": "Just check", + "Keep my changes": "Keep my changes", "Language:": "Language:", "Learn More": "Learn More", "Light style": "Light style", @@ -174,6 +175,7 @@ "Pushover": "Pushover", "Pushsafer": "Pushsafer", "Read only ID selected: %s": "Read only ID selected: %s", + "Reload": "Reload", "Rename": "Rename", "Reorder scripts in folders": "Reorder scripts in folders", "Repeat": "Repeat", @@ -192,6 +194,7 @@ "Schedule": "Schedule", "Script": "Script", "Script %s was modified on disk": "Script %s was modified on disk", + "Script was modified externally": "Script was modified externally", "Script is not running": "Script is not running", "Search in scripts": "Search in scripts", "Search...": "Search...", @@ -231,6 +234,7 @@ "Telegram": "Telegram", "Text:": "Text:", "Th": "Th", + "The script \"%s\" has been modified by another user or in another window. Do you want to reload the script or keep your local changes?": "The script \"%s\" has been modified by another user or in another window. Do you want to reload the script or keep your local changes?", "The script will be stopped and must be activated manually after debugging. Continue?": "The script will be stopped and must be activated manually after debugging. Continue?", "This is advances option. You can write your own code here and it will be executed on trigger": "This is advances option. You can write your own code here and it will be executed on trigger", "Thursday": "Thursday", diff --git a/src-editor/src/i18n/es.json b/src-editor/src/i18n/es.json index 0b037086a..743f402ed 100644 --- a/src-editor/src/i18n/es.json +++ b/src-editor/src/i18n/es.json @@ -125,6 +125,7 @@ "July": "julio", "June": "junio", "Just check": "Sólo revisa", + "Keep my changes": "Mantener mis cambios", "Language:": "Idioma:", "Learn More": "Aprende más", "Light style": "Estilo ligero", @@ -174,6 +175,7 @@ "Pushover": "Persona fácil de convencer", "Pushsafer": "Pushsafer", "Read only ID selected: %s": "ID de solo lectura seleccionado: %s", + "Reload": "Recargar", "Rename": "Rebautizar", "Reorder scripts in folders": "Reordenar guiones en carpetas", "Repeat": "Repetir", @@ -192,6 +194,7 @@ "Schedule": "Calendario", "Script": "Guión", "Script %s was modified on disk": "El script %s fue modificado en el disco", + "Script was modified externally": "El script fue modificado externamente", "Script is not running": "El script no se está ejecutando", "Search in scripts": "Buscar en guiones", "Search...": "Buscar...", @@ -231,6 +234,7 @@ "Telegram": "Telegrama", "Text:": "Texto:", "Th": "4", + "The script \"%s\" has been modified by another user or in another window. Do you want to reload the script or keep your local changes?": "El script \"%s\" ha sido modificado por otro usuario o en otra ventana. ¿Desea recargar el script o mantener sus cambios locales?", "The script will be stopped and must be activated manually after debugging. Continue?": "El script se detendrá y deberá activarse manualmente después de la depuración. ¿Continuar?", "This is advances option. You can write your own code here and it will be executed on trigger": "Esta es la opción de avances. Puede escribir su propio código aquí y se ejecutará en el disparador", "Thursday": "jueves", diff --git a/src-editor/src/i18n/fr.json b/src-editor/src/i18n/fr.json index effcefc90..fe65ce1c9 100644 --- a/src-editor/src/i18n/fr.json +++ b/src-editor/src/i18n/fr.json @@ -125,6 +125,7 @@ "July": "juillet", "June": "juin", "Just check": "Vérifiez simplement", + "Keep my changes": "Garder mes modifications", "Language:": "Langue:", "Learn More": "Apprendre encore plus", "Light style": "Style de lumière", @@ -174,6 +175,7 @@ "Pushover": "Pushover", "Pushsafer": "Pushsafer", "Read only ID selected: %s": "ID en lecture seule sélectionné: %s", + "Reload": "Recharger", "Rename": "Renommer", "Reorder scripts in folders": "Réorganiser les scripts dans des dossiers", "Repeat": "Répéter", @@ -192,6 +194,7 @@ "Schedule": "Horaire", "Script": "Scénario", "Script %s was modified on disk": "Le script %s a été modifié sur le disque", + "Script was modified externally": "Le script a été modifié en externe", "Script is not running": "Le script n'est pas en cours d'exécution", "Search in scripts": "Rechercher dans les scripts", "Search...": "Chercher...", @@ -231,6 +234,7 @@ "Telegram": "Télégramme", "Text:": "Texte:", "Th": "4", + "The script \"%s\" has been modified by another user or in another window. Do you want to reload the script or keep your local changes?": "Le script \"%s\" a été modifié par un autre utilisateur ou dans une autre fenêtre. Voulez-vous recharger le script ou garder vos modifications locales ?", "The script will be stopped and must be activated manually after debugging. Continue?": "Le script sera arrêté et doit être activé manuellement après le débogage. Continuez?", "This is advances option. You can write your own code here and it will be executed on trigger": "C'est une option avancée. Vous pouvez écrire votre propre code ici et il sera exécuté au déclenchement", "Thursday": "Jeudi", diff --git a/src-editor/src/i18n/it.json b/src-editor/src/i18n/it.json index 8485d284d..ef09021f7 100644 --- a/src-editor/src/i18n/it.json +++ b/src-editor/src/i18n/it.json @@ -125,6 +125,7 @@ "July": "luglio", "June": "giugno", "Just check": "Controlla solamente", + "Keep my changes": "Mantieni le mie modifiche", "Language:": "Linguaggio:", "Learn More": "Per saperne di più", "Light style": "Stile leggero", @@ -174,6 +175,7 @@ "Pushover": "Pushover", "Pushsafer": "Pushsafer", "Read only ID selected: %s": "ID di sola lettura selezionato: %s", + "Reload": "Ricaricare", "Rename": "Rinominare", "Reorder scripts in folders": "Riordina gli script nelle cartelle", "Repeat": "Ripetere", @@ -192,6 +194,7 @@ "Schedule": "Programma", "Script": "copione", "Script %s was modified on disk": "Lo script %s è stato modificato sul disco", + "Script was modified externally": "Lo script è stato modificato esternamente", "Script is not running": "Lo script non è in esecuzione", "Search in scripts": "Cerca negli script", "Search...": "Ricerca...", @@ -231,6 +234,7 @@ "Telegram": "Telegramma", "Text:": "Testo:", "Th": "4", + "The script \"%s\" has been modified by another user or in another window. Do you want to reload the script or keep your local changes?": "Lo script \"%s\" è stato modificato da un altro utente o in un'altra finestra. Vuoi ricaricare lo script o mantenere le tue modifiche locali?", "The script will be stopped and must be activated manually after debugging. Continue?": "Lo script verrà interrotto e dovrà essere attivato manualmente dopo il debug. Continua?", "This is advances option. You can write your own code here and it will be executed on trigger": "Questa è un'opzione anticipata. Puoi scrivere il tuo codice qui e verrà eseguito al trigger", "Thursday": "giovedi", diff --git a/src-editor/src/i18n/nl.json b/src-editor/src/i18n/nl.json index bd863fc41..24a0d3d3b 100644 --- a/src-editor/src/i18n/nl.json +++ b/src-editor/src/i18n/nl.json @@ -125,6 +125,7 @@ "July": "juli", "June": "juni", "Just check": "Kijk maar", + "Keep my changes": "Mijn wijzigingen behouden", "Language:": "Taal:", "Learn More": "Leer meer", "Light style": "Lichte stijl", @@ -174,6 +175,7 @@ "Pushover": "Pushover", "Pushsafer": "Duwijzer", "Read only ID selected: %s": "Alleen-lezen ID geselecteerd: %s", + "Reload": "Herladen", "Rename": "andere naam geven", "Reorder scripts in folders": "Sorteer scripts in mappen opnieuw", "Repeat": "Herhaling", @@ -192,6 +194,7 @@ "Schedule": "Schema", "Script": "Script", "Script %s was modified on disk": "Script %s is gewijzigd op schijf", + "Script was modified externally": "Script is extern gewijzigd", "Script is not running": "Script is niet actief", "Search in scripts": "Zoeken in scripts", "Search...": "Zoeken...", @@ -231,6 +234,7 @@ "Telegram": "Telegram", "Text:": "Tekst:", "Th": "4", + "The script \"%s\" has been modified by another user or in another window. Do you want to reload the script or keep your local changes?": "Het script \"%s\" is gewijzigd door een andere gebruiker of in een ander venster. Wilt u het script herladen of uw lokale wijzigingen behouden?", "The script will be stopped and must be activated manually after debugging. Continue?": "Het script wordt gestopt en moet na het debuggen handmatig worden geactiveerd. Doorgaan met?", "This is advances option. You can write your own code here and it will be executed on trigger": "Dit is een voorschotoptie. U kunt hier uw eigen code schrijven en deze wordt bij een trigger uitgevoerd", "Thursday": "donderdag", diff --git a/src-editor/src/i18n/pl.json b/src-editor/src/i18n/pl.json index 3b58876d8..6dc081bd8 100644 --- a/src-editor/src/i18n/pl.json +++ b/src-editor/src/i18n/pl.json @@ -125,6 +125,7 @@ "July": "Lipiec", "June": "Czerwiec", "Just check": "Po prostu sprawdź", + "Keep my changes": "Zachowaj moje zmiany", "Language:": "Język:", "Learn More": "Ucz się więcej", "Light style": "Lekki styl", @@ -174,6 +175,7 @@ "Pushover": "Pushover", "Pushsafer": "Pushsafer", "Read only ID selected: %s": "Wybrano identyfikator tylko do odczytu: %s", + "Reload": "Przeładuj", "Rename": "Przemianuj", "Reorder scripts in folders": "Zmień kolejność skryptów w folderach", "Repeat": "Powtórz", @@ -192,6 +194,7 @@ "Schedule": "Harmonogram", "Script": "Skrypt", "Script %s was modified on disk": "Skrypt %s został zmodyfikowany na dysku", + "Script was modified externally": "Skrypt został zmodyfikowany zewnętrznie", "Script is not running": "Skrypt nie działa", "Search in scripts": "Szukaj w skryptach", "Search...": "Szukaj...", @@ -231,6 +234,7 @@ "Telegram": "Telegram", "Text:": "Tekst:", "Th": "Cz", + "The script \"%s\" has been modified by another user or in another window. Do you want to reload the script or keep your local changes?": "Skrypt \"%s\" został zmodyfikowany przez innego użytkownika lub w innym oknie. Czy chcesz przeładować skrypt, czy zachować lokalne zmiany?", "The script will be stopped and must be activated manually after debugging. Continue?": "Skrypt zostanie zatrzymany i należy go aktywować ręcznie po debugowaniu. Kontyntynuj?", "This is advances option. You can write your own code here and it will be executed on trigger": "To jest opcja zaawansowana. Możesz tutaj napisać własny kod, który zostanie wykonany po wyzwoleniu", "Thursday": "Czwartek", diff --git a/src-editor/src/i18n/pt.json b/src-editor/src/i18n/pt.json index 29d1aa371..c0ca375e0 100644 --- a/src-editor/src/i18n/pt.json +++ b/src-editor/src/i18n/pt.json @@ -125,6 +125,7 @@ "July": "julho", "June": "junho", "Just check": "Apenas verifique", + "Keep my changes": "Manter minhas alterações", "Language:": "Língua:", "Learn More": "Aprender mais", "Light style": "Estilo claro", @@ -174,6 +175,7 @@ "Pushover": "Pushover", "Pushsafer": "Pushsafer", "Read only ID selected: %s": "ID somente leitura selecionada: %s", + "Reload": "Recarregar", "Rename": "Renomear", "Reorder scripts in folders": "Reordenar scripts em pastas", "Repeat": "Repetir", @@ -192,6 +194,7 @@ "Schedule": "Cronograma", "Script": "Script", "Script %s was modified on disk": "O script \"%s\" foi modificado no disco rígido", + "Script was modified externally": "O script foi modificado externamente", "Script is not running": "Script não está sendo executado", "Search in scripts": "Pesquisa em scripts", "Search...": "Procurar...", @@ -231,6 +234,7 @@ "Telegram": "Telegrama", "Text:": "Texto:", "Th": "4", + "The script \"%s\" has been modified by another user or in another window. Do you want to reload the script or keep your local changes?": "O script \"%s\" foi modificado por outro usuário ou em outra janela. Deseja recarregar o script ou manter suas alterações locais?", "The script will be stopped and must be activated manually after debugging. Continue?": "O script será interrompido e deve ser ativado manualmente após a depuração. Continuar?", "This is advances option. You can write your own code here and it will be executed on trigger": "Esta é a opção de avanços. Você pode escrever seu próprio código aqui e ele será executado no gatilho", "Thursday": "Quinta-feira", diff --git a/src-editor/src/i18n/ru.json b/src-editor/src/i18n/ru.json index 938dc1659..f407457d0 100644 --- a/src-editor/src/i18n/ru.json +++ b/src-editor/src/i18n/ru.json @@ -125,6 +125,7 @@ "July": "Июль", "June": "Июнь", "Just check": "Просто проверить", + "Keep my changes": "Сохранить мои изменения", "Language:": "Язык:", "Learn More": "Узнать больше", "Light style": "Светлый стиль", @@ -174,6 +175,7 @@ "Pushover": "Pushover", "Pushsafer": "Pushsafer", "Read only ID selected: %s": "Выбран идентификатор только для чтения: %s", + "Reload": "Перезагрузить", "Rename": "Переименовать", "Reorder scripts in folders": "Сортировать скрипты в папках", "Repeat": "Повторение", @@ -192,6 +194,7 @@ "Schedule": "Расписание", "Script": "скрипт", "Script %s was modified on disk": "Скрипт \"%s\" был изменен на диске", + "Script was modified externally": "Скрипт был изменён извне", "Script is not running": "Сценарий не запущен", "Search in scripts": "Поиск в скриптах", "Search...": "Поиск...", @@ -231,6 +234,7 @@ "Telegram": "Telegram", "Text:": "Текст:", "Th": "Чт", + "The script \"%s\" has been modified by another user or in another window. Do you want to reload the script or keep your local changes?": "Скрипт \"%s\" был изменён другим пользователем или в другом окне. Вы хотите перезагрузить скрипт или сохранить свои локальные изменения?", "The script will be stopped and must be activated manually after debugging. Continue?": "Cкрипт будет остановлен и должен быть активирован вручную после отладки. Продолжать?", "This is advances option. You can write your own code here and it will be executed on trigger": "Это расширеный вариант. Вы можете написать здесь свой код и он будет выполняться по триггеру", "Thursday": "Четверг", diff --git a/src-editor/src/i18n/uk.json b/src-editor/src/i18n/uk.json index 9220aba26..ce1b97e93 100644 --- a/src-editor/src/i18n/uk.json +++ b/src-editor/src/i18n/uk.json @@ -125,6 +125,7 @@ "July": "липень", "June": "червень", "Just check": "Просто перевірте", + "Keep my changes": "Зберегти мої зміни", "Language:": "Мову:", "Learn More": "Вивчайте більше", "Light style": "Легкий стиль", @@ -174,6 +175,7 @@ "Pushover": "Pushover", "Pushsafer": "Pushsafer", "Read only ID selected: %s": "Вибрано ідентифікатор лише для читання: %s", + "Reload": "Перезавантажити", "Rename": "Перейменувати", "Reorder scripts in folders": "Зміна порядку сценаріїв у папках", "Repeat": "Повторіть", @@ -192,6 +194,7 @@ "Schedule": "розклад", "Script": "Сценарій", "Script %s was modified on disk": "Сценарій %s змінено на диску", + "Script was modified externally": "Скрипт було змінено ззовні", "Script is not running": "Сценарій не працює", "Search in scripts": "Пошук у скриптах", "Search...": "пошук...", @@ -231,6 +234,7 @@ "Telegram": "Телеграма", "Text:": "Текст:", "Th": "чт", + "The script \"%s\" has been modified by another user or in another window. Do you want to reload the script or keep your local changes?": "Скрипт \"%s\" було змінено іншим користувачем або в іншому вікні. Бажаєте перезавантажити скрипт чи зберегти свої локальні зміни?", "The script will be stopped and must be activated manually after debugging. Continue?": "Сценарій буде зупинено, і його необхідно активувати вручну після налагодження. Продовжити?", "This is advances option. You can write your own code here and it will be executed on trigger": "Це авансовий варіант. Ви можете написати тут свій власний код, і він буде виконано на тригері", "Thursday": "четвер", diff --git a/src-editor/src/i18n/zh-cn.json b/src-editor/src/i18n/zh-cn.json index 548c2f084..7b3d067ba 100644 --- a/src-editor/src/i18n/zh-cn.json +++ b/src-editor/src/i18n/zh-cn.json @@ -125,6 +125,7 @@ "July": "七月", "June": "六月", "Just check": "只是检查", + "Keep my changes": "保留我的更改", "Language:": "语言:", "Learn More": "了解更多", "Light style": "浅色调风格", @@ -174,6 +175,7 @@ "Pushover": "俯卧撑", "Pushsafer": "推安全", "Read only ID selected: %s": "选择的只读ID:%s", + "Reload": "重新加载", "Rename": "重命名", "Reorder scripts in folders": "重新排序文件夹中的脚本", "Repeat": "重复", @@ -192,6 +194,7 @@ "Schedule": "日程", "Script": "脚本", "Script %s was modified on disk": "脚本%s已在磁盘上修改", + "Script was modified externally": "脚本已被外部修改", "Script is not running": "脚本没有运行", "Search in scripts": "在脚本中搜索", "Search...": "搜索...", @@ -231,6 +234,7 @@ "Telegram": "电报", "Text:": "文本:", "Th": "4", + "The script \"%s\" has been modified by another user or in another window. Do you want to reload the script or keep your local changes?": "脚本 \"%s\" 已被其他用户或在其他窗口中修改。您想重新加载脚本还是保留您的本地更改?", "The script will be stopped and must be activated manually after debugging. Continue?": "该脚本将停止,并且必须在调试后手动激活。继续?", "This is advances option. You can write your own code here and it will be executed on trigger": "这是高级选项。您可以在此处编写自己的代码,它将在触发器上执行", "Thursday": "星期四", From 4fa28bad6c8d4c6364e0ab027efeaa9fcdc1d795 Mon Sep 17 00:00:00 2001 From: GermanBluefox Date: Sun, 22 Mar 2026 10:40:04 +0100 Subject: [PATCH 6/7] Correcting error in configuration: https://github.com/ioBroker/ioBroker.javascript/issues/2147 --- README.md | 6 + ...g-CEA56Rl4.js => OpenAiDialog-CANTLp4d.js} | 2 +- .../{index-DWalwvIj.js => index-B0ByV4SK.js} | 2 +- .../{index-Bm6wEaaB.js => index-bny2V8S2.js} | 132 +++++++++--------- .../{index-C9EIOjDT.js => index-ns4mNOlq.js} | 2 +- ...nts-B8x6wOMD.js => Components-B9ZyjeRI.js} | 2 +- .../{index-DbXK0odl.js => index-1mjx3wAv.js} | 2 +- .../{index-N2n19KrF.js => index-Bjqk2TGv.js} | 2 +- ...Ze.js => localSharedImportMap-DS3qfiqR.js} | 2 +- ...CqrW7o8v.js => virtualExposes-jSvr-kK3.js} | 2 +- ...criptSet__customComponents_js-BfZkrlkY.js} | 4 +- admin/custom/customComponents.js | 2 +- admin/tab.html | 2 +- src-admin/src/Components/Map.tsx | 20 ++- 14 files changed, 99 insertions(+), 83 deletions(-) rename admin/assets/{OpenAiDialog-CEA56Rl4.js => OpenAiDialog-CANTLp4d.js} (99%) rename admin/assets/{index-DWalwvIj.js => index-B0ByV4SK.js} (99%) rename admin/assets/{index-Bm6wEaaB.js => index-bny2V8S2.js} (74%) rename admin/assets/{index-C9EIOjDT.js => index-ns4mNOlq.js} (99%) rename admin/custom/assets/{Components-B8x6wOMD.js => Components-B9ZyjeRI.js} (52%) rename admin/custom/assets/{index-DbXK0odl.js => index-1mjx3wAv.js} (95%) rename admin/custom/assets/{index-N2n19KrF.js => index-Bjqk2TGv.js} (99%) rename admin/custom/assets/{localSharedImportMap-2Enh8EZe.js => localSharedImportMap-DS3qfiqR.js} (96%) rename admin/custom/assets/{virtualExposes-CqrW7o8v.js => virtualExposes-jSvr-kK3.js} (68%) rename admin/custom/assets/{virtual_mf-REMOTE_ENTRY_ID_ConfigCustomJavascriptSet__customComponents_js-BZZsMeVW.js => virtual_mf-REMOTE_ENTRY_ID_ConfigCustomJavascriptSet__customComponents_js-BfZkrlkY.js} (99%) diff --git a/README.md b/README.md index 6c781c8a9..1ece4f1cc 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,12 @@ Executes Javascript, Typescript Scripts. --> ### **WORK IN PROGRESS** * (@GermanBluefox) Added support for plain import/export +* (@GermanBluefox) Correcting error in configuration +* (@GermanBluefox) disallow writing into node_modules folder by scripts +* (@GermanBluefox) Correcting start of the script more than one time if restart is triggered +* (@GermanBluefox) All delayed writings are stopped by the script stop +* (@GermanBluefox) Added check if a script has been modified by another user/window +* (@GermanBluefox) Make the instance number more prominent ### 9.1.1 (2026-03-19) * (GermanBluefox) Small GUI optimizations diff --git a/admin/assets/OpenAiDialog-CEA56Rl4.js b/admin/assets/OpenAiDialog-CANTLp4d.js similarity index 99% rename from admin/assets/OpenAiDialog-CEA56Rl4.js rename to admin/assets/OpenAiDialog-CANTLp4d.js index ef766e19c..00aefcbe1 100644 --- a/admin/assets/OpenAiDialog-CEA56Rl4.js +++ b/admin/assets/OpenAiDialog-CANTLp4d.js @@ -1,4 +1,4 @@ -import{c as ie,j as n}from"./createSvgIcon-DPvF8xqu.js";import{j as S,b as H,k as J,c as re}from"./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js";import{_ as F,a as Q,b as Z,i as $,h as X,c as oe,$ as ae,d as ce,e as le,f as de,g as ee}from"./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js";import{_ as l}from"./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js";import{_ as me}from"./preload-helper-BDBacUwf.js";import{C as he,b as ue,R as fe}from"./index-gIA8x-8f.js";import pe from"./ScriptEditorVanillaMonaco-DSYvOslZ.js";import{c as te,I as ge}from"./index-C49cpVll.js";import{h as ye}from"./index-Bm6wEaaB.js";import"./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js";import"./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js";import"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js";import"./inheritsLoose-B0Ba5G9z.js";const ve=ie(n.jsx("path",{d:"M11.07 12.85c.77-1.39 2.25-2.21 3.11-3.44.91-1.29.4-3.7-2.18-3.7-1.69 0-2.52 1.28-2.87 2.34L6.54 6.96C7.25 4.83 9.18 3 11.99 3c2.35 0 3.96 1.07 4.78 2.41.7 1.15 1.11 3.3.03 4.9-1.2 1.77-2.35 2.31-2.97 3.45-.25.46-.35.76-.35 2.24h-2.89c-.01-.78-.13-2.05.48-3.15M14 20c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2"}),"QuestionMark"),je=me(()=>import("./docs-BrInh2Pn.js"),[],import.meta.url);let G=null;async function xe(s){if(G)return G;const f=await s.getObjectViewSystem("state","","香"),r=await s.getObjectViewSystem("channel","","香"),v=await s.getObjectViewSystem("device","","香"),d=await s.getObjectViewSystem("folder","","香"),k=await s.getObjectViewSystem("enum","","香");return G=Object.assign(f,r,v,d,k),G}function V(s,f){return s&&typeof s=="object"?s[f]||s.en:s||""}async function Ie(s){var P,N,L,K;const f=l.I18n.getLanguage(),r=await xe(s),v=Object.keys(r).sort(),d=new he,k=[],A=["UNREACH_STICKY"],W=[ue.Types.info],_=[],b=[],R=[],D=[];v.forEach(m=>{var a,h,c;((a=r[m])==null?void 0:a.type)==="enum"?_.push(m):(c=(h=r[m])==null?void 0:h.common)!=null&&c.smartName&&D.push(m)}),_.forEach(m=>{m.startsWith("enum.rooms.")?b.push(m):m.startsWith("enum.functions.")&&R.push(m);const a=r[m].common.members;a!=null&&a.length&&a.forEach(h=>{r[h]&&(D.includes(h)||D.push(h))})});const M={id:"",objects:r,_keysOptional:v,_usedIdsOptional:k,ignoreIndicators:A,excludedTypes:W},E=[];D.forEach(m=>{M.id=m;const a=d.detect(M);a&&a.forEach(h=>{var w;const c=(w=h.states.find(i=>i.id))==null?void 0:w.id;if(!c||E.find(i=>i.id===c))return;const j=r[c],z={id:c,name:V(j.common.name,f),type:j.type,deviceType:h.type,states:h.states.filter(i=>i.id).map(i=>({id:i.id,name:i.name,role:i.defaultRole,type:r[i.id].common.type,unit:r[i.id].common.unit,read:r[i.id].common.read===void 0?!0:r[i.id].common.read,write:r[i.id].common.write===void 0?!0:r[i.id].common.write}))},T=c.split(".");let e,o;(j.type==="channel"||j.type==="state")&&(T.pop(),e=T.join("."),r[e]&&(r[e].type==="channel"||r[e].type==="folder")?(T.pop(),o=T.join("."),(!r[o]||r[o].type!=="device"&&r[e].type!=="folder")&&(o=void 0)):e=void 0);const I=b.find(i=>{var x,p,t;return(x=r[i].common.members)!=null&&x.includes(c)||e&&((p=r[i].common.members)!=null&&p.includes(e))?!0:o&&((t=r[i].common.members)==null?void 0:t.includes(o))});I&&(z.room=V(r[I].common.name,f));const g=R.find(i=>{var x,p,t;return(x=r[i].common.members)!=null&&x.includes(c)||e&&((p=r[i].common.members)!=null&&p.includes(e))?!0:o&&((t=r[i].common.members)==null?void 0:t.includes(o))});g&&(z.function=V(r[g].common.name,f)),E.push(z)})});for(let m=0;m(await je).default,we={ru:"Russian",en:"English",de:"German",es:"Spanish",fr:"French",it:"Italian",pl:"Polish",nl:"Dutch",pt:"Portuguese",uk:"Ukrainian","zh-cn":"Chinese"},Y={flexShrink:0,opacity:.7},ne={openai:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",style:Y,children:n.jsx("path",{d:"M22.282 9.821a5.985 5.985 0 0 0-.516-4.91 6.046 6.046 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a5.985 5.985 0 0 0-3.998 2.9 6.046 6.046 0 0 0 .743 7.097 5.98 5.98 0 0 0 .51 4.911 6.051 6.051 0 0 0 6.515 2.9A5.985 5.985 0 0 0 13.26 24a6.056 6.056 0 0 0 5.772-4.206 5.99 5.99 0 0 0 3.997-2.9 6.056 6.056 0 0 0-.747-7.073zM13.26 22.43a4.476 4.476 0 0 1-2.876-1.04l.141-.081 4.779-2.758a.795.795 0 0 0 .392-.681v-6.737l2.02 1.168a.071.071 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494zM3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085 4.783 2.759a.771.771 0 0 0 .78 0l5.843-3.369v2.332a.08.08 0 0 1-.033.062L9.74 19.95a4.5 4.5 0 0 1-6.14-1.646zM2.34 7.896a4.485 4.485 0 0 1 2.366-1.973V11.6a.766.766 0 0 0 .388.676l5.815 3.355-2.02 1.168a.076.076 0 0 1-.071 0l-4.83-2.786A4.504 4.504 0 0 1 2.34 7.872zm16.597 3.855-5.833-3.387L15.119 7.2a.076.076 0 0 1 .071 0l4.83 2.791a4.494 4.494 0 0 1-.676 8.105v-5.678a.79.79 0 0 0-.407-.667zm2.01-3.023-.141-.085-4.774-2.782a.776.776 0 0 0-.785 0L9.409 9.23V6.897a.066.066 0 0 1 .028-.061l4.83-2.787a4.5 4.5 0 0 1 6.68 4.66zm-12.64 4.135-2.02-1.164a.08.08 0 0 1-.038-.057V6.075a4.5 4.5 0 0 1 7.375-3.453l-.142.08L8.704 5.46a.795.795 0 0 0-.393.681zm1.097-2.365 2.602-1.5 2.607 1.5v2.999l-2.597 1.5-2.607-1.5z"})}),anthropic:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",style:Y,children:n.jsx("path",{d:"M17.304 3.54h-3.604L7.128 20.46h3.604l1.345-3.462h6.932l1.345 3.462H24L17.304 3.54zm-3.45 10.696 2.647-6.812 2.647 6.812h-5.295zM6.696 3.54H3.092L0 20.46h3.604L6.696 3.54z"})}),gemini:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",style:Y,children:n.jsx("path",{d:"M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0z"})}),deepseek:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",style:Y,children:n.jsx("path",{d:"M5 3h6a9 9 0 0 1 0 18H5V3zm4 14V7h2a5 5 0 0 1 0 10H9z"})})};async function se(s,f){const r=Object.keys(f);for(let v=0;v{const[f,r]=S(window.localStorage.getItem("openai-question")||""),[v,d]=S(""),[k,A]=S(!1),[W,_]=S(!1),[b,R]=S(window.localStorage.getItem("openai-model")||""),[D,M]=S(!1),[E,P]=S([]),[N,L]=S(!0),[K,m]=S(null),a=H(null),h=H(null),c=H({}),j=H(null),z=J(async e=>{L(!0),m(null);try{const o=await se(s.socket,s.runningInstances);if(e!=null&&e.current)return;if(!o){L(!1);return}h.current=o;const I=Object.keys(s.runningInstances)[0];if(!I){m(l.I18n.t("No running javascript instance found")),L(!1);return}const g=[],w={},i=[],x=[],p=(t,B)=>{for(const O of t){const C=O.toLowerCase();C.includes("embedding")||C.includes("moderation")||C.startsWith("dall-e")||C.startsWith("tts-")||C.startsWith("whisper")||C.startsWith("babbage")||C.startsWith("davinci")||C.startsWith("sora")||C.startsWith("omni-moderation")||w[O]||(g.push(O),w[O]=B)}};if((o.gptKey||o.gptBaseUrl)&&x.push(s.socket.sendTo(I,"testApiConnection",{apiKey:o.gptKey,baseUrl:o.gptBaseUrl||"",provider:"openai"}).then(t=>{t.models?p(t.models,"openai"):t.error&&i.push(`OpenAI: ${t.error}`)}).catch(t=>{i.push(`OpenAI: ${String(t)}`)})),o.claudeKey&&x.push(s.socket.sendTo(I,"testApiConnection",{apiKey:o.claudeKey,provider:"anthropic"}).then(t=>{t.models?p(t.models,"anthropic"):t.error&&i.push(`Anthropic: ${t.error}`)}).catch(t=>{i.push(`Anthropic: ${String(t)}`)})),o.geminiKey&&x.push(s.socket.sendTo(I,"testApiConnection",{apiKey:o.geminiKey,provider:"gemini"}).then(t=>{t.models?p(t.models,"gemini"):t.error&&i.push(`Gemini: ${t.error}`)}).catch(t=>{i.push(`Gemini: ${String(t)}`)})),o.deepseekKey&&x.push(s.socket.sendTo(I,"testApiConnection",{apiKey:o.deepseekKey,provider:"deepseek"}).then(t=>{t.models?p(t.models,"deepseek"):t.error&&i.push(`DeepSeek: ${t.error}`)}).catch(t=>{i.push(`DeepSeek: ${String(t)}`)})),await Promise.all(x),e!=null&&e.current)return;if(c.current=w,g.length>0){g.sort(),P(g);const t=window.localStorage.getItem("openai-model");t&&g.includes(t)?R(t):R(g[0])}i.length>0&&m(i.join("; "))}catch(o){console.error("Failed to fetch models:",o),e!=null&&e.current||m(l.I18n.t("Request failed: %s",String(o)))}e!=null&&e.current||L(!1)},[s.socket,s.runningInstances]);re(()=>{const e={current:!1};return z(e),()=>{e.current=!0}},[z]);const T=J(async()=>{let e;a.current?e=a.current:(e=await Ie(s.socket),a.current=e,console.log(`devices: ${JSON.stringify(e,null,2)}`));let o=h.current;o||(o=await se(s.socket,s.runningInstances),h.current=o);let I;if(j.current?I=j.current:(I=await _e(),j.current=I),!o){M(!0);return}const g=c.current[b];if(!g){_(l.I18n.t("Please select a valid model"));return}let w,i;g==="anthropic"?(w=o.claudeKey,i=""):g==="gemini"?(w=o.geminiKey,i=""):g==="deepseek"?(w=o.deepseekKey,i=""):(w=o.gptKey,i=o.gptBaseUrl||"");const x=Object.keys(s.runningInstances)[0];if(!x){_(l.I18n.t("No running javascript instance found"));return}A(!0),_(!1);try{const p=await s.socket.sendTo(x,"chatCompletion",{apiKey:w,baseUrl:i,model:b,provider:g,messages:[{role:"system",content:`You are programmer. Here is a documentation: +import{c as ie,j as n}from"./createSvgIcon-DPvF8xqu.js";import{j as S,b as H,k as J,c as re}from"./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js";import{_ as F,a as Q,b as Z,i as $,h as X,c as oe,$ as ae,d as ce,e as le,f as de,g as ee}from"./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js";import{_ as l}from"./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js";import{_ as me}from"./preload-helper-BDBacUwf.js";import{C as he,b as ue,R as fe}from"./index-gIA8x-8f.js";import pe from"./ScriptEditorVanillaMonaco-DSYvOslZ.js";import{c as te,I as ge}from"./index-C49cpVll.js";import{h as ye}from"./index-bny2V8S2.js";import"./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js";import"./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js";import"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js";import"./inheritsLoose-B0Ba5G9z.js";const ve=ie(n.jsx("path",{d:"M11.07 12.85c.77-1.39 2.25-2.21 3.11-3.44.91-1.29.4-3.7-2.18-3.7-1.69 0-2.52 1.28-2.87 2.34L6.54 6.96C7.25 4.83 9.18 3 11.99 3c2.35 0 3.96 1.07 4.78 2.41.7 1.15 1.11 3.3.03 4.9-1.2 1.77-2.35 2.31-2.97 3.45-.25.46-.35.76-.35 2.24h-2.89c-.01-.78-.13-2.05.48-3.15M14 20c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2"}),"QuestionMark"),je=me(()=>import("./docs-BrInh2Pn.js"),[],import.meta.url);let G=null;async function xe(s){if(G)return G;const f=await s.getObjectViewSystem("state","","香"),r=await s.getObjectViewSystem("channel","","香"),v=await s.getObjectViewSystem("device","","香"),d=await s.getObjectViewSystem("folder","","香"),k=await s.getObjectViewSystem("enum","","香");return G=Object.assign(f,r,v,d,k),G}function V(s,f){return s&&typeof s=="object"?s[f]||s.en:s||""}async function Ie(s){var P,N,L,K;const f=l.I18n.getLanguage(),r=await xe(s),v=Object.keys(r).sort(),d=new he,k=[],A=["UNREACH_STICKY"],W=[ue.Types.info],_=[],b=[],R=[],D=[];v.forEach(m=>{var a,h,c;((a=r[m])==null?void 0:a.type)==="enum"?_.push(m):(c=(h=r[m])==null?void 0:h.common)!=null&&c.smartName&&D.push(m)}),_.forEach(m=>{m.startsWith("enum.rooms.")?b.push(m):m.startsWith("enum.functions.")&&R.push(m);const a=r[m].common.members;a!=null&&a.length&&a.forEach(h=>{r[h]&&(D.includes(h)||D.push(h))})});const M={id:"",objects:r,_keysOptional:v,_usedIdsOptional:k,ignoreIndicators:A,excludedTypes:W},E=[];D.forEach(m=>{M.id=m;const a=d.detect(M);a&&a.forEach(h=>{var w;const c=(w=h.states.find(i=>i.id))==null?void 0:w.id;if(!c||E.find(i=>i.id===c))return;const j=r[c],z={id:c,name:V(j.common.name,f),type:j.type,deviceType:h.type,states:h.states.filter(i=>i.id).map(i=>({id:i.id,name:i.name,role:i.defaultRole,type:r[i.id].common.type,unit:r[i.id].common.unit,read:r[i.id].common.read===void 0?!0:r[i.id].common.read,write:r[i.id].common.write===void 0?!0:r[i.id].common.write}))},T=c.split(".");let e,o;(j.type==="channel"||j.type==="state")&&(T.pop(),e=T.join("."),r[e]&&(r[e].type==="channel"||r[e].type==="folder")?(T.pop(),o=T.join("."),(!r[o]||r[o].type!=="device"&&r[e].type!=="folder")&&(o=void 0)):e=void 0);const I=b.find(i=>{var x,p,t;return(x=r[i].common.members)!=null&&x.includes(c)||e&&((p=r[i].common.members)!=null&&p.includes(e))?!0:o&&((t=r[i].common.members)==null?void 0:t.includes(o))});I&&(z.room=V(r[I].common.name,f));const g=R.find(i=>{var x,p,t;return(x=r[i].common.members)!=null&&x.includes(c)||e&&((p=r[i].common.members)!=null&&p.includes(e))?!0:o&&((t=r[i].common.members)==null?void 0:t.includes(o))});g&&(z.function=V(r[g].common.name,f)),E.push(z)})});for(let m=0;m(await je).default,we={ru:"Russian",en:"English",de:"German",es:"Spanish",fr:"French",it:"Italian",pl:"Polish",nl:"Dutch",pt:"Portuguese",uk:"Ukrainian","zh-cn":"Chinese"},Y={flexShrink:0,opacity:.7},ne={openai:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",style:Y,children:n.jsx("path",{d:"M22.282 9.821a5.985 5.985 0 0 0-.516-4.91 6.046 6.046 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a5.985 5.985 0 0 0-3.998 2.9 6.046 6.046 0 0 0 .743 7.097 5.98 5.98 0 0 0 .51 4.911 6.051 6.051 0 0 0 6.515 2.9A5.985 5.985 0 0 0 13.26 24a6.056 6.056 0 0 0 5.772-4.206 5.99 5.99 0 0 0 3.997-2.9 6.056 6.056 0 0 0-.747-7.073zM13.26 22.43a4.476 4.476 0 0 1-2.876-1.04l.141-.081 4.779-2.758a.795.795 0 0 0 .392-.681v-6.737l2.02 1.168a.071.071 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494zM3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085 4.783 2.759a.771.771 0 0 0 .78 0l5.843-3.369v2.332a.08.08 0 0 1-.033.062L9.74 19.95a4.5 4.5 0 0 1-6.14-1.646zM2.34 7.896a4.485 4.485 0 0 1 2.366-1.973V11.6a.766.766 0 0 0 .388.676l5.815 3.355-2.02 1.168a.076.076 0 0 1-.071 0l-4.83-2.786A4.504 4.504 0 0 1 2.34 7.872zm16.597 3.855-5.833-3.387L15.119 7.2a.076.076 0 0 1 .071 0l4.83 2.791a4.494 4.494 0 0 1-.676 8.105v-5.678a.79.79 0 0 0-.407-.667zm2.01-3.023-.141-.085-4.774-2.782a.776.776 0 0 0-.785 0L9.409 9.23V6.897a.066.066 0 0 1 .028-.061l4.83-2.787a4.5 4.5 0 0 1 6.68 4.66zm-12.64 4.135-2.02-1.164a.08.08 0 0 1-.038-.057V6.075a4.5 4.5 0 0 1 7.375-3.453l-.142.08L8.704 5.46a.795.795 0 0 0-.393.681zm1.097-2.365 2.602-1.5 2.607 1.5v2.999l-2.597 1.5-2.607-1.5z"})}),anthropic:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",style:Y,children:n.jsx("path",{d:"M17.304 3.54h-3.604L7.128 20.46h3.604l1.345-3.462h6.932l1.345 3.462H24L17.304 3.54zm-3.45 10.696 2.647-6.812 2.647 6.812h-5.295zM6.696 3.54H3.092L0 20.46h3.604L6.696 3.54z"})}),gemini:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",style:Y,children:n.jsx("path",{d:"M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0z"})}),deepseek:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",style:Y,children:n.jsx("path",{d:"M5 3h6a9 9 0 0 1 0 18H5V3zm4 14V7h2a5 5 0 0 1 0 10H9z"})})};async function se(s,f){const r=Object.keys(f);for(let v=0;v{const[f,r]=S(window.localStorage.getItem("openai-question")||""),[v,d]=S(""),[k,A]=S(!1),[W,_]=S(!1),[b,R]=S(window.localStorage.getItem("openai-model")||""),[D,M]=S(!1),[E,P]=S([]),[N,L]=S(!0),[K,m]=S(null),a=H(null),h=H(null),c=H({}),j=H(null),z=J(async e=>{L(!0),m(null);try{const o=await se(s.socket,s.runningInstances);if(e!=null&&e.current)return;if(!o){L(!1);return}h.current=o;const I=Object.keys(s.runningInstances)[0];if(!I){m(l.I18n.t("No running javascript instance found")),L(!1);return}const g=[],w={},i=[],x=[],p=(t,B)=>{for(const O of t){const C=O.toLowerCase();C.includes("embedding")||C.includes("moderation")||C.startsWith("dall-e")||C.startsWith("tts-")||C.startsWith("whisper")||C.startsWith("babbage")||C.startsWith("davinci")||C.startsWith("sora")||C.startsWith("omni-moderation")||w[O]||(g.push(O),w[O]=B)}};if((o.gptKey||o.gptBaseUrl)&&x.push(s.socket.sendTo(I,"testApiConnection",{apiKey:o.gptKey,baseUrl:o.gptBaseUrl||"",provider:"openai"}).then(t=>{t.models?p(t.models,"openai"):t.error&&i.push(`OpenAI: ${t.error}`)}).catch(t=>{i.push(`OpenAI: ${String(t)}`)})),o.claudeKey&&x.push(s.socket.sendTo(I,"testApiConnection",{apiKey:o.claudeKey,provider:"anthropic"}).then(t=>{t.models?p(t.models,"anthropic"):t.error&&i.push(`Anthropic: ${t.error}`)}).catch(t=>{i.push(`Anthropic: ${String(t)}`)})),o.geminiKey&&x.push(s.socket.sendTo(I,"testApiConnection",{apiKey:o.geminiKey,provider:"gemini"}).then(t=>{t.models?p(t.models,"gemini"):t.error&&i.push(`Gemini: ${t.error}`)}).catch(t=>{i.push(`Gemini: ${String(t)}`)})),o.deepseekKey&&x.push(s.socket.sendTo(I,"testApiConnection",{apiKey:o.deepseekKey,provider:"deepseek"}).then(t=>{t.models?p(t.models,"deepseek"):t.error&&i.push(`DeepSeek: ${t.error}`)}).catch(t=>{i.push(`DeepSeek: ${String(t)}`)})),await Promise.all(x),e!=null&&e.current)return;if(c.current=w,g.length>0){g.sort(),P(g);const t=window.localStorage.getItem("openai-model");t&&g.includes(t)?R(t):R(g[0])}i.length>0&&m(i.join("; "))}catch(o){console.error("Failed to fetch models:",o),e!=null&&e.current||m(l.I18n.t("Request failed: %s",String(o)))}e!=null&&e.current||L(!1)},[s.socket,s.runningInstances]);re(()=>{const e={current:!1};return z(e),()=>{e.current=!0}},[z]);const T=J(async()=>{let e;a.current?e=a.current:(e=await Ie(s.socket),a.current=e,console.log(`devices: ${JSON.stringify(e,null,2)}`));let o=h.current;o||(o=await se(s.socket,s.runningInstances),h.current=o);let I;if(j.current?I=j.current:(I=await _e(),j.current=I),!o){M(!0);return}const g=c.current[b];if(!g){_(l.I18n.t("Please select a valid model"));return}let w,i;g==="anthropic"?(w=o.claudeKey,i=""):g==="gemini"?(w=o.geminiKey,i=""):g==="deepseek"?(w=o.deepseekKey,i=""):(w=o.gptKey,i=o.gptBaseUrl||"");const x=Object.keys(s.runningInstances)[0];if(!x){_(l.I18n.t("No running javascript instance found"));return}A(!0),_(!1);try{const p=await s.socket.sendTo(x,"chatCompletion",{apiKey:w,baseUrl:i,model:b,provider:g,messages:[{role:"system",content:`You are programmer. Here is a documentation: ${I}`},{role:"system",content:`Here is list of devices: diff --git a/admin/assets/index-DWalwvIj.js b/admin/assets/index-B0ByV4SK.js similarity index 99% rename from admin/assets/index-DWalwvIj.js rename to admin/assets/index-B0ByV4SK.js index c882da958..25e2be3e8 100644 --- a/admin/assets/index-DWalwvIj.js +++ b/admin/assets/index-B0ByV4SK.js @@ -1 +1 @@ -import{j as n}from"./createSvgIcon-DPvF8xqu.js";import{c as E,h as yt,j as M,m as nt,k as lt,l as Dt,b as ut,o as xt}from"./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js";import{_ as u}from"./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js";import{u as kt,a as St,M as Y,C as et,G as Nt,b as $t,c as bt,I as qt,S as J,d as Bt,e as ft,j as Mt,D as Ht,f as Wt}from"./index-Bm6wEaaB.js";import{_ as wt,b as Ct,h as vt,i as jt,p as Tt,f as Et,g as mt,o as Pt,Y as Ut,Z as Ft,C as Jt,D as st}from"./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js";import{I as Lt}from"./index-C49cpVll.js";import"./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js";import"./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js";import"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js";import"./preload-helper-BDBacUwf.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js";import"./inheritsLoose-B0Ba5G9z.js";function zt(e){const s=kt().getMonitor(),[i,a]=St(s,e);return E(()=>s.subscribeToOffsetChange(a)),E(()=>s.subscribeToStateChange(a)),i}let V;function Gt(){return V||(V=new Image,V.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),V}const Kt="_wrapperRules_nnott_1",Qt="_rootWrapper_nnott_9",Yt="_addClass_nnott_14",ot={wrapperRules:Kt,rootWrapper:Qt,addClass:Yt},Zt="_switchesItem_10ls3_1",Xt="_switchesItemActive_10ls3_28",Vt="_iconTheme_10ls3_36",it={switchesItem:Zt,switchesItemActive:Xt,iconTheme:Vt},It=({name:e,id:t,active:s,icon:i,adapter:a,socket:o,onDoubleClick:c,title:l,onTouchMove:d,style:j})=>n.jsxs("div",{onDoubleClick:c,onTouchMove:d,title:l?u.I18n.t(l):void 0,className:u.Utils.clsx(it.switchesItem,s&&it.switchesItemActive,`block-${t}`),children:[n.jsx(Y,{iconName:i,className:it.iconTheme,adapter:a,socket:o,style:j}),n.jsx("span",{children:e?u.I18n.t(e):""})]},t),Rt="_cardStyle_8rq8v_1",tn="_cardStyleActive_8rq8v_17",nn="_controlMenu_8rq8v_22",en="_closeBtn_8rq8v_31",sn="_isDelete_8rq8v_73",on="_drag_mobile_8rq8v_90",G={cardStyle:Rt,cardStyleActive:tn,controlMenu:nn,closeBtn:en,isDelete:sn,drag_mobile:on};function K(e,t,s){let i;switch(e){case"actions":if(s==="else")return i={...t,actions:{...t[e],else:[...t[e].else]}},i;if(s==="then")return i={...t,actions:{...t[e],then:[...t[e].then]}},i;throw console.error(`Unknown additionalParameter: ${s}`),new Error(`Unknown additionalParameter: ${s}`);case"triggers":return i={...t,triggers:[...t.triggers]},i;case"conditions":return i={...t,conditions:[...t.conditions]},i;default:throw new Error(`Unknown name: ${e}`)}}function z(e,t,s,i){var a;switch(e){case"actions":return t.actions[s]=t.actions[s].filter(o=>o._id!==i),t;case"conditions":return t.conditions[s]=(a=t.conditions[s])==null?void 0:a.filter(o=>o._id!==i),t;default:return t.triggers=t.triggers.filter(o=>o._id!==i),t}}function cn(e,t,s){const{_id:i,acceptedBy:a}=e;let o;if(!a||!t[a])return console.warn(`Cannot find ${a}`),t;switch(a){case"actions":if(o=t.actions[s].find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=t.actions[s].indexOf(o);t.actions[s][c]=e}return t;case"conditions":if(o=t.conditions[s].find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=t.conditions[s].indexOf(o);t.conditions[s][c]=e}return t;default:if(o=t.triggers.find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=t.triggers.indexOf(o);t.triggers[c]=e}return t}}const Ot=yt(e=>{var N;const{setUserRules:t,userRules:s,_id:i,id:a,blockValue:o,active:c,acceptedBy:l,isTourOpen:d,setTourStep:j,tourStep:O}=e,[I,_]=M(null),{blocks:r,socket:k,onUpdate:H,setOnUpdate:w,onDebugMessage:f,enableSimulation:x}=nt(et),p=lt(h=>r==null?void 0:r.find(b=>b.getStaticData().id===h),[r]),g=lt(h=>{const b=cn(h,s,o);b&&t(b)},[s]),C=h=>{h.currentTarget!==I&&_(h.currentTarget)},q=()=>_(null),T=Dt(()=>{const h=p(a)||Nt;return n.jsx(h,{...e,notFound:!p(a),isTourOpen:d,setTourStep:j,tourStep:O,onUpdate:H,setOnUpdate:w,enableSimulation:x,onDebugMessage:f,onChange:g,className:void 0,socket:k})},[s,H,f,x]),[S,B]=M(!1);return n.jsxs("div",{onMouseMove:C,onMouseEnter:C,onMouseLeave:q,onMouseDown:h=>{if(h.ctrlKey){let b;const v=K(l,s,o);l==="conditions"?(b=v.conditions[o].find(m=>m._id===i),b&&v.conditions[o].splice(v.conditions[o].indexOf(b),0,{...b,_id:Date.now()})):l==="actions"?(b=v.actions[o].find(m=>m._id===i),b&&v.actions[o].splice(v.actions[o].indexOf(b),0,{...b,_id:Date.now()})):(b=v.triggers.find(m=>m._id===i),b&&v.triggers.splice(v[l].indexOf(b),0,{...b,_id:Date.now()})),t(v)}},id:"height",style:c?{width:(((N=document.getElementById("width"))==null?void 0:N.clientWidth)||0)-70}:void 0,className:`${G.cardStyle} ${c?G.cardStyleActive:null} ${S?G.isDelete:null}`,children:[n.jsx("div",{className:G.drag_mobile}),T,t&&n.jsx("div",{className:G.controlMenu,style:I?{opacity:1}:{opacity:0},children:n.jsx("div",{onClick:()=>{let h=K(l,s,o);h=z(l,h,o,i),B(!0),setTimeout(()=>{l==="triggers"&&w(!0),t(h)},300)},className:G.closeBtn})})]})}),rn={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},an=(e,t,s)=>{if(!e||!t)return{display:"none"};let{x:i,y:a}=t;const o=`translate(${i}px, ${a}px)`;return{transform:o,WebkitTransform:o}},ln=e=>{const{itemType:t,isDragging:s,item:i,initialOffset:a,currentOffset:o,targetIds:c}=zt(d=>({item:d.getItem(),itemType:d.getItemType(),initialOffset:d.getInitialSourceClientOffset(),currentOffset:d.getSourceClientOffset(),isDragging:d.isDragging(),targetIds:d.getTargetIds()})),l=()=>t==="box"?c.length?n.jsx(Ot,{active:!0,...i,allBlocks:e.allBlocks}):n.jsx(It,{active:!0,...i,socket:e.socket}):null;return s?n.jsx("div",{style:rn,children:n.jsx("div",{style:an(a,o),children:l()})}):null},dn="_border_wrpm3_1",fn="_emptyBlockStyle_wrpm3_6",mn="_emptyBlock_wrpm3_6",gn="_selectOnChange_wrpm3_22",hn="_selectOnChangeHelp_wrpm3_28",_n="_selectOnChangeHelpIcon_wrpm3_34",pn="_emptyBlockNone_wrpm3_49",un="_mainBlockItemRules_wrpm3_55",xn="_nameBlockItems_wrpm3_63",bn="_contentBlockItem_wrpm3_73",wn="_wrapperMargin_wrpm3_81",Cn="_contentHeightOn_wrpm3_87",vn="_contentHeightOff_wrpm3_99",jn="_cardAdd_wrpm3_105",In="_blockCardAdd_wrpm3_125",On="_addClassOverflow_wrpm3_136",An="_addClassHeight_wrpm3_140",D={border:dn,emptyBlockStyle:fn,emptyBlock:mn,selectOnChange:gn,selectOnChangeHelp:hn,selectOnChangeHelpIcon:_n,emptyBlockNone:pn,mainBlockItemRules:un,nameBlockItems:xn,contentBlockItem:bn,wrapperMargin:wn,contentHeightOn:Cn,contentHeightOff:vn,cardAdd:jn,blockCardAdd:In,addClassOverflow:On,addClassHeight:An};function dt(e,t){const[s,i]=M(window.localStorage.getItem(t)?JSON.parse(window.localStorage.getItem(t)||""):e);return[s,o=>{window.localStorage.setItem(t,JSON.stringify(o)),i(o)},!!window.localStorage.getItem(t)]}function yn(e,t){let s=0,i=null,a;return function(...o){const c=Date.now();a=o,c-s>=t?(s=c,e.apply(this,o)):i||(i=setTimeout(()=>{s=Date.now(),i=null,e.apply(this,a)},t-(c-s)))}}function tt(e){if(Array.isArray(e))return e.map(t=>tt(t));if(typeof e=="function")return e.bind(null);if(e&&typeof e=="object"){const t={};return Object.keys(e).forEach(s=>{t[s]=tt(e[s])}),t}return e}const ct=yn((e,t)=>e(t),0);function R(e,t){const s=t.find(i=>i._id===e);return{card:s,index:s?t.indexOf(s):-1}}function rt(e,t,s,i,a,o,c,l,d){const{card:j,index:O}=R(e,s);if(!(Ot&&l>d)&&j&&O!==t){const I=tt(s);I.splice(O,1),I.splice(t,0,j);const _=tt(a);switch(o){case"actions":_.actions[c]=I,ct(i,_);return;case"conditions":_.conditions[c]=I,ct(i,_);return;default:_.triggers=I,ct(i,_);return}}}const Dn="_drag_7xfhc_1",kn="_root_7xfhc_11",gt={drag:Dn,root:kn},At=({typeBlock:e,allProperties:t,id:s,isActive:i,setUserRules:a,userRules:o,children:c,_id:l,blockValue:d})=>{const{setOnUpdate:j}=nt(et),[{opacity:O},I,_]=$t({type:"box",item:()=>({...t,id:s,isActive:i,_id:l}),end:(w,f)=>{const{acceptedBy:x}=w,p=f.getDropResult();let g;if(!p)return typeof l=="number"&&!f.getTargetIds().length&&(g=K(x,o,d),g=z(x,g,d,l),a(g)),null;if(p.blockValue!==d){const C=typeof l=="number"?l:Date.now();g=K(x,o,p.blockValue);const q={id:w.id,acceptedBy:w.acceptedBy};switch(x){case"actions":return d&&(g=z("actions",g,d,C)),g=z("actions",g,p.blockValue,C),g.actions[p.blockValue].push({...q,_id:C}),a(g);case"conditions":return typeof d=="number"&&(g=z("conditions",g,d,C)),g=z("conditions",g,p.blockValue,C),g.conditions[p.blockValue].push({...q,_id:C}),a(g);default:return j(!0),g=z("triggers",g,p.blockValue,C),g.triggers.push({...q,_id:C}),a(g)}}},collect:w=>({opacity:w.isDragging()?.4:1,isDragging:w.isDragging()})}),r=ut(null),[,k]=bt({accept:"box",canDrop:()=>!1,hover({_id:w,acceptedBy:f},x){var T;if(!r.current||e!==f)return;const p=(T=r.current)==null?void 0:T.getBoundingClientRect(),g=(p.bottom-p.top)/2,C=x.getClientOffset(),q=((C==null?void 0:C.y)||0)-p.top;if(l&&w!==l)switch(f){case"actions":if(d==="then"||d==="else"){const{index:S}=R(l,o.actions[d]);S!==w&&rt(w,S,o[f][d],a,o,f,d,q,g)}return;case"conditions":if(typeof d=="number"){const{index:S}=R(l,o[f][d]);S!==w&&rt(w,S,o[f][d],a,o,f,d,q,g)}return;default:{const{index:S}=R(l,o[f]);S!==w&&rt(w,S,o[f],a,o,f,void 0,q,g);return}}}});E(()=>{_(Gt(),{captureDraggingState:!0})},[]),I(k(r));const H=window.innerWidth<600;return n.jsxs("div",{ref:H&&l?null:r,className:gt.root,style:{opacity:O},children:[n.jsx("div",{className:l?gt.drag:null,ref:l&&H?r:null}),c]})},Sn=({onClose:e,open:t})=>n.jsxs(wt,{open:t,onClose:e,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[n.jsx(Ct,{children:n.jsxs("div",{style:{fontSize:"1rem",fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif',fontWeight:400,lineHeight:1.5,letterSpacing:"0.00938em"},children:[n.jsx("h3",{children:u.I18n.t("On condition change")}),n.jsx("div",{children:u.I18n.t("help_on_change")}),n.jsx("h3",{children:u.I18n.t("Just check")}),n.jsx("div",{children:u.I18n.t("help_just_check")})]})}),n.jsx(vt,{children:n.jsx(jt,{onClick:e,color:"primary",autoFocus:!0,startIcon:n.jsx(Lt,{}),children:u.I18n.t("OK")})})]}),Nn=({onClose:e,open:t})=>n.jsxs(wt,{open:t,onClose:e,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[n.jsx(Ct,{children:n.jsxs(Tt,{id:"alert-dialog-description",children:[n.jsx("h3",{children:u.I18n.t("On condition change")}),n.jsx("div",{children:u.I18n.t("help_on_change")}),n.jsx("h3",{children:u.I18n.t("Just check")}),n.jsx("div",{children:u.I18n.t("help_just_check")})]})}),n.jsx(vt,{children:n.jsx(jt,{onClick:e,color:"primary",autoFocus:!0,children:u.I18n.t("OK")})})]}),ht=({size:e,blockValue:t,boolean:s,typeBlock:i,userRules:a,setUserRules:o,animation:c,setTourStep:l,tourStep:d,isTourOpen:j,theme:O,themeType:I,themeName:_})=>{var W;const[r,k]=M(!1),[H,w]=M(!1),[f,x]=M(!1),[p,g]=M("");s===void 0&&(s=!0);const C=bt({accept:"box",drop:()=>({blockValue:t}),hover:({acceptedBy:A,_id:L},Z)=>{k(A===i),x(!!L),g(Z.getHandlerId()||"")},canDrop:({acceptedBy:A})=>(w(A===i),A===i),collect:A=>{var L;return{isOver:A.isOver(),canDrop:((L=A.getItem())==null?void 0:L.acceptedBy)===i,offset:A.getClientOffset(),targetId:A.getHandlerId()}}}),q=C[0],{canDrop:T,isOver:S,offset:B,targetId:N}=q,h=C[1];E(()=>{g("")},[B]);const b=T&&S;let v="";b?v=r?"#00fb003d":"#fb00002e":T?v=H?"#00fb003d":"#fb00002e":B&&(v=N===p?"#fb00002e":"");let m;return i==="actions"?m=a.actions[t]:i==="conditions"?m=a.conditions[t]:m=a.triggers,n.jsx("div",{ref:h,style:{backgroundColor:v},className:`${u.Utils.clsx(D.contentBlockItem,e&&D.addClassHeight)} ${s?c?D.contentHeightOn:null:D.contentHeightOff}`,children:n.jsxs("div",{className:D.wrapperMargin,children:[m.map(A=>n.jsx(At,{typeBlock:i,...A,blockValue:t,allProperties:A,userRules:a,setUserRules:o,children:n.jsx(Ot,{...A,isTourOpen:j,setTourStep:l,tourStep:d,settings:A,blockValue:t,userRules:a,setUserRules:o,theme:O,themeType:I,themeName:_})},A._id)),n.jsx("div",{style:b&&r&&!f?{height:((W=document.getElementById("height"))==null?void 0:W.clientHeight)||200}:void 0,className:`${D.emptyBlockStyle} ${b&&r&&!f?D.emptyBlock:D.emptyBlockNone}`})]})})},at=({size:e,typeBlock:t,name:s,nameAdditionally:i,additionally:a,border:o,userRules:c,setUserRules:l,iconName:d,adapter:j,socket:O,setTourStep:I,tourStep:_,isTourOpen:r,theme:k,themeType:H,themeName:w})=>{const[f,x,p]=dt(t==="actions"?!1:[],`additionallyClickItems_${t}`),[g,C]=M(!1),[q,T]=M(!1);E(()=>{if(t==="conditions"&&(f==null?void 0:f.length)!==c.conditions.length-1){const N=[];c.conditions.forEach((h,b)=>{b>0&&N.push({_id:Date.now(),open:!0})}),x([...f,...N])}t==="actions"&&!p&&c.actions.else.length&&x(!0)},[]);const[S,B]=M(!1);return n.jsxs("div",{className:`${u.Utils.clsx(D.mainBlockItemRules,e&&D.addClassOverflow)} ${o&&!e?D.border:null}`,children:[n.jsxs("span",{id:"width",className:D.nameBlockItems,children:[n.jsx(Y,{iconName:d,className:D.iconThemCard,adapter:j,socket:O}),s]}),t==="conditions"?n.jsxs("div",{style:{width:"100%"},children:[n.jsxs(Et,{variant:"standard",className:D.selectOnChange,value:c.justCheck||!1,onChange:N=>{const h=K("conditions",c);h.justCheck=N.target.value==="true",l(h)},children:[n.jsx(mt,{value:"false",children:u.I18n.t("on condition change")}),n.jsx(mt,{value:"true",children:u.I18n.t("just check")})]}),n.jsx(Pt,{size:"small",title:u.I18n.t("Explanation"),className:D.selectOnChangeHelp,onClick:()=>C(!0),children:n.jsx(qt,{className:D.selectOnChangeHelpIcon})})]}):null,n.jsx(ht,{setTourStep:I,tourStep:_,isTourOpen:r,blockValue:t==="actions"?"then":t==="conditions"?0:t,typeBlock:t,setUserRules:l,userRules:c,theme:k,themeName:w,themeType:H,size:e}),a&&[...Array(t==="actions"?1:c.conditions.length-1)].map((N,h)=>{const b=(v=h)=>t==="actions"?!!f:!!f.find((m,W)=>W===v&&m.open);return n.jsxs(xt,{children:[n.jsxs("div",{onClick:()=>{if(t==="actions")return x(!f),null;let v=JSON.parse(JSON.stringify(f));if(c.conditions[h+1].length)return v[h].open=!v[h].open,x(v),null;v=v.filter((m,W)=>W!==h),x(v),B(h),setTimeout(()=>{B(!1),l({...c,conditions:[...c.conditions.filter((m,W)=>W!==h+1)]})},250)},className:D.blockCardAdd,children:[b()?"-":"+",n.jsx("div",{className:D.cardAdd,children:i})]},h),n.jsx(ht,{blockValue:t==="actions"?"else":t==="conditions"?h+1:t,typeBlock:t,setUserRules:l,userRules:c,boolean:b(),animation:S===h,size:e,theme:k,themeName:w,themeType:H})]},`${h}_block_${t}`)}),a&&t==="conditions"&&n.jsxs("div",{onClick:()=>{x([...f,{_id:Date.now(),open:!0}]),l({...c,conditions:[...c.conditions,[]]}),B(c.conditions.length-1),setTimeout(()=>B(!1),1e3)},className:D.blockCardAdd,children:["+",n.jsx("div",{className:D.cardAdd,children:i})]}),n.jsx(Sn,{open:g,onClose:()=>C(!1)}),n.jsx(Nn,{open:q,onClose:()=>T(!1)})]})},$n="_menuRules_1qqcb_1",qn="_switchesRenderWrapper_1qqcb_13",Bn="_menuOff_1qqcb_22",Mn="_menuTitle_1qqcb_28",Hn="_marginAuto_1qqcb_42",Wn="_inputWidth_1qqcb_47",Tn="_menuWrapper_1qqcb_52",En="_hamburgerWrapper_1qqcb_57",Pn="_hamburgerOff_1qqcb_74",Un="_nothingFound_1qqcb_82",Fn="_resetSearch_1qqcb_89",Jn="_controlPanel_1qqcb_101",Ln="_controlPanelAppBar_1qqcb_112",zn="_addClassMenu_1qqcb_126",Gn="_addClassBackground_1qqcb_132",Kn="_addClassPosition_1qqcb_136",$={menuRules:$n,switchesRenderWrapper:qn,menuOff:Bn,menuTitle:Mn,marginAuto:Hn,inputWidth:Wn,menuWrapper:Tn,hamburgerWrapper:En,hamburgerOff:Pn,nothingFound:Un,resetSearch:Fn,controlPanel:Jn,controlPanelAppBar:Ln,addClassMenu:zn,addClassBackground:Gn,addClassPosition:Kn},Qn=e=>{const{allProperties:t,allProperties:{acceptedBy:s,id:i},setUserRules:a,userRules:o,setTourStep:c,tourStep:l,isTourOpen:d,onTouchMove:j,isActive:O}=e;return n.jsx(At,{allProperties:t,id:t.id,isActive:O,setUserRules:a,userRules:o,children:n.jsx(It,{onDoubleClick:()=>{d&&l===J.addScheduleByDoubleClick&&i==="TriggerScheduleBlock"&&c(J.openTagsMenu),d&&l===J.addActionPrintText&&i==="ActionPrintText"&&c(J.showJavascript);const I=Date.now();let _;switch(s){case"actions":_="then";break;case"conditions":_=o[s].length-1;break}const r=K(s,o,_),k={id:i,_id:I,acceptedBy:s};_!==void 0?s==="actions"?r.actions[_].push({...k}):s==="conditions"&&r.conditions[_].push({...k}):r.triggers.push({...k}),a(r)},...e,...t,onTouchMove:j})})},Yn="_hamburgerMenu_hqnsm_8",Zn="_animate_hqnsm_21",_t={hamburgerMenu:Yn,animate:Zn};function Xn({bool:e}){return n.jsx("div",{className:`${_t.hamburgerMenu} ${e?_t.animate:""}`})}const Vn=({addClass:e,setAllBlocks:t,allBlocks:s,userRules:i,onChangeBlocks:a,setTourStep:o,tourStep:c,isTourOpen:l})=>{const{blocks:d,socket:j}=nt(et),[O,I]=dt(!1,"hamburgerOnOff"),[_,r]=dt({text:"",type:"triggers",index:0},"filterControlPanel"),k=(f=_.text,x=_.type)=>{if(!d)return;let p=[...d];p=p.filter(g=>{if(!f)return!0;const{name:C}=g.getStaticData();return C&&u.I18n.t(C).toLowerCase().includes(f.toLowerCase())}),p=p.filter(g=>x===g.getStaticData().acceptedBy),t(p)},H=(f,x)=>{l&&x===0&&c===J.selectTriggers&&o(J.addScheduleByDoubleClick),l&&x===2&&c===J.selectActions&&o(J.addActionPrintText),r({..._,index:x,type:["triggers","conditions","actions"][x]}),k(_.text,["triggers","conditions","actions"][x])},w=f=>({id:`scrollable-force-tab-${f}`,"aria-controls":`scrollable-force-tabpanel-${f}`});return E(()=>{k()},[d]),n.jsx(Ut,{mouseEvent:!1,touchEvent:"onTouchStart",onClickAway:()=>I(!0),children:n.jsxs("div",{className:u.Utils.clsx($.menuWrapper,e[1035]&&$.addClassMenu),children:[n.jsx("div",{className:`${$.hamburgerWrapper} ${O?$.hamburgerOff:null}`,onClick:()=>I(!O),children:n.jsx(Xn,{bool:!O})}),n.jsxs("div",{className:`${u.Utils.clsx($.menuRules,e[1035]&&$.addClassBackground,e[835]&&$.addClassPosition)} ${O?$.menuOff:null}`,children:[n.jsx("div",{className:$.controlPanel,children:n.jsx(Ft,{className:$.controlPanelAppBar,position:"static",children:n.jsxs(Jt,{value:_.index,onChange:H,children:[n.jsx(st,{className:"blocks-triggers",title:u.I18n.t("Triggers"),icon:n.jsx(Y,{iconName:"FlashOn"}),...w(0)}),n.jsx(st,{title:u.I18n.t("Conditions"),className:"blocks-conditions",icon:n.jsx(Y,{iconName:"Help"}),...w(1)}),n.jsx(st,{title:u.I18n.t("Actions"),className:"blocks-actions",icon:n.jsx(Y,{iconName:"PlayForWork"}),...w(2)})]})})}),n.jsx("div",{className:$.switchesRenderWrapper,children:n.jsxs("span",{children:[s.map(f=>{const{name:x,id:p,icon:g,adapter:C}=f.getStaticData();return n.jsx(xt,{children:n.jsx(Qn,{adapter:C,allProperties:f.getStaticData(),icon:g,id:p,isActive:!1,isTourOpen:l,name:x,onTouchMove:()=>I(!0),setTourStep:o,setUserRules:a,socket:j,tourStep:c,userRules:i})},p)}),!s.length&&n.jsxs("div",{className:$.nothingFound,children:[u.I18n.t("Nothing found"),"...",n.jsx("div",{className:$.resetSearch,onClick:()=>{r({..._,text:""}),k("")},children:u.I18n.t("reset search")})]})]})}),n.jsx("div",{className:u.Utils.clsx($.menuTitle,$.marginAuto)}),n.jsx(Bt,{className:$.inputWidth,fullWidth:!0,customValue:!0,value:_.text,size:"small",autoComplete:"off",label:u.I18n.t("search"),variant:"outlined",onChange:f=>{r({..._,text:f}),k(f)}})]})]})})};let pt=[];const me=({code:e,onChange:t,themeName:s,themeType:i,theme:a,setTourStep:o,tourStep:c,isTourOpen:l,command:d,scriptId:j,changed:O,running:I})=>{var v;const{blocks:_,socket:r,setOnUpdate:k,setOnDebugMessage:H,setEnableSimulation:w}=nt(et),[f,x]=M([]),[p,g]=M(ft(e)),[C,q]=M(""),[T,S]=M(!1);E(()=>{let m,W;const A=(P,y)=>{P===`${m}.alive`&&W!==(y==null?void 0:y.val)&&(W=!!(y!=null&&y.val),W&&m&&(r==null||r.sendTo(m.replace(/^system\.adapter\./,""),"rulesOn",j)))},L=(P,y)=>{var U,Q;r&&m!==((U=y==null?void 0:y.common)==null?void 0:U.engine)&&(m&&(r.unsubscribeState(`${m}.alive`,A),W&&r.sendTo(m.replace(/^system\.adapter\./,""),"rulesOn",j)),m=(Q=y==null?void 0:y.common)==null?void 0:Q.engine,m&&m&&r.subscribeState(`${m}.alive`,A))},Z=(P,y)=>{if(y)try{const U=JSON.parse(y.val),Q=Date.now();if(U.ruleId===j&&Q-U.ts<1e3){const F=[...pt,{blockId:U.blockId,data:U.data,ts:U.ts}];F.length>200&&F.splice(0,200-F.length);for(let X=F.length-1;X>=0;X--)if(F[X].ts{var y;m=(y=P==null?void 0:P.common)==null?void 0:y.engine,r.subscribeObject(j,L),m&&(r.subscribeState(`${m}.alive`,A),r.subscribeState(`${m.replace(/^system\.adapter\./,"")}.debug.rules`,Z))}),function(){r==null||r.unsubscribeObject(j,L),m&&(r==null||r.unsubscribeState(`${m}.alive`,A),W&&(r==null||r.sendTo(m.replace(/^system\.adapter\./,""),"rulesOff",j)),r==null||r.unsubscribeState(`${m.replace(/^system\.adapter\./,"")}.debug.rules`,Z))}},[]),E(()=>{w(!O&&I)},[O,I,w]),E(()=>{d&&(q(d),T||S(!0))},[d]),E(()=>{const m=ft(e);JSON.stringify(m)!==JSON.stringify(p)&&(g(m),k(!0))},[e]),E(()=>{document.getElementsByTagName("HTML")[0].className=s||"blue"},[s]);const B=lt(m=>{g(m),_&&t(Mt(m,_))},[_,t]),N=ut(null),[h,b]=M({835:!1,1035:!1});return E(()=>{N.current&&(N.current.clientWidth<=1035&&b({835:!1,1035:!0}),N.current.clientWidth<=835&&b({1035:!0,835:!0}),N.current.clientWidth>1035&&b({835:!1,1035:!1}))},[((v=N.current)==null?void 0:v.clientWidth)||0]),!_||!r?null:n.jsxs("div",{className:ot.wrapperRules,ref:N,children:[n.jsx(ln,{allBlocks:f,socket:r}),T?C==="export"?n.jsx(Ht,{scriptId:j,themeType:i,onClose:()=>S(!1),text:JSON.stringify(p,null,2)}):n.jsx(Wt,{themeType:i,onClose:m=>{S(!1),m&&B(JSON.parse(m))}}):null,n.jsxs("div",{className:u.Utils.clsx(ot.rootWrapper,h[835]&&ot.addClass),children:[n.jsx(Vn,{setAllBlocks:x,allBlocks:f,userRules:p,onChangeBlocks:B,setTourStep:o,tourStep:c,addClass:h,isTourOpen:l}),n.jsx(at,{socket:r,setUserRules:B,userRules:p,isTourOpen:l,setTourStep:o,tourStep:c,name:`${u.I18n.t("when")}...`,typeBlock:"triggers",iconName:"FlashOn",size:h[835],themeType:i,themeName:s,theme:a}),n.jsx(at,{socket:r,setUserRules:B,isTourOpen:l,setTourStep:o,tourStep:c,userRules:p,name:`...${u.I18n.t("and")}...`,typeBlock:"conditions",iconName:"Help",nameAdditionally:u.I18n.t("or"),additionally:!0,border:!0,size:h[835],themeType:i,themeName:s,theme:a}),n.jsx(at,{socket:r,setUserRules:B,isTourOpen:l,setTourStep:o,tourStep:c,userRules:p,name:`...${u.I18n.t("then")}`,typeBlock:"actions",iconName:"PlayForWork",nameAdditionally:u.I18n.t("else"),additionally:!0,size:h[835],themeType:i,themeName:s,theme:a})]})]},"rulesEditor")};export{me as default}; +import{j as n}from"./createSvgIcon-DPvF8xqu.js";import{c as E,h as yt,j as M,m as nt,k as lt,l as Dt,b as ut,o as xt}from"./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js";import{_ as u}from"./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js";import{u as kt,a as St,M as Y,C as et,G as Nt,b as $t,c as bt,I as qt,S as J,d as Bt,e as ft,j as Mt,D as Ht,f as Wt}from"./index-bny2V8S2.js";import{_ as wt,b as Ct,h as vt,i as jt,p as Tt,f as Et,g as mt,o as Pt,Y as Ut,Z as Ft,C as Jt,D as st}from"./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js";import{I as Lt}from"./index-C49cpVll.js";import"./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js";import"./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js";import"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js";import"./preload-helper-BDBacUwf.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js";import"./inheritsLoose-B0Ba5G9z.js";function zt(e){const s=kt().getMonitor(),[i,a]=St(s,e);return E(()=>s.subscribeToOffsetChange(a)),E(()=>s.subscribeToStateChange(a)),i}let V;function Gt(){return V||(V=new Image,V.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),V}const Kt="_wrapperRules_nnott_1",Qt="_rootWrapper_nnott_9",Yt="_addClass_nnott_14",ot={wrapperRules:Kt,rootWrapper:Qt,addClass:Yt},Zt="_switchesItem_10ls3_1",Xt="_switchesItemActive_10ls3_28",Vt="_iconTheme_10ls3_36",it={switchesItem:Zt,switchesItemActive:Xt,iconTheme:Vt},It=({name:e,id:t,active:s,icon:i,adapter:a,socket:o,onDoubleClick:c,title:l,onTouchMove:d,style:j})=>n.jsxs("div",{onDoubleClick:c,onTouchMove:d,title:l?u.I18n.t(l):void 0,className:u.Utils.clsx(it.switchesItem,s&&it.switchesItemActive,`block-${t}`),children:[n.jsx(Y,{iconName:i,className:it.iconTheme,adapter:a,socket:o,style:j}),n.jsx("span",{children:e?u.I18n.t(e):""})]},t),Rt="_cardStyle_8rq8v_1",tn="_cardStyleActive_8rq8v_17",nn="_controlMenu_8rq8v_22",en="_closeBtn_8rq8v_31",sn="_isDelete_8rq8v_73",on="_drag_mobile_8rq8v_90",G={cardStyle:Rt,cardStyleActive:tn,controlMenu:nn,closeBtn:en,isDelete:sn,drag_mobile:on};function K(e,t,s){let i;switch(e){case"actions":if(s==="else")return i={...t,actions:{...t[e],else:[...t[e].else]}},i;if(s==="then")return i={...t,actions:{...t[e],then:[...t[e].then]}},i;throw console.error(`Unknown additionalParameter: ${s}`),new Error(`Unknown additionalParameter: ${s}`);case"triggers":return i={...t,triggers:[...t.triggers]},i;case"conditions":return i={...t,conditions:[...t.conditions]},i;default:throw new Error(`Unknown name: ${e}`)}}function z(e,t,s,i){var a;switch(e){case"actions":return t.actions[s]=t.actions[s].filter(o=>o._id!==i),t;case"conditions":return t.conditions[s]=(a=t.conditions[s])==null?void 0:a.filter(o=>o._id!==i),t;default:return t.triggers=t.triggers.filter(o=>o._id!==i),t}}function cn(e,t,s){const{_id:i,acceptedBy:a}=e;let o;if(!a||!t[a])return console.warn(`Cannot find ${a}`),t;switch(a){case"actions":if(o=t.actions[s].find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=t.actions[s].indexOf(o);t.actions[s][c]=e}return t;case"conditions":if(o=t.conditions[s].find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=t.conditions[s].indexOf(o);t.conditions[s][c]=e}return t;default:if(o=t.triggers.find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=t.triggers.indexOf(o);t.triggers[c]=e}return t}}const Ot=yt(e=>{var N;const{setUserRules:t,userRules:s,_id:i,id:a,blockValue:o,active:c,acceptedBy:l,isTourOpen:d,setTourStep:j,tourStep:O}=e,[I,_]=M(null),{blocks:r,socket:k,onUpdate:H,setOnUpdate:w,onDebugMessage:f,enableSimulation:x}=nt(et),p=lt(h=>r==null?void 0:r.find(b=>b.getStaticData().id===h),[r]),g=lt(h=>{const b=cn(h,s,o);b&&t(b)},[s]),C=h=>{h.currentTarget!==I&&_(h.currentTarget)},q=()=>_(null),T=Dt(()=>{const h=p(a)||Nt;return n.jsx(h,{...e,notFound:!p(a),isTourOpen:d,setTourStep:j,tourStep:O,onUpdate:H,setOnUpdate:w,enableSimulation:x,onDebugMessage:f,onChange:g,className:void 0,socket:k})},[s,H,f,x]),[S,B]=M(!1);return n.jsxs("div",{onMouseMove:C,onMouseEnter:C,onMouseLeave:q,onMouseDown:h=>{if(h.ctrlKey){let b;const v=K(l,s,o);l==="conditions"?(b=v.conditions[o].find(m=>m._id===i),b&&v.conditions[o].splice(v.conditions[o].indexOf(b),0,{...b,_id:Date.now()})):l==="actions"?(b=v.actions[o].find(m=>m._id===i),b&&v.actions[o].splice(v.actions[o].indexOf(b),0,{...b,_id:Date.now()})):(b=v.triggers.find(m=>m._id===i),b&&v.triggers.splice(v[l].indexOf(b),0,{...b,_id:Date.now()})),t(v)}},id:"height",style:c?{width:(((N=document.getElementById("width"))==null?void 0:N.clientWidth)||0)-70}:void 0,className:`${G.cardStyle} ${c?G.cardStyleActive:null} ${S?G.isDelete:null}`,children:[n.jsx("div",{className:G.drag_mobile}),T,t&&n.jsx("div",{className:G.controlMenu,style:I?{opacity:1}:{opacity:0},children:n.jsx("div",{onClick:()=>{let h=K(l,s,o);h=z(l,h,o,i),B(!0),setTimeout(()=>{l==="triggers"&&w(!0),t(h)},300)},className:G.closeBtn})})]})}),rn={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},an=(e,t,s)=>{if(!e||!t)return{display:"none"};let{x:i,y:a}=t;const o=`translate(${i}px, ${a}px)`;return{transform:o,WebkitTransform:o}},ln=e=>{const{itemType:t,isDragging:s,item:i,initialOffset:a,currentOffset:o,targetIds:c}=zt(d=>({item:d.getItem(),itemType:d.getItemType(),initialOffset:d.getInitialSourceClientOffset(),currentOffset:d.getSourceClientOffset(),isDragging:d.isDragging(),targetIds:d.getTargetIds()})),l=()=>t==="box"?c.length?n.jsx(Ot,{active:!0,...i,allBlocks:e.allBlocks}):n.jsx(It,{active:!0,...i,socket:e.socket}):null;return s?n.jsx("div",{style:rn,children:n.jsx("div",{style:an(a,o),children:l()})}):null},dn="_border_wrpm3_1",fn="_emptyBlockStyle_wrpm3_6",mn="_emptyBlock_wrpm3_6",gn="_selectOnChange_wrpm3_22",hn="_selectOnChangeHelp_wrpm3_28",_n="_selectOnChangeHelpIcon_wrpm3_34",pn="_emptyBlockNone_wrpm3_49",un="_mainBlockItemRules_wrpm3_55",xn="_nameBlockItems_wrpm3_63",bn="_contentBlockItem_wrpm3_73",wn="_wrapperMargin_wrpm3_81",Cn="_contentHeightOn_wrpm3_87",vn="_contentHeightOff_wrpm3_99",jn="_cardAdd_wrpm3_105",In="_blockCardAdd_wrpm3_125",On="_addClassOverflow_wrpm3_136",An="_addClassHeight_wrpm3_140",D={border:dn,emptyBlockStyle:fn,emptyBlock:mn,selectOnChange:gn,selectOnChangeHelp:hn,selectOnChangeHelpIcon:_n,emptyBlockNone:pn,mainBlockItemRules:un,nameBlockItems:xn,contentBlockItem:bn,wrapperMargin:wn,contentHeightOn:Cn,contentHeightOff:vn,cardAdd:jn,blockCardAdd:In,addClassOverflow:On,addClassHeight:An};function dt(e,t){const[s,i]=M(window.localStorage.getItem(t)?JSON.parse(window.localStorage.getItem(t)||""):e);return[s,o=>{window.localStorage.setItem(t,JSON.stringify(o)),i(o)},!!window.localStorage.getItem(t)]}function yn(e,t){let s=0,i=null,a;return function(...o){const c=Date.now();a=o,c-s>=t?(s=c,e.apply(this,o)):i||(i=setTimeout(()=>{s=Date.now(),i=null,e.apply(this,a)},t-(c-s)))}}function tt(e){if(Array.isArray(e))return e.map(t=>tt(t));if(typeof e=="function")return e.bind(null);if(e&&typeof e=="object"){const t={};return Object.keys(e).forEach(s=>{t[s]=tt(e[s])}),t}return e}const ct=yn((e,t)=>e(t),0);function R(e,t){const s=t.find(i=>i._id===e);return{card:s,index:s?t.indexOf(s):-1}}function rt(e,t,s,i,a,o,c,l,d){const{card:j,index:O}=R(e,s);if(!(Ot&&l>d)&&j&&O!==t){const I=tt(s);I.splice(O,1),I.splice(t,0,j);const _=tt(a);switch(o){case"actions":_.actions[c]=I,ct(i,_);return;case"conditions":_.conditions[c]=I,ct(i,_);return;default:_.triggers=I,ct(i,_);return}}}const Dn="_drag_7xfhc_1",kn="_root_7xfhc_11",gt={drag:Dn,root:kn},At=({typeBlock:e,allProperties:t,id:s,isActive:i,setUserRules:a,userRules:o,children:c,_id:l,blockValue:d})=>{const{setOnUpdate:j}=nt(et),[{opacity:O},I,_]=$t({type:"box",item:()=>({...t,id:s,isActive:i,_id:l}),end:(w,f)=>{const{acceptedBy:x}=w,p=f.getDropResult();let g;if(!p)return typeof l=="number"&&!f.getTargetIds().length&&(g=K(x,o,d),g=z(x,g,d,l),a(g)),null;if(p.blockValue!==d){const C=typeof l=="number"?l:Date.now();g=K(x,o,p.blockValue);const q={id:w.id,acceptedBy:w.acceptedBy};switch(x){case"actions":return d&&(g=z("actions",g,d,C)),g=z("actions",g,p.blockValue,C),g.actions[p.blockValue].push({...q,_id:C}),a(g);case"conditions":return typeof d=="number"&&(g=z("conditions",g,d,C)),g=z("conditions",g,p.blockValue,C),g.conditions[p.blockValue].push({...q,_id:C}),a(g);default:return j(!0),g=z("triggers",g,p.blockValue,C),g.triggers.push({...q,_id:C}),a(g)}}},collect:w=>({opacity:w.isDragging()?.4:1,isDragging:w.isDragging()})}),r=ut(null),[,k]=bt({accept:"box",canDrop:()=>!1,hover({_id:w,acceptedBy:f},x){var T;if(!r.current||e!==f)return;const p=(T=r.current)==null?void 0:T.getBoundingClientRect(),g=(p.bottom-p.top)/2,C=x.getClientOffset(),q=((C==null?void 0:C.y)||0)-p.top;if(l&&w!==l)switch(f){case"actions":if(d==="then"||d==="else"){const{index:S}=R(l,o.actions[d]);S!==w&&rt(w,S,o[f][d],a,o,f,d,q,g)}return;case"conditions":if(typeof d=="number"){const{index:S}=R(l,o[f][d]);S!==w&&rt(w,S,o[f][d],a,o,f,d,q,g)}return;default:{const{index:S}=R(l,o[f]);S!==w&&rt(w,S,o[f],a,o,f,void 0,q,g);return}}}});E(()=>{_(Gt(),{captureDraggingState:!0})},[]),I(k(r));const H=window.innerWidth<600;return n.jsxs("div",{ref:H&&l?null:r,className:gt.root,style:{opacity:O},children:[n.jsx("div",{className:l?gt.drag:null,ref:l&&H?r:null}),c]})},Sn=({onClose:e,open:t})=>n.jsxs(wt,{open:t,onClose:e,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[n.jsx(Ct,{children:n.jsxs("div",{style:{fontSize:"1rem",fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif',fontWeight:400,lineHeight:1.5,letterSpacing:"0.00938em"},children:[n.jsx("h3",{children:u.I18n.t("On condition change")}),n.jsx("div",{children:u.I18n.t("help_on_change")}),n.jsx("h3",{children:u.I18n.t("Just check")}),n.jsx("div",{children:u.I18n.t("help_just_check")})]})}),n.jsx(vt,{children:n.jsx(jt,{onClick:e,color:"primary",autoFocus:!0,startIcon:n.jsx(Lt,{}),children:u.I18n.t("OK")})})]}),Nn=({onClose:e,open:t})=>n.jsxs(wt,{open:t,onClose:e,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[n.jsx(Ct,{children:n.jsxs(Tt,{id:"alert-dialog-description",children:[n.jsx("h3",{children:u.I18n.t("On condition change")}),n.jsx("div",{children:u.I18n.t("help_on_change")}),n.jsx("h3",{children:u.I18n.t("Just check")}),n.jsx("div",{children:u.I18n.t("help_just_check")})]})}),n.jsx(vt,{children:n.jsx(jt,{onClick:e,color:"primary",autoFocus:!0,children:u.I18n.t("OK")})})]}),ht=({size:e,blockValue:t,boolean:s,typeBlock:i,userRules:a,setUserRules:o,animation:c,setTourStep:l,tourStep:d,isTourOpen:j,theme:O,themeType:I,themeName:_})=>{var W;const[r,k]=M(!1),[H,w]=M(!1),[f,x]=M(!1),[p,g]=M("");s===void 0&&(s=!0);const C=bt({accept:"box",drop:()=>({blockValue:t}),hover:({acceptedBy:A,_id:L},Z)=>{k(A===i),x(!!L),g(Z.getHandlerId()||"")},canDrop:({acceptedBy:A})=>(w(A===i),A===i),collect:A=>{var L;return{isOver:A.isOver(),canDrop:((L=A.getItem())==null?void 0:L.acceptedBy)===i,offset:A.getClientOffset(),targetId:A.getHandlerId()}}}),q=C[0],{canDrop:T,isOver:S,offset:B,targetId:N}=q,h=C[1];E(()=>{g("")},[B]);const b=T&&S;let v="";b?v=r?"#00fb003d":"#fb00002e":T?v=H?"#00fb003d":"#fb00002e":B&&(v=N===p?"#fb00002e":"");let m;return i==="actions"?m=a.actions[t]:i==="conditions"?m=a.conditions[t]:m=a.triggers,n.jsx("div",{ref:h,style:{backgroundColor:v},className:`${u.Utils.clsx(D.contentBlockItem,e&&D.addClassHeight)} ${s?c?D.contentHeightOn:null:D.contentHeightOff}`,children:n.jsxs("div",{className:D.wrapperMargin,children:[m.map(A=>n.jsx(At,{typeBlock:i,...A,blockValue:t,allProperties:A,userRules:a,setUserRules:o,children:n.jsx(Ot,{...A,isTourOpen:j,setTourStep:l,tourStep:d,settings:A,blockValue:t,userRules:a,setUserRules:o,theme:O,themeType:I,themeName:_})},A._id)),n.jsx("div",{style:b&&r&&!f?{height:((W=document.getElementById("height"))==null?void 0:W.clientHeight)||200}:void 0,className:`${D.emptyBlockStyle} ${b&&r&&!f?D.emptyBlock:D.emptyBlockNone}`})]})})},at=({size:e,typeBlock:t,name:s,nameAdditionally:i,additionally:a,border:o,userRules:c,setUserRules:l,iconName:d,adapter:j,socket:O,setTourStep:I,tourStep:_,isTourOpen:r,theme:k,themeType:H,themeName:w})=>{const[f,x,p]=dt(t==="actions"?!1:[],`additionallyClickItems_${t}`),[g,C]=M(!1),[q,T]=M(!1);E(()=>{if(t==="conditions"&&(f==null?void 0:f.length)!==c.conditions.length-1){const N=[];c.conditions.forEach((h,b)=>{b>0&&N.push({_id:Date.now(),open:!0})}),x([...f,...N])}t==="actions"&&!p&&c.actions.else.length&&x(!0)},[]);const[S,B]=M(!1);return n.jsxs("div",{className:`${u.Utils.clsx(D.mainBlockItemRules,e&&D.addClassOverflow)} ${o&&!e?D.border:null}`,children:[n.jsxs("span",{id:"width",className:D.nameBlockItems,children:[n.jsx(Y,{iconName:d,className:D.iconThemCard,adapter:j,socket:O}),s]}),t==="conditions"?n.jsxs("div",{style:{width:"100%"},children:[n.jsxs(Et,{variant:"standard",className:D.selectOnChange,value:c.justCheck||!1,onChange:N=>{const h=K("conditions",c);h.justCheck=N.target.value==="true",l(h)},children:[n.jsx(mt,{value:"false",children:u.I18n.t("on condition change")}),n.jsx(mt,{value:"true",children:u.I18n.t("just check")})]}),n.jsx(Pt,{size:"small",title:u.I18n.t("Explanation"),className:D.selectOnChangeHelp,onClick:()=>C(!0),children:n.jsx(qt,{className:D.selectOnChangeHelpIcon})})]}):null,n.jsx(ht,{setTourStep:I,tourStep:_,isTourOpen:r,blockValue:t==="actions"?"then":t==="conditions"?0:t,typeBlock:t,setUserRules:l,userRules:c,theme:k,themeName:w,themeType:H,size:e}),a&&[...Array(t==="actions"?1:c.conditions.length-1)].map((N,h)=>{const b=(v=h)=>t==="actions"?!!f:!!f.find((m,W)=>W===v&&m.open);return n.jsxs(xt,{children:[n.jsxs("div",{onClick:()=>{if(t==="actions")return x(!f),null;let v=JSON.parse(JSON.stringify(f));if(c.conditions[h+1].length)return v[h].open=!v[h].open,x(v),null;v=v.filter((m,W)=>W!==h),x(v),B(h),setTimeout(()=>{B(!1),l({...c,conditions:[...c.conditions.filter((m,W)=>W!==h+1)]})},250)},className:D.blockCardAdd,children:[b()?"-":"+",n.jsx("div",{className:D.cardAdd,children:i})]},h),n.jsx(ht,{blockValue:t==="actions"?"else":t==="conditions"?h+1:t,typeBlock:t,setUserRules:l,userRules:c,boolean:b(),animation:S===h,size:e,theme:k,themeName:w,themeType:H})]},`${h}_block_${t}`)}),a&&t==="conditions"&&n.jsxs("div",{onClick:()=>{x([...f,{_id:Date.now(),open:!0}]),l({...c,conditions:[...c.conditions,[]]}),B(c.conditions.length-1),setTimeout(()=>B(!1),1e3)},className:D.blockCardAdd,children:["+",n.jsx("div",{className:D.cardAdd,children:i})]}),n.jsx(Sn,{open:g,onClose:()=>C(!1)}),n.jsx(Nn,{open:q,onClose:()=>T(!1)})]})},$n="_menuRules_1qqcb_1",qn="_switchesRenderWrapper_1qqcb_13",Bn="_menuOff_1qqcb_22",Mn="_menuTitle_1qqcb_28",Hn="_marginAuto_1qqcb_42",Wn="_inputWidth_1qqcb_47",Tn="_menuWrapper_1qqcb_52",En="_hamburgerWrapper_1qqcb_57",Pn="_hamburgerOff_1qqcb_74",Un="_nothingFound_1qqcb_82",Fn="_resetSearch_1qqcb_89",Jn="_controlPanel_1qqcb_101",Ln="_controlPanelAppBar_1qqcb_112",zn="_addClassMenu_1qqcb_126",Gn="_addClassBackground_1qqcb_132",Kn="_addClassPosition_1qqcb_136",$={menuRules:$n,switchesRenderWrapper:qn,menuOff:Bn,menuTitle:Mn,marginAuto:Hn,inputWidth:Wn,menuWrapper:Tn,hamburgerWrapper:En,hamburgerOff:Pn,nothingFound:Un,resetSearch:Fn,controlPanel:Jn,controlPanelAppBar:Ln,addClassMenu:zn,addClassBackground:Gn,addClassPosition:Kn},Qn=e=>{const{allProperties:t,allProperties:{acceptedBy:s,id:i},setUserRules:a,userRules:o,setTourStep:c,tourStep:l,isTourOpen:d,onTouchMove:j,isActive:O}=e;return n.jsx(At,{allProperties:t,id:t.id,isActive:O,setUserRules:a,userRules:o,children:n.jsx(It,{onDoubleClick:()=>{d&&l===J.addScheduleByDoubleClick&&i==="TriggerScheduleBlock"&&c(J.openTagsMenu),d&&l===J.addActionPrintText&&i==="ActionPrintText"&&c(J.showJavascript);const I=Date.now();let _;switch(s){case"actions":_="then";break;case"conditions":_=o[s].length-1;break}const r=K(s,o,_),k={id:i,_id:I,acceptedBy:s};_!==void 0?s==="actions"?r.actions[_].push({...k}):s==="conditions"&&r.conditions[_].push({...k}):r.triggers.push({...k}),a(r)},...e,...t,onTouchMove:j})})},Yn="_hamburgerMenu_hqnsm_8",Zn="_animate_hqnsm_21",_t={hamburgerMenu:Yn,animate:Zn};function Xn({bool:e}){return n.jsx("div",{className:`${_t.hamburgerMenu} ${e?_t.animate:""}`})}const Vn=({addClass:e,setAllBlocks:t,allBlocks:s,userRules:i,onChangeBlocks:a,setTourStep:o,tourStep:c,isTourOpen:l})=>{const{blocks:d,socket:j}=nt(et),[O,I]=dt(!1,"hamburgerOnOff"),[_,r]=dt({text:"",type:"triggers",index:0},"filterControlPanel"),k=(f=_.text,x=_.type)=>{if(!d)return;let p=[...d];p=p.filter(g=>{if(!f)return!0;const{name:C}=g.getStaticData();return C&&u.I18n.t(C).toLowerCase().includes(f.toLowerCase())}),p=p.filter(g=>x===g.getStaticData().acceptedBy),t(p)},H=(f,x)=>{l&&x===0&&c===J.selectTriggers&&o(J.addScheduleByDoubleClick),l&&x===2&&c===J.selectActions&&o(J.addActionPrintText),r({..._,index:x,type:["triggers","conditions","actions"][x]}),k(_.text,["triggers","conditions","actions"][x])},w=f=>({id:`scrollable-force-tab-${f}`,"aria-controls":`scrollable-force-tabpanel-${f}`});return E(()=>{k()},[d]),n.jsx(Ut,{mouseEvent:!1,touchEvent:"onTouchStart",onClickAway:()=>I(!0),children:n.jsxs("div",{className:u.Utils.clsx($.menuWrapper,e[1035]&&$.addClassMenu),children:[n.jsx("div",{className:`${$.hamburgerWrapper} ${O?$.hamburgerOff:null}`,onClick:()=>I(!O),children:n.jsx(Xn,{bool:!O})}),n.jsxs("div",{className:`${u.Utils.clsx($.menuRules,e[1035]&&$.addClassBackground,e[835]&&$.addClassPosition)} ${O?$.menuOff:null}`,children:[n.jsx("div",{className:$.controlPanel,children:n.jsx(Ft,{className:$.controlPanelAppBar,position:"static",children:n.jsxs(Jt,{value:_.index,onChange:H,children:[n.jsx(st,{className:"blocks-triggers",title:u.I18n.t("Triggers"),icon:n.jsx(Y,{iconName:"FlashOn"}),...w(0)}),n.jsx(st,{title:u.I18n.t("Conditions"),className:"blocks-conditions",icon:n.jsx(Y,{iconName:"Help"}),...w(1)}),n.jsx(st,{title:u.I18n.t("Actions"),className:"blocks-actions",icon:n.jsx(Y,{iconName:"PlayForWork"}),...w(2)})]})})}),n.jsx("div",{className:$.switchesRenderWrapper,children:n.jsxs("span",{children:[s.map(f=>{const{name:x,id:p,icon:g,adapter:C}=f.getStaticData();return n.jsx(xt,{children:n.jsx(Qn,{adapter:C,allProperties:f.getStaticData(),icon:g,id:p,isActive:!1,isTourOpen:l,name:x,onTouchMove:()=>I(!0),setTourStep:o,setUserRules:a,socket:j,tourStep:c,userRules:i})},p)}),!s.length&&n.jsxs("div",{className:$.nothingFound,children:[u.I18n.t("Nothing found"),"...",n.jsx("div",{className:$.resetSearch,onClick:()=>{r({..._,text:""}),k("")},children:u.I18n.t("reset search")})]})]})}),n.jsx("div",{className:u.Utils.clsx($.menuTitle,$.marginAuto)}),n.jsx(Bt,{className:$.inputWidth,fullWidth:!0,customValue:!0,value:_.text,size:"small",autoComplete:"off",label:u.I18n.t("search"),variant:"outlined",onChange:f=>{r({..._,text:f}),k(f)}})]})]})})};let pt=[];const me=({code:e,onChange:t,themeName:s,themeType:i,theme:a,setTourStep:o,tourStep:c,isTourOpen:l,command:d,scriptId:j,changed:O,running:I})=>{var v;const{blocks:_,socket:r,setOnUpdate:k,setOnDebugMessage:H,setEnableSimulation:w}=nt(et),[f,x]=M([]),[p,g]=M(ft(e)),[C,q]=M(""),[T,S]=M(!1);E(()=>{let m,W;const A=(P,y)=>{P===`${m}.alive`&&W!==(y==null?void 0:y.val)&&(W=!!(y!=null&&y.val),W&&m&&(r==null||r.sendTo(m.replace(/^system\.adapter\./,""),"rulesOn",j)))},L=(P,y)=>{var U,Q;r&&m!==((U=y==null?void 0:y.common)==null?void 0:U.engine)&&(m&&(r.unsubscribeState(`${m}.alive`,A),W&&r.sendTo(m.replace(/^system\.adapter\./,""),"rulesOn",j)),m=(Q=y==null?void 0:y.common)==null?void 0:Q.engine,m&&m&&r.subscribeState(`${m}.alive`,A))},Z=(P,y)=>{if(y)try{const U=JSON.parse(y.val),Q=Date.now();if(U.ruleId===j&&Q-U.ts<1e3){const F=[...pt,{blockId:U.blockId,data:U.data,ts:U.ts}];F.length>200&&F.splice(0,200-F.length);for(let X=F.length-1;X>=0;X--)if(F[X].ts{var y;m=(y=P==null?void 0:P.common)==null?void 0:y.engine,r.subscribeObject(j,L),m&&(r.subscribeState(`${m}.alive`,A),r.subscribeState(`${m.replace(/^system\.adapter\./,"")}.debug.rules`,Z))}),function(){r==null||r.unsubscribeObject(j,L),m&&(r==null||r.unsubscribeState(`${m}.alive`,A),W&&(r==null||r.sendTo(m.replace(/^system\.adapter\./,""),"rulesOff",j)),r==null||r.unsubscribeState(`${m.replace(/^system\.adapter\./,"")}.debug.rules`,Z))}},[]),E(()=>{w(!O&&I)},[O,I,w]),E(()=>{d&&(q(d),T||S(!0))},[d]),E(()=>{const m=ft(e);JSON.stringify(m)!==JSON.stringify(p)&&(g(m),k(!0))},[e]),E(()=>{document.getElementsByTagName("HTML")[0].className=s||"blue"},[s]);const B=lt(m=>{g(m),_&&t(Mt(m,_))},[_,t]),N=ut(null),[h,b]=M({835:!1,1035:!1});return E(()=>{N.current&&(N.current.clientWidth<=1035&&b({835:!1,1035:!0}),N.current.clientWidth<=835&&b({1035:!0,835:!0}),N.current.clientWidth>1035&&b({835:!1,1035:!1}))},[((v=N.current)==null?void 0:v.clientWidth)||0]),!_||!r?null:n.jsxs("div",{className:ot.wrapperRules,ref:N,children:[n.jsx(ln,{allBlocks:f,socket:r}),T?C==="export"?n.jsx(Ht,{scriptId:j,themeType:i,onClose:()=>S(!1),text:JSON.stringify(p,null,2)}):n.jsx(Wt,{themeType:i,onClose:m=>{S(!1),m&&B(JSON.parse(m))}}):null,n.jsxs("div",{className:u.Utils.clsx(ot.rootWrapper,h[835]&&ot.addClass),children:[n.jsx(Vn,{setAllBlocks:x,allBlocks:f,userRules:p,onChangeBlocks:B,setTourStep:o,tourStep:c,addClass:h,isTourOpen:l}),n.jsx(at,{socket:r,setUserRules:B,userRules:p,isTourOpen:l,setTourStep:o,tourStep:c,name:`${u.I18n.t("when")}...`,typeBlock:"triggers",iconName:"FlashOn",size:h[835],themeType:i,themeName:s,theme:a}),n.jsx(at,{socket:r,setUserRules:B,isTourOpen:l,setTourStep:o,tourStep:c,userRules:p,name:`...${u.I18n.t("and")}...`,typeBlock:"conditions",iconName:"Help",nameAdditionally:u.I18n.t("or"),additionally:!0,border:!0,size:h[835],themeType:i,themeName:s,theme:a}),n.jsx(at,{socket:r,setUserRules:B,isTourOpen:l,setTourStep:o,tourStep:c,userRules:p,name:`...${u.I18n.t("then")}`,typeBlock:"actions",iconName:"PlayForWork",nameAdditionally:u.I18n.t("else"),additionally:!0,size:h[835],themeType:i,themeName:s,theme:a})]})]},"rulesEditor")};export{me as default}; diff --git a/admin/assets/index-Bm6wEaaB.js b/admin/assets/index-bny2V8S2.js similarity index 74% rename from admin/assets/index-Bm6wEaaB.js rename to admin/assets/index-bny2V8S2.js index 73678bee6..5cd8a8aa8 100644 --- a/admin/assets/index-Bm6wEaaB.js +++ b/admin/assets/index-bny2V8S2.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DWalwvIj.js","./createSvgIcon-DPvF8xqu.js","./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js","./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js","./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js","./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js","./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js","./index-C49cpVll.js","./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js","./preload-helper-BDBacUwf.js","./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js","./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js","./inheritsLoose-B0Ba5G9z.js","./index-BCK6q-N6.css","./index-C9EIOjDT.js","./ScriptEditorVanillaMonaco-DSYvOslZ.js","./ScriptEditor-C-fO5h68.js","./Save-Cld9qv9i.js","./OpenAiDialog-CEA56Rl4.js","./index-gIA8x-8f.js"])))=>i.map(i=>d[i]); -import{d as e_}from"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js";import{j as m,c as $t,g as Tw,r as Sw,_ as Ig,i as t_}from"./createSvgIcon-DPvF8xqu.js";import{r as DT}from"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js";import{a as _e,_ as AT,b as Ko,c as Lt,d as OT,e as Ew,f as xg,g as um,h as dm,i as hm,j as kt,k as xn,l as us,m as ia,n as Iw,o as Dg,p as RT,q as NT,r as xw,s as MT,t as _n}from"./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js";import{_ as Ut,a as ss,b as qt,c as Eo,d as Di,e as Ag,f as Ai,g as it,h as Ht,i as He,j as Xl,k as Zl,l as Ql,m as ec,n as tc,o as qe,p as Dw,q as Si,r as Og,s as s_,t as Rg,u as Ng,v as Pn,w as Aw,x as LT,y as pm,z as wt,A as PT,B as o_,C as BT,D as qp,E as wc,F as FT,G as jT,H as zT,I as UT,J as Ow,K as HT,L as WT,M as i_,N as wn,O as GT,P as VT,Q as KT,R as YT,S as JT,T as Rw,U as qT,V as Mg,W as Nw,X as XT}from"./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js";import{_ as x}from"./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js";import{I as qo,a as so,b as mc,C as ZT,c as Mw,F as QT,d as eS,e as kc,f as Lg,g as tS,h as sS,i as oS,j as iS,M as nS,k as rS,l as aS,m as lS,_ as cS,n as sc,o as uS,p as dS,q as oc,r as n_,s as hS,t as pS,u as gS,v as mS,w as r_,x as Yc,y as fS,z as $S,A as bS,B as vS,D as yS,E as _S,G as wS,H as Lw,J as Pw,K as Bw,L as kS,N as CS,O as TS,P as SS,Q as ES,R as IS}from"./index-C49cpVll.js";import{y as xS,_ as DS,a as AS,m as OS,S as a_,T as l_}from"./inheritsLoose-B0Ba5G9z.js";import{c as eo}from"./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js";function Xo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}import{_ as jn}from"./preload-helper-BDBacUwf.js";import{P as ke}from"./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js";import{_ as RS}from"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();var Fw,c_=DT;Fw=c_.createRoot,c_.hydrateRoot;var jw={exports:{}},ht={};var Jc=60103,qc=60106,na=60107,ra=60108,aa=60114,la=60109,ca=60110,ua=60112,da=60113,gm=60120,ha=60115,pa=60116,zw=60121,Uw=60122,Hw=60117,Ww=60129,Gw=60131;if(typeof Symbol=="function"&&Symbol.for){var Nt=Symbol.for;Jc=Nt("react.element"),qc=Nt("react.portal"),na=Nt("react.fragment"),ra=Nt("react.strict_mode"),aa=Nt("react.profiler"),la=Nt("react.provider"),ca=Nt("react.context"),ua=Nt("react.forward_ref"),da=Nt("react.suspense"),gm=Nt("react.suspense_list"),ha=Nt("react.memo"),pa=Nt("react.lazy"),zw=Nt("react.block"),Uw=Nt("react.server.block"),Hw=Nt("react.fundamental"),Ww=Nt("react.debug_trace_mode"),Gw=Nt("react.legacy_hidden")}function Ms(a){if(typeof a=="object"&&a!==null){var s=a.$$typeof;switch(s){case Jc:switch(a=a.type,a){case na:case aa:case ra:case da:case gm:return a;default:switch(a=a&&a.$$typeof,a){case ca:case ua:case pa:case ha:case la:return a;default:return s}}case qc:return s}}}var NS=la,MS=Jc,LS=ua,PS=na,BS=pa,FS=ha,jS=qc,zS=aa,US=ra,HS=da;ht.ContextConsumer=ca;ht.ContextProvider=NS;ht.Element=MS;ht.ForwardRef=LS;ht.Fragment=PS;ht.Lazy=BS;ht.Memo=FS;ht.Portal=jS;ht.Profiler=zS;ht.StrictMode=US;ht.Suspense=HS;ht.isAsyncMode=function(){return!1};ht.isConcurrentMode=function(){return!1};ht.isContextConsumer=function(a){return Ms(a)===ca};ht.isContextProvider=function(a){return Ms(a)===la};ht.isElement=function(a){return typeof a=="object"&&a!==null&&a.$$typeof===Jc};ht.isForwardRef=function(a){return Ms(a)===ua};ht.isFragment=function(a){return Ms(a)===na};ht.isLazy=function(a){return Ms(a)===pa};ht.isMemo=function(a){return Ms(a)===ha};ht.isPortal=function(a){return Ms(a)===qc};ht.isProfiler=function(a){return Ms(a)===aa};ht.isStrictMode=function(a){return Ms(a)===ra};ht.isSuspense=function(a){return Ms(a)===da};ht.isValidElementType=function(a){return typeof a=="string"||typeof a=="function"||a===na||a===aa||a===Ww||a===ra||a===da||a===gm||a===Gw||typeof a=="object"&&a!==null&&(a.$$typeof===pa||a.$$typeof===ha||a.$$typeof===la||a.$$typeof===ca||a.$$typeof===ua||a.$$typeof===Hw||a.$$typeof===zw||a[0]===Uw)};ht.typeOf=Ms;jw.exports=ht;var WS=jw.exports;function Cc(a,s){const i=getComputedStyle(s);if(!i)return;let r=a===ft.Horizontal?s.clientWidth:s.clientHeight;return r!==0?(a===ft.Horizontal?r-=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight):r-=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom),r):void 0}function ic(a,s,i=[],r={condition:!0}){const{condition:l}=r,c=(function(d,h){var p={};for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&h.indexOf(f)<0&&(p[f]=d[f]);if(d!=null&&typeof Object.getOwnPropertySymbols=="function"){var b=0;for(f=Object.getOwnPropertySymbols(d);b(l&&window.addEventListener(a,s,c),()=>{l&&window.removeEventListener(a,s)})),[a,s,l,...i])}(function(a,s){s===void 0&&(s={});var i=s.insertAt;if(typeof document<"u"){var r=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css",i==="top"&&r.firstChild?r.insertBefore(l,r.firstChild):r.appendChild(l),l.styleSheet?l.styleSheet.cssText=a:l.appendChild(document.createTextNode(a))}})(`/* === Main Container === */ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-B0ByV4SK.js","./createSvgIcon-DPvF8xqu.js","./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js","./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js","./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js","./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js","./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js","./index-C49cpVll.js","./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js","./preload-helper-BDBacUwf.js","./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js","./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js","./inheritsLoose-B0Ba5G9z.js","./index-BCK6q-N6.css","./index-ns4mNOlq.js","./ScriptEditorVanillaMonaco-DSYvOslZ.js","./ScriptEditor-C-fO5h68.js","./Save-Cld9qv9i.js","./OpenAiDialog-CANTLp4d.js","./index-gIA8x-8f.js"])))=>i.map(i=>d[i]); +import{d as e_}from"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js";import{j as m,c as $t,g as Tw,r as Sw,_ as Ig,i as t_}from"./createSvgIcon-DPvF8xqu.js";import{r as DT}from"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js";import{a as _e,_ as AT,b as Ko,c as Lt,d as RT,e as Ew,f as xg,g as um,h as dm,i as hm,j as kt,k as xn,l as us,m as ia,n as Iw,o as Dg,p as OT,q as NT,r as xw,s as MT,t as _n}from"./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js";import{_ as Pt,a as Xt,b as Wt,c as Eo,d as Di,e as Ag,f as Ai,g as it,h as Bt,i as Ue,j as Xl,k as Zl,l as Ql,m as ec,n as tc,o as qe,p as Dw,q as Si,r as Rg,s as s_,t as Og,u as Ng,v as Pn,w as Aw,x as LT,y as pm,z as wt,A as PT,B as o_,C as BT,D as qp,E as wc,F as jT,G as FT,H as zT,I as UT,J as Rw,K as HT,L as WT,M as i_,N as wn,O as GT,P as VT,Q as KT,R as YT,S as JT,T as Ow,U as qT,V as Mg,W as Nw,X as XT}from"./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js";import{_ as x}from"./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js";import{I as qo,a as so,b as mc,C as ZT,c as Mw,F as QT,d as eS,e as kc,f as Lg,g as tS,h as sS,i as oS,j as iS,M as nS,k as rS,l as aS,m as lS,_ as cS,n as sc,o as uS,p as dS,q as oc,r as n_,s as hS,t as pS,u as gS,v as mS,w as r_,x as Yc,y as fS,z as $S,A as bS,B as vS,D as yS,E as _S,G as wS,H as Lw,J as Pw,K as Bw,L as kS,N as CS,O as TS,P as SS,Q as ES,R as IS}from"./index-C49cpVll.js";import{y as xS,_ as DS,a as AS,m as RS,S as a_,T as l_}from"./inheritsLoose-B0Ba5G9z.js";import{c as eo}from"./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js";function Xo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}import{_ as Fn}from"./preload-helper-BDBacUwf.js";import{P as ke}from"./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js";import{_ as OS}from"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();var jw,c_=DT;jw=c_.createRoot,c_.hydrateRoot;var Fw={exports:{}},ht={};var Jc=60103,qc=60106,na=60107,ra=60108,aa=60114,la=60109,ca=60110,ua=60112,da=60113,gm=60120,ha=60115,pa=60116,zw=60121,Uw=60122,Hw=60117,Ww=60129,Gw=60131;if(typeof Symbol=="function"&&Symbol.for){var Nt=Symbol.for;Jc=Nt("react.element"),qc=Nt("react.portal"),na=Nt("react.fragment"),ra=Nt("react.strict_mode"),aa=Nt("react.profiler"),la=Nt("react.provider"),ca=Nt("react.context"),ua=Nt("react.forward_ref"),da=Nt("react.suspense"),gm=Nt("react.suspense_list"),ha=Nt("react.memo"),pa=Nt("react.lazy"),zw=Nt("react.block"),Uw=Nt("react.server.block"),Hw=Nt("react.fundamental"),Ww=Nt("react.debug_trace_mode"),Gw=Nt("react.legacy_hidden")}function Ms(a){if(typeof a=="object"&&a!==null){var s=a.$$typeof;switch(s){case Jc:switch(a=a.type,a){case na:case aa:case ra:case da:case gm:return a;default:switch(a=a&&a.$$typeof,a){case ca:case ua:case pa:case ha:case la:return a;default:return s}}case qc:return s}}}var NS=la,MS=Jc,LS=ua,PS=na,BS=pa,jS=ha,FS=qc,zS=aa,US=ra,HS=da;ht.ContextConsumer=ca;ht.ContextProvider=NS;ht.Element=MS;ht.ForwardRef=LS;ht.Fragment=PS;ht.Lazy=BS;ht.Memo=jS;ht.Portal=FS;ht.Profiler=zS;ht.StrictMode=US;ht.Suspense=HS;ht.isAsyncMode=function(){return!1};ht.isConcurrentMode=function(){return!1};ht.isContextConsumer=function(a){return Ms(a)===ca};ht.isContextProvider=function(a){return Ms(a)===la};ht.isElement=function(a){return typeof a=="object"&&a!==null&&a.$$typeof===Jc};ht.isForwardRef=function(a){return Ms(a)===ua};ht.isFragment=function(a){return Ms(a)===na};ht.isLazy=function(a){return Ms(a)===pa};ht.isMemo=function(a){return Ms(a)===ha};ht.isPortal=function(a){return Ms(a)===qc};ht.isProfiler=function(a){return Ms(a)===aa};ht.isStrictMode=function(a){return Ms(a)===ra};ht.isSuspense=function(a){return Ms(a)===da};ht.isValidElementType=function(a){return typeof a=="string"||typeof a=="function"||a===na||a===aa||a===Ww||a===ra||a===da||a===gm||a===Gw||typeof a=="object"&&a!==null&&(a.$$typeof===pa||a.$$typeof===ha||a.$$typeof===la||a.$$typeof===ca||a.$$typeof===ua||a.$$typeof===Hw||a.$$typeof===zw||a[0]===Uw)};ht.typeOf=Ms;Fw.exports=ht;var WS=Fw.exports;function Cc(a,s){const i=getComputedStyle(s);if(!i)return;let r=a===ft.Horizontal?s.clientWidth:s.clientHeight;return r!==0?(a===ft.Horizontal?r-=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight):r-=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom),r):void 0}function ic(a,s,i=[],r={condition:!0}){const{condition:l}=r,c=(function(d,h){var p={};for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&h.indexOf(f)<0&&(p[f]=d[f]);if(d!=null&&typeof Object.getOwnPropertySymbols=="function"){var b=0;for(f=Object.getOwnPropertySymbols(d);b(l&&window.addEventListener(a,s,c),()=>{l&&window.removeEventListener(a,s)})),[a,s,l,...i])}(function(a,s){s===void 0&&(s={});var i=s.insertAt;if(typeof document<"u"){var r=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css",i==="top"&&r.firstChild?r.insertBefore(l,r.firstChild):r.appendChild(l),l.styleSheet?l.styleSheet.cssText=a:l.appendChild(document.createTextNode(a))}})(`/* === Main Container === */ .__dbk__container { height: 100%; width: 100%; @@ -88,12 +88,12 @@ import{d as e_}from"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntr .__dbk__dragger.Dark { background: #434252; } -/* ====== */`);const GS=_e.forwardRef((({className:a,theme:s,draggerClassName:i,direction:r=ft.Vertical,onDragging:l},c)=>{const d=`__dbk__gutter ${r} ${a||s}`,h=`__dbk__dragger ${r} ${i||s}`;return m.jsx("div",Object.assign({className:d,ref:c,dir:r,onMouseDown:l,onTouchStart:fc?l:void 0},{children:m.jsx("div",{className:h},void 0)}),void 0)}));var ws;function Pg(a,s,i){let r,l;return s?(r=a/2,l=a):i?(r=a,l=a/2):(r=a,l=a),{aGutterSize:r,bGutterSize:l}}function VS(a,s){switch(s.type){case ws.SetIsReadyToCompute:return Object.assign(Object.assign({},a),{isReady:s.payload.isReady});case ws.CreatePairs:{const{direction:i,children:r,gutters:l}=s.payload,c=r[0].parentNode;if(!c)throw new Error("Cannot create pairs - parent is undefined.");const d=Cc(i,c);if(d===void 0)throw new Error(`Cannot create pairs - parent has undefined or zero size: ${d}.`);const h=[];return r.forEach(((p,f)=>{if(f>0){const b=r[f-1],y=r[f],w=l[f-1],v=i===ft.Horizontal?b.getBoundingClientRect().left:b.getBoundingClientRect().top,_=i===ft.Horizontal?y.getBoundingClientRect().right:y.getBoundingClientRect().bottom,$=i===ft.Horizontal?b.getBoundingClientRect().width+w.getBoundingClientRect().width+y.getBoundingClientRect().width:b.getBoundingClientRect().height+w.getBoundingClientRect().height+y.getBoundingClientRect().height,S=i===ft.Horizontal?w.getBoundingClientRect().width:w.getBoundingClientRect().height,T={idx:f-1,a:b,b:y,gutter:w,parent:c,start:v,end:_,size:$,gutterSize:S,aSizePct:100/r.length,bSizePct:100/r.length};h.push(T)}})),Object.assign(Object.assign({},a),{pairs:h})}case ws.StartDragging:{const{gutterIdx:i}=s.payload;return Object.assign(Object.assign({},a),{isDragging:!0,draggingIdx:i})}case ws.StopDragging:return Object.assign(Object.assign({},a),{isDragging:!1});case ws.CalculateSizes:{const{direction:i,gutterIdx:r}=s.payload,l=a.pairs[r],c=Cc(i,l.parent);if(!c)throw new Error("Cannot calculate sizes - 'pair.parent' has undefined or zero size.");const d=l.gutter[i===ft.Horizontal?"clientWidth":"clientHeight"],h=r===0,p=r===a.pairs.length-1,{aGutterSize:f,bGutterSize:b}=Pg(d,h,p);let y,w,v,_,$;return i===ft.Horizontal?(y=l.a.getBoundingClientRect().left,w=l.b.getBoundingClientRect().right,_=(l.a.getBoundingClientRect().width+f)/c*100,$=(l.b.getBoundingClientRect().width+b)/c*100,v=l.a.getBoundingClientRect().width+f+b+l.b.getBoundingClientRect().width):(y=l.a.getBoundingClientRect().top,w=l.b.getBoundingClientRect().bottom,_=(l.a.getBoundingClientRect().height+f)/c*100,$=(l.b.getBoundingClientRect().height+b)/c*100,v=l.a.getBoundingClientRect().height+f+b+l.b.getBoundingClientRect().height),a.pairs[r]=Object.assign(Object.assign({},l),{start:y,end:w,size:v,aSizePct:_,bSizePct:$,gutterSize:d}),Object.assign({},a)}default:return a}}function Vw(a,s=0,i=[]){return OT.toArray(a).reduce(((r,l,c)=>(WS.isFragment(l)?r.push.apply(r,Vw(l.props.children,s+1,i.concat(l.key||c))):Ew(l)?r.push(xg(l,{key:i.concat(String(l.key)).join(".")})):typeof l!="string"&&typeof l!="number"||r.push(l),r)),[])}(function(a){a[a.SetIsReadyToCompute=0]="SetIsReadyToCompute",a[a.CreatePairs=1]="CreatePairs",a[a.CalculateSizes=2]="CalculateSizes",a[a.StartDragging=3]="StartDragging",a[a.StopDragging=4]="StopDragging"})(ws||(ws={}));const u_=a=>"changedTouches"in a;var ft,Bg;(function(a){a.Horizontal="Horizontal",a.Vertical="Vertical"})(ft||(ft={})),(function(a){a.Light="Light",a.Dark="Dark"})(Bg||(Bg={}));const fc=typeof window<"u"&&"ontouchstart"in window;function Xp(a){return a===ft.Horizontal?"col-resize":"row-resize"}const KS={isReady:!1,isDragging:!1,pairs:[]};function d_({direction:a=ft.Horizontal,minWidths:s=[],minHeights:i=[],initialSizes:r,gutterTheme:l=Bg.Dark,gutterClassName:c,draggerClassName:d,children:h,onResizeStarted:p,onResizeFinished:f,classes:b=[]}){const y=Vw(h),[w,v]=AT(VS,KS),_=Ko(null),$=Ko([]),S=Ko([]);$.current=[],S.current=[];const T=_e.useCallback((R=>{v({type:ws.SetIsReadyToCompute,payload:{isReady:R}})}),[]),E=_e.useCallback(((R,K)=>{v({type:ws.StartDragging,payload:{gutterIdx:K}});const C=w.pairs[K];p==null||p(C.idx),C.a.style.userSelect="none",C.b.style.userSelect="none",C.gutter.style.cursor=Xp(R),C.parent.style.cursor=Xp(R),document.body.style.cursor=Xp(R)}),[w.pairs]),D=_e.useCallback((()=>{v({type:ws.StopDragging});const R=[];for(let C=0;C{v({type:ws.CalculateSizes,payload:{direction:R,gutterIdx:K}})}),[]),P=_e.useCallback(((R,K,C)=>{v({type:ws.CreatePairs,payload:{direction:R,children:K,gutters:C}})}),[]),W=_e.useCallback(((R,K,C,Q)=>{const ve=K[0].parentNode;if(!ve)throw new Error("Cannot set initial sizes - parent is undefined");if(Cc(R,ve)===void 0)throw new Error("Cannot set initial sizes - parent has undefined size");K.forEach(((ce,ne)=>{const me=ne===0,re=ne===K.length-1;let B,N=0;K.length>1&&(N=C[re?ne-1:ne].getBoundingClientRect()[R===ft.Horizontal?"width":"height"],N=me||re?N/2:N),B=Q&&ne{if(w.draggingIdx===void 0)throw new Error("Cannot adjust size - 'draggingIdx' is undefined");const C=w.pairs[w.draggingIdx];if(C.size===void 0)throw new Error("Cannot adjust size - 'pair.size' is undefined");if(C.gutterSize===void 0)throw new Error("Cannot adjust size - 'pair.gutterSize' is undefined");const Q=C.aSizePct+C.bSizePct,ve=K/C.size*Q,ce=Q-K/C.size*Q,ne=w.draggingIdx===0,me=w.draggingIdx===w.pairs.length-1,{aGutterSize:re,bGutterSize:B}=Pg(C.gutterSize,ne,me),N=`calc(${ve}% - ${re}px)`,te=`calc(${ce}% - ${B}px)`;R===ft.Horizontal?(C.a.style.width=N,C.b.style.width=te):(C.a.style.height=N,C.b.style.height=te)}),[w.draggingIdx,w.pairs,a]),z=_e.useCallback(((R,K,C)=>{if(!w.isDragging)return;if(w.draggingIdx===void 0)throw new Error("Cannot drag - 'draggingIdx' is undefined");const Q=w.pairs[w.draggingIdx];if(Q.start===void 0)throw new Error("Cannot drag - 'pair.start' is undefined");if(Q.size===void 0)throw new Error("Cannot drag - 'pair.size' is undefined");if(Q.gutterSize===void 0)throw new Error("Cannot drag - 'pair.gutterSize' is undefined");let ve=(function(me,re){const B=u_(re)?re.changedTouches[0]:re;return me===ft.Horizontal?B.clientX:B.clientY})(K,R)-Q.start,ce=16,ne=16;C.length>w.draggingIdx&&(ce=C[w.draggingIdx]),C.length>=w.draggingIdx+1&&(ne=C[w.draggingIdx+1]),ve=Q.size-(Q.gutterSize+ne)&&(ve=Q.size-(Q.gutterSize+ne)),G(K,ve)}),[w.isDragging,w.draggingIdx,w.pairs,G]),Z=()=>{if(w.isDragging){if(w.draggingIdx===void 0)throw new Error("Cannot calculate sizes after dragging = 'state.draggingIdx' is undefined");M(a,w.draggingIdx),D()}},he=R=>{w.isDragging&&(u_(R)&&R.preventDefault(),z(R,a,a===ft.Horizontal?s:i))};function Ce(R,K){if(!R.current)throw new Error("Can't add element to ref object - ref isn't initialized");K&&!R.current.includes(K)&&R.current.push(K)}return ic("mouseup",Z,[w.isDragging,D]),ic("mousemove",he,[a,w.isDragging,z,s,i]),ic("touchend",Z,[w.isDragging,D],{condition:fc}),ic("touchmove",he,[a,w.isDragging,z,s,i],{condition:fc,passive:!fc}),Lt((function(){if(!_.current)return;const R=_.current.parentElement;if(!R)return;const K=new ResizeObserver((()=>{const C=getComputedStyle(R),Q=a===ft.Horizontal?R.clientWidth:R.clientHeight;T(!!C&&!!Q)}));return K.observe(R),()=>{K.disconnect()}}),[_.current,a]),Lt((function(){if(w.isReady&&(!$.current||$.current[0].offsetParent)){if(!$.current||!S.current)throw new Error("Cannot create pairs - either variable 'childRefs' or 'gutterRefs' is undefined");y.length<=1?W(a,$.current,S.current,r):(W(a,$.current,S.current,r),P(a,$.current,S.current))}}),[h,w.isReady,a,W,P,r]),m.jsx("div",Object.assign({className:`__dbk__container ${a}`,ref:_},{children:w.isReady&&y.map(((R,K)=>m.jsxs(_e.Fragment,{children:[m.jsx("div",Object.assign({ref:C=>Ce($,C),className:"__dbk__child-wrapper "+(KCe(S,C),className:c,theme:l,draggerClassName:d,direction:a,onDragging:()=>{return M(a,C=K),void E(a,C);var C}},void 0)]},K)))}),void 0)}const Kw=um({dragDropManager:void 0});function Qr(a){"@babel/helpers - typeof";return Qr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},Qr(a)}function YS(a,s){if(Qr(a)!="object"||!a)return a;var i=a[Symbol.toPrimitive];if(i!==void 0){var r=i.call(a,s);if(Qr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(a)}function JS(a){var s=YS(a,"string");return Qr(s)=="symbol"?s:s+""}function qS(a,s,i){return(s=JS(s))in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function bs(a){return"Minified Redux error #"+a+"; visit https://redux.js.org/Errors?code="+a+" for the full message or use the non-minified dev environment for full errors. "}var h_=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),p_=function(){return Math.random().toString(36).substring(7).split("").join(".")},g_={INIT:"@@redux/INIT"+p_(),REPLACE:"@@redux/REPLACE"+p_()};function XS(a){if(typeof a!="object"||a===null)return!1;for(var s=a;Object.getPrototypeOf(s)!==null;)s=Object.getPrototypeOf(s);return Object.getPrototypeOf(a)===s}function Yw(a,s,i){var r;if(typeof s=="function"&&typeof i=="function"||typeof i=="function"&&typeof arguments[3]=="function")throw new Error(bs(0));if(typeof s=="function"&&typeof i>"u"&&(i=s,s=void 0),typeof i<"u"){if(typeof i!="function")throw new Error(bs(1));return i(Yw)(a,s)}if(typeof a!="function")throw new Error(bs(2));var l=a,c=s,d=[],h=d,p=!1;function f(){h===d&&(h=d.slice())}function b(){if(p)throw new Error(bs(3));return c}function y($){if(typeof $!="function")throw new Error(bs(4));if(p)throw new Error(bs(5));var S=!0;return f(),h.push($),function(){if(S){if(p)throw new Error(bs(6));S=!1,f();var E=h.indexOf($);h.splice(E,1),d=null}}}function w($){if(!XS($))throw new Error(bs(7));if(typeof $.type>"u")throw new Error(bs(8));if(p)throw new Error(bs(9));try{p=!0,c=l(c,$)}finally{p=!1}for(var S=d=h,T=0;Tr&&r[l]?r[l]:i||null,a)}function eE(a,s){return a.filter(i=>i!==s)}function Jw(a){return typeof a=="object"}function tE(a,s){const i=new Map,r=c=>{i.set(c,i.has(c)?i.get(c)+1:1)};a.forEach(r),s.forEach(r);const l=[];return i.forEach((c,d)=>{c===1&&l.push(d)}),l}function sE(a,s){return a.filter(i=>s.indexOf(i)>-1)}const mm="dnd-core/INIT_COORDS",Xc="dnd-core/BEGIN_DRAG",fm="dnd-core/PUBLISH_DRAG_SOURCE",Zc="dnd-core/HOVER",Qc="dnd-core/DROP",eu="dnd-core/END_DRAG";function m_(a,s){return{type:mm,payload:{sourceClientOffset:s||null,clientOffset:a||null}}}const oE={type:mm,payload:{clientOffset:null,sourceClientOffset:null}};function iE(a){return function(i=[],r={publishSource:!0}){const{publishSource:l=!0,clientOffset:c,getSourceClientOffset:d}=r,h=a.getMonitor(),p=a.getRegistry();a.dispatch(m_(c)),nE(i,h,p);const f=lE(i,h);if(f==null){a.dispatch(oE);return}let b=null;if(c){if(!d)throw new Error("getSourceClientOffset must be defined");rE(d),b=d(f)}a.dispatch(m_(c,b));const w=p.getSource(f).beginDrag(h,f);if(w==null)return;aE(w),p.pinSource(f);const v=p.getSourceType(f);return{type:Xc,payload:{itemType:v,item:w,sourceId:f,clientOffset:c||null,sourceClientOffset:b||null,isSourcePublic:!!l}}}}function nE(a,s,i){Ve(!s.isDragging(),"Cannot call beginDrag while dragging."),a.forEach(function(r){Ve(i.getSource(r),"Expected sourceIds to be registered.")})}function rE(a){Ve(typeof a=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function aE(a){Ve(Jw(a),"Item must be an object.")}function lE(a,s){let i=null;for(let r=a.length-1;r>=0;r--)if(s.canDragSource(a[r])){i=a[r];break}return i}function cE(a,s,i){return s in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function uE(a){for(var s=1;s{const p=pE(d,h,l,r),f={type:Qc,payload:{dropResult:uE({},i,p)}};a.dispatch(f)})}}function hE(a){Ve(a.isDragging(),"Cannot call drop while not dragging."),Ve(!a.didDrop(),"Cannot call drop twice during one drag operation.")}function pE(a,s,i,r){const l=i.getTarget(a);let c=l?l.drop(r,a):void 0;return gE(c),typeof c>"u"&&(c=s===0?{}:r.getDropResult()),c}function gE(a){Ve(typeof a>"u"||Jw(a),"Drop result must either be an object or undefined.")}function mE(a){const s=a.getTargetIds().filter(a.canDropOnTarget,a);return s.reverse(),s}function fE(a){return function(){const i=a.getMonitor(),r=a.getRegistry();$E(i);const l=i.getSourceId();return l!=null&&(r.getSource(l,!0).endDrag(i,l),r.unpinSource()),{type:eu}}}function $E(a){Ve(a.isDragging(),"Cannot call endDrag while not dragging.")}function Fg(a,s){return s===null?a===null:Array.isArray(a)?a.some(i=>i===s):a===s}function bE(a){return function(i,{clientOffset:r}={}){vE(i);const l=i.slice(0),c=a.getMonitor(),d=a.getRegistry(),h=c.getItemType();return _E(l,d,h),yE(l,c,d),wE(l,c,d),{type:Zc,payload:{targetIds:l,clientOffset:r||null}}}}function vE(a){Ve(Array.isArray(a),"Expected targetIds to be an array.")}function yE(a,s,i){Ve(s.isDragging(),"Cannot call hover while not dragging."),Ve(!s.didDrop(),"Cannot call hover after drop.");for(let r=0;r=0;r--){const l=a[r],c=s.getTargetType(l);Fg(c,i)||a.splice(r,1)}}function wE(a,s,i){a.forEach(function(r){i.getTarget(r).hover(s,r)})}function kE(a){return function(){if(a.getMonitor().isDragging())return{type:fm}}}function CE(a){return{beginDrag:iE(a),publishDragSource:kE(a),hover:bE(a),drop:dE(a),endDrag:fE(a)}}class TE{receiveBackend(s){this.backend=s}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const s=this,{dispatch:i}=this.store;function r(c){return(...d)=>{const h=c.apply(s,d);typeof h<"u"&&i(h)}}const l=CE(this);return Object.keys(l).reduce((c,d)=>{const h=l[d];return c[d]=r(h),c},{})}dispatch(s){this.store.dispatch(s)}constructor(s,i){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=s,this.monitor=i,s.subscribe(this.handleRefCountChange)}}function SE(a,s){return{x:a.x+s.x,y:a.y+s.y}}function qw(a,s){return{x:a.x-s.x,y:a.y-s.y}}function EE(a){const{clientOffset:s,initialClientOffset:i,initialSourceClientOffset:r}=a;return!s||!i||!r?null:qw(SE(s,r),i)}function IE(a){const{clientOffset:s,initialClientOffset:i}=a;return!s||!i?null:qw(s,i)}const Kr=[],$m=[];Kr.__IS_NONE__=!0;$m.__IS_ALL__=!0;function xE(a,s){return a===Kr?!1:a===$m||typeof s>"u"?!0:sE(s,a).length>0}class DE{subscribeToStateChange(s,i={}){const{handlerIds:r}=i;Ve(typeof s=="function","listener must be a function."),Ve(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let l=this.store.getState().stateId;const c=()=>{const d=this.store.getState(),h=d.stateId;try{h===l||h===l+1&&!xE(d.dirtyHandlerIds,r)||s()}finally{l=h}};return this.store.subscribe(c)}subscribeToOffsetChange(s){Ve(typeof s=="function","listener must be a function.");let i=this.store.getState().dragOffset;const r=()=>{const l=this.store.getState().dragOffset;l!==i&&(i=l,s())};return this.store.subscribe(r)}canDragSource(s){if(!s)return!1;const i=this.registry.getSource(s);return Ve(i,`Expected to find a valid source. sourceId=${s}`),this.isDragging()?!1:i.canDrag(this,s)}canDropOnTarget(s){if(!s)return!1;const i=this.registry.getTarget(s);if(Ve(i,`Expected to find a valid target. targetId=${s}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(s),l=this.getItemType();return Fg(r,l)&&i.canDrop(this,s)}isDragging(){return!!this.getItemType()}isDraggingSource(s){if(!s)return!1;const i=this.registry.getSource(s,!0);if(Ve(i,`Expected to find a valid source. sourceId=${s}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(s),l=this.getItemType();return r!==l?!1:i.isDragging(this,s)}isOverTarget(s,i={shallow:!1}){if(!s)return!1;const{shallow:r}=i;if(!this.isDragging())return!1;const l=this.registry.getTargetType(s),c=this.getItemType();if(c&&!Fg(l,c))return!1;const d=this.getTargetIds();if(!d.length)return!1;const h=d.indexOf(s);return r?h===d.length-1:h>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return EE(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return IE(this.store.getState().dragOffset)}constructor(s,i){this.store=s,this.registry=i}}const f_=typeof global<"u"?global:self,Xw=f_.MutationObserver||f_.WebKitMutationObserver;function Zw(a){return function(){const i=setTimeout(l,0),r=setInterval(l,50);function l(){clearTimeout(i),clearInterval(r),a()}}}function AE(a){let s=1;const i=new Xw(a),r=document.createTextNode("");return i.observe(r,{characterData:!0}),function(){s=-s,r.data=s}}const OE=typeof Xw=="function"?AE:Zw;class RE{enqueueTask(s){const{queue:i,requestFlush:r}=this;i.length||(r(),this.flushing=!0),i[i.length]=s}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:s}=this;for(;this.indexthis.capacity){for(let r=0,l=s.length-this.index;r{this.pendingErrors.push(s),this.requestErrorThrow()},this.requestFlush=OE(this.flush),this.requestErrorThrow=Zw(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class NE{call(){try{this.task&&this.task()}catch(s){this.onError(s)}finally{this.task=null,this.release(this)}}constructor(s,i){this.onError=s,this.release=i,this.task=null}}class ME{create(s){const i=this.freeTasks,r=i.length?i.pop():new NE(this.onError,l=>i[i.length]=l);return r.task=s,r}constructor(s){this.onError=s,this.freeTasks=[]}}const Qw=new RE,LE=new ME(Qw.registerPendingError);function PE(a){Qw.enqueueTask(LE.create(a))}const bm="dnd-core/ADD_SOURCE",vm="dnd-core/ADD_TARGET",ym="dnd-core/REMOVE_SOURCE",tu="dnd-core/REMOVE_TARGET";function BE(a){return{type:bm,payload:{sourceId:a}}}function FE(a){return{type:vm,payload:{targetId:a}}}function jE(a){return{type:ym,payload:{sourceId:a}}}function zE(a){return{type:tu,payload:{targetId:a}}}function UE(a){Ve(typeof a.canDrag=="function","Expected canDrag to be a function."),Ve(typeof a.beginDrag=="function","Expected beginDrag to be a function."),Ve(typeof a.endDrag=="function","Expected endDrag to be a function.")}function HE(a){Ve(typeof a.canDrop=="function","Expected canDrop to be a function."),Ve(typeof a.hover=="function","Expected hover to be a function."),Ve(typeof a.drop=="function","Expected beginDrag to be a function.")}function jg(a,s){if(s&&Array.isArray(a)){a.forEach(i=>jg(i,!1));return}Ve(typeof a=="string"||typeof a=="symbol",s?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var _s;(function(a){a.SOURCE="SOURCE",a.TARGET="TARGET"})(_s||(_s={}));let WE=0;function GE(){return WE++}function VE(a){const s=GE().toString();switch(a){case _s.SOURCE:return`S${s}`;case _s.TARGET:return`T${s}`;default:throw new Error(`Unknown Handler Role: ${a}`)}}function $_(a){switch(a[0]){case"S":return _s.SOURCE;case"T":return _s.TARGET;default:throw new Error(`Cannot parse handler ID: ${a}`)}}function b_(a,s){const i=a.entries();let r=!1;do{const{done:l,value:[,c]}=i.next();if(c===s)return!0;r=!!l}while(!r);return!1}class KE{addSource(s,i){jg(s),UE(i);const r=this.addHandler(_s.SOURCE,s,i);return this.store.dispatch(BE(r)),r}addTarget(s,i){jg(s,!0),HE(i);const r=this.addHandler(_s.TARGET,s,i);return this.store.dispatch(FE(r)),r}containsHandler(s){return b_(this.dragSources,s)||b_(this.dropTargets,s)}getSource(s,i=!1){return Ve(this.isSourceId(s),"Expected a valid source ID."),i&&s===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(s)}getTarget(s){return Ve(this.isTargetId(s),"Expected a valid target ID."),this.dropTargets.get(s)}getSourceType(s){return Ve(this.isSourceId(s),"Expected a valid source ID."),this.types.get(s)}getTargetType(s){return Ve(this.isTargetId(s),"Expected a valid target ID."),this.types.get(s)}isSourceId(s){return $_(s)===_s.SOURCE}isTargetId(s){return $_(s)===_s.TARGET}removeSource(s){Ve(this.getSource(s),"Expected an existing source."),this.store.dispatch(jE(s)),PE(()=>{this.dragSources.delete(s),this.types.delete(s)})}removeTarget(s){Ve(this.getTarget(s),"Expected an existing target."),this.store.dispatch(zE(s)),this.dropTargets.delete(s),this.types.delete(s)}pinSource(s){const i=this.getSource(s);Ve(i,"Expected an existing source."),this.pinnedSourceId=s,this.pinnedSource=i}unpinSource(){Ve(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(s,i,r){const l=VE(s);return this.types.set(l,i),s===_s.SOURCE?this.dragSources.set(l,r):s===_s.TARGET&&this.dropTargets.set(l,r),l}constructor(s){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=s}}const YE=(a,s)=>a===s;function JE(a,s){return!a&&!s?!0:!a||!s?!1:a.x===s.x&&a.y===s.y}function qE(a,s,i=YE){if(a.length!==s.length)return!1;for(let r=0;r0||!qE(i,r)))return Kr;const d=r[r.length-1],h=i[i.length-1];return d!==h&&(d&&l.push(d),h&&l.push(h)),l}function ZE(a,s,i){return s in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function QE(a){for(var s=1;s=0)&&Object.prototype.propertyIsEnumerable.call(a,r)&&(i[r]=a[r])}return i}function hI(a,s){if(a==null)return{};var i={},r=Object.keys(a),l,c;for(c=0;c=0)&&(i[l]=a[l]);return i}let y_=0;const $c=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var ek=dm(function(s){var{children:i}=s,r=dI(s,["children"]);const[l,c]=pI(r);return Lt(()=>{if(c){const d=tk();return++y_,()=>{--y_===0&&(d[$c]=null)}}},[]),m.jsx(Kw.Provider,{value:l,children:i})});function pI(a){if("manager"in a)return[{dragDropManager:a.manager},!1];const s=gI(a.backend,a.context,a.options,a.debugMode),i=!a.context;return[s,i]}function gI(a,s=tk(),i,r){const l=s;return l[$c]||(l[$c]={dragDropManager:cI(a,s,i,r)}),l[$c]}function tk(){return typeof global<"u"?global:window}var mI=function a(s,i){if(s===i)return!0;if(s&&i&&typeof s=="object"&&typeof i=="object"){if(s.constructor!==i.constructor)return!1;var r,l,c;if(Array.isArray(s)){if(r=s.length,r!=i.length)return!1;for(l=r;l--!==0;)if(!a(s[l],i[l]))return!1;return!0}if(s.constructor===RegExp)return s.source===i.source&&s.flags===i.flags;if(s.valueOf!==Object.prototype.valueOf)return s.valueOf()===i.valueOf();if(s.toString!==Object.prototype.toString)return s.toString()===i.toString();if(c=Object.keys(s),r=c.length,r!==Object.keys(i).length)return!1;for(l=r;l--!==0;)if(!Object.prototype.hasOwnProperty.call(i,c[l]))return!1;for(l=r;l--!==0;){var d=c[l];if(!a(s[d],i[d]))return!1}return!0}return s!==s&&i!==i};const fI=Xo(mI),Oi=typeof window<"u"?hm:Lt;function $I(a,s,i){const[r,l]=kt(()=>s(a)),c=xn(()=>{const d=s(a);fI(r,d)||(l(d),i&&i())},[r,a,i]);return Oi(c),[r,c]}function bI(a,s,i){const[r,l]=$I(a,s,i);return Oi(function(){const d=a.getHandlerId();if(d!=null)return a.subscribeToStateChange(l,{handlerIds:[d]})},[a,l]),r}function sk(a,s,i){return bI(s,a||(()=>({})),()=>i.reconnect())}function ok(a,s){const i=[];return typeof a!="function"&&i.push(a),us(()=>typeof a=="function"?a():a,i)}function vI(a){return us(()=>a.hooks.dragSource(),[a])}function yI(a){return us(()=>a.hooks.dragPreview(),[a])}let Zp=!1,Qp=!1;class _I{receiveHandlerId(s){this.sourceId=s}getHandlerId(){return this.sourceId}canDrag(){Ve(!Zp,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Zp=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Zp=!1}}isDragging(){if(!this.sourceId)return!1;Ve(!Qp,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Qp=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Qp=!1}}subscribeToStateChange(s,i){return this.internalMonitor.subscribeToStateChange(s,i)}isDraggingSource(s){return this.internalMonitor.isDraggingSource(s)}isOverTarget(s,i){return this.internalMonitor.isOverTarget(s,i)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(s){return this.internalMonitor.subscribeToOffsetChange(s)}canDragSource(s){return this.internalMonitor.canDragSource(s)}canDropOnTarget(s){return this.internalMonitor.canDropOnTarget(s)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(s){this.sourceId=null,this.internalMonitor=s.getMonitor()}}let eg=!1;class wI{receiveHandlerId(s){this.targetId=s}getHandlerId(){return this.targetId}subscribeToStateChange(s,i){return this.internalMonitor.subscribeToStateChange(s,i)}canDrop(){if(!this.targetId)return!1;Ve(!eg,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return eg=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{eg=!1}}isOver(s){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,s):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(s){this.targetId=null,this.internalMonitor=s.getMonitor()}}function kI(a,s,i){const r=i.getRegistry(),l=r.addTarget(a,s);return[l,()=>r.removeTarget(l)]}function CI(a,s,i){const r=i.getRegistry(),l=r.addSource(a,s);return[l,()=>r.removeSource(l)]}function zg(a,s,i,r){let l;if(l!==void 0)return!!l;if(a===s)return!0;if(typeof a!="object"||!a||typeof s!="object"||!s)return!1;const c=Object.keys(a),d=Object.keys(s);if(c.length!==d.length)return!1;const h=Object.prototype.hasOwnProperty.bind(s);for(let p=0;p, or turn it into a drag source or a drop target itself.`)}function SI(a){return(s=null,i=null)=>{if(!Ew(s)){const c=s;return a(c,i),c}const r=s;return TI(r),EI(r,i?c=>a(c,i):a)}}function ik(a){const s={};return Object.keys(a).forEach(i=>{const r=a[i];if(i.endsWith("Ref"))s[i]=a[i];else{const l=SI(r);s[i]=()=>l}}),s}function __(a,s){typeof a=="function"?a(s):a.current=s}function EI(a,s){const i=a.ref;return Ve(typeof i!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a or
. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),i?xg(a,{ref:r=>{__(i,r),__(s,r)}}):xg(a,{ref:s})}class II{receiveHandlerId(s){this.handlerId!==s&&(this.handlerId=s,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(s){this.dragSourceOptionsInternal=s}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(s){this.dragPreviewOptionsInternal=s}reconnect(){const s=this.reconnectDragSource();this.reconnectDragPreview(s)}reconnectDragSource(){const s=this.dragSource,i=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return i&&this.disconnectDragSource(),this.handlerId?s?(i&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=s,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,s,this.dragSourceOptions)),i):(this.lastConnectedDragSource=s,i):i}reconnectDragPreview(s=!1){const i=this.dragPreview,r=s||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!i){this.lastConnectedDragPreview=i;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=i,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,i,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!zg(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!zg(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(s){this.hooks=ik({dragSource:(i,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,Ug(i)?this.dragSourceRef=i:this.dragSourceNode=i,this.reconnectDragSource()},dragPreview:(i,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,Ug(i)?this.dragPreviewRef=i:this.dragPreviewNode=i,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=s}}class xI{get connectTarget(){return this.dropTarget}reconnect(){const s=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();s&&this.disconnectDropTarget();const i=this.dropTarget;if(this.handlerId){if(!i){this.lastConnectedDropTarget=i;return}s&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=i,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,i,this.dropTargetOptions))}}receiveHandlerId(s){s!==this.handlerId&&(this.handlerId=s,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(s){this.dropTargetOptionsInternal=s}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!zg(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(s){this.hooks=ik({dropTarget:(i,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,Ug(i)?this.dropTargetRef=i:this.dropTargetNode=i,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=s}}function zn(){const{dragDropManager:a}=ia(Kw);return Ve(a!=null,"Expected drag drop context"),a}function DI(a,s){const i=zn(),r=us(()=>new II(i.getBackend()),[i]);return Oi(()=>(r.dragSourceOptions=a||null,r.reconnect(),()=>r.disconnectDragSource()),[r,a]),Oi(()=>(r.dragPreviewOptions=s||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,s]),r}function AI(){const a=zn();return us(()=>new _I(a),[a])}class OI{beginDrag(){const s=this.spec,i=this.monitor;let r=null;return typeof s.item=="object"?r=s.item:typeof s.item=="function"?r=s.item(i):r={},r??null}canDrag(){const s=this.spec,i=this.monitor;return typeof s.canDrag=="boolean"?s.canDrag:typeof s.canDrag=="function"?s.canDrag(i):!0}isDragging(s,i){const r=this.spec,l=this.monitor,{isDragging:c}=r;return c?c(l):i===s.getSourceId()}endDrag(){const s=this.spec,i=this.monitor,r=this.connector,{end:l}=s;l&&l(i.getItem(),i),r.reconnect()}constructor(s,i,r){this.spec=s,this.monitor=i,this.connector=r}}function RI(a,s,i){const r=us(()=>new OI(a,s,i),[s,i]);return Lt(()=>{r.spec=a},[a]),r}function NI(a){return us(()=>{const s=a.type;return Ve(s!=null,"spec.type must be defined"),s},[a])}function MI(a,s,i){const r=zn(),l=RI(a,s,i),c=NI(a);Oi(function(){if(c!=null){const[h,p]=CI(c,l,r);return s.receiveHandlerId(h),i.receiveHandlerId(h),p}},[r,s,i,l,c])}function LI(a,s){const i=ok(a);Ve(!i.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=AI(),l=DI(i.options,i.previewOptions);return MI(i,r,l),[sk(i.collect,r,l),vI(l),yI(l)]}function PI(a){return us(()=>a.hooks.dropTarget(),[a])}function BI(a){const s=zn(),i=us(()=>new xI(s.getBackend()),[s]);return Oi(()=>(i.dropTargetOptions=a||null,i.reconnect(),()=>i.disconnectDropTarget()),[a]),i}function FI(){const a=zn();return us(()=>new wI(a),[a])}function jI(a){const{accept:s}=a;return us(()=>(Ve(a.accept!=null,"accept must be defined"),Array.isArray(s)?s:[s]),[s])}class zI{canDrop(){const s=this.spec,i=this.monitor;return s.canDrop?s.canDrop(i.getItem(),i):!0}hover(){const s=this.spec,i=this.monitor;s.hover&&s.hover(i.getItem(),i)}drop(){const s=this.spec,i=this.monitor;if(s.drop)return s.drop(i.getItem(),i)}constructor(s,i){this.spec=s,this.monitor=i}}function UI(a,s){const i=us(()=>new zI(a,s),[s]);return Lt(()=>{i.spec=a},[a]),i}function HI(a,s,i){const r=zn(),l=UI(a,s),c=jI(a);Oi(function(){const[h,p]=kI(c,l,r);return s.receiveHandlerId(h),i.receiveHandlerId(h),p},[r,s,l,i,c.map(d=>d.toString()).join("|")])}function WI(a,s){const i=ok(a),r=FI(),l=BI(i.options);return HI(i,r,l),[sk(i.collect,r,l),PI(l)]}function nk(a){let s=null;return()=>(s==null&&(s=a()),s)}function GI(a,s){return a.filter(i=>i!==s)}function VI(a,s){const i=new Set,r=c=>i.add(c);a.forEach(r),s.forEach(r);const l=[];return i.forEach(c=>l.push(c)),l}class KI{enter(s){const i=this.entered.length,r=l=>this.isNodeInDocument(l)&&(!l.contains||l.contains(s));return this.entered=VI(this.entered.filter(r),[s]),i===0&&this.entered.length>0}leave(s){const i=this.entered.length;return this.entered=GI(this.entered.filter(this.isNodeInDocument),s),i>0&&this.entered.length===0}reset(){this.entered=[]}constructor(s){this.entered=[],this.isNodeInDocument=s}}class YI{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(s=>{Object.defineProperty(this.item,s,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${s}" until the drop event.`),null}})})}loadDataTransfer(s){if(s){const i={};Object.keys(this.config.exposeProperties).forEach(r=>{const l=this.config.exposeProperties[r];l!=null&&(i[r]={value:l(s,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,i)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(s,i){return i===s.getSourceId()}endDrag(){}constructor(s){this.config=s,this.item={},this.initializeExposedProperties()}}const rk="__NATIVE_FILE__",ak="__NATIVE_URL__",lk="__NATIVE_TEXT__",ck="__NATIVE_HTML__",w_=Object.freeze(Object.defineProperty({__proto__:null,FILE:rk,HTML:ck,TEXT:lk,URL:ak},Symbol.toStringTag,{value:"Module"}));function tg(a,s,i){const r=s.reduce((l,c)=>l||a.getData(c),"");return r??i}const Hg={[rk]:{exposeProperties:{files:a=>Array.prototype.slice.call(a.files),items:a=>a.items,dataTransfer:a=>a},matchesTypes:["Files"]},[ck]:{exposeProperties:{html:(a,s)=>tg(a,s,""),dataTransfer:a=>a},matchesTypes:["Html","text/html"]},[ak]:{exposeProperties:{urls:(a,s)=>tg(a,s,"").split(` -`),dataTransfer:a=>a},matchesTypes:["Url","text/uri-list"]},[lk]:{exposeProperties:{text:(a,s)=>tg(a,s,""),dataTransfer:a=>a},matchesTypes:["Text","text/plain"]}};function JI(a,s){const i=Hg[a];if(!i)throw new Error(`native type ${a} has no configuration`);const r=new YI(i);return r.loadDataTransfer(s),r}function sg(a){if(!a)return null;const s=Array.prototype.slice.call(a.types||[]);return Object.keys(Hg).filter(i=>{const r=Hg[i];return r!=null&&r.matchesTypes?r.matchesTypes.some(l=>s.indexOf(l)>-1):!1})[0]||null}const qI=nk(()=>/firefox/i.test(navigator.userAgent)),uk=nk(()=>!!window.safari);class k_{interpolate(s){const{xs:i,ys:r,c1s:l,c2s:c,c3s:d}=this;let h=i.length-1;if(s===i[h])return r[h];let p=0,f=d.length-1,b;for(;p<=f;){b=Math.floor(.5*(p+f));const v=i[b];if(vs)f=b-1;else return r[b]}h=Math.max(0,f);const y=s-i[h],w=y*y;return r[h]+l[h]*y+c[h]*w+d[h]*y*w}constructor(s,i){const{length:r}=s,l=[];for(let v=0;vs[v]{let W=new k_([0,.5,1],[p.y,p.y/b*_,p.y+_-b]).interpolate(w);return uk()&&c&&(W+=(window.devicePixelRatio-1)*_),W},S=()=>new k_([0,.5,1],[p.x,p.x/f*v,p.x+v-f]).interpolate(y),{offsetX:T,offsetY:E}=l,D=T===0||T,M=E===0||E;return{x:D?T:S(),y:M?E:$()}}let tx=class{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var s;return!((s=this.globalContext)===null||s===void 0)&&s.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var s;return((s=this.optionsArgs)===null||s===void 0?void 0:s.rootElement)||this.window}constructor(s,i){this.ownerDocument=null,this.globalContext=s,this.optionsArgs=i}};function sx(a,s,i){return s in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function C_(a){for(var s=1;s{this.sourcePreviewNodes.delete(s),this.sourcePreviewNodeOptions.delete(s)}}connectDragSource(s,i,r){this.sourceNodes.set(s,i),this.sourceNodeOptions.set(s,r);const l=d=>this.handleDragStart(d,s),c=d=>this.handleSelectStart(d);return i.setAttribute("draggable","true"),i.addEventListener("dragstart",l),i.addEventListener("selectstart",c),()=>{this.sourceNodes.delete(s),this.sourceNodeOptions.delete(s),i.removeEventListener("dragstart",l),i.removeEventListener("selectstart",c),i.setAttribute("draggable","false")}}connectDropTarget(s,i){const r=d=>this.handleDragEnter(d,s),l=d=>this.handleDragOver(d,s),c=d=>this.handleDrop(d,s);return i.addEventListener("dragenter",r),i.addEventListener("dragover",l),i.addEventListener("drop",c),()=>{i.removeEventListener("dragenter",r),i.removeEventListener("dragover",l),i.removeEventListener("drop",c)}}addEventListeners(s){s.addEventListener&&(s.addEventListener("dragstart",this.handleTopDragStart),s.addEventListener("dragstart",this.handleTopDragStartCapture,!0),s.addEventListener("dragend",this.handleTopDragEndCapture,!0),s.addEventListener("dragenter",this.handleTopDragEnter),s.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),s.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),s.addEventListener("dragover",this.handleTopDragOver),s.addEventListener("dragover",this.handleTopDragOverCapture,!0),s.addEventListener("drop",this.handleTopDrop),s.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(s){s.removeEventListener&&(s.removeEventListener("dragstart",this.handleTopDragStart),s.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),s.removeEventListener("dragend",this.handleTopDragEndCapture,!0),s.removeEventListener("dragenter",this.handleTopDragEnter),s.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),s.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),s.removeEventListener("dragover",this.handleTopDragOver),s.removeEventListener("dragover",this.handleTopDragOverCapture,!0),s.removeEventListener("drop",this.handleTopDrop),s.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const s=this.monitor.getSourceId(),i=this.sourceNodeOptions.get(s);return C_({dropEffect:this.altKeyPressed?"copy":"move"},i||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const s=this.monitor.getSourceId(),i=this.sourcePreviewNodeOptions.get(s);return C_({anchorX:.5,anchorY:.5,captureDraggingState:!1},i||{})}isDraggingNativeItem(){const s=this.monitor.getItemType();return Object.keys(w_).some(i=>w_[i]===s)}beginDragNativeItem(s,i){this.clearCurrentDragSourceNode(),this.currentNativeSource=JI(s,i),this.currentNativeHandle=this.registry.addSource(s,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(s){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=s;const i=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},i)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var s;(s=this.window)===null||s===void 0||s.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(s,i){s.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(i))}handleDragEnter(s,i){this.dragEnterTargetIds.unshift(i)}handleDragOver(s,i){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(i)}handleDrop(s,i){this.dropTargetIds.unshift(i)}constructor(s,i,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=l=>{const c=this.sourceNodes.get(l);return c&&dk(c)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=l=>!!(l&&this.document&&this.document.body&&this.document.body.contains(l)),this.endDragIfSourceWasRemovedFromDOM=()=>{const l=this.currentDragSourceNode;l==null||this.isNodeInDocument(l)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=l=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(l||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=l=>{if(l.defaultPrevented)return;const{dragStartSourceIds:c}=this;this.dragStartSourceIds=null;const d=nc(l);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(c||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:d});const{dataTransfer:h}=l,p=sg(h);if(this.monitor.isDragging()){if(h&&typeof h.setDragImage=="function"){const b=this.monitor.getSourceId(),y=this.sourceNodes.get(b),w=this.sourcePreviewNodes.get(b)||y;if(w){const{anchorX:v,anchorY:_,offsetX:$,offsetY:S}=this.getCurrentSourcePreviewNodeOptions(),D=ex(y,w,d,{anchorX:v,anchorY:_},{offsetX:$,offsetY:S});h.setDragImage(w,D.x,D.y)}}try{h==null||h.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(l.target);const{captureDraggingState:f}=this.getCurrentSourcePreviewNodeOptions();f?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(p)this.beginDragNativeItem(p);else{if(h&&!h.types&&(l.target&&!l.target.hasAttribute||!l.target.hasAttribute("draggable")))return;l.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=l=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var c;(c=this.currentNativeSource)===null||c===void 0||c.loadDataTransfer(l.dataTransfer)}if(!this.enterLeaveCounter.enter(l.target)||this.monitor.isDragging())return;const{dataTransfer:h}=l,p=sg(h);p&&this.beginDragNativeItem(p,h)},this.handleTopDragEnter=l=>{const{dragEnterTargetIds:c}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=l.altKey,c.length>0&&this.actions.hover(c,{clientOffset:nc(l)}),c.some(h=>this.monitor.canDropOnTarget(h))&&(l.preventDefault(),l.dataTransfer&&(l.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=l=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var c;(c=this.currentNativeSource)===null||c===void 0||c.loadDataTransfer(l.dataTransfer)}},this.handleTopDragOver=l=>{const{dragOverTargetIds:c}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){l.preventDefault(),l.dataTransfer&&(l.dataTransfer.dropEffect="none");return}this.altKeyPressed=l.altKey,this.lastClientOffset=nc(l),this.scheduleHover(c),(c||[]).some(h=>this.monitor.canDropOnTarget(h))?(l.preventDefault(),l.dataTransfer&&(l.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?l.preventDefault():(l.preventDefault(),l.dataTransfer&&(l.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=l=>{this.isDraggingNativeItem()&&l.preventDefault(),this.enterLeaveCounter.leave(l.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=l=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var c;l.preventDefault(),(c=this.currentNativeSource)===null||c===void 0||c.loadDataTransfer(l.dataTransfer)}else sg(l.dataTransfer)&&l.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=l=>{const{dropTargetIds:c}=this;this.dropTargetIds=[],this.actions.hover(c,{clientOffset:nc(l)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=l=>{const c=l.target;typeof c.dragDrop=="function"&&(c.tagName==="INPUT"||c.tagName==="SELECT"||c.tagName==="TEXTAREA"||c.isContentEditable||(l.preventDefault(),c.dragDrop()))},this.options=new tx(i,r),this.actions=s.getActions(),this.monitor=s.getMonitor(),this.registry=s.getRegistry(),this.enterLeaveCounter=new KI(this.isNodeInDocument)}}const hk=function(s,i,r){return new ox(s,i,r)},ix=$t([m.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),m.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"AccessTime"),nx=$t(m.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox"),rx=$t(m.jsx("path",{d:"M4 8h4V4H4zm6 12h4v-4h-4zm-6 0h4v-4H4zm0-6h4v-4H4zm6 0h4v-4h-4zm6-10v4h4V4zm-6 4h4V4h-4zm6 6h4v-4h-4zm0 6h4v-4h-4z"}),"Apps"),ax=$t(m.jsx("path",{d:"M9 2c-1.05 0-2.05.16-3 .46 4.06 1.27 7 5.06 7 9.54s-2.94 8.27-7 9.54c.95.3 1.95.46 3 .46 5.52 0 10-4.48 10-10S14.52 2 9 2"}),"Brightness3"),lx=$t(m.jsx("path",{d:"M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5s-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20zm-6 8h-4v-2h4zm0-4h-4v-2h4z"}),"BugReport"),cx=$t(m.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm-1 4 6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2zm-1 7h5.5L14 6.5z"}),"FileCopy"),ux=$t(m.jsx("path",{d:"M7 2v11h3v9l7-12h-4l4-8z"}),"FlashOn"),dx=$t(m.jsx("path",{d:"M3.27 5 2 6.27l6.97 6.97L6.5 19h3l1.57-3.66L16.73 21 18 19.73 3.55 5.27zM6 5v.18L8.82 8h2.4l-.72 1.68 2.1 2.1L14.21 8H20V5z"}),"FormatClear"),hx=$t(m.jsx("path",{d:"M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z"}),"Functions"),pk=$t(m.jsx("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutline"),px=$t(m.jsx("path",{d:"M21 3.01H3c-1.1 0-2 .9-2 2V9h2V4.99h18v14.03H3V15H1v4.01c0 1.1.9 1.98 2 1.98h18c1.1 0 2-.88 2-1.98v-14c0-1.11-.9-2-2-2M11 16l4-4-4-4v3H1v2h10z"}),"Input"),T_=$t(m.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"}),"Lock"),gx=$t(m.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert"),mx=$t(m.jsx("path",{d:"M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10c1.38 0 2.5-1.12 2.5-2.5 0-.61-.23-1.2-.64-1.67-.08-.1-.13-.21-.13-.33 0-.28.22-.5.5-.5H16c3.31 0 6-2.69 6-6 0-4.96-4.49-9-10-9m5.5 11c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m-3-4c-.83 0-1.5-.67-1.5-1.5S13.67 6 14.5 6s1.5.67 1.5 1.5S15.33 9 14.5 9M5 11.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5S7.33 13 6.5 13 5 12.33 5 11.5m6-4c0 .83-.67 1.5-1.5 1.5S8 8.33 8 7.5 8.67 6 9.5 6s1.5.67 1.5 1.5"}),"Palette"),bc=$t(m.jsx("path",{d:"M6 19h4V5H6zm8-14v14h4V5z"}),"Pause"),Wg=$t(m.jsx("path",{d:"M8 5v14l11-7z"}),"PlayArrow"),fx=$t(m.jsx("path",{d:"M11 5v5.59H7.5l4.5 4.5 4.5-4.5H13V5zm-5 9c0 3.31 2.69 6 6 6s6-2.69 6-6h-2c0 2.21-1.79 4-4 4s-4-1.79-4-4z"}),"PlayForWork"),$x=$t(m.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search"),bx=$t(m.jsx("path",{d:"M10.59 9.17 5.41 4 4 5.41l5.17 5.17zM14.5 4l2.04 2.04L4 18.59 5.41 20 17.96 7.46 20 9.5V4zm.33 9.41-1.41 1.41 3.13 3.13L14.5 20H20v-5.5l-2.04 2.04z"}),"Shuffle"),vx=$t(m.jsx("path",{d:"M2 20h20v-4H2zm2-3h2v2H4zM2 4v4h20V4zm4 3H4V5h2zm-4 7h20v-4H2zm2-3h2v2H4z"}),"Storage"),yx=$t(m.jsx("path",{d:"M14 17H4v2h10zm6-8H4v2h16zM4 15h16v-2H4zM4 5v2h16V5z"}),"Subject"),_x=$t(m.jsx("path",{d:"M16 17.01V10h-2v7.01h-3L15 21l4-3.99zM9 3 5 6.99h3V14h2V6.99h3z"}),"SwapVert"),wx=$t(m.jsx("path",{d:"M7.41 18.59 8.83 20 12 16.83 15.17 20l1.41-1.41L12 14zm9.18-13.18L15.17 4 12 7.17 8.83 4 7.41 5.41 12 10z"}),"UnfoldLess"),kx=$t(m.jsx("path",{d:"M12 5.83 15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15z"}),"UnfoldMore"),Tc="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='512'%20height='512'%20shape-rendering='geometricPrecision'%20image-rendering='optimizeQuality'%20fill-rule='evenodd'%20xmlns:v='https://vecta.io/nano'%3e%3cpath%20fill='%23efda4e'%20d='M-.5-.5h512v512H-.5V-.5z'/%3e%3cpath%20fill='%23020100'%20d='M308.5%20287.5c1.777-3.005%202.777-6.338%203-10%209.147-21.963%2025.48-35.463%2049-40.5%2021.999-4.173%2043.666-2.84%2065%204%2014.575%205.411%2025.575%2014.911%2033%2028.5l-1%202c-12.413%205.624-24.58%2011.624-36.5%2018-5.321-8.25-12.821-13.417-22.5-15.5-13.957-3.122-27.29-1.455-40%205-8.125%205.36-10.958%2012.86-8.5%2022.5%203.223%206.223%208.057%2010.723%2014.5%2013.5l64%2020c38.459%2016.085%2052.626%2044.585%2042.5%2085.5-7.572%2026.208-24.738%2042.041-51.5%2047.5-25.102%205.733-49.768%204.4-74-4-19.291-8.625-32.291-22.958-39-43%2011.266-8.887%2023.433-16.387%2036.5-22.5%203.117%206.896%206.784%2013.563%2011%2020%2012.705%2012.307%2027.872%2016.807%2045.5%2013.5%2022.189-3.504%2032.355-16.338%2030.5-38.5-2.833-6.833-7.667-11.667-14.5-14.5l-57-17c-36.004-11.84-52.67-36.673-50-74.5z'/%3e%3cpath%20fill='%23020200'%20d='M222.5%20238.5h43l-.5%20159c-2.688%2052.355-30.188%2076.855-82.5%2073.5-24.871-3.543-41.204-17.21-49-41l.5-2.5a12.14%2012.14%200%200%200%204.5-3.5c10.653-5.825%2021.32-11.325%2032-16.5%204.763%2021.72%2017.763%2028.887%2039%2021.5%204.616-2.618%207.783-6.451%209.5-11.5%201.163-5.968%202.163-11.968%203-18l.5-161z'/%3e%3cpath%20fill='%23615820'%20d='M311.5%20277.5c-.223%203.662-1.223%206.995-3%2010%20.223-3.662%201.223-6.995%203-10z'/%3e%3c/svg%3e",gk="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20500%20500'%3e%3cpath%20fill='%234285f4'%20d='M44.271%2027.275l206.5%201v170l-58.5-36.5c-7.005-.916-12.505%201.584-16.5%207.5v147c4.625%204.412%2010.125%206.245%2016.5%205.5l57.5-35.5c.833%2054.003%201.356%20108.003.189%20162-1.272.546-45.599-.242-48.689%201.121-3.674%207.844-4.79%2011.207-13%2023.879-4.372%205.527-2.19%204.097-10.689%2012.258-5.166%202.748-4.191%203.45-14.311%206.242-17.67%201.983-35.336%201.983-53%200-9.535-3.774-10.879-4.163-18.526-11.22-5.562-4.39-11.131-11.803-11.974-15.28-4.068-7.881-3.42-9.116-5.5-13.5-3.672-1.503-35.798.203-40.746-1.335-5.823-2.314-2.946-.422-7.954-3.689-2.888-2.668-2.255-3.221-2.421-9.904L20.771%2050.275c.36-2.108-.41-5.806%202.522-11.615%204.343-5.852%205.374-7%2010.061-9.146%206.083-2.73%208.677-1.475%2010.917-2.239z'/%3e%3cpath%20d='M258.271%2030.275l154.63.407c5.654.559%2010.783%203.17%2014.37%207.093%204.907%204.408%206.204%208.723%207.5%2013.5v373c-.208%205.716-.297%207.982-4.848%2015.404-7.078%206.393-9.879%206.39-15.652%206.692-24.804%201.296-50.079%201.189-74.96%201.041-24.516-.014-68.46.89-81.5.391l-2.512-172.528c-20.083%2012.625-42.777%2025.125-63.028%2037.5-4.127%201.292-7.294.125-9.5-3.5l1-137c1.864-2.707%204.364-3.541%207.5-2.5%2020.366%2013.427%2064.35%2038.947%2065.581%2038.339l1.419-177.839z'%20fill='%23DDD'/%3e%3c/svg%3e",mk="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20512%20512'%20width='32'%20height='32'%3e%3cpath%20fill='%23007acc'%20d='M-.5-.5h503l-1%20179h10v333h-421v-7h-91V-.5z'/%3e%3cpath%20fill='%230f81cf'%20d='M502.5-.5h9v179h-10l1-179z'/%3e%3cpath%20fill='%23fdfefe'%20d='M470.5%20227.5c.33%2017.508-.003%2034.841-1%2052-23.486-15.709-48.82-19.875-76-12.5-15.89%208.078-19.39%2019.911-10.5%2035.5%204.673%205.577%2010.173%2010.077%2016.5%2013.5l38%2019c17.945%209.278%2031.112%2023.112%2039.5%2041.5%201.352%203.22%202.186%206.553%202.5%2010a305.16%20305.16%200%200%201%201%2026c-3.553%2033.726-21.886%2054.559-55%2062.5-34.769%207.363-68.435%204.196-101-9.5-.167-19.003%200-38.003.5-57%2022.903%2021.314%2049.736%2029.147%2080.5%2023.5%2019.435-5.701%2025.268-17.868%2017.5-36.5-4.718-6.44-10.552-11.606-17.5-15.5a1552.42%201552.42%200%200%201-47-24c-27.679-19.331-38.846-45.831-33.5-79.5%206.43-26.433%2022.597-43.933%2048.5-52.5%2026.131-6.625%2052.464-7.292%2079-2a565.56%20565.56%200%200%201%2018%205.5z'/%3e%3cpath%20fill='%23fefefe'%20d='M122.5%20222.5h182v46h-65v206h-52v-206h-65v-46z'/%3e%3cpath%20fill='%2370b3e1'%20d='M470.5%20227.5c1.327%2017.505%201.327%2035.171%200%2053-.607-.124-.94-.457-1-1%20.997-17.159%201.33-34.492%201-52z'/%3e%3cpath%20fill='%236cafe0'%20d='M479.5%20386.5c1.465%205.09%202.132%2010.423%202%2016-.002%203.518-.335%206.851-1%2010a305.16%20305.16%200%200%200-1-26z'/%3e%3cpath%20fill='%231283cf'%20d='M-.5%20504.5h91v7h-91v-7z'/%3e%3c/svg%3e",fk="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIj4KICAgIDxyYWRpYWxHcmFkaWVudCBpZD0ibXlHcmFkaWVudCI+CiAgICAgICAgPHN0b3Agb2Zmc2V0PSIxMCUiIHN0b3AtY29sb3I9IiMxQzJENUYiIC8+CiAgICAgICAgPHN0b3Agb2Zmc2V0PSI5NSUiIHN0b3AtY29sb3I9IiMwQjFENTMiIC8+CiAgICA8L3JhZGlhbEdyYWRpZW50PgogICAgPHBhdGggZmlsbD0idXJsKCcjbXlHcmFkaWVudCcpIiBkPSJNLS4xLS4xaDUxMnY1MTJILS4xVi0uMXoiLz4KICAgIDxwYXRoIGZpbGw9IiNmOGY4ZmEiCiAgICAgICAgICBkPSJNNDgyLjUgMjMxLjV2NmgtMjVjLS45NzItOC4xNy01LjYzOS0xMi4xNy0xNC0xMi05LjUzMS4wMjktMT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0LTF2LTE2Yy0xNC44NDMuMzI5LTI5LjUxLS4wMDQtNDQtMXoiLz4KICAgIDxwYXRoIGZpbGw9IiNhMmE5YmUiIGQ9Ik00MjguNSAyNzUuNWgtMjV2OGMtLjk3Ny0yLjc4Ny0xLjMxLTUuNzg3LTEtOSA4Ljg0OS0uMzI2IDE3LjUxNi4wMDcgMjYgMXoiLz4KICAgIDxwYXRoIGZpbGw9IiNhNWFjYmYiCiAgICAgICAgICBkPSJNMTEzLjUgMzAxLjVjLjk3OC4zMTEgMS42NDUuOTc4IDIgMmwtMTYgMWMtNS43MTEtLjAwNS0xMS4wNDQtLjY3Mi0xNi0yYTEyOC4xOSAxMjguMTkgMCAwIDAgMTUuNSAxYzUuMjE2LS4wMDYgMTAuMDQ5LS42NzMgMTQuNS0yeiIvPgogICAgPHBhdGggZmlsbD0iI2E1YWNjMCIgZD0iTTIzMy41IDIwOS41djk0aDY5di0xN2MtMTMuNTEuMzI5LTI2Ljg0NC0uMDA0LTQwLTFoNDF2MTloLTcxYTIyNTYuNDEgMjI1Ni40MSAwIDAgMSAxLTk1eiIvPgogICAgPHBhdGggZmlsbD0iI2E2YWNjMCIKICAgICAgICAgIGQ9Ik0zMTYuNSAyMDkuNWMtLjk5OCAzMS4xNjItMS4zMzIgNjIuNDk2LTEgOTRoNzN2LTE3Yy0xNC44NDMuMzI5LTI5LjUxLS4wMDQtNDQtMWg0NXYxOWgtNzVhMjMwNC45NSAyMzA0Ljk1IDAgMCAxIDEtOTZjLjYwNy4xMjQuOTQuNDU3IDEgMXoiLz4KPC9zdmc+";class _m extends _e.Component{isShowInstance;oldId;constructor(s){super(s),this.state={name:s.name,id:s.id,instance:s.instance||0,prefix:_m.getPrefix(s.id)},this.isShowInstance=!s.folder&&!!s.instances&&(!!s.instance||!!s.instances[0]||s.instances.length>1),this.oldId=s.id}static getPrefix(s){const i=(s||"").split(".");return i.pop(),i.join(".")}getId(s){return s=(s||"").replace(/[\\/\][*,;'"`<>?\s]/g,"_"),`${this.state.prefix}.${s}`}handleCancel=()=>{this.props.onClose()};handleOk=()=>{this.props.onRename(this.oldId,this.state.id,this.state.name,this.state.instance===0?0:this.state.instance||void 0),this.props.onClose()};handleChange=s=>{this.setState({name:s,id:this.getId(s)})};render(){return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"md",fullWidth:!0,open:!0,"aria-labelledby":"confirmation-dialog-title",children:[m.jsx(ss,{id:"confirmation-dialog-title",children:x.I18n.t("Rename")}),m.jsx(qt,{children:m.jsxs("form",{noValidate:!0,autoComplete:"off",children:[m.jsx(Eo,{variant:"standard",style:{width:"100%"},id:"standard-name",autoFocus:!0,label:x.I18n.t("Name"),value:this.state.name,onKeyUp:s=>{s.key==="Enter"&&(s.preventDefault(),setTimeout(()=>this.handleOk(),200))},onChange:s=>this.handleChange(s.target.value),margin:"normal"}),m.jsx(Eo,{variant:"standard",id:"standard-name-id",style:{width:"100%"},label:x.I18n.t("ID"),value:this.state.id,disabled:!0,margin:"normal"}),this.isShowInstance&&m.jsxs(Di,{variant:"standard",children:[m.jsx(Ag,{htmlFor:"instance",children:x.I18n.t("Instance")}),m.jsx(Ai,{variant:"standard",value:this.state.instance,onChange:s=>this.setState({instance:parseInt(s.target.value,10)}),inputProps:{name:"instance",id:"instance"},children:this.props.instances.map(s=>m.jsx(it,{value:s,children:s||"0"},s))})]})]})}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",onClick:this.handleOk,color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Ok")}),m.jsx(He,{color:"grey",variant:"contained",onClick:this.handleCancel,startIcon:m.jsx(so,{}),children:x.I18n.t("Cancel")})]})]})}}class Cx extends _e.Component{constructor(s){super(s),this.state={name:s.name,id:s.id}}handleCancel=()=>{this.props.onClose()};handleOk=()=>{this.props.onDelete(this.state.id),this.props.onClose()};render(){return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"md",open:!0,"aria-labelledby":"confirmation-dialog-title",children:[m.jsx(ss,{id:"confirmation-dialog-title",children:x.I18n.t("Are you sure?")}),m.jsxs(qt,{children:[m.jsx(mc,{}),m.jsx("span",{style:{fontSize:14,fontWeight:"bold"},children:x.I18n.t("Delete %s",this.state.name)})]}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",onClick:this.handleOk,color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Ok")}),m.jsx(He,{color:"grey",variant:"contained",onClick:this.handleCancel,startIcon:m.jsx(so,{}),children:x.I18n.t("Cancel")})]})]})}}const Tx=""+new URL("tileJS-C48gYbHw.png",import.meta.url).href,Sx=""+new URL("tileTS-CsXmgy4B.png",import.meta.url).href,Ex=""+new URL("tileBlockly-BMpdinN3.png",import.meta.url).href,Ix=""+new URL("tileRules-BkbaFIhs.png",import.meta.url).href,jt={card:{maxWidth:345,minWidth:250,display:"inline-block",margin:"0 10px 0 10px"},media:{height:122},text:{maxWidth:218,minHeight:30},complexity:{fontWeight:"bold",fontStyle:"italic",marginBottom:8}};class Dn extends _e.Component{handleCancel=()=>{this.props.onClose()};static openHtml(s){const i=x.I18n.getLanguage();!s.includes("javascript.md")&&(i==="de"||i==="ru")&&(s=s.replace(/\/en\//,`/${i}/`));const r=window.open(s,"_blank");r==null||r.focus()}getJSCard(){return m.jsxs(Xl,{style:jt.card,children:[m.jsxs(Zl,{onClick:()=>this.props.onClose&&this.props.onClose("Javascript/js"),children:[m.jsx(Ql,{style:jt.media,image:Tx,title:"JavaScript"}),m.jsxs(ec,{children:[m.jsx("h2",{children:"JavaScript"}),m.jsx("div",{style:jt.complexity,children:x.I18n.t("for programmers")}),m.jsx("div",{style:jt.text,children:x.I18n.t("JS description")})]})]}),m.jsxs(tc,{children:[m.jsx(He,{size:"small",color:"primary",variant:"contained",onClick:()=>this.props.onClose&&this.props.onClose("Javascript/js"),children:x.I18n.t("Add")}),m.jsx(He,{size:"small",color:"secondary",onClick:()=>Dn.openHtml("https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/javascript.md"),children:x.I18n.t("Learn More")})]})]})}getTSCard(){return m.jsxs(Xl,{style:jt.card,children:[m.jsxs(Zl,{onClick:()=>this.props.onClose&&this.props.onClose("TypeScript/ts"),children:[m.jsx(Ql,{style:jt.media,image:Sx,title:"TypeScript"}),m.jsxs(ec,{children:[m.jsx("h2",{children:"TypeScript"}),m.jsx("div",{style:jt.complexity,children:x.I18n.t("for professionals")}),m.jsx("div",{style:jt.text,children:x.I18n.t("TS description")})]})]}),m.jsxs(tc,{children:[m.jsx(He,{size:"small",color:"primary",variant:"contained",onClick:()=>this.props.onClose&&this.props.onClose("TypeScript/ts"),children:x.I18n.t("Add")}),m.jsx(He,{size:"small",color:"secondary",onClick:()=>Dn.openHtml("https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/javascript.md"),children:x.I18n.t("Learn More")})]})]})}getBlocklyCard(){return m.jsxs(Xl,{style:jt.card,children:[m.jsxs(Zl,{onClick:()=>this.props.onClose&&this.props.onClose("Blockly"),children:[m.jsx(Ql,{style:jt.media,image:Ex,title:"Blockly"}),m.jsxs(ec,{children:[m.jsx("h2",{children:"Blockly"}),m.jsx("div",{style:jt.complexity,children:x.I18n.t("normal")}),m.jsx("div",{style:jt.text,children:x.I18n.t("Blockly description")})]})]}),m.jsxs(tc,{children:[m.jsx(He,{size:"small",color:"primary",variant:"contained",onClick:()=>this.props.onClose&&this.props.onClose("Blockly"),children:x.I18n.t("Add")}),m.jsx(He,{size:"small",color:"secondary",onClick:()=>Dn.openHtml("https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/blockly.md"),children:x.I18n.t("Learn More")})]})]})}getRulesCard(){return m.jsxs(Xl,{style:jt.card,children:[m.jsxs(Zl,{onClick:()=>this.props.onClose&&this.props.onClose("Rules"),children:[m.jsx(Ql,{style:jt.media,image:Ix,title:"Rules"}),m.jsxs(ec,{children:[m.jsx("h2",{children:"Rules"}),m.jsx("div",{style:jt.complexity,children:x.I18n.t("easy")}),m.jsx("div",{style:jt.text,children:x.I18n.t("Rules description")})]})]}),m.jsxs(tc,{children:[m.jsx(He,{size:"small",color:"primary",variant:"contained",onClick:()=>this.props.onClose&&this.props.onClose("Rules"),children:x.I18n.t("Add")}),m.jsx(He,{size:"small",color:"secondary",onClick:()=>Dn.openHtml("https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/javascript.md"),children:x.I18n.t("Learn More")})]})]})}render(){return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"lg",fullWidth:!0,open:!0,"aria-labelledby":"confirmation-dialog-title",children:[m.jsx(ss,{id:"confirmation-dialog-title",children:x.I18n.t("Add new script")}),m.jsxs(qt,{style:{textAlign:"center"},children:[this.getRulesCard(),this.getBlocklyCard(),this.getJSCard(),this.getTSCard()]}),m.jsx(Ht,{children:m.jsx(He,{color:"grey",onClick:this.handleCancel,startIcon:m.jsx(so,{}),children:x.I18n.t("Cancel")})})]})}}class og extends _e.Component{isShowInstance;constructor(s){super(s),this.state={name:s.name||"Script",instance:s.instance||0,parent:s.parent,error:"",id:""},this.isShowInstance=!s.folder&&!!s.instances&&(!!s.instance||!!s.instances[0]||s.instances.length>1)}getId(s){return s=s||this.state.name||"",s=s.replace(/[\\/\][.*,;'"`<>?\s]/g,"_").trim().replace(/\.$/,"_"),`${this.state?this.state.parent:this.props.parent}.${s}`}handleOk=()=>{this.props.onAdd(this.getId(this.state.name),this.state.name,this.state.instance,this.props.type),this.props.onClose()};render(){var s;return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"md",fullWidth:!0,open:!0,"aria-labelledby":"confirmation-dialog-title",children:[m.jsx(ss,{id:"confirmation-dialog-title",children:this.props.title||x.I18n.t("Create new")}),m.jsx(qt,{children:m.jsxs("form",{noValidate:!0,autoComplete:"off",children:[m.jsx(Eo,{variant:"standard",style:{width:"100%"},id:"standard-name",autoFocus:!0,error:!!this.state.error,label:x.I18n.t("Name"),value:this.state.name||"",helperText:this.state.error,slotProps:{input:{endAdornment:this.state.name?m.jsx(qe,{size:"small",onClick:()=>this.setState({name:""}),children:m.jsx(ZT,{})}):void 0}},onKeyUp:i=>{i.preventDefault(),i.key==="Enter"&&!this.state.error&&setTimeout(()=>this.handleOk(),200)},onChange:i=>{var c;const r=i.target.value,l=this.getId(r);r?(c=this.props.existingItems)!=null&&c.includes(l)?this.setState({name:r,id:l,error:x.I18n.t("Duplicate name")}):this.setState({name:r,id:l,error:""}):this.setState({name:r,id:l,error:x.I18n.t("Empty name is not allowed")})},margin:"normal"}),m.jsxs(Di,{variant:"standard",style:{width:"100%"},children:[m.jsx(Ag,{htmlFor:"parent",children:x.I18n.t("Folder")}),m.jsx(Ai,{variant:"standard",style:{width:"100%"},value:this.state.parent,onChange:i=>this.setState({parent:i.target.value}),inputProps:{name:"parent",id:"parent"},children:this.props.parents.map(i=>{const r=i.id.split(".");r.splice(0,2);const l=[];let c="script.js";return r.forEach(d=>{c+=`.${d}`;const h=this.props.parents.find(p=>p.id===c);h?l.push(h.name):l.push(d)}),l.length||l.push(i.name),m.jsx(it,{value:i.id,children:l.join(" / ")},i.id)})})]}),m.jsx(Eo,{variant:"standard",id:"standard-name-id",style:{width:"100%"},label:x.I18n.t("ID"),value:this.getId(),disabled:!0,margin:"normal"}),this.isShowInstance&&m.jsxs(Di,{variant:"standard",children:[m.jsx(Ag,{htmlFor:"instance",children:x.I18n.t("Instance")}),m.jsx(Ai,{variant:"standard",value:this.state.instance,onChange:i=>this.setState({instance:parseInt(i.target.value,10)}),inputProps:{name:"instance",id:"instance"},children:(s=this.props.instances)==null?void 0:s.map(i=>m.jsx(it,{value:i,children:i||"0"},`instance${i}`))})]})]})}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",onClick:this.handleOk,disabled:!!this.state.error,color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Ok")}),m.jsx(He,{color:"grey",variant:"contained",onClick:()=>this.props.onClose(),startIcon:m.jsx(so,{}),children:x.I18n.t("Cancel")})]})]})}}const xx={title:a=>({background:a.palette.error.main,color:a.palette.error.contrastText,"&>h2":{color:a.palette.error.contrastText}})};class su extends _e.Component{handleOk=()=>{this.props.onClose()};render(){return m.jsxs(Ut,{open:!0,maxWidth:"sm",fullWidth:!0,onClose:()=>this.handleOk(),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[m.jsx(ss,{sx:xx.title,id:"alert-dialog-title",children:this.props.title||x.I18n.t("Error")}),m.jsx(qt,{children:m.jsx(Dw,{id:"alert-dialog-description",children:this.props.text||x.I18n.t("Unknown error!")})}),m.jsx(Ht,{children:m.jsx(He,{variant:"contained",onClick:()=>this.handleOk(),color:"primary",autoFocus:!0,startIcon:m.jsx(qo,{}),children:x.I18n.t("Ok")})})]})}}const zr={icon:{width:24,height:24},filterWithButton:{width:"100%"},title:{fontWeight:"bold",marginTop:16}};class Dx extends _e.Component{constructor(s){super(s),this.state={instances:[],filter:window.localStorage.getItem("javascript.debug.filter")||"",showAskForStop:!1,jsInstance:window.localStorage.getItem("javascript.debug.instance")||"",jsInstanceHost:"",adapterToDebug:window.localStorage.getItem("javascript.debug.adapter")||""}}componentDidMount(){this.props.socket.getAdapterInstances().then(s=>{const i=s.filter(h=>{var p;return h&&!((p=h.common)!=null&&p.onlyWWW)}).map(h=>{var b,y,w;const p=h._id.replace(/^system\.adapter\./,""),[f]=p.split(".");return{id:p,enabled:(b=h.common)==null?void 0:b.enabled,host:(y=h.common)==null?void 0:y.host,icon:(w=h.common)!=null&&w.icon?`../../adapter/${f}/${h.common.icon}`:""}});i.sort((h,p)=>h.id>p.id?1:h.idh.id===this.state.jsInstance):null;let c;if(!this.state.jsInstance||!l){const h=i.find(p=>p.id.startsWith("javascript."));c=(h==null?void 0:h.host)||"",r=(h==null?void 0:h.id)||""}else c=(l==null?void 0:l.host)||"";let d=this.state.adapterToDebug||"";d&&!i.find(h=>h.id===d)&&(d=""),this.setState({instances:i,jsInstance:r,adapterToDebug:d,jsInstanceHost:c})})}handleOk=()=>{var s;if((s=this.state.instances.find(i=>i.id===this.state.adapterToDebug))!=null&&s.enabled){this.props.socket.getObject(`system.adapter.${this.state.adapterToDebug}`).then(i=>{i&&(i.common.enabled=!1,this.props.socket.setObject(i._id,i).then(()=>this.props.onDebug(this.state.jsInstance,this.state.adapterToDebug)))});return}this.props.onDebug(this.state.jsInstance,this.state.adapterToDebug)};renderJavascriptList(){const s=this.state.instances.filter(i=>i.id.startsWith("javascript."));return s.length<2?null:m.jsxs(Si,{children:[m.jsx("div",{style:zr.title,children:x.I18n.t("Host")}),m.jsx(Og,{component:"nav",children:s.map(i=>m.jsxs(s_,{component:"div",selected:this.state.jsInstance===i.id,onClick:()=>this.setState({jsInstance:i.id,jsInstanceHost:i.host}),children:[m.jsx(Rg,{children:m.jsx("img",{src:i.icon,alt:i.id,style:zr.icon})}),m.jsx(Ng,{primary:i.id})]},i.id))})]})}renderInstances(){if(!this.state.jsInstance)return m.jsx(Si,{});const s=this.state.instances.filter(i=>i.id!==this.state.jsInstance&&i.host===this.state.jsInstanceHost&&(!this.state.filter||i.id.includes(this.state.filter.toLowerCase())));return m.jsxs(Si,{children:[m.jsx("div",{style:zr.title,children:x.I18n.t("Instances")}),m.jsx(Og,{component:"nav",children:s.map(i=>m.jsxs(s_,{selected:this.state.adapterToDebug===i.id,onDoubleClick:()=>this.setState({adapterToDebug:i.id},()=>this.handleOk()),onClick:()=>this.setState({adapterToDebug:i.id}),children:[m.jsx(Rg,{children:m.jsx("img",{src:i.icon,alt:i.id,style:zr.icon})}),m.jsx(Ng,{primary:i.id})]},i.id))})]})}render(){return m.jsxs(Ut,{maxWidth:"md",fullWidth:!1,open:!0,onClose:()=>!1,"aria-labelledby":"confirmation-dialog-title",children:[m.jsx(ss,{id:"confirmation-dialog-title",children:this.props.title||x.I18n.t("Debug instance")}),m.jsx(qt,{children:m.jsxs(Si,{container:!0,direction:"column",children:[m.jsx(Si,{children:m.jsx(Pn,{style:zr.filterWithButton,value:this.state.filter,placeholder:x.I18n.t("Filter"),onChange:s=>{this.setState({filter:s.target.value}),window.localStorage.setItem("javascript.debug.filter",s.target.value)},endAdornment:m.jsx(Aw,{position:"end",children:this.state.filter?m.jsx(qe,{size:"small","aria-label":"toggle password visibility",onClick:()=>this.setState({filter:""}),children:m.jsx(Mw,{})}):""})})}),m.jsx(Si,{children:m.jsxs(Si,{container:!0,children:[this.renderJavascriptList(),this.renderInstances()]})})]})}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",onClick:this.handleOk,disabled:!this.state.jsInstance||!this.state.adapterToDebug,color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Start")}),m.jsx(He,{color:"grey",variant:"contained",onClick:()=>this.props.onClose(),startIcon:m.jsx(so,{}),children:x.I18n.t("Close")})]})]})}}function $k(a){if(!a)throw new Error("Password must be a non-empty string.")}function Gg(a){return new TextEncoder().encode(a)}function Ax(a){return new TextDecoder().decode(a)}function Ox(a){let s="";for(let i=0;i({height:a.toolbar.height}),toolbarButtons:a=>({color:a.palette.mode==="dark"?"white !important":"black !important"}),iconButtonsDisabled:{filter:"grayscale(100%)",opacity:.5},toolbarSearch:{width:"calc(100% - 105px)",lineHeight:"34px",marginLeft:5},iconButtons:{width:32,height:32,padding:2},iconDropdownMenu:{paddingRight:5},menu:{width:"100%",height:"100%"},innerMenu:{width:"100%",height:"calc(100% - 76px)",overflowX:"hidden",overflowY:"auto"},listItemIcon:{minWidth:32},scriptIcon:{width:18,height:18,borderRadius:2,marginTop:4,marginBottom:4,marginLeft:8,marginRight:4},folder:{cursor:"pointer",padding:0,userSelect:"none"},folderReorder:{opacity:.3,transitionDuration:"0.5s",transitionProperty:"opacity"},folderIcon:{width:20,height:20},folderIconReorder:{paddingTop:4,paddingBottom:4,paddingLeft:8,paddingRight:4},folderIconNoReorder:{cursor:"pointer",paddingTop:4,paddingBottom:4,paddingLeft:8,paddingRight:4},script:{cursor:"pointer",padding:0,userSelect:"none"},scriptReorder:{opacity:1,transitionDuration:"0.5s",transitionProperty:"opacity"},reorder:{},selected:window.vendorPrefix?a=>({backgroundColor:a.palette.primary.main,color:a.palette.text.primary}):{backgroundColor:"#164477",color:"white"},instances:{fontSize:"smaller",fontWeight:"bold",marginRight:4},childrenCount:{fontSize:10,opacity:.4},footer:{height:24,display:"flex"},footerButtons:a=>({"& img":{color:a.palette.mode==="dark"?"#ffffff":"#111111",cursor:"pointer",mt:"1px",mr:"2px",height:22,width:22,"&:hover":{backgroundColor:"#dbdbdb"}},"& svg":{color:a.palette.mode==="dark"?"#ffffff":"#111111",cursor:"pointer",mt:"1px",mr:"2px",height:22,width:22,"&:hover":{backgroundColor:"#dbdbdb"}}}),footerButtonsRight:{float:"right"}},Tn={Blockly:gk,"Javascript/js":Tc,def:Tc,Rules:fk,"TypeScript/ts":mk};function Kg(a,s,i){var r;return i=i||x.I18n.getLanguage(),(r=s==null?void 0:s.common)!=null&&r.name?typeof s.common.name=="object"?(s.common.name[i]||s.common.name.en||a.replace(/^script\.js./,"")).toString():s.common.name.toString():a.replace(/^script\.js./,"")}function E_(a){var l;const s=[{id:Jt,depth:0,index:0,parent:null,title:"root",type:"folder",parentIndex:null}],i=Object.keys(a);for(let c=0;c1?h.join("."):null,instance:d.common.engine?parseInt(d.common.engine.split(".").pop(),10)||0:null,index:0,parentIndex:0}):s.push({id:i[c],title:Kg(i[c],d),depth:h.length-1,type:"folder",parent:h.length>1?h.join("."):null,index:0,parentIndex:null})}let r;do r=!1,s.forEach(c=>{if(c.parent&&!s.find(h=>h.id===c.parent)){const h=c.parent.split(".");h.pop(),s.push({id:c.parent,title:c.parent.split(".").pop()||"",depth:h.length-1,type:"folder",parent:h.length>1?h.join("."):null,index:0,parentIndex:null}),r=!0}});while(r);return s.sort((c,d)=>{const h=c.id.toLowerCase(),p=d.id.toLowerCase();return c.type==="folder"&&d.type!=="folder"?-1:d.type==="folder"&&c.type!=="folder"||h>p?1:hc.index=d),s.forEach(c=>{if(c.parent){const d=s.find(h=>h.id===c.parent);d&&(c.parentIndex=d.index)}}),s}function Lx(a){const{onDrop:s}=a,[{isOver:i,isOverAny:r},l]=WI({accept:"script",drop:c=>i?s(c):void 0,collect:c=>({isOver:c.isOver({shallow:!0}),isOverAny:c.isOver()})});return m.jsx("div",{ref:l,style:{background:i?"#40adff":void 0,opacity:r?.7:void 0},children:a.children},a.folderName)}function I_(a){const{name:s}=a,[{opacity:i},r]=LI({type:"script",item:()=>({name:s}),collect:l=>({opacity:l.isDragging()?.3:1})});return m.jsx("div",{ref:r,style:{opacity:i,transform:"translate3d(0, 0, 0)"},children:a.children},s)}class So extends _e.Component{inputRef;filterTimer;problems;problemsTimer;onProblemUpdatedBound;parent=null;constructor(s){super(s);const i=window.localStorage?window.localStorage.getItem("SideMenu.expanded"):"[]";let r;try{r=JSON.parse(i||"[]")||[]}catch{r=[]}this.inputRef=_e.createRef(),this.state={listItems:E_(s.scripts||{}),expanded:r,problems:[],reorder:!1,themeName:this.props.themeName,selected:window.localStorage&&window.localStorage.getItem("SideMenu.selected")||null,creatingScript:null,creatingFolder:!1,copingScript:"",renaming:null,deleting:null,choosingType:!1,errorText:"",instances:s.instances||[],menuOpened:!1,menuAnchorEl:null,menuAnchorFilterEl:null,searchMode:!1,expertMode:this.props.expertMode,searchText:"",width:this.props.width||300,typeFilter:window.localStorage&&window.localStorage.getItem("SideMenu.typeFilter")||"",statusFilter:window.localStorage&&window.localStorage.getItem("SideMenu.statusFilter")||"",runningInstances:this.props.runningInstances||{},scriptsHash:s.scriptsHash,showAdapterDebug:!1,isAllZeroInstances:!1,showExportDialog:!1};const l=this.ensureSelectedIsVisible();l&&Object.assign(this.state,{expanded:l}),this.filterTimer=null,Object.assign(this.state,{isAllZeroInstances:this.getIsAllZeroInstances()}),this.problems=null,this.problemsTimer=null,this.onProblemUpdatedBound=this.onProblemUpdated.bind(this)}readProblems(s,i){var r,l;if(i||(i=Object.keys(this.props.scripts)),!i||!i.length)s&&s();else{const c=i.shift(),d=this.props.scripts[c];if(((r=this.props.scripts)==null?void 0:r[c].type)==="script"&&((l=d.common)!=null&&l.enabled)&&!c.match(/^script\.js\.global\./)){const h=d.common.engine.split(".").pop(),p=this,f=`javascript.${h}.scriptProblem.${c.substring(Jt.length+1)}`;this.props.socket.getState(f).then(b=>{p.onProblemUpdated(f,b),setTimeout(()=>p.readProblems(s,i),0)})}else setTimeout(()=>this.readProblems(s,i),0)}}componentDidMount(){this.readProblems(()=>{this.props.instances.forEach(s=>{this.props.socket.subscribeState(`javascript.${s}.scriptProblem.*`,this.onProblemUpdatedBound)})})}componentWillUnmount(){this.props.instances.forEach(s=>{this.props.socket.unsubscribeState(`javascript.${s}.scriptProblem.*`,this.onProblemUpdatedBound)})}onProblemUpdated(s,i){if(!i||!s)return;s=`${Jt}.${s.replace(/^javascript\.\d+\.scriptProblem\./,"")}`,this.problems||(this.problems=JSON.parse(JSON.stringify(this.state.problems))||[]);let r=!1;if(i.val)this.problems.includes(s)||(this.problems.push(s),r=!0);else{const l=this.problems.indexOf(s);l!==-1&&(this.problems.splice(l,1),r=!0)}r&&!this.problemsTimer&&(this.problemsTimer=setTimeout(()=>{this.problemsTimer=null,this.setState({problems:this.problems}),this.problems=null},300))}static filterListStatic(s,i,r,l,c){i=JSON.parse(JSON.stringify(i));let d=!1;const h={listItems:i};if(s&&r&&l){const p=l.toLowerCase();if(i.forEach(f=>{var v;const b=f.title.toLowerCase();f.filteredPartly=!1;let y=b.includes(p);const w=(v=c==null?void 0:c[f.id])==null?void 0:v.common;if(!y&&(w!=null&&w.source))if(w.engineType==="Blockly"){const _=w.source.lastIndexOf("//");y=w.source.substring(0,_).toLowerCase().includes(p)}else y=w.source.toLowerCase().includes(p);y?f.filtered&&(f.filtered=!1,d=!0):f.filtered||(f.filtered=!0,d=!0)}),d)for(let f=i.length-1;f>=0;f--){const b=i[f];if(!b.filtered||b.filteredPartly){let y=b;do y!=null&&y.parent&&i[y.parentIndex]&&(d=!0,i[y.parentIndex].filteredPartly=!0),y=y!=null&&y.parent&&i[y.parentIndex]?i[y.parentIndex]:null;while(y)}}}else i.forEach(p=>{(p.filtered||p.filteredPartly)&&(p.filtered=!1,p.filteredPartly=!1,d=!0)}),s||(h.searchText="",h.searchMode=!1,d=!0);return d?h:null}filterList(s,i){const r=So.filterListStatic(s,this.state.listItems,this.state.searchMode,this.state.searchText,this.props.scripts);r?this.setState(r,()=>i&&i()):i&&i()}static ensureSelectedIsVisibleStatic(s,i,r){i=JSON.parse(JSON.stringify(i));let l=!1,c=typeof s=="object"?s:r.find(d=>d.id===s);do{if(c!=null&&c.parent){const d=c.parent;c=r.find(h=>h.id===d)}else c=void 0;c&&(i.includes(c.id)||(i.push(c.id),l=!0))}while(c);return l?i:null}ensureSelectedIsVisible(s,i){return So.ensureSelectedIsVisibleStatic(s||this.state.selected,i||this.state.expanded,this.state.listItems)}static getDerivedStateFromProps(s,i){const r={};let l=!1;if(i.expertMode!==s.expertMode&&(l=!0,r.expertMode=s.expertMode),i.scriptsHash!==s.scriptsHash&&s.scripts){const c=E_(s.scripts||{});if(r.listItems=c,i.searchText){const p=So.filterListStatic(!0,c,i.searchMode,i.searchText,s.scripts);p&&Object.assign(r,p)}const d=So.getIsAllZeroInstancesStatic(c,s.instances||[]),h=So.ensureSelectedIsVisibleStatic(i.selected,i.expanded,i.listItems);r.isAllZeroInstances=d,h&&(r.expanded=h),l=!0}if(i.width!==s.width&&(l=!0,r.width=s.width),i.themeName!==s.themeName&&(l=!0,r.themeName=s.themeName),s.selectId&&i.selected!==s.selectId){const c=i.listItems.find(d=>d.id===s.selectId);if(!i.reorder&&c){const d=So.ensureSelectedIsVisibleStatic(c,i.expanded,i.listItems);r.selected=c.id,d&&(r.expanded=d),l=!0,window.localStorage&&window.localStorage.setItem("SideMenu.selected",c.id)}}return l?r:null}static getIsAllZeroInstancesStatic(s,i){let r=!i[0]&&i.length<=1;return r&&s.forEach(l=>{l.type!=="folder"&&l.instance!==0&&(r=!1)}),r}getIsAllZeroInstances(s,i){return s=s||this.state.listItems,i=i||this.state.instances,So.getIsAllZeroInstancesStatic(s||this.state.listItems,i||this.state.instances)}saveExpanded(s){window.localStorage.setItem("SideMenu.expanded",JSON.stringify(s||this.state.expanded))}showError(s){this.setState({errorText:s})}onToggle(s,i){if(i==null||i.stopPropagation(),s===Jt)return;const r=[...this.state.expanded],l=r.indexOf(s);l!==-1?(r.splice(l,1),this.state.selected&&this.state.selected.startsWith(`${s}.`)&&window.localStorage&&window.localStorage.setItem("SideMenu.selected",s)):(r.push(s),r.sort()),this.setState({expanded:r}),this.saveExpanded(r)}renderItemButtonsOnEnd(s,i){if(this.state.reorder)return null;if(s.type!=="folder"){let r=s.enabled?ig:ng;return s.enabled&&this.state.problems.includes(s.id)&&(r=S_),[m.jsx(qe,{onClick:l=>{l.stopPropagation(),this.props.onEnableDisable&&this.props.onEnableDisable(s.id,!s.enabled)},title:s.enabled?x.I18n.t("Pause script"):x.I18n.t("Run script"),disabled:this.props.debugMode,style:{...Pe.iconButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0,color:r},size:"medium",children:s.enabled?m.jsx(bc,{}):m.jsx(Wg,{})},"startStop"),this.state.width>Ur?m.jsx(qe,{style:this.props.debugMode?Pe.iconButtonsDisabled:void 0,title:x.I18n.t("Delete script"),disabled:s.id===To||s.id===Cn||this.props.debugMode,onClick:l=>this.onDelete(s,l),size:"medium",children:m.jsx(mc,{})},"delete"):null,m.jsx(qe,{style:this.props.debugMode?Pe.iconButtonsDisabled:void 0,disabled:this.props.debugMode,title:x.I18n.t("Edit script or just double click"),onClick:l=>this.onEdit(s,l),size:"medium",children:m.jsx(px,{})},"openInEdit")]}return this.state.width>Ur&&s.id!==Jt&&s.id!==Cn&&s.id!==To&&!(i!=null&&i.length)?m.jsx(qe,{style:this.props.debugMode?Pe.iconButtonsDisabled:void 0,title:x.I18n.t("Delete folder"),disabled:s.id===To||s.id===Cn||this.props.debugMode,onClick:r=>this.onDelete(s,r),size:"medium",children:m.jsx(mc,{})},"delete"):null}onDelete(s,i){return i==null||i.stopPropagation(),new Promise(r=>{if(!s){r();return}typeof s!="object"?this.setState({deleting:s},()=>r()):this.setState({deleting:s.id},()=>r())})}onEdit(s,i){this.onClick(s,i),this.props.onEdit&&this.props.onEdit(s.id)}getTextStyle(s){return!this.state.reorder&&s.type!=="folder"?{width:`calc(100% - ${this.state.width>Ur?185:137}px)`,overflow:"hidden",whiteSpace:"nowrap",flex:"none",padding:"0 16px 0 0"}:{whiteSpace:"nowrap",padding:"0 16px 0 0"}}onClick(s,i){if(i==null||i.stopPropagation(),!this.state.reorder&&s){const r=this.ensureSelectedIsVisible(s),l={selected:s.id};r&&(l.expanded=r),this.setState(l),window.localStorage&&window.localStorage.setItem("SideMenu.selected",s.id)}}onDblClick(s,i){i==null||i.stopPropagation(),!this.state.reorder&&(s.type==="folder"?this.onToggle(s.id):this.onEdit(s))}isFilteredOut(s){var i,r;return s.filtered&&!s.filteredPartly||this.state.typeFilter&&s.type!=="folder"&&s.type.toLowerCase()!==this.state.typeFilter.toLowerCase()||!this.state.expertMode&&((r=(i=this.props.scripts[s.id])==null?void 0:i.native)!=null&&r.protected)||this.state.statusFilter&&s.type!=="folder"&&(this.state.statusFilter==="running"&&!s.enabled||this.state.statusFilter==="paused"&&s.enabled||this.state.statusFilter==="problems"&&(!s.enabled||this.state.problems.indexOf(s.id)===-1))?!0:s.id===To&&!this.state.expertMode}renderListItem(s,i,r){var w,v;if(s.id===Jt&&!this.state.reorder)return null;const l=(this.state.reorder?s.depth:s.depth-1)*Mx;let c=s.title;if(this.state.searchText){const _=c.toLowerCase().indexOf(this.state.searchText.toLowerCase());_!==-1&&(c=[m.jsx("span",{children:c.substring(0,_)},"first"),m.jsx("span",{style:{color:"orange"},children:c.substring(_,_+this.state.searchText.length)},"second"),m.jsx("span",{children:c.substring(_+this.state.searchText.length)},"third")])}if(!this.state.isAllZeroInstances&&s.type!=="folder"){const _=this.state.runningInstances[`system.adapter.javascript.${s.instance}`];c=[m.jsxs("span",{title:`${x.I18n.t("Instance")} ${s.instance}${_?"":` (${x.I18n.t("not running")})`}`,style:{...Pe.instances,color:_?ig:ng},children:["[",s.instance,"]"]},"instance"),m.jsx("span",{children:c},"title")]}const d=this.state.reorder&&!this.props.debugMode,h={marginLeft:l,cursor:s.type==="folder"&&d?"default":"inherit",width:`calc(100% - ${l}px)`};d||(h.opacity=s.filteredPartly?.5:1),s.id===To&&s.id!==this.state.selected&&(h.color="#00a200");let p=s.id===Jt;!p&&i&&(p=this.state.expanded.includes(s.id));let f;s.type==="folder"?f={...Pe.folderIcon,...d?Pe.folderIconReorder:Pe.folderIconNoReorder}:f={...Pe.scriptIcon},s.id===To?f.color="#356956":s.id===Cn&&(f.color="#4899e1");let b=null;(r&&r.length||i&&i.length)&&(b=m.jsx("span",{style:Pe.childrenCount,children:r&&r.length!==i.length?`${r.length}(${i.length})`:i.length}));const y={...s.type==="folder"?Pe.folder:Pe.script,...d?Pe.reorder:void 0,...d&&s.type!=="folder"?Pe.scriptReorder:void 0,...d&&s.type==="folder"?Pe.folderReorder:void 0,...h};return m.jsxs(LT,{style:y,sx:s.id===this.state.selected&&!d?Pe.selected:void 0,className:x.Utils.clsx(d&&s.type==="folder"&&"folder-reorder",d&&s.type!=="folder"&&"script-reorder"),onClick:_=>this.onClick(s,_),onDoubleClick:_=>this.onDblClick(s,_),secondaryAction:this.renderItemButtonsOnEnd(s,i),children:[(v=(w=this.props.scripts[s.id])==null?void 0:w.native)!=null&&v.protected?m.jsx(T_,{style:{color:"orange",position:"absolute",right:5,width:10,height:10}}):null,m.jsx(Rg,{style:Pe.listItemIcon,children:s.type==="folder"?d||p?m.jsx(QT,{style:f,onClick:_=>!d&&this.onToggle(s.id,_)}):m.jsx(eS,{style:f,onClick:_=>!d&&this.onToggle(s.id,_)}):m.jsx("img",{style:f,alt:s.type,src:Tn[s.type]||Tn.def})}),m.jsx(Ng,{sx:{"& .MuiListItemText-primary":s.id===this.state.selected&&!d?Pe.selected:void 0},style:this.getTextStyle(s),primary:m.jsxs("span",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[c,b]})})]},s.id)}onDragFinish(s,i){let r=`${i}.${s.split(".").pop()}`;r!==s&&(this.state.listItems.find(l=>l.id===r)&&(r+=`_${x.I18n.t("copy")}`),this.props.onRename&&this.props.onRename(s,r))}renderOneItem(s,i){const r=this.state.statusFilter||this.state.typeFilter?s.filter(f=>f.parent===i.id?!this.isFilteredOut(f):!1):[],l=s.filter(f=>f.parent===i.id);if(this.isFilteredOut(i)||i.type==="folder"&&(this.state.statusFilter||this.state.typeFilter)&&!r.length)return null;const c=this.state.reorder&&!this.props.debugMode,d=this.renderListItem(i,l,r),h=[];let p;return l&&(c||this.state.expanded.includes(i.id)||i.id===Jt)&&(p=l.map(f=>this.renderOneItem(s,f))),c?i.type==="folder"?h.push(m.jsxs(Lx,{onDrop:f=>this.onDragFinish(f.name,i.id),folderName:i.id,children:[m.jsx(I_,{name:i.id,children:d},`draggable_${i.id}`),p||null]},`droppable_${i.id}`)):h.push(m.jsxs(I_,{name:i.id,children:[d,p||null]},`draggable_${i.id}`)):(h.push(d),p==null||p.forEach(f=>h.push(f))),h}renderAllItems(s){const i=s.filter(r=>!r.parent).map(r=>this.renderOneItem(s,r));return m.jsx(Og,{dense:!0,disablePadding:!0,sx:Pe.mainList,children:i})}onAddNew(s){s==null||s.stopPropagation();let i=this.state.listItems.find(l=>l.id===this.state.selected),r=Jt;for(;i&&i.type!=="folder";)i=this.state.listItems[i.parentIndex];i&&(r=i.id),this.parent=r,this.setState({choosingType:!0})}onCopy(s,i){s==null||s.stopPropagation();let r=this.state.listItems.find(c=>c.id===i),l=Jt;for(;r&&r.type!=="folder";)r=this.state.listItems[r.parentIndex];r&&(l=r.id),this.parent=l,this.setState({copingScript:i||""})}onAddNewFolder(s){s==null||s.stopPropagation();let i=this.state.listItems.find(l=>l.id===this.state.selected),r=Jt;for(;i&&i.type!=="folder";)i=this.state.listItems[i.parentIndex];i&&(r=i.id),this.parent=r,this.setState({creatingFolder:!0})}onRename(s){s==null||s.stopPropagation(),this.setState({renaming:this.state.selected})}getUniqueName(s){let i=1,r=`${x.I18n.t("Script")} `;if(s){const l=Kg(s,this.props.scripts[s]),c=l.match(/\d+$/);c?(r=l.replace(/\d+$/,""),i=parseInt(c[0],10)+1):r=l}for(;this.state.listItems.find(l=>l.id===`${this.parent}.${r.replace(/\.\s/g,"_")}${i}`);)i++;return r+i}getUniqueFolderName(){let s=1;for(;this.state.listItems.find(i=>i.id===`${this.parent}.${x.I18n.t("Folder")}_${s}`);)s++;return`${x.I18n.t("Folder")} ${s}`}onCloseMenu(s){this.setState({menuOpened:!1,menuAnchorEl:null,menuAnchorFilterEl:null},s)}getMainMenu(s,i){var l,c,d,h;const r=this.state.expertMode&&!!Object.keys(this.props.changedScripts).find(p=>{var f,b;return this.props.changedScripts[p]&&((b=(f=this.props.scripts[p])==null?void 0:f.native)==null?void 0:b.protected)});return m.jsxs(pm,{id:"long-menu",anchorEl:this.state.menuAnchorEl,open:this.state.menuOpened,onClose:()=>this.setState({menuOpened:!1,menuAnchorEl:null}),slotProps:{paper:{style:{maxHeight:Nx*7.5}}},children:[this.state.width<=Ur?m.jsxs(it,{disabled:this.props.debugMode||!this.state.selected||this.state.selected===To||this.state.selected===Cn||!!(s!=null&&s.length),onClick:p=>{if(p.stopPropagation(),p.preventDefault(),this.state.listItems.find(f=>f.parent===this.state.selected)){this.showError(x.I18n.t("Cannot delete non empty item!"));return}this.setState({menuOpened:!1,menuAnchorEl:null},()=>this.onDelete(this.state.selected).then(()=>{}))},children:[m.jsx(mc,{style:{...Pe.iconDropdownMenu,color:"red"}}),x.I18n.t("Delete")]},"delete"):null,m.jsxs(it,{disabled:this.props.debugMode||r,selected:this.state.expertMode,onClick:p=>{p.stopPropagation(),p.preventDefault(),this.onCloseMenu(()=>this.props.onExpertModeChange&&this.props.onExpertModeChange(!this.state.expertMode))},children:[m.jsx(x.IconExpert,{style:{...Pe.iconDropdownMenu,color:this.state.expertMode?"orange":"inherit"}}),x.I18n.t("Expert mode")]},"expertMode"),this.props.onExport&&m.jsxs(it,{onClick:p=>{p.stopPropagation(),p.preventDefault(),this.onCloseMenu(()=>this.setState({showExportDialog:!0}))},children:[m.jsx(kc,{style:Pe.iconDropdownMenu}),x.I18n.t("Export all scripts")]},"exportAll"),this.props.onImport&&m.jsxs(it,{disabled:this.props.debugMode,onClick:p=>{p.stopPropagation(),p.preventDefault(),this.onCloseMenu(()=>this.props.onImport())},children:[m.jsx(Lg,{style:Pe.iconDropdownMenu}),x.I18n.t("Import scripts")]},"import"),this.props.onThemeChange&&m.jsxs(it,{onClick:()=>this.onCloseMenu(()=>{this.props.onThemeChange&&this.props.onThemeChange(x.Utils.toggleTheme(this.state.themeName))}),children:[m.jsx(mx,{style:Pe.iconDropdownMenu}),x.I18n.t('Change theme (actual "%s")',this.state.themeName)]},"dark"),this.props.onAddNew&&m.jsxs(it,{disabled:!this.state.selected||!i||i.type==="folder",onClick:p=>{const f=this.state.selected;this.onCloseMenu(()=>this.onCopy(p,f))},children:[m.jsx(tS,{style:Pe.iconDropdownMenu}),x.I18n.t("Copy script")]},"copy"),this.state.expertMode&&m.jsxs(it,{disabled:this.props.debugMode,onClick:p=>{p.stopPropagation(),p.preventDefault(),this.onCloseMenu(()=>this.setState({showAdapterDebug:!0}))},children:[m.jsx(lx,{style:Pe.iconDropdownMenu}),x.I18n.t("Debug instance")]},"debugInstance"),this.state.selected&&this.props.password&&this.props.scripts[this.state.selected].type==="script"?m.jsxs(it,{disabled:this.props.debugMode||this.props.changedScripts[this.state.selected],onClick:p=>{p.stopPropagation(),p.preventDefault(),this.onCloseMenu(async()=>{var b;const f=await this.props.socket.getObject(this.state.selected);f&&((b=f.native)!=null&&b.protected?(delete f.native.protected,f.common.source=Vg(this.props.password,f.common.source||"")):(f.native||={},f.native.protected=!0,f.common.source=vc(this.props.password,f.common.source||"")),await this.props.socket.setObject(f._id,f))})},children:[m.jsx(T_,{style:{...Pe.iconDropdownMenu,color:"orange"}}),(c=(l=this.props.scripts[this.state.selected])==null?void 0:l.native)!=null&&c.protected?m.jsx("span",{style:{color:(h=(d=this.props.scripts[this.state.selected])==null?void 0:d.native)!=null&&h.protected?"orange":void 0},children:x.I18n.t("Unprotect script")}):x.I18n.t("Protect script")]},"encrypt"):null]},"menu")}getToolbarButtons(){const s=[],i=this.state.reorder&&!this.props.debugMode;if(this.state.searchMode&&!this.props.debugMode)s.push(m.jsx(Pn,{value:this.state.searchText,style:Pe.toolbarSearch,ref:this.inputRef,autoFocus:!0,placeholder:x.I18n.t("Search..."),onChange:r=>{this.setState({searchText:r.target.value}),this.filterTimer&&clearTimeout(this.filterTimer),this.filterTimer=setTimeout(()=>{this.filterTimer=null,this.filterList(!0),this.props.onSearch&&this.props.onSearch(this.state.searchText)},400)}},"searchInput")),s.push(m.jsx(qe,{sx:Pe.toolbarButtons,style:{float:"right"},title:x.I18n.t("End search mode"),onClick:r=>{r.stopPropagation(),this.filterList(!1,()=>this.props.onSearch&&this.props.onSearch(this.state.searchText))},size:"medium",children:m.jsx(dx,{})},"disableSearch")),this.state.searchText&&s.push(m.jsx(qe,{title:x.I18n.t("Clear search input"),sx:Pe.toolbarButtons,style:{marginTop:7,float:"right"},onClick:r=>{r.stopPropagation(),this.setState({searchText:""},()=>{this.filterList(!0),this.props.onSearch&&this.props.onSearch(this.state.searchText)})},size:"medium",children:m.jsx(Mw,{fontSize:"small"})},"cleanSearch"));else{if(!i){s.push(m.jsx(qe,{"aria-label":"More","aria-owns":this.state.menuOpened?"long-menu":void 0,title:x.I18n.t("Menu"),"aria-haspopup":"true",onClick:c=>{c.stopPropagation(),c.preventDefault(),this.setState({menuOpened:!0,menuAnchorEl:c.currentTarget})},size:"medium",children:m.jsx(gx,{})},"menuButton"));const r=this.state.listItems.find(c=>c.id===this.state.selected);let l;r&&this.state.width<=Ur&&r.type==="folder"&&(l=this.state.listItems.filter(c=>c.parent===this.state.selected)),s.push(this.getMainMenu(l,r)),s.push(m.jsx(qe,{disabled:this.props.debugMode,title:x.I18n.t("Create new script"),sx:{...Pe.toolbarButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0},style:{color:i?"red":"inherit"},onClick:c=>this.onAddNew(c),size:"medium",children:m.jsx(sS,{})},"new-script")),s.push(m.jsx(qe,{disabled:this.props.debugMode,title:x.I18n.t("Create new folder"),sx:{...Pe.toolbarButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0},style:{color:i?"red":"inherit"},onClick:c=>this.onAddNewFolder(c),size:"medium",children:m.jsx(oS,{})},"new-folder"))}s.push(m.jsx(qe,{disabled:i||this.props.debugMode,sx:{...Pe.toolbarButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0},title:x.I18n.t("Search in scripts"),style:{float:"right",opacity:this.props.debugMode?.5:i?0:1},onClick:r=>{r.stopPropagation(),this.setState({searchMode:!0})},size:"medium",children:m.jsx($x,{})},"search")),s.push(m.jsx(qe,{disabled:this.props.debugMode,title:x.I18n.t("Reorder scripts in folders"),sx:{...Pe.toolbarButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0},style:{color:i?"red":"inherit",float:"right"},onClick:r=>{r.stopPropagation(),this.setState({reorder:!this.state.reorder})},size:"medium",children:m.jsx(_x,{})},"reorder")),!i&&this.state.selected&&this.state.selected!==To&&this.state.selected!==Cn&&s.push(m.jsx(qe,{sx:{...Pe.toolbarButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0},disabled:this.props.debugMode,title:x.I18n.t("Rename"),onClick:r=>this.onRename(r),size:"medium",children:m.jsx(iS,{})},"rename")),s.push(m.jsxs("span",{style:{opacity:.5,fontSize:10},children:["v",this.props.version]},"version"))}return s}getFolders(){const s=[{id:Jt,name:x.I18n.t("Root folder")}];return this.state.listItems.forEach(i=>{i.type==="folder"&&i.id!==Jt&&(!i.id.startsWith(To)||this.state.expertMode)&&s.push({id:i.id,name:i.title})}),s}onCollapseAll(){this.setState({expanded:[]}),this.saveExpanded([])}onExpandAll(){const s=[];this.state.listItems.forEach(i=>this.state.listItems.find(r=>r.parent===i.id)&&s.push(i.id)),this.setState({expanded:s}),this.saveExpanded(s)}getBottomButtons(){return this.state.reorder||this.props.debugMode?null:[m.jsx(wt,{sx:Pe.footerButtons,title:x.I18n.t("Show only running scripts"),onClick:s=>{s.stopPropagation(),s.preventDefault();const i=this.state.statusFilter==="running"?"":"running";window.localStorage&&window.localStorage.setItem("SideMenu.statusFilter",i),this.setState({statusFilter:i})},children:m.jsx(bc,{style:{color:ig,opacity:this.state.statusFilter==="running"?1:.3,background:this.state.statusFilter==="running"?"gray":"inherit"}})},"filterByRunning"),m.jsx(wt,{sx:Pe.footerButtons,title:x.I18n.t("Show only paused scripts"),onClick:()=>{const s=this.state.statusFilter==="paused"?"":"paused";window.localStorage&&window.localStorage.setItem("SideMenu.statusFilter",s),this.setState({statusFilter:s})},children:m.jsx(Wg,{style:{color:ng,opacity:this.state.statusFilter==="paused"?1:.3,background:this.state.statusFilter==="paused"?"gray":"inherit"}})},"filterByPaused"),m.jsx(wt,{sx:Pe.footerButtons,style:{marginRight:16},title:x.I18n.t("Show only scripts with problems"),onClick:()=>{const s=this.state.statusFilter==="problems"?"":"problems";window.localStorage&&window.localStorage.setItem("SideMenu.statusFilter",s),this.setState({statusFilter:s})},children:m.jsx(bc,{style:{color:S_,opacity:this.state.statusFilter==="problems"?1:.3,background:this.state.statusFilter==="problems"?"gray":"inherit"}})},"filterByProblem"),m.jsx(wt,{sx:Pe.footerButtons,children:m.jsx("img",{alt:"Blockly",style:{opacity:this.state.typeFilter==="Blockly"?1:.3,background:this.state.typeFilter==="Blockly"?"gray":"inherit"},src:Tn.Blockly,onClick:()=>{const s=this.state.typeFilter==="Blockly"?"":"Blockly";window.localStorage&&window.localStorage.setItem("SideMenu.typeFilter",s),this.setState({typeFilter:s})}})},"filterBlockly"),m.jsx(wt,{sx:Pe.footerButtons,children:m.jsx("img",{alt:"Javascript",style:{opacity:this.state.typeFilter==="Javascript/js"?1:.3,background:this.state.typeFilter==="Javascript/js"?"gray":"inherit"},src:Tn["Javascript/js"],onClick:()=>{const s=this.state.typeFilter==="Javascript/js"?"":"Javascript/js";window.localStorage&&window.localStorage.setItem("SideMenu.typeFilter",s),this.setState({typeFilter:s})}})},"filterJS"),m.jsx(wt,{sx:Pe.footerButtons,children:m.jsx("img",{alt:"TypeScript",style:{opacity:this.state.typeFilter==="TypeScript/ts"?1:.3,background:this.state.typeFilter==="TypeScript/ts"?"gray":"inherit"},src:Tn["TypeScript/ts"],onClick:()=>{const s=this.state.typeFilter==="TypeScript/ts"?"":"TypeScript/ts";window.localStorage&&window.localStorage.setItem("SideMenu.typeFilter",s),this.setState({typeFilter:s})}})},"filterTS"),m.jsx(wt,{sx:Pe.footerButtons,children:m.jsx("img",{alt:"Rules",style:{opacity:this.state.typeFilter==="Rules"?1:.3,background:this.state.typeFilter==="Rules"?"gray":"inherit"},src:Tn.Rules,onClick:()=>{const s=this.state.typeFilter==="Rules"?"":"Rules";window.localStorage&&window.localStorage.setItem("SideMenu.typeFilter",s),this.setState({typeFilter:s})}})},"filterRules"),m.jsx("div",{style:{flexGrow:1}},"padding"),m.jsx(wt,{sx:Pe.footerButtons,onClick:()=>this.onExpandAll(),title:x.I18n.t("Expand all"),children:m.jsx(kx,{style:Pe.footerButtonsRight})},"expandAll"),this.state.expanded.length?m.jsx(wt,{sx:Pe.footerButtons,onClick:()=>this.onCollapseAll(),title:x.I18n.t("Collapse all"),children:m.jsx(wx,{style:Pe.footerButtonsRight})},"collapseAll"):m.jsx("div",{style:{height:22,width:24}})]}getAdapterDebugDialog(){return this.state.showAdapterDebug?m.jsx(Dx,{socket:this.props.socket,onClose:()=>this.setState({showAdapterDebug:!1}),onDebug:(s,i)=>this.setState({showAdapterDebug:!1},()=>this.props.onDebugInstance({instance:s,adapter:i}))},"debug"):null}render(){var r,l,c;const s=this.state.renaming?this.state.listItems.find(d=>d.id===this.state.renaming):void 0,i=this.state.copingScript&&this.props.scripts[this.state.copingScript].type==="script"?this.props.scripts[this.state.copingScript]:void 0;return[m.jsxs(PT,{variant:"permanent",style:Pe.menu,sx:{"& .MuiDrawer-paper":Pe.drawerPaper},anchor:"left",onClick:()=>this.onClick({id:""}),children:[m.jsx(wt,{sx:Pe.toolbar,children:this.getToolbarButtons()}),m.jsx(o_,{}),m.jsx(ek,{backend:hk,children:m.jsx("div",{style:Pe.innerMenu,children:this.renderAllItems(this.state.listItems)})}),m.jsx(o_,{}),m.jsx("div",{style:Pe.footer,children:this.getBottomButtons()})]},"drawer"),s?m.jsx(_m,{name:s.title,id:this.state.renaming||"",folder:s.type==="folder",instance:s.instance,instances:this.props.instances,onClose:()=>this.setState({renaming:null}),onRename:(d,h,p,f)=>this.props.onRename&&this.props.onRename(d,h,p,f)},"dialog-rename"):null,this.state.deleting?m.jsx(Cx,{name:this.state.listItems.find(d=>d.id===this.state.deleting).title,id:this.state.deleting,onClose:()=>this.setState({deleting:null}),onDelete:d=>this.props.onDelete&&this.props.onDelete(d)},"dialog-delete"):null,this.state.choosingType?m.jsx(Dn,{onClose:d=>{const h={choosingType:!1};d&&(h.creatingScript=d),this.setState(h)}},"dialog-script-type"):null,this.state.creatingScript?m.jsx(og,{onClose:()=>this.setState({creatingScript:null}),title:x.I18n.t("Create new script"),name:this.getUniqueName(),parents:this.getFolders(),folder:!1,existingItems:this.state.listItems.map(d=>d.id),instance:this.props.instances[0]||0,instances:this.props.instances,type:this.state.creatingScript,parent:this.parent,onAdd:(d,h,p,f)=>this.props.onAddNew&&this.props.onAddNew(d,h,!1,p,f)},"dialog-new-script"):null,this.state.copingScript?m.jsx(og,{onClose:()=>this.setState({copingScript:""}),title:x.I18n.t("Copy script"),name:this.getUniqueName(this.state.copingScript),parents:this.getFolders(),folder:!1,instance:parseInt((l=(r=i==null?void 0:i.common)==null?void 0:r.engine)==null?void 0:l.split(".").pop(),10)||0,instances:this.props.instances,type:((c=i==null?void 0:i.common)==null?void 0:c.engineType)||"Javascript/js",parent:this.parent,onAdd:(d,h,p,f)=>{var y;const b=this.state.copingScript&&this.props.scripts[this.state.copingScript].type==="script"?this.props.scripts[this.state.copingScript]:void 0;b!=null&&b.common&&(b.common.enabled=!1),this.props.onAddNew&&this.props.onAddNew(d,h,!1,p,f,(y=b==null?void 0:b.common)==null?void 0:y.source)}},"dialog-copy-script"):null,this.state.creatingFolder?m.jsx(og,{onClose:()=>this.setState({creatingFolder:!1}),title:x.I18n.t("Create new folder"),parents:this.getFolders(),name:this.getUniqueFolderName(),parent:this.parent,onAdd:(d,h)=>this.props.onAddNew&&this.props.onAddNew(d,h,!0)},"dialog-new-folder"):null,this.state.errorText?m.jsx(su,{onClose:()=>this.setState({errorText:""}),text:this.state.errorText},"error"):null,this.getAdapterDebugDialog(),this.state.showExportDialog?m.jsxs(Ut,{open:!0,onClose:()=>this.setState({showExportDialog:!1}),children:[m.jsx(ss,{children:x.I18n.t("Export all scripts")}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",onClick:()=>{this.setState({showExportDialog:!1}),this.props.onExport(!0)},color:"primary",children:x.I18n.t("as JSON")}),m.jsx(He,{variant:"contained",onClick:()=>{this.setState({showExportDialog:!1}),this.props.onExport(!1)},color:"grey",children:x.I18n.t("as plain text")}),m.jsx(He,{variant:"contained",onClick:()=>this.setState({showExportDialog:!1}),color:"primary",children:x.I18n.t("Cancel")})]})]},"dialog-export-format"):null]}}const Px="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgAQMAAADYVuV7AAAABlBMVEUAAAAzMzPI8eYgAAAAAXRSTlMAQObYZgAAACFJREFUeAFjAIJRwP////8PYIKWHCigNQdKj/pn1D+jAABTG16wVQqVpQAAAABJRU5ErkJggg==",Bx="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgAQMAAADYVuV7AAAABlBMVEUAAAAzMzPI8eYgAAAAAXRSTlMAQObYZgAAABtJREFUeAFjAIJRwP8fCj7QkENn/4z6Z5QzCgBjbWaoyx1PqQAAAABJRU5ErkJggg==";function Fx(a){let s,i=a.getHours();return i<10&&(i=`0${i.toString()}`),s=`${i}:`,i=a.getMinutes(),i<10&&(i=`0${i.toString()}`),s+=`${i}:`,i=a.getSeconds(),i<10&&(i=`0${i.toString()}`),s+=`${i}.`,i=a.getMilliseconds(),i<10?i=`00${i.toString()}`:i<100&&(i=`0${i.toString()}`),s+=i,s}const x_=34,zt={logBox:{width:"100%",height:"100%",position:"relative",overflow:"hidden"},logBoxInner:a=>({display:"inline-block",color:a.palette.mode==="dark"?"white":"black",width:`calc(100% - ${x_}px)`,height:"100%",overflow:"auto",position:"relative",verticalAlign:"top"}),info:a=>({background:a.palette.mode==="dark"?"darkgrey":"lightgrey",color:(a.palette.mode==="dark","black")}),error:a=>({background:"#FF0000",color:a.palette.mode==="dark"?"black":"white"}),warn:a=>({background:"#FF8000",color:a.palette.mode==="dark"?"black":"white"}),debug:a=>({background:"gray",opacity:.8,color:a.palette.mode==="dark"?"black":"white"}),silly:a=>({background:"gray",opacity:.6,color:a.palette.mode==="dark"?"black":"white"}),table:{fontFamily:"monospace",width:"100%"},toolbox:{width:x_,height:"100%",boxShadow:"2px 0px 4px -1px rgba(0, 0, 0, 0.2), 4px 0px 5px 0px rgba(0, 0, 0, 0.14), 1px 0px 10px 0px rgba(0, 0, 0, 0.12)",display:"inline-block",verticalAlign:"top",overflow:"hidden"},trFrom:{width:90},trTime:{width:90},trSeverity:{width:40,fontWeight:"bold"},trPreMessage:{padding:0,margin:0},iconButtons:{width:32,height:32,padding:4},layoutIcon:a=>({"& img":{width:24,height:24,background:a.palette.mode==="dark"?"#9d9d9d":void 0,borderRadius:a.palette.mode==="dark"?"30px":void 0}})};function jx(a){return a<10?`00${a}`:a<100?`0${a}`:a.toString()}const Zs={};class wm extends _e.Component{messagesEnd;constructor(s){super(s),this.state={lines:{},goBottom:!0,selected:null,editing:this.props.editing||[]},this.messagesEnd=_e.createRef()}static generateLine(s,i){let r=s.message||"";if(typeof r!="object"){const l=new RegExp(`${s.from.replace(".","\\.").replace(")","\\)").replace("(","\\(")} \\(\\d+\\) `,"g"),c=r.match(l);c?r=r.replace(c[0],""):r=r.replace(`${s.from} `,"")}return r.startsWith(`${i}: `)&&(r=r.substring(i.length+2)),m.jsxs(wt,{component:"tr",sx:zt[s.severity],children:[m.jsx("td",{style:zt.trFrom,children:s.from}),m.jsx("td",{style:zt.trTime,children:Fx(new Date(s.ts))}),m.jsx("td",{style:zt.trSeverity,children:s.severity}),m.jsx("td",{children:m.jsx("pre",{style:zt.trPreMessage,children:r})})]},`tr_${s.ts}_${s.message.substring(s.message.length-10)}`)}scrollToBottom(){var s,i;(i=(s=this.messagesEnd)==null?void 0:s.current)==null||i.scrollIntoView({behavior:"smooth"})}logHandler=s=>{const i=this.state.lines,r=this.state.editing.filter(f=>s.message.includes(f));let l=null;if(!r.length||(r.length===1?l=r[0]:(r.sort(),l=r[r.length-1]),!l))return;const c=i[l]||[],d=Zs[l]||[];c.push(wm.generateLine(s,l));let h=s.severity;(h==="info"||h==="warn")&&(h+=" ");const p=new Date(s.ts);d.push(`${p.toLocaleString()}.${jx(p.getMilliseconds())} [${h}]: ${s.message}`),c.length>300&&(c.splice(0,c.length-300),d.splice(0,c.length-300)),Zs[l]=d,i[l]=c,this.setState({lines:i})};componentDidMount(){this.props.socket.registerLogHandler(this.logHandler)}componentWillUnmount(){this.props.socket.unregisterLogHandler(this.logHandler)}componentDidUpdate(){this.state.goBottom&&this.scrollToBottom()}static getDerivedStateFromProps(s,i){let r=!1;const l={};if(s.selected!==i.selected){const c=s.selected,d=i.lines;c&&(d[c]=d[c]||[],Zs[c]=Zs[c]||[]),l.selected=c,r=!0}if(JSON.stringify(s.editing)!==JSON.stringify(i.editing)){const c=JSON.parse(JSON.stringify(s.editing));r=!0;const d=i.lines;for(const h in Zs)Object.prototype.hasOwnProperty.call(Zs,h)&&(c.includes(h)||(delete Zs[h],delete d[h]));l.editing=c}return r?l:null}onCopy(){x.Utils.copyToClipboard((Zs[this.state.selected]||[]).join(` -`))}clearLog(){const s=this.state.lines;s[this.state.selected]&&(s[this.state.selected]=[]),Zs[this.state.selected]&&(Zs[this.state.selected]=[]),this.setState({lines:s})}renderLogList(s){return this.state.selected&&(s!=null&&s.length)?m.jsxs(wt,{sx:zt.logBoxInner,children:[m.jsx("table",{style:zt.table,children:m.jsx("tbody",{children:s})},"logTable"),m.jsx("div",{ref:this.messagesEnd,style:{float:"left",clear:"both"}},"logScrollPoint")]},"logList"):m.jsx(wt,{sx:zt.logBoxInner,style:{paddingLeft:10},children:x.I18n.t("Log outputs")},"logList")}render(){const s=this.state.selected?this.state.lines[this.state.selected]:null;return m.jsxs("div",{style:zt.logBox,children:[m.jsxs("div",{style:zt.toolbox,children:[m.jsx(qe,{style:zt.iconButtons,onClick:()=>this.setState({goBottom:!this.state.goBottom}),color:this.state.goBottom?"secondary":void 0,size:"medium",children:m.jsx(nS,{})}),s!=null&&s.length?m.jsx(qe,{style:zt.iconButtons,onClick:()=>this.clearLog(),size:"medium",children:m.jsx(rS,{})}):null,s!=null&&s.length?m.jsx(qe,{style:zt.iconButtons,onClick:()=>this.onCopy(),size:"medium",children:m.jsx(aS,{})}):null,this.props.onLayoutChange?m.jsx(qe,{style:zt.iconButtons,onClick:()=>this.props.onLayoutChange&&this.props.onLayoutChange(),title:x.I18n.t("Change layout"),size:"medium",sx:zt.layoutIcon,children:m.jsx("img",{alt:"split",src:this.props.verticalLayout?Px:Bx})}):null,m.jsx(qe,{style:zt.iconButtons,onClick:()=>this.props.onHideLog(),title:x.I18n.t("Hide logs"),size:"medium",children:m.jsx(lS,{})})]},"toolbox"),this.renderLogList(s)]})}}var D_="focus-outline-hidden";function vk(){var a=this;document.addEventListener("keydown",function(s){a.focusByKeyboard=!0},!0),document.addEventListener("mousedown",function(s){a.focusByKeyboard=!1},!0),document.addEventListener("focus",function(s){a.updateVisibility()},!0),document.addEventListener("focusout",function(s){window.setTimeout(function(){document.hasFocus()||(a.focusByKeyboard=!0,a.updateVisibility())},0)}),this.updateVisibility()}vk.prototype={focusByKeyboard:!0,updateVisibility:function(){this.hidden=!this.focusByKeyboard},set hidden(a){document.documentElement.classList.toggle(D_,a)},get hidden(){return document.documentElement.classList.contains(D_)}};new vk;var yk={exports:{}};(function(a){(function(){var s={}.hasOwnProperty;function i(){for(var r=[],l=0;l4&&arguments[4]!==void 0?arguments[4]:"easeInOutCubic";return r>l?i:s+(i-s)*Ux[c](r/l)};Mi.calcEndPoint=function(s){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(Hx(s))return parseInt(s)+r;var l=i===window||i===document.documentElement?window.pageYOffset:i.scrollTop-i.getBoundingClientRect().top,c=s.nodeName.toLowerCase()==="html"?-l:s.getBoundingClientRect().top+l;return c+r};(function(a,s){Object.defineProperty(s,"__esModule",{value:!0});var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},r=Mi;s.default=function(l){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d=c.duration,h=d===void 0?500:d,p=c.context,f=p===void 0?window:p,b=c.offset,y=b===void 0?0:b,w=c.ease,v=w===void 0?"easeInOutCubic":w,_=c.callback;if((typeof window>"u"?"undefined":i(window))==="object"){var $=f.scrollTop!==null&&f.scrollTop!==void 0?f.scrollTop:window.pageYOffset,S=(0,r.calcEndPoint)(l,f,y),T=performance.now(),E=window.requestAnimationFrame,D=function M(){var P=performance.now()-T,W=(0,r.setPosition)($,S,P,h,v);f!==window?f.scrollTop=W:window.scroll(0,W),P>h?typeof _=="function"&&_(l):E(M)};D()}},a.exports=s.default})(Jg,Jg.exports);var _k=Jg.exports,qg={exports:{}};(function(a,s){Object.defineProperty(s,"__esModule",{value:!0});var i=Object.assign||function(d){for(var h=1;h0&&arguments[0]!==void 0?arguments[0]:{},h=d.query,p=h===void 0?'[href^="#"]:not([href="#"]':h,f=d.match,b=f===void 0?function(S){return document.getElementById(S.hash.substring(1))}:f,y=d.hashChange,w=y===void 0?!0:y,v=d.scrollSmoothConfig,_=document.querySelectorAll(p),$=function(T){T.preventDefault();var E=b(T.target);E&&(w&&history.replaceState(null,null,"#"+E.id),(0,l.default)(E,i({},v)))};Array.from(_).map(function(S){S.addEventListener("click",$,!1)})},a.exports=s.default})(qg,qg.exports);var Wx=qg.exports,Xg={exports:{}};(function(a,s){Object.defineProperty(s,"__esModule",{value:!0});function i(r){if(Array.isArray(r)){for(var l=0,c=Array(r.length);l0&&arguments[0]!==void 0?arguments[0]:{},l=r.activeClass,c=l===void 0?"active":l,d=r.query,h=d===void 0?'[href^="#"]:not([href="#"]):not([href="#0"])':d,p=r.threshold,f=p===void 0?[.25,.5,.75]:p,b=r.detectType,y=b===void 0?"max":b,w={threshold:f},v=function(W){return W.classList.remove(c)},_=function(W){return W.classList.add(c)},$=function(){document.querySelectorAll("."+c).forEach(v)},S=function(W){$(),_(document.querySelector('a[href="#'+W.id+'"]'))},T=function(W){W.forEach(function(G){G.intersectionRatio>=Math[y].apply(Math,i(f))&&S(G.target)})},E=document.querySelectorAll(h),D=new IntersectionObserver(T,w),M=function(W){var G=document.querySelector("#"+W.hash.slice(1));D.observe(G)};E.forEach(M)},a.exports=s.default})(Xg,Xg.exports);var Gx=Xg.exports;(function(a,s){Object.defineProperty(s,"__esModule",{value:!0});var i=_k,r=f(i),l=Mi,c=Wx,d=f(c),h=Gx,p=f(h);function f(b){return b&&b.__esModule?b:{default:b}}s.default={to:r.default,calcEndPoint:l.calcEndPoint,anchorScroll:d.default,observe:p.default},a.exports=s.default})(Yg,Yg.exports);var Vx=Yg.exports;const Kx=Xo(Vx);var km={exports:{}},Yx=km.exports;(function(a){(function(s,i){a.exports?a.exports=i():s.Scrollparent=i()})(Yx,function(){var s=/(auto|scroll)/,i=function(h,p){return h.parentNode===null?p:i(h.parentNode,p.concat([h]))},r=function(h,p){return getComputedStyle(h,null).getPropertyValue(p)},l=function(h){return r(h,"overflow")+r(h,"overflow-y")+r(h,"overflow-x")},c=function(h){return s.test(l(h))},d=function(h){if(h instanceof HTMLElement||h instanceof SVGElement){for(var p=i(h.parentNode,[]),f=0;f=s||G<0||y&&z>=c}function T(){var W=rg();if(S(W))return E(W);h=setTimeout(T,$(W))}function E(W){return h=void 0,w&&r?v(W):(r=l=void 0,d)}function D(){h!==void 0&&clearTimeout(h),f=0,r=p=l=h=void 0}function M(){return h===void 0?d:E(rg())}function P(){var W=rg(),G=S(W);if(r=arguments,l=this,p=W,G){if(h===void 0)return _(p);if(y)return h=setTimeout(T,s),v(p)}return h===void 0&&(h=setTimeout(T,s)),d}return P.cancel=D,P.flush=M,P}function Zg(a){var s=typeof a;return!!a&&(s=="object"||s=="function")}function h0(a){return!!a&&typeof a=="object"}function p0(a){return typeof a=="symbol"||h0(a)&&l0.call(a)==Zx}function R_(a){if(typeof a=="number")return a;if(p0(a))return O_;if(Zg(a)){var s=typeof a.valueOf=="function"?a.valueOf():a;a=Zg(s)?s+"":s}if(typeof a!="string")return a===0?a:+a;a=a.replace(Qx,"");var i=t0.test(a);return i||s0.test(a)?o0(a.slice(2),i?2:8):e0.test(a)?O_:+a}var g0=d0;const m0=Xo(g0);var Qg="data-focus-lock",wk="data-focus-lock-disabled",f0="data-no-focus-lock",$0="data-autofocus-inside",b0="data-no-autofocus";function ag(a,s){return typeof a=="function"?a(s):a&&(a.current=s),a}function v0(a,s){var i=kt(function(){return{value:a,callback:s,facade:{get current(){return i.value},set current(r){var l=i.value;l!==r&&(i.value=r,i.callback(r,l))}}}})[0];return i.callback=s,i.facade}var y0=typeof window<"u"?hm:Lt,N_=new WeakMap;function _0(a,s){var i=v0(null,function(r){return a.forEach(function(l){return ag(l,r)})});return y0(function(){var r=N_.get(i);if(r){var l=new Set(r),c=new Set(a),d=i.current;l.forEach(function(h){c.has(h)||ag(h,null)}),c.forEach(function(h){l.has(h)||ag(h,d)})}N_.set(i,a)},[a]),i}var lg={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"};function kk(a){return a}function Ck(a,s){s===void 0&&(s=kk);var i=[],r=!1,l={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:a},useMedium:function(c){var d=s(c,r);return i.push(d),function(){i=i.filter(function(h){return h!==d})}},assignSyncMedium:function(c){for(r=!0;i.length;){var d=i;i=[],d.forEach(c)}i={push:function(h){return c(h)},filter:function(){return i}}},assignMedium:function(c){r=!0;var d=[];if(i.length){var h=i;i=[],h.forEach(c),d=i}var p=function(){var b=d;d=[],b.forEach(c)},f=function(){return Promise.resolve().then(p)};f(),i={push:function(b){d.push(b),f()},filter:function(b){return d=d.filter(b),i}}}};return l}function Cm(a,s){return s===void 0&&(s=kk),Ck(a,s)}function w0(a){a===void 0&&(a={});var s=Ck(null);return s.options=cS({async:!0,ssr:!1},a),s}var Tk=Cm({},function(a){var s=a.target,i=a.currentTarget;return{target:s,currentTarget:i}}),Sk=Cm(),k0=Cm(),C0=w0({async:!0,ssr:typeof document<"u"}),T0=um(void 0),S0=[],Tm=Iw(function(s,i){var r,l=kt(),c=l[0],d=l[1],h=Ko(),p=Ko(!1),f=Ko(null),b=kt({}),y=b[1],w=s.children,v=s.disabled,_=v===void 0?!1:v,$=s.noFocusGuards,S=$===void 0?!1:$,T=s.persistentFocus,E=T===void 0?!1:T,D=s.crossFrame,M=D===void 0?!0:D,P=s.autoFocus,W=P===void 0?!0:P;s.allowTextSelection;var G=s.group,z=s.className,Z=s.whiteList,he=s.hasPositiveIndices,Ce=s.shards,R=Ce===void 0?S0:Ce,K=s.as,C=K===void 0?"div":K,Q=s.lockProps,ve=Q===void 0?{}:Q,ce=s.sideCar,ne=s.returnFocus,me=ne===void 0?!1:ne,re=s.focusOptions,B=s.onActivation,N=s.onDeactivation,te=kt({}),q=te[0],se=xn(function(Y){var O=Y.captureFocusRestore;if(!f.current){var A,U=(A=document)==null?void 0:A.activeElement;f.current=U,U!==document.body&&(f.current=O(U))}h.current&&B&&B(h.current),p.current=!0,y()},[B]),j=xn(function(){p.current=!1,N&&N(h.current),y()},[N]),Te=xn(function(Y){var O=f.current;if(O){var A=(typeof O=="function"?O():O)||document.body,U=typeof me=="function"?me(A):me;if(U){var H=typeof U=="object"?U:void 0;f.current=null,Y?Promise.resolve().then(function(){return A.focus(H)}):A.focus(H)}}},[me]),ae=xn(function(Y){p.current&&Tk.useMedium(Y)},[]),we=Sk.useMedium,Ie=xn(function(Y){h.current!==Y&&(h.current=Y,d(Y))},[]),Ne=Ig((r={},r[wk]=_&&"disabled",r[Qg]=G,r),ve),Ae=S!==!0,We=Ae&&S!=="tail",k=_0([i,Ie]),X=us(function(){return{observed:h,shards:R,enabled:!_,active:p.current}},[_,p.current,R,c]);return _e.createElement(Dg,null,Ae&&[_e.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:_?-1:0,style:lg}),he?_e.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:_?-1:1,style:lg}):null],!_&&_e.createElement(ce,{id:q,sideCar:C0,observed:c,disabled:_,persistentFocus:E,crossFrame:M,autoFocus:W,whiteList:Z,shards:R,onActivation:se,onDeactivation:j,returnFocus:Te,focusOptions:re,noFocusGuards:S}),_e.createElement(C,Ig({ref:k},Ne,{className:z,onBlur:we,onFocus:ae}),_e.createElement(T0.Provider,{value:X},w)),We&&_e.createElement("div",{"data-focus-guard":!0,tabIndex:_?-1:0,style:lg}))});Tm.propTypes={};function E0(a,s){function i(r){return r.displayName||r.name||"Component"}return function(l){var c=[],d;function h(){d=a(c.map(function(f){return f.props})),s(d)}var p=(function(f){DS(b,f);function b(){return f.apply(this,arguments)||this}b.peek=function(){return d};var y=b.prototype;return y.componentDidMount=function(){c.push(this),h()},y.componentDidUpdate=function(){h()},y.componentWillUnmount=function(){var v=c.indexOf(this);c.splice(v,1),h()},y.render=function(){return _e.createElement(l,this.props)},b})(RT);return qS(p,"displayName","SideEffect("+i(l)+")"),p}}var oo=function(a){for(var s=Array(a.length),i=0;i=0}).sort(L0)},B0=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],Im=B0.join(","),F0="".concat(Im,", [data-focus-guard]"),Mk=function(a,s){return oo((a.shadowRoot||a).children).reduce(function(i,r){return i.concat(r.matches(s?F0:Im)?[r]:[],Mk(r))},[])},j0=function(a,s){var i;return a instanceof HTMLIFrameElement&&(!((i=a.contentDocument)===null||i===void 0)&&i.body)?Bn([a.contentDocument.body],s):[a]},Bn=function(a,s){return a.reduce(function(i,r){var l,c=Mk(r,s),d=(l=[]).concat.apply(l,c.map(function(h){return j0(h,s)}));return i.concat(d,r.parentNode?oo(r.parentNode.querySelectorAll(Im)).filter(function(h){return h===r}):[])},[])},z0=function(a){var s=a.querySelectorAll("[".concat($0,"]"));return oo(s).map(function(i){return Bn([i])}).reduce(function(i,r){return i.concat(r)},[])},xm=function(a,s){return oo(a).filter(function(i){return Dk(s,i)}).filter(function(i){return R0(i)})},M_=function(a,s){return s===void 0&&(s=new Map),oo(a).filter(function(i){return Ak(s,i)})},Dm=function(a,s,i){return Em(xm(Bn(a,i),s),!0,i)},ea=function(a,s){return Em(xm(Bn(a),s),!1)},U0=function(a,s){return xm(z0(a),s)},xi=function(a,s){return a.shadowRoot?xi(a.shadowRoot,s):Object.getPrototypeOf(a).contains!==void 0&&Object.getPrototypeOf(a).contains.call(a,s)?!0:oo(a.children).some(function(i){var r;if(i instanceof HTMLIFrameElement){var l=(r=i.contentDocument)===null||r===void 0?void 0:r.body;return l?xi(l,s):!1}return xi(i,s)})},H0=function(a){for(var s=new Set,i=a.length,r=0;r0&&s.add(l),(c&Node.DOCUMENT_POSITION_CONTAINS)>0&&s.add(r)}return a.filter(function(d,h){return!s.has(h)})},Lk=function(a){return a.parentNode?Lk(a.parentNode):a},Am=function(a){var s=Ri(a);return s.filter(Boolean).reduce(function(i,r){var l=r.getAttribute(Qg);return i.push.apply(i,l?H0(oo(Lk(r).querySelectorAll("[".concat(Qg,'="').concat(l,'"]:not([').concat(wk,'="disabled"])')))):[r]),i},[])},W0=function(a){try{return a()}catch{return}},ta=function(a){if(a===void 0&&(a=document),!(!a||!a.activeElement)){var s=a.activeElement;return s.shadowRoot?ta(s.shadowRoot):s instanceof HTMLIFrameElement&&W0(function(){return s.contentWindow.document})?ta(s.contentWindow.document):s}},G0=function(a,s){return a===s},V0=function(a,s){return!!oo(a.querySelectorAll("iframe")).some(function(i){return G0(i,s)})},Pk=function(a,s){return s===void 0&&(s=ta(Ek(a).ownerDocument)),!s||s.dataset&&s.dataset.focusGuard?!1:Am(a).some(function(i){return xi(i,s)||V0(i,s)})},K0=function(a){a===void 0&&(a=document);var s=ta(a);return s?oo(a.querySelectorAll("[".concat(f0,"]"))).some(function(i){return xi(i,s)}):!1},Y0=function(a,s){return s.filter(Nk).filter(function(i){return i.name===a.name}).filter(function(i){return i.checked})[0]||a},Om=function(a,s){return Nk(a)&&a.name?Y0(a,s):a},J0=function(a){var s=new Set;return a.forEach(function(i){return s.add(Om(i,a))}),a.filter(function(i){return s.has(i)})},L_=function(a){return a[0]&&a.length>1?Om(a[0],a):a[0]},P_=function(a,s){return a.indexOf(Om(s,a))},tm="NEW_FOCUS",q0=function(a,s,i,r,l){var c=a.length,d=a[0],h=a[c-1],p=Sm(r);if(!(r&&a.indexOf(r)>=0)){var f=r!==void 0?i.indexOf(r):-1,b=l?i.indexOf(l):f,y=l?a.indexOf(l):-1;if(f===-1)return y!==-1?y:tm;if(y===-1)return tm;var w=f-b,v=i.indexOf(d),_=i.indexOf(h),$=J0(i),S=r!==void 0?$.indexOf(r):-1,T=l?$.indexOf(l):S,E=$.filter(function(z){return z.tabIndex>=0}),D=r!==void 0?E.indexOf(r):-1,M=l?E.indexOf(l):D,P=D>=0&&M>=0?M-D:T-S;if(!w&&y>=0||s.length===0)return y;var W=P_(a,s[0]),G=P_(a,s[s.length-1]);if(f<=v&&p&&Math.abs(w)>1)return G;if(f>=_&&p&&Math.abs(w)>1)return W;if(w&&Math.abs(P)>1)return y;if(f<=v)return G;if(f>_)return W;if(w)return Math.abs(w)>1?y:(c+y+w)%c}},X0=function(a){return function(s){var i,r=(i=Ok(s))===null||i===void 0?void 0:i.autofocus;return s.autofocus||r!==void 0&&r!=="false"||a.indexOf(s)>=0}},B_=function(a,s,i){var r=a.map(function(c){var d=c.node;return d}),l=M_(r.filter(X0(i)));return l&&l.length?L_(l):L_(M_(s))},sm=function(a,s){return s===void 0&&(s=[]),s.push(a),a.parentNode&&sm(a.parentNode.host||a.parentNode,s),s},cg=function(a,s){for(var i=sm(a),r=sm(s),l=0;l=0)return c}return!1},Bk=function(a,s,i){var r=Ri(a),l=Ri(s),c=r[0],d=!1;return l.filter(Boolean).forEach(function(h){d=cg(d||h,h)||d,i.filter(Boolean).forEach(function(p){var f=cg(c,p);f&&(!d||xi(f,d)?d=f:d=cg(f,d))})}),d},F_=function(a,s){return a.reduce(function(i,r){return i.concat(U0(r,s))},[])},Z0=function(a,s){var i=new Map;return s.forEach(function(r){return i.set(r.node,r)}),a.map(function(r){return i.get(r)}).filter(M0)},Q0=function(a,s){var i=ta(Ri(a).length>0?document:Ek(a).ownerDocument),r=Am(a).filter(em),l=Bk(i||a,a,r),c=new Map,d=ea(r,c),h=d.filter(function(_){var $=_.node;return em($)});if(h[0]){var p=ea([l],c).map(function(_){var $=_.node;return $}),f=Z0(p,h),b=f.map(function(_){var $=_.node;return $}),y=f.filter(function(_){var $=_.tabIndex;return $>=0}).map(function(_){var $=_.node;return $}),w=q0(b,y,p,i,s);if(w===tm){var v=B_(d,y,F_(r,c))||B_(d,b,F_(r,c));if(v)return{node:v};console.warn("focus-lock: cannot find any node to move focus into");return}return w===void 0?w:f[w]}},eD=function(a){var s=Am(a).filter(em),i=Bk(a,a,s),r=Em(Bn([i],!0),!0,!0),l=Bn(s,!1);return r.map(function(c){var d=c.node,h=c.index;return{node:d,index:h,lockItem:l.indexOf(d)>=0,guard:Sm(d)}})},Rm=function(a,s){a&&("focus"in a&&a.focus(s),"contentWindow"in a&&a.contentWindow&&a.contentWindow.focus())},ug=0,dg=!1,Fk=function(a,s,i){i===void 0&&(i={});var r=Q0(a,s);if(!dg&&r){if(ug>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),dg=!0,setTimeout(function(){dg=!1},1);return}ug++,Rm(r.node,i.focusOptions),ug--}};function Hr(a){if(!a)return null;if(typeof WeakRef>"u")return function(){return a||null};var s=a?new WeakRef(a):null;return function(){return(s==null?void 0:s.deref())||null}}var tD=function(a){if(!a)return null;for(var s=[],i=a;i&&i!==document.body;)s.push({current:Hr(i),parent:Hr(i.parentElement),left:Hr(i.previousElementSibling),right:Hr(i.nextElementSibling)}),i=i.parentElement;return{element:Hr(a),stack:s,ownerDocument:a.ownerDocument}},sD=function(a){var s,i,r,l,c;if(a)for(var d=a.stack,h=a.ownerDocument,p=new Map,f=0,b=d;f-1&&(S.filter(function(E){var D=E.guard,M=E.node;return D&&M.dataset.focusAutoGuard}).forEach(function(E){var D=E.node;return D.removeAttribute("tabIndex")}),z_(T,S.length,1,S),z_(T,-1,-1,S))}}}return s},Gk=function(s){Sc()&&s&&(s.stopPropagation(),s.preventDefault())},Lm=function(){return Nm(Sc)},yD=function(s){var i=s.target,r=s.currentTarget;r.contains(i)||gD(r,i)},_D=function(){return null},Vk=function(){Mm=!0},Kk=function(){Mm=!1,sa="just",Nm(function(){sa="meanwhile"})},wD=function(){document.addEventListener("focusin",Gk),document.addEventListener("focusout",Lm),window.addEventListener("focus",Vk),window.addEventListener("blur",Kk)},kD=function(){document.removeEventListener("focusin",Gk),document.removeEventListener("focusout",Lm),window.removeEventListener("focus",Vk),window.removeEventListener("blur",Kk)};function CD(a){return a.filter(function(s){var i=s.disabled;return!i})}var Yk={moveFocusInside:Fk,focusInside:Pk,focusNextElement:rD,focusPrevElement:aD,focusFirstElement:lD,focusLastElement:cD,captureFocusRestore:jk};function TD(a){var s=a.slice(-1)[0];s&&!Rn&&wD();var i=Rn,r=i&&s&&s.id===i.id;Rn=s,i&&!r&&(i.onDeactivation(),a.filter(function(l){var c=l.id;return c===i.id}).length||i.returnFocus(!s)),s?(ts=null,(!r||i.observed!==s.observed)&&s.onActivation(Yk),Sc(),Nm(Sc)):(kD(),ts=null)}Tk.assignSyncMedium(yD);Sk.assignMedium(Lm);k0.assignMedium(function(a){return a(Yk)});const SD=E0(CD,TD)(_D);var Jk=Iw(function(s,i){return _e.createElement(Tm,Ig({sideCar:SD,ref:i},s))}),qk=Tm.propTypes||{};qk.sideCar;AS(qk,["sideCar"]);Jk.propTypes={};var Xk={exports:{}},ct={};var Pm=Symbol.for("react.element"),Bm=Symbol.for("react.portal"),ou=Symbol.for("react.fragment"),iu=Symbol.for("react.strict_mode"),nu=Symbol.for("react.profiler"),ru=Symbol.for("react.provider"),au=Symbol.for("react.context"),ED=Symbol.for("react.server_context"),lu=Symbol.for("react.forward_ref"),cu=Symbol.for("react.suspense"),uu=Symbol.for("react.suspense_list"),du=Symbol.for("react.memo"),hu=Symbol.for("react.lazy"),ID=Symbol.for("react.offscreen"),Zk;Zk=Symbol.for("react.module.reference");function Cs(a){if(typeof a=="object"&&a!==null){var s=a.$$typeof;switch(s){case Pm:switch(a=a.type,a){case ou:case nu:case iu:case cu:case uu:return a;default:switch(a=a&&a.$$typeof,a){case ED:case au:case lu:case hu:case du:case ru:return a;default:return s}}case Bm:return s}}}ct.ContextConsumer=au;ct.ContextProvider=ru;ct.Element=Pm;ct.ForwardRef=lu;ct.Fragment=ou;ct.Lazy=hu;ct.Memo=du;ct.Portal=Bm;ct.Profiler=nu;ct.StrictMode=iu;ct.Suspense=cu;ct.SuspenseList=uu;ct.isAsyncMode=function(){return!1};ct.isConcurrentMode=function(){return!1};ct.isContextConsumer=function(a){return Cs(a)===au};ct.isContextProvider=function(a){return Cs(a)===ru};ct.isElement=function(a){return typeof a=="object"&&a!==null&&a.$$typeof===Pm};ct.isForwardRef=function(a){return Cs(a)===lu};ct.isFragment=function(a){return Cs(a)===ou};ct.isLazy=function(a){return Cs(a)===hu};ct.isMemo=function(a){return Cs(a)===du};ct.isPortal=function(a){return Cs(a)===Bm};ct.isProfiler=function(a){return Cs(a)===nu};ct.isStrictMode=function(a){return Cs(a)===iu};ct.isSuspense=function(a){return Cs(a)===cu};ct.isSuspenseList=function(a){return Cs(a)===uu};ct.isValidElementType=function(a){return typeof a=="string"||typeof a=="function"||a===ou||a===nu||a===iu||a===cu||a===uu||a===ID||typeof a=="object"&&a!==null&&(a.$$typeof===hu||a.$$typeof===du||a.$$typeof===ru||a.$$typeof===au||a.$$typeof===lu||a.$$typeof===Zk||a.getModuleId!==void 0)};ct.typeOf=Cs;Xk.exports=ct;var Qk=Xk.exports;function xD(a){function s(N,te,q,se,j){for(var Te=0,ae=0,we=0,Ie=0,Ne,Ae,We=0,k=0,X,Y=X=Ne=0,O=0,A=0,U=0,H=0,ue=q.length,V=ue-1,be,pe="",fe="",Le="",Ue="",Be;ONe)&&(H=(pe=pe.replace(" ",":")).length),0se&&(se=(te=te.trim()).charCodeAt(0)),se){case 38:return te.replace(T,"$1"+N.trim());case 58:return N.trim()+te.replace(T,"$1"+N.trim());default:if(0<1*q&&0ae.charCodeAt(8))break;case 115:j=j.replace(ae,"-webkit-"+ae)+";"+j;break;case 207:case 102:j=j.replace(ae,"-webkit-"+(102q.charCodeAt(0)&&(q=q.trim()),B=q,q=[B],01?s-1:0),r=1;r0?" Args: "+i.join(", "):""))}var RD=(function(){function a(i){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=i}var s=a.prototype;return s.indexOfGroup=function(i){for(var r=0,l=0;l=this.groupSizes.length){for(var l=this.groupSizes,c=l.length,d=c;i>=d;)(d<<=1)<0&&ga(16,""+i);this.groupSizes=new Uint32Array(d),this.groupSizes.set(l),this.length=d;for(var h=c;h=this.length||this.groupSizes[i]===0)return r;for(var l=this.groupSizes[i],c=this.indexOfGroup(i),d=c+l,h=c;h=Yr&&(Yr=s+1),yc.set(a,s),Ic.set(s,a)},LD="style["+Fn+'][data-styled-version="5.3.11"]',PD=new RegExp("^"+Fn+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),BD=function(a,s,i){for(var r,l=i.split(","),c=0,d=l.length;c=0;f--){var b=p[f];if(b&&b.nodeType===1&&b.hasAttribute(Fn))return b}})(i),c=l!==void 0?l.nextSibling:null;r.setAttribute(Fn,"active"),r.setAttribute("data-styled-version","5.3.11");var d=jD();return d&&r.setAttribute("nonce",d),i.insertBefore(r,c),r},zD=(function(){function a(i){var r=this.element=eC(i);r.appendChild(document.createTextNode("")),this.sheet=(function(l){if(l.sheet)return l.sheet;for(var c=document.styleSheets,d=0,h=c.length;d=0){var l=document.createTextNode(r),c=this.nodes[i];return this.element.insertBefore(l,c||null),this.length++,!0}return!1},s.deleteRule=function(i){this.element.removeChild(this.nodes[i]),this.length--},s.getRule=function(i){return i0&&(y+=w+",")})),c+=""+f+b+'{content:"'+y+`"}/*!sc*/ -`}}}return c})(this)},a})(),GD=/(a)(d)/gi,G_=function(a){return String.fromCharCode(a+(a>25?39:97))};function im(a){var s,i="";for(s=Math.abs(a);s>52;s=s/52|0)i=G_(s%52)+i;return(G_(s%52)+i).replace(GD,"$1-$2")}var An=function(a,s){for(var i=s.length;i;)a=33*a^s.charCodeAt(--i);return a},tC=function(a){return An(5381,a)};function sC(a){for(var s=0;s>>0);if(!i.hasNameForId(l,h)){var p=r(d,"."+h,void 0,l);i.insertRules(l,h,p)}c.push(h),this.staticRulesId=h}else{for(var f=this.rules.length,b=An(this.baseHash,r.hash),y="",w=0;w>>0);if(!i.hasNameForId(l,S)){var T=r(y,"."+S,void 0,l);i.insertRules(l,S,T)}c.push(S)}}return c.join(" ")},a})(),YD=/^\s*\/\/.*$/gm,JD=[":","[",".","#"];function qD(a){var s,i,r,l,c=Yo,d=c.options,h=d===void 0?Yo:d,p=c.plugins,f=p===void 0?Ec:p,b=new xD(h),y=[],w=(function($){function S(T){if(T)try{$(T+"}")}catch{}}return function(T,E,D,M,P,W,G,z,Z,he){switch(T){case 1:if(Z===0&&E.charCodeAt(0)===64)return $(E+";"),"";break;case 2:if(z===0)return E+"/*|*/";break;case 3:switch(z){case 102:case 112:return $(D[0]+E),"";default:return E+(he===0?"/*|*/":"")}case-2:E.split("/*|*/}").forEach(S)}}})((function($){y.push($)})),v=function($,S,T){return S===0&&JD.indexOf(T[i.length])!==-1||T.match(l)?$:"."+s};function _($,S,T,E){E===void 0&&(E="&");var D=$.replace(YD,""),M=S&&T?T+" "+S+" { "+D+" }":D;return s=E,i=S,r=new RegExp("\\"+i+"\\b","g"),l=new RegExp("(\\"+i+"\\b){2,}"),b(T||!S?"":S,M)}return b.use([].concat(f,[function($,S,T){$===2&&T.length&&T[0].lastIndexOf(i)>0&&(T[0]=T[0].replace(r,v))},w,function($){if($===-2){var S=y;return y=[],S}}])),_.hash=f.length?f.reduce((function($,S){return S.name||ga(15),An($,S.name)}),5381).toString():"",_}var oC=_e.createContext();oC.Consumer;var iC=_e.createContext(),XD=(iC.Consumer,new xc),nm=qD();function nC(){return ia(oC)||XD}function rC(){return ia(iC)||nm}var ZD=(function(){function a(s,i){var r=this;this.inject=function(l,c){c===void 0&&(c=nm);var d=r.name+c.hash;l.hasNameForId(r.id,d)||l.insertRules(r.id,d,c(r.rules,d,"@keyframes"))},this.toString=function(){return ga(12,String(r.name))},this.name=s,this.id="sc-keyframes-"+s,this.rules=i}return a.prototype.getName=function(s){return s===void 0&&(s=nm),this.name+s.hash},a})(),QD=/([A-Z])/,eA=/([A-Z])/g,tA=/^ms-/,sA=function(a){return"-"+a.toLowerCase()};function V_(a){return QD.test(a)?a.replace(eA,sA).replace(tA,"-ms-"):a}var K_=function(a){return a==null||a===!1||a===""};function Ni(a,s,i,r){if(Array.isArray(a)){for(var l,c=[],d=0,h=a.length;d1?s-1:0),r=1;r?@[\\\]^`{|}~-]+/g,iA=/(^-|-$)/g;function hg(a){return a.replace(oA,"-").replace(iA,"")}var cC=function(a){return im(tC(a)>>>0)};function ac(a){return typeof a=="string"&&!0}var rm=function(a){return typeof a=="function"||typeof a=="object"&&a!==null&&!Array.isArray(a)},nA=function(a){return a!=="__proto__"&&a!=="constructor"&&a!=="prototype"};function rA(a,s,i){var r=a[i];rm(s)&&rm(r)?uC(r,s):a[i]=s}function uC(a){for(var s=arguments.length,i=new Array(s>1?s-1:0),r=1;r=0||(he[z]=W[z]);return he})(s,["componentId"]),P=D&&D+"-"+(ac(E)?E:hg(H_(E)));return dC(E,to({},M,{attrs:w,componentId:P}),i)},Object.defineProperty(_,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(E){this._foldedDefaultProps=r?uC({},a.defaultProps,E):E}}),Object.defineProperty(_,"toString",{value:function(){return"."+_.styledComponentId}}),l&&OS(_,a,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),_}var ks=function(a){return(function s(i,r,l){if(l===void 0&&(l=Yo),!Qk.isValidElementType(r))return ga(1,String(r));var c=function(){return i(r,l,aC.apply(void 0,arguments))};return c.withConfig=function(d){return s(i,r,to({},l,{},d))},c.attrs=function(d){return s(i,r,to({},l,{attrs:Array.prototype.concat(l.attrs,d).filter(Boolean)}))},c})(dC,a)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(a){ks[a]=ks(a)}));var aA=(function(){function a(i,r){this.rules=i,this.componentId=r,this.isStatic=sC(i),xc.registerId(this.componentId+1)}var s=a.prototype;return s.createStyles=function(i,r,l,c){var d=c(Ni(this.rules,r,l,c).join(""),""),h=this.componentId+i;l.insertRules(h,h,d)},s.removeStyles=function(i,r){r.clearRules(this.componentId+i)},s.renderStyles=function(i,r,l,c){i>2&&xc.registerId(this.componentId+i),this.removeStyles(i,l),this.createStyles(i,r,l,c)},a})();function lA(a){for(var s=arguments.length,i=new Array(s>1?s-1:0),r=1;ra.length)&&(s=a.length);for(var i=0,r=Array(s);i=a.length?{done:!0}:{done:!1,value:a[r++]}},e:function(p){throw p},f:l}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +/* ====== */`);const GS=_e.forwardRef((({className:a,theme:s,draggerClassName:i,direction:r=ft.Vertical,onDragging:l},c)=>{const d=`__dbk__gutter ${r} ${a||s}`,h=`__dbk__dragger ${r} ${i||s}`;return m.jsx("div",Object.assign({className:d,ref:c,dir:r,onMouseDown:l,onTouchStart:fc?l:void 0},{children:m.jsx("div",{className:h},void 0)}),void 0)}));var ws;function Pg(a,s,i){let r,l;return s?(r=a/2,l=a):i?(r=a,l=a/2):(r=a,l=a),{aGutterSize:r,bGutterSize:l}}function VS(a,s){switch(s.type){case ws.SetIsReadyToCompute:return Object.assign(Object.assign({},a),{isReady:s.payload.isReady});case ws.CreatePairs:{const{direction:i,children:r,gutters:l}=s.payload,c=r[0].parentNode;if(!c)throw new Error("Cannot create pairs - parent is undefined.");const d=Cc(i,c);if(d===void 0)throw new Error(`Cannot create pairs - parent has undefined or zero size: ${d}.`);const h=[];return r.forEach(((p,f)=>{if(f>0){const b=r[f-1],y=r[f],w=l[f-1],v=i===ft.Horizontal?b.getBoundingClientRect().left:b.getBoundingClientRect().top,_=i===ft.Horizontal?y.getBoundingClientRect().right:y.getBoundingClientRect().bottom,$=i===ft.Horizontal?b.getBoundingClientRect().width+w.getBoundingClientRect().width+y.getBoundingClientRect().width:b.getBoundingClientRect().height+w.getBoundingClientRect().height+y.getBoundingClientRect().height,S=i===ft.Horizontal?w.getBoundingClientRect().width:w.getBoundingClientRect().height,T={idx:f-1,a:b,b:y,gutter:w,parent:c,start:v,end:_,size:$,gutterSize:S,aSizePct:100/r.length,bSizePct:100/r.length};h.push(T)}})),Object.assign(Object.assign({},a),{pairs:h})}case ws.StartDragging:{const{gutterIdx:i}=s.payload;return Object.assign(Object.assign({},a),{isDragging:!0,draggingIdx:i})}case ws.StopDragging:return Object.assign(Object.assign({},a),{isDragging:!1});case ws.CalculateSizes:{const{direction:i,gutterIdx:r}=s.payload,l=a.pairs[r],c=Cc(i,l.parent);if(!c)throw new Error("Cannot calculate sizes - 'pair.parent' has undefined or zero size.");const d=l.gutter[i===ft.Horizontal?"clientWidth":"clientHeight"],h=r===0,p=r===a.pairs.length-1,{aGutterSize:f,bGutterSize:b}=Pg(d,h,p);let y,w,v,_,$;return i===ft.Horizontal?(y=l.a.getBoundingClientRect().left,w=l.b.getBoundingClientRect().right,_=(l.a.getBoundingClientRect().width+f)/c*100,$=(l.b.getBoundingClientRect().width+b)/c*100,v=l.a.getBoundingClientRect().width+f+b+l.b.getBoundingClientRect().width):(y=l.a.getBoundingClientRect().top,w=l.b.getBoundingClientRect().bottom,_=(l.a.getBoundingClientRect().height+f)/c*100,$=(l.b.getBoundingClientRect().height+b)/c*100,v=l.a.getBoundingClientRect().height+f+b+l.b.getBoundingClientRect().height),a.pairs[r]=Object.assign(Object.assign({},l),{start:y,end:w,size:v,aSizePct:_,bSizePct:$,gutterSize:d}),Object.assign({},a)}default:return a}}function Vw(a,s=0,i=[]){return RT.toArray(a).reduce(((r,l,c)=>(WS.isFragment(l)?r.push.apply(r,Vw(l.props.children,s+1,i.concat(l.key||c))):Ew(l)?r.push(xg(l,{key:i.concat(String(l.key)).join(".")})):typeof l!="string"&&typeof l!="number"||r.push(l),r)),[])}(function(a){a[a.SetIsReadyToCompute=0]="SetIsReadyToCompute",a[a.CreatePairs=1]="CreatePairs",a[a.CalculateSizes=2]="CalculateSizes",a[a.StartDragging=3]="StartDragging",a[a.StopDragging=4]="StopDragging"})(ws||(ws={}));const u_=a=>"changedTouches"in a;var ft,Bg;(function(a){a.Horizontal="Horizontal",a.Vertical="Vertical"})(ft||(ft={})),(function(a){a.Light="Light",a.Dark="Dark"})(Bg||(Bg={}));const fc=typeof window<"u"&&"ontouchstart"in window;function Xp(a){return a===ft.Horizontal?"col-resize":"row-resize"}const KS={isReady:!1,isDragging:!1,pairs:[]};function d_({direction:a=ft.Horizontal,minWidths:s=[],minHeights:i=[],initialSizes:r,gutterTheme:l=Bg.Dark,gutterClassName:c,draggerClassName:d,children:h,onResizeStarted:p,onResizeFinished:f,classes:b=[]}){const y=Vw(h),[w,v]=AT(VS,KS),_=Ko(null),$=Ko([]),S=Ko([]);$.current=[],S.current=[];const T=_e.useCallback((O=>{v({type:ws.SetIsReadyToCompute,payload:{isReady:O}})}),[]),E=_e.useCallback(((O,K)=>{v({type:ws.StartDragging,payload:{gutterIdx:K}});const C=w.pairs[K];p==null||p(C.idx),C.a.style.userSelect="none",C.b.style.userSelect="none",C.gutter.style.cursor=Xp(O),C.parent.style.cursor=Xp(O),document.body.style.cursor=Xp(O)}),[w.pairs]),D=_e.useCallback((()=>{v({type:ws.StopDragging});const O=[];for(let C=0;C{v({type:ws.CalculateSizes,payload:{direction:O,gutterIdx:K}})}),[]),P=_e.useCallback(((O,K,C)=>{v({type:ws.CreatePairs,payload:{direction:O,children:K,gutters:C}})}),[]),W=_e.useCallback(((O,K,C,Q)=>{const ve=K[0].parentNode;if(!ve)throw new Error("Cannot set initial sizes - parent is undefined");if(Cc(O,ve)===void 0)throw new Error("Cannot set initial sizes - parent has undefined size");K.forEach(((ce,ne)=>{const me=ne===0,re=ne===K.length-1;let B,N=0;K.length>1&&(N=C[re?ne-1:ne].getBoundingClientRect()[O===ft.Horizontal?"width":"height"],N=me||re?N/2:N),B=Q&&ne{if(w.draggingIdx===void 0)throw new Error("Cannot adjust size - 'draggingIdx' is undefined");const C=w.pairs[w.draggingIdx];if(C.size===void 0)throw new Error("Cannot adjust size - 'pair.size' is undefined");if(C.gutterSize===void 0)throw new Error("Cannot adjust size - 'pair.gutterSize' is undefined");const Q=C.aSizePct+C.bSizePct,ve=K/C.size*Q,ce=Q-K/C.size*Q,ne=w.draggingIdx===0,me=w.draggingIdx===w.pairs.length-1,{aGutterSize:re,bGutterSize:B}=Pg(C.gutterSize,ne,me),N=`calc(${ve}% - ${re}px)`,te=`calc(${ce}% - ${B}px)`;O===ft.Horizontal?(C.a.style.width=N,C.b.style.width=te):(C.a.style.height=N,C.b.style.height=te)}),[w.draggingIdx,w.pairs,a]),z=_e.useCallback(((O,K,C)=>{if(!w.isDragging)return;if(w.draggingIdx===void 0)throw new Error("Cannot drag - 'draggingIdx' is undefined");const Q=w.pairs[w.draggingIdx];if(Q.start===void 0)throw new Error("Cannot drag - 'pair.start' is undefined");if(Q.size===void 0)throw new Error("Cannot drag - 'pair.size' is undefined");if(Q.gutterSize===void 0)throw new Error("Cannot drag - 'pair.gutterSize' is undefined");let ve=(function(me,re){const B=u_(re)?re.changedTouches[0]:re;return me===ft.Horizontal?B.clientX:B.clientY})(K,O)-Q.start,ce=16,ne=16;C.length>w.draggingIdx&&(ce=C[w.draggingIdx]),C.length>=w.draggingIdx+1&&(ne=C[w.draggingIdx+1]),ve=Q.size-(Q.gutterSize+ne)&&(ve=Q.size-(Q.gutterSize+ne)),G(K,ve)}),[w.isDragging,w.draggingIdx,w.pairs,G]),Z=()=>{if(w.isDragging){if(w.draggingIdx===void 0)throw new Error("Cannot calculate sizes after dragging = 'state.draggingIdx' is undefined");M(a,w.draggingIdx),D()}},he=O=>{w.isDragging&&(u_(O)&&O.preventDefault(),z(O,a,a===ft.Horizontal?s:i))};function Ce(O,K){if(!O.current)throw new Error("Can't add element to ref object - ref isn't initialized");K&&!O.current.includes(K)&&O.current.push(K)}return ic("mouseup",Z,[w.isDragging,D]),ic("mousemove",he,[a,w.isDragging,z,s,i]),ic("touchend",Z,[w.isDragging,D],{condition:fc}),ic("touchmove",he,[a,w.isDragging,z,s,i],{condition:fc,passive:!fc}),Lt((function(){if(!_.current)return;const O=_.current.parentElement;if(!O)return;const K=new ResizeObserver((()=>{const C=getComputedStyle(O),Q=a===ft.Horizontal?O.clientWidth:O.clientHeight;T(!!C&&!!Q)}));return K.observe(O),()=>{K.disconnect()}}),[_.current,a]),Lt((function(){if(w.isReady&&(!$.current||$.current[0].offsetParent)){if(!$.current||!S.current)throw new Error("Cannot create pairs - either variable 'childRefs' or 'gutterRefs' is undefined");y.length<=1?W(a,$.current,S.current,r):(W(a,$.current,S.current,r),P(a,$.current,S.current))}}),[h,w.isReady,a,W,P,r]),m.jsx("div",Object.assign({className:`__dbk__container ${a}`,ref:_},{children:w.isReady&&y.map(((O,K)=>m.jsxs(_e.Fragment,{children:[m.jsx("div",Object.assign({ref:C=>Ce($,C),className:"__dbk__child-wrapper "+(KCe(S,C),className:c,theme:l,draggerClassName:d,direction:a,onDragging:()=>{return M(a,C=K),void E(a,C);var C}},void 0)]},K)))}),void 0)}const Kw=um({dragDropManager:void 0});function Qr(a){"@babel/helpers - typeof";return Qr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},Qr(a)}function YS(a,s){if(Qr(a)!="object"||!a)return a;var i=a[Symbol.toPrimitive];if(i!==void 0){var r=i.call(a,s);if(Qr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(a)}function JS(a){var s=YS(a,"string");return Qr(s)=="symbol"?s:s+""}function qS(a,s,i){return(s=JS(s))in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function bs(a){return"Minified Redux error #"+a+"; visit https://redux.js.org/Errors?code="+a+" for the full message or use the non-minified dev environment for full errors. "}var h_=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),p_=function(){return Math.random().toString(36).substring(7).split("").join(".")},g_={INIT:"@@redux/INIT"+p_(),REPLACE:"@@redux/REPLACE"+p_()};function XS(a){if(typeof a!="object"||a===null)return!1;for(var s=a;Object.getPrototypeOf(s)!==null;)s=Object.getPrototypeOf(s);return Object.getPrototypeOf(a)===s}function Yw(a,s,i){var r;if(typeof s=="function"&&typeof i=="function"||typeof i=="function"&&typeof arguments[3]=="function")throw new Error(bs(0));if(typeof s=="function"&&typeof i>"u"&&(i=s,s=void 0),typeof i<"u"){if(typeof i!="function")throw new Error(bs(1));return i(Yw)(a,s)}if(typeof a!="function")throw new Error(bs(2));var l=a,c=s,d=[],h=d,p=!1;function f(){h===d&&(h=d.slice())}function b(){if(p)throw new Error(bs(3));return c}function y($){if(typeof $!="function")throw new Error(bs(4));if(p)throw new Error(bs(5));var S=!0;return f(),h.push($),function(){if(S){if(p)throw new Error(bs(6));S=!1,f();var E=h.indexOf($);h.splice(E,1),d=null}}}function w($){if(!XS($))throw new Error(bs(7));if(typeof $.type>"u")throw new Error(bs(8));if(p)throw new Error(bs(9));try{p=!0,c=l(c,$)}finally{p=!1}for(var S=d=h,T=0;Tr&&r[l]?r[l]:i||null,a)}function eE(a,s){return a.filter(i=>i!==s)}function Jw(a){return typeof a=="object"}function tE(a,s){const i=new Map,r=c=>{i.set(c,i.has(c)?i.get(c)+1:1)};a.forEach(r),s.forEach(r);const l=[];return i.forEach((c,d)=>{c===1&&l.push(d)}),l}function sE(a,s){return a.filter(i=>s.indexOf(i)>-1)}const mm="dnd-core/INIT_COORDS",Xc="dnd-core/BEGIN_DRAG",fm="dnd-core/PUBLISH_DRAG_SOURCE",Zc="dnd-core/HOVER",Qc="dnd-core/DROP",eu="dnd-core/END_DRAG";function m_(a,s){return{type:mm,payload:{sourceClientOffset:s||null,clientOffset:a||null}}}const oE={type:mm,payload:{clientOffset:null,sourceClientOffset:null}};function iE(a){return function(i=[],r={publishSource:!0}){const{publishSource:l=!0,clientOffset:c,getSourceClientOffset:d}=r,h=a.getMonitor(),p=a.getRegistry();a.dispatch(m_(c)),nE(i,h,p);const f=lE(i,h);if(f==null){a.dispatch(oE);return}let b=null;if(c){if(!d)throw new Error("getSourceClientOffset must be defined");rE(d),b=d(f)}a.dispatch(m_(c,b));const w=p.getSource(f).beginDrag(h,f);if(w==null)return;aE(w),p.pinSource(f);const v=p.getSourceType(f);return{type:Xc,payload:{itemType:v,item:w,sourceId:f,clientOffset:c||null,sourceClientOffset:b||null,isSourcePublic:!!l}}}}function nE(a,s,i){Ve(!s.isDragging(),"Cannot call beginDrag while dragging."),a.forEach(function(r){Ve(i.getSource(r),"Expected sourceIds to be registered.")})}function rE(a){Ve(typeof a=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function aE(a){Ve(Jw(a),"Item must be an object.")}function lE(a,s){let i=null;for(let r=a.length-1;r>=0;r--)if(s.canDragSource(a[r])){i=a[r];break}return i}function cE(a,s,i){return s in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function uE(a){for(var s=1;s{const p=pE(d,h,l,r),f={type:Qc,payload:{dropResult:uE({},i,p)}};a.dispatch(f)})}}function hE(a){Ve(a.isDragging(),"Cannot call drop while not dragging."),Ve(!a.didDrop(),"Cannot call drop twice during one drag operation.")}function pE(a,s,i,r){const l=i.getTarget(a);let c=l?l.drop(r,a):void 0;return gE(c),typeof c>"u"&&(c=s===0?{}:r.getDropResult()),c}function gE(a){Ve(typeof a>"u"||Jw(a),"Drop result must either be an object or undefined.")}function mE(a){const s=a.getTargetIds().filter(a.canDropOnTarget,a);return s.reverse(),s}function fE(a){return function(){const i=a.getMonitor(),r=a.getRegistry();$E(i);const l=i.getSourceId();return l!=null&&(r.getSource(l,!0).endDrag(i,l),r.unpinSource()),{type:eu}}}function $E(a){Ve(a.isDragging(),"Cannot call endDrag while not dragging.")}function jg(a,s){return s===null?a===null:Array.isArray(a)?a.some(i=>i===s):a===s}function bE(a){return function(i,{clientOffset:r}={}){vE(i);const l=i.slice(0),c=a.getMonitor(),d=a.getRegistry(),h=c.getItemType();return _E(l,d,h),yE(l,c,d),wE(l,c,d),{type:Zc,payload:{targetIds:l,clientOffset:r||null}}}}function vE(a){Ve(Array.isArray(a),"Expected targetIds to be an array.")}function yE(a,s,i){Ve(s.isDragging(),"Cannot call hover while not dragging."),Ve(!s.didDrop(),"Cannot call hover after drop.");for(let r=0;r=0;r--){const l=a[r],c=s.getTargetType(l);jg(c,i)||a.splice(r,1)}}function wE(a,s,i){a.forEach(function(r){i.getTarget(r).hover(s,r)})}function kE(a){return function(){if(a.getMonitor().isDragging())return{type:fm}}}function CE(a){return{beginDrag:iE(a),publishDragSource:kE(a),hover:bE(a),drop:dE(a),endDrag:fE(a)}}class TE{receiveBackend(s){this.backend=s}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const s=this,{dispatch:i}=this.store;function r(c){return(...d)=>{const h=c.apply(s,d);typeof h<"u"&&i(h)}}const l=CE(this);return Object.keys(l).reduce((c,d)=>{const h=l[d];return c[d]=r(h),c},{})}dispatch(s){this.store.dispatch(s)}constructor(s,i){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=s,this.monitor=i,s.subscribe(this.handleRefCountChange)}}function SE(a,s){return{x:a.x+s.x,y:a.y+s.y}}function qw(a,s){return{x:a.x-s.x,y:a.y-s.y}}function EE(a){const{clientOffset:s,initialClientOffset:i,initialSourceClientOffset:r}=a;return!s||!i||!r?null:qw(SE(s,r),i)}function IE(a){const{clientOffset:s,initialClientOffset:i}=a;return!s||!i?null:qw(s,i)}const Kr=[],$m=[];Kr.__IS_NONE__=!0;$m.__IS_ALL__=!0;function xE(a,s){return a===Kr?!1:a===$m||typeof s>"u"?!0:sE(s,a).length>0}class DE{subscribeToStateChange(s,i={}){const{handlerIds:r}=i;Ve(typeof s=="function","listener must be a function."),Ve(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let l=this.store.getState().stateId;const c=()=>{const d=this.store.getState(),h=d.stateId;try{h===l||h===l+1&&!xE(d.dirtyHandlerIds,r)||s()}finally{l=h}};return this.store.subscribe(c)}subscribeToOffsetChange(s){Ve(typeof s=="function","listener must be a function.");let i=this.store.getState().dragOffset;const r=()=>{const l=this.store.getState().dragOffset;l!==i&&(i=l,s())};return this.store.subscribe(r)}canDragSource(s){if(!s)return!1;const i=this.registry.getSource(s);return Ve(i,`Expected to find a valid source. sourceId=${s}`),this.isDragging()?!1:i.canDrag(this,s)}canDropOnTarget(s){if(!s)return!1;const i=this.registry.getTarget(s);if(Ve(i,`Expected to find a valid target. targetId=${s}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(s),l=this.getItemType();return jg(r,l)&&i.canDrop(this,s)}isDragging(){return!!this.getItemType()}isDraggingSource(s){if(!s)return!1;const i=this.registry.getSource(s,!0);if(Ve(i,`Expected to find a valid source. sourceId=${s}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(s),l=this.getItemType();return r!==l?!1:i.isDragging(this,s)}isOverTarget(s,i={shallow:!1}){if(!s)return!1;const{shallow:r}=i;if(!this.isDragging())return!1;const l=this.registry.getTargetType(s),c=this.getItemType();if(c&&!jg(l,c))return!1;const d=this.getTargetIds();if(!d.length)return!1;const h=d.indexOf(s);return r?h===d.length-1:h>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return EE(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return IE(this.store.getState().dragOffset)}constructor(s,i){this.store=s,this.registry=i}}const f_=typeof global<"u"?global:self,Xw=f_.MutationObserver||f_.WebKitMutationObserver;function Zw(a){return function(){const i=setTimeout(l,0),r=setInterval(l,50);function l(){clearTimeout(i),clearInterval(r),a()}}}function AE(a){let s=1;const i=new Xw(a),r=document.createTextNode("");return i.observe(r,{characterData:!0}),function(){s=-s,r.data=s}}const RE=typeof Xw=="function"?AE:Zw;class OE{enqueueTask(s){const{queue:i,requestFlush:r}=this;i.length||(r(),this.flushing=!0),i[i.length]=s}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:s}=this;for(;this.indexthis.capacity){for(let r=0,l=s.length-this.index;r{this.pendingErrors.push(s),this.requestErrorThrow()},this.requestFlush=RE(this.flush),this.requestErrorThrow=Zw(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class NE{call(){try{this.task&&this.task()}catch(s){this.onError(s)}finally{this.task=null,this.release(this)}}constructor(s,i){this.onError=s,this.release=i,this.task=null}}class ME{create(s){const i=this.freeTasks,r=i.length?i.pop():new NE(this.onError,l=>i[i.length]=l);return r.task=s,r}constructor(s){this.onError=s,this.freeTasks=[]}}const Qw=new OE,LE=new ME(Qw.registerPendingError);function PE(a){Qw.enqueueTask(LE.create(a))}const bm="dnd-core/ADD_SOURCE",vm="dnd-core/ADD_TARGET",ym="dnd-core/REMOVE_SOURCE",tu="dnd-core/REMOVE_TARGET";function BE(a){return{type:bm,payload:{sourceId:a}}}function jE(a){return{type:vm,payload:{targetId:a}}}function FE(a){return{type:ym,payload:{sourceId:a}}}function zE(a){return{type:tu,payload:{targetId:a}}}function UE(a){Ve(typeof a.canDrag=="function","Expected canDrag to be a function."),Ve(typeof a.beginDrag=="function","Expected beginDrag to be a function."),Ve(typeof a.endDrag=="function","Expected endDrag to be a function.")}function HE(a){Ve(typeof a.canDrop=="function","Expected canDrop to be a function."),Ve(typeof a.hover=="function","Expected hover to be a function."),Ve(typeof a.drop=="function","Expected beginDrag to be a function.")}function Fg(a,s){if(s&&Array.isArray(a)){a.forEach(i=>Fg(i,!1));return}Ve(typeof a=="string"||typeof a=="symbol",s?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var _s;(function(a){a.SOURCE="SOURCE",a.TARGET="TARGET"})(_s||(_s={}));let WE=0;function GE(){return WE++}function VE(a){const s=GE().toString();switch(a){case _s.SOURCE:return`S${s}`;case _s.TARGET:return`T${s}`;default:throw new Error(`Unknown Handler Role: ${a}`)}}function $_(a){switch(a[0]){case"S":return _s.SOURCE;case"T":return _s.TARGET;default:throw new Error(`Cannot parse handler ID: ${a}`)}}function b_(a,s){const i=a.entries();let r=!1;do{const{done:l,value:[,c]}=i.next();if(c===s)return!0;r=!!l}while(!r);return!1}class KE{addSource(s,i){Fg(s),UE(i);const r=this.addHandler(_s.SOURCE,s,i);return this.store.dispatch(BE(r)),r}addTarget(s,i){Fg(s,!0),HE(i);const r=this.addHandler(_s.TARGET,s,i);return this.store.dispatch(jE(r)),r}containsHandler(s){return b_(this.dragSources,s)||b_(this.dropTargets,s)}getSource(s,i=!1){return Ve(this.isSourceId(s),"Expected a valid source ID."),i&&s===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(s)}getTarget(s){return Ve(this.isTargetId(s),"Expected a valid target ID."),this.dropTargets.get(s)}getSourceType(s){return Ve(this.isSourceId(s),"Expected a valid source ID."),this.types.get(s)}getTargetType(s){return Ve(this.isTargetId(s),"Expected a valid target ID."),this.types.get(s)}isSourceId(s){return $_(s)===_s.SOURCE}isTargetId(s){return $_(s)===_s.TARGET}removeSource(s){Ve(this.getSource(s),"Expected an existing source."),this.store.dispatch(FE(s)),PE(()=>{this.dragSources.delete(s),this.types.delete(s)})}removeTarget(s){Ve(this.getTarget(s),"Expected an existing target."),this.store.dispatch(zE(s)),this.dropTargets.delete(s),this.types.delete(s)}pinSource(s){const i=this.getSource(s);Ve(i,"Expected an existing source."),this.pinnedSourceId=s,this.pinnedSource=i}unpinSource(){Ve(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(s,i,r){const l=VE(s);return this.types.set(l,i),s===_s.SOURCE?this.dragSources.set(l,r):s===_s.TARGET&&this.dropTargets.set(l,r),l}constructor(s){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=s}}const YE=(a,s)=>a===s;function JE(a,s){return!a&&!s?!0:!a||!s?!1:a.x===s.x&&a.y===s.y}function qE(a,s,i=YE){if(a.length!==s.length)return!1;for(let r=0;r0||!qE(i,r)))return Kr;const d=r[r.length-1],h=i[i.length-1];return d!==h&&(d&&l.push(d),h&&l.push(h)),l}function ZE(a,s,i){return s in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function QE(a){for(var s=1;s=0)&&Object.prototype.propertyIsEnumerable.call(a,r)&&(i[r]=a[r])}return i}function hI(a,s){if(a==null)return{};var i={},r=Object.keys(a),l,c;for(c=0;c=0)&&(i[l]=a[l]);return i}let y_=0;const $c=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var ek=dm(function(s){var{children:i}=s,r=dI(s,["children"]);const[l,c]=pI(r);return Lt(()=>{if(c){const d=tk();return++y_,()=>{--y_===0&&(d[$c]=null)}}},[]),m.jsx(Kw.Provider,{value:l,children:i})});function pI(a){if("manager"in a)return[{dragDropManager:a.manager},!1];const s=gI(a.backend,a.context,a.options,a.debugMode),i=!a.context;return[s,i]}function gI(a,s=tk(),i,r){const l=s;return l[$c]||(l[$c]={dragDropManager:cI(a,s,i,r)}),l[$c]}function tk(){return typeof global<"u"?global:window}var mI=function a(s,i){if(s===i)return!0;if(s&&i&&typeof s=="object"&&typeof i=="object"){if(s.constructor!==i.constructor)return!1;var r,l,c;if(Array.isArray(s)){if(r=s.length,r!=i.length)return!1;for(l=r;l--!==0;)if(!a(s[l],i[l]))return!1;return!0}if(s.constructor===RegExp)return s.source===i.source&&s.flags===i.flags;if(s.valueOf!==Object.prototype.valueOf)return s.valueOf()===i.valueOf();if(s.toString!==Object.prototype.toString)return s.toString()===i.toString();if(c=Object.keys(s),r=c.length,r!==Object.keys(i).length)return!1;for(l=r;l--!==0;)if(!Object.prototype.hasOwnProperty.call(i,c[l]))return!1;for(l=r;l--!==0;){var d=c[l];if(!a(s[d],i[d]))return!1}return!0}return s!==s&&i!==i};const fI=Xo(mI),Ri=typeof window<"u"?hm:Lt;function $I(a,s,i){const[r,l]=kt(()=>s(a)),c=xn(()=>{const d=s(a);fI(r,d)||(l(d),i&&i())},[r,a,i]);return Ri(c),[r,c]}function bI(a,s,i){const[r,l]=$I(a,s,i);return Ri(function(){const d=a.getHandlerId();if(d!=null)return a.subscribeToStateChange(l,{handlerIds:[d]})},[a,l]),r}function sk(a,s,i){return bI(s,a||(()=>({})),()=>i.reconnect())}function ok(a,s){const i=[];return typeof a!="function"&&i.push(a),us(()=>typeof a=="function"?a():a,i)}function vI(a){return us(()=>a.hooks.dragSource(),[a])}function yI(a){return us(()=>a.hooks.dragPreview(),[a])}let Zp=!1,Qp=!1;class _I{receiveHandlerId(s){this.sourceId=s}getHandlerId(){return this.sourceId}canDrag(){Ve(!Zp,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Zp=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Zp=!1}}isDragging(){if(!this.sourceId)return!1;Ve(!Qp,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Qp=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Qp=!1}}subscribeToStateChange(s,i){return this.internalMonitor.subscribeToStateChange(s,i)}isDraggingSource(s){return this.internalMonitor.isDraggingSource(s)}isOverTarget(s,i){return this.internalMonitor.isOverTarget(s,i)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(s){return this.internalMonitor.subscribeToOffsetChange(s)}canDragSource(s){return this.internalMonitor.canDragSource(s)}canDropOnTarget(s){return this.internalMonitor.canDropOnTarget(s)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(s){this.sourceId=null,this.internalMonitor=s.getMonitor()}}let eg=!1;class wI{receiveHandlerId(s){this.targetId=s}getHandlerId(){return this.targetId}subscribeToStateChange(s,i){return this.internalMonitor.subscribeToStateChange(s,i)}canDrop(){if(!this.targetId)return!1;Ve(!eg,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return eg=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{eg=!1}}isOver(s){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,s):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(s){this.targetId=null,this.internalMonitor=s.getMonitor()}}function kI(a,s,i){const r=i.getRegistry(),l=r.addTarget(a,s);return[l,()=>r.removeTarget(l)]}function CI(a,s,i){const r=i.getRegistry(),l=r.addSource(a,s);return[l,()=>r.removeSource(l)]}function zg(a,s,i,r){let l;if(l!==void 0)return!!l;if(a===s)return!0;if(typeof a!="object"||!a||typeof s!="object"||!s)return!1;const c=Object.keys(a),d=Object.keys(s);if(c.length!==d.length)return!1;const h=Object.prototype.hasOwnProperty.bind(s);for(let p=0;p, or turn it into a drag source or a drop target itself.`)}function SI(a){return(s=null,i=null)=>{if(!Ew(s)){const c=s;return a(c,i),c}const r=s;return TI(r),EI(r,i?c=>a(c,i):a)}}function ik(a){const s={};return Object.keys(a).forEach(i=>{const r=a[i];if(i.endsWith("Ref"))s[i]=a[i];else{const l=SI(r);s[i]=()=>l}}),s}function __(a,s){typeof a=="function"?a(s):a.current=s}function EI(a,s){const i=a.ref;return Ve(typeof i!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a or
. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),i?xg(a,{ref:r=>{__(i,r),__(s,r)}}):xg(a,{ref:s})}class II{receiveHandlerId(s){this.handlerId!==s&&(this.handlerId=s,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(s){this.dragSourceOptionsInternal=s}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(s){this.dragPreviewOptionsInternal=s}reconnect(){const s=this.reconnectDragSource();this.reconnectDragPreview(s)}reconnectDragSource(){const s=this.dragSource,i=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return i&&this.disconnectDragSource(),this.handlerId?s?(i&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=s,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,s,this.dragSourceOptions)),i):(this.lastConnectedDragSource=s,i):i}reconnectDragPreview(s=!1){const i=this.dragPreview,r=s||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!i){this.lastConnectedDragPreview=i;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=i,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,i,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!zg(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!zg(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(s){this.hooks=ik({dragSource:(i,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,Ug(i)?this.dragSourceRef=i:this.dragSourceNode=i,this.reconnectDragSource()},dragPreview:(i,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,Ug(i)?this.dragPreviewRef=i:this.dragPreviewNode=i,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=s}}class xI{get connectTarget(){return this.dropTarget}reconnect(){const s=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();s&&this.disconnectDropTarget();const i=this.dropTarget;if(this.handlerId){if(!i){this.lastConnectedDropTarget=i;return}s&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=i,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,i,this.dropTargetOptions))}}receiveHandlerId(s){s!==this.handlerId&&(this.handlerId=s,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(s){this.dropTargetOptionsInternal=s}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!zg(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(s){this.hooks=ik({dropTarget:(i,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,Ug(i)?this.dropTargetRef=i:this.dropTargetNode=i,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=s}}function zn(){const{dragDropManager:a}=ia(Kw);return Ve(a!=null,"Expected drag drop context"),a}function DI(a,s){const i=zn(),r=us(()=>new II(i.getBackend()),[i]);return Ri(()=>(r.dragSourceOptions=a||null,r.reconnect(),()=>r.disconnectDragSource()),[r,a]),Ri(()=>(r.dragPreviewOptions=s||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,s]),r}function AI(){const a=zn();return us(()=>new _I(a),[a])}class RI{beginDrag(){const s=this.spec,i=this.monitor;let r=null;return typeof s.item=="object"?r=s.item:typeof s.item=="function"?r=s.item(i):r={},r??null}canDrag(){const s=this.spec,i=this.monitor;return typeof s.canDrag=="boolean"?s.canDrag:typeof s.canDrag=="function"?s.canDrag(i):!0}isDragging(s,i){const r=this.spec,l=this.monitor,{isDragging:c}=r;return c?c(l):i===s.getSourceId()}endDrag(){const s=this.spec,i=this.monitor,r=this.connector,{end:l}=s;l&&l(i.getItem(),i),r.reconnect()}constructor(s,i,r){this.spec=s,this.monitor=i,this.connector=r}}function OI(a,s,i){const r=us(()=>new RI(a,s,i),[s,i]);return Lt(()=>{r.spec=a},[a]),r}function NI(a){return us(()=>{const s=a.type;return Ve(s!=null,"spec.type must be defined"),s},[a])}function MI(a,s,i){const r=zn(),l=OI(a,s,i),c=NI(a);Ri(function(){if(c!=null){const[h,p]=CI(c,l,r);return s.receiveHandlerId(h),i.receiveHandlerId(h),p}},[r,s,i,l,c])}function LI(a,s){const i=ok(a);Ve(!i.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=AI(),l=DI(i.options,i.previewOptions);return MI(i,r,l),[sk(i.collect,r,l),vI(l),yI(l)]}function PI(a){return us(()=>a.hooks.dropTarget(),[a])}function BI(a){const s=zn(),i=us(()=>new xI(s.getBackend()),[s]);return Ri(()=>(i.dropTargetOptions=a||null,i.reconnect(),()=>i.disconnectDropTarget()),[a]),i}function jI(){const a=zn();return us(()=>new wI(a),[a])}function FI(a){const{accept:s}=a;return us(()=>(Ve(a.accept!=null,"accept must be defined"),Array.isArray(s)?s:[s]),[s])}class zI{canDrop(){const s=this.spec,i=this.monitor;return s.canDrop?s.canDrop(i.getItem(),i):!0}hover(){const s=this.spec,i=this.monitor;s.hover&&s.hover(i.getItem(),i)}drop(){const s=this.spec,i=this.monitor;if(s.drop)return s.drop(i.getItem(),i)}constructor(s,i){this.spec=s,this.monitor=i}}function UI(a,s){const i=us(()=>new zI(a,s),[s]);return Lt(()=>{i.spec=a},[a]),i}function HI(a,s,i){const r=zn(),l=UI(a,s),c=FI(a);Ri(function(){const[h,p]=kI(c,l,r);return s.receiveHandlerId(h),i.receiveHandlerId(h),p},[r,s,l,i,c.map(d=>d.toString()).join("|")])}function WI(a,s){const i=ok(a),r=jI(),l=BI(i.options);return HI(i,r,l),[sk(i.collect,r,l),PI(l)]}function nk(a){let s=null;return()=>(s==null&&(s=a()),s)}function GI(a,s){return a.filter(i=>i!==s)}function VI(a,s){const i=new Set,r=c=>i.add(c);a.forEach(r),s.forEach(r);const l=[];return i.forEach(c=>l.push(c)),l}class KI{enter(s){const i=this.entered.length,r=l=>this.isNodeInDocument(l)&&(!l.contains||l.contains(s));return this.entered=VI(this.entered.filter(r),[s]),i===0&&this.entered.length>0}leave(s){const i=this.entered.length;return this.entered=GI(this.entered.filter(this.isNodeInDocument),s),i>0&&this.entered.length===0}reset(){this.entered=[]}constructor(s){this.entered=[],this.isNodeInDocument=s}}class YI{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(s=>{Object.defineProperty(this.item,s,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${s}" until the drop event.`),null}})})}loadDataTransfer(s){if(s){const i={};Object.keys(this.config.exposeProperties).forEach(r=>{const l=this.config.exposeProperties[r];l!=null&&(i[r]={value:l(s,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,i)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(s,i){return i===s.getSourceId()}endDrag(){}constructor(s){this.config=s,this.item={},this.initializeExposedProperties()}}const rk="__NATIVE_FILE__",ak="__NATIVE_URL__",lk="__NATIVE_TEXT__",ck="__NATIVE_HTML__",w_=Object.freeze(Object.defineProperty({__proto__:null,FILE:rk,HTML:ck,TEXT:lk,URL:ak},Symbol.toStringTag,{value:"Module"}));function tg(a,s,i){const r=s.reduce((l,c)=>l||a.getData(c),"");return r??i}const Hg={[rk]:{exposeProperties:{files:a=>Array.prototype.slice.call(a.files),items:a=>a.items,dataTransfer:a=>a},matchesTypes:["Files"]},[ck]:{exposeProperties:{html:(a,s)=>tg(a,s,""),dataTransfer:a=>a},matchesTypes:["Html","text/html"]},[ak]:{exposeProperties:{urls:(a,s)=>tg(a,s,"").split(` +`),dataTransfer:a=>a},matchesTypes:["Url","text/uri-list"]},[lk]:{exposeProperties:{text:(a,s)=>tg(a,s,""),dataTransfer:a=>a},matchesTypes:["Text","text/plain"]}};function JI(a,s){const i=Hg[a];if(!i)throw new Error(`native type ${a} has no configuration`);const r=new YI(i);return r.loadDataTransfer(s),r}function sg(a){if(!a)return null;const s=Array.prototype.slice.call(a.types||[]);return Object.keys(Hg).filter(i=>{const r=Hg[i];return r!=null&&r.matchesTypes?r.matchesTypes.some(l=>s.indexOf(l)>-1):!1})[0]||null}const qI=nk(()=>/firefox/i.test(navigator.userAgent)),uk=nk(()=>!!window.safari);class k_{interpolate(s){const{xs:i,ys:r,c1s:l,c2s:c,c3s:d}=this;let h=i.length-1;if(s===i[h])return r[h];let p=0,f=d.length-1,b;for(;p<=f;){b=Math.floor(.5*(p+f));const v=i[b];if(vs)f=b-1;else return r[b]}h=Math.max(0,f);const y=s-i[h],w=y*y;return r[h]+l[h]*y+c[h]*w+d[h]*y*w}constructor(s,i){const{length:r}=s,l=[];for(let v=0;vs[v]{let W=new k_([0,.5,1],[p.y,p.y/b*_,p.y+_-b]).interpolate(w);return uk()&&c&&(W+=(window.devicePixelRatio-1)*_),W},S=()=>new k_([0,.5,1],[p.x,p.x/f*v,p.x+v-f]).interpolate(y),{offsetX:T,offsetY:E}=l,D=T===0||T,M=E===0||E;return{x:D?T:S(),y:M?E:$()}}let tx=class{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var s;return!((s=this.globalContext)===null||s===void 0)&&s.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var s;return((s=this.optionsArgs)===null||s===void 0?void 0:s.rootElement)||this.window}constructor(s,i){this.ownerDocument=null,this.globalContext=s,this.optionsArgs=i}};function sx(a,s,i){return s in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function C_(a){for(var s=1;s{this.sourcePreviewNodes.delete(s),this.sourcePreviewNodeOptions.delete(s)}}connectDragSource(s,i,r){this.sourceNodes.set(s,i),this.sourceNodeOptions.set(s,r);const l=d=>this.handleDragStart(d,s),c=d=>this.handleSelectStart(d);return i.setAttribute("draggable","true"),i.addEventListener("dragstart",l),i.addEventListener("selectstart",c),()=>{this.sourceNodes.delete(s),this.sourceNodeOptions.delete(s),i.removeEventListener("dragstart",l),i.removeEventListener("selectstart",c),i.setAttribute("draggable","false")}}connectDropTarget(s,i){const r=d=>this.handleDragEnter(d,s),l=d=>this.handleDragOver(d,s),c=d=>this.handleDrop(d,s);return i.addEventListener("dragenter",r),i.addEventListener("dragover",l),i.addEventListener("drop",c),()=>{i.removeEventListener("dragenter",r),i.removeEventListener("dragover",l),i.removeEventListener("drop",c)}}addEventListeners(s){s.addEventListener&&(s.addEventListener("dragstart",this.handleTopDragStart),s.addEventListener("dragstart",this.handleTopDragStartCapture,!0),s.addEventListener("dragend",this.handleTopDragEndCapture,!0),s.addEventListener("dragenter",this.handleTopDragEnter),s.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),s.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),s.addEventListener("dragover",this.handleTopDragOver),s.addEventListener("dragover",this.handleTopDragOverCapture,!0),s.addEventListener("drop",this.handleTopDrop),s.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(s){s.removeEventListener&&(s.removeEventListener("dragstart",this.handleTopDragStart),s.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),s.removeEventListener("dragend",this.handleTopDragEndCapture,!0),s.removeEventListener("dragenter",this.handleTopDragEnter),s.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),s.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),s.removeEventListener("dragover",this.handleTopDragOver),s.removeEventListener("dragover",this.handleTopDragOverCapture,!0),s.removeEventListener("drop",this.handleTopDrop),s.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const s=this.monitor.getSourceId(),i=this.sourceNodeOptions.get(s);return C_({dropEffect:this.altKeyPressed?"copy":"move"},i||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const s=this.monitor.getSourceId(),i=this.sourcePreviewNodeOptions.get(s);return C_({anchorX:.5,anchorY:.5,captureDraggingState:!1},i||{})}isDraggingNativeItem(){const s=this.monitor.getItemType();return Object.keys(w_).some(i=>w_[i]===s)}beginDragNativeItem(s,i){this.clearCurrentDragSourceNode(),this.currentNativeSource=JI(s,i),this.currentNativeHandle=this.registry.addSource(s,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(s){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=s;const i=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},i)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var s;(s=this.window)===null||s===void 0||s.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(s,i){s.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(i))}handleDragEnter(s,i){this.dragEnterTargetIds.unshift(i)}handleDragOver(s,i){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(i)}handleDrop(s,i){this.dropTargetIds.unshift(i)}constructor(s,i,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=l=>{const c=this.sourceNodes.get(l);return c&&dk(c)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=l=>!!(l&&this.document&&this.document.body&&this.document.body.contains(l)),this.endDragIfSourceWasRemovedFromDOM=()=>{const l=this.currentDragSourceNode;l==null||this.isNodeInDocument(l)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=l=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(l||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=l=>{if(l.defaultPrevented)return;const{dragStartSourceIds:c}=this;this.dragStartSourceIds=null;const d=nc(l);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(c||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:d});const{dataTransfer:h}=l,p=sg(h);if(this.monitor.isDragging()){if(h&&typeof h.setDragImage=="function"){const b=this.monitor.getSourceId(),y=this.sourceNodes.get(b),w=this.sourcePreviewNodes.get(b)||y;if(w){const{anchorX:v,anchorY:_,offsetX:$,offsetY:S}=this.getCurrentSourcePreviewNodeOptions(),D=ex(y,w,d,{anchorX:v,anchorY:_},{offsetX:$,offsetY:S});h.setDragImage(w,D.x,D.y)}}try{h==null||h.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(l.target);const{captureDraggingState:f}=this.getCurrentSourcePreviewNodeOptions();f?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(p)this.beginDragNativeItem(p);else{if(h&&!h.types&&(l.target&&!l.target.hasAttribute||!l.target.hasAttribute("draggable")))return;l.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=l=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var c;(c=this.currentNativeSource)===null||c===void 0||c.loadDataTransfer(l.dataTransfer)}if(!this.enterLeaveCounter.enter(l.target)||this.monitor.isDragging())return;const{dataTransfer:h}=l,p=sg(h);p&&this.beginDragNativeItem(p,h)},this.handleTopDragEnter=l=>{const{dragEnterTargetIds:c}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=l.altKey,c.length>0&&this.actions.hover(c,{clientOffset:nc(l)}),c.some(h=>this.monitor.canDropOnTarget(h))&&(l.preventDefault(),l.dataTransfer&&(l.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=l=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var c;(c=this.currentNativeSource)===null||c===void 0||c.loadDataTransfer(l.dataTransfer)}},this.handleTopDragOver=l=>{const{dragOverTargetIds:c}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){l.preventDefault(),l.dataTransfer&&(l.dataTransfer.dropEffect="none");return}this.altKeyPressed=l.altKey,this.lastClientOffset=nc(l),this.scheduleHover(c),(c||[]).some(h=>this.monitor.canDropOnTarget(h))?(l.preventDefault(),l.dataTransfer&&(l.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?l.preventDefault():(l.preventDefault(),l.dataTransfer&&(l.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=l=>{this.isDraggingNativeItem()&&l.preventDefault(),this.enterLeaveCounter.leave(l.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=l=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var c;l.preventDefault(),(c=this.currentNativeSource)===null||c===void 0||c.loadDataTransfer(l.dataTransfer)}else sg(l.dataTransfer)&&l.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=l=>{const{dropTargetIds:c}=this;this.dropTargetIds=[],this.actions.hover(c,{clientOffset:nc(l)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=l=>{const c=l.target;typeof c.dragDrop=="function"&&(c.tagName==="INPUT"||c.tagName==="SELECT"||c.tagName==="TEXTAREA"||c.isContentEditable||(l.preventDefault(),c.dragDrop()))},this.options=new tx(i,r),this.actions=s.getActions(),this.monitor=s.getMonitor(),this.registry=s.getRegistry(),this.enterLeaveCounter=new KI(this.isNodeInDocument)}}const hk=function(s,i,r){return new ox(s,i,r)},ix=$t([m.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),m.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"AccessTime"),nx=$t(m.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox"),rx=$t(m.jsx("path",{d:"M4 8h4V4H4zm6 12h4v-4h-4zm-6 0h4v-4H4zm0-6h4v-4H4zm6 0h4v-4h-4zm6-10v4h4V4zm-6 4h4V4h-4zm6 6h4v-4h-4zm0 6h4v-4h-4z"}),"Apps"),ax=$t(m.jsx("path",{d:"M9 2c-1.05 0-2.05.16-3 .46 4.06 1.27 7 5.06 7 9.54s-2.94 8.27-7 9.54c.95.3 1.95.46 3 .46 5.52 0 10-4.48 10-10S14.52 2 9 2"}),"Brightness3"),lx=$t(m.jsx("path",{d:"M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5s-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20zm-6 8h-4v-2h4zm0-4h-4v-2h4z"}),"BugReport"),cx=$t(m.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm-1 4 6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2zm-1 7h5.5L14 6.5z"}),"FileCopy"),ux=$t(m.jsx("path",{d:"M7 2v11h3v9l7-12h-4l4-8z"}),"FlashOn"),dx=$t(m.jsx("path",{d:"M3.27 5 2 6.27l6.97 6.97L6.5 19h3l1.57-3.66L16.73 21 18 19.73 3.55 5.27zM6 5v.18L8.82 8h2.4l-.72 1.68 2.1 2.1L14.21 8H20V5z"}),"FormatClear"),hx=$t(m.jsx("path",{d:"M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z"}),"Functions"),pk=$t(m.jsx("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutline"),px=$t(m.jsx("path",{d:"M21 3.01H3c-1.1 0-2 .9-2 2V9h2V4.99h18v14.03H3V15H1v4.01c0 1.1.9 1.98 2 1.98h18c1.1 0 2-.88 2-1.98v-14c0-1.11-.9-2-2-2M11 16l4-4-4-4v3H1v2h10z"}),"Input"),T_=$t(m.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"}),"Lock"),gx=$t(m.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert"),mx=$t(m.jsx("path",{d:"M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10c1.38 0 2.5-1.12 2.5-2.5 0-.61-.23-1.2-.64-1.67-.08-.1-.13-.21-.13-.33 0-.28.22-.5.5-.5H16c3.31 0 6-2.69 6-6 0-4.96-4.49-9-10-9m5.5 11c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m-3-4c-.83 0-1.5-.67-1.5-1.5S13.67 6 14.5 6s1.5.67 1.5 1.5S15.33 9 14.5 9M5 11.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5S7.33 13 6.5 13 5 12.33 5 11.5m6-4c0 .83-.67 1.5-1.5 1.5S8 8.33 8 7.5 8.67 6 9.5 6s1.5.67 1.5 1.5"}),"Palette"),bc=$t(m.jsx("path",{d:"M6 19h4V5H6zm8-14v14h4V5z"}),"Pause"),Wg=$t(m.jsx("path",{d:"M8 5v14l11-7z"}),"PlayArrow"),fx=$t(m.jsx("path",{d:"M11 5v5.59H7.5l4.5 4.5 4.5-4.5H13V5zm-5 9c0 3.31 2.69 6 6 6s6-2.69 6-6h-2c0 2.21-1.79 4-4 4s-4-1.79-4-4z"}),"PlayForWork"),$x=$t(m.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search"),bx=$t(m.jsx("path",{d:"M10.59 9.17 5.41 4 4 5.41l5.17 5.17zM14.5 4l2.04 2.04L4 18.59 5.41 20 17.96 7.46 20 9.5V4zm.33 9.41-1.41 1.41 3.13 3.13L14.5 20H20v-5.5l-2.04 2.04z"}),"Shuffle"),vx=$t(m.jsx("path",{d:"M2 20h20v-4H2zm2-3h2v2H4zM2 4v4h20V4zm4 3H4V5h2zm-4 7h20v-4H2zm2-3h2v2H4z"}),"Storage"),yx=$t(m.jsx("path",{d:"M14 17H4v2h10zm6-8H4v2h16zM4 15h16v-2H4zM4 5v2h16V5z"}),"Subject"),_x=$t(m.jsx("path",{d:"M16 17.01V10h-2v7.01h-3L15 21l4-3.99zM9 3 5 6.99h3V14h2V6.99h3z"}),"SwapVert"),wx=$t(m.jsx("path",{d:"M7.41 18.59 8.83 20 12 16.83 15.17 20l1.41-1.41L12 14zm9.18-13.18L15.17 4 12 7.17 8.83 4 7.41 5.41 12 10z"}),"UnfoldLess"),kx=$t(m.jsx("path",{d:"M12 5.83 15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15z"}),"UnfoldMore"),Tc="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='512'%20height='512'%20shape-rendering='geometricPrecision'%20image-rendering='optimizeQuality'%20fill-rule='evenodd'%20xmlns:v='https://vecta.io/nano'%3e%3cpath%20fill='%23efda4e'%20d='M-.5-.5h512v512H-.5V-.5z'/%3e%3cpath%20fill='%23020100'%20d='M308.5%20287.5c1.777-3.005%202.777-6.338%203-10%209.147-21.963%2025.48-35.463%2049-40.5%2021.999-4.173%2043.666-2.84%2065%204%2014.575%205.411%2025.575%2014.911%2033%2028.5l-1%202c-12.413%205.624-24.58%2011.624-36.5%2018-5.321-8.25-12.821-13.417-22.5-15.5-13.957-3.122-27.29-1.455-40%205-8.125%205.36-10.958%2012.86-8.5%2022.5%203.223%206.223%208.057%2010.723%2014.5%2013.5l64%2020c38.459%2016.085%2052.626%2044.585%2042.5%2085.5-7.572%2026.208-24.738%2042.041-51.5%2047.5-25.102%205.733-49.768%204.4-74-4-19.291-8.625-32.291-22.958-39-43%2011.266-8.887%2023.433-16.387%2036.5-22.5%203.117%206.896%206.784%2013.563%2011%2020%2012.705%2012.307%2027.872%2016.807%2045.5%2013.5%2022.189-3.504%2032.355-16.338%2030.5-38.5-2.833-6.833-7.667-11.667-14.5-14.5l-57-17c-36.004-11.84-52.67-36.673-50-74.5z'/%3e%3cpath%20fill='%23020200'%20d='M222.5%20238.5h43l-.5%20159c-2.688%2052.355-30.188%2076.855-82.5%2073.5-24.871-3.543-41.204-17.21-49-41l.5-2.5a12.14%2012.14%200%200%200%204.5-3.5c10.653-5.825%2021.32-11.325%2032-16.5%204.763%2021.72%2017.763%2028.887%2039%2021.5%204.616-2.618%207.783-6.451%209.5-11.5%201.163-5.968%202.163-11.968%203-18l.5-161z'/%3e%3cpath%20fill='%23615820'%20d='M311.5%20277.5c-.223%203.662-1.223%206.995-3%2010%20.223-3.662%201.223-6.995%203-10z'/%3e%3c/svg%3e",gk="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20500%20500'%3e%3cpath%20fill='%234285f4'%20d='M44.271%2027.275l206.5%201v170l-58.5-36.5c-7.005-.916-12.505%201.584-16.5%207.5v147c4.625%204.412%2010.125%206.245%2016.5%205.5l57.5-35.5c.833%2054.003%201.356%20108.003.189%20162-1.272.546-45.599-.242-48.689%201.121-3.674%207.844-4.79%2011.207-13%2023.879-4.372%205.527-2.19%204.097-10.689%2012.258-5.166%202.748-4.191%203.45-14.311%206.242-17.67%201.983-35.336%201.983-53%200-9.535-3.774-10.879-4.163-18.526-11.22-5.562-4.39-11.131-11.803-11.974-15.28-4.068-7.881-3.42-9.116-5.5-13.5-3.672-1.503-35.798.203-40.746-1.335-5.823-2.314-2.946-.422-7.954-3.689-2.888-2.668-2.255-3.221-2.421-9.904L20.771%2050.275c.36-2.108-.41-5.806%202.522-11.615%204.343-5.852%205.374-7%2010.061-9.146%206.083-2.73%208.677-1.475%2010.917-2.239z'/%3e%3cpath%20d='M258.271%2030.275l154.63.407c5.654.559%2010.783%203.17%2014.37%207.093%204.907%204.408%206.204%208.723%207.5%2013.5v373c-.208%205.716-.297%207.982-4.848%2015.404-7.078%206.393-9.879%206.39-15.652%206.692-24.804%201.296-50.079%201.189-74.96%201.041-24.516-.014-68.46.89-81.5.391l-2.512-172.528c-20.083%2012.625-42.777%2025.125-63.028%2037.5-4.127%201.292-7.294.125-9.5-3.5l1-137c1.864-2.707%204.364-3.541%207.5-2.5%2020.366%2013.427%2064.35%2038.947%2065.581%2038.339l1.419-177.839z'%20fill='%23DDD'/%3e%3c/svg%3e",mk="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20512%20512'%20width='32'%20height='32'%3e%3cpath%20fill='%23007acc'%20d='M-.5-.5h503l-1%20179h10v333h-421v-7h-91V-.5z'/%3e%3cpath%20fill='%230f81cf'%20d='M502.5-.5h9v179h-10l1-179z'/%3e%3cpath%20fill='%23fdfefe'%20d='M470.5%20227.5c.33%2017.508-.003%2034.841-1%2052-23.486-15.709-48.82-19.875-76-12.5-15.89%208.078-19.39%2019.911-10.5%2035.5%204.673%205.577%2010.173%2010.077%2016.5%2013.5l38%2019c17.945%209.278%2031.112%2023.112%2039.5%2041.5%201.352%203.22%202.186%206.553%202.5%2010a305.16%20305.16%200%200%201%201%2026c-3.553%2033.726-21.886%2054.559-55%2062.5-34.769%207.363-68.435%204.196-101-9.5-.167-19.003%200-38.003.5-57%2022.903%2021.314%2049.736%2029.147%2080.5%2023.5%2019.435-5.701%2025.268-17.868%2017.5-36.5-4.718-6.44-10.552-11.606-17.5-15.5a1552.42%201552.42%200%200%201-47-24c-27.679-19.331-38.846-45.831-33.5-79.5%206.43-26.433%2022.597-43.933%2048.5-52.5%2026.131-6.625%2052.464-7.292%2079-2a565.56%20565.56%200%200%201%2018%205.5z'/%3e%3cpath%20fill='%23fefefe'%20d='M122.5%20222.5h182v46h-65v206h-52v-206h-65v-46z'/%3e%3cpath%20fill='%2370b3e1'%20d='M470.5%20227.5c1.327%2017.505%201.327%2035.171%200%2053-.607-.124-.94-.457-1-1%20.997-17.159%201.33-34.492%201-52z'/%3e%3cpath%20fill='%236cafe0'%20d='M479.5%20386.5c1.465%205.09%202.132%2010.423%202%2016-.002%203.518-.335%206.851-1%2010a305.16%20305.16%200%200%200-1-26z'/%3e%3cpath%20fill='%231283cf'%20d='M-.5%20504.5h91v7h-91v-7z'/%3e%3c/svg%3e",fk="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIj4KICAgIDxyYWRpYWxHcmFkaWVudCBpZD0ibXlHcmFkaWVudCI+CiAgICAgICAgPHN0b3Agb2Zmc2V0PSIxMCUiIHN0b3AtY29sb3I9IiMxQzJENUYiIC8+CiAgICAgICAgPHN0b3Agb2Zmc2V0PSI5NSUiIHN0b3AtY29sb3I9IiMwQjFENTMiIC8+CiAgICA8L3JhZGlhbEdyYWRpZW50PgogICAgPHBhdGggZmlsbD0idXJsKCcjbXlHcmFkaWVudCcpIiBkPSJNLS4xLS4xaDUxMnY1MTJILS4xVi0uMXoiLz4KICAgIDxwYXRoIGZpbGw9IiNmOGY4ZmEiCiAgICAgICAgICBkPSJNNDgyLjUgMjMxLjV2NmgtMjVjLS45NzItOC4xNy01LjYzOS0xMi4xNy0xNC0xMi05LjUzMS4wMjktMTMuMzY1IDQuNjk1LTExLjUgMTRsNC41IDQuNSAzMyA4YzE5LjM4OCA5LjYzNCAyMy4zODggMjMuODAxIDEyIDQyLjVhMzUuMDYgMzUuMDYgMCAwIDAtOCA2Yy0xMy45MjUgNC43NjEtMjguMjU4IDYuMjYxLTQzIDQuNS0xMC42MDEtMS4wMjQtMTguOTM1LTUuODU3LTI1LTE0LjUtMS4wNzctMi4yMjktMS43NDQtNC41NjMtMi03di04aDI1YzEuNDk1IDQuMjc5IDMuODI4IDguMTEzIDcgMTEuNSA3LjQ3OCAyLjI1OCAxNC44MTEgMS45MjUgMjItMSAyLjg5NC0yLjkwOSAzLjcyNy02LjQwOSAyLjUtMTAuNWEzNi44IDM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NSAxYzUuMjE2LS4wMDYgMTAuMDQ5LS42NzMgMTQuNS0yeiIvPgogICAgPHBhdGggZmlsbD0iI2E1YWNjMCIgZD0iTTIzMy41IDIwOS41djk0aDY5di0xN2MtMTMuNTEuMzI5LTI2Ljg0NC0uMDA0LTQwLTFoNDF2MTloLTcxYTIyNTYuNDEgMjI1Ni40MSAwIDAgMSAxLTk1eiIvPgogICAgPHBhdGggZmlsbD0iI2E2YWNjMCIKICAgICAgICAgIGQ9Ik0zMTYuNSAyMDkuNWMtLjk5OCAzMS4xNjItMS4zMzIgNjIuNDk2LTEgOTRoNzN2LTE3Yy0xNC44NDMuMzI5LTI5LjUxLS4wMDQtNDQtMWg0NXYxOWgtNzVhMjMwNC45NSAyMzA0Ljk1IDAgMCAxIDEtOTZjLjYwNy4xMjQuOTQuNDU3IDEgMXoiLz4KPC9zdmc+";class _m extends _e.Component{isShowInstance;oldId;constructor(s){super(s),this.state={name:s.name,id:s.id,instance:s.instance||0,prefix:_m.getPrefix(s.id)},this.isShowInstance=!s.folder&&!!s.instances&&(!!s.instance||!!s.instances[0]||s.instances.length>1),this.oldId=s.id}static getPrefix(s){const i=(s||"").split(".");return i.pop(),i.join(".")}getId(s){return s=(s||"").replace(/[\\/\][*,;'"`<>?\s]/g,"_"),`${this.state.prefix}.${s}`}handleCancel=()=>{this.props.onClose()};handleOk=()=>{this.props.onRename(this.oldId,this.state.id,this.state.name,this.state.instance===0?0:this.state.instance||void 0),this.props.onClose()};handleChange=s=>{this.setState({name:s,id:this.getId(s)})};render(){return m.jsxs(Pt,{onClose:()=>!1,maxWidth:"md",fullWidth:!0,open:!0,"aria-labelledby":"confirmation-dialog-title",children:[m.jsx(Xt,{id:"confirmation-dialog-title",children:x.I18n.t("Rename")}),m.jsx(Wt,{children:m.jsxs("form",{noValidate:!0,autoComplete:"off",children:[m.jsx(Eo,{variant:"standard",style:{width:"100%"},id:"standard-name",autoFocus:!0,label:x.I18n.t("Name"),value:this.state.name,onKeyUp:s=>{s.key==="Enter"&&(s.preventDefault(),setTimeout(()=>this.handleOk(),200))},onChange:s=>this.handleChange(s.target.value),margin:"normal"}),m.jsx(Eo,{variant:"standard",id:"standard-name-id",style:{width:"100%"},label:x.I18n.t("ID"),value:this.state.id,disabled:!0,margin:"normal"}),this.isShowInstance&&m.jsxs(Di,{variant:"standard",children:[m.jsx(Ag,{htmlFor:"instance",children:x.I18n.t("Instance")}),m.jsx(Ai,{variant:"standard",value:this.state.instance,onChange:s=>this.setState({instance:parseInt(s.target.value,10)}),inputProps:{name:"instance",id:"instance"},children:this.props.instances.map(s=>m.jsx(it,{value:s,children:s||"0"},s))})]})]})}),m.jsxs(Bt,{children:[m.jsx(Ue,{variant:"contained",onClick:this.handleOk,color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Ok")}),m.jsx(Ue,{color:"grey",variant:"contained",onClick:this.handleCancel,startIcon:m.jsx(so,{}),children:x.I18n.t("Cancel")})]})]})}}class Cx extends _e.Component{constructor(s){super(s),this.state={name:s.name,id:s.id}}handleCancel=()=>{this.props.onClose()};handleOk=()=>{this.props.onDelete(this.state.id),this.props.onClose()};render(){return m.jsxs(Pt,{onClose:()=>!1,maxWidth:"md",open:!0,"aria-labelledby":"confirmation-dialog-title",children:[m.jsx(Xt,{id:"confirmation-dialog-title",children:x.I18n.t("Are you sure?")}),m.jsxs(Wt,{children:[m.jsx(mc,{}),m.jsx("span",{style:{fontSize:14,fontWeight:"bold"},children:x.I18n.t("Delete %s",this.state.name)})]}),m.jsxs(Bt,{children:[m.jsx(Ue,{variant:"contained",onClick:this.handleOk,color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Ok")}),m.jsx(Ue,{color:"grey",variant:"contained",onClick:this.handleCancel,startIcon:m.jsx(so,{}),children:x.I18n.t("Cancel")})]})]})}}const Tx=""+new URL("tileJS-C48gYbHw.png",import.meta.url).href,Sx=""+new URL("tileTS-CsXmgy4B.png",import.meta.url).href,Ex=""+new URL("tileBlockly-BMpdinN3.png",import.meta.url).href,Ix=""+new URL("tileRules-BkbaFIhs.png",import.meta.url).href,Ut={card:{maxWidth:345,minWidth:250,display:"inline-block",margin:"0 10px 0 10px"},media:{height:122},text:{maxWidth:218,minHeight:30},complexity:{fontWeight:"bold",fontStyle:"italic",marginBottom:8}};class Dn extends _e.Component{handleCancel=()=>{this.props.onClose()};static openHtml(s){const i=x.I18n.getLanguage();!s.includes("javascript.md")&&(i==="de"||i==="ru")&&(s=s.replace(/\/en\//,`/${i}/`));const r=window.open(s,"_blank");r==null||r.focus()}getJSCard(){return m.jsxs(Xl,{style:Ut.card,children:[m.jsxs(Zl,{onClick:()=>this.props.onClose&&this.props.onClose("Javascript/js"),children:[m.jsx(Ql,{style:Ut.media,image:Tx,title:"JavaScript"}),m.jsxs(ec,{children:[m.jsx("h2",{children:"JavaScript"}),m.jsx("div",{style:Ut.complexity,children:x.I18n.t("for programmers")}),m.jsx("div",{style:Ut.text,children:x.I18n.t("JS description")})]})]}),m.jsxs(tc,{children:[m.jsx(Ue,{size:"small",color:"primary",variant:"contained",onClick:()=>this.props.onClose&&this.props.onClose("Javascript/js"),children:x.I18n.t("Add")}),m.jsx(Ue,{size:"small",color:"secondary",onClick:()=>Dn.openHtml("https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/javascript.md"),children:x.I18n.t("Learn More")})]})]})}getTSCard(){return m.jsxs(Xl,{style:Ut.card,children:[m.jsxs(Zl,{onClick:()=>this.props.onClose&&this.props.onClose("TypeScript/ts"),children:[m.jsx(Ql,{style:Ut.media,image:Sx,title:"TypeScript"}),m.jsxs(ec,{children:[m.jsx("h2",{children:"TypeScript"}),m.jsx("div",{style:Ut.complexity,children:x.I18n.t("for professionals")}),m.jsx("div",{style:Ut.text,children:x.I18n.t("TS description")})]})]}),m.jsxs(tc,{children:[m.jsx(Ue,{size:"small",color:"primary",variant:"contained",onClick:()=>this.props.onClose&&this.props.onClose("TypeScript/ts"),children:x.I18n.t("Add")}),m.jsx(Ue,{size:"small",color:"secondary",onClick:()=>Dn.openHtml("https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/javascript.md"),children:x.I18n.t("Learn More")})]})]})}getBlocklyCard(){return m.jsxs(Xl,{style:Ut.card,children:[m.jsxs(Zl,{onClick:()=>this.props.onClose&&this.props.onClose("Blockly"),children:[m.jsx(Ql,{style:Ut.media,image:Ex,title:"Blockly"}),m.jsxs(ec,{children:[m.jsx("h2",{children:"Blockly"}),m.jsx("div",{style:Ut.complexity,children:x.I18n.t("normal")}),m.jsx("div",{style:Ut.text,children:x.I18n.t("Blockly description")})]})]}),m.jsxs(tc,{children:[m.jsx(Ue,{size:"small",color:"primary",variant:"contained",onClick:()=>this.props.onClose&&this.props.onClose("Blockly"),children:x.I18n.t("Add")}),m.jsx(Ue,{size:"small",color:"secondary",onClick:()=>Dn.openHtml("https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/blockly.md"),children:x.I18n.t("Learn More")})]})]})}getRulesCard(){return m.jsxs(Xl,{style:Ut.card,children:[m.jsxs(Zl,{onClick:()=>this.props.onClose&&this.props.onClose("Rules"),children:[m.jsx(Ql,{style:Ut.media,image:Ix,title:"Rules"}),m.jsxs(ec,{children:[m.jsx("h2",{children:"Rules"}),m.jsx("div",{style:Ut.complexity,children:x.I18n.t("easy")}),m.jsx("div",{style:Ut.text,children:x.I18n.t("Rules description")})]})]}),m.jsxs(tc,{children:[m.jsx(Ue,{size:"small",color:"primary",variant:"contained",onClick:()=>this.props.onClose&&this.props.onClose("Rules"),children:x.I18n.t("Add")}),m.jsx(Ue,{size:"small",color:"secondary",onClick:()=>Dn.openHtml("https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/javascript.md"),children:x.I18n.t("Learn More")})]})]})}render(){return m.jsxs(Pt,{onClose:()=>!1,maxWidth:"lg",fullWidth:!0,open:!0,"aria-labelledby":"confirmation-dialog-title",children:[m.jsx(Xt,{id:"confirmation-dialog-title",children:x.I18n.t("Add new script")}),m.jsxs(Wt,{style:{textAlign:"center"},children:[this.getRulesCard(),this.getBlocklyCard(),this.getJSCard(),this.getTSCard()]}),m.jsx(Bt,{children:m.jsx(Ue,{color:"grey",onClick:this.handleCancel,startIcon:m.jsx(so,{}),children:x.I18n.t("Cancel")})})]})}}class og extends _e.Component{isShowInstance;constructor(s){super(s),this.state={name:s.name||"Script",instance:s.instance||0,parent:s.parent,error:"",id:""},this.isShowInstance=!s.folder&&!!s.instances&&(!!s.instance||!!s.instances[0]||s.instances.length>1)}getId(s){return s=s||this.state.name||"",s=s.replace(/[\\/\][.*,;'"`<>?\s]/g,"_").trim().replace(/\.$/,"_"),`${this.state?this.state.parent:this.props.parent}.${s}`}handleOk=()=>{this.props.onAdd(this.getId(this.state.name),this.state.name,this.state.instance,this.props.type),this.props.onClose()};render(){var s;return m.jsxs(Pt,{onClose:()=>!1,maxWidth:"md",fullWidth:!0,open:!0,"aria-labelledby":"confirmation-dialog-title",children:[m.jsx(Xt,{id:"confirmation-dialog-title",children:this.props.title||x.I18n.t("Create new")}),m.jsx(Wt,{children:m.jsxs("form",{noValidate:!0,autoComplete:"off",children:[m.jsx(Eo,{variant:"standard",style:{width:"100%"},id:"standard-name",autoFocus:!0,error:!!this.state.error,label:x.I18n.t("Name"),value:this.state.name||"",helperText:this.state.error,slotProps:{input:{endAdornment:this.state.name?m.jsx(qe,{size:"small",onClick:()=>this.setState({name:""}),children:m.jsx(ZT,{})}):void 0}},onKeyUp:i=>{i.preventDefault(),i.key==="Enter"&&!this.state.error&&setTimeout(()=>this.handleOk(),200)},onChange:i=>{var c;const r=i.target.value,l=this.getId(r);r?(c=this.props.existingItems)!=null&&c.includes(l)?this.setState({name:r,id:l,error:x.I18n.t("Duplicate name")}):this.setState({name:r,id:l,error:""}):this.setState({name:r,id:l,error:x.I18n.t("Empty name is not allowed")})},margin:"normal"}),m.jsxs(Di,{variant:"standard",style:{width:"100%"},children:[m.jsx(Ag,{htmlFor:"parent",children:x.I18n.t("Folder")}),m.jsx(Ai,{variant:"standard",style:{width:"100%"},value:this.state.parent,onChange:i=>this.setState({parent:i.target.value}),inputProps:{name:"parent",id:"parent"},children:this.props.parents.map(i=>{const r=i.id.split(".");r.splice(0,2);const l=[];let c="script.js";return r.forEach(d=>{c+=`.${d}`;const h=this.props.parents.find(p=>p.id===c);h?l.push(h.name):l.push(d)}),l.length||l.push(i.name),m.jsx(it,{value:i.id,children:l.join(" / ")},i.id)})})]}),m.jsx(Eo,{variant:"standard",id:"standard-name-id",style:{width:"100%"},label:x.I18n.t("ID"),value:this.getId(),disabled:!0,margin:"normal"}),this.isShowInstance&&m.jsxs(Di,{variant:"standard",children:[m.jsx(Ag,{htmlFor:"instance",children:x.I18n.t("Instance")}),m.jsx(Ai,{variant:"standard",value:this.state.instance,onChange:i=>this.setState({instance:parseInt(i.target.value,10)}),inputProps:{name:"instance",id:"instance"},children:(s=this.props.instances)==null?void 0:s.map(i=>m.jsx(it,{value:i,children:i||"0"},`instance${i}`))})]})]})}),m.jsxs(Bt,{children:[m.jsx(Ue,{variant:"contained",onClick:this.handleOk,disabled:!!this.state.error,color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Ok")}),m.jsx(Ue,{color:"grey",variant:"contained",onClick:()=>this.props.onClose(),startIcon:m.jsx(so,{}),children:x.I18n.t("Cancel")})]})]})}}const xx={title:a=>({background:a.palette.error.main,color:a.palette.error.contrastText,"&>h2":{color:a.palette.error.contrastText}})};class su extends _e.Component{handleOk=()=>{this.props.onClose()};render(){return m.jsxs(Pt,{open:!0,maxWidth:"sm",fullWidth:!0,onClose:()=>this.handleOk(),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[m.jsx(Xt,{sx:xx.title,id:"alert-dialog-title",children:this.props.title||x.I18n.t("Error")}),m.jsx(Wt,{children:m.jsx(Dw,{id:"alert-dialog-description",children:this.props.text||x.I18n.t("Unknown error!")})}),m.jsx(Bt,{children:m.jsx(Ue,{variant:"contained",onClick:()=>this.handleOk(),color:"primary",autoFocus:!0,startIcon:m.jsx(qo,{}),children:x.I18n.t("Ok")})})]})}}const zr={icon:{width:24,height:24},filterWithButton:{width:"100%"},title:{fontWeight:"bold",marginTop:16}};class Dx extends _e.Component{constructor(s){super(s),this.state={instances:[],filter:window.localStorage.getItem("javascript.debug.filter")||"",showAskForStop:!1,jsInstance:window.localStorage.getItem("javascript.debug.instance")||"",jsInstanceHost:"",adapterToDebug:window.localStorage.getItem("javascript.debug.adapter")||""}}componentDidMount(){this.props.socket.getAdapterInstances().then(s=>{const i=s.filter(h=>{var p;return h&&!((p=h.common)!=null&&p.onlyWWW)}).map(h=>{var b,y,w;const p=h._id.replace(/^system\.adapter\./,""),[f]=p.split(".");return{id:p,enabled:(b=h.common)==null?void 0:b.enabled,host:(y=h.common)==null?void 0:y.host,icon:(w=h.common)!=null&&w.icon?`../../adapter/${f}/${h.common.icon}`:""}});i.sort((h,p)=>h.id>p.id?1:h.idh.id===this.state.jsInstance):null;let c;if(!this.state.jsInstance||!l){const h=i.find(p=>p.id.startsWith("javascript."));c=(h==null?void 0:h.host)||"",r=(h==null?void 0:h.id)||""}else c=(l==null?void 0:l.host)||"";let d=this.state.adapterToDebug||"";d&&!i.find(h=>h.id===d)&&(d=""),this.setState({instances:i,jsInstance:r,adapterToDebug:d,jsInstanceHost:c})})}handleOk=()=>{var s;if((s=this.state.instances.find(i=>i.id===this.state.adapterToDebug))!=null&&s.enabled){this.props.socket.getObject(`system.adapter.${this.state.adapterToDebug}`).then(i=>{i&&(i.common.enabled=!1,this.props.socket.setObject(i._id,i).then(()=>this.props.onDebug(this.state.jsInstance,this.state.adapterToDebug)))});return}this.props.onDebug(this.state.jsInstance,this.state.adapterToDebug)};renderJavascriptList(){const s=this.state.instances.filter(i=>i.id.startsWith("javascript."));return s.length<2?null:m.jsxs(Si,{children:[m.jsx("div",{style:zr.title,children:x.I18n.t("Host")}),m.jsx(Rg,{component:"nav",children:s.map(i=>m.jsxs(s_,{component:"div",selected:this.state.jsInstance===i.id,onClick:()=>this.setState({jsInstance:i.id,jsInstanceHost:i.host}),children:[m.jsx(Og,{children:m.jsx("img",{src:i.icon,alt:i.id,style:zr.icon})}),m.jsx(Ng,{primary:i.id})]},i.id))})]})}renderInstances(){if(!this.state.jsInstance)return m.jsx(Si,{});const s=this.state.instances.filter(i=>i.id!==this.state.jsInstance&&i.host===this.state.jsInstanceHost&&(!this.state.filter||i.id.includes(this.state.filter.toLowerCase())));return m.jsxs(Si,{children:[m.jsx("div",{style:zr.title,children:x.I18n.t("Instances")}),m.jsx(Rg,{component:"nav",children:s.map(i=>m.jsxs(s_,{selected:this.state.adapterToDebug===i.id,onDoubleClick:()=>this.setState({adapterToDebug:i.id},()=>this.handleOk()),onClick:()=>this.setState({adapterToDebug:i.id}),children:[m.jsx(Og,{children:m.jsx("img",{src:i.icon,alt:i.id,style:zr.icon})}),m.jsx(Ng,{primary:i.id})]},i.id))})]})}render(){return m.jsxs(Pt,{maxWidth:"md",fullWidth:!1,open:!0,onClose:()=>!1,"aria-labelledby":"confirmation-dialog-title",children:[m.jsx(Xt,{id:"confirmation-dialog-title",children:this.props.title||x.I18n.t("Debug instance")}),m.jsx(Wt,{children:m.jsxs(Si,{container:!0,direction:"column",children:[m.jsx(Si,{children:m.jsx(Pn,{style:zr.filterWithButton,value:this.state.filter,placeholder:x.I18n.t("Filter"),onChange:s=>{this.setState({filter:s.target.value}),window.localStorage.setItem("javascript.debug.filter",s.target.value)},endAdornment:m.jsx(Aw,{position:"end",children:this.state.filter?m.jsx(qe,{size:"small","aria-label":"toggle password visibility",onClick:()=>this.setState({filter:""}),children:m.jsx(Mw,{})}):""})})}),m.jsx(Si,{children:m.jsxs(Si,{container:!0,children:[this.renderJavascriptList(),this.renderInstances()]})})]})}),m.jsxs(Bt,{children:[m.jsx(Ue,{variant:"contained",onClick:this.handleOk,disabled:!this.state.jsInstance||!this.state.adapterToDebug,color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Start")}),m.jsx(Ue,{color:"grey",variant:"contained",onClick:()=>this.props.onClose(),startIcon:m.jsx(so,{}),children:x.I18n.t("Close")})]})]})}}function $k(a){if(!a)throw new Error("Password must be a non-empty string.")}function Gg(a){return new TextEncoder().encode(a)}function Ax(a){return new TextDecoder().decode(a)}function Rx(a){let s="";for(let i=0;i({height:a.toolbar.height}),toolbarButtons:a=>({color:a.palette.mode==="dark"?"white !important":"black !important"}),iconButtonsDisabled:{filter:"grayscale(100%)",opacity:.5},toolbarSearch:{width:"calc(100% - 105px)",lineHeight:"34px",marginLeft:5},iconButtons:{width:32,height:32,padding:2},iconDropdownMenu:{paddingRight:5},menu:{width:"100%",height:"100%"},innerMenu:{width:"100%",height:"calc(100% - 76px)",overflowX:"hidden",overflowY:"auto"},listItemIcon:{minWidth:32},scriptIcon:{width:18,height:18,borderRadius:2,marginTop:4,marginBottom:4,marginLeft:8,marginRight:4},folder:{cursor:"pointer",padding:0,userSelect:"none"},folderReorder:{opacity:.3,transitionDuration:"0.5s",transitionProperty:"opacity"},folderIcon:{width:20,height:20},folderIconReorder:{paddingTop:4,paddingBottom:4,paddingLeft:8,paddingRight:4},folderIconNoReorder:{cursor:"pointer",paddingTop:4,paddingBottom:4,paddingLeft:8,paddingRight:4},script:{cursor:"pointer",padding:0,userSelect:"none"},scriptReorder:{opacity:1,transitionDuration:"0.5s",transitionProperty:"opacity"},reorder:{},selected:window.vendorPrefix?a=>({backgroundColor:a.palette.primary.main,color:a.palette.text.primary}):{backgroundColor:"#164477",color:"white"},instances:{fontSize:"smaller",fontWeight:"bold",marginRight:4},childrenCount:{fontSize:10,opacity:.4},footer:{height:24,display:"flex"},footerButtons:a=>({"& img":{color:a.palette.mode==="dark"?"#ffffff":"#111111",cursor:"pointer",mt:"1px",mr:"2px",height:22,width:22,"&:hover":{backgroundColor:"#dbdbdb"}},"& svg":{color:a.palette.mode==="dark"?"#ffffff":"#111111",cursor:"pointer",mt:"1px",mr:"2px",height:22,width:22,"&:hover":{backgroundColor:"#dbdbdb"}}}),footerButtonsRight:{float:"right"}},Tn={Blockly:gk,"Javascript/js":Tc,def:Tc,Rules:fk,"TypeScript/ts":mk};function Kg(a,s,i){var r;return i=i||x.I18n.getLanguage(),(r=s==null?void 0:s.common)!=null&&r.name?typeof s.common.name=="object"?(s.common.name[i]||s.common.name.en||a.replace(/^script\.js./,"")).toString():s.common.name.toString():a.replace(/^script\.js./,"")}function E_(a){var l;const s=[{id:qt,depth:0,index:0,parent:null,title:"root",type:"folder",parentIndex:null}],i=Object.keys(a);for(let c=0;c1?h.join("."):null,instance:d.common.engine?parseInt(d.common.engine.split(".").pop(),10)||0:null,index:0,parentIndex:0}):s.push({id:i[c],title:Kg(i[c],d),depth:h.length-1,type:"folder",parent:h.length>1?h.join("."):null,index:0,parentIndex:null})}let r;do r=!1,s.forEach(c=>{if(c.parent&&!s.find(h=>h.id===c.parent)){const h=c.parent.split(".");h.pop(),s.push({id:c.parent,title:c.parent.split(".").pop()||"",depth:h.length-1,type:"folder",parent:h.length>1?h.join("."):null,index:0,parentIndex:null}),r=!0}});while(r);return s.sort((c,d)=>{const h=c.id.toLowerCase(),p=d.id.toLowerCase();return c.type==="folder"&&d.type!=="folder"?-1:d.type==="folder"&&c.type!=="folder"||h>p?1:hc.index=d),s.forEach(c=>{if(c.parent){const d=s.find(h=>h.id===c.parent);d&&(c.parentIndex=d.index)}}),s}function Lx(a){const{onDrop:s}=a,[{isOver:i,isOverAny:r},l]=WI({accept:"script",drop:c=>i?s(c):void 0,collect:c=>({isOver:c.isOver({shallow:!0}),isOverAny:c.isOver()})});return m.jsx("div",{ref:l,style:{background:i?"#40adff":void 0,opacity:r?.7:void 0},children:a.children},a.folderName)}function I_(a){const{name:s}=a,[{opacity:i},r]=LI({type:"script",item:()=>({name:s}),collect:l=>({opacity:l.isDragging()?.3:1})});return m.jsx("div",{ref:r,style:{opacity:i,transform:"translate3d(0, 0, 0)"},children:a.children},s)}class So extends _e.Component{inputRef;filterTimer;problems;problemsTimer;onProblemUpdatedBound;parent=null;constructor(s){super(s);const i=window.localStorage?window.localStorage.getItem("SideMenu.expanded"):"[]";let r;try{r=JSON.parse(i||"[]")||[]}catch{r=[]}this.inputRef=_e.createRef(),this.state={listItems:E_(s.scripts||{}),expanded:r,problems:[],reorder:!1,themeName:this.props.themeName,selected:window.localStorage&&window.localStorage.getItem("SideMenu.selected")||null,creatingScript:null,creatingFolder:!1,copingScript:"",renaming:null,deleting:null,choosingType:!1,errorText:"",instances:s.instances||[],menuOpened:!1,menuAnchorEl:null,menuAnchorFilterEl:null,searchMode:!1,expertMode:this.props.expertMode,searchText:"",width:this.props.width||300,typeFilter:window.localStorage&&window.localStorage.getItem("SideMenu.typeFilter")||"",statusFilter:window.localStorage&&window.localStorage.getItem("SideMenu.statusFilter")||"",runningInstances:this.props.runningInstances||{},scriptsHash:s.scriptsHash,showAdapterDebug:!1,isAllZeroInstances:!1,showExportDialog:!1};const l=this.ensureSelectedIsVisible();l&&Object.assign(this.state,{expanded:l}),this.filterTimer=null,Object.assign(this.state,{isAllZeroInstances:this.getIsAllZeroInstances()}),this.problems=null,this.problemsTimer=null,this.onProblemUpdatedBound=this.onProblemUpdated.bind(this)}readProblems(s,i){var r,l;if(i||(i=Object.keys(this.props.scripts)),!i||!i.length)s&&s();else{const c=i.shift(),d=this.props.scripts[c];if(((r=this.props.scripts)==null?void 0:r[c].type)==="script"&&((l=d.common)!=null&&l.enabled)&&!c.match(/^script\.js\.global\./)){const h=d.common.engine.split(".").pop(),p=this,f=`javascript.${h}.scriptProblem.${c.substring(qt.length+1)}`;this.props.socket.getState(f).then(b=>{p.onProblemUpdated(f,b),setTimeout(()=>p.readProblems(s,i),0)})}else setTimeout(()=>this.readProblems(s,i),0)}}componentDidMount(){this.readProblems(()=>{this.props.instances.forEach(s=>{this.props.socket.subscribeState(`javascript.${s}.scriptProblem.*`,this.onProblemUpdatedBound)})})}componentWillUnmount(){this.props.instances.forEach(s=>{this.props.socket.unsubscribeState(`javascript.${s}.scriptProblem.*`,this.onProblemUpdatedBound)})}onProblemUpdated(s,i){if(!i||!s)return;s=`${qt}.${s.replace(/^javascript\.\d+\.scriptProblem\./,"")}`,this.problems||(this.problems=JSON.parse(JSON.stringify(this.state.problems))||[]);let r=!1;if(i.val)this.problems.includes(s)||(this.problems.push(s),r=!0);else{const l=this.problems.indexOf(s);l!==-1&&(this.problems.splice(l,1),r=!0)}r&&!this.problemsTimer&&(this.problemsTimer=setTimeout(()=>{this.problemsTimer=null,this.setState({problems:this.problems}),this.problems=null},300))}static filterListStatic(s,i,r,l,c){i=JSON.parse(JSON.stringify(i));let d=!1;const h={listItems:i};if(s&&r&&l){const p=l.toLowerCase();if(i.forEach(f=>{var v;const b=f.title.toLowerCase();f.filteredPartly=!1;let y=b.includes(p);const w=(v=c==null?void 0:c[f.id])==null?void 0:v.common;if(!y&&(w!=null&&w.source))if(w.engineType==="Blockly"){const _=w.source.lastIndexOf("//");y=w.source.substring(0,_).toLowerCase().includes(p)}else y=w.source.toLowerCase().includes(p);y?f.filtered&&(f.filtered=!1,d=!0):f.filtered||(f.filtered=!0,d=!0)}),d)for(let f=i.length-1;f>=0;f--){const b=i[f];if(!b.filtered||b.filteredPartly){let y=b;do y!=null&&y.parent&&i[y.parentIndex]&&(d=!0,i[y.parentIndex].filteredPartly=!0),y=y!=null&&y.parent&&i[y.parentIndex]?i[y.parentIndex]:null;while(y)}}}else i.forEach(p=>{(p.filtered||p.filteredPartly)&&(p.filtered=!1,p.filteredPartly=!1,d=!0)}),s||(h.searchText="",h.searchMode=!1,d=!0);return d?h:null}filterList(s,i){const r=So.filterListStatic(s,this.state.listItems,this.state.searchMode,this.state.searchText,this.props.scripts);r?this.setState(r,()=>i&&i()):i&&i()}static ensureSelectedIsVisibleStatic(s,i,r){i=JSON.parse(JSON.stringify(i));let l=!1,c=typeof s=="object"?s:r.find(d=>d.id===s);do{if(c!=null&&c.parent){const d=c.parent;c=r.find(h=>h.id===d)}else c=void 0;c&&(i.includes(c.id)||(i.push(c.id),l=!0))}while(c);return l?i:null}ensureSelectedIsVisible(s,i){return So.ensureSelectedIsVisibleStatic(s||this.state.selected,i||this.state.expanded,this.state.listItems)}static getDerivedStateFromProps(s,i){const r={};let l=!1;if(i.expertMode!==s.expertMode&&(l=!0,r.expertMode=s.expertMode),i.scriptsHash!==s.scriptsHash&&s.scripts){const c=E_(s.scripts||{});if(r.listItems=c,i.searchText){const p=So.filterListStatic(!0,c,i.searchMode,i.searchText,s.scripts);p&&Object.assign(r,p)}const d=So.getIsAllZeroInstancesStatic(c,s.instances||[]),h=So.ensureSelectedIsVisibleStatic(i.selected,i.expanded,i.listItems);r.isAllZeroInstances=d,h&&(r.expanded=h),l=!0}if(i.width!==s.width&&(l=!0,r.width=s.width),i.themeName!==s.themeName&&(l=!0,r.themeName=s.themeName),s.selectId&&i.selected!==s.selectId){const c=i.listItems.find(d=>d.id===s.selectId);if(!i.reorder&&c){const d=So.ensureSelectedIsVisibleStatic(c,i.expanded,i.listItems);r.selected=c.id,d&&(r.expanded=d),l=!0,window.localStorage&&window.localStorage.setItem("SideMenu.selected",c.id)}}return l?r:null}static getIsAllZeroInstancesStatic(s,i){let r=!i[0]&&i.length<=1;return r&&s.forEach(l=>{l.type!=="folder"&&l.instance!==0&&(r=!1)}),r}getIsAllZeroInstances(s,i){return s=s||this.state.listItems,i=i||this.state.instances,So.getIsAllZeroInstancesStatic(s||this.state.listItems,i||this.state.instances)}saveExpanded(s){window.localStorage.setItem("SideMenu.expanded",JSON.stringify(s||this.state.expanded))}showError(s){this.setState({errorText:s})}onToggle(s,i){if(i==null||i.stopPropagation(),s===qt)return;const r=[...this.state.expanded],l=r.indexOf(s);l!==-1?(r.splice(l,1),this.state.selected&&this.state.selected.startsWith(`${s}.`)&&window.localStorage&&window.localStorage.setItem("SideMenu.selected",s)):(r.push(s),r.sort()),this.setState({expanded:r}),this.saveExpanded(r)}renderItemButtonsOnEnd(s,i){if(this.state.reorder)return null;if(s.type!=="folder"){let r=s.enabled?ig:ng;return s.enabled&&this.state.problems.includes(s.id)&&(r=S_),[m.jsx(qe,{onClick:l=>{l.stopPropagation(),this.props.onEnableDisable&&this.props.onEnableDisable(s.id,!s.enabled)},title:s.enabled?x.I18n.t("Pause script"):x.I18n.t("Run script"),disabled:this.props.debugMode,style:{...Pe.iconButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0,color:r},size:"medium",children:s.enabled?m.jsx(bc,{}):m.jsx(Wg,{})},"startStop"),this.state.width>Ur?m.jsx(qe,{style:this.props.debugMode?Pe.iconButtonsDisabled:void 0,title:x.I18n.t("Delete script"),disabled:s.id===To||s.id===Cn||this.props.debugMode,onClick:l=>this.onDelete(s,l),size:"medium",children:m.jsx(mc,{})},"delete"):null,m.jsx(qe,{style:this.props.debugMode?Pe.iconButtonsDisabled:void 0,disabled:this.props.debugMode,title:x.I18n.t("Edit script or just double click"),onClick:l=>this.onEdit(s,l),size:"medium",children:m.jsx(px,{})},"openInEdit")]}return this.state.width>Ur&&s.id!==qt&&s.id!==Cn&&s.id!==To&&!(i!=null&&i.length)?m.jsx(qe,{style:this.props.debugMode?Pe.iconButtonsDisabled:void 0,title:x.I18n.t("Delete folder"),disabled:s.id===To||s.id===Cn||this.props.debugMode,onClick:r=>this.onDelete(s,r),size:"medium",children:m.jsx(mc,{})},"delete"):null}onDelete(s,i){return i==null||i.stopPropagation(),new Promise(r=>{if(!s){r();return}typeof s!="object"?this.setState({deleting:s},()=>r()):this.setState({deleting:s.id},()=>r())})}onEdit(s,i){this.onClick(s,i),this.props.onEdit&&this.props.onEdit(s.id)}getTextStyle(s){return!this.state.reorder&&s.type!=="folder"?{width:`calc(100% - ${this.state.width>Ur?185:137}px)`,overflow:"hidden",whiteSpace:"nowrap",flex:"none",padding:"0 16px 0 0"}:{whiteSpace:"nowrap",padding:"0 16px 0 0"}}onClick(s,i){if(i==null||i.stopPropagation(),!this.state.reorder&&s){const r=this.ensureSelectedIsVisible(s),l={selected:s.id};r&&(l.expanded=r),this.setState(l),window.localStorage&&window.localStorage.setItem("SideMenu.selected",s.id)}}onDblClick(s,i){i==null||i.stopPropagation(),!this.state.reorder&&(s.type==="folder"?this.onToggle(s.id):this.onEdit(s))}isFilteredOut(s){var i,r;return s.filtered&&!s.filteredPartly||this.state.typeFilter&&s.type!=="folder"&&s.type.toLowerCase()!==this.state.typeFilter.toLowerCase()||!this.state.expertMode&&((r=(i=this.props.scripts[s.id])==null?void 0:i.native)!=null&&r.protected)||this.state.statusFilter&&s.type!=="folder"&&(this.state.statusFilter==="running"&&!s.enabled||this.state.statusFilter==="paused"&&s.enabled||this.state.statusFilter==="problems"&&(!s.enabled||this.state.problems.indexOf(s.id)===-1))?!0:s.id===To&&!this.state.expertMode}renderListItem(s,i,r){var w,v;if(s.id===qt&&!this.state.reorder)return null;const l=(this.state.reorder?s.depth:s.depth-1)*Mx;let c=s.title;if(this.state.searchText){const _=c.toLowerCase().indexOf(this.state.searchText.toLowerCase());_!==-1&&(c=[m.jsx("span",{children:c.substring(0,_)},"first"),m.jsx("span",{style:{color:"orange"},children:c.substring(_,_+this.state.searchText.length)},"second"),m.jsx("span",{children:c.substring(_+this.state.searchText.length)},"third")])}if(!this.state.isAllZeroInstances&&s.type!=="folder"){const _=this.state.runningInstances[`system.adapter.javascript.${s.instance}`];c=[m.jsxs("span",{title:`${x.I18n.t("Instance")} ${s.instance}${_?"":` (${x.I18n.t("not running")})`}`,style:{...Pe.instances,color:_?ig:ng},children:["[",s.instance,"]"]},"instance"),m.jsx("span",{children:c},"title")]}const d=this.state.reorder&&!this.props.debugMode,h={marginLeft:l,cursor:s.type==="folder"&&d?"default":"inherit",width:`calc(100% - ${l}px)`};d||(h.opacity=s.filteredPartly?.5:1),s.id===To&&s.id!==this.state.selected&&(h.color="#00a200");let p=s.id===qt;!p&&i&&(p=this.state.expanded.includes(s.id));let f;s.type==="folder"?f={...Pe.folderIcon,...d?Pe.folderIconReorder:Pe.folderIconNoReorder}:f={...Pe.scriptIcon},s.id===To?f.color="#356956":s.id===Cn&&(f.color="#4899e1");let b=null;(r&&r.length||i&&i.length)&&(b=m.jsx("span",{style:Pe.childrenCount,children:r&&r.length!==i.length?`${r.length}(${i.length})`:i.length}));const y={...s.type==="folder"?Pe.folder:Pe.script,...d?Pe.reorder:void 0,...d&&s.type!=="folder"?Pe.scriptReorder:void 0,...d&&s.type==="folder"?Pe.folderReorder:void 0,...h};return m.jsxs(LT,{style:y,sx:s.id===this.state.selected&&!d?Pe.selected:void 0,className:x.Utils.clsx(d&&s.type==="folder"&&"folder-reorder",d&&s.type!=="folder"&&"script-reorder"),onClick:_=>this.onClick(s,_),onDoubleClick:_=>this.onDblClick(s,_),secondaryAction:this.renderItemButtonsOnEnd(s,i),children:[(v=(w=this.props.scripts[s.id])==null?void 0:w.native)!=null&&v.protected?m.jsx(T_,{style:{color:"orange",position:"absolute",right:5,width:10,height:10}}):null,m.jsx(Og,{style:Pe.listItemIcon,children:s.type==="folder"?d||p?m.jsx(QT,{style:f,onClick:_=>!d&&this.onToggle(s.id,_)}):m.jsx(eS,{style:f,onClick:_=>!d&&this.onToggle(s.id,_)}):m.jsx("img",{style:f,alt:s.type,src:Tn[s.type]||Tn.def})}),m.jsx(Ng,{sx:{"& .MuiListItemText-primary":s.id===this.state.selected&&!d?Pe.selected:void 0},style:this.getTextStyle(s),primary:m.jsxs("span",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[c,b]})})]},s.id)}onDragFinish(s,i){let r=`${i}.${s.split(".").pop()}`;r!==s&&(this.state.listItems.find(l=>l.id===r)&&(r+=`_${x.I18n.t("copy")}`),this.props.onRename&&this.props.onRename(s,r))}renderOneItem(s,i){const r=this.state.statusFilter||this.state.typeFilter?s.filter(f=>f.parent===i.id?!this.isFilteredOut(f):!1):[],l=s.filter(f=>f.parent===i.id);if(this.isFilteredOut(i)||i.type==="folder"&&(this.state.statusFilter||this.state.typeFilter)&&!r.length)return null;const c=this.state.reorder&&!this.props.debugMode,d=this.renderListItem(i,l,r),h=[];let p;return l&&(c||this.state.expanded.includes(i.id)||i.id===qt)&&(p=l.map(f=>this.renderOneItem(s,f))),c?i.type==="folder"?h.push(m.jsxs(Lx,{onDrop:f=>this.onDragFinish(f.name,i.id),folderName:i.id,children:[m.jsx(I_,{name:i.id,children:d},`draggable_${i.id}`),p||null]},`droppable_${i.id}`)):h.push(m.jsxs(I_,{name:i.id,children:[d,p||null]},`draggable_${i.id}`)):(h.push(d),p==null||p.forEach(f=>h.push(f))),h}renderAllItems(s){const i=s.filter(r=>!r.parent).map(r=>this.renderOneItem(s,r));return m.jsx(Rg,{dense:!0,disablePadding:!0,sx:Pe.mainList,children:i})}onAddNew(s){s==null||s.stopPropagation();let i=this.state.listItems.find(l=>l.id===this.state.selected),r=qt;for(;i&&i.type!=="folder";)i=this.state.listItems[i.parentIndex];i&&(r=i.id),this.parent=r,this.setState({choosingType:!0})}onCopy(s,i){s==null||s.stopPropagation();let r=this.state.listItems.find(c=>c.id===i),l=qt;for(;r&&r.type!=="folder";)r=this.state.listItems[r.parentIndex];r&&(l=r.id),this.parent=l,this.setState({copingScript:i||""})}onAddNewFolder(s){s==null||s.stopPropagation();let i=this.state.listItems.find(l=>l.id===this.state.selected),r=qt;for(;i&&i.type!=="folder";)i=this.state.listItems[i.parentIndex];i&&(r=i.id),this.parent=r,this.setState({creatingFolder:!0})}onRename(s){s==null||s.stopPropagation(),this.setState({renaming:this.state.selected})}getUniqueName(s){let i=1,r=`${x.I18n.t("Script")} `;if(s){const l=Kg(s,this.props.scripts[s]),c=l.match(/\d+$/);c?(r=l.replace(/\d+$/,""),i=parseInt(c[0],10)+1):r=l}for(;this.state.listItems.find(l=>l.id===`${this.parent}.${r.replace(/\.\s/g,"_")}${i}`);)i++;return r+i}getUniqueFolderName(){let s=1;for(;this.state.listItems.find(i=>i.id===`${this.parent}.${x.I18n.t("Folder")}_${s}`);)s++;return`${x.I18n.t("Folder")} ${s}`}onCloseMenu(s){this.setState({menuOpened:!1,menuAnchorEl:null,menuAnchorFilterEl:null},s)}getMainMenu(s,i){var l,c,d,h;const r=this.state.expertMode&&!!Object.keys(this.props.changedScripts).find(p=>{var f,b;return this.props.changedScripts[p]&&((b=(f=this.props.scripts[p])==null?void 0:f.native)==null?void 0:b.protected)});return m.jsxs(pm,{id:"long-menu",anchorEl:this.state.menuAnchorEl,open:this.state.menuOpened,onClose:()=>this.setState({menuOpened:!1,menuAnchorEl:null}),slotProps:{paper:{style:{maxHeight:Nx*7.5}}},children:[this.state.width<=Ur?m.jsxs(it,{disabled:this.props.debugMode||!this.state.selected||this.state.selected===To||this.state.selected===Cn||!!(s!=null&&s.length),onClick:p=>{if(p.stopPropagation(),p.preventDefault(),this.state.listItems.find(f=>f.parent===this.state.selected)){this.showError(x.I18n.t("Cannot delete non empty item!"));return}this.setState({menuOpened:!1,menuAnchorEl:null},()=>this.onDelete(this.state.selected).then(()=>{}))},children:[m.jsx(mc,{style:{...Pe.iconDropdownMenu,color:"red"}}),x.I18n.t("Delete")]},"delete"):null,m.jsxs(it,{disabled:this.props.debugMode||r,selected:this.state.expertMode,onClick:p=>{p.stopPropagation(),p.preventDefault(),this.onCloseMenu(()=>this.props.onExpertModeChange&&this.props.onExpertModeChange(!this.state.expertMode))},children:[m.jsx(x.IconExpert,{style:{...Pe.iconDropdownMenu,color:this.state.expertMode?"orange":"inherit"}}),x.I18n.t("Expert mode")]},"expertMode"),this.props.onExport&&m.jsxs(it,{onClick:p=>{p.stopPropagation(),p.preventDefault(),this.onCloseMenu(()=>this.setState({showExportDialog:!0}))},children:[m.jsx(kc,{style:Pe.iconDropdownMenu}),x.I18n.t("Export all scripts")]},"exportAll"),this.props.onImport&&m.jsxs(it,{disabled:this.props.debugMode,onClick:p=>{p.stopPropagation(),p.preventDefault(),this.onCloseMenu(()=>this.props.onImport())},children:[m.jsx(Lg,{style:Pe.iconDropdownMenu}),x.I18n.t("Import scripts")]},"import"),this.props.onThemeChange&&m.jsxs(it,{onClick:()=>this.onCloseMenu(()=>{this.props.onThemeChange&&this.props.onThemeChange(x.Utils.toggleTheme(this.state.themeName))}),children:[m.jsx(mx,{style:Pe.iconDropdownMenu}),x.I18n.t('Change theme (actual "%s")',this.state.themeName)]},"dark"),this.props.onAddNew&&m.jsxs(it,{disabled:!this.state.selected||!i||i.type==="folder",onClick:p=>{const f=this.state.selected;this.onCloseMenu(()=>this.onCopy(p,f))},children:[m.jsx(tS,{style:Pe.iconDropdownMenu}),x.I18n.t("Copy script")]},"copy"),this.state.expertMode&&m.jsxs(it,{disabled:this.props.debugMode,onClick:p=>{p.stopPropagation(),p.preventDefault(),this.onCloseMenu(()=>this.setState({showAdapterDebug:!0}))},children:[m.jsx(lx,{style:Pe.iconDropdownMenu}),x.I18n.t("Debug instance")]},"debugInstance"),this.state.selected&&this.props.password&&this.props.scripts[this.state.selected].type==="script"?m.jsxs(it,{disabled:this.props.debugMode||this.props.changedScripts[this.state.selected],onClick:p=>{p.stopPropagation(),p.preventDefault(),this.onCloseMenu(async()=>{var b;const f=await this.props.socket.getObject(this.state.selected);f&&((b=f.native)!=null&&b.protected?(delete f.native.protected,f.common.source=Vg(this.props.password,f.common.source||"")):(f.native||={},f.native.protected=!0,f.common.source=vc(this.props.password,f.common.source||"")),await this.props.socket.setObject(f._id,f))})},children:[m.jsx(T_,{style:{...Pe.iconDropdownMenu,color:"orange"}}),(c=(l=this.props.scripts[this.state.selected])==null?void 0:l.native)!=null&&c.protected?m.jsx("span",{style:{color:(h=(d=this.props.scripts[this.state.selected])==null?void 0:d.native)!=null&&h.protected?"orange":void 0},children:x.I18n.t("Unprotect script")}):x.I18n.t("Protect script")]},"encrypt"):null]},"menu")}getToolbarButtons(){const s=[],i=this.state.reorder&&!this.props.debugMode;if(this.state.searchMode&&!this.props.debugMode)s.push(m.jsx(Pn,{value:this.state.searchText,style:Pe.toolbarSearch,ref:this.inputRef,autoFocus:!0,placeholder:x.I18n.t("Search..."),onChange:r=>{this.setState({searchText:r.target.value}),this.filterTimer&&clearTimeout(this.filterTimer),this.filterTimer=setTimeout(()=>{this.filterTimer=null,this.filterList(!0),this.props.onSearch&&this.props.onSearch(this.state.searchText)},400)}},"searchInput")),s.push(m.jsx(qe,{sx:Pe.toolbarButtons,style:{float:"right"},title:x.I18n.t("End search mode"),onClick:r=>{r.stopPropagation(),this.filterList(!1,()=>this.props.onSearch&&this.props.onSearch(this.state.searchText))},size:"medium",children:m.jsx(dx,{})},"disableSearch")),this.state.searchText&&s.push(m.jsx(qe,{title:x.I18n.t("Clear search input"),sx:Pe.toolbarButtons,style:{marginTop:7,float:"right"},onClick:r=>{r.stopPropagation(),this.setState({searchText:""},()=>{this.filterList(!0),this.props.onSearch&&this.props.onSearch(this.state.searchText)})},size:"medium",children:m.jsx(Mw,{fontSize:"small"})},"cleanSearch"));else{if(!i){s.push(m.jsx(qe,{"aria-label":"More","aria-owns":this.state.menuOpened?"long-menu":void 0,title:x.I18n.t("Menu"),"aria-haspopup":"true",onClick:c=>{c.stopPropagation(),c.preventDefault(),this.setState({menuOpened:!0,menuAnchorEl:c.currentTarget})},size:"medium",children:m.jsx(gx,{})},"menuButton"));const r=this.state.listItems.find(c=>c.id===this.state.selected);let l;r&&this.state.width<=Ur&&r.type==="folder"&&(l=this.state.listItems.filter(c=>c.parent===this.state.selected)),s.push(this.getMainMenu(l,r)),s.push(m.jsx(qe,{disabled:this.props.debugMode,title:x.I18n.t("Create new script"),sx:{...Pe.toolbarButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0},style:{color:i?"red":"inherit"},onClick:c=>this.onAddNew(c),size:"medium",children:m.jsx(sS,{})},"new-script")),s.push(m.jsx(qe,{disabled:this.props.debugMode,title:x.I18n.t("Create new folder"),sx:{...Pe.toolbarButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0},style:{color:i?"red":"inherit"},onClick:c=>this.onAddNewFolder(c),size:"medium",children:m.jsx(oS,{})},"new-folder"))}s.push(m.jsx(qe,{disabled:i||this.props.debugMode,sx:{...Pe.toolbarButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0},title:x.I18n.t("Search in scripts"),style:{float:"right",opacity:this.props.debugMode?.5:i?0:1},onClick:r=>{r.stopPropagation(),this.setState({searchMode:!0})},size:"medium",children:m.jsx($x,{})},"search")),s.push(m.jsx(qe,{disabled:this.props.debugMode,title:x.I18n.t("Reorder scripts in folders"),sx:{...Pe.toolbarButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0},style:{color:i?"red":"inherit",float:"right"},onClick:r=>{r.stopPropagation(),this.setState({reorder:!this.state.reorder})},size:"medium",children:m.jsx(_x,{})},"reorder")),!i&&this.state.selected&&this.state.selected!==To&&this.state.selected!==Cn&&s.push(m.jsx(qe,{sx:{...Pe.toolbarButtons,...this.props.debugMode?Pe.iconButtonsDisabled:void 0},disabled:this.props.debugMode,title:x.I18n.t("Rename"),onClick:r=>this.onRename(r),size:"medium",children:m.jsx(iS,{})},"rename")),s.push(m.jsxs("span",{style:{opacity:.5,fontSize:10},children:["v",this.props.version]},"version"))}return s}getFolders(){const s=[{id:qt,name:x.I18n.t("Root folder")}];return this.state.listItems.forEach(i=>{i.type==="folder"&&i.id!==qt&&(!i.id.startsWith(To)||this.state.expertMode)&&s.push({id:i.id,name:i.title})}),s}onCollapseAll(){this.setState({expanded:[]}),this.saveExpanded([])}onExpandAll(){const s=[];this.state.listItems.forEach(i=>this.state.listItems.find(r=>r.parent===i.id)&&s.push(i.id)),this.setState({expanded:s}),this.saveExpanded(s)}getBottomButtons(){return this.state.reorder||this.props.debugMode?null:[m.jsx(wt,{sx:Pe.footerButtons,title:x.I18n.t("Show only running scripts"),onClick:s=>{s.stopPropagation(),s.preventDefault();const i=this.state.statusFilter==="running"?"":"running";window.localStorage&&window.localStorage.setItem("SideMenu.statusFilter",i),this.setState({statusFilter:i})},children:m.jsx(bc,{style:{color:ig,opacity:this.state.statusFilter==="running"?1:.3,background:this.state.statusFilter==="running"?"gray":"inherit"}})},"filterByRunning"),m.jsx(wt,{sx:Pe.footerButtons,title:x.I18n.t("Show only paused scripts"),onClick:()=>{const s=this.state.statusFilter==="paused"?"":"paused";window.localStorage&&window.localStorage.setItem("SideMenu.statusFilter",s),this.setState({statusFilter:s})},children:m.jsx(Wg,{style:{color:ng,opacity:this.state.statusFilter==="paused"?1:.3,background:this.state.statusFilter==="paused"?"gray":"inherit"}})},"filterByPaused"),m.jsx(wt,{sx:Pe.footerButtons,style:{marginRight:16},title:x.I18n.t("Show only scripts with problems"),onClick:()=>{const s=this.state.statusFilter==="problems"?"":"problems";window.localStorage&&window.localStorage.setItem("SideMenu.statusFilter",s),this.setState({statusFilter:s})},children:m.jsx(bc,{style:{color:S_,opacity:this.state.statusFilter==="problems"?1:.3,background:this.state.statusFilter==="problems"?"gray":"inherit"}})},"filterByProblem"),m.jsx(wt,{sx:Pe.footerButtons,children:m.jsx("img",{alt:"Blockly",style:{opacity:this.state.typeFilter==="Blockly"?1:.3,background:this.state.typeFilter==="Blockly"?"gray":"inherit"},src:Tn.Blockly,onClick:()=>{const s=this.state.typeFilter==="Blockly"?"":"Blockly";window.localStorage&&window.localStorage.setItem("SideMenu.typeFilter",s),this.setState({typeFilter:s})}})},"filterBlockly"),m.jsx(wt,{sx:Pe.footerButtons,children:m.jsx("img",{alt:"Javascript",style:{opacity:this.state.typeFilter==="Javascript/js"?1:.3,background:this.state.typeFilter==="Javascript/js"?"gray":"inherit"},src:Tn["Javascript/js"],onClick:()=>{const s=this.state.typeFilter==="Javascript/js"?"":"Javascript/js";window.localStorage&&window.localStorage.setItem("SideMenu.typeFilter",s),this.setState({typeFilter:s})}})},"filterJS"),m.jsx(wt,{sx:Pe.footerButtons,children:m.jsx("img",{alt:"TypeScript",style:{opacity:this.state.typeFilter==="TypeScript/ts"?1:.3,background:this.state.typeFilter==="TypeScript/ts"?"gray":"inherit"},src:Tn["TypeScript/ts"],onClick:()=>{const s=this.state.typeFilter==="TypeScript/ts"?"":"TypeScript/ts";window.localStorage&&window.localStorage.setItem("SideMenu.typeFilter",s),this.setState({typeFilter:s})}})},"filterTS"),m.jsx(wt,{sx:Pe.footerButtons,children:m.jsx("img",{alt:"Rules",style:{opacity:this.state.typeFilter==="Rules"?1:.3,background:this.state.typeFilter==="Rules"?"gray":"inherit"},src:Tn.Rules,onClick:()=>{const s=this.state.typeFilter==="Rules"?"":"Rules";window.localStorage&&window.localStorage.setItem("SideMenu.typeFilter",s),this.setState({typeFilter:s})}})},"filterRules"),m.jsx("div",{style:{flexGrow:1}},"padding"),m.jsx(wt,{sx:Pe.footerButtons,onClick:()=>this.onExpandAll(),title:x.I18n.t("Expand all"),children:m.jsx(kx,{style:Pe.footerButtonsRight})},"expandAll"),this.state.expanded.length?m.jsx(wt,{sx:Pe.footerButtons,onClick:()=>this.onCollapseAll(),title:x.I18n.t("Collapse all"),children:m.jsx(wx,{style:Pe.footerButtonsRight})},"collapseAll"):m.jsx("div",{style:{height:22,width:24}})]}getAdapterDebugDialog(){return this.state.showAdapterDebug?m.jsx(Dx,{socket:this.props.socket,onClose:()=>this.setState({showAdapterDebug:!1}),onDebug:(s,i)=>this.setState({showAdapterDebug:!1},()=>this.props.onDebugInstance({instance:s,adapter:i}))},"debug"):null}render(){var r,l,c;const s=this.state.renaming?this.state.listItems.find(d=>d.id===this.state.renaming):void 0,i=this.state.copingScript&&this.props.scripts[this.state.copingScript].type==="script"?this.props.scripts[this.state.copingScript]:void 0;return[m.jsxs(PT,{variant:"permanent",style:Pe.menu,sx:{"& .MuiDrawer-paper":Pe.drawerPaper},anchor:"left",onClick:()=>this.onClick({id:""}),children:[m.jsx(wt,{sx:Pe.toolbar,children:this.getToolbarButtons()}),m.jsx(o_,{}),m.jsx(ek,{backend:hk,children:m.jsx("div",{style:Pe.innerMenu,children:this.renderAllItems(this.state.listItems)})}),m.jsx(o_,{}),m.jsx("div",{style:Pe.footer,children:this.getBottomButtons()})]},"drawer"),s?m.jsx(_m,{name:s.title,id:this.state.renaming||"",folder:s.type==="folder",instance:s.instance,instances:this.props.instances,onClose:()=>this.setState({renaming:null}),onRename:(d,h,p,f)=>this.props.onRename&&this.props.onRename(d,h,p,f)},"dialog-rename"):null,this.state.deleting?m.jsx(Cx,{name:this.state.listItems.find(d=>d.id===this.state.deleting).title,id:this.state.deleting,onClose:()=>this.setState({deleting:null}),onDelete:d=>this.props.onDelete&&this.props.onDelete(d)},"dialog-delete"):null,this.state.choosingType?m.jsx(Dn,{onClose:d=>{const h={choosingType:!1};d&&(h.creatingScript=d),this.setState(h)}},"dialog-script-type"):null,this.state.creatingScript?m.jsx(og,{onClose:()=>this.setState({creatingScript:null}),title:x.I18n.t("Create new script"),name:this.getUniqueName(),parents:this.getFolders(),folder:!1,existingItems:this.state.listItems.map(d=>d.id),instance:this.props.instances[0]||0,instances:this.props.instances,type:this.state.creatingScript,parent:this.parent,onAdd:(d,h,p,f)=>this.props.onAddNew&&this.props.onAddNew(d,h,!1,p,f)},"dialog-new-script"):null,this.state.copingScript?m.jsx(og,{onClose:()=>this.setState({copingScript:""}),title:x.I18n.t("Copy script"),name:this.getUniqueName(this.state.copingScript),parents:this.getFolders(),folder:!1,instance:parseInt((l=(r=i==null?void 0:i.common)==null?void 0:r.engine)==null?void 0:l.split(".").pop(),10)||0,instances:this.props.instances,type:((c=i==null?void 0:i.common)==null?void 0:c.engineType)||"Javascript/js",parent:this.parent,onAdd:(d,h,p,f)=>{var y;const b=this.state.copingScript&&this.props.scripts[this.state.copingScript].type==="script"?this.props.scripts[this.state.copingScript]:void 0;b!=null&&b.common&&(b.common.enabled=!1),this.props.onAddNew&&this.props.onAddNew(d,h,!1,p,f,(y=b==null?void 0:b.common)==null?void 0:y.source)}},"dialog-copy-script"):null,this.state.creatingFolder?m.jsx(og,{onClose:()=>this.setState({creatingFolder:!1}),title:x.I18n.t("Create new folder"),parents:this.getFolders(),name:this.getUniqueFolderName(),parent:this.parent,onAdd:(d,h)=>this.props.onAddNew&&this.props.onAddNew(d,h,!0)},"dialog-new-folder"):null,this.state.errorText?m.jsx(su,{onClose:()=>this.setState({errorText:""}),text:this.state.errorText},"error"):null,this.getAdapterDebugDialog(),this.state.showExportDialog?m.jsxs(Pt,{open:!0,onClose:()=>this.setState({showExportDialog:!1}),children:[m.jsx(Xt,{children:x.I18n.t("Export all scripts")}),m.jsxs(Bt,{children:[m.jsx(Ue,{variant:"contained",onClick:()=>{this.setState({showExportDialog:!1}),this.props.onExport(!0)},color:"primary",children:x.I18n.t("as JSON")}),m.jsx(Ue,{variant:"contained",onClick:()=>{this.setState({showExportDialog:!1}),this.props.onExport(!1)},color:"grey",children:x.I18n.t("as plain text")}),m.jsx(Ue,{variant:"contained",onClick:()=>this.setState({showExportDialog:!1}),color:"primary",children:x.I18n.t("Cancel")})]})]},"dialog-export-format"):null]}}const Px="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgAQMAAADYVuV7AAAABlBMVEUAAAAzMzPI8eYgAAAAAXRSTlMAQObYZgAAACFJREFUeAFjAIJRwP////8PYIKWHCigNQdKj/pn1D+jAABTG16wVQqVpQAAAABJRU5ErkJggg==",Bx="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgAQMAAADYVuV7AAAABlBMVEUAAAAzMzPI8eYgAAAAAXRSTlMAQObYZgAAABtJREFUeAFjAIJRwP8fCj7QkENn/4z6Z5QzCgBjbWaoyx1PqQAAAABJRU5ErkJggg==";function jx(a){let s,i=a.getHours();return i<10&&(i=`0${i.toString()}`),s=`${i}:`,i=a.getMinutes(),i<10&&(i=`0${i.toString()}`),s+=`${i}:`,i=a.getSeconds(),i<10&&(i=`0${i.toString()}`),s+=`${i}.`,i=a.getMilliseconds(),i<10?i=`00${i.toString()}`:i<100&&(i=`0${i.toString()}`),s+=i,s}const x_=34,Ht={logBox:{width:"100%",height:"100%",position:"relative",overflow:"hidden"},logBoxInner:a=>({display:"inline-block",color:a.palette.mode==="dark"?"white":"black",width:`calc(100% - ${x_}px)`,height:"100%",overflow:"auto",position:"relative",verticalAlign:"top"}),info:a=>({background:a.palette.mode==="dark"?"darkgrey":"lightgrey",color:(a.palette.mode==="dark","black")}),error:a=>({background:"#FF0000",color:a.palette.mode==="dark"?"black":"white"}),warn:a=>({background:"#FF8000",color:a.palette.mode==="dark"?"black":"white"}),debug:a=>({background:"gray",opacity:.8,color:a.palette.mode==="dark"?"black":"white"}),silly:a=>({background:"gray",opacity:.6,color:a.palette.mode==="dark"?"black":"white"}),table:{fontFamily:"monospace",width:"100%"},toolbox:{width:x_,height:"100%",boxShadow:"2px 0px 4px -1px rgba(0, 0, 0, 0.2), 4px 0px 5px 0px rgba(0, 0, 0, 0.14), 1px 0px 10px 0px rgba(0, 0, 0, 0.12)",display:"inline-block",verticalAlign:"top",overflow:"hidden"},trFrom:{width:90},trTime:{width:90},trSeverity:{width:40,fontWeight:"bold"},trPreMessage:{padding:0,margin:0},iconButtons:{width:32,height:32,padding:4},layoutIcon:a=>({"& img":{width:24,height:24,background:a.palette.mode==="dark"?"#9d9d9d":void 0,borderRadius:a.palette.mode==="dark"?"30px":void 0}})};function Fx(a){return a<10?`00${a}`:a<100?`0${a}`:a.toString()}const Zs={};class wm extends _e.Component{messagesEnd;constructor(s){super(s),this.state={lines:{},goBottom:!0,selected:null,editing:this.props.editing||[]},this.messagesEnd=_e.createRef()}static generateLine(s,i){let r=s.message||"";if(typeof r!="object"){const l=new RegExp(`${s.from.replace(".","\\.").replace(")","\\)").replace("(","\\(")} \\(\\d+\\) `,"g"),c=r.match(l);c?r=r.replace(c[0],""):r=r.replace(`${s.from} `,"")}return r.startsWith(`${i}: `)&&(r=r.substring(i.length+2)),m.jsxs(wt,{component:"tr",sx:Ht[s.severity],children:[m.jsx("td",{style:Ht.trFrom,children:s.from}),m.jsx("td",{style:Ht.trTime,children:jx(new Date(s.ts))}),m.jsx("td",{style:Ht.trSeverity,children:s.severity}),m.jsx("td",{children:m.jsx("pre",{style:Ht.trPreMessage,children:r})})]},`tr_${s.ts}_${s.message.substring(s.message.length-10)}`)}scrollToBottom(){var s,i;(i=(s=this.messagesEnd)==null?void 0:s.current)==null||i.scrollIntoView({behavior:"smooth"})}logHandler=s=>{const i=this.state.lines,r=this.state.editing.filter(f=>s.message.includes(f));let l=null;if(!r.length||(r.length===1?l=r[0]:(r.sort(),l=r[r.length-1]),!l))return;const c=i[l]||[],d=Zs[l]||[];c.push(wm.generateLine(s,l));let h=s.severity;(h==="info"||h==="warn")&&(h+=" ");const p=new Date(s.ts);d.push(`${p.toLocaleString()}.${Fx(p.getMilliseconds())} [${h}]: ${s.message}`),c.length>300&&(c.splice(0,c.length-300),d.splice(0,c.length-300)),Zs[l]=d,i[l]=c,this.setState({lines:i})};componentDidMount(){this.props.socket.registerLogHandler(this.logHandler)}componentWillUnmount(){this.props.socket.unregisterLogHandler(this.logHandler)}componentDidUpdate(){this.state.goBottom&&this.scrollToBottom()}static getDerivedStateFromProps(s,i){let r=!1;const l={};if(s.selected!==i.selected){const c=s.selected,d=i.lines;c&&(d[c]=d[c]||[],Zs[c]=Zs[c]||[]),l.selected=c,r=!0}if(JSON.stringify(s.editing)!==JSON.stringify(i.editing)){const c=JSON.parse(JSON.stringify(s.editing));r=!0;const d=i.lines;for(const h in Zs)Object.prototype.hasOwnProperty.call(Zs,h)&&(c.includes(h)||(delete Zs[h],delete d[h]));l.editing=c}return r?l:null}onCopy(){x.Utils.copyToClipboard((Zs[this.state.selected]||[]).join(` +`))}clearLog(){const s=this.state.lines;s[this.state.selected]&&(s[this.state.selected]=[]),Zs[this.state.selected]&&(Zs[this.state.selected]=[]),this.setState({lines:s})}renderLogList(s){return this.state.selected&&(s!=null&&s.length)?m.jsxs(wt,{sx:Ht.logBoxInner,children:[m.jsx("table",{style:Ht.table,children:m.jsx("tbody",{children:s})},"logTable"),m.jsx("div",{ref:this.messagesEnd,style:{float:"left",clear:"both"}},"logScrollPoint")]},"logList"):m.jsx(wt,{sx:Ht.logBoxInner,style:{paddingLeft:10},children:x.I18n.t("Log outputs")},"logList")}render(){const s=this.state.selected?this.state.lines[this.state.selected]:null;return m.jsxs("div",{style:Ht.logBox,children:[m.jsxs("div",{style:Ht.toolbox,children:[m.jsx(qe,{style:Ht.iconButtons,onClick:()=>this.setState({goBottom:!this.state.goBottom}),color:this.state.goBottom?"secondary":void 0,size:"medium",children:m.jsx(nS,{})}),s!=null&&s.length?m.jsx(qe,{style:Ht.iconButtons,onClick:()=>this.clearLog(),size:"medium",children:m.jsx(rS,{})}):null,s!=null&&s.length?m.jsx(qe,{style:Ht.iconButtons,onClick:()=>this.onCopy(),size:"medium",children:m.jsx(aS,{})}):null,this.props.onLayoutChange?m.jsx(qe,{style:Ht.iconButtons,onClick:()=>this.props.onLayoutChange&&this.props.onLayoutChange(),title:x.I18n.t("Change layout"),size:"medium",sx:Ht.layoutIcon,children:m.jsx("img",{alt:"split",src:this.props.verticalLayout?Px:Bx})}):null,m.jsx(qe,{style:Ht.iconButtons,onClick:()=>this.props.onHideLog(),title:x.I18n.t("Hide logs"),size:"medium",children:m.jsx(lS,{})})]},"toolbox"),this.renderLogList(s)]})}}var D_="focus-outline-hidden";function vk(){var a=this;document.addEventListener("keydown",function(s){a.focusByKeyboard=!0},!0),document.addEventListener("mousedown",function(s){a.focusByKeyboard=!1},!0),document.addEventListener("focus",function(s){a.updateVisibility()},!0),document.addEventListener("focusout",function(s){window.setTimeout(function(){document.hasFocus()||(a.focusByKeyboard=!0,a.updateVisibility())},0)}),this.updateVisibility()}vk.prototype={focusByKeyboard:!0,updateVisibility:function(){this.hidden=!this.focusByKeyboard},set hidden(a){document.documentElement.classList.toggle(D_,a)},get hidden(){return document.documentElement.classList.contains(D_)}};new vk;var yk={exports:{}};(function(a){(function(){var s={}.hasOwnProperty;function i(){for(var r=[],l=0;l4&&arguments[4]!==void 0?arguments[4]:"easeInOutCubic";return r>l?i:s+(i-s)*Ux[c](r/l)};Mi.calcEndPoint=function(s){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(Hx(s))return parseInt(s)+r;var l=i===window||i===document.documentElement?window.pageYOffset:i.scrollTop-i.getBoundingClientRect().top,c=s.nodeName.toLowerCase()==="html"?-l:s.getBoundingClientRect().top+l;return c+r};(function(a,s){Object.defineProperty(s,"__esModule",{value:!0});var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},r=Mi;s.default=function(l){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d=c.duration,h=d===void 0?500:d,p=c.context,f=p===void 0?window:p,b=c.offset,y=b===void 0?0:b,w=c.ease,v=w===void 0?"easeInOutCubic":w,_=c.callback;if((typeof window>"u"?"undefined":i(window))==="object"){var $=f.scrollTop!==null&&f.scrollTop!==void 0?f.scrollTop:window.pageYOffset,S=(0,r.calcEndPoint)(l,f,y),T=performance.now(),E=window.requestAnimationFrame,D=function M(){var P=performance.now()-T,W=(0,r.setPosition)($,S,P,h,v);f!==window?f.scrollTop=W:window.scroll(0,W),P>h?typeof _=="function"&&_(l):E(M)};D()}},a.exports=s.default})(Jg,Jg.exports);var _k=Jg.exports,qg={exports:{}};(function(a,s){Object.defineProperty(s,"__esModule",{value:!0});var i=Object.assign||function(d){for(var h=1;h0&&arguments[0]!==void 0?arguments[0]:{},h=d.query,p=h===void 0?'[href^="#"]:not([href="#"]':h,f=d.match,b=f===void 0?function(S){return document.getElementById(S.hash.substring(1))}:f,y=d.hashChange,w=y===void 0?!0:y,v=d.scrollSmoothConfig,_=document.querySelectorAll(p),$=function(T){T.preventDefault();var E=b(T.target);E&&(w&&history.replaceState(null,null,"#"+E.id),(0,l.default)(E,i({},v)))};Array.from(_).map(function(S){S.addEventListener("click",$,!1)})},a.exports=s.default})(qg,qg.exports);var Wx=qg.exports,Xg={exports:{}};(function(a,s){Object.defineProperty(s,"__esModule",{value:!0});function i(r){if(Array.isArray(r)){for(var l=0,c=Array(r.length);l0&&arguments[0]!==void 0?arguments[0]:{},l=r.activeClass,c=l===void 0?"active":l,d=r.query,h=d===void 0?'[href^="#"]:not([href="#"]):not([href="#0"])':d,p=r.threshold,f=p===void 0?[.25,.5,.75]:p,b=r.detectType,y=b===void 0?"max":b,w={threshold:f},v=function(W){return W.classList.remove(c)},_=function(W){return W.classList.add(c)},$=function(){document.querySelectorAll("."+c).forEach(v)},S=function(W){$(),_(document.querySelector('a[href="#'+W.id+'"]'))},T=function(W){W.forEach(function(G){G.intersectionRatio>=Math[y].apply(Math,i(f))&&S(G.target)})},E=document.querySelectorAll(h),D=new IntersectionObserver(T,w),M=function(W){var G=document.querySelector("#"+W.hash.slice(1));D.observe(G)};E.forEach(M)},a.exports=s.default})(Xg,Xg.exports);var Gx=Xg.exports;(function(a,s){Object.defineProperty(s,"__esModule",{value:!0});var i=_k,r=f(i),l=Mi,c=Wx,d=f(c),h=Gx,p=f(h);function f(b){return b&&b.__esModule?b:{default:b}}s.default={to:r.default,calcEndPoint:l.calcEndPoint,anchorScroll:d.default,observe:p.default},a.exports=s.default})(Yg,Yg.exports);var Vx=Yg.exports;const Kx=Xo(Vx);var km={exports:{}},Yx=km.exports;(function(a){(function(s,i){a.exports?a.exports=i():s.Scrollparent=i()})(Yx,function(){var s=/(auto|scroll)/,i=function(h,p){return h.parentNode===null?p:i(h.parentNode,p.concat([h]))},r=function(h,p){return getComputedStyle(h,null).getPropertyValue(p)},l=function(h){return r(h,"overflow")+r(h,"overflow-y")+r(h,"overflow-x")},c=function(h){return s.test(l(h))},d=function(h){if(h instanceof HTMLElement||h instanceof SVGElement){for(var p=i(h.parentNode,[]),f=0;f=s||G<0||y&&z>=c}function T(){var W=rg();if(S(W))return E(W);h=setTimeout(T,$(W))}function E(W){return h=void 0,w&&r?v(W):(r=l=void 0,d)}function D(){h!==void 0&&clearTimeout(h),f=0,r=p=l=h=void 0}function M(){return h===void 0?d:E(rg())}function P(){var W=rg(),G=S(W);if(r=arguments,l=this,p=W,G){if(h===void 0)return _(p);if(y)return h=setTimeout(T,s),v(p)}return h===void 0&&(h=setTimeout(T,s)),d}return P.cancel=D,P.flush=M,P}function Zg(a){var s=typeof a;return!!a&&(s=="object"||s=="function")}function h0(a){return!!a&&typeof a=="object"}function p0(a){return typeof a=="symbol"||h0(a)&&l0.call(a)==Zx}function O_(a){if(typeof a=="number")return a;if(p0(a))return R_;if(Zg(a)){var s=typeof a.valueOf=="function"?a.valueOf():a;a=Zg(s)?s+"":s}if(typeof a!="string")return a===0?a:+a;a=a.replace(Qx,"");var i=t0.test(a);return i||s0.test(a)?o0(a.slice(2),i?2:8):e0.test(a)?R_:+a}var g0=d0;const m0=Xo(g0);var Qg="data-focus-lock",wk="data-focus-lock-disabled",f0="data-no-focus-lock",$0="data-autofocus-inside",b0="data-no-autofocus";function ag(a,s){return typeof a=="function"?a(s):a&&(a.current=s),a}function v0(a,s){var i=kt(function(){return{value:a,callback:s,facade:{get current(){return i.value},set current(r){var l=i.value;l!==r&&(i.value=r,i.callback(r,l))}}}})[0];return i.callback=s,i.facade}var y0=typeof window<"u"?hm:Lt,N_=new WeakMap;function _0(a,s){var i=v0(null,function(r){return a.forEach(function(l){return ag(l,r)})});return y0(function(){var r=N_.get(i);if(r){var l=new Set(r),c=new Set(a),d=i.current;l.forEach(function(h){c.has(h)||ag(h,null)}),c.forEach(function(h){l.has(h)||ag(h,d)})}N_.set(i,a)},[a]),i}var lg={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"};function kk(a){return a}function Ck(a,s){s===void 0&&(s=kk);var i=[],r=!1,l={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:a},useMedium:function(c){var d=s(c,r);return i.push(d),function(){i=i.filter(function(h){return h!==d})}},assignSyncMedium:function(c){for(r=!0;i.length;){var d=i;i=[],d.forEach(c)}i={push:function(h){return c(h)},filter:function(){return i}}},assignMedium:function(c){r=!0;var d=[];if(i.length){var h=i;i=[],h.forEach(c),d=i}var p=function(){var b=d;d=[],b.forEach(c)},f=function(){return Promise.resolve().then(p)};f(),i={push:function(b){d.push(b),f()},filter:function(b){return d=d.filter(b),i}}}};return l}function Cm(a,s){return s===void 0&&(s=kk),Ck(a,s)}function w0(a){a===void 0&&(a={});var s=Ck(null);return s.options=cS({async:!0,ssr:!1},a),s}var Tk=Cm({},function(a){var s=a.target,i=a.currentTarget;return{target:s,currentTarget:i}}),Sk=Cm(),k0=Cm(),C0=w0({async:!0,ssr:typeof document<"u"}),T0=um(void 0),S0=[],Tm=Iw(function(s,i){var r,l=kt(),c=l[0],d=l[1],h=Ko(),p=Ko(!1),f=Ko(null),b=kt({}),y=b[1],w=s.children,v=s.disabled,_=v===void 0?!1:v,$=s.noFocusGuards,S=$===void 0?!1:$,T=s.persistentFocus,E=T===void 0?!1:T,D=s.crossFrame,M=D===void 0?!0:D,P=s.autoFocus,W=P===void 0?!0:P;s.allowTextSelection;var G=s.group,z=s.className,Z=s.whiteList,he=s.hasPositiveIndices,Ce=s.shards,O=Ce===void 0?S0:Ce,K=s.as,C=K===void 0?"div":K,Q=s.lockProps,ve=Q===void 0?{}:Q,ce=s.sideCar,ne=s.returnFocus,me=ne===void 0?!1:ne,re=s.focusOptions,B=s.onActivation,N=s.onDeactivation,te=kt({}),q=te[0],se=xn(function(Y){var R=Y.captureFocusRestore;if(!f.current){var A,U=(A=document)==null?void 0:A.activeElement;f.current=U,U!==document.body&&(f.current=R(U))}h.current&&B&&B(h.current),p.current=!0,y()},[B]),F=xn(function(){p.current=!1,N&&N(h.current),y()},[N]),Te=xn(function(Y){var R=f.current;if(R){var A=(typeof R=="function"?R():R)||document.body,U=typeof me=="function"?me(A):me;if(U){var H=typeof U=="object"?U:void 0;f.current=null,Y?Promise.resolve().then(function(){return A.focus(H)}):A.focus(H)}}},[me]),ae=xn(function(Y){p.current&&Tk.useMedium(Y)},[]),we=Sk.useMedium,Ie=xn(function(Y){h.current!==Y&&(h.current=Y,d(Y))},[]),Ne=Ig((r={},r[wk]=_&&"disabled",r[Qg]=G,r),ve),Ae=S!==!0,We=Ae&&S!=="tail",k=_0([i,Ie]),X=us(function(){return{observed:h,shards:O,enabled:!_,active:p.current}},[_,p.current,O,c]);return _e.createElement(Dg,null,Ae&&[_e.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:_?-1:0,style:lg}),he?_e.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:_?-1:1,style:lg}):null],!_&&_e.createElement(ce,{id:q,sideCar:C0,observed:c,disabled:_,persistentFocus:E,crossFrame:M,autoFocus:W,whiteList:Z,shards:O,onActivation:se,onDeactivation:F,returnFocus:Te,focusOptions:re,noFocusGuards:S}),_e.createElement(C,Ig({ref:k},Ne,{className:z,onBlur:we,onFocus:ae}),_e.createElement(T0.Provider,{value:X},w)),We&&_e.createElement("div",{"data-focus-guard":!0,tabIndex:_?-1:0,style:lg}))});Tm.propTypes={};function E0(a,s){function i(r){return r.displayName||r.name||"Component"}return function(l){var c=[],d;function h(){d=a(c.map(function(f){return f.props})),s(d)}var p=(function(f){DS(b,f);function b(){return f.apply(this,arguments)||this}b.peek=function(){return d};var y=b.prototype;return y.componentDidMount=function(){c.push(this),h()},y.componentDidUpdate=function(){h()},y.componentWillUnmount=function(){var v=c.indexOf(this);c.splice(v,1),h()},y.render=function(){return _e.createElement(l,this.props)},b})(OT);return qS(p,"displayName","SideEffect("+i(l)+")"),p}}var oo=function(a){for(var s=Array(a.length),i=0;i=0}).sort(L0)},B0=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],Im=B0.join(","),j0="".concat(Im,", [data-focus-guard]"),Mk=function(a,s){return oo((a.shadowRoot||a).children).reduce(function(i,r){return i.concat(r.matches(s?j0:Im)?[r]:[],Mk(r))},[])},F0=function(a,s){var i;return a instanceof HTMLIFrameElement&&(!((i=a.contentDocument)===null||i===void 0)&&i.body)?Bn([a.contentDocument.body],s):[a]},Bn=function(a,s){return a.reduce(function(i,r){var l,c=Mk(r,s),d=(l=[]).concat.apply(l,c.map(function(h){return F0(h,s)}));return i.concat(d,r.parentNode?oo(r.parentNode.querySelectorAll(Im)).filter(function(h){return h===r}):[])},[])},z0=function(a){var s=a.querySelectorAll("[".concat($0,"]"));return oo(s).map(function(i){return Bn([i])}).reduce(function(i,r){return i.concat(r)},[])},xm=function(a,s){return oo(a).filter(function(i){return Dk(s,i)}).filter(function(i){return O0(i)})},M_=function(a,s){return s===void 0&&(s=new Map),oo(a).filter(function(i){return Ak(s,i)})},Dm=function(a,s,i){return Em(xm(Bn(a,i),s),!0,i)},ea=function(a,s){return Em(xm(Bn(a),s),!1)},U0=function(a,s){return xm(z0(a),s)},xi=function(a,s){return a.shadowRoot?xi(a.shadowRoot,s):Object.getPrototypeOf(a).contains!==void 0&&Object.getPrototypeOf(a).contains.call(a,s)?!0:oo(a.children).some(function(i){var r;if(i instanceof HTMLIFrameElement){var l=(r=i.contentDocument)===null||r===void 0?void 0:r.body;return l?xi(l,s):!1}return xi(i,s)})},H0=function(a){for(var s=new Set,i=a.length,r=0;r0&&s.add(l),(c&Node.DOCUMENT_POSITION_CONTAINS)>0&&s.add(r)}return a.filter(function(d,h){return!s.has(h)})},Lk=function(a){return a.parentNode?Lk(a.parentNode):a},Am=function(a){var s=Oi(a);return s.filter(Boolean).reduce(function(i,r){var l=r.getAttribute(Qg);return i.push.apply(i,l?H0(oo(Lk(r).querySelectorAll("[".concat(Qg,'="').concat(l,'"]:not([').concat(wk,'="disabled"])')))):[r]),i},[])},W0=function(a){try{return a()}catch{return}},ta=function(a){if(a===void 0&&(a=document),!(!a||!a.activeElement)){var s=a.activeElement;return s.shadowRoot?ta(s.shadowRoot):s instanceof HTMLIFrameElement&&W0(function(){return s.contentWindow.document})?ta(s.contentWindow.document):s}},G0=function(a,s){return a===s},V0=function(a,s){return!!oo(a.querySelectorAll("iframe")).some(function(i){return G0(i,s)})},Pk=function(a,s){return s===void 0&&(s=ta(Ek(a).ownerDocument)),!s||s.dataset&&s.dataset.focusGuard?!1:Am(a).some(function(i){return xi(i,s)||V0(i,s)})},K0=function(a){a===void 0&&(a=document);var s=ta(a);return s?oo(a.querySelectorAll("[".concat(f0,"]"))).some(function(i){return xi(i,s)}):!1},Y0=function(a,s){return s.filter(Nk).filter(function(i){return i.name===a.name}).filter(function(i){return i.checked})[0]||a},Rm=function(a,s){return Nk(a)&&a.name?Y0(a,s):a},J0=function(a){var s=new Set;return a.forEach(function(i){return s.add(Rm(i,a))}),a.filter(function(i){return s.has(i)})},L_=function(a){return a[0]&&a.length>1?Rm(a[0],a):a[0]},P_=function(a,s){return a.indexOf(Rm(s,a))},tm="NEW_FOCUS",q0=function(a,s,i,r,l){var c=a.length,d=a[0],h=a[c-1],p=Sm(r);if(!(r&&a.indexOf(r)>=0)){var f=r!==void 0?i.indexOf(r):-1,b=l?i.indexOf(l):f,y=l?a.indexOf(l):-1;if(f===-1)return y!==-1?y:tm;if(y===-1)return tm;var w=f-b,v=i.indexOf(d),_=i.indexOf(h),$=J0(i),S=r!==void 0?$.indexOf(r):-1,T=l?$.indexOf(l):S,E=$.filter(function(z){return z.tabIndex>=0}),D=r!==void 0?E.indexOf(r):-1,M=l?E.indexOf(l):D,P=D>=0&&M>=0?M-D:T-S;if(!w&&y>=0||s.length===0)return y;var W=P_(a,s[0]),G=P_(a,s[s.length-1]);if(f<=v&&p&&Math.abs(w)>1)return G;if(f>=_&&p&&Math.abs(w)>1)return W;if(w&&Math.abs(P)>1)return y;if(f<=v)return G;if(f>_)return W;if(w)return Math.abs(w)>1?y:(c+y+w)%c}},X0=function(a){return function(s){var i,r=(i=Rk(s))===null||i===void 0?void 0:i.autofocus;return s.autofocus||r!==void 0&&r!=="false"||a.indexOf(s)>=0}},B_=function(a,s,i){var r=a.map(function(c){var d=c.node;return d}),l=M_(r.filter(X0(i)));return l&&l.length?L_(l):L_(M_(s))},sm=function(a,s){return s===void 0&&(s=[]),s.push(a),a.parentNode&&sm(a.parentNode.host||a.parentNode,s),s},cg=function(a,s){for(var i=sm(a),r=sm(s),l=0;l=0)return c}return!1},Bk=function(a,s,i){var r=Oi(a),l=Oi(s),c=r[0],d=!1;return l.filter(Boolean).forEach(function(h){d=cg(d||h,h)||d,i.filter(Boolean).forEach(function(p){var f=cg(c,p);f&&(!d||xi(f,d)?d=f:d=cg(f,d))})}),d},j_=function(a,s){return a.reduce(function(i,r){return i.concat(U0(r,s))},[])},Z0=function(a,s){var i=new Map;return s.forEach(function(r){return i.set(r.node,r)}),a.map(function(r){return i.get(r)}).filter(M0)},Q0=function(a,s){var i=ta(Oi(a).length>0?document:Ek(a).ownerDocument),r=Am(a).filter(em),l=Bk(i||a,a,r),c=new Map,d=ea(r,c),h=d.filter(function(_){var $=_.node;return em($)});if(h[0]){var p=ea([l],c).map(function(_){var $=_.node;return $}),f=Z0(p,h),b=f.map(function(_){var $=_.node;return $}),y=f.filter(function(_){var $=_.tabIndex;return $>=0}).map(function(_){var $=_.node;return $}),w=q0(b,y,p,i,s);if(w===tm){var v=B_(d,y,j_(r,c))||B_(d,b,j_(r,c));if(v)return{node:v};console.warn("focus-lock: cannot find any node to move focus into");return}return w===void 0?w:f[w]}},eD=function(a){var s=Am(a).filter(em),i=Bk(a,a,s),r=Em(Bn([i],!0),!0,!0),l=Bn(s,!1);return r.map(function(c){var d=c.node,h=c.index;return{node:d,index:h,lockItem:l.indexOf(d)>=0,guard:Sm(d)}})},Om=function(a,s){a&&("focus"in a&&a.focus(s),"contentWindow"in a&&a.contentWindow&&a.contentWindow.focus())},ug=0,dg=!1,jk=function(a,s,i){i===void 0&&(i={});var r=Q0(a,s);if(!dg&&r){if(ug>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),dg=!0,setTimeout(function(){dg=!1},1);return}ug++,Om(r.node,i.focusOptions),ug--}};function Hr(a){if(!a)return null;if(typeof WeakRef>"u")return function(){return a||null};var s=a?new WeakRef(a):null;return function(){return(s==null?void 0:s.deref())||null}}var tD=function(a){if(!a)return null;for(var s=[],i=a;i&&i!==document.body;)s.push({current:Hr(i),parent:Hr(i.parentElement),left:Hr(i.previousElementSibling),right:Hr(i.nextElementSibling)}),i=i.parentElement;return{element:Hr(a),stack:s,ownerDocument:a.ownerDocument}},sD=function(a){var s,i,r,l,c;if(a)for(var d=a.stack,h=a.ownerDocument,p=new Map,f=0,b=d;f-1&&(S.filter(function(E){var D=E.guard,M=E.node;return D&&M.dataset.focusAutoGuard}).forEach(function(E){var D=E.node;return D.removeAttribute("tabIndex")}),z_(T,S.length,1,S),z_(T,-1,-1,S))}}}return s},Gk=function(s){Sc()&&s&&(s.stopPropagation(),s.preventDefault())},Lm=function(){return Nm(Sc)},yD=function(s){var i=s.target,r=s.currentTarget;r.contains(i)||gD(r,i)},_D=function(){return null},Vk=function(){Mm=!0},Kk=function(){Mm=!1,sa="just",Nm(function(){sa="meanwhile"})},wD=function(){document.addEventListener("focusin",Gk),document.addEventListener("focusout",Lm),window.addEventListener("focus",Vk),window.addEventListener("blur",Kk)},kD=function(){document.removeEventListener("focusin",Gk),document.removeEventListener("focusout",Lm),window.removeEventListener("focus",Vk),window.removeEventListener("blur",Kk)};function CD(a){return a.filter(function(s){var i=s.disabled;return!i})}var Yk={moveFocusInside:jk,focusInside:Pk,focusNextElement:rD,focusPrevElement:aD,focusFirstElement:lD,focusLastElement:cD,captureFocusRestore:Fk};function TD(a){var s=a.slice(-1)[0];s&&!On&&wD();var i=On,r=i&&s&&s.id===i.id;On=s,i&&!r&&(i.onDeactivation(),a.filter(function(l){var c=l.id;return c===i.id}).length||i.returnFocus(!s)),s?(ss=null,(!r||i.observed!==s.observed)&&s.onActivation(Yk),Sc(),Nm(Sc)):(kD(),ss=null)}Tk.assignSyncMedium(yD);Sk.assignMedium(Lm);k0.assignMedium(function(a){return a(Yk)});const SD=E0(CD,TD)(_D);var Jk=Iw(function(s,i){return _e.createElement(Tm,Ig({sideCar:SD,ref:i},s))}),qk=Tm.propTypes||{};qk.sideCar;AS(qk,["sideCar"]);Jk.propTypes={};var Xk={exports:{}},ct={};var Pm=Symbol.for("react.element"),Bm=Symbol.for("react.portal"),ou=Symbol.for("react.fragment"),iu=Symbol.for("react.strict_mode"),nu=Symbol.for("react.profiler"),ru=Symbol.for("react.provider"),au=Symbol.for("react.context"),ED=Symbol.for("react.server_context"),lu=Symbol.for("react.forward_ref"),cu=Symbol.for("react.suspense"),uu=Symbol.for("react.suspense_list"),du=Symbol.for("react.memo"),hu=Symbol.for("react.lazy"),ID=Symbol.for("react.offscreen"),Zk;Zk=Symbol.for("react.module.reference");function Cs(a){if(typeof a=="object"&&a!==null){var s=a.$$typeof;switch(s){case Pm:switch(a=a.type,a){case ou:case nu:case iu:case cu:case uu:return a;default:switch(a=a&&a.$$typeof,a){case ED:case au:case lu:case hu:case du:case ru:return a;default:return s}}case Bm:return s}}}ct.ContextConsumer=au;ct.ContextProvider=ru;ct.Element=Pm;ct.ForwardRef=lu;ct.Fragment=ou;ct.Lazy=hu;ct.Memo=du;ct.Portal=Bm;ct.Profiler=nu;ct.StrictMode=iu;ct.Suspense=cu;ct.SuspenseList=uu;ct.isAsyncMode=function(){return!1};ct.isConcurrentMode=function(){return!1};ct.isContextConsumer=function(a){return Cs(a)===au};ct.isContextProvider=function(a){return Cs(a)===ru};ct.isElement=function(a){return typeof a=="object"&&a!==null&&a.$$typeof===Pm};ct.isForwardRef=function(a){return Cs(a)===lu};ct.isFragment=function(a){return Cs(a)===ou};ct.isLazy=function(a){return Cs(a)===hu};ct.isMemo=function(a){return Cs(a)===du};ct.isPortal=function(a){return Cs(a)===Bm};ct.isProfiler=function(a){return Cs(a)===nu};ct.isStrictMode=function(a){return Cs(a)===iu};ct.isSuspense=function(a){return Cs(a)===cu};ct.isSuspenseList=function(a){return Cs(a)===uu};ct.isValidElementType=function(a){return typeof a=="string"||typeof a=="function"||a===ou||a===nu||a===iu||a===cu||a===uu||a===ID||typeof a=="object"&&a!==null&&(a.$$typeof===hu||a.$$typeof===du||a.$$typeof===ru||a.$$typeof===au||a.$$typeof===lu||a.$$typeof===Zk||a.getModuleId!==void 0)};ct.typeOf=Cs;Xk.exports=ct;var Qk=Xk.exports;function xD(a){function s(N,te,q,se,F){for(var Te=0,ae=0,we=0,Ie=0,Ne,Ae,We=0,k=0,X,Y=X=Ne=0,R=0,A=0,U=0,H=0,ue=q.length,V=ue-1,be,pe="",fe="",Le="",He="",Be;RNe)&&(H=(pe=pe.replace(" ",":")).length),0se&&(se=(te=te.trim()).charCodeAt(0)),se){case 38:return te.replace(T,"$1"+N.trim());case 58:return N.trim()+te.replace(T,"$1"+N.trim());default:if(0<1*q&&0ae.charCodeAt(8))break;case 115:F=F.replace(ae,"-webkit-"+ae)+";"+F;break;case 207:case 102:F=F.replace(ae,"-webkit-"+(102q.charCodeAt(0)&&(q=q.trim()),B=q,q=[B],01?s-1:0),r=1;r0?" Args: "+i.join(", "):""))}var OD=(function(){function a(i){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=i}var s=a.prototype;return s.indexOfGroup=function(i){for(var r=0,l=0;l=this.groupSizes.length){for(var l=this.groupSizes,c=l.length,d=c;i>=d;)(d<<=1)<0&&ga(16,""+i);this.groupSizes=new Uint32Array(d),this.groupSizes.set(l),this.length=d;for(var h=c;h=this.length||this.groupSizes[i]===0)return r;for(var l=this.groupSizes[i],c=this.indexOfGroup(i),d=c+l,h=c;h=Yr&&(Yr=s+1),yc.set(a,s),Ic.set(s,a)},LD="style["+jn+'][data-styled-version="5.3.11"]',PD=new RegExp("^"+jn+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),BD=function(a,s,i){for(var r,l=i.split(","),c=0,d=l.length;c=0;f--){var b=p[f];if(b&&b.nodeType===1&&b.hasAttribute(jn))return b}})(i),c=l!==void 0?l.nextSibling:null;r.setAttribute(jn,"active"),r.setAttribute("data-styled-version","5.3.11");var d=FD();return d&&r.setAttribute("nonce",d),i.insertBefore(r,c),r},zD=(function(){function a(i){var r=this.element=eC(i);r.appendChild(document.createTextNode("")),this.sheet=(function(l){if(l.sheet)return l.sheet;for(var c=document.styleSheets,d=0,h=c.length;d=0){var l=document.createTextNode(r),c=this.nodes[i];return this.element.insertBefore(l,c||null),this.length++,!0}return!1},s.deleteRule=function(i){this.element.removeChild(this.nodes[i]),this.length--},s.getRule=function(i){return i0&&(y+=w+",")})),c+=""+f+b+'{content:"'+y+`"}/*!sc*/ +`}}}return c})(this)},a})(),GD=/(a)(d)/gi,G_=function(a){return String.fromCharCode(a+(a>25?39:97))};function im(a){var s,i="";for(s=Math.abs(a);s>52;s=s/52|0)i=G_(s%52)+i;return(G_(s%52)+i).replace(GD,"$1-$2")}var An=function(a,s){for(var i=s.length;i;)a=33*a^s.charCodeAt(--i);return a},tC=function(a){return An(5381,a)};function sC(a){for(var s=0;s>>0);if(!i.hasNameForId(l,h)){var p=r(d,"."+h,void 0,l);i.insertRules(l,h,p)}c.push(h),this.staticRulesId=h}else{for(var f=this.rules.length,b=An(this.baseHash,r.hash),y="",w=0;w>>0);if(!i.hasNameForId(l,S)){var T=r(y,"."+S,void 0,l);i.insertRules(l,S,T)}c.push(S)}}return c.join(" ")},a})(),YD=/^\s*\/\/.*$/gm,JD=[":","[",".","#"];function qD(a){var s,i,r,l,c=Yo,d=c.options,h=d===void 0?Yo:d,p=c.plugins,f=p===void 0?Ec:p,b=new xD(h),y=[],w=(function($){function S(T){if(T)try{$(T+"}")}catch{}}return function(T,E,D,M,P,W,G,z,Z,he){switch(T){case 1:if(Z===0&&E.charCodeAt(0)===64)return $(E+";"),"";break;case 2:if(z===0)return E+"/*|*/";break;case 3:switch(z){case 102:case 112:return $(D[0]+E),"";default:return E+(he===0?"/*|*/":"")}case-2:E.split("/*|*/}").forEach(S)}}})((function($){y.push($)})),v=function($,S,T){return S===0&&JD.indexOf(T[i.length])!==-1||T.match(l)?$:"."+s};function _($,S,T,E){E===void 0&&(E="&");var D=$.replace(YD,""),M=S&&T?T+" "+S+" { "+D+" }":D;return s=E,i=S,r=new RegExp("\\"+i+"\\b","g"),l=new RegExp("(\\"+i+"\\b){2,}"),b(T||!S?"":S,M)}return b.use([].concat(f,[function($,S,T){$===2&&T.length&&T[0].lastIndexOf(i)>0&&(T[0]=T[0].replace(r,v))},w,function($){if($===-2){var S=y;return y=[],S}}])),_.hash=f.length?f.reduce((function($,S){return S.name||ga(15),An($,S.name)}),5381).toString():"",_}var oC=_e.createContext();oC.Consumer;var iC=_e.createContext(),XD=(iC.Consumer,new xc),nm=qD();function nC(){return ia(oC)||XD}function rC(){return ia(iC)||nm}var ZD=(function(){function a(s,i){var r=this;this.inject=function(l,c){c===void 0&&(c=nm);var d=r.name+c.hash;l.hasNameForId(r.id,d)||l.insertRules(r.id,d,c(r.rules,d,"@keyframes"))},this.toString=function(){return ga(12,String(r.name))},this.name=s,this.id="sc-keyframes-"+s,this.rules=i}return a.prototype.getName=function(s){return s===void 0&&(s=nm),this.name+s.hash},a})(),QD=/([A-Z])/,eA=/([A-Z])/g,tA=/^ms-/,sA=function(a){return"-"+a.toLowerCase()};function V_(a){return QD.test(a)?a.replace(eA,sA).replace(tA,"-ms-"):a}var K_=function(a){return a==null||a===!1||a===""};function Ni(a,s,i,r){if(Array.isArray(a)){for(var l,c=[],d=0,h=a.length;d1?s-1:0),r=1;r?@[\\\]^`{|}~-]+/g,iA=/(^-|-$)/g;function hg(a){return a.replace(oA,"-").replace(iA,"")}var cC=function(a){return im(tC(a)>>>0)};function ac(a){return typeof a=="string"&&!0}var rm=function(a){return typeof a=="function"||typeof a=="object"&&a!==null&&!Array.isArray(a)},nA=function(a){return a!=="__proto__"&&a!=="constructor"&&a!=="prototype"};function rA(a,s,i){var r=a[i];rm(s)&&rm(r)?uC(r,s):a[i]=s}function uC(a){for(var s=arguments.length,i=new Array(s>1?s-1:0),r=1;r=0||(he[z]=W[z]);return he})(s,["componentId"]),P=D&&D+"-"+(ac(E)?E:hg(H_(E)));return dC(E,to({},M,{attrs:w,componentId:P}),i)},Object.defineProperty(_,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(E){this._foldedDefaultProps=r?uC({},a.defaultProps,E):E}}),Object.defineProperty(_,"toString",{value:function(){return"."+_.styledComponentId}}),l&&RS(_,a,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),_}var ks=function(a){return(function s(i,r,l){if(l===void 0&&(l=Yo),!Qk.isValidElementType(r))return ga(1,String(r));var c=function(){return i(r,l,aC.apply(void 0,arguments))};return c.withConfig=function(d){return s(i,r,to({},l,{},d))},c.attrs=function(d){return s(i,r,to({},l,{attrs:Array.prototype.concat(l.attrs,d).filter(Boolean)}))},c})(dC,a)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(a){ks[a]=ks(a)}));var aA=(function(){function a(i,r){this.rules=i,this.componentId=r,this.isStatic=sC(i),xc.registerId(this.componentId+1)}var s=a.prototype;return s.createStyles=function(i,r,l,c){var d=c(Ni(this.rules,r,l,c).join(""),""),h=this.componentId+i;l.insertRules(h,h,d)},s.removeStyles=function(i,r){r.clearRules(this.componentId+i)},s.renderStyles=function(i,r,l,c){i>2&&xc.registerId(this.componentId+i),this.removeStyles(i,l),this.createStyles(i,r,l,c)},a})();function lA(a){for(var s=arguments.length,i=new Array(s>1?s-1:0),r=1;ra.length)&&(s=a.length);for(var i=0,r=Array(s);i=a.length?{done:!0}:{done:!1,value:a[r++]}},e:function(p){throw p},f:l}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var c,d=!0,h=!1;return{s:function(){i=i.call(a)},n:function(){var p=i.next();return d=p.done,p},e:function(p){h=!0,c=p},f:function(){try{d||i.return==null||i.return()}finally{if(h)throw c}}}}function vs(a,s,i){return(s=pC(s))in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function Dc(a){return Dc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(s){return s.__proto__||Object.getPrototypeOf(s)},Dc(a)}function mA(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(s&&s.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),s&&am(a,s)}function hC(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(hC=function(){return!!a})()}function fA(a,s){var i=a==null?null:typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(i!=null){var r,l,c,d,h=[],p=!0,f=!1;try{if(c=(i=i.call(a)).next,s!==0)for(;!(p=(r=c.call(i)).done)&&(h.push(r.value),h.length!==s);p=!0);}catch(b){f=!0,l=b}finally{try{if(!p&&i.return!=null&&(d=i.return(),Object(d)!==d))return}finally{if(f)throw l}}return h}}function $A(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q_(a,s){var i=Object.keys(a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(a);s&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(a,l).enumerable})),i.push.apply(i,r)}return i}function Ac(a){for(var s=1;s(SA(T)?h+b*2:p+b*2)},v=function(T){for(var E=EA(y),D=0;Db?P:b,G=mg(s+p,d)?mg(r+b,d)?r-p:r-p+b:s-b,z=G>b?G:b,Z={top:[W,s-p-b*2],right:[i+b*2,z],bottom:[W,r+b*2],left:[l-h-b*2,z],center:[c/2-h/2,d/2-p/2]};return T==="center"||w(T)?Z[T]:v(Z)},$=_(f);return"translate(".concat(Math.round($[0]),"px, ").concat(Math.round($[1]),"px)")}),iw,xA=ks.span(iw||(iw=Ls([` + `):""},function(a){var s=a.targetTop,i=a.targetRight,r=a.targetBottom,l=a.targetLeft,c=a.windowWidth,d=a.windowHeight,h=a.helperWidth,p=a.helperHeight,f=a.helperPosition,b=a.padding,y={left:l,right:c-i,top:s,bottom:d-r},w=function(T){return y[T]>(SA(T)?h+b*2:p+b*2)},v=function(T){for(var E=EA(y),D=0;Db?P:b,G=mg(s+p,d)?mg(r+b,d)?r-p:r-p+b:s-b,z=G>b?G:b,Z={top:[W,s-p-b*2],right:[i+b*2,z],bottom:[W,r+b*2],left:[l-h-b*2,z],center:[c/2-h/2,d/2-p/2]};return T==="center"||w(T)?Z[T]:v(Z)},$=_(f);return"translate(".concat(Math.round($[0]),"px, ").concat(Math.round($[1]),"px)")}),iw,xA=ks.span(iw||(iw=Ls([` position: absolute; font-family: monospace; background: var(--reactour-accent); @@ -178,7 +178,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho justify-content: center; align-items: center; flex-wrap: wrap; -`]))),aw,OA=ks.button(aw||(aw=Ls([` +`]))),aw,RA=ks.button(aw||(aw=Ls([` counter-increment: dot; width: 8px; height: 8px; @@ -217,7 +217,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho transform: translate(-50%, -2px); } } -`])),function(a){return a.current===a.index?"0":"1px solid #caccce"},function(a){return a.disabled?"not-allowed":"pointer"},function(a){return a.current===a.index?1.25:1},function(a){return a.current===a.index?"var(--reactour-accent)":"#caccce"},function(a){return a.current===a.index?"var(--reactour-accent)":"none"},function(a){return a.current===a.index?a.accentColor:"#caccce"},function(a){return a.current===a.index?a.accentColor:"none"},function(a){return a.showNumber?"block":"none"}),lw,RA=ks.div(lw||(lw=Ls([` +`])),function(a){return a.current===a.index?"0":"1px solid #caccce"},function(a){return a.disabled?"not-allowed":"pointer"},function(a){return a.current===a.index?1.25:1},function(a){return a.current===a.index?"var(--reactour-accent)":"#caccce"},function(a){return a.current===a.index?"var(--reactour-accent)":"none"},function(a){return a.current===a.index?a.accentColor:"#caccce"},function(a){return a.current===a.index?a.accentColor:"none"},function(a){return a.showNumber?"block":"none"}),lw,OA=ks.div(lw||(lw=Ls([` opacity: `,`; color: `,`; width: 100%; @@ -227,7 +227,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho position: fixed; z-index: 99999; pointer-events: none; -`])),function(a){return!a.maskClassName&&.7},function(a){return!a.maskClassName&&"#000"});function vC(a){var s=a.windowWidth,i=a.windowHeight,r=a.targetWidth,l=a.targetHeight,c=a.targetTop,d=a.targetLeft,h=a.padding,p=a.rounded,f=a.roundedStep,b=a.disableInteraction,y=a.disableInteractionClassName,w=a.className,v=a.onClick,_=a.highlightedBorder,$=Qs(r+h*2),S=Qs(l+h*2),T=Qs(c-h),E=Qs(d-h),D=f?Math.min($/2,S/2):p;return _e.createElement(RA,{onClick:v,maskClassName:w},_e.createElement("svg",{width:s,height:i,xmlns:"http://www.w3.org/2000/svg",className:w},_e.createElement("defs",null,_e.createElement("mask",{id:"mask-main"},_e.createElement("rect",{x:0,y:0,width:s,height:i,fill:"white"}),_e.createElement("rect",{x:E,y:T,width:$,height:S,fill:"black"}),_e.createElement("rect",{x:E-1,y:T-1,width:D,height:D,fill:"white"}),_e.createElement("circle",{cx:E+D,cy:T+D,r:D,fill:"black"}),_e.createElement("rect",{x:E+$-D+1,y:T-1,width:D,height:D,fill:"white"}),_e.createElement("circle",{cx:E+$-D,cy:T+D,r:D,fill:"black"}),_e.createElement("rect",{x:E-1,y:T+S-D+1,width:D,height:D,fill:"white"}),_e.createElement("circle",{cx:E+D,cy:T+S-D,r:D,fill:"black"}),_e.createElement("rect",{x:E+$-D+1,y:T+S-D+1,width:D,height:D,fill:"white"}),_e.createElement("circle",{cx:E+$-D,cy:T+S-D,r:D,fill:"black "})),_e.createElement("clipPath",{id:"clip-path"},_e.createElement("rect",{x:0,y:0,width:s,height:T}),_e.createElement("rect",{x:0,y:T,width:E,height:S}),_e.createElement("rect",{x:d+r+h,y:T,width:Qs(s-r-E),height:S}),_e.createElement("rect",{x:0,y:c+l+h,width:s,height:Qs(i-l-T)}))),_e.createElement("rect",{x:0,y:0,width:s,height:i,fill:"currentColor",mask:"url(#mask-main)"}),_e.createElement("rect",{x:0,y:0,width:s,height:i,fill:"currentColor",clipPath:"url(#clip-path)",pointerEvents:"auto"}),_e.createElement("rect",{x:E,y:T,width:$,height:S,pointerEvents:"auto",fill:"transparent",display:b?"block":"none",className:y}),_&&_e.createElement("rect",{x:Qs(E+_.width/2),y:Qs(T+_.width/2),width:Qs($-_.width),height:Qs(S-_.width),pointerEvents:"auto",fill:"none",strokeWidth:_.width,stroke:_.color,rx:D-2})))}vC.propTypes={windowWidth:ke.number.isRequired,windowHeight:ke.number.isRequired,targetWidth:ke.number.isRequired,targetHeight:ke.number.isRequired,targetTop:ke.number.isRequired,targetLeft:ke.number.isRequired,padding:ke.number.isRequired,rounded:ke.number.isRequired,roundedStep:ke.bool,disableInteraction:ke.bool.isRequired,disableInteractionClassName:ke.string.isRequired,highlightedBorder:ke.shape({color:ke.string.isRequired,width:ke.number.isRequired})};var NA=(function(a){var s=a.step,i=a.refresh,r=kt(0),l=vA(r,2),c=l[0],d=l[1];return Lt(function(){if(s.resizeObservables){var h=function(w){var v=Mn(w),_;try{var $=function(){var T=_.value;if(!T.attributes)return 1;var E=s.resizeObservables.find(function(D){return T.matches(D)||T.querySelector(D)!=null});E&&d(c+1)};for(v.s();!(_=v.n()).done;)$()}catch(S){v.e(S)}finally{v.f()}},p=new MutationObserver(function(y){var w=Mn(y),v;try{for(w.s();!(v=w.n()).done;){var _=v.value;_.addedNodes.length!==0&&h(_.addedNodes),_.removedNodes.length!==0&&h(_.removedNodes)}}catch($){w.e($)}finally{w.f()}}),f=document.documentElement||document.body,b={childList:!0,subtree:!0};return p.observe(f,b),function(){p.disconnect()}}},[s,c]),Lt(function(){if(s.resizeObservables){var h=new ResizeObserver(function(w){i()}),p=Mn(s.resizeObservables),f;try{for(p.s();!(f=p.n()).done;){var b=f.value,y=document.querySelector(b);y&&h.observe(y)}}catch(w){p.e(w)}finally{p.f()}return function(){h.disconnect()}}},[s,c]),null}),MA=(function(a){var s=a.step,i=a.refresh;return Lt(function(){if(s.mutationObservables){var r=function(p){var f=Mn(p),b;try{var y=function(){var v=b.value;if(!v.attributes)return 1;var _=s.mutationObservables.find(function($){return v.matches($)||v.querySelector($)!=null});_&&i()};for(f.s();!(b=f.n()).done;)y()}catch(w){f.e(w)}finally{f.f()}},l=new MutationObserver(function(h){var p=Mn(h),f;try{for(p.s();!(f=p.n()).done;){var b=f.value;b.addedNodes.length!==0&&r(b.addedNodes),b.removedNodes.length!==0&&r(b.removedNodes)}}catch(y){p.e(y)}finally{p.f()}}),c=document.documentElement||document.body,d={childList:!0,subtree:!0};return l.observe(c,d),function(){l.disconnect()}}},[s]),null});function LA(a){var s=a.children,i=Ko(null);return i.current===null&&(i.current=document.createElement("div"),i.current.setAttribute("id","___reactour")),Lt(function(){return document.body.appendChild(i.current),function(){document.body.removeChild(i.current)}},[i]),RS(s,i.current)}var PA={disableFocusLock:ke.bool,badgeContent:ke.func,highlightedMaskClassName:ke.string,children:ke.oneOfType([ke.node,ke.element]),className:ke.string,closeButtonAriaLabel:ke.string,closeWithMask:ke.bool,inViewThreshold:ke.number,isOpen:ke.bool.isRequired,lastStepNextButton:ke.node,maskClassName:ke.string,maskSpace:ke.number,nextButton:ke.node,onAfterOpen:ke.func,onBeforeClose:ke.func,onRequestClose:ke.func,prevButton:ke.node,scrollDuration:ke.number,scrollOffset:ke.number,showButtons:ke.bool,showCloseButton:ke.bool,showNavigation:ke.bool,showNavigationNumber:ke.bool,showNumber:ke.bool,startAt:ke.number,goToStep:ke.number,getCurrentStep:ke.func,nextStep:ke.func,prevStep:ke.func,steps:ke.arrayOf(ke.shape({selector:ke.string,content:ke.oneOfType([ke.node,ke.element,ke.func]).isRequired,position:ke.oneOfType([ke.arrayOf(ke.number),ke.oneOf(["top","right","bottom","left","center"])]),action:ke.func,style:ke.object,stepInteraction:ke.bool,navDotAriaLabel:ke.string,roundedStep:ke.bool})),update:ke.string,updateDelay:ke.number,disableInteraction:ke.bool,disableDotsNavigation:ke.bool,disableKeyboardNavigation:ke.oneOfType([ke.arrayOf(ke.oneOf(["esc","right","left"])),ke.bool]),rounded:ke.number,accentColor:ke.string,highlightedBorder:ke.shape({color:ke.string.isRequired,width:ke.number.isRequired})},BA={disableFocusLock:!1,showNavigation:!0,showNavigationNumber:!0,showButtons:!0,showCloseButton:!0,closeButtonAriaLabel:"Close",showNumber:!0,scrollDuration:1,maskSpace:10,updateDelay:1,disableInteraction:!1,rounded:0,accentColor:"#007aff",closeWithMask:!0},Sn={mask:{disableInteraction:"reactour__mask--disable-interaction"},helper:{base:"reactour__helper",isOpen:"reactour__helper--is-open"},dot:{base:"reactour__dot",active:"reactour__dot--is-active"}},Um=(function(a){function s(){var i;return hA(this,s),i=dA(this,s),vs(i,"unlockFocus",function(r){i.setState({focusUnlocked:!0},r())}),vs(i,"showStep",function(){if(!(!i.helper||!i.helper.current)){var r=i.props.steps,l=i.state,c=l.current,d=l.focusUnlocked;d&&i.setState({focusUnlocked:!1});var h=r[c],p=h.selector?document.querySelector(h.selector):null,f=function(_){h.action&&typeof h.action=="function"&&i.unlockFocus(function(){return h.action(_)})};if(h.observe){var b=document.querySelector(h.observe),y={attributes:!0,childList:!0,characterData:!0};i.setState(function(v){return v.observer&&setTimeout(function(){v.observer.disconnect()},0),{observer:new MutationObserver(function(_){_.forEach(function($){if($.type==="childList"&&$.addedNodes.length>0){var S=function(){return f($.addedNodes[0])};setTimeout(function(){return i.calculateNode($.addedNodes[0],h,S)},100)}else if($.type==="childList"&&$.removedNodes.length>0){var T=function(){return f(p)};i.calculateNode(p,h,T)}})})}},function(){return i.state.observer.observe(b,y)})}else i.state.observer&&(i.state.observer.disconnect(),i.setState({observer:null}));if(p){var w=function(){return f(p)};i.calculateNode(p,h,w)}else i.setState(fg(null,h,i.helper.current),f),h.selector&&console.warn("Doesn't find a DOM node '".concat(h.selector,"'. Please check the 'steps' Tour prop Array at position ").concat(c,"."))}}),vs(i,"calculateNode",function(r,l,c){var d=i.props,h=d.scrollDuration,p=d.inViewThreshold,f=d.scrollOffset,b=bC(r,l),y=Math.max(document.documentElement.clientWidth,window.innerWidth||0),w=Math.max(document.documentElement.clientHeight,window.innerHeight||0);if(CA(Ac(Ac({},b),{},{w:y,h:w,threshold:p})))i.setState(fg(r,l,i.helper.current),c);else{var v=qx(r),_=f||(b.height>w?-25:-(w/2)+b.height/2);Kx.to(r,{context:TA(v)?window:v,duration:h,offset:_,callback:function(S){i.setState(fg(S,l,i.helper.current),c)}})}}),vs(i,"recalculateNode",function(r){var l=document.querySelector(r.selector),c=function(h){r.action&&typeof r.action=="function"&&i.unlockFocus(function(){return r.action(h)})};i.calculateNode(l,r,function(){return c(l)})}),vs(i,"maskClickHandler",function(r){var l=i.props,c=l.closeWithMask,d=l.onRequestClose;c&&!r.target.classList.contains(Sn.mask.disableInteraction)&&d(r)}),vs(i,"nextStep",function(){var r=i.props,l=r.steps,c=r.getCurrentStep;i.setState(function(d){var h=d.current0?l.current-1:l.current;return typeof r=="function"&&r(c),{current:c}},i.showStep)}),vs(i,"gotoStep",function(r){var l=i.props,c=l.steps,d=l.getCurrentStep;i.setState(function(h){var p=c[r]?r:h.current;return typeof d=="function"&&d(p),{current:p}},i.showStep)}),vs(i,"keyDownHandler",function(r){var l=i.props,c=l.onRequestClose,d=l.nextStep,h=l.prevStep,p=l.disableKeyboardNavigation;if(r.stopPropagation(),p!==!0){var f,b,y;p&&(f=p.includes("esc"),b=p.includes("right"),y=p.includes("left")),r.keyCode===27&&!f&&(r.preventDefault(),c()),r.keyCode===39&&!b&&(r.preventDefault(),typeof d=="function"?d():i.nextStep()),r.keyCode===37&&!y&&(r.preventDefault(),typeof h=="function"?h():i.prevStep())}}),i.state={isOpen:!1,current:0,top:0,right:0,bottom:0,left:0,width:0,height:0,w:0,h:0,inDOM:!1,observer:null,focusUnlocked:!1},i.helper=MT(),i.helperElement=null,i.debouncedShowStep=m0(i.showStep,70),i}return mA(s,a),gA(s,[{key:"componentDidMount",value:function(){var r=this.props,l=r.isOpen,c=r.startAt;l&&this.open(c)}},{key:"UNSAFE_componentWillReceiveProps",value:function(r){var l=this.props,c=l.isOpen,d=l.update,h=l.updateDelay;!c&&r.isOpen?this.open(r.startAt):c&&!r.isOpen&&this.close(),c&&d!==r.update&&(r.steps[this.state.current]?setTimeout(this.showStep,h):this.props.onRequestClose()),c&&r.isOpen&&this.state.current!==r.goToStep&&this.gotoStep(r.goToStep)}},{key:"componentWillUnmount",value:function(){var r=this.props.isOpen;r&&this.close(),this.state.observer&&this.state.observer.disconnect()}},{key:"open",value:function(r){var l=this,c=this.props.onAfterOpen;this.setState(function(d){return{isOpen:!0,current:r!==void 0?r:d.current}},function(){setTimeout(l.showStep,1),l.helperElement=l.helper.current,l.props.disableFocusLock||l.helper.current.focus(),c&&c(l.helperElement)}),window.addEventListener("resize",this.debouncedShowStep,!1),window.addEventListener("keydown",this.keyDownHandler,!1)}},{key:"close",value:function(){this.setState(function(r){return r.observer&&r.observer.disconnect(),{isOpen:!1,observer:null}},this.onBeforeClose),window.removeEventListener("resize",this.debouncedShowStep),window.removeEventListener("keydown",this.keyDownHandler)}},{key:"onBeforeClose",value:function(){var r=this.props.onBeforeClose;r&&r(this.helperElement)}},{key:"render",value:function(){var r=this,l=this.props,c=l.className,d=l.steps,h=l.maskClassName,p=l.showButtons,f=l.showCloseButton,b=l.closeButtonAriaLabel,y=l.showNavigation,w=l.showNavigationNumber,v=l.showNumber,_=l.onRequestClose,$=l.maskSpace,S=l.lastStepNextButton,T=l.nextButton,E=l.prevButton,D=l.badgeContent,M=l.highlightedMaskClassName,P=l.disableInteraction,W=l.disableDotsNavigation,G=l.nextStep,z=l.prevStep,Z=l.rounded,he=l.accentColor,Ce=l.CustomHelper,R=l.disableFocusLock,K=l.highlightedBorder,C=this.state,Q=C.isOpen,ve=C.current,ce=C.inDOM,ne=C.top,me=C.right,re=C.bottom,B=C.left,N=C.width,te=C.height,q=C.w,se=C.h,j=C.helperWidth,Te=C.helperHeight,ae=C.helperPosition;return Q?_e.createElement(LA,null,_e.createElement(_A,null),_e.createElement(NA,{step:d[ve],refresh:function(){return r.recalculateNode(d[ve])}}),_e.createElement(MA,{step:d[ve],refresh:function(){return r.recalculateNode(d[ve])}}),_e.createElement(vC,{onClick:this.maskClickHandler,forwardRef:function(Ie){return r.mask=Ie},windowWidth:q,windowHeight:se,targetWidth:N,targetHeight:te,targetTop:ne,targetLeft:B,padding:$,rounded:Z,roundedStep:d[ve].roundedStep,className:h,disableInteraction:d[ve].stepInteraction===!1||P?!d[ve].stepInteraction:P,disableInteractionClassName:"".concat(Sn.mask.disableInteraction," ").concat(M),highlightedBorder:K}),_e.createElement(Jk,{disabled:R,autoFocus:!1},_e.createElement(IA,{ref:this.helper,targetHeight:te,targetWidth:N,targetTop:ne,targetRight:me,targetBottom:re,targetLeft:B,windowWidth:q,windowHeight:se,helperWidth:j,helperHeight:Te,helperPosition:ae,padding:$,tabIndex:-1,current:ve,style:d[ve].style?d[ve].style:{},rounded:Z,className:A_(Sn.helper.base,c,vs({},Sn.helper.isOpen,Q)),accentColor:he,defaultStyles:!Ce,role:"dialog"},Ce?_e.createElement(Ce,{current:ve,totalSteps:d.length,gotoStep:this.gotoStep,close:_,content:d[ve]&&(typeof d[ve].content=="function"?d[ve].content({close:_,goTo:this.gotoStep,inDOM:ce,step:ve+1}):d[ve].content)},this.props.children):_e.createElement(_e.Fragment,null,this.props.children,d[ve]&&(typeof d[ve].content=="function"?d[ve].content({close:_,goTo:this.gotoStep,inDOM:ce,step:ve+1}):d[ve].content),v&&_e.createElement(xA,{"data-tour-elem":"badge",accentColor:he},typeof D=="function"?D(ve+1,d.length):ve+1),(p||y)&&_e.createElement(DA,{"data-tour-elem":"controls"},p&&_e.createElement(tw,{onClick:typeof z=="function"?z:this.prevStep,disabled:ve===0,label:E||null}),y&&_e.createElement(AA,{"data-tour-elem":"navigation"},d.map(function(we,Ie){return _e.createElement(OA,{key:"".concat(we.selector?we.selector:"undef","_").concat(Ie),onClick:function(){return r.gotoStep(Ie)},current:ve,index:Ie,accentColor:he,disabled:ve===Ie||W,showNumber:w,"data-tour-elem":"dot",className:A_(Sn.dot.base,vs({},Sn.dot.active,ve===Ie)),"aria-label":we.navDotAriaLabel})})),p&&_e.createElement(tw,{onClick:ve===d.length-1?S?_:function(){}:typeof G=="function"?G:this.nextStep,disabled:!S&&ve===d.length-1,inverted:!0,label:S&&ve===d.length-1?S:T||null})),f&&_e.createElement(kA,{onClick:_,className:"reactour__close",ariaLabel:b}))))):null}}])})(xw),fg=function(s,i,r){if(r){var l=Math.max(document.documentElement.clientWidth,window.innerWidth||0),c=Math.max(document.documentElement.clientHeight,window.innerHeight||0),d=_c(r),h=d.width,p=d.height,f={top:c+10,right:l/2+9,bottom:c/2+9,left:l/2-h/2,width:0,height:0,w:l,h:c,helperPosition:"center"};return s&&(f=bC(s,i)),function(){return Ac(Ac({w:l,h:c,helperWidth:h,helperHeight:p,helperPosition:i.position},f),{},{inDOM:!!s})}}};Um.propTypes=PA;Um.defaultProps=BA;const FA=""+new URL("blockly2js-B3Jxf2e-.svg",import.meta.url).href,jA=""+new URL("rules2js-DnYyR8mI.svg",import.meta.url).href,Ns={selectTriggers:0,addScheduleByDoubleClick:1,openTagsMenu:2,selectIntervalTag:3,selectActions:4,addActionPrintText:5,showJavascript:6,switchBackToRules:7,saveTheScript:8},zA=[{selector:".blocks-triggers",content:"Select triggers"},{selector:".block-TriggerScheduleBlock",content:"Double click to add the block"},{selector:".tag-card",content:"Open drop down menu"},{selector:".tag-card-interval",content:"Select interval"},{selector:".blocks-actions",content:"Select action blocks"},{selector:".block-ActionPrintText",content:"Double click to add the block"},{selector:".button-js-code",content:"Check the script"},{selector:".button-js-code",content:"Switch back to rules"},{selector:".button-save",content:"Save the script"}],$g=187,lc={root:{left:0,top:0,width:"100%",height:"100%",position:"fixed",background:"rgba(0, 0, 0, .3)",zIndex:2e4},connecting:{left:"40%",top:"40%",width:"20%",height:"20%",position:"absolute"},spinner:{animation:"admin-connecting-rotator 1.4s linear infinite"},path:{strokeDasharray:187,strokeDashoffset:0,transformOrigin:"center",animation:"admin-connecting-dash 1.4s ease-in-out infinite, $colors 5.6s ease-in-out infinite"}};function En(){return m.jsxs("div",{style:lc.root,children:[m.jsx("style",{children:` +`])),function(a){return!a.maskClassName&&.7},function(a){return!a.maskClassName&&"#000"});function vC(a){var s=a.windowWidth,i=a.windowHeight,r=a.targetWidth,l=a.targetHeight,c=a.targetTop,d=a.targetLeft,h=a.padding,p=a.rounded,f=a.roundedStep,b=a.disableInteraction,y=a.disableInteractionClassName,w=a.className,v=a.onClick,_=a.highlightedBorder,$=Qs(r+h*2),S=Qs(l+h*2),T=Qs(c-h),E=Qs(d-h),D=f?Math.min($/2,S/2):p;return _e.createElement(OA,{onClick:v,maskClassName:w},_e.createElement("svg",{width:s,height:i,xmlns:"http://www.w3.org/2000/svg",className:w},_e.createElement("defs",null,_e.createElement("mask",{id:"mask-main"},_e.createElement("rect",{x:0,y:0,width:s,height:i,fill:"white"}),_e.createElement("rect",{x:E,y:T,width:$,height:S,fill:"black"}),_e.createElement("rect",{x:E-1,y:T-1,width:D,height:D,fill:"white"}),_e.createElement("circle",{cx:E+D,cy:T+D,r:D,fill:"black"}),_e.createElement("rect",{x:E+$-D+1,y:T-1,width:D,height:D,fill:"white"}),_e.createElement("circle",{cx:E+$-D,cy:T+D,r:D,fill:"black"}),_e.createElement("rect",{x:E-1,y:T+S-D+1,width:D,height:D,fill:"white"}),_e.createElement("circle",{cx:E+D,cy:T+S-D,r:D,fill:"black"}),_e.createElement("rect",{x:E+$-D+1,y:T+S-D+1,width:D,height:D,fill:"white"}),_e.createElement("circle",{cx:E+$-D,cy:T+S-D,r:D,fill:"black "})),_e.createElement("clipPath",{id:"clip-path"},_e.createElement("rect",{x:0,y:0,width:s,height:T}),_e.createElement("rect",{x:0,y:T,width:E,height:S}),_e.createElement("rect",{x:d+r+h,y:T,width:Qs(s-r-E),height:S}),_e.createElement("rect",{x:0,y:c+l+h,width:s,height:Qs(i-l-T)}))),_e.createElement("rect",{x:0,y:0,width:s,height:i,fill:"currentColor",mask:"url(#mask-main)"}),_e.createElement("rect",{x:0,y:0,width:s,height:i,fill:"currentColor",clipPath:"url(#clip-path)",pointerEvents:"auto"}),_e.createElement("rect",{x:E,y:T,width:$,height:S,pointerEvents:"auto",fill:"transparent",display:b?"block":"none",className:y}),_&&_e.createElement("rect",{x:Qs(E+_.width/2),y:Qs(T+_.width/2),width:Qs($-_.width),height:Qs(S-_.width),pointerEvents:"auto",fill:"none",strokeWidth:_.width,stroke:_.color,rx:D-2})))}vC.propTypes={windowWidth:ke.number.isRequired,windowHeight:ke.number.isRequired,targetWidth:ke.number.isRequired,targetHeight:ke.number.isRequired,targetTop:ke.number.isRequired,targetLeft:ke.number.isRequired,padding:ke.number.isRequired,rounded:ke.number.isRequired,roundedStep:ke.bool,disableInteraction:ke.bool.isRequired,disableInteractionClassName:ke.string.isRequired,highlightedBorder:ke.shape({color:ke.string.isRequired,width:ke.number.isRequired})};var NA=(function(a){var s=a.step,i=a.refresh,r=kt(0),l=vA(r,2),c=l[0],d=l[1];return Lt(function(){if(s.resizeObservables){var h=function(w){var v=Mn(w),_;try{var $=function(){var T=_.value;if(!T.attributes)return 1;var E=s.resizeObservables.find(function(D){return T.matches(D)||T.querySelector(D)!=null});E&&d(c+1)};for(v.s();!(_=v.n()).done;)$()}catch(S){v.e(S)}finally{v.f()}},p=new MutationObserver(function(y){var w=Mn(y),v;try{for(w.s();!(v=w.n()).done;){var _=v.value;_.addedNodes.length!==0&&h(_.addedNodes),_.removedNodes.length!==0&&h(_.removedNodes)}}catch($){w.e($)}finally{w.f()}}),f=document.documentElement||document.body,b={childList:!0,subtree:!0};return p.observe(f,b),function(){p.disconnect()}}},[s,c]),Lt(function(){if(s.resizeObservables){var h=new ResizeObserver(function(w){i()}),p=Mn(s.resizeObservables),f;try{for(p.s();!(f=p.n()).done;){var b=f.value,y=document.querySelector(b);y&&h.observe(y)}}catch(w){p.e(w)}finally{p.f()}return function(){h.disconnect()}}},[s,c]),null}),MA=(function(a){var s=a.step,i=a.refresh;return Lt(function(){if(s.mutationObservables){var r=function(p){var f=Mn(p),b;try{var y=function(){var v=b.value;if(!v.attributes)return 1;var _=s.mutationObservables.find(function($){return v.matches($)||v.querySelector($)!=null});_&&i()};for(f.s();!(b=f.n()).done;)y()}catch(w){f.e(w)}finally{f.f()}},l=new MutationObserver(function(h){var p=Mn(h),f;try{for(p.s();!(f=p.n()).done;){var b=f.value;b.addedNodes.length!==0&&r(b.addedNodes),b.removedNodes.length!==0&&r(b.removedNodes)}}catch(y){p.e(y)}finally{p.f()}}),c=document.documentElement||document.body,d={childList:!0,subtree:!0};return l.observe(c,d),function(){l.disconnect()}}},[s]),null});function LA(a){var s=a.children,i=Ko(null);return i.current===null&&(i.current=document.createElement("div"),i.current.setAttribute("id","___reactour")),Lt(function(){return document.body.appendChild(i.current),function(){document.body.removeChild(i.current)}},[i]),OS(s,i.current)}var PA={disableFocusLock:ke.bool,badgeContent:ke.func,highlightedMaskClassName:ke.string,children:ke.oneOfType([ke.node,ke.element]),className:ke.string,closeButtonAriaLabel:ke.string,closeWithMask:ke.bool,inViewThreshold:ke.number,isOpen:ke.bool.isRequired,lastStepNextButton:ke.node,maskClassName:ke.string,maskSpace:ke.number,nextButton:ke.node,onAfterOpen:ke.func,onBeforeClose:ke.func,onRequestClose:ke.func,prevButton:ke.node,scrollDuration:ke.number,scrollOffset:ke.number,showButtons:ke.bool,showCloseButton:ke.bool,showNavigation:ke.bool,showNavigationNumber:ke.bool,showNumber:ke.bool,startAt:ke.number,goToStep:ke.number,getCurrentStep:ke.func,nextStep:ke.func,prevStep:ke.func,steps:ke.arrayOf(ke.shape({selector:ke.string,content:ke.oneOfType([ke.node,ke.element,ke.func]).isRequired,position:ke.oneOfType([ke.arrayOf(ke.number),ke.oneOf(["top","right","bottom","left","center"])]),action:ke.func,style:ke.object,stepInteraction:ke.bool,navDotAriaLabel:ke.string,roundedStep:ke.bool})),update:ke.string,updateDelay:ke.number,disableInteraction:ke.bool,disableDotsNavigation:ke.bool,disableKeyboardNavigation:ke.oneOfType([ke.arrayOf(ke.oneOf(["esc","right","left"])),ke.bool]),rounded:ke.number,accentColor:ke.string,highlightedBorder:ke.shape({color:ke.string.isRequired,width:ke.number.isRequired})},BA={disableFocusLock:!1,showNavigation:!0,showNavigationNumber:!0,showButtons:!0,showCloseButton:!0,closeButtonAriaLabel:"Close",showNumber:!0,scrollDuration:1,maskSpace:10,updateDelay:1,disableInteraction:!1,rounded:0,accentColor:"#007aff",closeWithMask:!0},Sn={mask:{disableInteraction:"reactour__mask--disable-interaction"},helper:{base:"reactour__helper",isOpen:"reactour__helper--is-open"},dot:{base:"reactour__dot",active:"reactour__dot--is-active"}},Um=(function(a){function s(){var i;return hA(this,s),i=dA(this,s),vs(i,"unlockFocus",function(r){i.setState({focusUnlocked:!0},r())}),vs(i,"showStep",function(){if(!(!i.helper||!i.helper.current)){var r=i.props.steps,l=i.state,c=l.current,d=l.focusUnlocked;d&&i.setState({focusUnlocked:!1});var h=r[c],p=h.selector?document.querySelector(h.selector):null,f=function(_){h.action&&typeof h.action=="function"&&i.unlockFocus(function(){return h.action(_)})};if(h.observe){var b=document.querySelector(h.observe),y={attributes:!0,childList:!0,characterData:!0};i.setState(function(v){return v.observer&&setTimeout(function(){v.observer.disconnect()},0),{observer:new MutationObserver(function(_){_.forEach(function($){if($.type==="childList"&&$.addedNodes.length>0){var S=function(){return f($.addedNodes[0])};setTimeout(function(){return i.calculateNode($.addedNodes[0],h,S)},100)}else if($.type==="childList"&&$.removedNodes.length>0){var T=function(){return f(p)};i.calculateNode(p,h,T)}})})}},function(){return i.state.observer.observe(b,y)})}else i.state.observer&&(i.state.observer.disconnect(),i.setState({observer:null}));if(p){var w=function(){return f(p)};i.calculateNode(p,h,w)}else i.setState(fg(null,h,i.helper.current),f),h.selector&&console.warn("Doesn't find a DOM node '".concat(h.selector,"'. Please check the 'steps' Tour prop Array at position ").concat(c,"."))}}),vs(i,"calculateNode",function(r,l,c){var d=i.props,h=d.scrollDuration,p=d.inViewThreshold,f=d.scrollOffset,b=bC(r,l),y=Math.max(document.documentElement.clientWidth,window.innerWidth||0),w=Math.max(document.documentElement.clientHeight,window.innerHeight||0);if(CA(Ac(Ac({},b),{},{w:y,h:w,threshold:p})))i.setState(fg(r,l,i.helper.current),c);else{var v=qx(r),_=f||(b.height>w?-25:-(w/2)+b.height/2);Kx.to(r,{context:TA(v)?window:v,duration:h,offset:_,callback:function(S){i.setState(fg(S,l,i.helper.current),c)}})}}),vs(i,"recalculateNode",function(r){var l=document.querySelector(r.selector),c=function(h){r.action&&typeof r.action=="function"&&i.unlockFocus(function(){return r.action(h)})};i.calculateNode(l,r,function(){return c(l)})}),vs(i,"maskClickHandler",function(r){var l=i.props,c=l.closeWithMask,d=l.onRequestClose;c&&!r.target.classList.contains(Sn.mask.disableInteraction)&&d(r)}),vs(i,"nextStep",function(){var r=i.props,l=r.steps,c=r.getCurrentStep;i.setState(function(d){var h=d.current0?l.current-1:l.current;return typeof r=="function"&&r(c),{current:c}},i.showStep)}),vs(i,"gotoStep",function(r){var l=i.props,c=l.steps,d=l.getCurrentStep;i.setState(function(h){var p=c[r]?r:h.current;return typeof d=="function"&&d(p),{current:p}},i.showStep)}),vs(i,"keyDownHandler",function(r){var l=i.props,c=l.onRequestClose,d=l.nextStep,h=l.prevStep,p=l.disableKeyboardNavigation;if(r.stopPropagation(),p!==!0){var f,b,y;p&&(f=p.includes("esc"),b=p.includes("right"),y=p.includes("left")),r.keyCode===27&&!f&&(r.preventDefault(),c()),r.keyCode===39&&!b&&(r.preventDefault(),typeof d=="function"?d():i.nextStep()),r.keyCode===37&&!y&&(r.preventDefault(),typeof h=="function"?h():i.prevStep())}}),i.state={isOpen:!1,current:0,top:0,right:0,bottom:0,left:0,width:0,height:0,w:0,h:0,inDOM:!1,observer:null,focusUnlocked:!1},i.helper=MT(),i.helperElement=null,i.debouncedShowStep=m0(i.showStep,70),i}return mA(s,a),gA(s,[{key:"componentDidMount",value:function(){var r=this.props,l=r.isOpen,c=r.startAt;l&&this.open(c)}},{key:"UNSAFE_componentWillReceiveProps",value:function(r){var l=this.props,c=l.isOpen,d=l.update,h=l.updateDelay;!c&&r.isOpen?this.open(r.startAt):c&&!r.isOpen&&this.close(),c&&d!==r.update&&(r.steps[this.state.current]?setTimeout(this.showStep,h):this.props.onRequestClose()),c&&r.isOpen&&this.state.current!==r.goToStep&&this.gotoStep(r.goToStep)}},{key:"componentWillUnmount",value:function(){var r=this.props.isOpen;r&&this.close(),this.state.observer&&this.state.observer.disconnect()}},{key:"open",value:function(r){var l=this,c=this.props.onAfterOpen;this.setState(function(d){return{isOpen:!0,current:r!==void 0?r:d.current}},function(){setTimeout(l.showStep,1),l.helperElement=l.helper.current,l.props.disableFocusLock||l.helper.current.focus(),c&&c(l.helperElement)}),window.addEventListener("resize",this.debouncedShowStep,!1),window.addEventListener("keydown",this.keyDownHandler,!1)}},{key:"close",value:function(){this.setState(function(r){return r.observer&&r.observer.disconnect(),{isOpen:!1,observer:null}},this.onBeforeClose),window.removeEventListener("resize",this.debouncedShowStep),window.removeEventListener("keydown",this.keyDownHandler)}},{key:"onBeforeClose",value:function(){var r=this.props.onBeforeClose;r&&r(this.helperElement)}},{key:"render",value:function(){var r=this,l=this.props,c=l.className,d=l.steps,h=l.maskClassName,p=l.showButtons,f=l.showCloseButton,b=l.closeButtonAriaLabel,y=l.showNavigation,w=l.showNavigationNumber,v=l.showNumber,_=l.onRequestClose,$=l.maskSpace,S=l.lastStepNextButton,T=l.nextButton,E=l.prevButton,D=l.badgeContent,M=l.highlightedMaskClassName,P=l.disableInteraction,W=l.disableDotsNavigation,G=l.nextStep,z=l.prevStep,Z=l.rounded,he=l.accentColor,Ce=l.CustomHelper,O=l.disableFocusLock,K=l.highlightedBorder,C=this.state,Q=C.isOpen,ve=C.current,ce=C.inDOM,ne=C.top,me=C.right,re=C.bottom,B=C.left,N=C.width,te=C.height,q=C.w,se=C.h,F=C.helperWidth,Te=C.helperHeight,ae=C.helperPosition;return Q?_e.createElement(LA,null,_e.createElement(_A,null),_e.createElement(NA,{step:d[ve],refresh:function(){return r.recalculateNode(d[ve])}}),_e.createElement(MA,{step:d[ve],refresh:function(){return r.recalculateNode(d[ve])}}),_e.createElement(vC,{onClick:this.maskClickHandler,forwardRef:function(Ie){return r.mask=Ie},windowWidth:q,windowHeight:se,targetWidth:N,targetHeight:te,targetTop:ne,targetLeft:B,padding:$,rounded:Z,roundedStep:d[ve].roundedStep,className:h,disableInteraction:d[ve].stepInteraction===!1||P?!d[ve].stepInteraction:P,disableInteractionClassName:"".concat(Sn.mask.disableInteraction," ").concat(M),highlightedBorder:K}),_e.createElement(Jk,{disabled:O,autoFocus:!1},_e.createElement(IA,{ref:this.helper,targetHeight:te,targetWidth:N,targetTop:ne,targetRight:me,targetBottom:re,targetLeft:B,windowWidth:q,windowHeight:se,helperWidth:F,helperHeight:Te,helperPosition:ae,padding:$,tabIndex:-1,current:ve,style:d[ve].style?d[ve].style:{},rounded:Z,className:A_(Sn.helper.base,c,vs({},Sn.helper.isOpen,Q)),accentColor:he,defaultStyles:!Ce,role:"dialog"},Ce?_e.createElement(Ce,{current:ve,totalSteps:d.length,gotoStep:this.gotoStep,close:_,content:d[ve]&&(typeof d[ve].content=="function"?d[ve].content({close:_,goTo:this.gotoStep,inDOM:ce,step:ve+1}):d[ve].content)},this.props.children):_e.createElement(_e.Fragment,null,this.props.children,d[ve]&&(typeof d[ve].content=="function"?d[ve].content({close:_,goTo:this.gotoStep,inDOM:ce,step:ve+1}):d[ve].content),v&&_e.createElement(xA,{"data-tour-elem":"badge",accentColor:he},typeof D=="function"?D(ve+1,d.length):ve+1),(p||y)&&_e.createElement(DA,{"data-tour-elem":"controls"},p&&_e.createElement(tw,{onClick:typeof z=="function"?z:this.prevStep,disabled:ve===0,label:E||null}),y&&_e.createElement(AA,{"data-tour-elem":"navigation"},d.map(function(we,Ie){return _e.createElement(RA,{key:"".concat(we.selector?we.selector:"undef","_").concat(Ie),onClick:function(){return r.gotoStep(Ie)},current:ve,index:Ie,accentColor:he,disabled:ve===Ie||W,showNumber:w,"data-tour-elem":"dot",className:A_(Sn.dot.base,vs({},Sn.dot.active,ve===Ie)),"aria-label":we.navDotAriaLabel})})),p&&_e.createElement(tw,{onClick:ve===d.length-1?S?_:function(){}:typeof G=="function"?G:this.nextStep,disabled:!S&&ve===d.length-1,inverted:!0,label:S&&ve===d.length-1?S:T||null})),f&&_e.createElement(kA,{onClick:_,className:"reactour__close",ariaLabel:b}))))):null}}])})(xw),fg=function(s,i,r){if(r){var l=Math.max(document.documentElement.clientWidth,window.innerWidth||0),c=Math.max(document.documentElement.clientHeight,window.innerHeight||0),d=_c(r),h=d.width,p=d.height,f={top:c+10,right:l/2+9,bottom:c/2+9,left:l/2-h/2,width:0,height:0,w:l,h:c,helperPosition:"center"};return s&&(f=bC(s,i)),function(){return Ac(Ac({w:l,h:c,helperWidth:h,helperHeight:p,helperPosition:i.position},f),{},{inDOM:!!s})}}};Um.propTypes=PA;Um.defaultProps=BA;const jA=""+new URL("blockly2js-B3Jxf2e-.svg",import.meta.url).href,FA=""+new URL("rules2js-DnYyR8mI.svg",import.meta.url).href,Ns={selectTriggers:0,addScheduleByDoubleClick:1,openTagsMenu:2,selectIntervalTag:3,selectActions:4,addActionPrintText:5,showJavascript:6,switchBackToRules:7,saveTheScript:8},zA=[{selector:".blocks-triggers",content:"Select triggers"},{selector:".block-TriggerScheduleBlock",content:"Double click to add the block"},{selector:".tag-card",content:"Open drop down menu"},{selector:".tag-card-interval",content:"Select interval"},{selector:".blocks-actions",content:"Select action blocks"},{selector:".block-ActionPrintText",content:"Double click to add the block"},{selector:".button-js-code",content:"Check the script"},{selector:".button-js-code",content:"Switch back to rules"},{selector:".button-save",content:"Save the script"}],$g=187,lc={root:{left:0,top:0,width:"100%",height:"100%",position:"fixed",background:"rgba(0, 0, 0, .3)",zIndex:2e4},connecting:{left:"40%",top:"40%",width:"20%",height:"20%",position:"absolute"},spinner:{animation:"admin-connecting-rotator 1.4s linear infinite"},path:{strokeDasharray:187,strokeDashoffset:0,transformOrigin:"center",animation:"admin-connecting-dash 1.4s ease-in-out infinite, $colors 5.6s ease-in-out infinite"}};function En(){return m.jsxs("div",{style:lc.root,children:[m.jsx("style",{children:` ' @keyframes admin-connecting-colors { 0% { stroke: #4285F4; @@ -266,20 +266,20 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho transform: rotate(270deg); } } -`}),m.jsx("div",{style:lc.connecting,children:m.jsx("svg",{style:lc.spinner,width:"100%",height:"100%",viewBox:"0 0 66 66",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("circle",{style:lc.path,fill:"none",strokeWidth:"6",strokeLinecap:"round",cx:"33",cy:"33",r:"30"})})})]})}const UA=_e.lazy(()=>jn(()=>Promise.resolve().then(()=>vO),void 0,import.meta.url)),HA=_e.lazy(()=>jn(()=>import("./index-DWalwvIj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url)),WA=_e.lazy(()=>jn(()=>import("./index-C9EIOjDT.js"),__vite__mapDeps([14,1,2,3,4,6,7,5,15,8,9,10,11,12]),import.meta.url)),GA=_e.lazy(()=>jn(()=>import("./ScriptEditorVanillaMonaco-DSYvOslZ.js"),__vite__mapDeps([15,1,2,3,4,6,7,5]),import.meta.url)),VA=_e.lazy(()=>jn(()=>import("./ScriptEditor-C-fO5h68.js"),__vite__mapDeps([16,1,2,3,4,6,5,15,7,17]),import.meta.url)),KA=_e.lazy(()=>jn(()=>import("./OpenAiDialog-CEA56Rl4.js"),__vite__mapDeps([18,1,2,3,4,6,5,9,19,15,7,8,10,11,12]),import.meta.url)),cw={Blockly:gk,"Javascript/js":Tc,Rules:fk,def:Tc,"TypeScript/ts":mk},YA=48,uw="#02a102",bg="#70aae9",JA=Tw[400],qA=Sw[400],je={toolbar:a=>({minHeight:38,boxShadow:"0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12)",backgroundColor:a.palette.mode==="dark"?"#1e1e1e":"#E2E2E2"}),toolbarButtons:{padding:4,marginLeft:4},toolbarButtonsDisabled:{filter:"grayscale(100%)",opacity:.5},editorDiv:a=>({height:`calc(100% - ${(parseInt(a.toolbar.height,10)||48)+38+10}px)`,width:"100%",overflow:"hidden",position:"relative"}),textButton:{marginRight:10,minHeight:24,padding:"6px 16px",height:32},saveButton:{background:"#ff9900"},tabIcon:{width:24,height:24,verticalAlign:"middle",marginBottom:2,marginRight:2,borderRadius:3},hintIcon:{padding:"0 8px 0 8px"},hintButton:{marginTop:8,marginLeft:20},tabMenuButton:{position:"absolute",top:0,right:0},tabChanged:a=>({color:a.palette.secondary.main}),tabText:{maxWidth:130,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",display:"inline-block",verticalAlign:"middle"},tabChangedIcon:{color:"#FF0000",fontSize:16,marginLeft:5},closeButton:{marginLeft:5},notRunning:{color:"#ffbc00",marginRight:8,marginLeft:8},tabButton:{minHeight:48},tabButtonWrapper:{display:"inline-block"},menuIcon:{width:18,height:18,borderRadius:2,marginRight:5}};class On extends _e.Component{getSelect=null;changedMirror={};cron={initValue:null,callback:null};scriptDialog={initValue:null,callback:null,args:null,isReturn:!1};objects;scripts;selectId={initValue:null,callback:null};confirmCallback=null;constructor(s){var c,d;super(s);let i=window.localStorage.getItem("Editor.selected")||"";const r=window.localStorage.getItem("Editor.editing")||"[]";let l;try{l=JSON.parse(r)}catch{l=[]}i&&!l.includes(i)&&l.push(i),i&&!this.props.password&&((d=(c=this.props.objects[i])==null?void 0:c.native)!=null&&d.protected)&&(i=l.find(h=>{var p,f;return!((f=(p=this.props.objects[h])==null?void 0:p.native)!=null&&f.protected)})||""),!i&&l.length&&(this.props.password?i=l[0]:i=l.find(h=>{var p,f;return!((f=(p=this.props.objects[h])==null?void 0:p.native)!=null&&f.protected)})||""),this.state={askAboutDebug:!1,astroEvents:null,blockly:null,changed:{},cmdToBlockly:"",cmdToRules:"",confirm:"",debugEnabled:!1,editing:l,insert:"",instancesLoaded:!1,isTourOpen:window.localStorage.getItem("tour")!=="true",menuDebugAnchorEl:null,menuOpened:!!this.props.menuOpened,menuTabsOpened:!1,openAiDialog:!1,triggerPrettier:1,rules:null,runningInstances:this.props.runningInstances||{},searchText:"",selected:i,showAdapterDebug:!1,showAstro:!1,showCompiledCode:!1,showCron:!1,showDebugMenu:!1,showScript:!1,showSelectId:!1,themeType:this.props.themeType,toast:"",tourStep:Ns.selectTriggers,verboseEnabled:!1,visible:s.visible},this.setChangedInAdmin(),window.systemLang=x.I18n.getLanguage(),window.main={objects:{},getObject:(h,p)=>this.props.socket.getObject(h).then(f=>p==null?void 0:p(null,f)).catch(f=>p==null?void 0:p(f)),instances:[],selectIdDialog:(h,p,f)=>{typeof p=="function"&&(f=p,p=null),this.selectId.callback=f,this.selectId.initValue=h,this.selectId.type=p,this.setState({showSelectId:!0})},cronDialog:(h,p)=>{this.cron.callback=p,this.cron.initValue=h,this.setState({showCron:!0})},showScriptDialog:(h,p,f,b)=>{this.scriptDialog.callback=b,this.scriptDialog.initValue=h,this.scriptDialog.args=p,this.scriptDialog.isReturn=f||!1,this.setState({showScript:!0})}},this.objects=s.objects,this.scripts={},this.getAllAdapterInstances().then(()=>{this.props.onSelectedChange&&this.state.selected&&setTimeout(()=>this.props.onSelectedChange(this.state.selected,this.state.editing),100)})}async getAllAdapterInstances(){const s=await this.props.socket.getAdapterInstances(!0),i={},r=s.map(l=>(i[l._id]=l,l._id));window.main.objects=i,window.main.instances=r,this.setState({instancesLoaded:!0})}static onInstanceChanged(s,i){if(s)if(!i&&window.main.instances.includes(s)){delete window.main.objects[s];const r=window.main.instances.indexOf(s);window.main.instances.splice(r,1)}else(i==null?void 0:i.type)==="instance"&&(window.main.instances.includes(s)||(window.main.instances.push(s),window.main.instances.sort()),window.main.objects[s]=i)}setChangedInAdmin(){const s=Object.keys(this.state.changed).find(i=>this.state.changed[i]);Object.keys(this.state.changed).forEach(i=>{this.changedMirror[i]=this.state.changed[i]}),Object.keys(this.changedMirror).forEach(i=>{this.state.changed[i]===void 0&&delete this.changedMirror[i]}),this.props.onChangedChanged(this.changedMirror),typeof window.parent<"u"&&window.parent&&(window.parent.configNotSaved=!!s)}componentDidMount(){window.addEventListener("beforeunload",this.onBrowserClose,!1),this.props.socket.subscribeObject("system.adapter.*",On.onInstanceChanged)}componentWillUnmount(){window.removeEventListener("beforeunload",this.onBrowserClose),this.props.socket.unsubscribeObject("system.adapter.*",On.onInstanceChanged)}onBrowserClose=s=>{const i=Object.keys(this.scripts).find(r=>JSON.stringify(this.scripts[r])!==JSON.stringify(this.getScriptFromObject(r)));if(i){console.log(`Script ${JSON.stringify(this.scripts[i])}`);const r=x.I18n.t("Configuration not saved.");return s=s||window.event,s&&(s.returnValue=r),r}};removeNonExistingScripts(s,i){s=s||this.props,i=i||{};let r=!1;if(this.state.editing&&this.state.editing.find(c=>s&&!s.objects[c])){const c=[...this.state.editing];for(let d=c.length-1;d>=0;d--)this.objects[c[d]]||(r=!0,c.splice(d,1));r&&(i.editing=c),this.state.selected&&!this.objects[this.state.selected]&&(r=!0,i.selected=c[0]||"",i.selected&&this.scripts[i.selected]&&(this.state.blockly!==(this.scripts[i.selected].engineType==="Blockly")&&(i.blockly=this.scripts[i.selected].engineType==="Blockly",r=!0),this.state.rules!==(this.scripts[i.selected].engineType==="Rules")&&(i.rules=this.scripts[i.selected].engineType==="Rules",r=!0),this.state.verboseEnabled!==this.scripts[i.selected].verbose&&(i.verboseEnabled=this.scripts[i.selected].verbose,r=!0),this.state.debugEnabled!==this.scripts[i.selected].debug&&(i.debugEnabled=this.scripts[i.selected].debug,r=!0)))}return r}UNSAFE_componentWillReceiveProps(s){var l,c,d;const i={};let r=!1;if(JSON.stringify(s.runningInstances)!==JSON.stringify(this.state.runningInstances)&&(r=!0,i.runningInstances=s.runningInstances),this.state.menuOpened!==s.menuOpened&&(i.menuOpened=s.menuOpened,r=!0),this.state.themeType!==s.themeType&&(i.themeType=s.themeType,r=!0),this.removeNonExistingScripts(s,i)&&(r=!0),this.state.searchText!==s.searchText&&(i.searchText=s.searchText,r=!0),this.objects!==s.objects){this.objects=s.objects,window.main.objects=s.objects,Object.keys(this.scripts).forEach(p=>{const f=this.scripts[p].source;this.scripts[p]=JSON.parse(JSON.stringify(this.objects[p].common)),this.scripts[p].source=f}),this.state.selected&&this.objects[this.state.selected]&&(this.scripts[this.state.selected]||=JSON.parse(JSON.stringify(this.objects[this.state.selected].common)),this.state.blockly!==(this.scripts[this.state.selected].engineType==="Blockly")&&(i.blockly=this.scripts[this.state.selected].engineType==="Blockly",r=!0),this.state.rules!==(this.scripts[this.state.selected].engineType==="Rules")&&(i.rules=this.scripts[this.state.selected].engineType==="Rules",r=!0),this.state.verboseEnabled!==this.scripts[this.state.selected].verbose&&(i.verboseEnabled=this.scripts[this.state.selected].verbose,r=!0),this.state.debugEnabled!==this.scripts[this.state.selected].debug&&(i.debugEnabled=this.scripts[this.state.selected].debug,r=!0));const h=[...this.state.editing];for(let p=h.length-1;p>=0;p--)this.objects[h[p]]||(r=!0,h.splice(p,1),this.state.changed[h[p]]!==void 0&&(i.changed||={...this.state.changed},i.changed&&delete i.changed[h[p]]));this.state.selected&&!this.objects[this.state.selected]&&(i.selected=h[0]||""),r&&(i.editing=h)}else for(const h in this.scripts)if(Object.prototype.hasOwnProperty.call(this.scripts,h)){if((l=this.objects[h])!=null&&l.common){if(this.objects[h].type==="script"){const p=this.scripts[h].source,f=JSON.parse(JSON.stringify(this.scripts[h]));f.source=this.objects[h].common.source,JSON.stringify(f)!==JSON.stringify(this.objects[h].common)&&(this.scripts[h]=JSON.parse(JSON.stringify(this.objects[h].common)),this.scripts[h].source=p),p!==this.objects[h].common.source?this.state.changed[h]?(d=this.objects[h].from)!=null&&d.startsWith("system.adapter.javascript.")&&(this.objects[h].from="system.adapter.admin.0",this.setState({toast:x.I18n.t("Script %s was modified on disk.",h.split(".").pop())})):this.props.password&&((c=this.objects[h].native)!=null&&c.protected)?this.scripts[h].source=Vg(this.props.password,this.objects[h].common.source):this.scripts[h].source=this.objects[h].common.source:this.state.changed[h]&&(i.changed||={...this.state.changed},i.changed&&(i.changed[h]=!1),r=!0)}}else if(this.scripts[h]&&(delete this.scripts[h],this.state.selected===h)){if(this.state.editing.indexOf(h)!==-1){const p=[...this.state.editing],f=p.indexOf(h);f!==-1&&(p.splice(f,1),i.editing=p,r=!0)}i.selected=this.state.editing[0]||"",r=!0}}if(s.selected&&this.state.selected!==s.selected){const h=this.getScriptFromObject(s.selected);this.scripts[s.selected]||=h;const p=h&&JSON.stringify(this.scripts[s.selected])!==JSON.stringify(h),f=[...this.state.editing];s.selected&&!f.includes(s.selected)&&(f.push(s.selected),this.props.onSelectedChange(s.selected,f),window.localStorage.setItem("Editor.editing",JSON.stringify(f))),r=!0,i.changed||={...this.state.changed},i.changed[s.selected]=!!p,i.editing=f,i.selected=s.selected,i.blockly=this.scripts[s.selected].engineType==="Blockly",i.rules=this.scripts[s.selected].engineType==="Rules",i.verboseEnabled=this.scripts[s.selected].verbose,i.debugEnabled=this.scripts[s.selected].debug,i.showCompiledCode=!1}this.state.visible!==s.visible&&(r=!0,i.visible=s.visible),r&&this.setState(i,()=>this.setChangedInAdmin())}onRestart(){var s,i;(i=(s=this.props).onRestart)==null||i.call(s,this.state.selected)}onStartStop(){var i,r,l;const s=JSON.parse(JSON.stringify(this.scripts[this.state.selected]));s.enabled=!s.enabled,this.props.password&&((i=this.props.objects[this.state.selected].native)!=null&&i.protected)&&(s.source=vc(this.props.password,s.source)),(l=(r=this.props).onChange)==null||l.call(r,this.state.selected,s)}onSave(){if(this.state.isTourOpen&&this.state.tourStep===Ns.saveTheScript&&(this.setState({isTourOpen:!1}),window.localStorage.setItem("tour","true")),this.state.changed[this.state.selected]){const s={...this.state.changed};s[this.state.selected]=!1,this.setState({changed:s},()=>{var r,l,c;this.setChangedInAdmin();const i=JSON.parse(JSON.stringify(this.scripts[this.state.selected]));this.props.password&&((r=this.props.objects[this.state.selected].native)!=null&&r.protected)&&(i.source=vc(this.props.password,i.source)),(c=(l=this.props).onChange)==null||c.call(l,this.state.selected,i)})}}onSaveAll(){const s={...this.state.changed};Object.keys(s).forEach(i=>{var r,l,c;if(s[i]){s[i]=!1;const d=JSON.parse(JSON.stringify(this.scripts[i]));this.props.password&&((r=this.props.objects[i].native)!=null&&r.protected)&&(d.source=vc(this.props.password,d.source)),(c=(l=this.props).onChange)==null||c.call(l,i,d)}}),this.setState({changed:s},()=>this.setChangedInAdmin())}onCancel(){this.scripts[this.state.selected]=this.getScriptFromObject(this.state.selected);const s={...this.state.changed};s[this.state.selected]=!1,this.setState({changed:s},()=>this.setChangedInAdmin())}onRegisterSelect(s){this.getSelect=s}onConvertBlockly2JS(){this.showConfirmDialog(x.I18n.t("It will not be possible to revert this operation."),s=>{if(s){this.scripts[this.state.selected].engineType="Javascript/js";const r=this.scripts[this.state.selected].source.split(` +`}),m.jsx("div",{style:lc.connecting,children:m.jsx("svg",{style:lc.spinner,width:"100%",height:"100%",viewBox:"0 0 66 66",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("circle",{style:lc.path,fill:"none",strokeWidth:"6",strokeLinecap:"round",cx:"33",cy:"33",r:"30"})})})]})}const UA=_e.lazy(()=>Fn(()=>Promise.resolve().then(()=>vR),void 0,import.meta.url)),HA=_e.lazy(()=>Fn(()=>import("./index-B0ByV4SK.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url)),WA=_e.lazy(()=>Fn(()=>import("./index-ns4mNOlq.js"),__vite__mapDeps([14,1,2,3,4,6,7,5,15,8,9,10,11,12]),import.meta.url)),GA=_e.lazy(()=>Fn(()=>import("./ScriptEditorVanillaMonaco-DSYvOslZ.js"),__vite__mapDeps([15,1,2,3,4,6,7,5]),import.meta.url)),VA=_e.lazy(()=>Fn(()=>import("./ScriptEditor-C-fO5h68.js"),__vite__mapDeps([16,1,2,3,4,6,5,15,7,17]),import.meta.url)),KA=_e.lazy(()=>Fn(()=>import("./OpenAiDialog-CANTLp4d.js"),__vite__mapDeps([18,1,2,3,4,6,5,9,19,15,7,8,10,11,12]),import.meta.url)),cw={Blockly:gk,"Javascript/js":Tc,Rules:fk,def:Tc,"TypeScript/ts":mk},YA=48,uw="#02a102",bg="#70aae9",JA=Tw[400],qA=Sw[400],Fe={toolbar:a=>({minHeight:38,boxShadow:"0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12)",backgroundColor:a.palette.mode==="dark"?"#1e1e1e":"#E2E2E2"}),toolbarButtons:{padding:4,marginLeft:4},toolbarButtonsDisabled:{filter:"grayscale(100%)",opacity:.5},editorDiv:a=>({height:`calc(100% - ${(parseInt(a.toolbar.height,10)||48)+38+10}px)`,width:"100%",overflow:"hidden",position:"relative"}),textButton:{marginRight:10,minHeight:24,padding:"6px 16px",height:32},saveButton:{background:"#ff9900"},tabIcon:{width:24,height:24,verticalAlign:"middle",marginBottom:2,marginRight:2,borderRadius:3},hintIcon:{padding:"0 8px 0 8px"},hintButton:{marginTop:8,marginLeft:20},tabMenuButton:{position:"absolute",top:0,right:0},tabChanged:a=>({color:a.palette.secondary.main}),tabText:{maxWidth:130,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",display:"inline-block",verticalAlign:"middle"},tabChangedIcon:{color:"#FF0000",fontSize:16,marginLeft:5},closeButton:{marginLeft:5},notRunning:{color:"#ffbc00",marginRight:8,marginLeft:8},tabButton:{minHeight:48},tabButtonWrapper:{display:"inline-block"},menuIcon:{width:18,height:18,borderRadius:2,marginRight:5}};class Rn extends _e.Component{getSelect=null;changedMirror={};cron={initValue:null,callback:null};scriptDialog={initValue:null,callback:null,args:null,isReturn:!1};objects;scripts;selectId={initValue:null,callback:null};confirmCallback=null;lastKnownTs={};constructor(s){var c,d;super(s);let i=window.localStorage.getItem("Editor.selected")||"";const r=window.localStorage.getItem("Editor.editing")||"[]";let l;try{l=JSON.parse(r)}catch{l=[]}i&&!l.includes(i)&&l.push(i),i&&!this.props.password&&((d=(c=this.props.objects[i])==null?void 0:c.native)!=null&&d.protected)&&(i=l.find(h=>{var p,f;return!((f=(p=this.props.objects[h])==null?void 0:p.native)!=null&&f.protected)})||""),!i&&l.length&&(this.props.password?i=l[0]:i=l.find(h=>{var p,f;return!((f=(p=this.props.objects[h])==null?void 0:p.native)!=null&&f.protected)})||""),this.state={askAboutDebug:!1,astroEvents:null,blockly:null,changed:{},cmdToBlockly:"",cmdToRules:"",confirm:"",debugEnabled:!1,editing:l,insert:"",instancesLoaded:!1,isTourOpen:window.localStorage.getItem("tour")!=="true",menuDebugAnchorEl:null,menuOpened:!!this.props.menuOpened,menuTabsOpened:!1,openAiDialog:!1,triggerPrettier:1,scriptConflict:"",rules:null,runningInstances:this.props.runningInstances||{},searchText:"",selected:i,showAdapterDebug:!1,showAstro:!1,showCompiledCode:!1,showCron:!1,showDebugMenu:!1,showScript:!1,showSelectId:!1,themeType:this.props.themeType,toast:"",tourStep:Ns.selectTriggers,verboseEnabled:!1,visible:s.visible},this.setChangedInAdmin(),window.systemLang=x.I18n.getLanguage(),window.main={objects:{},getObject:(h,p)=>this.props.socket.getObject(h).then(f=>p==null?void 0:p(null,f)).catch(f=>p==null?void 0:p(f)),instances:[],selectIdDialog:(h,p,f)=>{typeof p=="function"&&(f=p,p=null),this.selectId.callback=f,this.selectId.initValue=h,this.selectId.type=p,this.setState({showSelectId:!0})},cronDialog:(h,p)=>{this.cron.callback=p,this.cron.initValue=h,this.setState({showCron:!0})},showScriptDialog:(h,p,f,b)=>{this.scriptDialog.callback=b,this.scriptDialog.initValue=h,this.scriptDialog.args=p,this.scriptDialog.isReturn=f||!1,this.setState({showScript:!0})}},this.objects=s.objects,this.scripts={},this.getAllAdapterInstances().then(()=>{this.props.onSelectedChange&&this.state.selected&&setTimeout(()=>this.props.onSelectedChange(this.state.selected,this.state.editing),100)})}async getAllAdapterInstances(){const s=await this.props.socket.getAdapterInstances(!0),i={},r=s.map(l=>(i[l._id]=l,l._id));window.main.objects=i,window.main.instances=r,this.setState({instancesLoaded:!0})}static onInstanceChanged(s,i){if(s)if(!i&&window.main.instances.includes(s)){delete window.main.objects[s];const r=window.main.instances.indexOf(s);window.main.instances.splice(r,1)}else(i==null?void 0:i.type)==="instance"&&(window.main.instances.includes(s)||(window.main.instances.push(s),window.main.instances.sort()),window.main.objects[s]=i)}setChangedInAdmin(){const s=Object.keys(this.state.changed).find(i=>this.state.changed[i]);Object.keys(this.state.changed).forEach(i=>{this.changedMirror[i]=this.state.changed[i]}),Object.keys(this.changedMirror).forEach(i=>{this.state.changed[i]===void 0&&delete this.changedMirror[i]}),this.props.onChangedChanged(this.changedMirror),typeof window.parent<"u"&&window.parent&&(window.parent.configNotSaved=!!s)}componentDidMount(){window.addEventListener("beforeunload",this.onBrowserClose,!1),this.props.socket.subscribeObject("system.adapter.*",Rn.onInstanceChanged)}componentWillUnmount(){window.removeEventListener("beforeunload",this.onBrowserClose),this.props.socket.unsubscribeObject("system.adapter.*",Rn.onInstanceChanged)}componentDidUpdate(s){if(s.scriptsHash!==this.props.scriptsHash)for(const i of this.state.editing){const r=this.props.objects[i];if(!r||r.type!=="script")continue;const l=r.ts||0,c=this.lastKnownTs[i];c!==void 0&&l!==c&&(this.state.changed[i]?this.state.scriptConflict||this.setState({scriptConflict:i}):(this.scripts[i]=this.getScriptFromObject(i),this.lastKnownTs[i]=l))}}onBrowserClose=s=>{const i=Object.keys(this.scripts).find(r=>JSON.stringify(this.scripts[r])!==JSON.stringify(this.getScriptFromObject(r)));if(i){console.log(`Script ${JSON.stringify(this.scripts[i])}`);const r=x.I18n.t("Configuration not saved.");return s=s||window.event,s&&(s.returnValue=r),r}};removeNonExistingScripts(s,i){s=s||this.props,i=i||{};let r=!1;if(this.state.editing&&this.state.editing.find(c=>s&&!s.objects[c])){const c=[...this.state.editing];for(let d=c.length-1;d>=0;d--)this.objects[c[d]]||(r=!0,c.splice(d,1));r&&(i.editing=c),this.state.selected&&!this.objects[this.state.selected]&&(r=!0,i.selected=c[0]||"",i.selected&&this.scripts[i.selected]&&(this.state.blockly!==(this.scripts[i.selected].engineType==="Blockly")&&(i.blockly=this.scripts[i.selected].engineType==="Blockly",r=!0),this.state.rules!==(this.scripts[i.selected].engineType==="Rules")&&(i.rules=this.scripts[i.selected].engineType==="Rules",r=!0),this.state.verboseEnabled!==this.scripts[i.selected].verbose&&(i.verboseEnabled=this.scripts[i.selected].verbose,r=!0),this.state.debugEnabled!==this.scripts[i.selected].debug&&(i.debugEnabled=this.scripts[i.selected].debug,r=!0)))}return r}UNSAFE_componentWillReceiveProps(s){var l,c,d;const i={};let r=!1;if(JSON.stringify(s.runningInstances)!==JSON.stringify(this.state.runningInstances)&&(r=!0,i.runningInstances=s.runningInstances),this.state.menuOpened!==s.menuOpened&&(i.menuOpened=s.menuOpened,r=!0),this.state.themeType!==s.themeType&&(i.themeType=s.themeType,r=!0),this.removeNonExistingScripts(s,i)&&(r=!0),this.state.searchText!==s.searchText&&(i.searchText=s.searchText,r=!0),this.objects!==s.objects){this.objects=s.objects,window.main.objects=s.objects,Object.keys(this.scripts).forEach(p=>{const f=this.scripts[p].source;this.scripts[p]=JSON.parse(JSON.stringify(this.objects[p].common)),this.scripts[p].source=f}),this.state.selected&&this.objects[this.state.selected]&&(this.scripts[this.state.selected]||=JSON.parse(JSON.stringify(this.objects[this.state.selected].common)),this.state.blockly!==(this.scripts[this.state.selected].engineType==="Blockly")&&(i.blockly=this.scripts[this.state.selected].engineType==="Blockly",r=!0),this.state.rules!==(this.scripts[this.state.selected].engineType==="Rules")&&(i.rules=this.scripts[this.state.selected].engineType==="Rules",r=!0),this.state.verboseEnabled!==this.scripts[this.state.selected].verbose&&(i.verboseEnabled=this.scripts[this.state.selected].verbose,r=!0),this.state.debugEnabled!==this.scripts[this.state.selected].debug&&(i.debugEnabled=this.scripts[this.state.selected].debug,r=!0));const h=[...this.state.editing];for(let p=h.length-1;p>=0;p--)this.objects[h[p]]||(r=!0,h.splice(p,1),this.state.changed[h[p]]!==void 0&&(i.changed||={...this.state.changed},i.changed&&delete i.changed[h[p]]));this.state.selected&&!this.objects[this.state.selected]&&(i.selected=h[0]||""),r&&(i.editing=h)}else for(const h in this.scripts)if(Object.prototype.hasOwnProperty.call(this.scripts,h)){if((l=this.objects[h])!=null&&l.common){if(this.objects[h].type==="script"){const p=this.scripts[h].source,f=JSON.parse(JSON.stringify(this.scripts[h]));f.source=this.objects[h].common.source,JSON.stringify(f)!==JSON.stringify(this.objects[h].common)&&(this.scripts[h]=JSON.parse(JSON.stringify(this.objects[h].common)),this.scripts[h].source=p),p!==this.objects[h].common.source?this.state.changed[h]?(d=this.objects[h].from)!=null&&d.startsWith("system.adapter.javascript.")&&(this.objects[h].from="system.adapter.admin.0",this.setState({toast:x.I18n.t("Script %s was modified on disk.",h.split(".").pop())})):this.props.password&&((c=this.objects[h].native)!=null&&c.protected)?this.scripts[h].source=Vg(this.props.password,this.objects[h].common.source):this.scripts[h].source=this.objects[h].common.source:this.state.changed[h]&&(i.changed||={...this.state.changed},i.changed&&(i.changed[h]=!1),r=!0)}}else if(this.scripts[h]&&(delete this.scripts[h],this.state.selected===h)){if(this.state.editing.indexOf(h)!==-1){const p=[...this.state.editing],f=p.indexOf(h);f!==-1&&(p.splice(f,1),i.editing=p,r=!0)}i.selected=this.state.editing[0]||"",r=!0}}if(s.selected&&this.state.selected!==s.selected){const h=this.getScriptFromObject(s.selected);this.scripts[s.selected]||=h;const p=h&&JSON.stringify(this.scripts[s.selected])!==JSON.stringify(h),f=[...this.state.editing];s.selected&&!f.includes(s.selected)&&(f.push(s.selected),this.props.onSelectedChange(s.selected,f),window.localStorage.setItem("Editor.editing",JSON.stringify(f))),r=!0,i.changed||={...this.state.changed},i.changed[s.selected]=!!p,i.editing=f,i.selected=s.selected,i.blockly=this.scripts[s.selected].engineType==="Blockly",i.rules=this.scripts[s.selected].engineType==="Rules",i.verboseEnabled=this.scripts[s.selected].verbose,i.debugEnabled=this.scripts[s.selected].debug,i.showCompiledCode=!1}this.state.visible!==s.visible&&(r=!0,i.visible=s.visible),r&&this.setState(i,()=>this.setChangedInAdmin())}onRestart(){var s,i;(i=(s=this.props).onRestart)==null||i.call(s,this.state.selected)}onStartStop(){var i,r,l;const s=JSON.parse(JSON.stringify(this.scripts[this.state.selected]));s.enabled=!s.enabled,this.props.password&&((i=this.props.objects[this.state.selected].native)!=null&&i.protected)&&(s.source=vc(this.props.password,s.source)),(l=(r=this.props).onChange)==null||l.call(r,this.state.selected,s)}onSave(){if(this.state.isTourOpen&&this.state.tourStep===Ns.saveTheScript&&(this.setState({isTourOpen:!1}),window.localStorage.setItem("tour","true")),this.state.changed[this.state.selected]){const s={...this.state.changed};s[this.state.selected]=!1,this.setState({changed:s},()=>{var r,l,c;this.setChangedInAdmin();const i=JSON.parse(JSON.stringify(this.scripts[this.state.selected]));this.props.password&&((r=this.props.objects[this.state.selected].native)!=null&&r.protected)&&(i.source=vc(this.props.password,i.source)),(c=(l=this.props).onChange)==null||c.call(l,this.state.selected,i)})}}onSaveAll(){const s={...this.state.changed};Object.keys(s).forEach(i=>{var r,l,c;if(s[i]){s[i]=!1;const d=JSON.parse(JSON.stringify(this.scripts[i]));this.props.password&&((r=this.props.objects[i].native)!=null&&r.protected)&&(d.source=vc(this.props.password,d.source)),(c=(l=this.props).onChange)==null||c.call(l,i,d)}}),this.setState({changed:s},()=>this.setChangedInAdmin())}onCancel(){var i;this.scripts[this.state.selected]=this.getScriptFromObject(this.state.selected),this.lastKnownTs[this.state.selected]=((i=this.props.objects[this.state.selected])==null?void 0:i.ts)||0;const s={...this.state.changed};s[this.state.selected]=!1,this.setState({changed:s},()=>this.setChangedInAdmin())}onRegisterSelect(s){this.getSelect=s}onConvertBlockly2JS(){this.showConfirmDialog(x.I18n.t("It will not be possible to revert this operation."),s=>{if(s){this.scripts[this.state.selected].engineType="Javascript/js";const r=this.scripts[this.state.selected].source.split(` `);r.pop(),this.scripts[this.state.selected].source=r.join(` -`);const l=this.state.selected,c={...this.state.changed};c[this.state.selected]=!0,this.setState({changed:c,blockly:!1,selected:""},()=>{this.setChangedInAdmin(),setTimeout(()=>this.setState({selected:l}),100)})}})}onChange(s){if(s.script!==void 0){if(s.script===this.scripts[this.state.selected].source)return;this.scripts[this.state.selected].source=s.script}s.debug!==void 0&&(this.scripts[this.state.selected].debug=s.debug),s.verbose!==void 0&&(this.scripts[this.state.selected].verbose=s.verbose);const i=JSON.stringify(this.scripts[this.state.selected])!==JSON.stringify(this.getScriptFromObject(this.state.selected));if(i!==!!this.state.changed[this.state.selected]){const r={...this.state.changed};r[this.state.selected]=i,this.objects[this.state.selected].from="system.adapter.admin.0",this.setState({changed:r},()=>this.setChangedInAdmin())}}onTabChange(s){var r,l;if(this.props.debugMode)return;window.localStorage.setItem("Editor.selected",s);const i=this.scripts[s]||this.getScriptFromObject(s);this.setState({selected:s,rules:i.engineType==="Rules",blockly:i.engineType==="Blockly",showCompiledCode:!1,verboseEnabled:i.verbose,debugEnabled:i.debug}),(l=(r=this.props).onSelectedChange)==null||l.call(r,s,this.state.editing)}isScriptChanged(s){return!!(this.scripts[s]&&this.props.objects[s]&&JSON.stringify(this.scripts[s])!==JSON.stringify(this.getScriptFromObject(s)))}onTabClose(s,i){i==null||i.stopPropagation();const r=this.state.editing.indexOf(s);if(this.state.editing.includes(s))if(this.isScriptChanged(s))this.showConfirmDialog(x.I18n.t("Discard changes for %s",this.props.objects[s].common.name),l=>{l&&(delete this.scripts[s],this.onTabClose(s))});else{const l=[...this.state.editing];l.splice(r,1);const c={editing:l};if(s===this.state.selected?l.length?r===0||l.length===1?c.selected=l[0]:c.selected=l[r-1]:c.selected="":this.state.selected&&!l.length&&(c.selected=""),window.localStorage.setItem("Editor.editing",JSON.stringify(l)),c.selected!==void 0){c.changed||={...this.state.changed},c.changed[c.selected]=this.isScriptChanged(c.selected);const d=c.selected?this.scripts[c.selected]||this.getScriptFromObject(c.selected):void 0;c.blockly=(d==null?void 0:d.engineType)==="Blockly",c.rules=(d==null?void 0:d.engineType)==="Rules",c.verboseEnabled=!!(d!=null&&d.verbose),c.debugEnabled=!!(d!=null&&d.debug),c.showCompiledCode=!1}this.setState(c,()=>{var d,h,p,f;this.setChangedInAdmin(),c.selected!==void 0?((h=(d=this.props).onSelectedChange)==null||h.call(d,c.selected,this.state.editing),window.localStorage.setItem("Editor.selected",c.selected)):(f=(p=this.props).onSelectedChange)==null||f.call(p,this.state.selected,this.state.editing)})}}showConfirmDialog(s,i){this.confirmCallback=i,this.setState({confirm:s})}sendCommandToBlockly(s){this.setState({cmdToBlockly:s},()=>setTimeout(()=>this.setState({cmdToBlockly:""}),200))}sendCommandToRules(s){this.setState({cmdToRules:s},()=>setTimeout(()=>this.setState({cmdToRules:""}),200))}static getText(s){return typeof s=="object"?s[x.I18n.getLanguage()]||s.en:s}getScriptFullName(s){var c;const i=s.split(".");i.shift(),i.shift();const r=[];let l="script.js";for(let d=0;dthis.onTabChange(i),indicatorColor:"primary",style:{position:"relative",marginLeft:10,width:this.state.editing.length>1?"calc(100% - 50px)":"100%",display:"inline-block"},textColor:"primary",variant:"scrollable",scrollButtons:"auto",allowScrollButtonsMobile:!0,children:[this.state.editing.map(s=>{var h,p;if(!this.props.objects[s]){const f=[m.jsx(wt,{sx:this.isScriptChanged(s)?je.tabChanged:void 0,style:je.tabText,children:s.split(".").pop()},"text"),m.jsx(qe,{onClick:b=>this.onTabClose(s,b),style:je.closeButton,size:"small",component:"span",children:m.jsx(sc,{})},"icon")];return m.jsx(qp,{wrapped:!0,href:`#${s}`,label:f,value:s,sx:{"& .MuiTab-wrapper":je.tabButtonWrapper}},s)}if(!this.props.password&&((h=this.props.objects[s].native)!=null&&h.protected))return null;let i=On.getText(this.props.objects[s].common.name)||"";const r=this.getScriptFullName(s);i.length>18&&(i=`${i.substring(0,15)}...`);const l=(p=this.getScriptFromObject(s))==null?void 0:p.source,c=this.scripts[s]&&l!==this.scripts[s].source,d=[m.jsx(wt,{sx:this.isScriptChanged(s)?je.tabChanged:void 0,style:je.tabText,children:i},"text"),c?m.jsx("span",{style:je.tabChangedIcon,children:"▣"},"changedSign"):null,!this.props.debugInstance&&(!this.props.debugMode||this.state.selected!==s)&&m.jsx(qe,{onClick:f=>this.onTabClose(s,f),style:je.closeButton,size:"small",component:"span",children:m.jsx(sc,{})},"icon")];return m.jsx(qp,{disabled:!!this.props.debugInstance||this.state.selected!==s&&this.props.debugMode,wrapped:!0,iconPosition:"start",icon:m.jsx("img",{alt:"",src:cw[this.props.objects[s].common.engineType]||cw.def,style:je.tabIcon},"icon"),href:`#${s}`,label:d,style:je.tabButton,value:s,title:r,sx:{"& .MuiTab-wrapper":je.tabButtonWrapper}},s)}),this.props.debugInstance?m.jsx(qp,{disabled:!1,wrapped:!0,href:`#${this.props.debugInstance.adapter}`,label:this.props.debugInstance.adapter,style:je.tabButton,value:this.props.debugInstance.adapter,title:this.props.debugInstance.adapter,sx:{"& .MuiTab-wrapper":je.tabButtonWrapper}},this.props.debugInstance.adapter):""]},"tabs1"),this.state.editing.length>1?m.jsx(qe,{href:"#","aria-label":"Close all but current",style:je.tabMenuButton,title:x.I18n.t("Close all but current"),"aria-haspopup":"false",onClick:s=>{const i=[this.state.selected];Object.keys(this.scripts).forEach(r=>r!==this.state.selected&&JSON.stringify(this.scripts[r])!==JSON.stringify(this.getScriptFromObject(r))&&i.push(r)),window.localStorage.setItem("Editor.editing",JSON.stringify(i)),this.setState({menuTabsOpened:!1,editing:i})},size:"medium",children:m.jsx(uS,{})},"menuButton"):null]:m.jsx(wt,{sx:je.toolbar,children:m.jsxs(He,{color:"grey",disabled:!0,style:je.hintButton,href:"",children:[m.jsx("span",{children:x.I18n.t("Click on this icon")},"select2"),m.jsx(dS,{style:je.hintIcon},"select3"),m.jsx("span",{children:x.I18n.t("for edit or create script")},"select4")]},"select1")},"tabs2")}getDebugMenu(){return this.state.showDebugMenu?m.jsxs(pm,{id:"menu-debug",anchorEl:this.state.menuDebugAnchorEl,open:this.state.showDebugMenu,onClose:()=>this.setState({showDebugMenu:!1,menuDebugAnchorEl:null}),slotProps:{root:{style:{maxHeight:YA*7.5}}},children:[m.jsxs(it,{title:x.I18n.t("debug_help"),onClick:s=>{s.stopPropagation(),s.preventDefault(),this.setState({showDebugMenu:!1,menuDebugAnchorEl:null,debugEnabled:!this.state.debugEnabled},()=>this.onChange({debug:this.state.debugEnabled}))},children:[m.jsx(wc,{checked:this.state.debugEnabled}),m.jsx(oc,{style:{...je.menuIcon,color:uw}}),x.I18n.t("debug_label")]},"debugEnabled"),m.jsxs(it,{title:x.I18n.t("verbose_help"),onClick:s=>{s.stopPropagation(),s.preventDefault(),this.setState({showDebugMenu:!1,menuDebugAnchorEl:null,verboseEnabled:!this.state.verboseEnabled},()=>this.onChange({verbose:this.state.verboseEnabled}))},children:[m.jsx(wc,{checked:this.state.verboseEnabled}),m.jsx(n_,{style:{...je.menuIcon,color:bg}}),x.I18n.t("verbose_label")]},"verboseEnabled")]},"menuDebug"):null}getDebugBadge(){return[this.state.debugEnabled&&this.state.verboseEnabled?m.jsx(oc,{style:{...je.menuIcon,color:bg}},"DebugVerbose"):null,this.state.debugEnabled&&!this.state.verboseEnabled?m.jsx(oc,{style:{...je.menuIcon,color:uw}},"DebugNoVerbose"):null,!this.state.debugEnabled&&this.state.verboseEnabled?m.jsx(n_,{style:{...je.menuIcon,color:bg}},"noDebugVerbose"):null]}getAskAboutDebug(){return this.state.askAboutDebug?m.jsx(x.DialogConfirm,{onClose:()=>{this.setState({askAboutDebug:!1},()=>this.props.onDebugModeChange(!0))},ok:x.I18n.t("Yes"),cancel:x.I18n.t("Cancel"),text:x.I18n.t("The script will be stopped and must be activated manually after debugging. Continue?")}):null}renderOpenAiDialog(){return this.state.openAiDialog?m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(KA,{adapterName:this.props.adapterName,socket:this.props.socket,runningInstances:this.state.runningInstances,themeType:this.state.themeType,onClose:()=>this.setState({openAiDialog:!1}),language:this.scripts[this.state.selected].engineType==="TypeScript/ts"?"typescript":"javascript",onAddCode:s=>this.setState({insert:s})})}):null}getToolbar(){var r,l;const s=!!(this.state.selected&&((r=this.scripts[this.state.selected])!=null&&r.engine)&&this.state.runningInstances[this.scripts[this.state.selected].engine]),i=!!(this.state.selected&&((l=this.scripts[this.state.selected])!=null&&l.enabled));if(this.state.selected){const c=Object.keys(this.state.changed).filter(h=>this.state.changed[h]).length,d=this.state.changed[this.state.selected];return m.jsxs(FT,{variant:"dense",sx:je.toolbar,children:[!this.props.debugInstance&&this.state.menuOpened&&this.props.onLocate&&m.jsx(qe,{style:je.toolbarButtons,title:x.I18n.t("Locate file"),onClick:()=>this.props.onLocate(this.state.selected),size:"medium",children:m.jsx(hS,{})},"locate"),!this.props.debugInstance&&!d&&s?m.jsx(qe,{disabled:this.props.debugMode,style:je.toolbarButtons,onClick:()=>this.onRestart(),title:x.I18n.t("Restart"),size:"medium",children:m.jsx(pS,{})},"restart"):null,!this.props.debugInstance&&!d?m.jsx(qe,{disabled:this.props.debugMode,onClick:()=>this.onStartStop(),title:i?x.I18n.t("Pause script"):x.I18n.t("Run script"),size:"medium",style:{...je.toolbarButtons,color:i?JA:qA},children:i?m.jsx(gS,{}):m.jsx(mS,{})},"start-stop"):null,!this.props.debugInstance&&!d&&!i?m.jsx("span",{style:je.notRunning,children:x.I18n.t("Script is not running")}):null,!d&&i&&!s?m.jsx("span",{style:je.notRunning,children:x.I18n.t("Instance is disabled")}):null,d?m.jsx(He,{color:"grey",variant:"contained",style:{...je.textButton,...je.saveButton},className:"button-save",onClick:()=>this.onSave(),endIcon:m.jsx(r_,{}),children:x.I18n.t("Save")},"save"):null,c>1||c===1&&!d?m.jsx(He,{color:"grey",variant:"contained",style:je.textButton,onClick:()=>this.onSaveAll(),endIcon:m.jsx(r_,{}),children:x.I18n.t("Save all")},"saveall"):null,d?m.jsx(He,{color:"grey",variant:"contained",style:je.textButton,onClick:()=>this.onCancel(),endIcon:m.jsx(Yc,{}),children:x.I18n.t("Cancel")},"cancel"):null,m.jsx("div",{style:{flex:2}}),!this.props.debugInstance&&!this.state.showCompiledCode&&m.jsx(qe,{style:je.toolbarButtons,title:x.I18n.t("Prettify the script"),onClick:()=>this.setState({triggerPrettier:this.state.triggerPrettier+1}),size:"medium",children:m.jsx(fS,{})},"prettier"),this.state.blockly&&!this.state.showCompiledCode?m.jsx(qe,{"aria-label":"Export Blocks",title:x.I18n.t("Export blocks"),style:je.toolbarButtons,onClick:()=>this.sendCommandToBlockly("export"),size:"medium",children:m.jsx(kc,{})},"export"):null,this.state.blockly&&!this.state.showCompiledCode&&m.jsx(qe,{"aria-label":"Import Blocks",title:x.I18n.t("Import blocks"),style:je.toolbarButtons,onClick:()=>this.sendCommandToBlockly("import"),size:"medium",children:m.jsx(Lg,{})},"import"),this.state.blockly&&!this.state.showCompiledCode&&m.jsx(qe,{"aria-label":"Check code",title:x.I18n.t("Check blocks"),style:je.toolbarButtons,onClick:()=>this.sendCommandToBlockly("check"),size:"medium",children:m.jsx($S,{})},"check"),!this.props.debugMode&&!this.state.blockly&&!this.state.rules&&!this.state.showCompiledCode?m.jsx(qe,{"aria-label":"create CRON",title:x.I18n.t("Create or edit CRON or time wizard"),style:je.toolbarButtons,onClick:()=>this.setState({showCron:!0}),size:"medium",children:m.jsx(bS,{})},"select-cron"):null,this.scripts[this.state.selected]&&this.scripts[this.state.selected].engineType!=="Blockly"&&this.scripts[this.state.selected].engineType!=="Rules"?m.jsx(qe,{"aria-label":"AI",title:x.I18n.t("AI code generator"),style:je.toolbarButtons,size:"medium",onClick:()=>this.setState({openAiDialog:!0}),children:m.jsx(vS,{})},"ai"):null,m.jsx(qe,{"aria-label":"Show astronomical events",title:x.I18n.t("Show astronomical events"),style:je.toolbarButtons,disabled:!s,onClick:()=>{this.setState({showAstro:!0,astroEvents:null}),this.props.socket.sendTo(this.scripts[this.state.selected].engine.replace("system.adapter.",""),"calcAstroAll",{}).then(h=>this.setState({astroEvents:h}))},size:"medium",children:m.jsx(yS,{})},"show-astro"),!this.props.debugMode&&!this.state.blockly&&!this.state.rules&&!this.state.showCompiledCode&&m.jsx(qe,{"aria-label":"select ID",title:x.I18n.t("Insert object ID"),style:je.toolbarButtons,onClick:()=>this.setState({showSelectId:!0}),size:"medium",children:m.jsx(_S,{})},"select-id"),this.state.blockly&&!this.state.rules&&this.state.showCompiledCode&&m.jsx(He,{color:"grey","aria-label":"convert to javascript",title:x.I18n.t("Convert blockly to javascript for ever."),onClick:()=>this.onConvertBlockly2JS(),children:"Blockly=>JS"},"convert2js"),this.state.rules&&!this.state.showCompiledCode&&m.jsx(qe,{"aria-label":"Export Blocks",title:x.I18n.t("Export blocks"),style:je.toolbarButtons,onClick:()=>this.sendCommandToRules("export"),size:"medium",children:m.jsx(kc,{})},"export"),this.state.rules&&!this.state.showCompiledCode&&m.jsx(qe,{"aria-label":"Import Blocks",title:x.I18n.t("Import blocks"),style:je.toolbarButtons,onClick:()=>this.sendCommandToRules("import"),size:"medium",children:m.jsx(Lg,{})},"import"),this.props.expertMode&&!d&&(this.props.debugMode||!this.state.blockly&&!this.state.rules||(this.state.blockly||this.state.rules)&&this.state.showCompiledCode)&&m.jsx(qe,{style:je.toolbarButtons,color:this.props.debugMode?"primary":"default",disabled:!this.props.debugMode&&!s,onClick:()=>{!this.props.debugMode&&i?this.setState({askAboutDebug:!0}):this.props.onDebugModeChange(!this.props.debugMode)},size:"medium",children:m.jsx(oc,{style:{fontSize:32}})}),(this.state.blockly||this.state.rules)&&m.jsx(He,{"aria-label":"blockly",title:x.I18n.t("Show javascript code"),className:"button-js-code",color:this.state.showCompiledCode?"secondary":"inherit",disabled:this.props.debugMode,style:{...je.toolbarButtons,...this.props.debugMode?je.toolbarButtonsDisabled:void 0,padding:"0 5px"},onClick:()=>{this.props.debugMode||(this.setState({showCompiledCode:!this.state.showCompiledCode}),this.state.isTourOpen&&this.state.tourStep===Ns.showJavascript&&this.setState({tourStep:Ns.switchBackToRules}),this.state.isTourOpen&&this.state.tourStep===Ns.switchBackToRules&&this.setState({tourStep:Ns.saveTheScript}))},children:m.jsx("img",{alt:this.state.blockly?"blockly2js":"rules2js",src:this.state.blockly?FA:jA})},"blockly-code"),m.jsx(qe,{disabled:this.props.debugMode,"aria-label":"Debug menu",title:x.I18n.t("Debug options"),style:je.toolbarButtons,onClick:h=>this.setState({showDebugMenu:!0,menuDebugAnchorEl:h.currentTarget}),size:"medium",children:m.jsx(jT,{style:je.badgeMargin,badgeContent:this.getDebugBadge(),children:m.jsx(wS,{})})},"debug")]},"toolbar1")}return null}getScriptEditor(){return!this.props.debugMode&&this.state.selected&&this.props.objects[this.state.selected]&&this.state.blockly!==null&&(!this.state.blockly||this.state.showCompiledCode)&&(!this.state.rules||this.state.showCompiledCode)?(this.scripts[this.state.selected]||=this.getScriptFromObject(this.state.selected),m.jsx(wt,{sx:je.editorDiv,children:m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(GA,{name:this.state.selected,adapterName:this.props.adapterName,insert:this.state.insert,onInserted:()=>this.setState({insert:""}),onForceSave:()=>this.onSave(),searchText:this.state.searchText,onRegisterSelect:s=>this.onRegisterSelect(s),readOnly:this.state.showCompiledCode,changed:this.state.changed[this.state.selected],code:this.scripts[this.state.selected].source||"",isDark:this.state.themeType==="dark",socket:this.props.socket,runningInstances:this.state.runningInstances,triggerPrettier:this.state.triggerPrettier,onChange:s=>this.onChange({script:s}),language:this.scripts[this.state.selected].engineType==="TypeScript/ts"?"typescript":"javascript"},"scriptEditor1")})},"scriptEditorDiv")):null}getBlocklyEditor(){return!this.props.debugMode&&this.state.instancesLoaded&&this.state.selected&&this.props.objects[this.state.selected]&&this.state.blockly&&!this.state.showCompiledCode&&this.state.visible?(this.scripts[this.state.selected]||=this.getScriptFromObject(this.state.selected),m.jsx(wt,{sx:je.editorDiv,children:m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(UA,{command:this.state.cmdToBlockly,themeType:this.state.themeType,searchText:this.state.searchText,code:this.scripts[this.state.selected].source||"",scriptId:this.state.selected,onChange:s=>this.onChange({script:s})},"BlocklyEditor")})},"blocklyEditorDiv")):null}getRulesEditor(){var s,i;if(!this.props.debugMode&&this.state.instancesLoaded&&this.state.selected&&this.props.objects[this.state.selected]&&this.state.rules&&!this.state.showCompiledCode&&this.state.visible){this.scripts[this.state.selected]||=this.getScriptFromObject(this.state.selected);const r=!!this.state.selected&&!!((s=this.scripts[this.state.selected])!=null&&s.engine)&&this.state.runningInstances[this.scripts[this.state.selected].engine],l=!!this.state.selected&&((i=this.scripts[this.state.selected])==null?void 0:i.enabled);return m.jsx(wt,{sx:je.editorDiv,children:m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(HA,{scriptId:this.state.selected,setTourStep:this.setTourStep,tourStep:this.state.tourStep,isTourOpen:this.state.isTourOpen,changed:this.state.changed[this.state.selected],running:r&&l,command:this.state.cmdToRules,themeType:this.state.themeType,themeName:this.props.themeName,theme:this.props.theme,searchText:this.state.searchText,resizing:this.props.resizing,code:this.scripts[this.state.selected].source||"",onChange:c=>this.onChange({script:c})},"flowEditor")})},"flowEditorDiv")}return null}getConfirmDialog(){return this.state.confirm?m.jsx(x.DialogConfirm,{text:this.state.confirm,onClose:s=>{if(this.confirmCallback){const i=this.confirmCallback;this.confirmCallback=null,i(s)}this.setState({confirm:""})}},"dialogConfirm1"):null}getSelectIdDialog(){var s;if(this.state.showSelectId){const i=["state","channel","device","adapter","instance","enum","host","config","script","user","group"],r=["adapter","instance","enum","host","config","script","user","group"];let l=this.selectId.callback?this.selectId.initValue||"":this.getSelect&&this.getSelect()||"",c=l.indexOf("/*");c!==-1&&(l=l.substring(0,c)),c=l.indexOf("//"),c!==-1&&(l=l.substring(0,c));let d=l.match(/"([^"]+)"/);return d&&(l=d[1]),d=l.match(/'([^']+)'/),d&&(l=d[1]),m.jsx(x.DialogSelectID,{theme:this.props.theme,imagePrefix:"../..",themeName:this.props.themeName,themeType:this.state.themeType,socket:this.props.socket,selected:l,expertMode:this.selectId.type&&this.selectId.type!=="all"&&r.includes(this.selectId.type)?!0:void 0,types:((s=this.selectId)==null?void 0:s.type)==="all"?i:[this.selectId.type||"state"],onClose:()=>{this.setState({showSelectId:!1}),this.selectId.callback&&(this.selectId.callback=null)},onOk:(h,p)=>{this.selectId.initValue=null,this.selectId.callback?(this.selectId.callback(h),this.selectId.callback=null):this.setState({insert:`'${h}'/*${p}*/`})}},"dialogSelectID1")}return null}getCronDialog(){return this.state.showCron?m.jsx(x.DialogCron,{theme:this.props.theme,cron:this.cron.callback?this.cron.initValue||"":this.getSelect?this.getSelect():"* * * * *",onClose:()=>this.setState({showCron:!1}),onOk:s=>{this.cron.initValue=null,this.cron.callback?(this.cron.callback(s),this.cron.callback=null):this.setState({insert:`'${s}'`})}},"dialogCron1"):null}getAstroDialog(){return this.state.showAstro?m.jsxs(Ut,{open:!0,onClose:()=>this.setState({showAstro:!1}),children:[m.jsx(ss,{children:x.I18n.t("Astronomical events today")}),m.jsx(qt,{children:this.state.astroEvents?m.jsx(UT,{component:Ow,children:m.jsxs(HT,{size:"small",children:[m.jsx(WT,{children:m.jsxs(i_,{children:[m.jsx(wn,{children:x.I18n.t("Name")}),m.jsx(wn,{children:x.I18n.t("Server time")}),m.jsx(wn,{children:x.I18n.t("Description")})]})}),m.jsx(GT,{children:Object.keys(this.state.astroEvents).map(s=>{var i,r,l,c;return m.jsxs(i_,{children:[m.jsx(wn,{component:"th",scope:"row",children:s.startsWith("next")?"":s}),m.jsx(VT,{title:`${x.I18n.t("Local time")}: ${(i=this.state.astroEvents)!=null&&i[s].isValidDate?new Date((r=this.state.astroEvents)==null?void 0:r[s].date).toLocaleTimeString():"n/a"}`,children:m.jsx(wn,{align:"right",children:(l=this.state.astroEvents)!=null&&l[s].isValidDate?(c=this.state.astroEvents)==null?void 0:c[s].serverTime:"n/a"})}),m.jsx(wn,{children:x.I18n.t(s)})]},s)})})]})}):m.jsx(zT,{})}),m.jsx(Ht,{children:m.jsx(He,{variant:"contained",onClick:()=>this.setState({showAstro:!1}),color:"primary",startIcon:m.jsx(sc,{}),children:x.I18n.t("Close")})})]},"dialogAstro"):null}getEditorDialog(){return this.state.showScript?m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(VA,{adapterName:this.props.adapterName,source:this.scriptDialog.initValue||"",args:this.scriptDialog.args?this.scriptDialog.args.join(", "):"",isReturn:this.scriptDialog.isReturn,socket:this.props.socket,runningInstances:this.state.runningInstances,themeType:this.state.themeType,onClose:s=>{this.scriptDialog.initValue=null,this.scriptDialog.callback&&(s!==!1&&this.scriptDialog.callback(s||""),this.scriptDialog.callback=null),this.setState({showScript:!1})}},"scriptEditorDialog")}):null}getToast(){return m.jsx(KT,{anchorOrigin:{vertical:"bottom",horizontal:"left"},open:!!this.state.toast,autoHideDuration:6e3,onClose:()=>this.setState({toast:""}),slotProps:{content:{"aria-describedby":"message-id"}},message:m.jsx("span",{id:"message-id",children:this.state.toast}),action:[m.jsx(qe,{"aria-label":"close",color:"inherit",style:je.closeToast,onClick:()=>this.setState({toast:""}),size:"medium",children:m.jsx(sc,{})},"close")]},"toast")}setTourStep=s=>this.setState({tourStep:s});getTour(){return this.state.instancesLoaded&&this.state.selected&&this.props.isAnyRulesExists===1&&this.props.objects[this.state.selected]&&this.state.rules&&this.state.visible?m.jsx(Um,{steps:zA,isOpen:this.state.isTourOpen,onRequestClose:()=>{this.setState({isTourOpen:!1}),window.localStorage.setItem("tour","true"),this.props.socket.setState("javascript.0.variables.rulesTour",{val:!0,ack:!0})},goToStep:this.state.tourStep},"tour"):null}getDebug(){return this.props.debugMode?this.state.selected&&this.scripts[this.state.selected]&&this.scripts[this.state.selected].engine&&this.state.runningInstances[this.scripts[this.state.selected].engine]?m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(WA,{runningInstances:this.state.runningInstances,adapterName:this.props.adapterName,socket:this.props.socket,themeName:this.props.themeName,themeType:this.props.themeType,src:this.props.debugInstance?this.props.debugInstance.adapter:this.state.selected,debugInstance:this.props.debugInstance},"debugger")}):(setTimeout(()=>this.props.onDebugModeChange(!1)),null):null}getScriptFromObject(s){var r,l;if(!((r=this.props.objects[s])!=null&&r.common))return;const i=JSON.parse(JSON.stringify(this.props.objects[s].common));return(l=this.props.objects[s].native)!=null&&l.protected&&this.props.password&&(i.source=Vg(this.props.password,i.source)),i}render(){var s,i;return this.state.selected&&this.props.objects[this.state.selected]&&this.state.blockly===null&&this.state.rules===null&&(this.scripts[this.state.selected]||=this.getScriptFromObject(this.state.selected),setTimeout(()=>{const r={blockly:this.scripts[this.state.selected].engineType==="Blockly",rules:this.scripts[this.state.selected].engineType==="Rules",showCompiledCode:!1,debugEnabled:this.scripts[this.state.selected].debug,verboseEnabled:this.scripts[this.state.selected].verbose};this.removeNonExistingScripts(null,r),this.setState(r)},100)),this.state.selected&&!this.props.password&&((i=(s=this.props.objects[this.state.selected])==null?void 0:s.native)!=null&&i.protected)&&setTimeout(()=>{const r=this.state.editing.find(l=>{var c,d;return!((d=(c=this.props.objects[l])==null?void 0:c.native)!=null&&d.protected)})||"";Object.keys(this.scripts).forEach(l=>{var c,d;(d=(c=this.props.objects[l])==null?void 0:c.native)!=null&&d.protected&&delete this.scripts[l]}),this.setState({selected:r},()=>{var l,c;(c=(l=this.props).onSelectedChange)==null||c.call(l,r,this.state.editing),this.state.selected?window.localStorage.setItem("Editor.selected",this.state.selected):window.localStorage.removeItem("Editor.selected")})},50),!this.state.selected&&this.props.password&&this.state.editing.length&&setTimeout(()=>{const r=this.state.editing[0];this.setState({selected:r},()=>{var l,c;(c=(l=this.props).onSelectedChange)==null||c.call(l,r,this.state.editing),window.localStorage.setItem("Editor.selected",this.state.selected)})},50),[this.getTabs(),this.getToolbar(),this.getScriptEditor(),this.getAskAboutDebug(),this.getBlocklyEditor(),this.getRulesEditor(),this.getDebug(),this.getConfirmDialog(),this.getSelectIdDialog(),this.getCronDialog(),this.getEditorDialog(),this.getAstroDialog(),this.getDebugMenu(),this.renderOpenAiDialog(),this.getToast(),this.getTour()]}}const Yt={dialog:{height:"95%"},dropzone:{marginTop:20,width:"100%",borderWidth:5,borderStyle:"dashed",borderColor:"#d0cccc",textAlign:"center",boxSizing:"border-box",paddingTop:45,borderRadius:10,height:"calc(100% - 10px)"},dropzoneDiv:{width:"100%",height:"100%"},dropzoneRejected:{borderColor:"#970000"},dropzoneAccepted:{borderColor:"#17cd02"},icon:{height:"30%",width:"30%",color:"#eeeeee",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",zIndex:0},iconError:{color:"#ffc3c6"},iconOk:{color:"#aaeebc"},text:{top:"50%",left:"50%",transform:"translate(-50%,-50%)",color:"#868686",position:"absolute",zIndex:1}};class Hm extends _e.Component{constructor(s){super(s),this.state={error:"",imageStatus:""}}componentDidMount(){setTimeout(()=>{var s;try{(s=window.document.getElementById("import-text-area"))==null||s.focus()}catch{}},100)}handleCancel(){this.props.onClose()}static readFileDataUrl(s,i){const r=new FileReader;r.onload=()=>{i(null,{data:r.result,name:s.name})},r.onabort=()=>{console.error("file reading was aborted"),i(x.I18n.t("file reading was aborted"))},r.onerror=l=>{console.error("file reading has failed"),i(x.I18n.t("file reading has failed: %s",l))},r.readAsDataURL(s)}handleDropFile(s){if(!(s!=null&&s.length))return;const i=s[s.length-1];i&&Hm.readFileDataUrl(i,(r,l)=>{var c;r||!l?this.setState({error:r||"No data"}):this.props.onClose(((c=l.data)==null?void 0:c.toString())||"",l.name)})}render(){const s={...Yt.dropzone,...this.state.imageStatus==="accepted"?Yt.dropzoneAccepted:this.state.imageStatus==="rejected"?Yt.dropzoneRejected:void 0};return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"lg",sx:{"& .MuiDialog-paper":Yt.dialog},fullWidth:!0,open:!0,"aria-labelledby":"import-dialog-title",PaperProps:{style:{minHeight:"90%",maxHeight:"90%"}},children:[m.jsx(ss,{id:"import-dialog-title",children:x.I18n.t("Import scripts")}),m.jsxs(qt,{children:[m.jsx(Lw,{maxSize:5e7,onDrop:(i,r)=>{var l,c,d;i.length?this.handleDropFile(i):window.alert(((d=(c=(l=r==null?void 0:r[0])==null?void 0:l.errors)==null?void 0:c[0])==null?void 0:d.message)||x.I18n.t("ra_Cannot upload"))},multiple:!1,accept:{"application/zip":[],"application/x-zip-compressed":[]},children:({getRootProps:i,getInputProps:r,isDragActive:l,isDragReject:c})=>c?(this.state.imageStatus!=="rejected"&&this.setState({imageStatus:"rejected"}),m.jsxs("div",{style:{...s,...Yt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Yt.text,children:x.I18n.t("Some files will be rejected")},"text"),m.jsx(Yc,{style:{...Yt.icon,...Yt.iconError}},"icon")]})):l?(this.state.imageStatus!=="accepted"&&this.setState({imageStatus:"accepted"}),m.jsxs("div",{style:{...s,...Yt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Yt.text,children:x.I18n.t("All files will be accepted")},"text"),m.jsx(Pw,{style:{...Yt.icon,...Yt.iconOk}},"icon")]})):(this.state.imageStatus!=="wait"&&this.setState({imageStatus:"wait"}),m.jsxs("div",{style:{...s,...Yt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Yt.text,children:x.I18n.t("Drop some files here or click...")},"text"),m.jsx(Bw,{style:Yt.icon},"icon")]}))},"image-drop"),this.state.error?m.jsx(su,{text:this.state.error,onClose:()=>this.setState({error:""})}):null]}),m.jsx(Ht,{children:m.jsx(He,{color:"grey",variant:"contained",onClick:()=>this.handleCancel(),startIcon:m.jsx(so,{}),children:x.I18n.t("Close")})})]})}}var Wm={exports:{}},XA=Wm.exports;(function(a,s){(function(i,r){a.exports=r()})(XA,function(){var i={},r,l,c,d,h,p,f,b,y,w,v,_,$,S,T,E,D,M,P,W,G,z,Z,he,Ce,R,K,C,Q,ve,ce,ne,me,re,B,N,te,q,se,j,Te,ae,we,Ie,Ne,Ae,We,k,X,Y,O,A,U,H,ue,V,be,pe,fe,Le,Ue,Be,Pt,ie,Oe,Ps,ze,Zo,Ze,At,Qo,io,no,Un,Io,Bs,ro,Hn,Km,pu,Fs,xo,gu,mu,ma,fu,Wn,fa,$u,bu,Ym,Jm,qm,Li,Xm,$a,Zm,Gn,ba,Qm,va,ef,ya,vu,yu,_a,wa,ka,Vn,tf,Pi,Kn,Ca,sf,of,nf,Do,xt,Yn,_u,Ts,ao,rf,wu,Ta,ku,af,Cu,Jn,lf,Sa,cf,uf,Ea,df,Bi,hf,Tu,Ia,Su,Eu,pf,xa,Fi,Da,gf,Iu,xu,mf,ff,ei,$f,qn,os,bf,vf,yf,_f,wf,kf,Cf,Du,lo,ji,Au,Tf,Sf,Ef,If,xf,Df,Af,Of,Rf,Ou,Nf,zi,Aa,Mf,Ui,Ru,Nu,Mu,Xn,Oa,Lu,Lf,Pu,Bu,Fu,ju,zu,Uu,Hu,Pf,Zn,Wu,Ra,Na,js,Gu,Vu,Qn,Ku,Yu,Bf,Ma,Ju,Ff,jf,zf,Uf,Hf,Hi,qu,Xu,Wi,La,Wf,Gf,Zu,Qu,co,ed,td,Vf,Kf,Yf,Jf,sd,qf,od,Xf,ti,er,Pa,Ba,si,id,Fa,nd,bt,Zf,Gi,oi,Qf,rd,ja,Vi,ad,ii,tr,ld,cd,e$,t$,s$,ud,o$,dd,sr,i$,n$,r$,a$,or,hd,pd,za,Ua,l$,ir,gd,nr,c$,u$,Ao,md,zs,d$,h$,fd,p$,ni,$d,g$,m$,f$,$$,b$,bd,v$,y$,Ha,_$,w$,vd,Wa,yd,Ga,_d,wd,Ki,ri,uo,Us,k$,C$,T$,kd,Va,S$,E$,I$,Cd,Ka,Td,Ya,x$,D$,A$,O$,Me,Xt,St,pt,Hs,Yi,De,vt,Sd,R$,Oo,Ja,qa,Ed,N$,Id,Xa,xd,Dd,M$,Ad,L$,Za,P$,B$,F$,j$,z$,Od,U$,rr,ar,H$,Rd,Nd,Md,Ld,Qa,Pd,W$,G$,V$,Ji,Bd,K$,el,ds,Y$,Ro,Fd,J$,lr,jd,zd,Ud,Hd,Wd,Gd,Vd,Kd,Yd,Jd,q$,X$,Z$,Q$,eb,tb,tl,sb,ob,qd,Xd,Zd,Qd,eh,th,sh,sl,cr,oh,ib,ih,nh,rh,ah,lh,ch,uh,dh,hh,ph,nb,rb,ab,gh,lb,cb,ub,db,hb,ge;r=function(e,t,o,n){if(!(e instanceof $e)&&typeof e!="string"||`${e}`.trim()==="")throw Error('Invalid type "'+e+'". The type must be a non-empty string or a Blockly.registry.Type.');if(e=`${e}`.toLowerCase(),typeof t!="string"||t.trim()==="")throw Error('Invalid name "'+t+'". The name must be a non-empty string.');const u=t.toLowerCase();if(!o)throw Error("Can not register a null value");let g=No[e],I=ol[e];if(g||(g=No[e]=Object.create(null),I=ol[e]=Object.create(null)),l(e,o),!n&&g[u]&&g[u]!==o)throw Error('Name "'+u+'" with type "'+e+'" already registered.');g[u]=o,I[u]=t},l=function(e,t){switch(e){case String($e.FIELD):if(typeof t.fromJson!="function")throw Error('Type "'+e+'" must have a fromJson function')}},c=function(e,t){e=`${e}`.toLowerCase(),t=t.toLowerCase();const o=No[e];o&&o[t]?(delete No[e][t],delete ol[e][t]):console.warn("Unable to unregister ["+t+"]["+e+"] from the registry.")},d=function(e,t,o){e=`${e}`.toLowerCase(),t=t.toLowerCase();const n=No[e];if(!n||!n[t]){if(t="Unable to find ["+t+"]["+e+"] in the registry.",o)throw Error(t+" You must require or register a "+e+" plugin.");return console.warn(t),null}return n[t]},h=function(e,t){return e=`${e}`.toLowerCase(),t=t.toLowerCase(),(e=No[e])?!!e[t]:!1},p=function(e,t,o){return d(e,t,o)},f=function(e,t,o){return d(e,t,o)},b=function(e,t,o){e=`${e}`.toLowerCase();var n=No[e];if(!n){if(n=`Unable to find [${e}] in the registry.`,o)throw Error(`${n} You must require or register a ${e} plugin.`);return console.warn(n),null}if(!t)return n;e=ol[e],o=Object.create(null);for(const u of Object.keys(n))o[e[u]]=n[u];return o},y=function(e,t,o){return t=t.plugins[String(e)]||Ws,typeof t=="function"?t:p(e,t,o)},w=function(e,t,o,n){e=e+" was deprecated in "+t+" and will be deleted in "+o+".",n&&(e+=` -Use `+n+" instead."),gb.has(e)||(gb.add(e),console.warn(e))},v=function(){return"blockly-"+(LC++).toString(36)},_=function(){return $b.genUid()},$=function(e){return e.type===ee.BLOCK_CREATE},S=function(e){return e.type===ee.BLOCK_DELETE},T=function(e){return e.type===ee.BLOCK_CHANGE},E=function(e){return e.type===ee.BLOCK_FIELD_INTERMEDIATE_CHANGE},D=function(e){return e.type===ee.BLOCK_MOVE},M=function(e){return e.type===ee.CLICK},P=function(e){return e.type===ee.BUBBLE_OPEN},W=function(e){return e.type===ee.VIEWPORT_CHANGE},i.setRecordUndo$$module$build$src$core$events$utils=function(e){ur=e},G=function(){return ur},z=function(e){vb.fireInternal(e)},Z=function(e){if(C()){if(!po.length)try{requestAnimationFrame(()=>{setTimeout(he,0)})}catch{setTimeout(he,0)}Ce(e)}},he=function(){const e=R(po,!0);po.length=0;for(const t of e){if(!t.workspaceId)continue;let o;(o=re(t.workspaceId))==null||o.fireChangeListener(t)}},Ce=function(e){if(T(e)&&e.element==="mutation"){let t;for(t=po.length;0!n.isNull()),t||e.reverse(),e},K=function(){for(let e=0,t;t=po[e];e++)t.recordUndo=!1},i.disable$$module$build$src$core$events$utils=function(){fh++},i.enable$$module$build$src$core$events$utils=function(){fh--},C=function(){return fh===0},i.getGroup$$module$build$src$core$events$utils=function(){return bb},i.setGroup$$module$build$src$core$events$utils=function(e){vb.setGroupInternal(e)},Q=function(e){bb=typeof e=="boolean"?e?_():"":e},ve=function(e){const t=[];e=e.getDescendants(!1);for(let o=0,n;n=e[o];o++)t[o]=n.id;return t},ce=function(e,t){const o=ne(e.type);if(!o)throw Error("Unknown event type.");return o.fromJson(e,t)},ne=function(e){const t=p($e.EVENT,e);if(!t)throw Error(`Event type ${e} not found in registry.`);return t},me=function(e){if((D(e)||$(e))&&e.workspaceId){var t=re(e.workspaceId);if(!e.blockId)throw Error("Encountered a blockEvent without a proper blockId");if(e=t.getBlockById(e.blockId)){const o=ur;try{ur=!1;const n=e.getParent();if(n&&!n.hasDisabledReason($h)){const u=e.getDescendants(!1);for(let g=0,I;I=u[g];g++)I.setDisabledReason(!1,$h)}else if((e.outputConnection||e.previousConnection)&&!t.isDragging())do e.setDisabledReason(!0,$h),e=e.getNextBlock();while(e)}finally{ur=o}}}},re=function(e){return dr[e]||null},B=function(){const e=[];for(const t in dr)e.push(dr[t]);return e},N=function(e){dr[e.id]=e},te=function(e){delete dr[e.id]},q=function(){return yb},se=function(e){yb=e},j=function(){return ai},i.setSelected$$module$build$src$core$common=function(e){if(ai!==e){var t,o,n,u,g,I,L=new(ne(ee.SELECTED))((n=(t=ai)==null?void 0:t.id)!=null?n:null,(u=e==null?void 0:e.id)!=null?u:null,(I=(g=e==null?void 0:e.workspace.id)!=null?g:(o=ai)==null?void 0:o.workspace.id)!=null?I:"");z(L);var le;(le=ai)==null||le.unselect(),ai=e;var Ee;(Ee=ai)==null||Ee.select()}},Te=function(){return _b},ae=function(e){_b=e},we=function(e){for(;e.options.parentWorkspace;)e=e.options.parentWorkspace;const t=e.getParentSvg(),o=e.getCachedParentSvgSize();var n=t.parentElement;if(n instanceof HTMLElement){var u=n.offsetWidth;n=n.offsetHeight,o.width!==u&&(t.setAttribute("width",u+"px"),e.setCachedParentSvgSize(u,null)),o.height!==n&&(t.setAttribute("height",n+"px"),e.setCachedParentSvgSize(null,n)),e.resize()}},Ie=function(e,t){const o=Object.create(null),n=e.getDescendants(!0);t&&(e=e.getNextBlock())&&(e=n.indexOf(e),n.splice(e,n.length-e));for(let u=0,g;g=n[u];u++)o[g.type]?o[g.type]++:o[g.type]=1;return o},Ne=function(e){return function(){this.jsonInit(e)}},Ae=function(e){wb.defineBlocksWithJsonArrayInternal(e)},We=function(e){i.defineBlocks$$module$build$src$core$common(i.createBlockDefinitionsFromJsonArray$$module$build$src$core$common(e))},i.createBlockDefinitionsFromJsonArray$$module$build$src$core$common=function(e){const t={};for(let o=0;o>>/g,e),Th="",e=document.createElement("style"),e.id="blockly-common-style",t=document.createTextNode(t),e.appendChild(t),document.head.insertBefore(e,document.head.firstChild)))},ie=function(e,t,o){e=document.createElementNS(pr,`${e}`);for(const n in t)e.setAttribute(n,`${t[n]}`);return o&&o.appendChild(e),e},Oe=function(e,t){return t=t.split(" "),t.every(o=>e.classList.contains(o))?!1:(e.classList.add(...t),!0)},Ps=function(e,t){e.classList.remove(...t.split(" "))},ze=function(e,t){return t=t.split(" "),t.every(o=>!e.classList.contains(o))?!1:(e.classList.remove(...t),!0)},Zo=function(e,t){return e.classList.contains(t)},Ze=function(e){return e&&e.parentNode?e.parentNode.removeChild(e):null},At=function(e,t){const o=t.nextSibling;if(t=t.parentNode,!t)throw Error("Reference node has no parent.");o?t.insertBefore(e,o):t.appendChild(e)},Qo=function(e,t){e.style.transform=t,e.style["-webkit-transform"]=t},io=function(){Eh++,Es||(Es=Object.create(null))},no=function(){Eh--,Eh||(Es=null)},Un=function(e){const t=e.textContent+` +`);const l=this.state.selected,c={...this.state.changed};c[this.state.selected]=!0,this.setState({changed:c,blockly:!1,selected:""},()=>{this.setChangedInAdmin(),setTimeout(()=>this.setState({selected:l}),100)})}})}onChange(s){if(s.script!==void 0){if(s.script===this.scripts[this.state.selected].source)return;this.scripts[this.state.selected].source=s.script}s.debug!==void 0&&(this.scripts[this.state.selected].debug=s.debug),s.verbose!==void 0&&(this.scripts[this.state.selected].verbose=s.verbose);const i=JSON.stringify(this.scripts[this.state.selected])!==JSON.stringify(this.getScriptFromObject(this.state.selected));if(i!==!!this.state.changed[this.state.selected]){const r={...this.state.changed};r[this.state.selected]=i,this.objects[this.state.selected].from="system.adapter.admin.0",this.setState({changed:r},()=>this.setChangedInAdmin())}}onTabChange(s){var r,l;if(this.props.debugMode)return;window.localStorage.setItem("Editor.selected",s);const i=this.scripts[s]||this.getScriptFromObject(s);this.scripts[s]||(this.scripts[s]=i),this.lastKnownTs[s]===void 0&&this.props.objects[s]&&(this.lastKnownTs[s]=this.props.objects[s].ts||0),this.setState({selected:s,rules:i.engineType==="Rules",blockly:i.engineType==="Blockly",showCompiledCode:!1,verboseEnabled:i.verbose,debugEnabled:i.debug}),(l=(r=this.props).onSelectedChange)==null||l.call(r,s,this.state.editing)}isScriptChanged(s){return!!(this.scripts[s]&&this.props.objects[s]&&JSON.stringify(this.scripts[s])!==JSON.stringify(this.getScriptFromObject(s)))}onTabClose(s,i){i==null||i.stopPropagation();const r=this.state.editing.indexOf(s);if(this.state.editing.includes(s))if(this.isScriptChanged(s))this.showConfirmDialog(x.I18n.t("Discard changes for %s",this.props.objects[s].common.name),l=>{l&&(delete this.scripts[s],delete this.lastKnownTs[s],this.onTabClose(s))});else{const l=[...this.state.editing];l.splice(r,1);const c={editing:l};if(s===this.state.selected?l.length?r===0||l.length===1?c.selected=l[0]:c.selected=l[r-1]:c.selected="":this.state.selected&&!l.length&&(c.selected=""),window.localStorage.setItem("Editor.editing",JSON.stringify(l)),c.selected!==void 0){c.changed||={...this.state.changed},c.changed[c.selected]=this.isScriptChanged(c.selected);const d=c.selected?this.scripts[c.selected]||this.getScriptFromObject(c.selected):void 0;c.blockly=(d==null?void 0:d.engineType)==="Blockly",c.rules=(d==null?void 0:d.engineType)==="Rules",c.verboseEnabled=!!(d!=null&&d.verbose),c.debugEnabled=!!(d!=null&&d.debug),c.showCompiledCode=!1}this.setState(c,()=>{var d,h,p,f;this.setChangedInAdmin(),c.selected!==void 0?((h=(d=this.props).onSelectedChange)==null||h.call(d,c.selected,this.state.editing),window.localStorage.setItem("Editor.selected",c.selected)):(f=(p=this.props).onSelectedChange)==null||f.call(p,this.state.selected,this.state.editing)})}}showConfirmDialog(s,i){this.confirmCallback=i,this.setState({confirm:s})}sendCommandToBlockly(s){this.setState({cmdToBlockly:s},()=>setTimeout(()=>this.setState({cmdToBlockly:""}),200))}sendCommandToRules(s){this.setState({cmdToRules:s},()=>setTimeout(()=>this.setState({cmdToRules:""}),200))}static getText(s){return typeof s=="object"?s[x.I18n.getLanguage()]||s.en:s}getScriptFullName(s){var c;const i=s.split(".");i.shift(),i.shift();const r=[];let l="script.js";for(let d=0;dthis.onTabChange(i),indicatorColor:"primary",style:{position:"relative",marginLeft:10,width:this.state.editing.length>1?"calc(100% - 50px)":"100%",display:"inline-block"},textColor:"primary",variant:"scrollable",scrollButtons:"auto",allowScrollButtonsMobile:!0,children:[this.state.editing.map(s=>{var h,p;if(!this.props.objects[s]){const f=[m.jsx(wt,{sx:this.isScriptChanged(s)?Fe.tabChanged:void 0,style:Fe.tabText,children:s.split(".").pop()},"text"),m.jsx(qe,{onClick:b=>this.onTabClose(s,b),style:Fe.closeButton,size:"small",component:"span",children:m.jsx(sc,{})},"icon")];return m.jsx(qp,{wrapped:!0,href:`#${s}`,label:f,value:s,sx:{"& .MuiTab-wrapper":Fe.tabButtonWrapper}},s)}if(!this.props.password&&((h=this.props.objects[s].native)!=null&&h.protected))return null;let i=Rn.getText(this.props.objects[s].common.name)||"";const r=this.getScriptFullName(s);i.length>18&&(i=`${i.substring(0,15)}...`);const l=(p=this.getScriptFromObject(s))==null?void 0:p.source,c=this.scripts[s]&&l!==this.scripts[s].source,d=[m.jsx(wt,{sx:this.isScriptChanged(s)?Fe.tabChanged:void 0,style:Fe.tabText,children:i},"text"),c?m.jsx("span",{style:Fe.tabChangedIcon,children:"▣"},"changedSign"):null,!this.props.debugInstance&&(!this.props.debugMode||this.state.selected!==s)&&m.jsx(qe,{onClick:f=>this.onTabClose(s,f),style:Fe.closeButton,size:"small",component:"span",children:m.jsx(sc,{})},"icon")];return m.jsx(qp,{disabled:!!this.props.debugInstance||this.state.selected!==s&&this.props.debugMode,wrapped:!0,iconPosition:"start",icon:m.jsx("img",{alt:"",src:cw[this.props.objects[s].common.engineType]||cw.def,style:Fe.tabIcon},"icon"),href:`#${s}`,label:d,style:Fe.tabButton,value:s,title:r,sx:{"& .MuiTab-wrapper":Fe.tabButtonWrapper}},s)}),this.props.debugInstance?m.jsx(qp,{disabled:!1,wrapped:!0,href:`#${this.props.debugInstance.adapter}`,label:this.props.debugInstance.adapter,style:Fe.tabButton,value:this.props.debugInstance.adapter,title:this.props.debugInstance.adapter,sx:{"& .MuiTab-wrapper":Fe.tabButtonWrapper}},this.props.debugInstance.adapter):""]},"tabs1"),this.state.editing.length>1?m.jsx(qe,{href:"#","aria-label":"Close all but current",style:Fe.tabMenuButton,title:x.I18n.t("Close all but current"),"aria-haspopup":"false",onClick:s=>{const i=[this.state.selected];Object.keys(this.scripts).forEach(r=>r!==this.state.selected&&JSON.stringify(this.scripts[r])!==JSON.stringify(this.getScriptFromObject(r))&&i.push(r)),window.localStorage.setItem("Editor.editing",JSON.stringify(i)),this.setState({menuTabsOpened:!1,editing:i})},size:"medium",children:m.jsx(uS,{})},"menuButton"):null]:m.jsx(wt,{sx:Fe.toolbar,children:m.jsxs(Ue,{color:"grey",disabled:!0,style:Fe.hintButton,href:"",children:[m.jsx("span",{children:x.I18n.t("Click on this icon")},"select2"),m.jsx(dS,{style:Fe.hintIcon},"select3"),m.jsx("span",{children:x.I18n.t("for edit or create script")},"select4")]},"select1")},"tabs2")}getDebugMenu(){return this.state.showDebugMenu?m.jsxs(pm,{id:"menu-debug",anchorEl:this.state.menuDebugAnchorEl,open:this.state.showDebugMenu,onClose:()=>this.setState({showDebugMenu:!1,menuDebugAnchorEl:null}),slotProps:{root:{style:{maxHeight:YA*7.5}}},children:[m.jsxs(it,{title:x.I18n.t("debug_help"),onClick:s=>{s.stopPropagation(),s.preventDefault(),this.setState({showDebugMenu:!1,menuDebugAnchorEl:null,debugEnabled:!this.state.debugEnabled},()=>this.onChange({debug:this.state.debugEnabled}))},children:[m.jsx(wc,{checked:this.state.debugEnabled}),m.jsx(oc,{style:{...Fe.menuIcon,color:uw}}),x.I18n.t("debug_label")]},"debugEnabled"),m.jsxs(it,{title:x.I18n.t("verbose_help"),onClick:s=>{s.stopPropagation(),s.preventDefault(),this.setState({showDebugMenu:!1,menuDebugAnchorEl:null,verboseEnabled:!this.state.verboseEnabled},()=>this.onChange({verbose:this.state.verboseEnabled}))},children:[m.jsx(wc,{checked:this.state.verboseEnabled}),m.jsx(n_,{style:{...Fe.menuIcon,color:bg}}),x.I18n.t("verbose_label")]},"verboseEnabled")]},"menuDebug"):null}getDebugBadge(){return[this.state.debugEnabled&&this.state.verboseEnabled?m.jsx(oc,{style:{...Fe.menuIcon,color:bg}},"DebugVerbose"):null,this.state.debugEnabled&&!this.state.verboseEnabled?m.jsx(oc,{style:{...Fe.menuIcon,color:uw}},"DebugNoVerbose"):null,!this.state.debugEnabled&&this.state.verboseEnabled?m.jsx(n_,{style:{...Fe.menuIcon,color:bg}},"noDebugVerbose"):null]}getAskAboutDebug(){return this.state.askAboutDebug?m.jsx(x.DialogConfirm,{onClose:()=>{this.setState({askAboutDebug:!1},()=>this.props.onDebugModeChange(!0))},ok:x.I18n.t("Yes"),cancel:x.I18n.t("Cancel"),text:x.I18n.t("The script will be stopped and must be activated manually after debugging. Continue?")}):null}renderOpenAiDialog(){return this.state.openAiDialog?m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(KA,{adapterName:this.props.adapterName,socket:this.props.socket,runningInstances:this.state.runningInstances,themeType:this.state.themeType,onClose:()=>this.setState({openAiDialog:!1}),language:this.scripts[this.state.selected].engineType==="TypeScript/ts"?"typescript":"javascript",onAddCode:s=>this.setState({insert:s})})}):null}getToolbar(){var r,l;const s=!!(this.state.selected&&((r=this.scripts[this.state.selected])!=null&&r.engine)&&this.state.runningInstances[this.scripts[this.state.selected].engine]),i=!!(this.state.selected&&((l=this.scripts[this.state.selected])!=null&&l.enabled));if(this.state.selected){const c=Object.keys(this.state.changed).filter(h=>this.state.changed[h]).length,d=this.state.changed[this.state.selected];return m.jsxs(jT,{variant:"dense",sx:Fe.toolbar,children:[!this.props.debugInstance&&this.state.menuOpened&&this.props.onLocate&&m.jsx(qe,{style:Fe.toolbarButtons,title:x.I18n.t("Locate file"),onClick:()=>this.props.onLocate(this.state.selected),size:"medium",children:m.jsx(hS,{})},"locate"),!this.props.debugInstance&&!d&&s?m.jsx(qe,{disabled:this.props.debugMode,style:Fe.toolbarButtons,onClick:()=>this.onRestart(),title:x.I18n.t("Restart"),size:"medium",children:m.jsx(pS,{})},"restart"):null,!this.props.debugInstance&&!d?m.jsx(qe,{disabled:this.props.debugMode,onClick:()=>this.onStartStop(),title:i?x.I18n.t("Pause script"):x.I18n.t("Run script"),size:"medium",style:{...Fe.toolbarButtons,color:i?JA:qA},children:i?m.jsx(gS,{}):m.jsx(mS,{})},"start-stop"):null,!this.props.debugInstance&&!d&&!i?m.jsx("span",{style:Fe.notRunning,children:x.I18n.t("Script is not running")}):null,!d&&i&&!s?m.jsx("span",{style:Fe.notRunning,children:x.I18n.t("Instance is disabled")}):null,d?m.jsx(Ue,{color:"grey",variant:"contained",style:{...Fe.textButton,...Fe.saveButton},className:"button-save",onClick:()=>this.onSave(),endIcon:m.jsx(r_,{}),children:x.I18n.t("Save")},"save"):null,c>1||c===1&&!d?m.jsx(Ue,{color:"grey",variant:"contained",style:Fe.textButton,onClick:()=>this.onSaveAll(),endIcon:m.jsx(r_,{}),children:x.I18n.t("Save all")},"saveall"):null,d?m.jsx(Ue,{color:"grey",variant:"contained",style:Fe.textButton,onClick:()=>this.onCancel(),endIcon:m.jsx(Yc,{}),children:x.I18n.t("Cancel")},"cancel"):null,m.jsx("div",{style:{flex:2}}),!this.props.debugInstance&&!this.state.showCompiledCode&&m.jsx(qe,{style:Fe.toolbarButtons,title:x.I18n.t("Prettify the script"),onClick:()=>this.setState({triggerPrettier:this.state.triggerPrettier+1}),size:"medium",children:m.jsx(fS,{})},"prettier"),this.state.blockly&&!this.state.showCompiledCode?m.jsx(qe,{"aria-label":"Export Blocks",title:x.I18n.t("Export blocks"),style:Fe.toolbarButtons,onClick:()=>this.sendCommandToBlockly("export"),size:"medium",children:m.jsx(kc,{})},"export"):null,this.state.blockly&&!this.state.showCompiledCode&&m.jsx(qe,{"aria-label":"Import Blocks",title:x.I18n.t("Import blocks"),style:Fe.toolbarButtons,onClick:()=>this.sendCommandToBlockly("import"),size:"medium",children:m.jsx(Lg,{})},"import"),this.state.blockly&&!this.state.showCompiledCode&&m.jsx(qe,{"aria-label":"Check code",title:x.I18n.t("Check blocks"),style:Fe.toolbarButtons,onClick:()=>this.sendCommandToBlockly("check"),size:"medium",children:m.jsx($S,{})},"check"),!this.props.debugMode&&!this.state.blockly&&!this.state.rules&&!this.state.showCompiledCode?m.jsx(qe,{"aria-label":"create CRON",title:x.I18n.t("Create or edit CRON or time wizard"),style:Fe.toolbarButtons,onClick:()=>this.setState({showCron:!0}),size:"medium",children:m.jsx(bS,{})},"select-cron"):null,this.scripts[this.state.selected]&&this.scripts[this.state.selected].engineType!=="Blockly"&&this.scripts[this.state.selected].engineType!=="Rules"?m.jsx(qe,{"aria-label":"AI",title:x.I18n.t("AI code generator"),style:Fe.toolbarButtons,size:"medium",onClick:()=>this.setState({openAiDialog:!0}),children:m.jsx(vS,{})},"ai"):null,m.jsx(qe,{"aria-label":"Show astronomical events",title:x.I18n.t("Show astronomical events"),style:Fe.toolbarButtons,disabled:!s,onClick:()=>{this.setState({showAstro:!0,astroEvents:null}),this.props.socket.sendTo(this.scripts[this.state.selected].engine.replace("system.adapter.",""),"calcAstroAll",{}).then(h=>this.setState({astroEvents:h}))},size:"medium",children:m.jsx(yS,{})},"show-astro"),!this.props.debugMode&&!this.state.blockly&&!this.state.rules&&!this.state.showCompiledCode&&m.jsx(qe,{"aria-label":"select ID",title:x.I18n.t("Insert object ID"),style:Fe.toolbarButtons,onClick:()=>this.setState({showSelectId:!0}),size:"medium",children:m.jsx(_S,{})},"select-id"),this.state.blockly&&!this.state.rules&&this.state.showCompiledCode&&m.jsx(Ue,{color:"grey","aria-label":"convert to javascript",title:x.I18n.t("Convert blockly to javascript for ever."),onClick:()=>this.onConvertBlockly2JS(),children:"Blockly=>JS"},"convert2js"),this.state.rules&&!this.state.showCompiledCode&&m.jsx(qe,{"aria-label":"Export Blocks",title:x.I18n.t("Export blocks"),style:Fe.toolbarButtons,onClick:()=>this.sendCommandToRules("export"),size:"medium",children:m.jsx(kc,{})},"export"),this.state.rules&&!this.state.showCompiledCode&&m.jsx(qe,{"aria-label":"Import Blocks",title:x.I18n.t("Import blocks"),style:Fe.toolbarButtons,onClick:()=>this.sendCommandToRules("import"),size:"medium",children:m.jsx(Lg,{})},"import"),this.props.expertMode&&!d&&(this.props.debugMode||!this.state.blockly&&!this.state.rules||(this.state.blockly||this.state.rules)&&this.state.showCompiledCode)&&m.jsx(qe,{style:Fe.toolbarButtons,color:this.props.debugMode?"primary":"default",disabled:!this.props.debugMode&&!s,onClick:()=>{!this.props.debugMode&&i?this.setState({askAboutDebug:!0}):this.props.onDebugModeChange(!this.props.debugMode)},size:"medium",children:m.jsx(oc,{style:{fontSize:32}})}),(this.state.blockly||this.state.rules)&&m.jsx(Ue,{"aria-label":"blockly",title:x.I18n.t("Show javascript code"),className:"button-js-code",color:this.state.showCompiledCode?"secondary":"inherit",disabled:this.props.debugMode,style:{...Fe.toolbarButtons,...this.props.debugMode?Fe.toolbarButtonsDisabled:void 0,padding:"0 5px"},onClick:()=>{this.props.debugMode||(this.setState({showCompiledCode:!this.state.showCompiledCode}),this.state.isTourOpen&&this.state.tourStep===Ns.showJavascript&&this.setState({tourStep:Ns.switchBackToRules}),this.state.isTourOpen&&this.state.tourStep===Ns.switchBackToRules&&this.setState({tourStep:Ns.saveTheScript}))},children:m.jsx("img",{alt:this.state.blockly?"blockly2js":"rules2js",src:this.state.blockly?jA:FA})},"blockly-code"),m.jsx(qe,{disabled:this.props.debugMode,"aria-label":"Debug menu",title:x.I18n.t("Debug options"),style:Fe.toolbarButtons,onClick:h=>this.setState({showDebugMenu:!0,menuDebugAnchorEl:h.currentTarget}),size:"medium",children:m.jsx(FT,{style:Fe.badgeMargin,badgeContent:this.getDebugBadge(),children:m.jsx(wS,{})})},"debug")]},"toolbar1")}return null}getScriptEditor(){return!this.props.debugMode&&this.state.selected&&this.props.objects[this.state.selected]&&this.state.blockly!==null&&(!this.state.blockly||this.state.showCompiledCode)&&(!this.state.rules||this.state.showCompiledCode)?(this.scripts[this.state.selected]||=this.getScriptFromObject(this.state.selected),m.jsx(wt,{sx:Fe.editorDiv,children:m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(GA,{name:this.state.selected,adapterName:this.props.adapterName,insert:this.state.insert,onInserted:()=>this.setState({insert:""}),onForceSave:()=>this.onSave(),searchText:this.state.searchText,onRegisterSelect:s=>this.onRegisterSelect(s),readOnly:this.state.showCompiledCode,changed:this.state.changed[this.state.selected],code:this.scripts[this.state.selected].source||"",isDark:this.state.themeType==="dark",socket:this.props.socket,runningInstances:this.state.runningInstances,triggerPrettier:this.state.triggerPrettier,onChange:s=>this.onChange({script:s}),language:this.scripts[this.state.selected].engineType==="TypeScript/ts"?"typescript":"javascript"},"scriptEditor1")})},"scriptEditorDiv")):null}getBlocklyEditor(){return!this.props.debugMode&&this.state.instancesLoaded&&this.state.selected&&this.props.objects[this.state.selected]&&this.state.blockly&&!this.state.showCompiledCode&&this.state.visible?(this.scripts[this.state.selected]||=this.getScriptFromObject(this.state.selected),m.jsx(wt,{sx:Fe.editorDiv,children:m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(UA,{command:this.state.cmdToBlockly,themeType:this.state.themeType,searchText:this.state.searchText,code:this.scripts[this.state.selected].source||"",scriptId:this.state.selected,onChange:s=>this.onChange({script:s})},"BlocklyEditor")})},"blocklyEditorDiv")):null}getRulesEditor(){var s,i;if(!this.props.debugMode&&this.state.instancesLoaded&&this.state.selected&&this.props.objects[this.state.selected]&&this.state.rules&&!this.state.showCompiledCode&&this.state.visible){this.scripts[this.state.selected]||=this.getScriptFromObject(this.state.selected);const r=!!this.state.selected&&!!((s=this.scripts[this.state.selected])!=null&&s.engine)&&this.state.runningInstances[this.scripts[this.state.selected].engine],l=!!this.state.selected&&((i=this.scripts[this.state.selected])==null?void 0:i.enabled);return m.jsx(wt,{sx:Fe.editorDiv,children:m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(HA,{scriptId:this.state.selected,setTourStep:this.setTourStep,tourStep:this.state.tourStep,isTourOpen:this.state.isTourOpen,changed:this.state.changed[this.state.selected],running:r&&l,command:this.state.cmdToRules,themeType:this.state.themeType,themeName:this.props.themeName,theme:this.props.theme,searchText:this.state.searchText,resizing:this.props.resizing,code:this.scripts[this.state.selected].source||"",onChange:c=>this.onChange({script:c})},"flowEditor")})},"flowEditorDiv")}return null}getScriptConflictDialog(){var r,l;if(!this.state.scriptConflict)return null;const s=this.state.scriptConflict,i=((l=(r=this.props.objects[s])==null?void 0:r.common)==null?void 0:l.name)||s;return m.jsxs(Pt,{open:!0,onClose:()=>this.setState({scriptConflict:""}),children:[m.jsx(Xt,{children:x.I18n.t("Script was modified externally")}),m.jsx(Wt,{children:x.I18n.t('The script "%s" has been modified by another user or in another window. Do you want to reload the script or keep your local changes?',i)}),m.jsxs(Bt,{children:[m.jsx(Ue,{variant:"contained",onClick:()=>{var d;this.scripts[s]=this.getScriptFromObject(s),this.lastKnownTs[s]=((d=this.props.objects[s])==null?void 0:d.ts)||0;const c={...this.state.changed};c[s]=!1,this.setState({scriptConflict:"",changed:c},()=>this.setChangedInAdmin())},color:"primary",autoFocus:!0,children:x.I18n.t("Reload")}),m.jsx(Ue,{variant:"contained",onClick:()=>{var c;this.lastKnownTs[s]=((c=this.props.objects[s])==null?void 0:c.ts)||0,this.setState({scriptConflict:""})},color:"secondary",children:x.I18n.t("Keep my changes")})]})]},"dialogScriptConflict")}getConfirmDialog(){return this.state.confirm?m.jsx(x.DialogConfirm,{text:this.state.confirm,onClose:s=>{if(this.confirmCallback){const i=this.confirmCallback;this.confirmCallback=null,i(s)}this.setState({confirm:""})}},"dialogConfirm1"):null}getSelectIdDialog(){var s;if(this.state.showSelectId){const i=["state","channel","device","adapter","instance","enum","host","config","script","user","group"],r=["adapter","instance","enum","host","config","script","user","group"];let l=this.selectId.callback?this.selectId.initValue||"":this.getSelect&&this.getSelect()||"",c=l.indexOf("/*");c!==-1&&(l=l.substring(0,c)),c=l.indexOf("//"),c!==-1&&(l=l.substring(0,c));let d=l.match(/"([^"]+)"/);return d&&(l=d[1]),d=l.match(/'([^']+)'/),d&&(l=d[1]),m.jsx(x.DialogSelectID,{theme:this.props.theme,imagePrefix:"../..",themeName:this.props.themeName,themeType:this.state.themeType,socket:this.props.socket,selected:l,expertMode:this.selectId.type&&this.selectId.type!=="all"&&r.includes(this.selectId.type)?!0:void 0,types:((s=this.selectId)==null?void 0:s.type)==="all"?i:[this.selectId.type||"state"],onClose:()=>{this.setState({showSelectId:!1}),this.selectId.callback&&(this.selectId.callback=null)},onOk:(h,p)=>{this.selectId.initValue=null,this.selectId.callback?(this.selectId.callback(h),this.selectId.callback=null):this.setState({insert:`'${h}'/*${p}*/`})}},"dialogSelectID1")}return null}getCronDialog(){return this.state.showCron?m.jsx(x.DialogCron,{theme:this.props.theme,cron:this.cron.callback?this.cron.initValue||"":this.getSelect?this.getSelect():"* * * * *",onClose:()=>this.setState({showCron:!1}),onOk:s=>{this.cron.initValue=null,this.cron.callback?(this.cron.callback(s),this.cron.callback=null):this.setState({insert:`'${s}'`})}},"dialogCron1"):null}getAstroDialog(){return this.state.showAstro?m.jsxs(Pt,{open:!0,onClose:()=>this.setState({showAstro:!1}),children:[m.jsx(Xt,{children:x.I18n.t("Astronomical events today")}),m.jsx(Wt,{children:this.state.astroEvents?m.jsx(UT,{component:Rw,children:m.jsxs(HT,{size:"small",children:[m.jsx(WT,{children:m.jsxs(i_,{children:[m.jsx(wn,{children:x.I18n.t("Name")}),m.jsx(wn,{children:x.I18n.t("Server time")}),m.jsx(wn,{children:x.I18n.t("Description")})]})}),m.jsx(GT,{children:Object.keys(this.state.astroEvents).map(s=>{var i,r,l,c;return m.jsxs(i_,{children:[m.jsx(wn,{component:"th",scope:"row",children:s.startsWith("next")?"":s}),m.jsx(VT,{title:`${x.I18n.t("Local time")}: ${(i=this.state.astroEvents)!=null&&i[s].isValidDate?new Date((r=this.state.astroEvents)==null?void 0:r[s].date).toLocaleTimeString():"n/a"}`,children:m.jsx(wn,{align:"right",children:(l=this.state.astroEvents)!=null&&l[s].isValidDate?(c=this.state.astroEvents)==null?void 0:c[s].serverTime:"n/a"})}),m.jsx(wn,{children:x.I18n.t(s)})]},s)})})]})}):m.jsx(zT,{})}),m.jsx(Bt,{children:m.jsx(Ue,{variant:"contained",onClick:()=>this.setState({showAstro:!1}),color:"primary",startIcon:m.jsx(sc,{}),children:x.I18n.t("Close")})})]},"dialogAstro"):null}getEditorDialog(){return this.state.showScript?m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(VA,{adapterName:this.props.adapterName,source:this.scriptDialog.initValue||"",args:this.scriptDialog.args?this.scriptDialog.args.join(", "):"",isReturn:this.scriptDialog.isReturn,socket:this.props.socket,runningInstances:this.state.runningInstances,themeType:this.state.themeType,onClose:s=>{this.scriptDialog.initValue=null,this.scriptDialog.callback&&(s!==!1&&this.scriptDialog.callback(s||""),this.scriptDialog.callback=null),this.setState({showScript:!1})}},"scriptEditorDialog")}):null}getToast(){return m.jsx(KT,{anchorOrigin:{vertical:"bottom",horizontal:"left"},open:!!this.state.toast,autoHideDuration:6e3,onClose:()=>this.setState({toast:""}),slotProps:{content:{"aria-describedby":"message-id"}},message:m.jsx("span",{id:"message-id",children:this.state.toast}),action:[m.jsx(qe,{"aria-label":"close",color:"inherit",style:Fe.closeToast,onClick:()=>this.setState({toast:""}),size:"medium",children:m.jsx(sc,{})},"close")]},"toast")}setTourStep=s=>this.setState({tourStep:s});getTour(){return this.state.instancesLoaded&&this.state.selected&&this.props.isAnyRulesExists===1&&this.props.objects[this.state.selected]&&this.state.rules&&this.state.visible?m.jsx(Um,{steps:zA,isOpen:this.state.isTourOpen,onRequestClose:()=>{this.setState({isTourOpen:!1}),window.localStorage.setItem("tour","true"),this.props.socket.setState("javascript.0.variables.rulesTour",{val:!0,ack:!0})},goToStep:this.state.tourStep},"tour"):null}getDebug(){return this.props.debugMode?this.state.selected&&this.scripts[this.state.selected]&&this.scripts[this.state.selected].engine&&this.state.runningInstances[this.scripts[this.state.selected].engine]?m.jsx(_n,{fallback:m.jsx(En,{}),children:m.jsx(WA,{runningInstances:this.state.runningInstances,adapterName:this.props.adapterName,socket:this.props.socket,themeName:this.props.themeName,themeType:this.props.themeType,src:this.props.debugInstance?this.props.debugInstance.adapter:this.state.selected,debugInstance:this.props.debugInstance},"debugger")}):(setTimeout(()=>this.props.onDebugModeChange(!1)),null):null}getScriptFromObject(s){var r,l;if(!((r=this.props.objects[s])!=null&&r.common))return;const i=JSON.parse(JSON.stringify(this.props.objects[s].common));return(l=this.props.objects[s].native)!=null&&l.protected&&this.props.password&&(i.source=Vg(this.props.password,i.source)),i}render(){var s,i,r;return this.state.selected&&this.props.objects[this.state.selected]&&this.state.blockly===null&&this.state.rules===null&&(this.scripts[this.state.selected]||(this.scripts[this.state.selected]=this.getScriptFromObject(this.state.selected),this.lastKnownTs[this.state.selected]=((s=this.props.objects[this.state.selected])==null?void 0:s.ts)||0),setTimeout(()=>{const l={blockly:this.scripts[this.state.selected].engineType==="Blockly",rules:this.scripts[this.state.selected].engineType==="Rules",showCompiledCode:!1,debugEnabled:this.scripts[this.state.selected].debug,verboseEnabled:this.scripts[this.state.selected].verbose};this.removeNonExistingScripts(null,l),this.setState(l)},100)),this.state.selected&&!this.props.password&&((r=(i=this.props.objects[this.state.selected])==null?void 0:i.native)!=null&&r.protected)&&setTimeout(()=>{const l=this.state.editing.find(c=>{var d,h;return!((h=(d=this.props.objects[c])==null?void 0:d.native)!=null&&h.protected)})||"";Object.keys(this.scripts).forEach(c=>{var d,h;(h=(d=this.props.objects[c])==null?void 0:d.native)!=null&&h.protected&&delete this.scripts[c]}),this.setState({selected:l},()=>{var c,d;(d=(c=this.props).onSelectedChange)==null||d.call(c,l,this.state.editing),this.state.selected?window.localStorage.setItem("Editor.selected",this.state.selected):window.localStorage.removeItem("Editor.selected")})},50),!this.state.selected&&this.props.password&&this.state.editing.length&&setTimeout(()=>{const l=this.state.editing[0];this.setState({selected:l},()=>{var c,d;(d=(c=this.props).onSelectedChange)==null||d.call(c,l,this.state.editing),window.localStorage.setItem("Editor.selected",this.state.selected)})},50),[this.getTabs(),this.getToolbar(),this.getScriptEditor(),this.getAskAboutDebug(),this.getBlocklyEditor(),this.getRulesEditor(),this.getDebug(),this.getConfirmDialog(),this.getScriptConflictDialog(),this.getSelectIdDialog(),this.getCronDialog(),this.getEditorDialog(),this.getAstroDialog(),this.getDebugMenu(),this.renderOpenAiDialog(),this.getToast(),this.getTour()]}}const Jt={dialog:{height:"95%"},dropzone:{marginTop:20,width:"100%",borderWidth:5,borderStyle:"dashed",borderColor:"#d0cccc",textAlign:"center",boxSizing:"border-box",paddingTop:45,borderRadius:10,height:"calc(100% - 10px)"},dropzoneDiv:{width:"100%",height:"100%"},dropzoneRejected:{borderColor:"#970000"},dropzoneAccepted:{borderColor:"#17cd02"},icon:{height:"30%",width:"30%",color:"#eeeeee",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",zIndex:0},iconError:{color:"#ffc3c6"},iconOk:{color:"#aaeebc"},text:{top:"50%",left:"50%",transform:"translate(-50%,-50%)",color:"#868686",position:"absolute",zIndex:1}};class Hm extends _e.Component{constructor(s){super(s),this.state={error:"",imageStatus:""}}componentDidMount(){setTimeout(()=>{var s;try{(s=window.document.getElementById("import-text-area"))==null||s.focus()}catch{}},100)}handleCancel(){this.props.onClose()}static readFileDataUrl(s,i){const r=new FileReader;r.onload=()=>{i(null,{data:r.result,name:s.name})},r.onabort=()=>{console.error("file reading was aborted"),i(x.I18n.t("file reading was aborted"))},r.onerror=l=>{console.error("file reading has failed"),i(x.I18n.t("file reading has failed: %s",l))},r.readAsDataURL(s)}handleDropFile(s){if(!(s!=null&&s.length))return;const i=s[s.length-1];i&&Hm.readFileDataUrl(i,(r,l)=>{var c;r||!l?this.setState({error:r||"No data"}):this.props.onClose(((c=l.data)==null?void 0:c.toString())||"",l.name)})}render(){const s={...Jt.dropzone,...this.state.imageStatus==="accepted"?Jt.dropzoneAccepted:this.state.imageStatus==="rejected"?Jt.dropzoneRejected:void 0};return m.jsxs(Pt,{onClose:()=>!1,maxWidth:"lg",sx:{"& .MuiDialog-paper":Jt.dialog},fullWidth:!0,open:!0,"aria-labelledby":"import-dialog-title",PaperProps:{style:{minHeight:"90%",maxHeight:"90%"}},children:[m.jsx(Xt,{id:"import-dialog-title",children:x.I18n.t("Import scripts")}),m.jsxs(Wt,{children:[m.jsx(Lw,{maxSize:5e7,onDrop:(i,r)=>{var l,c,d;i.length?this.handleDropFile(i):window.alert(((d=(c=(l=r==null?void 0:r[0])==null?void 0:l.errors)==null?void 0:c[0])==null?void 0:d.message)||x.I18n.t("ra_Cannot upload"))},multiple:!1,accept:{"application/zip":[],"application/x-zip-compressed":[]},children:({getRootProps:i,getInputProps:r,isDragActive:l,isDragReject:c})=>c?(this.state.imageStatus!=="rejected"&&this.setState({imageStatus:"rejected"}),m.jsxs("div",{style:{...s,...Jt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Jt.text,children:x.I18n.t("Some files will be rejected")},"text"),m.jsx(Yc,{style:{...Jt.icon,...Jt.iconError}},"icon")]})):l?(this.state.imageStatus!=="accepted"&&this.setState({imageStatus:"accepted"}),m.jsxs("div",{style:{...s,...Jt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Jt.text,children:x.I18n.t("All files will be accepted")},"text"),m.jsx(Pw,{style:{...Jt.icon,...Jt.iconOk}},"icon")]})):(this.state.imageStatus!=="wait"&&this.setState({imageStatus:"wait"}),m.jsxs("div",{style:{...s,...Jt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Jt.text,children:x.I18n.t("Drop some files here or click...")},"text"),m.jsx(Bw,{style:Jt.icon},"icon")]}))},"image-drop"),this.state.error?m.jsx(su,{text:this.state.error,onClose:()=>this.setState({error:""})}):null]}),m.jsx(Bt,{children:m.jsx(Ue,{color:"grey",variant:"contained",onClick:()=>this.handleCancel(),startIcon:m.jsx(so,{}),children:x.I18n.t("Close")})})]})}}var Wm={exports:{}},XA=Wm.exports;(function(a,s){(function(i,r){a.exports=r()})(XA,function(){var i={},r,l,c,d,h,p,f,b,y,w,v,_,$,S,T,E,D,M,P,W,G,z,Z,he,Ce,O,K,C,Q,ve,ce,ne,me,re,B,N,te,q,se,F,Te,ae,we,Ie,Ne,Ae,We,k,X,Y,R,A,U,H,ue,V,be,pe,fe,Le,He,Be,jt,ie,Re,Ps,ze,Zo,Ze,At,Qo,io,no,Un,Io,Bs,ro,Hn,Km,pu,js,xo,gu,mu,ma,fu,Wn,fa,$u,bu,Ym,Jm,qm,Li,Xm,$a,Zm,Gn,ba,Qm,va,ef,ya,vu,yu,_a,wa,ka,Vn,tf,Pi,Kn,Ca,sf,of,nf,Do,xt,Yn,_u,Ts,ao,rf,wu,Ta,ku,af,Cu,Jn,lf,Sa,cf,uf,Ea,df,Bi,hf,Tu,Ia,Su,Eu,pf,xa,ji,Da,gf,Iu,xu,mf,ff,ei,$f,qn,os,bf,vf,yf,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". The name must be a non-empty string.');const u=t.toLowerCase();if(!o)throw Error("Can not register a null value");let g=No[e],I=ol[e];if(g||(g=No[e]=Object.create(null),I=ol[e]=Object.create(null)),l(e,o),!n&&g[u]&&g[u]!==o)throw Error('Name "'+u+'" with type "'+e+'" already registered.');g[u]=o,I[u]=t},l=function(e,t){switch(e){case String($e.FIELD):if(typeof t.fromJson!="function")throw Error('Type "'+e+'" must have a fromJson function')}},c=function(e,t){e=`${e}`.toLowerCase(),t=t.toLowerCase();const o=No[e];o&&o[t]?(delete No[e][t],delete ol[e][t]):console.warn("Unable to unregister ["+t+"]["+e+"] from the registry.")},d=function(e,t,o){e=`${e}`.toLowerCase(),t=t.toLowerCase();const n=No[e];if(!n||!n[t]){if(t="Unable to find ["+t+"]["+e+"] in the registry.",o)throw Error(t+" You must require or register a "+e+" plugin.");return console.warn(t),null}return n[t]},h=function(e,t){return e=`${e}`.toLowerCase(),t=t.toLowerCase(),(e=No[e])?!!e[t]:!1},p=function(e,t,o){return d(e,t,o)},f=function(e,t,o){return d(e,t,o)},b=function(e,t,o){e=`${e}`.toLowerCase();var n=No[e];if(!n){if(n=`Unable to find [${e}] in the registry.`,o)throw Error(`${n} You must require or register a ${e} plugin.`);return console.warn(n),null}if(!t)return n;e=ol[e],o=Object.create(null);for(const u of Object.keys(n))o[e[u]]=n[u];return o},y=function(e,t,o){return t=t.plugins[String(e)]||Ws,typeof t=="function"?t:p(e,t,o)},w=function(e,t,o,n){e=e+" was deprecated in "+t+" and will be deleted in "+o+".",n&&(e+=` +Use `+n+" instead."),gb.has(e)||(gb.add(e),console.warn(e))},v=function(){return"blockly-"+(LC++).toString(36)},_=function(){return $b.genUid()},$=function(e){return e.type===ee.BLOCK_CREATE},S=function(e){return e.type===ee.BLOCK_DELETE},T=function(e){return e.type===ee.BLOCK_CHANGE},E=function(e){return e.type===ee.BLOCK_FIELD_INTERMEDIATE_CHANGE},D=function(e){return e.type===ee.BLOCK_MOVE},M=function(e){return e.type===ee.CLICK},P=function(e){return e.type===ee.BUBBLE_OPEN},W=function(e){return e.type===ee.VIEWPORT_CHANGE},i.setRecordUndo$$module$build$src$core$events$utils=function(e){ur=e},G=function(){return ur},z=function(e){vb.fireInternal(e)},Z=function(e){if(C()){if(!po.length)try{requestAnimationFrame(()=>{setTimeout(he,0)})}catch{setTimeout(he,0)}Ce(e)}},he=function(){const e=O(po,!0);po.length=0;for(const t of e){if(!t.workspaceId)continue;let o;(o=re(t.workspaceId))==null||o.fireChangeListener(t)}},Ce=function(e){if(T(e)&&e.element==="mutation"){let t;for(t=po.length;0!n.isNull()),t||e.reverse(),e},K=function(){for(let e=0,t;t=po[e];e++)t.recordUndo=!1},i.disable$$module$build$src$core$events$utils=function(){fh++},i.enable$$module$build$src$core$events$utils=function(){fh--},C=function(){return fh===0},i.getGroup$$module$build$src$core$events$utils=function(){return bb},i.setGroup$$module$build$src$core$events$utils=function(e){vb.setGroupInternal(e)},Q=function(e){bb=typeof e=="boolean"?e?_():"":e},ve=function(e){const t=[];e=e.getDescendants(!1);for(let o=0,n;n=e[o];o++)t[o]=n.id;return t},ce=function(e,t){const o=ne(e.type);if(!o)throw Error("Unknown event type.");return o.fromJson(e,t)},ne=function(e){const t=p($e.EVENT,e);if(!t)throw Error(`Event type ${e} not found in registry.`);return t},me=function(e){if((D(e)||$(e))&&e.workspaceId){var t=re(e.workspaceId);if(!e.blockId)throw Error("Encountered a blockEvent without a proper blockId");if(e=t.getBlockById(e.blockId)){const o=ur;try{ur=!1;const n=e.getParent();if(n&&!n.hasDisabledReason($h)){const u=e.getDescendants(!1);for(let g=0,I;I=u[g];g++)I.setDisabledReason(!1,$h)}else if((e.outputConnection||e.previousConnection)&&!t.isDragging())do e.setDisabledReason(!0,$h),e=e.getNextBlock();while(e)}finally{ur=o}}}},re=function(e){return dr[e]||null},B=function(){const e=[];for(const t in dr)e.push(dr[t]);return e},N=function(e){dr[e.id]=e},te=function(e){delete dr[e.id]},q=function(){return yb},se=function(e){yb=e},F=function(){return ai},i.setSelected$$module$build$src$core$common=function(e){if(ai!==e){var t,o,n,u,g,I,L=new(ne(ee.SELECTED))((n=(t=ai)==null?void 0:t.id)!=null?n:null,(u=e==null?void 0:e.id)!=null?u:null,(I=(g=e==null?void 0:e.workspace.id)!=null?g:(o=ai)==null?void 0:o.workspace.id)!=null?I:"");z(L);var le;(le=ai)==null||le.unselect(),ai=e;var Ee;(Ee=ai)==null||Ee.select()}},Te=function(){return _b},ae=function(e){_b=e},we=function(e){for(;e.options.parentWorkspace;)e=e.options.parentWorkspace;const t=e.getParentSvg(),o=e.getCachedParentSvgSize();var n=t.parentElement;if(n instanceof HTMLElement){var u=n.offsetWidth;n=n.offsetHeight,o.width!==u&&(t.setAttribute("width",u+"px"),e.setCachedParentSvgSize(u,null)),o.height!==n&&(t.setAttribute("height",n+"px"),e.setCachedParentSvgSize(null,n)),e.resize()}},Ie=function(e,t){const o=Object.create(null),n=e.getDescendants(!0);t&&(e=e.getNextBlock())&&(e=n.indexOf(e),n.splice(e,n.length-e));for(let u=0,g;g=n[u];u++)o[g.type]?o[g.type]++:o[g.type]=1;return o},Ne=function(e){return function(){this.jsonInit(e)}},Ae=function(e){wb.defineBlocksWithJsonArrayInternal(e)},We=function(e){i.defineBlocks$$module$build$src$core$common(i.createBlockDefinitionsFromJsonArray$$module$build$src$core$common(e))},i.createBlockDefinitionsFromJsonArray$$module$build$src$core$common=function(e){const t={};for(let o=0;o>>/g,e),Th="",e=document.createElement("style"),e.id="blockly-common-style",t=document.createTextNode(t),e.appendChild(t),document.head.insertBefore(e,document.head.firstChild)))},ie=function(e,t,o){e=document.createElementNS(pr,`${e}`);for(const n in t)e.setAttribute(n,`${t[n]}`);return o&&o.appendChild(e),e},Re=function(e,t){return t=t.split(" "),t.every(o=>e.classList.contains(o))?!1:(e.classList.add(...t),!0)},Ps=function(e,t){e.classList.remove(...t.split(" "))},ze=function(e,t){return t=t.split(" "),t.every(o=>!e.classList.contains(o))?!1:(e.classList.remove(...t),!0)},Zo=function(e,t){return e.classList.contains(t)},Ze=function(e){return e&&e.parentNode?e.parentNode.removeChild(e):null},At=function(e,t){const o=t.nextSibling;if(t=t.parentNode,!t)throw Error("Reference node has no parent.");o?t.insertBefore(e,o):t.appendChild(e)},Qo=function(e,t){e.style.transform=t,e.style["-webkit-transform"]=t},io=function(){Eh++,Es||(Es=Object.create(null))},no=function(){Eh--,Eh||(Es=null)},Un=function(e){const t=e.textContent+` `+e.className.baseVal;let o;if(Es&&(o=Es[t]))return o;try{o=e.getComputedTextLength()}catch{return 8*e.textContent.length}return Es&&(Es[t]=o),o},Io=function(e,t,o,n){return Bs(e,t+"pt",o,n)},Bs=function(e,t,o,n){const u=e.textContent;e=u+` -`+e.className.baseVal;var g;return Es&&(g=Es[e])||(cl||(g=document.createElement("canvas"),g.className="blocklyComputeCanvas",document.body.appendChild(g),cl=g.getContext("2d")),cl.font=o+" "+t+" "+n,g=u?cl.measureText(u).width:0,Es&&(Es[e]=g)),g},ro=function(e,t,o,n){const u=document.createElement("span");u.style.font=o+" "+t+" "+n,u.textContent=e,e=document.createElement("div"),e.style.width="1px",e.style.height="0",t=document.createElement("div"),t.style.display="flex",t.style.position="fixed",t.style.top="0",t.style.left="0",t.appendChild(u),t.appendChild(e),document.body.appendChild(t),o={height:0,baseline:0};try{t.style.alignItems="baseline",o.baseline=e.offsetTop-u.offsetTop,t.style.alignItems="flex-end",o.height=e.offsetTop-u.offsetTop}finally{document.body.removeChild(t)}return o},Hn=function(e){return Pb.getSizeInternal(e)},Km=function(e){if(Fs(e,"display")!=="none")return pu(e);const t=e.style,o=t.display,n=t.visibility,u=t.position;t.visibility="hidden",t.position="absolute",t.display="inline";const g=e.offsetWidth;return e=e.offsetHeight,t.display=o,t.position=u,t.visibility=n,new Xe(g,e)},pu=function(e){return new Xe(e.offsetWidth,e.offsetHeight)},Fs=function(e,t){return e=window.getComputedStyle(e),e[t]||e.getPropertyValue(t)},xo=function(e){const t=new ye(0,0);e=e.getBoundingClientRect();var o=document.documentElement;return o=new ye(window.pageXOffset||o.scrollLeft,window.pageYOffset||o.scrollTop),t.x=e.left+o.x,t.y=e.top+o.y,t},gu=function(){const e=document.body,t=document.documentElement;return new ye(e.scrollLeft||t.scrollLeft,e.scrollTop||t.scrollTop)},mu=function(e){const t=parseFloat(Fs(e,"borderLeftWidth")),o=parseFloat(Fs(e,"borderRightWidth")),n=parseFloat(Fs(e,"borderTopWidth"));return e=parseFloat(Fs(e,"borderBottomWidth")),new rt(n,e,t,o)},ma=function(e,t,o){e=fu(e,t,o),t.scrollLeft=e.x,t.scrollTop=e.y},fu=function(e,t,o){var n=xo(e),u=xo(t),g=mu(t);const I=n.x-u.x-g.left;return n=n.y-u.y-g.top,u=pu(e),e=t.clientWidth-u.width,u=t.clientHeight-u.height,g=t.scrollLeft,t=t.scrollTop,o?(g+=I-e/2,t+=n-u/2):(g+=Math.min(I,Math.max(I-e,0)),t+=Math.min(n,Math.max(n-u,0))),new ye(g,t)},Wn=function(e){const t=new ye(0,0);var o=e.x&&e.getAttribute("x");const n=e.y&&e.getAttribute("y");return o&&(t.x=parseInt(o)),n&&(t.y=parseInt(n)),(o=(o=e.getAttribute("transform"))&&o.match(Bb))&&(t.x+=Number(o[1]),o[3]&&(t.y+=Number(o[3]))),(e=e.getAttribute("style"))&&e.includes("translate")&&(e=e.match(Fb))&&(t.x+=Number(e[1]),e[3]&&(t.y+=Number(e[3]))),t},fa=function(e){let t=0,o=0;for(;e;){const n=Wn(e);if(t+=n.x,o+=n.y,(" "+(e.getAttribute("class")||"")+" ").includes(" injectionDiv "))break;e=e.parentNode}return new ye(t,o)},$u=function(){const e=gu();return new rt(e.y,document.documentElement.clientHeight+e.y,e.x,document.documentElement.clientWidth+e.x)},bu=function(){const e=document.documentElement,t=window;return new ye(t.pageXOffset||e.scrollLeft,t.pageYOffset||e.scrollTop)},Ym=function(e,t){var o=t.x;t=t.y;const n=e.getInjectionDiv().getBoundingClientRect();return o=new ye(o-n.left,t-n.top),t=e.getOriginOffsetInPixels(),ye.difference(o,t).scale(1/e.scale)},Jm=function(e,t){var o=t.scale(e.scale);t=o.x,o=o.y;const n=e.getInjectionDiv().getBoundingClientRect();return e=e.getOriginOffsetInPixels(),new ye(t+n.left+e.x,o+n.top+e.y)},qm=function(e){({document:dl=dl,DOMParser:gr=gr,XMLSerializer:mr=mr}=e),ul=new gr,Ih=new mr},i.createElement$$module$build$src$core$utils$xml=function(e){return dl.createElementNS(jb,e)},i.createTextNode$$module$build$src$core$utils$xml=function(e){return dl.createTextNode(e)},i.textToDom$$module$build$src$core$utils$xml=function(e){let t=ul.parseFromString(e,"text/xml");if(t&&t.documentElement&&!t.getElementsByTagName("parsererror").length)return t.documentElement;if((t=ul.parseFromString(e,"text/html"))&&t.body.firstChild&&t.body.firstChild.nodeName.toLowerCase()==="xml")return t.body.firstChild;throw Error(`DOMParser was unable to parse: ${e}`)},Li=function(e){return Xm(Ih.serializeToString(e))},Xm=function(e){return e.replace(zC,t=>`&#${t.charCodeAt(0)};`)},$a=function(e){return e?((e instanceof Element||typeof e=="string")&&(e=yu(e),e=ef(e)),Zm(e),e):null},Zm=function(e){const t=e.kind;if(e=e.contents,t&&t!==zb&&t!==xh)throw Error("Invalid toolbox kind "+t+". Please supply either "+zb+" or "+xh);if(!e)throw Error("Toolbox must have a contents attribute.")},Gn=function(e){return e?e.contents?e.contents:Array.isArray(e)&&0o.kind.toUpperCase()==="CATEGORY").length},va=function(e){return e&&e.contents?!!e.contents.filter(function(t){return t.kind.toUpperCase()==="CATEGORY"}).length:!1},ef=function(e){const t={contents:ya(e)};return e instanceof Node&&vu(e,t),t},ya=function(e){const t=[];let o=e.childNodes;o||(o=e);for(let n=0,u;u=o[n];n++){if(!u.tagName)continue;e={};const g=u.tagName.toUpperCase();e.kind=g,g==="BLOCK"?e.blockxml=u:u.childNodes&&0 document.")}else e instanceof Element&&(t=e);return t},_a=function(e,t,o,n,u,g){const I=g.scrollbar&&g.scrollbar.canScrollVertically();return e.horizontal===Zi.LEFT?(o=u.absoluteMetrics.left+o,I&&g.RTL&&(o+=yt.scrollbarThickness)):(o=u.absoluteMetrics.left+u.viewMetrics.width-t.width-o,I&&!g.RTL&&(o-=yt.scrollbarThickness)),e.vertical===$o.TOP?e=u.absoluteMetrics.top+n:(e=u.absoluteMetrics.top+u.viewMetrics.height-t.height-n,g.scrollbar&&g.scrollbar.canScrollHorizontally()&&(e-=yt.scrollbarThickness)),new rt(e,e+t.height,o,o+t.width)},wa=function(e,t){return{horizontal:t.toolboxMetrics.position===Ge.LEFT||e.horizontalLayout&&!e.RTL?Zi.RIGHT:Zi.LEFT,vertical:t.toolboxMetrics.position===Ge.BOTTOM?$o.TOP:$o.BOTTOM}},ka=function(e,t,o,n){const u=e.left,g=e.right-e.left,I=e.bottom-e.top;for(let L=0;Lg.id!==e.id).map(g=>g.getRelativeToSurfaceXY());for(;nf(ye.sum(o,n),u);)n.translate(t.RTL?-30:30,30);e.moveTo(ye.sum(o,n))},nf=function(e,t){return t.some(o=>1>=Math.abs(o.x-e.x)&&1>=Math.abs(o.y-e.y))},Do=function(e,t){e.setAttribute(WC,t)},xt=function(e,t,o){Array.isArray(o)&&(o=o.join(" ")),e.setAttribute(HC+t,`${o}`)},Yn=function(e){return e.saveState!==void 0&&e.loadState!==void 0},_u=function(e){return wu(e),rf()?(Ta(),Promise.resolve()):(Qi||(Qi=new Promise(t=>{Ph=t,Jb=window.requestAnimationFrame(()=>{Ta(),t()})})),Qi)},Ts=function(){return Qi||Promise.resolve()},ao=function(e){e||window.cancelAnimationFrame(Jb),Ta(e),!e&&Ph&&Ph()},rf=function(){return Db},wu=function(e){Mh.add(e),Lh.set(e,i.getGroup$$module$build$src$core$events$utils());const t=e.getParent();t?wu(t):ml.add(e)},Ta=function(e){const t=e?new Set([e]):new Set([...ml].map(g=>g.workspace)),o=[...ml].filter(af).filter(g=>t.has(g.workspace));for(var n of o)Cu(n);for(const g of t)g.resizeContents();for(var u of o)n=u.getRelativeToSurfaceXY(),u.updateComponentLocations(n);for(const g of o)u=i.getGroup$$module$build$src$core$events$utils(),(n=Lh.get(g))&&i.setGroup$$module$build$src$core$events$utils(n),g.bumpNeighbours(),i.setGroup$$module$build$src$core$events$utils(u);for(const g of o)ku(g);e||(Qi=null)},ku=function(e){ml.delete(e),Mh.delete(e),Lh.delete(e);for(const t of e.getChildren(!1))ku(t)},af=function(e){return!e.isDisposed()&&!e.getParent()},Cu=function(e){if(Mh.has(e)&&e.initialized){for(const t of e.getChildren(!1))Cu(t);e.renderEfficiently()}},Jn=function(e,t){qb(e,t)},lf=function(e){qb=e},Sa=function(e,t){Qb.confirmInternal(e,t)},cf=function(e,t){Xb(e,t)},uf=function(e){Xb=e},Ea=function(e,t,o){Zb(e,t,o)},df=function(e){Zb=e},Bi=function(e){return e.getProcedureDef!==void 0},hf=function(e){return e.getProcedureCall!==void 0&&e.renameProcedure!==void 0},Tu=function(e){return e.getVariableModel!==void 0},i.allUsedVarModels$$module$build$src$core$variables=function(e){e=e.getAllBlocks(!1);const t=new Set;for(let o=0;o1'),n.appendChild(o),t.push(n)),Zt.variables_get){e.sort(vr.compareByName);for(let u=0,g;g=e[u];u++)o=i.createElement$$module$build$src$core$utils$xml("block"),o.setAttribute("type","variables_get"),o.setAttribute("gap","8"),o.appendChild(ei(g)),t.push(o)}}return t},Eu=function(e){return tv.generateUniqueNameInternal(e)},pf=function(e){return xa(zh.charAt(0),e.getAllVariableNames())},xa=function(e,t){if(!t.length)return e;const o=zh;let n="",u=o.indexOf(e);for(;;){let g=!1;for(let I=0;Ig.getVariableModel().name);if(n&&(o=n.some(g=>g.toLowerCase()===e),n=n.some(g=>g.toLowerCase()===t),o&&n))return u.getName()}return null},ff=function(e,t,o){e=e.toLowerCase(),t=t.toLowerCase(),o=o.getAllBlocks(!1);for(const u of o){if(!Bi(u))continue;o=u.getProcedureDef();var n=o[1];const g=n.some(I=>I.toLowerCase()===e);if(n=n.some(I=>I.toLowerCase()===t),g&&n)return o[0]}return null},ei=function(e){const t=i.createElement$$module$build$src$core$utils$xml("field");return t.setAttribute("name","VAR"),t.setAttribute("id",e.getId()),t.setAttribute("variabletype",e.type),e=i.createTextNode$$module$build$src$core$utils$xml(e.name),t.appendChild(e),t},i.getOrCreateVariablePackage$$module$build$src$core$variables=function(e,t,o,n){let u=i.getVariable$$module$build$src$core$variables(e,t,o,n);return u||(u=$f(e,t,o,n)),u},i.getVariable$$module$build$src$core$variables=function(e,t,o,n){const u=e.getPotentialVariableMap();let g=null;if(t&&(g=e.getVariableById(t),!g&&u&&(g=u.getVariableById(t)),g))return g;if(o){if(n===void 0)throw Error("Tried to look up a variable by name without a type");g=e.getVariable(o,n),!g&&u&&(g=u.getVariable(o,n))}return g},$f=function(e,t,o,n){const u=e.getPotentialVariableMap();return o||(o=Eu(e.isFlyout?e.targetWorkspace:e)),u?u.createVariable(o,n,t):e.createVariable(o,n,t)},qn=function(e,t){e=e.getAllVariables();const o=[];if(t.length!==e.length)for(let n=0;n{le.disposed||le.setConnectionTracking(!0)},1)}return L},Au=function(e,t,{parentConnection:o,isShadow:n=!1}={}){if(!e.type)throw new sv(e);const u=t.newBlock(e.type,e.id);return u.setShadow(n),Sf(u,e),Ef(u,e),If(u,e),xf(o,u,e),Df(u,e),Af(u,e),Of(u,e),Rf(u,e),Nf(u,t.rendered),u},Tf=function(e,t){if(C())for(e=qn(e,t),t=0;t`&#${t.charCodeAt(0)};`)},$a=function(e){return e?((e instanceof Element||typeof e=="string")&&(e=yu(e),e=ef(e)),Zm(e),e):null},Zm=function(e){const t=e.kind;if(e=e.contents,t&&t!==zb&&t!==xh)throw Error("Invalid toolbox kind "+t+". Please supply either "+zb+" or "+xh);if(!e)throw Error("Toolbox must have a contents attribute.")},Gn=function(e){return e?e.contents?e.contents:Array.isArray(e)&&0o.kind.toUpperCase()==="CATEGORY").length},va=function(e){return e&&e.contents?!!e.contents.filter(function(t){return t.kind.toUpperCase()==="CATEGORY"}).length:!1},ef=function(e){const t={contents:ya(e)};return e instanceof Node&&vu(e,t),t},ya=function(e){const t=[];let o=e.childNodes;o||(o=e);for(let n=0,u;u=o[n];n++){if(!u.tagName)continue;e={};const g=u.tagName.toUpperCase();e.kind=g,g==="BLOCK"?e.blockxml=u:u.childNodes&&0 document.")}else e instanceof Element&&(t=e);return t},_a=function(e,t,o,n,u,g){const I=g.scrollbar&&g.scrollbar.canScrollVertically();return e.horizontal===Zi.LEFT?(o=u.absoluteMetrics.left+o,I&&g.RTL&&(o+=yt.scrollbarThickness)):(o=u.absoluteMetrics.left+u.viewMetrics.width-t.width-o,I&&!g.RTL&&(o-=yt.scrollbarThickness)),e.vertical===$o.TOP?e=u.absoluteMetrics.top+n:(e=u.absoluteMetrics.top+u.viewMetrics.height-t.height-n,g.scrollbar&&g.scrollbar.canScrollHorizontally()&&(e-=yt.scrollbarThickness)),new rt(e,e+t.height,o,o+t.width)},wa=function(e,t){return{horizontal:t.toolboxMetrics.position===Ge.LEFT||e.horizontalLayout&&!e.RTL?Zi.RIGHT:Zi.LEFT,vertical:t.toolboxMetrics.position===Ge.BOTTOM?$o.TOP:$o.BOTTOM}},ka=function(e,t,o,n){const u=e.left,g=e.right-e.left,I=e.bottom-e.top;for(let L=0;Lg.id!==e.id).map(g=>g.getRelativeToSurfaceXY());for(;nf(ye.sum(o,n),u);)n.translate(t.RTL?-30:30,30);e.moveTo(ye.sum(o,n))},nf=function(e,t){return t.some(o=>1>=Math.abs(o.x-e.x)&&1>=Math.abs(o.y-e.y))},Do=function(e,t){e.setAttribute(WC,t)},xt=function(e,t,o){Array.isArray(o)&&(o=o.join(" ")),e.setAttribute(HC+t,`${o}`)},Yn=function(e){return e.saveState!==void 0&&e.loadState!==void 0},_u=function(e){return wu(e),rf()?(Ta(),Promise.resolve()):(Qi||(Qi=new Promise(t=>{Ph=t,Jb=window.requestAnimationFrame(()=>{Ta(),t()})})),Qi)},Ts=function(){return Qi||Promise.resolve()},ao=function(e){e||window.cancelAnimationFrame(Jb),Ta(e),!e&&Ph&&Ph()},rf=function(){return Db},wu=function(e){Mh.add(e),Lh.set(e,i.getGroup$$module$build$src$core$events$utils());const t=e.getParent();t?wu(t):ml.add(e)},Ta=function(e){const t=e?new Set([e]):new Set([...ml].map(g=>g.workspace)),o=[...ml].filter(af).filter(g=>t.has(g.workspace));for(var n of o)Cu(n);for(const g of t)g.resizeContents();for(var u of o)n=u.getRelativeToSurfaceXY(),u.updateComponentLocations(n);for(const g of o)u=i.getGroup$$module$build$src$core$events$utils(),(n=Lh.get(g))&&i.setGroup$$module$build$src$core$events$utils(n),g.bumpNeighbours(),i.setGroup$$module$build$src$core$events$utils(u);for(const g of o)ku(g);e||(Qi=null)},ku=function(e){ml.delete(e),Mh.delete(e),Lh.delete(e);for(const t of e.getChildren(!1))ku(t)},af=function(e){return!e.isDisposed()&&!e.getParent()},Cu=function(e){if(Mh.has(e)&&e.initialized){for(const t of e.getChildren(!1))Cu(t);e.renderEfficiently()}},Jn=function(e,t){qb(e,t)},lf=function(e){qb=e},Sa=function(e,t){Qb.confirmInternal(e,t)},cf=function(e,t){Xb(e,t)},uf=function(e){Xb=e},Ea=function(e,t,o){Zb(e,t,o)},df=function(e){Zb=e},Bi=function(e){return e.getProcedureDef!==void 0},hf=function(e){return e.getProcedureCall!==void 0&&e.renameProcedure!==void 0},Tu=function(e){return e.getVariableModel!==void 0},i.allUsedVarModels$$module$build$src$core$variables=function(e){e=e.getAllBlocks(!1);const t=new Set;for(let o=0;o1'),n.appendChild(o),t.push(n)),Qt.variables_get){e.sort(vr.compareByName);for(let u=0,g;g=e[u];u++)o=i.createElement$$module$build$src$core$utils$xml("block"),o.setAttribute("type","variables_get"),o.setAttribute("gap","8"),o.appendChild(ei(g)),t.push(o)}}return t},Eu=function(e){return tv.generateUniqueNameInternal(e)},pf=function(e){return xa(zh.charAt(0),e.getAllVariableNames())},xa=function(e,t){if(!t.length)return e;const o=zh;let n="",u=o.indexOf(e);for(;;){let g=!1;for(let I=0;Ig.getVariableModel().name);if(n&&(o=n.some(g=>g.toLowerCase()===e),n=n.some(g=>g.toLowerCase()===t),o&&n))return u.getName()}return null},ff=function(e,t,o){e=e.toLowerCase(),t=t.toLowerCase(),o=o.getAllBlocks(!1);for(const u of o){if(!Bi(u))continue;o=u.getProcedureDef();var n=o[1];const g=n.some(I=>I.toLowerCase()===e);if(n=n.some(I=>I.toLowerCase()===t),g&&n)return o[0]}return null},ei=function(e){const t=i.createElement$$module$build$src$core$utils$xml("field");return t.setAttribute("name","VAR"),t.setAttribute("id",e.getId()),t.setAttribute("variabletype",e.type),e=i.createTextNode$$module$build$src$core$utils$xml(e.name),t.appendChild(e),t},i.getOrCreateVariablePackage$$module$build$src$core$variables=function(e,t,o,n){let u=i.getVariable$$module$build$src$core$variables(e,t,o,n);return u||(u=$f(e,t,o,n)),u},i.getVariable$$module$build$src$core$variables=function(e,t,o,n){const u=e.getPotentialVariableMap();let g=null;if(t&&(g=e.getVariableById(t),!g&&u&&(g=u.getVariableById(t)),g))return g;if(o){if(n===void 0)throw Error("Tried to look up a variable by name without a type");g=e.getVariable(o,n),!g&&u&&(g=u.getVariable(o,n))}return g},$f=function(e,t,o,n){const u=e.getPotentialVariableMap();return o||(o=Eu(e.isFlyout?e.targetWorkspace:e)),u?u.createVariable(o,n,t):e.createVariable(o,n,t)},qn=function(e,t){e=e.getAllVariables();const o=[];if(t.length!==e.length)for(let n=0;n{le.disposed||le.setConnectionTracking(!0)},1)}return L},Au=function(e,t,{parentConnection:o,isShadow:n=!1}={}){if(!e.type)throw new sv(e);const u=t.newBlock(e.type,e.id);return u.setShadow(n),Sf(u,e),Ef(u,e),If(u,e),xf(o,u,e),Df(u,e),Af(u,e),Rf(u,e),Of(u,e),Nf(u,t.rendered),u},Tf=function(e,t){if(C())for(e=qn(e,t),t=0;tt&&(t=o[n].length);var u=-1/0;let g,I=1;do{n=u,g=e,e=[],u=o.length/I;let L=1;for(let le=0;len);return g},Ma=function(e,t,o){const n=[0],u=[];for(var g=0;gn&&(n=L,u=I)}return u?Ju(e,u,o):t},Ff=function(e,t){const o=[];for(let n=0;nhv&&co()}else Cr!==hs&&(clearTimeout(bi),Vh=e.pageX,Kh=e.pageY,bi=setTimeout(Jf,pv))},Qu=function(){Cr=hs=null,co()},co=function(){kr&&(kr=!1,Tt&&(Tt.style.display="none")),bi&&(clearTimeout(bi),bi=0)},ed=function(){co(),rn=!0},td=function(){rn=!1},Vf=function(){Tt&&hs&&(typeof yl=="function"?yl(Tt,hs):Kf())},Kf=function(){var e=Hi(hs);e=i.wrap$$module$build$src$core$utils$string(e,uv),e=e.split(` -`);for(let t=0;to+window.scrollY&&(u-=Tt.offsetHeight+2*Jh),e?n=Math.max(_l-window.scrollX,n):n+Tt.offsetWidth>t+window.scrollX-2*_l&&(n=t-Tt.offsetWidth-2*_l),{x:n,y:u}},Jf=function(){if(!rn&&(Cr=hs,Tt)){Tt.textContent="",Vf();var e=hs.RTL;Tt.style.direction=e?"rtl":"ltr",Tt.style.display="block",kr=!0;var{x:t,y:o}=Yf(e);Tt.style.left=t+"px",Tt.style.top=o+"px"}},sd=function(){return qh},qf=function(e){qh=e},od=function(){return Xh},Xf=function(e){Xh=e},ti=function(e){e=`${e}`.toLowerCase().trim();var t=gv[e];if(t||(t=e.substring(0,2)==="0x"?"#"+e.substring(2):e,t=t[0]==="#"?t:"#"+t,/^#[0-9a-f]{6}$/.test(t)))return t;if(/^#[0-9a-f]{3}$/.test(t))return["#",t[1],t[1],t[2],t[2],t[3],t[3]].join("");var o=e.match(/^(?:rgb)?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);return o&&(e=Number(o[1]),t=Number(o[2]),o=Number(o[3]),0<=e&&256>e&&0<=t&&256>t&&0<=o&&256>o)?er(e,t,o):null},er=function(e,t,o){return t=e<<16|t<<8|o,16>e?"#"+(16777216|t).toString(16).substr(1):"#"+t.toString(16)},Pa=function(e){return e=ti(e),e?(e=parseInt(e.substr(1),16),[e>>16,e>>8&255,e&255]):[0,0,0]},Ba=function(e,t,o){let n=0,u=0,g=0;if(t===0)g=u=n=o;else{const I=Math.floor(e/60),L=e/60-I;e=o*(1-t);const le=o*(1-t*L);switch(t=o*(1-t*(1-L)),I){case 1:n=le,u=o,g=e;break;case 2:n=e,u=o,g=t;break;case 3:n=e,u=le,g=o;break;case 4:n=t,u=e,g=o;break;case 5:n=o,u=e,g=le;break;case 6:case 0:n=o,u=t,g=e}}return er(Math.floor(n),Math.floor(u),Math.floor(g))},si=function(e,t,o){return e=ti(e),!e||(t=ti(t),!t)?null:(e=Pa(e),t=Pa(t),er(Math.round(t[0]+o*(e[0]-t[0])),Math.round(t[1]+o*(e[1]-t[1])),Math.round(t[2]+o*(e[2]-t[2]))))},id=function(e){return Ba(e,qh,255*Xh)},Fa=function(e,t,o){const n=[];var u=e.split("");u.push("");var g=0;e=[];let I=null;for(let Ee=0;Ee=L?(g=2,I=L,(L=e.join(""))&&n.push(L),e.length=0):L==="{"?g=3:(e.push("%",L),g=0);else if(g===2)if("0"<=L&&"9">=L)I+=L;else{var le=void 0;n.push(parseInt((le=I)!=null?le:"",10)),Ee--,g=0}else g===3&&(L===""?(e.splice(0,0,"%{"),Ee--,g=0):L!=="}"?e.push(L):(g=e.join(""),/[A-Z]\w*/i.test(g)?(L=g.toUpperCase(),(L=L.startsWith("BKY_")?L.substring(4):null)&&L in i.Msg$$module$build$src$core$msg?(g=i.Msg$$module$build$src$core$msg[L],typeof g=="string"?Array.prototype.push.apply(n,Fa(g,t,o)):t?n.push(`${g}`):n.push(g)):n.push("%{"+g+"}")):n.push("%{"+g+"}"),g=e.length=0))}for((t=e.join(""))&&n.push(t),le=[],e.length=0,u=0;u=o)return{hue:o,hex:Ba(o,sd(),255*od())};if(o=ti(t))return{hue:null,hex:o};throw o='Invalid colour: "'+t+'"',e!==t&&(o+=' (from "'+e+'")'),Error(o)},oi=function(){return xs},Qf=function(e){if(xs=e,e===null){let t;(t=document.querySelector("."+kl))==null||t.remove()}},rd=function(){const e=Te()||document.body;document.querySelector("."+kl)?xs=document.querySelector("."+kl):(xs=document.createElement("div"),xs.className=kl),e.appendChild(xs)},ja=function(e,t,o,n){if(Vi(),an=e,wl=o,o=xs){if(o.style.direction=t?"rtl":"ltr",o.style.display="block",!n&&e instanceof lt){let I;n=(I=e.getSourceBlock())==null?void 0:I.workspace}var u;Zh=(u=n)!=null?u:null;var g;e=(g=n)!=null?g:q(),ln=e.getRenderer().getClassName(),cn=e.getTheme().getClassName(),ln&&Oe(o,ln),cn&&Oe(o,cn)}},Vi=function(){if(ad()){an=null;var e=xs;e&&(e.style.display="none",e.style.left="",e.style.top="",wl&&wl(),wl=null,e.textContent="",ln&&(ze(e,ln),ln=""),cn&&(ze(e,cn),cn=""),q().markFocused())}},ad=function(){return!!an},ii=function(e){an===e&&Vi()},tr=function(e){Zh!==null&&Zh!==e||Vi()},ld=function(e,t,o){xs.style.left=e+"px",xs.style.top=t+"px",xs.style.height=o+"px"},cd=function(e,t,o,n){const u=t$(e,t,o);e=e$(e,t,o,n),0>u?ld(e,0,o.height+u):ld(e,u,o.height)},e$=function(e,t,o,n){return n?Math.min(Math.max(t.right-o.width,e.left),e.right-o.width):Math.max(Math.min(t.left,e.right-o.width),e.left)},t$=function(e,t,o){return t.bottom+o.height>=e.bottom?t.top-o.height:t.bottom},s$=function(e){return!(e==null||!e.repositionForWindowResize)},ud=function(){s$(an)&&an.repositionForWindowResize()||Vi()},o$=function(){return Cl},dd=function(e){Cl=e},sr=function(e,t,o,n){if(ja(mv,o,hd,n),t.length){var u=i$(t,o,e);Tl=u,n$(u,e,o),setTimeout(function(){u.focus()},1),Cl=null}else or()},i$=function(e,t,o){const n=new Rh;n.setRole(Is.MENU);for(let u=0;u{setTimeout(()=>{g.callback(g.scope,o)},0)})},{})}return n},n$=function(e,t,o){const n=$u();t=new rt(t.clientY+n.top,t.clientY+n.top,t.clientX+n.left,t.clientX+n.left),r$(e);const u=e.getSize();o&&(t.left+=u.width,t.right+=u.width,n.left+=u.width,n.right+=u.width),cd(n,t,u,o),e.focus()},r$=function(e){var t=oi();if(!t)throw Error("Attempting to create a context menu when widget div is null");t=e.render(t),Oe(t,"blocklyContextMenu"),H(t,"contextmenu",null,a$),e.focus()},a$=function(e){e.preventDefault(),e.stopPropagation()},or=function(){ii(mv),Cl=null},hd=function(){Tl&&(Tl.dispose(),Tl=null)},i.callbackFactory$$module$build$src$core$contextmenu=function(e,t){return()=>{i.disable$$module$build$src$core$events$utils();let o;try{o=t instanceof Element?ni(t,e.workspace):ji(t,e.workspace);const n=e.getRelativeToSurfaceXY();n.x=e.RTL?n.x-i.config$$module$build$src$core$config.snapRadius:n.x+i.config$$module$build$src$core$config.snapRadius,n.y+=2*i.config$$module$build$src$core$config.snapRadius,o.moveBy(n.x,n.y)}finally{i.enable$$module$build$src$core$events$utils()}return C()&&!o.isShadow()&&z(new(ne(ee.BLOCK_CREATE))(o)),i.setSelected$$module$build$src$core$common(o),o}},pd=function(e,t){return t=fe(t,e.getParentSvg(),e.getInverseScreenCTM()),t.x/=e.scale,t.y/=e.scale,t},za=function(e,t,o){t=pd(e,t),$v.set(e,ye.difference(o,t))},Ua=function(e,t){if(t=pd(e,t),e=$v.get(e),!e)throw Error("Drag not initialized");return ye.sum(e,t)},l$=function(e,t=!1){const o=i.createElement$$module$build$src$core$utils$xml("xml");var n=gd(i.allUsedVarModels$$module$build$src$core$variables(e));n.hasChildNodes()&&o.appendChild(n);for(const u of e.getTopComments())o.appendChild(ir(u,t));for(e=e.getTopBlocks(!0),n=0;n/g,"<$1$2>")},d$=function(e){e=zs(e).split("<");let t="";for(let o=1;o"&&(t+=" ")}return e=e.join(` -`),e=e.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1"),e.replace(/^\n/,"")},h$=function(e,t){return t.setResizesEnabled(!1),t.clear(),e=i.domToWorkspace$$module$build$src$core$xml(e,t),t.setResizesEnabled(!0),e},i.domToWorkspace$$module$build$src$core$xml=function(e,t){let o=0;t.RTL&&(o=t.getWidth());const n=[];io();const u=i.getGroup$$module$build$src$core$events$utils();u||i.setGroup$$module$build$src$core$events$utils(!0),t.setResizesEnabled&&t.setResizesEnabled(!1);let g=!0;try{for(let I=0,L;L=e.childNodes[I];I++){const le=L.nodeName.toLowerCase(),Ee=L;if(le==="block"||le==="shadow"&&!G()){const dt=ni(Ee,t);n.push(dt.id);let ut;const es=parseInt((ut=Ee.getAttribute("x"))!=null?ut:"10",10);let yn;const jr=parseInt((yn=Ee.getAttribute("y"))!=null?yn:"10",10);isNaN(es)||isNaN(jr)||dt.moveBy(t.RTL?o-es:es,jr,["create"]),g=!1}else{if(le==="shadow")throw TypeError("Shadow block cannot be a top-level block.");if(le==="comment")fd(Ee,t);else if(le==="variables"){if(g)$d(Ee,t);else throw Error("'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location.");g=!1}}}}finally{i.setGroup$$module$build$src$core$events$utils(u),t.setResizesEnabled&&t.setResizesEnabled(!0),t.rendered&&ao(),no()}return z(new(ne(ee.FINISHED_LOADING))(t)),n},fd=function(e,t){var o;const n=(o=e.getAttribute("id"))!=null?o:void 0;o=t.rendered?new Il(t,n):new El(t,n);var u;o.setText((u=e.textContent)!=null?u:"");var g;u=parseInt((g=e.getAttribute("x"))!=null?g:"",10);let I;g=parseInt((I=e.getAttribute("y"))!=null?I:"",10),isNaN(u)||isNaN(g)||(u=t.RTL?t.getWidth()-u:u,o.moveTo(new ye(u,g)));var L;t=parseInt((L=e.getAttribute("w"))!=null?L:"",10);let le;return L=parseInt((le=e.getAttribute("h"))!=null?le:"",10),isNaN(t)||isNaN(L)||o.setSize(new Xe(t,L)),e.getAttribute("collapsed")==="true"&&o.setCollapsed(!0),e.getAttribute("editable")==="false"&&o.setEditable(!1),e.getAttribute("movable")==="false"&&o.setMovable(!1),e.getAttribute("deletable")==="false"&&o.setDeletable(!1),o},p$=function(e,t){if(!t.getBlocksBoundingBox)return i.domToWorkspace$$module$build$src$core$xml(e,t);var o=t.getBlocksBoundingBox();if(e=i.domToWorkspace$$module$build$src$core$xml(e,t),o&&o.top!==o.bottom){var n=o.bottom;o=t.RTL?o.right:o.left;var u=1/0;let g=-1/0,I=1/0;for(let L=0;Lg&&(g=le.x)}for(n=n-I+10,o=t.RTL?o-g:o-u,u=0;uEe.setBubbleVisible(g),1)}},$$=function(e,t){for(let o=0;ou}),yd(u,{x:n.x,y:n.y,width:e.width,height:e.height},t.RTL,new Date)}},yd=function(e,t,o,n){const u=(new Date().getTime()-n.getTime())/150;1o)){var n=t.getSvgXY(e.getSvgRoot());e.outputConnection?(n.x+=(e.RTL?3:-3)*o,n.y+=13*o):e.previousConnection&&(n.x+=(e.RTL?-23:23)*o,n.y+=3*o);var u=ie(J.CIRCLE,{cx:n.x,cy:n.y,r:0,fill:"none",stroke:"#888","stroke-width":10},t.getParentSvg());e=ie(J.ANIMATE,{id:"animationCircle",begin:"indefinite",attributeName:"r",dur:"150ms",from:0,to:25*o},u),t=ie(J.ANIMATE,{id:"animationOpacity",begin:"indefinite",attributeName:"opacity",dur:"150ms",from:1,to:0},u),e.beginElement(),t.beginElement(),setTimeout(()=>{Ze(u)},150)}},_d=function(e){if(Ki(),e.workspace.getAudioManager().play("disconnect"),!(1>e.workspace.scale)){var t=e.getHeightWidth().height;t=Math.atan(10/t)/Math.PI*180,e.RTL||(t*=-1),Sr=e,wd(e,t,new Date,0)}},wd=function(e,t,o,n){const u=[.66,1,.66,0,-.66,-1,-.66,0];let g="";o.getTime()+200>new Date().getTime()&&(g=`skewX(${Math.round(u[n%u.length]*t)})`,xl=setTimeout(wd,15,e,t,o,n+1)),e.getSvgRoot().setAttribute("transform",`${e.getTranslation()} ${g}`)},Ki=function(){Sr&&(xl&&(clearTimeout(xl),xl=null),Sr.getSvgRoot().setAttribute("transform",Sr.getTranslation()),Sr=null)},ri=function(e){return e.getRelativeToSurfaceXY!==void 0&&e.isMovable!==void 0&&e.startDrag!==void 0&&e.drag!==void 0&&e.endDrag!==void 0&&e.revertDrag!==void 0},uo=function(e,t){for(const o in t)e[o]=t[o]!==null&&typeof t[o]=="object"?uo(e[o]||Object.create(null),t[o]):t[o];return e},Us=function(e,t){r($e.FIELD,e,t)},k$=function(e){c($e.FIELD,e)},i.fromJson$$module$build$src$core$field_registry=function(e){return _v.fromJsonInternal(e)},C$=function(e){const t=f($e.FIELD,e.type);return t?t.fromJson(e):(console.warn("Blockly could not create a field of type "+e.type+". The field is probably not being registered. This could be because the file is not loaded, the field does not register itself (Issue #1584), or the registration is not being reached."),null)},i.register$$module$build$src$core$extensions=function(e,t){if(typeof e!="string"||e.trim()==="")throw Error('Error: Invalid extension name "'+e+'"');if(dn[e])throw Error('Error: Extension "'+e+'" is already registered.');if(typeof t!="function")throw Error('Error: Extension "'+e+'" must be a function');dn[e]=t},i.registerMixin$$module$build$src$core$extensions=function(e,t){if(!t||typeof t!="object")throw Error('Error: Mixin "'+e+'" must be a object');i.register$$module$build$src$core$extensions(e,function(){this.mixin(t)})},i.registerMutator$$module$build$src$core$extensions=function(e,t,o,n){const u='Error when registering mutator "'+e+'": ';Td(u,t);const g=Cd(t,u);if(o&&typeof o!="function")throw Error(u+'Extension "'+e+'" is not a function');i.register$$module$build$src$core$extensions(e,function(){g&&this.setMutator(new i.MutatorIcon$$module$build$src$core$icons$mutator_icon(n||[],this)),this.mixin(t),o&&o.apply(this)})},T$=function(e){kd(e)?delete dn[e]:console.warn('No extension mapping for name "'+e+'" found to unregister')},kd=function(e){return!!dn[e]},Va=function(e,t,o){const n=dn[e];if(typeof n!="function")throw Error('Error: Extension "'+e+'" not found.');let u;if(o?S$(e,t):u=Ya(t),n.apply(t),o)Td('Error after applying mutator "'+e+'": ',t);else if(!x$(u,t))throw Error('Error when applying extension "'+e+'": mutation properties changed when applying a non-mutator extension.')},S$=function(e,t){if(Ya(t).length)throw Error('Error: tried to apply mutation "'+e+'" to a block that already has mutator functions. Block id: '+t.id)},E$=function(e,t){return Ka(e.mutationToDom,e.domToMutation,t+" mutationToDom/domToMutation")},I$=function(e,t){return Ka(e.saveExtraState,e.loadExtraState,t+" saveExtraState/loadExtraState")},Cd=function(e,t){return Ka(e.compose,e.decompose,t+" compose/decompose")},Ka=function(e,t,o){if(e&&t){if(typeof e!="function"||typeof t!="function")throw Error(o+" must be a function");return!0}if(!e&&!t)return!1;throw Error(o+"Must have both or neither functions")},Td=function(e,t){const o=E$(t,e),n=I$(t,e);if(!o&&!n)throw Error(e+"Mutations must contain either XML hooks, or JSON hooks, or both");Cd(t,e)},Ya=function(e){const t=[];return e.domToMutation!==void 0&&t.push(e.domToMutation),e.mutationToDom!==void 0&&t.push(e.mutationToDom),e.saveExtraState!==void 0&&t.push(e.saveExtraState),e.loadExtraState!==void 0&&t.push(e.loadExtraState),e.compose!==void 0&&t.push(e.compose),e.decompose!==void 0&&t.push(e.decompose),t},x$=function(e,t){if(t=Ya(t),t.length!==e.length)return!1;for(let o=0;o!n.getReturnTypes()).map(n=>[n.getName(),n.getParameters().map(u=>u.getName()),!1]);e.getBlocksByType("procedures_defnoreturn",!1).forEach(n=>{!Oo(n)&&Bi(n)&&t.push(n.getProcedureDef())});const o=e.getProcedureMap().getProcedures().filter(n=>!!n.getReturnTypes()).map(n=>[n.getName(),n.getParameters().map(u=>u.getName()),!0]);return e.getBlocksByType("procedures_defreturn",!1).forEach(n=>{!Oo(n)&&Bi(n)&&o.push(n.getProcedureDef())}),t.sort(Ed),o.sort(Ed),[t,o]},Ed=function(e,t){return e[0].localeCompare(t[0],void 0,{sensitivity:"base"})},i.findLegalName$$module$build$src$core$procedures=function(e,t){if(t.isInFlyout)return e;for(e=e||i.Msg$$module$build$src$core$msg.UNNAMED_KEY||"unnamed";!N$(e,t.workspace,t);){const o=e.match(/^(.*?)(\d+)$/);e=o?o[1]+(parseInt(o[2])+1):e+"2"}return e},N$=function(e,t,o){return!Id(e,t,o)},Id=function(e,t,o){for(const n of t.getAllBlocks(!1))if(n!==o&&Bi(n)&&i.Names$$module$build$src$core$names.equals(n.getProcedureDef()[0],e))return!0;o=o&&Oo(o)?o==null?void 0:o.getProcedureModel():void 0;for(const n of t.getProcedureMap().getProcedures())if(n!==o&&i.Names$$module$build$src$core$names.equals(n.getName(),e))return!0;return!1},i.rename$$module$build$src$core$procedures=function(e){var t=this.getSourceBlock();if(!t)throw new _t;e=e.trim();const o=i.findLegalName$$module$build$src$core$procedures(e,t);Oo(t)&&!t.isInsertionMarker()&&t.getProcedureModel().setName(o);const n=this.getValue();if(n!==e&&n!==o)for(e=t.workspace.getAllBlocks(!1),t=0;tL$(o,e)||hf(o)&&i.Names$$module$build$src$core$names.equals(o.getProcedureCall(),e))},L$=function(e,t){return Oo(e)&&!e.isProcedureDef()&&e.getProcedureModel()&&i.Names$$module$build$src$core$names.equals(e.getProcedureModel().getName(),t)},i.mutateCallers$$module$build$src$core$procedures=function(e){const t=G();var o=e.getProcedureDef()[0];const n=e.mutationToDom(!0);e=Ad(o,e.workspace);for(let g=0,I;I=e[g];g++){o=(o=I.mutationToDom())&&Li(o),I.domToMutation&&I.domToMutation(n);var u=I.mutationToDom();u=u&&Li(u),o!==u&&(i.setRecordUndo$$module$build$src$core$events$utils(!1),z(new(ne(ee.BLOCK_CHANGE))(I,"mutation",null,o,u)),i.setRecordUndo$$module$build$src$core$events$utils(t))}},i.getDefinition$$module$build$src$core$procedures=function(e,t){for(const o of t.getAllBlocks(!1))if(Oo(o)&&o.isProcedureDef()&&i.Names$$module$build$src$core$names.equals(o.getProcedureModel().getName(),e)||Bi(o)&&i.Names$$module$build$src$core$names.equals(o.getProcedureDef()[0],e))return o;return null},Za=function(e){return e.isDynamic},P$=function(e){return e.pathDown!==void 0&&e.pathUp!==void 0},B$=function(e){return e.pathLeft!==void 0&&e.pathRight!==void 0},F$=function(e,t){if(!e||!t)throw Error("Cannot connect null connections.");e.targetConnection=t,t.targetConnection=e},j$=function(e,t){let o=null;t=t.outputConnection;const n=t==null?void 0:t.getConnectionChecker();for(let u=0,g;g=e.inputList[u];u++){const I=g.connection;let L;if(I&&((L=n)!=null&&L.canConnect(t,I,!1))){if(o)return null;o=I}}return o},z$=function(e,t){let o;for(;o=j$(e,t);)if(e=o.targetBlock(),!e||e.isShadow())return o;return null},Od=function(e){return e.getType!==void 0&&e.initView!==void 0&&e.dispose!==void 0&&e.getWeight!==void 0&&e.getSize!==void 0&&e.applyColour!==void 0&&e.hideForInsertionMarker!==void 0&&e.updateEditable!==void 0&&e.updateCollapsed!==void 0&&e.isShownWhenCollapsed!==void 0&&e.setOffsetInBlock!==void 0&&e.onLocationChange!==void 0&&e.onClick!==void 0},U$=function(e){return Od(e)&&zi(e)&&Yn(e)&&e.setText!==void 0&&e.getText!==void 0&&e.setBubbleSize!==void 0&&e.getBubbleSize!==void 0&&e.getType()===Ct.COMMENT},rr=function(e){let t=e.outputConnection;return(!t||e.previousConnection&&e.previousConnection.isConnected())&&(t=e.previousConnection),t},ar=function(e,t){r($e.RENDERER,e,t)},H$=function(e){c($e.RENDERER,e)},Rd=function(e,t,o){return e=new(p($e.RENDERER,e))(e),e.init(t,o),e},Nd=function(e){Fi(e.getTargetWorkspace(),void 0,"String")},Md=function(e){Fi(e.getTargetWorkspace(),void 0,"Number")},Ld=function(e){Fi(e.getTargetWorkspace(),void 0,"Colour")},Qa=function(e){let t=[],o=document.createElement("button");return o.setAttribute("text",i.Msg$$module$build$src$core$msg.NEW_STRING_VARIABLE),o.setAttribute("callbackKey","CREATE_VARIABLE_STRING"),t.push(o),o=document.createElement("button"),o.setAttribute("text",i.Msg$$module$build$src$core$msg.NEW_NUMBER_VARIABLE),o.setAttribute("callbackKey","CREATE_VARIABLE_NUMBER"),t.push(o),o=document.createElement("button"),o.setAttribute("text",i.Msg$$module$build$src$core$msg.NEW_COLOUR_VARIABLE),o.setAttribute("callbackKey","CREATE_VARIABLE_COLOUR"),t.push(o),e.registerButtonCallback("CREATE_VARIABLE_STRING",Nd),e.registerButtonCallback("CREATE_VARIABLE_NUMBER",Md),e.registerButtonCallback("CREATE_VARIABLE_COLOUR",Ld),e=Pd(e),t=t.concat(e)},Pd=function(e){e=e.getAllVariables();const t=[];if(0L.id!=e.id).map(L=>L.getRelativeToSurfaceXY());for(;G$(ye.sum(t,g),I)||V$(e,ye.sum(u,g),n);)o.RTL?g.translate(-n,2*n):g.translate(n,2*n);e.moveTo(ye.sum(t,g))},G$=function(e,t){return t.some(o=>1>=Math.abs(o.x-e.x)&&1>=Math.abs(o.y-e.y))},V$=function(e,t,o){return e.getConnections_(!1).some(n=>!!n.closest(o,t).connection)},Ji=function(e,t,o){const n=o.getBoundingRectangle(),u=n.right-n.left,g=Ui(t.top,n.top,t.top+t.height-(n.bottom-n.top))-n.top;let I=t.left;return t=t.left+t.width-u,e.RTL?I=Math.min(t,I):t=Math.max(I,t),(e=Ui(I,n.left,t)-n.left)||g?(o.moveBy(e,g,["inbounds"]),!0):!1},Bd=function(e){return t=>{var o=e.getMetricsManager();if(o.hasFixedEdges()&&!e.isDragging()){var n;if(pb.includes((n=t.type)!=null?n:"")){n=o.getScrollMetrics(!0);const u=K$(e,t);u&&(o=i.getGroup$$module$build$src$core$events$utils()||!1,i.setGroup$$module$build$src$core$events$utils(t.group),Ji(e,n,u)&&!t.group&&console.warn("Moved object in bounds but there was no event group. This may break undo."),i.setGroup$$module$build$src$core$events$utils(o))}else W(t)&&t.scale&&t.oldScale&&t.scale>t.oldScale&&el(e)}}},K$=function(e,t){let o=null;switch(t.type){case ee.BLOCK_CREATE:case ee.BLOCK_MOVE:(o=e.getBlockById(t.blockId))&&(o=o.getRootBlock());break;case ee.COMMENT_CREATE:case ee.COMMENT_MOVE:case ee.COMMENT_RESIZE:o=e.getCommentById(t.commentId)}return o},el=function(e){var t=e.getMetricsManager();if(t.hasFixedEdges()&&!e.isDragging()){t=t.getScrollMetrics(!0);var o=e.getTopBoundedElements();for(let n=0,u;u=o[n];n++)Ji(e,t,u)}},ds=function(e){return e.isDeletable!==void 0&&e.dispose!==void 0&&e.setDeleteStyle!==void 0},Y$=function(e){const t=e.toCopyData();Sp=t;let o;return Ep=(o=e.workspace)!=null?o:null,t},Ro=function(e,t,o){return e&&t?Fd(e,t,o):Sp&&Ep?Fd(Sp,Ep):null},Fd=function(e,t,o){let n;t=t.isMutator?t:(n=t.getRootWorkspace())!=null?n:t;let u,g;return(g=(u=f($e.PASTER,e.paster,!1))==null?void 0:u.paste(e,t,o))!=null?g:null},J$=function(e){const t=e.toCopyData();return t?Ro(t,e.workspace):null},lr=function(e){return e.toCopyData!==void 0},jd=function(){st.registry.register({name:Ys.ESCAPE,preconditionFn(e){return!e.options.readOnly},callback(e){return e.hideChaff(),!0},keyCodes:[Ye.ESC]})},zd=function(){st.registry.register({name:Ys.DELETE,preconditionFn(e){const t=j();return!e.options.readOnly&&t!=null&&ds(t)&&t.isDeletable()&&!bo.inProgress()},callback(e,t){return t.preventDefault(),e=j(),e instanceof $s?e.checkAndDelete():ds(e)&&e.isDeletable()&&(i.setGroup$$module$build$src$core$events$utils(!0),e.dispose(),i.setGroup$$module$build$src$core$events$utils(!1)),!0},keyCodes:[Ye.DELETE,Ye.BACKSPACE]})},Ud=function(){const e=st.registry.createSerializedKey(Ye.C,[Ye.CTRL]),t=st.registry.createSerializedKey(Ye.C,[Ye.ALT]),o=st.registry.createSerializedKey(Ye.C,[Ye.META]);st.registry.register({name:Ys.COPY,preconditionFn(n){const u=j();return!n.options.readOnly&&!bo.inProgress()&&u!=null&&ds(u)&&u.isDeletable()&&ri(u)&&u.isMovable()&&lr(u)},callback(n,u){return u.preventDefault(),n.hideChaff(),u=j(),!u||!lr(u)?!1:(Ho=u.toCopyData(),Wo=u.workspace instanceof cs?u.workspace:n,$n=ri(u)?u.getRelativeToSurfaceXY():null,!!Ho)},keyCodes:[e,t,o]})},Hd=function(){const e=st.registry.createSerializedKey(Ye.X,[Ye.CTRL]),t=st.registry.createSerializedKey(Ye.X,[Ye.ALT]),o=st.registry.createSerializedKey(Ye.X,[Ye.META]);st.registry.register({name:Ys.CUT,preconditionFn(n){const u=j();return!n.options.readOnly&&!bo.inProgress()&&u!=null&&ds(u)&&u.isDeletable()&&ri(u)&&u.isMovable()&&!u.workspace.isFlyout},callback(n){const u=j();return u instanceof $s?(Ho=u.toCopyData(),Wo=n,$n=u.getRelativeToSurfaceXY(),u.checkAndDelete(),!0):ds(u)&&u.isDeletable()&&lr(u)?(Ho=u.toCopyData(),Wo=n,$n=ri(u)?u.getRelativeToSurfaceXY():null,u.dispose(),!0):!1},keyCodes:[e,t,o]})},Wd=function(){const e=st.registry.createSerializedKey(Ye.V,[Ye.CTRL]),t=st.registry.createSerializedKey(Ye.V,[Ye.ALT]),o=st.registry.createSerializedKey(Ye.V,[Ye.META]);st.registry.register({name:Ys.PASTE,preconditionFn(n){return!n.options.readOnly&&!bo.inProgress()},callback(){if(!Ho||!Wo)return!1;if(!$n)return!!Ro(Ho,Wo);const{left:n,top:u,width:g,height:I}=Wo.getMetricsManager().getViewMetrics(!0);if(new rt(u,u+I,n,n+g).contains($n.x,$n.y))return!!Ro(Ho,Wo);const L=new ye(n+g/2,u+I/2);return!!Ro(Ho,Wo,L)},keyCodes:[e,t,o]})},Gd=function(){const e=st.registry.createSerializedKey(Ye.Z,[Ye.CTRL]),t=st.registry.createSerializedKey(Ye.Z,[Ye.ALT]),o=st.registry.createSerializedKey(Ye.Z,[Ye.META]);st.registry.register({name:Ys.UNDO,preconditionFn(n){return!n.options.readOnly&&!bo.inProgress()},callback(n,u){return n.hideChaff(),n.undo(!1),u.preventDefault(),!0},keyCodes:[e,t,o]})},Vd=function(){const e=st.registry.createSerializedKey(Ye.Z,[Ye.SHIFT,Ye.CTRL]),t=st.registry.createSerializedKey(Ye.Z,[Ye.SHIFT,Ye.ALT]),o=st.registry.createSerializedKey(Ye.Z,[Ye.SHIFT,Ye.META]),n=st.registry.createSerializedKey(Ye.Y,[Ye.CTRL]);st.registry.register({name:Ys.REDO,preconditionFn(u){return!bo.inProgress()&&!u.options.readOnly},callback(u,g){return u.hideChaff(),u.undo(!0),g.preventDefault(),!0},keyCodes:[e,t,o,n]})},Kd=function(){jd(),zd(),Ud(),Hd(),Wd(),Gd(),Vd()},Yd=function(e){const t=e.saveState();return e.getParameters().length&&(t.parameters=e.getParameters().map(o=>o.saveState())),t},Jd=function(e,t,o,n){if(e=e.loadState(o,n),!o.parameters)return e;for(const[u,g]of o.parameters.entries())e.insertParameter(t.loadState(g,n),u);return e},q$=function(e){const t=Object.create(null),o=b($e.SERIALIZER,!0);for(const n in o){let u;const g=(u=o[n])==null?void 0:u.save(e);g&&(t[n]=g)}return t},X$=function(e,t,{recordUndo:o=!1}={}){var n=b($e.SERIALIZER,!0);if(n){n=Object.entries(n).sort((g,I)=>I[1].priority-g[1].priority);var u=G();i.setRecordUndo$$module$build$src$core$events$utils(o),(o=i.getGroup$$module$build$src$core$events$utils())||i.setGroup$$module$build$src$core$events$utils(!0),io(),t instanceof cs&&t.setResizesEnabled(!1);for(const[,g]of n.reverse()){let I;(I=g)==null||I.clear(t)}for(const[g,I]of n.reverse())if(e[g]){let L;(L=I)==null||L.load(e[g],t)}t instanceof cs&&t.setResizesEnabled(!0),no(),z(new(ne(ee.FINISHED_LOADING))(t)),i.setGroup$$module$build$src$core$events$utils(o),i.setRecordUndo$$module$build$src$core$events$utils(u)}},Z$=function(e,t){let o=null;o=typeof e=="string"?document.getElementById(e)||document.querySelector(e):e;var n;if(!document.contains(o)&&document!==((n=o)==null?void 0:n.ownerDocument))throw Error("Error: container is not in current document");e=new gs(t||{}),n=document.createElement("div"),Oe(n,"injectionDiv"),t!=null&&t.rtl&&Oe(n,"blocklyRTL"),n.tabIndex=0,xt(n,Et.LABEL,i.Msg$$module$build$src$core$msg.WORKSPACE_ARIA_LABEL),o.appendChild(n),t=Q$(n,e);const u=eb(n,t,e);return tb(u),se(u),we(u),n.addEventListener("focusin",function(){se(u)}),H(n,"keydown",null,tl),H(Xn(),"keydown",null,tl),(t=oi())&&H(t,"keydown",null,tl),u},Q$=function(e,t){e.setAttribute("dir","LTR"),Pt(t.hasCss,t.pathToMedia),e=ie(J.SVG,{xmlns:pr,"xmlns:html":Gs,"xmlns:xlink":is,version:"1.1",class:"blocklySvg",tabindex:"0"},e);const o=ie(J.DEFS,{},e),n=String(Math.random()).substring(2);return t.gridPattern=sp.createDom(n,t.gridOptions,o),e},eb=function(e,t,o){o.parentWorkspace=null,o=new cs(o);const n=o.options;o.scale=n.zoomOptions.startScale,t.appendChild(o.createDom("blocklyMainBackground",e));var u=o.getRenderer().getClassName();return u&&Oe(e,u),(u=o.getTheme().getClassName())&&Oe(e,u),!n.hasCategories&&n.languageTree&&(e=o.addFlyout(J.SVG),At(e,t)),n.hasTrashcan&&o.addTrashcan(),n.zoomOptions&&n.zoomOptions.controls&&o.addZoomControls(),o.getThemeManager().subscribe(t,"workspaceBackgroundColour","background-color"),o.translate(0,0),o.addChangeListener(Bd(o)),we(o),rd(),Ru(),Xu(),o},tb=function(e){const t=e.options;var o=e.getParentSvg();if(H(o.parentNode,"contextmenu",null,function(n){be(n)||n.preventDefault()}),o=H(window,"resize",null,function(){co(),e.hideComponents(!0),Vu(),ud(),we(e),el(e)}),e.setResizeHandlerWrapper(o),sb(),t.languageTree){o=e.getToolbox();const n=e.getFlyout(!0);o?o.init():n&&(n.init(e),n.show(t.languageTree),typeof n.scrollToStart=="function"&&n.scrollToStart())}t.hasTrashcan&&e.trashcan.init(),t.zoomOptions&&t.zoomOptions.controls&&e.zoomControls_.init(),t.moveOptions&&t.moveOptions.scrollbars?(e.scrollbar=new xp(e,t.moveOptions.scrollbars===!0||!!t.moveOptions.scrollbars.horizontal,t.moveOptions.scrollbars===!0||!!t.moveOptions.scrollbars.vertical,"blocklyMainWorkspaceScrollbar"),e.scrollbar.resize()):e.setMetrics({x:.5,y:.5}),t.hasSounds&&ob(t.pathToMedia,e)},tl=function(e){const t=q();t&&!(be(e)||t.rendered&&!t.isVisible())&&st.registry.onKeyDown(t,e)},sb=function(){ry||(H(document,"scroll",null,function(){const e=B();for(let t=0,o;o=e[t];t++)o instanceof cs&&o.updateInverseScreenCTM()}),ue(document,"touchend",null,X),ue(document,"touchcancel",null,X)),ry=!0},ob=function(e,t){function o(){for(;u.length;){const g=u.pop();g&&V(g)}n.preload()}const n=t.getAudioManager();n.load([e+"click.mp3",e+"click.wav",e+"click.ogg"],"click"),n.load([e+"disconnect.wav",e+"disconnect.mp3",e+"disconnect.ogg"],"disconnect"),n.load([e+"delete.mp3",e+"delete.ogg",e+"delete.wav"],"delete");const u=[];u.push(H(document,"pointermove",null,o,!0)),u.push(H(document,"touchstart",null,o,!0))},qd=function(){Ke.registry.register({displayText(){return i.Msg$$module$build$src$core$msg.UNDO},preconditionFn(e){return 0t.length?cr(t):Sa(i.Msg$$module$build$src$core$msg.DELETE_ALL_BLOCKS.replace("%1",String(t.length)),function(o){o&&cr(t)})}},scopeType:Ke.ScopeType.WORKSPACE,id:"workspaceDelete",weight:6})},ib=function(){qd(),Xd(),Zd(),eh(),th(),oh()},ih=function(){Ke.registry.register({displayText(){return i.Msg$$module$build$src$core$msg.DUPLICATE_BLOCK},preconditionFn(e){return e=e.block,!e.isInFlyout&&e.isDeletable()&&e.isMovable()?e.isDuplicatable()?"enabled":"disabled":"hidden"},callback(e){if(e.block){var t=e.block.toCopyData();t&&Ro(t,e.block.workspace)}},scopeType:Ke.ScopeType.BLOCK,id:"blockDuplicate",weight:1})},nh=function(){Ke.registry.register({displayText(e){return e.block.hasIcon(_o.TYPE)?i.Msg$$module$build$src$core$msg.REMOVE_COMMENT:i.Msg$$module$build$src$core$msg.ADD_COMMENT},preconditionFn(e){return e=e.block,!e.isInFlyout&&e.workspace.options.comments&&!e.isCollapsed()&&e.isEditable()?"enabled":"hidden"},callback(e){e=e.block,e.hasIcon(_o.TYPE)?e.setCommentText(null):e.setCommentText("")},scopeType:Ke.ScopeType.BLOCK,id:"blockComment",weight:2})},rh=function(){Ke.registry.register({displayText(e){return e.block.getInputsInline()?i.Msg$$module$build$src$core$msg.EXTERNAL_INPUTS:i.Msg$$module$build$src$core$msg.INLINE_INPUTS},preconditionFn(e){if(e=e.block,!e.isInFlyout&&e.isMovable()&&!e.isCollapsed()){for(let t=1;t(t.has(Gt)?1:0),e.getInheritedDisabled()||t?"disabled":"enabled"}return"hidden"},callback(e){e=e.block;const t=i.getGroup$$module$build$src$core$events$utils();t||i.setGroup$$module$build$src$core$events$utils(!0),e.setDisabledReason(!e.hasDisabledReason(Gt),Gt),i.setGroup$$module$build$src$core$events$utils(t)},scopeType:Ke.ScopeType.BLOCK,id:"blockDisable",weight:5})},ch=function(){Ke.registry.register({displayText(e){var t=e.block;return e=t.getDescendants(!1).length,(t=t.getNextBlock())&&(e-=t.getDescendants(!1).length),e===1?i.Msg$$module$build$src$core$msg.DELETE_BLOCK:i.Msg$$module$build$src$core$msg.DELETE_X_BLOCKS.replace("%1",`${e}`)},preconditionFn(e){return!e.block.isInFlyout&&e.block.isDeletable()?"enabled":"hidden"},callback(e){e.block&&e.block.checkAndDelete()},scopeType:Ke.ScopeType.BLOCK,id:"blockDelete",weight:6})},uh=function(){Ke.registry.register({displayText(){return i.Msg$$module$build$src$core$msg.HELP},preconditionFn(e){return e=e.block,(typeof e.helpUrl=="function"?e.helpUrl():e.helpUrl)?"enabled":"hidden"},callback(e){e.block.showHelp()},scopeType:Ke.ScopeType.BLOCK,id:"blockHelp",weight:7})},dh=function(){Ke.registry.register({displayText:()=>i.Msg$$module$build$src$core$msg.REMOVE_COMMENT,preconditionFn(e){let t;return(t=e.comment)!=null&&t.isDeletable()?"enabled":"hidden"},callback(e){i.setGroup$$module$build$src$core$events$utils(!0);let t;(t=e.comment)==null||t.dispose(),i.setGroup$$module$build$src$core$events$utils(!1)},scopeType:Ke.ScopeType.COMMENT,id:"commentDelete",weight:6})},hh=function(){Ke.registry.register({displayText:()=>i.Msg$$module$build$src$core$msg.DUPLICATE_COMMENT,preconditionFn(e){let t;return(t=e.comment)!=null&&t.isMovable()?"enabled":"hidden"},callback(e){if(e.comment){var t=e.comment.toCopyData();t&&Ro(t,e.comment.workspace)}},scopeType:Ke.ScopeType.COMMENT,id:"commentDuplicate",weight:1})},ph=function(){Ke.registry.register({displayText:()=>i.Msg$$module$build$src$core$msg.ADD_COMMENT,preconditionFn:e=>{let t;return(t=e.workspace)!=null&&t.isMutator?"hidden":"enabled"},callback:(e,t)=>{if(e=e.workspace){i.setGroup$$module$build$src$core$events$utils(!0);var o=new Il(e);o.setText(i.Msg$$module$build$src$core$msg.WORKSPACE_COMMENT_DEFAULT_TEXT),o.moveTo(nb(new ye(t.clientX,t.clientY),e)),i.setSelected$$module$build$src$core$common(o),i.setGroup$$module$build$src$core$events$utils(!1)}},scopeType:Ke.ScopeType.WORKSPACE,id:"commentCreate",weight:8})},nb=function(e,t){var o=t.getInjectionDiv().getBoundingClientRect();return e=new ye(e.x-o.left,e.y-o.top),o=t.getOriginOffsetInPixels(),e=ye.difference(e,o),e.scale(1/t.scale),e},rb=function(){ih(),nh(),rh(),ah(),lh(),ch(),uh()},ab=function(){hh(),dh(),ph()},gh=function(){ib(),rb()},lb=function(e){return e.paste!==void 0},cb=function(e){return e.getSvgRoot!==void 0},ub=function(e){return typeof e.id=="string"&&e.workspace!==void 0&&e.select!==void 0&&e.unselect!==void 0},db=function(e){return e.isSelectable()},hb=function(e){q().hideChaff(e)},ge=ge||{},ge.scope={},ge.ASSUME_ES5=!1,ge.ASSUME_NO_NATIVE_MAP=!1,ge.ASSUME_NO_NATIVE_SET=!1,ge.SIMPLE_FROUND_POLYFILL=!1,ge.ISOLATE_POLYFILLS=!1,ge.FORCE_POLYFILL_PROMISE=!1,ge.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1,ge.defineProperty=ge.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(e,t,o){return e==Array.prototype||e==Object.prototype||(e[t]=o.value),e},ge.getGlobal=function(e){e=[typeof globalThis=="object"&&globalThis,e,typeof window=="object"&&window,typeof self=="object"&&self,typeof eo=="object"&&eo];for(var t=0;t>>0,ge.propertyToPolyfillSymbol[u]=ge.IS_SYMBOL_NATIVE?ge.global.Symbol(u):ge.POLYFILL_PREFIX+o+"$"+u),ge.defineProperty(n,ge.propertyToPolyfillSymbol[u],{configurable:!0,writable:!0,value:t})))},ge.underscoreProtoCanBeSet=function(){var e={a:!0},t={};try{return t.__proto__=e,t.a}catch{}return!1},ge.setPrototypeOf=ge.TRUST_ES6_POLYFILLS&&typeof Object.setPrototypeOf=="function"?Object.setPrototypeOf:ge.underscoreProtoCanBeSet()?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null,ge.arrayIteratorImpl=function(e){var t=0;return function(){return to&&(o=Math.max(o+u,0));o{const e=fb.length,t=[];for(let o=0;20>o;o++)t[o]=fb.charAt(Math.random()*e);return t.join("")}},LC=0,mh={TEST_ONLY:$b};mh.genUid=_,mh.getNextUniqueId=v;var bb="",ur=!0,fh=0,$h="ORPHANED_BLOCK",po=[],vb={FIRE_QUEUE:po,enqueueEvent:Ce,fireNow:he,fireInternal:Z,setGroupInternal:Q};i.disable$$module$build$src$core$events$utils,i.enable$$module$build$src$core$events$utils,i.getGroup$$module$build$src$core$events$utils,i.setGroup$$module$build$src$core$events$utils,i.setRecordUndo$$module$build$src$core$events$utils;var dr=Object.create(null),yb,ai=null,_b,hr=[],wb={defineBlocksWithJsonArrayInternal:We},Ot={TEST_ONLY:wb};Ot.createBlockDefinitionsFromJsonArray=i.createBlockDefinitionsFromJsonArray$$module$build$src$core$common,Ot.defineBlocks=i.defineBlocks$$module$build$src$core$common,Ot.defineBlocksWithJsonArray=Ae,Ot.draggingConnections=hr,Ot.getAllWorkspaces=B,Ot.getBlockTypeCounts=Ie,Ot.getMainWorkspace=q,Ot.getParentContainer=Te,Ot.getSelected=j,Ot.getWorkspaceById=re,Ot.registerWorkspace=N,Ot.setMainWorkspace=se,Ot.setParentContainer=ae,Ot.setSelected=i.setSelected$$module$build$src$core$common,Ot.svgResize=we,Ot.unregisterWorkpace=te;var qi=class{constructor(){this.workspaceId=void 0,this.isUiEvent=!1,this.type="",this.group=i.getGroup$$module$build$src$core$events$utils(),this.recordUndo=G()}toJson(){return{type:this.type,group:this.group}}static fromJson(e,t,o){return o.isBlank=!1,o.group=e.group||"",o.workspaceId=t.id,o}isNull(){return!1}run(e){}getEventWorkspace_(){let e;if(this.workspaceId&&(e=re(this.workspaceId)),!e)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return e}},Ss=class extends qi{constructor(e){super(),this.recordUndo=!1,this.isUiEvent=!0,this.isBlank=typeof e>"u",this.workspaceId=e||""}},bh=class extends Ss{constructor(e,t,o){t=e?e.workspace.id:t,t===null&&(t=void 0),super(t),this.type=ee.CLICK,this.blockId=e?e.id:void 0,this.targetType=o}toJson(){const e=super.toJson();if(!this.targetType)throw Error("The click target type is undefined. Either pass a block to the constructor, or call fromJson");return e.targetType=this.targetType,e.blockId=this.blockId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new bh),t.targetType=e.targetType,t.blockId=e.blockId,t}},vh;(function(e){e.BLOCK="block",e.WORKSPACE="workspace",e.ZOOM_CONTROLS="zoom_controls"})(vh||(vh={})),r($e.EVENT,ee.CLICK,bh);var PC=750,kb="ontouchstart"in globalThis||!!(globalThis.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!globalThis.navigator||!globalThis.navigator.maxTouchPoints&&!globalThis.navigator.msMaxTouchPoints),il=null,li={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"],mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]},nl=0,ci={TOUCH_ENABLED:kb,TOUCH_MAP:li};ci.checkTouchIdentifier=U,ci.clearTouchIdentifier=Y,ci.getTouchIdentifierFromEvent=A,ci.longStart=k,ci.longStop=X,ci.shouldHandleEvent=O;var yh,Cb,Tb,Sb,rl,al,_h,Eb,Ib,xb;(function(e){function t(n){return o.includes(n.toUpperCase())}yh=e;const o=yh.toUpperCase();Cb=t("JavaFX"),Tb=t("WebKit"),Sb=t("Gecko")&&!Tb,rl=t("Android"),e=globalThis.navigator&&globalThis.navigator.maxTouchPoints,al=t("iPad")||t("Macintosh")&&0{n.push(this.componentData.get(u))}),n.sort(function(u,g){return u.weight-g.weight}),n.forEach(function(u){o.push(u.component)})}else e.forEach(n=>{o.push(this.componentData.get(n).component)});return o}};gt.Capability=mo,(function(e){e=e.ComponentWeight||(e.ComponentWeight={}),e[e.TOOLBOX_WEIGHT=0]="TOOLBOX_WEIGHT",e[e.FLYOUT_WEIGHT=1]="FLYOUT_WEIGHT",e[e.TRASHCAN_WEIGHT=2]="TRASHCAN_WEIGHT",e[e.ZOOM_CONTROLS_WEIGHT=3]="ZOOM_CONTROLS_WEIGHT"})(gt||(gt={})),gt.ComponentWeight;var Ch=!1,Th=` +`)},Bf=function(e,t){if(e.length<=t)return e;const o=e.trim().split(/\s+/);for(var n=0;nt&&(t=o[n].length);var u=-1/0;let g,I=1;do{n=u,g=e,e=[],u=o.length/I;let L=1;for(let le=0;len);return g},Ma=function(e,t,o){const n=[0],u=[];for(var g=0;gn&&(n=L,u=I)}return u?Ju(e,u,o):t},jf=function(e,t){const o=[];for(let n=0;nhv&&co()}else Cr!==hs&&(clearTimeout(bi),Vh=e.pageX,Kh=e.pageY,bi=setTimeout(Jf,pv))},Qu=function(){Cr=hs=null,co()},co=function(){kr&&(kr=!1,Tt&&(Tt.style.display="none")),bi&&(clearTimeout(bi),bi=0)},ed=function(){co(),rn=!0},td=function(){rn=!1},Vf=function(){Tt&&hs&&(typeof yl=="function"?yl(Tt,hs):Kf())},Kf=function(){var e=Hi(hs);e=i.wrap$$module$build$src$core$utils$string(e,uv),e=e.split(` +`);for(let t=0;to+window.scrollY&&(u-=Tt.offsetHeight+2*Jh),e?n=Math.max(_l-window.scrollX,n):n+Tt.offsetWidth>t+window.scrollX-2*_l&&(n=t-Tt.offsetWidth-2*_l),{x:n,y:u}},Jf=function(){if(!rn&&(Cr=hs,Tt)){Tt.textContent="",Vf();var e=hs.RTL;Tt.style.direction=e?"rtl":"ltr",Tt.style.display="block",kr=!0;var{x:t,y:o}=Yf(e);Tt.style.left=t+"px",Tt.style.top=o+"px"}},sd=function(){return qh},qf=function(e){qh=e},od=function(){return Xh},Xf=function(e){Xh=e},ti=function(e){e=`${e}`.toLowerCase().trim();var t=gv[e];if(t||(t=e.substring(0,2)==="0x"?"#"+e.substring(2):e,t=t[0]==="#"?t:"#"+t,/^#[0-9a-f]{6}$/.test(t)))return t;if(/^#[0-9a-f]{3}$/.test(t))return["#",t[1],t[1],t[2],t[2],t[3],t[3]].join("");var o=e.match(/^(?:rgb)?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);return o&&(e=Number(o[1]),t=Number(o[2]),o=Number(o[3]),0<=e&&256>e&&0<=t&&256>t&&0<=o&&256>o)?er(e,t,o):null},er=function(e,t,o){return t=e<<16|t<<8|o,16>e?"#"+(16777216|t).toString(16).substr(1):"#"+t.toString(16)},Pa=function(e){return e=ti(e),e?(e=parseInt(e.substr(1),16),[e>>16,e>>8&255,e&255]):[0,0,0]},Ba=function(e,t,o){let n=0,u=0,g=0;if(t===0)g=u=n=o;else{const I=Math.floor(e/60),L=e/60-I;e=o*(1-t);const le=o*(1-t*L);switch(t=o*(1-t*(1-L)),I){case 1:n=le,u=o,g=e;break;case 2:n=e,u=o,g=t;break;case 3:n=e,u=le,g=o;break;case 4:n=t,u=e,g=o;break;case 5:n=o,u=e,g=le;break;case 6:case 0:n=o,u=t,g=e}}return er(Math.floor(n),Math.floor(u),Math.floor(g))},si=function(e,t,o){return e=ti(e),!e||(t=ti(t),!t)?null:(e=Pa(e),t=Pa(t),er(Math.round(t[0]+o*(e[0]-t[0])),Math.round(t[1]+o*(e[1]-t[1])),Math.round(t[2]+o*(e[2]-t[2]))))},id=function(e){return Ba(e,qh,255*Xh)},ja=function(e,t,o){const n=[];var u=e.split("");u.push("");var g=0;e=[];let I=null;for(let Ee=0;Ee=L?(g=2,I=L,(L=e.join(""))&&n.push(L),e.length=0):L==="{"?g=3:(e.push("%",L),g=0);else if(g===2)if("0"<=L&&"9">=L)I+=L;else{var le=void 0;n.push(parseInt((le=I)!=null?le:"",10)),Ee--,g=0}else g===3&&(L===""?(e.splice(0,0,"%{"),Ee--,g=0):L!=="}"?e.push(L):(g=e.join(""),/[A-Z]\w*/i.test(g)?(L=g.toUpperCase(),(L=L.startsWith("BKY_")?L.substring(4):null)&&L in i.Msg$$module$build$src$core$msg?(g=i.Msg$$module$build$src$core$msg[L],typeof g=="string"?Array.prototype.push.apply(n,ja(g,t,o)):t?n.push(`${g}`):n.push(g)):n.push("%{"+g+"}")):n.push("%{"+g+"}"),g=e.length=0))}for((t=e.join(""))&&n.push(t),le=[],e.length=0,u=0;u=o)return{hue:o,hex:Ba(o,sd(),255*od())};if(o=ti(t))return{hue:null,hex:o};throw o='Invalid colour: "'+t+'"',e!==t&&(o+=' (from "'+e+'")'),Error(o)},oi=function(){return xs},Qf=function(e){if(xs=e,e===null){let t;(t=document.querySelector("."+kl))==null||t.remove()}},rd=function(){const e=Te()||document.body;document.querySelector("."+kl)?xs=document.querySelector("."+kl):(xs=document.createElement("div"),xs.className=kl),e.appendChild(xs)},Fa=function(e,t,o,n){if(Vi(),an=e,wl=o,o=xs){if(o.style.direction=t?"rtl":"ltr",o.style.display="block",!n&&e instanceof lt){let I;n=(I=e.getSourceBlock())==null?void 0:I.workspace}var u;Zh=(u=n)!=null?u:null;var g;e=(g=n)!=null?g:q(),ln=e.getRenderer().getClassName(),cn=e.getTheme().getClassName(),ln&&Re(o,ln),cn&&Re(o,cn)}},Vi=function(){if(ad()){an=null;var e=xs;e&&(e.style.display="none",e.style.left="",e.style.top="",wl&&wl(),wl=null,e.textContent="",ln&&(ze(e,ln),ln=""),cn&&(ze(e,cn),cn=""),q().markFocused())}},ad=function(){return!!an},ii=function(e){an===e&&Vi()},tr=function(e){Zh!==null&&Zh!==e||Vi()},ld=function(e,t,o){xs.style.left=e+"px",xs.style.top=t+"px",xs.style.height=o+"px"},cd=function(e,t,o,n){const u=t$(e,t,o);e=e$(e,t,o,n),0>u?ld(e,0,o.height+u):ld(e,u,o.height)},e$=function(e,t,o,n){return n?Math.min(Math.max(t.right-o.width,e.left),e.right-o.width):Math.max(Math.min(t.left,e.right-o.width),e.left)},t$=function(e,t,o){return t.bottom+o.height>=e.bottom?t.top-o.height:t.bottom},s$=function(e){return!(e==null||!e.repositionForWindowResize)},ud=function(){s$(an)&&an.repositionForWindowResize()||Vi()},o$=function(){return Cl},dd=function(e){Cl=e},sr=function(e,t,o,n){if(Fa(mv,o,hd,n),t.length){var u=i$(t,o,e);Tl=u,n$(u,e,o),setTimeout(function(){u.focus()},1),Cl=null}else or()},i$=function(e,t,o){const n=new Oh;n.setRole(Is.MENU);for(let u=0;u{setTimeout(()=>{g.callback(g.scope,o)},0)})},{})}return n},n$=function(e,t,o){const n=$u();t=new rt(t.clientY+n.top,t.clientY+n.top,t.clientX+n.left,t.clientX+n.left),r$(e);const u=e.getSize();o&&(t.left+=u.width,t.right+=u.width,n.left+=u.width,n.right+=u.width),cd(n,t,u,o),e.focus()},r$=function(e){var t=oi();if(!t)throw Error("Attempting to create a context menu when widget div is null");t=e.render(t),Re(t,"blocklyContextMenu"),H(t,"contextmenu",null,a$),e.focus()},a$=function(e){e.preventDefault(),e.stopPropagation()},or=function(){ii(mv),Cl=null},hd=function(){Tl&&(Tl.dispose(),Tl=null)},i.callbackFactory$$module$build$src$core$contextmenu=function(e,t){return()=>{i.disable$$module$build$src$core$events$utils();let o;try{o=t instanceof Element?ni(t,e.workspace):Fi(t,e.workspace);const n=e.getRelativeToSurfaceXY();n.x=e.RTL?n.x-i.config$$module$build$src$core$config.snapRadius:n.x+i.config$$module$build$src$core$config.snapRadius,n.y+=2*i.config$$module$build$src$core$config.snapRadius,o.moveBy(n.x,n.y)}finally{i.enable$$module$build$src$core$events$utils()}return C()&&!o.isShadow()&&z(new(ne(ee.BLOCK_CREATE))(o)),i.setSelected$$module$build$src$core$common(o),o}},pd=function(e,t){return t=fe(t,e.getParentSvg(),e.getInverseScreenCTM()),t.x/=e.scale,t.y/=e.scale,t},za=function(e,t,o){t=pd(e,t),$v.set(e,ye.difference(o,t))},Ua=function(e,t){if(t=pd(e,t),e=$v.get(e),!e)throw Error("Drag not initialized");return ye.sum(e,t)},l$=function(e,t=!1){const o=i.createElement$$module$build$src$core$utils$xml("xml");var n=gd(i.allUsedVarModels$$module$build$src$core$variables(e));n.hasChildNodes()&&o.appendChild(n);for(const u of e.getTopComments())o.appendChild(ir(u,t));for(e=e.getTopBlocks(!0),n=0;n/g,"<$1$2>")},d$=function(e){e=zs(e).split("<");let t="";for(let o=1;o"&&(t+=" ")}return e=e.join(` +`),e=e.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1"),e.replace(/^\n/,"")},h$=function(e,t){return t.setResizesEnabled(!1),t.clear(),e=i.domToWorkspace$$module$build$src$core$xml(e,t),t.setResizesEnabled(!0),e},i.domToWorkspace$$module$build$src$core$xml=function(e,t){let o=0;t.RTL&&(o=t.getWidth());const n=[];io();const u=i.getGroup$$module$build$src$core$events$utils();u||i.setGroup$$module$build$src$core$events$utils(!0),t.setResizesEnabled&&t.setResizesEnabled(!1);let g=!0;try{for(let I=0,L;L=e.childNodes[I];I++){const le=L.nodeName.toLowerCase(),Ee=L;if(le==="block"||le==="shadow"&&!G()){const dt=ni(Ee,t);n.push(dt.id);let ut;const ts=parseInt((ut=Ee.getAttribute("x"))!=null?ut:"10",10);let yn;const Fr=parseInt((yn=Ee.getAttribute("y"))!=null?yn:"10",10);isNaN(ts)||isNaN(Fr)||dt.moveBy(t.RTL?o-ts:ts,Fr,["create"]),g=!1}else{if(le==="shadow")throw TypeError("Shadow block cannot be a top-level block.");if(le==="comment")fd(Ee,t);else if(le==="variables"){if(g)$d(Ee,t);else throw Error("'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location.");g=!1}}}}finally{i.setGroup$$module$build$src$core$events$utils(u),t.setResizesEnabled&&t.setResizesEnabled(!0),t.rendered&&ao(),no()}return z(new(ne(ee.FINISHED_LOADING))(t)),n},fd=function(e,t){var o;const n=(o=e.getAttribute("id"))!=null?o:void 0;o=t.rendered?new Il(t,n):new El(t,n);var u;o.setText((u=e.textContent)!=null?u:"");var g;u=parseInt((g=e.getAttribute("x"))!=null?g:"",10);let I;g=parseInt((I=e.getAttribute("y"))!=null?I:"",10),isNaN(u)||isNaN(g)||(u=t.RTL?t.getWidth()-u:u,o.moveTo(new ye(u,g)));var L;t=parseInt((L=e.getAttribute("w"))!=null?L:"",10);let le;return L=parseInt((le=e.getAttribute("h"))!=null?le:"",10),isNaN(t)||isNaN(L)||o.setSize(new Xe(t,L)),e.getAttribute("collapsed")==="true"&&o.setCollapsed(!0),e.getAttribute("editable")==="false"&&o.setEditable(!1),e.getAttribute("movable")==="false"&&o.setMovable(!1),e.getAttribute("deletable")==="false"&&o.setDeletable(!1),o},p$=function(e,t){if(!t.getBlocksBoundingBox)return i.domToWorkspace$$module$build$src$core$xml(e,t);var o=t.getBlocksBoundingBox();if(e=i.domToWorkspace$$module$build$src$core$xml(e,t),o&&o.top!==o.bottom){var n=o.bottom;o=t.RTL?o.right:o.left;var u=1/0;let g=-1/0,I=1/0;for(let L=0;Lg&&(g=le.x)}for(n=n-I+10,o=t.RTL?o-g:o-u,u=0;uEe.setBubbleVisible(g),1)}},$$=function(e,t){for(let o=0;ou}),yd(u,{x:n.x,y:n.y,width:e.width,height:e.height},t.RTL,new Date)}},yd=function(e,t,o,n){const u=(new Date().getTime()-n.getTime())/150;1o)){var n=t.getSvgXY(e.getSvgRoot());e.outputConnection?(n.x+=(e.RTL?3:-3)*o,n.y+=13*o):e.previousConnection&&(n.x+=(e.RTL?-23:23)*o,n.y+=3*o);var u=ie(J.CIRCLE,{cx:n.x,cy:n.y,r:0,fill:"none",stroke:"#888","stroke-width":10},t.getParentSvg());e=ie(J.ANIMATE,{id:"animationCircle",begin:"indefinite",attributeName:"r",dur:"150ms",from:0,to:25*o},u),t=ie(J.ANIMATE,{id:"animationOpacity",begin:"indefinite",attributeName:"opacity",dur:"150ms",from:1,to:0},u),e.beginElement(),t.beginElement(),setTimeout(()=>{Ze(u)},150)}},_d=function(e){if(Ki(),e.workspace.getAudioManager().play("disconnect"),!(1>e.workspace.scale)){var t=e.getHeightWidth().height;t=Math.atan(10/t)/Math.PI*180,e.RTL||(t*=-1),Sr=e,wd(e,t,new Date,0)}},wd=function(e,t,o,n){const u=[.66,1,.66,0,-.66,-1,-.66,0];let g="";o.getTime()+200>new Date().getTime()&&(g=`skewX(${Math.round(u[n%u.length]*t)})`,xl=setTimeout(wd,15,e,t,o,n+1)),e.getSvgRoot().setAttribute("transform",`${e.getTranslation()} ${g}`)},Ki=function(){Sr&&(xl&&(clearTimeout(xl),xl=null),Sr.getSvgRoot().setAttribute("transform",Sr.getTranslation()),Sr=null)},ri=function(e){return e.getRelativeToSurfaceXY!==void 0&&e.isMovable!==void 0&&e.startDrag!==void 0&&e.drag!==void 0&&e.endDrag!==void 0&&e.revertDrag!==void 0},uo=function(e,t){for(const o in t)e[o]=t[o]!==null&&typeof t[o]=="object"?uo(e[o]||Object.create(null),t[o]):t[o];return e},Us=function(e,t){r($e.FIELD,e,t)},k$=function(e){c($e.FIELD,e)},i.fromJson$$module$build$src$core$field_registry=function(e){return _v.fromJsonInternal(e)},C$=function(e){const t=f($e.FIELD,e.type);return t?t.fromJson(e):(console.warn("Blockly could not create a field of type "+e.type+". The field is probably not being registered. This could be because the file is not loaded, the field does not register itself (Issue #1584), or the registration is not being reached."),null)},i.register$$module$build$src$core$extensions=function(e,t){if(typeof e!="string"||e.trim()==="")throw Error('Error: Invalid extension name "'+e+'"');if(dn[e])throw Error('Error: Extension "'+e+'" is already registered.');if(typeof t!="function")throw Error('Error: Extension "'+e+'" must be a function');dn[e]=t},i.registerMixin$$module$build$src$core$extensions=function(e,t){if(!t||typeof t!="object")throw Error('Error: Mixin "'+e+'" must be a object');i.register$$module$build$src$core$extensions(e,function(){this.mixin(t)})},i.registerMutator$$module$build$src$core$extensions=function(e,t,o,n){const u='Error when registering mutator "'+e+'": ';Td(u,t);const g=Cd(t,u);if(o&&typeof o!="function")throw Error(u+'Extension "'+e+'" is not a function');i.register$$module$build$src$core$extensions(e,function(){g&&this.setMutator(new i.MutatorIcon$$module$build$src$core$icons$mutator_icon(n||[],this)),this.mixin(t),o&&o.apply(this)})},T$=function(e){kd(e)?delete dn[e]:console.warn('No extension mapping for name "'+e+'" found to unregister')},kd=function(e){return!!dn[e]},Va=function(e,t,o){const n=dn[e];if(typeof n!="function")throw Error('Error: Extension "'+e+'" not found.');let u;if(o?S$(e,t):u=Ya(t),n.apply(t),o)Td('Error after applying mutator "'+e+'": ',t);else if(!x$(u,t))throw Error('Error when applying extension "'+e+'": mutation properties changed when applying a non-mutator extension.')},S$=function(e,t){if(Ya(t).length)throw Error('Error: tried to apply mutation "'+e+'" to a block that already has mutator functions. Block id: '+t.id)},E$=function(e,t){return Ka(e.mutationToDom,e.domToMutation,t+" mutationToDom/domToMutation")},I$=function(e,t){return Ka(e.saveExtraState,e.loadExtraState,t+" saveExtraState/loadExtraState")},Cd=function(e,t){return Ka(e.compose,e.decompose,t+" compose/decompose")},Ka=function(e,t,o){if(e&&t){if(typeof e!="function"||typeof t!="function")throw Error(o+" must be a function");return!0}if(!e&&!t)return!1;throw Error(o+"Must have both or neither functions")},Td=function(e,t){const o=E$(t,e),n=I$(t,e);if(!o&&!n)throw Error(e+"Mutations must contain either XML hooks, or JSON hooks, or both");Cd(t,e)},Ya=function(e){const t=[];return e.domToMutation!==void 0&&t.push(e.domToMutation),e.mutationToDom!==void 0&&t.push(e.mutationToDom),e.saveExtraState!==void 0&&t.push(e.saveExtraState),e.loadExtraState!==void 0&&t.push(e.loadExtraState),e.compose!==void 0&&t.push(e.compose),e.decompose!==void 0&&t.push(e.decompose),t},x$=function(e,t){if(t=Ya(t),t.length!==e.length)return!1;for(let o=0;o!n.getReturnTypes()).map(n=>[n.getName(),n.getParameters().map(u=>u.getName()),!1]);e.getBlocksByType("procedures_defnoreturn",!1).forEach(n=>{!Ro(n)&&Bi(n)&&t.push(n.getProcedureDef())});const o=e.getProcedureMap().getProcedures().filter(n=>!!n.getReturnTypes()).map(n=>[n.getName(),n.getParameters().map(u=>u.getName()),!0]);return e.getBlocksByType("procedures_defreturn",!1).forEach(n=>{!Ro(n)&&Bi(n)&&o.push(n.getProcedureDef())}),t.sort(Ed),o.sort(Ed),[t,o]},Ed=function(e,t){return e[0].localeCompare(t[0],void 0,{sensitivity:"base"})},i.findLegalName$$module$build$src$core$procedures=function(e,t){if(t.isInFlyout)return e;for(e=e||i.Msg$$module$build$src$core$msg.UNNAMED_KEY||"unnamed";!N$(e,t.workspace,t);){const o=e.match(/^(.*?)(\d+)$/);e=o?o[1]+(parseInt(o[2])+1):e+"2"}return e},N$=function(e,t,o){return!Id(e,t,o)},Id=function(e,t,o){for(const n of t.getAllBlocks(!1))if(n!==o&&Bi(n)&&i.Names$$module$build$src$core$names.equals(n.getProcedureDef()[0],e))return!0;o=o&&Ro(o)?o==null?void 0:o.getProcedureModel():void 0;for(const n of t.getProcedureMap().getProcedures())if(n!==o&&i.Names$$module$build$src$core$names.equals(n.getName(),e))return!0;return!1},i.rename$$module$build$src$core$procedures=function(e){var t=this.getSourceBlock();if(!t)throw new _t;e=e.trim();const o=i.findLegalName$$module$build$src$core$procedures(e,t);Ro(t)&&!t.isInsertionMarker()&&t.getProcedureModel().setName(o);const n=this.getValue();if(n!==e&&n!==o)for(e=t.workspace.getAllBlocks(!1),t=0;tL$(o,e)||hf(o)&&i.Names$$module$build$src$core$names.equals(o.getProcedureCall(),e))},L$=function(e,t){return Ro(e)&&!e.isProcedureDef()&&e.getProcedureModel()&&i.Names$$module$build$src$core$names.equals(e.getProcedureModel().getName(),t)},i.mutateCallers$$module$build$src$core$procedures=function(e){const t=G();var o=e.getProcedureDef()[0];const n=e.mutationToDom(!0);e=Ad(o,e.workspace);for(let g=0,I;I=e[g];g++){o=(o=I.mutationToDom())&&Li(o),I.domToMutation&&I.domToMutation(n);var u=I.mutationToDom();u=u&&Li(u),o!==u&&(i.setRecordUndo$$module$build$src$core$events$utils(!1),z(new(ne(ee.BLOCK_CHANGE))(I,"mutation",null,o,u)),i.setRecordUndo$$module$build$src$core$events$utils(t))}},i.getDefinition$$module$build$src$core$procedures=function(e,t){for(const o of t.getAllBlocks(!1))if(Ro(o)&&o.isProcedureDef()&&i.Names$$module$build$src$core$names.equals(o.getProcedureModel().getName(),e)||Bi(o)&&i.Names$$module$build$src$core$names.equals(o.getProcedureDef()[0],e))return o;return null},Za=function(e){return e.isDynamic},P$=function(e){return e.pathDown!==void 0&&e.pathUp!==void 0},B$=function(e){return e.pathLeft!==void 0&&e.pathRight!==void 0},j$=function(e,t){if(!e||!t)throw Error("Cannot connect null connections.");e.targetConnection=t,t.targetConnection=e},F$=function(e,t){let o=null;t=t.outputConnection;const n=t==null?void 0:t.getConnectionChecker();for(let u=0,g;g=e.inputList[u];u++){const I=g.connection;let L;if(I&&((L=n)!=null&&L.canConnect(t,I,!1))){if(o)return null;o=I}}return o},z$=function(e,t){let o;for(;o=F$(e,t);)if(e=o.targetBlock(),!e||e.isShadow())return o;return null},Rd=function(e){return e.getType!==void 0&&e.initView!==void 0&&e.dispose!==void 0&&e.getWeight!==void 0&&e.getSize!==void 0&&e.applyColour!==void 0&&e.hideForInsertionMarker!==void 0&&e.updateEditable!==void 0&&e.updateCollapsed!==void 0&&e.isShownWhenCollapsed!==void 0&&e.setOffsetInBlock!==void 0&&e.onLocationChange!==void 0&&e.onClick!==void 0},U$=function(e){return Rd(e)&&zi(e)&&Yn(e)&&e.setText!==void 0&&e.getText!==void 0&&e.setBubbleSize!==void 0&&e.getBubbleSize!==void 0&&e.getType()===Ct.COMMENT},rr=function(e){let t=e.outputConnection;return(!t||e.previousConnection&&e.previousConnection.isConnected())&&(t=e.previousConnection),t},ar=function(e,t){r($e.RENDERER,e,t)},H$=function(e){c($e.RENDERER,e)},Od=function(e,t,o){return e=new(p($e.RENDERER,e))(e),e.init(t,o),e},Nd=function(e){ji(e.getTargetWorkspace(),void 0,"String")},Md=function(e){ji(e.getTargetWorkspace(),void 0,"Number")},Ld=function(e){ji(e.getTargetWorkspace(),void 0,"Colour")},Qa=function(e){let t=[],o=document.createElement("button");return o.setAttribute("text",i.Msg$$module$build$src$core$msg.NEW_STRING_VARIABLE),o.setAttribute("callbackKey","CREATE_VARIABLE_STRING"),t.push(o),o=document.createElement("button"),o.setAttribute("text",i.Msg$$module$build$src$core$msg.NEW_NUMBER_VARIABLE),o.setAttribute("callbackKey","CREATE_VARIABLE_NUMBER"),t.push(o),o=document.createElement("button"),o.setAttribute("text",i.Msg$$module$build$src$core$msg.NEW_COLOUR_VARIABLE),o.setAttribute("callbackKey","CREATE_VARIABLE_COLOUR"),t.push(o),e.registerButtonCallback("CREATE_VARIABLE_STRING",Nd),e.registerButtonCallback("CREATE_VARIABLE_NUMBER",Md),e.registerButtonCallback("CREATE_VARIABLE_COLOUR",Ld),e=Pd(e),t=t.concat(e)},Pd=function(e){e=e.getAllVariables();const t=[];if(0L.id!=e.id).map(L=>L.getRelativeToSurfaceXY());for(;G$(ye.sum(t,g),I)||V$(e,ye.sum(u,g),n);)o.RTL?g.translate(-n,2*n):g.translate(n,2*n);e.moveTo(ye.sum(t,g))},G$=function(e,t){return t.some(o=>1>=Math.abs(o.x-e.x)&&1>=Math.abs(o.y-e.y))},V$=function(e,t,o){return e.getConnections_(!1).some(n=>!!n.closest(o,t).connection)},Ji=function(e,t,o){const n=o.getBoundingRectangle(),u=n.right-n.left,g=Ui(t.top,n.top,t.top+t.height-(n.bottom-n.top))-n.top;let I=t.left;return t=t.left+t.width-u,e.RTL?I=Math.min(t,I):t=Math.max(I,t),(e=Ui(I,n.left,t)-n.left)||g?(o.moveBy(e,g,["inbounds"]),!0):!1},Bd=function(e){return t=>{var o=e.getMetricsManager();if(o.hasFixedEdges()&&!e.isDragging()){var n;if(pb.includes((n=t.type)!=null?n:"")){n=o.getScrollMetrics(!0);const u=K$(e,t);u&&(o=i.getGroup$$module$build$src$core$events$utils()||!1,i.setGroup$$module$build$src$core$events$utils(t.group),Ji(e,n,u)&&!t.group&&console.warn("Moved object in bounds but there was no event group. This may break undo."),i.setGroup$$module$build$src$core$events$utils(o))}else W(t)&&t.scale&&t.oldScale&&t.scale>t.oldScale&&el(e)}}},K$=function(e,t){let o=null;switch(t.type){case ee.BLOCK_CREATE:case ee.BLOCK_MOVE:(o=e.getBlockById(t.blockId))&&(o=o.getRootBlock());break;case ee.COMMENT_CREATE:case ee.COMMENT_MOVE:case ee.COMMENT_RESIZE:o=e.getCommentById(t.commentId)}return o},el=function(e){var t=e.getMetricsManager();if(t.hasFixedEdges()&&!e.isDragging()){t=t.getScrollMetrics(!0);var o=e.getTopBoundedElements();for(let n=0,u;u=o[n];n++)Ji(e,t,u)}},ds=function(e){return e.isDeletable!==void 0&&e.dispose!==void 0&&e.setDeleteStyle!==void 0},Y$=function(e){const t=e.toCopyData();Sp=t;let o;return Ep=(o=e.workspace)!=null?o:null,t},Oo=function(e,t,o){return e&&t?jd(e,t,o):Sp&&Ep?jd(Sp,Ep):null},jd=function(e,t,o){let n;t=t.isMutator?t:(n=t.getRootWorkspace())!=null?n:t;let u,g;return(g=(u=f($e.PASTER,e.paster,!1))==null?void 0:u.paste(e,t,o))!=null?g:null},J$=function(e){const t=e.toCopyData();return t?Oo(t,e.workspace):null},lr=function(e){return e.toCopyData!==void 0},Fd=function(){st.registry.register({name:Ys.ESCAPE,preconditionFn(e){return!e.options.readOnly},callback(e){return e.hideChaff(),!0},keyCodes:[Ye.ESC]})},zd=function(){st.registry.register({name:Ys.DELETE,preconditionFn(e){const t=F();return!e.options.readOnly&&t!=null&&ds(t)&&t.isDeletable()&&!bo.inProgress()},callback(e,t){return t.preventDefault(),e=F(),e instanceof $s?e.checkAndDelete():ds(e)&&e.isDeletable()&&(i.setGroup$$module$build$src$core$events$utils(!0),e.dispose(),i.setGroup$$module$build$src$core$events$utils(!1)),!0},keyCodes:[Ye.DELETE,Ye.BACKSPACE]})},Ud=function(){const e=st.registry.createSerializedKey(Ye.C,[Ye.CTRL]),t=st.registry.createSerializedKey(Ye.C,[Ye.ALT]),o=st.registry.createSerializedKey(Ye.C,[Ye.META]);st.registry.register({name:Ys.COPY,preconditionFn(n){const u=F();return!n.options.readOnly&&!bo.inProgress()&&u!=null&&ds(u)&&u.isDeletable()&&ri(u)&&u.isMovable()&&lr(u)},callback(n,u){return u.preventDefault(),n.hideChaff(),u=F(),!u||!lr(u)?!1:(Ho=u.toCopyData(),Wo=u.workspace instanceof cs?u.workspace:n,$n=ri(u)?u.getRelativeToSurfaceXY():null,!!Ho)},keyCodes:[e,t,o]})},Hd=function(){const e=st.registry.createSerializedKey(Ye.X,[Ye.CTRL]),t=st.registry.createSerializedKey(Ye.X,[Ye.ALT]),o=st.registry.createSerializedKey(Ye.X,[Ye.META]);st.registry.register({name:Ys.CUT,preconditionFn(n){const u=F();return!n.options.readOnly&&!bo.inProgress()&&u!=null&&ds(u)&&u.isDeletable()&&ri(u)&&u.isMovable()&&!u.workspace.isFlyout},callback(n){const u=F();return u instanceof $s?(Ho=u.toCopyData(),Wo=n,$n=u.getRelativeToSurfaceXY(),u.checkAndDelete(),!0):ds(u)&&u.isDeletable()&&lr(u)?(Ho=u.toCopyData(),Wo=n,$n=ri(u)?u.getRelativeToSurfaceXY():null,u.dispose(),!0):!1},keyCodes:[e,t,o]})},Wd=function(){const e=st.registry.createSerializedKey(Ye.V,[Ye.CTRL]),t=st.registry.createSerializedKey(Ye.V,[Ye.ALT]),o=st.registry.createSerializedKey(Ye.V,[Ye.META]);st.registry.register({name:Ys.PASTE,preconditionFn(n){return!n.options.readOnly&&!bo.inProgress()},callback(){if(!Ho||!Wo)return!1;if(!$n)return!!Oo(Ho,Wo);const{left:n,top:u,width:g,height:I}=Wo.getMetricsManager().getViewMetrics(!0);if(new rt(u,u+I,n,n+g).contains($n.x,$n.y))return!!Oo(Ho,Wo);const L=new ye(n+g/2,u+I/2);return!!Oo(Ho,Wo,L)},keyCodes:[e,t,o]})},Gd=function(){const e=st.registry.createSerializedKey(Ye.Z,[Ye.CTRL]),t=st.registry.createSerializedKey(Ye.Z,[Ye.ALT]),o=st.registry.createSerializedKey(Ye.Z,[Ye.META]);st.registry.register({name:Ys.UNDO,preconditionFn(n){return!n.options.readOnly&&!bo.inProgress()},callback(n,u){return n.hideChaff(),n.undo(!1),u.preventDefault(),!0},keyCodes:[e,t,o]})},Vd=function(){const e=st.registry.createSerializedKey(Ye.Z,[Ye.SHIFT,Ye.CTRL]),t=st.registry.createSerializedKey(Ye.Z,[Ye.SHIFT,Ye.ALT]),o=st.registry.createSerializedKey(Ye.Z,[Ye.SHIFT,Ye.META]),n=st.registry.createSerializedKey(Ye.Y,[Ye.CTRL]);st.registry.register({name:Ys.REDO,preconditionFn(u){return!bo.inProgress()&&!u.options.readOnly},callback(u,g){return u.hideChaff(),u.undo(!0),g.preventDefault(),!0},keyCodes:[e,t,o,n]})},Kd=function(){Fd(),zd(),Ud(),Hd(),Wd(),Gd(),Vd()},Yd=function(e){const t=e.saveState();return e.getParameters().length&&(t.parameters=e.getParameters().map(o=>o.saveState())),t},Jd=function(e,t,o,n){if(e=e.loadState(o,n),!o.parameters)return e;for(const[u,g]of o.parameters.entries())e.insertParameter(t.loadState(g,n),u);return e},q$=function(e){const t=Object.create(null),o=b($e.SERIALIZER,!0);for(const n in o){let u;const g=(u=o[n])==null?void 0:u.save(e);g&&(t[n]=g)}return t},X$=function(e,t,{recordUndo:o=!1}={}){var n=b($e.SERIALIZER,!0);if(n){n=Object.entries(n).sort((g,I)=>I[1].priority-g[1].priority);var u=G();i.setRecordUndo$$module$build$src$core$events$utils(o),(o=i.getGroup$$module$build$src$core$events$utils())||i.setGroup$$module$build$src$core$events$utils(!0),io(),t instanceof cs&&t.setResizesEnabled(!1);for(const[,g]of n.reverse()){let I;(I=g)==null||I.clear(t)}for(const[g,I]of n.reverse())if(e[g]){let L;(L=I)==null||L.load(e[g],t)}t instanceof cs&&t.setResizesEnabled(!0),no(),z(new(ne(ee.FINISHED_LOADING))(t)),i.setGroup$$module$build$src$core$events$utils(o),i.setRecordUndo$$module$build$src$core$events$utils(u)}},Z$=function(e,t){let o=null;o=typeof e=="string"?document.getElementById(e)||document.querySelector(e):e;var n;if(!document.contains(o)&&document!==((n=o)==null?void 0:n.ownerDocument))throw Error("Error: container is not in current document");e=new gs(t||{}),n=document.createElement("div"),Re(n,"injectionDiv"),t!=null&&t.rtl&&Re(n,"blocklyRTL"),n.tabIndex=0,xt(n,Et.LABEL,i.Msg$$module$build$src$core$msg.WORKSPACE_ARIA_LABEL),o.appendChild(n),t=Q$(n,e);const u=eb(n,t,e);return tb(u),se(u),we(u),n.addEventListener("focusin",function(){se(u)}),H(n,"keydown",null,tl),H(Xn(),"keydown",null,tl),(t=oi())&&H(t,"keydown",null,tl),u},Q$=function(e,t){e.setAttribute("dir","LTR"),jt(t.hasCss,t.pathToMedia),e=ie(J.SVG,{xmlns:pr,"xmlns:html":Gs,"xmlns:xlink":is,version:"1.1",class:"blocklySvg",tabindex:"0"},e);const o=ie(J.DEFS,{},e),n=String(Math.random()).substring(2);return t.gridPattern=sp.createDom(n,t.gridOptions,o),e},eb=function(e,t,o){o.parentWorkspace=null,o=new cs(o);const n=o.options;o.scale=n.zoomOptions.startScale,t.appendChild(o.createDom("blocklyMainBackground",e));var u=o.getRenderer().getClassName();return u&&Re(e,u),(u=o.getTheme().getClassName())&&Re(e,u),!n.hasCategories&&n.languageTree&&(e=o.addFlyout(J.SVG),At(e,t)),n.hasTrashcan&&o.addTrashcan(),n.zoomOptions&&n.zoomOptions.controls&&o.addZoomControls(),o.getThemeManager().subscribe(t,"workspaceBackgroundColour","background-color"),o.translate(0,0),o.addChangeListener(Bd(o)),we(o),rd(),Ou(),Xu(),o},tb=function(e){const t=e.options;var o=e.getParentSvg();if(H(o.parentNode,"contextmenu",null,function(n){be(n)||n.preventDefault()}),o=H(window,"resize",null,function(){co(),e.hideComponents(!0),Vu(),ud(),we(e),el(e)}),e.setResizeHandlerWrapper(o),sb(),t.languageTree){o=e.getToolbox();const n=e.getFlyout(!0);o?o.init():n&&(n.init(e),n.show(t.languageTree),typeof n.scrollToStart=="function"&&n.scrollToStart())}t.hasTrashcan&&e.trashcan.init(),t.zoomOptions&&t.zoomOptions.controls&&e.zoomControls_.init(),t.moveOptions&&t.moveOptions.scrollbars?(e.scrollbar=new xp(e,t.moveOptions.scrollbars===!0||!!t.moveOptions.scrollbars.horizontal,t.moveOptions.scrollbars===!0||!!t.moveOptions.scrollbars.vertical,"blocklyMainWorkspaceScrollbar"),e.scrollbar.resize()):e.setMetrics({x:.5,y:.5}),t.hasSounds&&ob(t.pathToMedia,e)},tl=function(e){const t=q();t&&!(be(e)||t.rendered&&!t.isVisible())&&st.registry.onKeyDown(t,e)},sb=function(){ry||(H(document,"scroll",null,function(){const e=B();for(let t=0,o;o=e[t];t++)o instanceof cs&&o.updateInverseScreenCTM()}),ue(document,"touchend",null,X),ue(document,"touchcancel",null,X)),ry=!0},ob=function(e,t){function o(){for(;u.length;){const g=u.pop();g&&V(g)}n.preload()}const n=t.getAudioManager();n.load([e+"click.mp3",e+"click.wav",e+"click.ogg"],"click"),n.load([e+"disconnect.wav",e+"disconnect.mp3",e+"disconnect.ogg"],"disconnect"),n.load([e+"delete.mp3",e+"delete.ogg",e+"delete.wav"],"delete");const u=[];u.push(H(document,"pointermove",null,o,!0)),u.push(H(document,"touchstart",null,o,!0))},qd=function(){Ke.registry.register({displayText(){return i.Msg$$module$build$src$core$msg.UNDO},preconditionFn(e){return 0t.length?cr(t):Sa(i.Msg$$module$build$src$core$msg.DELETE_ALL_BLOCKS.replace("%1",String(t.length)),function(o){o&&cr(t)})}},scopeType:Ke.ScopeType.WORKSPACE,id:"workspaceDelete",weight:6})},ib=function(){qd(),Xd(),Zd(),eh(),th(),oh()},ih=function(){Ke.registry.register({displayText(){return i.Msg$$module$build$src$core$msg.DUPLICATE_BLOCK},preconditionFn(e){return e=e.block,!e.isInFlyout&&e.isDeletable()&&e.isMovable()?e.isDuplicatable()?"enabled":"disabled":"hidden"},callback(e){if(e.block){var t=e.block.toCopyData();t&&Oo(t,e.block.workspace)}},scopeType:Ke.ScopeType.BLOCK,id:"blockDuplicate",weight:1})},nh=function(){Ke.registry.register({displayText(e){return e.block.hasIcon(_o.TYPE)?i.Msg$$module$build$src$core$msg.REMOVE_COMMENT:i.Msg$$module$build$src$core$msg.ADD_COMMENT},preconditionFn(e){return e=e.block,!e.isInFlyout&&e.workspace.options.comments&&!e.isCollapsed()&&e.isEditable()?"enabled":"hidden"},callback(e){e=e.block,e.hasIcon(_o.TYPE)?e.setCommentText(null):e.setCommentText("")},scopeType:Ke.ScopeType.BLOCK,id:"blockComment",weight:2})},rh=function(){Ke.registry.register({displayText(e){return e.block.getInputsInline()?i.Msg$$module$build$src$core$msg.EXTERNAL_INPUTS:i.Msg$$module$build$src$core$msg.INLINE_INPUTS},preconditionFn(e){if(e=e.block,!e.isInFlyout&&e.isMovable()&&!e.isCollapsed()){for(let t=1;t(t.has(Vt)?1:0),e.getInheritedDisabled()||t?"disabled":"enabled"}return"hidden"},callback(e){e=e.block;const t=i.getGroup$$module$build$src$core$events$utils();t||i.setGroup$$module$build$src$core$events$utils(!0),e.setDisabledReason(!e.hasDisabledReason(Vt),Vt),i.setGroup$$module$build$src$core$events$utils(t)},scopeType:Ke.ScopeType.BLOCK,id:"blockDisable",weight:5})},ch=function(){Ke.registry.register({displayText(e){var t=e.block;return e=t.getDescendants(!1).length,(t=t.getNextBlock())&&(e-=t.getDescendants(!1).length),e===1?i.Msg$$module$build$src$core$msg.DELETE_BLOCK:i.Msg$$module$build$src$core$msg.DELETE_X_BLOCKS.replace("%1",`${e}`)},preconditionFn(e){return!e.block.isInFlyout&&e.block.isDeletable()?"enabled":"hidden"},callback(e){e.block&&e.block.checkAndDelete()},scopeType:Ke.ScopeType.BLOCK,id:"blockDelete",weight:6})},uh=function(){Ke.registry.register({displayText(){return i.Msg$$module$build$src$core$msg.HELP},preconditionFn(e){return e=e.block,(typeof e.helpUrl=="function"?e.helpUrl():e.helpUrl)?"enabled":"hidden"},callback(e){e.block.showHelp()},scopeType:Ke.ScopeType.BLOCK,id:"blockHelp",weight:7})},dh=function(){Ke.registry.register({displayText:()=>i.Msg$$module$build$src$core$msg.REMOVE_COMMENT,preconditionFn(e){let t;return(t=e.comment)!=null&&t.isDeletable()?"enabled":"hidden"},callback(e){i.setGroup$$module$build$src$core$events$utils(!0);let t;(t=e.comment)==null||t.dispose(),i.setGroup$$module$build$src$core$events$utils(!1)},scopeType:Ke.ScopeType.COMMENT,id:"commentDelete",weight:6})},hh=function(){Ke.registry.register({displayText:()=>i.Msg$$module$build$src$core$msg.DUPLICATE_COMMENT,preconditionFn(e){let t;return(t=e.comment)!=null&&t.isMovable()?"enabled":"hidden"},callback(e){if(e.comment){var t=e.comment.toCopyData();t&&Oo(t,e.comment.workspace)}},scopeType:Ke.ScopeType.COMMENT,id:"commentDuplicate",weight:1})},ph=function(){Ke.registry.register({displayText:()=>i.Msg$$module$build$src$core$msg.ADD_COMMENT,preconditionFn:e=>{let t;return(t=e.workspace)!=null&&t.isMutator?"hidden":"enabled"},callback:(e,t)=>{if(e=e.workspace){i.setGroup$$module$build$src$core$events$utils(!0);var o=new Il(e);o.setText(i.Msg$$module$build$src$core$msg.WORKSPACE_COMMENT_DEFAULT_TEXT),o.moveTo(nb(new ye(t.clientX,t.clientY),e)),i.setSelected$$module$build$src$core$common(o),i.setGroup$$module$build$src$core$events$utils(!1)}},scopeType:Ke.ScopeType.WORKSPACE,id:"commentCreate",weight:8})},nb=function(e,t){var o=t.getInjectionDiv().getBoundingClientRect();return e=new ye(e.x-o.left,e.y-o.top),o=t.getOriginOffsetInPixels(),e=ye.difference(e,o),e.scale(1/t.scale),e},rb=function(){ih(),nh(),rh(),ah(),lh(),ch(),uh()},ab=function(){hh(),dh(),ph()},gh=function(){ib(),rb()},lb=function(e){return e.paste!==void 0},cb=function(e){return e.getSvgRoot!==void 0},ub=function(e){return typeof e.id=="string"&&e.workspace!==void 0&&e.select!==void 0&&e.unselect!==void 0},db=function(e){return e.isSelectable()},hb=function(e){q().hideChaff(e)},ge=ge||{},ge.scope={},ge.ASSUME_ES5=!1,ge.ASSUME_NO_NATIVE_MAP=!1,ge.ASSUME_NO_NATIVE_SET=!1,ge.SIMPLE_FROUND_POLYFILL=!1,ge.ISOLATE_POLYFILLS=!1,ge.FORCE_POLYFILL_PROMISE=!1,ge.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1,ge.defineProperty=ge.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(e,t,o){return e==Array.prototype||e==Object.prototype||(e[t]=o.value),e},ge.getGlobal=function(e){e=[typeof globalThis=="object"&&globalThis,e,typeof window=="object"&&window,typeof self=="object"&&self,typeof eo=="object"&&eo];for(var t=0;t>>0,ge.propertyToPolyfillSymbol[u]=ge.IS_SYMBOL_NATIVE?ge.global.Symbol(u):ge.POLYFILL_PREFIX+o+"$"+u),ge.defineProperty(n,ge.propertyToPolyfillSymbol[u],{configurable:!0,writable:!0,value:t})))},ge.underscoreProtoCanBeSet=function(){var e={a:!0},t={};try{return t.__proto__=e,t.a}catch{}return!1},ge.setPrototypeOf=ge.TRUST_ES6_POLYFILLS&&typeof Object.setPrototypeOf=="function"?Object.setPrototypeOf:ge.underscoreProtoCanBeSet()?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null,ge.arrayIteratorImpl=function(e){var t=0;return function(){return to&&(o=Math.max(o+u,0));o{const e=fb.length,t=[];for(let o=0;20>o;o++)t[o]=fb.charAt(Math.random()*e);return t.join("")}},LC=0,mh={TEST_ONLY:$b};mh.genUid=_,mh.getNextUniqueId=v;var bb="",ur=!0,fh=0,$h="ORPHANED_BLOCK",po=[],vb={FIRE_QUEUE:po,enqueueEvent:Ce,fireNow:he,fireInternal:Z,setGroupInternal:Q};i.disable$$module$build$src$core$events$utils,i.enable$$module$build$src$core$events$utils,i.getGroup$$module$build$src$core$events$utils,i.setGroup$$module$build$src$core$events$utils,i.setRecordUndo$$module$build$src$core$events$utils;var dr=Object.create(null),yb,ai=null,_b,hr=[],wb={defineBlocksWithJsonArrayInternal:We},Rt={TEST_ONLY:wb};Rt.createBlockDefinitionsFromJsonArray=i.createBlockDefinitionsFromJsonArray$$module$build$src$core$common,Rt.defineBlocks=i.defineBlocks$$module$build$src$core$common,Rt.defineBlocksWithJsonArray=Ae,Rt.draggingConnections=hr,Rt.getAllWorkspaces=B,Rt.getBlockTypeCounts=Ie,Rt.getMainWorkspace=q,Rt.getParentContainer=Te,Rt.getSelected=F,Rt.getWorkspaceById=re,Rt.registerWorkspace=N,Rt.setMainWorkspace=se,Rt.setParentContainer=ae,Rt.setSelected=i.setSelected$$module$build$src$core$common,Rt.svgResize=we,Rt.unregisterWorkpace=te;var qi=class{constructor(){this.workspaceId=void 0,this.isUiEvent=!1,this.type="",this.group=i.getGroup$$module$build$src$core$events$utils(),this.recordUndo=G()}toJson(){return{type:this.type,group:this.group}}static fromJson(e,t,o){return o.isBlank=!1,o.group=e.group||"",o.workspaceId=t.id,o}isNull(){return!1}run(e){}getEventWorkspace_(){let e;if(this.workspaceId&&(e=re(this.workspaceId)),!e)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return e}},Ss=class extends qi{constructor(e){super(),this.recordUndo=!1,this.isUiEvent=!0,this.isBlank=typeof e>"u",this.workspaceId=e||""}},bh=class extends Ss{constructor(e,t,o){t=e?e.workspace.id:t,t===null&&(t=void 0),super(t),this.type=ee.CLICK,this.blockId=e?e.id:void 0,this.targetType=o}toJson(){const e=super.toJson();if(!this.targetType)throw Error("The click target type is undefined. Either pass a block to the constructor, or call fromJson");return e.targetType=this.targetType,e.blockId=this.blockId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new bh),t.targetType=e.targetType,t.blockId=e.blockId,t}},vh;(function(e){e.BLOCK="block",e.WORKSPACE="workspace",e.ZOOM_CONTROLS="zoom_controls"})(vh||(vh={})),r($e.EVENT,ee.CLICK,bh);var PC=750,kb="ontouchstart"in globalThis||!!(globalThis.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!globalThis.navigator||!globalThis.navigator.maxTouchPoints&&!globalThis.navigator.msMaxTouchPoints),il=null,li={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"],mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]},nl=0,ci={TOUCH_ENABLED:kb,TOUCH_MAP:li};ci.checkTouchIdentifier=U,ci.clearTouchIdentifier=Y,ci.getTouchIdentifierFromEvent=A,ci.longStart=k,ci.longStop=X,ci.shouldHandleEvent=R;var yh,Cb,Tb,Sb,rl,al,_h,Eb,Ib,xb;(function(e){function t(n){return o.includes(n.toUpperCase())}yh=e;const o=yh.toUpperCase();Cb=t("JavaFX"),Tb=t("WebKit"),Sb=t("Gecko")&&!Tb,rl=t("Android"),e=globalThis.navigator&&globalThis.navigator.maxTouchPoints,al=t("iPad")||t("Macintosh")&&0{n.push(this.componentData.get(u))}),n.sort(function(u,g){return u.weight-g.weight}),n.forEach(function(u){o.push(u.component)})}else e.forEach(n=>{o.push(this.componentData.get(n).component)});return o}};gt.Capability=mo,(function(e){e=e.ComponentWeight||(e.ComponentWeight={}),e[e.TOOLBOX_WEIGHT=0]="TOOLBOX_WEIGHT",e[e.FLYOUT_WEIGHT=1]="FLYOUT_WEIGHT",e[e.TRASHCAN_WEIGHT=2]="TRASHCAN_WEIGHT",e[e.ZOOM_CONTROLS_WEIGHT=3]="ZOOM_CONTROLS_WEIGHT"})(gt||(gt={})),gt.ComponentWeight;var Ch=!1,Th=` .blocklySvg { background-color: #fff; outline: none; @@ -719,7 +719,7 @@ input[type=number] { z-index: 80; pointer-events: none; } -`,Sh={};Sh.inject=Pt,Sh.register=Be;var ye=class{constructor(e,t){this.x=e,this.y=t}clone(){return new ye(this.x,this.y)}scale(e){return this.x*=e,this.y*=e,this}translate(e,t){return this.x+=e,this.y+=t,this}static equals(e,t){return e===t?!0:e&&t?e.x===t.x&&e.y===t.y:!1}static distance(e,t){const o=e.x-t.x;return e=e.y-t.y,Math.sqrt(o*o+e*e)}static magnitude(e){return Math.sqrt(e.x*e.x+e.y*e.y)}static difference(e,t){return new ye(e.x-t.x,e.y-t.y)}static sum(e,t){return new ye(e.x+t.x,e.y+t.y)}},pr="http://www.w3.org/2000/svg",Gs="http://www.w3.org/1999/xhtml",is="http://www.w3.org/1999/xlink",fo;(function(e){e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE"})(fo||(fo={}));var Es=null,Eh=0,cl=null,Dt={HTML_NS:Gs};Dt.NodeType=fo,Dt.SVG_NS=pr,Dt.XLINK_NS=is,Dt.addClass=Oe,Dt.createSvgElement=ie,Dt.getFastTextWidth=Io,Dt.getFastTextWidthWithSizeString=Bs,Dt.getTextWidth=Un,Dt.hasClass=Zo,Dt.insertAfter=At,Dt.measureFontMetrics=ro,Dt.removeClass=ze,Dt.removeClasses=Ps,Dt.removeNode=Ze,Dt.setCssTransform=Qo,Dt.startTextWidthCache=io,Dt.stopTextWidthCache=no;var J=class{constructor(e){this.tagName=e}toString(){return this.tagName}};J.ANIMATE=new J("animate"),J.CIRCLE=new J("circle"),J.CLIPPATH=new J("clipPath"),J.DEFS=new J("defs"),J.FECOMPOSITE=new J("feComposite"),J.FECOMPONENTTRANSFER=new J("feComponentTransfer"),J.FEFLOOD=new J("feFlood"),J.FEFUNCA=new J("feFuncA"),J.FEGAUSSIANBLUR=new J("feGaussianBlur"),J.FEPOINTLIGHT=new J("fePointLight"),J.FESPECULARLIGHTING=new J("feSpecularLighting"),J.FILTER=new J("filter"),J.FOREIGNOBJECT=new J("foreignObject"),J.G=new J("g"),J.IMAGE=new J("image"),J.LINE=new J("line"),J.PATH=new J("path"),J.PATTERN=new J("pattern"),J.POLYGON=new J("polygon"),J.RECT=new J("rect"),J.SVG=new J("svg"),J.TEXT=new J("text"),J.TSPAN=new J("tspan");var rt=class{constructor(e,t,o,n){this.top=e,this.bottom=t,this.left=o,this.right=n}clone(){return new rt(this.top,this.bottom,this.left,this.right)}getHeight(){return this.bottom-this.top}getWidth(){return this.right-this.left}contains(e,t){return e>=this.left&&e<=this.right&&t>=this.top&&t<=this.bottom}intersects(e){return this.left<=e.right&&this.right>=e.left&&this.bottom>=e.top&&this.top<=e.bottom}static equals(e,t){return e===t?!0:e&&t?e.top===t.top&&e.bottom===t.bottom&&e.left===t.left&&e.right===t.right:!1}static createFromPoint(e,t,o){const n=e.x;return e=e.y,new rt(e,e+o,n,n+t)}},Xe=class{constructor(e,t){this.width=e,this.height=t}static equals(e,t){return e===t?!0:e&&t?e.width===t.width&&e.height===t.height:!1}static max(e,t){return new Xe(Math.max(e.width,t.width),Math.max(e.height,t.height))}static min(e,t){return new Xe(Math.min(e.width,t.width),Math.min(e.height,t.height))}},Pb={getSizeInternal:Km},Mo={TEST_ONLY:Pb};Mo.getBorderBox=mu,Mo.getComputedStyle=Fs,Mo.getContainerOffsetToScrollInto=fu,Mo.getPageOffset=xo,Mo.getSize=Hn,Mo.getViewportPageOffset=gu,Mo.scrollIntoContainerView=ma;var Bb=/translate\(\s*([-+\d.e]+)([ ,]\s*([-+\d.e]+)\s*)?/,Fb=/transform:\s*translate(?:3d)?\(\s*([-+\d.e]+)\s*px([ ,]\s*([-+\d.e]+)\s*px)?/,jC={XY_REGEX:Bb,XY_STYLE_REGEX:Fb},ui={TEST_ONLY:jC};ui.getDocumentScroll=bu,ui.getInjectionDivXY=fa,ui.getRelativeXY=Wn,ui.getViewportBBox=$u,ui.screenToWsCoordinates=Ym,ui.wsToScreenCoordinates=Jm;var yt=class{constructor(e,t,o,n,u){this.workspace=e,this.horizontal=t,this.oldHostMetrics=null,this.ratio=1,this.origin=new ye(0,0),this.startDragHandle=this.handlePosition=this.handleLength=this.scrollbarLength=this.startDragMouse=0,this.containerVisible=this.isHandleVisible=!0,this.position=new ye(0,0),this.onMouseMoveWrapper_=this.onMouseUpWrapper_=null,this.pair=o||!1,this.margin=u!==void 0?u:yt.DEFAULT_SCROLLBAR_MARGIN,e="blocklyScrollbar"+(this.horizontal?"Horizontal":"Vertical"),n&&(e+=" "+n),this.outerSvg=ie(J.SVG,{class:e}),n=ie(J.G,{},this.outerSvg),this.svgBackground=ie(J.RECT,{class:"blocklyScrollbarBackground"},n),e=Math.floor((yt.scrollbarThickness-5)/2),this.svgHandle=ie(J.RECT,{class:"blocklyScrollbarHandle",rx:e,ry:e},n),this.workspace.getThemeManager().subscribe(this.svgHandle,"scrollbarColour","fill"),this.workspace.getThemeManager().subscribe(this.svgHandle,"scrollbarOpacity","fill-opacity"),At(this.outerSvg,this.workspace.getParentSvg()),this.setInitialThickness(),t?(this.lengthAttribute_="width",this.positionAttribute_="x"):(this.lengthAttribute_="height",this.positionAttribute_="y"),this.onMouseDownBarWrapper_=H(this.svgBackground,"pointerdown",this,this.onMouseDownBar),this.onMouseDownHandleWrapper_=H(this.svgHandle,"pointerdown",this,this.onMouseDownHandle)}setInitialThickness(){const e=yt.scrollbarThickness;this.horizontal?(this.svgBackground.setAttribute("height",String(e)),this.outerSvg.setAttribute("height",String(e)),this.svgHandle.setAttribute("height",String(e-5)),this.svgHandle.setAttribute("y","2.5")):(this.svgBackground.setAttribute("width",String(e)),this.outerSvg.setAttribute("width",String(e)),this.svgHandle.setAttribute("width",String(e-5)),this.svgHandle.setAttribute("x","2.5"))}dispose(){this.cleanUp(),V(this.onMouseDownBarWrapper_),V(this.onMouseDownHandleWrapper_),Ze(this.outerSvg),this.workspace.getThemeManager().unsubscribe(this.svgHandle)}constrainHandleLength(e){return e=0>=e||isNaN(e)?0:Math.min(e,this.scrollbarLength)}setHandleLength(e){this.handleLength=e,this.svgHandle.setAttribute(this.lengthAttribute_,String(this.handleLength))}constrainHandlePosition(e){return e=0>=e||isNaN(e)?0:Math.min(e,this.scrollbarLength-this.handleLength)}setHandlePosition(e){this.handlePosition=e,this.svgHandle.setAttribute(this.positionAttribute_,String(this.handlePosition))}setScrollbarLength(e){this.scrollbarLength=e,this.outerSvg.setAttribute(this.lengthAttribute_,String(this.scrollbarLength)),this.svgBackground.setAttribute(this.lengthAttribute_,String(this.scrollbarLength))}setPosition(e,t){this.position.x=e,this.position.y=t,Qo(this.outerSvg,"translate("+(this.position.x+this.origin.x)+"px,"+(this.position.y+this.origin.y)+"px)")}resize(e){!e&&(e=this.workspace.getMetrics(),!e)||this.oldHostMetrics&&yt.metricsAreEquivalent(e,this.oldHostMetrics)||(this.horizontal?this.resizeHorizontal(e):this.resizeVertical(e),this.oldHostMetrics=e,this.updateMetrics())}requiresViewResize(e){return this.oldHostMetrics?this.oldHostMetrics.viewWidth!==e.viewWidth||this.oldHostMetrics.viewHeight!==e.viewHeight||this.oldHostMetrics.absoluteLeft!==e.absoluteLeft||this.oldHostMetrics.absoluteTop!==e.absoluteTop:!0}resizeHorizontal(e){this.requiresViewResize(e)?this.resizeViewHorizontal(e):this.resizeContentHorizontal(e)}resizeViewHorizontal(e){var t=e.viewWidth-2*this.margin;this.pair&&(t-=yt.scrollbarThickness),this.setScrollbarLength(Math.max(0,t)),t=e.absoluteLeft+this.margin,this.pair&&this.workspace.RTL&&(t+=yt.scrollbarThickness),this.setPosition(t,e.absoluteTop+e.viewHeight-yt.scrollbarThickness-this.margin),this.resizeContentHorizontal(e)}resizeContentHorizontal(e){if(e.viewWidth>=e.scrollWidth)this.setHandleLength(this.scrollbarLength),this.setHandlePosition(0),this.pair||this.setVisible(!1);else{this.pair||this.setVisible(!0);var t=this.scrollbarLength*e.viewWidth/e.scrollWidth;t=this.constrainHandleLength(t),this.setHandleLength(t),t=e.scrollWidth-e.viewWidth;var o=this.scrollbarLength-this.handleLength;e=(e.viewLeft-e.scrollLeft)/t*o,e=this.constrainHandlePosition(e),this.setHandlePosition(e),this.ratio=o/t}}resizeVertical(e){this.requiresViewResize(e)?this.resizeViewVertical(e):this.resizeContentVertical(e)}resizeViewVertical(e){let t=e.viewHeight-2*this.margin;this.pair&&(t-=yt.scrollbarThickness),this.setScrollbarLength(Math.max(0,t)),this.setPosition(this.workspace.RTL?e.absoluteLeft+this.margin:e.absoluteLeft+e.viewWidth-yt.scrollbarThickness-this.margin,e.absoluteTop+this.margin),this.resizeContentVertical(e)}resizeContentVertical(e){if(e.viewHeight>=e.scrollHeight)this.setHandleLength(this.scrollbarLength),this.setHandlePosition(0),this.pair||this.setVisible(!1);else{this.pair||this.setVisible(!0);var t=this.scrollbarLength*e.viewHeight/e.scrollHeight;t=this.constrainHandleLength(t),this.setHandleLength(t),t=e.scrollHeight-e.viewHeight;var o=this.scrollbarLength-this.handleLength;e=(e.viewTop-e.scrollTop)/t*o,e=this.constrainHandlePosition(e),this.setHandlePosition(e),this.ratio=o/t}}isVisible(){return this.isHandleVisible}setContainerVisible(e){const t=e!==this.containerVisible;this.containerVisible=e,t&&this.updateDisplay_()}setVisible(e){if(this.pair)throw Error("Unable to toggle visibility of paired scrollbars.");this.setVisibleInternal(e)}setVisibleInternal(e){const t=e!==this.isVisible();this.isHandleVisible=e,t&&this.updateDisplay_()}updateDisplay_(){this.containerVisible&&this.isVisible()?this.outerSvg.setAttribute("display","block"):this.outerSvg.setAttribute("display","none")}onMouseDownBar(e){if(this.workspace.markFocused(),Y(),this.cleanUp(),pe(e))e.stopPropagation();else{var t=fe(e,this.workspace.getParentSvg(),this.workspace.getInverseScreenCTM());t=this.horizontal?t.x:t.y;var o=fa(this.svgHandle);o=this.horizontal?o.x:o.y;var n=this.handlePosition,u=.95*this.handleLength;t<=o?n-=u:t>=o+this.handleLength&&(n+=u),this.setHandlePosition(this.constrainHandlePosition(n)),this.updateMetrics(),e.stopPropagation(),e.preventDefault()}}onMouseDownHandle(e){this.workspace.markFocused(),this.cleanUp(),pe(e)?e.stopPropagation():(this.startDragHandle=this.handlePosition,this.startDragMouse=this.horizontal?e.clientX:e.clientY,this.onMouseUpWrapper_=H(document,"pointerup",this,this.onMouseUpHandle),this.onMouseMoveWrapper_=H(document,"pointermove",this,this.onMouseMoveHandle),e.stopPropagation(),e.preventDefault())}onMouseMoveHandle(e){this.setHandlePosition(this.constrainHandlePosition(this.startDragHandle+((this.horizontal?e.clientX:e.clientY)-this.startDragMouse))),this.updateMetrics()}onMouseUpHandle(){Y(),this.cleanUp()}cleanUp(){this.workspace.hideChaff(!0),this.onMouseUpWrapper_&&(V(this.onMouseUpWrapper_),this.onMouseUpWrapper_=null),this.onMouseMoveWrapper_&&(V(this.onMouseMoveWrapper_),this.onMouseMoveWrapper_=null)}getRatio_(){let e=this.handlePosition/(this.scrollbarLength-this.handleLength);return isNaN(e)&&(e=0),e}updateMetrics(){const e=this.getRatio_();this.horizontal?this.workspace.setMetrics({x:e}):this.workspace.setMetrics({y:e})}set(e,t){this.setHandlePosition(this.constrainHandlePosition(e*this.ratio)),(t||t===void 0)&&this.updateMetrics()}setOrigin(e,t){this.origin=new ye(e,t)}static metricsAreEquivalent(e,t){return e.viewWidth===t.viewWidth&&e.viewHeight===t.viewHeight&&e.viewLeft===t.viewLeft&&e.viewTop===t.viewTop&&e.absoluteTop===t.absoluteTop&&e.absoluteLeft===t.absoluteLeft&&e.scrollWidth===t.scrollWidth&&e.scrollHeight===t.scrollHeight&&e.scrollLeft===t.scrollLeft&&e.scrollTop===t.scrollTop}};yt.scrollbarThickness=kb?25:15,yt.DEFAULT_SCROLLBAR_MARGIN=.5;var ul={parseFromString:function(){throw Error("DOMParser was not found in the global scope and was not properly injected using injectDependencies")}},Ih={serializeToString:function(){throw Error("XMLSerializer was not foundin the global scope and was not properly injected using injectDependencies")}},{document:dl,DOMParser:gr,XMLSerializer:mr}=globalThis;gr&&(ul=new gr),mr&&(Ih=new mr);var jb="https://developers.google.com/blockly/xml",zC=/[\x00-\x09\x0B\x0C\x0E-\x1F]/g,Xi={NAME_SPACE:jb};Xi.createElement=i.createElement$$module$build$src$core$utils$xml,Xi.createTextNode=i.createTextNode$$module$build$src$core$utils$xml,Xi.domToText=Li,Xi.injectDependencies=qm,Xi.textToDom=i.textToDom$$module$build$src$core$utils$xml;var xh="categoryToolbox",zb="flyoutToolbox",Ge;(function(e){e[e.TOP=0]="TOP",e[e.BOTTOM=1]="BOTTOM",e[e.LEFT=2]="LEFT",e[e.RIGHT=3]="RIGHT"})(Ge||(Ge={}));var Ub={hasCategoriesInternal:Qm},Lo={};Lo.Position=Ge,Lo.TEST_ONLY=Ub,Lo.convertFlyoutDefToJsonArray=Gn,Lo.convertToolboxDefToJson=$a,Lo.hasCategories=ba,Lo.isCategoryCollapsible=va,Lo.parseToolboxTree=yu;var $o;(function(e){e[e.TOP=0]="TOP",e[e.BOTTOM=1]="BOTTOM"})($o||($o={}));var Zi;(function(e){e[e.LEFT=0]="LEFT",e[e.RIGHT=1]="RIGHT"})(Zi||(Zi={}));var Po;(function(e){e[e.UP=0]="UP",e[e.DOWN=1]="DOWN"})(Po||(Po={}));var di={};di.bumpDirection=Po,di.bumpPositionRect=ka,di.getCornerOppositeToolbox=wa,di.getStartPositionRect=_a,di.horizontalPosition=Zi,di.verticalPosition=$o;var Wt={width:96,height:124,url:"sprites.png"},Hb=class{constructor(e){this.workspace=e,this.id="zoomControls",this.boundEvents=[],this.zoomResetGroup=this.zoomOutGroup=this.zoomInGroup=null,this.HEIGHT=this.WIDTH=32,this.SMALL_SPACING=2,this.LARGE_SPACING=11,this.MARGIN_HORIZONTAL=this.MARGIN_VERTICAL=20,this.svgGroup=null,this.top=this.left=0,this.initialized=!1}createDom(){this.svgGroup=ie(J.G,{});const e=String(Math.random()).substring(2);return this.createZoomOutSvg(e),this.createZoomInSvg(e),this.workspace.isMovable()&&this.createZoomResetSvg(e),this.svgGroup}init(){this.workspace.getComponentManager().addComponent({component:this,weight:gt.ComponentWeight.ZOOM_CONTROLS_WEIGHT,capabilities:[gt.Capability.POSITIONABLE]}),this.initialized=!0}dispose(){this.workspace.getComponentManager().removeComponent("zoomControls"),this.svgGroup&&Ze(this.svgGroup);for(const e of this.boundEvents)V(e);this.boundEvents.length=0}getBoundingRectangle(){let e=this.SMALL_SPACING+2*this.HEIGHT;return this.zoomResetGroup&&(e+=this.LARGE_SPACING+this.HEIGHT),new rt(this.top,this.top+e,this.left,this.left+this.WIDTH)}position(e,t){if(this.initialized){var o=wa(this.workspace,e),n=this.SMALL_SPACING+2*this.HEIGHT;if(this.zoomResetGroup&&(n+=this.LARGE_SPACING+this.HEIGHT),e=_a(o,new Xe(this.WIDTH,n),this.MARGIN_HORIZONTAL,this.MARGIN_VERTICAL,e,this.workspace),o=o.vertical,t=ka(e,this.MARGIN_VERTICAL,o===$o.TOP?Po.DOWN:Po.UP,t),o===$o.TOP){var u=this.SMALL_SPACING+this.HEIGHT,g;(g=this.zoomInGroup)==null||g.setAttribute("transform","translate(0, "+u+")"),this.zoomResetGroup&&this.zoomResetGroup.setAttribute("transform","translate(0, "+(u+this.LARGE_SPACING+this.HEIGHT)+")")}else{g=this.zoomResetGroup?this.LARGE_SPACING+this.HEIGHT:0;let L;(L=this.zoomInGroup)==null||L.setAttribute("transform","translate(0, "+g+")"),g=g+this.SMALL_SPACING+this.HEIGHT,(u=this.zoomOutGroup)==null||u.setAttribute("transform","translate(0, "+g+")")}this.top=t.top,this.left=t.left;var I;(I=this.svgGroup)==null||I.setAttribute("transform","translate("+this.left+","+this.top+")")}}createZoomOutSvg(e){this.zoomOutGroup=ie(J.G,{class:"blocklyZoom blocklyZoomOut"},this.svgGroup);const t=ie(J.CLIPPATH,{id:"blocklyZoomoutClipPath"+e},this.zoomOutGroup);ie(J.RECT,{width:32,height:32},t),ie(J.IMAGE,{width:Wt.width,height:Wt.height,x:-64,y:-92,"clip-path":"url(#blocklyZoomoutClipPath"+e+")"},this.zoomOutGroup).setAttributeNS(is,"xlink:href",this.workspace.options.pathToMedia+Wt.url),this.boundEvents.push(H(this.zoomOutGroup,"pointerdown",null,this.zoom.bind(this,-1)))}createZoomInSvg(e){this.zoomInGroup=ie(J.G,{class:"blocklyZoom blocklyZoomIn"},this.svgGroup);const t=ie(J.CLIPPATH,{id:"blocklyZoominClipPath"+e},this.zoomInGroup);ie(J.RECT,{width:32,height:32},t),ie(J.IMAGE,{width:Wt.width,height:Wt.height,x:-32,y:-92,"clip-path":"url(#blocklyZoominClipPath"+e+")"},this.zoomInGroup).setAttributeNS(is,"xlink:href",this.workspace.options.pathToMedia+Wt.url),this.boundEvents.push(H(this.zoomInGroup,"pointerdown",null,this.zoom.bind(this,1)))}zoom(e,t){this.workspace.markFocused(),this.workspace.zoomCenter(e),this.fireZoomEvent(),Y(),t.stopPropagation(),t.preventDefault()}createZoomResetSvg(e){this.zoomResetGroup=ie(J.G,{class:"blocklyZoom blocklyZoomReset"},this.svgGroup);const t=ie(J.CLIPPATH,{id:"blocklyZoomresetClipPath"+e},this.zoomResetGroup);ie(J.RECT,{width:32,height:32},t),ie(J.IMAGE,{width:Wt.width,height:Wt.height,y:-92,"clip-path":"url(#blocklyZoomresetClipPath"+e+")"},this.zoomResetGroup).setAttributeNS(is,"xlink:href",this.workspace.options.pathToMedia+Wt.url),this.boundEvents.push(H(this.zoomResetGroup,"pointerdown",null,this.resetZoom.bind(this)))}resetZoom(e){this.workspace.markFocused();const t=Math.log(this.workspace.options.zoomOptions.startScale/this.workspace.scale)/Math.log(this.workspace.options.zoomOptions.scaleSpeed);this.workspace.beginCanvasTransition(),this.workspace.zoomCenter(t),this.workspace.scrollCenter(),setTimeout(this.workspace.endCanvasTransition.bind(this.workspace),500),this.fireZoomEvent(),Y(),e.stopPropagation(),e.preventDefault()}fireZoomEvent(){const e=new(ne(ee.CLICK))(null,this.workspace.id,"zoom_controls");z(e)}};Be(` +`,Sh={};Sh.inject=jt,Sh.register=Be;var ye=class{constructor(e,t){this.x=e,this.y=t}clone(){return new ye(this.x,this.y)}scale(e){return this.x*=e,this.y*=e,this}translate(e,t){return this.x+=e,this.y+=t,this}static equals(e,t){return e===t?!0:e&&t?e.x===t.x&&e.y===t.y:!1}static distance(e,t){const o=e.x-t.x;return e=e.y-t.y,Math.sqrt(o*o+e*e)}static magnitude(e){return Math.sqrt(e.x*e.x+e.y*e.y)}static difference(e,t){return new ye(e.x-t.x,e.y-t.y)}static sum(e,t){return new ye(e.x+t.x,e.y+t.y)}},pr="http://www.w3.org/2000/svg",Gs="http://www.w3.org/1999/xhtml",is="http://www.w3.org/1999/xlink",fo;(function(e){e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE"})(fo||(fo={}));var Es=null,Eh=0,cl=null,Dt={HTML_NS:Gs};Dt.NodeType=fo,Dt.SVG_NS=pr,Dt.XLINK_NS=is,Dt.addClass=Re,Dt.createSvgElement=ie,Dt.getFastTextWidth=Io,Dt.getFastTextWidthWithSizeString=Bs,Dt.getTextWidth=Un,Dt.hasClass=Zo,Dt.insertAfter=At,Dt.measureFontMetrics=ro,Dt.removeClass=ze,Dt.removeClasses=Ps,Dt.removeNode=Ze,Dt.setCssTransform=Qo,Dt.startTextWidthCache=io,Dt.stopTextWidthCache=no;var J=class{constructor(e){this.tagName=e}toString(){return this.tagName}};J.ANIMATE=new J("animate"),J.CIRCLE=new J("circle"),J.CLIPPATH=new J("clipPath"),J.DEFS=new J("defs"),J.FECOMPOSITE=new J("feComposite"),J.FECOMPONENTTRANSFER=new J("feComponentTransfer"),J.FEFLOOD=new J("feFlood"),J.FEFUNCA=new J("feFuncA"),J.FEGAUSSIANBLUR=new J("feGaussianBlur"),J.FEPOINTLIGHT=new J("fePointLight"),J.FESPECULARLIGHTING=new J("feSpecularLighting"),J.FILTER=new J("filter"),J.FOREIGNOBJECT=new J("foreignObject"),J.G=new J("g"),J.IMAGE=new J("image"),J.LINE=new J("line"),J.PATH=new J("path"),J.PATTERN=new J("pattern"),J.POLYGON=new J("polygon"),J.RECT=new J("rect"),J.SVG=new J("svg"),J.TEXT=new J("text"),J.TSPAN=new J("tspan");var rt=class{constructor(e,t,o,n){this.top=e,this.bottom=t,this.left=o,this.right=n}clone(){return new rt(this.top,this.bottom,this.left,this.right)}getHeight(){return this.bottom-this.top}getWidth(){return this.right-this.left}contains(e,t){return e>=this.left&&e<=this.right&&t>=this.top&&t<=this.bottom}intersects(e){return this.left<=e.right&&this.right>=e.left&&this.bottom>=e.top&&this.top<=e.bottom}static equals(e,t){return e===t?!0:e&&t?e.top===t.top&&e.bottom===t.bottom&&e.left===t.left&&e.right===t.right:!1}static createFromPoint(e,t,o){const n=e.x;return e=e.y,new rt(e,e+o,n,n+t)}},Xe=class{constructor(e,t){this.width=e,this.height=t}static equals(e,t){return e===t?!0:e&&t?e.width===t.width&&e.height===t.height:!1}static max(e,t){return new Xe(Math.max(e.width,t.width),Math.max(e.height,t.height))}static min(e,t){return new Xe(Math.min(e.width,t.width),Math.min(e.height,t.height))}},Pb={getSizeInternal:Km},Mo={TEST_ONLY:Pb};Mo.getBorderBox=mu,Mo.getComputedStyle=js,Mo.getContainerOffsetToScrollInto=fu,Mo.getPageOffset=xo,Mo.getSize=Hn,Mo.getViewportPageOffset=gu,Mo.scrollIntoContainerView=ma;var Bb=/translate\(\s*([-+\d.e]+)([ ,]\s*([-+\d.e]+)\s*)?/,jb=/transform:\s*translate(?:3d)?\(\s*([-+\d.e]+)\s*px([ ,]\s*([-+\d.e]+)\s*px)?/,FC={XY_REGEX:Bb,XY_STYLE_REGEX:jb},ui={TEST_ONLY:FC};ui.getDocumentScroll=bu,ui.getInjectionDivXY=fa,ui.getRelativeXY=Wn,ui.getViewportBBox=$u,ui.screenToWsCoordinates=Ym,ui.wsToScreenCoordinates=Jm;var yt=class{constructor(e,t,o,n,u){this.workspace=e,this.horizontal=t,this.oldHostMetrics=null,this.ratio=1,this.origin=new ye(0,0),this.startDragHandle=this.handlePosition=this.handleLength=this.scrollbarLength=this.startDragMouse=0,this.containerVisible=this.isHandleVisible=!0,this.position=new ye(0,0),this.onMouseMoveWrapper_=this.onMouseUpWrapper_=null,this.pair=o||!1,this.margin=u!==void 0?u:yt.DEFAULT_SCROLLBAR_MARGIN,e="blocklyScrollbar"+(this.horizontal?"Horizontal":"Vertical"),n&&(e+=" "+n),this.outerSvg=ie(J.SVG,{class:e}),n=ie(J.G,{},this.outerSvg),this.svgBackground=ie(J.RECT,{class:"blocklyScrollbarBackground"},n),e=Math.floor((yt.scrollbarThickness-5)/2),this.svgHandle=ie(J.RECT,{class:"blocklyScrollbarHandle",rx:e,ry:e},n),this.workspace.getThemeManager().subscribe(this.svgHandle,"scrollbarColour","fill"),this.workspace.getThemeManager().subscribe(this.svgHandle,"scrollbarOpacity","fill-opacity"),At(this.outerSvg,this.workspace.getParentSvg()),this.setInitialThickness(),t?(this.lengthAttribute_="width",this.positionAttribute_="x"):(this.lengthAttribute_="height",this.positionAttribute_="y"),this.onMouseDownBarWrapper_=H(this.svgBackground,"pointerdown",this,this.onMouseDownBar),this.onMouseDownHandleWrapper_=H(this.svgHandle,"pointerdown",this,this.onMouseDownHandle)}setInitialThickness(){const e=yt.scrollbarThickness;this.horizontal?(this.svgBackground.setAttribute("height",String(e)),this.outerSvg.setAttribute("height",String(e)),this.svgHandle.setAttribute("height",String(e-5)),this.svgHandle.setAttribute("y","2.5")):(this.svgBackground.setAttribute("width",String(e)),this.outerSvg.setAttribute("width",String(e)),this.svgHandle.setAttribute("width",String(e-5)),this.svgHandle.setAttribute("x","2.5"))}dispose(){this.cleanUp(),V(this.onMouseDownBarWrapper_),V(this.onMouseDownHandleWrapper_),Ze(this.outerSvg),this.workspace.getThemeManager().unsubscribe(this.svgHandle)}constrainHandleLength(e){return e=0>=e||isNaN(e)?0:Math.min(e,this.scrollbarLength)}setHandleLength(e){this.handleLength=e,this.svgHandle.setAttribute(this.lengthAttribute_,String(this.handleLength))}constrainHandlePosition(e){return e=0>=e||isNaN(e)?0:Math.min(e,this.scrollbarLength-this.handleLength)}setHandlePosition(e){this.handlePosition=e,this.svgHandle.setAttribute(this.positionAttribute_,String(this.handlePosition))}setScrollbarLength(e){this.scrollbarLength=e,this.outerSvg.setAttribute(this.lengthAttribute_,String(this.scrollbarLength)),this.svgBackground.setAttribute(this.lengthAttribute_,String(this.scrollbarLength))}setPosition(e,t){this.position.x=e,this.position.y=t,Qo(this.outerSvg,"translate("+(this.position.x+this.origin.x)+"px,"+(this.position.y+this.origin.y)+"px)")}resize(e){!e&&(e=this.workspace.getMetrics(),!e)||this.oldHostMetrics&&yt.metricsAreEquivalent(e,this.oldHostMetrics)||(this.horizontal?this.resizeHorizontal(e):this.resizeVertical(e),this.oldHostMetrics=e,this.updateMetrics())}requiresViewResize(e){return this.oldHostMetrics?this.oldHostMetrics.viewWidth!==e.viewWidth||this.oldHostMetrics.viewHeight!==e.viewHeight||this.oldHostMetrics.absoluteLeft!==e.absoluteLeft||this.oldHostMetrics.absoluteTop!==e.absoluteTop:!0}resizeHorizontal(e){this.requiresViewResize(e)?this.resizeViewHorizontal(e):this.resizeContentHorizontal(e)}resizeViewHorizontal(e){var t=e.viewWidth-2*this.margin;this.pair&&(t-=yt.scrollbarThickness),this.setScrollbarLength(Math.max(0,t)),t=e.absoluteLeft+this.margin,this.pair&&this.workspace.RTL&&(t+=yt.scrollbarThickness),this.setPosition(t,e.absoluteTop+e.viewHeight-yt.scrollbarThickness-this.margin),this.resizeContentHorizontal(e)}resizeContentHorizontal(e){if(e.viewWidth>=e.scrollWidth)this.setHandleLength(this.scrollbarLength),this.setHandlePosition(0),this.pair||this.setVisible(!1);else{this.pair||this.setVisible(!0);var t=this.scrollbarLength*e.viewWidth/e.scrollWidth;t=this.constrainHandleLength(t),this.setHandleLength(t),t=e.scrollWidth-e.viewWidth;var o=this.scrollbarLength-this.handleLength;e=(e.viewLeft-e.scrollLeft)/t*o,e=this.constrainHandlePosition(e),this.setHandlePosition(e),this.ratio=o/t}}resizeVertical(e){this.requiresViewResize(e)?this.resizeViewVertical(e):this.resizeContentVertical(e)}resizeViewVertical(e){let t=e.viewHeight-2*this.margin;this.pair&&(t-=yt.scrollbarThickness),this.setScrollbarLength(Math.max(0,t)),this.setPosition(this.workspace.RTL?e.absoluteLeft+this.margin:e.absoluteLeft+e.viewWidth-yt.scrollbarThickness-this.margin,e.absoluteTop+this.margin),this.resizeContentVertical(e)}resizeContentVertical(e){if(e.viewHeight>=e.scrollHeight)this.setHandleLength(this.scrollbarLength),this.setHandlePosition(0),this.pair||this.setVisible(!1);else{this.pair||this.setVisible(!0);var t=this.scrollbarLength*e.viewHeight/e.scrollHeight;t=this.constrainHandleLength(t),this.setHandleLength(t),t=e.scrollHeight-e.viewHeight;var o=this.scrollbarLength-this.handleLength;e=(e.viewTop-e.scrollTop)/t*o,e=this.constrainHandlePosition(e),this.setHandlePosition(e),this.ratio=o/t}}isVisible(){return this.isHandleVisible}setContainerVisible(e){const t=e!==this.containerVisible;this.containerVisible=e,t&&this.updateDisplay_()}setVisible(e){if(this.pair)throw Error("Unable to toggle visibility of paired scrollbars.");this.setVisibleInternal(e)}setVisibleInternal(e){const t=e!==this.isVisible();this.isHandleVisible=e,t&&this.updateDisplay_()}updateDisplay_(){this.containerVisible&&this.isVisible()?this.outerSvg.setAttribute("display","block"):this.outerSvg.setAttribute("display","none")}onMouseDownBar(e){if(this.workspace.markFocused(),Y(),this.cleanUp(),pe(e))e.stopPropagation();else{var t=fe(e,this.workspace.getParentSvg(),this.workspace.getInverseScreenCTM());t=this.horizontal?t.x:t.y;var o=fa(this.svgHandle);o=this.horizontal?o.x:o.y;var n=this.handlePosition,u=.95*this.handleLength;t<=o?n-=u:t>=o+this.handleLength&&(n+=u),this.setHandlePosition(this.constrainHandlePosition(n)),this.updateMetrics(),e.stopPropagation(),e.preventDefault()}}onMouseDownHandle(e){this.workspace.markFocused(),this.cleanUp(),pe(e)?e.stopPropagation():(this.startDragHandle=this.handlePosition,this.startDragMouse=this.horizontal?e.clientX:e.clientY,this.onMouseUpWrapper_=H(document,"pointerup",this,this.onMouseUpHandle),this.onMouseMoveWrapper_=H(document,"pointermove",this,this.onMouseMoveHandle),e.stopPropagation(),e.preventDefault())}onMouseMoveHandle(e){this.setHandlePosition(this.constrainHandlePosition(this.startDragHandle+((this.horizontal?e.clientX:e.clientY)-this.startDragMouse))),this.updateMetrics()}onMouseUpHandle(){Y(),this.cleanUp()}cleanUp(){this.workspace.hideChaff(!0),this.onMouseUpWrapper_&&(V(this.onMouseUpWrapper_),this.onMouseUpWrapper_=null),this.onMouseMoveWrapper_&&(V(this.onMouseMoveWrapper_),this.onMouseMoveWrapper_=null)}getRatio_(){let e=this.handlePosition/(this.scrollbarLength-this.handleLength);return isNaN(e)&&(e=0),e}updateMetrics(){const e=this.getRatio_();this.horizontal?this.workspace.setMetrics({x:e}):this.workspace.setMetrics({y:e})}set(e,t){this.setHandlePosition(this.constrainHandlePosition(e*this.ratio)),(t||t===void 0)&&this.updateMetrics()}setOrigin(e,t){this.origin=new ye(e,t)}static metricsAreEquivalent(e,t){return e.viewWidth===t.viewWidth&&e.viewHeight===t.viewHeight&&e.viewLeft===t.viewLeft&&e.viewTop===t.viewTop&&e.absoluteTop===t.absoluteTop&&e.absoluteLeft===t.absoluteLeft&&e.scrollWidth===t.scrollWidth&&e.scrollHeight===t.scrollHeight&&e.scrollLeft===t.scrollLeft&&e.scrollTop===t.scrollTop}};yt.scrollbarThickness=kb?25:15,yt.DEFAULT_SCROLLBAR_MARGIN=.5;var ul={parseFromString:function(){throw Error("DOMParser was not found in the global scope and was not properly injected using injectDependencies")}},Ih={serializeToString:function(){throw Error("XMLSerializer was not foundin the global scope and was not properly injected using injectDependencies")}},{document:dl,DOMParser:gr,XMLSerializer:mr}=globalThis;gr&&(ul=new gr),mr&&(Ih=new mr);var Fb="https://developers.google.com/blockly/xml",zC=/[\x00-\x09\x0B\x0C\x0E-\x1F]/g,Xi={NAME_SPACE:Fb};Xi.createElement=i.createElement$$module$build$src$core$utils$xml,Xi.createTextNode=i.createTextNode$$module$build$src$core$utils$xml,Xi.domToText=Li,Xi.injectDependencies=qm,Xi.textToDom=i.textToDom$$module$build$src$core$utils$xml;var xh="categoryToolbox",zb="flyoutToolbox",Ge;(function(e){e[e.TOP=0]="TOP",e[e.BOTTOM=1]="BOTTOM",e[e.LEFT=2]="LEFT",e[e.RIGHT=3]="RIGHT"})(Ge||(Ge={}));var Ub={hasCategoriesInternal:Qm},Lo={};Lo.Position=Ge,Lo.TEST_ONLY=Ub,Lo.convertFlyoutDefToJsonArray=Gn,Lo.convertToolboxDefToJson=$a,Lo.hasCategories=ba,Lo.isCategoryCollapsible=va,Lo.parseToolboxTree=yu;var $o;(function(e){e[e.TOP=0]="TOP",e[e.BOTTOM=1]="BOTTOM"})($o||($o={}));var Zi;(function(e){e[e.LEFT=0]="LEFT",e[e.RIGHT=1]="RIGHT"})(Zi||(Zi={}));var Po;(function(e){e[e.UP=0]="UP",e[e.DOWN=1]="DOWN"})(Po||(Po={}));var di={};di.bumpDirection=Po,di.bumpPositionRect=ka,di.getCornerOppositeToolbox=wa,di.getStartPositionRect=_a,di.horizontalPosition=Zi,di.verticalPosition=$o;var Gt={width:96,height:124,url:"sprites.png"},Hb=class{constructor(e){this.workspace=e,this.id="zoomControls",this.boundEvents=[],this.zoomResetGroup=this.zoomOutGroup=this.zoomInGroup=null,this.HEIGHT=this.WIDTH=32,this.SMALL_SPACING=2,this.LARGE_SPACING=11,this.MARGIN_HORIZONTAL=this.MARGIN_VERTICAL=20,this.svgGroup=null,this.top=this.left=0,this.initialized=!1}createDom(){this.svgGroup=ie(J.G,{});const e=String(Math.random()).substring(2);return this.createZoomOutSvg(e),this.createZoomInSvg(e),this.workspace.isMovable()&&this.createZoomResetSvg(e),this.svgGroup}init(){this.workspace.getComponentManager().addComponent({component:this,weight:gt.ComponentWeight.ZOOM_CONTROLS_WEIGHT,capabilities:[gt.Capability.POSITIONABLE]}),this.initialized=!0}dispose(){this.workspace.getComponentManager().removeComponent("zoomControls"),this.svgGroup&&Ze(this.svgGroup);for(const e of this.boundEvents)V(e);this.boundEvents.length=0}getBoundingRectangle(){let e=this.SMALL_SPACING+2*this.HEIGHT;return this.zoomResetGroup&&(e+=this.LARGE_SPACING+this.HEIGHT),new rt(this.top,this.top+e,this.left,this.left+this.WIDTH)}position(e,t){if(this.initialized){var o=wa(this.workspace,e),n=this.SMALL_SPACING+2*this.HEIGHT;if(this.zoomResetGroup&&(n+=this.LARGE_SPACING+this.HEIGHT),e=_a(o,new Xe(this.WIDTH,n),this.MARGIN_HORIZONTAL,this.MARGIN_VERTICAL,e,this.workspace),o=o.vertical,t=ka(e,this.MARGIN_VERTICAL,o===$o.TOP?Po.DOWN:Po.UP,t),o===$o.TOP){var u=this.SMALL_SPACING+this.HEIGHT,g;(g=this.zoomInGroup)==null||g.setAttribute("transform","translate(0, "+u+")"),this.zoomResetGroup&&this.zoomResetGroup.setAttribute("transform","translate(0, "+(u+this.LARGE_SPACING+this.HEIGHT)+")")}else{g=this.zoomResetGroup?this.LARGE_SPACING+this.HEIGHT:0;let L;(L=this.zoomInGroup)==null||L.setAttribute("transform","translate(0, "+g+")"),g=g+this.SMALL_SPACING+this.HEIGHT,(u=this.zoomOutGroup)==null||u.setAttribute("transform","translate(0, "+g+")")}this.top=t.top,this.left=t.left;var I;(I=this.svgGroup)==null||I.setAttribute("transform","translate("+this.left+","+this.top+")")}}createZoomOutSvg(e){this.zoomOutGroup=ie(J.G,{class:"blocklyZoom blocklyZoomOut"},this.svgGroup);const t=ie(J.CLIPPATH,{id:"blocklyZoomoutClipPath"+e},this.zoomOutGroup);ie(J.RECT,{width:32,height:32},t),ie(J.IMAGE,{width:Gt.width,height:Gt.height,x:-64,y:-92,"clip-path":"url(#blocklyZoomoutClipPath"+e+")"},this.zoomOutGroup).setAttributeNS(is,"xlink:href",this.workspace.options.pathToMedia+Gt.url),this.boundEvents.push(H(this.zoomOutGroup,"pointerdown",null,this.zoom.bind(this,-1)))}createZoomInSvg(e){this.zoomInGroup=ie(J.G,{class:"blocklyZoom blocklyZoomIn"},this.svgGroup);const t=ie(J.CLIPPATH,{id:"blocklyZoominClipPath"+e},this.zoomInGroup);ie(J.RECT,{width:32,height:32},t),ie(J.IMAGE,{width:Gt.width,height:Gt.height,x:-32,y:-92,"clip-path":"url(#blocklyZoominClipPath"+e+")"},this.zoomInGroup).setAttributeNS(is,"xlink:href",this.workspace.options.pathToMedia+Gt.url),this.boundEvents.push(H(this.zoomInGroup,"pointerdown",null,this.zoom.bind(this,1)))}zoom(e,t){this.workspace.markFocused(),this.workspace.zoomCenter(e),this.fireZoomEvent(),Y(),t.stopPropagation(),t.preventDefault()}createZoomResetSvg(e){this.zoomResetGroup=ie(J.G,{class:"blocklyZoom blocklyZoomReset"},this.svgGroup);const t=ie(J.CLIPPATH,{id:"blocklyZoomresetClipPath"+e},this.zoomResetGroup);ie(J.RECT,{width:32,height:32},t),ie(J.IMAGE,{width:Gt.width,height:Gt.height,y:-92,"clip-path":"url(#blocklyZoomresetClipPath"+e+")"},this.zoomResetGroup).setAttributeNS(is,"xlink:href",this.workspace.options.pathToMedia+Gt.url),this.boundEvents.push(H(this.zoomResetGroup,"pointerdown",null,this.resetZoom.bind(this)))}resetZoom(e){this.workspace.markFocused();const t=Math.log(this.workspace.options.zoomOptions.startScale/this.workspace.scale)/Math.log(this.workspace.options.zoomOptions.scaleSpeed);this.workspace.beginCanvasTransition(),this.workspace.zoomCenter(t),this.workspace.scrollCenter(),setTimeout(this.workspace.endCanvasTransition.bind(this.workspace),500),this.fireZoomEvent(),Y(),e.stopPropagation(),e.preventDefault()}fireZoomEvent(){const e=new(ne(ee.CLICK))(null,this.workspace.id,"zoom_controls");z(e)}};Be(` .blocklyZoom>image, .blocklyZoom>svg>image { opacity: .4; } @@ -731,11 +731,11 @@ input[type=number] { .blocklyZoom>image:active, .blocklyZoom>svg>image:active { opacity: .8; } -`);var Wb=100,Gb=75,Vb=50,Kb=25,UC={BLOCKS:Vb,PROCEDURES:Gb,VARIABLES:Wb,WORKSPACE_COMMENTS:Kb},Dh={};Dh.register=Vn,Dh.unregister=tf;var Yb=class{constructor(){this.priority=Kb}save(e){const t=[];for(const o of e.getTopComments())(e=Pi(o,{addCoordinates:!0,saveIds:!0}))&&t.push(e);return t.length?t:null}load(e,t){for(const o of e)Kn(o,t,{recordUndo:G()})}clear(e){for(const t of e.getTopComments())t.dispose()}};Vn("workspaceComments",new Yb);var hl={};hl.WorkspaceCommentSerializer=Yb,hl.append=Kn,hl.save=Pi;var Ah={};Ah.register=Ca,Ah.unregister=sf;var pl=class{paste(e,t,o){e=e.commentState,o&&(e.x=o.x,e.y=o.y),i.disable$$module$build$src$core$events$utils();let n;try{n=Kn(e,t),of(n)}finally{i.enable$$module$build$src$core$events$utils()}return n?(C()&&z(new(ne(ee.COMMENT_CREATE))(n)),i.setSelected$$module$build$src$core$common(n),n):null}};pl.TYPE="workspace-comment",Ca(pl.TYPE,new pl);var Oh;Oh=28,i.config$$module$build$src$core$config={dragRadius:5,flyoutDragRadius:10,snapRadius:Oh,connectingSnapRadius:Oh,currentConnectionPreference:8,bumpDelay:250},i.config$$module$build$src$core$config;var HC="aria-",WC="role",Is;(function(e){e.GRID="grid",e.GRIDCELL="gridcell",e.GROUP="group",e.LISTBOX="listbox",e.MENU="menu",e.MENUITEM="menuitem",e.MENUITEMCHECKBOX="menuitemcheckbox",e.OPTION="option",e.PRESENTATION="presentation",e.ROW="row",e.TREE="tree",e.TREEITEM="treeitem"})(Is||(Is={}));var Et;(function(e){e.ACTIVEDESCENDANT="activedescendant",e.COLCOUNT="colcount",e.DISABLED="disabled",e.EXPANDED="expanded",e.INVALID="invalid",e.LABEL="label",e.LABELLEDBY="labelledby",e.LEVEL="level",e.ORIENTATION="orientation",e.POSINSET="posinset",e.ROWCOUNT="rowcount",e.SELECTED="selected",e.SETSIZE="setsize",e.VALUEMAX="valuemax",e.VALUEMIN="valuemin"})(Et||(Et={}));var fr={};fr.Role=Is,fr.State=Et,fr.setRole=Do,fr.setState=xt;var Rh=class{constructor(){this.menuItems=[],this.roleName=this.element=this.onKeyDownHandler=this.pointerLeaveHandler=this.pointerEnterHandler=this.clickHandler=this.pointerMoveHandler=this.highlightedItem=this.openingCoords=null}addChild(e){this.menuItems.push(e)}render(e){const t=document.createElement("div");t.className="blocklyMenu goog-menu blocklyNonSelectable",t.tabIndex=0,this.roleName&&Do(t,this.roleName),this.element=t;for(let o=0,n;n=this.menuItems[o];o++)t.appendChild(n.createDom());return this.pointerMoveHandler=H(t,"pointermove",this,this.handlePointerMove,!0),this.clickHandler=H(t,"pointerup",this,this.handleClick,!0),this.pointerEnterHandler=H(t,"pointerenter",this,this.handlePointerEnter,!0),this.pointerLeaveHandler=H(t,"pointerleave",this,this.handlePointerLeave,!0),this.onKeyDownHandler=H(t,"keydown",this,this.handleKeyEvent),e.appendChild(t),t}getElement(){return this.element}focus(){const e=this.getElement();e&&(e.focus({preventScroll:!0}),Oe(e,"blocklyFocused"))}blur(){const e=this.getElement();e&&(e.blur(),ze(e,"blocklyFocused"))}setRole(e){this.roleName=e}dispose(){this.pointerMoveHandler&&(V(this.pointerMoveHandler),this.pointerMoveHandler=null),this.clickHandler&&(V(this.clickHandler),this.clickHandler=null),this.pointerEnterHandler&&(V(this.pointerEnterHandler),this.pointerEnterHandler=null),this.pointerLeaveHandler&&(V(this.pointerLeaveHandler),this.pointerLeaveHandler=null),this.onKeyDownHandler&&(V(this.onKeyDownHandler),this.onKeyDownHandler=null);for(let e=0,t;t=this.menuItems[e];e++)t.dispose();this.element=null}getMenuItem(e){const t=this.getElement();for(;e&&e!==t;){if(e.classList.contains("blocklyMenuItem")){for(let o=0,n;n=this.menuItems[o];o++)if(n.getElement()===e)return n}e=e.parentElement}return null}setHighlighted(e){var t=this.highlightedItem;if(t&&(t.setHighlighted(!1),this.highlightedItem=null),e){e.setHighlighted(!0),this.highlightedItem=e,t=this.getElement();const o=t==null?void 0:t.parentElement,n=e.getElement();o&&n&&(ma(n,o),xt(t,Et.ACTIVEDESCENDANT,e.getId()))}}highlightNext(){const e=this.highlightedItem?this.menuItems.indexOf(this.highlightedItem):-1;this.highlightHelper(e,1)}highlightPrevious(){const e=this.highlightedItem?this.menuItems.indexOf(this.highlightedItem):-1;this.highlightHelper(0>e?this.menuItems.length:e,-1)}highlightFirst(){this.highlightHelper(-1,1)}highlightLast(){this.highlightHelper(this.menuItems.length,-1)}highlightHelper(e,t){e+=t;let o;for(;o=this.menuItems[e];){if(o.isEnabled()){this.setHighlighted(o);break}e+=t}}handlePointerMove(e){Math.max(Math.abs(e.movementX),Math.abs(e.movementY))!==0&&(e=this.getMenuItem(e.target))&&(e.isEnabled()?this.highlightedItem!==e&&this.setHighlighted(e):this.setHighlighted(null))}handleClick(e){const t=this.openingCoords;if(this.openingCoords=null,t&&typeof e.clientX=="number"){const o=new ye(e.clientX,e.clientY);if(1>ye.distance(t,o))return}(e=this.getMenuItem(e.target))&&e.performAction()}handlePointerEnter(e){this.focus()}handlePointerLeave(e){this.getElement()&&this.setHighlighted(null)}handleKeyEvent(e){if(this.menuItems.length&&!(e.shiftKey||e.ctrlKey||e.metaKey||e.altKey)){var t=this.highlightedItem;switch(e.key){case"Enter":case" ":t&&t.performAction();break;case"ArrowUp":this.highlightPrevious();break;case"ArrowDown":this.highlightNext();break;case"PageUp":case"Home":this.highlightFirst();break;case"PageDown":case"End":this.highlightLast();break;default:return}e.preventDefault(),e.stopPropagation()}}getSize(){const e=this.getElement(),t=Hn(e);return t.height=e.scrollHeight,t}},Nh=class{constructor(e,t){this.content=e,this.opt_value=t,this.enabled=!0,this.element=null,this.rightToLeft=!1,this.roleName=null,this.highlight=this.checked=this.checkable=!1,this.actionHandler=null}createDom(){const e=document.createElement("div");e.id=v(),this.element=e,e.className="blocklyMenuItem goog-menuitem "+(this.enabled?"":"blocklyMenuItemDisabled goog-menuitem-disabled ")+(this.checked?"blocklyMenuItemSelected goog-option-selected ":"")+(this.highlight?"blocklyMenuItemHighlight goog-menuitem-highlight ":"")+(this.rightToLeft?"blocklyMenuItemRtl goog-menuitem-rtl ":"");const t=document.createElement("div");if(t.className="blocklyMenuItemContent goog-menuitem-content",this.checkable){var o=document.createElement("div");o.className="blocklyMenuItemCheckbox goog-menuitem-checkbox",t.appendChild(o)}return o=this.content,typeof this.content=="string"&&(o=document.createTextNode(this.content)),t.appendChild(o),e.appendChild(t),this.roleName&&Do(e,this.roleName),xt(e,Et.SELECTED,this.checkable&&this.checked||!1),xt(e,Et.DISABLED,!this.enabled),e}dispose(){this.element=null}getElement(){return this.element}getId(){return this.element.id}getValue(){let e;return(e=this.opt_value)!=null?e:null}setRightToLeft(e){this.rightToLeft=e}setRole(e){this.roleName=e}setCheckable(e){this.checkable=e}setChecked(e){this.checked=e}setHighlighted(e){this.highlight=e;const t=this.getElement();t&&this.isEnabled()&&(e?(Oe(t,"blocklyMenuItemHighlight"),Oe(t,"goog-menuitem-highlight")):(ze(t,"blocklyMenuItemHighlight"),ze(t,"goog-menuitem-highlight")))}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}performAction(){this.isEnabled()&&this.actionHandler&&this.actionHandler(this)}onAction(e,t){this.actionHandler=e.bind(t)}},$r="_TEMP_COLLAPSED_INPUT",gl="_TEMP_COLLAPSED_FIELD",Gt="MANUALLY_DISABLED",GC={COLLAPSED_FIELD_NAME:gl,COLLAPSED_INPUT_NAME:$r,MANUALLY_DISABLED:Gt};(function(e){e[e.VALUE=1]="VALUE",e[e.STATEMENT=3]="STATEMENT",e[e.DUMMY=5]="DUMMY",e[e.CUSTOM=6]="CUSTOM",e[e.END_ROW=7]="END_ROW"})(i.inputTypes$$module$build$src$core$inputs$input_types||(i.inputTypes$$module$build$src$core$inputs$input_types={})),i.inputTypes$$module$build$src$core$inputs$input_types;var ml=new Set,Mh=new WeakSet,Lh=new WeakMap,Qi=null,Ph=null,Jb=0,fl={};fl.finishQueuedRenders=Ts,fl.queueRender=_u,fl.triggerQueuedRenders=ao;var qb=function(e,t){window.alert(e),t&&t()},Xb=function(e,t){t(window.confirm(e))},Zb=function(e,t,o){o(window.prompt(e,t))},Qb={confirmInternal:cf},hi={TEST_ONLY:Qb};hi.alert=Jn,hi.confirm=Sa,hi.prompt=Ea,hi.setAlert=lf,hi.setConfirm=uf,hi.setPrompt=df;var Bh,ev;i.Msg$$module$build$src$core$msg=Object.create(null),Bh=function(e){Object.keys(e).forEach(function(t){i.Msg$$module$build$src$core$msg[t]=e[t]})},ev={Msg:i.Msg$$module$build$src$core$msg,setLocale:Bh};var br=class extends qi{constructor(e){super(),this.isBlank=typeof e>"u",e&&(this.varId=e.getId(),this.workspaceId=e.workspace.id)}toJson(){const e=super.toJson();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");return e.varId=this.varId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new br),t.varId=e.varId,t}},Fh=class extends br{constructor(e){super(e),this.type=ee.VAR_CREATE,e&&(this.varType=e.type,this.varName=e.name)}toJson(){const e=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");return e.varType=this.varType,e.varName=this.varName,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Fh),t.varType=e.varType,t.varName=e.varName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");e?t.createVariable(this.varName,this.varType,this.varId):t.deleteVariableById(this.varId)}};r($e.EVENT,ee.VAR_CREATE,Fh);var vr=class{constructor(e,t,o,n){this.workspace=e,this.name=t,this.type=o||"",this.id=n||_()}getId(){return this.id}static compareByName(e,t){return e.name.localeCompare(t.name,void 0,{sensitivity:"base"})}},jh="VARIABLE",zh="ijkmnopqrstuvwxyzabcdefgh",tv={generateUniqueNameInternal:pf},Rt={CATEGORY_NAME:jh,TEST_ONLY:tv,VAR_LETTER_OPTIONS:zh};Rt.allDeveloperVariables=i.allDeveloperVariables$$module$build$src$core$variables,Rt.allUsedVarModels=i.allUsedVarModels$$module$build$src$core$variables,Rt.createVariableButtonHandler=Fi,Rt.flyoutCategory=Ia,Rt.flyoutCategoryBlocks=Su,Rt.generateUniqueName=Eu,Rt.generateUniqueNameFromOptions=xa,Rt.generateVariableFieldDom=ei,Rt.getAddedVariables=qn,Rt.getOrCreateVariablePackage=i.getOrCreateVariablePackage$$module$build$src$core$variables,Rt.getVariable=i.getVariable$$module$build$src$core$variables,Rt.nameUsedWithAnyType=Iu,Rt.nameUsedWithConflictingParam=xu,Rt.promptName=Da,Rt.renameVariable=i.renameVariable$$module$build$src$core$variables;var en=class extends Error{},sv=class extends en{constructor(e){super("Expected to find a 'type' property, defining the block type"),this.state=e}},yr=class extends en{constructor(e,t,o){super(`The block ${t.toDevString()} is missing a(n) ${e} +`);var Wb=100,Gb=75,Vb=50,Kb=25,UC={BLOCKS:Vb,PROCEDURES:Gb,VARIABLES:Wb,WORKSPACE_COMMENTS:Kb},Dh={};Dh.register=Vn,Dh.unregister=tf;var Yb=class{constructor(){this.priority=Kb}save(e){const t=[];for(const o of e.getTopComments())(e=Pi(o,{addCoordinates:!0,saveIds:!0}))&&t.push(e);return t.length?t:null}load(e,t){for(const o of e)Kn(o,t,{recordUndo:G()})}clear(e){for(const t of e.getTopComments())t.dispose()}};Vn("workspaceComments",new Yb);var hl={};hl.WorkspaceCommentSerializer=Yb,hl.append=Kn,hl.save=Pi;var Ah={};Ah.register=Ca,Ah.unregister=sf;var pl=class{paste(e,t,o){e=e.commentState,o&&(e.x=o.x,e.y=o.y),i.disable$$module$build$src$core$events$utils();let n;try{n=Kn(e,t),of(n)}finally{i.enable$$module$build$src$core$events$utils()}return n?(C()&&z(new(ne(ee.COMMENT_CREATE))(n)),i.setSelected$$module$build$src$core$common(n),n):null}};pl.TYPE="workspace-comment",Ca(pl.TYPE,new pl);var Rh;Rh=28,i.config$$module$build$src$core$config={dragRadius:5,flyoutDragRadius:10,snapRadius:Rh,connectingSnapRadius:Rh,currentConnectionPreference:8,bumpDelay:250},i.config$$module$build$src$core$config;var HC="aria-",WC="role",Is;(function(e){e.GRID="grid",e.GRIDCELL="gridcell",e.GROUP="group",e.LISTBOX="listbox",e.MENU="menu",e.MENUITEM="menuitem",e.MENUITEMCHECKBOX="menuitemcheckbox",e.OPTION="option",e.PRESENTATION="presentation",e.ROW="row",e.TREE="tree",e.TREEITEM="treeitem"})(Is||(Is={}));var Et;(function(e){e.ACTIVEDESCENDANT="activedescendant",e.COLCOUNT="colcount",e.DISABLED="disabled",e.EXPANDED="expanded",e.INVALID="invalid",e.LABEL="label",e.LABELLEDBY="labelledby",e.LEVEL="level",e.ORIENTATION="orientation",e.POSINSET="posinset",e.ROWCOUNT="rowcount",e.SELECTED="selected",e.SETSIZE="setsize",e.VALUEMAX="valuemax",e.VALUEMIN="valuemin"})(Et||(Et={}));var fr={};fr.Role=Is,fr.State=Et,fr.setRole=Do,fr.setState=xt;var Oh=class{constructor(){this.menuItems=[],this.roleName=this.element=this.onKeyDownHandler=this.pointerLeaveHandler=this.pointerEnterHandler=this.clickHandler=this.pointerMoveHandler=this.highlightedItem=this.openingCoords=null}addChild(e){this.menuItems.push(e)}render(e){const t=document.createElement("div");t.className="blocklyMenu goog-menu blocklyNonSelectable",t.tabIndex=0,this.roleName&&Do(t,this.roleName),this.element=t;for(let o=0,n;n=this.menuItems[o];o++)t.appendChild(n.createDom());return this.pointerMoveHandler=H(t,"pointermove",this,this.handlePointerMove,!0),this.clickHandler=H(t,"pointerup",this,this.handleClick,!0),this.pointerEnterHandler=H(t,"pointerenter",this,this.handlePointerEnter,!0),this.pointerLeaveHandler=H(t,"pointerleave",this,this.handlePointerLeave,!0),this.onKeyDownHandler=H(t,"keydown",this,this.handleKeyEvent),e.appendChild(t),t}getElement(){return this.element}focus(){const e=this.getElement();e&&(e.focus({preventScroll:!0}),Re(e,"blocklyFocused"))}blur(){const e=this.getElement();e&&(e.blur(),ze(e,"blocklyFocused"))}setRole(e){this.roleName=e}dispose(){this.pointerMoveHandler&&(V(this.pointerMoveHandler),this.pointerMoveHandler=null),this.clickHandler&&(V(this.clickHandler),this.clickHandler=null),this.pointerEnterHandler&&(V(this.pointerEnterHandler),this.pointerEnterHandler=null),this.pointerLeaveHandler&&(V(this.pointerLeaveHandler),this.pointerLeaveHandler=null),this.onKeyDownHandler&&(V(this.onKeyDownHandler),this.onKeyDownHandler=null);for(let e=0,t;t=this.menuItems[e];e++)t.dispose();this.element=null}getMenuItem(e){const t=this.getElement();for(;e&&e!==t;){if(e.classList.contains("blocklyMenuItem")){for(let o=0,n;n=this.menuItems[o];o++)if(n.getElement()===e)return n}e=e.parentElement}return null}setHighlighted(e){var t=this.highlightedItem;if(t&&(t.setHighlighted(!1),this.highlightedItem=null),e){e.setHighlighted(!0),this.highlightedItem=e,t=this.getElement();const o=t==null?void 0:t.parentElement,n=e.getElement();o&&n&&(ma(n,o),xt(t,Et.ACTIVEDESCENDANT,e.getId()))}}highlightNext(){const e=this.highlightedItem?this.menuItems.indexOf(this.highlightedItem):-1;this.highlightHelper(e,1)}highlightPrevious(){const e=this.highlightedItem?this.menuItems.indexOf(this.highlightedItem):-1;this.highlightHelper(0>e?this.menuItems.length:e,-1)}highlightFirst(){this.highlightHelper(-1,1)}highlightLast(){this.highlightHelper(this.menuItems.length,-1)}highlightHelper(e,t){e+=t;let o;for(;o=this.menuItems[e];){if(o.isEnabled()){this.setHighlighted(o);break}e+=t}}handlePointerMove(e){Math.max(Math.abs(e.movementX),Math.abs(e.movementY))!==0&&(e=this.getMenuItem(e.target))&&(e.isEnabled()?this.highlightedItem!==e&&this.setHighlighted(e):this.setHighlighted(null))}handleClick(e){const t=this.openingCoords;if(this.openingCoords=null,t&&typeof e.clientX=="number"){const o=new ye(e.clientX,e.clientY);if(1>ye.distance(t,o))return}(e=this.getMenuItem(e.target))&&e.performAction()}handlePointerEnter(e){this.focus()}handlePointerLeave(e){this.getElement()&&this.setHighlighted(null)}handleKeyEvent(e){if(this.menuItems.length&&!(e.shiftKey||e.ctrlKey||e.metaKey||e.altKey)){var t=this.highlightedItem;switch(e.key){case"Enter":case" ":t&&t.performAction();break;case"ArrowUp":this.highlightPrevious();break;case"ArrowDown":this.highlightNext();break;case"PageUp":case"Home":this.highlightFirst();break;case"PageDown":case"End":this.highlightLast();break;default:return}e.preventDefault(),e.stopPropagation()}}getSize(){const e=this.getElement(),t=Hn(e);return t.height=e.scrollHeight,t}},Nh=class{constructor(e,t){this.content=e,this.opt_value=t,this.enabled=!0,this.element=null,this.rightToLeft=!1,this.roleName=null,this.highlight=this.checked=this.checkable=!1,this.actionHandler=null}createDom(){const e=document.createElement("div");e.id=v(),this.element=e,e.className="blocklyMenuItem goog-menuitem "+(this.enabled?"":"blocklyMenuItemDisabled goog-menuitem-disabled ")+(this.checked?"blocklyMenuItemSelected goog-option-selected ":"")+(this.highlight?"blocklyMenuItemHighlight goog-menuitem-highlight ":"")+(this.rightToLeft?"blocklyMenuItemRtl goog-menuitem-rtl ":"");const t=document.createElement("div");if(t.className="blocklyMenuItemContent goog-menuitem-content",this.checkable){var o=document.createElement("div");o.className="blocklyMenuItemCheckbox goog-menuitem-checkbox",t.appendChild(o)}return o=this.content,typeof this.content=="string"&&(o=document.createTextNode(this.content)),t.appendChild(o),e.appendChild(t),this.roleName&&Do(e,this.roleName),xt(e,Et.SELECTED,this.checkable&&this.checked||!1),xt(e,Et.DISABLED,!this.enabled),e}dispose(){this.element=null}getElement(){return this.element}getId(){return this.element.id}getValue(){let e;return(e=this.opt_value)!=null?e:null}setRightToLeft(e){this.rightToLeft=e}setRole(e){this.roleName=e}setCheckable(e){this.checkable=e}setChecked(e){this.checked=e}setHighlighted(e){this.highlight=e;const t=this.getElement();t&&this.isEnabled()&&(e?(Re(t,"blocklyMenuItemHighlight"),Re(t,"goog-menuitem-highlight")):(ze(t,"blocklyMenuItemHighlight"),ze(t,"goog-menuitem-highlight")))}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}performAction(){this.isEnabled()&&this.actionHandler&&this.actionHandler(this)}onAction(e,t){this.actionHandler=e.bind(t)}},$r="_TEMP_COLLAPSED_INPUT",gl="_TEMP_COLLAPSED_FIELD",Vt="MANUALLY_DISABLED",GC={COLLAPSED_FIELD_NAME:gl,COLLAPSED_INPUT_NAME:$r,MANUALLY_DISABLED:Vt};(function(e){e[e.VALUE=1]="VALUE",e[e.STATEMENT=3]="STATEMENT",e[e.DUMMY=5]="DUMMY",e[e.CUSTOM=6]="CUSTOM",e[e.END_ROW=7]="END_ROW"})(i.inputTypes$$module$build$src$core$inputs$input_types||(i.inputTypes$$module$build$src$core$inputs$input_types={})),i.inputTypes$$module$build$src$core$inputs$input_types;var ml=new Set,Mh=new WeakSet,Lh=new WeakMap,Qi=null,Ph=null,Jb=0,fl={};fl.finishQueuedRenders=Ts,fl.queueRender=_u,fl.triggerQueuedRenders=ao;var qb=function(e,t){window.alert(e),t&&t()},Xb=function(e,t){t(window.confirm(e))},Zb=function(e,t,o){o(window.prompt(e,t))},Qb={confirmInternal:cf},hi={TEST_ONLY:Qb};hi.alert=Jn,hi.confirm=Sa,hi.prompt=Ea,hi.setAlert=lf,hi.setConfirm=uf,hi.setPrompt=df;var Bh,ev;i.Msg$$module$build$src$core$msg=Object.create(null),Bh=function(e){Object.keys(e).forEach(function(t){i.Msg$$module$build$src$core$msg[t]=e[t]})},ev={Msg:i.Msg$$module$build$src$core$msg,setLocale:Bh};var br=class extends qi{constructor(e){super(),this.isBlank=typeof e>"u",e&&(this.varId=e.getId(),this.workspaceId=e.workspace.id)}toJson(){const e=super.toJson();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");return e.varId=this.varId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new br),t.varId=e.varId,t}},jh=class extends br{constructor(e){super(e),this.type=ee.VAR_CREATE,e&&(this.varType=e.type,this.varName=e.name)}toJson(){const e=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");return e.varType=this.varType,e.varName=this.varName,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new jh),t.varType=e.varType,t.varName=e.varName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");e?t.createVariable(this.varName,this.varType,this.varId):t.deleteVariableById(this.varId)}};r($e.EVENT,ee.VAR_CREATE,jh);var vr=class{constructor(e,t,o,n){this.workspace=e,this.name=t,this.type=o||"",this.id=n||_()}getId(){return this.id}static compareByName(e,t){return e.name.localeCompare(t.name,void 0,{sensitivity:"base"})}},Fh="VARIABLE",zh="ijkmnopqrstuvwxyzabcdefgh",tv={generateUniqueNameInternal:pf},Ot={CATEGORY_NAME:Fh,TEST_ONLY:tv,VAR_LETTER_OPTIONS:zh};Ot.allDeveloperVariables=i.allDeveloperVariables$$module$build$src$core$variables,Ot.allUsedVarModels=i.allUsedVarModels$$module$build$src$core$variables,Ot.createVariableButtonHandler=ji,Ot.flyoutCategory=Ia,Ot.flyoutCategoryBlocks=Su,Ot.generateUniqueName=Eu,Ot.generateUniqueNameFromOptions=xa,Ot.generateVariableFieldDom=ei,Ot.getAddedVariables=qn,Ot.getOrCreateVariablePackage=i.getOrCreateVariablePackage$$module$build$src$core$variables,Ot.getVariable=i.getVariable$$module$build$src$core$variables,Ot.nameUsedWithAnyType=Iu,Ot.nameUsedWithConflictingParam=xu,Ot.promptName=Da,Ot.renameVariable=i.renameVariable$$module$build$src$core$variables;var en=class extends Error{},sv=class extends en{constructor(e){super("Expected to find a 'type' property, defining the block type"),this.state=e}},yr=class extends en{constructor(e,t,o){super(`The block ${t.toDevString()} is missing a(n) ${e} connection`),this.block=t,this.state=o}},ov=class extends en{constructor(e,t,o,n){super(`The block ${o.toDevString()} could not connect its ${t} to its parent, because: ${e}`),this.childBlock=o,this.childState=n}},iv=class extends en{constructor(e){super(`Encountered a real block which is defined as a child of a shadow block. It is an invariant of Blockly that shadow blocks only have shadow -children`),this.state=e}},nv=class extends en{constructor(e,t,o){super(`Cannot add an icon of type '${e}' to the block ${t.toDevString()}, because there is no icon registered with type '${e}'. Make sure that all of your icons have been registered.`),this.block=t,this.state=o}},pi={};pi.BadConnectionCheck=ov,pi.DeserializationError=en,pi.MissingBlockType=sv,pi.MissingConnection=yr,pi.RealChildOfShadow=iv,pi.UnregisteredIcon=nv;var rv=class{constructor(){this.priority=Vb}save(e){const t=[];for(const o of e.getTopBlocks(!1))(e=os(o,{addCoordinates:!0,doFullSerialization:!1}))&&t.push(e);return t.length?{languageVersion:0,blocks:t}:null}load(e,t){e=e.blocks;for(const o of e)lo(o,t,{recordUndo:G()})}clear(e){for(const t of e.getTopBlocks(!1))t.dispose(!1)}};Vn("blocks",new rv);var _r={};_r.BlockSerializer=rv,_r.append=lo,_r.appendInternal=ji,_r.save=os;var Ct=class{constructor(e){this.name=e}toString(){return this.name}equals(e){return this.name===e.toString()}};Ct.MUTATOR=new Ct("mutator"),Ct.WARNING=new Ct("warning"),Ct.COMMENT=new Ct("comment");var gi=class extends qi{constructor(e){super(),this.isBlank=!e,e&&(this.blockId=e.id,this.workspaceId=e.workspace.id)}toJson(){const e=super.toJson();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");return e.blockId=this.blockId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new gi),t.blockId=e.blockId,t}},mi=class extends gi{constructor(e,t,o,n,u){super(e),this.type=ee.BLOCK_CHANGE,e&&(this.element=t,this.name=o||void 0,this.oldValue=n,this.newValue=u)}toJson(){const e=super.toJson();if(!this.element)throw Error("The changed element is undefined. Either pass an element to the constructor, or call fromJson");return e.element=this.element,e.name=this.name,e.oldValue=this.oldValue,e.newValue=this.newValue,this.disabledReason&&(e.disabledReason=this.disabledReason),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new mi),t.element=e.element,t.name=e.name,t.oldValue=e.oldValue,t.newValue=e.newValue,e.disabledReason!==void 0&&(t.disabledReason=e.disabledReason),t}setDisabledReason(e){if(this.element!=="disabled")throw Error('Cannot set the disabled reason for a BlockChange event if the element is not "disabled".');this.disabledReason=e}isNull(){return this.oldValue===this.newValue}run(e){var t=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");if(t=t.getBlockById(this.blockId),!t)throw Error("The associated block is undefined. Either pass a block to the constructor, or call fromJson");const o=t.getIcon(Ct.MUTATOR);switch(o&&zi(o)&&o.bubbleIsVisible()&&o.setBubbleVisible(!1),e=e?this.newValue:this.oldValue,this.element){case"field":(t=t.getField(this.name))?t.setValue(e):console.warn("Can't set non-existent field: "+this.name);break;case"comment":t.setCommentText(e||null);break;case"collapsed":t.setCollapsed(!!e);break;case"disabled":var n;t.setDisabledReason(!!e,(n=this.disabledReason)!=null?n:Gt);break;case"inline":t.setInputsInline(!!e);break;case"mutation":n=mi.getExtraBlockState_(t),t.loadExtraState?t.loadExtraState(JSON.parse(e||"{}")):t.domToMutation&&t.domToMutation(i.textToDom$$module$build$src$core$utils$xml(e||"")),z(new mi(t,"mutation",null,n,e));break;default:console.warn("Unknown change type: "+this.element)}}static getExtraBlockState_(e){return e.saveExtraState?(e=e.saveExtraState(!0))?JSON.stringify(e):"":e.mutationToDom&&(e=e.mutationToDom())?zs(e):""}};r($e.EVENT,ee.BLOCK_CHANGE,mi);var $l={};$l.clamp=Ui,$l.toDegrees=Mf,$l.toRadians=Aa;var bl=16,av=1,lv=12,Uh=16,vl=.25,Hh=null,fi=null,tn="",sn="",tt,on,$i,Wh=null,Bo=null,cv=null,Gh={getBoundsInfo:function(){const e=xo(Wh),t=Hn(Wh);return{left:e.x,right:e.x+t.width,top:e.y,bottom:e.y+t.height,width:t.width,height:t.height}},getPositionMetrics:function(e,t,o,n){const u=Gh.getBoundsInfo(),g=Hn(tt);return t+g.heightu.top?Hu(o,n,u,g):t+g.heightdocument.documentElement.clientTop?Hu(o,n,u,g):Pf(e,u,g)}},Bt={ANIMATION_TIME:vl,ARROW_HORIZONTAL_PADDING:lv,ARROW_SIZE:bl,BORDER_SIZE:av,PADDING_Y:Uh,TEST_ONLY:Gh};Bt.clearContent=Oa,Bt.createDom=Ru,Bt.getContentDiv=Xn,Bt.getOwner=Mu,Bt.getPositionX=Zn,Bt.hide=Na,Bt.hideIfOwner=Ra,Bt.hideWithoutAnimation=js,Bt.isVisible=Wu,Bt.repositionForWindowResize=Vu,Bt.setBoundsElement=Nu,Bt.setColour=Lu,Bt.show=zu,Bt.showPositionedByBlock=Lf,Bt.showPositionedByField=Pu;var wr=class{constructor(e){this.workspace=e,this.cursorSvg=this.cursor=null,this.markers=new Map,this.markerSvg=null}registerMarker(e,t){this.markers.has(e)&&this.unregisterMarker(e),t.setDrawer(this.workspace.getRenderer().makeMarkerDrawer(this.workspace,t)),this.setMarkerSvg(t.getDrawer().createDom()),this.markers.set(e,t)}unregisterMarker(e){const t=this.markers.get(e);if(t)t.dispose(),this.markers.delete(e);else throw Error("Marker with ID "+e+" does not exist. Can only unregister markers that exist.")}getCursor(){return this.cursor}getMarker(e){return this.markers.get(e)||null}setCursor(e){this.cursor&&this.cursor.getDrawer()&&this.cursor.getDrawer().dispose(),(this.cursor=e)&&(e=this.workspace.getRenderer().makeMarkerDrawer(this.workspace,this.cursor),this.cursor.setDrawer(e),this.setCursorSvg(this.cursor.getDrawer().createDom()))}setCursorSvg(e){e?(this.workspace.getBlockCanvas().appendChild(e),this.cursorSvg=e):this.cursorSvg=null}setMarkerSvg(e){e?this.workspace.getBlockCanvas()&&(this.cursorSvg?this.workspace.getBlockCanvas().insertBefore(e,this.cursorSvg):this.workspace.getBlockCanvas().appendChild(e)):this.markerSvg=null}updateMarkers(){this.workspace.keyboardAccessibilityMode&&this.cursorSvg&&this.workspace.getCursor().draw()}dispose(){const e=Object.keys(this.markers);for(let t=0,o;o=e[t];t++)this.unregisterMarker(o);this.markers.clear(),this.cursor&&(this.cursor.dispose(),this.cursor=null)}};wr.LOCAL_MARKER="local_marker_1";var nn={};nn.commonWordPrefix=Ku,nn.commonWordSuffix=Yu,nn.isNumber=i.isNumber$$module$build$src$core$utils$string,nn.shortestStringLength=Qn,nn.wrap=i.wrap$$module$build$src$core$utils$string;var yl=void 0,kr=!1,rn=!1,uv=50,dv=0,bi=0,Vh=0,Kh=0,hs=null,Cr=null,Yh=0,Jh=10,hv=10,pv=750,_l=5,Tt=null,ns={HOVER_MS:pv,LIMIT:uv,MARGINS:_l,OFFSET_X:Yh,OFFSET_Y:Jh,RADIUS_OK:hv};ns.bindMouseEvents=Wi,ns.block=ed,ns.createDom=Xu,ns.dispose=Qu,ns.getCustomTooltip=zf,ns.getDiv=Hf,ns.getTooltipOfObject=Hi,ns.hide=co,ns.isVisible=Uf,ns.setCustomTooltip=jf,ns.unbindMouseEvents=La,ns.unblock=td;var qh=.45,Xh=.65,gv={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00"},ps={};ps.blend=si,ps.getHsvSaturation=sd,ps.getHsvValue=od,ps.hexToRgb=Pa,ps.hsvToHex=Ba,ps.hueToHex=id,ps.names=gv,ps.parse=ti,ps.rgbToHex=er,ps.setHsvSaturation=qf,ps.setHsvValue=Xf;var Tr={};Tr.checkMessageReferences=Zf,Tr.parseBlockColour=Gi,Tr.replaceMessageReferences=bt,Tr.tokenizeInterpolation=nd;var lt=class{constructor(e,t,o){this.DEFAULT_VALUE=null,this.name=void 0,this.constants_=this.mouseDownWrapper=this.textContent_=this.textElement_=this.borderRect_=this.fieldGroup_=this.markerSvg=this.cursorSvg=this.tooltip=this.validator_=null,this.disposed=!1,this.maxDisplayLength=50,this.sourceBlock_=null,this.enabled_=this.visible_=this.isDirty_=!0,this.suffixField=this.prefixField=this.clickTarget_=null,this.EDITABLE=!0,this.SERIALIZABLE=!1,this.CURSOR="",this.value_="DEFAULT_VALUE"in new.target.prototype?new.target.prototype.DEFAULT_VALUE:this.DEFAULT_VALUE,this.size_=new Xe(0,0),e!==lt.SKIP_SETUP&&(o&&this.configure_(o),this.setValue(e),t&&this.setValidator(t))}configure_(e){e.tooltip&&this.setTooltip(bt(e.tooltip))}setSourceBlock(e){if(this.sourceBlock_)throw Error("Field already bound to a block");this.sourceBlock_=e}getConstants(){return!this.constants_&&this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&this.sourceBlock_.workspace.rendered&&(this.constants_=this.sourceBlock_.workspace.getRenderer().getConstants()),this.constants_}getSourceBlock(){return this.sourceBlock_}init(){this.fieldGroup_||(this.fieldGroup_=ie(J.G,{}),this.isVisible()||(this.fieldGroup_.style.display="none"),this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_),this.initView(),this.updateEditable(),this.setTooltip(this.tooltip),this.bindEvents_(),this.initModel(),this.applyColour())}initView(){this.createBorderRect_(),this.createTextElement_()}initModel(){}isFullBlockField(){return!this.borderRect_}createBorderRect_(){this.borderRect_=ie(J.RECT,{rx:this.getConstants().FIELD_BORDER_RECT_RADIUS,ry:this.getConstants().FIELD_BORDER_RECT_RADIUS,x:0,y:0,height:this.size_.height,width:this.size_.width,class:"blocklyFieldRect"},this.fieldGroup_)}createTextElement_(){this.textElement_=ie(J.TEXT,{class:"blocklyText"},this.fieldGroup_),this.getConstants().FIELD_TEXT_BASELINE_CENTER&&this.textElement_.setAttribute("dominant-baseline","central"),this.textContent_=document.createTextNode(""),this.textElement_.appendChild(this.textContent_)}bindEvents_(){const e=this.getClickTarget_();if(!e)throw Error("A click target has not been set.");Wi(e),this.mouseDownWrapper=H(e,"pointerdown",this,this.onMouseDown_)}fromXml(e){this.setValue(e.textContent)}toXml(e){return e.textContent=this.getValue(),e}saveState(e){return e=this.saveLegacyState(lt),e!==null?e:this.getValue()}loadState(e){this.loadLegacyState(lt,e)||this.setValue(e)}saveLegacyState(e){return e.prototype.saveState===this.saveState&&e.prototype.toXml!==this.toXml?(e=i.createElement$$module$build$src$core$utils$xml("field"),e.setAttribute("name",this.name||""),Li(this.toXml(e)).replace(' xmlns="https://developers.google.com/blockly/xml"',"")):null}loadLegacyState(e,t){return e.prototype.loadState===this.loadState&&e.prototype.fromXml!==this.fromXml?(this.fromXml(i.textToDom$$module$build$src$core$utils$xml(t)),!0):!1}dispose(){Ra(this),ii(this);let e;(e=this.getSourceBlock())!=null&&e.isDeadOrDying()||Ze(this.fieldGroup_),this.disposed=!0}updateEditable(){const e=this.fieldGroup_,t=this.getSourceBlock();this.EDITABLE&&e&&t&&(this.enabled_&&t.isEditable()?(Oe(e,"blocklyEditableText"),ze(e,"blocklyNonEditableText"),e.style.cursor=this.CURSOR):(Oe(e,"blocklyNonEditableText"),ze(e,"blocklyEditableText"),e.style.cursor=""))}setEnabled(e){this.enabled_=e,this.updateEditable()}isEnabled(){return this.enabled_}isClickable(){return this.enabled_&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()&&this.showEditor_!==lt.prototype.showEditor_}isClickableInFlyout(e){return!e}isCurrentlyEditable(){return this.enabled_&&this.EDITABLE&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()}isSerializable(){let e=!1;return this.name&&(this.SERIALIZABLE?e=!0:this.EDITABLE&&(console.warn("Detected an editable field that was not serializable. Please define SERIALIZABLE property as true on all editable custom fields. Proceeding with serialization."),e=!0)),e}isVisible(){return this.visible_}setVisible(e){if(this.visible_!==e){this.visible_=e;var t=this.fieldGroup_;t&&(t.style.display=e?"block":"none")}}setValidator(e){this.validator_=e}getValidator(){return this.validator_}getSvgRoot(){return this.fieldGroup_}getBorderRect(){if(!this.borderRect_)throw Error(`The border rectangle is ${this.borderRect_}.`);return this.borderRect_}getTextElement(){if(!this.textElement_)throw Error(`The text element is ${this.textElement_}.`);return this.textElement_}getTextContent(){if(!this.textContent_)throw Error(`The text content is ${this.textContent_}.`);return this.textContent_}applyColour(){}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_()}showEditor(e){this.isClickable()&&this.showEditor_(e)}showEditor_(e){}repositionForWindowResize(){return!1}updateSize_(e){const t=this.getConstants();e=e!==void 0?e:this.isFullBlockField()?0:this.getConstants().FIELD_BORDER_RECT_X_PADDING;let o=2*e,n=t.FIELD_TEXT_HEIGHT,u=0;this.textElement_&&(u=Io(this.textElement_,t.FIELD_TEXT_FONTSIZE,t.FIELD_TEXT_FONTWEIGHT,t.FIELD_TEXT_FONTFAMILY),o+=u),this.isFullBlockField()||(n=Math.max(n,t.FIELD_BORDER_RECT_HEIGHT)),this.size_.height=n,this.size_.width=o,this.positionTextElement_(e,u),this.positionBorderRect_()}positionTextElement_(e,t){if(this.textElement_){var o=this.getConstants(),n=this.size_.height/2,u;this.textElement_.setAttribute("x",String((u=this.getSourceBlock())!=null&&u.RTL?this.size_.width-t-e:e)),this.textElement_.setAttribute("y",String(o.FIELD_TEXT_BASELINE_CENTER?n:n-o.FIELD_TEXT_HEIGHT/2+o.FIELD_TEXT_BASELINE))}}positionBorderRect_(){this.borderRect_&&(this.borderRect_.setAttribute("width",String(this.size_.width)),this.borderRect_.setAttribute("height",String(this.size_.height)),this.borderRect_.setAttribute("rx",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)),this.borderRect_.setAttribute("ry",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)))}getSize(){return this.isVisible()?(this.isDirty_?(this.render_(),this.isDirty_=!1):this.visible_&&this.size_.width===0&&(this.render_(),this.size_.width!==0&&console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead.")),this.size_):new Xe(0,0)}getScaledBBox(){let e;var t=this.getSourceBlock();if(!t)throw new _t;if(this.isFullBlockField()){var o=this.sourceBlock_.getHeightWidth();const n=t.workspace.scale;e=this.getAbsoluteXY_(),t=(o.width+1)*n,o=(o.height+1)*n,Ab?(e.x+=1.5*n,e.y+=1.5*n):(e.x-=.5*n,e.y-=.5*n)}else o=this.borderRect_.getBoundingClientRect(),e=xo(this.borderRect_),t=o.width,o=o.height;return new rt(e.y,e.y+o,e.x,e.x+t)}onLocationChange(e){}getDisplayText_(){let e=this.getText();return e?(e.length>this.maxDisplayLength&&(e=e.substring(0,this.maxDisplayLength-2)+"…"),e=e.replace(/\s/g,lt.NBSP),this.sourceBlock_&&this.sourceBlock_.RTL&&(e+="‏"),e):lt.NBSP}getText(){const e=this.getText_();return String(e!==null?e:this.getValue())}getText_(){return null}markDirty(){this.isDirty_=!0,this.constants_=null}forceRerender(){this.isDirty_=!0,this.sourceBlock_&&this.sourceBlock_.rendered&&this.sourceBlock_.queueRender()}setValue(e,t=!0){if(e!==null){var o=i.getGroup$$module$build$src$core$events$utils();o||i.setGroup$$module$build$src$core$events$utils(!0);try{const le=this.doClassValidation_(e),Ee=this.processValidation(e,le,t);if(!(Ee instanceof Error)){var n,u=(n=this.getValidator())==null?void 0:n.call(this,Ee),g=this.processValidation(Ee,u,t);if(!(g instanceof Error)){var I=this.sourceBlock_;if(!I||!I.disposed){var L=this.getValue();L===g?this.doValueUpdate_(g):(this.doValueUpdate_(g),t&&I&&C()&&z(new(ne(ee.BLOCK_CHANGE))(I,"field",this.name||null,L,g)),this.isDirty_&&this.forceRerender())}}}}finally{i.setGroup$$module$build$src$core$events$utils(o)}}}processValidation(e,t,o){return t===null?(this.doValueInvalid_(e,o),this.isDirty_&&this.forceRerender(),Error()):t===void 0?e:t}getValue(){return this.value_}doClassValidation_(e){return e??null}doValueUpdate_(e){this.value_=e,this.isDirty_=!0}doValueInvalid_(e,t){}onMouseDown_(e){this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&(e=this.sourceBlock_.workspace.getGesture(e))&&e.setStartField(this)}setTooltip(e){e||e===""||(e=this.sourceBlock_);const t=this.getClickTarget_();t?t.tooltip=e:this.tooltip=e}getTooltip(){const e=this.getClickTarget_();return Hi(e||{tooltip:this.tooltip})}getClickTarget_(){return this.clickTarget_||this.getSvgRoot()}getAbsoluteXY_(){return xo(this.getClickTarget_())}referencesVariables(){return!1}refreshVariableName(){}getParentInput(){let e=null;const t=this.getSourceBlock();if(!t)throw new _t;const o=t.inputList;for(let n=0;n")),z(new mi(t,"mutation",null,n,e));break;default:console.warn("Unknown change type: "+this.element)}}static getExtraBlockState_(e){return e.saveExtraState?(e=e.saveExtraState(!0))?JSON.stringify(e):"":e.mutationToDom&&(e=e.mutationToDom())?zs(e):""}};r($e.EVENT,ee.BLOCK_CHANGE,mi);var $l={};$l.clamp=Ui,$l.toDegrees=Mf,$l.toRadians=Aa;var bl=16,av=1,lv=12,Uh=16,vl=.25,Hh=null,fi=null,tn="",sn="",tt,on,$i,Wh=null,Bo=null,cv=null,Gh={getBoundsInfo:function(){const e=xo(Wh),t=Hn(Wh);return{left:e.x,right:e.x+t.width,top:e.y,bottom:e.y+t.height,width:t.width,height:t.height}},getPositionMetrics:function(e,t,o,n){const u=Gh.getBoundsInfo(),g=Hn(tt);return t+g.heightu.top?Hu(o,n,u,g):t+g.heightdocument.documentElement.clientTop?Hu(o,n,u,g):Pf(e,u,g)}},Ft={ANIMATION_TIME:vl,ARROW_HORIZONTAL_PADDING:lv,ARROW_SIZE:bl,BORDER_SIZE:av,PADDING_Y:Uh,TEST_ONLY:Gh};Ft.clearContent=Ra,Ft.createDom=Ou,Ft.getContentDiv=Xn,Ft.getOwner=Mu,Ft.getPositionX=Zn,Ft.hide=Na,Ft.hideIfOwner=Oa,Ft.hideWithoutAnimation=Fs,Ft.isVisible=Wu,Ft.repositionForWindowResize=Vu,Ft.setBoundsElement=Nu,Ft.setColour=Lu,Ft.show=zu,Ft.showPositionedByBlock=Lf,Ft.showPositionedByField=Pu;var wr=class{constructor(e){this.workspace=e,this.cursorSvg=this.cursor=null,this.markers=new Map,this.markerSvg=null}registerMarker(e,t){this.markers.has(e)&&this.unregisterMarker(e),t.setDrawer(this.workspace.getRenderer().makeMarkerDrawer(this.workspace,t)),this.setMarkerSvg(t.getDrawer().createDom()),this.markers.set(e,t)}unregisterMarker(e){const t=this.markers.get(e);if(t)t.dispose(),this.markers.delete(e);else throw Error("Marker with ID "+e+" does not exist. Can only unregister markers that exist.")}getCursor(){return this.cursor}getMarker(e){return this.markers.get(e)||null}setCursor(e){this.cursor&&this.cursor.getDrawer()&&this.cursor.getDrawer().dispose(),(this.cursor=e)&&(e=this.workspace.getRenderer().makeMarkerDrawer(this.workspace,this.cursor),this.cursor.setDrawer(e),this.setCursorSvg(this.cursor.getDrawer().createDom()))}setCursorSvg(e){e?(this.workspace.getBlockCanvas().appendChild(e),this.cursorSvg=e):this.cursorSvg=null}setMarkerSvg(e){e?this.workspace.getBlockCanvas()&&(this.cursorSvg?this.workspace.getBlockCanvas().insertBefore(e,this.cursorSvg):this.workspace.getBlockCanvas().appendChild(e)):this.markerSvg=null}updateMarkers(){this.workspace.keyboardAccessibilityMode&&this.cursorSvg&&this.workspace.getCursor().draw()}dispose(){const e=Object.keys(this.markers);for(let t=0,o;o=e[t];t++)this.unregisterMarker(o);this.markers.clear(),this.cursor&&(this.cursor.dispose(),this.cursor=null)}};wr.LOCAL_MARKER="local_marker_1";var nn={};nn.commonWordPrefix=Ku,nn.commonWordSuffix=Yu,nn.isNumber=i.isNumber$$module$build$src$core$utils$string,nn.shortestStringLength=Qn,nn.wrap=i.wrap$$module$build$src$core$utils$string;var yl=void 0,kr=!1,rn=!1,uv=50,dv=0,bi=0,Vh=0,Kh=0,hs=null,Cr=null,Yh=0,Jh=10,hv=10,pv=750,_l=5,Tt=null,ns={HOVER_MS:pv,LIMIT:uv,MARGINS:_l,OFFSET_X:Yh,OFFSET_Y:Jh,RADIUS_OK:hv};ns.bindMouseEvents=Wi,ns.block=ed,ns.createDom=Xu,ns.dispose=Qu,ns.getCustomTooltip=zf,ns.getDiv=Hf,ns.getTooltipOfObject=Hi,ns.hide=co,ns.isVisible=Uf,ns.setCustomTooltip=Ff,ns.unbindMouseEvents=La,ns.unblock=td;var qh=.45,Xh=.65,gv={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00"},ps={};ps.blend=si,ps.getHsvSaturation=sd,ps.getHsvValue=od,ps.hexToRgb=Pa,ps.hsvToHex=Ba,ps.hueToHex=id,ps.names=gv,ps.parse=ti,ps.rgbToHex=er,ps.setHsvSaturation=qf,ps.setHsvValue=Xf;var Tr={};Tr.checkMessageReferences=Zf,Tr.parseBlockColour=Gi,Tr.replaceMessageReferences=bt,Tr.tokenizeInterpolation=nd;var lt=class{constructor(e,t,o){this.DEFAULT_VALUE=null,this.name=void 0,this.constants_=this.mouseDownWrapper=this.textContent_=this.textElement_=this.borderRect_=this.fieldGroup_=this.markerSvg=this.cursorSvg=this.tooltip=this.validator_=null,this.disposed=!1,this.maxDisplayLength=50,this.sourceBlock_=null,this.enabled_=this.visible_=this.isDirty_=!0,this.suffixField=this.prefixField=this.clickTarget_=null,this.EDITABLE=!0,this.SERIALIZABLE=!1,this.CURSOR="",this.value_="DEFAULT_VALUE"in new.target.prototype?new.target.prototype.DEFAULT_VALUE:this.DEFAULT_VALUE,this.size_=new Xe(0,0),e!==lt.SKIP_SETUP&&(o&&this.configure_(o),this.setValue(e),t&&this.setValidator(t))}configure_(e){e.tooltip&&this.setTooltip(bt(e.tooltip))}setSourceBlock(e){if(this.sourceBlock_)throw Error("Field already bound to a block");this.sourceBlock_=e}getConstants(){return!this.constants_&&this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&this.sourceBlock_.workspace.rendered&&(this.constants_=this.sourceBlock_.workspace.getRenderer().getConstants()),this.constants_}getSourceBlock(){return this.sourceBlock_}init(){this.fieldGroup_||(this.fieldGroup_=ie(J.G,{}),this.isVisible()||(this.fieldGroup_.style.display="none"),this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_),this.initView(),this.updateEditable(),this.setTooltip(this.tooltip),this.bindEvents_(),this.initModel(),this.applyColour())}initView(){this.createBorderRect_(),this.createTextElement_()}initModel(){}isFullBlockField(){return!this.borderRect_}createBorderRect_(){this.borderRect_=ie(J.RECT,{rx:this.getConstants().FIELD_BORDER_RECT_RADIUS,ry:this.getConstants().FIELD_BORDER_RECT_RADIUS,x:0,y:0,height:this.size_.height,width:this.size_.width,class:"blocklyFieldRect"},this.fieldGroup_)}createTextElement_(){this.textElement_=ie(J.TEXT,{class:"blocklyText"},this.fieldGroup_),this.getConstants().FIELD_TEXT_BASELINE_CENTER&&this.textElement_.setAttribute("dominant-baseline","central"),this.textContent_=document.createTextNode(""),this.textElement_.appendChild(this.textContent_)}bindEvents_(){const e=this.getClickTarget_();if(!e)throw Error("A click target has not been set.");Wi(e),this.mouseDownWrapper=H(e,"pointerdown",this,this.onMouseDown_)}fromXml(e){this.setValue(e.textContent)}toXml(e){return e.textContent=this.getValue(),e}saveState(e){return e=this.saveLegacyState(lt),e!==null?e:this.getValue()}loadState(e){this.loadLegacyState(lt,e)||this.setValue(e)}saveLegacyState(e){return e.prototype.saveState===this.saveState&&e.prototype.toXml!==this.toXml?(e=i.createElement$$module$build$src$core$utils$xml("field"),e.setAttribute("name",this.name||""),Li(this.toXml(e)).replace(' xmlns="https://developers.google.com/blockly/xml"',"")):null}loadLegacyState(e,t){return e.prototype.loadState===this.loadState&&e.prototype.fromXml!==this.fromXml?(this.fromXml(i.textToDom$$module$build$src$core$utils$xml(t)),!0):!1}dispose(){Oa(this),ii(this);let e;(e=this.getSourceBlock())!=null&&e.isDeadOrDying()||Ze(this.fieldGroup_),this.disposed=!0}updateEditable(){const e=this.fieldGroup_,t=this.getSourceBlock();this.EDITABLE&&e&&t&&(this.enabled_&&t.isEditable()?(Re(e,"blocklyEditableText"),ze(e,"blocklyNonEditableText"),e.style.cursor=this.CURSOR):(Re(e,"blocklyNonEditableText"),ze(e,"blocklyEditableText"),e.style.cursor=""))}setEnabled(e){this.enabled_=e,this.updateEditable()}isEnabled(){return this.enabled_}isClickable(){return this.enabled_&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()&&this.showEditor_!==lt.prototype.showEditor_}isClickableInFlyout(e){return!e}isCurrentlyEditable(){return this.enabled_&&this.EDITABLE&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()}isSerializable(){let e=!1;return this.name&&(this.SERIALIZABLE?e=!0:this.EDITABLE&&(console.warn("Detected an editable field that was not serializable. Please define SERIALIZABLE property as true on all editable custom fields. Proceeding with serialization."),e=!0)),e}isVisible(){return this.visible_}setVisible(e){if(this.visible_!==e){this.visible_=e;var t=this.fieldGroup_;t&&(t.style.display=e?"block":"none")}}setValidator(e){this.validator_=e}getValidator(){return this.validator_}getSvgRoot(){return this.fieldGroup_}getBorderRect(){if(!this.borderRect_)throw Error(`The border rectangle is ${this.borderRect_}.`);return this.borderRect_}getTextElement(){if(!this.textElement_)throw Error(`The text element is ${this.textElement_}.`);return this.textElement_}getTextContent(){if(!this.textContent_)throw Error(`The text content is ${this.textContent_}.`);return this.textContent_}applyColour(){}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_()}showEditor(e){this.isClickable()&&this.showEditor_(e)}showEditor_(e){}repositionForWindowResize(){return!1}updateSize_(e){const t=this.getConstants();e=e!==void 0?e:this.isFullBlockField()?0:this.getConstants().FIELD_BORDER_RECT_X_PADDING;let o=2*e,n=t.FIELD_TEXT_HEIGHT,u=0;this.textElement_&&(u=Io(this.textElement_,t.FIELD_TEXT_FONTSIZE,t.FIELD_TEXT_FONTWEIGHT,t.FIELD_TEXT_FONTFAMILY),o+=u),this.isFullBlockField()||(n=Math.max(n,t.FIELD_BORDER_RECT_HEIGHT)),this.size_.height=n,this.size_.width=o,this.positionTextElement_(e,u),this.positionBorderRect_()}positionTextElement_(e,t){if(this.textElement_){var o=this.getConstants(),n=this.size_.height/2,u;this.textElement_.setAttribute("x",String((u=this.getSourceBlock())!=null&&u.RTL?this.size_.width-t-e:e)),this.textElement_.setAttribute("y",String(o.FIELD_TEXT_BASELINE_CENTER?n:n-o.FIELD_TEXT_HEIGHT/2+o.FIELD_TEXT_BASELINE))}}positionBorderRect_(){this.borderRect_&&(this.borderRect_.setAttribute("width",String(this.size_.width)),this.borderRect_.setAttribute("height",String(this.size_.height)),this.borderRect_.setAttribute("rx",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)),this.borderRect_.setAttribute("ry",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)))}getSize(){return this.isVisible()?(this.isDirty_?(this.render_(),this.isDirty_=!1):this.visible_&&this.size_.width===0&&(this.render_(),this.size_.width!==0&&console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead.")),this.size_):new Xe(0,0)}getScaledBBox(){let e;var t=this.getSourceBlock();if(!t)throw new _t;if(this.isFullBlockField()){var o=this.sourceBlock_.getHeightWidth();const n=t.workspace.scale;e=this.getAbsoluteXY_(),t=(o.width+1)*n,o=(o.height+1)*n,Ab?(e.x+=1.5*n,e.y+=1.5*n):(e.x-=.5*n,e.y-=.5*n)}else o=this.borderRect_.getBoundingClientRect(),e=xo(this.borderRect_),t=o.width,o=o.height;return new rt(e.y,e.y+o,e.x,e.x+t)}onLocationChange(e){}getDisplayText_(){let e=this.getText();return e?(e.length>this.maxDisplayLength&&(e=e.substring(0,this.maxDisplayLength-2)+"…"),e=e.replace(/\s/g,lt.NBSP),this.sourceBlock_&&this.sourceBlock_.RTL&&(e+="‏"),e):lt.NBSP}getText(){const e=this.getText_();return String(e!==null?e:this.getValue())}getText_(){return null}markDirty(){this.isDirty_=!0,this.constants_=null}forceRerender(){this.isDirty_=!0,this.sourceBlock_&&this.sourceBlock_.rendered&&this.sourceBlock_.queueRender()}setValue(e,t=!0){if(e!==null){var o=i.getGroup$$module$build$src$core$events$utils();o||i.setGroup$$module$build$src$core$events$utils(!0);try{const le=this.doClassValidation_(e),Ee=this.processValidation(e,le,t);if(!(Ee instanceof Error)){var n,u=(n=this.getValidator())==null?void 0:n.call(this,Ee),g=this.processValidation(Ee,u,t);if(!(g instanceof Error)){var I=this.sourceBlock_;if(!I||!I.disposed){var L=this.getValue();L===g?this.doValueUpdate_(g):(this.doValueUpdate_(g),t&&I&&C()&&z(new(ne(ee.BLOCK_CHANGE))(I,"field",this.name||null,L,g)),this.isDirty_&&this.forceRerender())}}}}finally{i.setGroup$$module$build$src$core$events$utils(o)}}}processValidation(e,t,o){return t===null?(this.doValueInvalid_(e,o),this.isDirty_&&this.forceRerender(),Error()):t===void 0?e:t}getValue(){return this.value_}doClassValidation_(e){return e??null}doValueUpdate_(e){this.value_=e,this.isDirty_=!0}doValueInvalid_(e,t){}onMouseDown_(e){this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&(e=this.sourceBlock_.workspace.getGesture(e))&&e.setStartField(this)}setTooltip(e){e||e===""||(e=this.sourceBlock_);const t=this.getClickTarget_();t?t.tooltip=e:this.tooltip=e}getTooltip(){const e=this.getClickTarget_();return Hi(e||{tooltip:this.tooltip})}getClickTarget_(){return this.clickTarget_||this.getSvgRoot()}getAbsoluteXY_(){return xo(this.getClickTarget_())}referencesVariables(){return!1}refreshVariableName(){}getParentInput(){let e=null;const t=this.getSourceBlock();if(!t)throw new _t;const o=t.inputList;for(let n=0;n{o.stopPropagation()})}addModelUpdateBindings(){this.view.addTextChangeListener((e,t)=>{super.setText(t)}),this.view.addSizeChangeListener((e,t)=>{super.setSize(t)}),this.view.addOnCollapseListener(()=>{super.setCollapsed(this.view.isCollapsed())}),this.view.addDisposeListener(()=>{this.isDeadOrDying()||this.dispose()})}setText(e){this.view.setText(e)}setSize(e){this.view.setSize(e)}setCollapsed(e){this.view.setCollapsed(e)}setEditable(e){super.setEditable(e),this.view.setEditable(this.isEditable())}getSvgRoot(){return this.view.getSvgRoot()}getSize(){return super.getSize()}getBoundingRectangle(){const e=this.getRelativeToSurfaceXY();var t,o;const n=(o=(t=this.view)==null?void 0:t.getSize())!=null?o:this.getSize();return this.workspace.RTL?(t=e.x-n.width,o=e.x):(t=e.x,o=e.x+n.width),new rt(e.y,e.y+n.height,t,o)}moveBy(e,t,o){const n=this.getRelativeToSurfaceXY();e=new ye(n.x+e,n.y+t),this.moveTo(e,o)}moveTo(e,t){super.moveTo(e,t),this.view.moveTo(e)}moveDuringDrag(e){this.location=e,this.view.moveTo(e)}setDragging(e){e?Oe(this.getSvgRoot(),"blocklyDragging"):ze(this.getSvgRoot(),"blocklyDragging")}dispose(){this.disposing=!0,this.view.isDeadOrDying()||this.view.dispose(),super.dispose()}startGesture(e){const t=this.workspace.getGesture(e);if(t){if(be(e))e.stopPropagation();else{t.handleCommentStart(e,this);let o;(o=this.workspace.getLayerManager())==null||o.append(this,Fo)}i.setSelected$$module$build$src$core$common(this)}}setDeleteStyle(e){e?Oe(this.getSvgRoot(),"blocklyDraggingDelete"):ze(this.getSvgRoot(),"blocklyDraggingDelete")}isMovable(){return this.dragStrategy.isMovable()}startDrag(){this.dragStrategy.startDrag()}drag(e){this.dragStrategy.drag(e)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){Oe(this.getSvgRoot(),"blocklySelected")}unselect(){ze(this.getSvgRoot(),"blocklySelected")}toCopyData(){return{paster:pl.TYPE,commentState:Pi(this,{addCoordinates:!0})}}showContextMenu(e){const t=Ke.registry.getContextMenuOptions(Ke.ScopeType.COMMENT,{comment:this});sr(e,t,this.workspace.RTL,this.workspace)}snapToGrid(){if(!this.isDeadOrDying()){var e=this.workspace.getGrid();if(e!=null&&e.shouldSnap()){var t=this.getRelativeToSurfaceXY();e=e.alignXY(t),e!==t&&this.moveTo(e,["snap"])}}}},Ft={};Ft.appendDomToWorkspace=p$,Ft.blockToDom=Ao,Ft.blockToDomWithXY=nr,Ft.clearWorkspaceAndLoadFromXml=h$,Ft.deleteNext=w$,Ft.domToBlock=i.domToBlock$$module$build$src$core$xml,Ft.domToBlockInternal=ni,Ft.domToPrettyText=d$,Ft.domToText=zs,Ft.domToVariables=$d,Ft.domToWorkspace=i.domToWorkspace$$module$build$src$core$xml,Ft.loadWorkspaceComment=fd,Ft.saveWorkspaceComment=ir,Ft.variablesToDom=gd,Ft.workspaceToDom=l$;var Qh=class extends gi{constructor(e){super(e),this.type=ee.BLOCK_CREATE,e&&(e.isShadow()&&(this.recordUndo=!1),this.xml=nr(e),this.ids=ve(e),this.json=os(e,{addCoordinates:!0}))}toJson(){const e=super.toJson();if(!this.xml)throw Error("The block XML is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");return e.xml=zs(this.xml),e.ids=this.ids,e.json=this.json,this.recordUndo||(e.recordUndo=this.recordUndo),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Qh),t.xml=i.textToDom$$module$build$src$core$utils$xml(e.xml),t.ids=e.ids,t.json=e.json,e.recordUndo!==void 0&&(t.recordUndo=e.recordUndo),t}run(e){const t=this.getEventWorkspace_();if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!KC(t,this.ids))if(e)lo(this.json,t);else for(e=0;ee.getBlockById(o)).filter(o=>o&&o.isShadow()).length===t.length};r($e.EVENT,ee.BLOCK_CREATE,Qh);var ep=class extends Ss{constructor(e,t){super(t),this.type=ee.THEME_CHANGE,this.themeName=e}toJson(){const e=super.toJson();if(!this.themeName)throw Error("The theme name is undefined. Either pass a theme name to the constructor, or call fromJson");return e.themeName=this.themeName,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new ep),t.themeName=e.themeName,t}};r($e.EVENT,ee.THEME_CHANGE,ep);var tp=class extends Ss{constructor(e,t,o,n,u){super(n),this.type=ee.VIEWPORT_CHANGE,this.viewTop=e,this.viewLeft=t,this.scale=o,this.oldScale=u}toJson(){const e=super.toJson();if(this.viewTop===void 0)throw Error("The view top is undefined. Either pass a value to the constructor, or call fromJson");if(this.viewLeft===void 0)throw Error("The view left is undefined. Either pass a value to the constructor, or call fromJson");if(this.scale===void 0)throw Error("The scale is undefined. Either pass a value to the constructor, or call fromJson");if(this.oldScale===void 0)throw Error("The old scale is undefined. Either pass a value to the constructor, or call fromJson");return e.viewTop=this.viewTop,e.viewLeft=this.viewLeft,e.scale=this.scale,e.oldScale=this.oldScale,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new tp),t.viewTop=e.viewTop,t.viewLeft=e.viewLeft,t.scale=e.scale,t.oldScale=e.oldScale,t}};r($e.EVENT,ee.VIEWPORT_CHANGE,tp);var xe;(function(e){e[e.INPUT_VALUE=1]="INPUT_VALUE",e[e.OUTPUT_VALUE=2]="OUTPUT_VALUE",e[e.NEXT_STATEMENT=3]="NEXT_STATEMENT",e[e.PREVIOUS_STATEMENT=4]="PREVIOUS_STATEMENT"})(xe||(xe={}));var un=class{constructor(e){this.connectionChecker=e,this.connections=[]}addConnection(e,t){t=this.calculateIndexForYPos(t),this.connections.splice(t,0,e)}findIndexOfConnection(e,t){if(!this.connections.length)return-1;const o=this.calculateIndexForYPos(t);if(o>=this.connections.length)return-1;t=e.y;let n=o;for(;0<=n&&this.connections[n].y===t;){if(this.connections[n]===e)return n;n--}for(n=o;ne)o=n;else{t=n;break}}return t}removeConnection(e,t){if(e=this.findIndexOfConnection(e,t),e===-1)throw Error("Unable to find connection in connectionDB.");this.connections.splice(e,1)}getNeighbours(e,t){function o(Ee){const dt=u-n[Ee].x,ut=g-n[Ee].y;return Math.sqrt(dt*dt+ut*ut)<=t&&le.push(n[Ee]),ut(this.flyout?i.config$$module$build$src$core$config.flyoutDragRadius:i.config$$module$build$src$core$config.dragRadius)}updateIsDraggingFromFlyout(){let e;if(!this.targetBlock||(e=this.flyout)==null||!e.isBlockCreatable(this.targetBlock))return!1;if(!this.flyout.targetWorkspace)throw Error(`Cannot update dragging from the flyout because the ' + - 'flyout's target workspace is undefined`);return!this.flyout.isScrollable()||this.flyout.isDragTowardWorkspace(this.currentDragDeltaXY)?(this.startWorkspace_=this.flyout.targetWorkspace,this.startWorkspace_.updateScreenCalculationsIfScrolled(),i.getGroup$$module$build$src$core$events$utils()||i.setGroup$$module$build$src$core$events$utils(!0),this.startBlock=null,this.targetBlock=this.flyout.createBlock(this.targetBlock),i.setSelected$$module$build$src$core$common(this.targetBlock),!0):!1}updateIsDraggingWorkspace(){if(!this.startWorkspace_)throw Error("Cannot update dragging the workspace because the start workspace is undefined");(this.flyout?this.flyout.isScrollable():this.startWorkspace_&&this.startWorkspace_.isDraggable())&&(this.dragging=!0,this.workspaceDragger=new vv(this.startWorkspace_),this.workspaceDragger.startDrag())}updateIsDragging(e){if(!this.startWorkspace_)throw Error("Cannot update dragging because the start workspace is undefined");if(this.calledUpdateIsDragging)throw Error("updateIsDragging_ should only be called once per gesture.");this.calledUpdateIsDragging=!0,this.flyout&&this.updateIsDraggingFromFlyout();const t=j();t&&ri(t)&&t.isMovable()?(this.dragging=!0,this.dragger=this.createDragger(t,this.startWorkspace_),this.dragger.onDragStart(e),this.dragger.onDrag(e,this.currentDragDeltaXY)):this.updateIsDraggingWorkspace()}createDragger(e,t){return new(y($e.BLOCK_DRAGGER,this.creatorWorkspace.options,!0))(e,t)}doStart(e){if(!this.startWorkspace_)throw Error("Cannot start the touch gesture becauase the start workspace is undefined");this.isPinchZoomEnabled=this.startWorkspace_.options.zoomOptions&&this.startWorkspace_.options.zoomOptions.pinch,be(e)?this.cancel():(this.gestureHasStarted=!0,Ki(),this.startWorkspace_.updateScreenCalculationsIfScrolled(),this.startWorkspace_.isMutator&&this.startWorkspace_.resize(),this.currentDropdownOwner=Mu(),this.startWorkspace_.hideChaff(!!this.flyout),this.startWorkspace_.markFocused(),this.mostRecentEvent=e,ed(),pe(e)?this.handleRightClick(e):(e.type.toLowerCase()==="pointerdown"&&e.pointerType!=="mouse"&&k(e,this),this.mouseDownXY=new ye(e.clientX,e.clientY),this.bindMouseEvents(e),this.isEnding_||this.handleTouchStart(e)))}bindMouseEvents(e){this.boundEvents.push(H(document,"pointerdown",null,this.handleStart.bind(this),!0)),this.boundEvents.push(H(document,"pointermove",null,this.handleMove.bind(this),!0)),this.boundEvents.push(H(document,"pointerup",null,this.handleUp.bind(this),!0)),e.preventDefault(),e.stopPropagation()}handleStart(e){this.isDragging()||(this.handleTouchStart(e),this.isMultiTouch()&&X())}handleMove(e){this.isDragging()&&O(e)||!this.isMultiTouch()?(this.updateFromEvent(e),this.workspaceDragger?this.workspaceDragger.drag(this.currentDragDeltaXY):this.dragger&&this.dragger.onDrag(this.mostRecentEvent,this.currentDragDeltaXY),e.preventDefault(),e.stopPropagation()):this.isMultiTouch()&&(this.handleTouchMove(e),X())}handleUp(e){if(this.isDragging()||this.handleTouchEnd(e),!this.isMultiTouch()||this.isDragging()){if(!O(e))return;if(this.updateFromEvent(e),X(),this.isEnding_){console.log("Trying to end a gesture recursively.");return}this.isEnding_=!0,this.dragger?this.dragger.onDragEnd(e,this.currentDragDeltaXY):this.workspaceDragger?this.workspaceDragger.endDrag(this.currentDragDeltaXY):this.isBubbleClick()||this.isCommentClick()||(this.isFieldClick()?this.doFieldClick():this.isIconClick()?this.doIconClick():this.isBlockClick()?this.doBlockClick():this.isWorkspaceClick()&&this.doWorkspaceClick(e))}e.preventDefault(),e.stopPropagation(),this.dispose()}handleTouchStart(e){var t=A(e);this.cachedPoints.set(t,this.getTouchPoint(e));var o=Array.from(this.cachedPoints.keys());o.length===2&&(t=this.cachedPoints.get(o[0]),o=this.cachedPoints.get(o[1]),this.startDistance=ye.distance(t,o),this.multiTouch=!0,e.preventDefault())}handleTouchMove(e){const t=A(e);this.cachedPoints.set(t,this.getTouchPoint(e)),this.isPinchZoomEnabled&&this.cachedPoints.size===2?this.handlePinch(e):(this.updateFromEvent(e),this.workspaceDragger?this.workspaceDragger.drag(this.currentDragDeltaXY):this.dragger&&this.dragger.onDrag(this.mostRecentEvent,this.currentDragDeltaXY),e.preventDefault(),e.stopPropagation())}handlePinch(e){var t=Array.from(this.cachedPoints.keys()),o=this.cachedPoints.get(t[0]);if(t=this.cachedPoints.get(t[1]),o=ye.distance(o,t)/this.startDistance,0this.previousScale){if(t=o-this.previousScale,t=0this.cachedPoints.size&&(this.cachedPoints.clear(),this.previousScale=0)}getTouchPoint(e){return this.startWorkspace_?new ye(e.pageX,e.pageY):null}isMultiTouch(){return this.multiTouch}cancel(){this.isEnding_||(X(),this.dragger?this.dragger.onDragEnd(this.mostRecentEvent,this.currentDragDeltaXY):this.workspaceDragger&&this.workspaceDragger.endDrag(this.currentDragDeltaXY),this.dispose())}handleRightClick(e){this.targetBlock?(this.bringBlockToFront(),this.targetBlock.workspace.hideChaff(!!this.flyout),this.targetBlock.showContextMenu(e)):this.startBubble?this.startBubble.showContextMenu(e):this.startComment?(this.startComment.workspace.hideChaff(),this.startComment.showContextMenu(e)):this.startWorkspace_&&!this.flyout&&(this.startWorkspace_.hideChaff(),this.startWorkspace_.showContextMenu(e)),e.preventDefault(),e.stopPropagation(),this.dispose()}handleWsStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");this.setStartWorkspace(t),this.mostRecentEvent=e,this.startBlock||this.startBubble||this.startComment||i.setSelected$$module$build$src$core$common(null),this.doStart(e)}fireWorkspaceClick(e){z(new(ne(ee.CLICK))(null,e.id,"workspace"))}handleFlyoutStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");this.setStartFlyout(t),this.handleWsStart(e,t.getWorkspace())}handleBlockStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBlockStart, but the gesture had already been started.");this.setStartBlock(t),this.mostRecentEvent=e}handleBubbleStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");this.setStartBubble(t),this.mostRecentEvent=e}handleCommentStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleCommentStart, but the gesture had already been started.");this.setStartComment(t),this.mostRecentEvent=e}doFieldClick(){if(!this.startField)throw Error("Cannot do a field click because the start field is undefined");this.currentDropdownOwner!==this.startField&&this.startField.showEditor(this.mostRecentEvent),this.bringBlockToFront()}doIconClick(){if(!this.startIcon)throw Error("Cannot do an icon click because the start icon is undefined");this.bringBlockToFront(),this.startIcon.onClick()}doBlockClick(){if(this.flyout&&this.flyout.autoClose){if(!this.targetBlock)throw Error("Cannot do a block click because the target block is undefined");if(this.targetBlock.isEnabled()){i.getGroup$$module$build$src$core$events$utils()||i.setGroup$$module$build$src$core$events$utils(!0);var e=this.flyout.createBlock(this.targetBlock);e.snapToGrid(),e.bumpNeighbours()}}else{if(!this.startWorkspace_)throw Error("Cannot do a block click because the start workspace is undefined");e=new(ne(ee.CLICK))(this.startBlock,this.startWorkspace_.id,"block"),z(e)}this.bringBlockToFront(),i.setGroup$$module$build$src$core$events$utils(!1)}doWorkspaceClick(e){e=this.creatorWorkspace,j()&&j().unselect(),this.fireWorkspaceClick(this.startWorkspace_||e)}bringBlockToFront(){this.targetBlock&&!this.flyout&&this.targetBlock.bringToFront()}setStartField(e){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");this.startField||(this.startField=e)}setStartIcon(e){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartIcon, but the gesture had already been started.");this.startIcon||(this.startIcon=e)}setStartBubble(e){this.startBubble||(this.startBubble=e)}setStartComment(e){this.startComment||(this.startComment=e)}setStartBlock(e){this.startBlock||this.startBubble||(this.startBlock=e,i.setSelected$$module$build$src$core$common(this.startBlock),e.isInFlyout&&e!==e.getRootBlock()?this.setTargetBlock(e.getRootBlock()):this.setTargetBlock(e))}setTargetBlock(e){e.isShadow()?this.setTargetBlock(e.getParent()):this.targetBlock=e}setStartWorkspace(e){this.startWorkspace_||(this.startWorkspace_=e)}setStartFlyout(e){this.flyout||(this.flyout=e)}isBubbleClick(){return!!this.startBubble&&!this.hasExceededDragRadius}isCommentClick(){return!!this.startComment&&!this.hasExceededDragRadius}isBlockClick(){return!!this.startBlock&&!this.hasExceededDragRadius&&!this.isFieldClick()&&!this.isIconClick()}isFieldClick(){return this.startField?this.startField.isClickable()&&!this.hasExceededDragRadius&&(!this.flyout||this.startField.isClickableInFlyout(this.flyout.autoClose)):!1}isIconClick(){if(!this.startIcon)return!1;const e=!this.flyout||!this.startIcon.isClickableInFlyout||this.startIcon.isClickableInFlyout(this.flyout.autoClose);return!this.hasExceededDragRadius&&e}isWorkspaceClick(){return!this.startBlock&&!this.startBubble&&!this.startField&&!this.hasExceededDragRadius}getCurrentDragger(){let e,t;return(t=(e=this.workspaceDragger)!=null?e:this.dragger)!=null?t:null}isDragging(){return this.dragging}hasStarted(){return this.gestureHasStarted}static inProgress(){const e=B();for(let t=0,o;o=e[t];t++)if(o.currentGesture_)return!0;return!1}},sp=class{constructor(e,t){this.pattern=e,this.scale=1;let o;this.spacing=(o=t.spacing)!=null?o:0;let n;this.length=(n=t.length)!=null?n:1,this.line2=(this.line1=e.firstChild)&&this.line1.nextSibling;let u;this.snapToGrid=(u=t.snap)!=null?u:!1}setSpacing(e){this.spacing=e,this.update(this.scale)}getSpacing(){return this.spacing}setLength(e){this.length=e,this.update(this.scale)}getLength(){return this.length}setSnapToGrid(e){this.snapToGrid=e}shouldSnap(){return this.snapToGrid}getPatternId(){return this.pattern.id}update(e){this.scale=e;var t=this.spacing*e;this.pattern.setAttribute("width",`${t}`),this.pattern.setAttribute("height",`${t}`),t=Math.floor(this.spacing/2)+.5;let o=t-this.length/2,n=t+this.length/2;t*=e,o*=e,n*=e,this.setLineAttributes(this.line1,e,o,n,t,t),this.setLineAttributes(this.line2,e,t,t,o,n)}setLineAttributes(e,t,o,n,u,g){e&&(e.setAttribute("stroke-width",`${t}`),e.setAttribute("x1",`${o}`),e.setAttribute("y1",`${u}`),e.setAttribute("x2",`${n}`),e.setAttribute("y2",`${g}`))}moveTo(e,t){this.pattern.setAttribute("x",`${e}`),this.pattern.setAttribute("y",`${t}`)}alignXY(e){var t=this.getSpacing();const o=t/2,n=Math.round(Math.round((e.x-o)/t)*t+o);return t=Math.round(Math.round((e.y-o)/t)*t+o),n===e.x&&t===e.y?e:new ye(n,t)}static createDom(e,t,o){e=ie(J.PATTERN,{id:"blocklyGridPattern"+e,patternUnits:"userSpaceOnUse"},o);let n,u;if(0<((n=t.length)!=null?n:1)&&0<((u=t.spacing)!=null?u:0)){ie(J.LINE,{stroke:t.colour},e);let g;(g=t.length)!=null&&g&&ie(J.LINE,{stroke:t.colour},e)}else ie(J.LINE,{},e);return e}},qC=class{constructor(e){this.workspace=e,this.layers=new Map,(e=e.getInjectionDiv())&&(this.dragLayer=this.createDragLayer(e),this.animationLayer=this.createAnimationLayer(e)),e=this.createLayer(Fo),Oe(e,"blocklyBlockCanvas"),e=this.createLayer(Sl),Oe(e,"blocklyBubbleCanvas")}createDragLayer(e){const t=ie(J.SVG,{class:"blocklyBlockDragSurface",xmlns:pr,"xmlns:html":Gs,"xmlns:xlink":is,version:"1.1"});return e.append(t),ie(J.G,{},t)}createAnimationLayer(e){const t=ie(J.SVG,{class:"blocklyAnimationLayer",xmlns:pr,"xmlns:html":Gs,"xmlns:xlink":is,version:"1.1"});return e.append(t),ie(J.G,{},t)}appendToAnimationLayer(e){let t;const o=(t=this.dragLayer)==null?void 0:t.getAttribute("transform");if(o){let u;(u=this.animationLayer)==null||u.setAttribute("transform",o)}let n;(n=this.animationLayer)==null||n.appendChild(e.getSvgRoot())}translateLayers(e,t){e=`translate(${e.x}, ${e.y}) scale(${t})`;let o;(o=this.dragLayer)==null||o.setAttribute("transform",e);for(const[,n]of this.layers)n.setAttribute("transform",e)}moveToDragLayer(e){let t;(t=this.dragLayer)==null||t.appendChild(e.getSvgRoot())}moveOffDragLayer(e,t){this.append(e,t)}append(e,t){this.layers.has(t)||this.createLayer(t);let o;(o=this.layers.get(t))==null||o.appendChild(e.getSvgRoot())}createLayer(e){const t=this.workspace.getSvgGroup(),o=ie(J.G,{});let n=!1;const u=[...this.layers].sort((g,I)=>g[0]-I[0]);for(const[g,I]of u)if(et[1]===e)?e:(this.sourceBlock_&&console.warn("Cannot set the dropdown's value to an unavailable option. Block type: "+this.sourceBlock_.type+", Field name: "+this.name+", Value: "+e),null)}doValueUpdate_(e){super.doValueUpdate_(e),e=this.getOptions(!0);for(let t=0,o;o=e[t];t++)o[1]===this.value_&&(this.selectedOption=o)}applyColour(){const e=this.sourceBlock_;this.borderRect_&&(this.borderRect_.setAttribute("stroke",e.getColourTertiary()),this.menu_?this.borderRect_.setAttribute("fill",e.getColourTertiary()):this.borderRect_.setAttribute("fill","transparent")),e&&this.arrow&&(e.isShadow()?this.arrow.style.fill=e.getColourSecondary():this.arrow.style.fill=e.getColour())}render_(){this.getTextContent().nodeValue="",this.imageElement.style.display="none";const e=this.selectedOption&&this.selectedOption[0];e&&typeof e=="object"?this.renderSelectedImage(e):this.renderSelectedText(),this.positionBorderRect_()}renderSelectedImage(e){const t=this.getSourceBlock();if(!t)throw new _t;this.imageElement.style.display="",this.imageElement.setAttributeNS(is,"xlink:href",e.src),this.imageElement.setAttribute("height",String(e.height)),this.imageElement.setAttribute("width",String(e.width));const o=Number(e.height);e=Number(e.width);var n=!!this.borderRect_;const u=Math.max(n?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,o+Qt.IMAGE_Y_PADDING);n=n?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let g;g=this.svgArrow?this.positionSVGArrow(e+n,u/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2):Io(this.arrow,this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY),this.size_.width=e+g+2*n,this.size_.height=u;let I=0;t.RTL?this.imageElement.setAttribute("x",`${n+g}`):(I=e+g,this.getTextElement().setAttribute("text-anchor","end"),this.imageElement.setAttribute("x",`${n}`)),this.imageElement.setAttribute("y",String(u/2-o/2)),this.positionTextElement_(I+n,e+g)}renderSelectedText(){this.getTextContent().nodeValue=this.getDisplayText_();var e=this.getTextElement();Oe(e,"blocklyDropdownText"),e.setAttribute("text-anchor","start");var t=!!this.borderRect_;e=Math.max(t?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,this.getConstants().FIELD_TEXT_HEIGHT);const o=Io(this.getTextElement(),this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY);t=t?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let n=0;this.svgArrow&&(n=this.positionSVGArrow(o+t,e/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2)),this.size_.width=o+n+2*t,this.size_.height=e,this.positionTextElement_(t,o)}positionSVGArrow(e,t){if(!this.svgArrow)return 0;const o=this.getSourceBlock();if(!o)throw new _t;const n=this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0,u=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_PADDING,g=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE;return this.svgArrow.setAttribute("transform","translate("+(o.RTL?n:e+u)+","+t+")"),g+u}getText_(){if(!this.selectedOption)return null;const e=this.selectedOption[0];return typeof e=="object"?e.alt:e}static fromJson(e){if(!e.options)throw Error("options are required for the dropdown field. The options property must be assigned an array of [humanReadableValue, languageNeutralValue] tuples.");return new this(e.options,void 0,e)}trimOptions(e){let t=!1;const o=e.map(([I,L])=>typeof I=="string"?[bt(I),L]:(t=!0,[I.alt!==null?Object.assign({},I,{alt:bt(I.alt)}):Object.assign({},I),L]));if(t||2>e.length)return{options:o};var n=o.map(([I])=>I),u=Qn(n);e=Ku(n,u);const g=Yu(n,u);return!e&&!g||u<=e+g?{options:o}:(u=e?n[0].substring(0,e-1):void 0,n=g?n[0].substr(1-g):void 0,{options:this.applyTrim(o,e,g),prefix:u,suffix:n})}applyTrim(e,t,o){return e.map(([n,u])=>[n.substring(t,n.length-o),u])}validateOptions(e){if(!Array.isArray(e))throw TypeError("FieldDropdown options must be an array.");if(!e.length)throw TypeError("FieldDropdown options must not be an empty array.");let t=!1;for(let o=0;o{o.stopPropagation()})}addModelUpdateBindings(){this.view.addTextChangeListener((e,t)=>{super.setText(t)}),this.view.addSizeChangeListener((e,t)=>{super.setSize(t)}),this.view.addOnCollapseListener(()=>{super.setCollapsed(this.view.isCollapsed())}),this.view.addDisposeListener(()=>{this.isDeadOrDying()||this.dispose()})}setText(e){this.view.setText(e)}setSize(e){this.view.setSize(e)}setCollapsed(e){this.view.setCollapsed(e)}setEditable(e){super.setEditable(e),this.view.setEditable(this.isEditable())}getSvgRoot(){return this.view.getSvgRoot()}getSize(){return super.getSize()}getBoundingRectangle(){const e=this.getRelativeToSurfaceXY();var t,o;const n=(o=(t=this.view)==null?void 0:t.getSize())!=null?o:this.getSize();return this.workspace.RTL?(t=e.x-n.width,o=e.x):(t=e.x,o=e.x+n.width),new rt(e.y,e.y+n.height,t,o)}moveBy(e,t,o){const n=this.getRelativeToSurfaceXY();e=new ye(n.x+e,n.y+t),this.moveTo(e,o)}moveTo(e,t){super.moveTo(e,t),this.view.moveTo(e)}moveDuringDrag(e){this.location=e,this.view.moveTo(e)}setDragging(e){e?Re(this.getSvgRoot(),"blocklyDragging"):ze(this.getSvgRoot(),"blocklyDragging")}dispose(){this.disposing=!0,this.view.isDeadOrDying()||this.view.dispose(),super.dispose()}startGesture(e){const t=this.workspace.getGesture(e);if(t){if(be(e))e.stopPropagation();else{t.handleCommentStart(e,this);let o;(o=this.workspace.getLayerManager())==null||o.append(this,jo)}i.setSelected$$module$build$src$core$common(this)}}setDeleteStyle(e){e?Re(this.getSvgRoot(),"blocklyDraggingDelete"):ze(this.getSvgRoot(),"blocklyDraggingDelete")}isMovable(){return this.dragStrategy.isMovable()}startDrag(){this.dragStrategy.startDrag()}drag(e){this.dragStrategy.drag(e)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){Re(this.getSvgRoot(),"blocklySelected")}unselect(){ze(this.getSvgRoot(),"blocklySelected")}toCopyData(){return{paster:pl.TYPE,commentState:Pi(this,{addCoordinates:!0})}}showContextMenu(e){const t=Ke.registry.getContextMenuOptions(Ke.ScopeType.COMMENT,{comment:this});sr(e,t,this.workspace.RTL,this.workspace)}snapToGrid(){if(!this.isDeadOrDying()){var e=this.workspace.getGrid();if(e!=null&&e.shouldSnap()){var t=this.getRelativeToSurfaceXY();e=e.alignXY(t),e!==t&&this.moveTo(e,["snap"])}}}},zt={};zt.appendDomToWorkspace=p$,zt.blockToDom=Ao,zt.blockToDomWithXY=nr,zt.clearWorkspaceAndLoadFromXml=h$,zt.deleteNext=w$,zt.domToBlock=i.domToBlock$$module$build$src$core$xml,zt.domToBlockInternal=ni,zt.domToPrettyText=d$,zt.domToText=zs,zt.domToVariables=$d,zt.domToWorkspace=i.domToWorkspace$$module$build$src$core$xml,zt.loadWorkspaceComment=fd,zt.saveWorkspaceComment=ir,zt.variablesToDom=gd,zt.workspaceToDom=l$;var Qh=class extends gi{constructor(e){super(e),this.type=ee.BLOCK_CREATE,e&&(e.isShadow()&&(this.recordUndo=!1),this.xml=nr(e),this.ids=ve(e),this.json=os(e,{addCoordinates:!0}))}toJson(){const e=super.toJson();if(!this.xml)throw Error("The block XML is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");return e.xml=zs(this.xml),e.ids=this.ids,e.json=this.json,this.recordUndo||(e.recordUndo=this.recordUndo),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Qh),t.xml=i.textToDom$$module$build$src$core$utils$xml(e.xml),t.ids=e.ids,t.json=e.json,e.recordUndo!==void 0&&(t.recordUndo=e.recordUndo),t}run(e){const t=this.getEventWorkspace_();if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!KC(t,this.ids))if(e)lo(this.json,t);else for(e=0;ee.getBlockById(o)).filter(o=>o&&o.isShadow()).length===t.length};r($e.EVENT,ee.BLOCK_CREATE,Qh);var ep=class extends Ss{constructor(e,t){super(t),this.type=ee.THEME_CHANGE,this.themeName=e}toJson(){const e=super.toJson();if(!this.themeName)throw Error("The theme name is undefined. Either pass a theme name to the constructor, or call fromJson");return e.themeName=this.themeName,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new ep),t.themeName=e.themeName,t}};r($e.EVENT,ee.THEME_CHANGE,ep);var tp=class extends Ss{constructor(e,t,o,n,u){super(n),this.type=ee.VIEWPORT_CHANGE,this.viewTop=e,this.viewLeft=t,this.scale=o,this.oldScale=u}toJson(){const e=super.toJson();if(this.viewTop===void 0)throw Error("The view top is undefined. Either pass a value to the constructor, or call fromJson");if(this.viewLeft===void 0)throw Error("The view left is undefined. Either pass a value to the constructor, or call fromJson");if(this.scale===void 0)throw Error("The scale is undefined. Either pass a value to the constructor, or call fromJson");if(this.oldScale===void 0)throw Error("The old scale is undefined. Either pass a value to the constructor, or call fromJson");return e.viewTop=this.viewTop,e.viewLeft=this.viewLeft,e.scale=this.scale,e.oldScale=this.oldScale,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new tp),t.viewTop=e.viewTop,t.viewLeft=e.viewLeft,t.scale=e.scale,t.oldScale=e.oldScale,t}};r($e.EVENT,ee.VIEWPORT_CHANGE,tp);var xe;(function(e){e[e.INPUT_VALUE=1]="INPUT_VALUE",e[e.OUTPUT_VALUE=2]="OUTPUT_VALUE",e[e.NEXT_STATEMENT=3]="NEXT_STATEMENT",e[e.PREVIOUS_STATEMENT=4]="PREVIOUS_STATEMENT"})(xe||(xe={}));var un=class{constructor(e){this.connectionChecker=e,this.connections=[]}addConnection(e,t){t=this.calculateIndexForYPos(t),this.connections.splice(t,0,e)}findIndexOfConnection(e,t){if(!this.connections.length)return-1;const o=this.calculateIndexForYPos(t);if(o>=this.connections.length)return-1;t=e.y;let n=o;for(;0<=n&&this.connections[n].y===t;){if(this.connections[n]===e)return n;n--}for(n=o;ne)o=n;else{t=n;break}}return t}removeConnection(e,t){if(e=this.findIndexOfConnection(e,t),e===-1)throw Error("Unable to find connection in connectionDB.");this.connections.splice(e,1)}getNeighbours(e,t){function o(Ee){const dt=u-n[Ee].x,ut=g-n[Ee].y;return Math.sqrt(dt*dt+ut*ut)<=t&&le.push(n[Ee]),ut(this.flyout?i.config$$module$build$src$core$config.flyoutDragRadius:i.config$$module$build$src$core$config.dragRadius)}updateIsDraggingFromFlyout(){let e;if(!this.targetBlock||(e=this.flyout)==null||!e.isBlockCreatable(this.targetBlock))return!1;if(!this.flyout.targetWorkspace)throw Error(`Cannot update dragging from the flyout because the ' + + 'flyout's target workspace is undefined`);return!this.flyout.isScrollable()||this.flyout.isDragTowardWorkspace(this.currentDragDeltaXY)?(this.startWorkspace_=this.flyout.targetWorkspace,this.startWorkspace_.updateScreenCalculationsIfScrolled(),i.getGroup$$module$build$src$core$events$utils()||i.setGroup$$module$build$src$core$events$utils(!0),this.startBlock=null,this.targetBlock=this.flyout.createBlock(this.targetBlock),i.setSelected$$module$build$src$core$common(this.targetBlock),!0):!1}updateIsDraggingWorkspace(){if(!this.startWorkspace_)throw Error("Cannot update dragging the workspace because the start workspace is undefined");(this.flyout?this.flyout.isScrollable():this.startWorkspace_&&this.startWorkspace_.isDraggable())&&(this.dragging=!0,this.workspaceDragger=new vv(this.startWorkspace_),this.workspaceDragger.startDrag())}updateIsDragging(e){if(!this.startWorkspace_)throw Error("Cannot update dragging because the start workspace is undefined");if(this.calledUpdateIsDragging)throw Error("updateIsDragging_ should only be called once per gesture.");this.calledUpdateIsDragging=!0,this.flyout&&this.updateIsDraggingFromFlyout();const t=F();t&&ri(t)&&t.isMovable()?(this.dragging=!0,this.dragger=this.createDragger(t,this.startWorkspace_),this.dragger.onDragStart(e),this.dragger.onDrag(e,this.currentDragDeltaXY)):this.updateIsDraggingWorkspace()}createDragger(e,t){return new(y($e.BLOCK_DRAGGER,this.creatorWorkspace.options,!0))(e,t)}doStart(e){if(!this.startWorkspace_)throw Error("Cannot start the touch gesture becauase the start workspace is undefined");this.isPinchZoomEnabled=this.startWorkspace_.options.zoomOptions&&this.startWorkspace_.options.zoomOptions.pinch,be(e)?this.cancel():(this.gestureHasStarted=!0,Ki(),this.startWorkspace_.updateScreenCalculationsIfScrolled(),this.startWorkspace_.isMutator&&this.startWorkspace_.resize(),this.currentDropdownOwner=Mu(),this.startWorkspace_.hideChaff(!!this.flyout),this.startWorkspace_.markFocused(),this.mostRecentEvent=e,ed(),pe(e)?this.handleRightClick(e):(e.type.toLowerCase()==="pointerdown"&&e.pointerType!=="mouse"&&k(e,this),this.mouseDownXY=new ye(e.clientX,e.clientY),this.bindMouseEvents(e),this.isEnding_||this.handleTouchStart(e)))}bindMouseEvents(e){this.boundEvents.push(H(document,"pointerdown",null,this.handleStart.bind(this),!0)),this.boundEvents.push(H(document,"pointermove",null,this.handleMove.bind(this),!0)),this.boundEvents.push(H(document,"pointerup",null,this.handleUp.bind(this),!0)),e.preventDefault(),e.stopPropagation()}handleStart(e){this.isDragging()||(this.handleTouchStart(e),this.isMultiTouch()&&X())}handleMove(e){this.isDragging()&&R(e)||!this.isMultiTouch()?(this.updateFromEvent(e),this.workspaceDragger?this.workspaceDragger.drag(this.currentDragDeltaXY):this.dragger&&this.dragger.onDrag(this.mostRecentEvent,this.currentDragDeltaXY),e.preventDefault(),e.stopPropagation()):this.isMultiTouch()&&(this.handleTouchMove(e),X())}handleUp(e){if(this.isDragging()||this.handleTouchEnd(e),!this.isMultiTouch()||this.isDragging()){if(!R(e))return;if(this.updateFromEvent(e),X(),this.isEnding_){console.log("Trying to end a gesture recursively.");return}this.isEnding_=!0,this.dragger?this.dragger.onDragEnd(e,this.currentDragDeltaXY):this.workspaceDragger?this.workspaceDragger.endDrag(this.currentDragDeltaXY):this.isBubbleClick()||this.isCommentClick()||(this.isFieldClick()?this.doFieldClick():this.isIconClick()?this.doIconClick():this.isBlockClick()?this.doBlockClick():this.isWorkspaceClick()&&this.doWorkspaceClick(e))}e.preventDefault(),e.stopPropagation(),this.dispose()}handleTouchStart(e){var t=A(e);this.cachedPoints.set(t,this.getTouchPoint(e));var o=Array.from(this.cachedPoints.keys());o.length===2&&(t=this.cachedPoints.get(o[0]),o=this.cachedPoints.get(o[1]),this.startDistance=ye.distance(t,o),this.multiTouch=!0,e.preventDefault())}handleTouchMove(e){const t=A(e);this.cachedPoints.set(t,this.getTouchPoint(e)),this.isPinchZoomEnabled&&this.cachedPoints.size===2?this.handlePinch(e):(this.updateFromEvent(e),this.workspaceDragger?this.workspaceDragger.drag(this.currentDragDeltaXY):this.dragger&&this.dragger.onDrag(this.mostRecentEvent,this.currentDragDeltaXY),e.preventDefault(),e.stopPropagation())}handlePinch(e){var t=Array.from(this.cachedPoints.keys()),o=this.cachedPoints.get(t[0]);if(t=this.cachedPoints.get(t[1]),o=ye.distance(o,t)/this.startDistance,0this.previousScale){if(t=o-this.previousScale,t=0this.cachedPoints.size&&(this.cachedPoints.clear(),this.previousScale=0)}getTouchPoint(e){return this.startWorkspace_?new ye(e.pageX,e.pageY):null}isMultiTouch(){return this.multiTouch}cancel(){this.isEnding_||(X(),this.dragger?this.dragger.onDragEnd(this.mostRecentEvent,this.currentDragDeltaXY):this.workspaceDragger&&this.workspaceDragger.endDrag(this.currentDragDeltaXY),this.dispose())}handleRightClick(e){this.targetBlock?(this.bringBlockToFront(),this.targetBlock.workspace.hideChaff(!!this.flyout),this.targetBlock.showContextMenu(e)):this.startBubble?this.startBubble.showContextMenu(e):this.startComment?(this.startComment.workspace.hideChaff(),this.startComment.showContextMenu(e)):this.startWorkspace_&&!this.flyout&&(this.startWorkspace_.hideChaff(),this.startWorkspace_.showContextMenu(e)),e.preventDefault(),e.stopPropagation(),this.dispose()}handleWsStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");this.setStartWorkspace(t),this.mostRecentEvent=e,this.startBlock||this.startBubble||this.startComment||i.setSelected$$module$build$src$core$common(null),this.doStart(e)}fireWorkspaceClick(e){z(new(ne(ee.CLICK))(null,e.id,"workspace"))}handleFlyoutStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");this.setStartFlyout(t),this.handleWsStart(e,t.getWorkspace())}handleBlockStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBlockStart, but the gesture had already been started.");this.setStartBlock(t),this.mostRecentEvent=e}handleBubbleStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");this.setStartBubble(t),this.mostRecentEvent=e}handleCommentStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleCommentStart, but the gesture had already been started.");this.setStartComment(t),this.mostRecentEvent=e}doFieldClick(){if(!this.startField)throw Error("Cannot do a field click because the start field is undefined");this.currentDropdownOwner!==this.startField&&this.startField.showEditor(this.mostRecentEvent),this.bringBlockToFront()}doIconClick(){if(!this.startIcon)throw Error("Cannot do an icon click because the start icon is undefined");this.bringBlockToFront(),this.startIcon.onClick()}doBlockClick(){if(this.flyout&&this.flyout.autoClose){if(!this.targetBlock)throw Error("Cannot do a block click because the target block is undefined");if(this.targetBlock.isEnabled()){i.getGroup$$module$build$src$core$events$utils()||i.setGroup$$module$build$src$core$events$utils(!0);var e=this.flyout.createBlock(this.targetBlock);e.snapToGrid(),e.bumpNeighbours()}}else{if(!this.startWorkspace_)throw Error("Cannot do a block click because the start workspace is undefined");e=new(ne(ee.CLICK))(this.startBlock,this.startWorkspace_.id,"block"),z(e)}this.bringBlockToFront(),i.setGroup$$module$build$src$core$events$utils(!1)}doWorkspaceClick(e){e=this.creatorWorkspace,F()&&F().unselect(),this.fireWorkspaceClick(this.startWorkspace_||e)}bringBlockToFront(){this.targetBlock&&!this.flyout&&this.targetBlock.bringToFront()}setStartField(e){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");this.startField||(this.startField=e)}setStartIcon(e){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartIcon, but the gesture had already been started.");this.startIcon||(this.startIcon=e)}setStartBubble(e){this.startBubble||(this.startBubble=e)}setStartComment(e){this.startComment||(this.startComment=e)}setStartBlock(e){this.startBlock||this.startBubble||(this.startBlock=e,i.setSelected$$module$build$src$core$common(this.startBlock),e.isInFlyout&&e!==e.getRootBlock()?this.setTargetBlock(e.getRootBlock()):this.setTargetBlock(e))}setTargetBlock(e){e.isShadow()?this.setTargetBlock(e.getParent()):this.targetBlock=e}setStartWorkspace(e){this.startWorkspace_||(this.startWorkspace_=e)}setStartFlyout(e){this.flyout||(this.flyout=e)}isBubbleClick(){return!!this.startBubble&&!this.hasExceededDragRadius}isCommentClick(){return!!this.startComment&&!this.hasExceededDragRadius}isBlockClick(){return!!this.startBlock&&!this.hasExceededDragRadius&&!this.isFieldClick()&&!this.isIconClick()}isFieldClick(){return this.startField?this.startField.isClickable()&&!this.hasExceededDragRadius&&(!this.flyout||this.startField.isClickableInFlyout(this.flyout.autoClose)):!1}isIconClick(){if(!this.startIcon)return!1;const e=!this.flyout||!this.startIcon.isClickableInFlyout||this.startIcon.isClickableInFlyout(this.flyout.autoClose);return!this.hasExceededDragRadius&&e}isWorkspaceClick(){return!this.startBlock&&!this.startBubble&&!this.startField&&!this.hasExceededDragRadius}getCurrentDragger(){let e,t;return(t=(e=this.workspaceDragger)!=null?e:this.dragger)!=null?t:null}isDragging(){return this.dragging}hasStarted(){return this.gestureHasStarted}static inProgress(){const e=B();for(let t=0,o;o=e[t];t++)if(o.currentGesture_)return!0;return!1}},sp=class{constructor(e,t){this.pattern=e,this.scale=1;let o;this.spacing=(o=t.spacing)!=null?o:0;let n;this.length=(n=t.length)!=null?n:1,this.line2=(this.line1=e.firstChild)&&this.line1.nextSibling;let u;this.snapToGrid=(u=t.snap)!=null?u:!1}setSpacing(e){this.spacing=e,this.update(this.scale)}getSpacing(){return this.spacing}setLength(e){this.length=e,this.update(this.scale)}getLength(){return this.length}setSnapToGrid(e){this.snapToGrid=e}shouldSnap(){return this.snapToGrid}getPatternId(){return this.pattern.id}update(e){this.scale=e;var t=this.spacing*e;this.pattern.setAttribute("width",`${t}`),this.pattern.setAttribute("height",`${t}`),t=Math.floor(this.spacing/2)+.5;let o=t-this.length/2,n=t+this.length/2;t*=e,o*=e,n*=e,this.setLineAttributes(this.line1,e,o,n,t,t),this.setLineAttributes(this.line2,e,t,t,o,n)}setLineAttributes(e,t,o,n,u,g){e&&(e.setAttribute("stroke-width",`${t}`),e.setAttribute("x1",`${o}`),e.setAttribute("y1",`${u}`),e.setAttribute("x2",`${n}`),e.setAttribute("y2",`${g}`))}moveTo(e,t){this.pattern.setAttribute("x",`${e}`),this.pattern.setAttribute("y",`${t}`)}alignXY(e){var t=this.getSpacing();const o=t/2,n=Math.round(Math.round((e.x-o)/t)*t+o);return t=Math.round(Math.round((e.y-o)/t)*t+o),n===e.x&&t===e.y?e:new ye(n,t)}static createDom(e,t,o){e=ie(J.PATTERN,{id:"blocklyGridPattern"+e,patternUnits:"userSpaceOnUse"},o);let n,u;if(0<((n=t.length)!=null?n:1)&&0<((u=t.spacing)!=null?u:0)){ie(J.LINE,{stroke:t.colour},e);let g;(g=t.length)!=null&&g&&ie(J.LINE,{stroke:t.colour},e)}else ie(J.LINE,{},e);return e}},qC=class{constructor(e){this.workspace=e,this.layers=new Map,(e=e.getInjectionDiv())&&(this.dragLayer=this.createDragLayer(e),this.animationLayer=this.createAnimationLayer(e)),e=this.createLayer(jo),Re(e,"blocklyBlockCanvas"),e=this.createLayer(Sl),Re(e,"blocklyBubbleCanvas")}createDragLayer(e){const t=ie(J.SVG,{class:"blocklyBlockDragSurface",xmlns:pr,"xmlns:html":Gs,"xmlns:xlink":is,version:"1.1"});return e.append(t),ie(J.G,{},t)}createAnimationLayer(e){const t=ie(J.SVG,{class:"blocklyAnimationLayer",xmlns:pr,"xmlns:html":Gs,"xmlns:xlink":is,version:"1.1"});return e.append(t),ie(J.G,{},t)}appendToAnimationLayer(e){let t;const o=(t=this.dragLayer)==null?void 0:t.getAttribute("transform");if(o){let u;(u=this.animationLayer)==null||u.setAttribute("transform",o)}let n;(n=this.animationLayer)==null||n.appendChild(e.getSvgRoot())}translateLayers(e,t){e=`translate(${e.x}, ${e.y}) scale(${t})`;let o;(o=this.dragLayer)==null||o.setAttribute("transform",e);for(const[,n]of this.layers)n.setAttribute("transform",e)}moveToDragLayer(e){let t;(t=this.dragLayer)==null||t.appendChild(e.getSvgRoot())}moveOffDragLayer(e,t){this.append(e,t)}append(e,t){this.layers.has(t)||this.createLayer(t);let o;(o=this.layers.get(t))==null||o.appendChild(e.getSvgRoot())}createLayer(e){const t=this.workspace.getSvgGroup(),o=ie(J.G,{});let n=!1;const u=[...this.layers].sort((g,I)=>g[0]-I[0]);for(const[g,I]of u)if(et[1]===e)?e:(this.sourceBlock_&&console.warn("Cannot set the dropdown's value to an unavailable option. Block type: "+this.sourceBlock_.type+", Field name: "+this.name+", Value: "+e),null)}doValueUpdate_(e){super.doValueUpdate_(e),e=this.getOptions(!0);for(let t=0,o;o=e[t];t++)o[1]===this.value_&&(this.selectedOption=o)}applyColour(){const e=this.sourceBlock_;this.borderRect_&&(this.borderRect_.setAttribute("stroke",e.getColourTertiary()),this.menu_?this.borderRect_.setAttribute("fill",e.getColourTertiary()):this.borderRect_.setAttribute("fill","transparent")),e&&this.arrow&&(e.isShadow()?this.arrow.style.fill=e.getColourSecondary():this.arrow.style.fill=e.getColour())}render_(){this.getTextContent().nodeValue="",this.imageElement.style.display="none";const e=this.selectedOption&&this.selectedOption[0];e&&typeof e=="object"?this.renderSelectedImage(e):this.renderSelectedText(),this.positionBorderRect_()}renderSelectedImage(e){const t=this.getSourceBlock();if(!t)throw new _t;this.imageElement.style.display="",this.imageElement.setAttributeNS(is,"xlink:href",e.src),this.imageElement.setAttribute("height",String(e.height)),this.imageElement.setAttribute("width",String(e.width));const o=Number(e.height);e=Number(e.width);var n=!!this.borderRect_;const u=Math.max(n?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,o+es.IMAGE_Y_PADDING);n=n?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let g;g=this.svgArrow?this.positionSVGArrow(e+n,u/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2):Io(this.arrow,this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY),this.size_.width=e+g+2*n,this.size_.height=u;let I=0;t.RTL?this.imageElement.setAttribute("x",`${n+g}`):(I=e+g,this.getTextElement().setAttribute("text-anchor","end"),this.imageElement.setAttribute("x",`${n}`)),this.imageElement.setAttribute("y",String(u/2-o/2)),this.positionTextElement_(I+n,e+g)}renderSelectedText(){this.getTextContent().nodeValue=this.getDisplayText_();var e=this.getTextElement();Re(e,"blocklyDropdownText"),e.setAttribute("text-anchor","start");var t=!!this.borderRect_;e=Math.max(t?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,this.getConstants().FIELD_TEXT_HEIGHT);const o=Io(this.getTextElement(),this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY);t=t?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let n=0;this.svgArrow&&(n=this.positionSVGArrow(o+t,e/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2)),this.size_.width=o+n+2*t,this.size_.height=e,this.positionTextElement_(t,o)}positionSVGArrow(e,t){if(!this.svgArrow)return 0;const o=this.getSourceBlock();if(!o)throw new _t;const n=this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0,u=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_PADDING,g=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE;return this.svgArrow.setAttribute("transform","translate("+(o.RTL?n:e+u)+","+t+")"),g+u}getText_(){if(!this.selectedOption)return null;const e=this.selectedOption[0];return typeof e=="object"?e.alt:e}static fromJson(e){if(!e.options)throw Error("options are required for the dropdown field. The options property must be assigned an array of [humanReadableValue, languageNeutralValue] tuples.");return new this(e.options,void 0,e)}trimOptions(e){let t=!1;const o=e.map(([I,L])=>typeof I=="string"?[bt(I),L]:(t=!0,[I.alt!==null?Object.assign({},I,{alt:bt(I.alt)}):Object.assign({},I),L]));if(t||2>e.length)return{options:o};var n=o.map(([I])=>I),u=Qn(n);e=Ku(n,u);const g=Yu(n,u);return!e&&!g||u<=e+g?{options:o}:(u=e?n[0].substring(0,e-1):void 0,n=g?n[0].substr(1-g):void 0,{options:this.applyTrim(o,e,g),prefix:u,suffix:n})}applyTrim(e,t,o){return e.map(([n,u])=>[n.substring(t,n.length-o),u])}validateOptions(e){if(!Array.isArray(e))throw TypeError("FieldDropdown options must be an array.");if(!e.length)throw TypeError("FieldDropdown options must not be an empty array.");let t=!1;for(let o=0;oe.width)return t;if(e=this.getWorkspaceViewRect(e),this.workspace.RTL){var o=this.anchor.x-t;o-this.size.widthe.right&&(t=-(e.right-this.anchor.x))}else{o=t+this.anchor.x;const n=o+this.size.width;oe.right&&(t=e.right-this.anchor.x-this.size.width)}return t}getOptimalRelativeTop(e){let t=-this.size.height/4;if(this.size.height>e.height)return t;const o=this.anchor.y+t,n=o+this.size.height;return e=this.getWorkspaceViewRect(e),oe.bottom&&(t=e.bottom-this.anchor.y-this.size.height),t}getWorkspaceViewRect(e){const t=e.top;let o=e.top+e.height,n=e.left;return e=e.left+e.width,o-=this.getScrollbarThickness(),this.workspace.RTL?n-=this.getScrollbarThickness():e-=this.getScrollbarThickness(),new rt(t,o,n,e)}getScrollbarThickness(){return yt.scrollbarThickness/this.workspace.scale}renderTail(){const e=[];var t=this.size.width/2,o=this.size.height/2,n=-this.relativeLeft,u=-this.relativeTop;if(t===n&&o===u)e.push("M "+t+","+o);else{u-=o,n-=t,this.workspace.RTL&&(n*=-1);var g=Math.sqrt(u*u+n*n),I=Math.acos(n/g);0>u&&(I=2*Math.PI-I);var L=I+Math.PI/2;L>2*Math.PI&&(L-=2*Math.PI);var le=Math.sin(L);const dt=Math.cos(L);let ut=(this.size.width+this.size.height)/rs.TAIL_THICKNESS;ut=Math.min(ut,this.size.width,this.size.height)/4,L=1-rs.ANCHOR_RADIUS/g,n=t+L*n,u=o+L*u,L=t+ut*dt;const es=o+ut*le;t-=ut*dt,o-=ut*le,le=Aa(this.workspace.RTL?-rs.TAIL_ANGLE:rs.TAIL_ANGLE),le=I+le,le>2*Math.PI&&(le-=2*Math.PI),I=Math.sin(le)*g/rs.TAIL_BEND,g=Math.cos(le)*g/rs.TAIL_BEND,e.push("M"+L+","+es),e.push("C"+(L+g)+","+(es+I)+" "+n+","+u+" "+n+","+u),e.push("C"+n+","+u+" "+(t+g)+","+(o+I)+" "+t+","+o)}e.push("z");let Ee;(Ee=this.tail)==null||Ee.setAttribute("d",e.join(" "))}bringToFront(){let e;const t=(e=this.svgRoot)==null?void 0:e.parentNode;return this.svgRoot&&(t==null?void 0:t.lastChild)!==this.svgRoot?(t==null||t.appendChild(this.svgRoot),!0):!1}getRelativeToSurfaceXY(){return new ye(this.workspace.RTL?-this.relativeLeft+this.anchor.x-this.size.width:this.anchor.x+this.relativeLeft,this.anchor.y+this.relativeTop)}getSvgRoot(){return this.svgRoot}moveDuringDrag(e){this.moveTo(e.x,e.y),this.relativeLeft=this.workspace.RTL?this.anchor.x-e.x-this.size.width:e.x-this.anchor.x,this.relativeTop=e.y-this.anchor.y,this.renderTail()}setDragging(e){}setDeleteStyle(e){}isDeletable(){return!1}showContextMenu(e){}isMovable(){return!0}startDrag(){this.dragStrategy.startDrag()}drag(e){this.dragStrategy.drag(e)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){}unselect(){}};rs=nt,nt.BORDER_WIDTH=6,nt.DOUBLE_BORDER=2*rs.BORDER_WIDTH,nt.MIN_SIZE=rs.DOUBLE_BORDER,nt.TAIL_THICKNESS=1,nt.TAIL_ANGLE=20,nt.TAIL_BEND=4,nt.ANCHOR_RADIUS=8;var vo=class extends nt{constructor(e,t,o,n){super(t,o,n),this.workspace=t,this.anchor=o,this.ownerRect=n,this.autoLayout=!0,t=new gs(e),this.validateWorkspaceOptions(t),this.svgDialog=ie(J.SVG,{x:nt.BORDER_WIDTH,y:nt.BORDER_WIDTH},this.contentContainer),e.parentWorkspace=this.workspace,this.miniWorkspace=this.newWorkspaceSvg(new gs(e)),this.miniWorkspace.internalIsMutator=!0,e=this.miniWorkspace.createDom("blocklyMutatorBackground"),this.svgDialog.appendChild(e),t.languageTree&&(e.insertBefore(this.miniWorkspace.addFlyout(J.G),this.miniWorkspace.getCanvas()),e=this.miniWorkspace.getFlyout(),e==null||e.init(this.miniWorkspace),e==null||e.show(t.languageTree)),this.miniWorkspace.addChangeListener(this.onWorkspaceChange.bind(this));let u,g;(u=this.miniWorkspace.getFlyout())==null||(g=u.getWorkspace())==null||g.addChangeListener(this.onWorkspaceChange.bind(this)),this.updateBubbleSize()}dispose(){this.miniWorkspace.dispose(),super.dispose()}getWorkspace(){return this.miniWorkspace}addWorkspaceChangeListener(e){this.miniWorkspace.addChangeListener(e)}validateWorkspaceOptions(e){if(e.hasCategories)throw Error("The miniworkspace bubble does not support toolboxes with categories");if(e.hasTrashcan)throw Error("The miniworkspace bubble does not support trashcans");if(e.zoomOptions.controls||e.zoomOptions.wheel||e.zoomOptions.pinch)throw Error("The miniworkspace bubble does not support zooming");if(e.moveOptions.scrollbars||e.moveOptions.wheel||e.moveOptions.drag)throw Error("The miniworkspace bubble does not scrolling/moving the workspace");if(e.horizontalLayout)throw Error("The miniworkspace bubble does not support horizontal layouts")}onWorkspaceChange(){this.bumpBlocksIntoBounds(),this.updateBubbleSize()}bumpBlocksIntoBounds(){if(!this.miniWorkspace.isDragging())for(const e of this.miniWorkspace.getTopBlocks(!1)){const t=e.getRelativeToSurfaceXY();if(20>t.y&&e.moveBy(0,20-t.y),e.RTL){let o=-20;const n=this.miniWorkspace.getFlyout();n&&(o-=n.getWidth()),t.x>o&&e.moveBy(o-t.x,0)}else 20>t.x&&e.moveBy(20-t.x,0)}}updateBubbleSize(){if(!this.miniWorkspace.isDragging()){var e=this.getSize(),t=this.calculateWorkspaceSize();Math.abs(e.width-t.width)({kind:"block",type:o}))}),t}getAnchorLocation(){const e=Rl/2;return ye.sum(this.workspaceLocation,new ye(e,e))}getBubbleOwnerRect(){const e=this.sourceBlock.getSvgRoot().getBBox();return new rt(e.y,e.y+e.height,e.x,e.x+e.width)}createRootBlock(){if(!this.sourceBlock.decompose)throw Error("Blocks with mutator icons must include a decompose method");this.rootBlock=this.sourceBlock.decompose(this.miniWorkspaceBubble.getWorkspace());for(var e of this.rootBlock.getDescendants(!1))e.queueRender();this.rootBlock.setMovable(!1),this.rootBlock.setDeletable(!1);let t,o,n,u;e=(u=(t=this.miniWorkspaceBubble)==null||(o=t.getWorkspace())==null||(n=o.getFlyout())==null?void 0:n.getWidth())!=null?u:0,this.rootBlock.moveBy(this.rootBlock.RTL?-(e+Nl):Nl,Nl)}addSaveConnectionsListener(){this.sourceBlock.saveConnections&&this.rootBlock&&(this.saveConnectionsListener=()=>{this.sourceBlock.saveConnections&&this.rootBlock&&this.sourceBlock.saveConnections(this.rootBlock)},this.saveConnectionsListener(),this.sourceBlock.workspace.addChangeListener(this.saveConnectionsListener))}createMiniWorkspaceChangeListener(){return e=>{i.MutatorIcon$$module$build$src$core$icons$mutator_icon.isIgnorableMutatorEvent(e)||this.updateWorkspacePid||(this.updateWorkspacePid=setTimeout(()=>{this.updateWorkspacePid=null,this.recomposeSourceBlock()},0))}}static isIgnorableMutatorEvent(e){return e.isUiEvent||$(e)||T(e)&&e.element==="disabled"}recomposeSourceBlock(){if(this.rootBlock){if(!this.sourceBlock.compose)throw Error("Blocks with mutator icons must include a compose method");var e=i.getGroup$$module$build$src$core$events$utils();e||i.setGroup$$module$build$src$core$events$utils(!0);var t=mi.getExtraBlockState_(this.sourceBlock);this.sourceBlock.compose(this.rootBlock);var o=mi.getExtraBlockState_(this.sourceBlock);t!==o&&z(new(ne(ee.BLOCK_CHANGE))(this.sourceBlock,"mutation",null,t,o)),i.setGroup$$module$build$src$core$events$utils(e)}}getWorkspace(){let e;return(e=this.miniWorkspaceBubble)==null?void 0:e.getWorkspace()}},i.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE=Ct.MUTATOR,i.MutatorIcon$$module$build$src$core$icons$mutator_icon.WEIGHT=1,i.MutatorIcon$$module$build$src$core$icons$mutator_icon;var dn=Object.create(null),QC={allExtensions:dn};i.register$$module$build$src$core$extensions("parent_tooltip_when_inline",O$);var As={TEST_ONLY:QC};As.apply=Va,As.buildTooltipForDropdown=i.buildTooltipForDropdown$$module$build$src$core$extensions,As.buildTooltipWithFieldText=i.buildTooltipWithFieldText$$module$build$src$core$extensions,As.isRegistered=kd,As.register=i.register$$module$build$src$core$extensions,As.registerMixin=i.registerMixin$$module$build$src$core$extensions,As.registerMutator=i.registerMutator$$module$build$src$core$extensions,As.runAfterPageLoad=D$,As.unregister=T$;var Ye;(function(e){e[e.WIN_KEY_FF_LINUX=0]="WIN_KEY_FF_LINUX",e[e.MAC_ENTER=3]="MAC_ENTER",e[e.BACKSPACE=8]="BACKSPACE",e[e.TAB=9]="TAB",e[e.NUM_CENTER=12]="NUM_CENTER",e[e.ENTER=13]="ENTER",e[e.SHIFT=16]="SHIFT",e[e.CTRL=17]="CTRL",e[e.ALT=18]="ALT",e[e.PAUSE=19]="PAUSE",e[e.CAPS_LOCK=20]="CAPS_LOCK",e[e.ESC=27]="ESC",e[e.SPACE=32]="SPACE",e[e.PAGE_UP=33]="PAGE_UP",e[e.PAGE_DOWN=34]="PAGE_DOWN",e[e.END=35]="END",e[e.HOME=36]="HOME",e[e.LEFT=37]="LEFT",e[e.UP=38]="UP",e[e.RIGHT=39]="RIGHT",e[e.DOWN=40]="DOWN",e[e.PLUS_SIGN=43]="PLUS_SIGN",e[e.PRINT_SCREEN=44]="PRINT_SCREEN",e[e.INSERT=45]="INSERT",e[e.DELETE=46]="DELETE",e[e.ZERO=48]="ZERO",e[e.ONE=49]="ONE",e[e.TWO=50]="TWO",e[e.THREE=51]="THREE",e[e.FOUR=52]="FOUR",e[e.FIVE=53]="FIVE",e[e.SIX=54]="SIX",e[e.SEVEN=55]="SEVEN",e[e.EIGHT=56]="EIGHT",e[e.NINE=57]="NINE",e[e.FF_SEMICOLON=59]="FF_SEMICOLON",e[e.FF_EQUALS=61]="FF_EQUALS",e[e.FF_DASH=173]="FF_DASH",e[e.FF_HASH=163]="FF_HASH",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.AT_SIGN=64]="AT_SIGN",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.META=91]="META",e[e.WIN_KEY_RIGHT=92]="WIN_KEY_RIGHT",e[e.CONTEXT_MENU=93]="CONTEXT_MENU",e[e.NUM_ZERO=96]="NUM_ZERO",e[e.NUM_ONE=97]="NUM_ONE",e[e.NUM_TWO=98]="NUM_TWO",e[e.NUM_THREE=99]="NUM_THREE",e[e.NUM_FOUR=100]="NUM_FOUR",e[e.NUM_FIVE=101]="NUM_FIVE",e[e.NUM_SIX=102]="NUM_SIX",e[e.NUM_SEVEN=103]="NUM_SEVEN",e[e.NUM_EIGHT=104]="NUM_EIGHT",e[e.NUM_NINE=105]="NUM_NINE",e[e.NUM_MULTIPLY=106]="NUM_MULTIPLY",e[e.NUM_PLUS=107]="NUM_PLUS",e[e.NUM_MINUS=109]="NUM_MINUS",e[e.NUM_PERIOD=110]="NUM_PERIOD",e[e.NUM_DIVISION=111]="NUM_DIVISION",e[e.F1=112]="F1",e[e.F2=113]="F2",e[e.F3=114]="F3",e[e.F4=115]="F4",e[e.F5=116]="F5",e[e.F6=117]="F6",e[e.F7=118]="F7",e[e.F8=119]="F8",e[e.F9=120]="F9",e[e.F10=121]="F10",e[e.F11=122]="F11",e[e.F12=123]="F12",e[e.NUMLOCK=144]="NUMLOCK",e[e.SCROLL_LOCK=145]="SCROLL_LOCK",e[e.FIRST_MEDIA_KEY=166]="FIRST_MEDIA_KEY",e[e.LAST_MEDIA_KEY=183]="LAST_MEDIA_KEY",e[e.SEMICOLON=186]="SEMICOLON",e[e.DASH=189]="DASH",e[e.EQUALS=187]="EQUALS",e[e.COMMA=188]="COMMA",e[e.PERIOD=190]="PERIOD",e[e.SLASH=191]="SLASH",e[e.APOSTROPHE=192]="APOSTROPHE",e[e.TILDE=192]="TILDE",e[e.SINGLE_QUOTE=222]="SINGLE_QUOTE",e[e.OPEN_SQUARE_BRACKET=219]="OPEN_SQUARE_BRACKET",e[e.BACKSLASH=220]="BACKSLASH",e[e.CLOSE_SQUARE_BRACKET=221]="CLOSE_SQUARE_BRACKET",e[e.WIN_KEY=224]="WIN_KEY",e[e.MAC_FF_META=224]="MAC_FF_META",e[e.MAC_WK_CMD_LEFT=91]="MAC_WK_CMD_LEFT",e[e.MAC_WK_CMD_RIGHT=93]="MAC_WK_CMD_RIGHT",e[e.WIN_IME=229]="WIN_IME",e[e.VK_NONAME=252]="VK_NONAME",e[e.PHANTOM=255]="PHANTOM"})(Ye||(Ye={}));var yo={};yo.arc=vt,yo.curve=Xt,yo.line=Yi,yo.lineOnAxis=De,yo.lineTo=Hs,yo.moveBy=pt,yo.moveTo=St,yo.point=Me;var mt={};mt.Coordinate=ye,mt.KeyCodes=Ye,mt.Rect=rt,mt.Size=Xe,mt.Svg=J,mt.aria=fr,mt.array=Lb,mt.browserEvents=go,mt.colour=ps,mt.deprecation=mb,mt.dom=Dt,mt.extensions=As,mt.idGenerator=mh,mt.math=$l,mt.object=yv,mt.parsing=Tr,mt.string=nn,mt.style=Mo,mt.svgMath=ui,mt.svgPaths=yo,mt.toolbox=Lo,mt.userAgent=FC,mt.xml=Xi;var kv=class extends nt{constructor(e,t,o){super(e,t,o),this.workspace=e,this.anchor=t,this.ownerRect=o,this.resizePointerMoveListener=this.resizePointerUpListener=null,this.textChangeListeners=[],this.sizeChangeListeners=[],this.text="",this.DEFAULT_SIZE=new Xe(160+nt.DOUBLE_BORDER,80+nt.DOUBLE_BORDER),this.MIN_SIZE=new Xe(45+nt.DOUBLE_BORDER,20+nt.DOUBLE_BORDER),this.editable=!0,Oe(this.svgRoot,"blocklyTextInputBubble"),{inputRoot:this.inputRoot,textArea:this.textArea}=this.createEditor(this.contentContainer),this.resizeGroup=this.createResizeHandle(this.svgRoot,e),this.setSize(this.DEFAULT_SIZE,!0)}getText(){return this.text}setText(e){this.text=e,this.textArea.value=e,this.onTextChange()}setEditable(e){(this.editable=e)?this.textArea.removeAttribute("readonly"):this.textArea.setAttribute("readonly","")}isEditable(){return this.editable}addTextChangeListener(e){this.textChangeListeners.push(e)}addSizeChangeListener(e){this.sizeChangeListeners.push(e)}createEditor(e){e=ie(J.FOREIGNOBJECT,{x:nt.BORDER_WIDTH,y:nt.BORDER_WIDTH},e);const t=document.createElementNS(Gs,"body");t.setAttribute("xmlns",Gs),t.className="blocklyMinimalBody";const o=document.createElementNS(Gs,"textarea");return o.className="blocklyTextarea blocklyText",o.setAttribute("dir",this.workspace.RTL?"RTL":"LTR"),t.appendChild(o),e.appendChild(t),this.bindTextAreaEvents(o),setTimeout(()=>{o.focus()},0),{inputRoot:e,textArea:o}}bindTextAreaEvents(e){H(e,"wheel",this,t=>{t.stopPropagation()}),H(e,"focus",this,this.onStartEdit,!0),H(e,"change",this,this.onTextChange)}createResizeHandle(e,t){return e=ie(J.IMAGE,{class:"blocklyResizeHandle",href:`${t.options.pathToMedia}resize-handle.svg`},e),H(e,"pointerdown",this,this.onResizePointerDown),e}setSize(e,t=!1){e.width=Math.max(e.width,this.MIN_SIZE.width),e.height=Math.max(e.height,this.MIN_SIZE.height);const o=e.width-nt.DOUBLE_BORDER,n=e.height-nt.DOUBLE_BORDER;this.inputRoot.setAttribute("width",`${o}`),this.inputRoot.setAttribute("height",`${n}`),this.resizeGroup.setAttribute("y",`${n}`),this.workspace.RTL?this.resizeGroup.setAttribute("x",`${-nt.DOUBLE_BORDER}`):this.resizeGroup.setAttribute("x",`${o}`),super.setSize(e,t),this.onSizeChange()}getSize(){return super.getSize()}onResizePointerDown(e){this.bringToFront(),pe(e)||(za(this.workspace,e,new ye(this.workspace.RTL?-this.getSize().width:this.getSize().width,this.getSize().height)),this.resizePointerUpListener=H(document,"pointerup",this,this.onResizePointerUp),this.resizePointerMoveListener=H(document,"pointermove",this,this.onResizePointerMove),this.workspace.hideChaff()),e.stopPropagation()}onResizePointerUp(e){Y(),this.resizePointerUpListener&&(V(this.resizePointerUpListener),this.resizePointerUpListener=null),this.resizePointerMoveListener&&(V(this.resizePointerMoveListener),this.resizePointerMoveListener=null)}onResizePointerMove(e){e=Ua(this.workspace,e),this.setSize(new Xe(this.workspace.RTL?-e.x:e.x,e.y),!1),this.onSizeChange()}onStartEdit(){this.bringToFront()&&this.textArea.focus()}onTextChange(){this.text=this.textArea.value;for(const e of this.textChangeListeners)e()}onSizeChange(){for(const e of this.sizeChangeListeners)e()}};Be(` + Found: ${n}`))}if(t)throw TypeError("Found invalid FieldDropdown options.")}};es.CHECKMARK_OVERHANG=25,es.MAX_MENU_HEIGHT_VH=.45,es.ARROW_CHAR="▾",es.IMAGE_Y_OFFSET=5,es.IMAGE_Y_PADDING=2*es.IMAGE_Y_OFFSET,Us("field_dropdown",es);var wv=class{constructor(e,t){this.bubble=e,this.workspace=t,this.startLoc=null,this.inGroup=!1}isMovable(){return!0}startDrag(){(this.inGroup=!!i.getGroup$$module$build$src$core$events$utils())||i.setGroup$$module$build$src$core$events$utils(!0),this.startLoc=this.bubble.getRelativeToSurfaceXY(),this.workspace.setResizesEnabled(!1);let e;(e=this.workspace.getLayerManager())==null||e.moveToDragLayer(this.bubble),this.bubble.setDragging&&this.bubble.setDragging(!0)}drag(e){this.bubble.moveDuringDrag(e)}endDrag(){this.workspace.setResizesEnabled(!0),this.inGroup||i.setGroup$$module$build$src$core$events$utils(!1);let e;(e=this.workspace.getLayerManager())==null||e.moveOffDragLayer(this.bubble,Sl),this.bubble.setDragging(!1)}revertDrag(){this.startLoc&&this.bubble.moveDuringDrag(this.startLoc)}},rs,nt=class{constructor(e,t,o){this.workspace=e,this.anchor=t,this.ownerRect=o,this.size=new Xe(0,0),this.colour="#ffffff",this.disposed=!1,this.relativeLeft=this.relativeTop=0,this.dragStrategy=new wv(this,this.workspace),this.id=v(),this.svgRoot=ie(J.G,{class:"blocklyBubble"},e.getBubbleCanvas()),e=ie(J.G,{filter:`url(#${this.workspace.getRenderer().getConstants().embossFilterId})`},this.svgRoot),this.tail=ie(J.PATH,{class:"blocklyBubbleTail"},e),this.background=ie(J.RECT,{class:"blocklyDraggable",x:0,y:0,rx:rs.BORDER_WIDTH,ry:rs.BORDER_WIDTH},e),this.contentContainer=ie(J.G,{},this.svgRoot),H(this.background,"pointerdown",this,this.onMouseDown)}dispose(){Ze(this.svgRoot),this.disposed=!0}setAnchorLocation(e,t=!1){this.anchor=e,t?this.positionByRect(this.ownerRect):this.positionRelativeToAnchor(),this.renderTail()}setPositionRelativeToAnchor(e,t){this.relativeLeft=e,this.relativeTop=t,this.positionRelativeToAnchor(),this.renderTail()}getSize(){return this.size}setSize(e,t=!1){e.width=Math.max(e.width,rs.MIN_SIZE),e.height=Math.max(e.height,rs.MIN_SIZE),this.size=e,this.background.setAttribute("width",`${e.width}`),this.background.setAttribute("height",`${e.height}`),t?this.positionByRect(this.ownerRect):this.positionRelativeToAnchor(),this.renderTail()}getColour(){return this.colour}setColour(e){this.colour=e,this.tail.setAttribute("fill",e),this.background.setAttribute("fill",e)}onMouseDown(e){let t;(t=this.workspace.getGesture(e))==null||t.handleBubbleStart(e,this),this.bringToFront(),i.setSelected$$module$build$src$core$common(this)}positionRelativeToAnchor(){let e=this.anchor.x;e=this.workspace.RTL?e-(this.relativeLeft+this.size.width):e+this.relativeLeft,this.moveTo(e,this.relativeTop+this.anchor.y)}moveTo(e,t){this.svgRoot.setAttribute("transform",`translate(${e}, ${t})`)}positionByRect(e=new rt(0,0,0,0)){var t=this.workspace.getMetricsManager().getViewMetrics(!0),o=this.getOptimalRelativeLeft(t),n=this.getOptimalRelativeTop(t);const u={x:o,y:-this.size.height-this.workspace.getRenderer().getConstants().MIN_BLOCK_HEIGHT},g={x:-this.size.width-30,y:n};n={x:e.getWidth(),y:n};var I={x:o,y:e.getHeight()};o=e.getWidth()e.width)return t;if(e=this.getWorkspaceViewRect(e),this.workspace.RTL){var o=this.anchor.x-t;o-this.size.widthe.right&&(t=-(e.right-this.anchor.x))}else{o=t+this.anchor.x;const n=o+this.size.width;oe.right&&(t=e.right-this.anchor.x-this.size.width)}return t}getOptimalRelativeTop(e){let t=-this.size.height/4;if(this.size.height>e.height)return t;const o=this.anchor.y+t,n=o+this.size.height;return e=this.getWorkspaceViewRect(e),oe.bottom&&(t=e.bottom-this.anchor.y-this.size.height),t}getWorkspaceViewRect(e){const t=e.top;let o=e.top+e.height,n=e.left;return e=e.left+e.width,o-=this.getScrollbarThickness(),this.workspace.RTL?n-=this.getScrollbarThickness():e-=this.getScrollbarThickness(),new rt(t,o,n,e)}getScrollbarThickness(){return yt.scrollbarThickness/this.workspace.scale}renderTail(){const e=[];var t=this.size.width/2,o=this.size.height/2,n=-this.relativeLeft,u=-this.relativeTop;if(t===n&&o===u)e.push("M "+t+","+o);else{u-=o,n-=t,this.workspace.RTL&&(n*=-1);var g=Math.sqrt(u*u+n*n),I=Math.acos(n/g);0>u&&(I=2*Math.PI-I);var L=I+Math.PI/2;L>2*Math.PI&&(L-=2*Math.PI);var le=Math.sin(L);const dt=Math.cos(L);let ut=(this.size.width+this.size.height)/rs.TAIL_THICKNESS;ut=Math.min(ut,this.size.width,this.size.height)/4,L=1-rs.ANCHOR_RADIUS/g,n=t+L*n,u=o+L*u,L=t+ut*dt;const ts=o+ut*le;t-=ut*dt,o-=ut*le,le=Aa(this.workspace.RTL?-rs.TAIL_ANGLE:rs.TAIL_ANGLE),le=I+le,le>2*Math.PI&&(le-=2*Math.PI),I=Math.sin(le)*g/rs.TAIL_BEND,g=Math.cos(le)*g/rs.TAIL_BEND,e.push("M"+L+","+ts),e.push("C"+(L+g)+","+(ts+I)+" "+n+","+u+" "+n+","+u),e.push("C"+n+","+u+" "+(t+g)+","+(o+I)+" "+t+","+o)}e.push("z");let Ee;(Ee=this.tail)==null||Ee.setAttribute("d",e.join(" "))}bringToFront(){let e;const t=(e=this.svgRoot)==null?void 0:e.parentNode;return this.svgRoot&&(t==null?void 0:t.lastChild)!==this.svgRoot?(t==null||t.appendChild(this.svgRoot),!0):!1}getRelativeToSurfaceXY(){return new ye(this.workspace.RTL?-this.relativeLeft+this.anchor.x-this.size.width:this.anchor.x+this.relativeLeft,this.anchor.y+this.relativeTop)}getSvgRoot(){return this.svgRoot}moveDuringDrag(e){this.moveTo(e.x,e.y),this.relativeLeft=this.workspace.RTL?this.anchor.x-e.x-this.size.width:e.x-this.anchor.x,this.relativeTop=e.y-this.anchor.y,this.renderTail()}setDragging(e){}setDeleteStyle(e){}isDeletable(){return!1}showContextMenu(e){}isMovable(){return!0}startDrag(){this.dragStrategy.startDrag()}drag(e){this.dragStrategy.drag(e)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){}unselect(){}};rs=nt,nt.BORDER_WIDTH=6,nt.DOUBLE_BORDER=2*rs.BORDER_WIDTH,nt.MIN_SIZE=rs.DOUBLE_BORDER,nt.TAIL_THICKNESS=1,nt.TAIL_ANGLE=20,nt.TAIL_BEND=4,nt.ANCHOR_RADIUS=8;var vo=class extends nt{constructor(e,t,o,n){super(t,o,n),this.workspace=t,this.anchor=o,this.ownerRect=n,this.autoLayout=!0,t=new gs(e),this.validateWorkspaceOptions(t),this.svgDialog=ie(J.SVG,{x:nt.BORDER_WIDTH,y:nt.BORDER_WIDTH},this.contentContainer),e.parentWorkspace=this.workspace,this.miniWorkspace=this.newWorkspaceSvg(new gs(e)),this.miniWorkspace.internalIsMutator=!0,e=this.miniWorkspace.createDom("blocklyMutatorBackground"),this.svgDialog.appendChild(e),t.languageTree&&(e.insertBefore(this.miniWorkspace.addFlyout(J.G),this.miniWorkspace.getCanvas()),e=this.miniWorkspace.getFlyout(),e==null||e.init(this.miniWorkspace),e==null||e.show(t.languageTree)),this.miniWorkspace.addChangeListener(this.onWorkspaceChange.bind(this));let u,g;(u=this.miniWorkspace.getFlyout())==null||(g=u.getWorkspace())==null||g.addChangeListener(this.onWorkspaceChange.bind(this)),this.updateBubbleSize()}dispose(){this.miniWorkspace.dispose(),super.dispose()}getWorkspace(){return this.miniWorkspace}addWorkspaceChangeListener(e){this.miniWorkspace.addChangeListener(e)}validateWorkspaceOptions(e){if(e.hasCategories)throw Error("The miniworkspace bubble does not support toolboxes with categories");if(e.hasTrashcan)throw Error("The miniworkspace bubble does not support trashcans");if(e.zoomOptions.controls||e.zoomOptions.wheel||e.zoomOptions.pinch)throw Error("The miniworkspace bubble does not support zooming");if(e.moveOptions.scrollbars||e.moveOptions.wheel||e.moveOptions.drag)throw Error("The miniworkspace bubble does not scrolling/moving the workspace");if(e.horizontalLayout)throw Error("The miniworkspace bubble does not support horizontal layouts")}onWorkspaceChange(){this.bumpBlocksIntoBounds(),this.updateBubbleSize()}bumpBlocksIntoBounds(){if(!this.miniWorkspace.isDragging())for(const e of this.miniWorkspace.getTopBlocks(!1)){const t=e.getRelativeToSurfaceXY();if(20>t.y&&e.moveBy(0,20-t.y),e.RTL){let o=-20;const n=this.miniWorkspace.getFlyout();n&&(o-=n.getWidth()),t.x>o&&e.moveBy(o-t.x,0)}else 20>t.x&&e.moveBy(20-t.x,0)}}updateBubbleSize(){if(!this.miniWorkspace.isDragging()){var e=this.getSize(),t=this.calculateWorkspaceSize();Math.abs(e.width-t.width)({kind:"block",type:o}))}),t}getAnchorLocation(){const e=Ol/2;return ye.sum(this.workspaceLocation,new ye(e,e))}getBubbleOwnerRect(){const e=this.sourceBlock.getSvgRoot().getBBox();return new rt(e.y,e.y+e.height,e.x,e.x+e.width)}createRootBlock(){if(!this.sourceBlock.decompose)throw Error("Blocks with mutator icons must include a decompose method");this.rootBlock=this.sourceBlock.decompose(this.miniWorkspaceBubble.getWorkspace());for(var e of this.rootBlock.getDescendants(!1))e.queueRender();this.rootBlock.setMovable(!1),this.rootBlock.setDeletable(!1);let t,o,n,u;e=(u=(t=this.miniWorkspaceBubble)==null||(o=t.getWorkspace())==null||(n=o.getFlyout())==null?void 0:n.getWidth())!=null?u:0,this.rootBlock.moveBy(this.rootBlock.RTL?-(e+Nl):Nl,Nl)}addSaveConnectionsListener(){this.sourceBlock.saveConnections&&this.rootBlock&&(this.saveConnectionsListener=()=>{this.sourceBlock.saveConnections&&this.rootBlock&&this.sourceBlock.saveConnections(this.rootBlock)},this.saveConnectionsListener(),this.sourceBlock.workspace.addChangeListener(this.saveConnectionsListener))}createMiniWorkspaceChangeListener(){return e=>{i.MutatorIcon$$module$build$src$core$icons$mutator_icon.isIgnorableMutatorEvent(e)||this.updateWorkspacePid||(this.updateWorkspacePid=setTimeout(()=>{this.updateWorkspacePid=null,this.recomposeSourceBlock()},0))}}static isIgnorableMutatorEvent(e){return e.isUiEvent||$(e)||T(e)&&e.element==="disabled"}recomposeSourceBlock(){if(this.rootBlock){if(!this.sourceBlock.compose)throw Error("Blocks with mutator icons must include a compose method");var e=i.getGroup$$module$build$src$core$events$utils();e||i.setGroup$$module$build$src$core$events$utils(!0);var t=mi.getExtraBlockState_(this.sourceBlock);this.sourceBlock.compose(this.rootBlock);var o=mi.getExtraBlockState_(this.sourceBlock);t!==o&&z(new(ne(ee.BLOCK_CHANGE))(this.sourceBlock,"mutation",null,t,o)),i.setGroup$$module$build$src$core$events$utils(e)}}getWorkspace(){let e;return(e=this.miniWorkspaceBubble)==null?void 0:e.getWorkspace()}},i.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE=Ct.MUTATOR,i.MutatorIcon$$module$build$src$core$icons$mutator_icon.WEIGHT=1,i.MutatorIcon$$module$build$src$core$icons$mutator_icon;var dn=Object.create(null),QC={allExtensions:dn};i.register$$module$build$src$core$extensions("parent_tooltip_when_inline",R$);var As={TEST_ONLY:QC};As.apply=Va,As.buildTooltipForDropdown=i.buildTooltipForDropdown$$module$build$src$core$extensions,As.buildTooltipWithFieldText=i.buildTooltipWithFieldText$$module$build$src$core$extensions,As.isRegistered=kd,As.register=i.register$$module$build$src$core$extensions,As.registerMixin=i.registerMixin$$module$build$src$core$extensions,As.registerMutator=i.registerMutator$$module$build$src$core$extensions,As.runAfterPageLoad=D$,As.unregister=T$;var Ye;(function(e){e[e.WIN_KEY_FF_LINUX=0]="WIN_KEY_FF_LINUX",e[e.MAC_ENTER=3]="MAC_ENTER",e[e.BACKSPACE=8]="BACKSPACE",e[e.TAB=9]="TAB",e[e.NUM_CENTER=12]="NUM_CENTER",e[e.ENTER=13]="ENTER",e[e.SHIFT=16]="SHIFT",e[e.CTRL=17]="CTRL",e[e.ALT=18]="ALT",e[e.PAUSE=19]="PAUSE",e[e.CAPS_LOCK=20]="CAPS_LOCK",e[e.ESC=27]="ESC",e[e.SPACE=32]="SPACE",e[e.PAGE_UP=33]="PAGE_UP",e[e.PAGE_DOWN=34]="PAGE_DOWN",e[e.END=35]="END",e[e.HOME=36]="HOME",e[e.LEFT=37]="LEFT",e[e.UP=38]="UP",e[e.RIGHT=39]="RIGHT",e[e.DOWN=40]="DOWN",e[e.PLUS_SIGN=43]="PLUS_SIGN",e[e.PRINT_SCREEN=44]="PRINT_SCREEN",e[e.INSERT=45]="INSERT",e[e.DELETE=46]="DELETE",e[e.ZERO=48]="ZERO",e[e.ONE=49]="ONE",e[e.TWO=50]="TWO",e[e.THREE=51]="THREE",e[e.FOUR=52]="FOUR",e[e.FIVE=53]="FIVE",e[e.SIX=54]="SIX",e[e.SEVEN=55]="SEVEN",e[e.EIGHT=56]="EIGHT",e[e.NINE=57]="NINE",e[e.FF_SEMICOLON=59]="FF_SEMICOLON",e[e.FF_EQUALS=61]="FF_EQUALS",e[e.FF_DASH=173]="FF_DASH",e[e.FF_HASH=163]="FF_HASH",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.AT_SIGN=64]="AT_SIGN",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.META=91]="META",e[e.WIN_KEY_RIGHT=92]="WIN_KEY_RIGHT",e[e.CONTEXT_MENU=93]="CONTEXT_MENU",e[e.NUM_ZERO=96]="NUM_ZERO",e[e.NUM_ONE=97]="NUM_ONE",e[e.NUM_TWO=98]="NUM_TWO",e[e.NUM_THREE=99]="NUM_THREE",e[e.NUM_FOUR=100]="NUM_FOUR",e[e.NUM_FIVE=101]="NUM_FIVE",e[e.NUM_SIX=102]="NUM_SIX",e[e.NUM_SEVEN=103]="NUM_SEVEN",e[e.NUM_EIGHT=104]="NUM_EIGHT",e[e.NUM_NINE=105]="NUM_NINE",e[e.NUM_MULTIPLY=106]="NUM_MULTIPLY",e[e.NUM_PLUS=107]="NUM_PLUS",e[e.NUM_MINUS=109]="NUM_MINUS",e[e.NUM_PERIOD=110]="NUM_PERIOD",e[e.NUM_DIVISION=111]="NUM_DIVISION",e[e.F1=112]="F1",e[e.F2=113]="F2",e[e.F3=114]="F3",e[e.F4=115]="F4",e[e.F5=116]="F5",e[e.F6=117]="F6",e[e.F7=118]="F7",e[e.F8=119]="F8",e[e.F9=120]="F9",e[e.F10=121]="F10",e[e.F11=122]="F11",e[e.F12=123]="F12",e[e.NUMLOCK=144]="NUMLOCK",e[e.SCROLL_LOCK=145]="SCROLL_LOCK",e[e.FIRST_MEDIA_KEY=166]="FIRST_MEDIA_KEY",e[e.LAST_MEDIA_KEY=183]="LAST_MEDIA_KEY",e[e.SEMICOLON=186]="SEMICOLON",e[e.DASH=189]="DASH",e[e.EQUALS=187]="EQUALS",e[e.COMMA=188]="COMMA",e[e.PERIOD=190]="PERIOD",e[e.SLASH=191]="SLASH",e[e.APOSTROPHE=192]="APOSTROPHE",e[e.TILDE=192]="TILDE",e[e.SINGLE_QUOTE=222]="SINGLE_QUOTE",e[e.OPEN_SQUARE_BRACKET=219]="OPEN_SQUARE_BRACKET",e[e.BACKSLASH=220]="BACKSLASH",e[e.CLOSE_SQUARE_BRACKET=221]="CLOSE_SQUARE_BRACKET",e[e.WIN_KEY=224]="WIN_KEY",e[e.MAC_FF_META=224]="MAC_FF_META",e[e.MAC_WK_CMD_LEFT=91]="MAC_WK_CMD_LEFT",e[e.MAC_WK_CMD_RIGHT=93]="MAC_WK_CMD_RIGHT",e[e.WIN_IME=229]="WIN_IME",e[e.VK_NONAME=252]="VK_NONAME",e[e.PHANTOM=255]="PHANTOM"})(Ye||(Ye={}));var yo={};yo.arc=vt,yo.curve=Zt,yo.line=Yi,yo.lineOnAxis=De,yo.lineTo=Hs,yo.moveBy=pt,yo.moveTo=St,yo.point=Me;var mt={};mt.Coordinate=ye,mt.KeyCodes=Ye,mt.Rect=rt,mt.Size=Xe,mt.Svg=J,mt.aria=fr,mt.array=Lb,mt.browserEvents=go,mt.colour=ps,mt.deprecation=mb,mt.dom=Dt,mt.extensions=As,mt.idGenerator=mh,mt.math=$l,mt.object=yv,mt.parsing=Tr,mt.string=nn,mt.style=Mo,mt.svgMath=ui,mt.svgPaths=yo,mt.toolbox=Lo,mt.userAgent=jC,mt.xml=Xi;var kv=class extends nt{constructor(e,t,o){super(e,t,o),this.workspace=e,this.anchor=t,this.ownerRect=o,this.resizePointerMoveListener=this.resizePointerUpListener=null,this.textChangeListeners=[],this.sizeChangeListeners=[],this.text="",this.DEFAULT_SIZE=new Xe(160+nt.DOUBLE_BORDER,80+nt.DOUBLE_BORDER),this.MIN_SIZE=new Xe(45+nt.DOUBLE_BORDER,20+nt.DOUBLE_BORDER),this.editable=!0,Re(this.svgRoot,"blocklyTextInputBubble"),{inputRoot:this.inputRoot,textArea:this.textArea}=this.createEditor(this.contentContainer),this.resizeGroup=this.createResizeHandle(this.svgRoot,e),this.setSize(this.DEFAULT_SIZE,!0)}getText(){return this.text}setText(e){this.text=e,this.textArea.value=e,this.onTextChange()}setEditable(e){(this.editable=e)?this.textArea.removeAttribute("readonly"):this.textArea.setAttribute("readonly","")}isEditable(){return this.editable}addTextChangeListener(e){this.textChangeListeners.push(e)}addSizeChangeListener(e){this.sizeChangeListeners.push(e)}createEditor(e){e=ie(J.FOREIGNOBJECT,{x:nt.BORDER_WIDTH,y:nt.BORDER_WIDTH},e);const t=document.createElementNS(Gs,"body");t.setAttribute("xmlns",Gs),t.className="blocklyMinimalBody";const o=document.createElementNS(Gs,"textarea");return o.className="blocklyTextarea blocklyText",o.setAttribute("dir",this.workspace.RTL?"RTL":"LTR"),t.appendChild(o),e.appendChild(t),this.bindTextAreaEvents(o),setTimeout(()=>{o.focus()},0),{inputRoot:e,textArea:o}}bindTextAreaEvents(e){H(e,"wheel",this,t=>{t.stopPropagation()}),H(e,"focus",this,this.onStartEdit,!0),H(e,"change",this,this.onTextChange)}createResizeHandle(e,t){return e=ie(J.IMAGE,{class:"blocklyResizeHandle",href:`${t.options.pathToMedia}resize-handle.svg`},e),H(e,"pointerdown",this,this.onResizePointerDown),e}setSize(e,t=!1){e.width=Math.max(e.width,this.MIN_SIZE.width),e.height=Math.max(e.height,this.MIN_SIZE.height);const o=e.width-nt.DOUBLE_BORDER,n=e.height-nt.DOUBLE_BORDER;this.inputRoot.setAttribute("width",`${o}`),this.inputRoot.setAttribute("height",`${n}`),this.resizeGroup.setAttribute("y",`${n}`),this.workspace.RTL?this.resizeGroup.setAttribute("x",`${-nt.DOUBLE_BORDER}`):this.resizeGroup.setAttribute("x",`${o}`),super.setSize(e,t),this.onSizeChange()}getSize(){return super.getSize()}onResizePointerDown(e){this.bringToFront(),pe(e)||(za(this.workspace,e,new ye(this.workspace.RTL?-this.getSize().width:this.getSize().width,this.getSize().height)),this.resizePointerUpListener=H(document,"pointerup",this,this.onResizePointerUp),this.resizePointerMoveListener=H(document,"pointermove",this,this.onResizePointerMove),this.workspace.hideChaff()),e.stopPropagation()}onResizePointerUp(e){Y(),this.resizePointerUpListener&&(V(this.resizePointerUpListener),this.resizePointerUpListener=null),this.resizePointerMoveListener&&(V(this.resizePointerMoveListener),this.resizePointerMoveListener=null)}onResizePointerMove(e){e=Ua(this.workspace,e),this.setSize(new Xe(this.workspace.RTL?-e.x:e.x,e.y),!1),this.onSizeChange()}onStartEdit(){this.bringToFront()&&this.textArea.focus()}onTextChange(){this.text=this.textArea.value;for(const e of this.textChangeListeners)e()}onSizeChange(){for(const e of this.sizeChangeListeners)e()}};Be(` .blocklyTextInputBubble .blocklyTextarea { background-color: var(--commentFillColour); border: 0; @@ -855,13 +855,13 @@ children`),this.state=e}},nv=class extends en{constructor(e,t,o){super(`Cannot a width: 100%; height: 100%; } -`);var op={};op.register=Sd,op.unregister=R$;var ip=17,Cv=160,Tv=80,_o=class extends Ol{constructor(e){super(e),this.sourceBlock=e,this.textInputBubble=null,this.text="",this.bubbleSize=new Xe(Cv,Tv),this.bubbleVisiblity=!1}getType(){return _o.TYPE}initView(e){this.svgRoot||(super.initView(e),ie(J.CIRCLE,{class:"blocklyIconShape",r:"8",cx:"8",cy:"8"},this.svgRoot),ie(J.PATH,{class:"blocklyIconSymbol",d:"m6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.4050.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25-1.201,0.998 -1.201,1.528 -1.204,2.19z"},this.svgRoot),ie(J.RECT,{class:"blocklyIconSymbol",x:"6.8",y:"10.78",height:"2",width:"2"},this.svgRoot),Oe(this.svgRoot,"blockly-icon-comment"))}dispose(){super.dispose();let e;(e=this.textInputBubble)==null||e.dispose()}getWeight(){return _o.WEIGHT}getSize(){return new Xe(ip,ip)}applyColour(){super.applyColour();const e=this.sourceBlock.getColour();let t;(t=this.textInputBubble)==null||t.setColour(e)}updateEditable(){const e=this,t=()=>super.updateEditable;return ge.asyncExecutePromiseGeneratorFunction(function*(){t().call(e),e.bubbleIsVisible()&&(yield e.setBubbleVisible(!1),yield e.setBubbleVisible(!0))})}onLocationChange(e){super.onLocationChange(e),e=this.getAnchorLocation();let t;(t=this.textInputBubble)==null||t.setAnchorLocation(e)}setText(e){const t=this.text;z(new(ne(ee.BLOCK_CHANGE))(this.sourceBlock,"comment",null,t,e)),this.text=e;let o;(o=this.textInputBubble)==null||o.setText(this.text)}getText(){return this.text}setBubbleSize(e){this.bubbleSize=e;let t;(t=this.textInputBubble)==null||t.setSize(this.bubbleSize,!0)}getBubbleSize(){return this.bubbleSize}saveState(){return this.text?{text:this.text,pinned:this.bubbleIsVisible(),height:this.bubbleSize.height,width:this.bubbleSize.width}:null}loadState(e){let t;this.text=(t=e.text)!=null?t:"";let o,n;this.bubbleSize=new Xe((o=e.width)!=null?o:Cv,(n=e.height)!=null?n:Tv);let u;this.bubbleVisiblity=(u=e.pinned)!=null?u:!1,this.setBubbleVisible(this.bubbleVisiblity)}onClick(){super.onClick(),this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}onTextChange(){if(this.textInputBubble){var e=this.textInputBubble.getText();this.text!==e&&(z(new(ne(ee.BLOCK_CHANGE))(this.sourceBlock,"comment",null,this.text,e)),this.text=e)}}onSizeChange(){this.textInputBubble&&(this.bubbleSize=this.textInputBubble.getSize())}bubbleIsVisible(){return this.bubbleVisiblity}setBubbleVisible(e){const t=this;return ge.asyncExecutePromiseGeneratorFunction(function*(){t.bubbleVisiblity!==e&&(t.bubbleVisiblity=e,yield Ts(),!t.sourceBlock.rendered||t.sourceBlock.isInFlyout||t.sourceBlock.isInsertionMarker()||(e?(t.sourceBlock.isEditable()?t.showEditableBubble():t.showNonEditableBubble(),t.applyColour()):t.hideBubble(),z(new(ne(ee.BUBBLE_OPEN))(t.sourceBlock,e,"comment"))))})}showEditableBubble(){this.createBubble();let e;(e=this.textInputBubble)==null||e.addTextChangeListener(()=>this.onTextChange());let t;(t=this.textInputBubble)==null||t.addSizeChangeListener(()=>this.onSizeChange())}showNonEditableBubble(){this.createBubble();let e;(e=this.textInputBubble)==null||e.setEditable(!1)}createBubble(){this.textInputBubble=new kv(this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect()),this.textInputBubble.setText(this.getText()),this.textInputBubble.setSize(this.bubbleSize,!0)}hideBubble(){let e;(e=this.textInputBubble)==null||e.dispose(),this.textInputBubble=null}getAnchorLocation(){const e=ip/2;return ye.sum(this.workspaceLocation,new ye(e,e))}getBubbleOwnerRect(){return this.sourceBlock.getBoundingRectangleWithoutChildren()}};_o.TYPE=Ct.COMMENT,_o.WEIGHT=3,Sd(_o.TYPE,_o);var Sv=class extends Error{constructor(e){super(`Tried to append an icon of type ${e.getType()} when an icon of that type already exists on the block. Use getIcon to access the existing icon.`),this.icon=e}},Ev={};Ev.DuplicateIconType=Sv;var Iv=class extends nt{constructor(e,t,o,n){super(t,o,n),this.text=e,this.workspace=t,this.anchor=o,this.ownerRect=n,this.paragraph=this.stringToSvg(e,this.contentContainer),this.updateBubbleSize()}getText(){return this.text}setText(e){this.text=e,Ze(this.paragraph),this.paragraph=this.stringToSvg(e,this.contentContainer),this.updateBubbleSize()}stringToSvg(e,t){return t=this.createParagraph(t),e=this.createTextFragments(t,e),this.workspace.RTL&&this.rightAlignTextFragments(t.getBBox().width,e),t}createParagraph(e){return ie(J.G,{class:"blocklyText blocklyBubbleText blocklyNoPointerEvents",transform:`translate(0,${nt.BORDER_WIDTH})`,style:`direction: ${this.workspace.RTL?"rtl":"ltr"}`},e)}createTextFragments(e,t){let o=1;return t.split(` -`).map(n=>{const u=ie(J.TEXT,{y:`${o}em`,x:nt.BORDER_WIDTH},e);return n=document.createTextNode(n),u.appendChild(n),o+=1,u})}rightAlignTextFragments(e,t){for(const o of t)o.setAttribute("text-anchor","start"),o.setAttribute("x",`${e+nt.BORDER_WIDTH}`)}updateBubbleSize(){const e=this.paragraph.getBBox();this.setSize(new Xe(e.width+2*nt.BORDER_WIDTH,e.height+2*nt.BORDER_WIDTH),!0)}},np=17,wo=class extends Ol{constructor(e){super(e),this.sourceBlock=e,this.textMap=new Map,this.textBubble=null}getType(){return wo.TYPE}initView(e){this.svgRoot||(super.initView(e),ie(J.PATH,{class:"blocklyIconShape",d:"M2,15Q-1,15 0.5,12L6.5,1.7Q8,-1 9.5,1.7L15.5,12Q17,15 14,15z"},this.svgRoot),ie(J.PATH,{class:"blocklyIconSymbol",d:"m7,4.8v3.16l0.27,2.27h1.46l0.27,-2.27v-3.16z"},this.svgRoot),ie(J.RECT,{class:"blocklyIconSymbol",x:"7",y:"11",height:"2",width:"2"},this.svgRoot),Oe(this.svgRoot,"blockly-icon-warning"))}dispose(){super.dispose();let e;(e=this.textBubble)==null||e.dispose()}getWeight(){return wo.WEIGHT}getSize(){return new Xe(np,np)}applyColour(){super.applyColour();let e;(e=this.textBubble)==null||e.setColour(this.sourceBlock.getColour())}updateCollapsed(){}isShownWhenCollapsed(){return!0}onLocationChange(e){super.onLocationChange(e);let t;(t=this.textBubble)==null||t.setAnchorLocation(this.getAnchorLocation())}addMessage(e,t){if(this.textMap.get(t)===e)return this;e?this.textMap.set(t,e):this.textMap.delete(t);let o;return(o=this.textBubble)==null||o.setText(this.getText()),this}getText(){return[...this.textMap.values()].join(` -`)}onClick(){super.onClick(),this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}bubbleIsVisible(){return!!this.textBubble}setBubbleVisible(e){const t=this;return ge.asyncExecutePromiseGeneratorFunction(function*(){if(t.bubbleIsVisible()!==e){if(yield Ts(),e)t.textBubble=new Iv(t.getText(),t.sourceBlock.workspace,t.getAnchorLocation(),t.getBubbleOwnerRect()),t.applyColour();else{let o;(o=t.textBubble)==null||o.dispose(),t.textBubble=null}z(new(ne(ee.BUBBLE_OPEN))(t.sourceBlock,e,"warning"))}})}getAnchorLocation(){const e=np/2;return ye.sum(this.workspaceLocation,new ye(e,e))}getBubbleOwnerRect(){const e=this.sourceBlock.getSvgRoot().getBBox();return new rt(e.y,e.y+e.height,e.x,e.x+e.width)}};wo.TYPE=Ct.WARNING,wo.WEIGHT=2;var jo={};jo.CommentIcon=_o,jo.Icon=Ol,jo.IconType=Ct,jo.MutatorIcon=i.MutatorIcon$$module$build$src$core$icons$mutator_icon,jo.WarningIcon=wo,jo.exceptions=Ev,jo.registry=op,i.Names$$module$build$src$core$names=class{constructor(e,t){this.db=new Map,this.dbReverse=new Set,this.variableMap=null,this.variablePrefix=t||"",this.reservedWords=new Set(e?e.split(","):[])}reset(){this.db.clear(),this.dbReverse.clear(),this.variableMap=null}setVariableMap(e){this.variableMap=e}getNameForUserVariable(e){return this.variableMap?(e=this.variableMap.getVariableById(e))?e.name:null:(console.warn(`Deprecated call to Names.prototype.getName without defining a variable map. To fix, add the following code in your generator's init() function: -Blockly.YourGeneratorName.nameDB_.setVariableMap(workspace.getVariableMap());`),null)}populateVariables(e){e=i.allUsedVarModels$$module$build$src$core$variables(e);for(let t=0;tsuper.updateEditable;return ge.asyncExecutePromiseGeneratorFunction(function*(){t().call(e),e.bubbleIsVisible()&&(yield e.setBubbleVisible(!1),yield e.setBubbleVisible(!0))})}onLocationChange(e){super.onLocationChange(e),e=this.getAnchorLocation();let t;(t=this.textInputBubble)==null||t.setAnchorLocation(e)}setText(e){const t=this.text;z(new(ne(ee.BLOCK_CHANGE))(this.sourceBlock,"comment",null,t,e)),this.text=e;let o;(o=this.textInputBubble)==null||o.setText(this.text)}getText(){return this.text}setBubbleSize(e){this.bubbleSize=e;let t;(t=this.textInputBubble)==null||t.setSize(this.bubbleSize,!0)}getBubbleSize(){return this.bubbleSize}saveState(){return this.text?{text:this.text,pinned:this.bubbleIsVisible(),height:this.bubbleSize.height,width:this.bubbleSize.width}:null}loadState(e){let t;this.text=(t=e.text)!=null?t:"";let o,n;this.bubbleSize=new Xe((o=e.width)!=null?o:Cv,(n=e.height)!=null?n:Tv);let u;this.bubbleVisiblity=(u=e.pinned)!=null?u:!1,this.setBubbleVisible(this.bubbleVisiblity)}onClick(){super.onClick(),this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}onTextChange(){if(this.textInputBubble){var e=this.textInputBubble.getText();this.text!==e&&(z(new(ne(ee.BLOCK_CHANGE))(this.sourceBlock,"comment",null,this.text,e)),this.text=e)}}onSizeChange(){this.textInputBubble&&(this.bubbleSize=this.textInputBubble.getSize())}bubbleIsVisible(){return this.bubbleVisiblity}setBubbleVisible(e){const t=this;return ge.asyncExecutePromiseGeneratorFunction(function*(){t.bubbleVisiblity!==e&&(t.bubbleVisiblity=e,yield Ts(),!t.sourceBlock.rendered||t.sourceBlock.isInFlyout||t.sourceBlock.isInsertionMarker()||(e?(t.sourceBlock.isEditable()?t.showEditableBubble():t.showNonEditableBubble(),t.applyColour()):t.hideBubble(),z(new(ne(ee.BUBBLE_OPEN))(t.sourceBlock,e,"comment"))))})}showEditableBubble(){this.createBubble();let e;(e=this.textInputBubble)==null||e.addTextChangeListener(()=>this.onTextChange());let t;(t=this.textInputBubble)==null||t.addSizeChangeListener(()=>this.onSizeChange())}showNonEditableBubble(){this.createBubble();let e;(e=this.textInputBubble)==null||e.setEditable(!1)}createBubble(){this.textInputBubble=new kv(this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect()),this.textInputBubble.setText(this.getText()),this.textInputBubble.setSize(this.bubbleSize,!0)}hideBubble(){let e;(e=this.textInputBubble)==null||e.dispose(),this.textInputBubble=null}getAnchorLocation(){const e=ip/2;return ye.sum(this.workspaceLocation,new ye(e,e))}getBubbleOwnerRect(){return this.sourceBlock.getBoundingRectangleWithoutChildren()}};_o.TYPE=Ct.COMMENT,_o.WEIGHT=3,Sd(_o.TYPE,_o);var Sv=class extends Error{constructor(e){super(`Tried to append an icon of type ${e.getType()} when an icon of that type already exists on the block. Use getIcon to access the existing icon.`),this.icon=e}},Ev={};Ev.DuplicateIconType=Sv;var Iv=class extends nt{constructor(e,t,o,n){super(t,o,n),this.text=e,this.workspace=t,this.anchor=o,this.ownerRect=n,this.paragraph=this.stringToSvg(e,this.contentContainer),this.updateBubbleSize()}getText(){return this.text}setText(e){this.text=e,Ze(this.paragraph),this.paragraph=this.stringToSvg(e,this.contentContainer),this.updateBubbleSize()}stringToSvg(e,t){return t=this.createParagraph(t),e=this.createTextFragments(t,e),this.workspace.RTL&&this.rightAlignTextFragments(t.getBBox().width,e),t}createParagraph(e){return ie(J.G,{class:"blocklyText blocklyBubbleText blocklyNoPointerEvents",transform:`translate(0,${nt.BORDER_WIDTH})`,style:`direction: ${this.workspace.RTL?"rtl":"ltr"}`},e)}createTextFragments(e,t){let o=1;return t.split(` +`).map(n=>{const u=ie(J.TEXT,{y:`${o}em`,x:nt.BORDER_WIDTH},e);return n=document.createTextNode(n),u.appendChild(n),o+=1,u})}rightAlignTextFragments(e,t){for(const o of t)o.setAttribute("text-anchor","start"),o.setAttribute("x",`${e+nt.BORDER_WIDTH}`)}updateBubbleSize(){const e=this.paragraph.getBBox();this.setSize(new Xe(e.width+2*nt.BORDER_WIDTH,e.height+2*nt.BORDER_WIDTH),!0)}},np=17,wo=class extends Rl{constructor(e){super(e),this.sourceBlock=e,this.textMap=new Map,this.textBubble=null}getType(){return wo.TYPE}initView(e){this.svgRoot||(super.initView(e),ie(J.PATH,{class:"blocklyIconShape",d:"M2,15Q-1,15 0.5,12L6.5,1.7Q8,-1 9.5,1.7L15.5,12Q17,15 14,15z"},this.svgRoot),ie(J.PATH,{class:"blocklyIconSymbol",d:"m7,4.8v3.16l0.27,2.27h1.46l0.27,-2.27v-3.16z"},this.svgRoot),ie(J.RECT,{class:"blocklyIconSymbol",x:"7",y:"11",height:"2",width:"2"},this.svgRoot),Re(this.svgRoot,"blockly-icon-warning"))}dispose(){super.dispose();let e;(e=this.textBubble)==null||e.dispose()}getWeight(){return wo.WEIGHT}getSize(){return new Xe(np,np)}applyColour(){super.applyColour();let e;(e=this.textBubble)==null||e.setColour(this.sourceBlock.getColour())}updateCollapsed(){}isShownWhenCollapsed(){return!0}onLocationChange(e){super.onLocationChange(e);let t;(t=this.textBubble)==null||t.setAnchorLocation(this.getAnchorLocation())}addMessage(e,t){if(this.textMap.get(t)===e)return this;e?this.textMap.set(t,e):this.textMap.delete(t);let o;return(o=this.textBubble)==null||o.setText(this.getText()),this}getText(){return[...this.textMap.values()].join(` +`)}onClick(){super.onClick(),this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}bubbleIsVisible(){return!!this.textBubble}setBubbleVisible(e){const t=this;return ge.asyncExecutePromiseGeneratorFunction(function*(){if(t.bubbleIsVisible()!==e){if(yield Ts(),e)t.textBubble=new Iv(t.getText(),t.sourceBlock.workspace,t.getAnchorLocation(),t.getBubbleOwnerRect()),t.applyColour();else{let o;(o=t.textBubble)==null||o.dispose(),t.textBubble=null}z(new(ne(ee.BUBBLE_OPEN))(t.sourceBlock,e,"warning"))}})}getAnchorLocation(){const e=np/2;return ye.sum(this.workspaceLocation,new ye(e,e))}getBubbleOwnerRect(){const e=this.sourceBlock.getSvgRoot().getBBox();return new rt(e.y,e.y+e.height,e.x,e.x+e.width)}};wo.TYPE=Ct.WARNING,wo.WEIGHT=2;var Fo={};Fo.CommentIcon=_o,Fo.Icon=Rl,Fo.IconType=Ct,Fo.MutatorIcon=i.MutatorIcon$$module$build$src$core$icons$mutator_icon,Fo.WarningIcon=wo,Fo.exceptions=Ev,Fo.registry=op,i.Names$$module$build$src$core$names=class{constructor(e,t){this.db=new Map,this.dbReverse=new Set,this.variableMap=null,this.variablePrefix=t||"",this.reservedWords=new Set(e?e.split(","):[])}reset(){this.db.clear(),this.dbReverse.clear(),this.variableMap=null}setVariableMap(e){this.variableMap=e}getNameForUserVariable(e){return this.variableMap?(e=this.variableMap.getVariableById(e))?e.name:null:(console.warn(`Deprecated call to Names.prototype.getName without defining a variable map. To fix, add the following code in your generator's init() function: +Blockly.YourGeneratorName.nameDB_.setVariableMap(workspace.getVariableMap());`),null)}populateVariables(e){e=i.allUsedVarModels$$module$build$src$core$variables(e);for(let t=0;trect,`,`${e} .blocklyEditableText>rect {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"fill-opacity: .6;","stroke: none;","}",`${e} .blocklyNonEditableText>text,`,`${e} .blocklyEditableText>text {`,"fill: #000;","}",`${e} .blocklyFlyoutLabelText {`,"fill: #000;","}",`${e} .blocklyText.blocklyBubbleText {`,"fill: #000;","}",`${e} .blocklyEditableText:not(.editing):hover>rect {`,"stroke: #fff;","stroke-width: 2;","}",`${e} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,"}",`${e} .blocklySelected>.blocklyPath {`,"stroke: #fc3;","stroke-width: 3px;","}",`${e} .blocklyHighlightedConnectionPath {`,"stroke: #fc3;","}",`${e} .blocklyReplaceable .blocklyPath {`,"fill-opacity: .5;","}",`${e} .blocklyReplaceable .blocklyPathLight,`,`${e} .blocklyReplaceable .blocklyPathDark {`,"display: none;","}",`${e} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"]}},Bl=class{constructor(e,t){this.inlinePath_=this.outlinePath_="",this.block_=e,this.info_=t,this.topLeft_=e.getRelativeToSurfaceXY(),this.constants_=t.getRenderer().getConstants()}draw(){this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights(),this.block_.pathObject.setPath(this.outlinePath_+` -`+this.inlinePath_),this.info_.RTL&&this.block_.pathObject.flipRTL(),this.recordSizeOnBlock_()}recordSizeOnBlock_(){this.block_.height=this.info_.height,this.block_.width=this.info_.widthWithChildren,this.block_.childlessWidth=this.info_.width}drawOutline_(){this.drawTop_();for(let e=1;ee||e>this.fieldRow.length)throw Error("index "+e+" out of bounds.");return(t||t===""&&o)&&(typeof t=="string"&&(t=i.fromJson$$module$build$src$core$field_registry({type:"field_label",text:t})),t.setSourceBlock(this.sourceBlock),this.sourceBlock.initialized&&this.initField(t),t.name=o,t.setVisible(this.isVisible()),t.prefixField&&(e=this.insertFieldAt(e,t.prefixField)),this.fieldRow.splice(e,0,t),e++,t.suffixField&&(e=this.insertFieldAt(e,t.suffixField)),this.sourceBlock.rendered&&this.sourceBlock.queueRender()),e}removeField(e,t){for(let o=0,n;n=this.fieldRow[o];o++)if(n.name===e)return n.dispose(),this.fieldRow.splice(o,1),this.sourceBlock.rendered&&this.sourceBlock.queueRender(),!0;if(t)return!1;throw Error('Field "'+e+'" not found.')}isVisible(){return this.visible}setVisible(e){let t=[];if(this.visible===e)return t;this.visible=e;for(let n=0,u;u=this.fieldRow[n];n++)u.setVisible(e);if(this.connection){var o=this.connection;e?t=o.startTrackingAll():o.stopTrackingAll(),(o=o.targetBlock())&&(o.getSvgRoot().style.display=e?"block":"none")}return t}markDirty(){for(let e=0,t;t=this.fieldRow[e];e++)t.markDirty()}setCheck(e){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setCheck(e),this}setAlign(e){return this.align=e,this.sourceBlock.rendered&&this.sourceBlock.queueRender(),this}setShadowDom(e){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setShadowDom(e),this}getShadowDom(){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.getShadowDom()}init(){for(const e of this.fieldRow)e.init()}initModel(){for(const e of this.fieldRow)e.initModel()}initField(e){this.sourceBlock.rendered?e.init():e.initModel()}dispose(){for(let e=0,t;t=this.fieldRow[e];e++)t.dispose();this.connection&&this.connection.dispose()}makeConnection(e){return this.sourceBlock.makeConnection_(e)}},Ks=class extends pn{constructor(e,t){super(e,t),this.name=e,this.type=i.inputTypes$$module$build$src$core$inputs$input_types.DUMMY}},Co=class extends pn{constructor(e,t){super(e,t),this.name=e,this.type=i.inputTypes$$module$build$src$core$inputs$input_types.END_ROW}},ls=class extends pn{constructor(e,t){if(!e)throw Error("Statement inputs must have a non-empty name");super(e,t),this.name=e,this.type=i.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT,this.connection=this.makeConnection(xe.NEXT_STATEMENT)}},Mv;i.ValueInput$$module$build$src$core$inputs$value_input=class extends pn{constructor(e,t){if(!e)throw Error("Value inputs must have a non-empty name");super(e,t),this.name=e,this.type=i.inputTypes$$module$build$src$core$inputs$input_types.VALUE,this.connection=this.makeConnection(xe.INPUT_VALUE)}},Mv={},Mv.ValueInput=i.ValueInput$$module$build$src$core$inputs$value_input;var Or=class{constructor(e,t){this.statementEdge=this.width=this.widthWithChildren=this.height=0,this.rows=[],this.inputRows=[],this.startY=this.startX=0,this.renderer_=e,this.block_=t,this.constants_=this.renderer_.getConstants(),this.outputConnection=t.outputConnection?new Rv(this.constants_,t.outputConnection):null,this.isInline=t.getInputsInline()&&!t.isCollapsed(),this.isCollapsed=t.isCollapsed(),this.isInsertionMarker=t.isInsertionMarker(),this.RTL=t.RTL,this.topRow=new dp(this.constants_),this.bottomRow=new rp(this.constants_)}getRenderer(){return this.renderer_}measure(){this.createRows_(),this.addElemSpacing_(),this.addRowSpacing_(),this.computeBounds_(),this.alignRowElements_(),this.finalize_()}createRows_(){this.populateTopRow_(),this.rows.push(this.topRow);let e=new cp(this.constants_);this.inputRows.push(e);var t=this.block_.getIcons();for(let o=0,n;n=t[o];o++){const u=new Dv(this.constants_,n);this.isCollapsed&&!n.isShownWhenCollapsed()||e.elements.push(u)}t=void 0;for(let o=0,n;n=this.block_.inputList[o];o++)if(n.isVisible()){this.shouldStartNewRow_(n,t)&&(this.rows.push(e),e=new cp(this.constants_),this.inputRows.push(e));for(let u=0,g;g=n.fieldRow[u];u++)e.elements.push(new hn(this.constants_,g,n));this.addInput_(n,e),t=n}this.isCollapsed&&(e.hasJaggedEdge=!0,e.elements.push(new Av(this.constants_))),(e.elements.length||e.hasDummyInput)&&this.rows.push(e),this.populateBottomRow_(),this.rows.push(this.bottomRow)}populateTopRow_(){var e=!!this.block_.previousConnection;const t=(this.block_.hat?this.block_.hat==="cap":this.constants_.ADD_START_HATS)&&!this.outputConnection&&!e;let o=this.topRow.hasLeftSquareCorner(this.block_)?Ar:Dr;this.topRow.elements.push(new o(this.constants_)),t?(e=new ap(this.constants_),this.topRow.elements.push(e),this.topRow.capline=e.ascenderHeight):e&&(this.topRow.hasPreviousConnection=!0,this.topRow.connection=new Nv(this.constants_,this.block_.previousConnection),this.topRow.elements.push(this.topRow.connection)),this.block_.inputList.length&&this.block_.inputList[0]instanceof ls&&!this.block_.isCollapsed()?this.topRow.minHeight=this.constants_.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT:this.topRow.minHeight=this.constants_.TOP_ROW_MIN_HEIGHT,o=this.topRow.hasRightSquareCorner(this.block_)?Ar:Dr,this.topRow.elements.push(new o(this.constants_,"right"))}populateBottomRow_(){this.bottomRow.hasNextConnection=!!this.block_.nextConnection,this.bottomRow.minHeight=this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1]instanceof ls?this.constants_.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT:this.constants_.BOTTOM_ROW_MIN_HEIGHT,this.bottomRow.hasLeftSquareCorner(this.block_)?this.bottomRow.elements.push(new Ar(this.constants_)):this.bottomRow.elements.push(new Dr(this.constants_)),this.bottomRow.hasNextConnection&&(this.bottomRow.connection=new Ov(this.constants_,this.block_.nextConnection),this.bottomRow.elements.push(this.bottomRow.connection)),this.bottomRow.hasRightSquareCorner(this.block_)?this.bottomRow.elements.push(new Ar(this.constants_,"right")):this.bottomRow.elements.push(new Dr(this.constants_,"right"))}addInput_(e,t){this.isInline&&e instanceof i.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new lp(this.constants_,e)),t.hasInlineInput=!0):e instanceof ls?(t.elements.push(new xr(this.constants_,e)),t.hasStatement=!0):e instanceof i.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new Ll(this.constants_,e)),t.hasExternalInput=!0):(e instanceof Ks||e instanceof Co)&&(t.minHeight=Math.max(t.minHeight,e.getSourceBlock()&&e.getSourceBlock().isShadow()?this.constants_.DUMMY_INPUT_SHADOW_MIN_HEIGHT:this.constants_.DUMMY_INPUT_MIN_HEIGHT),t.hasDummyInput=!0),t.align===null&&(t.align=e.align)}shouldStartNewRow_(e,t){return t?t instanceof Co||e instanceof ls||t instanceof ls?!0:e instanceof i.ValueInput$$module$build$src$core$inputs$value_input||e instanceof Ks||t instanceof i.ValueInput$$module$build$src$core$inputs$value_input?!this.isInline:!1:!1}addElemSpacing_(){for(let e=0,t;t=this.rows[e];e++){const o=t.elements;if(t.elements=[],t.startsWithElemSpacer()&&t.elements.push(new as(this.constants_,this.getInRowSpacing_(null,o[0]))),o.length){for(let n=0;ne.disposeInternal()),this.inputList.forEach(e=>e.dispose()),this.inputList.length=0,this.getConnections_(!0).forEach(e=>e.dispose()),this.disposed=!0}isDeadOrDying(){return this.disposing||this.disposed}initModel(){if(!this.initialized){for(const e of this.inputList)e.initModel();this.initialized=!0}}unplug(e){this.outputConnection&&this.unplugFromRow(e),this.previousConnection&&this.unplugFromStack(e)}unplugFromRow(e){let t=null,o;(o=this.outputConnection)!=null&&o.isConnected()&&(t=this.outputConnection.targetConnection,this.outputConnection.disconnect()),t&&e&&(e=this.getOnlyValueConnection())&&e.isConnected()&&!e.targetBlock().isShadow()&&(e=e.targetConnection,e==null||e.disconnect(),this.workspace.connectionChecker.canConnect(e,t,!1)?t.connect(e):e==null||e.onFailedConnect(t))}getOnlyValueConnection(){let e=null;for(let t=0;t(n=n+(o==="("||u===")"?"":" ")+u,o=u[u.length-1],n),""),t=t.trim()||"???",e&&t.length>e&&(t=t.substring(0,e-3)+"..."),t}toTokens(e="?"){const t=[];for(const n of this.inputList)if(n.name!=$r){for(const u of n.fieldRow)t.push(u.getText());if(n.connection){const u=n.connection.targetBlock();if(u){var o=n.connection;let g=o.getCheck();!g&&o.targetConnection&&(g=o.targetConnection.getCheck()),(o=!!g&&(g.includes("Boolean")||g.includes("Number")))&&t.push("("),t.push(...u.toTokens(e)),o&&t.push(")")}else t.push(e)}}return t}appendValueInput(e){return this.appendInput(new i.ValueInput$$module$build$src$core$inputs$value_input(e,this))}appendStatementInput(e){return this.statementInputCount++,this.appendInput(new ls(e,this))}appendDummyInput(e=""){return this.appendInput(new Ks(e,this))}appendEndRowInput(e=""){return this.appendInput(new Co(e,this))}appendInput(e){return this.inputList.push(e),e}appendInputFromRegistry(e,t){return(e=p($e.INPUT,e,!1))?this.appendInput(new e(t,this)):null}jsonInit(e){var t=e.type?'Block "'+e.type+'": ':"";if(e.output&&e.previousStatement)throw Error(t+"Must not have both an output and a previousStatement.");for(var o=0;e["args"+o];){if(e["message"+o]===void 0)throw Error(t+`args${o} must have a corresponding message (message${o}).`);o++}if(e.style&&e.style.hat&&(this.hat=e.style.hat,e.style=null),e.style&&e.colour)throw Error(t+"Must not have both a colour and a style.");for(e.style?this.jsonInitStyle(e,t):this.jsonInitColour(e,t),o=0;e["message"+o]!==void 0;)this.interpolate(e["message"+o],e["args"+o]||[],e["implicitAlign"+o]||e["lastDummyAlign"+o],t),o++;if(e.inputsInline!==void 0&&(i.disable$$module$build$src$core$events$utils(),this.setInputsInline(e.inputsInline),i.enable$$module$build$src$core$events$utils()),e.output!==void 0&&this.setOutput(!0,e.output),e.outputShape!==void 0&&this.setOutputShape(e.outputShape),e.previousStatement!==void 0&&this.setPreviousStatement(!0,e.previousStatement),e.nextStatement!==void 0&&this.setNextStatement(!0,e.nextStatement),e.tooltip!==void 0&&(o=bt(e.tooltip),this.setTooltip(o)),e.enableContextMenu!==void 0&&(this.contextMenu=!!e.enableContextMenu),e.suppressPrefixSuffix!==void 0&&(this.suppressPrefixSuffix=!!e.suppressPrefixSuffix),e.helpUrl!==void 0&&(o=bt(e.helpUrl),this.setHelpUrl(o)),typeof e.extensions=="string"&&(console.warn(t+"JSON attribute 'extensions' should be an array of strings. Found raw string in JSON for '"+e.type+"' block."),e.extensions=[e.extensions]),e.mutator!==void 0&&Va(e.mutator,this,!0),e=e.extensions,Array.isArray(e))for(t=0;tg||g>t)throw Error('Block "'+this.type+'": Message index %'+g+" out of range.");if(o[g])throw Error('Block "'+this.type+'": Message index %'+g+" duplicated.");o[g]=!0,n++}}if(n!==t)throw Error('Block "'+this.type+'": Message does not reference all '+t+" arg(s).")}interpolateArguments(e,t,o){const n=[];for(let g=0;g=this.inputList.length)throw RangeError("Input index "+e+" out of bounds.");if(t>this.inputList.length)throw RangeError("Reference input "+t+" out of bounds.");const o=this.inputList[e];this.inputList.splice(e,1),et.getWeight()-o.getWeight()),e}removeIcon(e){if(!this.hasIcon(e))return!1;let t;return(t=this.getIcon(e))==null||t.dispose(),this.icons=this.icons.filter(o=>!o.getType().equals(e)),!0}hasIcon(e){return this.icons.some(t=>t.getType().equals(e))}getIcon(e){return e instanceof Ct?this.icons.find(t=>t.getType().equals(e)):this.icons.find(t=>t.getType().toString()===e)}getIcons(){return[...this.icons]}getRelativeToSurfaceXY(){return this.xy}moveBy(e,t,o){if(this.parentBlock_)throw Error("Block has parent");const n=new(ne(ee.BLOCK_MOVE))(this);o&&n.setReason(o),this.xy.translate(e,t),n.recordNew(),z(n)}makeConnection_(e){return new Qe(this,e)}allInputsFilled(e){if(e===void 0&&(e=!0),!e&&this.isShadow())return!1;for(let o=0,n;n=this.inputList[o];o++)if(n.connection){var t=n.connection.targetBlock();if(!t||!t.allInputsFilled(e))return!1}return(t=this.getNextBlock())?t.allInputsFilled(e):!0}toDevString(){let e=this.type?'"'+this.type+'" block':"Block";return this.id&&(e+=' (id="'+this.id+'")'),e}};Uo.COLLAPSED_INPUT_NAME=$r,Uo.COLLAPSED_FIELD_NAME=gl;var ms=class{constructor(e,t,o,n){this.workspace=e,this.targetWorkspace=t,this.isFlyoutLabel=n,this.onMouseUpWrapper=null,this.height=this.width=0,this.cursorSvg=this.svgText=this.svgGroup=null,this.text=o.text,this.position=new ye(0,0),this.callbackKey=o.callbackKey||o.callbackkey,this.cssClass=o["web-class"]||null,this.info=o}createDom(){var e=this.isFlyoutLabel?"blocklyFlyoutLabel":"blocklyFlyoutButton";this.cssClass&&(e+=" "+this.cssClass),this.svgGroup=ie(J.G,{class:e},this.workspace.getCanvas());let t;this.isFlyoutLabel||(t=ie(J.RECT,{class:"blocklyFlyoutButtonShadow",rx:ms.BORDER_RADIUS,ry:ms.BORDER_RADIUS,x:1,y:1},this.svgGroup)),e=ie(J.RECT,{class:this.isFlyoutLabel?"blocklyFlyoutLabelBackground":"blocklyFlyoutButtonBackground",rx:ms.BORDER_RADIUS,ry:ms.BORDER_RADIUS},this.svgGroup);const o=ie(J.TEXT,{class:this.isFlyoutLabel?"blocklyFlyoutLabelText":"blocklyText",x:0,y:0,"text-anchor":"middle"},this.svgGroup);var n=bt(this.text);this.workspace.RTL&&(n+="‏"),o.textContent=n,this.isFlyoutLabel&&(this.svgText=o,this.workspace.getThemeManager().subscribe(this.svgText,"flyoutForegroundColour","fill"));const u=Fs(o,"fontSize"),g=Fs(o,"fontWeight"),I=Fs(o,"fontFamily");if(this.width=Bs(o,u,g,I),n=ro(n,u,g,I),this.height=n.height,!this.isFlyoutLabel){this.width+=2*ms.TEXT_MARGIN_X,this.height+=2*ms.TEXT_MARGIN_Y;let L;(L=t)==null||L.setAttribute("width",String(this.width));let le;(le=t)==null||le.setAttribute("height",String(this.height))}return e.setAttribute("width",String(this.width)),e.setAttribute("height",String(this.height)),o.setAttribute("x",String(this.width/2)),o.setAttribute("y",String(this.height/2-n.height/2+n.baseline)),this.updateTransform(),this.onMouseUpWrapper=H(this.svgGroup,"pointerup",this,this.onMouseUp),this.svgGroup}show(){this.updateTransform(),this.svgGroup.setAttribute("display","block")}updateTransform(){this.svgGroup.setAttribute("transform","translate("+this.position.x+","+this.position.y+")")}moveTo(e,t){this.position.x=e,this.position.y=t,this.updateTransform()}isLabel(){return this.isFlyoutLabel}getPosition(){return this.position}getButtonText(){return this.text}getTargetWorkspace(){return this.targetWorkspace}getWorkspace(){return this.workspace}dispose(){this.onMouseUpWrapper&&V(this.onMouseUpWrapper),this.svgGroup&&Ze(this.svgGroup),this.svgText&&this.workspace.getThemeManager().unsubscribe(this.svgText)}setCursorSvg(e){e?this.svgGroup&&(this.svgGroup.appendChild(e),this.cursorSvg=e):this.cursorSvg=null}setMarkerSvg(){throw Error("Attempted to set a marker on a button.")}onMouseUp(e){(e=this.targetWorkspace.getGesture(e))&&e.cancel(),this.isFlyoutLabel&&this.callbackKey?console.warn("Labels should not have callbacks. Label text: "+this.text):this.isFlyoutLabel||this.callbackKey&&this.targetWorkspace.getButtonCallback(this.callbackKey)?this.isFlyoutLabel||(e=this.targetWorkspace.getButtonCallback(this.callbackKey))&&e(this):console.warn("Buttons should have callbacks. Button text: "+this.text)}};ms.TEXT_MARGIN_X=5,ms.TEXT_MARGIN_Y=2,ms.BORDER_RADIUS=4,Be(` +`+this.inlinePath_),this.info_.RTL&&this.block_.pathObject.flipRTL(),this.recordSizeOnBlock_()}recordSizeOnBlock_(){this.block_.height=this.info_.height,this.block_.width=this.info_.widthWithChildren,this.block_.childlessWidth=this.info_.width}drawOutline_(){this.drawTop_();for(let e=1;ee||e>this.fieldRow.length)throw Error("index "+e+" out of bounds.");return(t||t===""&&o)&&(typeof t=="string"&&(t=i.fromJson$$module$build$src$core$field_registry({type:"field_label",text:t})),t.setSourceBlock(this.sourceBlock),this.sourceBlock.initialized&&this.initField(t),t.name=o,t.setVisible(this.isVisible()),t.prefixField&&(e=this.insertFieldAt(e,t.prefixField)),this.fieldRow.splice(e,0,t),e++,t.suffixField&&(e=this.insertFieldAt(e,t.suffixField)),this.sourceBlock.rendered&&this.sourceBlock.queueRender()),e}removeField(e,t){for(let o=0,n;n=this.fieldRow[o];o++)if(n.name===e)return n.dispose(),this.fieldRow.splice(o,1),this.sourceBlock.rendered&&this.sourceBlock.queueRender(),!0;if(t)return!1;throw Error('Field "'+e+'" not found.')}isVisible(){return this.visible}setVisible(e){let t=[];if(this.visible===e)return t;this.visible=e;for(let n=0,u;u=this.fieldRow[n];n++)u.setVisible(e);if(this.connection){var o=this.connection;e?t=o.startTrackingAll():o.stopTrackingAll(),(o=o.targetBlock())&&(o.getSvgRoot().style.display=e?"block":"none")}return t}markDirty(){for(let e=0,t;t=this.fieldRow[e];e++)t.markDirty()}setCheck(e){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setCheck(e),this}setAlign(e){return this.align=e,this.sourceBlock.rendered&&this.sourceBlock.queueRender(),this}setShadowDom(e){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setShadowDom(e),this}getShadowDom(){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.getShadowDom()}init(){for(const e of this.fieldRow)e.init()}initModel(){for(const e of this.fieldRow)e.initModel()}initField(e){this.sourceBlock.rendered?e.init():e.initModel()}dispose(){for(let e=0,t;t=this.fieldRow[e];e++)t.dispose();this.connection&&this.connection.dispose()}makeConnection(e){return this.sourceBlock.makeConnection_(e)}},Ks=class extends pn{constructor(e,t){super(e,t),this.name=e,this.type=i.inputTypes$$module$build$src$core$inputs$input_types.DUMMY}},Co=class extends pn{constructor(e,t){super(e,t),this.name=e,this.type=i.inputTypes$$module$build$src$core$inputs$input_types.END_ROW}},ls=class extends pn{constructor(e,t){if(!e)throw Error("Statement inputs must have a non-empty name");super(e,t),this.name=e,this.type=i.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT,this.connection=this.makeConnection(xe.NEXT_STATEMENT)}},Mv;i.ValueInput$$module$build$src$core$inputs$value_input=class extends pn{constructor(e,t){if(!e)throw Error("Value inputs must have a non-empty name");super(e,t),this.name=e,this.type=i.inputTypes$$module$build$src$core$inputs$input_types.VALUE,this.connection=this.makeConnection(xe.INPUT_VALUE)}},Mv={},Mv.ValueInput=i.ValueInput$$module$build$src$core$inputs$value_input;var Rr=class{constructor(e,t){this.statementEdge=this.width=this.widthWithChildren=this.height=0,this.rows=[],this.inputRows=[],this.startY=this.startX=0,this.renderer_=e,this.block_=t,this.constants_=this.renderer_.getConstants(),this.outputConnection=t.outputConnection?new Ov(this.constants_,t.outputConnection):null,this.isInline=t.getInputsInline()&&!t.isCollapsed(),this.isCollapsed=t.isCollapsed(),this.isInsertionMarker=t.isInsertionMarker(),this.RTL=t.RTL,this.topRow=new dp(this.constants_),this.bottomRow=new rp(this.constants_)}getRenderer(){return this.renderer_}measure(){this.createRows_(),this.addElemSpacing_(),this.addRowSpacing_(),this.computeBounds_(),this.alignRowElements_(),this.finalize_()}createRows_(){this.populateTopRow_(),this.rows.push(this.topRow);let e=new cp(this.constants_);this.inputRows.push(e);var t=this.block_.getIcons();for(let o=0,n;n=t[o];o++){const u=new Dv(this.constants_,n);this.isCollapsed&&!n.isShownWhenCollapsed()||e.elements.push(u)}t=void 0;for(let o=0,n;n=this.block_.inputList[o];o++)if(n.isVisible()){this.shouldStartNewRow_(n,t)&&(this.rows.push(e),e=new cp(this.constants_),this.inputRows.push(e));for(let u=0,g;g=n.fieldRow[u];u++)e.elements.push(new hn(this.constants_,g,n));this.addInput_(n,e),t=n}this.isCollapsed&&(e.hasJaggedEdge=!0,e.elements.push(new Av(this.constants_))),(e.elements.length||e.hasDummyInput)&&this.rows.push(e),this.populateBottomRow_(),this.rows.push(this.bottomRow)}populateTopRow_(){var e=!!this.block_.previousConnection;const t=(this.block_.hat?this.block_.hat==="cap":this.constants_.ADD_START_HATS)&&!this.outputConnection&&!e;let o=this.topRow.hasLeftSquareCorner(this.block_)?Ar:Dr;this.topRow.elements.push(new o(this.constants_)),t?(e=new ap(this.constants_),this.topRow.elements.push(e),this.topRow.capline=e.ascenderHeight):e&&(this.topRow.hasPreviousConnection=!0,this.topRow.connection=new Nv(this.constants_,this.block_.previousConnection),this.topRow.elements.push(this.topRow.connection)),this.block_.inputList.length&&this.block_.inputList[0]instanceof ls&&!this.block_.isCollapsed()?this.topRow.minHeight=this.constants_.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT:this.topRow.minHeight=this.constants_.TOP_ROW_MIN_HEIGHT,o=this.topRow.hasRightSquareCorner(this.block_)?Ar:Dr,this.topRow.elements.push(new o(this.constants_,"right"))}populateBottomRow_(){this.bottomRow.hasNextConnection=!!this.block_.nextConnection,this.bottomRow.minHeight=this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1]instanceof ls?this.constants_.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT:this.constants_.BOTTOM_ROW_MIN_HEIGHT,this.bottomRow.hasLeftSquareCorner(this.block_)?this.bottomRow.elements.push(new Ar(this.constants_)):this.bottomRow.elements.push(new Dr(this.constants_)),this.bottomRow.hasNextConnection&&(this.bottomRow.connection=new Rv(this.constants_,this.block_.nextConnection),this.bottomRow.elements.push(this.bottomRow.connection)),this.bottomRow.hasRightSquareCorner(this.block_)?this.bottomRow.elements.push(new Ar(this.constants_,"right")):this.bottomRow.elements.push(new Dr(this.constants_,"right"))}addInput_(e,t){this.isInline&&e instanceof i.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new lp(this.constants_,e)),t.hasInlineInput=!0):e instanceof ls?(t.elements.push(new xr(this.constants_,e)),t.hasStatement=!0):e instanceof i.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new Ll(this.constants_,e)),t.hasExternalInput=!0):(e instanceof Ks||e instanceof Co)&&(t.minHeight=Math.max(t.minHeight,e.getSourceBlock()&&e.getSourceBlock().isShadow()?this.constants_.DUMMY_INPUT_SHADOW_MIN_HEIGHT:this.constants_.DUMMY_INPUT_MIN_HEIGHT),t.hasDummyInput=!0),t.align===null&&(t.align=e.align)}shouldStartNewRow_(e,t){return t?t instanceof Co||e instanceof ls||t instanceof ls?!0:e instanceof i.ValueInput$$module$build$src$core$inputs$value_input||e instanceof Ks||t instanceof i.ValueInput$$module$build$src$core$inputs$value_input?!this.isInline:!1:!1}addElemSpacing_(){for(let e=0,t;t=this.rows[e];e++){const o=t.elements;if(t.elements=[],t.startsWithElemSpacer()&&t.elements.push(new as(this.constants_,this.getInRowSpacing_(null,o[0]))),o.length){for(let n=0;ne.disposeInternal()),this.inputList.forEach(e=>e.dispose()),this.inputList.length=0,this.getConnections_(!0).forEach(e=>e.dispose()),this.disposed=!0}isDeadOrDying(){return this.disposing||this.disposed}initModel(){if(!this.initialized){for(const e of this.inputList)e.initModel();this.initialized=!0}}unplug(e){this.outputConnection&&this.unplugFromRow(e),this.previousConnection&&this.unplugFromStack(e)}unplugFromRow(e){let t=null,o;(o=this.outputConnection)!=null&&o.isConnected()&&(t=this.outputConnection.targetConnection,this.outputConnection.disconnect()),t&&e&&(e=this.getOnlyValueConnection())&&e.isConnected()&&!e.targetBlock().isShadow()&&(e=e.targetConnection,e==null||e.disconnect(),this.workspace.connectionChecker.canConnect(e,t,!1)?t.connect(e):e==null||e.onFailedConnect(t))}getOnlyValueConnection(){let e=null;for(let t=0;t(n=n+(o==="("||u===")"?"":" ")+u,o=u[u.length-1],n),""),t=t.trim()||"???",e&&t.length>e&&(t=t.substring(0,e-3)+"..."),t}toTokens(e="?"){const t=[];for(const n of this.inputList)if(n.name!=$r){for(const u of n.fieldRow)t.push(u.getText());if(n.connection){const u=n.connection.targetBlock();if(u){var o=n.connection;let g=o.getCheck();!g&&o.targetConnection&&(g=o.targetConnection.getCheck()),(o=!!g&&(g.includes("Boolean")||g.includes("Number")))&&t.push("("),t.push(...u.toTokens(e)),o&&t.push(")")}else t.push(e)}}return t}appendValueInput(e){return this.appendInput(new i.ValueInput$$module$build$src$core$inputs$value_input(e,this))}appendStatementInput(e){return this.statementInputCount++,this.appendInput(new ls(e,this))}appendDummyInput(e=""){return this.appendInput(new Ks(e,this))}appendEndRowInput(e=""){return this.appendInput(new Co(e,this))}appendInput(e){return this.inputList.push(e),e}appendInputFromRegistry(e,t){return(e=p($e.INPUT,e,!1))?this.appendInput(new e(t,this)):null}jsonInit(e){var t=e.type?'Block "'+e.type+'": ':"";if(e.output&&e.previousStatement)throw Error(t+"Must not have both an output and a previousStatement.");for(var o=0;e["args"+o];){if(e["message"+o]===void 0)throw Error(t+`args${o} must have a corresponding message (message${o}).`);o++}if(e.style&&e.style.hat&&(this.hat=e.style.hat,e.style=null),e.style&&e.colour)throw Error(t+"Must not have both a colour and a style.");for(e.style?this.jsonInitStyle(e,t):this.jsonInitColour(e,t),o=0;e["message"+o]!==void 0;)this.interpolate(e["message"+o],e["args"+o]||[],e["implicitAlign"+o]||e["lastDummyAlign"+o],t),o++;if(e.inputsInline!==void 0&&(i.disable$$module$build$src$core$events$utils(),this.setInputsInline(e.inputsInline),i.enable$$module$build$src$core$events$utils()),e.output!==void 0&&this.setOutput(!0,e.output),e.outputShape!==void 0&&this.setOutputShape(e.outputShape),e.previousStatement!==void 0&&this.setPreviousStatement(!0,e.previousStatement),e.nextStatement!==void 0&&this.setNextStatement(!0,e.nextStatement),e.tooltip!==void 0&&(o=bt(e.tooltip),this.setTooltip(o)),e.enableContextMenu!==void 0&&(this.contextMenu=!!e.enableContextMenu),e.suppressPrefixSuffix!==void 0&&(this.suppressPrefixSuffix=!!e.suppressPrefixSuffix),e.helpUrl!==void 0&&(o=bt(e.helpUrl),this.setHelpUrl(o)),typeof e.extensions=="string"&&(console.warn(t+"JSON attribute 'extensions' should be an array of strings. Found raw string in JSON for '"+e.type+"' block."),e.extensions=[e.extensions]),e.mutator!==void 0&&Va(e.mutator,this,!0),e=e.extensions,Array.isArray(e))for(t=0;tg||g>t)throw Error('Block "'+this.type+'": Message index %'+g+" out of range.");if(o[g])throw Error('Block "'+this.type+'": Message index %'+g+" duplicated.");o[g]=!0,n++}}if(n!==t)throw Error('Block "'+this.type+'": Message does not reference all '+t+" arg(s).")}interpolateArguments(e,t,o){const n=[];for(let g=0;g=this.inputList.length)throw RangeError("Input index "+e+" out of bounds.");if(t>this.inputList.length)throw RangeError("Reference input "+t+" out of bounds.");const o=this.inputList[e];this.inputList.splice(e,1),et.getWeight()-o.getWeight()),e}removeIcon(e){if(!this.hasIcon(e))return!1;let t;return(t=this.getIcon(e))==null||t.dispose(),this.icons=this.icons.filter(o=>!o.getType().equals(e)),!0}hasIcon(e){return this.icons.some(t=>t.getType().equals(e))}getIcon(e){return e instanceof Ct?this.icons.find(t=>t.getType().equals(e)):this.icons.find(t=>t.getType().toString()===e)}getIcons(){return[...this.icons]}getRelativeToSurfaceXY(){return this.xy}moveBy(e,t,o){if(this.parentBlock_)throw Error("Block has parent");const n=new(ne(ee.BLOCK_MOVE))(this);o&&n.setReason(o),this.xy.translate(e,t),n.recordNew(),z(n)}makeConnection_(e){return new Qe(this,e)}allInputsFilled(e){if(e===void 0&&(e=!0),!e&&this.isShadow())return!1;for(let o=0,n;n=this.inputList[o];o++)if(n.connection){var t=n.connection.targetBlock();if(!t||!t.allInputsFilled(e))return!1}return(t=this.getNextBlock())?t.allInputsFilled(e):!0}toDevString(){let e=this.type?'"'+this.type+'" block':"Block";return this.id&&(e+=' (id="'+this.id+'")'),e}};Uo.COLLAPSED_INPUT_NAME=$r,Uo.COLLAPSED_FIELD_NAME=gl;var ms=class{constructor(e,t,o,n){this.workspace=e,this.targetWorkspace=t,this.isFlyoutLabel=n,this.onMouseUpWrapper=null,this.height=this.width=0,this.cursorSvg=this.svgText=this.svgGroup=null,this.text=o.text,this.position=new ye(0,0),this.callbackKey=o.callbackKey||o.callbackkey,this.cssClass=o["web-class"]||null,this.info=o}createDom(){var e=this.isFlyoutLabel?"blocklyFlyoutLabel":"blocklyFlyoutButton";this.cssClass&&(e+=" "+this.cssClass),this.svgGroup=ie(J.G,{class:e},this.workspace.getCanvas());let t;this.isFlyoutLabel||(t=ie(J.RECT,{class:"blocklyFlyoutButtonShadow",rx:ms.BORDER_RADIUS,ry:ms.BORDER_RADIUS,x:1,y:1},this.svgGroup)),e=ie(J.RECT,{class:this.isFlyoutLabel?"blocklyFlyoutLabelBackground":"blocklyFlyoutButtonBackground",rx:ms.BORDER_RADIUS,ry:ms.BORDER_RADIUS},this.svgGroup);const o=ie(J.TEXT,{class:this.isFlyoutLabel?"blocklyFlyoutLabelText":"blocklyText",x:0,y:0,"text-anchor":"middle"},this.svgGroup);var n=bt(this.text);this.workspace.RTL&&(n+="‏"),o.textContent=n,this.isFlyoutLabel&&(this.svgText=o,this.workspace.getThemeManager().subscribe(this.svgText,"flyoutForegroundColour","fill"));const u=js(o,"fontSize"),g=js(o,"fontWeight"),I=js(o,"fontFamily");if(this.width=Bs(o,u,g,I),n=ro(n,u,g,I),this.height=n.height,!this.isFlyoutLabel){this.width+=2*ms.TEXT_MARGIN_X,this.height+=2*ms.TEXT_MARGIN_Y;let L;(L=t)==null||L.setAttribute("width",String(this.width));let le;(le=t)==null||le.setAttribute("height",String(this.height))}return e.setAttribute("width",String(this.width)),e.setAttribute("height",String(this.height)),o.setAttribute("x",String(this.width/2)),o.setAttribute("y",String(this.height/2-n.height/2+n.baseline)),this.updateTransform(),this.onMouseUpWrapper=H(this.svgGroup,"pointerup",this,this.onMouseUp),this.svgGroup}show(){this.updateTransform(),this.svgGroup.setAttribute("display","block")}updateTransform(){this.svgGroup.setAttribute("transform","translate("+this.position.x+","+this.position.y+")")}moveTo(e,t){this.position.x=e,this.position.y=t,this.updateTransform()}isLabel(){return this.isFlyoutLabel}getPosition(){return this.position}getButtonText(){return this.text}getTargetWorkspace(){return this.targetWorkspace}getWorkspace(){return this.workspace}dispose(){this.onMouseUpWrapper&&V(this.onMouseUpWrapper),this.svgGroup&&Ze(this.svgGroup),this.svgText&&this.workspace.getThemeManager().unsubscribe(this.svgText)}setCursorSvg(e){e?this.svgGroup&&(this.svgGroup.appendChild(e),this.cursorSvg=e):this.cursorSvg=null}setMarkerSvg(){throw Error("Attempted to set a marker on a button.")}onMouseUp(e){(e=this.targetWorkspace.getGesture(e))&&e.cancel(),this.isFlyoutLabel&&this.callbackKey?console.warn("Labels should not have callbacks. Label text: "+this.text):this.isFlyoutLabel||this.callbackKey&&this.targetWorkspace.getButtonCallback(this.callbackKey)?this.isFlyoutLabel||(e=this.targetWorkspace.getButtonCallback(this.callbackKey))&&e(this):console.warn("Buttons should have callbacks. Button text: "+this.text)}};ms.TEXT_MARGIN_X=5,ms.TEXT_MARGIN_Y=2,ms.BORDER_RADIUS=4,Be(` .blocklyFlyoutButton { fill: #888; cursor: default; @@ -882,16 +882,16 @@ Blockly.YourGeneratorName.nameDB_.setVariableMap(workspace.getVariableMap());`), .blocklyFlyoutLabelBackground { opacity: 0; } -`);var de=class{constructor(e,t,o){if(this.wsCoordinate=null,!t)throw Error("Cannot create a node without a location.");this.type=e,this.isConnectionLocation=de.isConnectionType(e),this.location=t,this.processParams(o||null)}processParams(e){e&&e.wsCoordinate&&(this.wsCoordinate=e.wsCoordinate)}getLocation(){return this.location}getType(){return this.type}getWsCoordinate(){return this.wsCoordinate}isConnection(){return this.isConnectionLocation}findNextForInput(){var e=this.location.getParentInput();const t=e.getSourceBlock();for(e=t.inputList.indexOf(e),e+=1;et instanceof Uo&&u.block===t||t instanceof ms&&u.button===t);return 0>n?null:(o=o?n+1:n-1,o===-1||o===e.length?null:e[o])}findTopASTNodeForBlock(e){const t=rr(e);return t?de.createConnectionNode(t):de.createBlockNode(e)}getOutAstNodeForBlock(e){if(!e)return null;e=e.getTopStackBlock();const t=rr(e);return t&&t.targetConnection&&t.targetConnection.getParentInput()?de.createInputNode(t.targetConnection.getParentInput()):de.createStackNode(e)}findFirstFieldOrInput(e){e=e.inputList;for(let t=0;t{Ga(o.getSourceBlock()),setTimeout(()=>{n.bringToFront()},0)})}}update(e,t){const o=this.getCandidate(e);((this.wouldDeleteBlock=this.shouldDelete(!!o,t))||this.shouldUpdatePreviews(o,e))&&(i.disable$$module$build$src$core$events$utils(),this.maybeHidePreview(o),this.maybeShowPreview(o),i.enable$$module$build$src$core$events$utils())}createMarkerBlock(e){i.disable$$module$build$src$core$events$utils();let t;try{const o=os(e,{addCoordinates:!1,addInputBlocks:!1,addNextBlocks:!1,doFullSerialization:!1});if(!o)throw Error(`Failed to serialize source block. ${e.toDevString()}`);t=lo(o,this.workspace);for(const n of t.getDescendants(!1))n.setInsertionMarker(!0);t.initSvg(),t.getSvgRoot().setAttribute("visibility","hidden")}finally{i.enable$$module$build$src$core$events$utils()}return t}initAvailableConnections(){const e=this.topBlock.getConnections_(!1),t=this.topBlock.lastConnectionInStack(!0);return t&&t!==this.topBlock.nextConnection&&(e.push(t),this.lastOnStack=t),e}shouldUpdatePreviews(e,t){if(!e)return!!this.activeCandidate;if(!this.activeCandidate)return!0;const{local:o,closest:n}=this.activeCandidate;if(n===e.closest&&o===e.local)return!1;const u=o.x+t.x-n.x;return t=o.y+t.y-n.y,e.radius{let le;(le=n)==null||le.positionNearConnection(L,g,I);let Ee;(Ee=n)==null||Ee.getSvgRoot().setAttribute("visibility","visible")}),this.markerConnection=u}hideInsertionMarker(){if(this.markerConnection){var e=this.markerConnection,t=e.getSourceBlock(),o=t.outputConnection,n;if((n=t.previousConnection)!=null&&n.targetConnection||o!=null&&o.targetConnection)t.unplug(!0);else{let u;(u=e.targetBlock())==null||u.unplug(!1)}if(e.targetConnection)throw Error("markerConnection still connected at the end of disconnectInsertionMarker");this.markerConnection=null,(e=t.getSvgRoot())&&e.setAttribute("visibility","hidden")}}showInsertionInputOutline(e){e=e.closest,this.highlightedBlock=e.getSourceBlock(),this.highlightedBlock.highlightShapeForInput(e,!0)}hideInsertionInputOutline(){if(this.highlightedBlock){if(!this.activeCandidate)throw Error("Cannot hide the insertion marker outline because there is no active candidate");this.highlightedBlock.highlightShapeForInput(this.activeCandidate.closest,!1),this.highlightedBlock=null}}showReplacementFade(e){if(this.fadedBlock=e.closest.targetBlock(),!this.fadedBlock)throw Error("Cannot show the replacement fade because the closest connection does not have a target block");this.fadedBlock.fadeForReplacement(!0)}hideReplacementFade(){this.fadedBlock&&(this.fadedBlock.fadeForReplacement(!1),this.fadedBlock=null)}getInsertionMarkers(){const e=[];return this.firstMarker&&e.push(this.firstMarker),this.lastMarker&&e.push(this.lastMarker),e}disposeInsertionMarker(e){if(e){i.disable$$module$build$src$core$events$utils();try{e.dispose()}finally{i.enable$$module$build$src$core$events$utils()}}}};(function(e){e=e.PREVIEW_TYPE||(e.PREVIEW_TYPE={}),e[e.INSERTION_MARKER=0]="INSERTION_MARKER",e[e.INPUT_OUTLINE=1]="INPUT_OUTLINE",e[e.REPLACEMENT_FADE=2]="REPLACEMENT_FADE"})(fs||(fs={})),fs.PREVIEW_TYPE;var jl=class{constructor(e){this.overrides=null,this.name=e}getClassName(){return this.name+"-renderer"}init(e,t){this.constants_=this.makeConstants_(),t&&(this.overrides=t,Object.assign(this.constants_,t)),this.constants_.setTheme(e),this.constants_.init()}createDom(e,t){this.constants_.createDom(e,this.name+"-"+t.name,"."+this.getClassName()+"."+t.getClassName())}refreshDom(e,t){const o=this.getConstants();o.dispose(),this.constants_=this.makeConstants_(),this.overrides&&Object.assign(this.constants_,this.overrides),this.constants_.randomIdentifier=o.randomIdentifier,this.constants_.setTheme(t),this.constants_.init(),this.createDom(e,t)}dispose(){this.constants_&&this.constants_.dispose()}makeConstants_(){return new Pl}makeRenderInfo_(e){return new Or(this,e)}makeDrawer_(e,t){return new Bl(e,t)}makeMarkerDrawer(e,t){return new gp(e,this.getConstants(),t)}makePathObject(e,t){return new Fl(e,t,this.constants_)}getConstants(){return this.constants_}shouldHighlightConnection(e){return!0}orphanCanConnectAtEnd(e,t,o){return!!Qe.getConnectionForOrphanedConnection(e,o===xe.OUTPUT_VALUE?t.outputConnection:t.previousConnection)}getConnectionPreviewMethod(e,t,o){return w("getConnectionPreviewMethod","v10","v12","an IConnectionPreviewer, if it fulfills your use case."),t.type===xe.OUTPUT_VALUE||t.type===xe.PREVIOUS_STATEMENT?!e.isConnected()||this.orphanCanConnectAtEnd(o,e.targetBlock(),t.type)?fs.PREVIEW_TYPE.INSERTION_MARKER:fs.PREVIEW_TYPE.REPLACEMENT_FADE:fs.PREVIEW_TYPE.INSERTION_MARKER}render(e){const t=this.makeRenderInfo_(e);t.measure(),this.makeDrawer_(e,t).draw()}},ot={};ot.BottomRow=rp,ot.Connection=ko,ot.ConstantProvider=Pl,ot.Drawer=Bl,ot.ExternalValueInput=Ll,ot.Field=hn,ot.Hat=ap,ot.Icon=Dv,ot.InRowSpacer=as,ot.InlineInput=lp,ot.InputConnection=zo,ot.InputRow=cp,ot.JaggedEdge=Av,ot.MarkerSvg=gp,ot.Measurable=Vs,ot.NextConnection=Ov,ot.OutputConnection=Rv,ot.PathObject=Fl,ot.PreviousConnection=Nv,ot.RenderInfo=Or,ot.Renderer=jl,ot.RoundCorner=Dr,ot.Row=Ir,ot.SpacerRow=up,ot.SquareCorner=Ar,ot.StatementInput=xr,ot.TopRow=dp,ot.Types=F,ot.init=Rd,ot.register=ar,ot.unregister=H$;var Lv=class{constructor(e,t){this.workspace=e,this.theme=t,this.subscribedWorkspaces=[],this.componentDB=new Map}getTheme(){return this.theme}setTheme(e){var t=this.theme;this.theme=e,(e=this.workspace.getInjectionDiv())&&(t&&(t=t.getClassName())&&ze(e,t),(t=this.theme.getClassName())&&Oe(e,t));for(let o=0,n;n=this.subscribedWorkspaces[o];o++)n.refreshTheme();for(const[o,n]of this.componentDB)for(const u of n){e=u.element,t=u.propertyName;const g=this.theme&&this.theme.getComponentStyle(o);e.style.setProperty(t,g||"")}for(const o of this.subscribedWorkspaces)o.hideChaff()}subscribeWorkspace(e){this.subscribedWorkspaces.push(e)}unsubscribeWorkspace(e){if(!Ue(this.subscribedWorkspaces,e))throw Error("Cannot unsubscribe a workspace that hasn't been subscribed.")}subscribe(e,t,o){this.componentDB.has(t)||this.componentDB.set(t,[]),this.componentDB.get(t).push({element:e,propertyName:o}),t=this.theme&&this.theme.getComponentStyle(t),e.style.setProperty(o,t||"")}unsubscribe(e){if(e)for(const[t,o]of this.componentDB){for(let n=o.length-1;0<=n;n--)o[n].element===e&&o.splice(n,1);o.length||this.componentDB.delete(t)}}dispose(){this.subscribedWorkspaces.length=0,this.componentDB.clear()}},mp="VARIABLE_DYNAMIC",wi={CATEGORY_NAME:mp};wi.flyoutCategory=Qa,wi.flyoutCategoryBlocks=Pd,wi.onCreateVariableButtonClick_Colour=Ld,wi.onCreateVariableButtonClick_Number=Md,wi.onCreateVariableButtonClick_String=Nd;var Pv=30,ki=[];ki[xe.INPUT_VALUE]=xe.OUTPUT_VALUE,ki[xe.OUTPUT_VALUE]=xe.INPUT_VALUE,ki[xe.NEXT_STATEMENT]=xe.PREVIOUS_STATEMENT,ki[xe.PREVIOUS_STATEMENT]=xe.NEXT_STATEMENT;var fp="RENAME_VARIABLE_ID",$p="DELETE_VARIABLE_ID",Bv=class{canConnect(e,t,o,n){return this.canConnectWithReason(e,t,o,n)===Qe.CAN_CONNECT}canConnectWithReason(e,t,o,n){const u=this.doSafetyChecks(e,t);return u!==Qe.CAN_CONNECT?u:this.doTypeChecks(e,t)?o&&!this.doDragChecks(e,t,n||0)?Qe.REASON_DRAG_CHECKS_FAILED:Qe.CAN_CONNECT:Qe.REASON_CHECKS_FAILED}getErrorMessage(e,t,o){switch(e){case Qe.REASON_SELF_CONNECTION:return"Attempted to connect a block to itself.";case Qe.REASON_DIFFERENT_WORKSPACES:return"Blocks not on same workspace.";case Qe.REASON_WRONG_TYPE:return"Attempt to connect incompatible types.";case Qe.REASON_TARGET_NULL:return"Target connection is null.";case Qe.REASON_CHECKS_FAILED:return"Connection checks failed. "+(t+" expected "+t.getCheck()+", found "+o.getCheck());case Qe.REASON_SHADOW_PARENT:return"Connecting non-shadow to shadow block.";case Qe.REASON_DRAG_CHECKS_FAILED:return"Drag checks failed.";case Qe.REASON_PREVIOUS_AND_OUTPUT:return"Block would have an output and a previous connection.";default:return"Unknown connection failure: this should never happen!"}}doSafetyChecks(e,t){if(!e||!t)return Qe.REASON_TARGET_NULL;let o,n,u;return e.isSuperior()?(o=e.getSourceBlock(),n=t.getSourceBlock(),u=t):(n=e.getSourceBlock(),o=t.getSourceBlock(),u=e,e=t),o===n?Qe.REASON_SELF_CONNECTION:u.type!==ki[e.type]?Qe.REASON_WRONG_TYPE:o.workspace!==n.workspace?Qe.REASON_DIFFERENT_WORKSPACES:o.isShadow()&&!n.isShadow()?Qe.REASON_SHADOW_PARENT:u.type===xe.OUTPUT_VALUE&&n.previousConnection&&n.previousConnection.isConnected()||u.type===xe.PREVIOUS_STATEMENT&&n.outputConnection&&n.outputConnection.isConnected()?Qe.REASON_PREVIOUS_AND_OUTPUT:Qe.CAN_CONNECT}doTypeChecks(e,t){if(e=e.getCheck(),t=t.getCheck(),!e||!t)return!0;for(let o=0;oo||t.getSourceBlock().isInsertionMarker())return!1;switch(t.type){case xe.PREVIOUS_STATEMENT:return this.canConnectToPrevious_(e,t);case xe.OUTPUT_VALUE:if(t.isConnected()&&!t.targetBlock().isInsertionMarker()||e.isConnected())return!1;break;case xe.INPUT_VALUE:if(t.isConnected()&&!t.targetBlock().isMovable()&&!t.targetBlock().isShadow())return!1;break;case xe.NEXT_STATEMENT:if(t.isConnected()&&!e.getSourceBlock().nextConnection&&!t.targetBlock().isShadow()&&t.targetBlock().nextConnection||t.targetBlock()&&!t.targetBlock().isMovable()&&!t.targetBlock().isShadow())return!1;break;default:return!1}return!hr.includes(t)}canConnectToPrevious_(e,t){return e.targetConnection||hr.includes(t)?!1:t.targetConnection?(e=t.targetBlock(),e.isInsertionMarker()?!e.getPreviousBlock():!1):!0}};r($e.CONNECTION_CHECKER,Ws,Bv);var bp=class extends br{constructor(e){super(e),this.type=ee.VAR_DELETE,e&&(this.varType=e.type,this.varName=e.name)}toJson(){const e=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");return e.varType=this.varType,e.varName=this.varName,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new bp),t.varType=e.varType,t.varName=e.varName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");e?t.deleteVariableById(this.varId):t.createVariable(this.varName,this.varType,this.varId)}};r($e.EVENT,ee.VAR_DELETE,bp);var vp=class extends br{constructor(e,t){super(e),this.type=ee.VAR_RENAME,e&&(this.oldName=e.name,this.newName=typeof t>"u"?"":t)}toJson(){const e=super.toJson();if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson");return e.oldName=this.oldName,e.newName=this.newName,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new vp),t.oldName=e.oldName,t.newName=e.newName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson");e?t.renameVariableById(this.varId,this.newName):t.renameVariableById(this.varId,this.oldName)}};r($e.EVENT,ee.VAR_RENAME,vp);var yp=class{constructor(e){this.workspace=e,this.variableMap=new Map}clear(){for(const e of this.variableMap.values())for(;0{u&&t&&this.deleteVariableInternal(t,n)})):this.deleteVariableInternal(t,n)}else console.warn("Can't delete non-existent variable: "+e)}deleteVariableInternal(e,t){const o=i.getGroup$$module$build$src$core$events$utils();o||i.setGroup$$module$build$src$core$events$utils(!0);try{for(let n=0;ne.name)}getVariableUsesById(e){const t=[],o=this.workspace.getAllBlocks(!1);for(let n=0;n!o.isInsertionMarker())):[]}addTopComment(e){this.topComments.push(e),this.commentDB.has(e.id)&&console.warn('Overriding an existing comment on this workspace, with id "'+e.id+'"'),this.commentDB.set(e.id,e)}removeTopComment(e){if(!Ue(this.topComments,e))throw Error("Comment not present in workspace's list of top-most comments.");this.commentDB.delete(e.id)}getTopComments(e=!1){const t=[].concat(this.topComments);return e&&1!o.isInsertionMarker())}clear(){this.isClearing=!0;try{const e=i.getGroup$$module$build$src$core$events$utils();for(e||i.setGroup$$module$build$src$core$events$utils(!0);this.topBlocks.length;)this.topBlocks[0].dispose(!1);for(;this.topComments.length;)this.topComments[this.topComments.length-1].dispose();i.setGroup$$module$build$src$core$events$utils(e),this.variableMap.clear(),this.potentialVariableMap&&this.potentialVariableMap.clear()}finally{this.isClearing=!1}}renameVariableById(e,t){this.variableMap.renameVariableById(e,t)}createVariable(e,t,o){return this.variableMap.createVariable(e,t,o)}getVariableUsesById(e){return this.variableMap.getVariableUsesById(e)}deleteVariableById(e){this.variableMap.deleteVariableById(e)}getVariable(e,t){return this.variableMap.getVariable(e,t)}getVariableById(e){return this.variableMap.getVariableById(e)}getVariablesOfType(e){return this.variableMap.getVariablesOfType(e)}getVariableTypes(){return this.variableMap.getVariableTypes(this)}getAllVariables(){return this.variableMap.getAllVariables()}getAllVariableNames(){return this.variableMap.getAllVariableNames()}getWidth(){return 0}newBlock(e,t){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts")}newComment(e){throw Error("The implementation of newComment should be monkey-patched in by blockly.ts")}remainingCapacity(){return isNaN(this.options.maxBlocks)?1/0:this.options.maxBlocks-this.getAllBlocks(!1).length}remainingCapacityOfType(e){return this.options.maxInstances?(this.options.maxInstances[e]!==void 0?this.options.maxInstances[e]:1/0)-this.getBlocksByType(e,!1).length:1/0}isCapacityAvailable(e){if(!this.hasBlockLimits())return!0;let t=0;for(const o in e){if(e[o]>this.remainingCapacityOfType(o))return!1;t+=e[o]}return!(t>this.remainingCapacity())}hasBlockLimits(){return this.options.maxBlocks!==1/0||!!this.options.maxInstances}getUndoStack(){return this.undoStack_}getRedoStack(){return this.redoStack_}undo(e){var t=e?this.redoStack_:this.undoStack_,o=e?this.undoStack_:this.redoStack_;const n=t.pop();if(n){for(var u=[n];t.length&&n.group&&n.group===t[t.length-1].group;){const g=t.pop();g&&u.push(g)}for(t=0;tthis.MAX_UNDO&&0<=this.MAX_UNDO;)this.undoStack_.shift();for(let t=0;t!!t.getStyleName())),this.refreshToolboxSelection(),this.toolbox&&this.toolbox.refreshTheme(),this.isVisible()&&this.setVisible(!0);const e=new(ne(ee.THEME_CHANGE))(this.getTheme().name,this.id);z(e)}updateBlockStyles(e){for(let t=0,o;o=e[t];t++){const n=o.getStyleName();n&&o.setStyle(n)}}getInverseScreenCTM(){if(this.inverseScreenCTMDirty){const e=this.getParentSvg().getScreenCTM();e&&(this.inverseScreenCTM=e.inverse(),this.inverseScreenCTMDirty=!1)}return this.inverseScreenCTM}updateInverseScreenCTM(){this.inverseScreenCTMDirty=!0}isVisible(){return this.visible}getSvgXY(e){let t=0,o=0,n=1;(this.getCanvas().contains(e)||this.getBubbleCanvas().contains(e))&&(n=this.scale);do{const u=Wn(e);(e===this.getCanvas()||e===this.getBubbleCanvas())&&(n=1),t+=u.x*n,o+=u.y*n,e=e.parentNode}while(e&&e!==this.getParentSvg()&&e!==this.getInjectionDiv());return new ye(t,o)}getCachedParentSvgSize(){const e=this.cachedParentSvgSize;return new Xe(e.width,e.height)}getOriginOffsetInPixels(){return fa(this.getCanvas())}getInjectionDiv(){if(!this.injectionDiv){let e=this.svgGroup_;for(;e;){if((" "+(e.getAttribute("class")||"")+" ").includes(" injectionDiv ")){this.injectionDiv=e;break}e=e.parentNode}}return this.injectionDiv}getSvgGroup(){return this.svgGroup_}getBlockCanvas(){return this.getCanvas()}setResizeHandlerWrapper(e){this.resizeHandlerWrapper=e}createDom(e,t){return this.injectionDiv||(this.injectionDiv=t??null),this.svgGroup_=ie(J.G,{class:"blocklyWorkspace"}),e&&(this.svgBackground_=ie(J.RECT,{height:"100%",width:"100%",class:e},this.svgGroup_),e==="blocklyMainBackground"&&this.grid?this.svgBackground_.style.fill="url(#"+this.grid.getPatternId()+")":this.themeManager_.subscribe(this.svgBackground_,"workspaceBackgroundColour","fill")),this.layerManager=new qC(this),this.svgBlockCanvas_=this.layerManager.getBlockLayer(),this.svgBubbleCanvas_=this.layerManager.getBubbleLayer(),this.isFlyout||(H(this.svgGroup_,"pointerdown",this,this.onMouseDown,!1),this.dummyWheelListener=()=>{},document.body.addEventListener("wheel",this.dummyWheelListener),H(this.svgGroup_,"wheel",this,this.onMouseWheel)),this.options.hasCategories&&(this.toolbox=new(y($e.TOOLBOX,this.options,!0))(this)),this.grid&&this.grid.update(this.scale),this.recordDragTargets(),(e=y($e.CURSOR,this.options))&&this.markerManager.setCursor(new e),this.renderer.createDom(this.svgGroup_,this.getTheme()),this.svgGroup_}dispose(){if(this.rendered=!1,this.currentGesture_&&this.currentGesture_.cancel(),this.svgGroup_&&Ze(this.svgGroup_),this.toolbox&&(this.toolbox.dispose(),this.toolbox=null),this.flyout&&(this.flyout.dispose(),this.flyout=null),this.trashcan&&(this.trashcan.dispose(),this.trashcan=null),this.scrollbar&&(this.scrollbar.dispose(),this.scrollbar=null),this.zoomControls_&&this.zoomControls_.dispose(),this.audioManager&&this.audioManager.dispose(),this.grid&&(this.grid=null),this.renderer.dispose(),this.markerManager&&this.markerManager.dispose(),super.dispose(),this.themeManager_&&(this.themeManager_.unsubscribeWorkspace(this),this.themeManager_.unsubscribe(this.svgBackground_),this.options.parentWorkspace||this.themeManager_.dispose()),this.connectionDBList.length=0,this.toolboxCategoryCallbacks.clear(),this.flyoutButtonCallbacks.clear(),!this.options.parentWorkspace){const e=this.getParentSvg();e&&e.parentNode&&Ze(e.parentNode)}this.resizeHandlerWrapper&&(V(this.resizeHandlerWrapper),this.resizeHandlerWrapper=null),this.dummyWheelListener&&(document.body.removeEventListener("wheel",this.dummyWheelListener),this.dummyWheelListener=null)}addTrashcan(){this.trashcan=cs.newTrashcan(this);const e=this.trashcan.createDom();this.svgGroup_.insertBefore(e,this.getCanvas())}static newTrashcan(e){throw Error("The implementation of newTrashcan should be monkey-patched in by blockly.ts")}addZoomControls(){this.zoomControls_=new Hb(this);const e=this.zoomControls_.createDom();this.svgGroup_.appendChild(e)}addFlyout(e){const t=new gs({parentWorkspace:this,rtl:this.RTL,oneBasedIndex:this.options.oneBasedIndex,horizontalLayout:this.horizontalLayout,renderer:this.options.renderer,rendererOverrides:this.options.rendererOverrides,move:{scrollbars:!0}});return t.toolboxPosition=this.options.toolboxPosition,this.flyout=this.horizontalLayout?new(y($e.FLYOUTS_HORIZONTAL_TOOLBOX,this.options,!0))(t):new(y($e.FLYOUTS_VERTICAL_TOOLBOX,this.options,!0))(t),this.flyout.autoClose=!1,this.flyout.getWorkspace().setVisible(!0),this.flyout.createDom(e)}getFlyout(e){return this.flyout||e?this.flyout:this.toolbox?this.toolbox.getFlyout():null}getToolbox(){return this.toolbox}updateScreenCalculations(){this.updateInverseScreenCTM(),this.recordDragTargets()}resizeContents(){this.resizesEnabled&&this.rendered&&(this.scrollbar&&this.scrollbar.resize(),this.updateInverseScreenCTM())}resize(){this.toolbox&&this.toolbox.position(),this.flyout&&this.flyout.position();const e=this.componentManager.getComponents(gt.Capability.POSITIONABLE,!0),t=this.getMetricsManager().getUiMetrics(),o=[];for(let n=0,u;u=e[n];n++){u.position(t,o);const g=u.getBoundingRectangle();g&&o.push(g)}this.scrollbar&&this.scrollbar.resize(),this.updateScreenCalculations()}updateScreenCalculationsIfScrolled(){const e=bu();ye.equals(this.lastRecordedPageScroll,e)||(this.lastRecordedPageScroll=e,this.updateScreenCalculations())}getLayerManager(){return this.layerManager}getCanvas(){return this.layerManager.getBlockLayer()}setCachedParentSvgSize(e,t){const o=this.getParentSvg();e!=null&&(this.cachedParentSvgSize.width=e,o.setAttribute("data-cached-width",`${e}`)),t!=null&&(this.cachedParentSvgSize.height=t,o.setAttribute("data-cached-height",`${t}`))}getBubbleCanvas(){return this.layerManager.getBubbleLayer()}getParentSvg(){if(!this.cachedParentSvg){let e=this.svgGroup_;for(;e;){if(e.tagName==="svg"){this.cachedParentSvg=e;break}e=e.parentNode}}return this.cachedParentSvg}maybeFireViewportChangeEvent(){if(C()){var e=this.scale,t=-this.scrollY,o=-this.scrollX;if(!(e===this.oldScale&&1>Math.abs(t-this.oldTop)&&1>Math.abs(o-this.oldLeft))){var n=new(ne(ee.VIEWPORT_CHANGE))(t,o,e,this.id,this.oldScale);this.oldScale=e,this.oldTop=t,this.oldLeft=o,z(n)}}}translate(e,t){let o;(o=this.layerManager)==null||o.translateLayers(new ye(e,t),this.scale);let n;(n=this.grid)==null||n.moveTo(e,t),this.maybeFireViewportChangeEvent()}getWidth(){const e=this.getMetrics();return e?e.viewWidth/this.scale:0}setVisible(e){this.visible=e,this.svgGroup_&&(this.scrollbar&&this.scrollbar.setContainerVisible(e),this.getFlyout()&&this.getFlyout().setContainerVisible(e),this.getParentSvg().style.display=e?"block":"none",this.toolbox&&this.toolbox.setVisible(e),e||this.hideChaff(!0))}render(){const e=this.getAllBlocks(!1);for(let t=e.length-1;0<=t;t--)e[t].queueRender();this.getTopBlocks().flatMap(t=>t.getDescendants(!1)).filter(t=>t.isInsertionMarker()).forEach(t=>t.queueRender()),Ts().then(()=>{this.markerManager.updateMarkers()})}highlightBlock(e,t){if(t===void 0){for(let o=0,n;n=this.highlightedBlocks[o];o++)n.setHighlighted(!1);this.highlightedBlocks.length=0}(e=e?this.getBlockById(e):null)&&((t=t===void 0||t)?this.highlightedBlocks.includes(e)||this.highlightedBlocks.push(e):Ue(this.highlightedBlocks,e),e.setHighlighted(t))}refreshToolboxSelection(){const e=this.isFlyout?this.targetWorkspace:this;e&&!e.currentGesture_&&e.toolbox&&e.toolbox.getFlyout()&&e.toolbox.refreshSelection()}renameVariableById(e,t){super.renameVariableById(e,t),this.refreshToolboxSelection()}deleteVariableById(e){super.deleteVariableById(e),this.refreshToolboxSelection()}createVariable(e,t,o){return e=super.createVariable(e,t,o),this.refreshToolboxSelection(),e}recordDragTargets(){const e=this.componentManager.getComponents(gt.Capability.DRAG_TARGET,!0);this.dragTargetAreas=[];for(let t=0,o;o=e[t];t++){const n=o.getClientRect();n&&this.dragTargetAreas.push({component:o,clientRect:n})}}newBlock(e,t){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts")}newComment(e){throw Error("The implementation of newComment should be monkey-patched in by blockly.ts")}getDragTarget(e){for(let t=0,o;o=this.dragTargetAreas[t];t++)if(o.clientRect.contains(e.clientX,e.clientY))return o.component;return null}onMouseDown(e){const t=this.getGesture(e);t&&t.handleWsStart(e,this)}startDrag(e,t){za(this,e,t)}moveDrag(e){return Ua(this,e)}isDragging(){return this.currentGesture_!==null&&this.currentGesture_.isDragging()}isDraggable(){return this.options.moveOptions&&this.options.moveOptions.drag}isMovable(){return this.options.moveOptions&&!!this.options.moveOptions.scrollbars||this.options.moveOptions&&this.options.moveOptions.wheel||this.options.moveOptions&&this.options.moveOptions.drag||this.options.zoomOptions&&this.options.zoomOptions.wheel||this.options.zoomOptions&&this.options.zoomOptions.pinch}isMovableHorizontally(){const e=!!this.scrollbar;return this.isMovable()&&(!e||e&&this.scrollbar.canScrollHorizontally())}isMovableVertically(){const e=!!this.scrollbar;return this.isMovable()&&(!e||e&&this.scrollbar.canScrollVertically())}onMouseWheel(e){if(bo.inProgress())e.preventDefault(),e.stopPropagation();else{var t=this.options.zoomOptions&&this.options.zoomOptions.wheel,o=this.options.moveOptions&&this.options.moveOptions.wheel;if(t||o){var n=Le(e);if(kh)var u=e.metaKey;t&&(e.ctrlKey||u||!o)?(n=-n.y/50,t=fe(e,this.getParentSvg(),this.getInverseScreenCTM()),this.zoom(t.x,t.y,n)):(t=this.scrollX-n.x,o=this.scrollY-n.y,e.shiftKey&&!n.x&&(t=this.scrollX-n.y,o=this.scrollY),this.scroll(t,o)),e.preventDefault()}}}getBlocksBoundingBox(){const e=this.getTopBoundedElements();if(!e.length)return new rt(0,0,0,0);const t=e[0].getBoundingRectangle();for(let n=1;nt.bottom&&(t.bottom=o.bottom),o.leftt.right&&(t.right=o.right))}return t}cleanUp(){this.setResizesEnabled(!1),i.setGroup$$module$build$src$core$events$utils(!0);var e=this.getTopBlocks(!0),t=e.filter(g=>g.isMovable());const o=e.filter(g=>!g.isMovable()).map(g=>g.getBoundingRectangle());e=function(g){for(const I of o)if(g.intersects(I))return I;return null};var n=0;const u=this.renderer.getConstants().MIN_BLOCK_HEIGHT;for(const g of t){for(t=g.getBoundingRectangle(),g.moveBy(-t.left,n-t.top,["cleanup"]),g.snapToGrid(),t=g.getBoundingRectangle(),n=e(t);n!=null;)n=n.top+n.getHeight()+u,g.moveBy(0,n-t.top,["cleanup"]),g.snapToGrid(),t=g.getBoundingRectangle(),n=e(t);n=g.getRelativeToSurfaceXY().y+g.getHeightWidth().height+u}i.setGroup$$module$build$src$core$events$utils(!1),this.setResizesEnabled(!0)}showContextMenu(e){if(!this.options.readOnly&&!this.isFlyout){var t=Ke.registry.getContextMenuOptions(Ke.ScopeType.WORKSPACE,{workspace:this});this.configureContextMenu&&this.configureContextMenu(t,e),sr(e,t,this.RTL,this)}}updateToolbox(e){if(e=$a(e)){if(!this.options.languageTree)throw Error("Existing toolbox is null. Can't create new toolbox.");if(ba(e)){if(!this.toolbox)throw Error("Existing toolbox has no categories. Can't change mode.");this.options.languageTree=e,this.toolbox.render(e)}else{if(!this.flyout)throw Error("Existing toolbox has categories. Can't change mode.");this.options.languageTree=e,this.flyout.show(e)}}else if(this.options.languageTree)throw Error("Can't nullify an existing toolbox.")}markFocused(){this.options.parentWorkspace?this.options.parentWorkspace.markFocused():(se(this),this.getParentSvg().focus({preventScroll:!0}))}zoom(e,t,o){o=Math.pow(this.options.zoomOptions.scaleSpeed,o);const n=this.scale*o;if(this.scale!==n){n>this.options.zoomOptions.maxScale?o=this.options.zoomOptions.maxScale/this.scale:nthis.options.zoomOptions.maxScale?e=this.options.zoomOptions.maxScale:this.options.zoomOptions.minScale&&et.autoHide(e))}static setTopLevelWorkspaceMetrics(e){const t=this.getMetrics();typeof e.x=="number"&&(this.scrollX=-(t.scrollLeft+(t.scrollWidth-t.viewWidth)*e.x)),typeof e.y=="number"&&(this.scrollY=-(t.scrollTop+(t.scrollHeight-t.viewHeight)*e.y)),this.translate(this.scrollX+t.absoluteLeft,this.scrollY+t.absoluteTop)}},_p=class extends Ss{constructor(e,t,o){super(o),this.type=ee.SELECTED,this.oldElementId=e??void 0,this.newElementId=t??void 0}toJson(){const e=super.toJson();return e.oldElementId=this.oldElementId,e.newElementId=this.newElementId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new _p),t.oldElementId=e.oldElementId,t.newElementId=e.newElementId,t}};r($e.EVENT,ee.SELECTED,_p);var Rr=class{paste(e,t,o){if(!t.isCapacityAvailable(e.typeCounts))return null;o&&(e.blockState.x=o.x,e.blockState.y=o.y),o=o||new ye(e.blockState.x||0,e.blockState.y||0),i.disable$$module$build$src$core$events$utils();let n;try{n=lo(e.blockState,t),W$(n,o)}finally{i.enable$$module$build$src$core$events$utils()}return n&&(C()&&!n.isShadow()&&z(new(ne(ee.BLOCK_CREATE))(n)),i.setSelected$$module$build$src$core$common(n),n)}};Rr.TYPE="block",Ca(Rr.TYPE,new Rr);var zl={};zl.bumpIntoBounds=Ji,zl.bumpIntoBoundsHandler=Bd,zl.bumpTopObjectsIntoBounds=el;var jv=class{constructor(e){this.block=e,this.connectionPreviewer=this.connectionCandidate=this.startLoc=this.startChildConn=this.startParentConn=null,this.dragging=!1,this.dragOffset=new ye(0,0),this.inGroup=!1,this.workspace=e.workspace}isMovable(){if(this.block.isShadow()){let e,t;return(t=(e=this.block.getParent())==null?void 0:e.isMovable())!=null?t:!1}return this.block.isOwnMovable()&&!this.block.isDeadOrDying()&&!this.workspace.options.readOnly&&!this.block.isInFlyout}startDrag(e){if(this.block.isShadow())this.startDraggingShadow(e);else{this.dragging=!0,(this.inGroup=!!i.getGroup$$module$build$src$core$events$utils())||i.setGroup$$module$build$src$core$events$utils(!0),this.fireDragStartEvent(),this.startLoc=this.block.getRelativeToSurfaceXY(),this.connectionCandidate=null,this.connectionPreviewer=new(y($e.CONNECTION_PREVIEWER,this.workspace.options))(this.block),io(),this.workspace.setResizesEnabled(!1),Ki(),e=!!e&&(e.altKey||e.ctrlKey||e.metaKey),this.shouldDisconnect(e)&&this.disconnectBlock(e),this.block.setDragging(!0);var t;(t=this.workspace.getLayerManager())==null||t.moveToDragLayer(this.block)}}startDraggingShadow(e){const t=this.block.getParent();if(!t)throw Error("Tried to drag a shadow block with no parent. Shadow blocks should always have parents.");this.dragOffset=ye.difference(t.getRelativeToSurfaceXY(),this.block.getRelativeToSurfaceXY()),t.startDrag(e)}shouldDisconnect(e){return!!(this.block.getParent()||e&&this.block.nextConnection&&this.block.nextConnection.targetBlock())}disconnectBlock(e){let t,o,n;if(this.startParentConn=(n=(t=this.block.outputConnection)==null?void 0:t.targetConnection)!=null?n:(o=this.block.previousConnection)==null?void 0:o.targetConnection,e){let u;this.startChildConn=(u=this.block.nextConnection)==null?void 0:u.targetConnection}this.block.unplug(e),_d(this.block)}fireDragStartEvent(){const e=new(ne(ee.BLOCK_DRAG))(this.block,!0,this.block.getDescendants(!1));z(e)}fireDragEndEvent(){const e=new(ne(ee.BLOCK_DRAG))(this.block,!1,this.block.getDescendants(!1));z(e)}fireMoveEvent(){if(!this.block.isDeadOrDying()){var e=new(ne(ee.BLOCK_MOVE))(this.block);e.setReason(["drag"]),e.oldCoordinate=this.startLoc,e.recordNew(),z(e)}}drag(e){if(this.block.isShadow()){let t;(t=this.block.getParent())==null||t.drag(ye.sum(e,this.dragOffset))}else this.block.moveDuringDrag(e),this.updateConnectionPreview(this.block,ye.difference(e,this.startLoc))}updateConnectionPreview(e,t){var o=this.connectionCandidate;const n=this.getConnectionCandidate(e,t);if(n){this.connectionCandidate=t=o&&this.currCandidateIsBetter(o,t,n)?o:n;var{local:u,neighbour:g}=t;t=u.type===xe.OUTPUT_VALUE||u.type===xe.PREVIOUS_STATEMENT,o=g.isConnected()&&!g.targetBlock().isInsertionMarker(),t&&o&&!this.orphanCanConnectAtEnd(e,g.targetBlock(),u.type)?this.connectionPreviewer.previewReplacement(u,g,g.targetBlock()):this.connectionPreviewer.previewConnection(u,g)}else this.connectionPreviewer.hidePreview(),this.connectionCandidate=null}orphanCanConnectAtEnd(e,t,o){return!!Qe.getConnectionForOrphanedConnection(e,o===xe.OUTPUT_VALUE?t.outputConnection:t.previousConnection)}currCandidateIsBetter(e,t,o){const{local:n,neighbour:u}=e;e=new ye(n.x,n.y);const g=new ye(u.x,u.y);return t=ye.distance(ye.sum(e,t),g),o.distance>t-i.config$$module$build$src$core$config.currentConnectionPreference}getConnectionCandidate(e,t){e=this.getLocalConnections(e);let o=this.connectionCandidate?i.config$$module$build$src$core$config.connectingSnapRadius:i.config$$module$build$src$core$config.snapRadius,n=null;for(const u of e){const{connection:g,radius:I}=u.closest(o,t);g&&(n={local:u,neighbour:g,distance:I},o=I)}return n}getLocalConnections(e){const t=e.getConnections_(!1),o=e.lastConnectionInStack(!0);return o&&o!==e.nextConnection&&t.push(o),t}endDrag(e){if(this.block.isShadow()){let t;(t=this.block.getParent())==null||t.endDrag(e)}else{if(this.fireDragEndEvent(),this.fireMoveEvent(),no(),Ki(),this.connectionPreviewer.hidePreview(),!this.block.isDeadOrDying()&&this.dragging){let t;(t=this.workspace.getLayerManager())==null||t.moveOffDragLayer(this.block,Fo),this.block.setDragging(!1)}this.connectionCandidate?(this.applyConnections(this.connectionCandidate),this.disposeStep()):this.block.queueRender().then(()=>this.disposeStep()),this.inGroup||i.setGroup$$module$build$src$core$events$utils(!1)}}disposeStep(){this.block.snapToGrid(),this.connectionPreviewer.dispose(),this.workspace.setResizesEnabled(!0)}applyConnections(e){const{local:t,neighbour:o}=e;t.connect(o);const n=t.isSuperior()?o:t,u=this.block.getRootBlock();Ts().then(()=>{Ga(n.getSourceBlock()),setTimeout(()=>{u.bringToFront()},0)})}revertDrag(){if(this.block.isShadow()){let t;(t=this.block.getParent())==null||t.revertDrag()}else{var e;if((e=this.startChildConn)==null||e.connect(this.block.nextConnection),this.startParentConn)switch(this.startParentConn.type){case xe.INPUT_VALUE:this.startParentConn.connect(this.block.outputConnection);break;case xe.NEXT_STATEMENT:this.startParentConn.connect(this.block.previousConnection)}else{this.block.moveTo(this.startLoc,["drag"]);let t;(t=this.workspace.getLayerManager())==null||t.moveOffDragLayer(this.block,Fo),Ji(this.workspace,this.workspace.getMetricsManager().getScrollMetrics(!0),this.block)}this.startParentConn=this.startChildConn=null,this.connectionPreviewer.hidePreview(),this.connectionCandidate=null,this.block.setDragging(!1),this.dragging=!1}}},zv=class{constructor(){this.drawer=this.curNode=this.colour=null,this.type="marker"}setDrawer(e){this.drawer=e}getDrawer(){return this.drawer}getCurNode(){return this.curNode}setCurNode(e){const t=this.curNode;this.curNode=e,this.drawer&&this.drawer.draw(t,this.curNode)}draw(){this.drawer&&this.drawer.draw(this.curNode,this.curNode)}hide(){this.drawer&&this.drawer.hide()}dispose(){this.getDrawer()&&this.getDrawer().dispose()}},wp=class extends zv{constructor(){super(),this.type="cursor"}next(){var e=this.getCurNode();if(!e)return null;for(e=e.next();e&&e.next()&&(e.getType()===de.types.NEXT||e.getType()===de.types.BLOCK);)e=e.next();return e&&this.setCurNode(e),e}in(){var e=this.getCurNode();if(!e)return null;(e.getType()===de.types.PREVIOUS||e.getType()===de.types.OUTPUT)&&(e=e.next());let t,o;return(e=(o=(t=e)==null?void 0:t.in())!=null?o:null)&&this.setCurNode(e),e}prev(){var e=this.getCurNode();if(!e)return null;for(e=e.prev();e&&e.prev()&&(e.getType()===de.types.NEXT||e.getType()===de.types.BLOCK);)e=e.prev();return e&&this.setCurNode(e),e}out(){var e=this.getCurNode();return e?((e=e.out())&&e.getType()===de.types.BLOCK&&(e=e.prev()||e),e&&this.setCurNode(e),e):null}};r($e.CURSOR,Ws,wp);var Nr=class extends wp{constructor(){super()}next(){var e=this.getCurNode();return e?((e=this.getNextNode_(e,this.validNode_))&&this.setCurNode(e),e):null}in(){return this.next()}prev(){var e=this.getCurNode();return e?((e=this.getPreviousNode_(e,this.validNode_))&&this.setCurNode(e),e):null}out(){return this.prev()}getNextNode_(e,t){if(!e)return null;const o=e.in()||e.next();return t(o)?o:o?this.getNextNode_(o,t):(e=this.findSiblingOrParent(e.out()),t(e)?e:e?this.getNextNode_(e,t):null)}getPreviousNode_(e,t){if(!e)return null;let o=e.prev();return o=o?this.getRightMostChild(o):e.out(),t(o)?o:o?this.getPreviousNode_(o,t):null}validNode_(e){let t=!1;return e=e&&e.getType(),(e===de.types.OUTPUT||e===de.types.INPUT||e===de.types.FIELD||e===de.types.NEXT||e===de.types.PREVIOUS||e===de.types.WORKSPACE)&&(t=!0),t}findSiblingOrParent(e){if(!e)return null;const t=e.next();return t||this.findSiblingOrParent(e.out())}getRightMostChild(e){if(!e.in())return e;for(e=e.in();e&&e.next();)e=e.next();return this.getRightMostChild(e)}};Nr.registrationName="basicCursor",r($e.CURSOR,Nr.registrationName,Nr);var Uv=class extends Nr{validNode_(e){let t=!1;const o=e&&e.getType();return e&&(e=e.getLocation(),o===de.types.FIELD&&e&&e.isTabNavigable()&&e.isClickable()&&(t=!0)),t}},Hv=10,Kt=class extends Qe{constructor(e,t){super(e,t),this.highlighted=!1,this.targetConnection=null,this.db=e.workspace.connectionDBList[t],this.dbOpposite=e.workspace.connectionDBList[ki[t]],this.offsetInBlock=new ye(0,0),this.trackedState=Kt.TrackedState.WILL_TRACK}dispose(){super.dispose(),this.trackedState===Kt.TrackedState.TRACKED&&this.db.removeConnection(this,this.y);let e,t;(t=(e=this.sourceBlock_.pathObject).removeConnectionHighlight)==null||t.call(e,this)}getSourceBlock(){return super.getSourceBlock()}targetBlock(){return super.targetBlock()}distanceFrom(e){const t=this.x-e.x;return e=this.y-e.y,Math.sqrt(t*t+e*e)}bumpAwayFrom(e,t=!1){if(!this.sourceBlock_.workspace.isDragging()){var o=i.config$$module$build$src$core$config.snapRadius+Math.floor(Math.random()*Hv),n=i.config$$module$build$src$core$config.snapRadius+Math.floor(Math.random()*Hv),u=e.sourceBlock_.getRootBlock(),g=this.sourceBlock_.getRootBlock();if(!u.isInFlyout&&!g.isInFlyout){var I=!0;if(g.isMovable())u.isMovable()&&t&&(n=-n);else if(u.isMovable())I=!1,o=-o,n=-n;else return;t=I?e:this,e=I?this:e,u=I?g:u,(g=j()===u)||u.addSelect(),u.RTL&&(o=-o),u.moveBy(t.x+o-e.x,t.y+n-e.y,["bump"]),g||u.removeSelect()}}}moveTo(e,t){let o=!1;return this.trackedState===Kt.TrackedState.WILL_TRACK?(this.db.addConnection(this,t),this.trackedState=Kt.TrackedState.TRACKED,o=!0):this.trackedState===Kt.TrackedState.TRACKED&&(this.db.removeConnection(this,this.y),this.db.addConnection(this,t),o=!0),this.x=e,this.y=t,o}moveBy(e,t){return this.moveTo(this.x+e,this.y+t)}moveToOffset(e){return this.moveTo(e.x+this.offsetInBlock.x,e.y+this.offsetInBlock.y)}setOffsetInBlock(e,t){this.offsetInBlock.x=e,this.offsetInBlock.y=t}getOffsetInBlock(){return this.offsetInBlock}tightenEfficiently(){var e=this.targetConnection;const t=this.targetBlock();e&&t&&(e=ye.difference(this.offsetInBlock,e.offsetInBlock),t.translate(e.x,e.y))}closest(e,t){return this.dbOpposite.searchForClosest(this,e,t)}highlight(){this.highlighted=!0,this.getSourceBlock().queueRender()}unhighlight(){this.highlighted=!1,this.getSourceBlock().queueRender()}isHighlighted(){return this.highlighted}setTracking(e){e&&this.trackedState===Kt.TrackedState.TRACKED||!e&&this.trackedState===Kt.TrackedState.UNTRACKED||this.sourceBlock_.isInFlyout||(e?(this.db.addConnection(this,this.y),this.trackedState=Kt.TrackedState.TRACKED):(this.trackedState===Kt.TrackedState.TRACKED&&this.db.removeConnection(this,this.y),this.trackedState=Kt.TrackedState.UNTRACKED))}stopTrackingAll(){if(this.setTracking(!1),this.targetConnection){const e=this.targetBlock().getDescendants(!1);for(let t=0;tclearTimeout(e)),this.warningTextDb.clear(),this.getIcons().forEach(e=>e.dispose())}checkAndDelete(){this.workspace.isFlyout||(i.setGroup$$module$build$src$core$events$utils(!0),this.workspace.hideChaff(),this.outputConnection?this.dispose(!1,!0):this.dispose(!0,!0),i.setGroup$$module$build$src$core$events$utils(!1))}toCopyData(){return this.isInsertionMarker_?null:{paster:Rr.TYPE,blockState:os(this,{addCoordinates:!0,addNextBlocks:!1}),typeCounts:Ie(this,!0)}}applyColour(){this.pathObject.applyColour(this);const e=this.getIcons();for(let t=0;t{this.isDeadOrDying()||(this.warningTextDb.delete(t),this.setWarningText(e,t))},100));else if(this.isInFlyout&&(e=null),o=this.getIcon(wo.TYPE),e){let n=this.getSurroundParent(),u=null;for(;n;)n.isCollapsed()&&(u=n),n=n.getSurroundParent();u&&u.setWarningText(i.Msg$$module$build$src$core$msg.COLLAPSED_WARNINGS_WARNING,$s.COLLAPSED_WARNING_ID),o?o.addMessage(e,t):this.addIcon(new wo(this).addMessage(e,t))}else o&&(t?(o.addMessage("",t),o.getText()||this.removeIcon(wo.TYPE)):this.removeIcon(wo.TYPE))}setMutator(e){this.removeIcon(i.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE),e&&this.addIcon(e)}addIcon(e){return super.addIcon(e),e instanceof i.MutatorIcon$$module$build$src$core$icons$mutator_icon&&(this.mutator=e),e.initView(this.createIconPointerDownListener(e)),e.applyColour(),e.updateEditable(),this.queueRender(),e}createIconPointerDownListener(e){return t=>{this.isDeadOrDying()||(t=this.workspace.getGesture(t))&&t.setStartIcon(e)}}removeIcon(e){const t=super.removeIcon(e);return e.equals(i.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE)&&(this.mutator=null),this.queueRender(),t}setEnabled(e){w("setEnabled","v11","v12","the setDisabledReason method of BlockSvg");const t=this.isEnabled();super.setEnabled(e),this.isEnabled()===t||this.getInheritedDisabled()||this.updateDisabled()}setDisabledReason(e,t){const o=this.isEnabled();super.setDisabledReason(e,t),this.isEnabled()===o||this.getInheritedDisabled()||this.updateDisabled()}setHighlighted(e){this.pathObject.updateHighlighted(e)}addSelect(){this.pathObject.updateSelected(!0)}removeSelect(){this.pathObject.updateSelected(!1)}setDeleteStyle(e){this.pathObject.updateDraggingDelete(e)}getColour(){return this.style.colourPrimary}setColour(e){super.setColour(e),e=this.workspace.getRenderer().getConstants().getBlockStyleForColour(this.colour_),this.pathObject.setStyle(e.style),this.style=e.style,this.styleName_=e.name,this.applyColour()}setStyle(e){const t=this.workspace.getRenderer().getConstants().getBlockStyle(e);if(this.styleName_=e,t)this.hat=t.hat,this.pathObject.setStyle(t),this.colour_=t.colourPrimary,this.style=t,this.applyColour();else throw Error("Invalid style name: "+e)}getStyle(){return this.style}bringToFront(e=!1){let t=this;if(!t.isDeadOrDying())do{const o=t.getSvgRoot(),n=o.parentNode,u=n.childNodes;if(u[u.length-1]!==o&&n.appendChild(o),e)break;t=t.getParent()}while(t)}setPreviousStatement(e,t){super.setPreviousStatement(e,t),this.queueRender()}setNextStatement(e,t){super.setNextStatement(e,t),this.queueRender()}setOutput(e,t){super.setOutput(e,t),this.queueRender()}setInputsInline(e){super.setInputsInline(e),this.queueRender()}removeInput(e,t){return e=super.removeInput(e,t),this.queueRender(),e}moveNumberedInputBefore(e,t){super.moveNumberedInputBefore(e,t),this.queueRender()}appendInput(e){return super.appendInput(e),this.queueRender(),e}setConnectionTracking(e){if(this.previousConnection&&this.previousConnection.setTracking(e),this.outputConnection&&this.outputConnection.setTracking(e),this.nextConnection){this.nextConnection.setTracking(e);var t=this.nextConnection.targetBlock();t&&t.setConnectionTracking(e)}if(!this.collapsed_)for(t=0;t=this.workspace.options.maxTrashcanContents||(e=new gs({scrollbars:!0,parentWorkspace:this.workspace,rtl:this.workspace.RTL,oneBasedIndex:this.workspace.options.oneBasedIndex,renderer:this.workspace.options.renderer,rendererOverrides:this.workspace.options.rendererOverrides,move:{scrollbars:!0}}),this.workspace.horizontalLayout?(e.toolboxPosition=this.workspace.toolboxPosition===Ge.TOP?Ge.BOTTOM:Ge.TOP,this.flyout=new(y($e.FLYOUTS_HORIZONTAL_TOOLBOX,this.workspace.options,!0))(e)):(e.toolboxPosition=this.workspace.toolboxPosition===Ge.RIGHT?Ge.LEFT:Ge.RIGHT,this.flyout=new(y($e.FLYOUTS_VERTICAL_TOOLBOX,this.workspace.options,!0))(e)),this.workspace.addChangeListener(this.onDelete.bind(this)))}createDom(){this.svgGroup=ie(J.G,{class:"blocklyTrash"});let e;const t=String(Math.random()).substring(2);e=ie(J.CLIPPATH,{id:"blocklyTrashBodyClipPath"+t},this.svgGroup),ie(J.RECT,{width:mn,height:Hl,y:fn},e);const o=ie(J.IMAGE,{width:Wt.width,x:-Cp,height:Wt.height,y:-Tp,"clip-path":"url(#blocklyTrashBodyClipPath"+t+")"},this.svgGroup);return o.setAttributeNS(is,"xlink:href",this.workspace.options.pathToMedia+Wt.url),e=ie(J.CLIPPATH,{id:"blocklyTrashLidClipPath"+t},this.svgGroup),ie(J.RECT,{width:mn,height:fn},e),this.svgLid=ie(J.IMAGE,{width:Wt.width,x:-Cp,height:Wt.height,y:-Tp,"clip-path":"url(#blocklyTrashLidClipPath"+t+")"},this.svgGroup),this.svgLid.setAttributeNS(is,"xlink:href",this.workspace.options.pathToMedia+Wt.url),ue(this.svgGroup,"pointerdown",this,this.blockMouseDownWhenOpenable),ue(this.svgGroup,"pointerup",this,this.click),ue(o,"pointerover",this,this.mouseOver),ue(o,"pointerout",this,this.mouseOut),this.animateLid(),this.svgGroup}init(){0{let o;(o=this.flyout)==null||o.show(e),t.cursor="";let n;(n=this.workspace.scrollbar)==null||n.setVisible(!1)},10),this.fireUiEvent(!0)}}closeFlyout(){if(this.contentsIsOpen()){var e;(e=this.flyout)==null||e.hide();var t;(t=this.workspace.scrollbar)==null||t.setVisible(!0),this.fireUiEvent(!1),this.workspace.recordDragTargets()}}autoHide(e){!e&&this.flyout&&this.closeFlyout()}emptyContents(){this.hasContents()&&(this.contents.length=0,this.setMinOpenness(0),this.closeFlyout())}position(e,t){if(this.initialized){var o=wa(this.workspace,e);e=_a(o,new Xe(mn,Hl+fn),rT,Vv,e,this.workspace),t=ka(e,Vv,o.vertical===$o.TOP?Po.DOWN:Po.UP,t),this.top=t.top,this.left=t.left;var n;(n=this.svgGroup)==null||n.setAttribute("transform","translate("+this.left+","+this.top+")");var u;(u=this.flyout)==null||u.position()}}getBoundingRectangle(){return new rt(this.top,this.top+Hl+fn,this.left,this.left+mn)}getClientRect(){if(!this.svgGroup)return null;var e=this.svgGroup.getBoundingClientRect();const t=e.top+Tp-Wl;return e=e.left+Cp-Wl,new rt(t,t+fn+Hl+2*Wl,e,e+mn+2*Wl)}onDragOver(e){this.setLidOpen(this.wouldDelete_)}onDragExit(e){this.setLidOpen(!1)}onDrop(e){setTimeout(this.setLidOpen.bind(this,!1),100)}setLidOpen(e){this.isLidOpen!==e&&(this.lidTask&&clearTimeout(this.lidTask),this.isLidOpen=e,this.animateLid())}animateLid(){const e=cT;var t=1/(e+1);this.lidOpen+=this.isLidOpen?t:-t,this.lidOpen=Math.min(Math.max(this.lidOpen,this.minOpenness),1),this.setLidAngle(this.lidOpen*Yv),t=Kv+this.lidOpen*(uT-Kv),this.svgGroup&&(this.svgGroup.style.opacity=`${t}`),this.lidOpen>this.minOpenness&&1>this.lidOpen&&(this.lidTask=setTimeout(this.animateLid.bind(this),lT/e))}setLidAngle(e){const t=this.workspace.toolboxPosition===Ge.RIGHT||this.workspace.horizontalLayout&&this.workspace.RTL;let o;(o=this.svgLid)==null||o.setAttribute("transform","rotate("+(t?-e:e)+","+(t?4:mn-4)+","+(fn-2)+")")}setMinOpenness(e){this.minOpenness=e,this.isLidOpen||this.setLidAngle(e*Yv)}closeLid(){this.setLidOpen(!1)}click(){this.hasContents()&&!this.workspace.isDragging()&&this.openFlyout()}fireUiEvent(e){e=new(ne(ee.TRASHCAN_OPEN))(e,this.workspace.id),z(e)}blockMouseDownWhenOpenable(e){!this.contentsIsOpen()&&this.hasContents()&&e.stopPropagation()}mouseOver(){this.hasContents()&&this.setLidOpen(!0)}mouseOut(){this.setLidOpen(!1)}onDelete(e){if(!(0>=this.workspace.options.maxTrashcanContents||!S(e)||e.wasShadow)){if(!e.oldJson)throw Error("Encountered a delete event without proper oldJson");if(e=JSON.stringify(this.cleanBlockJson(e.oldJson)),!this.contents.includes(e)){for(this.contents.unshift(e);this.contents.length>this.workspace.options.maxTrashcanContents;)this.contents.pop();this.setMinOpenness(aT)}}}cleanBlockJson(e){function t(o){if(o){if(delete o.id,delete o.x,delete o.y,delete o.enabled,delete o.disabledReasons,o.icons&&o.icons.comment){var n=o.icons.comment;delete n.height,delete n.width,delete n.pinned}n=o.inputs;for(var u in n){var g=n[u];const I=g.block;g=g.shadow,I&&t(I),g&&t(g)}o.next&&(u=o.next,o=u.block,u=u.shadow,o&&t(o),u&&t(u))}}return e=JSON.parse(JSON.stringify(e)),t(e),Object.assign({},{kind:"BLOCK"},e)}},mn=47,Hl=44,fn=16,Vv=20,rT=20,Wl=10,Cp=0,Tp=32,aT=.1,lT=80,cT=4,Kv=.4,uT=.8,Yv=45,st=class{constructor(){this.shortcuts=new Map,this.keyMap=new Map,this.reset()}reset(){this.shortcuts.clear(),this.keyMap.clear()}register(e,t){if(this.shortcuts.get(e.name)&&!t)throw Error(`Shortcut named "${e.name}" already exists.`);if(this.shortcuts.set(e.name,e),t=e.keyCodes,t!=null&&t.length)for(const o of t)this.addKeyMapping(o,e.name,!!e.allowCollision)}unregister(e){return this.shortcuts.get(e)?(this.removeAllKeyMappings(e),this.shortcuts.delete(e),!0):(console.warn(`Keyboard shortcut named "${e}" not found.`),!1)}addKeyMapping(e,t,o){e=`${e}`;const n=this.keyMap.get(e);if(n&&!o)throw Error(`Shortcut named "${t}" collides with shortcuts "${n}"`);n&&o?n.unshift(t):this.keyMap.set(e,[t])}removeKeyMapping(e,t,o){const n=this.keyMap.get(e);if(!n)return o||console.warn(`No keyboard shortcut named "${t}" registered with key code "${e}"`),!1;const u=n.indexOf(t);return-1Yd(t)),e.length?e:null}load(e,t){const o=t.getProcedureMap();for(const n of e)o.add(Jd(this.procedureModelClass,this.parameterModelClass,n,t))}clear(e){e.getProcedureMap().clear()}},Gl={};Gl.ProcedureSerializer=hT,Gl.loadProcedure=Jd,Gl.saveProcedure=Yd;var Jv=class{constructor(){this.priority=Wb}save(e){const t=[];for(const o of e.getAllVariables())e={name:o.name,id:o.getId()},o.type&&(e.type=o.type),t.push(e);return t.length?t:null}load(e,t){for(const o of e)t.createVariable(o.name,o.type,o.id)}clear(e){e.getVariableMap().clear()}};Vn("variables",new Jv);var qv={};qv.VariableSerializer=Jv;var Ip={};Ip.load=X$,Ip.save=q$;var pT={blocks:_r,exceptions:pi,priorities:UC,procedures:Gl,registry:Dh,variables:qv,workspaceComments:hl,workspaces:Ip},xp=class{constructor(e,t,o,n,u){this.workspace=e,this.oldHostMetrics=this.corner_=this.vScroll=this.hScroll=null,t=t===void 0?!0:t,o=o===void 0?!0:o;const g=t&&o;t&&(this.hScroll=new yt(e,!0,g,n,u)),o&&(this.vScroll=new yt(e,!1,g,n,u)),g&&(this.corner_=ie(J.RECT,{height:yt.scrollbarThickness,width:yt.scrollbarThickness,class:"blocklyScrollbarBackground"}),At(this.corner_,e.getBubbleCanvas()))}dispose(){Ze(this.corner_),this.oldHostMetrics=this.corner_=null,this.hScroll&&(this.hScroll.dispose(),this.hScroll=null),this.vScroll&&(this.vScroll.dispose(),this.vScroll=null)}resize(){const e=this.workspace.getMetrics();if(e){var t=!1,o=!1;if(this.oldHostMetrics&&this.oldHostMetrics.viewWidth===e.viewWidth&&this.oldHostMetrics.viewHeight===e.viewHeight&&this.oldHostMetrics.absoluteTop===e.absoluteTop&&this.oldHostMetrics.absoluteLeft===e.absoluteLeft?(this.oldHostMetrics&&this.oldHostMetrics.scrollWidth===e.scrollWidth&&this.oldHostMetrics.viewLeft===e.viewLeft&&this.oldHostMetrics.scrollLeft===e.scrollLeft||(t=!0),this.oldHostMetrics&&this.oldHostMetrics.scrollHeight===e.scrollHeight&&this.oldHostMetrics.viewTop===e.viewTop&&this.oldHostMetrics.scrollTop===e.scrollTop||(o=!0)):o=t=!0,t||o){try{i.disable$$module$build$src$core$events$utils(),this.hScroll&&t&&this.hScroll.resize(e),this.vScroll&&o&&this.vScroll.resize(e)}finally{i.enable$$module$build$src$core$events$utils()}this.workspace.maybeFireViewportChangeEvent()}if(this.hScroll&&this.vScroll){if(!this.oldHostMetrics||this.oldHostMetrics.viewWidth!==e.viewWidth||this.oldHostMetrics.absoluteLeft!==e.absoluteLeft){let n;(n=this.corner_)==null||n.setAttribute("x",String(this.vScroll.position.x))}if(!this.oldHostMetrics||this.oldHostMetrics.viewHeight!==e.viewHeight||this.oldHostMetrics.absoluteTop!==e.absoluteTop){let n;(n=this.corner_)==null||n.setAttribute("y",String(this.hScroll.position.y))}}this.oldHostMetrics=e}}canScrollHorizontally(){return!!this.hScroll}canScrollVertically(){return!!this.vScroll}setOrigin(e,t){this.hScroll&&this.hScroll.setOrigin(e,t),this.vScroll&&this.vScroll.setOrigin(e,t)}set(e,t,o){this.hScroll&&this.hScroll.set(e,!1),this.vScroll&&this.vScroll.set(t,!1),(o||o===void 0)&&(e={},this.hScroll&&(e.x=this.hScroll.getRatio_()),this.vScroll&&(e.y=this.vScroll.getRatio_()),this.workspace.setMetrics(e))}setX(e){this.hScroll&&this.hScroll.set(e,!0)}setY(e){this.vScroll&&this.vScroll.set(e,!0)}setContainerVisible(e){this.hScroll&&this.hScroll.setContainerVisible(e),this.vScroll&&this.vScroll.setContainerVisible(e)}isVisible(){let e=!1;return this.hScroll&&(e=this.hScroll.isVisible()),this.vScroll&&(e=e||this.vScroll.isVisible()),e}setVisible(e){this.hScroll&&this.hScroll.setVisibleInternal(e),this.vScroll&&this.vScroll.setVisibleInternal(e)}resizeContent(e){this.hScroll&&this.hScroll.resizeContentHorizontal(e),this.vScroll&&this.vScroll.resizeContentVertical(e)}resizeView(e){this.hScroll&&this.hScroll.resizeViewHorizontal(e),this.vScroll&&this.vScroll.resizeViewVertical(e)}},Dp=class{constructor(e){this.workspace_=e}getDimensionsPx_(e){let t=0,o=0;return e&&(t=e.getWidth(),o=e.getHeight()),new Xe(t,o)}getFlyoutMetrics(e){return e=this.getDimensionsPx_(this.workspace_.getFlyout(e)),{width:e.width,height:e.height,position:this.workspace_.toolboxPosition}}getToolboxMetrics(){const e=this.getDimensionsPx_(this.workspace_.getToolbox());return{width:e.width,height:e.height,position:this.workspace_.toolboxPosition}}getSvgMetrics(){return this.workspace_.getCachedParentSvgSize()}getAbsoluteMetrics(){let e=0,t=0;const o=this.getToolboxMetrics(),n=this.getFlyoutMetrics(),u=!!this.workspace_.getToolbox();var g;const I=!((g=this.workspace_.getFlyout())!=null&&g.autoClose);g=u?o.position:n.position;const L=g===Ge.TOP;return g===Ge.LEFT&&(u&&(e+=o.width),I&&(e+=n.width)),L&&(u&&(t+=o.height),I&&(t+=n.height)),{top:t,left:e}}getViewMetrics(e){e=e?this.workspace_.scale:1;const t=this.getSvgMetrics(),o=this.getToolboxMetrics(),n=this.getFlyoutMetrics(),u=!!this.workspace_.getToolbox();var g;const I=!((g=this.workspace_.getFlyout())!=null&&g.autoClose);g=u?o.position:n.position;const L=g===Ge.LEFT||g===Ge.RIGHT;return(g===Ge.TOP||g===Ge.BOTTOM)&&(u&&(t.height-=o.height),I&&(t.height-=n.height)),L&&(u&&(t.width-=o.width),I&&(t.width-=n.width)),{height:t.height/e,width:t.width/e,top:-this.workspace_.scrollY/e,left:-this.workspace_.scrollX/e}}getContentMetrics(e){e=e?1:this.workspace_.scale;const t=this.workspace_.getBlocksBoundingBox();return{height:(t.bottom-t.top)*e,width:(t.right-t.left)*e,top:t.top*e,left:t.left*e}}hasFixedEdges(){return!this.workspace_.isMovableHorizontally()||!this.workspace_.isMovableVertically()}getComputedFixedEdges_(e){if(!this.hasFixedEdges())return{};const t=this.workspace_.isMovableHorizontally(),o=this.workspace_.isMovableVertically();e=e||this.getViewMetrics(!1);const n={};return o||(n.top=e.top,n.bottom=e.top+e.height),t||(n.left=e.left,n.right=e.left+e.width),n}getPaddedContent_(e,t){const o=t.top+t.height,n=t.left+t.width,u=e.width;e=e.height;const g=u/2,I=e/2;return{top:Math.min(t.top-I,o-e),bottom:Math.max(o+I,t.top+e),left:Math.min(t.left-g,n-u),right:Math.max(n+g,t.left+u)}}getScrollMetrics(e,t,o){e=e?this.workspace_.scale:1,t=t||this.getViewMetrics(!1);var n=o||this.getContentMetrics();o=this.getComputedFixedEdges_(t),t=this.getPaddedContent_(t,n),n=o.top!==void 0?o.top:t.top;const u=o.left!==void 0?o.left:t.left;return{top:n/e,left:u/e,width:((o.right!==void 0?o.right:t.right)-u)/e,height:((o.bottom!==void 0?o.bottom:t.bottom)-n)/e}}getUiMetrics(){return{viewMetrics:this.getViewMetrics(),absoluteMetrics:this.getAbsoluteMetrics(),toolboxMetrics:this.getToolboxMetrics()}}getMetrics(){const e=this.getToolboxMetrics(),t=this.getFlyoutMetrics(!0),o=this.getSvgMetrics(),n=this.getAbsoluteMetrics(),u=this.getViewMetrics(),g=this.getContentMetrics(),I=this.getScrollMetrics(!1,u,g);return{contentHeight:g.height,contentWidth:g.width,contentTop:g.top,contentLeft:g.left,scrollHeight:I.height,scrollWidth:I.width,scrollTop:I.top,scrollLeft:I.left,viewHeight:u.height,viewWidth:u.width,viewTop:u.top,viewLeft:u.left,absoluteTop:n.top,absoluteLeft:n.left,svgHeight:o.height,svgWidth:o.width,toolboxWidth:e.width,toolboxHeight:e.height,toolboxPosition:e.position,flyoutWidth:t.width,flyoutHeight:t.height}}};r($e.METRICS_MANAGER,Ws,Dp),"Blockly"in globalThis||(globalThis.Blockly={Msg:ev});var Xv=class extends Pl{constructor(){super(),this.GRID_UNIT=4,this.CURSOR_COLOUR="#ffa200",this.CURSOR_RADIUS=5,this.JAGGED_TEETH_WIDTH=this.JAGGED_TEETH_HEIGHT=0,this.START_HAT_HEIGHT=22,this.START_HAT_WIDTH=96,this.SHAPES={HEXAGONAL:1,ROUND:2,SQUARE:3,PUZZLE:4,NOTCH:5},this.SHAPE_IN_SHAPE_PADDING={1:{0:5*this.GRID_UNIT,1:2*this.GRID_UNIT,2:5*this.GRID_UNIT,3:5*this.GRID_UNIT},2:{0:3*this.GRID_UNIT,1:3*this.GRID_UNIT,2:1*this.GRID_UNIT,3:2*this.GRID_UNIT},3:{0:2*this.GRID_UNIT,1:2*this.GRID_UNIT,2:2*this.GRID_UNIT,3:2*this.GRID_UNIT}},this.FULL_BLOCK_FIELDS=!0,this.FIELD_TEXT_FONTWEIGHT="bold",this.FIELD_TEXT_FONTFAMILY='"Helvetica Neue", "Segoe UI", Helvetica, sans-serif',this.FIELD_COLOUR_FULL_BLOCK=this.FIELD_TEXTINPUT_BOX_SHADOW=this.FIELD_DROPDOWN_SVG_ARROW=this.FIELD_DROPDOWN_COLOURED_DIV=this.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW=!0,this.SELECTED_GLOW_COLOUR="#fff200",this.SELECTED_GLOW_SIZE=.5,this.REPLACEMENT_GLOW_COLOUR="#fff200",this.REPLACEMENT_GLOW_SIZE=2,this.selectedGlowFilterId="",this.selectedGlowFilter=null,this.replacementGlowFilterId="",this.SQUARED=this.ROUNDED=this.HEXAGONAL=this.replacementGlowFilter=null,this.SMALL_PADDING=this.GRID_UNIT,this.MEDIUM_PADDING=2*this.GRID_UNIT,this.MEDIUM_LARGE_PADDING=3*this.GRID_UNIT,this.LARGE_PADDING=4*this.GRID_UNIT,this.CORNER_RADIUS=1*this.GRID_UNIT,this.NOTCH_WIDTH=9*this.GRID_UNIT,this.NOTCH_HEIGHT=2*this.GRID_UNIT,this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT=3*this.GRID_UNIT,this.MIN_BLOCK_WIDTH=2*this.GRID_UNIT,this.MIN_BLOCK_HEIGHT=12*this.GRID_UNIT,this.EMPTY_STATEMENT_INPUT_HEIGHT=6*this.GRID_UNIT,this.TOP_ROW_MIN_HEIGHT=this.CORNER_RADIUS,this.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING,this.BOTTOM_ROW_MIN_HEIGHT=this.CORNER_RADIUS,this.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT=6*this.GRID_UNIT,this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT,this.STATEMENT_INPUT_SPACER_MIN_WIDTH=40*this.GRID_UNIT,this.STATEMENT_INPUT_PADDING_LEFT=4*this.GRID_UNIT,this.EMPTY_INLINE_INPUT_PADDING=4*this.GRID_UNIT,this.EMPTY_INLINE_INPUT_HEIGHT=8*this.GRID_UNIT,this.DUMMY_INPUT_MIN_HEIGHT=8*this.GRID_UNIT,this.DUMMY_INPUT_SHADOW_MIN_HEIGHT=6*this.GRID_UNIT,this.CURSOR_WS_WIDTH=20*this.GRID_UNIT,this.FIELD_TEXT_FONTSIZE=3*this.GRID_UNIT,this.FIELD_BORDER_RECT_RADIUS=this.CORNER_RADIUS,this.FIELD_BORDER_RECT_X_PADDING=2*this.GRID_UNIT,this.FIELD_BORDER_RECT_Y_PADDING=1.625*this.GRID_UNIT,this.FIELD_BORDER_RECT_HEIGHT=8*this.GRID_UNIT,this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=8*this.GRID_UNIT,this.FIELD_DROPDOWN_SVG_ARROW_PADDING=this.FIELD_BORDER_RECT_X_PADDING,this.FIELD_COLOUR_DEFAULT_WIDTH=6*this.GRID_UNIT,this.FIELD_COLOUR_DEFAULT_HEIGHT=8*this.GRID_UNIT,this.FIELD_CHECKBOX_X_OFFSET=1*this.GRID_UNIT,this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH=12*this.GRID_UNIT}setFontConstants_(e){super.setFontConstants_(e),this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT=this.FIELD_TEXT_HEIGHT+2*this.FIELD_BORDER_RECT_Y_PADDING}init(){super.init(),this.HEXAGONAL=this.makeHexagonal(),this.ROUNDED=this.makeRounded(),this.SQUARED=this.makeSquared(),this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT+this.INSIDE_CORNERS.rightWidth}setDynamicProperties_(e){super.setDynamicProperties_(e),this.SELECTED_GLOW_COLOUR=e.getComponentStyle("selectedGlowColour")||this.SELECTED_GLOW_COLOUR;const t=Number(e.getComponentStyle("selectedGlowSize"));this.SELECTED_GLOW_SIZE=t&&!isNaN(t)?t:this.SELECTED_GLOW_SIZE,this.REPLACEMENT_GLOW_COLOUR=e.getComponentStyle("replacementGlowColour")||this.REPLACEMENT_GLOW_COLOUR,this.REPLACEMENT_GLOW_SIZE=(e=Number(e.getComponentStyle("replacementGlowSize")))&&!isNaN(e)?e:this.REPLACEMENT_GLOW_SIZE}dispose(){super.dispose(),this.selectedGlowFilter&&Ze(this.selectedGlowFilter),this.replacementGlowFilter&&Ze(this.replacementGlowFilter)}makeStartHat(){const e=this.START_HAT_HEIGHT,t=this.START_HAT_WIDTH,o=Xt("c",[Me(25,-e),Me(71,-e),Me(t,0)]);return{height:e,width:t,path:o}}makeHexagonal(){function e(o,n,u){var g=o/2;return g=g>t?t:g,u=u?-1:1,o=(n?-1:1)*o/2,Hs(-u*g,o)+Hs(u*g,o)}const t=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH;return{type:this.SHAPES.HEXAGONAL,isDynamic:!0,width(o){return o/=2,o>t?t:o},height(o){return o},connectionOffsetY(o){return o/2},connectionOffsetX(o){return-o},pathDown(o){return e(o,!1,!1)},pathUp(o){return e(o,!0,!1)},pathRightDown(o){return e(o,!1,!0)},pathRightUp(o){return e(o,!1,!0)}}}makeRounded(){function e(n,u,g){const I=n>o?n-o:0;n=(n>o?o:n)/2;const L=g===u?"0":"1";return vt("a","0 0,"+L,n,Me((g?1:-1)*n,(u?-1:1)*n))+De("v",(u?-1:1)*I)+vt("a","0 0,"+L,n,Me((g?-1:1)*n,(u?-1:1)*n))}const t=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH,o=2*t;return{type:this.SHAPES.ROUND,isDynamic:!0,width(n){return n/=2,n>t?t:n},height(n){return n},connectionOffsetY(n){return n/2},connectionOffsetX(n){return-n},pathDown(n){return e(n,!1,!1)},pathUp(n){return e(n,!0,!1)},pathRightDown(n){return e(n,!1,!0)},pathRightUp(n){return e(n,!1,!0)}}}makeSquared(){function e(o,n,u){o-=2*t;const g=u===n?"0":"1";return vt("a","0 0,"+g,t,Me((u?1:-1)*t,(n?-1:1)*t))+De("v",(n?-1:1)*o)+vt("a","0 0,"+g,t,Me((u?-1:1)*t,(n?-1:1)*t))}const t=this.CORNER_RADIUS;return{type:this.SHAPES.SQUARE,isDynamic:!0,width(o){return t},height(o){return o},connectionOffsetY(o){return o/2},connectionOffsetX(o){return-o},pathDown(o){return e(o,!1,!1)},pathUp(o){return e(o,!0,!1)},pathRightDown(o){return e(o,!1,!0)},pathRightUp(o){return e(o,!1,!0)}}}shapeFor(e){let t=e.getCheck();switch(!t&&e.targetConnection&&(t=e.targetConnection.getCheck()),e.type){case xe.INPUT_VALUE:case xe.OUTPUT_VALUE:if(e=e.getSourceBlock().getOutputShape(),e!==null)switch(e){case this.SHAPES.HEXAGONAL:return this.HEXAGONAL;case this.SHAPES.ROUND:return this.ROUNDED;case this.SHAPES.SQUARE:return this.SQUARED}return t&&t.includes("Boolean")?this.HEXAGONAL:t&&t.includes("Number")?this.ROUNDED:(t&&t.includes("String"),this.ROUNDED);case xe.PREVIOUS_STATEMENT:case xe.NEXT_STATEMENT:return this.NOTCH;default:throw Error("Unknown type")}}makeNotch(){function e(Ee){return Xt("c",[Me(Ee*u/2,0),Me(Ee*u*3/4,I/2),Me(Ee*u,I)])+Yi([Me(Ee*u,g)])+Xt("c",[Me(Ee*u/4,I/2),Me(Ee*u/2,I),Me(Ee*u,I)])+De("h",Ee*n)+Xt("c",[Me(Ee*u/2,0),Me(Ee*u*3/4,-(I/2)),Me(Ee*u,-I)])+Yi([Me(Ee*u,-g)])+Xt("c",[Me(Ee*u/4,-(I/2)),Me(Ee*u/2,-I),Me(Ee*u,-I)])}const t=this.NOTCH_WIDTH,o=this.NOTCH_HEIGHT,n=t/3,u=n/3,g=o/2,I=g/2,L=e(1),le=e(-1);return{type:this.SHAPES.NOTCH,width:t,height:o,pathLeft:L,pathRight:le}}makeInsideCorners(){const e=this.CORNER_RADIUS,t=vt("a","0 0,0",e,Me(-e,e)),o=vt("a","0 0,1",e,Me(-e,e)),n=vt("a","0 0,0",e,Me(e,e)),u=vt("a","0 0,1",e,Me(e,e));return{width:e,height:e,pathTop:t,pathBottom:n,rightWidth:e,rightHeight:e,pathTopRight:o,pathBottomRight:u}}generateSecondaryColour_(e){return si("#000",e,.15)||e}generateTertiaryColour_(e){return si("#000",e,.25)||e}createDom(e,t,o){super.createDom(e,t,o),e=ie(J.DEFS,{},e),t=ie(J.FILTER,{id:"blocklySelectedGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},e),ie(J.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.SELECTED_GLOW_SIZE},t),o=ie(J.FECOMPONENTTRANSFER,{result:"outBlur"},t),ie(J.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},o),ie(J.FEFLOOD,{"flood-color":this.SELECTED_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},t),ie(J.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},t),this.selectedGlowFilterId=t.id,this.selectedGlowFilter=t,e=ie(J.FILTER,{id:"blocklyReplacementGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},e),ie(J.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.REPLACEMENT_GLOW_SIZE},e),t=ie(J.FECOMPONENTTRANSFER,{result:"outBlur"},e),ie(J.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},t),ie(J.FEFLOOD,{"flood-color":this.REPLACEMENT_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},e),ie(J.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},e),ie(J.FECOMPOSITE,{in:"SourceGraphic",in2:"outGlow",operator:"over"},e),this.replacementGlowFilterId=e.id,this.replacementGlowFilter=e}getCSS_(e){return[`${e} .blocklyText,`,`${e} .blocklyFlyoutLabelText {`,`font: ${this.FIELD_TEXT_FONTWEIGHT} ${this.FIELD_TEXT_FONTSIZE}pt ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${e} .blocklyTextInputBubble textarea {`,"font-weight: normal;","}",`${e} .blocklyText {`,"fill: #fff;","}",`${e} .blocklyNonEditableText>rect:not(.blocklyDropdownRect),`,`${e} .blocklyEditableText>rect:not(.blocklyDropdownRect) {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"}",`${e} .blocklyNonEditableText>text,`,`${e} .blocklyEditableText>text,`,`${e} .blocklyNonEditableText>g>text,`,`${e} .blocklyEditableText>g>text {`,"fill: #575E75;","}",`${e} .blocklyFlyoutLabelText {`,"fill: #575E75;","}",`${e} .blocklyText.blocklyBubbleText {`,"fill: #575E75;","}",`${e} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableText:not(.editing):hover>rect,",`${e} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableText:not(.editing):hover>.blocklyPath {","stroke: #fff;","stroke-width: 2;","}",`${e} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,"color: #575E75;","}",`${e} .blocklyDropdownText {`,"fill: #fff !important;","}",`${e}.blocklyWidgetDiv .blocklyMenuItem,`,`${e}.blocklyDropDownDiv .blocklyMenuItem {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${e}.blocklyDropDownDiv .blocklyMenuItemContent {`,"color: #fff;","}",`${e} .blocklyHighlightedConnectionPath {`,`stroke: ${this.SELECTED_GLOW_COLOUR};`,"}",`${e} .blocklyDisabled > .blocklyOutlinePath {`,`fill: url(#blocklyDisabledPattern${this.randomIdentifier})`,"}",`${e} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"]}},Zv=class extends Bl{constructor(e,t){super(e,t)}draw(){const e=this.block_.pathObject;e.beginDrawing(),this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights(),e.setPath(this.outlinePath_+` -`+this.inlinePath_),this.info_.RTL&&e.flipRTL(),this.recordSizeOnBlock_(),this.info_.outputConnection&&(e.outputShapeType=this.info_.outputConnection.shape.type),e.endDrawing()}drawOutline_(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape&&!this.info_.hasStatementInput&&!this.info_.bottomRow.hasNextConnection?(this.drawFlatTop_(),this.drawRightDynamicConnection_(),this.drawFlatBottom_(),this.drawLeftDynamicConnection_()):super.drawOutline_()}drawLeft_(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape?this.drawLeftDynamicConnection_():super.drawLeft_()}drawRightSideRow_(e){if(!(0>=e.height)){if(F.isSpacer(e)){const n=e.precedesStatement;var t=e.followsStatement;if(n||t){const u=this.constants_.INSIDE_CORNERS;var o=u.rightHeight;o=e.height-(n?o:0),t=t?u.pathBottomRight:"",e=0=o||0>=t)throw Error("Height and width values of an image field must be greater than 0.");this.size_=new Xe(t,o+Ci.Y_PADDING),this.imageHeight=o,typeof u=="function"&&(this.clickHandler=u),e!==lt.SKIP_SETUP&&(I?this.configure_(I):(this.flipRtl=!!g,this.altText=bt(n)||""),this.setValue(bt(e)))}configure_(e){super.configure_(e),e.flipRtl&&(this.flipRtl=e.flipRtl),e.alt&&(this.altText=bt(e.alt))}initView(){this.imageElement=ie(J.IMAGE,{height:this.imageHeight+"px",width:this.size_.width+"px",alt:this.altText},this.fieldGroup_),this.imageElement.setAttributeNS(is,"xlink:href",this.value_),this.clickHandler&&(this.imageElement.style.cursor="pointer")}updateSize_(){}doClassValidation_(e){return typeof e!="string"?null:e}doValueUpdate_(e){this.value_=e,this.imageElement&&this.imageElement.setAttributeNS(is,"xlink:href",this.value_)}getFlipRtl(){return this.flipRtl}setAlt(e){e!==this.altText&&(this.altText=e||"",this.imageElement&&this.imageElement.setAttribute("alt",this.altText))}showEditor_(){this.clickHandler&&this.clickHandler(this)}setOnClickHandler(e){this.clickHandler=e}getText_(){return this.altText}static fromJson(e){if(!e.src||!e.width||!e.height)throw Error("src, width, and height values for an image field arerequired. The width and height must be non-zero.");return new this(e.src,e.width,e.height,void 0,void 0,void 0,e)}};Ci.Y_PADDING=1,Us("field_image",Ci),Ci.prototype.DEFAULT_VALUE="";var Vl=class extends lt{constructor(e,t,o){super(lt.SKIP_SETUP),this.spellcheck_=!0,this.htmlInput_=null,this.isTextValid_=this.isBeingEdited_=!1,this.onKeyInputWrapper=this.onKeyDownWrapper=this.valueWhenEditorWasOpened_=null,this.fullBlockClickTarget_=!1,this.workspace_=null,this.SERIALIZABLE=!0,this.CURSOR="text",e!==lt.SKIP_SETUP&&(o&&this.configure_(o),this.setValue(e),t&&this.setValidator(t))}configure_(e){super.configure_(e),e.spellcheck!==void 0&&(this.spellcheck_=e.spellcheck)}initView(){if(!this.getSourceBlock())throw new _t;super.initView(),this.isFullBlockField()&&(this.clickTarget_=this.sourceBlock_.getSvgRoot())}isFullBlockField(){const e=this.getSourceBlock();if(!e)throw new _t;let t;return this.fullBlockClickTarget_=!((t=this.getConstants())==null||!t.FULL_BLOCK_FIELDS)&&e.isSimpleReporter()}doValueInvalid_(e,t=!0){this.isBeingEdited_&&(this.isDirty_=!0,this.isTextValid_=!1,e=this.value_,this.value_=this.valueWhenEditorWasOpened_,this.sourceBlock_&&C()&&this.value_!==e&&t&&z(new(ne(ee.BLOCK_CHANGE))(this.sourceBlock_,"field",this.name||null,e,this.value_)))}doValueUpdate_(e){this.isTextValid_=this.isDirty_=!0,this.value_=e}applyColour(){const e=this.getSourceBlock();if(!e)throw new _t;this.getConstants().FULL_BLOCK_FIELDS&&this.fieldGroup_&&(!this.isFullBlockField()&&this.borderRect_?(this.borderRect_.style.display="block",this.borderRect_.setAttribute("stroke",e.getColourTertiary())):(this.borderRect_.style.display="none",e.pathObject.svgPath.setAttribute("fill",this.getConstants().FIELD_BORDER_RECT_COLOUR)))}getSize(){let e;return(e=this.getConstants())!=null&&e.FULL_BLOCK_FIELDS&&(this.render_(),this.isDirty_=!1),super.getSize()}onLocationChange(){this.isBeingEdited_&&this.resizeEditor_()}render_(){if(super.render_(),this.isBeingEdited_){var e=this.htmlInput_;this.isTextValid_?(ze(e,"blocklyInvalidInput"),xt(e,Et.INVALID,!1)):(Oe(e,"blocklyInvalidInput"),xt(e,Et.INVALID,!0))}if(e=this.getSourceBlock(),!e)throw new _t;this.getConstants().FULL_BLOCK_FIELDS&&e.applyColour()}setSpellcheck(e){e!==this.spellcheck_&&(this.spellcheck_=e,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))}showEditor_(e,t=!1){this.workspace_=this.sourceBlock_.workspace,!t&&this.workspace_.options.modalInputs&&(Rb||wh||ll)?this.showPromptEditor():this.showInlineEditor(t)}showPromptEditor(){Ea(i.Msg$$module$build$src$core$msg.CHANGE_VALUE_TITLE,this.getText(),e=>{e!==null&&this.setValue(this.getValueFromEditorText_(e)),this.onFinishEditing_(this.value_)})}showInlineEditor(e){const t=this.getSourceBlock();if(!t)throw new _t;ja(this,t.RTL,this.widgetDispose_.bind(this),this.workspace_),this.htmlInput_=this.widgetCreate_(),this.isBeingEdited_=!0,this.valueWhenEditorWasOpened_=this.value_,e||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())}widgetCreate_(){var e=this.getSourceBlock();if(!e)throw new _t;i.setGroup$$module$build$src$core$events$utils(!0);const t=oi();var o=this.getClickTarget_();if(!o)throw Error("A click target has not been set.");Oe(o,"editing"),o=document.createElement("input"),o.className="blocklyHtmlInput",o.setAttribute("spellcheck",this.spellcheck_);const n=this.workspace_.getScale();var u=this.getConstants().FIELD_TEXT_FONTSIZE*n+"pt";return t.style.fontSize=u,o.style.fontSize=u,u=Vl.BORDERRADIUS*n+"px",this.isFullBlockField()&&(u=this.getScaledBBox(),u=(u.bottom-u.top)/2+"px",e=e.getParent()?e.getParent().getColourTertiary():this.sourceBlock_.getColourTertiary(),o.style.border=1*n+"px solid "+e,t.style.borderRadius=u,t.style.transition="box-shadow 0.25s ease 0s",this.getConstants().FIELD_TEXTINPUT_BOX_SHADOW&&(t.style.boxShadow="rgba(255, 255, 255, 0.3) 0 0 0 "+4*n+"px")),o.style.borderRadius=u,t.appendChild(o),o.value=o.defaultValue=this.getEditorText_(this.value_),o.setAttribute("data-untyped-default-value",String(this.value_)),this.resizeEditor_(),this.bindInputEvents_(o),o}widgetDispose_(){this.isBeingEdited_=!1,this.isTextValid_=!0,this.forceRerender(),this.onFinishEditing_(this.value_),this.sourceBlock_&&C()&&this.valueWhenEditorWasOpened_!==null&&this.valueWhenEditorWasOpened_!==this.value_&&(z(new(ne(ee.BLOCK_CHANGE))(this.sourceBlock_,"field",this.name||null,this.valueWhenEditorWasOpened_,this.value_)),this.valueWhenEditorWasOpened_=null),i.setGroup$$module$build$src$core$events$utils(!1),this.unbindInputEvents_();var e=oi().style;if(e.width="auto",e.height="auto",e.fontSize="",e.transition="",e.boxShadow="",this.htmlInput_=null,e=this.getClickTarget_(),!e)throw Error("A click target has not been set.");ze(e,"editing")}onFinishEditing_(e){}bindInputEvents_(e){this.onKeyDownWrapper=H(e,"keydown",this,this.onHtmlInputKeyDown_),this.onKeyInputWrapper=H(e,"input",this,this.onHtmlInputChange)}unbindInputEvents_(){this.onKeyDownWrapper&&(V(this.onKeyDownWrapper),this.onKeyDownWrapper=null),this.onKeyInputWrapper&&(V(this.onKeyInputWrapper),this.onKeyInputWrapper=null)}onHtmlInputKeyDown_(e){e.key==="Enter"?(ii(this),js()):e.key==="Escape"?(this.setValue(this.htmlInput_.getAttribute("data-untyped-default-value"),!1),ii(this),js()):e.key==="Tab"&&(ii(this),js(),this.sourceBlock_.tab(this,!e.shiftKey),e.preventDefault())}onHtmlInputChange(e){e=this.value_,this.setValue(this.getValueFromEditorText_(this.htmlInput_.value),!1),this.sourceBlock_&&C()&&this.value_!==e&&z(new(ne(ee.BLOCK_FIELD_INTERMEDIATE_CHANGE))(this.sourceBlock_,this.name||null,e,this.value_))}setEditorValue_(e,t=!0){this.isDirty_=!0,this.isBeingEdited_&&(this.htmlInput_.value=this.getEditorText_(e)),this.setValue(e,t)}resizeEditor_(){Ts().then(()=>{const e=this.getSourceBlock();if(!e)throw new _t;const t=oi(),o=this.getScaledBBox();t.style.width=o.right-o.left+"px",t.style.height=o.bottom-o.top+"px";const n=o.top;t.style.left=`${e.RTL?o.right-t.offsetWidth:o.left}px`,t.style.top=`${n}px`})}repositionForWindowResize(){let e;const t=(e=this.getSourceBlock())==null?void 0:e.getRootBlock();return t instanceof $s?(Ji(this.workspace_,this.workspace_.getMetricsManager().getViewMetrics(!0),t)||this.resizeEditor_(),!0):!1}isTabNavigable(){return!0}getText_(){return this.isBeingEdited_&&this.htmlInput_?this.htmlInput_.value:null}getEditorText_(e){return`${e}`}getValueFromEditorText_(e){return e}};Vl.BORDERRADIUS=4;var Kl=class extends Vl{constructor(e,t,o){super(e,t,o)}doClassValidation_(e){return e===void 0?null:`${e}`}static fromJson(e){return new this(bt(e.text),void 0,e)}};Us("field_input",Kl),Kl.prototype.DEFAULT_VALUE="";var Qv=class extends rp{constructor(e){super(e)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(e){return!!e.outputConnection}hasRightSquareCorner(e){return!!e.outputConnection&&!e.statementInputCount&&!e.nextConnection}},Yl=class extends xr{constructor(e,t){if(super(e,t),this.connectedBottomNextConnection=!1,this.connectedBlock){for(e=this.connectedBlock;t=e.getNextBlock();)e=t;e.nextConnection||(this.height=this.connectedBlockHeight,this.connectedBottomNextConnection=!0)}}},ey=class extends Vs{constructor(e){super(e),this.width=this.height=0,this.type|=F.getType("RIGHT_CONNECTION")}},ty=class extends dp{constructor(e){super(e)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(e){const t=(e.hat?e.hat==="cap":this.constants_.ADD_START_HATS)&&!e.outputConnection&&!e.previousConnection;return!!e.outputConnection||t}hasRightSquareCorner(e){return!!e.outputConnection&&!e.statementInputCount&&!e.nextConnection}},sy=class extends Or{constructor(e,t){super(e,t),this.isInline=!0,this.renderer_=e,this.constants_=this.renderer_.getConstants(),this.topRow=new ty(this.constants_),this.bottomRow=new Qv(this.constants_),this.isMultiRow=!t.getInputsInline()||t.isCollapsed(),this.hasStatementInput=0=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!n.precedesStatement,F.isInputRow(g)&&g.hasStatement){g.measure();let I,L;t=g.width-((L=(I=g.getLastInput())==null?void 0:I.width)!=null?L:0)+e}else if(o&&(u===2||n)&&F.isInputRow(g)&&!g.hasStatement){n=g.xPos,o=null;for(let I=0;Io?o:this.height/2,t-o*(1-Math.sin(Math.acos((o-this.constants_.SMALL_PADDING)/o)))):0;if(F.isInlineInput(e)&&e instanceof zo){const u=e.connectedBlock;return e=u?u.pathObject.outputShapeType:e.shape.type,e==null||u&&u.outputConnection&&(u.statementInputCount||u.nextConnection)||o===n.SHAPES.HEXAGONAL&&o!==e?0:t-this.constants_.SHAPE_IN_SHAPE_PADDING[o][e]}return F.isField(e)&&e instanceof hn?o===n.SHAPES.ROUND&&e.field instanceof Kl?t-2.75*n.GRID_UNIT:t-this.constants_.SHAPE_IN_SHAPE_PADDING[o][0]:F.isIcon(e)?this.constants_.SMALL_PADDING:0}finalizeVerticalAlignment_(){if(!this.outputConnection)for(let n=2;n=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!I.precedesStatement;if(e?this.topRow.hasPreviousConnection:u.followsStatement){var o=g.elements[1];if(o=g.elements.length===3&&o instanceof hn&&(o.field instanceof _i||o.field instanceof Ci),!e&&o)u.height-=this.constants_.SMALL_PADDING,I.height-=this.constants_.SMALL_PADDING,g.height-=this.constants_.MEDIUM_PADDING;else if(!e&&!t)u.height+=this.constants_.SMALL_PADDING;else if(t){for(e=!1,t=0;t{if(!n.isDeadOrDying()){i.disable$$module$build$src$core$events$utils();try{n==null||n.positionNearConnection(u,g,I),n==null||n.getSvgRoot().setAttribute("visibility","visible")}finally{i.enable$$module$build$src$core$events$utils()}}}),u}createInsertionMarker(e){const t=os(e,{addCoordinates:!1,addInputBlocks:!1,addNextBlocks:!1,doFullSerialization:!1});if(!t)throw Error(`Failed to serialize source block. ${e.toDevString()}`);e=lo(t,this.workspace);for(const o of e.getDescendants(!1))o.setInsertionMarker(!0);return e.initSvg(),e.getSvgRoot().setAttribute("visibility","hidden"),e}getMatchingConnection(e,t,o){if(e=e.getConnections_(!0),t=t.getConnections_(!0),e.length!==t.length)return null;for(let n=0;nt instanceof Uo&&u.block===t||t instanceof ms&&u.button===t);return 0>n?null:(o=o?n+1:n-1,o===-1||o===e.length?null:e[o])}findTopASTNodeForBlock(e){const t=rr(e);return t?de.createConnectionNode(t):de.createBlockNode(e)}getOutAstNodeForBlock(e){if(!e)return null;e=e.getTopStackBlock();const t=rr(e);return t&&t.targetConnection&&t.targetConnection.getParentInput()?de.createInputNode(t.targetConnection.getParentInput()):de.createStackNode(e)}findFirstFieldOrInput(e){e=e.inputList;for(let t=0;t{Ga(o.getSourceBlock()),setTimeout(()=>{n.bringToFront()},0)})}}update(e,t){const o=this.getCandidate(e);((this.wouldDeleteBlock=this.shouldDelete(!!o,t))||this.shouldUpdatePreviews(o,e))&&(i.disable$$module$build$src$core$events$utils(),this.maybeHidePreview(o),this.maybeShowPreview(o),i.enable$$module$build$src$core$events$utils())}createMarkerBlock(e){i.disable$$module$build$src$core$events$utils();let t;try{const o=os(e,{addCoordinates:!1,addInputBlocks:!1,addNextBlocks:!1,doFullSerialization:!1});if(!o)throw Error(`Failed to serialize source block. ${e.toDevString()}`);t=lo(o,this.workspace);for(const n of t.getDescendants(!1))n.setInsertionMarker(!0);t.initSvg(),t.getSvgRoot().setAttribute("visibility","hidden")}finally{i.enable$$module$build$src$core$events$utils()}return t}initAvailableConnections(){const e=this.topBlock.getConnections_(!1),t=this.topBlock.lastConnectionInStack(!0);return t&&t!==this.topBlock.nextConnection&&(e.push(t),this.lastOnStack=t),e}shouldUpdatePreviews(e,t){if(!e)return!!this.activeCandidate;if(!this.activeCandidate)return!0;const{local:o,closest:n}=this.activeCandidate;if(n===e.closest&&o===e.local)return!1;const u=o.x+t.x-n.x;return t=o.y+t.y-n.y,e.radius{let le;(le=n)==null||le.positionNearConnection(L,g,I);let Ee;(Ee=n)==null||Ee.getSvgRoot().setAttribute("visibility","visible")}),this.markerConnection=u}hideInsertionMarker(){if(this.markerConnection){var e=this.markerConnection,t=e.getSourceBlock(),o=t.outputConnection,n;if((n=t.previousConnection)!=null&&n.targetConnection||o!=null&&o.targetConnection)t.unplug(!0);else{let u;(u=e.targetBlock())==null||u.unplug(!1)}if(e.targetConnection)throw Error("markerConnection still connected at the end of disconnectInsertionMarker");this.markerConnection=null,(e=t.getSvgRoot())&&e.setAttribute("visibility","hidden")}}showInsertionInputOutline(e){e=e.closest,this.highlightedBlock=e.getSourceBlock(),this.highlightedBlock.highlightShapeForInput(e,!0)}hideInsertionInputOutline(){if(this.highlightedBlock){if(!this.activeCandidate)throw Error("Cannot hide the insertion marker outline because there is no active candidate");this.highlightedBlock.highlightShapeForInput(this.activeCandidate.closest,!1),this.highlightedBlock=null}}showReplacementFade(e){if(this.fadedBlock=e.closest.targetBlock(),!this.fadedBlock)throw Error("Cannot show the replacement fade because the closest connection does not have a target block");this.fadedBlock.fadeForReplacement(!0)}hideReplacementFade(){this.fadedBlock&&(this.fadedBlock.fadeForReplacement(!1),this.fadedBlock=null)}getInsertionMarkers(){const e=[];return this.firstMarker&&e.push(this.firstMarker),this.lastMarker&&e.push(this.lastMarker),e}disposeInsertionMarker(e){if(e){i.disable$$module$build$src$core$events$utils();try{e.dispose()}finally{i.enable$$module$build$src$core$events$utils()}}}};(function(e){e=e.PREVIEW_TYPE||(e.PREVIEW_TYPE={}),e[e.INSERTION_MARKER=0]="INSERTION_MARKER",e[e.INPUT_OUTLINE=1]="INPUT_OUTLINE",e[e.REPLACEMENT_FADE=2]="REPLACEMENT_FADE"})(fs||(fs={})),fs.PREVIEW_TYPE;var Fl=class{constructor(e){this.overrides=null,this.name=e}getClassName(){return this.name+"-renderer"}init(e,t){this.constants_=this.makeConstants_(),t&&(this.overrides=t,Object.assign(this.constants_,t)),this.constants_.setTheme(e),this.constants_.init()}createDom(e,t){this.constants_.createDom(e,this.name+"-"+t.name,"."+this.getClassName()+"."+t.getClassName())}refreshDom(e,t){const o=this.getConstants();o.dispose(),this.constants_=this.makeConstants_(),this.overrides&&Object.assign(this.constants_,this.overrides),this.constants_.randomIdentifier=o.randomIdentifier,this.constants_.setTheme(t),this.constants_.init(),this.createDom(e,t)}dispose(){this.constants_&&this.constants_.dispose()}makeConstants_(){return new Pl}makeRenderInfo_(e){return new Rr(this,e)}makeDrawer_(e,t){return new Bl(e,t)}makeMarkerDrawer(e,t){return new gp(e,this.getConstants(),t)}makePathObject(e,t){return new jl(e,t,this.constants_)}getConstants(){return this.constants_}shouldHighlightConnection(e){return!0}orphanCanConnectAtEnd(e,t,o){return!!Qe.getConnectionForOrphanedConnection(e,o===xe.OUTPUT_VALUE?t.outputConnection:t.previousConnection)}getConnectionPreviewMethod(e,t,o){return w("getConnectionPreviewMethod","v10","v12","an IConnectionPreviewer, if it fulfills your use case."),t.type===xe.OUTPUT_VALUE||t.type===xe.PREVIOUS_STATEMENT?!e.isConnected()||this.orphanCanConnectAtEnd(o,e.targetBlock(),t.type)?fs.PREVIEW_TYPE.INSERTION_MARKER:fs.PREVIEW_TYPE.REPLACEMENT_FADE:fs.PREVIEW_TYPE.INSERTION_MARKER}render(e){const t=this.makeRenderInfo_(e);t.measure(),this.makeDrawer_(e,t).draw()}},ot={};ot.BottomRow=rp,ot.Connection=ko,ot.ConstantProvider=Pl,ot.Drawer=Bl,ot.ExternalValueInput=Ll,ot.Field=hn,ot.Hat=ap,ot.Icon=Dv,ot.InRowSpacer=as,ot.InlineInput=lp,ot.InputConnection=zo,ot.InputRow=cp,ot.JaggedEdge=Av,ot.MarkerSvg=gp,ot.Measurable=Vs,ot.NextConnection=Rv,ot.OutputConnection=Ov,ot.PathObject=jl,ot.PreviousConnection=Nv,ot.RenderInfo=Rr,ot.Renderer=Fl,ot.RoundCorner=Dr,ot.Row=Ir,ot.SpacerRow=up,ot.SquareCorner=Ar,ot.StatementInput=xr,ot.TopRow=dp,ot.Types=j,ot.init=Od,ot.register=ar,ot.unregister=H$;var Lv=class{constructor(e,t){this.workspace=e,this.theme=t,this.subscribedWorkspaces=[],this.componentDB=new Map}getTheme(){return this.theme}setTheme(e){var t=this.theme;this.theme=e,(e=this.workspace.getInjectionDiv())&&(t&&(t=t.getClassName())&&ze(e,t),(t=this.theme.getClassName())&&Re(e,t));for(let o=0,n;n=this.subscribedWorkspaces[o];o++)n.refreshTheme();for(const[o,n]of this.componentDB)for(const u of n){e=u.element,t=u.propertyName;const g=this.theme&&this.theme.getComponentStyle(o);e.style.setProperty(t,g||"")}for(const o of this.subscribedWorkspaces)o.hideChaff()}subscribeWorkspace(e){this.subscribedWorkspaces.push(e)}unsubscribeWorkspace(e){if(!He(this.subscribedWorkspaces,e))throw Error("Cannot unsubscribe a workspace that hasn't been subscribed.")}subscribe(e,t,o){this.componentDB.has(t)||this.componentDB.set(t,[]),this.componentDB.get(t).push({element:e,propertyName:o}),t=this.theme&&this.theme.getComponentStyle(t),e.style.setProperty(o,t||"")}unsubscribe(e){if(e)for(const[t,o]of this.componentDB){for(let n=o.length-1;0<=n;n--)o[n].element===e&&o.splice(n,1);o.length||this.componentDB.delete(t)}}dispose(){this.subscribedWorkspaces.length=0,this.componentDB.clear()}},mp="VARIABLE_DYNAMIC",wi={CATEGORY_NAME:mp};wi.flyoutCategory=Qa,wi.flyoutCategoryBlocks=Pd,wi.onCreateVariableButtonClick_Colour=Ld,wi.onCreateVariableButtonClick_Number=Md,wi.onCreateVariableButtonClick_String=Nd;var Pv=30,ki=[];ki[xe.INPUT_VALUE]=xe.OUTPUT_VALUE,ki[xe.OUTPUT_VALUE]=xe.INPUT_VALUE,ki[xe.NEXT_STATEMENT]=xe.PREVIOUS_STATEMENT,ki[xe.PREVIOUS_STATEMENT]=xe.NEXT_STATEMENT;var fp="RENAME_VARIABLE_ID",$p="DELETE_VARIABLE_ID",Bv=class{canConnect(e,t,o,n){return this.canConnectWithReason(e,t,o,n)===Qe.CAN_CONNECT}canConnectWithReason(e,t,o,n){const u=this.doSafetyChecks(e,t);return u!==Qe.CAN_CONNECT?u:this.doTypeChecks(e,t)?o&&!this.doDragChecks(e,t,n||0)?Qe.REASON_DRAG_CHECKS_FAILED:Qe.CAN_CONNECT:Qe.REASON_CHECKS_FAILED}getErrorMessage(e,t,o){switch(e){case Qe.REASON_SELF_CONNECTION:return"Attempted to connect a block to itself.";case Qe.REASON_DIFFERENT_WORKSPACES:return"Blocks not on same workspace.";case Qe.REASON_WRONG_TYPE:return"Attempt to connect incompatible types.";case Qe.REASON_TARGET_NULL:return"Target connection is null.";case Qe.REASON_CHECKS_FAILED:return"Connection checks failed. "+(t+" expected "+t.getCheck()+", found "+o.getCheck());case Qe.REASON_SHADOW_PARENT:return"Connecting non-shadow to shadow block.";case Qe.REASON_DRAG_CHECKS_FAILED:return"Drag checks failed.";case Qe.REASON_PREVIOUS_AND_OUTPUT:return"Block would have an output and a previous connection.";default:return"Unknown connection failure: this should never happen!"}}doSafetyChecks(e,t){if(!e||!t)return Qe.REASON_TARGET_NULL;let o,n,u;return e.isSuperior()?(o=e.getSourceBlock(),n=t.getSourceBlock(),u=t):(n=e.getSourceBlock(),o=t.getSourceBlock(),u=e,e=t),o===n?Qe.REASON_SELF_CONNECTION:u.type!==ki[e.type]?Qe.REASON_WRONG_TYPE:o.workspace!==n.workspace?Qe.REASON_DIFFERENT_WORKSPACES:o.isShadow()&&!n.isShadow()?Qe.REASON_SHADOW_PARENT:u.type===xe.OUTPUT_VALUE&&n.previousConnection&&n.previousConnection.isConnected()||u.type===xe.PREVIOUS_STATEMENT&&n.outputConnection&&n.outputConnection.isConnected()?Qe.REASON_PREVIOUS_AND_OUTPUT:Qe.CAN_CONNECT}doTypeChecks(e,t){if(e=e.getCheck(),t=t.getCheck(),!e||!t)return!0;for(let o=0;oo||t.getSourceBlock().isInsertionMarker())return!1;switch(t.type){case xe.PREVIOUS_STATEMENT:return this.canConnectToPrevious_(e,t);case xe.OUTPUT_VALUE:if(t.isConnected()&&!t.targetBlock().isInsertionMarker()||e.isConnected())return!1;break;case xe.INPUT_VALUE:if(t.isConnected()&&!t.targetBlock().isMovable()&&!t.targetBlock().isShadow())return!1;break;case xe.NEXT_STATEMENT:if(t.isConnected()&&!e.getSourceBlock().nextConnection&&!t.targetBlock().isShadow()&&t.targetBlock().nextConnection||t.targetBlock()&&!t.targetBlock().isMovable()&&!t.targetBlock().isShadow())return!1;break;default:return!1}return!hr.includes(t)}canConnectToPrevious_(e,t){return e.targetConnection||hr.includes(t)?!1:t.targetConnection?(e=t.targetBlock(),e.isInsertionMarker()?!e.getPreviousBlock():!1):!0}};r($e.CONNECTION_CHECKER,Ws,Bv);var bp=class extends br{constructor(e){super(e),this.type=ee.VAR_DELETE,e&&(this.varType=e.type,this.varName=e.name)}toJson(){const e=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");return e.varType=this.varType,e.varName=this.varName,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new bp),t.varType=e.varType,t.varName=e.varName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");e?t.deleteVariableById(this.varId):t.createVariable(this.varName,this.varType,this.varId)}};r($e.EVENT,ee.VAR_DELETE,bp);var vp=class extends br{constructor(e,t){super(e),this.type=ee.VAR_RENAME,e&&(this.oldName=e.name,this.newName=typeof t>"u"?"":t)}toJson(){const e=super.toJson();if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson");return e.oldName=this.oldName,e.newName=this.newName,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new vp),t.oldName=e.oldName,t.newName=e.newName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson");e?t.renameVariableById(this.varId,this.newName):t.renameVariableById(this.varId,this.oldName)}};r($e.EVENT,ee.VAR_RENAME,vp);var yp=class{constructor(e){this.workspace=e,this.variableMap=new Map}clear(){for(const e of this.variableMap.values())for(;0{u&&t&&this.deleteVariableInternal(t,n)})):this.deleteVariableInternal(t,n)}else console.warn("Can't delete non-existent variable: "+e)}deleteVariableInternal(e,t){const o=i.getGroup$$module$build$src$core$events$utils();o||i.setGroup$$module$build$src$core$events$utils(!0);try{for(let n=0;ne.name)}getVariableUsesById(e){const t=[],o=this.workspace.getAllBlocks(!1);for(let n=0;n!o.isInsertionMarker())):[]}addTopComment(e){this.topComments.push(e),this.commentDB.has(e.id)&&console.warn('Overriding an existing comment on this workspace, with id "'+e.id+'"'),this.commentDB.set(e.id,e)}removeTopComment(e){if(!He(this.topComments,e))throw Error("Comment not present in workspace's list of top-most comments.");this.commentDB.delete(e.id)}getTopComments(e=!1){const t=[].concat(this.topComments);return e&&1!o.isInsertionMarker())}clear(){this.isClearing=!0;try{const e=i.getGroup$$module$build$src$core$events$utils();for(e||i.setGroup$$module$build$src$core$events$utils(!0);this.topBlocks.length;)this.topBlocks[0].dispose(!1);for(;this.topComments.length;)this.topComments[this.topComments.length-1].dispose();i.setGroup$$module$build$src$core$events$utils(e),this.variableMap.clear(),this.potentialVariableMap&&this.potentialVariableMap.clear()}finally{this.isClearing=!1}}renameVariableById(e,t){this.variableMap.renameVariableById(e,t)}createVariable(e,t,o){return this.variableMap.createVariable(e,t,o)}getVariableUsesById(e){return this.variableMap.getVariableUsesById(e)}deleteVariableById(e){this.variableMap.deleteVariableById(e)}getVariable(e,t){return this.variableMap.getVariable(e,t)}getVariableById(e){return this.variableMap.getVariableById(e)}getVariablesOfType(e){return this.variableMap.getVariablesOfType(e)}getVariableTypes(){return this.variableMap.getVariableTypes(this)}getAllVariables(){return this.variableMap.getAllVariables()}getAllVariableNames(){return this.variableMap.getAllVariableNames()}getWidth(){return 0}newBlock(e,t){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts")}newComment(e){throw Error("The implementation of newComment should be monkey-patched in by blockly.ts")}remainingCapacity(){return isNaN(this.options.maxBlocks)?1/0:this.options.maxBlocks-this.getAllBlocks(!1).length}remainingCapacityOfType(e){return this.options.maxInstances?(this.options.maxInstances[e]!==void 0?this.options.maxInstances[e]:1/0)-this.getBlocksByType(e,!1).length:1/0}isCapacityAvailable(e){if(!this.hasBlockLimits())return!0;let t=0;for(const o in e){if(e[o]>this.remainingCapacityOfType(o))return!1;t+=e[o]}return!(t>this.remainingCapacity())}hasBlockLimits(){return this.options.maxBlocks!==1/0||!!this.options.maxInstances}getUndoStack(){return this.undoStack_}getRedoStack(){return this.redoStack_}undo(e){var t=e?this.redoStack_:this.undoStack_,o=e?this.undoStack_:this.redoStack_;const n=t.pop();if(n){for(var u=[n];t.length&&n.group&&n.group===t[t.length-1].group;){const g=t.pop();g&&u.push(g)}for(t=0;tthis.MAX_UNDO&&0<=this.MAX_UNDO;)this.undoStack_.shift();for(let t=0;t!!t.getStyleName())),this.refreshToolboxSelection(),this.toolbox&&this.toolbox.refreshTheme(),this.isVisible()&&this.setVisible(!0);const e=new(ne(ee.THEME_CHANGE))(this.getTheme().name,this.id);z(e)}updateBlockStyles(e){for(let t=0,o;o=e[t];t++){const n=o.getStyleName();n&&o.setStyle(n)}}getInverseScreenCTM(){if(this.inverseScreenCTMDirty){const e=this.getParentSvg().getScreenCTM();e&&(this.inverseScreenCTM=e.inverse(),this.inverseScreenCTMDirty=!1)}return this.inverseScreenCTM}updateInverseScreenCTM(){this.inverseScreenCTMDirty=!0}isVisible(){return this.visible}getSvgXY(e){let t=0,o=0,n=1;(this.getCanvas().contains(e)||this.getBubbleCanvas().contains(e))&&(n=this.scale);do{const u=Wn(e);(e===this.getCanvas()||e===this.getBubbleCanvas())&&(n=1),t+=u.x*n,o+=u.y*n,e=e.parentNode}while(e&&e!==this.getParentSvg()&&e!==this.getInjectionDiv());return new ye(t,o)}getCachedParentSvgSize(){const e=this.cachedParentSvgSize;return new Xe(e.width,e.height)}getOriginOffsetInPixels(){return fa(this.getCanvas())}getInjectionDiv(){if(!this.injectionDiv){let e=this.svgGroup_;for(;e;){if((" "+(e.getAttribute("class")||"")+" ").includes(" injectionDiv ")){this.injectionDiv=e;break}e=e.parentNode}}return this.injectionDiv}getSvgGroup(){return this.svgGroup_}getBlockCanvas(){return this.getCanvas()}setResizeHandlerWrapper(e){this.resizeHandlerWrapper=e}createDom(e,t){return this.injectionDiv||(this.injectionDiv=t??null),this.svgGroup_=ie(J.G,{class:"blocklyWorkspace"}),e&&(this.svgBackground_=ie(J.RECT,{height:"100%",width:"100%",class:e},this.svgGroup_),e==="blocklyMainBackground"&&this.grid?this.svgBackground_.style.fill="url(#"+this.grid.getPatternId()+")":this.themeManager_.subscribe(this.svgBackground_,"workspaceBackgroundColour","fill")),this.layerManager=new qC(this),this.svgBlockCanvas_=this.layerManager.getBlockLayer(),this.svgBubbleCanvas_=this.layerManager.getBubbleLayer(),this.isFlyout||(H(this.svgGroup_,"pointerdown",this,this.onMouseDown,!1),this.dummyWheelListener=()=>{},document.body.addEventListener("wheel",this.dummyWheelListener),H(this.svgGroup_,"wheel",this,this.onMouseWheel)),this.options.hasCategories&&(this.toolbox=new(y($e.TOOLBOX,this.options,!0))(this)),this.grid&&this.grid.update(this.scale),this.recordDragTargets(),(e=y($e.CURSOR,this.options))&&this.markerManager.setCursor(new e),this.renderer.createDom(this.svgGroup_,this.getTheme()),this.svgGroup_}dispose(){if(this.rendered=!1,this.currentGesture_&&this.currentGesture_.cancel(),this.svgGroup_&&Ze(this.svgGroup_),this.toolbox&&(this.toolbox.dispose(),this.toolbox=null),this.flyout&&(this.flyout.dispose(),this.flyout=null),this.trashcan&&(this.trashcan.dispose(),this.trashcan=null),this.scrollbar&&(this.scrollbar.dispose(),this.scrollbar=null),this.zoomControls_&&this.zoomControls_.dispose(),this.audioManager&&this.audioManager.dispose(),this.grid&&(this.grid=null),this.renderer.dispose(),this.markerManager&&this.markerManager.dispose(),super.dispose(),this.themeManager_&&(this.themeManager_.unsubscribeWorkspace(this),this.themeManager_.unsubscribe(this.svgBackground_),this.options.parentWorkspace||this.themeManager_.dispose()),this.connectionDBList.length=0,this.toolboxCategoryCallbacks.clear(),this.flyoutButtonCallbacks.clear(),!this.options.parentWorkspace){const e=this.getParentSvg();e&&e.parentNode&&Ze(e.parentNode)}this.resizeHandlerWrapper&&(V(this.resizeHandlerWrapper),this.resizeHandlerWrapper=null),this.dummyWheelListener&&(document.body.removeEventListener("wheel",this.dummyWheelListener),this.dummyWheelListener=null)}addTrashcan(){this.trashcan=cs.newTrashcan(this);const e=this.trashcan.createDom();this.svgGroup_.insertBefore(e,this.getCanvas())}static newTrashcan(e){throw Error("The implementation of newTrashcan should be monkey-patched in by blockly.ts")}addZoomControls(){this.zoomControls_=new Hb(this);const e=this.zoomControls_.createDom();this.svgGroup_.appendChild(e)}addFlyout(e){const t=new gs({parentWorkspace:this,rtl:this.RTL,oneBasedIndex:this.options.oneBasedIndex,horizontalLayout:this.horizontalLayout,renderer:this.options.renderer,rendererOverrides:this.options.rendererOverrides,move:{scrollbars:!0}});return t.toolboxPosition=this.options.toolboxPosition,this.flyout=this.horizontalLayout?new(y($e.FLYOUTS_HORIZONTAL_TOOLBOX,this.options,!0))(t):new(y($e.FLYOUTS_VERTICAL_TOOLBOX,this.options,!0))(t),this.flyout.autoClose=!1,this.flyout.getWorkspace().setVisible(!0),this.flyout.createDom(e)}getFlyout(e){return this.flyout||e?this.flyout:this.toolbox?this.toolbox.getFlyout():null}getToolbox(){return this.toolbox}updateScreenCalculations(){this.updateInverseScreenCTM(),this.recordDragTargets()}resizeContents(){this.resizesEnabled&&this.rendered&&(this.scrollbar&&this.scrollbar.resize(),this.updateInverseScreenCTM())}resize(){this.toolbox&&this.toolbox.position(),this.flyout&&this.flyout.position();const e=this.componentManager.getComponents(gt.Capability.POSITIONABLE,!0),t=this.getMetricsManager().getUiMetrics(),o=[];for(let n=0,u;u=e[n];n++){u.position(t,o);const g=u.getBoundingRectangle();g&&o.push(g)}this.scrollbar&&this.scrollbar.resize(),this.updateScreenCalculations()}updateScreenCalculationsIfScrolled(){const e=bu();ye.equals(this.lastRecordedPageScroll,e)||(this.lastRecordedPageScroll=e,this.updateScreenCalculations())}getLayerManager(){return this.layerManager}getCanvas(){return this.layerManager.getBlockLayer()}setCachedParentSvgSize(e,t){const o=this.getParentSvg();e!=null&&(this.cachedParentSvgSize.width=e,o.setAttribute("data-cached-width",`${e}`)),t!=null&&(this.cachedParentSvgSize.height=t,o.setAttribute("data-cached-height",`${t}`))}getBubbleCanvas(){return this.layerManager.getBubbleLayer()}getParentSvg(){if(!this.cachedParentSvg){let e=this.svgGroup_;for(;e;){if(e.tagName==="svg"){this.cachedParentSvg=e;break}e=e.parentNode}}return this.cachedParentSvg}maybeFireViewportChangeEvent(){if(C()){var e=this.scale,t=-this.scrollY,o=-this.scrollX;if(!(e===this.oldScale&&1>Math.abs(t-this.oldTop)&&1>Math.abs(o-this.oldLeft))){var n=new(ne(ee.VIEWPORT_CHANGE))(t,o,e,this.id,this.oldScale);this.oldScale=e,this.oldTop=t,this.oldLeft=o,z(n)}}}translate(e,t){let o;(o=this.layerManager)==null||o.translateLayers(new ye(e,t),this.scale);let n;(n=this.grid)==null||n.moveTo(e,t),this.maybeFireViewportChangeEvent()}getWidth(){const e=this.getMetrics();return e?e.viewWidth/this.scale:0}setVisible(e){this.visible=e,this.svgGroup_&&(this.scrollbar&&this.scrollbar.setContainerVisible(e),this.getFlyout()&&this.getFlyout().setContainerVisible(e),this.getParentSvg().style.display=e?"block":"none",this.toolbox&&this.toolbox.setVisible(e),e||this.hideChaff(!0))}render(){const e=this.getAllBlocks(!1);for(let t=e.length-1;0<=t;t--)e[t].queueRender();this.getTopBlocks().flatMap(t=>t.getDescendants(!1)).filter(t=>t.isInsertionMarker()).forEach(t=>t.queueRender()),Ts().then(()=>{this.markerManager.updateMarkers()})}highlightBlock(e,t){if(t===void 0){for(let o=0,n;n=this.highlightedBlocks[o];o++)n.setHighlighted(!1);this.highlightedBlocks.length=0}(e=e?this.getBlockById(e):null)&&((t=t===void 0||t)?this.highlightedBlocks.includes(e)||this.highlightedBlocks.push(e):He(this.highlightedBlocks,e),e.setHighlighted(t))}refreshToolboxSelection(){const e=this.isFlyout?this.targetWorkspace:this;e&&!e.currentGesture_&&e.toolbox&&e.toolbox.getFlyout()&&e.toolbox.refreshSelection()}renameVariableById(e,t){super.renameVariableById(e,t),this.refreshToolboxSelection()}deleteVariableById(e){super.deleteVariableById(e),this.refreshToolboxSelection()}createVariable(e,t,o){return e=super.createVariable(e,t,o),this.refreshToolboxSelection(),e}recordDragTargets(){const e=this.componentManager.getComponents(gt.Capability.DRAG_TARGET,!0);this.dragTargetAreas=[];for(let t=0,o;o=e[t];t++){const n=o.getClientRect();n&&this.dragTargetAreas.push({component:o,clientRect:n})}}newBlock(e,t){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts")}newComment(e){throw Error("The implementation of newComment should be monkey-patched in by blockly.ts")}getDragTarget(e){for(let t=0,o;o=this.dragTargetAreas[t];t++)if(o.clientRect.contains(e.clientX,e.clientY))return o.component;return null}onMouseDown(e){const t=this.getGesture(e);t&&t.handleWsStart(e,this)}startDrag(e,t){za(this,e,t)}moveDrag(e){return Ua(this,e)}isDragging(){return this.currentGesture_!==null&&this.currentGesture_.isDragging()}isDraggable(){return this.options.moveOptions&&this.options.moveOptions.drag}isMovable(){return this.options.moveOptions&&!!this.options.moveOptions.scrollbars||this.options.moveOptions&&this.options.moveOptions.wheel||this.options.moveOptions&&this.options.moveOptions.drag||this.options.zoomOptions&&this.options.zoomOptions.wheel||this.options.zoomOptions&&this.options.zoomOptions.pinch}isMovableHorizontally(){const e=!!this.scrollbar;return this.isMovable()&&(!e||e&&this.scrollbar.canScrollHorizontally())}isMovableVertically(){const e=!!this.scrollbar;return this.isMovable()&&(!e||e&&this.scrollbar.canScrollVertically())}onMouseWheel(e){if(bo.inProgress())e.preventDefault(),e.stopPropagation();else{var t=this.options.zoomOptions&&this.options.zoomOptions.wheel,o=this.options.moveOptions&&this.options.moveOptions.wheel;if(t||o){var n=Le(e);if(kh)var u=e.metaKey;t&&(e.ctrlKey||u||!o)?(n=-n.y/50,t=fe(e,this.getParentSvg(),this.getInverseScreenCTM()),this.zoom(t.x,t.y,n)):(t=this.scrollX-n.x,o=this.scrollY-n.y,e.shiftKey&&!n.x&&(t=this.scrollX-n.y,o=this.scrollY),this.scroll(t,o)),e.preventDefault()}}}getBlocksBoundingBox(){const e=this.getTopBoundedElements();if(!e.length)return new rt(0,0,0,0);const t=e[0].getBoundingRectangle();for(let n=1;nt.bottom&&(t.bottom=o.bottom),o.leftt.right&&(t.right=o.right))}return t}cleanUp(){this.setResizesEnabled(!1),i.setGroup$$module$build$src$core$events$utils(!0);var e=this.getTopBlocks(!0),t=e.filter(g=>g.isMovable());const o=e.filter(g=>!g.isMovable()).map(g=>g.getBoundingRectangle());e=function(g){for(const I of o)if(g.intersects(I))return I;return null};var n=0;const u=this.renderer.getConstants().MIN_BLOCK_HEIGHT;for(const g of t){for(t=g.getBoundingRectangle(),g.moveBy(-t.left,n-t.top,["cleanup"]),g.snapToGrid(),t=g.getBoundingRectangle(),n=e(t);n!=null;)n=n.top+n.getHeight()+u,g.moveBy(0,n-t.top,["cleanup"]),g.snapToGrid(),t=g.getBoundingRectangle(),n=e(t);n=g.getRelativeToSurfaceXY().y+g.getHeightWidth().height+u}i.setGroup$$module$build$src$core$events$utils(!1),this.setResizesEnabled(!0)}showContextMenu(e){if(!this.options.readOnly&&!this.isFlyout){var t=Ke.registry.getContextMenuOptions(Ke.ScopeType.WORKSPACE,{workspace:this});this.configureContextMenu&&this.configureContextMenu(t,e),sr(e,t,this.RTL,this)}}updateToolbox(e){if(e=$a(e)){if(!this.options.languageTree)throw Error("Existing toolbox is null. Can't create new toolbox.");if(ba(e)){if(!this.toolbox)throw Error("Existing toolbox has no categories. Can't change mode.");this.options.languageTree=e,this.toolbox.render(e)}else{if(!this.flyout)throw Error("Existing toolbox has categories. Can't change mode.");this.options.languageTree=e,this.flyout.show(e)}}else if(this.options.languageTree)throw Error("Can't nullify an existing toolbox.")}markFocused(){this.options.parentWorkspace?this.options.parentWorkspace.markFocused():(se(this),this.getParentSvg().focus({preventScroll:!0}))}zoom(e,t,o){o=Math.pow(this.options.zoomOptions.scaleSpeed,o);const n=this.scale*o;if(this.scale!==n){n>this.options.zoomOptions.maxScale?o=this.options.zoomOptions.maxScale/this.scale:nthis.options.zoomOptions.maxScale?e=this.options.zoomOptions.maxScale:this.options.zoomOptions.minScale&&et.autoHide(e))}static setTopLevelWorkspaceMetrics(e){const t=this.getMetrics();typeof e.x=="number"&&(this.scrollX=-(t.scrollLeft+(t.scrollWidth-t.viewWidth)*e.x)),typeof e.y=="number"&&(this.scrollY=-(t.scrollTop+(t.scrollHeight-t.viewHeight)*e.y)),this.translate(this.scrollX+t.absoluteLeft,this.scrollY+t.absoluteTop)}},_p=class extends Ss{constructor(e,t,o){super(o),this.type=ee.SELECTED,this.oldElementId=e??void 0,this.newElementId=t??void 0}toJson(){const e=super.toJson();return e.oldElementId=this.oldElementId,e.newElementId=this.newElementId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new _p),t.oldElementId=e.oldElementId,t.newElementId=e.newElementId,t}};r($e.EVENT,ee.SELECTED,_p);var Or=class{paste(e,t,o){if(!t.isCapacityAvailable(e.typeCounts))return null;o&&(e.blockState.x=o.x,e.blockState.y=o.y),o=o||new ye(e.blockState.x||0,e.blockState.y||0),i.disable$$module$build$src$core$events$utils();let n;try{n=lo(e.blockState,t),W$(n,o)}finally{i.enable$$module$build$src$core$events$utils()}return n&&(C()&&!n.isShadow()&&z(new(ne(ee.BLOCK_CREATE))(n)),i.setSelected$$module$build$src$core$common(n),n)}};Or.TYPE="block",Ca(Or.TYPE,new Or);var zl={};zl.bumpIntoBounds=Ji,zl.bumpIntoBoundsHandler=Bd,zl.bumpTopObjectsIntoBounds=el;var Fv=class{constructor(e){this.block=e,this.connectionPreviewer=this.connectionCandidate=this.startLoc=this.startChildConn=this.startParentConn=null,this.dragging=!1,this.dragOffset=new ye(0,0),this.inGroup=!1,this.workspace=e.workspace}isMovable(){if(this.block.isShadow()){let e,t;return(t=(e=this.block.getParent())==null?void 0:e.isMovable())!=null?t:!1}return this.block.isOwnMovable()&&!this.block.isDeadOrDying()&&!this.workspace.options.readOnly&&!this.block.isInFlyout}startDrag(e){if(this.block.isShadow())this.startDraggingShadow(e);else{this.dragging=!0,(this.inGroup=!!i.getGroup$$module$build$src$core$events$utils())||i.setGroup$$module$build$src$core$events$utils(!0),this.fireDragStartEvent(),this.startLoc=this.block.getRelativeToSurfaceXY(),this.connectionCandidate=null,this.connectionPreviewer=new(y($e.CONNECTION_PREVIEWER,this.workspace.options))(this.block),io(),this.workspace.setResizesEnabled(!1),Ki(),e=!!e&&(e.altKey||e.ctrlKey||e.metaKey),this.shouldDisconnect(e)&&this.disconnectBlock(e),this.block.setDragging(!0);var t;(t=this.workspace.getLayerManager())==null||t.moveToDragLayer(this.block)}}startDraggingShadow(e){const t=this.block.getParent();if(!t)throw Error("Tried to drag a shadow block with no parent. Shadow blocks should always have parents.");this.dragOffset=ye.difference(t.getRelativeToSurfaceXY(),this.block.getRelativeToSurfaceXY()),t.startDrag(e)}shouldDisconnect(e){return!!(this.block.getParent()||e&&this.block.nextConnection&&this.block.nextConnection.targetBlock())}disconnectBlock(e){let t,o,n;if(this.startParentConn=(n=(t=this.block.outputConnection)==null?void 0:t.targetConnection)!=null?n:(o=this.block.previousConnection)==null?void 0:o.targetConnection,e){let u;this.startChildConn=(u=this.block.nextConnection)==null?void 0:u.targetConnection}this.block.unplug(e),_d(this.block)}fireDragStartEvent(){const e=new(ne(ee.BLOCK_DRAG))(this.block,!0,this.block.getDescendants(!1));z(e)}fireDragEndEvent(){const e=new(ne(ee.BLOCK_DRAG))(this.block,!1,this.block.getDescendants(!1));z(e)}fireMoveEvent(){if(!this.block.isDeadOrDying()){var e=new(ne(ee.BLOCK_MOVE))(this.block);e.setReason(["drag"]),e.oldCoordinate=this.startLoc,e.recordNew(),z(e)}}drag(e){if(this.block.isShadow()){let t;(t=this.block.getParent())==null||t.drag(ye.sum(e,this.dragOffset))}else this.block.moveDuringDrag(e),this.updateConnectionPreview(this.block,ye.difference(e,this.startLoc))}updateConnectionPreview(e,t){var o=this.connectionCandidate;const n=this.getConnectionCandidate(e,t);if(n){this.connectionCandidate=t=o&&this.currCandidateIsBetter(o,t,n)?o:n;var{local:u,neighbour:g}=t;t=u.type===xe.OUTPUT_VALUE||u.type===xe.PREVIOUS_STATEMENT,o=g.isConnected()&&!g.targetBlock().isInsertionMarker(),t&&o&&!this.orphanCanConnectAtEnd(e,g.targetBlock(),u.type)?this.connectionPreviewer.previewReplacement(u,g,g.targetBlock()):this.connectionPreviewer.previewConnection(u,g)}else this.connectionPreviewer.hidePreview(),this.connectionCandidate=null}orphanCanConnectAtEnd(e,t,o){return!!Qe.getConnectionForOrphanedConnection(e,o===xe.OUTPUT_VALUE?t.outputConnection:t.previousConnection)}currCandidateIsBetter(e,t,o){const{local:n,neighbour:u}=e;e=new ye(n.x,n.y);const g=new ye(u.x,u.y);return t=ye.distance(ye.sum(e,t),g),o.distance>t-i.config$$module$build$src$core$config.currentConnectionPreference}getConnectionCandidate(e,t){e=this.getLocalConnections(e);let o=this.connectionCandidate?i.config$$module$build$src$core$config.connectingSnapRadius:i.config$$module$build$src$core$config.snapRadius,n=null;for(const u of e){const{connection:g,radius:I}=u.closest(o,t);g&&(n={local:u,neighbour:g,distance:I},o=I)}return n}getLocalConnections(e){const t=e.getConnections_(!1),o=e.lastConnectionInStack(!0);return o&&o!==e.nextConnection&&t.push(o),t}endDrag(e){if(this.block.isShadow()){let t;(t=this.block.getParent())==null||t.endDrag(e)}else{if(this.fireDragEndEvent(),this.fireMoveEvent(),no(),Ki(),this.connectionPreviewer.hidePreview(),!this.block.isDeadOrDying()&&this.dragging){let t;(t=this.workspace.getLayerManager())==null||t.moveOffDragLayer(this.block,jo),this.block.setDragging(!1)}this.connectionCandidate?(this.applyConnections(this.connectionCandidate),this.disposeStep()):this.block.queueRender().then(()=>this.disposeStep()),this.inGroup||i.setGroup$$module$build$src$core$events$utils(!1)}}disposeStep(){this.block.snapToGrid(),this.connectionPreviewer.dispose(),this.workspace.setResizesEnabled(!0)}applyConnections(e){const{local:t,neighbour:o}=e;t.connect(o);const n=t.isSuperior()?o:t,u=this.block.getRootBlock();Ts().then(()=>{Ga(n.getSourceBlock()),setTimeout(()=>{u.bringToFront()},0)})}revertDrag(){if(this.block.isShadow()){let t;(t=this.block.getParent())==null||t.revertDrag()}else{var e;if((e=this.startChildConn)==null||e.connect(this.block.nextConnection),this.startParentConn)switch(this.startParentConn.type){case xe.INPUT_VALUE:this.startParentConn.connect(this.block.outputConnection);break;case xe.NEXT_STATEMENT:this.startParentConn.connect(this.block.previousConnection)}else{this.block.moveTo(this.startLoc,["drag"]);let t;(t=this.workspace.getLayerManager())==null||t.moveOffDragLayer(this.block,jo),Ji(this.workspace,this.workspace.getMetricsManager().getScrollMetrics(!0),this.block)}this.startParentConn=this.startChildConn=null,this.connectionPreviewer.hidePreview(),this.connectionCandidate=null,this.block.setDragging(!1),this.dragging=!1}}},zv=class{constructor(){this.drawer=this.curNode=this.colour=null,this.type="marker"}setDrawer(e){this.drawer=e}getDrawer(){return this.drawer}getCurNode(){return this.curNode}setCurNode(e){const t=this.curNode;this.curNode=e,this.drawer&&this.drawer.draw(t,this.curNode)}draw(){this.drawer&&this.drawer.draw(this.curNode,this.curNode)}hide(){this.drawer&&this.drawer.hide()}dispose(){this.getDrawer()&&this.getDrawer().dispose()}},wp=class extends zv{constructor(){super(),this.type="cursor"}next(){var e=this.getCurNode();if(!e)return null;for(e=e.next();e&&e.next()&&(e.getType()===de.types.NEXT||e.getType()===de.types.BLOCK);)e=e.next();return e&&this.setCurNode(e),e}in(){var e=this.getCurNode();if(!e)return null;(e.getType()===de.types.PREVIOUS||e.getType()===de.types.OUTPUT)&&(e=e.next());let t,o;return(e=(o=(t=e)==null?void 0:t.in())!=null?o:null)&&this.setCurNode(e),e}prev(){var e=this.getCurNode();if(!e)return null;for(e=e.prev();e&&e.prev()&&(e.getType()===de.types.NEXT||e.getType()===de.types.BLOCK);)e=e.prev();return e&&this.setCurNode(e),e}out(){var e=this.getCurNode();return e?((e=e.out())&&e.getType()===de.types.BLOCK&&(e=e.prev()||e),e&&this.setCurNode(e),e):null}};r($e.CURSOR,Ws,wp);var Nr=class extends wp{constructor(){super()}next(){var e=this.getCurNode();return e?((e=this.getNextNode_(e,this.validNode_))&&this.setCurNode(e),e):null}in(){return this.next()}prev(){var e=this.getCurNode();return e?((e=this.getPreviousNode_(e,this.validNode_))&&this.setCurNode(e),e):null}out(){return this.prev()}getNextNode_(e,t){if(!e)return null;const o=e.in()||e.next();return t(o)?o:o?this.getNextNode_(o,t):(e=this.findSiblingOrParent(e.out()),t(e)?e:e?this.getNextNode_(e,t):null)}getPreviousNode_(e,t){if(!e)return null;let o=e.prev();return o=o?this.getRightMostChild(o):e.out(),t(o)?o:o?this.getPreviousNode_(o,t):null}validNode_(e){let t=!1;return e=e&&e.getType(),(e===de.types.OUTPUT||e===de.types.INPUT||e===de.types.FIELD||e===de.types.NEXT||e===de.types.PREVIOUS||e===de.types.WORKSPACE)&&(t=!0),t}findSiblingOrParent(e){if(!e)return null;const t=e.next();return t||this.findSiblingOrParent(e.out())}getRightMostChild(e){if(!e.in())return e;for(e=e.in();e&&e.next();)e=e.next();return this.getRightMostChild(e)}};Nr.registrationName="basicCursor",r($e.CURSOR,Nr.registrationName,Nr);var Uv=class extends Nr{validNode_(e){let t=!1;const o=e&&e.getType();return e&&(e=e.getLocation(),o===de.types.FIELD&&e&&e.isTabNavigable()&&e.isClickable()&&(t=!0)),t}},Hv=10,Yt=class extends Qe{constructor(e,t){super(e,t),this.highlighted=!1,this.targetConnection=null,this.db=e.workspace.connectionDBList[t],this.dbOpposite=e.workspace.connectionDBList[ki[t]],this.offsetInBlock=new ye(0,0),this.trackedState=Yt.TrackedState.WILL_TRACK}dispose(){super.dispose(),this.trackedState===Yt.TrackedState.TRACKED&&this.db.removeConnection(this,this.y);let e,t;(t=(e=this.sourceBlock_.pathObject).removeConnectionHighlight)==null||t.call(e,this)}getSourceBlock(){return super.getSourceBlock()}targetBlock(){return super.targetBlock()}distanceFrom(e){const t=this.x-e.x;return e=this.y-e.y,Math.sqrt(t*t+e*e)}bumpAwayFrom(e,t=!1){if(!this.sourceBlock_.workspace.isDragging()){var o=i.config$$module$build$src$core$config.snapRadius+Math.floor(Math.random()*Hv),n=i.config$$module$build$src$core$config.snapRadius+Math.floor(Math.random()*Hv),u=e.sourceBlock_.getRootBlock(),g=this.sourceBlock_.getRootBlock();if(!u.isInFlyout&&!g.isInFlyout){var I=!0;if(g.isMovable())u.isMovable()&&t&&(n=-n);else if(u.isMovable())I=!1,o=-o,n=-n;else return;t=I?e:this,e=I?this:e,u=I?g:u,(g=F()===u)||u.addSelect(),u.RTL&&(o=-o),u.moveBy(t.x+o-e.x,t.y+n-e.y,["bump"]),g||u.removeSelect()}}}moveTo(e,t){let o=!1;return this.trackedState===Yt.TrackedState.WILL_TRACK?(this.db.addConnection(this,t),this.trackedState=Yt.TrackedState.TRACKED,o=!0):this.trackedState===Yt.TrackedState.TRACKED&&(this.db.removeConnection(this,this.y),this.db.addConnection(this,t),o=!0),this.x=e,this.y=t,o}moveBy(e,t){return this.moveTo(this.x+e,this.y+t)}moveToOffset(e){return this.moveTo(e.x+this.offsetInBlock.x,e.y+this.offsetInBlock.y)}setOffsetInBlock(e,t){this.offsetInBlock.x=e,this.offsetInBlock.y=t}getOffsetInBlock(){return this.offsetInBlock}tightenEfficiently(){var e=this.targetConnection;const t=this.targetBlock();e&&t&&(e=ye.difference(this.offsetInBlock,e.offsetInBlock),t.translate(e.x,e.y))}closest(e,t){return this.dbOpposite.searchForClosest(this,e,t)}highlight(){this.highlighted=!0,this.getSourceBlock().queueRender()}unhighlight(){this.highlighted=!1,this.getSourceBlock().queueRender()}isHighlighted(){return this.highlighted}setTracking(e){e&&this.trackedState===Yt.TrackedState.TRACKED||!e&&this.trackedState===Yt.TrackedState.UNTRACKED||this.sourceBlock_.isInFlyout||(e?(this.db.addConnection(this,this.y),this.trackedState=Yt.TrackedState.TRACKED):(this.trackedState===Yt.TrackedState.TRACKED&&this.db.removeConnection(this,this.y),this.trackedState=Yt.TrackedState.UNTRACKED))}stopTrackingAll(){if(this.setTracking(!1),this.targetConnection){const e=this.targetBlock().getDescendants(!1);for(let t=0;tclearTimeout(e)),this.warningTextDb.clear(),this.getIcons().forEach(e=>e.dispose())}checkAndDelete(){this.workspace.isFlyout||(i.setGroup$$module$build$src$core$events$utils(!0),this.workspace.hideChaff(),this.outputConnection?this.dispose(!1,!0):this.dispose(!0,!0),i.setGroup$$module$build$src$core$events$utils(!1))}toCopyData(){return this.isInsertionMarker_?null:{paster:Or.TYPE,blockState:os(this,{addCoordinates:!0,addNextBlocks:!1}),typeCounts:Ie(this,!0)}}applyColour(){this.pathObject.applyColour(this);const e=this.getIcons();for(let t=0;t{this.isDeadOrDying()||(this.warningTextDb.delete(t),this.setWarningText(e,t))},100));else if(this.isInFlyout&&(e=null),o=this.getIcon(wo.TYPE),e){let n=this.getSurroundParent(),u=null;for(;n;)n.isCollapsed()&&(u=n),n=n.getSurroundParent();u&&u.setWarningText(i.Msg$$module$build$src$core$msg.COLLAPSED_WARNINGS_WARNING,$s.COLLAPSED_WARNING_ID),o?o.addMessage(e,t):this.addIcon(new wo(this).addMessage(e,t))}else o&&(t?(o.addMessage("",t),o.getText()||this.removeIcon(wo.TYPE)):this.removeIcon(wo.TYPE))}setMutator(e){this.removeIcon(i.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE),e&&this.addIcon(e)}addIcon(e){return super.addIcon(e),e instanceof i.MutatorIcon$$module$build$src$core$icons$mutator_icon&&(this.mutator=e),e.initView(this.createIconPointerDownListener(e)),e.applyColour(),e.updateEditable(),this.queueRender(),e}createIconPointerDownListener(e){return t=>{this.isDeadOrDying()||(t=this.workspace.getGesture(t))&&t.setStartIcon(e)}}removeIcon(e){const t=super.removeIcon(e);return e.equals(i.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE)&&(this.mutator=null),this.queueRender(),t}setEnabled(e){w("setEnabled","v11","v12","the setDisabledReason method of BlockSvg");const t=this.isEnabled();super.setEnabled(e),this.isEnabled()===t||this.getInheritedDisabled()||this.updateDisabled()}setDisabledReason(e,t){const o=this.isEnabled();super.setDisabledReason(e,t),this.isEnabled()===o||this.getInheritedDisabled()||this.updateDisabled()}setHighlighted(e){this.pathObject.updateHighlighted(e)}addSelect(){this.pathObject.updateSelected(!0)}removeSelect(){this.pathObject.updateSelected(!1)}setDeleteStyle(e){this.pathObject.updateDraggingDelete(e)}getColour(){return this.style.colourPrimary}setColour(e){super.setColour(e),e=this.workspace.getRenderer().getConstants().getBlockStyleForColour(this.colour_),this.pathObject.setStyle(e.style),this.style=e.style,this.styleName_=e.name,this.applyColour()}setStyle(e){const t=this.workspace.getRenderer().getConstants().getBlockStyle(e);if(this.styleName_=e,t)this.hat=t.hat,this.pathObject.setStyle(t),this.colour_=t.colourPrimary,this.style=t,this.applyColour();else throw Error("Invalid style name: "+e)}getStyle(){return this.style}bringToFront(e=!1){let t=this;if(!t.isDeadOrDying())do{const o=t.getSvgRoot(),n=o.parentNode,u=n.childNodes;if(u[u.length-1]!==o&&n.appendChild(o),e)break;t=t.getParent()}while(t)}setPreviousStatement(e,t){super.setPreviousStatement(e,t),this.queueRender()}setNextStatement(e,t){super.setNextStatement(e,t),this.queueRender()}setOutput(e,t){super.setOutput(e,t),this.queueRender()}setInputsInline(e){super.setInputsInline(e),this.queueRender()}removeInput(e,t){return e=super.removeInput(e,t),this.queueRender(),e}moveNumberedInputBefore(e,t){super.moveNumberedInputBefore(e,t),this.queueRender()}appendInput(e){return super.appendInput(e),this.queueRender(),e}setConnectionTracking(e){if(this.previousConnection&&this.previousConnection.setTracking(e),this.outputConnection&&this.outputConnection.setTracking(e),this.nextConnection){this.nextConnection.setTracking(e);var t=this.nextConnection.targetBlock();t&&t.setConnectionTracking(e)}if(!this.collapsed_)for(t=0;t=this.workspace.options.maxTrashcanContents||(e=new gs({scrollbars:!0,parentWorkspace:this.workspace,rtl:this.workspace.RTL,oneBasedIndex:this.workspace.options.oneBasedIndex,renderer:this.workspace.options.renderer,rendererOverrides:this.workspace.options.rendererOverrides,move:{scrollbars:!0}}),this.workspace.horizontalLayout?(e.toolboxPosition=this.workspace.toolboxPosition===Ge.TOP?Ge.BOTTOM:Ge.TOP,this.flyout=new(y($e.FLYOUTS_HORIZONTAL_TOOLBOX,this.workspace.options,!0))(e)):(e.toolboxPosition=this.workspace.toolboxPosition===Ge.RIGHT?Ge.LEFT:Ge.RIGHT,this.flyout=new(y($e.FLYOUTS_VERTICAL_TOOLBOX,this.workspace.options,!0))(e)),this.workspace.addChangeListener(this.onDelete.bind(this)))}createDom(){this.svgGroup=ie(J.G,{class:"blocklyTrash"});let e;const t=String(Math.random()).substring(2);e=ie(J.CLIPPATH,{id:"blocklyTrashBodyClipPath"+t},this.svgGroup),ie(J.RECT,{width:mn,height:Hl,y:fn},e);const o=ie(J.IMAGE,{width:Gt.width,x:-Cp,height:Gt.height,y:-Tp,"clip-path":"url(#blocklyTrashBodyClipPath"+t+")"},this.svgGroup);return o.setAttributeNS(is,"xlink:href",this.workspace.options.pathToMedia+Gt.url),e=ie(J.CLIPPATH,{id:"blocklyTrashLidClipPath"+t},this.svgGroup),ie(J.RECT,{width:mn,height:fn},e),this.svgLid=ie(J.IMAGE,{width:Gt.width,x:-Cp,height:Gt.height,y:-Tp,"clip-path":"url(#blocklyTrashLidClipPath"+t+")"},this.svgGroup),this.svgLid.setAttributeNS(is,"xlink:href",this.workspace.options.pathToMedia+Gt.url),ue(this.svgGroup,"pointerdown",this,this.blockMouseDownWhenOpenable),ue(this.svgGroup,"pointerup",this,this.click),ue(o,"pointerover",this,this.mouseOver),ue(o,"pointerout",this,this.mouseOut),this.animateLid(),this.svgGroup}init(){0{let o;(o=this.flyout)==null||o.show(e),t.cursor="";let n;(n=this.workspace.scrollbar)==null||n.setVisible(!1)},10),this.fireUiEvent(!0)}}closeFlyout(){if(this.contentsIsOpen()){var e;(e=this.flyout)==null||e.hide();var t;(t=this.workspace.scrollbar)==null||t.setVisible(!0),this.fireUiEvent(!1),this.workspace.recordDragTargets()}}autoHide(e){!e&&this.flyout&&this.closeFlyout()}emptyContents(){this.hasContents()&&(this.contents.length=0,this.setMinOpenness(0),this.closeFlyout())}position(e,t){if(this.initialized){var o=wa(this.workspace,e);e=_a(o,new Xe(mn,Hl+fn),rT,Vv,e,this.workspace),t=ka(e,Vv,o.vertical===$o.TOP?Po.DOWN:Po.UP,t),this.top=t.top,this.left=t.left;var n;(n=this.svgGroup)==null||n.setAttribute("transform","translate("+this.left+","+this.top+")");var u;(u=this.flyout)==null||u.position()}}getBoundingRectangle(){return new rt(this.top,this.top+Hl+fn,this.left,this.left+mn)}getClientRect(){if(!this.svgGroup)return null;var e=this.svgGroup.getBoundingClientRect();const t=e.top+Tp-Wl;return e=e.left+Cp-Wl,new rt(t,t+fn+Hl+2*Wl,e,e+mn+2*Wl)}onDragOver(e){this.setLidOpen(this.wouldDelete_)}onDragExit(e){this.setLidOpen(!1)}onDrop(e){setTimeout(this.setLidOpen.bind(this,!1),100)}setLidOpen(e){this.isLidOpen!==e&&(this.lidTask&&clearTimeout(this.lidTask),this.isLidOpen=e,this.animateLid())}animateLid(){const e=cT;var t=1/(e+1);this.lidOpen+=this.isLidOpen?t:-t,this.lidOpen=Math.min(Math.max(this.lidOpen,this.minOpenness),1),this.setLidAngle(this.lidOpen*Yv),t=Kv+this.lidOpen*(uT-Kv),this.svgGroup&&(this.svgGroup.style.opacity=`${t}`),this.lidOpen>this.minOpenness&&1>this.lidOpen&&(this.lidTask=setTimeout(this.animateLid.bind(this),lT/e))}setLidAngle(e){const t=this.workspace.toolboxPosition===Ge.RIGHT||this.workspace.horizontalLayout&&this.workspace.RTL;let o;(o=this.svgLid)==null||o.setAttribute("transform","rotate("+(t?-e:e)+","+(t?4:mn-4)+","+(fn-2)+")")}setMinOpenness(e){this.minOpenness=e,this.isLidOpen||this.setLidAngle(e*Yv)}closeLid(){this.setLidOpen(!1)}click(){this.hasContents()&&!this.workspace.isDragging()&&this.openFlyout()}fireUiEvent(e){e=new(ne(ee.TRASHCAN_OPEN))(e,this.workspace.id),z(e)}blockMouseDownWhenOpenable(e){!this.contentsIsOpen()&&this.hasContents()&&e.stopPropagation()}mouseOver(){this.hasContents()&&this.setLidOpen(!0)}mouseOut(){this.setLidOpen(!1)}onDelete(e){if(!(0>=this.workspace.options.maxTrashcanContents||!S(e)||e.wasShadow)){if(!e.oldJson)throw Error("Encountered a delete event without proper oldJson");if(e=JSON.stringify(this.cleanBlockJson(e.oldJson)),!this.contents.includes(e)){for(this.contents.unshift(e);this.contents.length>this.workspace.options.maxTrashcanContents;)this.contents.pop();this.setMinOpenness(aT)}}}cleanBlockJson(e){function t(o){if(o){if(delete o.id,delete o.x,delete o.y,delete o.enabled,delete o.disabledReasons,o.icons&&o.icons.comment){var n=o.icons.comment;delete n.height,delete n.width,delete n.pinned}n=o.inputs;for(var u in n){var g=n[u];const I=g.block;g=g.shadow,I&&t(I),g&&t(g)}o.next&&(u=o.next,o=u.block,u=u.shadow,o&&t(o),u&&t(u))}}return e=JSON.parse(JSON.stringify(e)),t(e),Object.assign({},{kind:"BLOCK"},e)}},mn=47,Hl=44,fn=16,Vv=20,rT=20,Wl=10,Cp=0,Tp=32,aT=.1,lT=80,cT=4,Kv=.4,uT=.8,Yv=45,st=class{constructor(){this.shortcuts=new Map,this.keyMap=new Map,this.reset()}reset(){this.shortcuts.clear(),this.keyMap.clear()}register(e,t){if(this.shortcuts.get(e.name)&&!t)throw Error(`Shortcut named "${e.name}" already exists.`);if(this.shortcuts.set(e.name,e),t=e.keyCodes,t!=null&&t.length)for(const o of t)this.addKeyMapping(o,e.name,!!e.allowCollision)}unregister(e){return this.shortcuts.get(e)?(this.removeAllKeyMappings(e),this.shortcuts.delete(e),!0):(console.warn(`Keyboard shortcut named "${e}" not found.`),!1)}addKeyMapping(e,t,o){e=`${e}`;const n=this.keyMap.get(e);if(n&&!o)throw Error(`Shortcut named "${t}" collides with shortcuts "${n}"`);n&&o?n.unshift(t):this.keyMap.set(e,[t])}removeKeyMapping(e,t,o){const n=this.keyMap.get(e);if(!n)return o||console.warn(`No keyboard shortcut named "${t}" registered with key code "${e}"`),!1;const u=n.indexOf(t);return-1Yd(t)),e.length?e:null}load(e,t){const o=t.getProcedureMap();for(const n of e)o.add(Jd(this.procedureModelClass,this.parameterModelClass,n,t))}clear(e){e.getProcedureMap().clear()}},Gl={};Gl.ProcedureSerializer=hT,Gl.loadProcedure=Jd,Gl.saveProcedure=Yd;var Jv=class{constructor(){this.priority=Wb}save(e){const t=[];for(const o of e.getAllVariables())e={name:o.name,id:o.getId()},o.type&&(e.type=o.type),t.push(e);return t.length?t:null}load(e,t){for(const o of e)t.createVariable(o.name,o.type,o.id)}clear(e){e.getVariableMap().clear()}};Vn("variables",new Jv);var qv={};qv.VariableSerializer=Jv;var Ip={};Ip.load=X$,Ip.save=q$;var pT={blocks:_r,exceptions:pi,priorities:UC,procedures:Gl,registry:Dh,variables:qv,workspaceComments:hl,workspaces:Ip},xp=class{constructor(e,t,o,n,u){this.workspace=e,this.oldHostMetrics=this.corner_=this.vScroll=this.hScroll=null,t=t===void 0?!0:t,o=o===void 0?!0:o;const g=t&&o;t&&(this.hScroll=new yt(e,!0,g,n,u)),o&&(this.vScroll=new yt(e,!1,g,n,u)),g&&(this.corner_=ie(J.RECT,{height:yt.scrollbarThickness,width:yt.scrollbarThickness,class:"blocklyScrollbarBackground"}),At(this.corner_,e.getBubbleCanvas()))}dispose(){Ze(this.corner_),this.oldHostMetrics=this.corner_=null,this.hScroll&&(this.hScroll.dispose(),this.hScroll=null),this.vScroll&&(this.vScroll.dispose(),this.vScroll=null)}resize(){const e=this.workspace.getMetrics();if(e){var t=!1,o=!1;if(this.oldHostMetrics&&this.oldHostMetrics.viewWidth===e.viewWidth&&this.oldHostMetrics.viewHeight===e.viewHeight&&this.oldHostMetrics.absoluteTop===e.absoluteTop&&this.oldHostMetrics.absoluteLeft===e.absoluteLeft?(this.oldHostMetrics&&this.oldHostMetrics.scrollWidth===e.scrollWidth&&this.oldHostMetrics.viewLeft===e.viewLeft&&this.oldHostMetrics.scrollLeft===e.scrollLeft||(t=!0),this.oldHostMetrics&&this.oldHostMetrics.scrollHeight===e.scrollHeight&&this.oldHostMetrics.viewTop===e.viewTop&&this.oldHostMetrics.scrollTop===e.scrollTop||(o=!0)):o=t=!0,t||o){try{i.disable$$module$build$src$core$events$utils(),this.hScroll&&t&&this.hScroll.resize(e),this.vScroll&&o&&this.vScroll.resize(e)}finally{i.enable$$module$build$src$core$events$utils()}this.workspace.maybeFireViewportChangeEvent()}if(this.hScroll&&this.vScroll){if(!this.oldHostMetrics||this.oldHostMetrics.viewWidth!==e.viewWidth||this.oldHostMetrics.absoluteLeft!==e.absoluteLeft){let n;(n=this.corner_)==null||n.setAttribute("x",String(this.vScroll.position.x))}if(!this.oldHostMetrics||this.oldHostMetrics.viewHeight!==e.viewHeight||this.oldHostMetrics.absoluteTop!==e.absoluteTop){let n;(n=this.corner_)==null||n.setAttribute("y",String(this.hScroll.position.y))}}this.oldHostMetrics=e}}canScrollHorizontally(){return!!this.hScroll}canScrollVertically(){return!!this.vScroll}setOrigin(e,t){this.hScroll&&this.hScroll.setOrigin(e,t),this.vScroll&&this.vScroll.setOrigin(e,t)}set(e,t,o){this.hScroll&&this.hScroll.set(e,!1),this.vScroll&&this.vScroll.set(t,!1),(o||o===void 0)&&(e={},this.hScroll&&(e.x=this.hScroll.getRatio_()),this.vScroll&&(e.y=this.vScroll.getRatio_()),this.workspace.setMetrics(e))}setX(e){this.hScroll&&this.hScroll.set(e,!0)}setY(e){this.vScroll&&this.vScroll.set(e,!0)}setContainerVisible(e){this.hScroll&&this.hScroll.setContainerVisible(e),this.vScroll&&this.vScroll.setContainerVisible(e)}isVisible(){let e=!1;return this.hScroll&&(e=this.hScroll.isVisible()),this.vScroll&&(e=e||this.vScroll.isVisible()),e}setVisible(e){this.hScroll&&this.hScroll.setVisibleInternal(e),this.vScroll&&this.vScroll.setVisibleInternal(e)}resizeContent(e){this.hScroll&&this.hScroll.resizeContentHorizontal(e),this.vScroll&&this.vScroll.resizeContentVertical(e)}resizeView(e){this.hScroll&&this.hScroll.resizeViewHorizontal(e),this.vScroll&&this.vScroll.resizeViewVertical(e)}},Dp=class{constructor(e){this.workspace_=e}getDimensionsPx_(e){let t=0,o=0;return e&&(t=e.getWidth(),o=e.getHeight()),new Xe(t,o)}getFlyoutMetrics(e){return e=this.getDimensionsPx_(this.workspace_.getFlyout(e)),{width:e.width,height:e.height,position:this.workspace_.toolboxPosition}}getToolboxMetrics(){const e=this.getDimensionsPx_(this.workspace_.getToolbox());return{width:e.width,height:e.height,position:this.workspace_.toolboxPosition}}getSvgMetrics(){return this.workspace_.getCachedParentSvgSize()}getAbsoluteMetrics(){let e=0,t=0;const o=this.getToolboxMetrics(),n=this.getFlyoutMetrics(),u=!!this.workspace_.getToolbox();var g;const I=!((g=this.workspace_.getFlyout())!=null&&g.autoClose);g=u?o.position:n.position;const L=g===Ge.TOP;return g===Ge.LEFT&&(u&&(e+=o.width),I&&(e+=n.width)),L&&(u&&(t+=o.height),I&&(t+=n.height)),{top:t,left:e}}getViewMetrics(e){e=e?this.workspace_.scale:1;const t=this.getSvgMetrics(),o=this.getToolboxMetrics(),n=this.getFlyoutMetrics(),u=!!this.workspace_.getToolbox();var g;const I=!((g=this.workspace_.getFlyout())!=null&&g.autoClose);g=u?o.position:n.position;const L=g===Ge.LEFT||g===Ge.RIGHT;return(g===Ge.TOP||g===Ge.BOTTOM)&&(u&&(t.height-=o.height),I&&(t.height-=n.height)),L&&(u&&(t.width-=o.width),I&&(t.width-=n.width)),{height:t.height/e,width:t.width/e,top:-this.workspace_.scrollY/e,left:-this.workspace_.scrollX/e}}getContentMetrics(e){e=e?1:this.workspace_.scale;const t=this.workspace_.getBlocksBoundingBox();return{height:(t.bottom-t.top)*e,width:(t.right-t.left)*e,top:t.top*e,left:t.left*e}}hasFixedEdges(){return!this.workspace_.isMovableHorizontally()||!this.workspace_.isMovableVertically()}getComputedFixedEdges_(e){if(!this.hasFixedEdges())return{};const t=this.workspace_.isMovableHorizontally(),o=this.workspace_.isMovableVertically();e=e||this.getViewMetrics(!1);const n={};return o||(n.top=e.top,n.bottom=e.top+e.height),t||(n.left=e.left,n.right=e.left+e.width),n}getPaddedContent_(e,t){const o=t.top+t.height,n=t.left+t.width,u=e.width;e=e.height;const g=u/2,I=e/2;return{top:Math.min(t.top-I,o-e),bottom:Math.max(o+I,t.top+e),left:Math.min(t.left-g,n-u),right:Math.max(n+g,t.left+u)}}getScrollMetrics(e,t,o){e=e?this.workspace_.scale:1,t=t||this.getViewMetrics(!1);var n=o||this.getContentMetrics();o=this.getComputedFixedEdges_(t),t=this.getPaddedContent_(t,n),n=o.top!==void 0?o.top:t.top;const u=o.left!==void 0?o.left:t.left;return{top:n/e,left:u/e,width:((o.right!==void 0?o.right:t.right)-u)/e,height:((o.bottom!==void 0?o.bottom:t.bottom)-n)/e}}getUiMetrics(){return{viewMetrics:this.getViewMetrics(),absoluteMetrics:this.getAbsoluteMetrics(),toolboxMetrics:this.getToolboxMetrics()}}getMetrics(){const e=this.getToolboxMetrics(),t=this.getFlyoutMetrics(!0),o=this.getSvgMetrics(),n=this.getAbsoluteMetrics(),u=this.getViewMetrics(),g=this.getContentMetrics(),I=this.getScrollMetrics(!1,u,g);return{contentHeight:g.height,contentWidth:g.width,contentTop:g.top,contentLeft:g.left,scrollHeight:I.height,scrollWidth:I.width,scrollTop:I.top,scrollLeft:I.left,viewHeight:u.height,viewWidth:u.width,viewTop:u.top,viewLeft:u.left,absoluteTop:n.top,absoluteLeft:n.left,svgHeight:o.height,svgWidth:o.width,toolboxWidth:e.width,toolboxHeight:e.height,toolboxPosition:e.position,flyoutWidth:t.width,flyoutHeight:t.height}}};r($e.METRICS_MANAGER,Ws,Dp),"Blockly"in globalThis||(globalThis.Blockly={Msg:ev});var Xv=class extends Pl{constructor(){super(),this.GRID_UNIT=4,this.CURSOR_COLOUR="#ffa200",this.CURSOR_RADIUS=5,this.JAGGED_TEETH_WIDTH=this.JAGGED_TEETH_HEIGHT=0,this.START_HAT_HEIGHT=22,this.START_HAT_WIDTH=96,this.SHAPES={HEXAGONAL:1,ROUND:2,SQUARE:3,PUZZLE:4,NOTCH:5},this.SHAPE_IN_SHAPE_PADDING={1:{0:5*this.GRID_UNIT,1:2*this.GRID_UNIT,2:5*this.GRID_UNIT,3:5*this.GRID_UNIT},2:{0:3*this.GRID_UNIT,1:3*this.GRID_UNIT,2:1*this.GRID_UNIT,3:2*this.GRID_UNIT},3:{0:2*this.GRID_UNIT,1:2*this.GRID_UNIT,2:2*this.GRID_UNIT,3:2*this.GRID_UNIT}},this.FULL_BLOCK_FIELDS=!0,this.FIELD_TEXT_FONTWEIGHT="bold",this.FIELD_TEXT_FONTFAMILY='"Helvetica Neue", "Segoe UI", Helvetica, sans-serif',this.FIELD_COLOUR_FULL_BLOCK=this.FIELD_TEXTINPUT_BOX_SHADOW=this.FIELD_DROPDOWN_SVG_ARROW=this.FIELD_DROPDOWN_COLOURED_DIV=this.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW=!0,this.SELECTED_GLOW_COLOUR="#fff200",this.SELECTED_GLOW_SIZE=.5,this.REPLACEMENT_GLOW_COLOUR="#fff200",this.REPLACEMENT_GLOW_SIZE=2,this.selectedGlowFilterId="",this.selectedGlowFilter=null,this.replacementGlowFilterId="",this.SQUARED=this.ROUNDED=this.HEXAGONAL=this.replacementGlowFilter=null,this.SMALL_PADDING=this.GRID_UNIT,this.MEDIUM_PADDING=2*this.GRID_UNIT,this.MEDIUM_LARGE_PADDING=3*this.GRID_UNIT,this.LARGE_PADDING=4*this.GRID_UNIT,this.CORNER_RADIUS=1*this.GRID_UNIT,this.NOTCH_WIDTH=9*this.GRID_UNIT,this.NOTCH_HEIGHT=2*this.GRID_UNIT,this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT=3*this.GRID_UNIT,this.MIN_BLOCK_WIDTH=2*this.GRID_UNIT,this.MIN_BLOCK_HEIGHT=12*this.GRID_UNIT,this.EMPTY_STATEMENT_INPUT_HEIGHT=6*this.GRID_UNIT,this.TOP_ROW_MIN_HEIGHT=this.CORNER_RADIUS,this.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING,this.BOTTOM_ROW_MIN_HEIGHT=this.CORNER_RADIUS,this.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT=6*this.GRID_UNIT,this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT,this.STATEMENT_INPUT_SPACER_MIN_WIDTH=40*this.GRID_UNIT,this.STATEMENT_INPUT_PADDING_LEFT=4*this.GRID_UNIT,this.EMPTY_INLINE_INPUT_PADDING=4*this.GRID_UNIT,this.EMPTY_INLINE_INPUT_HEIGHT=8*this.GRID_UNIT,this.DUMMY_INPUT_MIN_HEIGHT=8*this.GRID_UNIT,this.DUMMY_INPUT_SHADOW_MIN_HEIGHT=6*this.GRID_UNIT,this.CURSOR_WS_WIDTH=20*this.GRID_UNIT,this.FIELD_TEXT_FONTSIZE=3*this.GRID_UNIT,this.FIELD_BORDER_RECT_RADIUS=this.CORNER_RADIUS,this.FIELD_BORDER_RECT_X_PADDING=2*this.GRID_UNIT,this.FIELD_BORDER_RECT_Y_PADDING=1.625*this.GRID_UNIT,this.FIELD_BORDER_RECT_HEIGHT=8*this.GRID_UNIT,this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=8*this.GRID_UNIT,this.FIELD_DROPDOWN_SVG_ARROW_PADDING=this.FIELD_BORDER_RECT_X_PADDING,this.FIELD_COLOUR_DEFAULT_WIDTH=6*this.GRID_UNIT,this.FIELD_COLOUR_DEFAULT_HEIGHT=8*this.GRID_UNIT,this.FIELD_CHECKBOX_X_OFFSET=1*this.GRID_UNIT,this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH=12*this.GRID_UNIT}setFontConstants_(e){super.setFontConstants_(e),this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT=this.FIELD_TEXT_HEIGHT+2*this.FIELD_BORDER_RECT_Y_PADDING}init(){super.init(),this.HEXAGONAL=this.makeHexagonal(),this.ROUNDED=this.makeRounded(),this.SQUARED=this.makeSquared(),this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT+this.INSIDE_CORNERS.rightWidth}setDynamicProperties_(e){super.setDynamicProperties_(e),this.SELECTED_GLOW_COLOUR=e.getComponentStyle("selectedGlowColour")||this.SELECTED_GLOW_COLOUR;const t=Number(e.getComponentStyle("selectedGlowSize"));this.SELECTED_GLOW_SIZE=t&&!isNaN(t)?t:this.SELECTED_GLOW_SIZE,this.REPLACEMENT_GLOW_COLOUR=e.getComponentStyle("replacementGlowColour")||this.REPLACEMENT_GLOW_COLOUR,this.REPLACEMENT_GLOW_SIZE=(e=Number(e.getComponentStyle("replacementGlowSize")))&&!isNaN(e)?e:this.REPLACEMENT_GLOW_SIZE}dispose(){super.dispose(),this.selectedGlowFilter&&Ze(this.selectedGlowFilter),this.replacementGlowFilter&&Ze(this.replacementGlowFilter)}makeStartHat(){const e=this.START_HAT_HEIGHT,t=this.START_HAT_WIDTH,o=Zt("c",[Me(25,-e),Me(71,-e),Me(t,0)]);return{height:e,width:t,path:o}}makeHexagonal(){function e(o,n,u){var g=o/2;return g=g>t?t:g,u=u?-1:1,o=(n?-1:1)*o/2,Hs(-u*g,o)+Hs(u*g,o)}const t=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH;return{type:this.SHAPES.HEXAGONAL,isDynamic:!0,width(o){return o/=2,o>t?t:o},height(o){return o},connectionOffsetY(o){return o/2},connectionOffsetX(o){return-o},pathDown(o){return e(o,!1,!1)},pathUp(o){return e(o,!0,!1)},pathRightDown(o){return e(o,!1,!0)},pathRightUp(o){return e(o,!1,!0)}}}makeRounded(){function e(n,u,g){const I=n>o?n-o:0;n=(n>o?o:n)/2;const L=g===u?"0":"1";return vt("a","0 0,"+L,n,Me((g?1:-1)*n,(u?-1:1)*n))+De("v",(u?-1:1)*I)+vt("a","0 0,"+L,n,Me((g?-1:1)*n,(u?-1:1)*n))}const t=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH,o=2*t;return{type:this.SHAPES.ROUND,isDynamic:!0,width(n){return n/=2,n>t?t:n},height(n){return n},connectionOffsetY(n){return n/2},connectionOffsetX(n){return-n},pathDown(n){return e(n,!1,!1)},pathUp(n){return e(n,!0,!1)},pathRightDown(n){return e(n,!1,!0)},pathRightUp(n){return e(n,!1,!0)}}}makeSquared(){function e(o,n,u){o-=2*t;const g=u===n?"0":"1";return vt("a","0 0,"+g,t,Me((u?1:-1)*t,(n?-1:1)*t))+De("v",(n?-1:1)*o)+vt("a","0 0,"+g,t,Me((u?-1:1)*t,(n?-1:1)*t))}const t=this.CORNER_RADIUS;return{type:this.SHAPES.SQUARE,isDynamic:!0,width(o){return t},height(o){return o},connectionOffsetY(o){return o/2},connectionOffsetX(o){return-o},pathDown(o){return e(o,!1,!1)},pathUp(o){return e(o,!0,!1)},pathRightDown(o){return e(o,!1,!0)},pathRightUp(o){return e(o,!1,!0)}}}shapeFor(e){let t=e.getCheck();switch(!t&&e.targetConnection&&(t=e.targetConnection.getCheck()),e.type){case xe.INPUT_VALUE:case xe.OUTPUT_VALUE:if(e=e.getSourceBlock().getOutputShape(),e!==null)switch(e){case this.SHAPES.HEXAGONAL:return this.HEXAGONAL;case this.SHAPES.ROUND:return this.ROUNDED;case this.SHAPES.SQUARE:return this.SQUARED}return t&&t.includes("Boolean")?this.HEXAGONAL:t&&t.includes("Number")?this.ROUNDED:(t&&t.includes("String"),this.ROUNDED);case xe.PREVIOUS_STATEMENT:case xe.NEXT_STATEMENT:return this.NOTCH;default:throw Error("Unknown type")}}makeNotch(){function e(Ee){return Zt("c",[Me(Ee*u/2,0),Me(Ee*u*3/4,I/2),Me(Ee*u,I)])+Yi([Me(Ee*u,g)])+Zt("c",[Me(Ee*u/4,I/2),Me(Ee*u/2,I),Me(Ee*u,I)])+De("h",Ee*n)+Zt("c",[Me(Ee*u/2,0),Me(Ee*u*3/4,-(I/2)),Me(Ee*u,-I)])+Yi([Me(Ee*u,-g)])+Zt("c",[Me(Ee*u/4,-(I/2)),Me(Ee*u/2,-I),Me(Ee*u,-I)])}const t=this.NOTCH_WIDTH,o=this.NOTCH_HEIGHT,n=t/3,u=n/3,g=o/2,I=g/2,L=e(1),le=e(-1);return{type:this.SHAPES.NOTCH,width:t,height:o,pathLeft:L,pathRight:le}}makeInsideCorners(){const e=this.CORNER_RADIUS,t=vt("a","0 0,0",e,Me(-e,e)),o=vt("a","0 0,1",e,Me(-e,e)),n=vt("a","0 0,0",e,Me(e,e)),u=vt("a","0 0,1",e,Me(e,e));return{width:e,height:e,pathTop:t,pathBottom:n,rightWidth:e,rightHeight:e,pathTopRight:o,pathBottomRight:u}}generateSecondaryColour_(e){return si("#000",e,.15)||e}generateTertiaryColour_(e){return si("#000",e,.25)||e}createDom(e,t,o){super.createDom(e,t,o),e=ie(J.DEFS,{},e),t=ie(J.FILTER,{id:"blocklySelectedGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},e),ie(J.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.SELECTED_GLOW_SIZE},t),o=ie(J.FECOMPONENTTRANSFER,{result:"outBlur"},t),ie(J.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},o),ie(J.FEFLOOD,{"flood-color":this.SELECTED_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},t),ie(J.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},t),this.selectedGlowFilterId=t.id,this.selectedGlowFilter=t,e=ie(J.FILTER,{id:"blocklyReplacementGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},e),ie(J.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.REPLACEMENT_GLOW_SIZE},e),t=ie(J.FECOMPONENTTRANSFER,{result:"outBlur"},e),ie(J.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},t),ie(J.FEFLOOD,{"flood-color":this.REPLACEMENT_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},e),ie(J.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},e),ie(J.FECOMPOSITE,{in:"SourceGraphic",in2:"outGlow",operator:"over"},e),this.replacementGlowFilterId=e.id,this.replacementGlowFilter=e}getCSS_(e){return[`${e} .blocklyText,`,`${e} .blocklyFlyoutLabelText {`,`font: ${this.FIELD_TEXT_FONTWEIGHT} ${this.FIELD_TEXT_FONTSIZE}pt ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${e} .blocklyTextInputBubble textarea {`,"font-weight: normal;","}",`${e} .blocklyText {`,"fill: #fff;","}",`${e} .blocklyNonEditableText>rect:not(.blocklyDropdownRect),`,`${e} .blocklyEditableText>rect:not(.blocklyDropdownRect) {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"}",`${e} .blocklyNonEditableText>text,`,`${e} .blocklyEditableText>text,`,`${e} .blocklyNonEditableText>g>text,`,`${e} .blocklyEditableText>g>text {`,"fill: #575E75;","}",`${e} .blocklyFlyoutLabelText {`,"fill: #575E75;","}",`${e} .blocklyText.blocklyBubbleText {`,"fill: #575E75;","}",`${e} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableText:not(.editing):hover>rect,",`${e} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableText:not(.editing):hover>.blocklyPath {","stroke: #fff;","stroke-width: 2;","}",`${e} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,"color: #575E75;","}",`${e} .blocklyDropdownText {`,"fill: #fff !important;","}",`${e}.blocklyWidgetDiv .blocklyMenuItem,`,`${e}.blocklyDropDownDiv .blocklyMenuItem {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${e}.blocklyDropDownDiv .blocklyMenuItemContent {`,"color: #fff;","}",`${e} .blocklyHighlightedConnectionPath {`,`stroke: ${this.SELECTED_GLOW_COLOUR};`,"}",`${e} .blocklyDisabled > .blocklyOutlinePath {`,`fill: url(#blocklyDisabledPattern${this.randomIdentifier})`,"}",`${e} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"]}},Zv=class extends Bl{constructor(e,t){super(e,t)}draw(){const e=this.block_.pathObject;e.beginDrawing(),this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights(),e.setPath(this.outlinePath_+` +`+this.inlinePath_),this.info_.RTL&&e.flipRTL(),this.recordSizeOnBlock_(),this.info_.outputConnection&&(e.outputShapeType=this.info_.outputConnection.shape.type),e.endDrawing()}drawOutline_(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape&&!this.info_.hasStatementInput&&!this.info_.bottomRow.hasNextConnection?(this.drawFlatTop_(),this.drawRightDynamicConnection_(),this.drawFlatBottom_(),this.drawLeftDynamicConnection_()):super.drawOutline_()}drawLeft_(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape?this.drawLeftDynamicConnection_():super.drawLeft_()}drawRightSideRow_(e){if(!(0>=e.height)){if(j.isSpacer(e)){const n=e.precedesStatement;var t=e.followsStatement;if(n||t){const u=this.constants_.INSIDE_CORNERS;var o=u.rightHeight;o=e.height-(n?o:0),t=t?u.pathBottomRight:"",e=0=o||0>=t)throw Error("Height and width values of an image field must be greater than 0.");this.size_=new Xe(t,o+Ci.Y_PADDING),this.imageHeight=o,typeof u=="function"&&(this.clickHandler=u),e!==lt.SKIP_SETUP&&(I?this.configure_(I):(this.flipRtl=!!g,this.altText=bt(n)||""),this.setValue(bt(e)))}configure_(e){super.configure_(e),e.flipRtl&&(this.flipRtl=e.flipRtl),e.alt&&(this.altText=bt(e.alt))}initView(){this.imageElement=ie(J.IMAGE,{height:this.imageHeight+"px",width:this.size_.width+"px",alt:this.altText},this.fieldGroup_),this.imageElement.setAttributeNS(is,"xlink:href",this.value_),this.clickHandler&&(this.imageElement.style.cursor="pointer")}updateSize_(){}doClassValidation_(e){return typeof e!="string"?null:e}doValueUpdate_(e){this.value_=e,this.imageElement&&this.imageElement.setAttributeNS(is,"xlink:href",this.value_)}getFlipRtl(){return this.flipRtl}setAlt(e){e!==this.altText&&(this.altText=e||"",this.imageElement&&this.imageElement.setAttribute("alt",this.altText))}showEditor_(){this.clickHandler&&this.clickHandler(this)}setOnClickHandler(e){this.clickHandler=e}getText_(){return this.altText}static fromJson(e){if(!e.src||!e.width||!e.height)throw Error("src, width, and height values for an image field arerequired. The width and height must be non-zero.");return new this(e.src,e.width,e.height,void 0,void 0,void 0,e)}};Ci.Y_PADDING=1,Us("field_image",Ci),Ci.prototype.DEFAULT_VALUE="";var Vl=class extends lt{constructor(e,t,o){super(lt.SKIP_SETUP),this.spellcheck_=!0,this.htmlInput_=null,this.isTextValid_=this.isBeingEdited_=!1,this.onKeyInputWrapper=this.onKeyDownWrapper=this.valueWhenEditorWasOpened_=null,this.fullBlockClickTarget_=!1,this.workspace_=null,this.SERIALIZABLE=!0,this.CURSOR="text",e!==lt.SKIP_SETUP&&(o&&this.configure_(o),this.setValue(e),t&&this.setValidator(t))}configure_(e){super.configure_(e),e.spellcheck!==void 0&&(this.spellcheck_=e.spellcheck)}initView(){if(!this.getSourceBlock())throw new _t;super.initView(),this.isFullBlockField()&&(this.clickTarget_=this.sourceBlock_.getSvgRoot())}isFullBlockField(){const e=this.getSourceBlock();if(!e)throw new _t;let t;return this.fullBlockClickTarget_=!((t=this.getConstants())==null||!t.FULL_BLOCK_FIELDS)&&e.isSimpleReporter()}doValueInvalid_(e,t=!0){this.isBeingEdited_&&(this.isDirty_=!0,this.isTextValid_=!1,e=this.value_,this.value_=this.valueWhenEditorWasOpened_,this.sourceBlock_&&C()&&this.value_!==e&&t&&z(new(ne(ee.BLOCK_CHANGE))(this.sourceBlock_,"field",this.name||null,e,this.value_)))}doValueUpdate_(e){this.isTextValid_=this.isDirty_=!0,this.value_=e}applyColour(){const e=this.getSourceBlock();if(!e)throw new _t;this.getConstants().FULL_BLOCK_FIELDS&&this.fieldGroup_&&(!this.isFullBlockField()&&this.borderRect_?(this.borderRect_.style.display="block",this.borderRect_.setAttribute("stroke",e.getColourTertiary())):(this.borderRect_.style.display="none",e.pathObject.svgPath.setAttribute("fill",this.getConstants().FIELD_BORDER_RECT_COLOUR)))}getSize(){let e;return(e=this.getConstants())!=null&&e.FULL_BLOCK_FIELDS&&(this.render_(),this.isDirty_=!1),super.getSize()}onLocationChange(){this.isBeingEdited_&&this.resizeEditor_()}render_(){if(super.render_(),this.isBeingEdited_){var e=this.htmlInput_;this.isTextValid_?(ze(e,"blocklyInvalidInput"),xt(e,Et.INVALID,!1)):(Re(e,"blocklyInvalidInput"),xt(e,Et.INVALID,!0))}if(e=this.getSourceBlock(),!e)throw new _t;this.getConstants().FULL_BLOCK_FIELDS&&e.applyColour()}setSpellcheck(e){e!==this.spellcheck_&&(this.spellcheck_=e,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))}showEditor_(e,t=!1){this.workspace_=this.sourceBlock_.workspace,!t&&this.workspace_.options.modalInputs&&(Ob||wh||ll)?this.showPromptEditor():this.showInlineEditor(t)}showPromptEditor(){Ea(i.Msg$$module$build$src$core$msg.CHANGE_VALUE_TITLE,this.getText(),e=>{e!==null&&this.setValue(this.getValueFromEditorText_(e)),this.onFinishEditing_(this.value_)})}showInlineEditor(e){const t=this.getSourceBlock();if(!t)throw new _t;Fa(this,t.RTL,this.widgetDispose_.bind(this),this.workspace_),this.htmlInput_=this.widgetCreate_(),this.isBeingEdited_=!0,this.valueWhenEditorWasOpened_=this.value_,e||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())}widgetCreate_(){var e=this.getSourceBlock();if(!e)throw new _t;i.setGroup$$module$build$src$core$events$utils(!0);const t=oi();var o=this.getClickTarget_();if(!o)throw Error("A click target has not been set.");Re(o,"editing"),o=document.createElement("input"),o.className="blocklyHtmlInput",o.setAttribute("spellcheck",this.spellcheck_);const n=this.workspace_.getScale();var u=this.getConstants().FIELD_TEXT_FONTSIZE*n+"pt";return t.style.fontSize=u,o.style.fontSize=u,u=Vl.BORDERRADIUS*n+"px",this.isFullBlockField()&&(u=this.getScaledBBox(),u=(u.bottom-u.top)/2+"px",e=e.getParent()?e.getParent().getColourTertiary():this.sourceBlock_.getColourTertiary(),o.style.border=1*n+"px solid "+e,t.style.borderRadius=u,t.style.transition="box-shadow 0.25s ease 0s",this.getConstants().FIELD_TEXTINPUT_BOX_SHADOW&&(t.style.boxShadow="rgba(255, 255, 255, 0.3) 0 0 0 "+4*n+"px")),o.style.borderRadius=u,t.appendChild(o),o.value=o.defaultValue=this.getEditorText_(this.value_),o.setAttribute("data-untyped-default-value",String(this.value_)),this.resizeEditor_(),this.bindInputEvents_(o),o}widgetDispose_(){this.isBeingEdited_=!1,this.isTextValid_=!0,this.forceRerender(),this.onFinishEditing_(this.value_),this.sourceBlock_&&C()&&this.valueWhenEditorWasOpened_!==null&&this.valueWhenEditorWasOpened_!==this.value_&&(z(new(ne(ee.BLOCK_CHANGE))(this.sourceBlock_,"field",this.name||null,this.valueWhenEditorWasOpened_,this.value_)),this.valueWhenEditorWasOpened_=null),i.setGroup$$module$build$src$core$events$utils(!1),this.unbindInputEvents_();var e=oi().style;if(e.width="auto",e.height="auto",e.fontSize="",e.transition="",e.boxShadow="",this.htmlInput_=null,e=this.getClickTarget_(),!e)throw Error("A click target has not been set.");ze(e,"editing")}onFinishEditing_(e){}bindInputEvents_(e){this.onKeyDownWrapper=H(e,"keydown",this,this.onHtmlInputKeyDown_),this.onKeyInputWrapper=H(e,"input",this,this.onHtmlInputChange)}unbindInputEvents_(){this.onKeyDownWrapper&&(V(this.onKeyDownWrapper),this.onKeyDownWrapper=null),this.onKeyInputWrapper&&(V(this.onKeyInputWrapper),this.onKeyInputWrapper=null)}onHtmlInputKeyDown_(e){e.key==="Enter"?(ii(this),Fs()):e.key==="Escape"?(this.setValue(this.htmlInput_.getAttribute("data-untyped-default-value"),!1),ii(this),Fs()):e.key==="Tab"&&(ii(this),Fs(),this.sourceBlock_.tab(this,!e.shiftKey),e.preventDefault())}onHtmlInputChange(e){e=this.value_,this.setValue(this.getValueFromEditorText_(this.htmlInput_.value),!1),this.sourceBlock_&&C()&&this.value_!==e&&z(new(ne(ee.BLOCK_FIELD_INTERMEDIATE_CHANGE))(this.sourceBlock_,this.name||null,e,this.value_))}setEditorValue_(e,t=!0){this.isDirty_=!0,this.isBeingEdited_&&(this.htmlInput_.value=this.getEditorText_(e)),this.setValue(e,t)}resizeEditor_(){Ts().then(()=>{const e=this.getSourceBlock();if(!e)throw new _t;const t=oi(),o=this.getScaledBBox();t.style.width=o.right-o.left+"px",t.style.height=o.bottom-o.top+"px";const n=o.top;t.style.left=`${e.RTL?o.right-t.offsetWidth:o.left}px`,t.style.top=`${n}px`})}repositionForWindowResize(){let e;const t=(e=this.getSourceBlock())==null?void 0:e.getRootBlock();return t instanceof $s?(Ji(this.workspace_,this.workspace_.getMetricsManager().getViewMetrics(!0),t)||this.resizeEditor_(),!0):!1}isTabNavigable(){return!0}getText_(){return this.isBeingEdited_&&this.htmlInput_?this.htmlInput_.value:null}getEditorText_(e){return`${e}`}getValueFromEditorText_(e){return e}};Vl.BORDERRADIUS=4;var Kl=class extends Vl{constructor(e,t,o){super(e,t,o)}doClassValidation_(e){return e===void 0?null:`${e}`}static fromJson(e){return new this(bt(e.text),void 0,e)}};Us("field_input",Kl),Kl.prototype.DEFAULT_VALUE="";var Qv=class extends rp{constructor(e){super(e)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(e){return!!e.outputConnection}hasRightSquareCorner(e){return!!e.outputConnection&&!e.statementInputCount&&!e.nextConnection}},Yl=class extends xr{constructor(e,t){if(super(e,t),this.connectedBottomNextConnection=!1,this.connectedBlock){for(e=this.connectedBlock;t=e.getNextBlock();)e=t;e.nextConnection||(this.height=this.connectedBlockHeight,this.connectedBottomNextConnection=!0)}}},ey=class extends Vs{constructor(e){super(e),this.width=this.height=0,this.type|=j.getType("RIGHT_CONNECTION")}},ty=class extends dp{constructor(e){super(e)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(e){const t=(e.hat?e.hat==="cap":this.constants_.ADD_START_HATS)&&!e.outputConnection&&!e.previousConnection;return!!e.outputConnection||t}hasRightSquareCorner(e){return!!e.outputConnection&&!e.statementInputCount&&!e.nextConnection}},sy=class extends Rr{constructor(e,t){super(e,t),this.isInline=!0,this.renderer_=e,this.constants_=this.renderer_.getConstants(),this.topRow=new ty(this.constants_),this.bottomRow=new Qv(this.constants_),this.isMultiRow=!t.getInputsInline()||t.isCollapsed(),this.hasStatementInput=0=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!n.precedesStatement,j.isInputRow(g)&&g.hasStatement){g.measure();let I,L;t=g.width-((L=(I=g.getLastInput())==null?void 0:I.width)!=null?L:0)+e}else if(o&&(u===2||n)&&j.isInputRow(g)&&!g.hasStatement){n=g.xPos,o=null;for(let I=0;Io?o:this.height/2,t-o*(1-Math.sin(Math.acos((o-this.constants_.SMALL_PADDING)/o)))):0;if(j.isInlineInput(e)&&e instanceof zo){const u=e.connectedBlock;return e=u?u.pathObject.outputShapeType:e.shape.type,e==null||u&&u.outputConnection&&(u.statementInputCount||u.nextConnection)||o===n.SHAPES.HEXAGONAL&&o!==e?0:t-this.constants_.SHAPE_IN_SHAPE_PADDING[o][e]}return j.isField(e)&&e instanceof hn?o===n.SHAPES.ROUND&&e.field instanceof Kl?t-2.75*n.GRID_UNIT:t-this.constants_.SHAPE_IN_SHAPE_PADDING[o][0]:j.isIcon(e)?this.constants_.SMALL_PADDING:0}finalizeVerticalAlignment_(){if(!this.outputConnection)for(let n=2;n=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!I.precedesStatement;if(e?this.topRow.hasPreviousConnection:u.followsStatement){var o=g.elements[1];if(o=g.elements.length===3&&o instanceof hn&&(o.field instanceof _i||o.field instanceof Ci),!e&&o)u.height-=this.constants_.SMALL_PADDING,I.height-=this.constants_.SMALL_PADDING,g.height-=this.constants_.MEDIUM_PADDING;else if(!e&&!t)u.height+=this.constants_.SMALL_PADDING;else if(t){for(e=!1,t=0;t{if(!n.isDeadOrDying()){i.disable$$module$build$src$core$events$utils();try{n==null||n.positionNearConnection(u,g,I),n==null||n.getSvgRoot().setAttribute("visibility","visible")}finally{i.enable$$module$build$src$core$events$utils()}}}),u}createInsertionMarker(e){const t=os(e,{addCoordinates:!1,addInputBlocks:!1,addNextBlocks:!1,doFullSerialization:!1});if(!t)throw Error(`Failed to serialize source block. ${e.toDevString()}`);e=lo(t,this.workspace);for(const o of e.getDescendants(!1))o.setInsertionMarker(!0);return e.initSvg(),e.getSvgRoot().setAttribute("visibility","hidden"),e}getMatchingConnection(e,t,o){if(e=e.getConnections_(!0),t=t.getConnections_(!0),e.length!==t.length)return null;for(let n=0;n{this.targetWorkspace.isDragging()||t.addSelect()})),this.listeners.push(ue(e,"pointerleave",t,()=>{this.targetWorkspace.isDragging()||t.removeSelect()})),this.listeners.push(ue(o,"pointerenter",t,()=>{this.targetWorkspace.isDragging()||t.addSelect()})),this.listeners.push(ue(o,"pointerleave",t,()=>{this.targetWorkspace.isDragging()||t.removeSelect()}))}blockMouseDown(e){return t=>{const o=this.targetWorkspace.getGesture(t);o&&(o.setStartBlock(e),o.handleFlyoutStart(t,this))}}onMouseDown(e){const t=this.targetWorkspace.getGesture(e);t&&t.handleFlyoutStart(e,this)}isBlockCreatable(e){return e.isEnabled()}createBlock(e){let t=null;i.disable$$module$build$src$core$events$utils();var o=this.targetWorkspace.getAllVariables();this.targetWorkspace.setResizesEnabled(!1);try{t=this.placeNewBlock(e)}finally{i.enable$$module$build$src$core$events$utils()}if(this.targetWorkspace.hideChaff(),e=qn(this.targetWorkspace,o),C()){for(i.setGroup$$module$build$src$core$events$utils(!0),o=0;o-t||e<-180+t||e>180-t}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const e=this.svgGroup_.getBoundingClientRect(),t=e.left;return this.toolboxPosition_===Ge.LEFT?new rt(-1e9,1e9,-1e9,t+e.width):new rt(-1e9,1e9,t,1e9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let e=0;var t=this.workspace_.getTopBlocks(!1);for(let n=0,u;u=t[n];n++){var o=u.getHeightWidth().width;u.outputConnection&&(o-=this.tabWidth_),e=Math.max(e,o)}for(let n=0,u;u=this.buttons_[n];n++)e=Math.max(e,u.width);if(e+=1.5*this.MARGIN+this.tabWidth_,e*=this.workspace_.scale,e+=yt.scrollbarThickness,this.width_!==e){for(let n=0,u;u=t[n];n++){if(this.RTL){o=u.getRelativeToSurfaceXY().x;let g=e/this.workspace_.scale-this.MARGIN;u.outputConnection||(g-=this.tabWidth_),u.moveBy(g-o,0)}this.rectMap_.has(u)&&this.moveRectToBlock_(this.rectMap_.get(u),u)}if(this.RTL)for(let n=0,u;u=this.buttons_[n];n++)t=u.getPosition().y,u.moveTo(e/this.workspace_.scale-u.width-this.MARGIN-this.tabWidth_,t);this.targetWorkspace.scrollbar||this.autoClose||this.targetWorkspace.getFlyout()!==this||this.toolboxPosition_!==Ge.LEFT||this.targetWorkspace.translate(this.targetWorkspace.scrollX+e,this.targetWorkspace.scrollY),this.width_=e,this.position(),this.targetWorkspace.resizeContents(),this.targetWorkspace.recordDragTargets()}}};Op.registryName="verticalFlyout",r($e.FLYOUTS_VERTICAL_TOOLBOX,Ws,Op);var cy=class extends Jl{constructor(e){super(e),this.horizontalLayout=!0}setMetrics_(e){if(this.isVisible()){var t=this.workspace_.getMetricsManager(),o=t.getScrollMetrics(),n=t.getViewMetrics();t=t.getAbsoluteMetrics(),typeof e.x=="number"&&(this.workspace_.scrollX=-(o.left+(o.width-n.width)*e.x)),this.workspace_.translate(this.workspace_.scrollX+t.left,this.workspace_.scrollY+t.top)}}getX(){return 0}getY(){if(!this.isVisible())return 0;var e=this.targetWorkspace.getMetricsManager();const t=e.getAbsoluteMetrics(),o=e.getViewMetrics();e=e.getToolboxMetrics();const n=this.toolboxPosition_===Ge.TOP;return this.targetWorkspace.toolboxPosition===this.toolboxPosition_?this.targetWorkspace.getToolbox()?n?e.height:o.height-this.height_:n?0:o.height:n?0:o.height+t.top-this.height_}position(){if(this.isVisible()&&this.targetWorkspace.isVisible()){var e=this.targetWorkspace.getMetricsManager().getViewMetrics();this.width_=e.width,this.setBackgroundPath(e.width-2*this.CORNER_RADIUS,this.height_-this.CORNER_RADIUS),e=this.getX();var t=this.getY();this.positionAt_(this.width_,this.height_,e,t)}}setBackgroundPath(e,t){const o=this.toolboxPosition_===Ge.TOP,n=["M 0,"+(o?0:this.CORNER_RADIUS)];o?(n.push("h",e+2*this.CORNER_RADIUS),n.push("v",t),n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,-this.CORNER_RADIUS,this.CORNER_RADIUS),n.push("h",-e),n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,-this.CORNER_RADIUS,-this.CORNER_RADIUS)):(n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,this.CORNER_RADIUS,-this.CORNER_RADIUS),n.push("h",e),n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,this.CORNER_RADIUS,this.CORNER_RADIUS),n.push("v",t),n.push("h",-e-2*this.CORNER_RADIUS)),n.push("z"),this.svgBackground_.setAttribute("d",n.join(" "))}scrollToStart(){let e;(e=this.workspace_.scrollbar)==null||e.setX(this.RTL?1/0:0)}wheel_(e){var t=Le(e);if(t=t.x||t.y){const o=this.workspace_.getMetricsManager(),n=o.getScrollMetrics();t=o.getViewMetrics().left-n.left+t;let u;(u=this.workspace_.scrollbar)==null||u.setX(t),tr(this.workspace_),js()}e.preventDefault(),e.stopPropagation()}layout_(e,t){this.workspace_.scale=this.targetWorkspace.scale;const o=this.MARGIN;let n=o+this.tabWidth_;this.RTL&&(e=e.reverse());for(let L=0,le;le=e[L];L++)if(le.type==="block"){var u=le.block;if(u==null)continue;var g=u.getDescendants(!1);for(let dt=0,ut;ut=g[dt];dt++)ut.isInFlyout=!0;g=u.getSvgRoot();const Ee=u.getHeightWidth();var I=u.outputConnection?this.tabWidth_:0;I=this.RTL?n+Ee.width:n-I,u.moveBy(I,o),I=this.createRect_(u,I,o,Ee,L),n+=Ee.width+t[L],this.addBlockListeners_(g,u,I)}else le.type==="button"&&(u=le.button,this.initFlyoutButton_(u,n,o),n+=u.width+t[L])}isDragTowardWorkspace(e){e=Math.atan2(e.y,e.x)/Math.PI*180;const t=this.dragAngleRange_;return e<90+t&&e>90-t||e>-90-t&&e<-90+t}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const e=this.svgGroup_.getBoundingClientRect(),t=e.top;return this.toolboxPosition_===Ge.TOP?new rt(-1e9,t+e.height,-1e9,1e9):new rt(t,1e9,-1e9,1e9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let e=0;const t=this.workspace_.getTopBlocks(!1);for(let n=0,u;u=t[n];n++)e=Math.max(e,u.getHeightWidth().height);const o=this.buttons_;for(let n=0,u;u=o[n];n++)e=Math.max(e,u.height);if(e+=1.5*this.MARGIN,e*=this.workspace_.scale,e+=yt.scrollbarThickness,this.height_!==e){for(let n=0,u;u=t[n];n++)this.rectMap_.has(u)&&this.moveRectToBlock_(this.rectMap_.get(u),u);this.targetWorkspace.scrollbar||this.autoClose||this.targetWorkspace.getFlyout()!==this||this.toolboxPosition_!==Ge.TOP||this.targetWorkspace.translate(this.targetWorkspace.scrollX,this.targetWorkspace.scrollY+e),this.height_=e,this.position(),this.targetWorkspace.resizeContents(),this.targetWorkspace.recordDragTargets()}}};r($e.FLYOUTS_HORIZONTAL_TOOLBOX,Ws,cy);var Lr=class extends Qt{constructor(e,t,o,n,u){super(lt.SKIP_SETUP),this.defaultType="",this.variableTypes=[],this.variable=null,this.SERIALIZABLE=!0,this.menuGenerator_=Lr.dropdownCreate,this.defaultVariableName=typeof e=="string"?e:"",this.size_=new Xe(0,0),e!==lt.SKIP_SETUP&&(u?this.configure_(u):this.setTypes(o,n),t&&this.setValidator(t))}configure_(e){super.configure_(e),this.setTypes(e.variableTypes,e.defaultType)}initModel(){var e=this.getSourceBlock();if(!e)throw new _t;this.variable||(e=i.getOrCreateVariablePackage$$module$build$src$core$variables(e.workspace,null,this.defaultVariableName,this.defaultType),this.doValueUpdate_(e.getId()))}shouldAddBorderRect_(){const e=this.getSourceBlock();if(!e)throw new _t;return super.shouldAddBorderRect_()&&(!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||e.type!=="variables_get")}fromXml(e){var t=this.getSourceBlock();if(!t)throw new _t;const o=e.getAttribute("id"),n=e.textContent,u=e.getAttribute("variabletype")||e.getAttribute("variableType")||"";if(t=i.getOrCreateVariablePackage$$module$build$src$core$variables(t.workspace,o,n,u),u!==null&&u!==t.type)throw Error("Serialized variable type with id '"+t.getId()+"' had type "+t.type+", and does not match variable field that references it: "+zs(e)+".");this.setValue(t.getId())}toXml(e){return this.initModel(),e.id=this.variable.getId(),e.textContent=this.variable.name,this.variable.type&&e.setAttribute("variabletype",this.variable.type),e}saveState(e){var t=this.saveLegacyState(Lr);return t!==null||(this.initModel(),t={id:this.variable.getId()},e&&(t.name=this.variable.name,t.type=this.variable.type)),t}loadState(e){const t=this.getSourceBlock();if(!t)throw new _t;this.loadLegacyState(Lr,e)||(e=i.getOrCreateVariablePackage$$module$build$src$core$variables(t.workspace,e.id||null,e.name,e.type||""),this.setValue(e.getId()))}setSourceBlock(e){if(e.isShadow())throw Error("Variable fields are not allowed to exist on shadow blocks.");super.setSourceBlock(e)}getValue(){return this.variable?this.variable.getId():null}getText(){return this.variable?this.variable.name:""}getVariable(){return this.variable}getValidator(){return this.variable?this.validator_:null}doClassValidation_(e){if(e===null)return null;var t=this.getSourceBlock();if(!t)throw new _t;return t=i.getVariable$$module$build$src$core$variables(t.workspace,e),t?(t=t.type,this.typeIsAllowed(t)?e:(console.warn("Variable type doesn't match this field! Type was "+t),null)):(console.warn("Variable id doesn't point to a real variable! ID was "+e),null)}doValueUpdate_(e){const t=this.getSourceBlock();if(!t)throw new _t;this.variable=i.getVariable$$module$build$src$core$variables(t.workspace,e),super.doValueUpdate_(e)}typeIsAllowed(e){const t=this.getVariableTypes();if(!t)return!0;for(let o=0;othis.max_&&(e.max=`${this.max_}`,xt(e,Et.VALUEMAX,this.max_)),e}static fromJson(e){return new this(e.value,void 0,void 0,void 0,void 0,e)}};Us("field_number",Rp),Rp.prototype.DEFAULT_VALUE=0;var uy=class extends _i{constructor(e,t,o){super(String(e??""),t,o),this.EDITABLE=!1,this.SERIALIZABLE=!0}static fromJson(e){return new this(bt(e.text),void 0,e)}};Us("field_label_serializable",uy);var Ti=class extends lt{constructor(e,t,o){super(lt.SKIP_SETUP),this.SERIALIZABLE=!0,this.CURSOR="default",this.value_=this.value_,this.checkChar=Ti.CHECK_CHAR,e!==lt.SKIP_SETUP&&(o&&this.configure_(o),this.setValue(e),t&&this.setValidator(t))}configure_(e){super.configure_(e),e.checkCharacter&&(this.checkChar=e.checkCharacter)}saveState(){const e=this.saveLegacyState(Ti);return e!==null?e:this.getValueBoolean()}initView(){super.initView();const e=this.getTextElement();Oe(e,"blocklyCheckbox"),e.style.display=this.value_?"block":"none"}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_(this.getConstants().FIELD_CHECKBOX_X_OFFSET)}getDisplayText_(){return this.checkChar}setCheckCharacter(e){this.checkChar=e||Ti.CHECK_CHAR,this.forceRerender()}showEditor_(){this.setValue(!this.value_)}doClassValidation_(e){return e===!0||e==="TRUE"?"TRUE":e===!1||e==="FALSE"?"FALSE":null}doValueUpdate_(e){this.value_=this.convertValueToBool(e),this.textElement_&&(this.textElement_.style.display=this.value_?"block":"none")}getValue(){return this.value_?"TRUE":"FALSE"}getValueBoolean(){return this.value_}getText(){return String(this.convertValueToBool(this.value_))}convertValueToBool(e){return typeof e=="string"?e==="TRUE":!!e}static fromJson(e){return new this(e.checked,void 0,e)}};Ti.CHECK_CHAR="✓",Us("field_checkbox",Ti),Ti.prototype.DEFAULT_VALUE=!1;var dy=class{constructor(e,t){this.draggable=e,this.workspace=t,this.dragTarget=null,this.startLoc=e.getRelativeToSurfaceXY()}onDragStart(e){this.draggable.startDrag(e)}onDrag(e,t){this.moveDraggable(e,t),t=this.getRoot(this.draggable),ds(t)&&t.setDeleteStyle(this.wouldDeleteDraggable(e,t)),this.updateDragTarget(e)}updateDragTarget(e){e=this.workspace.getDragTarget(e);const t=this.getRoot(this.draggable);if(this.dragTarget!==e){let o;(o=this.dragTarget)==null||o.onDragExit(t),e==null||e.onDragEnter(t)}e==null||e.onDragOver(t),this.dragTarget=e}moveDraggable(e,t){t=this.pixelsToWorkspaceUnits(t),t=ye.sum(this.startLoc,t),this.draggable.drag(t,e)}wouldDeleteDraggable(e,t){return(e=this.workspace.getDragTarget(e))&&this.workspace.getComponentManager().hasCapability(e.id,gt.Capability.DELETE_AREA)?e.wouldDelete(t):!1}onDragEnd(e){const t=i.getGroup$$module$build$src$core$events$utils();var o=this.workspace.getDragTarget(e);const n=this.getRoot(this.draggable);if(o){let u;(u=this.dragTarget)==null||u.onDrop(n)}this.shouldReturnToStart(e,n)&&this.draggable.revertDrag(),(o=ds(n)&&this.wouldDeleteDraggable(e,n))&&this.draggable instanceof $s&&Wa(this.draggable.getRootBlock()),this.draggable.endDrag(e),o&&ds(n)&&(e=i.getGroup$$module$build$src$core$events$utils(),i.setGroup$$module$build$src$core$events$utils(t),n.dispose(),i.setGroup$$module$build$src$core$events$utils(e))}getRoot(e){return e instanceof $s?e.getRootBlock():e}shouldReturnToStart(e,t){return(e=this.workspace.getDragTarget(e))?e.shouldPreventMove(t):!1}pixelsToWorkspaceUnits(e){return e=new ye(e.x/this.workspace.scale,e.y/this.workspace.scale),this.workspace.isMutator&&e.scale(1/this.workspace.options.parentWorkspace.scale),e}};r($e.BLOCK_DRAGGER,Ws,dy);var Pr={};Pr.BlockDragStrategy=jv,Pr.BubbleDragStrategy=wv,Pr.CommentDragStrategy=fv,Pr.Dragger=dy;var Np=class extends Ss{constructor(e,t,o){super(e?e.workspace.id:void 0),this.type=ee.BLOCK_DRAG,e&&(this.blockId=e.id,this.isStart=t,this.blocks=o)}toJson(){const e=super.toJson();if(this.isStart===void 0)throw Error("Whether this event is the start of a drag is undefined. Either pass the value to the constructor, or call fromJson");if(this.blockId===void 0)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");return e.isStart=this.isStart,e.blockId=this.blockId,e.blocks=this.blocks,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Np),t.isStart=e.isStart,t.blockId=e.blockId,t.blocks=e.blocks,t}};r($e.EVENT,ee.BLOCK_DRAG,Np);var Mp=class extends gi{constructor(e,t,o,n){super(e),this.type=ee.BLOCK_FIELD_INTERMEDIATE_CHANGE,this.recordUndo=!1,e&&(this.name=t,this.oldValue=o,this.newValue=n)}toJson(){const e=super.toJson();if(!this.name)throw Error("The changed field name is undefined. Either pass a name to the constructor, or call fromJson.");return e.name=this.name,e.oldValue=this.oldValue,e.newValue=this.newValue,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Mp),t.name=e.name,t.oldValue=e.oldValue,t.newValue=e.newValue,t}isNull(){return this.oldValue===this.newValue}run(e){var t=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");if(t=t.getBlockById(this.blockId),!t)throw Error("The associated block is undefined. Either pass a block to the constructor, or call fromJson");e=e?this.newValue:this.oldValue,(t=t.getField(this.name))?t.setValue(e):console.warn("Can't set non-existent field: "+this.name)}};r($e.EVENT,ee.BLOCK_FIELD_INTERMEDIATE_CHANGE,Mp);var Lp=class extends gi{constructor(e){super(e),this.type=ee.BLOCK_MOVE,e&&(e.isShadow()&&(this.recordUndo=!1),e=this.currentLocation(),this.oldParentId=e.parentId,this.oldInputName=e.inputName,this.oldCoordinate=e.coordinate)}toJson(){const e=super.toJson();return e.oldParentId=this.oldParentId,e.oldInputName=this.oldInputName,this.oldCoordinate&&(e.oldCoordinate=`${Math.round(this.oldCoordinate.x)}, ${Math.round(this.oldCoordinate.y)}`),e.newParentId=this.newParentId,e.newInputName=this.newInputName,this.newCoordinate&&(e.newCoordinate=`${Math.round(this.newCoordinate.x)}, ${Math.round(this.newCoordinate.y)}`),this.reason&&(e.reason=this.reason),this.recordUndo||(e.recordUndo=this.recordUndo),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Lp),t.oldParentId=e.oldParentId,t.oldInputName=e.oldInputName,e.oldCoordinate&&(o=e.oldCoordinate.split(","),t.oldCoordinate=new ye(Number(o[0]),Number(o[1]))),t.newParentId=e.newParentId,t.newInputName=e.newInputName,e.newCoordinate&&(o=e.newCoordinate.split(","),t.newCoordinate=new ye(Number(o[0]),Number(o[1]))),e.reason!==void 0&&(t.reason=e.reason),e.recordUndo!==void 0&&(t.recordUndo=e.recordUndo),t}recordNew(){const e=this.currentLocation();this.newParentId=e.parentId,this.newInputName=e.inputName,this.newCoordinate=e.coordinate}setReason(e){this.reason=e}currentLocation(){var e=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");var t=e.getBlockById(this.blockId);if(!t)throw Error("The block associated with the block move event could not be found");e={};const o=t.getParent();return o?(e.parentId=o.id,(t=o.getInputWithBlock(t))&&(e.inputName=t.name)):e.coordinate=t.getRelativeToSurfaceXY(),e}isNull(){return this.oldParentId===this.newParentId&&this.oldInputName===this.newInputName&&ye.equals(this.oldCoordinate,this.newCoordinate)}run(e){var t=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");var o=t.getBlockById(this.blockId);if(o){var n=e?this.newParentId:this.oldParentId,u=e?this.newInputName:this.oldInputName;if(e=e?this.newCoordinate:this.oldCoordinate,n){var g=t.getBlockById(n);if(!g){console.warn("Can't connect to non-existent block: "+n);return}}if(o.getParent()&&o.unplug(),e)u=o.getRelativeToSurfaceXY(),o.moveBy(e.x-u.x,e.y-u.y,this.reason);else{t=o.outputConnection,(!t||o.previousConnection&&o.previousConnection.isConnected())&&(t=o.previousConnection);let I,L;o=(L=t)==null?void 0:L.type,u?(o=g.getInput(u))&&(I=o.connection):o===xe.PREVIOUS_STATEMENT&&(I=g.nextConnection),I&&t?t.connect(I):console.warn("Can't connect to non-existent input: "+u)}}else console.warn("Can't move non-existent block: "+this.blockId)}};r($e.EVENT,ee.BLOCK_MOVE,Lp);var Pp=class extends Ss{constructor(e,t,o){super(e?e.workspace.id:void 0),this.type=ee.BUBBLE_OPEN,e&&(this.blockId=e.id,this.isOpen=t,this.bubbleType=o)}toJson(){const e=super.toJson();if(this.isOpen===void 0)throw Error("Whether this event is for opening the bubble is undefined. Either pass the value to the constructor, or call fromJson");if(!this.bubbleType)throw Error("The type of bubble is undefined. Either pass the value to the constructor, or call fromJson");return e.isOpen=this.isOpen,e.bubbleType=this.bubbleType,e.blockId=this.blockId||"",e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Pp),t.isOpen=e.isOpen,t.bubbleType=e.bubbleType,t.blockId=e.blockId,t}},Bp;(function(e){e.MUTATOR="mutator",e.COMMENT="comment",e.WARNING="warning"})(Bp||(Bp={})),r($e.EVENT,ee.BUBBLE_OPEN,Pp);var qs=class extends qi{constructor(e){super(),this.isBlank=!e,e&&(this.commentId=e.id,this.workspaceId=e.workspace.id,this.group=i.getGroup$$module$build$src$core$events$utils(),this.recordUndo=G())}toJson(){const e=super.toJson();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");return e.commentId=this.commentId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new qs),t.commentId=e.commentId,t}static CommentCreateDeleteHelper(e,t){const o=e.getEventWorkspace_();if(t){if(!e.json)throw Error("Encountered a comment event without proper json");Kn(e.json,o)}else{if(!e.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");(t=o.getCommentById(e.commentId))?t.dispose():console.warn("Can't delete non-existent comment: "+e.commentId)}}},Fp=class extends qs{constructor(e,t,o){super(e),this.type=ee.COMMENT_CHANGE,e&&(this.oldContents_=typeof t>"u"?"":t,this.newContents_=typeof o>"u"?"":o)}toJson(){const e=super.toJson();if(!this.oldContents_)throw Error("The old contents is undefined. Either pass a value to the constructor, or call fromJson");if(!this.newContents_)throw Error("The new contents is undefined. Either pass a value to the constructor, or call fromJson");return e.oldContents=this.oldContents_,e.newContents=this.newContents_,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Fp),t.oldContents_=e.oldContents,t.newContents_=e.newContents,t}isNull(){return this.oldContents_===this.newContents_}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(t=t.getCommentById(this.commentId)){var o=e?this.newContents_:this.oldContents_;if(o===void 0)throw Error(e?"The new contents is undefined. Either pass a value to the constructor, or call fromJson":"The old contents is undefined. Either pass a value to the constructor, or call fromJson");t.setText(o)}else console.warn("Can't change non-existent comment: "+this.commentId)}};r($e.EVENT,ee.COMMENT_CHANGE,Fp);var jp=class extends qs{constructor(e,t){super(e),this.newCollapsed=t,this.type=ee.COMMENT_COLLAPSE}toJson(){const e=super.toJson();if(this.newCollapsed===void 0)throw Error("The new collapse value undefined. Either call recordNew, or call fromJson");return e.newCollapsed=this.newCollapsed,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new jp),t.newCollapsed=e.newCollapsed,t}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");(t=t.getCommentById(this.commentId))?t.setCollapsed(e?!!this.newCollapsed:!this.newCollapsed):console.warn("Can't collapse or uncollapse non-existent comment: "+this.commentId)}};r($e.EVENT,ee.COMMENT_COLLAPSE,jp);var zp=class extends qs{constructor(e){super(e),this.type=ee.COMMENT_CREATE,e&&(this.xml=ir(e),this.json=Pi(e,{addCoordinates:!0}))}toJson(){const e=super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.json)throw Error("The comment JSON is undefined. Either pass a block to the constructor, or call fromJson");return e.xml=zs(this.xml),e.json=this.json,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new zp),t.xml=i.textToDom$$module$build$src$core$utils$xml(e.xml),t.json=e.json,t}run(e){qs.CommentCreateDeleteHelper(this,e)}};r($e.EVENT,ee.COMMENT_CREATE,zp);var Up=class extends qs{constructor(e){super(e),this.type=ee.COMMENT_DELETE,e&&(this.xml=ir(e),this.json=Pi(e,{addCoordinates:!0}))}run(e){qs.CommentCreateDeleteHelper(this,!e)}toJson(){const e=super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.json)throw Error("The comment JSON is undefined. Either pass a block to the constructor, or call fromJson");return e.xml=zs(this.xml),e.json=this.json,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Up),t.xml=i.textToDom$$module$build$src$core$utils$xml(e.xml),t.json=e.json,t}};r($e.EVENT,ee.COMMENT_DELETE,Up);var Hp=class extends Ss{constructor(e,t){super(e?e.workspace.id:void 0),this.type=ee.COMMENT_DRAG,e&&(this.commentId=e.id,this.isStart=t)}toJson(){const e=super.toJson();if(this.isStart===void 0)throw Error("Whether this event is the start of a drag is undefined. Either pass the value to the constructor, or call fromJson");if(this.commentId===void 0)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");return e.isStart=this.isStart,e.commentId=this.commentId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Hp),t.isStart=e.isStart,t.commentId=e.commentId,t}};r($e.EVENT,ee.COMMENT_DRAG,Hp);var Wp=class extends qs{constructor(e){super(e),this.type=ee.COMMENT_MOVE,e&&(this.comment_=e,this.oldCoordinate_=e.getRelativeToSurfaceXY())}recordNew(){if(this.newCoordinate_)throw Error("Tried to record the new position of a comment on the same event twice.");if(!this.comment_)throw Error("The comment is undefined. Pass a comment to the constructor if you want to use the record functionality");this.newCoordinate_=this.comment_.getRelativeToSurfaceXY()}setReason(e){this.reason=e}setOldCoordinate(e){this.oldCoordinate_=e}toJson(){const e=super.toJson();if(!this.oldCoordinate_)throw Error("The old comment position is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.newCoordinate_)throw Error("The new comment position is undefined. Either call recordNew, or call fromJson");return e.oldCoordinate=`${Math.round(this.oldCoordinate_.x)}, ${Math.round(this.oldCoordinate_.y)}`,e.newCoordinate=Math.round(this.newCoordinate_.x)+","+Math.round(this.newCoordinate_.y),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Wp),o=e.oldCoordinate.split(","),t.oldCoordinate_=new ye(Number(o[0]),Number(o[1])),o=e.newCoordinate.split(","),t.newCoordinate_=new ye(Number(o[0]),Number(o[1])),t}isNull(){return ye.equals(this.oldCoordinate_,this.newCoordinate_)}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(t=t.getCommentById(this.commentId)){if(e=e?this.newCoordinate_:this.oldCoordinate_,!e)throw Error("Either oldCoordinate_ or newCoordinate_ is undefined. Either pass a comment to the constructor and call recordNew, or call fromJson");t.moveTo(e)}else console.warn("Can't move non-existent comment: "+this.commentId)}};r($e.EVENT,ee.COMMENT_MOVE,Wp);var Gp=class extends qs{constructor(e){super(e),this.type=ee.COMMENT_RESIZE,e&&(this.oldSize=e.getSize())}recordCurrentSizeAsNewSize(){if(this.newSize)throw Error("Tried to record the new size of a comment on the same event twice.");var e=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(e=e.getCommentById(this.commentId),!e)throw Error("The comment associated with the comment resize event could not be found");this.newSize=e.getSize()}toJson(){const e=super.toJson();if(!this.oldSize)throw Error("The old comment size is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.newSize)throw Error("The new comment size is undefined. Either call recordCurrentSizeAsNewSize, or call fromJson");return e.oldWidth=Math.round(this.oldSize.width),e.oldHeight=Math.round(this.oldSize.height),e.newWidth=Math.round(this.newSize.width),e.newHeight=Math.round(this.newSize.height),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Gp),t.oldSize=new Xe(e.oldWidth,e.oldHeight),t.newSize=new Xe(e.newWidth,e.newHeight),t}isNull(){return Xe.equals(this.oldSize,this.newSize)}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(t=t.getCommentById(this.commentId)){if(e=e?this.newSize:this.oldSize,!e)throw Error("Either oldSize or newSize is undefined. Either pass a comment to the constructor and call recordCurrentSizeAsNewSize, or call fromJson");t.setSize(e)}else console.warn("Can't resize non-existent comment: "+this.commentId)}};r($e.EVENT,ee.COMMENT_RESIZE,Gp);var Vp=class extends Ss{constructor(e,t,o){super(o),this.type=ee.TOOLBOX_ITEM_SELECT,this.oldItem=e??void 0,this.newItem=t??void 0}toJson(){const e=super.toJson();return e.oldItem=this.oldItem,e.newItem=this.newItem,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Vp),t.oldItem=e.oldItem,t.newItem=e.newItem,t}};r($e.EVENT,ee.TOOLBOX_ITEM_SELECT,Vp);var hy=class extends qi{constructor(e){super(),this.isBlank=!0,this.recordUndo=!1,this.type=ee.FINISHED_LOADING,this.isBlank=!!e,e&&(this.workspaceId=e.id)}};r($e.EVENT,ee.FINISHED_LOADING,hy);var py,gy,my,fy,$y,by,vy,yy,_y,wy,ky,Cy,Ty,Sy,Ey,Iy,xy,Dy,Ay,Oy,Ry,Ny,My,Ly,Py,Se;i.BLOCK_CHANGE$$module$build$src$core$events$events=ee.BLOCK_CHANGE,i.BLOCK_CREATE$$module$build$src$core$events$events=ee.BLOCK_CREATE,i.BLOCK_DELETE$$module$build$src$core$events$events=ee.BLOCK_DELETE,py=ee.BLOCK_DRAG,i.BLOCK_MOVE$$module$build$src$core$events$events=ee.BLOCK_MOVE,gy=ee.BLOCK_FIELD_INTERMEDIATE_CHANGE,my=ee.BUBBLE_OPEN,fy=ee.BLOCK_CHANGE,$y=ee.CLICK,by=ee.COMMENT_CHANGE,vy=ee.COMMENT_CREATE,yy=ee.COMMENT_DELETE,_y=ee.COMMENT_MOVE,wy=ee.COMMENT_RESIZE,ky=ee.COMMENT_DRAG,Cy=ee.BLOCK_CREATE,Ty=ee.BLOCK_DELETE,Sy=ee.FINISHED_LOADING,Ey=ee.MARKER_MOVE,Iy=ee.BLOCK_MOVE,xy=ee.SELECTED,Dy=ee.THEME_CHANGE,Ay=ee.TOOLBOX_ITEM_SELECT,Oy=ee.TRASHCAN_OPEN,Ry=ee.UI,Ny=ee.VAR_CREATE,My=ee.VAR_DELETE,Ly=ee.VAR_RENAME,Py=ee.VIEWPORT_CHANGE,Se={},Se.Abstract=qi,Se.BLOCK_CHANGE=i.BLOCK_CHANGE$$module$build$src$core$events$events,Se.BLOCK_CREATE=i.BLOCK_CREATE$$module$build$src$core$events$events,Se.BLOCK_DELETE=i.BLOCK_DELETE$$module$build$src$core$events$events,Se.BLOCK_DRAG=py,Se.BLOCK_FIELD_INTERMEDIATE_CHANGE=gy,Se.BLOCK_MOVE=i.BLOCK_MOVE$$module$build$src$core$events$events,Se.BUBBLE_OPEN=my,Se.BUMP_EVENTS=pb,Se.BlockBase=gi,Se.BlockChange=mi,Se.BlockCreate=Qh,Se.BlockDelete=hp,Se.BlockDrag=Np,Se.BlockFieldIntermediateChange=Mp,Se.BlockMove=Lp,Se.BubbleOpen=Pp,Se.BubbleType=Bp,Se.CHANGE=fy,Se.CLICK=$y,Se.COMMENT_CHANGE=by,Se.COMMENT_CREATE=vy,Se.COMMENT_DELETE=yy,Se.COMMENT_DRAG=ky,Se.COMMENT_MOVE=_y,Se.COMMENT_RESIZE=wy,Se.CREATE=Cy,Se.Click=bh,Se.ClickTarget=vh,Se.CommentBase=qs,Se.CommentChange=Fp,Se.CommentCollapse=jp,Se.CommentCreate=zp,Se.CommentDelete=Up,Se.CommentDrag=Hp,Se.CommentMove=Wp,Se.CommentResize=Gp,Se.DELETE=Ty,Se.FINISHED_LOADING=Sy,Se.FinishedLoading=hy,Se.MARKER_MOVE=Ey,Se.MOVE=Iy,Se.MarkerMove=pp,Se.SELECTED=xy,Se.Selected=_p,Se.THEME_CHANGE=Dy,Se.TOOLBOX_ITEM_SELECT=Ay,Se.TRASHCAN_OPEN=Oy,Se.ThemeChange=ep,Se.ToolboxItemSelect=Vp,Se.TrashcanOpen=kp,Se.UI=Ry,Se.UiBase=Ss,Se.VAR_CREATE=Ny,Se.VAR_DELETE=My,Se.VAR_RENAME=Ly,Se.VIEWPORT_CHANGE=Py,Se.VarBase=br,Se.VarCreate=Fh,Se.VarDelete=bp,Se.VarRename=vp,Se.ViewportChange=tp,Se.clearPendingUndo=K,Se.disable=i.disable$$module$build$src$core$events$utils,Se.disableOrphans=me,Se.enable=i.enable$$module$build$src$core$events$utils,Se.filter=R,Se.fire=z,Se.fromJson=ce,Se.get=ne,Se.getDescendantIds=ve,Se.getGroup=i.getGroup$$module$build$src$core$events$utils,Se.getRecordUndo=G,Se.isEnabled=C,Se.setGroup=i.setGroup$$module$build$src$core$events$utils,Se.setRecordUndo=i.setRecordUndo$$module$build$src$core$events$utils;var Os={};Os.BottomRow=Qv,Os.ConstantProvider=Xv,Os.Drawer=Zv,Os.MarkerSvg=oy,Os.PathObject=iy,Os.RenderInfo=sy,Os.Renderer=Ap,Os.RightConnectionShape=ey,Os.StatementInput=Yl,Os.TopRow=ty,gh();var It={};It.registerCleanup=Zd,It.registerCollapse=eh,It.registerCollapseExpandBlock=ah,It.registerComment=nh,It.registerCommentCreate=ph,It.registerCommentDelete=dh,It.registerCommentDuplicate=hh,It.registerCommentOptions=ab,It.registerDefaultOptions=gh,It.registerDelete=ch,It.registerDeleteAll=oh,It.registerDisable=lh,It.registerDuplicate=ih,It.registerExpand=th,It.registerHelp=uh,It.registerInline=rh,It.registerRedo=Xd,It.registerUndo=qd;var ql={};ql.CommentView=bv,ql.RenderedWorkspaceComment=Il,ql.WorkspaceComment=El;var Br={};Br.Bubble=nt,Br.MiniWorkspaceBubble=vo,Br.TextBubble=Iv,Br.TextInputBubble=kv;var By=class extends Pl{constructor(){super(),this.FIELD_TEXT_BASELINE_CENTER=!1,this.DARK_PATH_OFFSET=1,this.MAX_BOTTOM_WIDTH=30,this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT/2}getCSS_(e){return super.getCSS_(e).concat([`${e} .blocklyInsertionMarker>.blocklyPathLight,`,`${e} .blocklyInsertionMarker>.blocklyPathDark {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"])}},Fy=class{constructor(e){this.inlineSteps_=this.steps_="",this.info_=e,this.RTL_=this.info_.RTL,e=e.getRenderer(),this.constants_=e.getConstants(),this.highlightConstants_=e.getHighlightConstants(),this.highlightOffset=this.highlightConstants_.OFFSET,this.outsideCornerPaths_=this.highlightConstants_.OUTSIDE_CORNER,this.insideCornerPaths_=this.highlightConstants_.INSIDE_CORNER,this.puzzleTabPaths_=this.highlightConstants_.PUZZLE_TAB,this.notchPaths_=this.highlightConstants_.NOTCH,this.startPaths_=this.highlightConstants_.START_HAT,this.jaggedTeethPaths_=this.highlightConstants_.JAGGED_TEETH}getPath(){return this.steps_+` -`+this.inlineSteps_}drawTopCorner(e){this.steps_+=pt(e.xPos,this.info_.startY);for(let t=0,o;o=e.elements[t];t++)F.isLeftSquareCorner(o)?this.steps_+=this.highlightConstants_.START_POINT:F.isLeftRoundedCorner(o)?this.steps_+=this.outsideCornerPaths_.topLeft(this.RTL_):F.isPreviousConnection(o)?this.steps_+=this.notchPaths_.pathLeft:F.isHat(o)?this.steps_+=this.startPaths_.path(this.RTL_):F.isSpacer(o)&&o.width!==0&&(this.steps_+=De("H",o.xPos+o.width-this.highlightOffset));this.steps_+=De("H",e.xPos+e.width-this.highlightOffset)}drawJaggedEdge_(e){this.info_.RTL&&(this.steps_+=this.jaggedTeethPaths_.pathLeft+De("v",e.height-this.jaggedTeethPaths_.height-this.highlightOffset))}drawValueInput(e){const t=e.getLastInput();if(this.RTL_){const o=e.height-t.connectionHeight;this.steps_+=St(t.xPos+t.width-this.highlightOffset,e.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)+De("v",o)}else this.steps_+=St(t.xPos+t.width,e.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)}drawStatementInput(e){const t=e.getLastInput();if(t)if(this.RTL_){const o=e.height-2*this.insideCornerPaths_.height;this.steps_+=St(t.xPos,e.yPos)+this.insideCornerPaths_.pathTop(this.RTL_)+De("v",o)+this.insideCornerPaths_.pathBottom(this.RTL_)+Hs(e.width-t.xPos-this.insideCornerPaths_.width,0)}else this.steps_+=St(t.xPos,e.yPos+e.height)+this.insideCornerPaths_.pathBottom(this.RTL_)+Hs(e.width-t.xPos-this.insideCornerPaths_.width,0)}drawRightSideRow(e){const t=e.xPos+e.width-this.highlightOffset;e instanceof up&&e.followsStatement&&(this.steps_+=De("H",t)),this.RTL_&&(this.steps_+=De("H",t),e.height>this.highlightOffset&&(this.steps_+=De("V",e.yPos+e.height-this.highlightOffset)))}drawBottomRow(e){if(this.RTL_)this.steps_+=De("V",e.baseline-this.highlightOffset);else{const t=this.info_.bottomRow.elements[0];F.isLeftSquareCorner(t)?this.steps_+=St(e.xPos+this.highlightOffset,e.baseline-this.highlightOffset):F.isLeftRoundedCorner(t)&&(this.steps_+=St(e.xPos,e.baseline),this.steps_+=this.outsideCornerPaths_.bottomLeft())}}drawLeft(){var e=this.info_.outputConnection;e&&(e=e.connectionOffsetY+e.height,this.RTL_?this.steps_+=St(this.info_.startX,e):(this.steps_+=St(this.info_.startX+this.highlightOffset,this.info_.bottomRow.baseline-this.highlightOffset),this.steps_+=De("V",e)),this.steps_+=this.puzzleTabPaths_.pathUp(this.RTL_)),this.RTL_||(e=this.info_.topRow,F.isLeftRoundedCorner(e.elements[0])?this.steps_+=De("V",this.outsideCornerPaths_.height):this.steps_+=De("V",e.capline+this.highlightOffset))}drawInlineInput(e){const t=this.highlightOffset,o=e.xPos+e.connectionWidth;var n=e.centerline-e.height/2;const u=e.width-e.connectionWidth,g=n+t;this.RTL_?(n=e.connectionOffsetY-t,e=e.height-(e.connectionOffsetY+e.connectionHeight)+t,this.inlineSteps_+=St(o-t,g)+De("v",n)+this.puzzleTabPaths_.pathDown(this.RTL_)+De("v",e)+De("h",u)):this.inlineSteps_+=St(e.xPos+e.width+t,g)+De("v",e.height)+De("h",-u)+St(o,n+e.connectionOffsetY)+this.puzzleTabPaths_.pathDown(this.RTL_)}},jy=class extends Bl{constructor(e,t){super(e,t),this.highlighter_=new Fy(t)}draw(){this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights();const e=this.block_.pathObject;e.setPath(this.outlinePath_+` -`+this.inlinePath_),e.setHighlightPath(this.highlighter_.getPath()),this.info_.RTL&&e.flipRTL(),this.recordSizeOnBlock_()}drawTop_(){this.highlighter_.drawTopCorner(this.info_.topRow),this.highlighter_.drawRightSideRow(this.info_.topRow),super.drawTop_()}drawJaggedEdge_(e){this.highlighter_.drawJaggedEdge_(e),super.drawJaggedEdge_(e)}drawValueInput_(e){this.highlighter_.drawValueInput(e),super.drawValueInput_(e)}drawStatementInput_(e){this.highlighter_.drawStatementInput(e),super.drawStatementInput_(e)}drawRightSideRow_(e){this.highlighter_.drawRightSideRow(e),this.outlinePath_+=De("H",e.xPos+e.width)+De("V",e.yPos+e.height)}drawBottom_(){this.highlighter_.drawBottomRow(this.info_.bottomRow),super.drawBottom_()}drawLeft_(){this.highlighter_.drawLeft(),super.drawLeft_()}drawInlineInput_(e){this.highlighter_.drawInlineInput(e),super.drawInlineInput_(e)}positionInlineInputConnection_(e){const t=e.centerline-e.height/2;if(e.connectionModel){let o=e.xPos+e.connectionWidth+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(o*=-1),e.connectionModel.setOffsetInBlock(o,t+e.connectionOffsetY+this.constants_.DARK_PATH_OFFSET)}}positionStatementInputConnection_(e){const t=e.getLastInput();if(t!=null&&t.connectionModel){let o=e.xPos+e.statementEdge+t.notchOffset;o=this.info_.RTL?-1*o:o+this.constants_.DARK_PATH_OFFSET,t.connectionModel.setOffsetInBlock(o,e.yPos+this.constants_.DARK_PATH_OFFSET)}}positionExternalValueConnection_(e){const t=e.getLastInput();if(t&&t.connectionModel){let o=e.xPos+e.width+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(o*=-1),t.connectionModel.setOffsetInBlock(o,e.yPos)}}positionNextConnection_(){const e=this.info_.bottomRow;if(e.connection){const t=e.connection,o=t.xPos;t.connectionModel.setOffsetInBlock((this.info_.RTL?-o:o)+this.constants_.DARK_PATH_OFFSET/2,e.baseline+this.constants_.DARK_PATH_OFFSET)}}},zy=class{constructor(e){this.OFFSET=.5,this.constantProvider=e,this.START_POINT=pt(this.OFFSET,this.OFFSET)}init(){this.INSIDE_CORNER=this.makeInsideCorner(),this.OUTSIDE_CORNER=this.makeOutsideCorner(),this.PUZZLE_TAB=this.makePuzzleTab(),this.NOTCH=this.makeNotch(),this.JAGGED_TEETH=this.makeJaggedTeeth(),this.START_HAT=this.makeStartHat()}makeInsideCorner(){const e=this.constantProvider.CORNER_RADIUS,t=this.OFFSET,o=(1-Math.SQRT1_2)*(e+t)-t,n=pt(o,o)+vt("a","0 0,0",e,Me(-o-t,e-o)),u=vt("a","0 0,0",e+t,Me(e+t,e+t)),g=pt(o,-o)+vt("a","0 0,0",e+t,Me(e-o,o+t));return{width:e+t,height:e,pathTop(I){return I?n:""},pathBottom(I){return I?u:g}}}makeOutsideCorner(){const e=this.constantProvider.CORNER_RADIUS,t=this.OFFSET,o=(1-Math.SQRT1_2)*(e-t)+t,n=pt(o,o)+vt("a","0 0,1",e-t,Me(e-o,-o+t)),u=pt(t,e)+vt("a","0 0,1",e-t,Me(e,-e+t)),g=-o,I=pt(o,g)+vt("a","0 0,1",e-t,Me(-o+t,-g-e));return{height:e,topLeft(L){return L?n:u},bottomLeft(){return I}}}makePuzzleTab(){const e=this.constantProvider.TAB_WIDTH,t=this.constantProvider.TAB_HEIGHT,o=pt(-2,-t+3.4)+Hs(-.45*e,-2.1),n=De("v",2.5)+pt(.97*-e,2.5)+Xt("q",[Me(.05*-e,10),Me(.3*e,9.5)])+pt(.67*e,-1.9)+De("v",2.5),u=De("v",-1.5)+pt(-.92*e,-.5)+Xt("q",[Me(-.19*e,-5.5),Me(0,-11)])+pt(.92*e,1),g=pt(-5,t-.7)+Hs(.46*e,-2.1);return{width:e,height:t,pathUp(I){return I?o:u},pathDown(I){return I?n:g}}}makeNotch(){return{pathLeft:De("h",this.OFFSET)+this.constantProvider.NOTCH.pathLeft}}makeJaggedTeeth(){return{pathLeft:Hs(5.1,2.6)+pt(-10.2,6.8)+Hs(5.1,2.6),height:12,width:10.2}}makeStartHat(){const e=this.constantProvider.START_HAT.height,t=pt(25,-8.7)+Xt("c",[Me(29.7,-6.2),Me(57.2,-.5),Me(75,8.7)]),o=Xt("c",[Me(17.8,-9.2),Me(45.3,-14.9),Me(75,-8.7)])+St(100.5,e+.5);return{path(n){return n?t:o}}}},Uy=class extends lp{constructor(e,t){super(e,t),this.constants_=e,this.connectedBlock&&(this.width+=this.constants_.DARK_PATH_OFFSET,this.height+=this.constants_.DARK_PATH_OFFSET)}},Hy=class extends xr{constructor(e,t){super(e,t),this.constants_=e,this.connectedBlock&&(this.height+=this.constants_.DARK_PATH_OFFSET)}},Wy=class extends Or{constructor(e,t){super(e,t),this.renderer_=e}getRenderer(){return this.renderer_}populateBottomRow_(){super.populateBottomRow_(),this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1]instanceof ls||(this.bottomRow.minHeight=this.constants_.MEDIUM_PADDING-this.constants_.DARK_PATH_OFFSET)}addInput_(e,t){this.isInline&&e instanceof i.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new Uy(this.constants_,e)),t.hasInlineInput=!0):e instanceof ls?(t.elements.push(new Hy(this.constants_,e)),t.hasStatement=!0):e instanceof i.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new Ll(this.constants_,e)),t.hasExternalInput=!0):(e instanceof Ks||e instanceof Co)&&(t.minHeight=Math.max(t.minHeight,this.constants_.DUMMY_INPUT_MIN_HEIGHT),t.hasDummyInput=!0),this.isInline||t.align!==null||(t.align=e.align)}addElemSpacing_(){let e=!1;for(let o=0,n;n=this.rows[o];o++)n.hasExternalInput&&(e=!0);for(let o=0,n;n=this.rows[o];o++){var t=n.elements;if(n.elements=[],n.startsWithElemSpacer()&&n.elements.push(new as(this.constants_,this.getInRowSpacing_(null,t[0]))),t.length){for(let u=0;u{this.targetWorkspace.isDragging()||t.addSelect()})),this.listeners.push(ue(e,"pointerleave",t,()=>{this.targetWorkspace.isDragging()||t.removeSelect()})),this.listeners.push(ue(o,"pointerenter",t,()=>{this.targetWorkspace.isDragging()||t.addSelect()})),this.listeners.push(ue(o,"pointerleave",t,()=>{this.targetWorkspace.isDragging()||t.removeSelect()}))}blockMouseDown(e){return t=>{const o=this.targetWorkspace.getGesture(t);o&&(o.setStartBlock(e),o.handleFlyoutStart(t,this))}}onMouseDown(e){const t=this.targetWorkspace.getGesture(e);t&&t.handleFlyoutStart(e,this)}isBlockCreatable(e){return e.isEnabled()}createBlock(e){let t=null;i.disable$$module$build$src$core$events$utils();var o=this.targetWorkspace.getAllVariables();this.targetWorkspace.setResizesEnabled(!1);try{t=this.placeNewBlock(e)}finally{i.enable$$module$build$src$core$events$utils()}if(this.targetWorkspace.hideChaff(),e=qn(this.targetWorkspace,o),C()){for(i.setGroup$$module$build$src$core$events$utils(!0),o=0;o-t||e<-180+t||e>180-t}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const e=this.svgGroup_.getBoundingClientRect(),t=e.left;return this.toolboxPosition_===Ge.LEFT?new rt(-1e9,1e9,-1e9,t+e.width):new rt(-1e9,1e9,t,1e9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let e=0;var t=this.workspace_.getTopBlocks(!1);for(let n=0,u;u=t[n];n++){var o=u.getHeightWidth().width;u.outputConnection&&(o-=this.tabWidth_),e=Math.max(e,o)}for(let n=0,u;u=this.buttons_[n];n++)e=Math.max(e,u.width);if(e+=1.5*this.MARGIN+this.tabWidth_,e*=this.workspace_.scale,e+=yt.scrollbarThickness,this.width_!==e){for(let n=0,u;u=t[n];n++){if(this.RTL){o=u.getRelativeToSurfaceXY().x;let g=e/this.workspace_.scale-this.MARGIN;u.outputConnection||(g-=this.tabWidth_),u.moveBy(g-o,0)}this.rectMap_.has(u)&&this.moveRectToBlock_(this.rectMap_.get(u),u)}if(this.RTL)for(let n=0,u;u=this.buttons_[n];n++)t=u.getPosition().y,u.moveTo(e/this.workspace_.scale-u.width-this.MARGIN-this.tabWidth_,t);this.targetWorkspace.scrollbar||this.autoClose||this.targetWorkspace.getFlyout()!==this||this.toolboxPosition_!==Ge.LEFT||this.targetWorkspace.translate(this.targetWorkspace.scrollX+e,this.targetWorkspace.scrollY),this.width_=e,this.position(),this.targetWorkspace.resizeContents(),this.targetWorkspace.recordDragTargets()}}};Rp.registryName="verticalFlyout",r($e.FLYOUTS_VERTICAL_TOOLBOX,Ws,Rp);var cy=class extends Jl{constructor(e){super(e),this.horizontalLayout=!0}setMetrics_(e){if(this.isVisible()){var t=this.workspace_.getMetricsManager(),o=t.getScrollMetrics(),n=t.getViewMetrics();t=t.getAbsoluteMetrics(),typeof e.x=="number"&&(this.workspace_.scrollX=-(o.left+(o.width-n.width)*e.x)),this.workspace_.translate(this.workspace_.scrollX+t.left,this.workspace_.scrollY+t.top)}}getX(){return 0}getY(){if(!this.isVisible())return 0;var e=this.targetWorkspace.getMetricsManager();const t=e.getAbsoluteMetrics(),o=e.getViewMetrics();e=e.getToolboxMetrics();const n=this.toolboxPosition_===Ge.TOP;return this.targetWorkspace.toolboxPosition===this.toolboxPosition_?this.targetWorkspace.getToolbox()?n?e.height:o.height-this.height_:n?0:o.height:n?0:o.height+t.top-this.height_}position(){if(this.isVisible()&&this.targetWorkspace.isVisible()){var e=this.targetWorkspace.getMetricsManager().getViewMetrics();this.width_=e.width,this.setBackgroundPath(e.width-2*this.CORNER_RADIUS,this.height_-this.CORNER_RADIUS),e=this.getX();var t=this.getY();this.positionAt_(this.width_,this.height_,e,t)}}setBackgroundPath(e,t){const o=this.toolboxPosition_===Ge.TOP,n=["M 0,"+(o?0:this.CORNER_RADIUS)];o?(n.push("h",e+2*this.CORNER_RADIUS),n.push("v",t),n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,-this.CORNER_RADIUS,this.CORNER_RADIUS),n.push("h",-e),n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,-this.CORNER_RADIUS,-this.CORNER_RADIUS)):(n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,this.CORNER_RADIUS,-this.CORNER_RADIUS),n.push("h",e),n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,this.CORNER_RADIUS,this.CORNER_RADIUS),n.push("v",t),n.push("h",-e-2*this.CORNER_RADIUS)),n.push("z"),this.svgBackground_.setAttribute("d",n.join(" "))}scrollToStart(){let e;(e=this.workspace_.scrollbar)==null||e.setX(this.RTL?1/0:0)}wheel_(e){var t=Le(e);if(t=t.x||t.y){const o=this.workspace_.getMetricsManager(),n=o.getScrollMetrics();t=o.getViewMetrics().left-n.left+t;let u;(u=this.workspace_.scrollbar)==null||u.setX(t),tr(this.workspace_),Fs()}e.preventDefault(),e.stopPropagation()}layout_(e,t){this.workspace_.scale=this.targetWorkspace.scale;const o=this.MARGIN;let n=o+this.tabWidth_;this.RTL&&(e=e.reverse());for(let L=0,le;le=e[L];L++)if(le.type==="block"){var u=le.block;if(u==null)continue;var g=u.getDescendants(!1);for(let dt=0,ut;ut=g[dt];dt++)ut.isInFlyout=!0;g=u.getSvgRoot();const Ee=u.getHeightWidth();var I=u.outputConnection?this.tabWidth_:0;I=this.RTL?n+Ee.width:n-I,u.moveBy(I,o),I=this.createRect_(u,I,o,Ee,L),n+=Ee.width+t[L],this.addBlockListeners_(g,u,I)}else le.type==="button"&&(u=le.button,this.initFlyoutButton_(u,n,o),n+=u.width+t[L])}isDragTowardWorkspace(e){e=Math.atan2(e.y,e.x)/Math.PI*180;const t=this.dragAngleRange_;return e<90+t&&e>90-t||e>-90-t&&e<-90+t}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const e=this.svgGroup_.getBoundingClientRect(),t=e.top;return this.toolboxPosition_===Ge.TOP?new rt(-1e9,t+e.height,-1e9,1e9):new rt(t,1e9,-1e9,1e9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let e=0;const t=this.workspace_.getTopBlocks(!1);for(let n=0,u;u=t[n];n++)e=Math.max(e,u.getHeightWidth().height);const o=this.buttons_;for(let n=0,u;u=o[n];n++)e=Math.max(e,u.height);if(e+=1.5*this.MARGIN,e*=this.workspace_.scale,e+=yt.scrollbarThickness,this.height_!==e){for(let n=0,u;u=t[n];n++)this.rectMap_.has(u)&&this.moveRectToBlock_(this.rectMap_.get(u),u);this.targetWorkspace.scrollbar||this.autoClose||this.targetWorkspace.getFlyout()!==this||this.toolboxPosition_!==Ge.TOP||this.targetWorkspace.translate(this.targetWorkspace.scrollX,this.targetWorkspace.scrollY+e),this.height_=e,this.position(),this.targetWorkspace.resizeContents(),this.targetWorkspace.recordDragTargets()}}};r($e.FLYOUTS_HORIZONTAL_TOOLBOX,Ws,cy);var Lr=class extends es{constructor(e,t,o,n,u){super(lt.SKIP_SETUP),this.defaultType="",this.variableTypes=[],this.variable=null,this.SERIALIZABLE=!0,this.menuGenerator_=Lr.dropdownCreate,this.defaultVariableName=typeof e=="string"?e:"",this.size_=new Xe(0,0),e!==lt.SKIP_SETUP&&(u?this.configure_(u):this.setTypes(o,n),t&&this.setValidator(t))}configure_(e){super.configure_(e),this.setTypes(e.variableTypes,e.defaultType)}initModel(){var e=this.getSourceBlock();if(!e)throw new _t;this.variable||(e=i.getOrCreateVariablePackage$$module$build$src$core$variables(e.workspace,null,this.defaultVariableName,this.defaultType),this.doValueUpdate_(e.getId()))}shouldAddBorderRect_(){const e=this.getSourceBlock();if(!e)throw new _t;return super.shouldAddBorderRect_()&&(!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||e.type!=="variables_get")}fromXml(e){var t=this.getSourceBlock();if(!t)throw new _t;const o=e.getAttribute("id"),n=e.textContent,u=e.getAttribute("variabletype")||e.getAttribute("variableType")||"";if(t=i.getOrCreateVariablePackage$$module$build$src$core$variables(t.workspace,o,n,u),u!==null&&u!==t.type)throw Error("Serialized variable type with id '"+t.getId()+"' had type "+t.type+", and does not match variable field that references it: "+zs(e)+".");this.setValue(t.getId())}toXml(e){return this.initModel(),e.id=this.variable.getId(),e.textContent=this.variable.name,this.variable.type&&e.setAttribute("variabletype",this.variable.type),e}saveState(e){var t=this.saveLegacyState(Lr);return t!==null||(this.initModel(),t={id:this.variable.getId()},e&&(t.name=this.variable.name,t.type=this.variable.type)),t}loadState(e){const t=this.getSourceBlock();if(!t)throw new _t;this.loadLegacyState(Lr,e)||(e=i.getOrCreateVariablePackage$$module$build$src$core$variables(t.workspace,e.id||null,e.name,e.type||""),this.setValue(e.getId()))}setSourceBlock(e){if(e.isShadow())throw Error("Variable fields are not allowed to exist on shadow blocks.");super.setSourceBlock(e)}getValue(){return this.variable?this.variable.getId():null}getText(){return this.variable?this.variable.name:""}getVariable(){return this.variable}getValidator(){return this.variable?this.validator_:null}doClassValidation_(e){if(e===null)return null;var t=this.getSourceBlock();if(!t)throw new _t;return t=i.getVariable$$module$build$src$core$variables(t.workspace,e),t?(t=t.type,this.typeIsAllowed(t)?e:(console.warn("Variable type doesn't match this field! Type was "+t),null)):(console.warn("Variable id doesn't point to a real variable! ID was "+e),null)}doValueUpdate_(e){const t=this.getSourceBlock();if(!t)throw new _t;this.variable=i.getVariable$$module$build$src$core$variables(t.workspace,e),super.doValueUpdate_(e)}typeIsAllowed(e){const t=this.getVariableTypes();if(!t)return!0;for(let o=0;othis.max_&&(e.max=`${this.max_}`,xt(e,Et.VALUEMAX,this.max_)),e}static fromJson(e){return new this(e.value,void 0,void 0,void 0,void 0,e)}};Us("field_number",Op),Op.prototype.DEFAULT_VALUE=0;var uy=class extends _i{constructor(e,t,o){super(String(e??""),t,o),this.EDITABLE=!1,this.SERIALIZABLE=!0}static fromJson(e){return new this(bt(e.text),void 0,e)}};Us("field_label_serializable",uy);var Ti=class extends lt{constructor(e,t,o){super(lt.SKIP_SETUP),this.SERIALIZABLE=!0,this.CURSOR="default",this.value_=this.value_,this.checkChar=Ti.CHECK_CHAR,e!==lt.SKIP_SETUP&&(o&&this.configure_(o),this.setValue(e),t&&this.setValidator(t))}configure_(e){super.configure_(e),e.checkCharacter&&(this.checkChar=e.checkCharacter)}saveState(){const e=this.saveLegacyState(Ti);return e!==null?e:this.getValueBoolean()}initView(){super.initView();const e=this.getTextElement();Re(e,"blocklyCheckbox"),e.style.display=this.value_?"block":"none"}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_(this.getConstants().FIELD_CHECKBOX_X_OFFSET)}getDisplayText_(){return this.checkChar}setCheckCharacter(e){this.checkChar=e||Ti.CHECK_CHAR,this.forceRerender()}showEditor_(){this.setValue(!this.value_)}doClassValidation_(e){return e===!0||e==="TRUE"?"TRUE":e===!1||e==="FALSE"?"FALSE":null}doValueUpdate_(e){this.value_=this.convertValueToBool(e),this.textElement_&&(this.textElement_.style.display=this.value_?"block":"none")}getValue(){return this.value_?"TRUE":"FALSE"}getValueBoolean(){return this.value_}getText(){return String(this.convertValueToBool(this.value_))}convertValueToBool(e){return typeof e=="string"?e==="TRUE":!!e}static fromJson(e){return new this(e.checked,void 0,e)}};Ti.CHECK_CHAR="✓",Us("field_checkbox",Ti),Ti.prototype.DEFAULT_VALUE=!1;var dy=class{constructor(e,t){this.draggable=e,this.workspace=t,this.dragTarget=null,this.startLoc=e.getRelativeToSurfaceXY()}onDragStart(e){this.draggable.startDrag(e)}onDrag(e,t){this.moveDraggable(e,t),t=this.getRoot(this.draggable),ds(t)&&t.setDeleteStyle(this.wouldDeleteDraggable(e,t)),this.updateDragTarget(e)}updateDragTarget(e){e=this.workspace.getDragTarget(e);const t=this.getRoot(this.draggable);if(this.dragTarget!==e){let o;(o=this.dragTarget)==null||o.onDragExit(t),e==null||e.onDragEnter(t)}e==null||e.onDragOver(t),this.dragTarget=e}moveDraggable(e,t){t=this.pixelsToWorkspaceUnits(t),t=ye.sum(this.startLoc,t),this.draggable.drag(t,e)}wouldDeleteDraggable(e,t){return(e=this.workspace.getDragTarget(e))&&this.workspace.getComponentManager().hasCapability(e.id,gt.Capability.DELETE_AREA)?e.wouldDelete(t):!1}onDragEnd(e){const t=i.getGroup$$module$build$src$core$events$utils();var o=this.workspace.getDragTarget(e);const n=this.getRoot(this.draggable);if(o){let u;(u=this.dragTarget)==null||u.onDrop(n)}this.shouldReturnToStart(e,n)&&this.draggable.revertDrag(),(o=ds(n)&&this.wouldDeleteDraggable(e,n))&&this.draggable instanceof $s&&Wa(this.draggable.getRootBlock()),this.draggable.endDrag(e),o&&ds(n)&&(e=i.getGroup$$module$build$src$core$events$utils(),i.setGroup$$module$build$src$core$events$utils(t),n.dispose(),i.setGroup$$module$build$src$core$events$utils(e))}getRoot(e){return e instanceof $s?e.getRootBlock():e}shouldReturnToStart(e,t){return(e=this.workspace.getDragTarget(e))?e.shouldPreventMove(t):!1}pixelsToWorkspaceUnits(e){return e=new ye(e.x/this.workspace.scale,e.y/this.workspace.scale),this.workspace.isMutator&&e.scale(1/this.workspace.options.parentWorkspace.scale),e}};r($e.BLOCK_DRAGGER,Ws,dy);var Pr={};Pr.BlockDragStrategy=Fv,Pr.BubbleDragStrategy=wv,Pr.CommentDragStrategy=fv,Pr.Dragger=dy;var Np=class extends Ss{constructor(e,t,o){super(e?e.workspace.id:void 0),this.type=ee.BLOCK_DRAG,e&&(this.blockId=e.id,this.isStart=t,this.blocks=o)}toJson(){const e=super.toJson();if(this.isStart===void 0)throw Error("Whether this event is the start of a drag is undefined. Either pass the value to the constructor, or call fromJson");if(this.blockId===void 0)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");return e.isStart=this.isStart,e.blockId=this.blockId,e.blocks=this.blocks,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Np),t.isStart=e.isStart,t.blockId=e.blockId,t.blocks=e.blocks,t}};r($e.EVENT,ee.BLOCK_DRAG,Np);var Mp=class extends gi{constructor(e,t,o,n){super(e),this.type=ee.BLOCK_FIELD_INTERMEDIATE_CHANGE,this.recordUndo=!1,e&&(this.name=t,this.oldValue=o,this.newValue=n)}toJson(){const e=super.toJson();if(!this.name)throw Error("The changed field name is undefined. Either pass a name to the constructor, or call fromJson.");return e.name=this.name,e.oldValue=this.oldValue,e.newValue=this.newValue,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Mp),t.name=e.name,t.oldValue=e.oldValue,t.newValue=e.newValue,t}isNull(){return this.oldValue===this.newValue}run(e){var t=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");if(t=t.getBlockById(this.blockId),!t)throw Error("The associated block is undefined. Either pass a block to the constructor, or call fromJson");e=e?this.newValue:this.oldValue,(t=t.getField(this.name))?t.setValue(e):console.warn("Can't set non-existent field: "+this.name)}};r($e.EVENT,ee.BLOCK_FIELD_INTERMEDIATE_CHANGE,Mp);var Lp=class extends gi{constructor(e){super(e),this.type=ee.BLOCK_MOVE,e&&(e.isShadow()&&(this.recordUndo=!1),e=this.currentLocation(),this.oldParentId=e.parentId,this.oldInputName=e.inputName,this.oldCoordinate=e.coordinate)}toJson(){const e=super.toJson();return e.oldParentId=this.oldParentId,e.oldInputName=this.oldInputName,this.oldCoordinate&&(e.oldCoordinate=`${Math.round(this.oldCoordinate.x)}, ${Math.round(this.oldCoordinate.y)}`),e.newParentId=this.newParentId,e.newInputName=this.newInputName,this.newCoordinate&&(e.newCoordinate=`${Math.round(this.newCoordinate.x)}, ${Math.round(this.newCoordinate.y)}`),this.reason&&(e.reason=this.reason),this.recordUndo||(e.recordUndo=this.recordUndo),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Lp),t.oldParentId=e.oldParentId,t.oldInputName=e.oldInputName,e.oldCoordinate&&(o=e.oldCoordinate.split(","),t.oldCoordinate=new ye(Number(o[0]),Number(o[1]))),t.newParentId=e.newParentId,t.newInputName=e.newInputName,e.newCoordinate&&(o=e.newCoordinate.split(","),t.newCoordinate=new ye(Number(o[0]),Number(o[1]))),e.reason!==void 0&&(t.reason=e.reason),e.recordUndo!==void 0&&(t.recordUndo=e.recordUndo),t}recordNew(){const e=this.currentLocation();this.newParentId=e.parentId,this.newInputName=e.inputName,this.newCoordinate=e.coordinate}setReason(e){this.reason=e}currentLocation(){var e=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");var t=e.getBlockById(this.blockId);if(!t)throw Error("The block associated with the block move event could not be found");e={};const o=t.getParent();return o?(e.parentId=o.id,(t=o.getInputWithBlock(t))&&(e.inputName=t.name)):e.coordinate=t.getRelativeToSurfaceXY(),e}isNull(){return this.oldParentId===this.newParentId&&this.oldInputName===this.newInputName&&ye.equals(this.oldCoordinate,this.newCoordinate)}run(e){var t=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");var o=t.getBlockById(this.blockId);if(o){var n=e?this.newParentId:this.oldParentId,u=e?this.newInputName:this.oldInputName;if(e=e?this.newCoordinate:this.oldCoordinate,n){var g=t.getBlockById(n);if(!g){console.warn("Can't connect to non-existent block: "+n);return}}if(o.getParent()&&o.unplug(),e)u=o.getRelativeToSurfaceXY(),o.moveBy(e.x-u.x,e.y-u.y,this.reason);else{t=o.outputConnection,(!t||o.previousConnection&&o.previousConnection.isConnected())&&(t=o.previousConnection);let I,L;o=(L=t)==null?void 0:L.type,u?(o=g.getInput(u))&&(I=o.connection):o===xe.PREVIOUS_STATEMENT&&(I=g.nextConnection),I&&t?t.connect(I):console.warn("Can't connect to non-existent input: "+u)}}else console.warn("Can't move non-existent block: "+this.blockId)}};r($e.EVENT,ee.BLOCK_MOVE,Lp);var Pp=class extends Ss{constructor(e,t,o){super(e?e.workspace.id:void 0),this.type=ee.BUBBLE_OPEN,e&&(this.blockId=e.id,this.isOpen=t,this.bubbleType=o)}toJson(){const e=super.toJson();if(this.isOpen===void 0)throw Error("Whether this event is for opening the bubble is undefined. Either pass the value to the constructor, or call fromJson");if(!this.bubbleType)throw Error("The type of bubble is undefined. Either pass the value to the constructor, or call fromJson");return e.isOpen=this.isOpen,e.bubbleType=this.bubbleType,e.blockId=this.blockId||"",e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Pp),t.isOpen=e.isOpen,t.bubbleType=e.bubbleType,t.blockId=e.blockId,t}},Bp;(function(e){e.MUTATOR="mutator",e.COMMENT="comment",e.WARNING="warning"})(Bp||(Bp={})),r($e.EVENT,ee.BUBBLE_OPEN,Pp);var qs=class extends qi{constructor(e){super(),this.isBlank=!e,e&&(this.commentId=e.id,this.workspaceId=e.workspace.id,this.group=i.getGroup$$module$build$src$core$events$utils(),this.recordUndo=G())}toJson(){const e=super.toJson();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");return e.commentId=this.commentId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new qs),t.commentId=e.commentId,t}static CommentCreateDeleteHelper(e,t){const o=e.getEventWorkspace_();if(t){if(!e.json)throw Error("Encountered a comment event without proper json");Kn(e.json,o)}else{if(!e.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");(t=o.getCommentById(e.commentId))?t.dispose():console.warn("Can't delete non-existent comment: "+e.commentId)}}},jp=class extends qs{constructor(e,t,o){super(e),this.type=ee.COMMENT_CHANGE,e&&(this.oldContents_=typeof t>"u"?"":t,this.newContents_=typeof o>"u"?"":o)}toJson(){const e=super.toJson();if(!this.oldContents_)throw Error("The old contents is undefined. Either pass a value to the constructor, or call fromJson");if(!this.newContents_)throw Error("The new contents is undefined. Either pass a value to the constructor, or call fromJson");return e.oldContents=this.oldContents_,e.newContents=this.newContents_,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new jp),t.oldContents_=e.oldContents,t.newContents_=e.newContents,t}isNull(){return this.oldContents_===this.newContents_}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(t=t.getCommentById(this.commentId)){var o=e?this.newContents_:this.oldContents_;if(o===void 0)throw Error(e?"The new contents is undefined. Either pass a value to the constructor, or call fromJson":"The old contents is undefined. Either pass a value to the constructor, or call fromJson");t.setText(o)}else console.warn("Can't change non-existent comment: "+this.commentId)}};r($e.EVENT,ee.COMMENT_CHANGE,jp);var Fp=class extends qs{constructor(e,t){super(e),this.newCollapsed=t,this.type=ee.COMMENT_COLLAPSE}toJson(){const e=super.toJson();if(this.newCollapsed===void 0)throw Error("The new collapse value undefined. Either call recordNew, or call fromJson");return e.newCollapsed=this.newCollapsed,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Fp),t.newCollapsed=e.newCollapsed,t}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");(t=t.getCommentById(this.commentId))?t.setCollapsed(e?!!this.newCollapsed:!this.newCollapsed):console.warn("Can't collapse or uncollapse non-existent comment: "+this.commentId)}};r($e.EVENT,ee.COMMENT_COLLAPSE,Fp);var zp=class extends qs{constructor(e){super(e),this.type=ee.COMMENT_CREATE,e&&(this.xml=ir(e),this.json=Pi(e,{addCoordinates:!0}))}toJson(){const e=super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.json)throw Error("The comment JSON is undefined. Either pass a block to the constructor, or call fromJson");return e.xml=zs(this.xml),e.json=this.json,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new zp),t.xml=i.textToDom$$module$build$src$core$utils$xml(e.xml),t.json=e.json,t}run(e){qs.CommentCreateDeleteHelper(this,e)}};r($e.EVENT,ee.COMMENT_CREATE,zp);var Up=class extends qs{constructor(e){super(e),this.type=ee.COMMENT_DELETE,e&&(this.xml=ir(e),this.json=Pi(e,{addCoordinates:!0}))}run(e){qs.CommentCreateDeleteHelper(this,!e)}toJson(){const e=super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.json)throw Error("The comment JSON is undefined. Either pass a block to the constructor, or call fromJson");return e.xml=zs(this.xml),e.json=this.json,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Up),t.xml=i.textToDom$$module$build$src$core$utils$xml(e.xml),t.json=e.json,t}};r($e.EVENT,ee.COMMENT_DELETE,Up);var Hp=class extends Ss{constructor(e,t){super(e?e.workspace.id:void 0),this.type=ee.COMMENT_DRAG,e&&(this.commentId=e.id,this.isStart=t)}toJson(){const e=super.toJson();if(this.isStart===void 0)throw Error("Whether this event is the start of a drag is undefined. Either pass the value to the constructor, or call fromJson");if(this.commentId===void 0)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");return e.isStart=this.isStart,e.commentId=this.commentId,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Hp),t.isStart=e.isStart,t.commentId=e.commentId,t}};r($e.EVENT,ee.COMMENT_DRAG,Hp);var Wp=class extends qs{constructor(e){super(e),this.type=ee.COMMENT_MOVE,e&&(this.comment_=e,this.oldCoordinate_=e.getRelativeToSurfaceXY())}recordNew(){if(this.newCoordinate_)throw Error("Tried to record the new position of a comment on the same event twice.");if(!this.comment_)throw Error("The comment is undefined. Pass a comment to the constructor if you want to use the record functionality");this.newCoordinate_=this.comment_.getRelativeToSurfaceXY()}setReason(e){this.reason=e}setOldCoordinate(e){this.oldCoordinate_=e}toJson(){const e=super.toJson();if(!this.oldCoordinate_)throw Error("The old comment position is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.newCoordinate_)throw Error("The new comment position is undefined. Either call recordNew, or call fromJson");return e.oldCoordinate=`${Math.round(this.oldCoordinate_.x)}, ${Math.round(this.oldCoordinate_.y)}`,e.newCoordinate=Math.round(this.newCoordinate_.x)+","+Math.round(this.newCoordinate_.y),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Wp),o=e.oldCoordinate.split(","),t.oldCoordinate_=new ye(Number(o[0]),Number(o[1])),o=e.newCoordinate.split(","),t.newCoordinate_=new ye(Number(o[0]),Number(o[1])),t}isNull(){return ye.equals(this.oldCoordinate_,this.newCoordinate_)}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(t=t.getCommentById(this.commentId)){if(e=e?this.newCoordinate_:this.oldCoordinate_,!e)throw Error("Either oldCoordinate_ or newCoordinate_ is undefined. Either pass a comment to the constructor and call recordNew, or call fromJson");t.moveTo(e)}else console.warn("Can't move non-existent comment: "+this.commentId)}};r($e.EVENT,ee.COMMENT_MOVE,Wp);var Gp=class extends qs{constructor(e){super(e),this.type=ee.COMMENT_RESIZE,e&&(this.oldSize=e.getSize())}recordCurrentSizeAsNewSize(){if(this.newSize)throw Error("Tried to record the new size of a comment on the same event twice.");var e=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(e=e.getCommentById(this.commentId),!e)throw Error("The comment associated with the comment resize event could not be found");this.newSize=e.getSize()}toJson(){const e=super.toJson();if(!this.oldSize)throw Error("The old comment size is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.newSize)throw Error("The new comment size is undefined. Either call recordCurrentSizeAsNewSize, or call fromJson");return e.oldWidth=Math.round(this.oldSize.width),e.oldHeight=Math.round(this.oldSize.height),e.newWidth=Math.round(this.newSize.width),e.newHeight=Math.round(this.newSize.height),e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Gp),t.oldSize=new Xe(e.oldWidth,e.oldHeight),t.newSize=new Xe(e.newWidth,e.newHeight),t}isNull(){return Xe.equals(this.oldSize,this.newSize)}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(t=t.getCommentById(this.commentId)){if(e=e?this.newSize:this.oldSize,!e)throw Error("Either oldSize or newSize is undefined. Either pass a comment to the constructor and call recordCurrentSizeAsNewSize, or call fromJson");t.setSize(e)}else console.warn("Can't resize non-existent comment: "+this.commentId)}};r($e.EVENT,ee.COMMENT_RESIZE,Gp);var Vp=class extends Ss{constructor(e,t,o){super(o),this.type=ee.TOOLBOX_ITEM_SELECT,this.oldItem=e??void 0,this.newItem=t??void 0}toJson(){const e=super.toJson();return e.oldItem=this.oldItem,e.newItem=this.newItem,e}static fromJson(e,t,o){return t=super.fromJson(e,t,o??new Vp),t.oldItem=e.oldItem,t.newItem=e.newItem,t}};r($e.EVENT,ee.TOOLBOX_ITEM_SELECT,Vp);var hy=class extends qi{constructor(e){super(),this.isBlank=!0,this.recordUndo=!1,this.type=ee.FINISHED_LOADING,this.isBlank=!!e,e&&(this.workspaceId=e.id)}};r($e.EVENT,ee.FINISHED_LOADING,hy);var py,gy,my,fy,$y,by,vy,yy,_y,wy,ky,Cy,Ty,Sy,Ey,Iy,xy,Dy,Ay,Ry,Oy,Ny,My,Ly,Py,Se;i.BLOCK_CHANGE$$module$build$src$core$events$events=ee.BLOCK_CHANGE,i.BLOCK_CREATE$$module$build$src$core$events$events=ee.BLOCK_CREATE,i.BLOCK_DELETE$$module$build$src$core$events$events=ee.BLOCK_DELETE,py=ee.BLOCK_DRAG,i.BLOCK_MOVE$$module$build$src$core$events$events=ee.BLOCK_MOVE,gy=ee.BLOCK_FIELD_INTERMEDIATE_CHANGE,my=ee.BUBBLE_OPEN,fy=ee.BLOCK_CHANGE,$y=ee.CLICK,by=ee.COMMENT_CHANGE,vy=ee.COMMENT_CREATE,yy=ee.COMMENT_DELETE,_y=ee.COMMENT_MOVE,wy=ee.COMMENT_RESIZE,ky=ee.COMMENT_DRAG,Cy=ee.BLOCK_CREATE,Ty=ee.BLOCK_DELETE,Sy=ee.FINISHED_LOADING,Ey=ee.MARKER_MOVE,Iy=ee.BLOCK_MOVE,xy=ee.SELECTED,Dy=ee.THEME_CHANGE,Ay=ee.TOOLBOX_ITEM_SELECT,Ry=ee.TRASHCAN_OPEN,Oy=ee.UI,Ny=ee.VAR_CREATE,My=ee.VAR_DELETE,Ly=ee.VAR_RENAME,Py=ee.VIEWPORT_CHANGE,Se={},Se.Abstract=qi,Se.BLOCK_CHANGE=i.BLOCK_CHANGE$$module$build$src$core$events$events,Se.BLOCK_CREATE=i.BLOCK_CREATE$$module$build$src$core$events$events,Se.BLOCK_DELETE=i.BLOCK_DELETE$$module$build$src$core$events$events,Se.BLOCK_DRAG=py,Se.BLOCK_FIELD_INTERMEDIATE_CHANGE=gy,Se.BLOCK_MOVE=i.BLOCK_MOVE$$module$build$src$core$events$events,Se.BUBBLE_OPEN=my,Se.BUMP_EVENTS=pb,Se.BlockBase=gi,Se.BlockChange=mi,Se.BlockCreate=Qh,Se.BlockDelete=hp,Se.BlockDrag=Np,Se.BlockFieldIntermediateChange=Mp,Se.BlockMove=Lp,Se.BubbleOpen=Pp,Se.BubbleType=Bp,Se.CHANGE=fy,Se.CLICK=$y,Se.COMMENT_CHANGE=by,Se.COMMENT_CREATE=vy,Se.COMMENT_DELETE=yy,Se.COMMENT_DRAG=ky,Se.COMMENT_MOVE=_y,Se.COMMENT_RESIZE=wy,Se.CREATE=Cy,Se.Click=bh,Se.ClickTarget=vh,Se.CommentBase=qs,Se.CommentChange=jp,Se.CommentCollapse=Fp,Se.CommentCreate=zp,Se.CommentDelete=Up,Se.CommentDrag=Hp,Se.CommentMove=Wp,Se.CommentResize=Gp,Se.DELETE=Ty,Se.FINISHED_LOADING=Sy,Se.FinishedLoading=hy,Se.MARKER_MOVE=Ey,Se.MOVE=Iy,Se.MarkerMove=pp,Se.SELECTED=xy,Se.Selected=_p,Se.THEME_CHANGE=Dy,Se.TOOLBOX_ITEM_SELECT=Ay,Se.TRASHCAN_OPEN=Ry,Se.ThemeChange=ep,Se.ToolboxItemSelect=Vp,Se.TrashcanOpen=kp,Se.UI=Oy,Se.UiBase=Ss,Se.VAR_CREATE=Ny,Se.VAR_DELETE=My,Se.VAR_RENAME=Ly,Se.VIEWPORT_CHANGE=Py,Se.VarBase=br,Se.VarCreate=jh,Se.VarDelete=bp,Se.VarRename=vp,Se.ViewportChange=tp,Se.clearPendingUndo=K,Se.disable=i.disable$$module$build$src$core$events$utils,Se.disableOrphans=me,Se.enable=i.enable$$module$build$src$core$events$utils,Se.filter=O,Se.fire=z,Se.fromJson=ce,Se.get=ne,Se.getDescendantIds=ve,Se.getGroup=i.getGroup$$module$build$src$core$events$utils,Se.getRecordUndo=G,Se.isEnabled=C,Se.setGroup=i.setGroup$$module$build$src$core$events$utils,Se.setRecordUndo=i.setRecordUndo$$module$build$src$core$events$utils;var Rs={};Rs.BottomRow=Qv,Rs.ConstantProvider=Xv,Rs.Drawer=Zv,Rs.MarkerSvg=oy,Rs.PathObject=iy,Rs.RenderInfo=sy,Rs.Renderer=Ap,Rs.RightConnectionShape=ey,Rs.StatementInput=Yl,Rs.TopRow=ty,gh();var It={};It.registerCleanup=Zd,It.registerCollapse=eh,It.registerCollapseExpandBlock=ah,It.registerComment=nh,It.registerCommentCreate=ph,It.registerCommentDelete=dh,It.registerCommentDuplicate=hh,It.registerCommentOptions=ab,It.registerDefaultOptions=gh,It.registerDelete=ch,It.registerDeleteAll=oh,It.registerDisable=lh,It.registerDuplicate=ih,It.registerExpand=th,It.registerHelp=uh,It.registerInline=rh,It.registerRedo=Xd,It.registerUndo=qd;var ql={};ql.CommentView=bv,ql.RenderedWorkspaceComment=Il,ql.WorkspaceComment=El;var Br={};Br.Bubble=nt,Br.MiniWorkspaceBubble=vo,Br.TextBubble=Iv,Br.TextInputBubble=kv;var By=class extends Pl{constructor(){super(),this.FIELD_TEXT_BASELINE_CENTER=!1,this.DARK_PATH_OFFSET=1,this.MAX_BOTTOM_WIDTH=30,this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT/2}getCSS_(e){return super.getCSS_(e).concat([`${e} .blocklyInsertionMarker>.blocklyPathLight,`,`${e} .blocklyInsertionMarker>.blocklyPathDark {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"])}},jy=class{constructor(e){this.inlineSteps_=this.steps_="",this.info_=e,this.RTL_=this.info_.RTL,e=e.getRenderer(),this.constants_=e.getConstants(),this.highlightConstants_=e.getHighlightConstants(),this.highlightOffset=this.highlightConstants_.OFFSET,this.outsideCornerPaths_=this.highlightConstants_.OUTSIDE_CORNER,this.insideCornerPaths_=this.highlightConstants_.INSIDE_CORNER,this.puzzleTabPaths_=this.highlightConstants_.PUZZLE_TAB,this.notchPaths_=this.highlightConstants_.NOTCH,this.startPaths_=this.highlightConstants_.START_HAT,this.jaggedTeethPaths_=this.highlightConstants_.JAGGED_TEETH}getPath(){return this.steps_+` +`+this.inlineSteps_}drawTopCorner(e){this.steps_+=pt(e.xPos,this.info_.startY);for(let t=0,o;o=e.elements[t];t++)j.isLeftSquareCorner(o)?this.steps_+=this.highlightConstants_.START_POINT:j.isLeftRoundedCorner(o)?this.steps_+=this.outsideCornerPaths_.topLeft(this.RTL_):j.isPreviousConnection(o)?this.steps_+=this.notchPaths_.pathLeft:j.isHat(o)?this.steps_+=this.startPaths_.path(this.RTL_):j.isSpacer(o)&&o.width!==0&&(this.steps_+=De("H",o.xPos+o.width-this.highlightOffset));this.steps_+=De("H",e.xPos+e.width-this.highlightOffset)}drawJaggedEdge_(e){this.info_.RTL&&(this.steps_+=this.jaggedTeethPaths_.pathLeft+De("v",e.height-this.jaggedTeethPaths_.height-this.highlightOffset))}drawValueInput(e){const t=e.getLastInput();if(this.RTL_){const o=e.height-t.connectionHeight;this.steps_+=St(t.xPos+t.width-this.highlightOffset,e.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)+De("v",o)}else this.steps_+=St(t.xPos+t.width,e.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)}drawStatementInput(e){const t=e.getLastInput();if(t)if(this.RTL_){const o=e.height-2*this.insideCornerPaths_.height;this.steps_+=St(t.xPos,e.yPos)+this.insideCornerPaths_.pathTop(this.RTL_)+De("v",o)+this.insideCornerPaths_.pathBottom(this.RTL_)+Hs(e.width-t.xPos-this.insideCornerPaths_.width,0)}else this.steps_+=St(t.xPos,e.yPos+e.height)+this.insideCornerPaths_.pathBottom(this.RTL_)+Hs(e.width-t.xPos-this.insideCornerPaths_.width,0)}drawRightSideRow(e){const t=e.xPos+e.width-this.highlightOffset;e instanceof up&&e.followsStatement&&(this.steps_+=De("H",t)),this.RTL_&&(this.steps_+=De("H",t),e.height>this.highlightOffset&&(this.steps_+=De("V",e.yPos+e.height-this.highlightOffset)))}drawBottomRow(e){if(this.RTL_)this.steps_+=De("V",e.baseline-this.highlightOffset);else{const t=this.info_.bottomRow.elements[0];j.isLeftSquareCorner(t)?this.steps_+=St(e.xPos+this.highlightOffset,e.baseline-this.highlightOffset):j.isLeftRoundedCorner(t)&&(this.steps_+=St(e.xPos,e.baseline),this.steps_+=this.outsideCornerPaths_.bottomLeft())}}drawLeft(){var e=this.info_.outputConnection;e&&(e=e.connectionOffsetY+e.height,this.RTL_?this.steps_+=St(this.info_.startX,e):(this.steps_+=St(this.info_.startX+this.highlightOffset,this.info_.bottomRow.baseline-this.highlightOffset),this.steps_+=De("V",e)),this.steps_+=this.puzzleTabPaths_.pathUp(this.RTL_)),this.RTL_||(e=this.info_.topRow,j.isLeftRoundedCorner(e.elements[0])?this.steps_+=De("V",this.outsideCornerPaths_.height):this.steps_+=De("V",e.capline+this.highlightOffset))}drawInlineInput(e){const t=this.highlightOffset,o=e.xPos+e.connectionWidth;var n=e.centerline-e.height/2;const u=e.width-e.connectionWidth,g=n+t;this.RTL_?(n=e.connectionOffsetY-t,e=e.height-(e.connectionOffsetY+e.connectionHeight)+t,this.inlineSteps_+=St(o-t,g)+De("v",n)+this.puzzleTabPaths_.pathDown(this.RTL_)+De("v",e)+De("h",u)):this.inlineSteps_+=St(e.xPos+e.width+t,g)+De("v",e.height)+De("h",-u)+St(o,n+e.connectionOffsetY)+this.puzzleTabPaths_.pathDown(this.RTL_)}},Fy=class extends Bl{constructor(e,t){super(e,t),this.highlighter_=new jy(t)}draw(){this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights();const e=this.block_.pathObject;e.setPath(this.outlinePath_+` +`+this.inlinePath_),e.setHighlightPath(this.highlighter_.getPath()),this.info_.RTL&&e.flipRTL(),this.recordSizeOnBlock_()}drawTop_(){this.highlighter_.drawTopCorner(this.info_.topRow),this.highlighter_.drawRightSideRow(this.info_.topRow),super.drawTop_()}drawJaggedEdge_(e){this.highlighter_.drawJaggedEdge_(e),super.drawJaggedEdge_(e)}drawValueInput_(e){this.highlighter_.drawValueInput(e),super.drawValueInput_(e)}drawStatementInput_(e){this.highlighter_.drawStatementInput(e),super.drawStatementInput_(e)}drawRightSideRow_(e){this.highlighter_.drawRightSideRow(e),this.outlinePath_+=De("H",e.xPos+e.width)+De("V",e.yPos+e.height)}drawBottom_(){this.highlighter_.drawBottomRow(this.info_.bottomRow),super.drawBottom_()}drawLeft_(){this.highlighter_.drawLeft(),super.drawLeft_()}drawInlineInput_(e){this.highlighter_.drawInlineInput(e),super.drawInlineInput_(e)}positionInlineInputConnection_(e){const t=e.centerline-e.height/2;if(e.connectionModel){let o=e.xPos+e.connectionWidth+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(o*=-1),e.connectionModel.setOffsetInBlock(o,t+e.connectionOffsetY+this.constants_.DARK_PATH_OFFSET)}}positionStatementInputConnection_(e){const t=e.getLastInput();if(t!=null&&t.connectionModel){let o=e.xPos+e.statementEdge+t.notchOffset;o=this.info_.RTL?-1*o:o+this.constants_.DARK_PATH_OFFSET,t.connectionModel.setOffsetInBlock(o,e.yPos+this.constants_.DARK_PATH_OFFSET)}}positionExternalValueConnection_(e){const t=e.getLastInput();if(t&&t.connectionModel){let o=e.xPos+e.width+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(o*=-1),t.connectionModel.setOffsetInBlock(o,e.yPos)}}positionNextConnection_(){const e=this.info_.bottomRow;if(e.connection){const t=e.connection,o=t.xPos;t.connectionModel.setOffsetInBlock((this.info_.RTL?-o:o)+this.constants_.DARK_PATH_OFFSET/2,e.baseline+this.constants_.DARK_PATH_OFFSET)}}},zy=class{constructor(e){this.OFFSET=.5,this.constantProvider=e,this.START_POINT=pt(this.OFFSET,this.OFFSET)}init(){this.INSIDE_CORNER=this.makeInsideCorner(),this.OUTSIDE_CORNER=this.makeOutsideCorner(),this.PUZZLE_TAB=this.makePuzzleTab(),this.NOTCH=this.makeNotch(),this.JAGGED_TEETH=this.makeJaggedTeeth(),this.START_HAT=this.makeStartHat()}makeInsideCorner(){const e=this.constantProvider.CORNER_RADIUS,t=this.OFFSET,o=(1-Math.SQRT1_2)*(e+t)-t,n=pt(o,o)+vt("a","0 0,0",e,Me(-o-t,e-o)),u=vt("a","0 0,0",e+t,Me(e+t,e+t)),g=pt(o,-o)+vt("a","0 0,0",e+t,Me(e-o,o+t));return{width:e+t,height:e,pathTop(I){return I?n:""},pathBottom(I){return I?u:g}}}makeOutsideCorner(){const e=this.constantProvider.CORNER_RADIUS,t=this.OFFSET,o=(1-Math.SQRT1_2)*(e-t)+t,n=pt(o,o)+vt("a","0 0,1",e-t,Me(e-o,-o+t)),u=pt(t,e)+vt("a","0 0,1",e-t,Me(e,-e+t)),g=-o,I=pt(o,g)+vt("a","0 0,1",e-t,Me(-o+t,-g-e));return{height:e,topLeft(L){return L?n:u},bottomLeft(){return I}}}makePuzzleTab(){const e=this.constantProvider.TAB_WIDTH,t=this.constantProvider.TAB_HEIGHT,o=pt(-2,-t+3.4)+Hs(-.45*e,-2.1),n=De("v",2.5)+pt(.97*-e,2.5)+Zt("q",[Me(.05*-e,10),Me(.3*e,9.5)])+pt(.67*e,-1.9)+De("v",2.5),u=De("v",-1.5)+pt(-.92*e,-.5)+Zt("q",[Me(-.19*e,-5.5),Me(0,-11)])+pt(.92*e,1),g=pt(-5,t-.7)+Hs(.46*e,-2.1);return{width:e,height:t,pathUp(I){return I?o:u},pathDown(I){return I?n:g}}}makeNotch(){return{pathLeft:De("h",this.OFFSET)+this.constantProvider.NOTCH.pathLeft}}makeJaggedTeeth(){return{pathLeft:Hs(5.1,2.6)+pt(-10.2,6.8)+Hs(5.1,2.6),height:12,width:10.2}}makeStartHat(){const e=this.constantProvider.START_HAT.height,t=pt(25,-8.7)+Zt("c",[Me(29.7,-6.2),Me(57.2,-.5),Me(75,8.7)]),o=Zt("c",[Me(17.8,-9.2),Me(45.3,-14.9),Me(75,-8.7)])+St(100.5,e+.5);return{path(n){return n?t:o}}}},Uy=class extends lp{constructor(e,t){super(e,t),this.constants_=e,this.connectedBlock&&(this.width+=this.constants_.DARK_PATH_OFFSET,this.height+=this.constants_.DARK_PATH_OFFSET)}},Hy=class extends xr{constructor(e,t){super(e,t),this.constants_=e,this.connectedBlock&&(this.height+=this.constants_.DARK_PATH_OFFSET)}},Wy=class extends Rr{constructor(e,t){super(e,t),this.renderer_=e}getRenderer(){return this.renderer_}populateBottomRow_(){super.populateBottomRow_(),this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1]instanceof ls||(this.bottomRow.minHeight=this.constants_.MEDIUM_PADDING-this.constants_.DARK_PATH_OFFSET)}addInput_(e,t){this.isInline&&e instanceof i.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new Uy(this.constants_,e)),t.hasInlineInput=!0):e instanceof ls?(t.elements.push(new Hy(this.constants_,e)),t.hasStatement=!0):e instanceof i.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new Ll(this.constants_,e)),t.hasExternalInput=!0):(e instanceof Ks||e instanceof Co)&&(t.minHeight=Math.max(t.minHeight,this.constants_.DUMMY_INPUT_MIN_HEIGHT),t.hasDummyInput=!0),this.isInline||t.align!==null||(t.align=e.align)}addElemSpacing_(){let e=!1;for(let o=0,n;n=this.rows[o];o++)n.hasExternalInput&&(e=!0);for(let o=0,n;n=this.rows[o];o++){var t=n.elements;if(n.elements=[],n.startsWithElemSpacer()&&n.elements.push(new as(this.constants_,this.getInRowSpacing_(null,t[0]))),t.length){for(let u=0;u>>/handdelete.cur"), auto; } @@ -1009,13 +1009,13 @@ Blockly.YourGeneratorName.nameDB_.setVariableMap(workspace.getVariableMap());`), .blocklyToolboxContents:focus { outline: none; } -`),r($e.TOOLBOX,Ws,Jy);var vT="11.2.2",yT=xe.INPUT_VALUE,_T=xe.OUTPUT_VALUE,wT=xe.NEXT_STATEMENT,kT=xe.PREVIOUS_STATEMENT,CT=Ge.TOP,TT=Ge.BOTTOM,ST=Ge.LEFT,ET=Ge.RIGHT;gn.prototype.newBlock=function(e,t){return new Uo(this,e,t)},cs.prototype.newBlock=function(e,t){return new $s(this,e,t)},gn.prototype.newComment=function(e){return new El(this,e)},cs.prototype.newComment=function(e){return new Il(this,e)},cs.newTrashcan=function(e){return new Gv(e)},vo.prototype.newWorkspaceSvg=function(e){return new cs(e)},i.Names$$module$build$src$core$names.prototype.populateProcedures=function(e){e=qa(e),e=e[0].concat(e[1]);for(let t=0;t{this.setState({popper:x.I18n.t("Copied"),anchorEl:i}),setTimeout(()=>this.setState({popper:"",anchorEl:null}),1e3)},50)}render(){const s=new Blob([this.props.text],{type:"application/xml"}),i=`${this.props.scriptId.substring(10)}.xml`;return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"lg",sx:{"& .MuiDialog-paper":Wr.dialog},fullWidth:!0,open:!0,"aria-labelledby":"export-dialog-title",children:[m.jsx(ss,{id:"export-dialog-title",children:x.I18n.t("Export selected blocks")}),m.jsx(qt,{style:Wr.overflowY,children:m.jsx("pre",{id:"export-text",style:{...Wr.textArea,...this.props.themeType==="dark"?void 0:Wr.textAreaLight},children:this.props.text})}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",color:"secondary",startIcon:m.jsx(kc,{}),children:m.jsx("a",{download:i,target:"_blank",rel:"noreferrer",href:URL.createObjectURL(s),style:{textDecoration:"inherit",color:"inherit"},children:x.I18n.t("Download as file")})}),m.jsx(He,{variant:"contained",onClick:r=>this.onCopy(r),color:"secondary",startIcon:m.jsx(cx,{}),children:x.I18n.t("Copy to clipboard")}),m.jsx(He,{variant:"contained",onClick:()=>this.handleCancel(),color:"primary",startIcon:m.jsx(so,{}),children:x.I18n.t("Close")}),m.jsx(YT,{id:"popper",style:{zIndex:1e4},open:!!this.state.popper,placement:"top",anchorEl:this.state.anchorEl,transition:!0,children:({TransitionProps:r})=>m.jsx(JT,{...r,timeout:350,children:m.jsx(Ow,{children:m.jsx("p",{style:Wr.typography,children:this.state.popper})})})}),m.jsx("textarea",{id:"copy_input",readOnly:!0,style:{position:"absolute",left:-9999},tabIndex:-1,"aria-hidden":!0,value:this.props.text})]})]},"export-dialog")}}const Mt={textArea:{width:"calc(100% - 10px)",height:"calc(80% - 20px)",resize:"none",fontFamily:"monospace",fontSize:"1em",backgroundColor:"transparent",borderRadius:4,outline:"none"},dropzone:{marginTop:20,width:"100%",borderWidth:5,borderStyle:"dashed",borderColor:"#d0cccc",textAlign:"center",boxSizing:"border-box",paddingTop:45,borderRadius:10,height:"calc(100% - 10px)"},dropzoneDiv:{width:"100%",height:"20%",position:"relative"},dropzoneRejected:{borderColor:"#970000"},dropzoneAccepted:{borderColor:"#17cd02"},icon:{height:"80%",width:"80%",opacity:.3,color:"#eeeeee",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",zIndex:0},iconError:{color:"#ffc3c6"},iconOk:{color:"#aaeebc"},text:{top:"50%",left:"50%",transform:"translate(-50%,-50%)",color:"#868686",position:"absolute",zIndex:1},dialog:{height:"95%"},fullHeight:{height:"100%",overflow:"hidden"}};class Gm extends _e.Component{constructor(s){super(s),this.state={text:"",imageStatus:"",error:""}}componentDidMount(){setTimeout(()=>{var s;try{(s=window.document.getElementById("import-text-area"))==null||s.focus()}catch{}},100)}static readFileDataUrl(s,i){const r=new FileReader;r.onload=()=>{i(null,{data:r.result,name:s.name})},r.onabort=()=>{console.error("file reading was aborted"),i(x.I18n.t("file reading was aborted"))},r.onerror=l=>{console.error("file reading has failed"),i(x.I18n.t("file reading has failed: %s",l))},r.readAsText(s)}handleDropFile(s){if(!(s!=null&&s.length))return;const i=s[s.length-1];i&&Gm.readFileDataUrl(i,(r,l)=>{var c;r||!l?this.setState({error:r||"No data"}):this.setState({text:((c=l.data)==null?void 0:c.toString())||""})})}handleCancel(){this.props.onClose()}handleOk(){this.props.onClose(this.state.text)}onChange(s){this.setState({text:s.target.value})}render(){const s={...Mt.dropzone,...this.state.imageStatus==="accepted"?Mt.dropzoneAccepted:this.state.imageStatus==="rejected"?Mt.dropzoneRejected:void 0};return m.jsxs(Ut,{onClose:()=>!1,maxWidth:"lg",sx:{"& .MuiDialog-paper":Mt.dialog},fullWidth:!0,open:!0,"aria-labelledby":"import-dialog-title",children:[m.jsx(ss,{id:"import-dialog-title",children:x.I18n.t("Import blocks")}),m.jsxs(qt,{style:Mt.fullHeight,children:[m.jsx("textarea",{autoFocus:!0,id:"import-text-area",placeholder:x.I18n.t("Paste your blocks here"),style:{...Mt.textArea,color:this.props.themeType==="dark"?"#ffffff":"#000000"},onChange:i=>this.onChange(i),value:this.state.text}),m.jsx(Lw,{maxSize:5e7,onDrop:(i,r)=>{var l,c,d;i.length?this.handleDropFile(i):window.alert(((d=(c=(l=r==null?void 0:r[0])==null?void 0:l.errors)==null?void 0:c[0])==null?void 0:d.message)||x.I18n.t("ra_Cannot upload"))},multiple:!1,accept:{"text/plain":[],"text/xml":[],"application/xml":[]},children:({getRootProps:i,getInputProps:r,isDragActive:l,isDragReject:c})=>c?(this.state.imageStatus!=="rejected"&&this.setState({imageStatus:"rejected"}),m.jsxs("div",{style:{...s,...Mt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Mt.text,children:x.I18n.t("Some files will be rejected")},"text"),m.jsx(Yc,{style:{...Mt.icon,...Mt.iconError}},"icon")]})):l?(this.state.imageStatus!=="accepted"&&this.setState({imageStatus:"accepted"}),m.jsxs("div",{style:{...s,...Mt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Mt.text,children:x.I18n.t("All files will be accepted")},"text"),m.jsx(Pw,{style:{...Mt.icon,...Mt.iconOk}},"icon")]})):(this.state.imageStatus!=="wait"&&this.setState({imageStatus:"wait"}),m.jsxs("div",{style:{...s,...Mt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Mt.text,children:x.I18n.t("Drop some files here or click...")},"text"),m.jsx(Bw,{style:Mt.icon},"icon")]}))})]}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",disabled:!this.state.text,onClick:()=>this.handleOk(),color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Import")}),m.jsx(He,{color:"grey",variant:"contained",onClick:()=>this.handleCancel(),startIcon:m.jsx(so,{}),children:x.I18n.t("Close")})]})]})}}const Fe=window.Blockly;class vg extends Error{constructor(){super("The field has not yet been attached to its input. Call appendField to attach it.")}}class Oc extends Fe.Field{textGroup=null;borderRect_=null;maxLines_=1/0;isOverflowedY_=!1;constructor(s,i,r){super(s),s!==Symbol("SKIP_SETUP")&&(r&&this.configure_(r),this.SERIALIZABLE=!0,this.setValue((s==null?void 0:s.toString())||""),i&&this.setValidator(i))}configure_(s){super.configure_(s),s.maxLines&&this.setMaxLines(s.maxLines)}toXml(s){return s.textContent=this.getValue().replace(/\n/g," "),s}fromXml(s){this.setValue(s.textContent.replace(/ /g,` -`))}saveState(){const s=this.saveLegacyState(Oc);return s!==null?s:this.getValue()}loadState(s){this.loadLegacyState(Fe.Field,s)||this.setValue(s)}initView(){this.createBorderRect_(),this.textGroup=Fe.utils.dom.createSvgElement(Fe.utils.Svg.G,{class:"blocklyEditableText"},this.fieldGroup_)}onHtmlInputKeyDownSuper_(s){s.key==="Enter"?(Fe.WidgetDiv.hideIfOwner(this),Fe.dropDownDiv.hideWithoutAnimation()):s.key==="Escape"?(this.setValue(this.htmlInput_.getAttribute("data-untyped-default-value"),!1),Fe.WidgetDiv.hideIfOwner(this),Fe.dropDownDiv.hideWithoutAnimation()):s.key==="Tab"&&(Fe.WidgetDiv.hideIfOwner(this),Fe.dropDownDiv.hideWithoutAnimation(),this.sourceBlock_.tab(this,!s.shiftKey),s.preventDefault())}onHtmlInputChange_(s){const i=this.value_;this.setValue(this.getValueFromEditorText_(this.htmlInput_.value),!1),this.sourceBlock_&&Fe.Events.isEnabled()&&this.value_!==i&&Fe.Events.fire(new(Fe.Events.get("block_field_intermediate_change"))(this.sourceBlock_,this.name||null,i,this.value_))}onFinishEditing_(s){}getValueFromEditorText_(s){return s}bindInputEvents_(s){this.onKeyDownWrapper_=Fe.browserEvents.conditionalBind(s,"keydown",this,this.onHtmlInputKeyDown_),this.onKeyInputWrapper_=Fe.browserEvents.conditionalBind(s,"input",this,this.onHtmlInputChange_)}getDisplayText_(){const s=this.getSourceBlock();if(!s)throw new Error("The field has not yet been attached to its input. Call appendField to attach it.");let i=this.getText();if(!i)return Fe.Field.NBSP;const r=i.split(` -`);i="";const l=this.isOverflowedY_?this.maxLines_:r.length;for(let c=0;cthis.maxDisplayLength?d=`${d.substring(0,this.maxDisplayLength-4)}...`:this.isOverflowedY_&&c===l-1&&(d=`${d.substring(0,d.length-3)}...`),d=d.replace(/\s/g,Fe.Field.NBSP),i+=d,c!==l-1&&(i+=` +`),r($e.TOOLBOX,Ws,Jy);var vT="11.2.2",yT=xe.INPUT_VALUE,_T=xe.OUTPUT_VALUE,wT=xe.NEXT_STATEMENT,kT=xe.PREVIOUS_STATEMENT,CT=Ge.TOP,TT=Ge.BOTTOM,ST=Ge.LEFT,ET=Ge.RIGHT;gn.prototype.newBlock=function(e,t){return new Uo(this,e,t)},cs.prototype.newBlock=function(e,t){return new $s(this,e,t)},gn.prototype.newComment=function(e){return new El(this,e)},cs.prototype.newComment=function(e){return new Il(this,e)},cs.newTrashcan=function(e){return new Gv(e)},vo.prototype.newWorkspaceSvg=function(e){return new cs(e)},i.Names$$module$build$src$core$names.prototype.populateProcedures=function(e){e=qa(e),e=e[0].concat(e[1]);for(let t=0;t{this.setState({popper:x.I18n.t("Copied"),anchorEl:i}),setTimeout(()=>this.setState({popper:"",anchorEl:null}),1e3)},50)}render(){const s=new Blob([this.props.text],{type:"application/xml"}),i=`${this.props.scriptId.substring(10)}.xml`;return m.jsxs(Pt,{onClose:()=>!1,maxWidth:"lg",sx:{"& .MuiDialog-paper":Wr.dialog},fullWidth:!0,open:!0,"aria-labelledby":"export-dialog-title",children:[m.jsx(Xt,{id:"export-dialog-title",children:x.I18n.t("Export selected blocks")}),m.jsx(Wt,{style:Wr.overflowY,children:m.jsx("pre",{id:"export-text",style:{...Wr.textArea,...this.props.themeType==="dark"?void 0:Wr.textAreaLight},children:this.props.text})}),m.jsxs(Bt,{children:[m.jsx(Ue,{variant:"contained",color:"secondary",startIcon:m.jsx(kc,{}),children:m.jsx("a",{download:i,target:"_blank",rel:"noreferrer",href:URL.createObjectURL(s),style:{textDecoration:"inherit",color:"inherit"},children:x.I18n.t("Download as file")})}),m.jsx(Ue,{variant:"contained",onClick:r=>this.onCopy(r),color:"secondary",startIcon:m.jsx(cx,{}),children:x.I18n.t("Copy to clipboard")}),m.jsx(Ue,{variant:"contained",onClick:()=>this.handleCancel(),color:"primary",startIcon:m.jsx(so,{}),children:x.I18n.t("Close")}),m.jsx(YT,{id:"popper",style:{zIndex:1e4},open:!!this.state.popper,placement:"top",anchorEl:this.state.anchorEl,transition:!0,children:({TransitionProps:r})=>m.jsx(JT,{...r,timeout:350,children:m.jsx(Rw,{children:m.jsx("p",{style:Wr.typography,children:this.state.popper})})})}),m.jsx("textarea",{id:"copy_input",readOnly:!0,style:{position:"absolute",left:-9999},tabIndex:-1,"aria-hidden":!0,value:this.props.text})]})]},"export-dialog")}}const Mt={textArea:{width:"calc(100% - 10px)",height:"calc(80% - 20px)",resize:"none",fontFamily:"monospace",fontSize:"1em",backgroundColor:"transparent",borderRadius:4,outline:"none"},dropzone:{marginTop:20,width:"100%",borderWidth:5,borderStyle:"dashed",borderColor:"#d0cccc",textAlign:"center",boxSizing:"border-box",paddingTop:45,borderRadius:10,height:"calc(100% - 10px)"},dropzoneDiv:{width:"100%",height:"20%",position:"relative"},dropzoneRejected:{borderColor:"#970000"},dropzoneAccepted:{borderColor:"#17cd02"},icon:{height:"80%",width:"80%",opacity:.3,color:"#eeeeee",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",zIndex:0},iconError:{color:"#ffc3c6"},iconOk:{color:"#aaeebc"},text:{top:"50%",left:"50%",transform:"translate(-50%,-50%)",color:"#868686",position:"absolute",zIndex:1},dialog:{height:"95%"},fullHeight:{height:"100%",overflow:"hidden"}};class Gm extends _e.Component{constructor(s){super(s),this.state={text:"",imageStatus:"",error:""}}componentDidMount(){setTimeout(()=>{var s;try{(s=window.document.getElementById("import-text-area"))==null||s.focus()}catch{}},100)}static readFileDataUrl(s,i){const r=new FileReader;r.onload=()=>{i(null,{data:r.result,name:s.name})},r.onabort=()=>{console.error("file reading was aborted"),i(x.I18n.t("file reading was aborted"))},r.onerror=l=>{console.error("file reading has failed"),i(x.I18n.t("file reading has failed: %s",l))},r.readAsText(s)}handleDropFile(s){if(!(s!=null&&s.length))return;const i=s[s.length-1];i&&Gm.readFileDataUrl(i,(r,l)=>{var c;r||!l?this.setState({error:r||"No data"}):this.setState({text:((c=l.data)==null?void 0:c.toString())||""})})}handleCancel(){this.props.onClose()}handleOk(){this.props.onClose(this.state.text)}onChange(s){this.setState({text:s.target.value})}render(){const s={...Mt.dropzone,...this.state.imageStatus==="accepted"?Mt.dropzoneAccepted:this.state.imageStatus==="rejected"?Mt.dropzoneRejected:void 0};return m.jsxs(Pt,{onClose:()=>!1,maxWidth:"lg",sx:{"& .MuiDialog-paper":Mt.dialog},fullWidth:!0,open:!0,"aria-labelledby":"import-dialog-title",children:[m.jsx(Xt,{id:"import-dialog-title",children:x.I18n.t("Import blocks")}),m.jsxs(Wt,{style:Mt.fullHeight,children:[m.jsx("textarea",{autoFocus:!0,id:"import-text-area",placeholder:x.I18n.t("Paste your blocks here"),style:{...Mt.textArea,color:this.props.themeType==="dark"?"#ffffff":"#000000"},onChange:i=>this.onChange(i),value:this.state.text}),m.jsx(Lw,{maxSize:5e7,onDrop:(i,r)=>{var l,c,d;i.length?this.handleDropFile(i):window.alert(((d=(c=(l=r==null?void 0:r[0])==null?void 0:l.errors)==null?void 0:c[0])==null?void 0:d.message)||x.I18n.t("ra_Cannot upload"))},multiple:!1,accept:{"text/plain":[],"text/xml":[],"application/xml":[]},children:({getRootProps:i,getInputProps:r,isDragActive:l,isDragReject:c})=>c?(this.state.imageStatus!=="rejected"&&this.setState({imageStatus:"rejected"}),m.jsxs("div",{style:{...s,...Mt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Mt.text,children:x.I18n.t("Some files will be rejected")},"text"),m.jsx(Yc,{style:{...Mt.icon,...Mt.iconError}},"icon")]})):l?(this.state.imageStatus!=="accepted"&&this.setState({imageStatus:"accepted"}),m.jsxs("div",{style:{...s,...Mt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Mt.text,children:x.I18n.t("All files will be accepted")},"text"),m.jsx(Pw,{style:{...Mt.icon,...Mt.iconOk}},"icon")]})):(this.state.imageStatus!=="wait"&&this.setState({imageStatus:"wait"}),m.jsxs("div",{style:{...s,...Mt.dropzoneDiv},...i(),children:[m.jsx("input",{...r()}),m.jsx("span",{style:Mt.text,children:x.I18n.t("Drop some files here or click...")},"text"),m.jsx(Bw,{style:Mt.icon},"icon")]}))})]}),m.jsxs(Bt,{children:[m.jsx(Ue,{variant:"contained",disabled:!this.state.text,onClick:()=>this.handleOk(),color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Import")}),m.jsx(Ue,{color:"grey",variant:"contained",onClick:()=>this.handleCancel(),startIcon:m.jsx(so,{}),children:x.I18n.t("Close")})]})]})}}const je=window.Blockly;class vg extends Error{constructor(){super("The field has not yet been attached to its input. Call appendField to attach it.")}}class Rc extends je.Field{textGroup=null;borderRect_=null;maxLines_=1/0;isOverflowedY_=!1;constructor(s,i,r){super(s),s!==Symbol("SKIP_SETUP")&&(r&&this.configure_(r),this.SERIALIZABLE=!0,this.setValue((s==null?void 0:s.toString())||""),i&&this.setValidator(i))}configure_(s){super.configure_(s),s.maxLines&&this.setMaxLines(s.maxLines)}toXml(s){return s.textContent=this.getValue().replace(/\n/g," "),s}fromXml(s){this.setValue(s.textContent.replace(/ /g,` +`))}saveState(){const s=this.saveLegacyState(Rc);return s!==null?s:this.getValue()}loadState(s){this.loadLegacyState(je.Field,s)||this.setValue(s)}initView(){this.createBorderRect_(),this.textGroup=je.utils.dom.createSvgElement(je.utils.Svg.G,{class:"blocklyEditableText"},this.fieldGroup_)}onHtmlInputKeyDownSuper_(s){s.key==="Enter"?(je.WidgetDiv.hideIfOwner(this),je.dropDownDiv.hideWithoutAnimation()):s.key==="Escape"?(this.setValue(this.htmlInput_.getAttribute("data-untyped-default-value"),!1),je.WidgetDiv.hideIfOwner(this),je.dropDownDiv.hideWithoutAnimation()):s.key==="Tab"&&(je.WidgetDiv.hideIfOwner(this),je.dropDownDiv.hideWithoutAnimation(),this.sourceBlock_.tab(this,!s.shiftKey),s.preventDefault())}onHtmlInputChange_(s){const i=this.value_;this.setValue(this.getValueFromEditorText_(this.htmlInput_.value),!1),this.sourceBlock_&&je.Events.isEnabled()&&this.value_!==i&&je.Events.fire(new(je.Events.get("block_field_intermediate_change"))(this.sourceBlock_,this.name||null,i,this.value_))}onFinishEditing_(s){}getValueFromEditorText_(s){return s}bindInputEvents_(s){this.onKeyDownWrapper_=je.browserEvents.conditionalBind(s,"keydown",this,this.onHtmlInputKeyDown_),this.onKeyInputWrapper_=je.browserEvents.conditionalBind(s,"input",this,this.onHtmlInputChange_)}getDisplayText_(){const s=this.getSourceBlock();if(!s)throw new Error("The field has not yet been attached to its input. Call appendField to attach it.");let i=this.getText();if(!i)return je.Field.NBSP;const r=i.split(` +`);i="";const l=this.isOverflowedY_?this.maxLines_:r.length;for(let c=0;cthis.maxDisplayLength?d=`${d.substring(0,this.maxDisplayLength-4)}...`:this.isOverflowedY_&&c===l-1&&(d=`${d.substring(0,d.length-3)}...`),d=d.replace(/\s/g,je.Field.NBSP),i+=d,c!==l-1&&(i+=` `)}return s.RTL&&(i+="‏"),i}doValueUpdate_(s){super.doValueUpdate_(s),this.value_!==null&&(this.isOverflowedY_=this.value_.split(` `).length>this.maxLines_)}render_(){const s=this.getSourceBlock();if(!s)throw new Error("The field has not yet been attached to its input. Call appendField to attach it.");let i;const r=this.textGroup;for(;i=r.firstChild;)r.removeChild(i);const l=this.getConstants();if(!l)throw Error("Constants not found");const c=this.getDisplayText_().split(` -`);let d=0;for(let h=0;hd&&(d=b),h+=s.FIELD_TEXT_HEIGHT+(p>0?s.FIELD_BORDER_RECT_Y_PADDING:0)}if(this.isBeingEdited_){const p=String(this.value_).split(` -`),f=Fe.utils.dom.createSvgElement(Fe.utils.Svg.TEXT,{class:"blocklyText blocklyMultilineText"});for(let w=0;wthis.maxDisplayLength&&(p[w]=p[w].substring(0,this.maxDisplayLength)),f.textContent=p[w];const v=Fe.utils.dom.getFastTextWidth(f,r,l,c);v>d&&(d=v)}const b=this.htmlInput_,y=b.offsetWidth-b.clientWidth;d+=y}this.borderRect_&&(h+=s.FIELD_BORDER_RECT_Y_PADDING*2,d+=s.FIELD_BORDER_RECT_X_PADDING*2+1,this.borderRect_.setAttribute("width",`${d}`),this.borderRect_.setAttribute("height",`${h}`)),this.size_.width=d,this.size_.height=h,this.positionBorderRect_()}showInlineEditor_(s){const i=this.getSourceBlock();if(!i)throw new vg;Fe.WidgetDiv.show(this,i.RTL,this.widgetDispose_.bind(this),this.workspace_),this.htmlInput_=this.widgetCreate_(),this.isBeingEdited_=!0,this.valueWhenEditorWasOpened_=this.value_,s||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())}getEditorText_(s){return`${s}`}getScaledBBox(){let s,i,r;const l=this.getSourceBlock();if(!l)throw new vg;if(this.isFullBlockField()){const c=this.sourceBlock_.getHeightWidth(),d=l.workspace.scale;r=this.getAbsoluteXY_(),s=(c.width+1)*d,i=(c.height+1)*d,Fe.utils.userAgent.GECKO?(r.x+=1.5*d,r.y+=1.5*d):(r.x-=.5*d,r.y-=.5*d)}else{const c=this.borderRect_.getBoundingClientRect();r=Fe.utils.style.getPageOffset(this.borderRect_),s=c.width,i=c.height}return new Fe.utils.Rect(r.y,r.y+i,r.x,r.x+s)}resizeEditor_(){Fe.renderManagement.finishQueuedRenders().then(()=>{const s=this.getSourceBlock();if(!s)throw new vg;const i=Fe.WidgetDiv.getDiv(),r=this.getScaledBBox();i.style.width=`${r.right-r.left}px`,i.style.height=`${r.bottom-r.top}px`;const l=s.RTL?r.right-i.offsetWidth:r.left,c=r.top;i.style.left=`${l}px`,i.style.top=`${c}px`})}unbindInputEvents_(){this.onKeyDownWrapper_&&(Fe.browserEvents.unbind(this.onKeyDownWrapper_),this.onKeyDownWrapper_=null),this.onKeyInputWrapper_&&(Fe.browserEvents.unbind(this.onKeyInputWrapper_),this.onKeyInputWrapper_=null)}getClickTarget_(){return this.clickTarget_||this.getSvgRoot()}widgetDispose_(){this.isBeingEdited_=!1,this.isTextValid_=!0,this.forceRerender(),this.onFinishEditing_(this.value_),this.sourceBlock_&&Fe.Events.isEnabled()&&this.valueWhenEditorWasOpened_!==null&&this.valueWhenEditorWasOpened_!==this.value_&&(Fe.Events.fire(new(Fe.Events.get("change"))(this.sourceBlock_,"field",this.name||null,this.valueWhenEditorWasOpened_,this.value_)),this.valueWhenEditorWasOpened_=null),Fe.Events.setGroup(!1),this.unbindInputEvents_();const s=Fe.WidgetDiv.getDiv().style;s.width="auto",s.height="auto",s.fontSize="",s.transition="",s.boxShadow="",this.htmlInput_=null;const i=this.getClickTarget_();if(!i)throw new Error("A click target has not been set.");Fe.utils.dom.removeClass(i,"editing")}showEditor_(s,i){this.workspace_=this.sourceBlock_.workspace,!i&&this.workspace_.options.modalInputs&&(Fe.utils.userAgent.MOBILE||Fe.utils.userAgent.ANDROID||Fe.utils.userAgent.IPAD)?this.showPromptEditor_():this.showInlineEditor_(!!i),this.forceRerender()}widgetCreate_(){const s=Fe.WidgetDiv.getDiv(),i=this.workspace_.getScale(),r=this.getConstants();if(!r)throw Error("Constants not found");const l=document.createElement("textarea");l.className="blocklyHtmlInput blocklyHtmlTextAreaInput",l.setAttribute("spellcheck",String(this.spellcheck_));const c=`${r.FIELD_TEXT_FONTSIZE*i}pt`;s.style.fontSize=c,l.style.fontSize=c;const d=`${Fe.FieldTextInput.BORDERRADIUS*i}px`;l.style.borderRadius=d;const h=r.FIELD_BORDER_RECT_X_PADDING*i,p=r.FIELD_BORDER_RECT_Y_PADDING*i/2;l.style.padding=`${p}px ${h}px ${p}px ${h}px`;const f=r.FIELD_TEXT_HEIGHT+r.FIELD_BORDER_RECT_Y_PADDING;return l.style.lineHeight=`${f*i}px`,s.appendChild(l),l.value=l.defaultValue=this.getEditorText_(this.value_),l.setAttribute("data-untyped-default-value",String(this.value_)),l.setAttribute("data-old-value",""),Fe.utils.userAgent.GECKO?setTimeout(this.resizeEditor_.bind(this),0):this.resizeEditor_(),this.bindInputEvents_(l),l}setMaxLines(s){typeof s=="number"&&s>0&&s!==this.maxLines_&&(this.maxLines_=s,this.forceRerender())}getMaxLines(){return this.maxLines_}onHtmlInputKeyDown_(s){s.key!=="Enter"&&this.onHtmlInputKeyDownSuper_(s)}static fromJson(s){const i=Fe.utils.parsing.replaceMessageReferences(s.text);return new this(i,void 0,s)}}Fe.Css.register(` +`);let d=0;for(let h=0;hd&&(d=b),h+=s.FIELD_TEXT_HEIGHT+(p>0?s.FIELD_BORDER_RECT_Y_PADDING:0)}if(this.isBeingEdited_){const p=String(this.value_).split(` +`),f=je.utils.dom.createSvgElement(je.utils.Svg.TEXT,{class:"blocklyText blocklyMultilineText"});for(let w=0;wthis.maxDisplayLength&&(p[w]=p[w].substring(0,this.maxDisplayLength)),f.textContent=p[w];const v=je.utils.dom.getFastTextWidth(f,r,l,c);v>d&&(d=v)}const b=this.htmlInput_,y=b.offsetWidth-b.clientWidth;d+=y}this.borderRect_&&(h+=s.FIELD_BORDER_RECT_Y_PADDING*2,d+=s.FIELD_BORDER_RECT_X_PADDING*2+1,this.borderRect_.setAttribute("width",`${d}`),this.borderRect_.setAttribute("height",`${h}`)),this.size_.width=d,this.size_.height=h,this.positionBorderRect_()}showInlineEditor_(s){const i=this.getSourceBlock();if(!i)throw new vg;je.WidgetDiv.show(this,i.RTL,this.widgetDispose_.bind(this),this.workspace_),this.htmlInput_=this.widgetCreate_(),this.isBeingEdited_=!0,this.valueWhenEditorWasOpened_=this.value_,s||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())}getEditorText_(s){return`${s}`}getScaledBBox(){let s,i,r;const l=this.getSourceBlock();if(!l)throw new vg;if(this.isFullBlockField()){const c=this.sourceBlock_.getHeightWidth(),d=l.workspace.scale;r=this.getAbsoluteXY_(),s=(c.width+1)*d,i=(c.height+1)*d,je.utils.userAgent.GECKO?(r.x+=1.5*d,r.y+=1.5*d):(r.x-=.5*d,r.y-=.5*d)}else{const c=this.borderRect_.getBoundingClientRect();r=je.utils.style.getPageOffset(this.borderRect_),s=c.width,i=c.height}return new je.utils.Rect(r.y,r.y+i,r.x,r.x+s)}resizeEditor_(){je.renderManagement.finishQueuedRenders().then(()=>{const s=this.getSourceBlock();if(!s)throw new vg;const i=je.WidgetDiv.getDiv(),r=this.getScaledBBox();i.style.width=`${r.right-r.left}px`,i.style.height=`${r.bottom-r.top}px`;const l=s.RTL?r.right-i.offsetWidth:r.left,c=r.top;i.style.left=`${l}px`,i.style.top=`${c}px`})}unbindInputEvents_(){this.onKeyDownWrapper_&&(je.browserEvents.unbind(this.onKeyDownWrapper_),this.onKeyDownWrapper_=null),this.onKeyInputWrapper_&&(je.browserEvents.unbind(this.onKeyInputWrapper_),this.onKeyInputWrapper_=null)}getClickTarget_(){return this.clickTarget_||this.getSvgRoot()}widgetDispose_(){this.isBeingEdited_=!1,this.isTextValid_=!0,this.forceRerender(),this.onFinishEditing_(this.value_),this.sourceBlock_&&je.Events.isEnabled()&&this.valueWhenEditorWasOpened_!==null&&this.valueWhenEditorWasOpened_!==this.value_&&(je.Events.fire(new(je.Events.get("change"))(this.sourceBlock_,"field",this.name||null,this.valueWhenEditorWasOpened_,this.value_)),this.valueWhenEditorWasOpened_=null),je.Events.setGroup(!1),this.unbindInputEvents_();const s=je.WidgetDiv.getDiv().style;s.width="auto",s.height="auto",s.fontSize="",s.transition="",s.boxShadow="",this.htmlInput_=null;const i=this.getClickTarget_();if(!i)throw new Error("A click target has not been set.");je.utils.dom.removeClass(i,"editing")}showEditor_(s,i){this.workspace_=this.sourceBlock_.workspace,!i&&this.workspace_.options.modalInputs&&(je.utils.userAgent.MOBILE||je.utils.userAgent.ANDROID||je.utils.userAgent.IPAD)?this.showPromptEditor_():this.showInlineEditor_(!!i),this.forceRerender()}widgetCreate_(){const s=je.WidgetDiv.getDiv(),i=this.workspace_.getScale(),r=this.getConstants();if(!r)throw Error("Constants not found");const l=document.createElement("textarea");l.className="blocklyHtmlInput blocklyHtmlTextAreaInput",l.setAttribute("spellcheck",String(this.spellcheck_));const c=`${r.FIELD_TEXT_FONTSIZE*i}pt`;s.style.fontSize=c,l.style.fontSize=c;const d=`${je.FieldTextInput.BORDERRADIUS*i}px`;l.style.borderRadius=d;const h=r.FIELD_BORDER_RECT_X_PADDING*i,p=r.FIELD_BORDER_RECT_Y_PADDING*i/2;l.style.padding=`${p}px ${h}px ${p}px ${h}px`;const f=r.FIELD_TEXT_HEIGHT+r.FIELD_BORDER_RECT_Y_PADDING;return l.style.lineHeight=`${f*i}px`,s.appendChild(l),l.value=l.defaultValue=this.getEditorText_(this.value_),l.setAttribute("data-untyped-default-value",String(this.value_)),l.setAttribute("data-old-value",""),je.utils.userAgent.GECKO?setTimeout(this.resizeEditor_.bind(this),0):this.resizeEditor_(),this.bindInputEvents_(l),l}setMaxLines(s){typeof s=="number"&&s>0&&s!==this.maxLines_&&(this.maxLines_=s,this.forceRerender())}getMaxLines(){return this.maxLines_}onHtmlInputKeyDown_(s){s.key!=="Enter"&&this.onHtmlInputKeyDownSuper_(s)}static fromJson(s){const i=je.utils.parsing.replaceMessageReferences(s.text);return new this(i,void 0,s)}}je.Css.register(` .blocklyHtmlTextAreaInput { font-family: monospace; resize: none; @@ -1027,7 +1027,7 @@ Blockly.YourGeneratorName.nameDB_.setVariableMap(workspace.getVariableMap());`), .blocklyHtmlTextAreaInputOverflowedY { overflow-y: scroll; } -`);const yC="text_multiline",oO={type:yC,message0:"%1 %2",args0:[{type:"field_image",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAARCAYAAADpPU2iAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAdhgAAHYYBXaITgQAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS42/U4J6AAAAP1JREFUOE+Vks0KQUEYhjmRIja4ABtZ2dm5A3t3Ia6AUm7CylYuQRaUhZSlLZJiQbFAyRnPN33y01HOW08z8873zpwzM4F3GWOCruvGIE4/rLaV+Nq1hVGMBqzhqlxgCys4wJA65xnogMHsQ5lujnYHTejBBCK2mE4abjCgMGhNxHgDFWjDSG07kdfVa2pZMf4ZyMAdWmpZMfYOsLiDMYMjlMB+K613QISRhTnITnsYg5yUd0DETmEoMlkFOeIT/A58iyK5E18BuTBfgYXfwNJv4P9/oEBerLylOnRhygmGdPpTTBZAPkde61lbQe4moWUvYUZYLfUNftIY4zwA5X2Z9AYnQrEAAAAASUVORK5CYII=",width:12,height:17,alt:"¶"},{type:"field_multilinetext",name:"TEXT",text:""}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_TEXT_HELPURL}",tooltip:"%{BKY_TEXT_TEXT_TOOLTIP}",extensions:["parent_tooltip_when_inline"]};function iO(a,s){const i=s.multiline_quote_(a.getFieldValue("TEXT")),r=i.indexOf("+")!==-1?6.2:0;return[i,r]}const nO=window.Blockly.common.createBlockDefinitionsFromJsonArray([oO]);nO[yC];const Je=window.Blockly;class lm extends Je.Field{picker=null;highlightedIndex=null;boundEvents=[];SERIALIZABLE=!0;CURSOR="default";isDirty_=!1;colours=["#ffffff","#cccccc","#c0c0c0","#999999","#666666","#333333","#000000","#ffcccc","#ff6666","#ff0000","#cc0000","#990000","#660000","#330000","#ffcc99","#ff9966","#ff9900","#ff6600","#cc6600","#993300","#663300","#ffff99","#ffff66","#ffcc66","#ffcc33","#cc9933","#996633","#663333","#ffffcc","#ffff33","#ffff00","#ffcc00","#999900","#666600","#333300","#99ff99","#66ff99","#33ff33","#33cc00","#009900","#006600","#003300","#99ffff","#33ffff","#66cccc","#00cccc","#339999","#336666","#003333","#ccffff","#66ffff","#33ccff","#3366ff","#3333ff","#000099","#000066","#ccccff","#9999ff","#6666cc","#6633ff","#6600cc","#333399","#330099","#ffccff","#ff99ff","#cc66cc","#cc33cc","#993399","#663366","#330033"];titles=[];columns=7;constructor(s,i,r){super(s),s!==Symbol("SKIP_SETUP")&&(r&&this.configure_(r),this.setValue(s),i&&this.setValidator(i))}configure_(s){super.configure_(s),s.colourOptions&&(this.colours=s.colourOptions),s.colourTitles&&(this.titles=s.colourTitles),s.columns&&(this.columns=s.columns)}initView(){const s=this.getConstants();if(!s)throw Error("Constants not found");this.size_=new Je.utils.Size(s.FIELD_COLOUR_DEFAULT_WIDTH,s.FIELD_COLOUR_DEFAULT_HEIGHT),this.createBorderRect_(),this.getBorderRect().style.fillOpacity="1",this.getBorderRect().setAttribute("stroke","#fff"),this.isFullBlockField()&&(this.clickTarget_=this.sourceBlock_.getSvgRoot())}isFullBlockField(){if(!this.getSourceBlock())throw new Je.UnattachedFieldError;const i=this.getConstants();return this.blockIsSimpleReporter()&&!!(i!=null&&i.FIELD_COLOUR_FULL_BLOCK)}blockIsSimpleReporter(){const s=this.getSourceBlock();if(!s)throw new Je.UnattachedFieldError;if(!s.outputConnection)return!1;for(const i of s.inputList)if(i.connection||i.fieldRow.length>1)return!1;return!0}applyColour(){const s=this.getSourceBlock();if(!s)throw new Je.UnattachedFieldError;if(!this.fieldGroup_)return;const i=this.borderRect_;if(!i)throw new Error("The border rect has not been initialized");this.isFullBlockField()?(i.style.display="none",s.pathObject.svgPath.setAttribute("fill",this.getValue()),s.pathObject.svgPath.setAttribute("stroke","#fff")):(i.style.display="block",i.style.fill=this.getValue())}getSize(){var s;return(s=this.getConstants())!=null&&s.FIELD_COLOUR_FULL_BLOCK&&(this.render_(),this.isDirty_=!1),super.getSize()}render_(){super.render_();const s=this.getSourceBlock();if(!s)throw new Je.UnattachedFieldError;s.applyColour()}updateSize_(s){const i=this.getConstants();if(!i)return;let r,l;this.isFullBlockField()?(r=(s??0)*2,l=i.FIELD_TEXT_HEIGHT):(r=i.FIELD_COLOUR_DEFAULT_WIDTH,l=i.FIELD_COLOUR_DEFAULT_HEIGHT),this.size_.height=l,this.size_.width=r,this.positionBorderRect_()}doClassValidation_(s){return typeof s!="string"?null:Je.utils.colour.parse(s)}getText(){let s=this.value_;return/^#(.)\1(.)\2(.)\3$/.test(s)&&(s=`#${s[1]}${s[3]}${s[5]}`),s}setColours(s,i){return this.colours=s,i&&(this.titles=i),this}setColumns(s){return this.columns=s,this}showEditor_(){if(this.dropdownCreate(),!this.picker)throw Error("Picker not found");Je.DropDownDiv.getContentDiv().appendChild(this.picker),Je.DropDownDiv.showPositionedByField(this,this.dropdownDispose.bind(this)),this.picker.focus({preventScroll:!0})}onClick(s){const i=s.target,r=i==null?void 0:i.getAttribute("data-colour");r!==null&&(this.setValue(r),Je.DropDownDiv.hideIfOwner(this))}onKeyDown(s){let i=!0,r;switch(s.key){case"ArrowUp":this.moveHighlightBy(0,-1);break;case"ArrowDown":this.moveHighlightBy(0,1);break;case"ArrowLeft":this.moveHighlightBy(-1,0);break;case"ArrowRight":this.moveHighlightBy(1,0);break;case"Enter":if(r=this.getHighlighted(),r){const l=r.getAttribute("data-colour");l!==null&&this.setValue(l)}Je.DropDownDiv.hideWithoutAnimation();break;default:i=!1}i&&s.stopPropagation()}moveHighlightBy(s,i){if(!this.highlightedIndex)return;const r=this.colours,l=this.columns;let c=this.highlightedIndex%l,d=Math.floor(this.highlightedIndex/l);c+=s,d+=i,s<0?c<0&&d>0?(c=l-1,d--):c<0&&(c=0):s>0?c>l-1&&dl-1&&c--:i<0?d<0&&(d=0):i>0&&d>Math.floor(r.length/l)-1&&(d=Math.floor(r.length/l)-1);const h=this.picker.childNodes[d].childNodes[c],p=d*l+c;this.setHighlightedCell(h,p)}onMouseMove(s){const i=s.target,r=i&&Number(i.getAttribute("data-index"));r!==null&&r!==this.highlightedIndex&&this.setHighlightedCell(i,r)}onMouseEnter(){var s;(s=this.picker)==null||s.focus({preventScroll:!0})}onMouseLeave(){var i;(i=this.picker)==null||i.blur();const s=this.getHighlighted();s&&Je.utils.dom.removeClass(s,"blocklyColourHighlighted")}getHighlighted(){var l;if(!this.highlightedIndex)return null;const s=this.highlightedIndex%this.columns,i=Math.floor(this.highlightedIndex/this.columns),r=(l=this.picker)==null?void 0:l.childNodes[i];return r?r.childNodes[s]:null}setHighlightedCell(s,i){const r=this.getHighlighted();r&&Je.utils.dom.removeClass(r,"blocklyColourHighlighted"),Je.utils.dom.addClass(s,"blocklyColourHighlighted"),this.highlightedIndex=i;const l=s.getAttribute("id");l&&this.picker&&Je.utils.aria.setState(this.picker,Je.utils.aria.State.ACTIVEDESCENDANT,l)}dropdownCreate(){const s=this.columns,i=this.colours,r=this.getValue(),l=document.createElement("table");l.className="blocklyColourTable",l.tabIndex=0,l.dir="ltr",Je.utils.aria.setRole(l,Je.utils.aria.Role.GRID),Je.utils.aria.setState(l,Je.utils.aria.State.EXPANDED,!0),Je.utils.aria.setState(l,Je.utils.aria.State.ROWCOUNT,Math.floor(i.length/s)),Je.utils.aria.setState(l,Je.utils.aria.State.COLCOUNT,s);let c=null;for(let d=0;d1)return!1;return!0}applyColour(){const s=this.getSourceBlock();if(!s)throw new Je.UnattachedFieldError;if(!this.fieldGroup_)return;const i=this.borderRect_;if(!i)throw new Error("The border rect has not been initialized");this.isFullBlockField()?(i.style.display="none",s.pathObject.svgPath.setAttribute("fill",this.getValue()),s.pathObject.svgPath.setAttribute("stroke","#fff")):(i.style.display="block",i.style.fill=this.getValue())}getSize(){var s;return(s=this.getConstants())!=null&&s.FIELD_COLOUR_FULL_BLOCK&&(this.render_(),this.isDirty_=!1),super.getSize()}render_(){super.render_();const s=this.getSourceBlock();if(!s)throw new Je.UnattachedFieldError;s.applyColour()}updateSize_(s){const i=this.getConstants();if(!i)return;let r,l;this.isFullBlockField()?(r=(s??0)*2,l=i.FIELD_TEXT_HEIGHT):(r=i.FIELD_COLOUR_DEFAULT_WIDTH,l=i.FIELD_COLOUR_DEFAULT_HEIGHT),this.size_.height=l,this.size_.width=r,this.positionBorderRect_()}doClassValidation_(s){return typeof s!="string"?null:Je.utils.colour.parse(s)}getText(){let s=this.value_;return/^#(.)\1(.)\2(.)\3$/.test(s)&&(s=`#${s[1]}${s[3]}${s[5]}`),s}setColours(s,i){return this.colours=s,i&&(this.titles=i),this}setColumns(s){return this.columns=s,this}showEditor_(){if(this.dropdownCreate(),!this.picker)throw Error("Picker not found");Je.DropDownDiv.getContentDiv().appendChild(this.picker),Je.DropDownDiv.showPositionedByField(this,this.dropdownDispose.bind(this)),this.picker.focus({preventScroll:!0})}onClick(s){const i=s.target,r=i==null?void 0:i.getAttribute("data-colour");r!==null&&(this.setValue(r),Je.DropDownDiv.hideIfOwner(this))}onKeyDown(s){let i=!0,r;switch(s.key){case"ArrowUp":this.moveHighlightBy(0,-1);break;case"ArrowDown":this.moveHighlightBy(0,1);break;case"ArrowLeft":this.moveHighlightBy(-1,0);break;case"ArrowRight":this.moveHighlightBy(1,0);break;case"Enter":if(r=this.getHighlighted(),r){const l=r.getAttribute("data-colour");l!==null&&this.setValue(l)}Je.DropDownDiv.hideWithoutAnimation();break;default:i=!1}i&&s.stopPropagation()}moveHighlightBy(s,i){if(!this.highlightedIndex)return;const r=this.colours,l=this.columns;let c=this.highlightedIndex%l,d=Math.floor(this.highlightedIndex/l);c+=s,d+=i,s<0?c<0&&d>0?(c=l-1,d--):c<0&&(c=0):s>0?c>l-1&&dl-1&&c--:i<0?d<0&&(d=0):i>0&&d>Math.floor(r.length/l)-1&&(d=Math.floor(r.length/l)-1);const h=this.picker.childNodes[d].childNodes[c],p=d*l+c;this.setHighlightedCell(h,p)}onMouseMove(s){const i=s.target,r=i&&Number(i.getAttribute("data-index"));r!==null&&r!==this.highlightedIndex&&this.setHighlightedCell(i,r)}onMouseEnter(){var s;(s=this.picker)==null||s.focus({preventScroll:!0})}onMouseLeave(){var i;(i=this.picker)==null||i.blur();const s=this.getHighlighted();s&&Je.utils.dom.removeClass(s,"blocklyColourHighlighted")}getHighlighted(){var l;if(!this.highlightedIndex)return null;const s=this.highlightedIndex%this.columns,i=Math.floor(this.highlightedIndex/this.columns),r=(l=this.picker)==null?void 0:l.childNodes[i];return r?r.childNodes[s]:null}setHighlightedCell(s,i){const r=this.getHighlighted();r&&Je.utils.dom.removeClass(r,"blocklyColourHighlighted"),Je.utils.dom.addClass(s,"blocklyColourHighlighted"),this.highlightedIndex=i;const l=s.getAttribute("id");l&&this.picker&&Je.utils.aria.setState(this.picker,Je.utils.aria.State.ACTIVEDESCENDANT,l)}dropdownCreate(){const s=this.columns,i=this.colours,r=this.getValue(),l=document.createElement("table");l.className="blocklyColourTable",l.tabIndex=0,l.dir="ltr",Je.utils.aria.setRole(l,Je.utils.aria.Role.GRID),Je.utils.aria.setState(l,Je.utils.aria.State.EXPANDED,!0),Je.utils.aria.setState(l,Je.utils.aria.State.ROWCOUNT,Math.floor(i.length/s)),Je.utils.aria.setState(l,Je.utils.aria.State.COLCOUNT,s);let c=null;for(let d=0;d{typeof a[s]=="function"&&(a.forBlock[s]||(console.log(`Migrating Blockly.JavaScript.${s} to Blockly.JavaScript.forBlock.${s}`),a.forBlock[s]=a[s],delete a[s]))})}let cc=!1,uc=!1,yg=null,_g=null;const hw=[];function TC(a,s,i,r){var l;if(r=r||[],(a.tagName==="BLOCK"||a.tagName==="block")&&(i=a.id),a.tagName==="FIELD"||a.tagName==="field")for(let c=0;cTC(c,s,i,r)),r}class et extends _e.Component{blockly=null;blocklyWorkspace=null;originalCode;someSelected=null;changeTimer=null;someSelectedTime=0;ignoreChanges=!1;blinkBlock;onResizeBind;didUpdate=null;lastCommand="";lastSearch;static Blockly=window.Blockly;constructor(s){super(s),this.state={languageOwnLoaded:uc,languageBlocklyLoaded:cc,changed:!1,message:"",error:"",themeType:this.props.themeType,exportText:"",importText:!1,searchText:this.props.searchText||"",showInputPrompt:null},this.originalCode=s.code||"",this.someSelected=null,this.onResizeBind=this.onResize.bind(this),this.lastSearch=this.props.searchText||"",this.blinkBlock=null,bO(),et.Blockly.dialog.setPrompt(this.onShowNameDialog),this.loadLanguages()}onShowNameDialog=(s,i,r)=>{this.setState({showInputPrompt:{promptText:s,defaultText:i,callback:r,value:i}})};static loadJS(s,i,r){const l=document.createElement("script");try{l.src=s,l.onload=i,l.onerror=i,(r||window.document.body).appendChild(l)}catch(c){console.error(`Cannot load ${s}: ${c}`),i&&i()}}static loadScripts(s,i){if(!(s!=null&&s.length)){i&&i();return}const r=s.pop();r&&!hw.includes(r)?(hw.push(r),et.loadJS(`../../adapter/${r}/blockly.js`,()=>setTimeout(()=>et.loadScripts(s,i),0))):setTimeout(()=>et.loadScripts(s,i),0)}static loadCustomBlockly(s,i){var l;const r=[];for(const c in s)!Object.prototype.hasOwnProperty.call(s,c)||!s[c]||!c.match(/^system\.adapter\./)||s[c].type!=="adapter"||(l=s[c].common)!=null&&l.blockly&&(console.log(`Detected custom blockly: ${s[c].common.name}`),r.push(s[c].common.name));et.loadScripts(r,i)}static loadXMLDoc(s){let i;return window.DOMParser?i=r=>new window.DOMParser().parseFromString(r,"text/xml"):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("Microsoft.XMLDOM")?i=r=>{const l=new window.ActiveXObject("Microsoft.XMLDOM");return l.async="false",l.loadXML(r),l}:i=()=>null,i(s)}searchBlocks(s){if(this.blocklyWorkspace){const i=et.Blockly.Xml.workspaceToDom(this.blocklyWorkspace),r=TC(i,s.toLowerCase());return console.log(`Search "${s}" found blocks: ${r.length?JSON.stringify(r):"none"}`),r}return[]}searchId(){const s=this.lastSearch?this.searchBlocks(this.lastSearch):null;s!=null&&s.length?(this.someSelected=s,this.someSelected.forEach(i=>{var r;return(r=this.blocklyWorkspace)==null?void 0:r.highlightBlock(i,!0)}),this.someSelectedTime=Date.now()):this.someSelected&&(this.someSelected.forEach(i=>{var r;return(r=this.blocklyWorkspace)==null?void 0:r.highlightBlock(i,!1)}),this.someSelected=null)}UNSAFE_componentWillReceiveProps(s){s.command&&this.lastCommand!==s.command&&(this.lastCommand=s.command,setTimeout(()=>this.lastCommand="",300),this.lastCommand==="check"?this.blocklyCheckBlocks((i,r)=>{i?(r&&et.blocklyBlinkBlock(r),this.setState({error:{text:x.I18n.t(i),title:x.I18n.t("Error was found")}}),this.blinkBlock=r):this.setState({message:x.I18n.t("Ok")})}):this.lastCommand==="export"?this.exportBlocks():this.lastCommand==="import"&&this.importBlocks()),s.searchText!==this.lastSearch&&(this.lastSearch=s.searchText,this.searchId()),this.state.themeType!==s.themeType&&this.setState({themeType:s.themeType},()=>this.updateBackground()),this.originalCode!==s.code&&(this.originalCode=s.code||"",this.loadCode(),this.searchId())}loadLanguages(){if(!cc){const s=window.document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("src",`google-blockly/msg/js/${x.I18n.getLanguage()}.js`),s.onload=()=>{cc=!0,this.setState({languageBlocklyLoaded:cc})},window.document.getElementsByTagName("head")[0].appendChild(s)}if(!uc){const s=window.document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("src",`google-blockly/own/msg/${x.I18n.getLanguage()}.js`),s.onload=()=>{uc=!0,this.setState({languageOwnLoaded:uc})},window.document.getElementsByTagName("head")[0].appendChild(s)}}onResize(){this.blocklyWorkspace&&et.Blockly.svgResize(this.blocklyWorkspace)}static jsCode2Blockly(s){s=s||"";const i=s.split(/[\r\n]+|\r|\n/g);let r="";for(let c=i.length-1;c>=0;c--)if(i[c].substring(0,2)==="//"){r=i[c].substring(2);break}if(r.substring(0,4)==="s.select(),i),setTimeout(()=>s.unselect(),i+150)}blocklyRemoveOrphanedShadows(){if(this.blocklyWorkspace){const s=this.blocklyWorkspace.getAllBlocks();let i;for(let r=0;i=s[r];r++)if(i.isShadow()){const l=i.getConnections_(!0);let c;for(let d=0;c=l[d];d++)if(!c.targetConnection){i.dispose();break}}}}blocklyCheckBlocks(s){let i;if(!this.blocklyWorkspace||this.blocklyWorkspace.getAllBlocks().length===0)return s&&s("no blocks found"),!1;let r=this.blocklyGetUnconnectedBlock();return r?i="not properly connected":(r=this.blocklyGetBlockWithWarning(),r&&(i="warning on this block")),r?(s?s(i,r):et.blocklyBlinkBlock(r),!1):(s(),!0)}blocklyGetUnconnectedBlock(){var r;const s=(r=this.blocklyWorkspace)==null?void 0:r.getAllBlocks();let i;if(s)for(let l=0;i=s[l];l++){const c=i.getConnections_(!0);let d;for(let h=0;d=c[h];h++)if(!d.sourceBlock_||(d.type===et.Blockly.INPUT_VALUE||d.type===et.Blockly.OUTPUT_VALUE)&&!d.targetConnection&&!d._optional)return i}return null}blocklyGetBlockWithWarning(){var r;const s=(r=this.blocklyWorkspace)==null?void 0:r.getAllBlocks();let i;if(s){for(let l=0;i=s[l];l++)if(i.warning)return i}return null}blocklyCode2JSCode(s){if(!this.blocklyWorkspace)return"";let i=et.Blockly.JavaScript.workspaceToCode(this.blocklyWorkspace);if(!s){i+=` -`;const r=et.Blockly.Xml.workspaceToDom(this.blocklyWorkspace),l=et.Blockly.Xml.domToText(r);i+=`//${btoa(encodeURIComponent(l))}`}return i}exportBlocks(){if(!this.blocklyWorkspace)return;let s;const i=et.Blockly.getSelected();if(i){const r=et.Blockly.Xml.blockToDom(i),l=i.getRelativeToSurfaceXY();r.setAttribute("x",(i.RTL?-l.x:l.x).toString()),r.setAttribute("y",l.y.toString()),s=et.Blockly.Xml.domToPrettyText(r)}else{const r=et.Blockly.Xml.workspaceToDom(this.blocklyWorkspace);s=et.Blockly.Xml.domToPrettyText(r)}this.setState({exportText:s})}importBlocks(){this.setState({importText:!0})}onImportBlocks(s){if(this.blocklyWorkspace&&(s=(s||"").trim(),s))try{s.startsWith("${s}`),s=s.replace(/[\n\r]/g,"").replace(/.*<\/variables>/g,""),window.scripts.loading=!0;const i=et.Blockly.utils.xml.textToDom(s);et.Blockly.Xml.appendDomToWorkspace(i,this.blocklyWorkspace),window.scripts.loading=!1,this.onBlocklyChanged()}catch(i){this.setState({error:{text:i.toString(),title:x.I18n.t("Import error")}})}}loadCode(){if(this.blocklyWorkspace){this.ignoreChanges=!0,this.blocklyWorkspace.clear();try{const s=et.jsCode2Blockly(this.originalCode)||'';window.scripts.loading=!0;const i=et.Blockly.utils.xml.textToDom(s);et.Blockly.Xml.domToWorkspace(i,this.blocklyWorkspace),window.scripts.loading=!1}catch(s){console.error(s),setTimeout(()=>this.setState({error:x.I18n.t("Cannot extract Blockly code!")}))}setTimeout(()=>this.ignoreChanges=!1,100)}}onBlocklyChanged(){this.blocklyRemoveOrphanedShadows(),this.setState({changed:!0}),this.onChange()}async componentDidUpdate(){if(!this.blockly||(this.didUpdate&&(clearTimeout(this.didUpdate),this.didUpdate=null),this.blocklyWorkspace))return;window.addEventListener("resize",this.onResizeBind,!1),yg=yg||await this.getToolbox(),_g=_g||et.Blockly.utils.xml.textToDom(yg),this.blocklyWorkspace=et.Blockly.inject(this.blockly,{renderer:"thrasos",theme:this.state.themeType==="dark"?dw:"classic",media:"google-blockly/media/",toolbox:_g,zoom:{controls:!0,wheel:!1,startScale:1,maxScale:3,minScale:.3,scaleSpeed:1.2,pinch:!0},move:{scrollbars:{horizontal:!0,vertical:!0},drag:!0,wheel:!0},trashcan:!0,grid:{spacing:25,length:1,snap:!0},sounds:!1}),window.scripts={blocklyWorkspace:this.blocklyWorkspace},this.blocklyWorkspace.registerToolboxCategoryCallback("PROCEDURE",window.Blockly.Procedures.flyoutCategoryNew),this.blocklyWorkspace.addChangeListener(i=>{var r;if(this.someSelected&&Date.now()-this.someSelectedTime>500){const l=(r=this.blocklyWorkspace)==null?void 0:r.getAllBlocks();this.someSelected=null,l==null||l.forEach(c=>c.removeSelect())}[et.Blockly.Events.UI,et.Blockly.Events.CREATE,et.Blockly.Events.VIEWPORT_CHANGE].includes(i.type)||this.ignoreChanges||(this.changeTimer&&clearTimeout(this.changeTimer),this.changeTimer=setTimeout(()=>{this.changeTimer=null,this.onBlocklyChanged()},200))}),this.loadCode(),this.onResize();const s=document.getElementsByClassName("blocklyToolboxDiv")[0];this.blockly.appendChild(s),this.updateBackground(),setTimeout(()=>this.searchId(),200)}updateBackground(){var s;this.state.themeType==="dark"?(s=this.blocklyWorkspace)==null||s.setTheme(dw):this.blocklyWorkspace&&(this.blocklyWorkspace.getThemeManager(),this.blocklyWorkspace.setTheme(et.Blockly.Themes.Classic))}componentWillUnmount(){this.blocklyWorkspace&&(this.blocklyWorkspace.dispose(),this.blocklyWorkspace=null,this.changeTimer&&clearTimeout(this.changeTimer),this.changeTimer=null,window.removeEventListener("resize",this.onResizeBind))}onChange(){this.originalCode=this.blocklyCode2JSCode(),this.props.onChange&&this.props.onChange(this.originalCode)}async getToolbox(s){const i=window.document.getElementById("toolbox");let r=i==null?void 0:i.outerHTML;if(!r)return s?(console.error("Cannot load blocks!"),""):new Promise(l=>{setTimeout(()=>l(this.getToolbox(!0)),500)});if(r=r.replace(/{(\w+)}/g,(l,c)=>window.MSG[c]),window.Blockly.CustomBlocks){let l="";const c=x.I18n.getLanguage();for(let d=0;d`;for(const f in p.blocks)Object.prototype.hasOwnProperty.call(p.blocks,f)&&(l+=p.blocks[f]);l+=""}r=r.replace("%%CUSTOM_BLOCKS%%",l)}return r}renderMessageDialog(){return this.state.message?m.jsx(x.Message,{text:typeof this.state.message=="object"?this.state.message.text:this.state.message,title:typeof this.state.message=="object"?this.state.message.title:"",onClose:()=>this.setState({message:""})},"dialogMessage"):null}renderErrorDialog(){return this.state.error?m.jsx(su,{text:typeof this.state.error=="object"?this.state.error.text.toString():this.state.error,title:typeof this.state.error=="object"?this.state.error.title:"",onClose:()=>{this.blinkBlock&&(et.blocklyBlinkBlock(this.blinkBlock),this.blinkBlock=null),this.setState({error:""})}},"dialogError"):null}renderExportDialog(){return this.state.exportText?m.jsx(sO,{themeType:this.state.themeType,onClose:()=>this.setState({exportText:""}),text:this.state.exportText,scriptId:this.props.scriptId},"dialogExport"):null}renderImportDialog(){return this.state.importText?m.jsx(Gm,{themeType:this.props.themeType,onClose:s=>{this.setState({importText:!1}),this.onImportBlocks(s)}},"dialogImport"):null}renderDialogPrompt(){return this.state.showInputPrompt?m.jsxs(Ut,{onClose:()=>{var i;const s=(i=this.state.showInputPrompt)==null?void 0:i.callback;s&&s(null),this.setState({showInputPrompt:null})},maxWidth:"sm",fullWidth:!0,open:!0,children:[m.jsx(ss,{children:this.state.showInputPrompt.promptText}),m.jsx(qt,{children:m.jsx(Eo,{variant:"standard",fullWidth:!0,autoFocus:!0,value:this.state.showInputPrompt.value,onKeyUp:s=>{var i,r;if(s.key==="Enter"){const l=(i=this.state.showInputPrompt)==null?void 0:i.callback,c=(r=this.state.showInputPrompt)==null?void 0:r.value;l&&l(c===void 0?null:c),this.setState({showInputPrompt:null})}},onChange:s=>{var r,l;const i={...this.state.showInputPrompt};(r=this.state.showInputPrompt)!=null&&r.callback&&(i.callback=(l=this.state.showInputPrompt)==null?void 0:l.callback),i.value=s.target.value,this.setState({showInputPrompt:i})}})}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",disabled:!this.state.showInputPrompt.value,onClick:()=>{var r,l;const s=(r=this.state.showInputPrompt)==null?void 0:r.callback,i=(l=this.state.showInputPrompt)==null?void 0:l.value;s&&s(i===void 0?null:i),this.setState({showInputPrompt:null})},color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Apply")}),m.jsx(He,{color:"grey",variant:"contained",onClick:()=>{var i;const s=(i=this.state.showInputPrompt)==null?void 0:i.callback;s&&s(null),this.setState({showInputPrompt:null})},startIcon:m.jsx(so,{}),children:x.I18n.t("Close")})]})]},"inputDialog"):null}render(){return this.state.languageBlocklyLoaded&&this.state.languageOwnLoaded?(this.didUpdate=setTimeout(()=>{this.didUpdate=null,this.componentDidUpdate()},100),[m.jsx("div",{ref:s=>this.blockly=s,style:{width:"100%",height:"100%",position:"relative"}},"blocklyDOM"),this.renderDialogPrompt(),this.renderMessageDialog(),this.renderErrorDialog(),this.renderExportDialog(),this.renderImportDialog()]):null}}const vO=Object.freeze(Object.defineProperty({__proto__:null,default:et},Symbol.toStringTag,{value:"Module"})),yO="_nameCard_15el3_28",_O="_iconThemCard_15el3_40",wO="_iconThemCardSelectable_15el3_49",kO="_iconHelp_15el3_53",CO="_blockName_15el3_64",TO="_controlMenuTop_15el3_123",SO="_debugInfo_15el3_132",EO="_tagCard_15el3_142",IO="_displayFlex_15el3_161",xO="_blockMarginTop_15el3_166",DO="_nameBlock_15el3_167",AO="_frontText_15el3_171",OO="_backText_15el3_177",RO="_iconTag_15el3_181",NO="_displayItalic_15el3_191",Re={nameCard:yO,iconThemCard:_O,iconThemCardSelectable:wO,iconHelp:kO,blockName:CO,controlMenuTop:TO,debugInfo:SO,tagCard:EO,displayFlex:IO,blockMarginTop:xO,nameBlock:DO,frontText:AO,backText:OO,iconTag:RO,displayItalic:NO},MO="_root_1dr6a_1",LO="_square_1dr6a_11",PO="_icon_1dr6a_16",wg={root:MO,square:LO,icon:PO},Jr=({fullWidth:a,size:s,onClick:i,style:r,className:l,value:c,square:d,icon:h})=>m.jsx(He,{variant:"outlined",color:"primary",onClick:i,fullWidth:a,style:r,className:x.Utils.clsx(wg.root,l,d?wg.square:""),size:s||"medium",children:h?m.jsx(x.Icon,{className:wg.icon,src:h}):c}),BO="_root_1ucda_1",FO={root:BO},jO=({size:a,value:s,title:i,onChange:r,className:l,customValue:c,disabled:d})=>{const[h,p]=kt(!1);return m.jsxs(m.Fragment,{children:[m.jsx(wc,{disabled:d,checked:!!(c?s:h),className:x.Utils.clsx(FO.root,l),onChange:f=>{c&&p(f.target.checked),r&&r(f.target.checked)},size:a||"medium"}),i||null]})},SC=dm(jO),zO="_root_19roy_1",pw={root:zO},Ei=a=>{const[s,i]=kt(""),{value:r,type:l,error:c,className:d,icon:h,label:p,style:f,onChange:b,fullWidth:y,autoComplete:w,customValue:v,autoFocus:_,rows:$,size:S,variant:T,multiline:E,disabled:D}=Object.assign({value:"",type:"text",error:"",className:null,table:!1,native:{},variant:"standard",size:"medium",component:null,styleComponentBlock:null,fullWidth:!1,autoComplete:"",customValue:!1,autoFocus:!1,rows:1},a);return m.jsx(Eo,{error:!!c,autoFocus:_,fullWidth:y,label:p,disabled:D,variant:T,multiline:E,rows:$,value:v?r:s,type:l,helperText:c,style:f,className:x.Utils.clsx(pw.root,d),autoComplete:w,onChange:M=>{!v&&i(M.target.value),b&&b(M.target.value)},slotProps:{input:{endAdornment:h?m.jsx(Aw,{position:"end",children:m.jsx(x.Icon,{className:pw.icon,src:h})}):null}},margin:"normal",size:S})},UO={formControl:{m:"10px 0","& .MuiFormControl-marginNormal":{mt:0,mb:0},"& > *":{color:"#2d0440 !important"},"& .MuiSelect-icon":{color:"#81688c"},"& label.Mui-focused":{color:"#81688c"},"& .MuiInput-underline:after":{borderBottomColor:"#510573"},"& .MuiInput-underline:before":{borderBottomColor:"#81688c"},"& .MuiInput-underline:hover:before":{borderBottomColor:"#81688c"}}},HO=({multiple:a,value:s,customValue:i,socket:r,title:l,attr:c,adapter:d,style:h,onChange:p,onInstanceHide:f})=>{const[b,y]=kt(s||"test1"),[w,v]=kt([]);return Lt(()=>{r==null||r.getAdapterInstances(d).then(_=>{const $=_.map(S=>({value:S._id.replace("system.adapter.",""),title:S._id.replace("system.adapter.","")}));$.length===1?f($[0].value):$.unshift({value:d,title:x.I18n.t("All")}),v($)})},[r,d,f]),m.jsxs(Di,{sx:UO.formControl,fullWidth:!0,style:h,children:[m.jsx(Ai,{variant:"standard",value:(i?s:b)||"_",fullWidth:!0,multiple:a,renderValue:_=>a&&Array.isArray(_)?_.join(", "):_,onChange:_=>{!i&&y(_.target.value),p(_.target.value)},input:c?m.jsx(Pn,{name:c,id:`${c}-helper`}):m.jsx(Pn,{name:c}),children:w.map(_=>m.jsx(it,{style:{placeContent:"space-between"},value:_.value||"_",children:x.I18n.t(_.title)},`key-${_.value}`))}),l?m.jsx(Rw,{children:x.I18n.t(l)}):null]})},WO="_modalWrapper_587ci_33",GO="_modalDialog_587ci_40",gw={modalWrapper:WO,modalDialog:GO},cm=({onClose:a,children:s,titleButtonApply:i,titleButtonClose:r,onApply:l,className:c,textInput:d,defaultValue:h,disabled:p})=>{const[f,b]=kt(h||""),[y]=kt(h||"");return m.jsxs(Ut,{open:!0,maxWidth:"md",disableEscapeKeyDown:!1,onClose:a,classes:{paper:gw.modalDialog},className:gw.modalWrapper,children:[m.jsxs(qt,{children:[d&&m.jsx(Ei,{className:c,autoComplete:"off",fullWidth:!0,variant:"outlined",size:"medium",rows:10,multiline:!0,value:f,onChange:b,customValue:!0}),!d&&s]}),m.jsxs(Ht,{children:[m.jsx(He,{disabled:p===void 0?y===f:p,onClick:()=>l(d?f:null),variant:"contained",color:"primary",children:x.I18n.t(i||"Ok")}),m.jsx(He,{color:"grey",onClick:a,variant:"contained",children:x.I18n.t(r||"Cancel")})]})]})},VO="_root_15mo1_1",KO={root:VO},YO=({multiple:a,value:s,customValue:i,title:r,attr:l,options:c,style:d,onChange:h,className:p,doNotTranslate:f,doNotTranslate2:b})=>{const[y,w]=kt(s===void 0?c[0].value:s),v=i?s:y,_=v===""||v===null||v===void 0?"_":v;return m.jsxs(Di,{variant:"standard",className:x.Utils.clsx(KO.root,p),fullWidth:!0,style:d,children:[m.jsxs(Ai,{variant:"standard",value:_,fullWidth:!0,multiple:a,renderValue:$=>{if(a&&Array.isArray($)){$.sort();let T=$.indexOf("0");T!==-1&&($.splice(T,1),$.push("0")),T=$.indexOf("_"),T!==-1&&($.splice(T,1),$.unshift("_"));const E=c.find(M=>M.only);return E&&$.includes(E.value)?E.titleShort?f?E.titleShort:x.I18n.t(E.titleShort):f?E.title:x.I18n.t(E.title):$.map(M=>c.find(P=>P.value===M||M==="_"&&P.value==="")||M).map(M=>typeof M=="object"?M.titleShort?f?M.titleShort:x.I18n.t(M.titleShort):f?M.title:x.I18n.t(M.title):f?M:x.I18n.t(M)).join(", ")}const S=c?c.find(T=>T.value===$||$==="_"&&T.value===""):null;return S!=null&&S.title?f?S==null?void 0:S.title:x.I18n.t(S==null?void 0:S.title):$},onChange:$=>{if(i||w($.target.value),a){const S=$.target.value,T=c.find(E=>E.only);if(T){const E=T.value;if(S.length===c.length-1&&S.includes(E))return h(S.filter(D=>D!==E),l);if(S.includes(E))return h(c.map(D=>D.value),l)}}h($.target.value,l)},input:l?m.jsx(Pn,{name:l,id:`${l}-helper`}):m.jsx(Pn,{name:l}),children:[!a&&(c==null?void 0:c.map($=>m.jsxs(it,{style:{placeContent:"space-between"},value:$.value===""||$.value===null||$.value===void 0?"_":$.value,children:[f?$.title:x.I18n.t($.title),$.title2&&m.jsx("div",{children:b?$.title2:x.I18n.t($.title2)})]},`key-${$.value}`))),a&&(c==null?void 0:c.map($=>m.jsxs(it,{style:{placeContent:"space-between"},value:$.value||"_",children:[f?$.title:x.I18n.t($.title)," ",m.jsx(SC,{customValue:!0,value:s==null?void 0:s.includes($.value)})]},`key-${$.value}`)))]}),r?m.jsx(Rw,{children:x.I18n.t(r)}):null]})},JO="_root_1gt4d_1",qO="_mark_1gt4d_27",mw={root:JO,mark:qO},XO=({size:a,value:s,style:i,onChange:r,className:l,customValue:c,min:d,max:h,step:p,unit:f})=>{const[b,y]=kt(0);d=d!==void 0?d:0,h=h!==void 0?h:0,p=p!==void 0?p:(h-d)/100;const w=[{value:d,label:d+(f||"")},{value:h,label:h+(f||"")}];return m.jsx(qT,{defaultValue:c?s:b,"aria-labelledby":"discrete-slider",valueLabelDisplay:"auto",classes:{mark:mw.mark},marks:w,step:p,min:d,max:h,value:c?s:b,style:i,className:x.Utils.clsx(mw.root,l),onChange:(v,_)=>{Array.isArray(_)?(!c&&y(_[0]),r(_[0])):(!c&&y(_),r(_))},size:a||"medium"})},ZO="_root_rzul6_1",QO={root:ZO},eR=({label:a,size:s,value:i,style:r,onChange:l,className:c,customValue:d})=>{const[h,p]=kt(!1);return m.jsx(Mg,{className:QO.root,control:m.jsx(Nw,{checked:d?i:h,style:r,className:c,onChange:f=>{d||p(f.target.checked),l(f.target.checked)},size:s||"medium"}),label:a??"all"})},tR=dm(eR),sR="_root_135pm_1",oR={root:sR},iR=({value:a,style:s,onChange:i,className:r})=>m.jsx(Eo,{variant:"standard",id:"time",type:"time",onChange:l=>i(l.currentTarget.value),value:a,className:x.Utils.clsx(oR.root,r),fullWidth:!0,style:s,slotProps:{htmlInput:{step:300},inputLabel:{shrink:!0}}}),nR="_root_135pm_1",dc={root:nR},kg=[31,29,31,30,31,30,31,31,30,31,30,31],rR=({value:a,onChange:s,className:i,style:r})=>{const[l,c]=(a||"01.01").toString().split(".");let d=parseInt(c,10)||0,h=parseInt(l,10)||0;h>12?h=12:h<0&&(h=0),d>kg[h]?d=kg[h]:d<0&&(d=0);const p=[];for(let f=0;fs(`${f.target.value.toString().padStart(2,"0")}.${d.toString().padStart(2,"0")}`),value:h,children:[m.jsx(it,{style:{placeContent:"space-between"},value:0,children:x.I18n.t("Any month")},0),m.jsx(it,{style:{placeContent:"space-between"},value:1,children:x.I18n.t("January")},1),m.jsx(it,{style:{placeContent:"space-between"},value:2,children:x.I18n.t("February")},2),m.jsx(it,{style:{placeContent:"space-between"},value:3,children:x.I18n.t("March")},3),m.jsx(it,{style:{placeContent:"space-between"},value:4,children:x.I18n.t("April")},4),m.jsx(it,{style:{placeContent:"space-between"},value:5,children:x.I18n.t("May")},5),m.jsx(it,{style:{placeContent:"space-between"},value:6,children:x.I18n.t("June")},6),m.jsx(it,{style:{placeContent:"space-between"},value:7,children:x.I18n.t("July")},7),m.jsx(it,{style:{placeContent:"space-between"},value:8,children:x.I18n.t("August")},8),m.jsx(it,{style:{placeContent:"space-between"},value:9,children:x.I18n.t("September")},9),m.jsx(it,{style:{placeContent:"space-between"},value:10,children:x.I18n.t("October")},10),m.jsx(it,{style:{placeContent:"space-between"},value:11,children:x.I18n.t("November")},11),m.jsx(it,{style:{placeContent:"space-between"},value:12,children:x.I18n.t("December")},12)]})}),m.jsx(Di,{variant:"standard",className:x.Utils.clsx(dc.root,i),style:r,children:m.jsxs(Ai,{variant:"standard",className:x.Utils.clsx(dc.root,i),margin:"dense",label:x.I18n.t("Date"),onChange:f=>s(`${h.toString().padStart(2,"0")}.${f.target.value.toString().padStart(2,"0")}`),value:d,children:[m.jsx(it,{style:{placeContent:"space-between"},value:0,children:x.I18n.t("Any")},"A"),p.map(f=>m.jsx(it,{style:{placeContent:"space-between"},value:f,children:f},f))]})})]})},Cg={},aR={Shuffle:bx,Apps:rx,Functions:hx,Language:kS,AddBox:nx,Pause:bc,Subject:yx,PlayForWork:fx,Brightness3:ax,HelpOutline:pk,Storage:vx,AccessTime:ix,PlayArrow:Wg,FlashOn:ux};function fw({iconName:a,className:s,adapter:i,socket:r,onClick:l,style:c}){const[d,h]=kt("");if(Lt(()=>{i&&r&&(Cg[i]instanceof Promise||(Cg[i]=r.getObject(`system.adapter.${i}`)),Cg[i].then(f=>{var b;return((b=f==null?void 0:f.common)==null?void 0:b.icon)&&h(`../../adapter/${i}/${f.common.icon}`)}))},[i,r]),i)return m.jsx("img",{onClick:f=>l&&l(f),src:d||"",className:s,style:c,alt:""});const p=a&&aR[a]||CS;return m.jsx(p,{className:s,style:c,onClick:f=>l&&l(f)})}let Tg;function lR(a){return Tg=Tg||x.I18n.getLanguage(),a&&typeof a=="object"?a[Tg]||a.en:a||""}function Ln(a){return a===null?"null":a===void 0?"undefined":Array.isArray(a)?a.join(", "):typeof a=="object"?JSON.stringify(a):a.toString()}class at extends xw{debugHideTimeout=null;lastObjectIdChange=0;enableSimulationProcessing=!1;lastDebugMessage=0;debugMessageTimeout=null;static getStaticData(){return{acceptedBy:"actions",name:"Not found",id:"ActionEmpty",icon:"Shuffle"}}static compile(s,i){return""}constructor(s,i){super(s),i||={};const r=s.settings||{tagCard:i.tagCardArray?typeof i.tagCardArray[0]!="string"?i.tagCardArray[0].title:i.tagCardArray[0]:""};!r.tagCard&&i.tagCardArray&&(r.tagCard=typeof i.tagCardArray[0]!="string"?i.tagCardArray[0].title:i.tagCardArray[0]),this.state={inputs:i.inputs||s.inputs||[],name:i.name||s.name||"",icon:i.icon||s.icon||"",adapter:i.adapter||s.adapter||"",helpDialog:i.helpDialog||s.helpDialog||"",tagCardArray:i.tagCardArray||[],openTagMenu:!1,openModal:!1,iconTag:!1,error:"",helpText:"",instanceSelectionOptions:[],instanceSelectionDef:"",hideAttributes:[],settings:r,debugMessage:null,enableSimulation:this.props.enableSimulation}}componentWillUnmount(){this.debugMessageTimeout&&(clearTimeout(this.debugMessageTimeout),this.debugMessageTimeout=null),this.debugHideTimeout&&(clearTimeout(this.debugHideTimeout),this.debugHideTimeout=null)}onTagChange(s,i,r,l,c){let d=!1;const h=JSON.parse(JSON.stringify(this.state.settings));this.state.inputs.forEach(p=>{const f=p.attr,b=p.defaultValue;f&&b!==void 0&&h[f]===void 0&&(d=!0,h[f]=b)}),d?(this.setState({settings:h},()=>i==null?void 0:i()),this.props.onChange(h)):i&&i()}onUpdate(){}onValueChanged(s,i){}renderText(s,i,r){const{className:l}=this.props,{attr:c,frontText:d,backText:h,nameBlock:p,name:f,doNotTranslate:b,doNotTranslateBack:y}=s;return m.jsxs(Dg,{children:[m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),children:[d&&m.jsx("div",{className:Re.frontText,children:b?d:x.I18n.t(d)}),m.jsx(Ei,{className:l,autoComplete:"off",label:lR(f),variant:"outlined",size:"small",fullWidth:!0,value:i,onChange:r,customValue:!0}),h&&m.jsx("div",{className:Re.backText,children:y?h:x.I18n.t(h)})]}),p&&m.jsx("div",{className:Re.nameBlock,children:x.I18n.t(p)})]},c)}renderSwitch(s,i,r){const{className:l}=this.props,{attr:c,frontText:d,backText:h,nameBlock:p,doNotTranslate:f,doNotTranslateBack:b}=s;return m.jsxs("div",{children:[m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),children:[d&&m.jsx("div",{className:Re.frontText,children:f?d:x.I18n.t(d)}),m.jsx(tR,{className:l,label:"",customValue:!0,value:i,onChange:r}),h&&m.jsx("div",{className:Re.backText,children:b?h:x.I18n.t(h)})]}),p&&m.jsx("div",{className:Re.nameBlock,children:x.I18n.t(p)})]},c)}renderNameText({attr:s,signature:i,doNotTranslate:r,defaultValue:l},c){return m.jsx("div",{className:x.Utils.clsx(i?Re.displayItalic:Re.displayFlex,Re.blockMarginTop),children:c?r?c:x.I18n.t(c):r?l:x.I18n.t(l)},s)}renderNumber(s,i,r){const{className:l}=this.props,{settings:c}=this.state,{attr:d,backText:h,frontText:p,openCheckbox:f,doNotTranslate:b,doNotTranslateBack:y}=s;let w=!0;return f&&(w=typeof c.offset=="boolean"?c.offset:!0),w?m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),children:[p&&m.jsx("div",{className:Re.frontText,children:b?p:x.I18n.t(p)}),m.jsx(Ei,{className:x.Utils.clsx(l,s.className),fullWidth:!0,autoComplete:"off",label:s.noHelperText?"":"number",variant:"outlined",size:"small",type:"number",value:i,onChange:r,customValue:!0}),h&&m.jsx("div",{className:Re.backText,children:y?h:x.I18n.t(h)})]},d):null}renderColor(s,i,r){const{className:l}=this.props,{attr:c,backText:d,frontText:h,doNotTranslate:p,doNotTranslateBack:f}=s;return m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),children:[h&&m.jsx("div",{className:Re.frontText,children:p?h:x.I18n.t(h)}),m.jsx(Ei,{className:l,autoComplete:"off",fullWidth:!0,variant:"outlined",size:"small",type:"color",value:i,onChange:r}),d&&m.jsx("div",{className:Re.backText,children:f?d:x.I18n.t(d)})]},c)}renderCheckbox(s,i,r){const{className:l}=this.props,{settings:c}=this.state,{attr:d,backText:h,frontText:p,defaultValue:f,doNotTranslate:b,doNotTranslateBack:y}=s;return m.jsxs("div",{className:Re.displayFlex,children:[p&&m.jsx("div",{className:Re.frontText,children:b?p:x.I18n.t(p)}),m.jsx(SC,{className:l,size:"small",value:typeof c[d]=="boolean"?!!c[d]:!!f,customValue:!0,onChange:r}),h&&m.jsx("div",{onClick:()=>r(typeof c[d]=="boolean"?!c[d]:!f),className:Re.backText,children:y?h:x.I18n.t(h)})]},d)}renderSlider(s,i,r){const{className:l}=this.props,{attr:c,frontText:d,backText:h,nameBlock:p,min:f,max:b,step:y,unit:w,doNotTranslate:v,doNotTranslateBack:_}=s;return m.jsxs("div",{children:[m.jsxs("div",{className:Re.displayFlex,style:{marginRight:20},children:[d&&m.jsx("div",{className:Re.frontText,children:v?d:x.I18n.t(d)}),m.jsx(XO,{customValue:!0,min:f,max:b,step:y,unit:w,className:l,autoComplete:"off",label:"number",variant:"outlined",size:"small",value:i,onChange:$=>{console.log($),r($)}}),h&&m.jsx("div",{style:{marginLeft:20},className:Re.backText,children:_?h:x.I18n.t(h)})]}),p&&m.jsx("div",{className:Re.nameBlock,children:x.I18n.t(p)})]},c)}renderButton(s,i,r){const{className:l}=this.props,{attr:c,frontText:d,backText:h,doNotTranslate:p,doNotTranslateBack:f}=s;return m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),children:[d&&m.jsx("div",{className:Re.frontText,children:p?d:x.I18n.t(d)}),m.jsx(Jr,{fullWidth:!0,value:i.toString(),className:l,onClick:()=>r(i)}),h&&m.jsx("div",{className:Re.backText,children:f?h:x.I18n.t(h)})]},c)}async findIcon(s){var i;if(!s)return null;if((i=s.common)!=null&&i.icon)return x.getSelectIdIcon(s,"../..");if(s.type==="state"||s.type==="channel"){const r=s._id.split(".");r.pop();const l=r.join(".");try{const c=await this.props.socket.getObject(l);return await this.findIcon(c)}catch{return null}}return null}renderObjectID(s,i,r){const{attr:l,openCheckbox:c,checkReadOnly:d}=s,{settings:h}=this.state,p=this.state[`showSelectId${l}`],{className:f,socket:b,style:y}=this.props;let w=!0;c&&(w=typeof h.offset=="boolean"?h.offset:!0);const v=h[l],_=v?this.state[v]:void 0;return v&&!_&&_!==!1&&setTimeout(async $=>{var D;const S=await b.getObject(i),T=await this.findIcon(S),E={[$]:S||!1,[`${$}___icon`]:T,error:d&&this.lastObjectIdChange&&Date.now()-this.lastObjectIdChange<1e3&&((D=S==null?void 0:S.common)==null?void 0:D.write)===!1?x.I18n.t("Read only ID selected: %s",h[$]):""};this.setState(E)},0,v),w?m.jsxs("div",{className:Re.blockMarginTop,children:[m.jsxs("div",{className:Re.displayFlex,children:[s.title?m.jsx("div",{children:x.I18n.t(s.title)}):null,m.jsx(Ei,{className:f,style:y,autoComplete:"off",fullWidth:!0,disabled:!0,variant:"outlined",size:"small",value:i,customValue:!0}),m.jsx(Jr,{icon:this.state[`${v}___icon`],square:!0,style:{...y||void 0,marginLeft:7},value:"...",className:f,onClick:()=>{const $={};$[`showSelectId${l}`]=!0,this.setState($)}})]}),_?m.jsx("div",{className:x.Utils.clsx(Re.nameBlock,Re.displayItalic),children:x.Utils.getObjectNameFromObj(_,x.I18n.getLanguage())}):null,p?m.jsx(x.DialogSelectID,{theme:this.props.theme,imagePrefix:"../..",dialogName:"javascript",themeType:x.Utils.getThemeName(),socket:b,selected:i,onClose:()=>{const $={};$[`showSelectId${l}`]=!1,this.setState($)},onOk:($,S)=>{const T={};T[`showSelectId${l}`]=!1;const E=Array.isArray($)?$[0]:$;this.setState(T,async()=>{var M,P,W,G,z,Z,he,Ce,R,K;const D=E?await b.getObject(E):void 0;this.lastObjectIdChange=Date.now(),r({[l]:$,[`${l}Role`]:(M=D==null?void 0:D.common)==null?void 0:M.role,[`${l}Type`]:(P=D==null?void 0:D.common)==null?void 0:P.type,[`${l}Unit`]:(W=D==null?void 0:D.common)==null?void 0:W.unit,[`${l}States`]:(G=D==null?void 0:D.common)==null?void 0:G.states,[`${l}Min`]:(z=D==null?void 0:D.common)==null?void 0:z.min,[`${l}Max`]:(Z=D==null?void 0:D.common)==null?void 0:Z.max,[`${l}Step`]:(he=D==null?void 0:D.common)==null?void 0:he.step,[`${l}Def`]:(Ce=D==null?void 0:D.common)==null?void 0:Ce.def,[`${l}Write`]:(R=D==null?void 0:D.common)==null?void 0:R.write,[`${l}Read`]:(K=D==null?void 0:D.common)==null?void 0:K.read},()=>this.props.setOnUpdate&&this.props.setOnUpdate(!0))})}}):null]},l):null}renderIconTag(){return m.jsx("div",{className:Re.iconTag,onClick:s=>{this.state.settings.tagCard&&(this.state.tagCardArray.length<3?this.onChangeTag():this.setState({openTagMenu:s.currentTarget}))},children:this.state.settings.tagCard})}renderTime(s,i,r){const{attr:l,backText:c,frontText:d,doNotTranslate:h,doNotTranslateBack:p}=s;return m.jsxs("div",{className:Re.displayFlex,style:{whiteSpace:"nowrap"},children:[d&&m.jsx("div",{className:Re.frontText,children:h?d:x.I18n.t(d)}),m.jsx(iR,{value:i,onChange:r}),c&&m.jsx("div",{className:Re.backText,children:p?c:x.I18n.t(c)})]},l)}renderSelect(s,i,r){const{className:l,style:c}=this.props,{name:d,options:h,frontText:p,backText:f,attr:b,multiple:y,doNotTranslate:w,doNotTranslate2:v,doNotTranslateBack:_}=s;return m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),style:{whiteSpace:"nowrap"},children:[p&&m.jsx("div",{className:Re.frontText,children:x.I18n.t(p)}),m.jsx(YO,{attr:b,doNotTranslate:w,doNotTranslate2:v,title:d,className:l,style:c,options:h,value:i,onChange:r,multiple:y,customValue:!0}),f&&m.jsx("div",{className:Re.backText,children:_?f:x.I18n.t(f)})]},b)}renderInstance(s,i,r){const{socket:l}=this.props,{name:c,frontText:d,backText:h,attr:p,adapter:f,doNotTranslate:b,doNotTranslateBack:y}=s;return this.state.hideAttributes.includes(p)?null:m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),style:{whiteSpace:"nowrap"},children:[d&&m.jsx("div",{className:Re.frontText,children:b?d:x.I18n.t(d)}),m.jsx(HO,{attr:p,socket:l,adapter:f,title:c,value:i,onChange:w=>{r(Array.isArray(w)?w[0]:w)},customValue:!0,onInstanceHide:w=>this.setState({hideAttributes:[...this.state.hideAttributes,p]},()=>r(w))}),h&&m.jsx("div",{className:Re.backText,children:y?h:x.I18n.t(h)})]},p)}renderDialog(s){const{onShowDialog:i,frontText:r,backText:l,attr:c,icon:d,doNotTranslate:h,doNotTranslateBack:p}=s;return m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),style:{whiteSpace:"nowrap"},children:[r&&m.jsx("div",{className:Re.frontText,children:h?r:x.I18n.t(r)}),m.jsx(fw,{iconName:d,className:x.Utils.clsx(Re.iconDialog),onClick:()=>i&&i()}),l&&m.jsx("div",{className:Re.backText,children:p?l:x.I18n.t(l)})]},c)}renderModalInput(s,i,r){const{openModal:l}=this.state,{className:c}=this.props,{attr:d,nameBlock:h,frontText:p,backText:f,noTextEdit:b,doNotTranslate:y,doNotTranslateBack:w}=s;return m.jsxs("div",{children:[m.jsxs("div",{className:x.Utils.clsx(Re.displayFlex,Re.blockMarginTop),children:[p&&m.jsx("div",{className:Re.frontText,children:y?p:x.I18n.t(p)}),m.jsx(Ei,{disabled:!!b,className:c,autoComplete:"off",fullWidth:!0,variant:"outlined",size:"small",value:i,onChange:r,customValue:!0}),m.jsx(Jr,{square:!0,style:{marginLeft:5},value:"...",className:c,onClick:()=>this.setState({openModal:!0})}),f&&m.jsx("div",{className:Re.backText,children:w?f:x.I18n.t(f)})]}),l?m.jsx(cm,{onApply:v=>this.setState({openModal:!1},()=>v!=null&&r(v)),onClose:()=>this.setState({openModal:!1}),defaultValue:i,textInput:!0}):null,h&&m.jsx("div",{className:Re.nameBlock,children:x.I18n.t(h)})]},d)}renderDate(s,i,r){const{attr:l,backText:c,frontText:d,doNotTranslate:h,doNotTranslateBack:p}=s;return m.jsxs("div",{className:Re.displayFlex,style:{whiteSpace:"nowrap"},children:[d&&m.jsx("div",{className:Re.frontText,children:h?d:x.I18n.t(d)}),m.jsx(rR,{value:i,onChange:r}),c&&m.jsx("div",{className:Re.backText,children:p?c:x.I18n.t(c)})]},l)}static getReplacesInText(s){var r;let i="";return(r=s.trigger)!=null&&r.oidType?i=".replace(/%s/g, obj.state.val).replace(/%id/g, obj.id).replace(/%name/g, obj.common && obj.common.name).replace(/%old/g, obj.oldState.val)":s.conditionsStates.length&&(i=`.replace(/%s/g, ${s.conditionsStates[0].name}).replace(/%id/g, "${s.conditionsStates[0].id}")`),i}renderTags(){const{tagCardArray:s,openTagMenu:i}=this.state,{tagCard:r}=this.state.settings;let l=r!=="="&&r!=="<>"&&r!==">="&&r!=="()"&&r!=="."&&r!=="<="&&r!=="<"&&r!==">"&&r?x.I18n.t(r):r;return s.length>=3&&(l=m.jsxs("div",{children:[m.jsx("div",{"aria-controls":"simple-menu","aria-haspopup":"true",onClick:c=>{this.setState({openTagMenu:c.currentTarget},()=>{this.props.isTourOpen&&this.props.tourStep===Ns.openTagsMenu&&setTimeout(()=>this.props.setTourStep&&this.props.setTourStep(Ns.selectIntervalTag),300)})},children:l}),m.jsx(pm,{id:"simple-menu",anchorEl:i,keepMounted:!0,open:!!i,onClose:()=>this.setState({openTagMenu:null}),children:s.map((c,d)=>{let h;return typeof c!="string"?h=c.title:h=c,m.jsxs(it,{selected:h===r,className:`tag-card-${h}`,style:{placeContent:"space-between"},onClick:p=>{p.stopPropagation(),this.props.isTourOpen&&(this.props.tourStep===Ns.openTagsMenu||this.props.tourStep===Ns.selectIntervalTag)&&h==="interval"&&setTimeout(()=>{var b,y;return(y=(b=this.props).setTourStep)==null?void 0:y.call(b,Ns.selectActions)},500);const f=JSON.parse(JSON.stringify(this.state.settings));f.tagCard=h,this.setState({openTagMenu:null,settings:f},()=>{this.props.onChange(this.state.settings),this.onTagChange(this.state.settings.tagCard)})},children:[h.search(/>|<|<>|<=|>=|=/)!==-1?h:x.I18n.t(h),typeof c!="string"&&c.title2&&m.jsx("div",{style:{marginLeft:4},children:x.I18n.t(c.title2)})]},`${h}_${d}`)})})]})),l}getData(){return{acceptedBy:"triggers",name:"",id:""}}onChangeTag(){const{tagCardArray:s,settings:i,settings:{tagCard:r}}=this.state;let l;if(typeof s[0]!="string"?l=s.map(c=>c.title):l=[...s],r&&l.length<3){const c={...i},d=l[(l.indexOf(r)+1)%l.length];c.tagCard=d,this.setState({settings:c},()=>{this.props.onChange(c),this.onTagChange(d)})}}componentDidMount(){this.onTagChange()}componentDidUpdate(){this.props.acceptedBy!=="triggers"&&this.props.onUpdate&&setTimeout(()=>this.onUpdate(),0)}onChangeInput(s){return(i,r,l)=>{const c=JSON.parse(JSON.stringify(this.state.settings));typeof i=="object"&&(!r||typeof r=="function")?(Object.keys(i).forEach(d=>c[d]=i[d]),typeof r=="function"&&(l=r,r=void 0)):c[r||s]=i,c.id=this.getData().id,c._id=this.props._id,this.setState({settings:c},()=>{this.onValueChanged(i,r||s),this.props.onChange(c),l==null||l()})}}renderSpecific(){return null}renderDebug(s){return""}renderDebugInfo(){return this.state.debugMessage?m.jsx("div",{className:Re.debugInfo,style:{opacity:1,height:22,bottom:-22},children:this.renderDebug?this.renderDebug(this.state.debugMessage):x.I18n.t("executed")},this.state.debugMessage.ts):null}renderCron(s,i,r){return null}renderWizard(s,i,r){return null}renderWriteState(){return null}renderInputElement(s,i){const{nameRender:r,defaultValue:l,attr:c}=s,{settings:d}=this.state;let h=c?d[c]:void 0;switch(h===void 0&&(h=l),r){case"renderTime":return c?this.renderTime(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderTime")},`invalid_${i}`);case"renderNameText":return this.renderNameText(s,l);case"renderSelect":return c?this.renderSelect(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderSelect")},`invalid_${i}`);case"renderModalInput":return c?this.renderModalInput(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderModalInput")},`invalid_${i}`);case"renderObjectID":return c?this.renderObjectID(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderObjectID")},`invalid_${i}`);case"renderDialog":return c?this.renderDialog(s):m.jsx("div",{children:x.I18n.t("Invalid renderDialog")},`invalid_${i}`);case"renderInstance":return c?this.renderInstance(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderInstance")},`invalid_${i}`);case"renderText":return c?this.renderText(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderText")},`invalid_${i}`);case"renderSlider":return c?this.renderSlider(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderSlider")},`invalid_${i}`);case"renderCheckbox":return c?this.renderCheckbox(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderCheckbox")},`invalid_${i}`);case"renderButton":return c?this.renderButton(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderButton")},`invalid_${i}`);case"renderColor":return c?this.renderColor(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderColor")},`invalid_${i}`);case"renderSwitch":return c?this.renderSwitch(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderSwitch")},`invalid_${i}`);case"renderDate":return c?this.renderDate(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderDate")},`invalid_${i}`);case"renderCron":return c?this.renderCron(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderCron")},`invalid_${i}`);case"renderWizard":return c?this.renderWizard(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderWizard")},`invalid_${i}`);case"renderWriteState":return this.renderWriteState();case"renderNumber":return c?this.renderNumber(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderNumber")},`invalid_${i}`);default:return this[r]?this[r](s,h,c?this.onChangeInput(c):null):m.jsx("div",{children:x.I18n.t("Invalid input type: %s",r)},`invalid_${i}`)}}render(){var w;const{inputs:s,name:i,icon:r,iconTag:l,settings:c,adapter:d,settings:{tagCard:h},helpDialog:p}=this.state,{socket:f,notFound:b}=this.props;this.state.settings&&!this.state.settings.tagCard&&((w=this.state.tagCardArray)!=null&&w.length)&&setTimeout(()=>{const v=JSON.parse(JSON.stringify(this.state.settings));v.tagCard=typeof this.state.tagCardArray[0]!="string"?this.state.tagCardArray[0].title:this.state.tagCardArray[0],this.setState({settings:v})},50),this.state.enableSimulation!==this.props.enableSimulation&&!this.enableSimulationProcessing&&(this.enableSimulationProcessing=!0,setTimeout(()=>{this.setState({enableSimulation:this.props.enableSimulation},()=>{this.enableSimulationProcessing=!1})},50));let y;if(this.props.onDebugMessage)for(let v=this.props.onDebugMessage.length-1;v>=0;v--){const _=this.props.onDebugMessage[v];if(_.blockId===this.props._id&&_.ts>this.lastDebugMessage&&_.ts>Date.now()-1e3){y=_;break}}return y&&(this.lastDebugMessage=y.ts,this.debugMessageTimeout&&clearTimeout(this.debugMessageTimeout),this.debugHideTimeout&&(clearTimeout(this.debugHideTimeout),this.debugHideTimeout=null),this.debugMessageTimeout=setTimeout(v=>{const _=JSON.parse(v),$=_.hideTimeout||5e3;this.debugMessageTimeout=null,this.setState({debugMessage:_},()=>{this.debugHideTimeout&&clearTimeout(this.debugHideTimeout),this.debugHideTimeout=setTimeout(()=>{this.debugHideTimeout=null,this.setState({debugMessage:null})},$)})},50,JSON.stringify(y))),m.jsxs(Dg,{children:[l?this.renderIconTag():m.jsx(fw,{iconName:r,className:x.Utils.clsx(Re.iconThemCard,h&&this.state.tagCardArray.length&&Re.iconThemCardSelectable),adapter:d,socket:f,onClick:v=>{h&&(this.state.tagCardArray.length<3?this.onChangeTag():this.setState({openTagMenu:v.currentTarget}))}}),m.jsxs("div",{className:Re.blockName,children:[m.jsxs("span",{className:Re.nameCard,children:[x.I18n.t(i),b?x.I18n.t("%s not found",c.id):"",p?m.jsx(qe,{className:Re.iconHelp,size:"small",onClick:()=>this.setState({helpText:x.I18n.t(p)}),children:m.jsx(pk,{})}):null]}),s.map((v,_)=>this.renderInputElement(v,_))]}),h&&m.jsx("div",{className:Re.controlMenuTop,style:{opacity:1,height:22,top:-22},children:m.jsx("div",{onClick:()=>this.onChangeTag(),className:x.Utils.clsx(Re.tagCard,"tag-card"),children:this.renderTags()})}),this.renderDebugInfo(),this.state.error?m.jsx(x.DialogError,{title:x.I18n.t("Warning"),text:this.state.error,onClose:()=>this.setState({error:""})}):null,this.state.helpText?m.jsx(x.DialogMessage,{title:x.I18n.t("Instructions"),text:this.state.helpText,onClose:()=>this.setState({helpText:""})}):null,this.renderSpecific()]})}}const $w={en:{name:"Google - English",engine:"google",params:[]},de:{name:"Google - Deutsch",engine:"google",params:[]},ru:{name:"Google - Русский",engine:"google",params:[]},it:{name:"Google - Italiano",engine:"google",params:[]},es:{name:"Google - Espaniol",engine:"google",params:[]},fr:{name:"Google - Français",engine:"google",params:[]},ru_YA:{name:"Yandex - Русский",engine:"yandex",params:["key","voice","emotion","ill","drunk","robot"],voice:["jane","zahar"],emotion:["none","good","neutral","evil","mixed"]},ru_YA_CLOUD:{name:"Yandex Cloud - Русский",engine:"yandexCloud",params:["key","folderID","voice","emotion"],voice:["alyss","oksana","jane","zahar"],emotion:["good","neutral","evil"]},"en-US":{name:"PicoTTS - Englisch US",engine:"PicoTTS",params:[]},"en-GB":{name:"PicoTTS - Englisch GB",engine:"PicoTTS",params:[]},"de-DE":{name:"PicoTTS - Deutsch",engine:"PicoTTS",params:[]},"it-IT":{name:"PicoTTS - Italiano",engine:"PicoTTS",params:[]},"es-ES":{name:"PicoTTS - Espaniol",engine:"PicoTTS",params:[]},"fr-FR":{name:"PicoTTS - Français",engine:"PicoTTS",params:[]},"ru-RU_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"ru-RU",ename:"Tatyana",ssml:!0,name:"Cloud - Русский - Татьяна"},"ru-RU_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"ru-RU",ename:"Maxim",ssml:!0,name:"Cloud - Русский - Максим"},"de-DE_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"de-DE",ename:"Marlene",ssml:!0,name:"Cloud - Deutsch - Marlene"},"de-DE_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"de-DE",ename:"Hans",ssml:!0,name:"Cloud - Deutsch - Hans"},"en-US_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Salli",ssml:!0,name:"Cloud - en-US - Female - Salli"},"en-US_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-US",ename:"Joey",ssml:!0,name:"Cloud - en-US - Male - Joey"},"da-DK_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"da-DK",ename:"Naja",ssml:!0,name:"Cloud - da-DK - Female - Naja"},"da-DK_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"da-DK",ename:"Mads",ssml:!0,name:"Cloud - da-DK - Male - Mads"},"en-AU_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-AU",ename:"Nicole",ssml:!0,name:"Cloud - en-AU - Female - Nicole"},"en-AU_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-AU",ename:"Russell",ssml:!0,name:"Cloud - en-AU - Male - Russell"},"en-GB_CLOUD_Female_Amy":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-GB",ename:"Amy",ssml:!0,name:"Cloud - en-GB - Female - Amy"},"en-GB_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-GB",ename:"Brian",ssml:!0,name:"Cloud - en-GB - Male - Brian"},"en-GB_CLOUD_Female_Emma":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-GB",ename:"Emma",ssml:!0,name:"Cloud - en-GB - Female - Emma"},"en-GB-WLS_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-GB-WLS",ename:"Gwyneth",ssml:!0,name:"Cloud - en-GB-WLS - Female - Gwyneth"},"en-GB-WLS_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-GB-WLS",ename:"Geraint",ssml:!0,name:"Cloud - en-GB-WLS - Male - Geraint"},"cy-GB_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"cy-GB",ename:"Gwyneth",ssml:!0,name:"Cloud - cy-GB - Female - Gwyneth"},"cy-GB_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"cy-GB",ename:"Geraint",ssml:!0,name:"Cloud - cy-GB - Male - Geraint"},"en-IN_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-IN",ename:"Raveena",ssml:!0,name:"Cloud - en-IN - Female - Raveena"},"en-US_CLOUD_Male_Chipmunk":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-US",ename:"Chipmunk",ssml:!0,name:"Cloud - en-US - Male - Chipmunk"},"en-US_CLOUD_Male_Eric":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-US",ename:"Eric",ssml:!0,name:"Cloud - en-US - Male - Eric"},"en-US_CLOUD_Female_Ivy":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Ivy",ssml:!0,name:"Cloud - en-US - Female - Ivy"},"en-US_CLOUD_Female_Jennifer":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Jennifer",ssml:!0,name:"Cloud - en-US - Female - Jennifer"},"en-US_CLOUD_Male_Justin":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-US",ename:"Justin",ssml:!0,name:"Cloud - en-US - Male - Justin"},"en-US_CLOUD_Female_Kendra":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Kendra",ssml:!0,name:"Cloud - en-US - Female - Kendra"},"en-US_CLOUD_Female_Kimberly":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Kimberly",ssml:!0,name:"Cloud - en-US - Female - Kimberly"},"es-ES_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"es-ES",ename:"Conchita",ssml:!0,name:"Cloud - es-ES - Female - Conchita"},"es-ES_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"es-ES",ename:"Enrique",ssml:!0,name:"Cloud - es-ES - Male - Enrique"},"es-US_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"es-US",ename:"Penelope",ssml:!0,name:"Cloud - es-US - Female - Penelope"},"es-US_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"es-US",ename:"Miguel",ssml:!0,name:"Cloud - es-US - Male - Miguel"},"fr-CA_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"fr-CA",ename:"Chantal",ssml:!0,name:"Cloud - fr-CA - Female - Chantal"},"fr-FR_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"fr-FR",ename:"Celine",ssml:!0,name:"Cloud - fr-FR - Female - Celine"},"fr-FR_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"fr-FR",ename:"Mathieu",ssml:!0,name:"Cloud - fr-FR - Male - Mathieu"},"is-IS_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"is-IS",ename:"Dora",ssml:!0,name:"Cloud - is-IS - Female - Dora"},"is-IS_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"is-IS",ename:"Karl",ssml:!0,name:"Cloud - is-IS - Male - Karl"},"it-IT_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"it-IT",ename:"Carla",ssml:!0,name:"Cloud - it-IT - Female - Carla"},"it-IT_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"it-IT",ename:"Giorgio",ssml:!0,name:"Cloud - it-IT - Male - Giorgio"},"nb-NO_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"nb-NO",ename:"Liv",ssml:!0,name:"Cloud - nb-NO - Female - Liv"},"nl-NL_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"nl-NL",ename:"Lotte",ssml:!0,name:"Cloud - nl-NL - Female - Lotte"},"nl-NL_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"nl-NL",ename:"Ruben",ssml:!0,name:"Cloud - nl-NL - Male - Ruben"},"pl-PL_CLOUD_Female_Agnieszka":{gender:"Female",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Agnieszka",ssml:!0,name:"Cloud - pl-PL - Female - Agnieszka"},"pl-PL_CLOUD_Male_Jacek":{gender:"Male",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Jacek",ssml:!0,name:"Cloud - pl-PL - Male - Jacek"},"pl-PL_CLOUD_Female_Ewa":{gender:"Female",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Ewa",ssml:!0,name:"Cloud - pl-PL - Female - Ewa"},"pl-PL_CLOUD_Male_Jan":{gender:"Male",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Jan",ssml:!0,name:"Cloud - pl-PL - Male - Jan"},"pl-PL_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Maja",ssml:!0,name:"Cloud - pl-PL - Female - Maja"},"pt-BR_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"pt-BR",ename:"Vitoria",ssml:!0,name:"Cloud - pt-BR - Female - Vitoria"},"pt-BR_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"pt-BR",ename:"Ricardo",ssml:!0,name:"Cloud - pt-BR - Male - Ricardo"},"pt-PT_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"pt-PT",ename:"Cristiano",ssml:!0,name:"Cloud - pt-PT - Male - Cristiano"},"pt-PT_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"pt-PT",ename:"Ines",ssml:!0,name:"Cloud - pt-PT - Female - Ines"},"ro-RO_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"ro-RO",ename:"Carmen",ssml:!0,name:"Cloud - ro-RO - Female - Carmen"},"sv-SE_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"sv-SE",ename:"Astrid",ssml:!0,name:"Cloud - sv-SE - Female - Astrid"},"tr-TR_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"tr-TR",ename:"Filiz",ssml:!0,name:"Cloud - tr-TR - Female - Filiz"},"ru-RU_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"ru-RU",ename:"Tatyana",ssml:!0,name:"AWS Polly - Русский - Татьяна"},"ru-RU_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"ru-RU",ename:"Maxim",ssml:!0,name:"AWS Polly - Русский - Максим"},"de-DE_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"de-DE",ename:"Marlene",ssml:!0,name:"AWS Polly - Deutsch - Marlene"},"de-DE_AP_Female_Vicky":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"de-DE",ename:"Vicky",ssml:!0,name:"AWS Polly - Deutsch - Vicky"},"de-DE_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"de-DE",ename:"Hans",ssml:!0,name:"AWS Polly - Deutsch - Hans"},"en-US_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Salli",ssml:!0,name:"AWS Polly - en-US - Female - Salli"},"en-US_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Joey",ssml:!0,name:"AWS Polly - en-US - Male - Joey"},"da-DK_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"da-DK",ename:"Naja",ssml:!0,name:"AWS Polly - da-DK - Female - Naja"},"da-DK_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"da-DK",ename:"Mads",ssml:!0,name:"AWS Polly - da-DK - Male - Mads"},"en-AU_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-AU",ename:"Nicole",ssml:!0,name:"AWS Polly - en-AU - Female - Nicole"},"en-AU_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-AU",ename:"Russell",ssml:!0,name:"AWS Polly - en-AU - Male - Russell"},"en-GB_AP_Female_Amy":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB",ename:"Amy",ssml:!0,name:"AWS Polly - en-GB - Female - Amy"},"en-GB_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB",ename:"Brian",ssml:!0,name:"AWS Polly - en-GB - Male - Brian"},"en-GB_AP_Female_Emma":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB",ename:"Emma",ssml:!0,name:"AWS Polly - en-GB - Female - Emma"},"en-GB-WLS_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB-WLS",ename:"Gwyneth",ssml:!0,name:"AWS Polly - en-GB-WLS - Female - Gwyneth"},"en-GB-WLS_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB-WLS",ename:"Geraint",ssml:!0,name:"AWS Polly - en-GB-WLS - Male - Geraint"},"cy-GB_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"cy-GB",ename:"Gwyneth",ssml:!0,name:"AWS Polly - cy-GB - Female - Gwyneth"},"cy-GB_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"cy-GB",ename:"Geraint",ssml:!0,name:"AWS Polly - cy-GB - Male - Geraint"},"en-IN_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-IN",ename:"Raveena",ssml:!0,name:"AWS Polly - en-IN - Female - Raveena"},"en-US_AP_Male_Chipmunk":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Chipmunk",ssml:!0,name:"AWS Polly - en-US - Male - Chipmunk"},"en-US_AP_Male_Eric":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Eric",ssml:!0,name:"AWS Polly - en-US - Male - Eric"},"en-US_AP_Female_Ivy":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Ivy",ssml:!0,name:"AWS Polly - en-US - Female - Ivy"},"en-US_AP_Female_Jennifer":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Jennifer",ssml:!0,name:"AWS Polly - en-US - Female - Jennifer"},"en-US_AP_Male_Justin":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Justin",ssml:!0,name:"AWS Polly - en-US - Male - Justin"},"en-US_AP_Female_Kendra":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Kendra",ssml:!0,name:"AWS Polly - en-US - Female - Kendra"},"en-US_AP_Female_Kimberly":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Kimberly",ssml:!0,name:"AWS Polly - en-US - Female - Kimberly"},"es-ES_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"es-ES",ename:"Conchita",ssml:!0,name:"AWS Polly - es-ES - Female - Conchita"},"es-ES_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"es-ES",ename:"Enrique",ssml:!0,name:"AWS Polly - es-ES - Male - Enrique"},"es-US_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"es-US",ename:"Penelope",ssml:!0,name:"AWS Polly - es-US - Female - Penelope"},"es-US_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"es-US",ename:"Miguel",ssml:!0,name:"AWS Polly - es-US - Male - Miguel"},"fr-CA_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"fr-CA",ename:"Chantal",ssml:!0,name:"AWS Polly - fr-CA - Female - Chantal"},"fr-FR_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"fr-FR",ename:"Celine",ssml:!0,name:"AWS Polly - fr-FR - Female - Celine"},"fr-FR_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"fr-FR",ename:"Mathieu",ssml:!0,name:"AWS Polly - fr-FR - Male - Mathieu"},"is-IS_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"is-IS",ename:"Dora",ssml:!0,name:"AWS Polly - is-IS - Female - Dora"},"is-IS_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"is-IS",ename:"Karl",ssml:!0,name:"AWS Polly - is-IS - Male - Karl"},"it-IT_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"it-IT",ename:"Carla",ssml:!0,name:"AWS Polly - it-IT - Female - Carla"},"it-IT_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"it-IT",ename:"Giorgio",ssml:!0,name:"AWS Polly - it-IT - Male - Giorgio"},"nb-NO_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"nb-NO",ename:"Liv",ssml:!0,name:"AWS Polly - nb-NO - Female - Liv"},"nl-NL_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"nl-NL",ename:"Lotte",ssml:!0,name:"AWS Polly - nl-NL - Female - Lotte"},"nl-NL_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"nl-NL",ename:"Ruben",ssml:!0,name:"AWS Polly - nl-NL - Male - Ruben"},"pl-PL_AP_Female_Agnieszka":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Agnieszka",ssml:!0,name:"AWS Polly - pl-PL - Female - Agnieszka"},"pl-PL_AP_Male_Jacek":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Jacek",ssml:!0,name:"AWS Polly - pl-PL - Male - Jacek"},"pl-PL_AP_Female_Ewa":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Ewa",ssml:!0,name:"AWS Polly - pl-PL - Female - Ewa"},"pl-PL_AP_Male_Jan":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Jan",ssml:!0,name:"AWS Polly - pl-PL - Male - Jan"},"pl-PL_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Maja",ssml:!0,name:"AWS Polly - pl-PL - Female - Maja"},"pt-BR_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pt-BR",ename:"Vitoria",ssml:!0,name:"AWS Polly - pt-BR - Female - Vitoria"},"pt-BR_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"pt-BR",ename:"Ricardo",ssml:!0,name:"AWS Polly - pt-BR - Male - Ricardo"},"pt-PT_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"pt-PT",ename:"Cristiano",ssml:!0,name:"AWS Polly - pt-PT - Male - Cristiano"},"pt-PT_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pt-PT",ename:"Ines",ssml:!0,name:"AWS Polly - pt-PT - Female - Ines"},"ro-RO_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"ro-RO",ename:"Carmen",ssml:!0,name:"AWS Polly - ro-RO - Female - Carmen"},"sv-SE_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"sv-SE",ename:"Astrid",ssml:!0,name:"AWS Polly - sv-SE - Female - Astrid"},"tr-TR_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"tr-TR",ename:"Filiz",ssml:!0,name:"AWS Polly - tr-TR - Female - Filiz"}};class Rc extends at{constructor(s){super(s,Rc.getStaticData())}static compile(s,i){return s.text?`// Sayit ${s.text||""} +`)}(${i}, ${r}, ${l})`,2]}const $R=window.Blockly.common.createBlockDefinitionsFromJsonArray([mR]);$R[CC];function bR(){window.Blockly.FieldMultilineInput||(window.Blockly.fieldRegistry.register("field_multilinetext",Rc),window.Blockly.JavaScript.forBlock.text_multiline=iR,window.Blockly.FieldMultilineInput=Rc,Object.assign(window.Blockly.Blocks,window.Blockly.common.createBlockDefinitionsFromJsonArray([{type:"text_multiline",message0:"%1 %2",args0:[{type:"field_image",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAARCAYAAADpPU2iAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAdhgAAHYYBXaITgQAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS42/U4J6AAAAP1JREFUOE+Vks0KQUEYhjmRIja4ABtZ2dm5A3t3Ia6AUm7CylYuQRaUhZSlLZJiQbFAyRnPN33y01HOW08z8873zpwzM4F3GWOCruvGIE4/rLaV+Nq1hVGMBqzhqlxgCys4wJA65xnogMHsQ5lujnYHTejBBCK2mE4abjCgMGhNxHgDFWjDSG07kdfVa2pZMf4ZyMAdWmpZMfYOsLiDMYMjlMB+K613QISRhTnITnsYg5yUd0DETmEoMlkFOeIT/A58iyK5E18BuTBfgYXfwNJv4P9/oEBerLylOnRhygmGdPpTTBZAPkde61lbQe4moWUvYUZYLfUNftIY4zwA5X2Z9AYnQrEAAAAASUVORK5CYII=",width:12,height:17,alt:"¶"},{type:"field_multilinetext",name:"TEXT",text:""}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_TEXT_HELPURL}",tooltip:"%{BKY_TEXT_TEXT_TOOLTIP}",extensions:["parent_tooltip_when_inline"]}]))),window.Blockly.FieldColour||(window.Blockly.fieldRegistry.register("field_colour",lm),window.Blockly.JavaScript.forBlock.colour_picker=aR,window.Blockly.JavaScript.forBlock.colour_blend=fR,window.Blockly.JavaScript.forBlock.colour_random=uR,window.Blockly.JavaScript.forBlock.colour_rgb=pR,window.Blockly.FieldColour=lm,Object.assign(window.Blockly.Blocks,window.Blockly.common.createBlockDefinitionsFromJsonArray([{type:"colour_picker",message0:"%1",args0:[{type:"field_colour",name:"COLOUR",colour:"#ff0000"}],output:"Colour",helpUrl:"%{BKY_COLOUR_PICKER_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_PICKER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]}])),Object.assign(window.Blockly.Blocks,window.Blockly.common.createBlockDefinitionsFromJsonArray([{type:"colour_random",message0:"%{BKY_COLOUR_RANDOM_TITLE}",output:"Colour",helpUrl:"%{BKY_COLOUR_RANDOM_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_RANDOM_TOOLTIP}"}])),Object.assign(window.Blockly.Blocks,window.Blockly.common.createBlockDefinitionsFromJsonArray([{type:"colour_rgb",message0:"%{BKY_COLOUR_RGB_TITLE} %{BKY_COLOUR_RGB_RED} %1 %{BKY_COLOUR_RGB_GREEN} %2 %{BKY_COLOUR_RGB_BLUE} %3",args0:[{type:"input_value",name:"RED",check:"Number",align:"RIGHT"},{type:"input_value",name:"GREEN",check:"Number",align:"RIGHT"},{type:"input_value",name:"BLUE",check:"Number",align:"RIGHT"}],output:"Colour",helpUrl:"%{BKY_COLOUR_RGB_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_RGB_TOOLTIP}"}])),Object.assign(window.Blockly.Blocks,window.Blockly.common.createBlockDefinitionsFromJsonArray([{type:"colour_blend",message0:"%{BKY_COLOUR_BLEND_TITLE} %{BKY_COLOUR_BLEND_COLOUR1} %1 %{BKY_COLOUR_BLEND_COLOUR2} %2 %{BKY_COLOUR_BLEND_RATIO} %3",args0:[{type:"input_value",name:"COLOUR1",check:"Colour",align:"RIGHT"},{type:"input_value",name:"COLOUR2",check:"Colour",align:"RIGHT"},{type:"input_value",name:"RATIO",check:"Number",align:"RIGHT"}],output:"Colour",helpUrl:"%{BKY_COLOUR_BLEND_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_BLEND_TOOLTIP}"}])));const a=window.Blockly.JavaScript;a.forBlock&&Object.keys(a).forEach(s=>{typeof a[s]=="function"&&(a.forBlock[s]||(console.log(`Migrating Blockly.JavaScript.${s} to Blockly.JavaScript.forBlock.${s}`),a.forBlock[s]=a[s],delete a[s]))})}let cc=!1,uc=!1,yg=null,_g=null;const hw=[];function TC(a,s,i,r){var l;if(r=r||[],(a.tagName==="BLOCK"||a.tagName==="block")&&(i=a.id),a.tagName==="FIELD"||a.tagName==="field")for(let c=0;cTC(c,s,i,r)),r}class et extends _e.Component{blockly=null;blocklyWorkspace=null;originalCode;someSelected=null;changeTimer=null;someSelectedTime=0;ignoreChanges=!1;blinkBlock;onResizeBind;didUpdate=null;lastCommand="";lastSearch;static Blockly=window.Blockly;constructor(s){super(s),this.state={languageOwnLoaded:uc,languageBlocklyLoaded:cc,changed:!1,message:"",error:"",themeType:this.props.themeType,exportText:"",importText:!1,searchText:this.props.searchText||"",showInputPrompt:null},this.originalCode=s.code||"",this.someSelected=null,this.onResizeBind=this.onResize.bind(this),this.lastSearch=this.props.searchText||"",this.blinkBlock=null,bR(),et.Blockly.dialog.setPrompt(this.onShowNameDialog),this.loadLanguages()}onShowNameDialog=(s,i,r)=>{this.setState({showInputPrompt:{promptText:s,defaultText:i,callback:r,value:i}})};static loadJS(s,i,r){const l=document.createElement("script");try{l.src=s,l.onload=i,l.onerror=i,(r||window.document.body).appendChild(l)}catch(c){console.error(`Cannot load ${s}: ${c}`),i&&i()}}static loadScripts(s,i){if(!(s!=null&&s.length)){i&&i();return}const r=s.pop();r&&!hw.includes(r)?(hw.push(r),et.loadJS(`../../adapter/${r}/blockly.js`,()=>setTimeout(()=>et.loadScripts(s,i),0))):setTimeout(()=>et.loadScripts(s,i),0)}static loadCustomBlockly(s,i){var l;const r=[];for(const c in s)!Object.prototype.hasOwnProperty.call(s,c)||!s[c]||!c.match(/^system\.adapter\./)||s[c].type!=="adapter"||(l=s[c].common)!=null&&l.blockly&&(console.log(`Detected custom blockly: ${s[c].common.name}`),r.push(s[c].common.name));et.loadScripts(r,i)}static loadXMLDoc(s){let i;return window.DOMParser?i=r=>new window.DOMParser().parseFromString(r,"text/xml"):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("Microsoft.XMLDOM")?i=r=>{const l=new window.ActiveXObject("Microsoft.XMLDOM");return l.async="false",l.loadXML(r),l}:i=()=>null,i(s)}searchBlocks(s){if(this.blocklyWorkspace){const i=et.Blockly.Xml.workspaceToDom(this.blocklyWorkspace),r=TC(i,s.toLowerCase());return console.log(`Search "${s}" found blocks: ${r.length?JSON.stringify(r):"none"}`),r}return[]}searchId(){const s=this.lastSearch?this.searchBlocks(this.lastSearch):null;s!=null&&s.length?(this.someSelected=s,this.someSelected.forEach(i=>{var r;return(r=this.blocklyWorkspace)==null?void 0:r.highlightBlock(i,!0)}),this.someSelectedTime=Date.now()):this.someSelected&&(this.someSelected.forEach(i=>{var r;return(r=this.blocklyWorkspace)==null?void 0:r.highlightBlock(i,!1)}),this.someSelected=null)}UNSAFE_componentWillReceiveProps(s){s.command&&this.lastCommand!==s.command&&(this.lastCommand=s.command,setTimeout(()=>this.lastCommand="",300),this.lastCommand==="check"?this.blocklyCheckBlocks((i,r)=>{i?(r&&et.blocklyBlinkBlock(r),this.setState({error:{text:x.I18n.t(i),title:x.I18n.t("Error was found")}}),this.blinkBlock=r):this.setState({message:x.I18n.t("Ok")})}):this.lastCommand==="export"?this.exportBlocks():this.lastCommand==="import"&&this.importBlocks()),s.searchText!==this.lastSearch&&(this.lastSearch=s.searchText,this.searchId()),this.state.themeType!==s.themeType&&this.setState({themeType:s.themeType},()=>this.updateBackground()),this.originalCode!==s.code&&(this.originalCode=s.code||"",this.loadCode(),this.searchId())}loadLanguages(){if(!cc){const s=window.document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("src",`google-blockly/msg/js/${x.I18n.getLanguage()}.js`),s.onload=()=>{cc=!0,this.setState({languageBlocklyLoaded:cc})},window.document.getElementsByTagName("head")[0].appendChild(s)}if(!uc){const s=window.document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("src",`google-blockly/own/msg/${x.I18n.getLanguage()}.js`),s.onload=()=>{uc=!0,this.setState({languageOwnLoaded:uc})},window.document.getElementsByTagName("head")[0].appendChild(s)}}onResize(){this.blocklyWorkspace&&et.Blockly.svgResize(this.blocklyWorkspace)}static jsCode2Blockly(s){s=s||"";const i=s.split(/[\r\n]+|\r|\n/g);let r="";for(let c=i.length-1;c>=0;c--)if(i[c].substring(0,2)==="//"){r=i[c].substring(2);break}if(r.substring(0,4)==="s.select(),i),setTimeout(()=>s.unselect(),i+150)}blocklyRemoveOrphanedShadows(){if(this.blocklyWorkspace){const s=this.blocklyWorkspace.getAllBlocks();let i;for(let r=0;i=s[r];r++)if(i.isShadow()){const l=i.getConnections_(!0);let c;for(let d=0;c=l[d];d++)if(!c.targetConnection){i.dispose();break}}}}blocklyCheckBlocks(s){let i;if(!this.blocklyWorkspace||this.blocklyWorkspace.getAllBlocks().length===0)return s&&s("no blocks found"),!1;let r=this.blocklyGetUnconnectedBlock();return r?i="not properly connected":(r=this.blocklyGetBlockWithWarning(),r&&(i="warning on this block")),r?(s?s(i,r):et.blocklyBlinkBlock(r),!1):(s(),!0)}blocklyGetUnconnectedBlock(){var r;const s=(r=this.blocklyWorkspace)==null?void 0:r.getAllBlocks();let i;if(s)for(let l=0;i=s[l];l++){const c=i.getConnections_(!0);let d;for(let h=0;d=c[h];h++)if(!d.sourceBlock_||(d.type===et.Blockly.INPUT_VALUE||d.type===et.Blockly.OUTPUT_VALUE)&&!d.targetConnection&&!d._optional)return i}return null}blocklyGetBlockWithWarning(){var r;const s=(r=this.blocklyWorkspace)==null?void 0:r.getAllBlocks();let i;if(s){for(let l=0;i=s[l];l++)if(i.warning)return i}return null}blocklyCode2JSCode(s){if(!this.blocklyWorkspace)return"";let i=et.Blockly.JavaScript.workspaceToCode(this.blocklyWorkspace);if(!s){i+=` +`;const r=et.Blockly.Xml.workspaceToDom(this.blocklyWorkspace),l=et.Blockly.Xml.domToText(r);i+=`//${btoa(encodeURIComponent(l))}`}return i}exportBlocks(){if(!this.blocklyWorkspace)return;let s;const i=et.Blockly.getSelected();if(i){const r=et.Blockly.Xml.blockToDom(i),l=i.getRelativeToSurfaceXY();r.setAttribute("x",(i.RTL?-l.x:l.x).toString()),r.setAttribute("y",l.y.toString()),s=et.Blockly.Xml.domToPrettyText(r)}else{const r=et.Blockly.Xml.workspaceToDom(this.blocklyWorkspace);s=et.Blockly.Xml.domToPrettyText(r)}this.setState({exportText:s})}importBlocks(){this.setState({importText:!0})}onImportBlocks(s){if(this.blocklyWorkspace&&(s=(s||"").trim(),s))try{s.startsWith("${s}`),s=s.replace(/[\n\r]/g,"").replace(/.*<\/variables>/g,""),window.scripts.loading=!0;const i=et.Blockly.utils.xml.textToDom(s);et.Blockly.Xml.appendDomToWorkspace(i,this.blocklyWorkspace),window.scripts.loading=!1,this.onBlocklyChanged()}catch(i){this.setState({error:{text:i.toString(),title:x.I18n.t("Import error")}})}}loadCode(){if(this.blocklyWorkspace){this.ignoreChanges=!0,this.blocklyWorkspace.clear();try{const s=et.jsCode2Blockly(this.originalCode)||'';window.scripts.loading=!0;const i=et.Blockly.utils.xml.textToDom(s);et.Blockly.Xml.domToWorkspace(i,this.blocklyWorkspace),window.scripts.loading=!1}catch(s){console.error(s),setTimeout(()=>this.setState({error:x.I18n.t("Cannot extract Blockly code!")}))}setTimeout(()=>this.ignoreChanges=!1,100)}}onBlocklyChanged(){this.blocklyRemoveOrphanedShadows(),this.setState({changed:!0}),this.onChange()}async componentDidUpdate(){if(!this.blockly||(this.didUpdate&&(clearTimeout(this.didUpdate),this.didUpdate=null),this.blocklyWorkspace))return;window.addEventListener("resize",this.onResizeBind,!1),yg=yg||await this.getToolbox(),_g=_g||et.Blockly.utils.xml.textToDom(yg),this.blocklyWorkspace=et.Blockly.inject(this.blockly,{renderer:"thrasos",theme:this.state.themeType==="dark"?dw:"classic",media:"google-blockly/media/",toolbox:_g,zoom:{controls:!0,wheel:!1,startScale:1,maxScale:3,minScale:.3,scaleSpeed:1.2,pinch:!0},move:{scrollbars:{horizontal:!0,vertical:!0},drag:!0,wheel:!0},trashcan:!0,grid:{spacing:25,length:1,snap:!0},sounds:!1}),window.scripts={blocklyWorkspace:this.blocklyWorkspace},this.blocklyWorkspace.registerToolboxCategoryCallback("PROCEDURE",window.Blockly.Procedures.flyoutCategoryNew),this.blocklyWorkspace.addChangeListener(i=>{var r;if(this.someSelected&&Date.now()-this.someSelectedTime>500){const l=(r=this.blocklyWorkspace)==null?void 0:r.getAllBlocks();this.someSelected=null,l==null||l.forEach(c=>c.removeSelect())}[et.Blockly.Events.UI,et.Blockly.Events.CREATE,et.Blockly.Events.VIEWPORT_CHANGE].includes(i.type)||this.ignoreChanges||(this.changeTimer&&clearTimeout(this.changeTimer),this.changeTimer=setTimeout(()=>{this.changeTimer=null,this.onBlocklyChanged()},200))}),this.loadCode(),this.onResize();const s=document.getElementsByClassName("blocklyToolboxDiv")[0];this.blockly.appendChild(s),this.updateBackground(),setTimeout(()=>this.searchId(),200)}updateBackground(){var s;this.state.themeType==="dark"?(s=this.blocklyWorkspace)==null||s.setTheme(dw):this.blocklyWorkspace&&(this.blocklyWorkspace.getThemeManager(),this.blocklyWorkspace.setTheme(et.Blockly.Themes.Classic))}componentWillUnmount(){this.blocklyWorkspace&&(this.blocklyWorkspace.dispose(),this.blocklyWorkspace=null,this.changeTimer&&clearTimeout(this.changeTimer),this.changeTimer=null,window.removeEventListener("resize",this.onResizeBind))}onChange(){this.originalCode=this.blocklyCode2JSCode(),this.props.onChange&&this.props.onChange(this.originalCode)}async getToolbox(s){const i=window.document.getElementById("toolbox");let r=i==null?void 0:i.outerHTML;if(!r)return s?(console.error("Cannot load blocks!"),""):new Promise(l=>{setTimeout(()=>l(this.getToolbox(!0)),500)});if(r=r.replace(/{(\w+)}/g,(l,c)=>window.MSG[c]),window.Blockly.CustomBlocks){let l="";const c=x.I18n.getLanguage();for(let d=0;d`;for(const f in p.blocks)Object.prototype.hasOwnProperty.call(p.blocks,f)&&(l+=p.blocks[f]);l+=""}r=r.replace("%%CUSTOM_BLOCKS%%",l)}return r}renderMessageDialog(){return this.state.message?m.jsx(x.Message,{text:typeof this.state.message=="object"?this.state.message.text:this.state.message,title:typeof this.state.message=="object"?this.state.message.title:"",onClose:()=>this.setState({message:""})},"dialogMessage"):null}renderErrorDialog(){return this.state.error?m.jsx(su,{text:typeof this.state.error=="object"?this.state.error.text.toString():this.state.error,title:typeof this.state.error=="object"?this.state.error.title:"",onClose:()=>{this.blinkBlock&&(et.blocklyBlinkBlock(this.blinkBlock),this.blinkBlock=null),this.setState({error:""})}},"dialogError"):null}renderExportDialog(){return this.state.exportText?m.jsx(sR,{themeType:this.state.themeType,onClose:()=>this.setState({exportText:""}),text:this.state.exportText,scriptId:this.props.scriptId},"dialogExport"):null}renderImportDialog(){return this.state.importText?m.jsx(Gm,{themeType:this.props.themeType,onClose:s=>{this.setState({importText:!1}),this.onImportBlocks(s)}},"dialogImport"):null}renderDialogPrompt(){return this.state.showInputPrompt?m.jsxs(Pt,{onClose:()=>{var i;const s=(i=this.state.showInputPrompt)==null?void 0:i.callback;s&&s(null),this.setState({showInputPrompt:null})},maxWidth:"sm",fullWidth:!0,open:!0,children:[m.jsx(Xt,{children:this.state.showInputPrompt.promptText}),m.jsx(Wt,{children:m.jsx(Eo,{variant:"standard",fullWidth:!0,autoFocus:!0,value:this.state.showInputPrompt.value,onKeyUp:s=>{var i,r;if(s.key==="Enter"){const l=(i=this.state.showInputPrompt)==null?void 0:i.callback,c=(r=this.state.showInputPrompt)==null?void 0:r.value;l&&l(c===void 0?null:c),this.setState({showInputPrompt:null})}},onChange:s=>{var r,l;const i={...this.state.showInputPrompt};(r=this.state.showInputPrompt)!=null&&r.callback&&(i.callback=(l=this.state.showInputPrompt)==null?void 0:l.callback),i.value=s.target.value,this.setState({showInputPrompt:i})}})}),m.jsxs(Bt,{children:[m.jsx(Ue,{variant:"contained",disabled:!this.state.showInputPrompt.value,onClick:()=>{var r,l;const s=(r=this.state.showInputPrompt)==null?void 0:r.callback,i=(l=this.state.showInputPrompt)==null?void 0:l.value;s&&s(i===void 0?null:i),this.setState({showInputPrompt:null})},color:"primary",startIcon:m.jsx(qo,{}),children:x.I18n.t("Apply")}),m.jsx(Ue,{color:"grey",variant:"contained",onClick:()=>{var i;const s=(i=this.state.showInputPrompt)==null?void 0:i.callback;s&&s(null),this.setState({showInputPrompt:null})},startIcon:m.jsx(so,{}),children:x.I18n.t("Close")})]})]},"inputDialog"):null}render(){return this.state.languageBlocklyLoaded&&this.state.languageOwnLoaded?(this.didUpdate=setTimeout(()=>{this.didUpdate=null,this.componentDidUpdate()},100),[m.jsx("div",{ref:s=>this.blockly=s,style:{width:"100%",height:"100%",position:"relative"}},"blocklyDOM"),this.renderDialogPrompt(),this.renderMessageDialog(),this.renderErrorDialog(),this.renderExportDialog(),this.renderImportDialog()]):null}}const vR=Object.freeze(Object.defineProperty({__proto__:null,default:et},Symbol.toStringTag,{value:"Module"})),yR="_nameCard_15el3_28",_R="_iconThemCard_15el3_40",wR="_iconThemCardSelectable_15el3_49",kR="_iconHelp_15el3_53",CR="_blockName_15el3_64",TR="_controlMenuTop_15el3_123",SR="_debugInfo_15el3_132",ER="_tagCard_15el3_142",IR="_displayFlex_15el3_161",xR="_blockMarginTop_15el3_166",DR="_nameBlock_15el3_167",AR="_frontText_15el3_171",RR="_backText_15el3_177",OR="_iconTag_15el3_181",NR="_displayItalic_15el3_191",Oe={nameCard:yR,iconThemCard:_R,iconThemCardSelectable:wR,iconHelp:kR,blockName:CR,controlMenuTop:TR,debugInfo:SR,tagCard:ER,displayFlex:IR,blockMarginTop:xR,nameBlock:DR,frontText:AR,backText:RR,iconTag:OR,displayItalic:NR},MR="_root_1dr6a_1",LR="_square_1dr6a_11",PR="_icon_1dr6a_16",wg={root:MR,square:LR,icon:PR},Jr=({fullWidth:a,size:s,onClick:i,style:r,className:l,value:c,square:d,icon:h})=>m.jsx(Ue,{variant:"outlined",color:"primary",onClick:i,fullWidth:a,style:r,className:x.Utils.clsx(wg.root,l,d?wg.square:""),size:s||"medium",children:h?m.jsx(x.Icon,{className:wg.icon,src:h}):c}),BR="_root_1ucda_1",jR={root:BR},FR=({size:a,value:s,title:i,onChange:r,className:l,customValue:c,disabled:d})=>{const[h,p]=kt(!1);return m.jsxs(m.Fragment,{children:[m.jsx(wc,{disabled:d,checked:!!(c?s:h),className:x.Utils.clsx(jR.root,l),onChange:f=>{c&&p(f.target.checked),r&&r(f.target.checked)},size:a||"medium"}),i||null]})},SC=dm(FR),zR="_root_19roy_1",pw={root:zR},Ei=a=>{const[s,i]=kt(""),{value:r,type:l,error:c,className:d,icon:h,label:p,style:f,onChange:b,fullWidth:y,autoComplete:w,customValue:v,autoFocus:_,rows:$,size:S,variant:T,multiline:E,disabled:D}=Object.assign({value:"",type:"text",error:"",className:null,table:!1,native:{},variant:"standard",size:"medium",component:null,styleComponentBlock:null,fullWidth:!1,autoComplete:"",customValue:!1,autoFocus:!1,rows:1},a);return m.jsx(Eo,{error:!!c,autoFocus:_,fullWidth:y,label:p,disabled:D,variant:T,multiline:E,rows:$,value:v?r:s,type:l,helperText:c,style:f,className:x.Utils.clsx(pw.root,d),autoComplete:w,onChange:M=>{!v&&i(M.target.value),b&&b(M.target.value)},slotProps:{input:{endAdornment:h?m.jsx(Aw,{position:"end",children:m.jsx(x.Icon,{className:pw.icon,src:h})}):null}},margin:"normal",size:S})},UR={formControl:{m:"10px 0","& .MuiFormControl-marginNormal":{mt:0,mb:0},"& > *":{color:"#2d0440 !important"},"& .MuiSelect-icon":{color:"#81688c"},"& label.Mui-focused":{color:"#81688c"},"& .MuiInput-underline:after":{borderBottomColor:"#510573"},"& .MuiInput-underline:before":{borderBottomColor:"#81688c"},"& .MuiInput-underline:hover:before":{borderBottomColor:"#81688c"}}},HR=({multiple:a,value:s,customValue:i,socket:r,title:l,attr:c,adapter:d,style:h,onChange:p,onInstanceHide:f})=>{const[b,y]=kt(s||"test1"),[w,v]=kt([]);return Lt(()=>{r==null||r.getAdapterInstances(d).then(_=>{const $=_.map(S=>({value:S._id.replace("system.adapter.",""),title:S._id.replace("system.adapter.","")}));$.length===1?f($[0].value):$.unshift({value:d,title:x.I18n.t("All")}),v($)})},[r,d,f]),m.jsxs(Di,{sx:UR.formControl,fullWidth:!0,style:h,children:[m.jsx(Ai,{variant:"standard",value:(i?s:b)||"_",fullWidth:!0,multiple:a,renderValue:_=>a&&Array.isArray(_)?_.join(", "):_,onChange:_=>{!i&&y(_.target.value),p(_.target.value)},input:c?m.jsx(Pn,{name:c,id:`${c}-helper`}):m.jsx(Pn,{name:c}),children:w.map(_=>m.jsx(it,{style:{placeContent:"space-between"},value:_.value||"_",children:x.I18n.t(_.title)},`key-${_.value}`))}),l?m.jsx(Ow,{children:x.I18n.t(l)}):null]})},WR="_modalWrapper_587ci_33",GR="_modalDialog_587ci_40",gw={modalWrapper:WR,modalDialog:GR},cm=({onClose:a,children:s,titleButtonApply:i,titleButtonClose:r,onApply:l,className:c,textInput:d,defaultValue:h,disabled:p})=>{const[f,b]=kt(h||""),[y]=kt(h||"");return m.jsxs(Pt,{open:!0,maxWidth:"md",disableEscapeKeyDown:!1,onClose:a,classes:{paper:gw.modalDialog},className:gw.modalWrapper,children:[m.jsxs(Wt,{children:[d&&m.jsx(Ei,{className:c,autoComplete:"off",fullWidth:!0,variant:"outlined",size:"medium",rows:10,multiline:!0,value:f,onChange:b,customValue:!0}),!d&&s]}),m.jsxs(Bt,{children:[m.jsx(Ue,{disabled:p===void 0?y===f:p,onClick:()=>l(d?f:null),variant:"contained",color:"primary",children:x.I18n.t(i||"Ok")}),m.jsx(Ue,{color:"grey",onClick:a,variant:"contained",children:x.I18n.t(r||"Cancel")})]})]})},VR="_root_15mo1_1",KR={root:VR},YR=({multiple:a,value:s,customValue:i,title:r,attr:l,options:c,style:d,onChange:h,className:p,doNotTranslate:f,doNotTranslate2:b})=>{const[y,w]=kt(s===void 0?c[0].value:s),v=i?s:y,_=v===""||v===null||v===void 0?"_":v;return m.jsxs(Di,{variant:"standard",className:x.Utils.clsx(KR.root,p),fullWidth:!0,style:d,children:[m.jsxs(Ai,{variant:"standard",value:_,fullWidth:!0,multiple:a,renderValue:$=>{if(a&&Array.isArray($)){$.sort();let T=$.indexOf("0");T!==-1&&($.splice(T,1),$.push("0")),T=$.indexOf("_"),T!==-1&&($.splice(T,1),$.unshift("_"));const E=c.find(M=>M.only);return E&&$.includes(E.value)?E.titleShort?f?E.titleShort:x.I18n.t(E.titleShort):f?E.title:x.I18n.t(E.title):$.map(M=>c.find(P=>P.value===M||M==="_"&&P.value==="")||M).map(M=>typeof M=="object"?M.titleShort?f?M.titleShort:x.I18n.t(M.titleShort):f?M.title:x.I18n.t(M.title):f?M:x.I18n.t(M)).join(", ")}const S=c?c.find(T=>T.value===$||$==="_"&&T.value===""):null;return S!=null&&S.title?f?S==null?void 0:S.title:x.I18n.t(S==null?void 0:S.title):$},onChange:$=>{if(i||w($.target.value),a){const S=$.target.value,T=c.find(E=>E.only);if(T){const E=T.value;if(S.length===c.length-1&&S.includes(E))return h(S.filter(D=>D!==E),l);if(S.includes(E))return h(c.map(D=>D.value),l)}}h($.target.value,l)},input:l?m.jsx(Pn,{name:l,id:`${l}-helper`}):m.jsx(Pn,{name:l}),children:[!a&&(c==null?void 0:c.map($=>m.jsxs(it,{style:{placeContent:"space-between"},value:$.value===""||$.value===null||$.value===void 0?"_":$.value,children:[f?$.title:x.I18n.t($.title),$.title2&&m.jsx("div",{children:b?$.title2:x.I18n.t($.title2)})]},`key-${$.value}`))),a&&(c==null?void 0:c.map($=>m.jsxs(it,{style:{placeContent:"space-between"},value:$.value||"_",children:[f?$.title:x.I18n.t($.title)," ",m.jsx(SC,{customValue:!0,value:s==null?void 0:s.includes($.value)})]},`key-${$.value}`)))]}),r?m.jsx(Ow,{children:x.I18n.t(r)}):null]})},JR="_root_1gt4d_1",qR="_mark_1gt4d_27",mw={root:JR,mark:qR},XR=({size:a,value:s,style:i,onChange:r,className:l,customValue:c,min:d,max:h,step:p,unit:f})=>{const[b,y]=kt(0);d=d!==void 0?d:0,h=h!==void 0?h:0,p=p!==void 0?p:(h-d)/100;const w=[{value:d,label:d+(f||"")},{value:h,label:h+(f||"")}];return m.jsx(qT,{defaultValue:c?s:b,"aria-labelledby":"discrete-slider",valueLabelDisplay:"auto",classes:{mark:mw.mark},marks:w,step:p,min:d,max:h,value:c?s:b,style:i,className:x.Utils.clsx(mw.root,l),onChange:(v,_)=>{Array.isArray(_)?(!c&&y(_[0]),r(_[0])):(!c&&y(_),r(_))},size:a||"medium"})},ZR="_root_rzul6_1",QR={root:ZR},eO=({label:a,size:s,value:i,style:r,onChange:l,className:c,customValue:d})=>{const[h,p]=kt(!1);return m.jsx(Mg,{className:QR.root,control:m.jsx(Nw,{checked:d?i:h,style:r,className:c,onChange:f=>{d||p(f.target.checked),l(f.target.checked)},size:s||"medium"}),label:a??"all"})},tO=dm(eO),sO="_root_135pm_1",oO={root:sO},iO=({value:a,style:s,onChange:i,className:r})=>m.jsx(Eo,{variant:"standard",id:"time",type:"time",onChange:l=>i(l.currentTarget.value),value:a,className:x.Utils.clsx(oO.root,r),fullWidth:!0,style:s,slotProps:{htmlInput:{step:300},inputLabel:{shrink:!0}}}),nO="_root_135pm_1",dc={root:nO},kg=[31,29,31,30,31,30,31,31,30,31,30,31],rO=({value:a,onChange:s,className:i,style:r})=>{const[l,c]=(a||"01.01").toString().split(".");let d=parseInt(c,10)||0,h=parseInt(l,10)||0;h>12?h=12:h<0&&(h=0),d>kg[h]?d=kg[h]:d<0&&(d=0);const p=[];for(let f=0;fs(`${f.target.value.toString().padStart(2,"0")}.${d.toString().padStart(2,"0")}`),value:h,children:[m.jsx(it,{style:{placeContent:"space-between"},value:0,children:x.I18n.t("Any month")},0),m.jsx(it,{style:{placeContent:"space-between"},value:1,children:x.I18n.t("January")},1),m.jsx(it,{style:{placeContent:"space-between"},value:2,children:x.I18n.t("February")},2),m.jsx(it,{style:{placeContent:"space-between"},value:3,children:x.I18n.t("March")},3),m.jsx(it,{style:{placeContent:"space-between"},value:4,children:x.I18n.t("April")},4),m.jsx(it,{style:{placeContent:"space-between"},value:5,children:x.I18n.t("May")},5),m.jsx(it,{style:{placeContent:"space-between"},value:6,children:x.I18n.t("June")},6),m.jsx(it,{style:{placeContent:"space-between"},value:7,children:x.I18n.t("July")},7),m.jsx(it,{style:{placeContent:"space-between"},value:8,children:x.I18n.t("August")},8),m.jsx(it,{style:{placeContent:"space-between"},value:9,children:x.I18n.t("September")},9),m.jsx(it,{style:{placeContent:"space-between"},value:10,children:x.I18n.t("October")},10),m.jsx(it,{style:{placeContent:"space-between"},value:11,children:x.I18n.t("November")},11),m.jsx(it,{style:{placeContent:"space-between"},value:12,children:x.I18n.t("December")},12)]})}),m.jsx(Di,{variant:"standard",className:x.Utils.clsx(dc.root,i),style:r,children:m.jsxs(Ai,{variant:"standard",className:x.Utils.clsx(dc.root,i),margin:"dense",label:x.I18n.t("Date"),onChange:f=>s(`${h.toString().padStart(2,"0")}.${f.target.value.toString().padStart(2,"0")}`),value:d,children:[m.jsx(it,{style:{placeContent:"space-between"},value:0,children:x.I18n.t("Any")},"A"),p.map(f=>m.jsx(it,{style:{placeContent:"space-between"},value:f,children:f},f))]})})]})},Cg={},aO={Shuffle:bx,Apps:rx,Functions:hx,Language:kS,AddBox:nx,Pause:bc,Subject:yx,PlayForWork:fx,Brightness3:ax,HelpOutline:pk,Storage:vx,AccessTime:ix,PlayArrow:Wg,FlashOn:ux};function fw({iconName:a,className:s,adapter:i,socket:r,onClick:l,style:c}){const[d,h]=kt("");if(Lt(()=>{i&&r&&(Cg[i]instanceof Promise||(Cg[i]=r.getObject(`system.adapter.${i}`)),Cg[i].then(f=>{var b;return((b=f==null?void 0:f.common)==null?void 0:b.icon)&&h(`../../adapter/${i}/${f.common.icon}`)}))},[i,r]),i)return m.jsx("img",{onClick:f=>l&&l(f),src:d||"",className:s,style:c,alt:""});const p=a&&aO[a]||CS;return m.jsx(p,{className:s,style:c,onClick:f=>l&&l(f)})}let Tg;function lO(a){return Tg=Tg||x.I18n.getLanguage(),a&&typeof a=="object"?a[Tg]||a.en:a||""}function Ln(a){return a===null?"null":a===void 0?"undefined":Array.isArray(a)?a.join(", "):typeof a=="object"?JSON.stringify(a):a.toString()}class at extends xw{debugHideTimeout=null;lastObjectIdChange=0;enableSimulationProcessing=!1;lastDebugMessage=0;debugMessageTimeout=null;static getStaticData(){return{acceptedBy:"actions",name:"Not found",id:"ActionEmpty",icon:"Shuffle"}}static compile(s,i){return""}constructor(s,i){super(s),i||={};const r=s.settings||{tagCard:i.tagCardArray?typeof i.tagCardArray[0]!="string"?i.tagCardArray[0].title:i.tagCardArray[0]:""};!r.tagCard&&i.tagCardArray&&(r.tagCard=typeof i.tagCardArray[0]!="string"?i.tagCardArray[0].title:i.tagCardArray[0]),this.state={inputs:i.inputs||s.inputs||[],name:i.name||s.name||"",icon:i.icon||s.icon||"",adapter:i.adapter||s.adapter||"",helpDialog:i.helpDialog||s.helpDialog||"",tagCardArray:i.tagCardArray||[],openTagMenu:!1,openModal:!1,iconTag:!1,error:"",helpText:"",instanceSelectionOptions:[],instanceSelectionDef:"",hideAttributes:[],settings:r,debugMessage:null,enableSimulation:this.props.enableSimulation}}componentWillUnmount(){this.debugMessageTimeout&&(clearTimeout(this.debugMessageTimeout),this.debugMessageTimeout=null),this.debugHideTimeout&&(clearTimeout(this.debugHideTimeout),this.debugHideTimeout=null)}onTagChange(s,i,r,l,c){let d=!1;const h=JSON.parse(JSON.stringify(this.state.settings));this.state.inputs.forEach(p=>{const f=p.attr,b=p.defaultValue;f&&b!==void 0&&h[f]===void 0&&(d=!0,h[f]=b)}),d?(this.setState({settings:h},()=>i==null?void 0:i()),this.props.onChange(h)):i&&i()}onUpdate(){}onValueChanged(s,i){}renderText(s,i,r){const{className:l}=this.props,{attr:c,frontText:d,backText:h,nameBlock:p,name:f,doNotTranslate:b,doNotTranslateBack:y}=s;return m.jsxs(Dg,{children:[m.jsxs("div",{className:x.Utils.clsx(Oe.displayFlex,Oe.blockMarginTop),children:[d&&m.jsx("div",{className:Oe.frontText,children:b?d:x.I18n.t(d)}),m.jsx(Ei,{className:l,autoComplete:"off",label:lO(f),variant:"outlined",size:"small",fullWidth:!0,value:i,onChange:r,customValue:!0}),h&&m.jsx("div",{className:Oe.backText,children:y?h:x.I18n.t(h)})]}),p&&m.jsx("div",{className:Oe.nameBlock,children:x.I18n.t(p)})]},c)}renderSwitch(s,i,r){const{className:l}=this.props,{attr:c,frontText:d,backText:h,nameBlock:p,doNotTranslate:f,doNotTranslateBack:b}=s;return m.jsxs("div",{children:[m.jsxs("div",{className:x.Utils.clsx(Oe.displayFlex,Oe.blockMarginTop),children:[d&&m.jsx("div",{className:Oe.frontText,children:f?d:x.I18n.t(d)}),m.jsx(tO,{className:l,label:"",customValue:!0,value:i,onChange:r}),h&&m.jsx("div",{className:Oe.backText,children:b?h:x.I18n.t(h)})]}),p&&m.jsx("div",{className:Oe.nameBlock,children:x.I18n.t(p)})]},c)}renderNameText({attr:s,signature:i,doNotTranslate:r,defaultValue:l},c){return m.jsx("div",{className:x.Utils.clsx(i?Oe.displayItalic:Oe.displayFlex,Oe.blockMarginTop),children:c?r?c:x.I18n.t(c):r?l:x.I18n.t(l)},s)}renderNumber(s,i,r){const{className:l}=this.props,{settings:c}=this.state,{attr:d,backText:h,frontText:p,openCheckbox:f,doNotTranslate:b,doNotTranslateBack:y}=s;let w=!0;return f&&(w=typeof c.offset=="boolean"?c.offset:!0),w?m.jsxs("div",{className:x.Utils.clsx(Oe.displayFlex,Oe.blockMarginTop),children:[p&&m.jsx("div",{className:Oe.frontText,children:b?p:x.I18n.t(p)}),m.jsx(Ei,{className:x.Utils.clsx(l,s.className),fullWidth:!0,autoComplete:"off",label:s.noHelperText?"":"number",variant:"outlined",size:"small",type:"number",value:i,onChange:r,customValue:!0}),h&&m.jsx("div",{className:Oe.backText,children:y?h:x.I18n.t(h)})]},d):null}renderColor(s,i,r){const{className:l}=this.props,{attr:c,backText:d,frontText:h,doNotTranslate:p,doNotTranslateBack:f}=s;return m.jsxs("div",{className:x.Utils.clsx(Oe.displayFlex,Oe.blockMarginTop),children:[h&&m.jsx("div",{className:Oe.frontText,children:p?h:x.I18n.t(h)}),m.jsx(Ei,{className:l,autoComplete:"off",fullWidth:!0,variant:"outlined",size:"small",type:"color",value:i,onChange:r}),d&&m.jsx("div",{className:Oe.backText,children:f?d:x.I18n.t(d)})]},c)}renderCheckbox(s,i,r){const{className:l}=this.props,{settings:c}=this.state,{attr:d,backText:h,frontText:p,defaultValue:f,doNotTranslate:b,doNotTranslateBack:y}=s;return m.jsxs("div",{className:Oe.displayFlex,children:[p&&m.jsx("div",{className:Oe.frontText,children:b?p:x.I18n.t(p)}),m.jsx(SC,{className:l,size:"small",value:typeof c[d]=="boolean"?!!c[d]:!!f,customValue:!0,onChange:r}),h&&m.jsx("div",{onClick:()=>r(typeof c[d]=="boolean"?!c[d]:!f),className:Oe.backText,children:y?h:x.I18n.t(h)})]},d)}renderSlider(s,i,r){const{className:l}=this.props,{attr:c,frontText:d,backText:h,nameBlock:p,min:f,max:b,step:y,unit:w,doNotTranslate:v,doNotTranslateBack:_}=s;return m.jsxs("div",{children:[m.jsxs("div",{className:Oe.displayFlex,style:{marginRight:20},children:[d&&m.jsx("div",{className:Oe.frontText,children:v?d:x.I18n.t(d)}),m.jsx(XR,{customValue:!0,min:f,max:b,step:y,unit:w,className:l,autoComplete:"off",label:"number",variant:"outlined",size:"small",value:i,onChange:$=>{console.log($),r($)}}),h&&m.jsx("div",{style:{marginLeft:20},className:Oe.backText,children:_?h:x.I18n.t(h)})]}),p&&m.jsx("div",{className:Oe.nameBlock,children:x.I18n.t(p)})]},c)}renderButton(s,i,r){const{className:l}=this.props,{attr:c,frontText:d,backText:h,doNotTranslate:p,doNotTranslateBack:f}=s;return m.jsxs("div",{className:x.Utils.clsx(Oe.displayFlex,Oe.blockMarginTop),children:[d&&m.jsx("div",{className:Oe.frontText,children:p?d:x.I18n.t(d)}),m.jsx(Jr,{fullWidth:!0,value:i.toString(),className:l,onClick:()=>r(i)}),h&&m.jsx("div",{className:Oe.backText,children:f?h:x.I18n.t(h)})]},c)}async findIcon(s){var i;if(!s)return null;if((i=s.common)!=null&&i.icon)return x.getSelectIdIcon(s,"../..");if(s.type==="state"||s.type==="channel"){const r=s._id.split(".");r.pop();const l=r.join(".");try{const c=await this.props.socket.getObject(l);return await this.findIcon(c)}catch{return null}}return null}renderObjectID(s,i,r){const{attr:l,openCheckbox:c,checkReadOnly:d}=s,{settings:h}=this.state,p=this.state[`showSelectId${l}`],{className:f,socket:b,style:y}=this.props;let w=!0;c&&(w=typeof h.offset=="boolean"?h.offset:!0);const v=h[l],_=v?this.state[v]:void 0;return v&&!_&&_!==!1&&setTimeout(async $=>{var D;const S=await b.getObject(i),T=await this.findIcon(S),E={[$]:S||!1,[`${$}___icon`]:T,error:d&&this.lastObjectIdChange&&Date.now()-this.lastObjectIdChange<1e3&&((D=S==null?void 0:S.common)==null?void 0:D.write)===!1?x.I18n.t("Read only ID selected: %s",h[$]):""};this.setState(E)},0,v),w?m.jsxs("div",{className:Oe.blockMarginTop,children:[m.jsxs("div",{className:Oe.displayFlex,children:[s.title?m.jsx("div",{children:x.I18n.t(s.title)}):null,m.jsx(Ei,{className:f,style:y,autoComplete:"off",fullWidth:!0,disabled:!0,variant:"outlined",size:"small",value:i,customValue:!0}),m.jsx(Jr,{icon:this.state[`${v}___icon`],square:!0,style:{...y||void 0,marginLeft:7},value:"...",className:f,onClick:()=>{const $={};$[`showSelectId${l}`]=!0,this.setState($)}})]}),_?m.jsx("div",{className:x.Utils.clsx(Oe.nameBlock,Oe.displayItalic),children:x.Utils.getObjectNameFromObj(_,x.I18n.getLanguage())}):null,p?m.jsx(x.DialogSelectID,{theme:this.props.theme,imagePrefix:"../..",dialogName:"javascript",themeType:x.Utils.getThemeName(),socket:b,selected:i,onClose:()=>{const $={};$[`showSelectId${l}`]=!1,this.setState($)},onOk:($,S)=>{const T={};T[`showSelectId${l}`]=!1;const E=Array.isArray($)?$[0]:$;this.setState(T,async()=>{var M,P,W,G,z,Z,he,Ce,O,K;const D=E?await b.getObject(E):void 0;this.lastObjectIdChange=Date.now(),r({[l]:$,[`${l}Role`]:(M=D==null?void 0:D.common)==null?void 0:M.role,[`${l}Type`]:(P=D==null?void 0:D.common)==null?void 0:P.type,[`${l}Unit`]:(W=D==null?void 0:D.common)==null?void 0:W.unit,[`${l}States`]:(G=D==null?void 0:D.common)==null?void 0:G.states,[`${l}Min`]:(z=D==null?void 0:D.common)==null?void 0:z.min,[`${l}Max`]:(Z=D==null?void 0:D.common)==null?void 0:Z.max,[`${l}Step`]:(he=D==null?void 0:D.common)==null?void 0:he.step,[`${l}Def`]:(Ce=D==null?void 0:D.common)==null?void 0:Ce.def,[`${l}Write`]:(O=D==null?void 0:D.common)==null?void 0:O.write,[`${l}Read`]:(K=D==null?void 0:D.common)==null?void 0:K.read},()=>this.props.setOnUpdate&&this.props.setOnUpdate(!0))})}}):null]},l):null}renderIconTag(){return m.jsx("div",{className:Oe.iconTag,onClick:s=>{this.state.settings.tagCard&&(this.state.tagCardArray.length<3?this.onChangeTag():this.setState({openTagMenu:s.currentTarget}))},children:this.state.settings.tagCard})}renderTime(s,i,r){const{attr:l,backText:c,frontText:d,doNotTranslate:h,doNotTranslateBack:p}=s;return m.jsxs("div",{className:Oe.displayFlex,style:{whiteSpace:"nowrap"},children:[d&&m.jsx("div",{className:Oe.frontText,children:h?d:x.I18n.t(d)}),m.jsx(iO,{value:i,onChange:r}),c&&m.jsx("div",{className:Oe.backText,children:p?c:x.I18n.t(c)})]},l)}renderSelect(s,i,r){const{className:l,style:c}=this.props,{name:d,options:h,frontText:p,backText:f,attr:b,multiple:y,doNotTranslate:w,doNotTranslate2:v,doNotTranslateBack:_}=s;return m.jsxs("div",{className:x.Utils.clsx(Oe.displayFlex,Oe.blockMarginTop),style:{whiteSpace:"nowrap"},children:[p&&m.jsx("div",{className:Oe.frontText,children:x.I18n.t(p)}),m.jsx(YR,{attr:b,doNotTranslate:w,doNotTranslate2:v,title:d,className:l,style:c,options:h,value:i,onChange:r,multiple:y,customValue:!0}),f&&m.jsx("div",{className:Oe.backText,children:_?f:x.I18n.t(f)})]},b)}renderInstance(s,i,r){const{socket:l}=this.props,{name:c,frontText:d,backText:h,attr:p,adapter:f,doNotTranslate:b,doNotTranslateBack:y}=s;return this.state.hideAttributes.includes(p)?null:m.jsxs("div",{className:x.Utils.clsx(Oe.displayFlex,Oe.blockMarginTop),style:{whiteSpace:"nowrap"},children:[d&&m.jsx("div",{className:Oe.frontText,children:b?d:x.I18n.t(d)}),m.jsx(HR,{attr:p,socket:l,adapter:f,title:c,value:i,onChange:w=>{r(Array.isArray(w)?w[0]:w)},customValue:!0,onInstanceHide:w=>this.setState({hideAttributes:[...this.state.hideAttributes,p]},()=>r(w))}),h&&m.jsx("div",{className:Oe.backText,children:y?h:x.I18n.t(h)})]},p)}renderDialog(s){const{onShowDialog:i,frontText:r,backText:l,attr:c,icon:d,doNotTranslate:h,doNotTranslateBack:p}=s;return m.jsxs("div",{className:x.Utils.clsx(Oe.displayFlex,Oe.blockMarginTop),style:{whiteSpace:"nowrap"},children:[r&&m.jsx("div",{className:Oe.frontText,children:h?r:x.I18n.t(r)}),m.jsx(fw,{iconName:d,className:x.Utils.clsx(Oe.iconDialog),onClick:()=>i&&i()}),l&&m.jsx("div",{className:Oe.backText,children:p?l:x.I18n.t(l)})]},c)}renderModalInput(s,i,r){const{openModal:l}=this.state,{className:c}=this.props,{attr:d,nameBlock:h,frontText:p,backText:f,noTextEdit:b,doNotTranslate:y,doNotTranslateBack:w}=s;return m.jsxs("div",{children:[m.jsxs("div",{className:x.Utils.clsx(Oe.displayFlex,Oe.blockMarginTop),children:[p&&m.jsx("div",{className:Oe.frontText,children:y?p:x.I18n.t(p)}),m.jsx(Ei,{disabled:!!b,className:c,autoComplete:"off",fullWidth:!0,variant:"outlined",size:"small",value:i,onChange:r,customValue:!0}),m.jsx(Jr,{square:!0,style:{marginLeft:5},value:"...",className:c,onClick:()=>this.setState({openModal:!0})}),f&&m.jsx("div",{className:Oe.backText,children:w?f:x.I18n.t(f)})]}),l?m.jsx(cm,{onApply:v=>this.setState({openModal:!1},()=>v!=null&&r(v)),onClose:()=>this.setState({openModal:!1}),defaultValue:i,textInput:!0}):null,h&&m.jsx("div",{className:Oe.nameBlock,children:x.I18n.t(h)})]},d)}renderDate(s,i,r){const{attr:l,backText:c,frontText:d,doNotTranslate:h,doNotTranslateBack:p}=s;return m.jsxs("div",{className:Oe.displayFlex,style:{whiteSpace:"nowrap"},children:[d&&m.jsx("div",{className:Oe.frontText,children:h?d:x.I18n.t(d)}),m.jsx(rO,{value:i,onChange:r}),c&&m.jsx("div",{className:Oe.backText,children:p?c:x.I18n.t(c)})]},l)}static getReplacesInText(s){var r;let i="";return(r=s.trigger)!=null&&r.oidType?i=".replace(/%s/g, obj.state.val).replace(/%id/g, obj.id).replace(/%name/g, obj.common && obj.common.name).replace(/%old/g, obj.oldState.val)":s.conditionsStates.length&&(i=`.replace(/%s/g, ${s.conditionsStates[0].name}).replace(/%id/g, "${s.conditionsStates[0].id}")`),i}renderTags(){const{tagCardArray:s,openTagMenu:i}=this.state,{tagCard:r}=this.state.settings;let l=r!=="="&&r!=="<>"&&r!==">="&&r!=="()"&&r!=="."&&r!=="<="&&r!=="<"&&r!==">"&&r?x.I18n.t(r):r;return s.length>=3&&(l=m.jsxs("div",{children:[m.jsx("div",{"aria-controls":"simple-menu","aria-haspopup":"true",onClick:c=>{this.setState({openTagMenu:c.currentTarget},()=>{this.props.isTourOpen&&this.props.tourStep===Ns.openTagsMenu&&setTimeout(()=>this.props.setTourStep&&this.props.setTourStep(Ns.selectIntervalTag),300)})},children:l}),m.jsx(pm,{id:"simple-menu",anchorEl:i,keepMounted:!0,open:!!i,onClose:()=>this.setState({openTagMenu:null}),children:s.map((c,d)=>{let h;return typeof c!="string"?h=c.title:h=c,m.jsxs(it,{selected:h===r,className:`tag-card-${h}`,style:{placeContent:"space-between"},onClick:p=>{p.stopPropagation(),this.props.isTourOpen&&(this.props.tourStep===Ns.openTagsMenu||this.props.tourStep===Ns.selectIntervalTag)&&h==="interval"&&setTimeout(()=>{var b,y;return(y=(b=this.props).setTourStep)==null?void 0:y.call(b,Ns.selectActions)},500);const f=JSON.parse(JSON.stringify(this.state.settings));f.tagCard=h,this.setState({openTagMenu:null,settings:f},()=>{this.props.onChange(this.state.settings),this.onTagChange(this.state.settings.tagCard)})},children:[h.search(/>|<|<>|<=|>=|=/)!==-1?h:x.I18n.t(h),typeof c!="string"&&c.title2&&m.jsx("div",{style:{marginLeft:4},children:x.I18n.t(c.title2)})]},`${h}_${d}`)})})]})),l}getData(){return{acceptedBy:"triggers",name:"",id:""}}onChangeTag(){const{tagCardArray:s,settings:i,settings:{tagCard:r}}=this.state;let l;if(typeof s[0]!="string"?l=s.map(c=>c.title):l=[...s],r&&l.length<3){const c={...i},d=l[(l.indexOf(r)+1)%l.length];c.tagCard=d,this.setState({settings:c},()=>{this.props.onChange(c),this.onTagChange(d)})}}componentDidMount(){this.onTagChange()}componentDidUpdate(){this.props.acceptedBy!=="triggers"&&this.props.onUpdate&&setTimeout(()=>this.onUpdate(),0)}onChangeInput(s){return(i,r,l)=>{const c=JSON.parse(JSON.stringify(this.state.settings));typeof i=="object"&&(!r||typeof r=="function")?(Object.keys(i).forEach(d=>c[d]=i[d]),typeof r=="function"&&(l=r,r=void 0)):c[r||s]=i,c.id=this.getData().id,c._id=this.props._id,this.setState({settings:c},()=>{this.onValueChanged(i,r||s),this.props.onChange(c),l==null||l()})}}renderSpecific(){return null}renderDebug(s){return""}renderDebugInfo(){return this.state.debugMessage?m.jsx("div",{className:Oe.debugInfo,style:{opacity:1,height:22,bottom:-22},children:this.renderDebug?this.renderDebug(this.state.debugMessage):x.I18n.t("executed")},this.state.debugMessage.ts):null}renderCron(s,i,r){return null}renderWizard(s,i,r){return null}renderWriteState(){return null}renderInputElement(s,i){const{nameRender:r,defaultValue:l,attr:c}=s,{settings:d}=this.state;let h=c?d[c]:void 0;switch(h===void 0&&(h=l),r){case"renderTime":return c?this.renderTime(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderTime")},`invalid_${i}`);case"renderNameText":return this.renderNameText(s,l);case"renderSelect":return c?this.renderSelect(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderSelect")},`invalid_${i}`);case"renderModalInput":return c?this.renderModalInput(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderModalInput")},`invalid_${i}`);case"renderObjectID":return c?this.renderObjectID(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderObjectID")},`invalid_${i}`);case"renderDialog":return c?this.renderDialog(s):m.jsx("div",{children:x.I18n.t("Invalid renderDialog")},`invalid_${i}`);case"renderInstance":return c?this.renderInstance(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderInstance")},`invalid_${i}`);case"renderText":return c?this.renderText(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderText")},`invalid_${i}`);case"renderSlider":return c?this.renderSlider(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderSlider")},`invalid_${i}`);case"renderCheckbox":return c?this.renderCheckbox(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderCheckbox")},`invalid_${i}`);case"renderButton":return c?this.renderButton(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderButton")},`invalid_${i}`);case"renderColor":return c?this.renderColor(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderColor")},`invalid_${i}`);case"renderSwitch":return c?this.renderSwitch(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderSwitch")},`invalid_${i}`);case"renderDate":return c?this.renderDate(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderDate")},`invalid_${i}`);case"renderCron":return c?this.renderCron(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderCron")},`invalid_${i}`);case"renderWizard":return c?this.renderWizard(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderWizard")},`invalid_${i}`);case"renderWriteState":return this.renderWriteState();case"renderNumber":return c?this.renderNumber(s,h,this.onChangeInput(c)):m.jsx("div",{children:x.I18n.t("Invalid renderNumber")},`invalid_${i}`);default:return this[r]?this[r](s,h,c?this.onChangeInput(c):null):m.jsx("div",{children:x.I18n.t("Invalid input type: %s",r)},`invalid_${i}`)}}render(){var w;const{inputs:s,name:i,icon:r,iconTag:l,settings:c,adapter:d,settings:{tagCard:h},helpDialog:p}=this.state,{socket:f,notFound:b}=this.props;this.state.settings&&!this.state.settings.tagCard&&((w=this.state.tagCardArray)!=null&&w.length)&&setTimeout(()=>{const v=JSON.parse(JSON.stringify(this.state.settings));v.tagCard=typeof this.state.tagCardArray[0]!="string"?this.state.tagCardArray[0].title:this.state.tagCardArray[0],this.setState({settings:v})},50),this.state.enableSimulation!==this.props.enableSimulation&&!this.enableSimulationProcessing&&(this.enableSimulationProcessing=!0,setTimeout(()=>{this.setState({enableSimulation:this.props.enableSimulation},()=>{this.enableSimulationProcessing=!1})},50));let y;if(this.props.onDebugMessage)for(let v=this.props.onDebugMessage.length-1;v>=0;v--){const _=this.props.onDebugMessage[v];if(_.blockId===this.props._id&&_.ts>this.lastDebugMessage&&_.ts>Date.now()-1e3){y=_;break}}return y&&(this.lastDebugMessage=y.ts,this.debugMessageTimeout&&clearTimeout(this.debugMessageTimeout),this.debugHideTimeout&&(clearTimeout(this.debugHideTimeout),this.debugHideTimeout=null),this.debugMessageTimeout=setTimeout(v=>{const _=JSON.parse(v),$=_.hideTimeout||5e3;this.debugMessageTimeout=null,this.setState({debugMessage:_},()=>{this.debugHideTimeout&&clearTimeout(this.debugHideTimeout),this.debugHideTimeout=setTimeout(()=>{this.debugHideTimeout=null,this.setState({debugMessage:null})},$)})},50,JSON.stringify(y))),m.jsxs(Dg,{children:[l?this.renderIconTag():m.jsx(fw,{iconName:r,className:x.Utils.clsx(Oe.iconThemCard,h&&this.state.tagCardArray.length&&Oe.iconThemCardSelectable),adapter:d,socket:f,onClick:v=>{h&&(this.state.tagCardArray.length<3?this.onChangeTag():this.setState({openTagMenu:v.currentTarget}))}}),m.jsxs("div",{className:Oe.blockName,children:[m.jsxs("span",{className:Oe.nameCard,children:[x.I18n.t(i),b?x.I18n.t("%s not found",c.id):"",p?m.jsx(qe,{className:Oe.iconHelp,size:"small",onClick:()=>this.setState({helpText:x.I18n.t(p)}),children:m.jsx(pk,{})}):null]}),s.map((v,_)=>this.renderInputElement(v,_))]}),h&&m.jsx("div",{className:Oe.controlMenuTop,style:{opacity:1,height:22,top:-22},children:m.jsx("div",{onClick:()=>this.onChangeTag(),className:x.Utils.clsx(Oe.tagCard,"tag-card"),children:this.renderTags()})}),this.renderDebugInfo(),this.state.error?m.jsx(x.DialogError,{title:x.I18n.t("Warning"),text:this.state.error,onClose:()=>this.setState({error:""})}):null,this.state.helpText?m.jsx(x.DialogMessage,{title:x.I18n.t("Instructions"),text:this.state.helpText,onClose:()=>this.setState({helpText:""})}):null,this.renderSpecific()]})}}const $w={en:{name:"Google - English",engine:"google",params:[]},de:{name:"Google - Deutsch",engine:"google",params:[]},ru:{name:"Google - Русский",engine:"google",params:[]},it:{name:"Google - Italiano",engine:"google",params:[]},es:{name:"Google - Espaniol",engine:"google",params:[]},fr:{name:"Google - Français",engine:"google",params:[]},ru_YA:{name:"Yandex - Русский",engine:"yandex",params:["key","voice","emotion","ill","drunk","robot"],voice:["jane","zahar"],emotion:["none","good","neutral","evil","mixed"]},ru_YA_CLOUD:{name:"Yandex Cloud - Русский",engine:"yandexCloud",params:["key","folderID","voice","emotion"],voice:["alyss","oksana","jane","zahar"],emotion:["good","neutral","evil"]},"en-US":{name:"PicoTTS - Englisch US",engine:"PicoTTS",params:[]},"en-GB":{name:"PicoTTS - Englisch GB",engine:"PicoTTS",params:[]},"de-DE":{name:"PicoTTS - Deutsch",engine:"PicoTTS",params:[]},"it-IT":{name:"PicoTTS - Italiano",engine:"PicoTTS",params:[]},"es-ES":{name:"PicoTTS - Espaniol",engine:"PicoTTS",params:[]},"fr-FR":{name:"PicoTTS - Français",engine:"PicoTTS",params:[]},"ru-RU_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"ru-RU",ename:"Tatyana",ssml:!0,name:"Cloud - Русский - Татьяна"},"ru-RU_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"ru-RU",ename:"Maxim",ssml:!0,name:"Cloud - Русский - Максим"},"de-DE_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"de-DE",ename:"Marlene",ssml:!0,name:"Cloud - Deutsch - Marlene"},"de-DE_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"de-DE",ename:"Hans",ssml:!0,name:"Cloud - Deutsch - Hans"},"en-US_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Salli",ssml:!0,name:"Cloud - en-US - Female - Salli"},"en-US_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-US",ename:"Joey",ssml:!0,name:"Cloud - en-US - Male - Joey"},"da-DK_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"da-DK",ename:"Naja",ssml:!0,name:"Cloud - da-DK - Female - Naja"},"da-DK_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"da-DK",ename:"Mads",ssml:!0,name:"Cloud - da-DK - Male - Mads"},"en-AU_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-AU",ename:"Nicole",ssml:!0,name:"Cloud - en-AU - Female - Nicole"},"en-AU_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-AU",ename:"Russell",ssml:!0,name:"Cloud - en-AU - Male - Russell"},"en-GB_CLOUD_Female_Amy":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-GB",ename:"Amy",ssml:!0,name:"Cloud - en-GB - Female - Amy"},"en-GB_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-GB",ename:"Brian",ssml:!0,name:"Cloud - en-GB - Male - Brian"},"en-GB_CLOUD_Female_Emma":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-GB",ename:"Emma",ssml:!0,name:"Cloud - en-GB - Female - Emma"},"en-GB-WLS_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-GB-WLS",ename:"Gwyneth",ssml:!0,name:"Cloud - en-GB-WLS - Female - Gwyneth"},"en-GB-WLS_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-GB-WLS",ename:"Geraint",ssml:!0,name:"Cloud - en-GB-WLS - Male - Geraint"},"cy-GB_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"cy-GB",ename:"Gwyneth",ssml:!0,name:"Cloud - cy-GB - Female - Gwyneth"},"cy-GB_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"cy-GB",ename:"Geraint",ssml:!0,name:"Cloud - cy-GB - Male - Geraint"},"en-IN_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-IN",ename:"Raveena",ssml:!0,name:"Cloud - en-IN - Female - Raveena"},"en-US_CLOUD_Male_Chipmunk":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-US",ename:"Chipmunk",ssml:!0,name:"Cloud - en-US - Male - Chipmunk"},"en-US_CLOUD_Male_Eric":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-US",ename:"Eric",ssml:!0,name:"Cloud - en-US - Male - Eric"},"en-US_CLOUD_Female_Ivy":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Ivy",ssml:!0,name:"Cloud - en-US - Female - Ivy"},"en-US_CLOUD_Female_Jennifer":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Jennifer",ssml:!0,name:"Cloud - en-US - Female - Jennifer"},"en-US_CLOUD_Male_Justin":{gender:"Male",engine:"cloud",params:["cloud"],language:"en-US",ename:"Justin",ssml:!0,name:"Cloud - en-US - Male - Justin"},"en-US_CLOUD_Female_Kendra":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Kendra",ssml:!0,name:"Cloud - en-US - Female - Kendra"},"en-US_CLOUD_Female_Kimberly":{gender:"Female",engine:"cloud",params:["cloud"],language:"en-US",ename:"Kimberly",ssml:!0,name:"Cloud - en-US - Female - Kimberly"},"es-ES_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"es-ES",ename:"Conchita",ssml:!0,name:"Cloud - es-ES - Female - Conchita"},"es-ES_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"es-ES",ename:"Enrique",ssml:!0,name:"Cloud - es-ES - Male - Enrique"},"es-US_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"es-US",ename:"Penelope",ssml:!0,name:"Cloud - es-US - Female - Penelope"},"es-US_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"es-US",ename:"Miguel",ssml:!0,name:"Cloud - es-US - Male - Miguel"},"fr-CA_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"fr-CA",ename:"Chantal",ssml:!0,name:"Cloud - fr-CA - Female - Chantal"},"fr-FR_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"fr-FR",ename:"Celine",ssml:!0,name:"Cloud - fr-FR - Female - Celine"},"fr-FR_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"fr-FR",ename:"Mathieu",ssml:!0,name:"Cloud - fr-FR - Male - Mathieu"},"is-IS_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"is-IS",ename:"Dora",ssml:!0,name:"Cloud - is-IS - Female - Dora"},"is-IS_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"is-IS",ename:"Karl",ssml:!0,name:"Cloud - is-IS - Male - Karl"},"it-IT_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"it-IT",ename:"Carla",ssml:!0,name:"Cloud - it-IT - Female - Carla"},"it-IT_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"it-IT",ename:"Giorgio",ssml:!0,name:"Cloud - it-IT - Male - Giorgio"},"nb-NO_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"nb-NO",ename:"Liv",ssml:!0,name:"Cloud - nb-NO - Female - Liv"},"nl-NL_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"nl-NL",ename:"Lotte",ssml:!0,name:"Cloud - nl-NL - Female - Lotte"},"nl-NL_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"nl-NL",ename:"Ruben",ssml:!0,name:"Cloud - nl-NL - Male - Ruben"},"pl-PL_CLOUD_Female_Agnieszka":{gender:"Female",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Agnieszka",ssml:!0,name:"Cloud - pl-PL - Female - Agnieszka"},"pl-PL_CLOUD_Male_Jacek":{gender:"Male",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Jacek",ssml:!0,name:"Cloud - pl-PL - Male - Jacek"},"pl-PL_CLOUD_Female_Ewa":{gender:"Female",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Ewa",ssml:!0,name:"Cloud - pl-PL - Female - Ewa"},"pl-PL_CLOUD_Male_Jan":{gender:"Male",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Jan",ssml:!0,name:"Cloud - pl-PL - Male - Jan"},"pl-PL_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"pl-PL",ename:"Maja",ssml:!0,name:"Cloud - pl-PL - Female - Maja"},"pt-BR_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"pt-BR",ename:"Vitoria",ssml:!0,name:"Cloud - pt-BR - Female - Vitoria"},"pt-BR_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"pt-BR",ename:"Ricardo",ssml:!0,name:"Cloud - pt-BR - Male - Ricardo"},"pt-PT_CLOUD_Male":{gender:"Male",engine:"cloud",params:["cloud"],language:"pt-PT",ename:"Cristiano",ssml:!0,name:"Cloud - pt-PT - Male - Cristiano"},"pt-PT_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"pt-PT",ename:"Ines",ssml:!0,name:"Cloud - pt-PT - Female - Ines"},"ro-RO_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"ro-RO",ename:"Carmen",ssml:!0,name:"Cloud - ro-RO - Female - Carmen"},"sv-SE_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"sv-SE",ename:"Astrid",ssml:!0,name:"Cloud - sv-SE - Female - Astrid"},"tr-TR_CLOUD_Female":{gender:"Female",engine:"cloud",params:["cloud"],language:"tr-TR",ename:"Filiz",ssml:!0,name:"Cloud - tr-TR - Female - Filiz"},"ru-RU_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"ru-RU",ename:"Tatyana",ssml:!0,name:"AWS Polly - Русский - Татьяна"},"ru-RU_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"ru-RU",ename:"Maxim",ssml:!0,name:"AWS Polly - Русский - Максим"},"de-DE_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"de-DE",ename:"Marlene",ssml:!0,name:"AWS Polly - Deutsch - Marlene"},"de-DE_AP_Female_Vicky":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"de-DE",ename:"Vicky",ssml:!0,name:"AWS Polly - Deutsch - Vicky"},"de-DE_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"de-DE",ename:"Hans",ssml:!0,name:"AWS Polly - Deutsch - Hans"},"en-US_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Salli",ssml:!0,name:"AWS Polly - en-US - Female - Salli"},"en-US_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Joey",ssml:!0,name:"AWS Polly - en-US - Male - Joey"},"da-DK_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"da-DK",ename:"Naja",ssml:!0,name:"AWS Polly - da-DK - Female - Naja"},"da-DK_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"da-DK",ename:"Mads",ssml:!0,name:"AWS Polly - da-DK - Male - Mads"},"en-AU_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-AU",ename:"Nicole",ssml:!0,name:"AWS Polly - en-AU - Female - Nicole"},"en-AU_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-AU",ename:"Russell",ssml:!0,name:"AWS Polly - en-AU - Male - Russell"},"en-GB_AP_Female_Amy":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB",ename:"Amy",ssml:!0,name:"AWS Polly - en-GB - Female - Amy"},"en-GB_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB",ename:"Brian",ssml:!0,name:"AWS Polly - en-GB - Male - Brian"},"en-GB_AP_Female_Emma":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB",ename:"Emma",ssml:!0,name:"AWS Polly - en-GB - Female - Emma"},"en-GB-WLS_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB-WLS",ename:"Gwyneth",ssml:!0,name:"AWS Polly - en-GB-WLS - Female - Gwyneth"},"en-GB-WLS_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-GB-WLS",ename:"Geraint",ssml:!0,name:"AWS Polly - en-GB-WLS - Male - Geraint"},"cy-GB_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"cy-GB",ename:"Gwyneth",ssml:!0,name:"AWS Polly - cy-GB - Female - Gwyneth"},"cy-GB_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"cy-GB",ename:"Geraint",ssml:!0,name:"AWS Polly - cy-GB - Male - Geraint"},"en-IN_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-IN",ename:"Raveena",ssml:!0,name:"AWS Polly - en-IN - Female - Raveena"},"en-US_AP_Male_Chipmunk":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Chipmunk",ssml:!0,name:"AWS Polly - en-US - Male - Chipmunk"},"en-US_AP_Male_Eric":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Eric",ssml:!0,name:"AWS Polly - en-US - Male - Eric"},"en-US_AP_Female_Ivy":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Ivy",ssml:!0,name:"AWS Polly - en-US - Female - Ivy"},"en-US_AP_Female_Jennifer":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Jennifer",ssml:!0,name:"AWS Polly - en-US - Female - Jennifer"},"en-US_AP_Male_Justin":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Justin",ssml:!0,name:"AWS Polly - en-US - Male - Justin"},"en-US_AP_Female_Kendra":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Kendra",ssml:!0,name:"AWS Polly - en-US - Female - Kendra"},"en-US_AP_Female_Kimberly":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"en-US",ename:"Kimberly",ssml:!0,name:"AWS Polly - en-US - Female - Kimberly"},"es-ES_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"es-ES",ename:"Conchita",ssml:!0,name:"AWS Polly - es-ES - Female - Conchita"},"es-ES_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"es-ES",ename:"Enrique",ssml:!0,name:"AWS Polly - es-ES - Male - Enrique"},"es-US_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"es-US",ename:"Penelope",ssml:!0,name:"AWS Polly - es-US - Female - Penelope"},"es-US_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"es-US",ename:"Miguel",ssml:!0,name:"AWS Polly - es-US - Male - Miguel"},"fr-CA_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"fr-CA",ename:"Chantal",ssml:!0,name:"AWS Polly - fr-CA - Female - Chantal"},"fr-FR_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"fr-FR",ename:"Celine",ssml:!0,name:"AWS Polly - fr-FR - Female - Celine"},"fr-FR_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"fr-FR",ename:"Mathieu",ssml:!0,name:"AWS Polly - fr-FR - Male - Mathieu"},"is-IS_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"is-IS",ename:"Dora",ssml:!0,name:"AWS Polly - is-IS - Female - Dora"},"is-IS_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"is-IS",ename:"Karl",ssml:!0,name:"AWS Polly - is-IS - Male - Karl"},"it-IT_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"it-IT",ename:"Carla",ssml:!0,name:"AWS Polly - it-IT - Female - Carla"},"it-IT_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"it-IT",ename:"Giorgio",ssml:!0,name:"AWS Polly - it-IT - Male - Giorgio"},"nb-NO_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"nb-NO",ename:"Liv",ssml:!0,name:"AWS Polly - nb-NO - Female - Liv"},"nl-NL_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"nl-NL",ename:"Lotte",ssml:!0,name:"AWS Polly - nl-NL - Female - Lotte"},"nl-NL_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"nl-NL",ename:"Ruben",ssml:!0,name:"AWS Polly - nl-NL - Male - Ruben"},"pl-PL_AP_Female_Agnieszka":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Agnieszka",ssml:!0,name:"AWS Polly - pl-PL - Female - Agnieszka"},"pl-PL_AP_Male_Jacek":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Jacek",ssml:!0,name:"AWS Polly - pl-PL - Male - Jacek"},"pl-PL_AP_Female_Ewa":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Ewa",ssml:!0,name:"AWS Polly - pl-PL - Female - Ewa"},"pl-PL_AP_Male_Jan":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Jan",ssml:!0,name:"AWS Polly - pl-PL - Male - Jan"},"pl-PL_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pl-PL",ename:"Maja",ssml:!0,name:"AWS Polly - pl-PL - Female - Maja"},"pt-BR_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pt-BR",ename:"Vitoria",ssml:!0,name:"AWS Polly - pt-BR - Female - Vitoria"},"pt-BR_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"pt-BR",ename:"Ricardo",ssml:!0,name:"AWS Polly - pt-BR - Male - Ricardo"},"pt-PT_AP_Male":{gender:"Male",engine:"polly",params:["accessKey","secretKey","region"],language:"pt-PT",ename:"Cristiano",ssml:!0,name:"AWS Polly - pt-PT - Male - Cristiano"},"pt-PT_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"pt-PT",ename:"Ines",ssml:!0,name:"AWS Polly - pt-PT - Female - Ines"},"ro-RO_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"ro-RO",ename:"Carmen",ssml:!0,name:"AWS Polly - ro-RO - Female - Carmen"},"sv-SE_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"sv-SE",ename:"Astrid",ssml:!0,name:"AWS Polly - sv-SE - Female - Astrid"},"tr-TR_AP_Female":{gender:"Female",engine:"polly",params:["accessKey","secretKey","region"],language:"tr-TR",ename:"Filiz",ssml:!0,name:"AWS Polly - tr-TR - Female - Filiz"}};class Oc extends at{constructor(s){super(s,Oc.getStaticData())}static compile(s,i){return s.text?`// Sayit ${s.text||""} const subActionVar${s._id} = "${s.language&&s.language!=="_"?`${s.language};`:""}${s.volume?`${s.volume};`:""}${(s.text||"").replace(/"/g,'\\"')}"${at.getReplacesInText(i)}; _sendToFrontEnd(${s._id}, {text: subActionVar${s._id}}); await setStateAsync("${s.instance}.tts.text", subActionVar${s._id});`:`// no text defined -_sendToFrontEnd(${s._id}, {text: 'No text defined'});`}renderDebug(s){return`${x.I18n.t("Say:")} ${s.data.text}`}onTagChange(){const s=x.I18n.getLanguage(),r=Object.keys($w).filter(l=>l.startsWith(s)).map(l=>({title:$w[l].name,value:l}));r.unshift({title:"Default",value:"_"}),this.setState({inputs:[{attr:"instance",nameRender:"renderInstance",adapter:"sayit",defaultValue:"sayit.0",frontText:"Instance:"},{nameRender:"renderSelect",frontText:"Language:",options:r,defaultValue:"_",attr:"language"},{nameRender:"renderNameText",defaultValue:"Volume",attr:"textVol"},{nameRender:"renderSlider",attr:"volume",defaultValue:100,min:0,max:100},{attr:"text",nameRender:"renderModalInput",defaultValue:"Hallo",nameBlock:"",frontText:"Text:"}]},()=>super.onTagChange())}static getStaticData(){return{acceptedBy:"actions",name:"Say It",id:"ActionSayText",adapter:"sayit",title:"Say some text via sayit adapter",helpDialog:"You can use %s in the text to display current trigger value or %id to display the triggered object ID"}}getData(){return Rc.getStaticData()}}class Nc extends at{constructor(s){super(s,Nc.getStaticData())}static compile(s,i){const r=(s.text||"").replace(/"/g,'\\"');return r?`// Pushover ${s.text||""} +_sendToFrontEnd(${s._id}, {text: 'No text defined'});`}renderDebug(s){return`${x.I18n.t("Say:")} ${s.data.text}`}onTagChange(){const s=x.I18n.getLanguage(),r=Object.keys($w).filter(l=>l.startsWith(s)).map(l=>({title:$w[l].name,value:l}));r.unshift({title:"Default",value:"_"}),this.setState({inputs:[{attr:"instance",nameRender:"renderInstance",adapter:"sayit",defaultValue:"sayit.0",frontText:"Instance:"},{nameRender:"renderSelect",frontText:"Language:",options:r,defaultValue:"_",attr:"language"},{nameRender:"renderNameText",defaultValue:"Volume",attr:"textVol"},{nameRender:"renderSlider",attr:"volume",defaultValue:100,min:0,max:100},{attr:"text",nameRender:"renderModalInput",defaultValue:"Hallo",nameBlock:"",frontText:"Text:"}]},()=>super.onTagChange())}static getStaticData(){return{acceptedBy:"actions",name:"Say It",id:"ActionSayText",adapter:"sayit",title:"Say some text via sayit adapter",helpDialog:"You can use %s in the text to display current trigger value or %id to display the triggered object ID"}}getData(){return Oc.getStaticData()}}class Nc extends at{constructor(s){super(s,Nc.getStaticData())}static compile(s,i){const r=(s.text||"").replace(/"/g,'\\"');return r?`// Pushover ${s.text||""} const subActionVar${s._id} = "${r}"${at.getReplacesInText(i)}; _sendToFrontEnd(${s._id}, {text: subActionVar${s._id}}); sendTo("${s.instance}", "send", { @@ -1142,7 +1142,7 @@ __%%THEN%%__ __%%STATE%%__ = false; __%%ELSE%%__ } -}`,cR=`"__%%DEBUG_TRIGGER%%__"; +}`,cO=`"__%%DEBUG_TRIGGER%%__"; __%%CONDITIONS_VARS%%__ const _cond = __%%CONDITION%%__; @@ -1152,7 +1152,7 @@ if (_cond) { __%%THEN%%__ } else { __%%ELSE%%__ -}`,Sg={triggers:[],conditions:[[]],justCheck:!1,actions:{then:[],else:[]}};function uR(a,s,i){const r=[];let l=a.triggers;l.length||(l=[{id:"TriggerScriptSave"}]);const c=[],d=[],h=a.conditions.find(f=>f.find(b=>b.tagCard==="()"));l.forEach((f,b)=>{var w;const y=Vm(f.id,i);if(y){const v={trigger:f,condition:{index:0},justCheck:h?!1:a.justCheck||!a.conditions.length||!a.conditions[0].length,conditionsDebug:[],conditionsVars:[],conditionsStates:[]},_=y.compile(f,v),$=dR(a.conditions,v,i),S=bw(a.actions.then,v,i),T=bw(a.actions.else,v,i);c.push(`cond${b}`),(w=v.prelines)!=null&&w.length&&v.prelines.forEach(E=>d.push(E)),_.includes(" __%%CONDITIONS_VARS%%__")&&(v.conditionsVars=v.conditionsVars.map((E,D)=>D?` ${E}`:E),v.conditionsDebug=v.conditionsDebug.map((E,D)=>D?` ${E}`:E)),r.push(_.replace("__%%CONDITIONS_VARS%%__",v.conditionsVars.join(` +}`,Sg={triggers:[],conditions:[[]],justCheck:!1,actions:{then:[],else:[]}};function uO(a,s,i){const r=[];let l=a.triggers;l.length||(l=[{id:"TriggerScriptSave"}]);const c=[],d=[],h=a.conditions.find(f=>f.find(b=>b.tagCard==="()"));l.forEach((f,b)=>{var w;const y=Vm(f.id,i);if(y){const v={trigger:f,condition:{index:0},justCheck:h?!1:a.justCheck||!a.conditions.length||!a.conditions[0].length,conditionsDebug:[],conditionsVars:[],conditionsStates:[]},_=y.compile(f,v),$=dO(a.conditions,v,i),S=bw(a.actions.then,v,i),T=bw(a.actions.else,v,i);c.push(`cond${b}`),(w=v.prelines)!=null&&w.length&&v.prelines.forEach(E=>d.push(E)),_.includes(" __%%CONDITIONS_VARS%%__")&&(v.conditionsVars=v.conditionsVars.map((E,D)=>D?` ${E}`:E),v.conditionsDebug=v.conditionsDebug.map((E,D)=>D?` ${E}`:E)),r.push(_.replace("__%%CONDITIONS_VARS%%__",v.conditionsVars.join(` `)).replace('"__%%DEBUG_CONDITIONS%%__";',v.conditionsDebug.join(` `)).replace("__%%CONDITION%%__",$).replace("__%%THEN%%__",S||"// ignore").replace("__%%ELSE%%__",T||"// ignore").replace(/__%%STATE%%__/g,`cond${b}`))}});let p=r.join(` @@ -1164,14 +1164,14 @@ ${p}`),d&&(p=`${d.join(` ${p}`),p}function Vm(a,s){return s.find(i=>i.getStaticData&&i.getStaticData().id===a)}function bw(a,s,i){const r=[];return a==null||a.forEach(l=>{const c=Vm(l.id,i);c&&r.push(c.compile(l,s))}),` ${r.join(` - `)}`}function dR(a,s,i){const r=[];let l=0;return a==null||a.forEach(c=>{const d=[];c!=null&&c.length&&(c.forEach(h=>{const p=Vm(h.id,i);p&&(s.condition.index=l++,d.push(p.compile(h,s)))}),r.push(`(${d.join(`) && - (`)})`))}),r.length?r.length===1?r[0]||"true":`(${r.join(") || (")})`:"true"}function hR(a,s){return uR(a,null,s)}function pne(a){if(!a)return Sg;const s=a.split(` -`);try{const i=(s.pop()||"").replace(/^\/\//,"");let r=JSON.parse(i);return r.triggers||(r=Sg),r}catch{return Sg}}function gne(a,s){let i="";const r=hR(a,s);return i+=r,i+=` + `)}`}function dO(a,s,i){const r=[];let l=0;return a==null||a.forEach(c=>{const d=[];c!=null&&c.length&&(c.forEach(h=>{const p=Vm(h.id,i);p&&(s.condition.index=l++,d.push(p.compile(h,s)))}),r.push(`(${d.join(`) && + (`)})`))}),r.length?r.length===1?r[0]||"true":`(${r.join(") || (")})`:"true"}function hO(a,s){return uO(a,null,s)}function Cne(a){if(!a)return Sg;const s=a.split(` +`);try{const i=(s.pop()||"").replace(/^\/\//,"");let r=JSON.parse(i);return r.triggers||(r=Sg),r}catch{return Sg}}function Tne(a,s){let i="";const r=hO(a,s);return i+=r,i+=` /* const demo = ${JSON.stringify(a,null,2).replace(/\*\//g,"* /")}; */ `,`${i} -//${JSON.stringify(a)}`}class Pc extends at{constructor(s){super(s,Pc.getStaticData())}static compile(s,i){return cR.replace('"__%%DEBUG_TRIGGER%%__"',`_sendToFrontEnd(${s._id}, {trigger: true})`)}renderDebug(){return x.I18n.t("Triggered")}onTagChange(s){this.setState({inputs:[{nameRender:"renderNameText",defaultValue:"On script save or adapter start",attr:"script"}]},()=>super.onTagChange())}static getStaticData(){return{acceptedBy:"triggers",name:"Start script",id:"TriggerScriptSave",icon:"PlayArrow",title:"Triggers the on script saving or the javascript instance restart"}}getData(){return Pc.getStaticData()}}var xC={exports:{}};(function(a,s){(function(){var i=Math.PI,r=Math.sin,l=Math.cos,c=Math.tan,d=Math.asin,h=Math.atan2,p=Math.acos,f=i/180,b=1e3*60*60*24,y=2440588,w=2451545;function v(re){return re.valueOf()/b-.5+y}function _(re){return new Date((re+.5-y)*b)}function $(re){return v(re)-w}var S=f*23.4397;function T(re,B){return h(r(re)*l(S)-c(B)*r(S),l(re))}function E(re,B){return d(r(B)*l(S)+l(B)*r(S)*r(re))}function D(re,B,N){return h(r(re),l(re)*r(B)-c(N)*l(B))}function M(re,B,N){return d(r(B)*r(N)+l(B)*l(N)*l(re))}function P(re,B){return f*(280.16+360.9856235*re)-B}function W(re){return re<0&&(re=0),2967e-7/Math.tan(re+.00312536/(re+.08901179))}function G(re){return f*(357.5291+.98560028*re)}function z(re){var B=f*(1.9148*r(re)+.02*r(2*re)+3e-4*r(3*re)),N=f*102.9372;return re+B+N+i}function Z(re){var B=G(re),N=z(B);return{dec:E(N,0),ra:T(N,0)}}var he={};he.getPosition=function(re,B,N){var te=f*-N,q=f*B,se=$(re),j=Z(se),Te=P(se,te)-j.ra;return{azimuth:D(Te,q,j.dec),altitude:M(Te,q,j.dec)}};var Ce=he.times=[[-.833,"sunrise","sunset"],[-.3,"sunriseEnd","sunsetStart"],[-6,"dawn","dusk"],[-12,"nauticalDawn","nauticalDusk"],[-18,"nightEnd","night"],[6,"goldenHourEnd","goldenHour"]];he.addTime=function(re,B,N){Ce.push([re,B,N])};var R=9e-4;function K(re,B){return Math.round(re-R-B/(2*i))}function C(re,B,N){return R+(re+B)/(2*i)+N}function Q(re,B,N){return w+re+.0053*r(B)-.0069*r(2*N)}function ve(re,B,N){return p((r(re)-r(B)*r(N))/(l(B)*l(N)))}function ce(re,B,N,te,q,se,j){var Te=ve(re,N,te),ae=C(Te,B,q);return Q(ae,se,j)}he.getTimes=function(re,B,N){var te=f*-N,q=f*B,se=$(re),j=K(se,te),Te=C(0,te,j),ae=G(Te),we=z(ae),Ie=E(we,0),Ne=Q(Te,ae,we),Ae,We,k,X,Y,O={solarNoon:_(Ne),nadir:_(Ne+.5)};for(Ae=0,We=Ce.length;Ae=0&&(U=Math.sqrt(X)/(Math.abs(Ne)*2),O=We-U,A=We+U,Math.abs(O)<=1&&Y++,Math.abs(A)<=1&&Y++,O<-1&&(O=A)),Y===1?j<0?we=H+O:Ie=H+O:Y===2&&(we=H+(k<0?A:O),Ie=H+(k<0?O:A)),!(we&&Ie));H+=2)j=ae;var ue={};return we&&(ue.rise=me(q,we)),Ie&&(ue.set=me(q,Ie)),!we&&!Ie&&(ue[k>0?"alwaysUp":"alwaysDown"]=!0),ue},a.exports=he})()})(xC);var pR=xC.exports;const DC=Xo(pR),gR='{"time":{"start":"00:00","end":"24:00","mode":"hours","interval":1},"period":{"days":1}}';class Ii extends at{coordinates=null;constructor(s){super(s,Ii.getStaticData())}static compile(s,i){var c;let r="",l=i.justCheck?EC:IC;if(l=l.replace('"__%%DEBUG_TRIGGER%%__"',`_sendToFrontEnd(${s._id}, {trigger: true})`),s.tagCard==="interval")r=`setInterval(${l}, ${s.interval||1} * ${s.unit==="s"?1e3:s.unit==="m"?6e4:36e5});`;else if(s.tagCard==="cron")r=`schedule("${s.cron}", ${l});`;else if(s.tagCard==="at"){const[d,h]=(s.at||"").split(":");let p="*";if((c=s==null?void 0:s.dow)!=null&&c.length&&!s.dow.includes("_")){const f=[...s.dow].map(v=>parseInt(v,10));f.sort();const b=[];let y=f[0],w=1;for(;w1?(y===f[w-1]?b.push(y.toString()):f[w-1]-y===1?b.push(`${y},${f[w-1]}`):b.push(`${y}-${f[w-1]}`),y=f[w]):w===f.length-1&&(y===f[w-1]||f[w]-y===1?b.push(`${y},${f[w]}`):b.push(`${y}-${f[w]}`));p=b.join(",")}r=`schedule("${h||"0"} ${d||"0"} * * ${p}", ${l});`}else s.tagCard==="astro"?r=`schedule({astro: "${s.astro}", shift: ${s.offset?s.offsetValue:0}}, ${l});`:s.tagCard==="wizard"&&(r=`schedule('${s.wizard}', ${l});`);return r}static _time2String(s){return s?`${s.getHours().toString().padStart(2,"0")}:${s.getMinutes().toString().padStart(2,"0")}`:"--:--"}async _setAstro(s,i,r){var p,f;if(s||=this.state.settings.astro||"solarNoon",i??=this.state.settings.offset,r??=this.state.settings.offsetValue,r=parseInt(r,10)||0,!this.coordinates){const b=await this.props.socket.getObject("system.adapter.javascript.0"),y=(p=b==null?void 0:b.native)==null?void 0:p.latitude,w=(f=b==null?void 0:b.native)==null?void 0:f.longitude;if(!y&&!w){const v=await this.props.socket.getObject("system.config");v!=null&&v.common&&(v.common.latitude||v.common.longitude)?this.coordinates={latitude:parseFloat(v.common.latitude),longitude:parseFloat(v.common.longitude)}:this.coordinates=null}else this.coordinates={latitude:parseFloat(y),longitude:parseFloat(w)}}const l=this.coordinates&&DC.getTimes(new Date,this.coordinates.latitude,this.coordinates.longitude),c=l?Object.keys(l).map(b=>({value:b,title:b,title2:`[${Ii._time2String(l[b])}]`,order:l?Ii._time2String(l[b]):"??:??"})):[];c.sort((b,y)=>b.order>y.order?1:b.ordersuper.onTagChange())}_setInterval(s){s=parseInt(s||this.state.settings.interval,10)||30;let i;s===1?i=[{value:"s",title:"second"},{value:"m",title:"minute"},{value:"h",title:"hour"}]:i=[{value:"s",title:"seconds"},{value:"m",title:"minutes"},{value:"h",title:"hours"}],this.setState({inputs:[{nameRender:"renderNumber",attr:"interval",frontText:"every",defaultValue:30,className:"block-input-interval"},{nameRender:"renderSelect",attr:"unit",defaultValue:"s",options:i}]},()=>super.onTagChange())}renderDebug(s){return x.I18n.t("Triggered")}onValueChanged(s,i){this.state.settings.tagCard==="astro"?i==="astro"?this._setAstro(s):i==="offset"?this._setAstro(void 0,s):i==="offsetValue"&&this._setAstro(void 0,void 0,s):this.state.settings.tagCard==="interval"&&i==="interval"&&this._setInterval(s)}renderCron(s,i,r){const{className:l}=this.props;return m.jsxs("div",{children:[m.jsxs("div",{style:{display:"flex",alignItems:"baseline"},children:[m.jsx("div",{style:{width:"100%"},children:this.renderText({nameRender:"renderText",attr:"cron",defaultValue:i},this.state.settings.cron||i,r)}),m.jsx(Jr,{square:!0,style:{marginLeft:7},value:"...",className:l,onClick:()=>this.setState({openDialog:!0,textCron:this.state.settings.cron})})]}),this.state.openDialog?m.jsx(cm,{disabled:this.state.settings.cron===this.state.textCron,onApply:()=>{const c=this.state.textCron;r(c,"cron",()=>{r(x.convertCronToText(c,x.I18n.getLanguage()),"addText"),this.setState({openDialog:!1})})},onClose:()=>this.setState({openDialog:!1,textCron:""}),children:m.jsx(x.ComplexCron,{cronExpression:this.state.settings.cron,onChange:c=>this.setState({textCron:c}),language:x.I18n.getLanguage()})}):null,this.renderNameText({nameRender:"renderNameText",defaultValue:x.I18n.t("every hour at 0 minutes"),attr:"addText",signature:!0,doNotTranslate:!0},this.state.settings.addText||x.I18n.t("every hour at 0 minutes"))]},"cron")}renderWizard(s,i,r){const{className:l}=this.props;return m.jsxs("div",{children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:7},children:[m.jsx(Ei,{className:l,autoComplete:"off",fullWidth:!0,variant:"outlined",size:"small",multiline:!0,rows:2,value:this.state.settings.wizardText,onChange:c=>r(c),customValue:!0}),m.jsx(Jr,{square:!0,style:{marginLeft:7},value:"...",className:l,onClick:()=>this.setState({openDialog:!0,wizard:this.state.settings.wizard,wizardText:x.Schedule.state2text(this.state.settings.wizard)})})]}),this.state.openDialog?m.jsx(cm,{disabled:this.state.settings.wizard===this.state.wizard,onApply:()=>this.setState({openDialog:!1},()=>{const c=JSON.parse(this.state.wizard);c.valid||={from:x.Schedule.now2string()},c.valid.from||=x.Schedule.now2string(),r({wizardText:this.state.wizardText,wizard:JSON.stringify(c)})}),onClose:()=>this.setState({openDialog:!1}),children:m.jsx(x.Schedule,{theme:this.props.theme,schedule:i,onChange:(c,d)=>this.setState({wizardText:d||"",wizard:c})})}):null]},"wizard")}onTagChange(s){switch(s||=this.state.settings.tagCard,s){case"interval":this._setInterval();break;case"cron":this.setState({inputs:[{nameRender:"renderCron",attr:"cron",defaultValue:"0 * * * *"}]},()=>super.onTagChange());break;case"wizard":{const i=JSON.parse(gR);i.valid||={from:x.Schedule.now2string()},i.valid.from||=x.Schedule.now2string(),this.setState({inputs:[{nameRender:"renderWizard",attr:"wizard",defaultValue:JSON.stringify(i)}]},()=>super.onTagChange(null,()=>{const r=x.Schedule.state2text(this.state.settings.wizard||i);if(this.state.settings.wizard!==r){const l=JSON.parse(JSON.stringify(this.state.settings));l.wizardText=r,this.setState({settings:l}),this.props.onChange(l)}}));break}case"at":this.setState({inputs:[{nameRender:"renderTime",prefix:"at",attr:"at",defaultValue:"07:30"},{nameRender:"renderSelect",attr:"dow",default:"",multiple:!0,defaultValue:["_","1","2","3","4","5","6","0"],options:[{value:"_",title:"Every day",only:!0},{value:"1",title:"Monday",titleShort:"Mo"},{value:"2",title:"Tuesday",titleShort:"Tu"},{value:"3",title:"Wednesday",titleShort:"We"},{value:"4",title:"Thursday",titleShort:"Th"},{value:"5",title:"Friday",titleShort:"Fr"},{value:"6",title:"Saturday",titleShort:"Sa"},{value:"0",title:"Sunday",titleShort:"Su"}]}]},()=>super.onTagChange());break;case"astro":this._setAstro();break}}static getStaticData(){return{acceptedBy:"triggers",name:"Schedule",id:"TriggerScheduleBlock",icon:"AccessTime",tagCardArray:["cron","wizard","interval","at","astro"],title:"Triggers the rule periodically or on some specific time"}}getData(){return Ii.getStaticData()}}const In={valueAck:{color:"#b02323"},valueNotAck:{color:"#12ac15"}},AC=_e.forwardRef((a,s)=>m.jsx(XT,{direction:"up",ref:s,...a}));AC.displayName="Transition";class Bc extends at{inputRef;constructor(s){super(s,Bc.getStaticData()),this.inputRef=_e.createRef()}static compile(s,i){let r=i.justCheck?EC:IC;return r=r.replace('"__%%DEBUG_TRIGGER%%__"',`_sendToFrontEnd(${s._id}, {val: obj.state.val, ack: obj.state.ack, valOld: obj.oldState && obj.oldState.val, ackOld: obj.oldState && obj.oldState.ack})`),`on({id: "${s.oid||""}", change: "${s.tagCard==="on update"?"any":"ne"}"}, ${r});`}renderDebug(s){return s.data.valOld!==void 0?m.jsxs("span",{children:[x.I18n.t("Triggered")," ",m.jsx("span",{style:s.data.ackOld?In.valueAck:In.valueNotAck,children:Ln(s.data.valOld)})," ","→"," ",m.jsx("span",{style:s.data.ack?In.valueAck:In.valueNotAck,children:Ln(s.data.val)})]}):m.jsxs("span",{children:[x.I18n.t("Triggered")," ",m.jsx("span",{style:s.data.ack?In.valueAck:In.valueNotAck,children:Ln(s.data.val)})]})}onWriteValue(){this.setState({openSimulate:!1});let s=this.state.simulateValue;window.localStorage.setItem(`javascript.app.${this.state.settings.oid}_ack`,this.state.simulateAck?"true":"false"),this.state.settings.oidType==="boolean"?(s=s===!0||s==="true"||s==="1",window.localStorage.setItem(`javascript.app.${this.state.settings.oid}`,s?"true":"false")):this.state.settings.oidType==="number"?(s=parseFloat(s)||0,window.localStorage.setItem(`javascript.app.${this.state.settings.oid}`,s.toString())):window.localStorage.setItem(`javascript.app.${this.state.settings.oid}`,(s==null?void 0:s.toString())||""),this.props.socket.setState(this.state.settings.oid,{val:s,ack:!!this.state.simulateAck})}renderWriteState(){return[m.jsx(He,{disabled:!this.state.settings.oid||!this.state.enableSimulation,variant:"contained",color:"primary",onClick:()=>{this.setState({openSimulate:!0,simulateValue:this.state.settings.oidType==="boolean"?window.localStorage.getItem(`javascript.app.${this.state.settings.oid}`)==="true":window.localStorage.getItem(`javascript.app.${this.state.settings.oid}`)||"",simulateAck:window.localStorage.getItem(`javascript.app.${this.state.settings.oid}_ack`)==="true"}),setTimeout(()=>{var s;return(s=this.inputRef.current)==null?void 0:s.focus()},200)},children:x.I18n.t("Simulate")},"buttonWrite"),m.jsxs(Ut,{open:!!this.state.openSimulate,TransitionComponent:AC,keepMounted:!0,onClose:()=>this.setState({openSimulate:!1}),"aria-labelledby":"simulate-dialog-slide-title","aria-describedby":"simulate-dialog-slide-description",children:[m.jsx(ss,{id:"simulate-dialog-slide-title",children:x.I18n.t("Trigger with value")}),m.jsxs(qt,{children:[this.state.settings.oidType==="boolean"?m.jsx(Mg,{control:m.jsx(Nw,{inputRef:this.inputRef,onKeyUp:s=>s.key==="Enter"&&this.onWriteValue(),value:!!this.state.simulateValue,onChange:s=>this.setState({simulateValue:s.target.checked})}),label:x.I18n.t("Value")}):m.jsx(Eo,{variant:"standard",inputRef:this.inputRef,label:x.I18n.t("Value"),fullWidth:!0,onKeyUp:s=>s.key==="Enter"&&this.onWriteValue(),value:!this.state.simulateValue&&this.state.simulateValue!==0?"":this.state.simulateValue,onChange:s=>this.setState({simulateValue:s.target.value})}),m.jsx("br",{}),m.jsx(Mg,{control:m.jsx(wc,{checked:!!this.state.simulateAck,onChange:s=>this.setState({simulateAck:s.target.checked}),color:"primary"}),label:x.I18n.t("Ack")})]}),m.jsxs(Ht,{children:[m.jsxs(He,{variant:"contained",onClick:()=>this.onWriteValue(),color:"primary",children:[m.jsx(TS,{}),x.I18n.t("Write")]}),m.jsxs(He,{color:"grey",variant:"contained",onClick:()=>this.setState({openSimulate:!1}),children:[m.jsx(Yc,{}),x.I18n.t("Close")]})]})]},"dialogWrite")]}onTagChange(s){this.setState({inputs:[{nameRender:"renderObjectID",attr:"oid",defaultValue:""},{nameRender:"renderWriteState"}]},()=>{super.onTagChange()})}static getStaticData(){return{acceptedBy:"triggers",name:"State",id:"TriggerState",icon:"FlashOn",tagCardArray:["on change","on update"],title:"Triggers the rule on update or change of some state"}}getData(){return Bc.getStaticData()}}const mR=""+new URL("hysteresis-CLhhemcG.png",import.meta.url).href,vw=`function __hysteresis(val, limit, state, hist, comp) { +//${JSON.stringify(a)}`}class Pc extends at{constructor(s){super(s,Pc.getStaticData())}static compile(s,i){return cO.replace('"__%%DEBUG_TRIGGER%%__"',`_sendToFrontEnd(${s._id}, {trigger: true})`)}renderDebug(){return x.I18n.t("Triggered")}onTagChange(s){this.setState({inputs:[{nameRender:"renderNameText",defaultValue:"On script save or adapter start",attr:"script"}]},()=>super.onTagChange())}static getStaticData(){return{acceptedBy:"triggers",name:"Start script",id:"TriggerScriptSave",icon:"PlayArrow",title:"Triggers the on script saving or the javascript instance restart"}}getData(){return Pc.getStaticData()}}var xC={exports:{}};(function(a,s){(function(){var i=Math.PI,r=Math.sin,l=Math.cos,c=Math.tan,d=Math.asin,h=Math.atan2,p=Math.acos,f=i/180,b=1e3*60*60*24,y=2440588,w=2451545;function v(re){return re.valueOf()/b-.5+y}function _(re){return new Date((re+.5-y)*b)}function $(re){return v(re)-w}var S=f*23.4397;function T(re,B){return h(r(re)*l(S)-c(B)*r(S),l(re))}function E(re,B){return d(r(B)*l(S)+l(B)*r(S)*r(re))}function D(re,B,N){return h(r(re),l(re)*r(B)-c(N)*l(B))}function M(re,B,N){return d(r(B)*r(N)+l(B)*l(N)*l(re))}function P(re,B){return f*(280.16+360.9856235*re)-B}function W(re){return re<0&&(re=0),2967e-7/Math.tan(re+.00312536/(re+.08901179))}function G(re){return f*(357.5291+.98560028*re)}function z(re){var B=f*(1.9148*r(re)+.02*r(2*re)+3e-4*r(3*re)),N=f*102.9372;return re+B+N+i}function Z(re){var B=G(re),N=z(B);return{dec:E(N,0),ra:T(N,0)}}var he={};he.getPosition=function(re,B,N){var te=f*-N,q=f*B,se=$(re),F=Z(se),Te=P(se,te)-F.ra;return{azimuth:D(Te,q,F.dec),altitude:M(Te,q,F.dec)}};var Ce=he.times=[[-.833,"sunrise","sunset"],[-.3,"sunriseEnd","sunsetStart"],[-6,"dawn","dusk"],[-12,"nauticalDawn","nauticalDusk"],[-18,"nightEnd","night"],[6,"goldenHourEnd","goldenHour"]];he.addTime=function(re,B,N){Ce.push([re,B,N])};var O=9e-4;function K(re,B){return Math.round(re-O-B/(2*i))}function C(re,B,N){return O+(re+B)/(2*i)+N}function Q(re,B,N){return w+re+.0053*r(B)-.0069*r(2*N)}function ve(re,B,N){return p((r(re)-r(B)*r(N))/(l(B)*l(N)))}function ce(re,B,N,te,q,se,F){var Te=ve(re,N,te),ae=C(Te,B,q);return Q(ae,se,F)}he.getTimes=function(re,B,N){var te=f*-N,q=f*B,se=$(re),F=K(se,te),Te=C(0,te,F),ae=G(Te),we=z(ae),Ie=E(we,0),Ne=Q(Te,ae,we),Ae,We,k,X,Y,R={solarNoon:_(Ne),nadir:_(Ne+.5)};for(Ae=0,We=Ce.length;Ae=0&&(U=Math.sqrt(X)/(Math.abs(Ne)*2),R=We-U,A=We+U,Math.abs(R)<=1&&Y++,Math.abs(A)<=1&&Y++,R<-1&&(R=A)),Y===1?F<0?we=H+R:Ie=H+R:Y===2&&(we=H+(k<0?A:R),Ie=H+(k<0?R:A)),!(we&&Ie));H+=2)F=ae;var ue={};return we&&(ue.rise=me(q,we)),Ie&&(ue.set=me(q,Ie)),!we&&!Ie&&(ue[k>0?"alwaysUp":"alwaysDown"]=!0),ue},a.exports=he})()})(xC);var pO=xC.exports;const DC=Xo(pO),gO='{"time":{"start":"00:00","end":"24:00","mode":"hours","interval":1},"period":{"days":1}}';class Ii extends at{coordinates=null;constructor(s){super(s,Ii.getStaticData())}static compile(s,i){var c;let r="",l=i.justCheck?EC:IC;if(l=l.replace('"__%%DEBUG_TRIGGER%%__"',`_sendToFrontEnd(${s._id}, {trigger: true})`),s.tagCard==="interval")r=`setInterval(${l}, ${s.interval||1} * ${s.unit==="s"?1e3:s.unit==="m"?6e4:36e5});`;else if(s.tagCard==="cron")r=`schedule("${s.cron}", ${l});`;else if(s.tagCard==="at"){const[d,h]=(s.at||"").split(":");let p="*";if((c=s==null?void 0:s.dow)!=null&&c.length&&!s.dow.includes("_")){const f=[...s.dow].map(v=>parseInt(v,10));f.sort();const b=[];let y=f[0],w=1;for(;w1?(y===f[w-1]?b.push(y.toString()):f[w-1]-y===1?b.push(`${y},${f[w-1]}`):b.push(`${y}-${f[w-1]}`),y=f[w]):w===f.length-1&&(y===f[w-1]||f[w]-y===1?b.push(`${y},${f[w]}`):b.push(`${y}-${f[w]}`));p=b.join(",")}r=`schedule("${h||"0"} ${d||"0"} * * ${p}", ${l});`}else s.tagCard==="astro"?r=`schedule({astro: "${s.astro}", shift: ${s.offset?s.offsetValue:0}}, ${l});`:s.tagCard==="wizard"&&(r=`schedule('${s.wizard}', ${l});`);return r}static _time2String(s){return s?`${s.getHours().toString().padStart(2,"0")}:${s.getMinutes().toString().padStart(2,"0")}`:"--:--"}async _setAstro(s,i,r){var p,f;if(s||=this.state.settings.astro||"solarNoon",i??=this.state.settings.offset,r??=this.state.settings.offsetValue,r=parseInt(r,10)||0,!this.coordinates){const b=await this.props.socket.getObject("system.adapter.javascript.0"),y=(p=b==null?void 0:b.native)==null?void 0:p.latitude,w=(f=b==null?void 0:b.native)==null?void 0:f.longitude;if(!y&&!w){const v=await this.props.socket.getObject("system.config");v!=null&&v.common&&(v.common.latitude||v.common.longitude)?this.coordinates={latitude:parseFloat(v.common.latitude),longitude:parseFloat(v.common.longitude)}:this.coordinates=null}else this.coordinates={latitude:parseFloat(y),longitude:parseFloat(w)}}const l=this.coordinates&&DC.getTimes(new Date,this.coordinates.latitude,this.coordinates.longitude),c=l?Object.keys(l).map(b=>({value:b,title:b,title2:`[${Ii._time2String(l[b])}]`,order:l?Ii._time2String(l[b]):"??:??"})):[];c.sort((b,y)=>b.order>y.order?1:b.ordersuper.onTagChange())}_setInterval(s){s=parseInt(s||this.state.settings.interval,10)||30;let i;s===1?i=[{value:"s",title:"second"},{value:"m",title:"minute"},{value:"h",title:"hour"}]:i=[{value:"s",title:"seconds"},{value:"m",title:"minutes"},{value:"h",title:"hours"}],this.setState({inputs:[{nameRender:"renderNumber",attr:"interval",frontText:"every",defaultValue:30,className:"block-input-interval"},{nameRender:"renderSelect",attr:"unit",defaultValue:"s",options:i}]},()=>super.onTagChange())}renderDebug(s){return x.I18n.t("Triggered")}onValueChanged(s,i){this.state.settings.tagCard==="astro"?i==="astro"?this._setAstro(s):i==="offset"?this._setAstro(void 0,s):i==="offsetValue"&&this._setAstro(void 0,void 0,s):this.state.settings.tagCard==="interval"&&i==="interval"&&this._setInterval(s)}renderCron(s,i,r){const{className:l}=this.props;return m.jsxs("div",{children:[m.jsxs("div",{style:{display:"flex",alignItems:"baseline"},children:[m.jsx("div",{style:{width:"100%"},children:this.renderText({nameRender:"renderText",attr:"cron",defaultValue:i},this.state.settings.cron||i,r)}),m.jsx(Jr,{square:!0,style:{marginLeft:7},value:"...",className:l,onClick:()=>this.setState({openDialog:!0,textCron:this.state.settings.cron})})]}),this.state.openDialog?m.jsx(cm,{disabled:this.state.settings.cron===this.state.textCron,onApply:()=>{const c=this.state.textCron;r(c,"cron",()=>{r(x.convertCronToText(c,x.I18n.getLanguage()),"addText"),this.setState({openDialog:!1})})},onClose:()=>this.setState({openDialog:!1,textCron:""}),children:m.jsx(x.ComplexCron,{cronExpression:this.state.settings.cron,onChange:c=>this.setState({textCron:c}),language:x.I18n.getLanguage()})}):null,this.renderNameText({nameRender:"renderNameText",defaultValue:x.I18n.t("every hour at 0 minutes"),attr:"addText",signature:!0,doNotTranslate:!0},this.state.settings.addText||x.I18n.t("every hour at 0 minutes"))]},"cron")}renderWizard(s,i,r){const{className:l}=this.props;return m.jsxs("div",{children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:7},children:[m.jsx(Ei,{className:l,autoComplete:"off",fullWidth:!0,variant:"outlined",size:"small",multiline:!0,rows:2,value:this.state.settings.wizardText,onChange:c=>r(c),customValue:!0}),m.jsx(Jr,{square:!0,style:{marginLeft:7},value:"...",className:l,onClick:()=>this.setState({openDialog:!0,wizard:this.state.settings.wizard,wizardText:x.Schedule.state2text(this.state.settings.wizard)})})]}),this.state.openDialog?m.jsx(cm,{disabled:this.state.settings.wizard===this.state.wizard,onApply:()=>this.setState({openDialog:!1},()=>{const c=JSON.parse(this.state.wizard);c.valid||={from:x.Schedule.now2string()},c.valid.from||=x.Schedule.now2string(),r({wizardText:this.state.wizardText,wizard:JSON.stringify(c)})}),onClose:()=>this.setState({openDialog:!1}),children:m.jsx(x.Schedule,{theme:this.props.theme,schedule:i,onChange:(c,d)=>this.setState({wizardText:d||"",wizard:c})})}):null]},"wizard")}onTagChange(s){switch(s||=this.state.settings.tagCard,s){case"interval":this._setInterval();break;case"cron":this.setState({inputs:[{nameRender:"renderCron",attr:"cron",defaultValue:"0 * * * *"}]},()=>super.onTagChange());break;case"wizard":{const i=JSON.parse(gO);i.valid||={from:x.Schedule.now2string()},i.valid.from||=x.Schedule.now2string(),this.setState({inputs:[{nameRender:"renderWizard",attr:"wizard",defaultValue:JSON.stringify(i)}]},()=>super.onTagChange(null,()=>{const r=x.Schedule.state2text(this.state.settings.wizard||i);if(this.state.settings.wizard!==r){const l=JSON.parse(JSON.stringify(this.state.settings));l.wizardText=r,this.setState({settings:l}),this.props.onChange(l)}}));break}case"at":this.setState({inputs:[{nameRender:"renderTime",prefix:"at",attr:"at",defaultValue:"07:30"},{nameRender:"renderSelect",attr:"dow",default:"",multiple:!0,defaultValue:["_","1","2","3","4","5","6","0"],options:[{value:"_",title:"Every day",only:!0},{value:"1",title:"Monday",titleShort:"Mo"},{value:"2",title:"Tuesday",titleShort:"Tu"},{value:"3",title:"Wednesday",titleShort:"We"},{value:"4",title:"Thursday",titleShort:"Th"},{value:"5",title:"Friday",titleShort:"Fr"},{value:"6",title:"Saturday",titleShort:"Sa"},{value:"0",title:"Sunday",titleShort:"Su"}]}]},()=>super.onTagChange());break;case"astro":this._setAstro();break}}static getStaticData(){return{acceptedBy:"triggers",name:"Schedule",id:"TriggerScheduleBlock",icon:"AccessTime",tagCardArray:["cron","wizard","interval","at","astro"],title:"Triggers the rule periodically or on some specific time"}}getData(){return Ii.getStaticData()}}const In={valueAck:{color:"#b02323"},valueNotAck:{color:"#12ac15"}},AC=_e.forwardRef((a,s)=>m.jsx(XT,{direction:"up",ref:s,...a}));AC.displayName="Transition";class Bc extends at{inputRef;constructor(s){super(s,Bc.getStaticData()),this.inputRef=_e.createRef()}static compile(s,i){let r=i.justCheck?EC:IC;return r=r.replace('"__%%DEBUG_TRIGGER%%__"',`_sendToFrontEnd(${s._id}, {val: obj.state.val, ack: obj.state.ack, valOld: obj.oldState && obj.oldState.val, ackOld: obj.oldState && obj.oldState.ack})`),`on({id: "${s.oid||""}", change: "${s.tagCard==="on update"?"any":"ne"}"}, ${r});`}renderDebug(s){return s.data.valOld!==void 0?m.jsxs("span",{children:[x.I18n.t("Triggered")," ",m.jsx("span",{style:s.data.ackOld?In.valueAck:In.valueNotAck,children:Ln(s.data.valOld)})," ","→"," ",m.jsx("span",{style:s.data.ack?In.valueAck:In.valueNotAck,children:Ln(s.data.val)})]}):m.jsxs("span",{children:[x.I18n.t("Triggered")," ",m.jsx("span",{style:s.data.ack?In.valueAck:In.valueNotAck,children:Ln(s.data.val)})]})}onWriteValue(){this.setState({openSimulate:!1});let s=this.state.simulateValue;window.localStorage.setItem(`javascript.app.${this.state.settings.oid}_ack`,this.state.simulateAck?"true":"false"),this.state.settings.oidType==="boolean"?(s=s===!0||s==="true"||s==="1",window.localStorage.setItem(`javascript.app.${this.state.settings.oid}`,s?"true":"false")):this.state.settings.oidType==="number"?(s=parseFloat(s)||0,window.localStorage.setItem(`javascript.app.${this.state.settings.oid}`,s.toString())):window.localStorage.setItem(`javascript.app.${this.state.settings.oid}`,(s==null?void 0:s.toString())||""),this.props.socket.setState(this.state.settings.oid,{val:s,ack:!!this.state.simulateAck})}renderWriteState(){return[m.jsx(Ue,{disabled:!this.state.settings.oid||!this.state.enableSimulation,variant:"contained",color:"primary",onClick:()=>{this.setState({openSimulate:!0,simulateValue:this.state.settings.oidType==="boolean"?window.localStorage.getItem(`javascript.app.${this.state.settings.oid}`)==="true":window.localStorage.getItem(`javascript.app.${this.state.settings.oid}`)||"",simulateAck:window.localStorage.getItem(`javascript.app.${this.state.settings.oid}_ack`)==="true"}),setTimeout(()=>{var s;return(s=this.inputRef.current)==null?void 0:s.focus()},200)},children:x.I18n.t("Simulate")},"buttonWrite"),m.jsxs(Pt,{open:!!this.state.openSimulate,TransitionComponent:AC,keepMounted:!0,onClose:()=>this.setState({openSimulate:!1}),"aria-labelledby":"simulate-dialog-slide-title","aria-describedby":"simulate-dialog-slide-description",children:[m.jsx(Xt,{id:"simulate-dialog-slide-title",children:x.I18n.t("Trigger with value")}),m.jsxs(Wt,{children:[this.state.settings.oidType==="boolean"?m.jsx(Mg,{control:m.jsx(Nw,{inputRef:this.inputRef,onKeyUp:s=>s.key==="Enter"&&this.onWriteValue(),value:!!this.state.simulateValue,onChange:s=>this.setState({simulateValue:s.target.checked})}),label:x.I18n.t("Value")}):m.jsx(Eo,{variant:"standard",inputRef:this.inputRef,label:x.I18n.t("Value"),fullWidth:!0,onKeyUp:s=>s.key==="Enter"&&this.onWriteValue(),value:!this.state.simulateValue&&this.state.simulateValue!==0?"":this.state.simulateValue,onChange:s=>this.setState({simulateValue:s.target.value})}),m.jsx("br",{}),m.jsx(Mg,{control:m.jsx(wc,{checked:!!this.state.simulateAck,onChange:s=>this.setState({simulateAck:s.target.checked}),color:"primary"}),label:x.I18n.t("Ack")})]}),m.jsxs(Bt,{children:[m.jsxs(Ue,{variant:"contained",onClick:()=>this.onWriteValue(),color:"primary",children:[m.jsx(TS,{}),x.I18n.t("Write")]}),m.jsxs(Ue,{color:"grey",variant:"contained",onClick:()=>this.setState({openSimulate:!1}),children:[m.jsx(Yc,{}),x.I18n.t("Close")]})]})]},"dialogWrite")]}onTagChange(s){this.setState({inputs:[{nameRender:"renderObjectID",attr:"oid",defaultValue:""},{nameRender:"renderWriteState"}]},()=>{super.onTagChange()})}static getStaticData(){return{acceptedBy:"triggers",name:"State",id:"TriggerState",icon:"FlashOn",tagCardArray:["on change","on update"],title:"Triggers the rule on update or change of some state"}}getData(){return Bc.getStaticData()}}const mO=""+new URL("hysteresis-CLhhemcG.png",import.meta.url).href,vw=`function __hysteresis(val, limit, state, hist, comp) { let cond1, cond2; if (comp === '>') { cond1 = val > limit + hist; @@ -1200,13 +1200,13 @@ const demo = ${JSON.stringify(a,null,2).replace(/\*\//g,"* /")}; } else { return state; } -}`;class qr extends at{constructor(s){super(s,qr.getStaticData())}isAllTriggersOnState(){var s,i,r,l;return!!((i=(s=this.props.userRules)==null?void 0:s.triggers)!=null&&i.find(c=>c.id==="TriggerState"))&&!((l=(r=this.props.userRules)==null?void 0:r.triggers)!=null&&l.find(c=>c.id!=="TriggerState"))}static compile(s,i){var d,h;let r=s.value;r==null&&(r=!1);let l,c;if(s.tagCard==="()")i.prelines||=[],i.prelines.find(p=>p!==vw)||i.prelines.push(vw),s.useTrigger?(l="obj.state.val",r===""&&(r=0),c=`__hysteresis(subCondVar${s._id}, ${r}, __%%STATE%%__, ${s.hist}, "${s.histComp}")`):(l=`(await getStateAsync("${s.oid}")).val`,r===""&&(r=0),typeof r=="string"&&parseFloat(r.trim()).toString()!==r.trim()&&(r=`"${r}"`),c=`__hysteresis(subCondVar${s._id}, ${r}, __%%STATE%%__, ${s.hist}, "${s.histComp}")`);else if(s.tagCard!=="includes"){const p=s.tagCard==="="?"==":s.tagCard==="<>"?"!=":s.tagCard;s.useTrigger?(l="obj.state.val",((d=i==null?void 0:i.trigger)==null?void 0:d.oidType)==="string"?(r=r.replace(/"/g,'\\"'),c=`subCondVar${s._id} ${p} "${r}"`):(r===""&&(r=0),typeof r=="string"&&parseFloat(r.trim()).toString()!==r.trim()&&(r=`"${r}"`),c=`subCondVar${s._id} ${p} ${r}`)):(l=`(await getStateAsync("${s.oid}")).val`,s.oidType==="string"?(r=r.replace(/"/g,'\\"'),c=`subCondVar${s._id} ${p} "${r}"`):(r===""&&(r=0),typeof r=="string"&&parseFloat(r.trim()).toString()!==r.trim()&&(r=`"${r}"`),c=`subCondVar${s._id} ${p} ${r}`))}else s.useTrigger?(l="obj.state.val",((h=i==null?void 0:i.trigger)==null?void 0:h.oidType)==="string"?(r=r.replace(/"/g,'\\"'),c=`obj.state.val.includes("${r}")`):c="false"):(l=`(await getStateAsync("${s.oid}")).val`,s.oidType==="string"?(r=r.replace(/"/g,'\\"'),c=`subCondVar${s._id}.includes("${r}")`):c="false");return i.conditionsStates.push({name:`subCondVar${s._id}`,id:s.oid}),i.conditionsVars.push(`const subCondVar${s._id} = ${l};`),i.conditionsVars.push(`const subCond${s._id} = ${c};`),i.conditionsDebug.push(`_sendToFrontEnd(${s._id}, {result: subCond${s._id}, value: subCondVar${s._id}, compareWith: "${r}"});`),`subCond${s._id}`}renderDebug(s){const i=this.state.settings.tagCard;return i!=="()"?`${s.data.result.toString().toUpperCase()} [${s.data.value} ${i} ${s.data.compareWith}]`:x.I18n.t("Triggered")}onShowHelp=()=>this.setState({showHysteresisHelp:!0});_setInputs(s,i,r,l,c){var $,S;const d=this.isAllTriggersOnState();i=i||this.state.settings.tagCard,r=r||this.state.settings.oidType,l=l||this.state.settings.oidUnit,c=c||this.state.settings.oidStates,s===void 0&&(s=this.state.settings.useTrigger),d&&s&&((S=($=this.props.userRules)==null?void 0:$.triggers)==null?void 0:S.length)===1&&(r=this.props.userRules.triggers[0].oidType,l=this.props.userRules.triggers[0].oidUnit,c=this.props.userRules.triggers[0].oidStates);const h=qr.getStaticData().tagCardArray,p=h.find(T=>T.title===i)||h[0];let f,b=null;r==="number"?(f=[{title:"=",title2:"[equal]",text:"equal to"},{title:">=",title2:"[greater or equal]",text:"greater or equal"},{title:">",title2:"[greater]",text:"greater than"},{title:"<=",title2:"[less or equal]",text:"less or equal"},{title:"<",title2:"[less]",text:"less than"},{title:"<>",title2:"[not equal]",text:"not equal to"},{title:"()",title2:"[hysteresis]",text:"hysteresis"}],c&&(b=Object.keys(c).map(T=>c?{value:T,title:c[T]}:null).filter(T=>T))):r==="boolean"?(f=[{title:"=",title2:"[equal]",text:"equal to"},{title:"<>",title2:"[not equal]",text:"not equal to"}],b=[{title:"false",value:!1},{title:"true",value:!0}]):(f=[{title:"=",title2:"[equal]",text:"equal to"},{title:">=",title2:"[greater or equal]",text:"greater or equal"},{title:">",title2:"[greater]",text:"greater than"},{title:"<=",title2:"[less or equal]",text:"less or equal"},{title:"<",title2:"[less]",text:"less than"},{title:"<>",title2:"[not equal]",text:"not equal to"},{title:".",title2:"[includes]",text:"includes"}],c&&(b=Object.keys(c).map(T=>({value:T,title:c?c[T]:T.toString()}))));let y=null;f.find(T=>T.title===i)||(i=f[0].title,y=y||{...this.state.settings},y.tagCard=i);let w,v={nameRender:"renderText",defaultValue:"",attr:"value",frontText:i==="()"?"Limit":(p==null?void 0:p.text)||"compare with",doNotTranslateBack:!0,backText:l};b&&(v={nameRender:"renderSelect",defaultValue:b[0].value,options:b,attr:"value",frontText:(p==null?void 0:p.text)||"compare with",doNotTranslateBack:!0,backText:l},b.find(T=>T.value===this.state.settings.value)||(y=y||{...this.state.settings},y.value=b[0].value),b.length<=2&&(f=[{title:"=",title2:"[equal]",text:"equal to"},{title:"<>",title2:"[not equal]",text:"not equal to"}])),d&&s?w=[{backText:"use trigger value",nameRender:"renderCheckbox",attr:"useTrigger",defaultValue:!1},v]:d?w=[{backText:"use trigger value",nameRender:"renderCheckbox",attr:"useTrigger"},{nameRender:"renderObjectID",attr:"oid",defaultValue:""},v]:w=[{nameRender:"renderObjectID",attr:"oid",defaultValue:""},v],i==="()"&&(w.splice(1,0,{nameRender:"renderDialog",icon:"HelpOutline",frontText:"Explanation",onShowDialog:this.onShowHelp}),w.splice(2,0,{nameRender:"renderSelect",attr:"histComp",defaultValue:">",frontText:"Condition",doNotTranslate:!0,options:[{title:">",value:">"},{title:">=",value:">="},{title:"<",value:"<"},{title:"<=",value:"<="},{title:"=",value:"="},{title:"<>",value:"<>"}]}),w.push({frontText:"Δ",doNotTranslate:!0,nameRender:"renderNumber",noHelperText:!0,attr:"hist",defaultValue:1,doNotTranslateBack:!0,backText:l}));const _={iconTag:!0,tagCardArray:f,inputs:w};this.setState(_,()=>super.onTagChange(null,()=>{y&&(this.setState({settings:y}),this.props.onChange(y))}))}onValueChanged(s,i){typeof s=="object"?this._setInputs(s.useTrigger,s.tagCard,s.oidType,s.states):i==="useTrigger"?this._setInputs(s):i==="oidType"?this._setInputs(void 0,void 0,s):i==="oidUnit"?this._setInputs(void 0,void 0,void 0,s):i==="oidStates"&&this._setInputs(void 0,void 0,void 0,void 0,s)}onUpdate(){this._setInputs(this.state.settings.useTrigger)}onTagChange(s){this._setInputs(this.state.settings.useTrigger,s)}static getStaticData(){return{acceptedBy:"conditions",name:"State condition",id:"ConditionState",icon:"Shuffle",tagCardArray:[{title:"=",title2:"[equal]",text:"equal to"},{title:">=",title2:"[greater or equal]",text:"greater or equal"},{title:">",title2:"[greater]",text:"greater than"},{title:"<=",title2:"[less or equal]",text:"less or equal"},{title:"<",title2:"[less]",text:"less than"},{title:"<>",title2:"[not equal]",text:"not equal to"},{title:".",title2:"[includes]",text:"includes"},{title:"()",title2:"[hysteresis]",text:"hysteresis"}],title:"Compares the state value with user defined value"}}getData(){return qr.getStaticData()}renderSpecific(){return this.state.showHysteresisHelp?m.jsxs(Ut,{open:!0,maxWidth:"md",onClose:()=>this.setState({showHysteresisHelp:!1}),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[m.jsx(qt,{children:m.jsx(Dw,{id:"alert-dialog-description",children:m.jsx("img",{src:mR,alt:"Hysteresis"})})}),m.jsx(Ht,{children:m.jsx(He,{onClick:()=>this.setState({showHysteresisHelp:!1}),color:"primary",autoFocus:!0,children:x.I18n.t("OK")})})]}):null}}const yw=[31,29,31,30,31,30,31,31,30,31,30,31];class Xr extends at{constructor(s){super(s,Xr.getStaticData())}static compile(s,i){const r=s.tagCard==="="?"===":s.tagCard==="<>"?"!==":s.tagCard;let l;if(s.withDate){const[c,d]=(s.date||"01.01").toString().split(".");let h=parseInt(d,10)||0,p=parseInt(c,10)||0;p>12?p=12:p<0&&(p=0),h>yw[p]?h=yw[p]:h<0&&(h=0),h&&p?l=`formatDate(Date.now(), 'MM.DD-hh:mm') ${r} "${s.date}-${s.time}"`:h===0&&p?l=`formatDate(Date.now(), 'MM-hh:mm') ${r} "${p.toString().padStart(2,"0")}-${s.time}"`:p===0&&h?l=`formatDate(Date.now(), 'DD-hh:mm') ${r} "${h.toString().padStart(2,"0")}-${s.time}"`:l=`formatDate(Date.now(), 'hh:mm') ${r} "${s.time}"`}else l=`formatDate(Date.now(), 'hh:mm') ${r} "${s.time}"`;return i.conditionsVars.push(`const subCond${s._id} = ${l};`),i.conditionsDebug.push(`_sendToFrontEnd(${s._id}, {result: subCond${s._id}});`),`subCond${s._id}`}_setInputs(s,i){i=i===void 0?this.state.settings.withDate:i,s=s||this.state.settings.tagCard;const r=Xr.getStaticData().tagCardArray,l=r==null?void 0:r.find(d=>d.title===s),c=[{nameRender:"renderNameText",attr:"interval",defaultValue:"Actual time of day"},{frontText:(l==null?void 0:l.text)||s,nameRender:"renderTime",attr:"time",defaultValue:"12:00"},{frontText:"with date",nameRender:"renderCheckbox",attr:"withDate",defaultValue:!1}];i&&c.push({nameRender:"renderDate",attr:"date",defaultValue:"01.01"}),this.setState({inputs:c,iconTag:!0},()=>super.onTagChange())}onValueChanged(s,i){i==="withDate"&&this._setInputs(void 0,s)}onTagChange(s){this._setInputs(s)}static getStaticData(){return{acceptedBy:"conditions",name:"Time condition",id:"ConditionTime",icon:"Shuffle",tagCardArray:[{title:"=",title2:"[equal]",text:"equal to"},{title:">=",title2:"[greater or equal]",text:"greater or equal"},{title:">",title2:"[greater]",text:"greater than"},{title:"<=",title2:"[less or equal]",text:"less or equal"},{title:"<",title2:"[less]",text:"less than"},{title:"<>",title2:"[not equal]",text:"not equal to"}],title:"Compares current time with the user specific time"}}getData(){return Xr.getStaticData()}}class Vo extends at{coordinates=null;constructor(s){super(s,Vo.getStaticData())}static compile(s,i){const r=s.tagCard==="="?"===":s.tagCard==="<>"?"!==":s.tagCard;let l;s.offset&&(l=parseInt(s.offsetValue,10)||0);const c=`formatDate(Date.now(), 'hh:mm') ${r} formatDate(getAstroDate("${s.astro}"${l?`, undefined, ${l}`:""}), 'hh:mm')`;return i.conditionsVars.push(`const subCond${s._id} = ${c};`),i.conditionsDebug.push(`_sendToFrontEnd(${s._id}, {result: ${c}});`),c}static _time2String(s){return s?`${s.getHours().toString().padStart(2,"0")}:${s.getMinutes().toString().padStart(2,"0")}`:"--:--"}onValueChanged(s,i){i==="astro"?this._setAstro(s):i==="offset"?this._setAstro(void 0,s):i==="offsetValue"&&this._setAstro(void 0,void 0,s)}async _setAstro(s,i,r){if(s=s||this.state.settings.astro||"solarNoon",i=i===void 0?this.state.settings.offset:i,r=r===void 0?this.state.settings.offsetValue:r,r=parseInt(r,10)||0,!this.coordinates){const b=await this.props.socket.getObject("system.adapter.javascript.0");if(!(b!=null&&b.native.latitude)&&!(b!=null&&b.native.longitude)){const y=await this.props.socket.getObject("system.config");y&&(y.common.latitude||y.common.longitude)?this.coordinates={latitude:y.common.latitude,longitude:y.common.longitude}:this.coordinates=null}else this.coordinates={latitude:b==null?void 0:b.native.latitude,longitude:b==null?void 0:b.native.longitude}}const l=this.coordinates?DC.getTimes(new Date,this.coordinates.latitude,this.coordinates.longitude):null,c=l?Object.keys(l).map(b=>({value:b,title:b,title2:`[${Vo._time2String(l[b])}]`,order:Vo._time2String(l[b])})):[];c.sort((b,y)=>b.order>y.order?1:b.orderb.title===this.state.settings.tagCard)||d[0];let p="--:--";if(s&&l&&l[s]){const b=new Date(l[s]);i&&b.setMinutes(b.getMinutes()+parseInt(r,10)),p=`(${x.I18n.t(h.text)} ${Vo._time2String(b)})`}let f;i?f=[{nameRender:"renderNameText",defaultValue:"Actual time of day",attr:"text"},{frontText:h.text,attr:"astro",nameRender:"renderSelect",options:c,doNotTranslate2:!0,defaultValue:"solarNoon"},{backText:"with offset",nameRender:"renderCheckbox",attr:"offset"},{backText:r===1?"minute":"minutes",frontText:"offset",nameRender:"renderNumber",defaultValue:0,attr:"offsetValue",noHelperText:!0},{nameRender:"renderNameText",attr:"textTime",doNotTranslate:!0,defaultValue:p}]:f=[{nameRender:"renderNameText",defaultValue:"Actual time of day",attr:"text"},{frontText:h.text,attr:"astro",nameRender:"renderSelect",options:c,doNotTranslate2:!0,defaultValue:"solarNoon"},{backText:"with offset",nameRender:"renderCheckbox",attr:"offset"},{nameRender:"renderNameText",attr:"textTime",doNotTranslate:!0,defaultValue:p}],this.setState({inputs:f},()=>super.onTagChange())}onTagChange(){this._setAstro()}static getStaticData(){return{acceptedBy:"conditions",name:"Astronomical",id:"ConditionAstronomical",icon:"Brightness3",tagCardArray:[{title:"=",title2:"[equal]",text:"equal to"},{title:">=",title2:"[greater or equal]",text:"greater or equal to"},{title:">",title2:"[greater]",text:"greater than"},{title:"<=",title2:"[less or equal]",text:"less or equal to"},{title:"<",title2:"[less]",text:"less than"},{title:"<>",title2:"[not equal]",text:"not equal to"}],title:"Compares current time with astronomical event"}}getData(){return Vo.getStaticData()}}const _w={valueAck:{color:"#b02323"},valueNotAck:{color:"#12ac15"}};class Fc extends at{constructor(s){super(s,Fc.getStaticData())}isAllTriggersOnState(){var s,i,r,l;return!!((i=(s=this.props.userRules)==null?void 0:s.triggers)!=null&&i.find(c=>c.id==="TriggerState"))&&!((l=(r=this.props.userRules)==null?void 0:r.triggers)!=null&&l.find(c=>c.id!=="TriggerState"))}static compile(s,i){let r=s.value;s.useTrigger?r=s.toggle?"!obj.state.val":"obj.state.val":(r==null&&(r=""),typeof s.value=="string"&&parseFloat(s.value).toString()!==s.value&&s.value!=="true"&&s.value!=="false"&&(r=`"${r.replace(/"/g,'\\"')}"${at.getReplacesInText(i)}`));let l;return s.toggle&&!s.useTrigger?l=`const subActionVar${s._id} = !(await getStateAsync("${s.oid}")).val`:l=`const subActionVar${s._id} = ${r}`,`// set state ${s.oid} to ${s.toggle&&!s.useTrigger?"toggle":r} +}`;class qr extends at{constructor(s){super(s,qr.getStaticData())}isAllTriggersOnState(){var s,i,r,l;return!!((i=(s=this.props.userRules)==null?void 0:s.triggers)!=null&&i.find(c=>c.id==="TriggerState"))&&!((l=(r=this.props.userRules)==null?void 0:r.triggers)!=null&&l.find(c=>c.id!=="TriggerState"))}static compile(s,i){var d,h;let r=s.value;r==null&&(r=!1);let l,c;if(s.tagCard==="()")i.prelines||=[],i.prelines.find(p=>p!==vw)||i.prelines.push(vw),s.useTrigger?(l="obj.state.val",r===""&&(r=0),c=`__hysteresis(subCondVar${s._id}, ${r}, __%%STATE%%__, ${s.hist}, "${s.histComp}")`):(l=`(await getStateAsync("${s.oid}")).val`,r===""&&(r=0),typeof r=="string"&&parseFloat(r.trim()).toString()!==r.trim()&&(r=`"${r}"`),c=`__hysteresis(subCondVar${s._id}, ${r}, __%%STATE%%__, ${s.hist}, "${s.histComp}")`);else if(s.tagCard!=="includes"){const p=s.tagCard==="="?"==":s.tagCard==="<>"?"!=":s.tagCard;s.useTrigger?(l="obj.state.val",((d=i==null?void 0:i.trigger)==null?void 0:d.oidType)==="string"?(r=r.replace(/"/g,'\\"'),c=`subCondVar${s._id} ${p} "${r}"`):(r===""&&(r=0),typeof r=="string"&&parseFloat(r.trim()).toString()!==r.trim()&&(r=`"${r}"`),c=`subCondVar${s._id} ${p} ${r}`)):(l=`(await getStateAsync("${s.oid}")).val`,s.oidType==="string"?(r=r.replace(/"/g,'\\"'),c=`subCondVar${s._id} ${p} "${r}"`):(r===""&&(r=0),typeof r=="string"&&parseFloat(r.trim()).toString()!==r.trim()&&(r=`"${r}"`),c=`subCondVar${s._id} ${p} ${r}`))}else s.useTrigger?(l="obj.state.val",((h=i==null?void 0:i.trigger)==null?void 0:h.oidType)==="string"?(r=r.replace(/"/g,'\\"'),c=`obj.state.val.includes("${r}")`):c="false"):(l=`(await getStateAsync("${s.oid}")).val`,s.oidType==="string"?(r=r.replace(/"/g,'\\"'),c=`subCondVar${s._id}.includes("${r}")`):c="false");return i.conditionsStates.push({name:`subCondVar${s._id}`,id:s.oid}),i.conditionsVars.push(`const subCondVar${s._id} = ${l};`),i.conditionsVars.push(`const subCond${s._id} = ${c};`),i.conditionsDebug.push(`_sendToFrontEnd(${s._id}, {result: subCond${s._id}, value: subCondVar${s._id}, compareWith: "${r}"});`),`subCond${s._id}`}renderDebug(s){const i=this.state.settings.tagCard;return i!=="()"?`${s.data.result.toString().toUpperCase()} [${s.data.value} ${i} ${s.data.compareWith}]`:x.I18n.t("Triggered")}onShowHelp=()=>this.setState({showHysteresisHelp:!0});_setInputs(s,i,r,l,c){var $,S;const d=this.isAllTriggersOnState();i=i||this.state.settings.tagCard,r=r||this.state.settings.oidType,l=l||this.state.settings.oidUnit,c=c||this.state.settings.oidStates,s===void 0&&(s=this.state.settings.useTrigger),d&&s&&((S=($=this.props.userRules)==null?void 0:$.triggers)==null?void 0:S.length)===1&&(r=this.props.userRules.triggers[0].oidType,l=this.props.userRules.triggers[0].oidUnit,c=this.props.userRules.triggers[0].oidStates);const h=qr.getStaticData().tagCardArray,p=h.find(T=>T.title===i)||h[0];let f,b=null;r==="number"?(f=[{title:"=",title2:"[equal]",text:"equal to"},{title:">=",title2:"[greater or equal]",text:"greater or equal"},{title:">",title2:"[greater]",text:"greater than"},{title:"<=",title2:"[less or equal]",text:"less or equal"},{title:"<",title2:"[less]",text:"less than"},{title:"<>",title2:"[not equal]",text:"not equal to"},{title:"()",title2:"[hysteresis]",text:"hysteresis"}],c&&(b=Object.keys(c).map(T=>c?{value:T,title:c[T]}:null).filter(T=>T))):r==="boolean"?(f=[{title:"=",title2:"[equal]",text:"equal to"},{title:"<>",title2:"[not equal]",text:"not equal to"}],b=[{title:"false",value:!1},{title:"true",value:!0}]):(f=[{title:"=",title2:"[equal]",text:"equal to"},{title:">=",title2:"[greater or equal]",text:"greater or equal"},{title:">",title2:"[greater]",text:"greater than"},{title:"<=",title2:"[less or equal]",text:"less or equal"},{title:"<",title2:"[less]",text:"less than"},{title:"<>",title2:"[not equal]",text:"not equal to"},{title:".",title2:"[includes]",text:"includes"}],c&&(b=Object.keys(c).map(T=>({value:T,title:c?c[T]:T.toString()}))));let y=null;f.find(T=>T.title===i)||(i=f[0].title,y=y||{...this.state.settings},y.tagCard=i);let w,v={nameRender:"renderText",defaultValue:"",attr:"value",frontText:i==="()"?"Limit":(p==null?void 0:p.text)||"compare with",doNotTranslateBack:!0,backText:l};b&&(v={nameRender:"renderSelect",defaultValue:b[0].value,options:b,attr:"value",frontText:(p==null?void 0:p.text)||"compare with",doNotTranslateBack:!0,backText:l},b.find(T=>T.value===this.state.settings.value)||(y=y||{...this.state.settings},y.value=b[0].value),b.length<=2&&(f=[{title:"=",title2:"[equal]",text:"equal to"},{title:"<>",title2:"[not equal]",text:"not equal to"}])),d&&s?w=[{backText:"use trigger value",nameRender:"renderCheckbox",attr:"useTrigger",defaultValue:!1},v]:d?w=[{backText:"use trigger value",nameRender:"renderCheckbox",attr:"useTrigger"},{nameRender:"renderObjectID",attr:"oid",defaultValue:""},v]:w=[{nameRender:"renderObjectID",attr:"oid",defaultValue:""},v],i==="()"&&(w.splice(1,0,{nameRender:"renderDialog",icon:"HelpOutline",frontText:"Explanation",onShowDialog:this.onShowHelp}),w.splice(2,0,{nameRender:"renderSelect",attr:"histComp",defaultValue:">",frontText:"Condition",doNotTranslate:!0,options:[{title:">",value:">"},{title:">=",value:">="},{title:"<",value:"<"},{title:"<=",value:"<="},{title:"=",value:"="},{title:"<>",value:"<>"}]}),w.push({frontText:"Δ",doNotTranslate:!0,nameRender:"renderNumber",noHelperText:!0,attr:"hist",defaultValue:1,doNotTranslateBack:!0,backText:l}));const _={iconTag:!0,tagCardArray:f,inputs:w};this.setState(_,()=>super.onTagChange(null,()=>{y&&(this.setState({settings:y}),this.props.onChange(y))}))}onValueChanged(s,i){typeof s=="object"?this._setInputs(s.useTrigger,s.tagCard,s.oidType,s.states):i==="useTrigger"?this._setInputs(s):i==="oidType"?this._setInputs(void 0,void 0,s):i==="oidUnit"?this._setInputs(void 0,void 0,void 0,s):i==="oidStates"&&this._setInputs(void 0,void 0,void 0,void 0,s)}onUpdate(){this._setInputs(this.state.settings.useTrigger)}onTagChange(s){this._setInputs(this.state.settings.useTrigger,s)}static getStaticData(){return{acceptedBy:"conditions",name:"State condition",id:"ConditionState",icon:"Shuffle",tagCardArray:[{title:"=",title2:"[equal]",text:"equal to"},{title:">=",title2:"[greater or equal]",text:"greater or equal"},{title:">",title2:"[greater]",text:"greater than"},{title:"<=",title2:"[less or equal]",text:"less or equal"},{title:"<",title2:"[less]",text:"less than"},{title:"<>",title2:"[not equal]",text:"not equal to"},{title:".",title2:"[includes]",text:"includes"},{title:"()",title2:"[hysteresis]",text:"hysteresis"}],title:"Compares the state value with user defined value"}}getData(){return qr.getStaticData()}renderSpecific(){return this.state.showHysteresisHelp?m.jsxs(Pt,{open:!0,maxWidth:"md",onClose:()=>this.setState({showHysteresisHelp:!1}),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[m.jsx(Wt,{children:m.jsx(Dw,{id:"alert-dialog-description",children:m.jsx("img",{src:mO,alt:"Hysteresis"})})}),m.jsx(Bt,{children:m.jsx(Ue,{onClick:()=>this.setState({showHysteresisHelp:!1}),color:"primary",autoFocus:!0,children:x.I18n.t("OK")})})]}):null}}const yw=[31,29,31,30,31,30,31,31,30,31,30,31];class Xr extends at{constructor(s){super(s,Xr.getStaticData())}static compile(s,i){const r=s.tagCard==="="?"===":s.tagCard==="<>"?"!==":s.tagCard;let l;if(s.withDate){const[c,d]=(s.date||"01.01").toString().split(".");let h=parseInt(d,10)||0,p=parseInt(c,10)||0;p>12?p=12:p<0&&(p=0),h>yw[p]?h=yw[p]:h<0&&(h=0),h&&p?l=`formatDate(Date.now(), 'MM.DD-hh:mm') ${r} "${s.date}-${s.time}"`:h===0&&p?l=`formatDate(Date.now(), 'MM-hh:mm') ${r} "${p.toString().padStart(2,"0")}-${s.time}"`:p===0&&h?l=`formatDate(Date.now(), 'DD-hh:mm') ${r} "${h.toString().padStart(2,"0")}-${s.time}"`:l=`formatDate(Date.now(), 'hh:mm') ${r} "${s.time}"`}else l=`formatDate(Date.now(), 'hh:mm') ${r} "${s.time}"`;return i.conditionsVars.push(`const subCond${s._id} = ${l};`),i.conditionsDebug.push(`_sendToFrontEnd(${s._id}, {result: subCond${s._id}});`),`subCond${s._id}`}_setInputs(s,i){i=i===void 0?this.state.settings.withDate:i,s=s||this.state.settings.tagCard;const r=Xr.getStaticData().tagCardArray,l=r==null?void 0:r.find(d=>d.title===s),c=[{nameRender:"renderNameText",attr:"interval",defaultValue:"Actual time of day"},{frontText:(l==null?void 0:l.text)||s,nameRender:"renderTime",attr:"time",defaultValue:"12:00"},{frontText:"with date",nameRender:"renderCheckbox",attr:"withDate",defaultValue:!1}];i&&c.push({nameRender:"renderDate",attr:"date",defaultValue:"01.01"}),this.setState({inputs:c,iconTag:!0},()=>super.onTagChange())}onValueChanged(s,i){i==="withDate"&&this._setInputs(void 0,s)}onTagChange(s){this._setInputs(s)}static getStaticData(){return{acceptedBy:"conditions",name:"Time condition",id:"ConditionTime",icon:"Shuffle",tagCardArray:[{title:"=",title2:"[equal]",text:"equal to"},{title:">=",title2:"[greater or equal]",text:"greater or equal"},{title:">",title2:"[greater]",text:"greater than"},{title:"<=",title2:"[less or equal]",text:"less or equal"},{title:"<",title2:"[less]",text:"less than"},{title:"<>",title2:"[not equal]",text:"not equal to"}],title:"Compares current time with the user specific time"}}getData(){return Xr.getStaticData()}}class Vo extends at{coordinates=null;constructor(s){super(s,Vo.getStaticData())}static compile(s,i){const r=s.tagCard==="="?"===":s.tagCard==="<>"?"!==":s.tagCard;let l;s.offset&&(l=parseInt(s.offsetValue,10)||0);const c=`formatDate(Date.now(), 'hh:mm') ${r} formatDate(getAstroDate("${s.astro}"${l?`, undefined, ${l}`:""}), 'hh:mm')`;return i.conditionsVars.push(`const subCond${s._id} = ${c};`),i.conditionsDebug.push(`_sendToFrontEnd(${s._id}, {result: ${c}});`),c}static _time2String(s){return s?`${s.getHours().toString().padStart(2,"0")}:${s.getMinutes().toString().padStart(2,"0")}`:"--:--"}onValueChanged(s,i){i==="astro"?this._setAstro(s):i==="offset"?this._setAstro(void 0,s):i==="offsetValue"&&this._setAstro(void 0,void 0,s)}async _setAstro(s,i,r){if(s=s||this.state.settings.astro||"solarNoon",i=i===void 0?this.state.settings.offset:i,r=r===void 0?this.state.settings.offsetValue:r,r=parseInt(r,10)||0,!this.coordinates){const b=await this.props.socket.getObject("system.adapter.javascript.0");if(!(b!=null&&b.native.latitude)&&!(b!=null&&b.native.longitude)){const y=await this.props.socket.getObject("system.config");y&&(y.common.latitude||y.common.longitude)?this.coordinates={latitude:y.common.latitude,longitude:y.common.longitude}:this.coordinates=null}else this.coordinates={latitude:b==null?void 0:b.native.latitude,longitude:b==null?void 0:b.native.longitude}}const l=this.coordinates?DC.getTimes(new Date,this.coordinates.latitude,this.coordinates.longitude):null,c=l?Object.keys(l).map(b=>({value:b,title:b,title2:`[${Vo._time2String(l[b])}]`,order:Vo._time2String(l[b])})):[];c.sort((b,y)=>b.order>y.order?1:b.orderb.title===this.state.settings.tagCard)||d[0];let p="--:--";if(s&&l&&l[s]){const b=new Date(l[s]);i&&b.setMinutes(b.getMinutes()+parseInt(r,10)),p=`(${x.I18n.t(h.text)} ${Vo._time2String(b)})`}let f;i?f=[{nameRender:"renderNameText",defaultValue:"Actual time of day",attr:"text"},{frontText:h.text,attr:"astro",nameRender:"renderSelect",options:c,doNotTranslate2:!0,defaultValue:"solarNoon"},{backText:"with offset",nameRender:"renderCheckbox",attr:"offset"},{backText:r===1?"minute":"minutes",frontText:"offset",nameRender:"renderNumber",defaultValue:0,attr:"offsetValue",noHelperText:!0},{nameRender:"renderNameText",attr:"textTime",doNotTranslate:!0,defaultValue:p}]:f=[{nameRender:"renderNameText",defaultValue:"Actual time of day",attr:"text"},{frontText:h.text,attr:"astro",nameRender:"renderSelect",options:c,doNotTranslate2:!0,defaultValue:"solarNoon"},{backText:"with offset",nameRender:"renderCheckbox",attr:"offset"},{nameRender:"renderNameText",attr:"textTime",doNotTranslate:!0,defaultValue:p}],this.setState({inputs:f},()=>super.onTagChange())}onTagChange(){this._setAstro()}static getStaticData(){return{acceptedBy:"conditions",name:"Astronomical",id:"ConditionAstronomical",icon:"Brightness3",tagCardArray:[{title:"=",title2:"[equal]",text:"equal to"},{title:">=",title2:"[greater or equal]",text:"greater or equal to"},{title:">",title2:"[greater]",text:"greater than"},{title:"<=",title2:"[less or equal]",text:"less or equal to"},{title:"<",title2:"[less]",text:"less than"},{title:"<>",title2:"[not equal]",text:"not equal to"}],title:"Compares current time with astronomical event"}}getData(){return Vo.getStaticData()}}const _w={valueAck:{color:"#b02323"},valueNotAck:{color:"#12ac15"}};class jc extends at{constructor(s){super(s,jc.getStaticData())}isAllTriggersOnState(){var s,i,r,l;return!!((i=(s=this.props.userRules)==null?void 0:s.triggers)!=null&&i.find(c=>c.id==="TriggerState"))&&!((l=(r=this.props.userRules)==null?void 0:r.triggers)!=null&&l.find(c=>c.id!=="TriggerState"))}static compile(s,i){let r=s.value;s.useTrigger?r=s.toggle?"!obj.state.val":"obj.state.val":(r==null&&(r=""),typeof s.value=="string"&&parseFloat(s.value).toString()!==s.value&&s.value!=="true"&&s.value!=="false"&&(r=`"${r.replace(/"/g,'\\"')}"${at.getReplacesInText(i)}`));let l;return s.toggle&&!s.useTrigger?l=`const subActionVar${s._id} = !(await getStateAsync("${s.oid}")).val`:l=`const subActionVar${s._id} = ${r}`,`// set state ${s.oid} to ${s.toggle&&!s.useTrigger?"toggle":r} ${l}; _sendToFrontEnd(${s._id}, {val: subActionVar${s._id}, ack: ${s.tagCard==="update"}}); - await setStateAsync("${s.oid}", subActionVar${s._id}, ${s.tagCard==="update"});`}renderDebug(s){return m.jsxs("span",{children:[x.I18n.t("Set:")," ",m.jsx("span",{style:s.data.ack?_w.valueAck:_w.valueNotAck,children:Ln(s.data.val)})]})}_setInputs(s,i){const r=this.isAllTriggersOnState();i=i===void 0?this.state.settings.toggle:i,s=s===void 0?this.state.settings.useTrigger:s;let l="",c;const{oidType:d,oidUnit:h,oidStates:p,oidMax:f,oidMin:b,oidRole:y,oidWrite:w,oidStep:v}=this.state.settings;let _;d&&(d==="number"?(l="number",f!==void 0&&b!==void 0&&(l="slider")):d==="boolean"?(l="boolean",y&&y.includes("button")&&w&&(l="button")):(l="",y&&y.includes("color")&&(l="color")),p&&(c=Object.keys(p).map(S=>({value:S,title:p[S]})),l="select"));let $;if(r&&s)$=[{backText:"use trigger value",nameRender:"renderCheckbox",attr:"useTrigger",defaultValue:!1}],l==="boolean"&&$.push({backText:"toggle value",attr:"toggle",nameRender:"renderCheckbox",defaultValue:!1});else{switch(l){case"number":$=[{backText:h||"",frontText:"with",nameRender:"renderNumber",defaultValue:f===void 0?0:f,attr:"value"}],this.state.settings.value!==void 0&&isNaN(parseFloat(this.state.settings.value))&&(_={value:f===void 0?0:f});break;case"slider":{$=[{nameRender:"renderSlider",defaultValue:f,min:b,max:f,unit:h,step:v,attr:"value"}];const S=parseFloat(this.state.settings.value);this.state.settings.value!==void 0&&(isNaN(S)||Sf)&&(_={value:f});break}case"select":$=[{nameRender:"renderSelect",frontText:"with",options:c,defaultValue:(c==null?void 0:c[0].value)||"",attr:"value"}],this.state.settings.value!==void 0&&!(c!=null&&c.find(S=>S.value===this.state.settings.value))&&(_={value:(c==null?void 0:c[0].value)||""});break;case"boolean":$=[{backText:"toggle value",attr:"toggle",nameRender:"renderCheckbox",defaultValue:!1}],i||$.push({backText:"true",frontText:"false",nameRender:"renderSwitch",defaultValue:!1,attr:"value"}),this.state.settings.value!==void 0&&this.state.settings.value!==!1&&this.state.settings.value!==!0&&(_={value:!1});break;case"button":$=[{nameRender:"renderButton",defaultValue:!0,attr:"value"}],this.state.settings.value!==void 0&&this.state.settings.value!==!0&&(_={value:!0});break;case"color":$=[{nameRender:"renderColor",frontText:"with",defaultValue:"#FFFFFF",attr:"value"}],this.state.settings.value!==void 0&&(typeof this.state.settings.value!="string"||!this.state.settings.value.startsWith("#")&&!this.state.settings.value.startsWith("rgb"))&&(_={value:"#FFFFFF"});break;default:$=[{backText:h||"",frontText:"with",nameRender:"renderText",defaultValue:"",attr:"value"}];break}r&&$.unshift({backText:"use trigger value",nameRender:"renderCheckbox",attr:"useTrigger"})}return{inputs:$,newSettings:_}}onTagChange(s,i,r,l,c){c=c===void 0?this.state.settings.useTrigger:c;const{inputs:d,newSettings:h}=this._setInputs(c,l);d.unshift({nameRender:"renderObjectID",attr:"oid",defaultValue:"",checkReadOnly:!0}),this.setState({inputs:d},()=>super.onTagChange(null,()=>{if(h){const p=JSON.parse(JSON.stringify(this.state.settings));Object.assign(p,h),this.setState(p),this.props.onChange(p)}}))}onValueChanged(s,i){this.onTagChange(void 0,void 0,void 0,i==="toggle"?s:void 0,i==="useTrigger"?s:void 0)}onUpdate(){this.onTagChange()}static getStaticData(){return{acceptedBy:"actions",name:"Set state action",id:"ActionSetState",icon:"PlayForWork",tagCardArray:["control","update"],title:"Control or update some state",helpDialog:"You can use %s in the value to use the current trigger value or %id to display the triggered object ID"}}getData(){return Fc.getStaticData()}}class jc extends at{constructor(s){super(s,jc.getStaticData())}static compile(s,i){return`// exec "${s.exec}" + await setStateAsync("${s.oid}", subActionVar${s._id}, ${s.tagCard==="update"});`}renderDebug(s){return m.jsxs("span",{children:[x.I18n.t("Set:")," ",m.jsx("span",{style:s.data.ack?_w.valueAck:_w.valueNotAck,children:Ln(s.data.val)})]})}_setInputs(s,i){const r=this.isAllTriggersOnState();i=i===void 0?this.state.settings.toggle:i,s=s===void 0?this.state.settings.useTrigger:s;let l="",c;const{oidType:d,oidUnit:h,oidStates:p,oidMax:f,oidMin:b,oidRole:y,oidWrite:w,oidStep:v}=this.state.settings;let _;d&&(d==="number"?(l="number",f!==void 0&&b!==void 0&&(l="slider")):d==="boolean"?(l="boolean",y&&y.includes("button")&&w&&(l="button")):(l="",y&&y.includes("color")&&(l="color")),p&&(c=Object.keys(p).map(S=>({value:S,title:p[S]})),l="select"));let $;if(r&&s)$=[{backText:"use trigger value",nameRender:"renderCheckbox",attr:"useTrigger",defaultValue:!1}],l==="boolean"&&$.push({backText:"toggle value",attr:"toggle",nameRender:"renderCheckbox",defaultValue:!1});else{switch(l){case"number":$=[{backText:h||"",frontText:"with",nameRender:"renderNumber",defaultValue:f===void 0?0:f,attr:"value"}],this.state.settings.value!==void 0&&isNaN(parseFloat(this.state.settings.value))&&(_={value:f===void 0?0:f});break;case"slider":{$=[{nameRender:"renderSlider",defaultValue:f,min:b,max:f,unit:h,step:v,attr:"value"}];const S=parseFloat(this.state.settings.value);this.state.settings.value!==void 0&&(isNaN(S)||Sf)&&(_={value:f});break}case"select":$=[{nameRender:"renderSelect",frontText:"with",options:c,defaultValue:(c==null?void 0:c[0].value)||"",attr:"value"}],this.state.settings.value!==void 0&&!(c!=null&&c.find(S=>S.value===this.state.settings.value))&&(_={value:(c==null?void 0:c[0].value)||""});break;case"boolean":$=[{backText:"toggle value",attr:"toggle",nameRender:"renderCheckbox",defaultValue:!1}],i||$.push({backText:"true",frontText:"false",nameRender:"renderSwitch",defaultValue:!1,attr:"value"}),this.state.settings.value!==void 0&&this.state.settings.value!==!1&&this.state.settings.value!==!0&&(_={value:!1});break;case"button":$=[{nameRender:"renderButton",defaultValue:!0,attr:"value"}],this.state.settings.value!==void 0&&this.state.settings.value!==!0&&(_={value:!0});break;case"color":$=[{nameRender:"renderColor",frontText:"with",defaultValue:"#FFFFFF",attr:"value"}],this.state.settings.value!==void 0&&(typeof this.state.settings.value!="string"||!this.state.settings.value.startsWith("#")&&!this.state.settings.value.startsWith("rgb"))&&(_={value:"#FFFFFF"});break;default:$=[{backText:h||"",frontText:"with",nameRender:"renderText",defaultValue:"",attr:"value"}];break}r&&$.unshift({backText:"use trigger value",nameRender:"renderCheckbox",attr:"useTrigger"})}return{inputs:$,newSettings:_}}onTagChange(s,i,r,l,c){c=c===void 0?this.state.settings.useTrigger:c;const{inputs:d,newSettings:h}=this._setInputs(c,l);d.unshift({nameRender:"renderObjectID",attr:"oid",defaultValue:"",checkReadOnly:!0}),this.setState({inputs:d},()=>super.onTagChange(null,()=>{if(h){const p=JSON.parse(JSON.stringify(this.state.settings));Object.assign(p,h),this.setState(p),this.props.onChange(p)}}))}onValueChanged(s,i){this.onTagChange(void 0,void 0,void 0,i==="toggle"?s:void 0,i==="useTrigger"?s:void 0)}onUpdate(){this.onTagChange()}static getStaticData(){return{acceptedBy:"actions",name:"Set state action",id:"ActionSetState",icon:"PlayForWork",tagCardArray:["control","update"],title:"Control or update some state",helpDialog:"You can use %s in the value to use the current trigger value or %id to display the triggered object ID"}}getData(){return jc.getStaticData()}}class Fc extends at{constructor(s){super(s,Fc.getStaticData())}static compile(s,i){return`// exec "${s.exec}" const subActionVar${s._id} = "${(s.exec||"").replace(/"/g,'\\"')}"${at.getReplacesInText(i)}; _sendToFrontEnd(${s._id}, {exec: subActionVar${s._id}}); - console.log(subActionVar${s._id});`}renderDebug(s){return`Exec: ${s.data.exec}`}onTagChange(s){this.setState({inputs:[{nameRender:"renderModalInput",attr:"exec",defaultValue:"ls /opt/iobroker",nameBlock:"Shell command"}]},()=>super.onTagChange(s))}static getStaticData(){return{acceptedBy:"actions",name:"Exec",id:"ActionExec",icon:"Apps",title:"Executes some shell command",helpDialog:"You can use %s in the command to use current trigger value or %id to use the triggered object ID"}}getData(){return jc.getStaticData()}}class zc extends at{constructor(s){super(s,zc.getStaticData())}static compile(s,i){return`// HTTP request ${s.url} + console.log(subActionVar${s._id});`}renderDebug(s){return`Exec: ${s.data.exec}`}onTagChange(s){this.setState({inputs:[{nameRender:"renderModalInput",attr:"exec",defaultValue:"ls /opt/iobroker",nameBlock:"Shell command"}]},()=>super.onTagChange(s))}static getStaticData(){return{acceptedBy:"actions",name:"Exec",id:"ActionExec",icon:"Apps",title:"Executes some shell command",helpDialog:"You can use %s in the command to use current trigger value or %id to use the triggered object ID"}}getData(){return Fc.getStaticData()}}class zc extends at{constructor(s){super(s,zc.getStaticData())}static compile(s,i){return`// HTTP request ${s.url} const subActionVar${s._id} = "${(s.url||"").replace(/"/g,'\\"')}"${at.getReplacesInText(i)}; _sendToFrontEnd(${s._id}, {url: subActionVar${s._id}}); request(subActionVar${s._id});`}renderDebug(s){return`URL: ${s.data.url}`}onTagChange(s){this.setState({inputs:[{nameRender:"renderModalInput",attr:"url",defaultValue:"http://mydevice.com?...",nameBlock:"URL"}]},()=>super.onTagChange(s))}static getStaticData(){return{acceptedBy:"actions",name:"HTTP Call",id:"ActionHTTPCall",icon:"Language",title:"Make a HTTP get request",helpDialog:"You can use %s in the URL to use current trigger value or %id to use the triggered object ID"}}getData(){return zc.getStaticData()}}class Uc extends at{constructor(s){super(s,Uc.getStaticData())}static compile(s,i){return`// Log ${s.text} @@ -1226,9 +1226,9 @@ const demo = ${JSON.stringify(a,null,2).replace(/\*\//g,"* /")}; ${i} ${r} _sendToFrontEnd(${s._id}, {val: val1_${s._id} ${s.operation} val2_${s._id}, ack: ${s.tagCard==="update"}}); - await setStateAsync("${s.oidResult}", val1_${s._id} ${s.operation} val2_${s._id}, ${s.tagCard==="update"});`}renderDebug(s){var i,r;return m.jsxs("span",{children:[x.I18n.t("Set:")," ",m.jsx("span",{className:s.data.ack?(i=this.props.classes)==null?void 0:i.valueAck:(r=this.props.classes)==null?void 0:r.valueNotAck,children:Ln(s.data.val)})]})}onTagChange(){const s=[];s.push({nameRender:"renderObjectID",title:"ID1",attr:"oid1",defaultValue:"",checkReadOnly:!1}),s.push({nameRender:"renderSelect",options:[{value:"+",title:"+"},{value:"-",title:"-"},{value:"*",title:"*"},{value:"/",title:"/"}],doNotTranslate:!0,defaultValue:"+",attr:"operation"}),s.push({nameRender:"renderObjectID",title:"ID2",attr:"oid2",defaultValue:"",checkReadOnly:!1}),s.push({nameRender:"renderNameText",defaultValue:"store in",attr:"textEqual"}),s.push({nameRender:"renderObjectID",attr:"oidResult",defaultValue:"",checkReadOnly:!0}),this.setState({inputs:s},()=>super.onTagChange(null,()=>{const i=JSON.parse(JSON.stringify(this.state.settings));this.props.onChange(i)}))}onValueChanged(s,i){this.onTagChange()}onUpdate(){this.onTagChange()}static getStaticData(){return{acceptedBy:"actions",name:"Operate two states",id:"ActionOperateStates",icon:"AddBox",tagCardArray:["control","update"],title:"Operations with two states"}}getData(){return Vc.getStaticData()}}const fR=[Ii,Pc,Bc,qr,Xr,Vo,Fc,jc,zc,Uc,Hc,Wc,Gc,Vc],hc={sayit:Rc,pushover:Nc,"whatsapp-cmb":Mc,pushsafer:Lc},$R=um({blocks:null,socket:null,onUpdate:!1,setOnUpdate:a=>{},setOnDebugMessage:a=>{},onDebugMessage:[],enableSimulation:!1,setEnableSimulation:a=>{},changedScripts:{},setChangedScripts:a=>{}}),bR=({children:a,socket:s})=>{const[i,r]=kt(null),[l,c]=kt(!1),[d,h]=kt([]),[p,f]=kt(!1),[b,y]=kt({});return Lt(()=>{l&&c(!1)},[l]),Lt(()=>{(async()=>{const w=await s.getAdapterInstances(),v=Object.keys(hc).filter(E=>w.find(D=>{var M;return((M=D==null?void 0:D.common)==null?void 0:M.name)===E})),_=[],$=w.filter(E=>E.common.javascriptRules),S=[];for(const E of $){if(S.includes(E.common.name)||!E.common.javascriptRules)continue;let D;if(E.common.javascriptRules.url.startsWith("http:")||E.common.javascriptRules.url.startsWith("https:")?D=E.common.javascriptRules.url:E.common.javascriptRules.url.startsWith("./")?D=`${window.location.protocol}//${window.location.host}${E.common.javascriptRules.url.replace(/^\./,"")}`:D=`${window.location.protocol}//${window.location.host}/adapter/${E.common.name}/${E.common.javascriptRules.url}`,E.common.javascriptRules.i18n===!0){const M=D.lastIndexOf("/");let P;M!==-1?P=D.substring(0,M):P=D;const W=x.I18n.getLanguage(),G=`${P}/i18n/${W}.json`;await fetch(G).then(z=>z.json()).then(z=>x.I18n.extendTranslations(z,W)).catch(z=>{if(W!=="en")return fetch(`${P}/i18n/en.json`).then(Z=>Z.json()).then(Z=>x.I18n.extendTranslations(Z,W)).catch(Z=>console.error(`Cannot load i18n "${G}": ${Z}`));console.log(`Cannot load i18n "${G}": ${z}`)})}else if(E.common.javascriptRules.i18n&&typeof E.common.javascriptRules.i18n=="object")try{x.I18n.extendTranslations(E.common.javascriptRules.i18n)}catch(M){console.error(`Cannot import i18n for "${E.common.javascriptRules.name}": ${M}`)}try{e_.registerRemotes([{name:E.common.javascriptRules.name,entry:D,type:E.common.javascriptRules.type}]);const M=(await e_.loadRemote(`${E.common.javascriptRules.name}/${E.common.javascriptRules.name}`)).default;M&&(_.push(M),S.push(E.common.name),hc[E.common.name]=null)}catch(M){console.error(`Cannot load component "${E.common.javascriptRules.name}": ${M}`)}}const T=v.filter(E=>hc[E]).map(E=>hc[E]);r([...fR,...T,..._])})()},[]),m.jsx($R.Provider,{value:{blocks:i,socket:s,onUpdate:l,setOnUpdate:c,onDebugMessage:d,setOnDebugMessage:h,enableSimulation:p,setEnableSimulation:f,changedScripts:b,setChangedScripts:y},children:a})},vR="Acknowledged",yR="Actions",_R="Add",wR="All",kR="Any",CR="Apply",TR="April",SR="Ask",ER="Astronomical",IR="August",xR="Cancel",DR="Close",AR="Condition",OR="Conditions",RR="Console",NR="Copied",MR="December",LR="Default",PR="Delay",BR="Delete",FR="Description",jR="Done",zR="Exec shell",UR="Explanation",HR="Export",WR="Februar",GR="February",VR="Filter",KR="Folder",YR="Fr",JR="Friday",qR="ID",XR="ID1",ZR="ID2",QR="Import",e1="Instance",t1="Instances",s1="Instructions",o1="Januar",i1="January",n1="July",r1="June",a1="Limit",l1="March",c1="May",u1="Menu",d1="Message",h1="Mo",p1="Model",g1="Monday",m1="Month",f1="More",$1="Name",b1="November",v1="OK",y1="October",_1="Ok",w1="Pause",k1="Pushover",C1="Pushsafer",T1="Rename",S1="Repeat",E1="Restart",I1="Result",x1="Sa",D1="Saturday",A1="Save",O1="Schedule",R1="Script",N1="September",M1="Simulate",L1="Stack",P1="Start",B1="State",F1="Su",j1="Sunday",z1="Telegram",U1="Th",H1="Thursday",W1="Time",G1="Triggered",V1="Triggers",K1="Tu",Y1="Tuesday",J1="URL",q1="Value",X1="Volume",Z1="We",Q1="Wednesday",eN="Write",tN="Yes",sN="acknowledgment",oN="all",iN="and",nN="Astro",rN="at",aN="control",lN="copy",cN="CRON",uN="Dawn",dN="This is a special mode in which states and objects will not change. But only information about each planned change will be displayed in the protocol.",hN="Debug",pN="Dusk",gN="easy",mN="every",fN="Function",$N="ID",bN="Name",vN="Role",yN="Room",_N="Golden hour",wN="End of golden hour",kN='The code will be executed only every time when condition is true. E.g. if triggering on the temperature sensor value and the condition is "if temperature is greater than 20°C", the "then" actions will be executed every time when sensor sends the temperature and it is over 20°C. By 21°C, by 22°C and so on.',CN='The code will be executed only if the condition result changes. E.g. if triggering on the temperature sensor value and the condition is "if temperature is greater than 20°C", the "then" actions will be executed once when temperature is over 20. Next time the "then" actions will be executed when the temperature fails under 20 and then rises over 20 again.',TN="hours",SN="includes",EN="interval",IN="magic",xN="milliseconds",DN="minutes",AN="ms",ON="Nadir",RN="Nautical dawn",NN="Nautical dusk",MN="Next Sunrise",LN="Next sunset",PN="Night",BN="Night end",FN="normal",jN="offset",zN="one",UN="or",HN="quiet",WN="search",GN="seconds",VN="Solar noon",KN="sunrise",YN="Sunrise end",JN="Sunset",qN="Sunset start",XN="then",ZN="Acknowledge",QN="From",eM="Last changed",tM="Quality",sM="Timestamp",oM="User",iM="Value",nM="two",rM="update",aM="Adds debug output to the log for many system commands",lM="Verbose log outputs",cM="when",uM="Wizard",dM="Retry",hM={"%s not found":"%s not found","()":"()","(at %s)":"(at %s)","(optional)":"(optional)","-":"-",".":".","AI code generator":"AI code generator",Ack:vR,Actions:yR,"Actual time of day":"Actual time of day",Add:_R,"Add new script":"Add new script",All:wR,"All files will be accepted":"All files will be accepted",Any:kR,"Any month":"Any month",Apply:CR,April:TR,"Are you sure?":"Are you sure?",Ask:SR,Astronomical:ER,"Astronomical events today":"Astronomical events today",August:IR,"Blockly description":"Creating rules by graphic blocks","Body:":"Body:",Cancel:xR,"Cannot delete non empty item!":"Cannot delete non empty item!","Change layout":"Change layout",'Change theme (actual "%s")':'Change theme (now - "%s")',"Check blocks":"Check blocks","Check is not active, because javascript adapter is disabled":"Check is not active, because Javascript adapter is disabled","Clear search input":"Clear search input","Click on this icon":"Click on this icon",Close:DR,"Close all but current":"Close all but current","Collapse all":"Collapse all","Compares current time with astronomical event":"Compares current time with astronomical event","Compares current time with the user specific time":"Compares current time with the user specific time","Compares the state value with user defined value":"Compares the state value with user defined value",Condition:AR,Conditions:OR,"Configuration not saved.":"Configuration not saved.",Console:RR,"Control or update some state":"Control or update some state","Control or update some state with delay":"Control or update some state with delay","Convert blockly to javascript for ever.":"Permanently convert Blockly to Javascript.",Copied:NR,"Copy script":"Copy script","Copy to clipboard":"Copy to clipboard","Create new":"Create new","Create new folder":"Create new folder","Create new script":"Create new script","Create or edit CRON or time wizard":"Create or edit CRON or time wizard","Dark Theme":"Dark theme","Dark style":"Dark style",Date:"Date","Debug instance":"Debug instance","Debug options":"Debug options",December:MR,Default:LR,"Define cron...":"Define cron...","Define schedule...":"Define schedule...",Delay:PR,Delete:BR,"Delete %s":"Delete %s...","Delete folder":"Delete folder","Delete script":"Delete script",Description:FR,"Deselect all":"Deselect all","Discard changes for %s":"Discard changes for %s",Done:jR,"Double click to write value":"Double click to write value","Download as file":"Download as file","Drop some files here or click...":"Drop some files here or click...","Duplicate name":"Duplicate name","Edit script or just double click":"Edit script or just double click","Empty name is not allowed":"Empty name is not allowed","End search mode":"End search mode","Enter your question":"Enter your request",Error:"Error","Error formatting code":"Error formatting code","Error was found":"Error was found","Every day":"Every day",Exec:zR,"Executes some shell command":"Executes some shell command","Existing scripts will be overwritten.":"Existing scripts will be overwritten.","Expand all":"Expand all","Expert mode":"Expert mode",Explanation:UR,Export:HR,"Export all scripts":"Export all scripts","Export blocks":"Export blocks","Export selected blocks":"Export selected blocks",Februar:WR,February:GR,Filter:VR,Folder:KR,Fr:YR,Friday:JR,Function:"Function","Function editor":"Function editor","Function: executed":"Function: executed","Go to next line":"Go to next line","HTTP Call":"HTTP Call","Hide logs":"Hide logs",ID:qR,ID1:XR,ID2:ZR,Import:QR,"Import blocks":"Import blocks","Import error":"Import error","Import scripts":"Import scripts","Insert object ID":"Insert object ID",Instance:e1,"Instance is disabled":"Instance is disabled","Instance:":"Instance:",Instances:t1,Instructions:s1,"Invalid CRON":"Invalid CRON","It will not be possible to revert this operation.":"It will not be possible to revert this operation.","JS description":"Creating rules by writing Javascript",Januar:o1,January:i1,July:n1,June:r1,"Just check":"Just check","Language:":"Language:","Learn More":"Learn More","Light style":"Light style",Limit:a1,"Local time":"Local time","Locate file":"Locate file","Log outputs":"Log outputs","Log text":"Log text","Log: %s":"Log: %s","Make a HTTP get request":"Make a HTTP get request","Make a pause between actions":"Make a pause between actions",March:l1,"March ":"March ",May:c1,Menu:u1,Message:d1,Mo:h1,Model:p1,Monday:g1,Month:m1,More:f1,Name:$1,"No API key found":"No API key found","No Chat GPT Key found":"No Chat GPT Key found","No active host found":"No active host found","Nothing found":"Nothing found",November:b1,OK:v1,October:y1,Ok:_1,"On condition change":"On condition result change","On script save or adapter start":"On script save or adapter start","On weekdays":"On weekdays","Open configuration":"Open configuration","Operate two states":"Operate two states","Operations with two states":"Operations with two states","Paste your blocks here":"Paste your blocks here",Pause:w1,"Pause execution":"Pause execution","Pause script":"Pause script","Phone:":"Phone:","Please select object ID...":"Please select object ID...","Press Ctrl+Enter to get the answer":"Press Ctrl+Enter to get the answer","Prettify the script":"Prettify the script","Print some text in log":"Print some text in log","Priority:":"Priority:",Pushover:k1,Pushsafer:C1,"Read only ID selected: %s":"Read only ID selected: %s",Rename:T1,"Reorder scripts in folders":"Reorder scripts in folders",Repeat:S1,Restart:E1,Result:I1,"Resume execution":"Resume execution","Root folder":"Root folder","Rules description":"Create rules with IF, THEN, ELSE blocks","Run script":"Run script",Sa:x1,Saturday:D1,Save:A1,"Save all":"Save all","Say It":"Say It","Say some text via sayit adapter":"Say some text via sayit adapter",Schedule:O1,Script:R1,"Script %s was modified on disk":"Script %s was modified on disk","Script is not running":"Script is not running","Search in scripts":"Search in scripts","Search...":"Search...","Select all":"Select all","Send email":"Send email","Sends an email":"Sends an email","Sends message via Pushsafer":"Sends message via Pushsafer","Sends message via pushover":"Sends message via pushover","Sends message via telegram":"Sends message via telegram","Sends message via whatsapp-cmb":"Sends message via whatsapp-cmb",September:N1,"Server time":"Server time","Set state action":"Set state action","Set with delay":"Set with delay","Shell command":"Shell command","Show astronomical events":"Show astronomical events","Show javascript code":"Show Javascript code","Show logs":"Show logs","Show only paused scripts":"Show only paused scripts","Show only running scripts":"Show only running scripts","Show only scripts with problems":"Show only scripts with problems",Simulate:M1,"Some files will be rejected":"Some files will be rejected","Sound:":"Sound:",Stack:L1,Start:P1,"Start script":"Start script",State:B1,"State condition":"State condition","Step into function":"Step into function","Step out from function":"Step out from function","Stop on exception":"Stop on exception",Su:F1,"Subject:":"Subject:",Sunday:j1,"TS description":"Creating rules by writing Typescript",Telegram:z1,"Text:":"Text:",Th:U1,"The script will be stopped and must be activated manually after debugging. Continue?":"The script will be stopped and must be activated manually after debugging. Continue?","This is advances option. You can write your own code here and it will be executed on trigger":"This is advances option. You can write your own code here and it will be executed on trigger",Thursday:H1,Time:W1,"Time condition":"Time condition","Title:":"Title:","To:":"To:","Trigger with value":"Trigger with value",Triggered:G1,Triggers:V1,"Triggers the on script saving or the javascript instance restart":"Triggers the on script saving or the javascript instance restart","Triggers the rule on update or change of some state":"Triggers the rule on update or change of some state","Triggers the rule periodically or on some specific time":"Triggers the rule periodically or on some specific time",Tu:K1,Tuesday:Y1,URL:J1,"Unknown error":"Unknown error","Unknown error!":"Unknown error!","Use generated code":"Use generated code","User function":"User function","User:":"User:",Value:q1,"Vibration:":"Vibration:",Volume:X1,We:Z1,Wednesday:Q1,"Whatsapp-cmb":"Whatsapp-cmb",Write:eN,"Write your own code":"Write your own code",Yes:tN,"Yet exists!":"Yet exists!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"You can use %s in the URL to use current trigger value, %id to use the triggered object ID, %name to show triggered object ID name or %old to use old trigger value","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"You can use %s in the command to use current trigger value, %id to use the triggered object ID, %name to show triggered object ID name or %old to use old trigger value","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"You can use %s in the text to display current trigger value, %id to use the triggered object ID, %name to show triggered object ID name or %old to use old trigger value","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"You can use %s in the value to use the current trigger value, %id to use the triggered object ID, %name to show triggered object ID name or %old to use old trigger value","You have to enter OpenAI API key in the configuration of javascript adapter.":"You have to enter OpenAI API key in the configuration of javascript adapter.","You have to enter at least one API key in the configuration of javascript adapter.":"You have to enter at least one API key (OpenAI, Anthropic or Gemini) in the configuration of javascript adapter.","Please select a valid model":"Please select a valid model","[equal]":"[equal]","[greater or equal]":"[greater or equal]","[greater]":"[greater]","[hysteresis]":"[hysteresis]","[includes]":"[includes]","[less or equal]":"[less or equal]","[less]":"[less]","[not equal]":"[not equal]",acknowledgment:sN,all:oN,and:iN,"as JSON":"as JSON","as plain text":"as plain text",astro:nN,at:rN,"clear running":"clear running",control:aN,copy:lN,cron:cN,dawn:uN,debug_help:dN,debug_label:hN,default:"default",dusk:pN,easy:gN,else:"else","equal to":"equal to",every:mN,"every hour at 0 minutes":"every hour at 0 minutes",false:"false","file reading has failed: %s":"file reading has failed: %s","file reading was aborted":"file reading was aborted",filter_func:fN,filter_id:$N,filter_name:bN,filter_role:vN,filter_room:yN,"for edit or create script":"for edit or create a new script","for professionals":"for professionals","for programmers":"for programmers",goldenHour:_N,goldenHourEnd:wN,"greater or equal":"greater or equal","greater or equal to":"greater or equal to","greater than":"greater than",help_just_check:kN,help_on_change:CN,"high priority":"high priority","high-priority":"high-priority","highest priority":"highest priority",hours:TN,includes:SN,interval:EN,"just check":"just check","less or equal":"less or equal","less or equal to":"less or equal to","less than":"less than","lower priority":"lower priority","lowest priority":"lowest priority",magic:IN,milliseconds:xN,minutes:DN,ms:AN,nadir:ON,nauticalDawn:RN,nauticalDusk:NN,nextSunrise:MN,nextSunset:LN,night:PN,nightEnd:BN,"no blocks found":"No blocks found","no group":"NO GROUP",normal:FN,"normal priority":"normal priority","not running":"not running","not equal to":"not equal to","not properly connected":"This block is not properly connected to other blocks.",offset:jN,"on change":"on change","on condition change":"on condition change","on update":"on update",one:zN,or:UN,quiet:HN,"reset search":"reset search",search:WN,seconds:GN,solarNoon:VN,"store in":"store in",sunrise:KN,sunriseEnd:YN,sunset:JN,sunsetStart:qN,then:XN,"toggle value":"toggle value",tooltip_ack:ZN,tooltip_from:QN,tooltip_lc:eM,tooltip_quality:tM,tooltip_ts:sM,tooltip_user:oM,tooltip_value:iM,true:"true",two:nM,undefined:"undefined",update:rM,"use seconds":"use seconds","use trigger value":"use trigger value",verbose_help:aM,verbose_label:lM,when:cM,with:"with","with date":"with date","with offset":"with offset",wizard:uM,"Loading models...":"Loading models...","Could not connect to API at %s":"Could not connect to API at %s","Invalid API key":"Invalid API key","Access denied by API":"Access denied by API","API error: %s":"API error: %s",'Model "%s" not found':'Model "%s" not found',"Request failed: %s":"Request failed: %s",Retry:dM,"No running javascript instance found":"No running javascript instance found"},pM="Bestätigt",gM="Aktionen",mM="Hinzufügen",fM="Alle",$M="Egal",bM="Anwenden",vM="April",yM="Fragen",_M="Astronomisch",wM="August",kM="Abbrechen",CM="Schließen",TM="Bedingung",SM="Bedingungen",EM="Konsole",IM="Kopiert",xM="Dezember",DM="Standard",AM="Verzögerung",OM="Löschen",RM="Beschreibung",NM="Fertig",MM="Exec shell",LM="Erläuterung",PM="Export",BM="Februar",FM="Februar",jM="Filter",zM="Ordner",UM="Fr",HM="Freitag",WM="ID",GM="ID1",VM="ID2",KM="Import",YM="Instanz",JM="Instanzen",qM="Anleitung",XM="Januar",ZM="Januar",QM="Juli",eL="Juni",tL="Grenze",sL="März",oL="Mai",iL="Menü",nL="Nachricht",rL="Mo",aL="Modell",lL="Montag",cL="Monat",uL="Mehr",dL="Name",hL="November",pL="OK",gL="Oktober",mL="Ok",fL="Pause",$L="Pushover",bL="Pushsafer",vL="Umbenennen",yL="Wiederholen",_L="Neustart",wL="Ergebnis",kL="Sa",CL="Samstag",TL="Speichern",SL="Zeitplan",EL="Skript",IL="September",xL="Simulieren",DL="Stack",AL="Start",OL="Zustand",RL="So",NL="Sonntag",ML="Telegram",LL="Do",PL="Donnerstag",BL="Zeit",FL="Ausgelöst",jL="Löst aus",zL="Di",UL="Dienstag",HL="URL",WL="Wert",GL="Volumen",VL="Mi",KL="Mittwoch",YL="Schreiben",JL="Ja",qL="Wissen",XL="alle",ZL="und",QL="Astro",eP="um",tP="Steuerung",sP="Kopie",oP="CRON",iP="Morgendämmerung",nP="Dies ist ein spezieller Modus, in dem sich Zustände und Objekte nicht ändern. Im Protokoll werden jedoch nur Informationen zu jeder geplanten Änderung angezeigt.",rP="Debuggen",aP="Abenddämmerung",lP="einfach",cP="jeder",uP="Funktion",dP="ID",hP="Name",pP="Rolle",gP="Raum",mP="Goldene Abendstunde",fP="Vormittag",$P='Der Code wird jedes Mal ausgeführt, wenn die Bedingung erfüllt ist. z.B. wenn der Temperatur wert sich ändert und die Bedingung "Wenn die Temperatur größer als 20°C ist" lautet, werden die "Dann" -Aktionen jedes Mal ausgeführt, wenn der Sensor die Temperatur sendet und diese über 20°C liegt. Bei 21°C, bei 22°C und so weiter.',bP='Der Code wird nur ausgeführt, wenn sich das Ergebnis der Bedingung ändert. z.B. wenn sich der Temperatur wert ändert und die Bedingung "Wenn die Temperatur größer als 20°C ist" lautet, werden die "Dann" -Aktionen einmal ausgeführt, wenn die Temperatur über 20°C liegt. Das nächste Mal werden die "Dann" -Aktionen ausgeführt, wenn die Temperatur unter 20°C gefallen ist und dann wieder über 20°C ansteigt.',vP="Stunden",yP="beinhaltet",_P="Intervall",wP="Magie",kP="Millisekunden",CP="Minuten",TP="ms",SP="Nadir",EP="nautische Morgendämmerung",IP="nautische Abenddämmerung",xP="Nächster Sonnenaufgang",DP="Nächster Sonnenuntergang",AP="Nacht",OP="astronomische Morgendämmerung",RP="Normal",NP="Versatz",MP="einer",LP="oder",PP="ruhig",BP="Suche",FP="Sekunden",jP="(Nach-)Mittag",zP="Sonnenaufgang",UP="Goldene Morgenstunde",HP="Sonnenuntergang",WP="Sonnenuntergang (Anfang)",GP="dann",VP="Bestätigen",KP="Von",YP="Zuletzt geändert",JP="Qualität",qP="Zeitstempel",XP="Benutzer",ZP="Wert",QP="zwei",eB="Aktualisieren",tB="Fügt Debug-Ausgaben für viele Systembefehle zum Protokoll hinzu",sB="Ausführliche Protokollausgaben",oB="falls",iB="Assistent",nB="Erneut versuchen",rB={"%s not found":"%s nicht gefunden","()":"()","(at %s)":"(um %s)","(optional)":"(optional)","-":"-",".":".","AI code generator":"KI-Codegenerator",Ack:pM,Actions:gM,"Actual time of day":"Tatsächliche Tageszeit",Add:mM,"Add new script":"Neues Skript hinzufügen",All:fM,"All files will be accepted":"Alle Dateien werden akzeptiert",Any:$M,"Any month":"Jeden Monat",Apply:bM,April:vM,"Are you sure?":"Wirklich sicher?",Ask:yM,Astronomical:_M,"Astronomical events today":"Astronomische Ereignisse heute",August:wM,"Blockly description":"Erstellen von Regeln durch Grafikblöcke","Body:":"Körper:",Cancel:kM,"Cannot delete non empty item!":"Kann nicht gelöscht werden, weil noch einige Elementen darin sind!","Change layout":"Layout ändern",'Change theme (actual "%s")':'Thema ändern (jetzt - "%s")',"Check blocks":"Blöcke prüfen","Check is not active, because javascript adapter is disabled":"Syntax-Check ist nicht aktiv, weil der Javascript Adapter nicht aktiv ist.","Clear search input":"Sucheingabe löschen","Click on this icon":"Auf dieses Symbol klicken",Close:CM,"Close all but current":"Alle anderen außer dem Aktiven schließen","Collapse all":"Alles einklappen","Compares current time with astronomical event":"Vergleicht die aktuelle Zeit mit einem astronomischen Ereignis","Compares current time with the user specific time":"Vergleicht die aktuelle Zeit mit der benutzerspezifischen Zeit","Compares the state value with user defined value":"Vergleicht den Zustandswert mit dem benutzerdefinierten Wert",Condition:TM,Conditions:SM,"Configuration not saved.":"Die Konfiguration ist nicht gespeichert.",Console:EM,"Control or update some state":"Zustand steuern oder aktualisieren","Control or update some state with delay":"Zustand mit Verzögerung steuern oder aktualisieren","Convert blockly to javascript for ever.":"Blockly dauerhaft in Javascript konvertieren.",Copied:IM,"Copy script":"Skript kopieren","Copy to clipboard":"In die Zwischenablage kopieren","Create new":"Neu erstellen","Create new folder":"Neuen Ordner erstellen","Create new script":"Neues Skript erstellen","Create or edit CRON or time wizard":"CRON- oder Zeit-Assistenten erstellen oder bearbeiten","Dark Theme":"Dunkles Thema","Dark style":"Dunkler Stil",Date:"Datum","Debug instance":"Debug-Instanz","Debug options":"Debug-Optionen",December:xM,Default:DM,"Define cron...":"Cron definieren ...","Define schedule...":"Zeitplan definieren ...",Delay:AM,Delete:OM,"Delete %s":"Löschen %s...","Delete folder":"Ordner löschen","Delete script":"Skript löschen",Description:RM,"Deselect all":"Alles abwählen","Discard changes for %s":"Änderungen für %s verwerfen",Done:NM,"Double click to write value":"Doppelklick zum Schreiben des Wertes","Download as file":"Download als Datei","Drop some files here or click...":"Dateien hier ablegen oder klicken ...","Duplicate name":"Doppelter Name","Edit script or just double click":"Skript bearbeiten oder einfach doppelklicken","Empty name is not allowed":"Leerer Name ist nicht zulässig","End search mode":"Suchmodus beenden","Enter your question":"Anfrage eingeben",Error:"Fehler","Error formatting code":"Fehler beim Formatieren des Codes","Error was found":"Fehler wurde gefunden","Every day":"Täglich",Exec:MM,"Executes some shell command":"Führt einen Shell-Befehl aus","Existing scripts will be overwritten.":"Vorhandene Skripte werden überschrieben.","Expand all":"Alle erweitern","Expert mode":"Expertenmodus",Explanation:LM,Export:PM,"Export all scripts":"Alle Skripte exportieren","Export blocks":"Blöcke exportieren","Export selected blocks":"Ausgewählte Blöcke exportieren",Februar:BM,February:FM,Filter:jM,Folder:zM,Fr:UM,Friday:HM,Function:"Funktion","Function editor":"Funktions-Editor","Function: executed":"Funktion: ausgeführt","Go to next line":"Gehe zur nächsten Zeile","HTTP Call":"HTTP-Aufruf","Hide logs":"Protokoll ausblenden",ID:WM,ID1:GM,ID2:VM,Import:KM,"Import blocks":"Blöcke importieren","Import error":"Fehler beim Importieren","Import scripts":"Skripte importieren","Insert object ID":"Objekt-ID einfügen",Instance:YM,"Instance is disabled":"Instanz ist deaktiviert","Instance:":"Instanz:",Instances:JM,Instructions:qM,"Invalid CRON":"Ungültiger CRON","It will not be possible to revert this operation.":"Dieser Vorgang kann nicht rückgängig gemacht werden.","JS description":"Regeln erstellen mit JavaScript",Januar:XM,January:ZM,July:QM,June:eL,"Just check":"Einfach überprüfen","Language:":"Sprache:","Learn More":"Mehr erfahren","Light style":"Heller Stil",Limit:tL,"Local time":"Lokale Zeit","Locate file":"Datei zeigen","Log outputs":"Protokoll","Log text":"Protokolltext","Log: %s":"Log: %s","Make a HTTP get request":"Eine HTTP-Abrufanforderung stellen","Make a pause between actions":"Eine Pause zwischen den Aktionen machen",March:sL,"March ":"März ",May:oL,Menu:iL,Message:nL,Mo:rL,Model:aL,Monday:lL,Month:cL,More:uL,Name:dL,"No API key found":"Kein API-Schlüssel gefunden","No Chat GPT Key found":"Kein Chat-GPT-Schlüssel gefunden","No active host found":"Kein aktiver Host gefunden","Nothing found":"Nichts gefunden",November:hL,OK:pL,October:gL,Ok:mL,"On condition change":"Bei Änderung des Ergebnis der Bedingung","On script save or adapter start":"Beim Speichern des Skripts oder beim Starten des Adapters","On weekdays":"An Wochentagen","Open configuration":"Konfiguration öffnen","Operate two states":"Zwei Zustände operieren","Operations with two states":"Operationen mit zwei Zuständen","Paste your blocks here":"Fügen Sie Ihre Blöcke hier ein",Pause:fL,"Pause execution":"Ausführung pausieren","Pause script":"Skript anhalten","Phone:":"Telefon:","Please select object ID...":"Objekt-ID auswählen ...","Press Ctrl+Enter to get the answer":"Strg+Eingabetaste, um die Antwort zu erhalten","Prettify the script":"Verschönern Sie das Skript","Print some text in log":"Einen Text im Protokoll ausdrucken","Priority:":"Priorität:",Pushover:$L,Pushsafer:bL,"Read only ID selected: %s":"Schreibgeschützte ID ausgewählt: %s",Rename:vL,"Reorder scripts in folders":"Skripte in Ordnern neu ordnen",Repeat:yL,Restart:_L,Result:wL,"Resume execution":"Ausführung fortsetzen","Root folder":"Root-Verzeichnis","Rules description":"Regeln erstellen mit WENN-, DANN- und SONST-Blöcken","Run script":"Skript ausführen",Sa:kL,Saturday:CL,Save:TL,"Save all":"Alle speichern","Say It":"Say It","Say some text via sayit adapter":"Einen Text über den Sayit-Adapter sagen",Schedule:SL,Script:EL,"Script %s was modified on disk":'Skript "%s" wurde auf der Festplatte geändert',"Script is not running":"Skript läuft nicht","Search in scripts":"Suche in Skripten","Search...":"Suche...","Select all":"Alles auswählen","Send email":"E-Mail senden","Sends an email":"Sendet eine E-Mail","Sends message via Pushsafer":"Sendet eine Nachricht über Pushsafer","Sends message via pushover":"Sendet eine Nachricht per Pushover","Sends message via telegram":"Sendet eine Nachricht per telegram","Sends message via whatsapp-cmb":"Sendet eine Nachricht über WhatsApp-Cmb",September:IL,"Server time":"Server-Zeit","Set state action":"Zustand setzten","Set with delay":"Setzen mit Verzögerung","Shell command":"Shell-Befehl","Show astronomical events":"Astronomische Ereignisse anzeigen","Show javascript code":"Javascript-Code zeigen","Show logs":"Protokoll anzeigen","Show only paused scripts":"Nur angehaltene Skripte zeigen","Show only running scripts":"Nur laufende Skripte zeigen","Show only scripts with problems":"Nur Skripte mit Problemen zeigen",Simulate:xL,"Some files will be rejected":"Einige Dateien werden abgelehnt","Sound:":"Klang:",Stack:DL,Start:AL,"Start script":"Skript starten",State:OL,"State condition":"Zustandsbedingung","Step into function":"Schritt in die Funktion","Step out from function":"Raus aus der Funktion","Stop on exception":"Bei Ausnahme anhalten",Su:RL,"Subject:":"Gegenstand:",Sunday:NL,"TS description":"Regeln erstellen mit TypeScript",Telegram:ML,"Text:":"Text:",Th:LL,"The script will be stopped and must be activated manually after debugging. Continue?":"Das Skript wird gestoppt und muss nach dem Debuggen manuell aktiviert werden. Fortsetzen?","This is advances option. You can write your own code here and it will be executed on trigger":"Dies ist eine erweiterte Option. Sie können hier Ihren eigenen Code schreiben, der beim Auslösen ausgeführt wird",Thursday:PL,Time:BL,"Time condition":"Zeitbedingung","Title:":"Titel:","To:":"Zu:","Trigger with value":"Trigger mit Wert",Triggered:FL,Triggers:jL,"Triggers the on script saving or the javascript instance restart":"Löst das Speichern des Skripts oder den Neustart der Javascript-Instanz aus","Triggers the rule on update or change of some state":"Löst die Regel beim Aktualisieren oder Ändern eines Zustands aus","Triggers the rule periodically or on some specific time":"Löst periodisch oder zu einem bestimmten Zeitpunkt aus",Tu:zL,Tuesday:UL,URL:HL,"Unknown error":"Unbekannter Fehler","Unknown error!":"Unbekannter Fehler!","Use generated code":"Code verwenden","User function":"Benutzerfunktion","User:":"Benutzer:",Value:WL,"Vibration:":"Vibration:",Volume:GL,We:VL,Wednesday:KL,"Whatsapp-cmb":"WhatsApp-cmb",Write:YL,"Write your own code":"Eigenen Code schreiben",Yes:JL,"Yet exists!":"Existiert schon!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Sie können %s in der URL verwenden, um den aktuellen Triggerwert zu verwenden, %id, um die ausgelöste Objekt-ID zu verwenden, %name, um den ID-Namen des ausgelösten Objekts anzuzeigen, oder %old, um den alten Triggerwert zu verwenden","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Sie können %s im Befehl verwenden, um den aktuellen Triggerwert zu verwenden, %id, um die ausgelöste Objekt-ID zu verwenden, %name, um den ID-Namen des ausgelösten Objekts anzuzeigen, oder %old, um den alten Triggerwert zu verwenden","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Sie können %s im Text verwenden, um den aktuellen Triggerwert anzuzeigen, %id, um die ausgelöste Objekt-ID zu verwenden, %name, um den ID-Namen des ausgelösten Objekts anzuzeigen, oder %old, um den alten Triggerwert zu verwenden","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Sie können %s im Wert verwenden, um den aktuellen Triggerwert zu verwenden, %id, um die ID des ausgelösten Objekts zu verwenden, %name, um den ID-Namen des ausgelösten Objekts anzuzeigen, oder %old, um den alten Triggerwert zu verwenden","You have to enter OpenAI API key in the configuration of javascript adapter.":"Sie müssen den OpenAI-API-Schlüssel in der Konfiguration des Javascript-Adapters eingeben.","You have to enter at least one API key in the configuration of javascript adapter.":"Sie müssen mindestens einen API-Schlüssel (OpenAI, Anthropic oder Gemini) in der Konfiguration des Javascript-Adapters eingeben.","Please select a valid model":"Bitte wählen Sie ein gültiges Modell aus","[equal]":"[gleich]","[greater or equal]":"[größer oder gleich]","[greater]":"[größer]","[hysteresis]":"[Hysterese]","[includes]":"[enthält]","[less or equal]":"[kleiner oder gleich]","[less]":"[kleiner]","[not equal]":"[ungleich]",acknowledgment:qL,all:XL,and:ZL,"as JSON":"als JSON","as plain text":"als Klartext",astro:QL,at:eP,"clear running":"laufende abbrechen",control:tP,copy:sP,cron:oP,dawn:iP,debug_help:nP,debug_label:rP,default:"Standard",dusk:aP,easy:lP,else:"sonst","equal to":"gleich",every:cP,"every hour at 0 minutes":"jede Stunde bei 0 Minuten",false:"falsch","file reading has failed: %s":"Das Lesen der Datei ist fehlgeschlagen: %s","file reading was aborted":"Das Lesen der Datei wurde abgebrochen",filter_func:uP,filter_id:dP,filter_name:hP,filter_role:pP,filter_room:gP,"for edit or create script":"zum Bearbeiten oder zum Erstellen eines neues Skripts","for professionals":"für Profis","for programmers":"für Programmierer",goldenHour:mP,goldenHourEnd:fP,"greater or equal":"größer oder gleich","greater or equal to":"größer oder gleich","greater than":"größer als",help_just_check:$P,help_on_change:bP,"high priority":"hohe Priorität","high-priority":"hohe Priorität","highest priority":"höchste Priorität",hours:vP,includes:yP,interval:_P,"just check":"einfach prüfen","less or equal":"kleiner oder gleich","less or equal to":"kleiner oder gleich","less than":"kleiner als","lower priority":"geringere Priorität","lowest priority":"niedrigste Priorität",magic:wP,milliseconds:kP,minutes:CP,ms:TP,nadir:SP,nauticalDawn:EP,nauticalDusk:IP,nextSunrise:xP,nextSunset:DP,night:AP,nightEnd:OP,"no blocks found":"Keine Blöcke gefunden","no group":"KEINE GRUPPE",normal:RP,"normal priority":"normale Priorität","not running":"nicht gestartet","not equal to":"ungleich","not properly connected":"Dieser Block ist mit anderen nicht richtig verbunden.",offset:NP,"on change":"bei Änderung","on condition change":"bei Zustandsänderung","on update":"beim Aktualisieren",one:MP,or:LP,quiet:PP,"reset search":"Suche zurücksetzen",search:BP,seconds:FP,solarNoon:jP,"store in":"speichern in",sunrise:zP,sunriseEnd:UP,sunset:HP,sunsetStart:WP,then:GP,"toggle value":"Wert umschalten",tooltip_ack:VP,tooltip_from:KP,tooltip_lc:YP,tooltip_quality:JP,tooltip_ts:qP,tooltip_user:XP,tooltip_value:ZP,true:"wahr",two:QP,undefined:"nicht definiert",update:eB,"use seconds":"Sekunden verwenden","use trigger value":"Triggerwert benutzen",verbose_help:tB,verbose_label:sB,when:oB,with:"mit","with date":"mit Datum","with offset":"mit Versatz",wizard:iB,"Loading models...":"Modelle werden geladen...","Could not connect to API at %s":"Verbindung zur API unter %s nicht möglich","Invalid API key":"Ungültiger API-Schlüssel","Access denied by API":"Zugriff von der API verweigert","API error: %s":"API-Fehler: %s",'Model "%s" not found':'Modell "%s" nicht gefunden',"Request failed: %s":"Anfrage fehlgeschlagen: %s",Retry:nB,"No running javascript instance found":"Keine laufende JavaScript-Instanz gefunden"},aB="Admitido",lB="Comportamiento",cB="Añadir",uB="Todos",dB="Alguna",hB="Apply",pB="abril",gB="Preguntar",mB="Astronómico",fB="agosto",$B="Cancelar",bB="Cerrar",vB="Condición",yB="Condiciones",_B="Consola",wB="Copiado",kB="diciembre",CB="Defecto",TB="Demora",SB="Eliminar",EB="Descripción",IB="Hecho",xB="Ejecutivo shell",DB="Explicación",AB="Exportar",OB="Februar",RB="febrero",NB="Filtrar",MB="Carpeta",LB="P.",PB="viernes",BB="CARNÉ DE IDENTIDAD",FB="ID1",jB="ID2",zB="Importar",UB="Ejemplo",HB="Instancias",WB="Instrucciones",GB="Enero",VB="enero",KB="julio",YB="junio",JB="Límite",qB="marzo",XB="Mayo",ZB="Menú",QB="Mensaje",e2="Mes",t2="Modelo",s2="lunes",o2="Mes",i2="Más",n2="Nombre",r2="noviembre",a2="OK",l2="octubre",c2="Okay",u2="Pausa",d2="Persona fácil de convencer",h2="Pushsafer",p2="Rebautizar",g2="Repetir",m2="Reiniciar",f2="Resultado",$2="Sa",b2="sábado",v2="Salvar",y2="Calendario",_2="Guión",w2="septiembre",k2="Simular",C2="Stack",T2="Comienzo",S2="Expresar",E2="Su",I2="domingo",x2="Telegrama",D2="4",A2="jueves",O2="Tiempo",R2="Motivado",N2="Disparadores",M2="Tu",L2="martes",P2="URL",B2="Valor",F2="Volumen",j2="3",z2="miércoles",U2="Escribir",H2="sí",W2="Reconocimiento",G2="todos",V2="y",K2="astro",Y2="a",J2="control",q2="Copiar",X2="CRON",Z2="Amanecer",Q2="Este es un modo especial en el que los estados y los objetos no cambiarán. Pero solo se mostrará información sobre cada cambio planificado en el protocolo.",eF="Depurar",tF="Oscuridad",sF="fácil",oF="cada",iF="Función",nF="CARNÉ DE IDENTIDAD",rF="Nombre",aF="Papel",lF="Habitación",cF="hora dorada",uF="Fin de la hora dorada",dF='El código se ejecutará solo cada vez que la condición sea verdadera. P.ej. si se activa en el valor del sensor de temperatura y la condición es "si la temperatura es superior a 20 ° C", las acciones "entonces" se ejecutarán cada vez que el sensor envíe la temperatura y supere los 20 ° C. Por 21 ° C, por 22 ° C y así sucesivamente.',hF='El código se ejecutará solo si cambia el resultado de la condición. P.ej. si se activa en el valor del sensor de temperatura y la condición es "si la temperatura es superior a 20 ° C", las acciones "entonces" se ejecutarán una vez cuando la temperatura sea superior a 20. La próxima vez, las acciones "entonces" se ejecutarán cuando la temperatura falla por debajo de 20 y luego sube por encima de 20 nuevamente.',pF="horas",gF="incluye",mF="intervalo",fF="magia",$F="milisegundos",bF="minutos",vF="ms",yF="nadir",_F="Amanecer náutico",wF="Atardecer náutico",kF="próximo amanecer",CF="Próxima puesta de sol",TF="Noche",SF="Fin de la noche",EF="normal",IF="compensar",xF="uno",DF="o",AF="tranquilo",OF="buscar",RF="segundos",NF="Mediodía solar",MF="amanecer",LF="Final del amanecer",PF="puesta de sol",BF="Inicio al atardecer",FF="entonces",jF="Reconocer",zF="De",UF="Último cambio",HF="Calidad",WF="Marca de tiempo",GF="Usuario",VF="Valor",KF="dos",YF="actualizar",JF="Agrega salida de depuración al registro para muchos comandos del sistema",qF="Salidas de registro detalladas",XF="cuando",ZF="Wizard",QF="Reintentar",ej={"%s not found":"%s no encontrado","()":"()","(at %s)":"(en %s)","(optional)":"(Opcional)","-":"-",".":".","AI code generator":"Generador de código de IA",Ack:aB,Actions:lB,"Actual time of day":"Hora real del día",Add:cB,"Add new script":"Agregar nuevo script",All:uB,"All files will be accepted":"Todos los archivos serán aceptados.",Any:dB,"Any month":"Cualquier mes",Apply:hB,April:pB,"Are you sure?":"¿Estás seguro?",Ask:gB,Astronomical:mB,"Astronomical events today":"Eventos astronómicos hoy",August:fB,"Blockly description":"Crear reglas por bloques gráficos","Body:":"Cuerpo:",Cancel:$B,"Cannot delete non empty item!":"¡No se puede eliminar un elemento no vacío!","Change layout":"Cambia el diseño",'Change theme (actual "%s")':'Cambiar tema (ahora - "%s")',"Check blocks":"Comprobar bloques","Check is not active, because javascript adapter is disabled":"La comprobación no está activa porque el adaptador Javascript está desactivado","Clear search input":"Borrar entrada de búsqueda","Click on this icon":"Haga clic en este ícono",Close:bB,"Close all but current":"Cerrar todo menos el actual","Collapse all":"Desplegar todo","Compares current time with astronomical event":"Compara la hora actual con un evento astronómico","Compares current time with the user specific time":"Compara la hora actual con la hora específica del usuario","Compares the state value with user defined value":"Compara el valor del estado con el valor definido por el usuario",Condition:vB,Conditions:yB,"Configuration not saved.":"Configuración no guardada.",Console:_B,"Control or update some state":"Controlar o actualizar algún estado","Control or update some state with delay":"Controlar o actualizar algún estado con retraso","Convert blockly to javascript for ever.":"Convierta instantáneamente en bloque a Javascript.",Copied:wB,"Copy script":"Copiar guion","Copy to clipboard":"Copiar al portapapeles","Create new":"Crear nuevo","Create new folder":"Crear nueva carpeta","Create new script":"Crear nuevo script","Create or edit CRON or time wizard":"Crear o editar CRON o asistente de tiempo","Dark Theme":"Tema oscuro","Dark style":"Estilo oscuro",Date:"Fecha","Debug instance":"Instancia de depuración","Debug options":"Opciones de depuración",December:kB,Default:CB,"Define cron...":"Definir cron ...","Define schedule...":"Definir horario ...",Delay:TB,Delete:SB,"Delete %s":"Eliminar %s ...","Delete folder":"Eliminar carpeta","Delete script":"Eliminar guión",Description:EB,"Deselect all":"Deseleccionar todo","Discard changes for %s":"Descartar cambios para %s",Done:IB,"Double click to write value":"Doble clic para escribir el valor","Download as file":"Descargar como archivo","Drop some files here or click...":"Suelta algunos archivos aquí o haz clic ...","Duplicate name":"Nombre duplicado","Edit script or just double click":"Editar guión o simplemente hacer doble clic","Empty name is not allowed":"No se permite el nombre vacío","End search mode":"Fin del modo de búsqueda","Enter your question":"Ingrese su solicitud",Error:"Error","Error formatting code":"Código de formato de error","Error was found":"Error encontrado","Every day":"Diario",Exec:xB,"Executes some shell command":"Ejecuta algún comando de shell","Existing scripts will be overwritten.":"Los guiones existentes se sobrescribirán.","Expand all":"Expandir todo","Expert mode":"Modo experto",Explanation:DB,Export:AB,"Export all scripts":"Exportar todos los scripts","Export blocks":"Exportar bloques","Export selected blocks":"Exportar bloques seleccionados",Februar:OB,February:RB,Filter:NB,Folder:MB,Fr:LB,Friday:PB,Function:"Función","Function editor":"Editor de funciones","Function: executed":"Función: ejecutada","Go to next line":"Ir a la siguiente línea","HTTP Call":"Llamada HTTP","Hide logs":"Ocultar registros",ID:BB,ID1:FB,ID2:jB,Import:zB,"Import blocks":"Importar bloques","Import error":"Error de importación","Import scripts":"Importar guiones","Insert object ID":"Insertar ID de objeto",Instance:UB,"Instance is disabled":"La instancia está deshabilitada","Instance:":"Ejemplo:",Instances:HB,Instructions:WB,"Invalid CRON":"CRON inválido","It will not be possible to revert this operation.":"No será posible revertir esta operación.","JS description":"Crear reglas escribiendo Javascript",Januar:GB,January:VB,July:KB,June:YB,"Just check":"Sólo revisa","Language:":"Idioma:","Learn More":"Aprende más","Light style":"Estilo ligero",Limit:JB,"Local time":"Hora local","Locate file":"Localizar el archivo","Log outputs":"Salidas de registro","Log text":"Texto de registro","Log: %s":"Log: %s","Make a HTTP get request":"Realizar una solicitud de obtención HTTP","Make a pause between actions":"Hacer una pausa entre acciones",March:qB,"March ":"marzo",May:XB,Menu:ZB,Message:QB,Mo:e2,Model:t2,Monday:s2,Month:o2,More:i2,Name:n2,"No API key found":"No se encontró ninguna clave API","No Chat GPT Key found":"No se ha encontrado ninguna clave GPT de chat","No active host found":"No se encontró un host activo","Nothing found":"Nada Encontrado",November:r2,OK:a2,October:l2,Ok:c2,"On condition change":"En condición de cambio","On script save or adapter start":"Al guardar el script o al iniciar el adaptador","On weekdays":"De lunes a viernes","Open configuration":"Configuración abierta","Operate two states":"Operar dos estados","Operations with two states":"Operaciones con dos estados","Paste your blocks here":"Pega tus bloques aquí",Pause:u2,"Pause execution":"Pausar ejecución","Pause script":"Pausar guion","Phone:":"Teléfono:","Please select object ID...":"Por favor, seleccione la ID del objeto ...","Press Ctrl+Enter to get the answer":"Presiona Ctrl+Enter para obtener la respuesta","Prettify the script":"Embellecer el guión","Print some text in log":"Imprime texto en el registro","Priority:":"Prioridad:",Pushover:d2,Pushsafer:h2,"Read only ID selected: %s":"ID de solo lectura seleccionado: %s",Rename:p2,"Reorder scripts in folders":"Reordenar guiones en carpetas",Repeat:g2,Restart:m2,Result:f2,"Resume execution":"Reanudar ejecución","Root folder":"Carpeta raíz","Rules description":"Crea reglas con bloques IF, THEN, ELSE","Run script":"Ejecutar guión",Sa:$2,Saturday:b2,Save:v2,"Save all":"Salvar a todos","Say It":"Say It","Say some text via sayit adapter":"Di un mensaje de texto a través del adaptador sayit",Schedule:y2,Script:_2,"Script %s was modified on disk":"El script %s fue modificado en el disco","Script is not running":"El script no se está ejecutando","Search in scripts":"Buscar en guiones","Search...":"Buscar...","Select all":"Seleccionar todo","Send email":"Enviar correo electrónico","Sends an email":"Envía un correo electrónico","Sends message via Pushsafer":"Envía mensaje a través de Pushsafer","Sends message via pushover":"Envía un mensaje a través de un pushover","Sends message via telegram":"Envía mensaje por telegrama","Sends message via whatsapp-cmb":"Envía mensaje vía whatsapp-cmb",September:w2,"Server time":"Tiempo del servidor","Set state action":"Establecer acción estatal","Set with delay":"Establecer con retraso","Shell command":"Comando de Shell","Show astronomical events":"Mostrar eventos astronómicos","Show javascript code":"Mostrar código Javascript","Show logs":"Mostrar registros","Show only paused scripts":"Mostrar solo secuencias de comandos pausadas","Show only running scripts":"Mostrar solo scripts en ejecución","Show only scripts with problems":"Mostrar solo guiones con problemas",Simulate:k2,"Some files will be rejected":"Algunos archivos serán rechazados","Sound:":"Sonido:",Stack:C2,Start:T2,"Start script":"Iniciar guion",State:S2,"State condition":"Condición del estado","Step into function":"Entra en función","Step out from function":"Sal de la función","Stop on exception":"Deténgase en excepción",Su:E2,"Subject:":"Sujeto:",Sunday:I2,"TS description":"Crear reglas escribiendo el mecanografiado",Telegram:x2,"Text:":"Texto:",Th:D2,"The script will be stopped and must be activated manually after debugging. Continue?":"El script se detendrá y deberá activarse manualmente después de la depuración. ¿Continuar?","This is advances option. You can write your own code here and it will be executed on trigger":"Esta es la opción de avances. Puede escribir su propio código aquí y se ejecutará en el disparador",Thursday:A2,Time:O2,"Time condition":"Condición de tiempo","Title:":"Título:","To:":"A:","Trigger with value":"Activar con valor",Triggered:R2,Triggers:N2,"Triggers the on script saving or the javascript instance restart":"Activa el guardado de la secuencia de comandos o el reinicio de la instancia de JavaScript","Triggers the rule on update or change of some state":"Activa la regla de actualización o cambio de algún estado","Triggers the rule periodically or on some specific time":"Activa la regla periódicamente o en un momento específico",Tu:M2,Tuesday:L2,URL:P2,"Unknown error":"Error desconocido","Unknown error!":"¡Error desconocido!","Use generated code":"Usar código generado","User function":"Función de usuario","User:":"Usuario:",Value:B2,"Vibration:":"Vibración:",Volume:F2,We:j2,Wednesday:z2,"Whatsapp-cmb":"Whatsapp-cmb",Write:U2,"Write your own code":"Escribe tu propio código",Yes:H2,"Yet exists!":"¡Sin embargo existe!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Puede usar %s en la URL para usar el valor de activación actual, %id para usar el ID de objeto activado, %name para mostrar el nombre de ID de objeto activado o %old para usar el valor de activación antiguo","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Puede usar %s en el comando para usar el valor de activación actual, %id para usar el ID de objeto activado, %name para mostrar el nombre de ID de objeto activado o %old para usar el valor de activación anterior","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Puede usar %s en el texto para mostrar el valor de activación actual, %id para usar el ID de objeto activado, %name para mostrar el nombre de ID de objeto activado o %old para usar el valor de activación antiguo","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Puede usar %s en el valor para usar el valor de activación actual, %id para usar el ID de objeto activado, %name para mostrar el nombre de ID de objeto activado o %old para usar el valor de activación antiguo","You have to enter OpenAI API key in the configuration of javascript adapter.":"Debe ingresar la clave API de OpenAI en la configuración del adaptador de JavaScript.","You have to enter at least one API key in the configuration of javascript adapter.":"Debe ingresar al menos una clave API (OpenAI, Anthropic o Gemini) en la configuración del adaptador de JavaScript.","Please select a valid model":"Seleccione un modelo válido","[equal]":"[igual]","[greater or equal]":"[mayor o igual]","[greater]":"[mayor que]","[hysteresis]":"[histéresis]","[includes]":"[incluye]","[less or equal]":"[menor o igual]","[less]":"[menos]","[not equal]":"[no es igual]",acknowledgment:W2,all:G2,and:V2,"as JSON":"como JSON","as plain text":"como texto plano",astro:K2,at:Y2,"clear running":"carrera clara",control:J2,copy:q2,cron:X2,dawn:Z2,debug_help:Q2,debug_label:eF,default:"defecto",dusk:tF,easy:sF,else:"demás","equal to":"igual a",every:oF,"every hour at 0 minutes":"cada hora a los 0 minutos",false:"falso","file reading has failed: %s":"la lectura del archivo ha fallado: %s","file reading was aborted":"la lectura del archivo fue abortada",filter_func:iF,filter_id:nF,filter_name:rF,filter_role:aF,filter_room:lF,"for edit or create script":"para editar o crear un nuevo script","for professionals":"para profesionales","for programmers":"para programadores",goldenHour:cF,goldenHourEnd:uF,"greater or equal":"mayor o igual","greater or equal to":"mayor o igual a","greater than":"mas grande que",help_just_check:dF,help_on_change:hF,"high priority":"alta prioridad","high-priority":"alta prioridad","highest priority":"más alta prioridad",hours:pF,includes:gF,interval:mF,"just check":"Sólo revisa","less or equal":"menor o igual","less or equal to":"menor o igual a","less than":"menos que","lower priority":"prioridad más baja","lowest priority":"prioridad más baja",magic:fF,milliseconds:$F,minutes:bF,ms:vF,nadir:yF,nauticalDawn:_F,nauticalDusk:wF,nextSunrise:kF,nextSunset:CF,night:TF,nightEnd:SF,"no blocks found":"No se encontraron bloques","no group":"NO GRUPO",normal:EF,"normal priority":"prioridad normal","not running":"no está en ejecución","not equal to":"no igual a","not properly connected":"Este bloque no está conectado correctamente a otros bloques.",offset:IF,"on change":"en el cambio","on condition change":"con cambio de condición","on update":"en actualización",one:xF,or:DF,quiet:AF,"reset search":"restablecer la búsqueda",search:OF,seconds:RF,solarNoon:NF,"store in":"almacenar en",sunrise:MF,sunriseEnd:LF,sunset:PF,sunsetStart:BF,then:FF,"toggle value":"alternar valor",tooltip_ack:jF,tooltip_from:zF,tooltip_lc:UF,tooltip_quality:HF,tooltip_ts:WF,tooltip_user:GF,tooltip_value:VF,true:"cierto",two:KF,undefined:"indefinido",update:YF,"use seconds":"usar segundos","use trigger value":"usar valor de activación",verbose_help:JF,verbose_label:qF,when:XF,with:"con","with date":"con fecha","with offset":"con desplazamiento",wizard:ZF,"Loading models...":"Cargando modelos...","Could not connect to API at %s":"No se pudo conectar a la API en %s","Invalid API key":"Clave API no válida","Access denied by API":"Acceso denegado por la API","API error: %s":"Error de API: %s",'Model "%s" not found':'Modelo "%s" no encontrado',"Request failed: %s":"Solicitud fallida: %s",Retry:QF,"No running javascript instance found":"No se encontró ninguna instancia de JavaScript en ejecución"},tj="Reconnu",sj="Actions",oj="Ajouter",ij="Tout",nj="Tout",rj="Postuler",aj="avril",lj="Demander",cj="Astronomique",uj="août",dj="Annuler",hj="proche",pj="État",gj="Conditions",mj="Console",fj="Copié",$j="décembre",bj="Défaut",vj="Retard",yj="Effacer",_j="Description",wj="Terminé",kj="Exec shell",Cj="Explication",Tj="Exportation",Sj="Février",Ej="février",Ij="Filtre",xj="Dossier",Dj="Fr",Aj="Vendredi",Oj="ID",Rj="ID1",Nj="ID2",Mj="Importation",Lj="Exemple",Pj="Instances",Bj="Instructions",Fj="Janvier",jj="janvier",zj="juillet",Uj="juin",Hj="Limite",Wj="Mars",Gj="Mai",Vj="M e n u",Kj="Message",Yj="Mo",Jj="Modèle",qj="Lundi",Xj="Mois",Zj="Plus",Qj="Nom",ez="novembre",tz="OK",sz="octobre",oz="D'accord",iz="Pause",nz="Pushover",rz="Pushsafer",az="Renommer",lz="Répéter",cz="Redémarrer",uz="Résultat",dz="Sa",hz="samedi",pz="sauver",gz="Horaire",mz="Scénario",fz="septembre",$z="Simuler",bz="Stack",vz="Début",yz="État",_z="Su",wz="dimanche",kz="Télégramme",Cz="4",Tz="Jeudi",Sz="Temps",Ez="Déclenché",Iz="Déclencheurs",xz="Tu",Dz="Mardi",Az="URL",Oz="Valeur",Rz="Le volume",Nz="3",Mz="Mercredi",Lz="Écrivez",Pz="Oui",Bz="reconnaissance",Fz="tout",jz="et",zz="astro",Uz="à",Hz="contrôler",Wz="copie",Gz="CRON",Vz="Aube",Kz="Il s'agit d'un mode spécial dans lequel les états et les objets ne changeront pas. Mais seules les informations sur chaque changement prévu seront affichées dans le protocole.",Yz="Déboguer",Jz="Crépuscule",qz="facile",Xz="chaque",Zz="Une fonction",Qz="ID",eU="Nom",tU="Rôle",sU="Pièce",oU="Heure d'or",iU="Fin de l'heure d'or",nU="Le code ne sera exécuté que chaque fois que la condition est vraie. Par exemple. si déclenchement sur la valeur du capteur de température et que la condition est «si la température est supérieure à 20 ° C», les actions «alors» seront exécutées à chaque fois que le capteur envoie la température et qu'elle est supérieure à 20 ° C. À 21 ° C, à 22 ° C et ainsi de suite.",rU="Le code ne sera exécuté que si le résultat de la condition change. Par exemple. si le déclenchement sur la valeur du capteur de température et que la condition est «si la température est supérieure à 20 ° C», les actions «alors» seront exécutées une fois lorsque la température est supérieure à 20. La prochaine fois, les actions «alors» seront exécutées lorsque la température échoue sous 20 puis remonte au-dessus de 20.",aU="les heures",lU="comprend",cU="intervalle",uU="la magie",dU="millisecondes",hU="minutes",pU="ms",gU="nadir",mU="Aube nautique",fU="Crépuscule nautique",$U="Prochain lever de soleil",bU="Prochain coucher de soleil",vU="Nuit",yU="Fin de nuit",_U="Ordinaire",wU="décalage",kU="une",CU="ou",TU="calmer",SU="chercher",EU="secondes",IU="Midi solaire",xU="lever du soleil",DU="Fin du lever du soleil",AU="le coucher du soleil",OU="Début du coucher du soleil",RU="alors",NU="Reconnaître",MU="De",LU="Dernière modification",PU="Qualité",BU="Horodatage",FU="Utilisateur",jU="Valeur",zU="deux",UU="mettre à jour",HU="Ajoute une sortie de débogage au journal pour de nombreuses commandes système",WU="Sorties de journal détaillées",GU="lorsque",VU="Wizard",KU="Réessayer",YU={"%s not found":"%s non trouvé","()":"()","(at %s)":"(à %s)","(optional)":"(optionnel)","-":"-",".":".","AI code generator":"Générateur de code IA",Ack:tj,Actions:sj,"Actual time of day":"Heure réelle de la journée",Add:oj,"Add new script":"Ajouter un nouveau script",All:ij,"All files will be accepted":"Tous les fichiers seront acceptés",Any:nj,"Any month":"N'importe quel mois",Apply:rj,April:aj,"Are you sure?":"Êtes-vous sûr?",Ask:lj,Astronomical:cj,"Astronomical events today":"Événements astronomiques aujourd'hui",August:uj,"Blockly description":"Création de règles par blocs graphiques","Body:":"Corps:",Cancel:dj,"Cannot delete non empty item!":"Impossible de supprimer un élément non vide!","Change layout":"Changer la disposition",'Change theme (actual "%s")':'Changer de thème (maintenant - "%s")',"Check blocks":"Vérifier les blocs","Check is not active, because javascript adapter is disabled":"La vérification n'est pas active, car l'adaptateur Javascript est désactivé","Clear search input":"Effacer la recherche","Click on this icon":"Cliquez sur cette icône",Close:hj,"Close all but current":"Ferme tout sauf courant","Collapse all":"Réduire tout","Compares current time with astronomical event":"Compare l'heure actuelle avec un événement astronomique","Compares current time with the user specific time":"Compare l'heure actuelle avec l'heure spécifique de l'utilisateur","Compares the state value with user defined value":"Compare la valeur d'état avec la valeur définie par l'utilisateur",Condition:pj,Conditions:gj,"Configuration not saved.":"Configuration non enregistrée.",Console:mj,"Control or update some state":"Contrôler ou mettre à jour un état","Control or update some state with delay":"Contrôler ou mettre à jour un état avec un délai","Convert blockly to javascript for ever.":"Convertissez instantanément en Javascript.",Copied:fj,"Copy script":"Copier le script","Copy to clipboard":"Copier dans le presse-papier","Create new":"Créer un nouveau","Create new folder":"Créer un nouveau dossier","Create new script":"Créer un nouveau script","Create or edit CRON or time wizard":"Créer ou éditer CRON ou un assistant de temps","Dark Theme":"Thème sombre","Dark style":"Style sombre",Date:"Date","Debug instance":"Instance de débogage","Debug options":"Options de débogage",December:$j,Default:bj,"Define cron...":"Définir le cron ...","Define schedule...":"Définir le calendrier ...",Delay:vj,Delete:yj,"Delete %s":"Supprimer %s ...","Delete folder":"Supprimer le dossier","Delete script":"Supprimer le script",Description:_j,"Deselect all":"Tout déselectionner","Discard changes for %s":"Ignorer les modifications pour %s",Done:wj,"Double click to write value":"Double clic pour écrire la valeur","Download as file":"Télécharger le fichier","Drop some files here or click...":"Déposer des fichiers ici ou cliquez sur ...","Duplicate name":"Nom en double","Edit script or just double click":"Modifiez le script ou double-cliquez simplement sur","Empty name is not allowed":"Le nom vide n'est pas autorisé","End search mode":"Fin du mode de recherche","Enter your question":"Entrez votre demande",Error:"Erreur","Error formatting code":"Erreur lors du formatage du code","Error was found":"Une erreur a été trouvée","Every day":"Tous les jours",Exec:kj,"Executes some shell command":"Exécute une commande shell","Existing scripts will be overwritten.":"Les scripts existants seront écrasés.","Expand all":"Développer tout","Expert mode":"Mode expert",Explanation:Cj,Export:Tj,"Export all scripts":"Exporter tous les scripts","Export blocks":"Blocs d'exportation","Export selected blocks":"Exporter les blocs sélectionnés",Februar:Sj,February:Ej,Filter:Ij,Folder:xj,Fr:Dj,Friday:Aj,Function:"Fonction","Function editor":"Éditeur de fonction","Function: executed":"Fonction : exécutée","Go to next line":"Aller à la ligne suivante","HTTP Call":"Appel HTTP","Hide logs":"Masquer les journaux",ID:Oj,ID1:Rj,ID2:Nj,Import:Mj,"Import blocks":"Blocs d'importation","Import error":"Erreur d'importation","Import scripts":"Importer des scripts","Insert object ID":"Insérer un identifiant d'objet",Instance:Lj,"Instance is disabled":"L'instance est désactivée","Instance:":"Exemple:",Instances:Pj,Instructions:Bj,"Invalid CRON":"CRON invalide","It will not be possible to revert this operation.":"Il ne sera pas possible de revenir sur cette opération.","JS description":"Créer des règles en écrivant du Javascript",Januar:Fj,January:jj,July:zj,June:Uj,"Just check":"Vérifiez simplement","Language:":"Langue:","Learn More":"Apprendre encore plus","Light style":"Style de lumière",Limit:Hj,"Local time":"Heure locale","Locate file":"Localiser le fichier","Log outputs":"Journal des sorties","Log text":"Texte du journal","Log: %s":"Log : %s","Make a HTTP get request":"Faire une requête HTTP Get","Make a pause between actions":"Faites une pause entre les actions",March:Wj,"March ":"mars",May:Gj,Menu:Vj,Message:Kj,Mo:Yj,Model:Jj,Monday:qj,Month:Xj,More:Zj,Name:Qj,"No API key found":"Aucune clé API trouvée","No Chat GPT Key found":"Aucune clé GPT de chat trouvée","No active host found":"Aucun hôte actif trouvé","Nothing found":"Rien n'a été trouvé",November:ez,OK:tz,October:sz,Ok:oz,"On condition change":"En cas de changement de condition","On script save or adapter start":"Lors de l'enregistrement du script ou du démarrage de l'adaptateur","On weekdays":"En semaine","Open configuration":"Configuration ouverte","Operate two states":"Opérer deux états","Operations with two states":"Opérations à deux états","Paste your blocks here":"Collez vos blocs ici",Pause:iz,"Pause execution":"Suspendre l'exécution","Pause script":"Script de pause","Phone:":"Téléphone:","Please select object ID...":"Veuillez sélectionner l'ID d'objet ...","Press Ctrl+Enter to get the answer":"Appuyez sur Ctrl+Entrée pour obtenir la réponse","Prettify the script":"Embellir le scénario","Print some text in log":"Imprimer du texte dans le journal","Priority:":"Priorité:",Pushover:nz,Pushsafer:rz,"Read only ID selected: %s":"ID en lecture seule sélectionné: %s",Rename:az,"Reorder scripts in folders":"Réorganiser les scripts dans des dossiers",Repeat:lz,Restart:cz,Result:uz,"Resume execution":"Reprendre l'exécution","Root folder":"Dossier racine","Rules description":"Créer des règles avec des blocs IF, THEN, ELSE","Run script":"Script de lancement",Sa:dz,Saturday:hz,Save:pz,"Save all":"Sauver tous","Say It":"Say It","Say some text via sayit adapter":"Dites du texte via l'adaptateur sayit",Schedule:gz,Script:mz,"Script %s was modified on disk":"Le script %s a été modifié sur le disque","Script is not running":"Le script n'est pas en cours d'exécution","Search in scripts":"Rechercher dans les scripts","Search...":"Chercher...","Select all":"Tout sélectionner","Send email":"Envoyer un e-mail","Sends an email":"Envoie un e-mail","Sends message via Pushsafer":"Envoie un message via Pushsafer","Sends message via pushover":"Envoie un message via pushover","Sends message via telegram":"Envoie un message par télégramme","Sends message via whatsapp-cmb":"Envoie un message via whatsapp-cmb",September:fz,"Server time":"Heure du serveur","Set state action":"Définir l'action de l'état","Set with delay":"Set avec retard","Shell command":"Commande Shell","Show astronomical events":"Afficher les événements astronomiques","Show javascript code":"Afficher le code Javascript","Show logs":"Afficher les journaux","Show only paused scripts":"Afficher uniquement les scripts en pause","Show only running scripts":"Afficher uniquement les scripts en cours d'exécution","Show only scripts with problems":"Afficher uniquement les scripts avec des problèmes",Simulate:$z,"Some files will be rejected":"Certains fichiers seront rejetés","Sound:":"Sonner:",Stack:bz,Start:vz,"Start script":"Lancer le script",State:yz,"State condition":"État condition","Step into function":"Entrez dans la fonction","Step out from function":"Sortez de la fonction","Stop on exception":"Arrêt sur exception",Su:_z,"Subject:":"Sujet:",Sunday:wz,"TS description":"Créer des règles en écrivant des caractères dactylographiés",Telegram:kz,"Text:":"Texte:",Th:Cz,"The script will be stopped and must be activated manually after debugging. Continue?":"Le script sera arrêté et doit être activé manuellement après le débogage. Continuez?","This is advances option. You can write your own code here and it will be executed on trigger":"C'est une option avancée. Vous pouvez écrire votre propre code ici et il sera exécuté au déclenchement",Thursday:Tz,Time:Sz,"Time condition":"Condition de temps","Title:":"Titre:","To:":"À:","Trigger with value":"Déclencheur avec valeur",Triggered:Ez,Triggers:Iz,"Triggers the on script saving or the javascript instance restart":"Déclenche l'enregistrement du script ou le redémarrage de l'instance javascript","Triggers the rule on update or change of some state":"Déclenche la règle sur la mise à jour ou le changement d'un état","Triggers the rule periodically or on some specific time":"Déclenche la règle périodiquement ou à une heure précise",Tu:xz,Tuesday:Dz,URL:Az,"Unknown error":"Erreur inconnue","Unknown error!":"Erreur inconnue!","Use generated code":"Utiliser le code généré","User function":"Fonction utilisateur","User:":"Utilisateur:",Value:Oz,"Vibration:":"Vibration:",Volume:Rz,We:Nz,Wednesday:Mz,"Whatsapp-cmb":"Whatsapp-cmb",Write:Lz,"Write your own code":"Écrivez votre propre code",Yes:Pz,"Yet exists!":"Pourtant existe!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Vous pouvez utiliser %s dans l'URL pour utiliser la valeur de déclenchement actuelle, %id pour utiliser l'ID de l'objet déclenché, %name pour afficher le nom de l'ID de l'objet déclenché ou %old pour utiliser l'ancienne valeur de déclenchement","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Vous pouvez utiliser %s dans la commande pour utiliser la valeur de déclenchement actuelle, %id pour utiliser l'ID de l'objet déclenché, %name pour afficher le nom de l'ID de l'objet déclenché ou %old pour utiliser l'ancienne valeur de déclenchement","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Vous pouvez utiliser %s dans le texte pour afficher la valeur de déclenchement actuelle, %id pour utiliser l'ID de l'objet déclenché, %name pour afficher le nom de l'ID de l'objet déclenché ou %old pour utiliser l'ancienne valeur de déclenchement","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Vous pouvez utiliser %s dans la valeur pour utiliser la valeur de déclenchement actuelle, %id pour utiliser l'ID de l'objet déclenché, %name pour afficher le nom de l'ID de l'objet déclenché ou %old pour utiliser l'ancienne valeur de déclenchement","You have to enter OpenAI API key in the configuration of javascript adapter.":"Vous devez entrer la clé API OpenAI dans la configuration de l'adaptateur javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Vous devez entrer au moins une clé API (OpenAI, Anthropic ou Gemini) dans la configuration de l'adaptateur javascript.","Please select a valid model":"Veuillez sélectionner un modèle valide","[equal]":"[égal]","[greater or equal]":"[supérieur ou égal]","[greater]":"[plus grand]","[hysteresis]":"[hystérèse]","[includes]":"[comprend]","[less or equal]":"[inférieur ou égal]","[less]":"[moins]","[not equal]":"[inégal]",acknowledgment:Bz,all:Fz,and:jz,"as JSON":"en JSON","as plain text":"en texte brut",astro:zz,at:Uz,"clear running":"course claire",control:Hz,copy:Wz,cron:Gz,dawn:Vz,debug_help:Kz,debug_label:Yz,default:"défaut",dusk:Jz,easy:qz,else:"autre","equal to":"égal à",every:Xz,"every hour at 0 minutes":"toutes les heures à 0 minute",false:"faux","file reading has failed: %s":"La lecture du fichier a échoué: %s","file reading was aborted":"la lecture du fichier a été abandonnée",filter_func:Zz,filter_id:Qz,filter_name:eU,filter_role:tU,filter_room:sU,"for edit or create script":"pour éditer ou créer un nouveau script","for professionals":"pour les professionnels","for programmers":"pour les programmeurs",goldenHour:oU,goldenHourEnd:iU,"greater or equal":"supérieur ou égal","greater or equal to":"supérieur ou égal à","greater than":"plus grand que",help_just_check:nU,help_on_change:rU,"high priority":"haute priorité","high-priority":"haute priorité","highest priority":"priorité la plus élevée",hours:aU,includes:lU,interval:cU,"just check":"Vérifiez simplement","less or equal":"inférieur ou égal","less or equal to":"inférieur ou égal à","less than":"moins que","lower priority":"priorité inférieure","lowest priority":"priorité la plus basse",magic:uU,milliseconds:dU,minutes:hU,ms:pU,nadir:gU,nauticalDawn:mU,nauticalDusk:fU,nextSunrise:$U,nextSunset:bU,night:vU,nightEnd:yU,"no blocks found":"Aucun bloc trouvé","no group":"PAS DE GROUPE",normal:_U,"normal priority":"priorité normale","not running":"pas en cours d'exécution","not equal to":"pas égal à","not properly connected":"Ce bloc n'est pas correctement connecté à d'autres blocs.",offset:wU,"on change":"sur le changement","on condition change":"sur changement de condition","on update":"sur mise à jour",one:kU,or:CU,quiet:TU,"reset search":"Réinitialiser la recherche",search:SU,seconds:EU,solarNoon:IU,"store in":"stocker dans",sunrise:xU,sunriseEnd:DU,sunset:AU,sunsetStart:OU,then:RU,"toggle value":"valeur de bascule",tooltip_ack:NU,tooltip_from:MU,tooltip_lc:LU,tooltip_quality:PU,tooltip_ts:BU,tooltip_user:FU,tooltip_value:jU,true:"vrai",two:zU,undefined:"indéfini",update:UU,"use seconds":"utiliser les secondes","use trigger value":"use trigger value",verbose_help:HU,verbose_label:WU,when:GU,with:"avec","with date":"avec date","with offset":"avec offset",wizard:VU,"Loading models...":"Chargement des modèles...","Could not connect to API at %s":"Impossible de se connecter à l'API sur %s","Invalid API key":"Clé API invalide","Access denied by API":"Accès refusé par l'API","API error: %s":"Erreur API : %s",'Model "%s" not found':'Modèle "%s" introuvable',"Request failed: %s":"Requête échouée : %s",Retry:KU,"No running javascript instance found":"Aucune instance JavaScript en cours d'exécution trouvée"},JU="Riconosciuto",qU="Azioni",XU="Inserisci",ZU="Tutti",QU="Qualunque",eH="Applica",tH="aprile",sH="Chiedere",oH="Astronomico",iH="agosto",nH="Annulla",rH="Vicino",aH="Condizione",lH="Condizioni",cH="Console",uH="Copiato",dH="dicembre",hH="Predefinito",pH="Ritardo",gH="Elimina",mH="Descrizione",fH="Fatto",$H="Execshell",bH="Spiegazione",vH="Esportare",yH="Februar",_H="febbraio",wH="Filtro",kH="Cartella",CH="P",TH="Venerdì",SH="ID",EH="ID1",IH="ID2",xH="Importare",DH="Esempio",AH="istanze",OH="Istruzioni",RH="Januar",NH="gennaio",MH="luglio",LH="giugno",PH="Limite",BH="marzo",FH="Maggio",jH="Menu",zH="Messaggio",UH="Mo",HH="Modello",WH="Lunedi",GH="Mese",VH="Di più",KH="Nome",YH="novembre",JH="OK",qH="ottobre",XH="Ok",ZH="Pausa",QH="Pushover",eW="Pushsafer",tW="Rinominare",sW="Ripetere",oW="Ricomincia",iW="Risultato",nW="Sa",rW="Sabato",aW="Salva",lW="Programma",cW="copione",uW="settembre",dW="Simulare",hW="Stack",pW="Cominciare",gW="Stato",mW="Su",fW="Domenica",$W="Telegramma",bW="4",vW="giovedi",yW="Tempo",_W="Innescato",wW="Trigger",kW="Tu",CW="martedì",TW="URL",SW="Valore",EW="Volume",IW="3",xW="mercoledì",DW="Scrivi",AW="sì",OW="riconoscimento",RW="tutti",NW="e",MW="astro",LW="a",PW="controllo",BW="copia",FW="CRON",jW="alba",zW="Questa è una modalità speciale in cui gli stati e gli oggetti non cambieranno. Ma nel protocollo verranno visualizzate solo le informazioni su ogni modifica pianificata.",UW="Debug",HW="crepuscolo",WW="facile",GW="ogni",VW="Funzione",KW="ID",YW="Nome",JW="Ruolo",qW="Camera",XW="Ora d'oro",ZW="Fine dell'ora d'oro",QW='Il codice verrà eseguito solo ogni volta che la condizione è vera. Per esempio. se si attiva il valore del sensore di temperatura e la condizione è "se la temperatura è maggiore di 20 ° C", le azioni "allora" verranno eseguite ogni volta che il sensore invia la temperatura e questa è superiore a 20 ° C. Di 21 ° C, di 22 ° C e così via.',e5='Il codice verrà eseguito solo se il risultato della condizione cambia. Per esempio. se si attiva il valore del sensore di temperatura e la condizione è "se la temperatura è maggiore di 20 ° C", le azioni "allora" verranno eseguite una volta quando la temperatura è superiore a 20. La prossima volta le azioni "allora" verranno eseguite quando la temperatura fallisce sotto 20 e poi sale di nuovo oltre 20.',t5="ore",s5="include",o5="intervallo",i5="Magia",n5="millisecondi",r5="minuti",a5="ms",l5="nadir",c5="Alba nautica",u5="Crepuscolo nautico",d5="Prossima alba",h5="Prossimo tramonto",p5="Notte",g5="Fine della notte",m5="normale",f5="compensare",$5="uno",b5="o",v5="silenzioso",y5="ricerca",_5="secondi",w5="Mezzogiorno solare",k5="Alba",C5="Fine dell'alba",T5="tramonto",S5="Inizio del tramonto",E5="poi",I5="Riconoscere",x5="A partire dal",D5="Ultima modifica",A5="Qualità",O5="timestamp",R5="Utente",N5="Valore",M5="Due",L5="aggiornare",P5="Aggiunge l'output di debug al registro per molti comandi di sistema",B5="Output di log dettagliati",F5="quando",j5="procedura guidata",z5="Riprova",U5={"%s not found":"%s non trovato","()":"()","(at %s)":"(a %s)","(optional)":"(opzionale)","-":"-",".":".","AI code generator":"Generatore di codice AI",Ack:JU,Actions:qU,"Actual time of day":"Ora effettiva della giornata",Add:XU,"Add new script":"Aggiungi nuovo script",All:ZU,"All files will be accepted":"Tutti i file saranno accettati",Any:QU,"Any month":"Ogni mese",Apply:eH,April:tH,"Are you sure?":"Sei sicuro?",Ask:sH,Astronomical:oH,"Astronomical events today":"Eventi astronomici oggi",August:iH,"Blockly description":"Creazione di regole tramite blocchi grafici","Body:":"Corpo:",Cancel:nH,"Cannot delete non empty item!":"Impossibile eliminare l'elemento non vuoto!","Change layout":"Cambia layout",'Change theme (actual "%s")':'Cambia tema (ora - "%s")',"Check blocks":"Controlla i blocchi","Check is not active, because javascript adapter is disabled":"Il controllo non è attivo perché l'adattatore Javascript è disabilitato","Clear search input":"Cancella input di ricerca","Click on this icon":"Clicca su questa icona",Close:rH,"Close all but current":"Chiudi tutto tranne corrente","Collapse all":"Comprimi tutto","Compares current time with astronomical event":"Confronta l'ora corrente con l'evento astronomico","Compares current time with the user specific time":"Confronta l'ora corrente con l'ora specifica dell'utente","Compares the state value with user defined value":"Confronta il valore dello stato con il valore definito dall'utente",Condition:aH,Conditions:lH,"Configuration not saved.":"Configurazione non salvata.",Console:cH,"Control or update some state":"Controlla o aggiorna uno stato","Control or update some state with delay":"Controlla o aggiorna uno stato con ritardo","Convert blockly to javascript for ever.":"Converti istantaneamente a blocchi in Javascript.",Copied:uH,"Copy script":"Copia script","Copy to clipboard":"Copia negli appunti","Create new":"Creare nuovo","Create new folder":"Crea una nuova cartella","Create new script":"Crea nuovo script","Create or edit CRON or time wizard":"Crea o modifica la procedura guidata CRON o time","Dark Theme":"Tema scuro","Dark style":"Stile scuro",Date:"Data","Debug instance":"Istanza di debug","Debug options":"Opzioni di debug",December:dH,Default:hH,"Define cron...":"Definisci cron ...","Define schedule...":"Definisci programma ...",Delay:pH,Delete:gH,"Delete %s":"Elimina %s ...","Delete folder":"Elimina cartella","Delete script":"Elimina script",Description:mH,"Deselect all":"Deselezionare tutto","Discard changes for %s":"Annulla modifiche per %s",Done:fH,"Double click to write value":"Doppio clic per scrivere il valore","Download as file":"Scarica come file","Drop some files here or click...":"Trascina alcuni file qui o fai clic su ...","Duplicate name":"Nome duplicato","Edit script or just double click":"Modifica lo script o fai doppio clic","Empty name is not allowed":"Il nome vuoto non è consentito","End search mode":"Termina la modalità di ricerca","Enter your question":"Inserisci la tua richiesta",Error:"Errore","Error formatting code":"Errore di formattazione del codice","Error was found":"Errore trovato","Every day":"Ogni giorno",Exec:$H,"Executes some shell command":"Esegue alcuni comandi della shell","Existing scripts will be overwritten.":"Gli script esistenti verranno sovrascritti.","Expand all":"Espandi tutto","Expert mode":"Modalità esperto",Explanation:bH,Export:vH,"Export all scripts":"Esporta tutti gli script","Export blocks":"Esporta blocchi","Export selected blocks":"Esporta i blocchi selezionati",Februar:yH,February:_H,Filter:wH,Folder:kH,Fr:CH,Friday:TH,Function:"Funzione","Function editor":"Editor di funzioni","Function: executed":"Funzione: eseguita","Go to next line":"Vai alla riga successiva","HTTP Call":"Chiamata HTTP","Hide logs":"Nascondi i registri",ID:SH,ID1:EH,ID2:IH,Import:xH,"Import blocks":"Importa blocchi","Import error":"Errore di importazione","Import scripts":"Importa script","Insert object ID":"Inserisci l'ID oggetto",Instance:DH,"Instance is disabled":"L'istanza è disabilitata","Instance:":"Esempio:",Instances:AH,Instructions:OH,"Invalid CRON":"CRON non valido","It will not be possible to revert this operation.":"Non sarà possibile ripristinare questa operazione.","JS description":"Creare regole scrivendo Javascript",Januar:RH,January:NH,July:MH,June:LH,"Just check":"Controlla solamente","Language:":"Linguaggio:","Learn More":"Per saperne di più","Light style":"Stile leggero",Limit:PH,"Local time":"Ora locale","Locate file":"Localizza file","Log outputs":"Registra le uscite","Log text":"Testo del registro","Log: %s":"Log: %s","Make a HTTP get request":"Effettua una richiesta get HTTP","Make a pause between actions":"Fai una pausa tra le azioni",March:BH,"March ":"marzo",May:FH,Menu:jH,Message:zH,Mo:UH,Model:HH,Monday:WH,Month:GH,More:VH,Name:KH,"No API key found":"Nessuna chiave API trovata","No Chat GPT Key found":"Nessuna chiave GPT chat trovata","No active host found":"Nessun host attivo trovato","Nothing found":"Non abbiamo trovato nulla",November:YH,OK:JH,October:qH,Ok:XH,"On condition change":"A condizione che cambino","On script save or adapter start":"Al salvataggio dello script o all'avvio dell'adattatore","On weekdays":"Nei giorni della settimana","Open configuration":"Configurazione aperta","Operate two states":"Gestisci due stati","Operations with two states":"Operazioni con due stati","Paste your blocks here":"Incolla qui i tuoi blocchi",Pause:ZH,"Pause execution":"Metti in pausa l'esecuzione","Pause script":"Metti in pausa lo script","Phone:":"Telefono:","Please select object ID...":"Seleziona l'ID oggetto ...","Press Ctrl+Enter to get the answer":"Premi Ctrl+Invio per ottenere la risposta","Prettify the script":"Abbellire la sceneggiatura","Print some text in log":"Stampa del testo nel registro","Priority:":"Priorità:",Pushover:QH,Pushsafer:eW,"Read only ID selected: %s":"ID di sola lettura selezionato: %s",Rename:tW,"Reorder scripts in folders":"Riordina gli script nelle cartelle",Repeat:sW,Restart:oW,Result:iW,"Resume execution":"Riprendi esecuzione","Root folder":"Cartella root","Rules description":"Crea regole con i blocchi IF, THEN, ELSE","Run script":"Esegui script",Sa:nW,Saturday:rW,Save:aW,"Save all":"Salva tutto","Say It":"Say It","Say some text via sayit adapter":"Pronuncia del testo tramite l'adattatore sayit",Schedule:lW,Script:cW,"Script %s was modified on disk":"Lo script %s è stato modificato sul disco","Script is not running":"Lo script non è in esecuzione","Search in scripts":"Cerca negli script","Search...":"Ricerca...","Select all":"Seleziona tutto","Send email":"Invia una email","Sends an email":"Invia un'e-mail","Sends message via Pushsafer":"Invia messaggio tramite Pushsafer","Sends message via pushover":"Invia messaggio tramite pushover","Sends message via telegram":"Invia messaggio tramite telegramma","Sends message via whatsapp-cmb":"Invia messaggio tramite whatsapp-cmb",September:uW,"Server time":"Ora del server","Set state action":"Imposta l'azione dello stato","Set with delay":"Impostato con ritardo","Shell command":"Comando Shell","Show astronomical events":"Mostra eventi astronomici","Show javascript code":"Mostra codice Javascript","Show logs":"Mostra i log","Show only paused scripts":"Mostra solo script in pausa","Show only running scripts":"Mostra solo gli script in esecuzione","Show only scripts with problems":"Mostra solo script con problemi",Simulate:dW,"Some files will be rejected":"Alcuni file verranno rifiutati","Sound:":"Suono:",Stack:hW,Start:pW,"Start script":"Avvia script",State:gW,"State condition":"Condizione dello stato","Step into function":"Entra in funzione","Step out from function":"Esci dalla funzione","Stop on exception":"Ferma in caso di eccezione",Su:mW,"Subject:":"Soggetto:",Sunday:fW,"TS description":"Creare regole scrivendo dattiloscritto",Telegram:$W,"Text:":"Testo:",Th:bW,"The script will be stopped and must be activated manually after debugging. Continue?":"Lo script verrà interrotto e dovrà essere attivato manualmente dopo il debug. Continua?","This is advances option. You can write your own code here and it will be executed on trigger":"Questa è un'opzione anticipata. Puoi scrivere il tuo codice qui e verrà eseguito al trigger",Thursday:vW,Time:yW,"Time condition":"Condizione temporale","Title:":"Titolo:","To:":"Per:","Trigger with value":"Trigger con valore",Triggered:_W,Triggers:wW,"Triggers the on script saving or the javascript instance restart":"Attiva il salvataggio dello script o il riavvio dell'istanza javascript","Triggers the rule on update or change of some state":"Attiva la regola in caso di aggiornamento o modifica di uno stato","Triggers the rule periodically or on some specific time":"Attiva la regola periodicamente o in un momento specifico",Tu:kW,Tuesday:CW,URL:TW,"Unknown error":"Errore sconosciuto","Unknown error!":"Errore sconosciuto!","Use generated code":"Usa il codice generato","User function":"Funzione utente","User:":"Utente:",Value:SW,"Vibration:":"Vibrazione:",Volume:EW,We:IW,Wednesday:xW,"Whatsapp-cmb":"Whatsapp-cmb",Write:DW,"Write your own code":"Scrivi il tuo codice",Yes:AW,"Yet exists!":"Esiste ancora!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"È possibile utilizzare %s nell'URL per utilizzare il valore di trigger corrente, %id per utilizzare l'ID dell'oggetto attivato, %name per mostrare il nome dell'ID dell'oggetto attivato o %old per utilizzare il vecchio valore di trigger","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"È possibile utilizzare %s nel comando per utilizzare il valore di trigger corrente, %id per utilizzare l'ID dell'oggetto attivato, %name per mostrare il nome dell'ID dell'oggetto attivato o %old per utilizzare il vecchio valore di trigger","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"È possibile utilizzare %s nel testo per visualizzare il valore di trigger corrente, %id per utilizzare l'ID dell'oggetto attivato, %name per mostrare il nome dell'ID dell'oggetto attivato o %old per utilizzare il vecchio valore di trigger","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"È possibile utilizzare %s nel valore per utilizzare il valore di trigger corrente, %id per utilizzare l'ID dell'oggetto attivato, %name per mostrare il nome dell'ID dell'oggetto attivato o %old per utilizzare il vecchio valore di trigger","You have to enter OpenAI API key in the configuration of javascript adapter.":"Devi inserire la chiave API OpenAI nella configurazione dell'adattatore javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Devi inserire almeno una chiave API (OpenAI, Anthropic o Gemini) nella configurazione dell'adattatore javascript.","Please select a valid model":"Seleziona un modello valido","[equal]":"[pari]","[greater or equal]":"[maggiore o uguale]","[greater]":"[maggiore]","[hysteresis]":"[isteresi]","[includes]":"[include]","[less or equal]":"[minore o uguale]","[less]":"[Di meno]","[not equal]":"[non uguale]",acknowledgment:OW,all:RW,and:NW,"as JSON":"come JSON","as plain text":"come testo",astro:MW,at:LW,"clear running":"chiara esecuzione",control:PW,copy:BW,cron:FW,dawn:jW,debug_help:zW,debug_label:UW,default:"predefinito",dusk:HW,easy:WW,else:"altro","equal to":"uguale a",every:GW,"every hour at 0 minutes":"ogni ora a 0 minuti",false:"falso","file reading has failed: %s":"lettura file non riuscita: %s","file reading was aborted":"la lettura del file è stata interrotta",filter_func:VW,filter_id:KW,filter_name:YW,filter_role:JW,filter_room:qW,"for edit or create script":"per modificare o creare un nuovo script","for professionals":"per i professionisti","for programmers":"per i programmatori",goldenHour:XW,goldenHourEnd:ZW,"greater or equal":"maggiore o uguale","greater or equal to":"maggiore o uguale a","greater than":"più grande di",help_just_check:QW,help_on_change:e5,"high priority":"priorità alta","high-priority":"priorità alta","highest priority":"massima priorità",hours:t5,includes:s5,interval:o5,"just check":"controlla solamente","less or equal":"inferiore o uguale","less or equal to":"minore o uguale a","less than":"meno di","lower priority":"priorità inferiore","lowest priority":"priorità più bassa",magic:i5,milliseconds:n5,minutes:r5,ms:a5,nadir:l5,nauticalDawn:c5,nauticalDusk:u5,nextSunrise:d5,nextSunset:h5,night:p5,nightEnd:g5,"no blocks found":"Nessun blocco trovato","no group":"NESSUN GRUPPO",normal:m5,"normal priority":"priorità normale","not running":"non in esecuzione","not equal to":"non uguale a","not properly connected":"Questo blocco non è correttamente collegato ad altri blocchi.",offset:f5,"on change":"sul cambiamento","on condition change":"a cambio di condizione","on update":"in aggiornamento",one:$5,or:b5,quiet:v5,"reset search":"resetta la ricerca",search:y5,seconds:_5,solarNoon:w5,"store in":"conservare in",sunrise:k5,sunriseEnd:C5,sunset:T5,sunsetStart:S5,then:E5,"toggle value":"alterna valore",tooltip_ack:I5,tooltip_from:x5,tooltip_lc:D5,tooltip_quality:A5,tooltip_ts:O5,tooltip_user:R5,tooltip_value:N5,true:"vero",two:M5,undefined:"non definito",update:L5,"use seconds":"usa i secondi","use trigger value":"usa il trigger",verbose_help:P5,verbose_label:B5,when:F5,with:"con","with date":"con data","with offset":"con offset",wizard:j5,"Loading models...":"Caricamento modelli...","Could not connect to API at %s":"Impossibile connettersi all'API su %s","Invalid API key":"Chiave API non valida","Access denied by API":"Accesso negato dall'API","API error: %s":"Errore API: %s",'Model "%s" not found':'Modello "%s" non trovato',"Request failed: %s":"Richiesta fallita: %s",Retry:z5,"No running javascript instance found":"Nessuna istanza JavaScript in esecuzione trovata"},H5="Erkend",W5="Acties",G5="Toevoegen",V5="Alle",K5="Ieder",Y5="Solliciteer",J5="april",q5="Vragen",X5="Astronomisch",Z5="augustus",Q5="annuleren",e3="Dichtbij",t3="Staat",s3="Voorwaarden",o3="Troosten",i3="Gekopieerd",n3="december",r3="Standaard",a3="Vertraging",l3="Verwijder",c3="Beschrijving",u3="Gedaan",d3="Exec shell",h3="Uitleg",p3="Exporteren",g3="Februari",m3="februari",f3="Filter",$3="Map",b3="Vr",v3="vrijdag",y3="ID kaart",_3="ID1",w3="ID2",k3="Importeren",C3="Voorbeeld",T3="Instanties",S3="Instructies",E3="Januar",I3="januari",x3="juli",D3="juni",A3="Begrenzing",O3="maart",R3="mei",N3="Menu",M3="Bericht",L3="Ma",P3="Model",B3="maandag",F3="Maand",j3="Meer",z3="Naam",U3="november",H3="OK",W3="oktober",G3="OK",V3="Pauze",K3="Pushover",Y3="Duwijzer",J3="andere naam geven",q3="Herhaling",X3="Herstarten",Z3="Resultaat",Q3="Za",eG="zaterdag",tG="Opslaan",sG="Schema",oG="Script",iG="september",nG="Simuleren",rG="Stack",aG="Begin",lG="Staat",cG="Zo",uG="zondag",dG="Telegram",hG="4",pG="donderdag",gG="Tijd",mG="Veroorzaakt",fG="Triggers",$G="Di",bG="dinsdag",vG="URL",yG="Waarde",_G="Volume",wG="3",kG="woensdag",CG="Schrijven",TG="Ja",SG="erkenning",EG="alle",IG="en",xG="astro",DG="Bij",AG="controle",OG="kopiëren",RG="cron",NG="dageraad",MG="Dit is een speciale modus waarin toestanden en objecten niet veranderen. Maar alleen informatie over elke geplande wijziging wordt in het protocol weergegeven.",LG="Debuggen",PG="schemer",BG="eenvoudig",FG="elke",jG="Functie",zG="ID kaart",UG="Naam",HG="Rol",WG="Kamer",GG="gouden uur",VG="Einde van gouden uur",KG='De code wordt alleen uitgevoerd als de voorwaarde waar is. Bijv. als het triggeren op de temperatuursensorwaarde en de conditie is "als de temperatuur hoger is dan 20 ° C", zullen de "dan" acties worden uitgevoerd elke keer dat de sensor de temperatuur verzendt en deze hoger is dan 20 ° C. Bij 21 ° C, bij 22 ° C enzovoort.',YG='De code wordt alleen uitgevoerd als het conditieresultaat verandert. Bijv. als de temperatuursensor wordt geactiveerd en de conditie is "als de temperatuur hoger is dan 20 ° C", worden de "dan" -acties eenmaal uitgevoerd wanneer de temperatuur hoger is dan 20. De volgende keer worden de "dan" -acties uitgevoerd wanneer de temperatuur faalt onder de 20 en stijgt dan weer boven de 20.',JG="uren",qG="omvat",XG="interval",ZG="magie",QG="milliseconden",eV="minuten",tV="ms",sV="nadir",oV="Nautische dageraad",iV="Nautische schemering",nV="Volgende zonsopgang",rV="Volgende zonsondergang",aV="nacht",lV="Einde van de nacht",cV="normaal",uV="compensatie",dV="een",hV="of",pV="stil",gV="zoeken",mV="seconden",fV="Zonne-middag",$V="zonsopkomst",bV="Einde zonsopgang",vV="zonsondergang",yV="Begin van de zonsondergang",_V="vervolgens",wV="Erkennen",kV="Van",CV="Laatst gewijzigd",TV="Kwaliteit",SV="tijdstempel",EV="Gebruiker",IV="Waarde",xV="twee",DV="bijwerken",AV="Voegt foutopsporingsuitvoer toe aan het logboek voor veel systeemopdrachten",OV="Uitgebreide log-uitgangen",RV="wanneer",NV="tovenaar",MV="Opnieuw proberen",LV={"%s not found":"%s niet gevonden","()":"()","(at %s)":"(op %s)","(optional)":"(optioneel)","-":"-",".":".","AI code generator":"AI-codegenerator",Ack:H5,Actions:W5,"Actual time of day":"Werkelijke tijd van de dag",Add:G5,"Add new script":"Nieuw script toevoegen",All:V5,"All files will be accepted":"Alle bestanden worden geaccepteerd",Any:K5,"Any month":"Elke maand",Apply:Y5,April:J5,"Are you sure?":"Weet je zeker dat?",Ask:q5,Astronomical:X5,"Astronomical events today":"Astronomische gebeurtenissen vandaag",August:Z5,"Blockly description":"Regels maken door grafische blokken","Body:":"Lichaam:",Cancel:Q5,"Cannot delete non empty item!":"Kan niet leeg item niet verwijderen!","Change layout":"Opmaak veranderen",'Change theme (actual "%s")':'Thema wijzigen (nu - "%s")',"Check blocks":"Controleer blokken","Check is not active, because javascript adapter is disabled":"Controle is niet actief, omdat Javascript-adapter is uitgeschakeld","Clear search input":"Zoekopdracht wissen","Click on this icon":"Klik op dit pictogram",Close:e3,"Close all but current":"Alles sluiten behalve huidig","Collapse all":"Alles inklappen","Compares current time with astronomical event":"Vergelijkt huidige tijd met astronomische gebeurtenis","Compares current time with the user specific time":"Vergelijkt de huidige tijd met de gebruikerspecifieke tijd","Compares the state value with user defined value":"Vergelijkt de statuswaarde met de door de gebruiker gedefinieerde waarde",Condition:t3,Conditions:s3,"Configuration not saved.":"Configuratie niet opgeslagen.",Console:o3,"Control or update some state":"Beheer of update een bepaalde staat","Control or update some state with delay":"Beheer of update een bepaalde staat met vertraging","Convert blockly to javascript for ever.":"Converteer direct blockly naar Javascript.",Copied:i3,"Copy script":"Kopieer script","Copy to clipboard":"Kopieer naar klembord","Create new":"Maak nieuw","Create new folder":"Maak een nieuwe map","Create new script":"Maak een nieuw script","Create or edit CRON or time wizard":"Creëer of bewerk CRON of tijdwizard","Dark Theme":"Donker thema","Dark style":"Donkere stijl",Date:"Datum","Debug instance":"Debug-instantie","Debug options":"Foutopsporingsopties",December:n3,Default:r3,"Define cron...":"Definieer cron ...","Define schedule...":"Definieer schema ...",Delay:a3,Delete:l3,"Delete %s":"%s verwijderen ...","Delete folder":"Verwijder map","Delete script":"Script verwijderen",Description:c3,"Deselect all":"Deselecteer alles","Discard changes for %s":"Wijzigingen voor %s annuleren",Done:u3,"Double click to write value":"Dubbelklikken om waarde te schrijven","Download as file":"Download","Drop some files here or click...":"Zet hier enkele bestanden neer of klik op ...","Duplicate name":"Dubbele naam","Edit script or just double click":"Bewerk het script of dubbelklik erop","Empty name is not allowed":"Lege naam is niet toegestaan","End search mode":"Zoekmodus beëindigen","Enter your question":"Voer uw verzoek in",Error:"Fout","Error formatting code":"Fout bij het opmaken van de code","Error was found":"Er is een fout gevonden","Every day":"Elke dag",Exec:d3,"Executes some shell command":"Voert een shell-commando uit","Existing scripts will be overwritten.":"Bestaande scripts worden overschreven.","Expand all":"Alles uitvouwen","Expert mode":"Expert modus",Explanation:h3,Export:p3,"Export all scripts":"Exporteer alle scripts","Export blocks":"Blokken exporteren","Export selected blocks":"Exporteer geselecteerde blokken",Februar:g3,February:m3,Filter:f3,Folder:$3,Fr:b3,Friday:v3,Function:"Functie","Function editor":"Functie-editor","Function: executed":"Functie: uitgevoerd","Go to next line":"Ga naar de volgende regel","HTTP Call":"HTTP-oproep","Hide logs":"Verberg logboeken",ID:y3,ID1:_3,ID2:w3,Import:k3,"Import blocks":"Blokken importeren","Import error":"Importfout","Import scripts":"Scripts importeren","Insert object ID":"Object-ID invoegen",Instance:C3,"Instance is disabled":"Exemplaar is uitgeschakeld","Instance:":"Voorbeeld:",Instances:T3,Instructions:S3,"Invalid CRON":"Ongeldige CRON","It will not be possible to revert this operation.":"Het is niet mogelijk om deze bewerking terug te zetten.","JS description":"Regels maken door Javascript te schrijven",Januar:E3,January:I3,July:x3,June:D3,"Just check":"Kijk maar","Language:":"Taal:","Learn More":"Leer meer","Light style":"Lichte stijl",Limit:A3,"Local time":"Lokale tijd","Locate file":"Vind het bestand","Log outputs":"Log uitgangen","Log text":"Log tekst","Log: %s":"Logboek: %s","Make a HTTP get request":"Maak een HTTP-ophaalverzoek","Make a pause between actions":"Pauzeer tussen acties",March:O3,"March ":"maart",May:R3,Menu:N3,Message:M3,Mo:L3,Model:P3,Monday:B3,Month:F3,More:j3,Name:z3,"No API key found":"Geen API-sleutel gevonden","No Chat GPT Key found":"Geen Chat GPT-sleutel gevonden","No active host found":"Geen actieve host gevonden","Nothing found":"Niets gevonden",November:U3,OK:H3,October:W3,Ok:G3,"On condition change":"Op voorwaarde verandering","On script save or adapter start":"Bij het opslaan van het script of het starten van de adapter","On weekdays":"Op weekdagen","Open configuration":"Configuratie openen","Operate two states":"Bedien twee toestanden:","Operations with two states":"Bewerkingen met twee toestanden","Paste your blocks here":"Plak hier je blokken",Pause:V3,"Pause execution":"Uitvoering pauzeren","Pause script":"Pauzeer script","Phone:":"Telefoon:","Please select object ID...":"Selecteer object-ID ...","Press Ctrl+Enter to get the answer":"Druk op Ctrl+Enter om het antwoord te krijgen","Prettify the script":"Maak het script mooier","Print some text in log":"Druk wat tekst af in het logboek","Priority:":"Prioriteit:",Pushover:K3,Pushsafer:Y3,"Read only ID selected: %s":"Alleen-lezen ID geselecteerd: %s",Rename:J3,"Reorder scripts in folders":"Sorteer scripts in mappen opnieuw",Repeat:q3,Restart:X3,Result:Z3,"Resume execution":"Uitvoering hervatten","Root folder":"Hoofdmap","Rules description":"Maak regels met IF, THEN, ELSE blokken","Run script":"Voer script uit",Sa:Q3,Saturday:eG,Save:tG,"Save all":"Sla alles op","Say It":"Say It","Say some text via sayit adapter":"Zeg wat tekst via de sayit-adapter",Schedule:sG,Script:oG,"Script %s was modified on disk":"Script %s is gewijzigd op schijf","Script is not running":"Script is niet actief","Search in scripts":"Zoeken in scripts","Search...":"Zoeken...","Select all":"Selecteer alles","Send email":"E-mail verzenden","Sends an email":"Stuurt een e-mail","Sends message via Pushsafer":"Stuurt bericht via Pushsafer","Sends message via pushover":"Stuurt bericht via pushover","Sends message via telegram":"Verzendt bericht via telegram","Sends message via whatsapp-cmb":"Stuurt bericht via whatsapp-cmb",September:iG,"Server time":"Servertijd","Set state action":"Stel statusactie in","Set with delay":"Met vertraging ingesteld","Shell command":"Shell-opdracht","Show astronomical events":"Laat astronomische gebeurtenissen zien","Show javascript code":"Javascript-code weergeven","Show logs":"Toon logboeken","Show only paused scripts":"Toon alleen onderbroken scripts","Show only running scripts":"Toon alleen actieve scripts","Show only scripts with problems":"Toon alleen scripts met problemen",Simulate:nG,"Some files will be rejected":"Sommige bestanden worden geweigerd","Sound:":"Geluid:",Stack:rG,Start:aG,"Start script":"Start het script",State:lG,"State condition":"Staat staat","Step into function":"Stap in functie","Step out from function":"Stap uit de functie","Stop on exception":"Stop bij uitzondering",Su:cG,"Subject:":"Onderwerpen:",Sunday:uG,"TS description":"Regels maken door Typescript te schrijven",Telegram:dG,"Text:":"Tekst:",Th:hG,"The script will be stopped and must be activated manually after debugging. Continue?":"Het script wordt gestopt en moet na het debuggen handmatig worden geactiveerd. Doorgaan met?","This is advances option. You can write your own code here and it will be executed on trigger":"Dit is een voorschotoptie. U kunt hier uw eigen code schrijven en deze wordt bij een trigger uitgevoerd",Thursday:pG,Time:gG,"Time condition":"Tijdsvoorwaarde","Title:":"Titel:","To:":"Naar:","Trigger with value":"Trigger met waarde",Triggered:mG,Triggers:fG,"Triggers the on script saving or the javascript instance restart":"Activeert het opslaan van het script of het opnieuw opstarten van de JavaScript-instantie","Triggers the rule on update or change of some state":"Activeert de regel voor het bijwerken of wijzigen van een bepaalde staat","Triggers the rule periodically or on some specific time":"Activeert de regel periodiek of op een specifieke tijd",Tu:$G,Tuesday:bG,URL:vG,"Unknown error":"Onbekende fout","Unknown error!":"Onbekende fout!","Use generated code":"Gebruik gegenereerde code","User function":"Gebruikersfunctie","User:":"Gebruiker:",Value:yG,"Vibration:":"Trilling:",Volume:_G,We:wG,Wednesday:kG,"Whatsapp-cmb":"Whatsapp-cmb",Write:CG,"Write your own code":"Schrijf je eigen code",Yes:TG,"Yet exists!":"Toch bestaat!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"U kunt %s in de URL gebruiken om de huidige triggerwaarde te gebruiken, %id om de geactiveerde object-ID te gebruiken, %name om de geactiveerde object-ID-naam te tonen of %old om de oude triggerwaarde te gebruiken","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"U kunt %s in de opdracht gebruiken om de huidige triggerwaarde te gebruiken, %id om de getriggerde object-ID te gebruiken, %name om de getriggerde object-ID-naam te tonen of %old om de oude triggerwaarde te gebruiken","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"U kunt %s in de tekst gebruiken om de huidige triggerwaarde weer te geven, %id om de geactiveerde object-ID te gebruiken, %name om de geactiveerde object-ID-naam weer te geven of %old om de oude triggerwaarde te gebruiken","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"U kunt %s in de waarde gebruiken om de huidige triggerwaarde te gebruiken, %id om de geactiveerde object-ID te gebruiken, %name om de geactiveerde object-ID-naam te tonen of %old om de oude triggerwaarde te gebruiken","You have to enter OpenAI API key in the configuration of javascript adapter.":"U moet de OpenAI API-sleutel invoeren in de configuratie van de javascript-adapter.","You have to enter at least one API key in the configuration of javascript adapter.":"U moet ten minste één API-sleutel (OpenAI, Anthropic of Gemini) invoeren in de configuratie van de javascript-adapter.","Please select a valid model":"Selecteer een geldig model","[equal]":"[Gelijk]","[greater or equal]":"[groter of gelijk]","[greater]":"[groter]","[hysteresis]":"[hysterese]","[includes]":"[inclusief]","[less or equal]":"[minder of gelijk]","[less]":"[minder]","[not equal]":"[niet gelijk]",acknowledgment:SG,all:EG,and:IG,"as JSON":"als JSON","as plain text":"als platte tekst",astro:xG,at:DG,"clear running":"duidelijk rennen",control:AG,copy:OG,cron:RG,dawn:NG,debug_help:MG,debug_label:LG,default:"standaard",dusk:PG,easy:BG,else:"anders","equal to":"gelijk aan",every:FG,"every hour at 0 minutes":"elk uur op 0 minuten",false:"false","file reading has failed: %s":"bestands lezen is mislukt: %s","file reading was aborted":"bestands lezen is afgebroken",filter_func:jG,filter_id:zG,filter_name:UG,filter_role:HG,filter_room:WG,"for edit or create script":"voor bewerken of een nieuw script maken","for professionals":"voor professionals","for programmers":"voor programmeurs",goldenHour:GG,goldenHourEnd:VG,"greater or equal":"groter of gelijk","greater or equal to":"groter of gelijk aan","greater than":"groter dan",help_just_check:KG,help_on_change:YG,"high priority":"hoge prioriteit","high-priority":"hoge prioriteit","highest priority":"hoogste prioriteit",hours:JG,includes:qG,interval:XG,"just check":"kijk maar","less or equal":"minder of gelijk","less or equal to":"minder of gelijk aan","less than":"minder dan","lower priority":"lagere prioriteit","lowest priority":"laagste prioriteit",magic:ZG,milliseconds:QG,minutes:eV,ms:tV,nadir:sV,nauticalDawn:oV,nauticalDusk:iV,nextSunrise:nV,nextSunset:rV,night:aV,nightEnd:lV,"no blocks found":"Geen blokken gevonden","no group":"GEEN GROEP",normal:cV,"normal priority":"normale prioriteit","not running":"niet actief","not equal to":"niet gelijk aan","not properly connected":"Dit blok is niet correct verbonden met andere blokken.",offset:uV,"on change":"bij verandering","on condition change":"op voorwaarde verandering","on update":"bij update",one:dV,or:hV,quiet:pV,"reset search":"reset zoeken",search:gV,seconds:mV,solarNoon:fV,"store in":"opslaan in",sunrise:$V,sunriseEnd:bV,sunset:vV,sunsetStart:yV,then:_V,"toggle value":"schakelwaarde",tooltip_ack:wV,tooltip_from:kV,tooltip_lc:CV,tooltip_quality:TV,tooltip_ts:SV,tooltip_user:EV,tooltip_value:IV,true:"waar",two:xV,undefined:"ongedefinieerd",update:DV,"use seconds":"gebruik seconden","use trigger value":"triggerwaarde gebruiken",verbose_help:AV,verbose_label:OV,when:RV,with:"met","with date":"met datum","with offset":"met offset",wizard:NV,"Loading models...":"Modellen laden...","Could not connect to API at %s":"Kan geen verbinding maken met API op %s","Invalid API key":"Ongeldige API-sleutel","Access denied by API":"Toegang geweigerd door API","API error: %s":"API-fout: %s",'Model "%s" not found':'Model "%s" niet gevonden',"Request failed: %s":"Verzoek mislukt: %s",Retry:MV,"No running javascript instance found":"Geen draaiende JavaScript-instantie gevonden"},PV="Potwierdzony",BV="Działania",FV="Dodaj",jV="Wszystko",zV="Każdy",UV="Zastosuj",HV="Kwiecień",WV="Zapytać",GV="Astronomiczny",VV="Sierpień",KV="Odwołaj",YV="Zamknij",JV="Stan",qV="Warunki",XV="Konsola",ZV="Skopiowano",QV="Grudzień",e4="Domyślna",t4="Opóźnienie",s4="Usuń",o4="Opis",i4="Gotowe",n4="Uruchom shell",r4="Wyjaśnienie",a4="Eksport",l4="Luty",c4="Luty",u4="Filtr",d4="Folder",h4="Pt",p4="Piątek",g4="ID",m4="ID1",f4="ID2",$4="Import",b4="Instancja",v4="Instancje",y4="Instrukcje",_4="Styczeń",w4="Styczeń",k4="Lipiec",C4="Czerwiec",T4="Limit",S4="Marzec",E4="Maj",I4="Menu",x4="Wiadomość",D4="Po",A4="Model",O4="Poniedziałek",R4="Miesiąc",N4="Więcej",M4="Nazwa",L4="Listopad",P4="OK",B4="Październik",F4="Ok",j4="Pauza",z4="Pushover",U4="Pushsafer",H4="Przemianuj",W4="Powtórz",G4="Uruchom ponownie",V4="Wynik",K4="So",Y4="Sobota",J4="Zapisz",q4="Harmonogram",X4="Skrypt",Z4="Wrzesień",Q4="Symulacja",e8="Stos",t8="Początek",s8="Stan",o8="Nd",i8="Niedziela",n8="Telegram",r8="Cz",a8="Czwartek",l8="Czas",c8="Wyzwolony",u8="Wyzwalacze",d8="Wt",h8="Wtorek",p8="URL",g8="Wartość",m8="Wolumen",f8="Śr",$8="Środa",b8="Pisać",v8="Tak",y8="potwierdzenie",_8="wszystko",w8="i",k8="Astro",C8="w",T8="kontrola",S8="Kopiuj",E8="CRON",I8="Świt",x8="Jest to specjalny tryb, w którym stany i obiekty się nie zmieniają. Jednak w protokole będą wyświetlane tylko informacje o każdej planowanej zmianie.",D8="Odpluskwić",A8="Zmierzch",O8="łatwy",R8="każdy",N8="Funkcja",M8="ID",L8="Nazwa",P8="Rola",B8="Pokój",F8="Złota godzina",j8="Koniec złotej godziny",z8="Kod zostanie wykonany tylko za każdym razem, gdy warunek będzie spełniony. Na przykład. jeśli wyzwalanie na wartość czujnika temperatury i warunek to „jeśli temperatura jest wyższa niż 20 ° C”, to działania „następnie” będą wykonywane za każdym razem, gdy czujnik wyśle temperaturę i jest powyżej 20 ° C. O 21 ° C, o 22 ° C i tak dalej.",U8="Kod zostanie wykonany tylko wtedy, gdy wynik warunku ulegnie zmianie. Na przykład. jeśli wyzwalanie na wartość czujnika temperatury i warunek „jeśli temperatura jest wyższa niż 20 ° C”, to akcje „następnie” zostaną wykonane raz, gdy temperatura przekroczy 20. Następnym razem działania „następnie” zostaną wykonane, gdy temperatura nie udaje się poniżej 20, a następnie ponownie wzrasta powyżej 20.",H8="godziny",W8="zawiera",G8="interwał",V8="magia",K8="milisekund",Y8="minuty",J8="ms",q8="Północ słoneczna",X8="Żeglarski świt",Z8="Żeglarski zmierzch",Q8="Następny wschód słońca",e6="Następny zachód słońca",t6="Noc",s6="Koniec nocy",o6="normalny",i6="przesunięcie",n6="jeden",r6="lub",a6="cisza",l6="Szukaj",c6="sekundy",u6="Południe słoneczne",d6="Wschód słońca",h6="Koniec wschodu słońca",p6="Zachód słońca",g6="Początek zachodu słońca",m6="następnie",f6="Akceptuj",$6="Od",b6="Ostatnia zmiana",v6="Jakość",y6="Znacznik czasu",_6="Użytkownik",w6="Wartość",k6="dwa",C6="aktualizacja",T6="Dodaje wyniki debugowania do dziennika dla wielu poleceń systemowych",S6="Pełne dane wyjściowe dziennika",E6="gdy",I6="Wizard",x6="Ponów próbę",D6={"%s not found":"%s nie znaleziono","()":"()","(at %s)":"(w %s)","(optional)":"(opcjonalny)","-":"-",".":".","AI code generator":"Generator kodu AI",Ack:PV,Actions:BV,"Actual time of day":"Aktualna pora dnia",Add:FV,"Add new script":"Dodaj nowy skrypt",All:jV,"All files will be accepted":"Wszystkie pliki zostaną zaakceptowane",Any:zV,"Any month":"Dowolny miesiąc",Apply:UV,April:HV,"Are you sure?":"Jesteś pewny?",Ask:WV,Astronomical:GV,"Astronomical events today":"Wydarzenia astronomiczne dzisiaj",August:VV,"Blockly description":"Tworzenie reguł za pomocą bloków graficznych","Body:":"Treść:",Cancel:KV,"Cannot delete non empty item!":"Nie można usunąć niepustego elementu!","Change layout":"Zmiana układu",'Change theme (actual "%s")':"Zmień motyw (obecnie - „%s”)","Check blocks":"Sprawdź bloki","Check is not active, because javascript adapter is disabled":"Sprawdzanie nie jest aktywne, ponieważ adapter Javascript jest wyłączony","Clear search input":"Wyczyść dane wyszukiwania","Click on this icon":"Kliknij tę ikonę",Close:YV,"Close all but current":"Zamknij wszystkie oprócz bieżących","Collapse all":"Zwinąć wszystkie","Compares current time with astronomical event":"Porównuje aktualny czas z wydarzeniem astronomicznym","Compares current time with the user specific time":"Porównuje aktualny czas z czasem określonym przez użytkownika","Compares the state value with user defined value":"Porównuje wartość stanu z wartością zdefiniowaną przez użytkownika",Condition:JV,Conditions:qV,"Configuration not saved.":"Konfiguracja nie została zapisana.",Console:XV,"Control or update some state":"Kontroluj lub aktualizuj stan","Control or update some state with delay":"Kontroluj lub aktualizuj jakiś stan z opóźnieniem","Convert blockly to javascript for ever.":"Bezpowrotna konwersja Blockly na Javascript.",Copied:ZV,"Copy script":"Skopiuj skrypt","Copy to clipboard":"Skopiuj do schowka","Create new":"Utwórz nowy","Create new folder":"Utwórz nowy folder","Create new script":"Utwórz nowy skrypt","Create or edit CRON or time wizard":"Utwórz lub edytuj CRON lub kreator czasu","Dark Theme":"Ciemny schemat","Dark style":"Ciemny styl",Date:"Data","Debug instance":"Debuguj instancję","Debug options":"Opcje debugowania",December:QV,Default:e4,"Define cron...":"Zdefiniuj CRON ...","Define schedule...":"Zdefiniuj harmonogram ...",Delay:t4,Delete:s4,"Delete %s":"Usuń %s ...","Delete folder":"Usuń folder","Delete script":"Usuń skrypt",Description:o4,"Deselect all":"Odznacz wszystkie","Discard changes for %s":"Odrzuć zmiany dla %s",Done:i4,"Double click to write value":"Kliknij dwukrotnie, aby zapisać wartość","Download as file":"Download jako plik plik","Drop some files here or click...":"Upuść niektóre pliki tutaj lub kliknij ...","Duplicate name":"Duplikat nazwy","Edit script or just double click":"Edytuj skrypt lub po prostu kliknij dwukrotnie","Empty name is not allowed":"Pusta nazwa jest niedozwolona","End search mode":"Zakończ tryb wyszukiwania","Enter your question":"Wpisz swoją prośbę",Error:"Błąd","Error formatting code":"Błąd formatowania kodu","Error was found":"Błąd został znaleziony","Every day":"Codziennie",Exec:n4,"Executes some shell command":"Wykonuje polecenie powłoki","Existing scripts will be overwritten.":"Istniejące skrypty zostaną zastąpione.","Expand all":"Rozwiń wszystkie","Expert mode":"Tryb ekspercki",Explanation:r4,Export:a4,"Export all scripts":"Wyeksportuj wszystkie skrypty","Export blocks":"Eksportuj bloki","Export selected blocks":"Eksportuj wybrane bloki",Februar:l4,February:c4,Filter:u4,Folder:d4,Fr:h4,Friday:p4,Function:"Funkcja","Function editor":"Edytor funkcji","Function: executed":"Funkcja: wykonywana","Go to next line":"Przejdź do następnej linii","HTTP Call":"Połączenie HTTP","Hide logs":"Ukryj dzienniki",ID:g4,ID1:m4,ID2:f4,Import:$4,"Import blocks":"Importuj bloki","Import error":"Błąd importowania","Import scripts":"Importuj skrypty","Insert object ID":"Wstaw identyfikator obiektu",Instance:b4,"Instance is disabled":"Instancja jest wyłączona","Instance:":"Instancja:",Instances:v4,Instructions:y4,"Invalid CRON":"Nieprawidłowy CRON","It will not be possible to revert this operation.":"Cofnięcie tej operacji nie będzie możliwe.","JS description":"Tworzenie reguł w Javascript",Januar:_4,January:w4,July:k4,June:C4,"Just check":"Po prostu sprawdź","Language:":"Język:","Learn More":"Ucz się więcej","Light style":"Lekki styl",Limit:T4,"Local time":"Czas lokalny","Locate file":"Znajdź plik","Log outputs":"Log dziennika","Log text":"Tekst dziennika","Log: %s":"Dziennik: %s","Make a HTTP get request":"Złóż żądanie HTTP get","Make a pause between actions":"Zrób przerwę między czynnościami",March:S4,"March ":"Marzec ",May:E4,Menu:I4,Message:x4,Mo:D4,Model:A4,Monday:O4,Month:R4,More:N4,Name:M4,"No API key found":"Nie znaleziono klucza API","No Chat GPT Key found":"Nie znaleziono klucza GPT czatu","No active host found":"Nie znaleziono aktywnego hosta","Nothing found":"Nic nie znaleziono",November:L4,OK:P4,October:B4,Ok:F4,"On condition change":"W przypadku zmiany warunków","On script save or adapter start":"Podczas zapisywania skryptu lub uruchamiania adaptera","On weekdays":"W dni powszednie","Open configuration":"Otwarta konfiguracja","Operate two states":"Obsługuj dwa stany","Operations with two states":"Operacje z dwoma stanami","Paste your blocks here":"Wklej tutaj swoje bloki",Pause:j4,"Pause execution":"Wstrzymaj wykonanie","Pause script":"Wstrzymaj skrypt","Phone:":"Telefon:","Please select object ID...":"Wybierz identyfikator obiektu ...","Press Ctrl+Enter to get the answer":"Naciśnij klawisze Ctrl+Enter, aby uzyskać odpowiedź","Prettify the script":"Upiększ skrypt","Print some text in log":"Wydrukuj tekst w dzienniku","Priority:":"Priorytet:",Pushover:z4,Pushsafer:U4,"Read only ID selected: %s":"Wybrano identyfikator tylko do odczytu: %s",Rename:H4,"Reorder scripts in folders":"Zmień kolejność skryptów w folderach",Repeat:W4,Restart:G4,Result:V4,"Resume execution":"Wznów wykonanie","Root folder":"Folder główny","Rules description":"Twórz reguły z blokami IF, THEN, ELSE","Run script":"Uruchom skrypt",Sa:K4,Saturday:Y4,Save:J4,"Save all":"Zapisz wszystko","Say It":"Wypowiedz","Say some text via sayit adapter":"Powiedz tekst przez adapter sayit",Schedule:q4,Script:X4,"Script %s was modified on disk":"Skrypt %s został zmodyfikowany na dysku","Script is not running":"Skrypt nie działa","Search in scripts":"Szukaj w skryptach","Search...":"Szukaj...","Select all":"Zaznacz wszystko","Send email":"Wysłać email","Sends an email":"Wysyła e-mail","Sends message via Pushsafer":"Wysyła wiadomość przez Pushsafer","Sends message via pushover":"Wysyła wiadomość przez pushover","Sends message via telegram":"Wysyła wiadomość telegramem","Sends message via whatsapp-cmb":"Wysyła wiadomość przez WhatsApp-cmb",September:Z4,"Server time":"Czas serwera","Set state action":"Ustaw stan działania","Set with delay":"Ustaw z opóźnieniem","Shell command":"Polecenie powłoki","Show astronomical events":"Pokaż wydarzenia astronomiczne","Show javascript code":"Pokaż kod JavaScript","Show logs":"Pokaż dzienniki","Show only paused scripts":"Pokaż tylko wstrzymane skrypty","Show only running scripts":"Pokaż tylko działające skrypty","Show only scripts with problems":"Pokaż tylko skrypty z problemami",Simulate:Q4,"Some files will be rejected":"Niektóre pliki zostaną odrzucone","Sound:":"Dźwięk:",Stack:e8,Start:t8,"Start script":"Uruchom skrypt",State:s8,"State condition":"Warunek stanu","Step into function":"Wejdź do funkcji","Step out from function":"Wyjdź z funkcji","Stop on exception":"Zatrzymaj się na wyjątku",Su:o8,"Subject:":"Temat:",Sunday:i8,"TS description":"Tworzenie reguł w Typescript",Telegram:n8,"Text:":"Tekst:",Th:r8,"The script will be stopped and must be activated manually after debugging. Continue?":"Skrypt zostanie zatrzymany i należy go aktywować ręcznie po debugowaniu. Kontyntynuj?","This is advances option. You can write your own code here and it will be executed on trigger":"To jest opcja zaawansowana. Możesz tutaj napisać własny kod, który zostanie wykonany po wyzwoleniu",Thursday:a8,Time:l8,"Time condition":"Warunek czasowy","Title:":"Tytuł:","To:":"Do:","Trigger with value":"Wyzwalacz z wartością",Triggered:c8,Triggers:u8,"Triggers the on script saving or the javascript instance restart":"Uruchamia zapisywanie skryptu lub restart instancji javascript","Triggers the rule on update or change of some state":"Uruchamia regułę przy aktualizacji lub zmianie jakiegoś stanu","Triggers the rule periodically or on some specific time":"Uruchamia regułę okresowo lub w określonym czasie",Tu:d8,Tuesday:h8,URL:p8,"Unknown error":"Nieznany błąd","Unknown error!":"Nieznany błąd!","Use generated code":"Użyj wygenerowanego kodu","User function":"Funkcja użytkownika","User:":"Użytkownik:",Value:g8,"Vibration:":"Wibracja:",Volume:m8,We:f8,Wednesday:$8,"Whatsapp-cmb":"Whatsapp-cmb",Write:b8,"Write your own code":"Napisz swój własny kod",Yes:v8,"Yet exists!":"A jednak istnieje!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Możesz użyć %s w adresie URL, aby użyć bieżącej wartości wyzwalacza, %id, aby użyć wyzwalanego identyfikatora obiektu, %name, aby wyświetlić nazwę identyfikatora wyzwalanego obiektu, lub %old, aby użyć starej wartości wyzwalacza","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Możesz użyć %s w poleceniu, aby użyć bieżącej wartości wyzwalającej, %id, aby użyć identyfikatora wyzwalanego obiektu, %name, aby wyświetlić nazwę identyfikatora wyzwalanego obiektu, lub %old, aby użyć starej wartości wyzwalającej","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Możesz użyć %s w tekście, aby wyświetlić aktualną wartość wyzwalającą, %id, aby użyć identyfikatora wyzwolonego obiektu, %name, aby wyświetlić nazwę identyfikatora wyzwolonego obiektu lub %old, aby użyć starej wartości wyzwalającej","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Możesz użyć %s w wartości, aby użyć bieżącej wartości wyzwalacza, %id, aby użyć identyfikatora wyzwalanego obiektu, %name, aby wyświetlić nazwę identyfikatora wyzwalanego obiektu, lub %old, aby użyć starej wartości wyzwalacza","You have to enter OpenAI API key in the configuration of javascript adapter.":"Należy wprowadzić klucz OpenAI API w konfiguracji adaptera javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Musisz wprowadzić co najmniej jeden klucz API (OpenAI, Anthropic lub Gemini) w konfiguracji adaptera javascript.","Please select a valid model":"Wybierz prawidłowy model","[equal]":"[równy]","[greater or equal]":"[większe lub równe]","[greater]":"[większe]","[hysteresis]":"[histereza]","[includes]":"[obejmuje]","[less or equal]":"[mniejsze lub równe]","[less]":"[mniejsze]","[not equal]":"[nie równe]",acknowledgment:y8,all:_8,and:w8,"as JSON":"jako JSON","as plain text":"jako zwykły tekst",astro:k8,at:C8,"clear running":"czyste uruchomienie",control:T8,copy:S8,cron:E8,dawn:I8,debug_help:x8,debug_label:D8,default:"domyślna",dusk:A8,easy:O8,else:"inaczej","equal to":"równy",every:R8,"every hour at 0 minutes":"co godzinę po 0 minutach",false:"fałsz","file reading has failed: %s":"odczyt pliku nie powiódł się: %s","file reading was aborted":"odczyt pliku został przerwany",filter_func:N8,filter_id:M8,filter_name:L8,filter_role:P8,filter_room:B8,"for edit or create script":"do edycji lub utwórz nowy skrypt","for professionals":"dla profesjonalistów","for programmers":"dla programistów",goldenHour:F8,goldenHourEnd:j8,"greater or equal":"większe lub równe","greater or equal to":"więcej lub równo","greater than":"więcej niż",help_just_check:z8,help_on_change:U8,"high priority":"wysoki priorytet","high-priority":"wysoki priorytet","highest priority":"najwyższy priorytet",hours:H8,includes:W8,interval:G8,"just check":"po prostu sprawdź","less or equal":"mniejsze lub równe","less or equal to":"mniej lub równo","less than":"mniej niż","lower priority":"niższy priorytet","lowest priority":"najniższy priorytet",magic:V8,milliseconds:K8,minutes:Y8,ms:J8,nadir:q8,nauticalDawn:X8,nauticalDusk:Z8,nextSunrise:Q8,nextSunset:e6,night:t6,nightEnd:s6,"no blocks found":"Nie znaleziono bloków","no group":"BRAK GRUPY",normal:o6,"normal priority":"normalny priorytet","not running":"nie uruchomiony","not equal to":"nie równa się","not properly connected":"Ten blok nie jest poprawnie podłączony do innych bloków.",offset:i6,"on change":"na zmianę","on condition change":"pod warunkiem zmiany warunków","on update":"po aktualizacji",one:n6,or:r6,quiet:a6,"reset search":"zresetuj wyszukiwanie",search:l6,seconds:c6,solarNoon:u6,"store in":"przechowaj w",sunrise:d6,sunriseEnd:h6,sunset:p6,sunsetStart:g6,then:m6,"toggle value":"wartość przełączania",tooltip_ack:f6,tooltip_from:$6,tooltip_lc:b6,tooltip_quality:v6,tooltip_ts:y6,tooltip_user:_6,tooltip_value:w6,true:"prawda",two:k6,undefined:"nieokreślony",update:C6,"use seconds":"użyj sekund","use trigger value":"użyj wartości wyzwalającej",verbose_help:T6,verbose_label:S6,when:E6,with:"z","with date":"z datą","with offset":"z przesunięciem",wizard:I6,"Loading models...":"Ładowanie modeli...","Could not connect to API at %s":"Nie można połączyć się z API pod adresem %s","Invalid API key":"Nieprawidłowy klucz API","Access denied by API":"Odmowa dostępu przez API","API error: %s":"Błąd API: %s",'Model "%s" not found':'Model "%s" nie znaleziony',"Request failed: %s":"Żądanie nie powiodło się: %s",Retry:x6,"No running javascript instance found":"Nie znaleziono uruchomionej instancji JavaScript"},A6="Reconhecido",O6="Ações",R6="Adicionar",N6="Todos",M6="Nenhum",L6="Aplique",P6="abril",B6="Perguntar",F6="Astronômico",j6="agosto",z6="Cancelar",U6="Fechar",H6="Doença",W6="Condições",G6="Console",V6="Copiado",K6="dezembro",Y6="Predefinição",J6="Atraso",q6="Deletar",X6="Descrição",Z6="Pronto",Q6="Exec shell",e9="Explicação",t9="Exportação",s9="Februar",o9="fevereiro",i9="Filtro",n9="Pasta",r9="Fr",a9="Sexta-feira",l9="ID",c9="ID1",u9="ID2",d9="Importar",h9="Instância",p9="Instâncias",g9="Instruções",m9="Januar",f9="janeiro",$9="julho",b9="junho",v9="Limite",y9="março",_9="maio",w9="Menu",k9="mensagem",C9="Mo",T9="Modelo",S9="Segunda-feira",E9="Mês",I9="Mais",x9="Nome",D9="novembro",A9="OK",O9="outubro",R9="Ok",N9="Pausa",M9="Pushover",L9="Pushsafer",P9="Renomear",B9="Repetir",F9="Reiniciar",j9="Resultado",z9="Sá",U9="Sábado",H9="Salve",W9="Cronograma",G9="Script",V9="setembro",K9="Simular",Y9="Pilha",J9="Começar",q9="Estado",X9="Su",Z9="Domingo",Q9="Telegrama",eK="4",tK="Quinta-feira",sK="Tempo",oK="Provocado",iK="Gatilhos",nK="Tu",rK="terça",aK="URL",lK="Valor",cK="Volume",uK="3",dK="quarta",hK="Escrever",pK="sim",gK="reconhecimento",mK="todos",fK="e",$K="astro",bK="no",vK="ao controle",yK="copiar",_K="CRON",wK="alvorecer",kK="Este é um modo especial no qual estados e objetos não serão alterados. Mas apenas as informações sobre cada mudança planejada serão exibidas no protocolo.",CK="Depurar",TK="Crepúsculo",SK="fácil",EK="cada",IK="Função",xK="ID",DK="Nome",AK="Tipo",OK="Quarto",RK="Hora dourada",NK="Fim da hora de ouro",MK='O código será executado apenas sempre que a condição for verdadeira. Por exemplo. se disparar no valor do sensor de temperatura e a condição for "se a temperatura for maior que 20 ° C", as ações "então" serão executadas toda vez que o sensor enviar a temperatura e ela estiver acima de 20 ° C. Por 21 ° C, por 22 ° C e assim por diante.',LK='O código será executado apenas se o resultado da condição mudar. Por exemplo. se disparar no valor do sensor de temperatura e a condição for "se a temperatura for maior que 20 ° C", as ações "então" serão executadas uma vez quando a temperatura estiver acima de 20. Na próxima vez, as ações "então" serão executadas quando a temperatura falha abaixo de 20 e sobe acima de 20 novamente.',PK="horas",BK="inclui",FK="intervalo",jK="Magia",zK="milissegundos",UK="minutos",HK="ms",WK="nadir",GK="Madrugada náutica",VK="Crepúsculo náutico",KK="próximo nascer do sol",YK="Próximo pôr do sol",JK="Noite",qK="Fim de noite",XK="normal",ZK="Deslocamento",QK="1",e7="ou",t7="quieto",s7="procurar",o7="segundos",i7="Meio-dia solar",n7="nascer do sol",r7="Fim do nascer do sol",a7="pôr do sol",l7="Começo do pôr do sol",c7="então",u7="reconhecer",d7="de",h7="Última alteração",p7="Qualidade",g7="timestamp",m7="usuário",f7="valor",$7="dois",b7="atualizar",v7="Adiciona saída de depuração ao log para muitos comandos do sistema",y7="Saídas de log detalhadas",_7="quando",w7="Wizard",k7="Tentar novamente",C7={"%s not found":"%s não encontrado","()":"()","(at %s)":"(em %s)","(optional)":"(opcional)","-":"-",".":".","AI code generator":"Gerador de código de IA",Ack:A6,Actions:O6,"Actual time of day":"Hora real do dia",Add:R6,"Add new script":"Adicionar novo script",All:N6,"All files will be accepted":"Todos os arquivos serão aceitos",Any:M6,"Any month":"Qualquer mês",Apply:L6,April:P6,"Are you sure?":"Você tem certeza?",Ask:B6,Astronomical:F6,"Astronomical events today":"Eventos astronômicos hoje",August:j6,"Blockly description":"Criando regras por blocos gráficos","Body:":"Corpo:",Cancel:z6,"Cannot delete non empty item!":"Não pode ser deletar, porque não está vazio!","Change layout":"Alterar layout",'Change theme (actual "%s")':'Alterar tema (agora - "%s")',"Check blocks":"Verificar blocos","Check is not active, because javascript adapter is disabled":"A verificação de sintaxe não está ativa porque o adaptador javascript não está rodando.","Clear search input":"Limpar entrada de pesquisa","Click on this icon":"Clique neste ícone",Close:U6,"Close all but current":"Fechar tudo, menos atual","Collapse all":"Recolher todos","Compares current time with astronomical event":"Compara o tempo atual com o evento astronômico","Compares current time with the user specific time":"Compara a hora atual com a hora específica do usuário","Compares the state value with user defined value":"Compara o valor do estado com o valor definido pelo usuário",Condition:H6,Conditions:W6,"Configuration not saved.":"Configuração não esta salva.",Console:G6,"Control or update some state":"Controlar ou atualizar algum estado","Control or update some state with delay":"Controlar ou atualizar algum estado com atraso","Convert blockly to javascript for ever.":"Converter Blockly em Javascript permanentemente.",Copied:V6,"Copy script":"Copiar script","Copy to clipboard":"Copiar para área de transferência","Create new":"Crie um novo","Create new folder":"Criar nova pasta","Create new script":"Criar novo script","Create or edit CRON or time wizard":"Criar ou editar o assistente cron ou o assistente de horário","Dark Theme":"Layout escuro","Dark style":"Estilo escuro",Date:"Encontro","Debug instance":"Instância de depuração","Debug options":"Opções de depuração",December:K6,Default:Y6,"Define cron...":"Definir cron...","Define schedule...":"Definir agendamento ...",Delay:J6,Delete:q6,"Delete %s":"Deletar %s...","Delete folder":"Deletar pasta","Delete script":"Deletar script",Description:X6,"Deselect all":"Desmarcar todos","Discard changes for %s":"Descartar alterações para %s",Done:Z6,"Double click to write value":"Clique duas vezes para escrever o valor","Download as file":"Baixar como arquivo","Drop some files here or click...":"Solte alguns arquivos aqui ou clique em...","Duplicate name":"Nome duplicado","Edit script or just double click":"Edite o script ou clique duas vezes","Empty name is not allowed":"Nome vazio não é permitido","End search mode":"Finalizar modo de pesquisa","Enter your question":"Digite sua solicitação",Error:"Erro","Error formatting code":"Erro de formatação de código","Error was found":"Erro foi encontrado","Every day":"Todos os dias",Exec:Q6,"Executes some shell command":"Executa algum comando shell","Existing scripts will be overwritten.":"Os scripts existentes serão substituídos.","Expand all":"Expandir todos","Expert mode":"Modo de especialista",Explanation:e9,Export:t9,"Export all scripts":"Exportar todos os scripts","Export blocks":"Exportar blocos","Export selected blocks":"Exportar blocos selecionados",Februar:s9,February:o9,Filter:i9,Folder:n9,Fr:r9,Friday:a9,Function:"Função","Function editor":"Editor de funções","Function: executed":"Função: executado","Go to next line":"Vá para a próxima linha","HTTP Call":"Chamada HTTP","Hide logs":"Ocultar logs",ID:l9,ID1:c9,ID2:u9,Import:d9,"Import blocks":"Importar blocos","Import error":"Erro de importação","Import scripts":"Importar script","Insert object ID":"Inserir ID do objeto",Instance:h9,"Instance is disabled":"Instância está desativada","Instance:":"Instância:",Instances:p9,Instructions:g9,"Invalid CRON":"CRON inválido","It will not be possible to revert this operation.":"Não será possível reverter esta operação.","JS description":"Criando regras escrevendo Javascript",Januar:m9,January:f9,July:$9,June:b9,"Just check":"Apenas verifique","Language:":"Língua:","Learn More":"Aprender mais","Light style":"Estilo claro",Limit:v9,"Local time":"Hora local","Locate file":"Localize o arquivo","Log outputs":"Saídas de log","Log text":"Texto de registro","Log: %s":"Log: %s","Make a HTTP get request":"Faça uma solicitação HTTP get","Make a pause between actions":"Faça uma pausa entre as ações",March:y9,"March ":"Março",May:_9,Menu:w9,Message:k9,Mo:C9,Model:T9,Monday:S9,Month:E9,More:I9,Name:x9,"No API key found":"Nenhuma chave API encontrada","No Chat GPT Key found":"Nenhuma chave GPT de bate-papo encontrada","No active host found":"Nenhum host ativo encontrado","Nothing found":"Nada encontrado",November:D9,OK:A9,October:O9,Ok:R9,"On condition change":"Na mudança de condição","On script save or adapter start":"Ao salvar o script ou iniciar o adaptador","On weekdays":"Nos dias úteis","Open configuration":"Configuração aberta","Operate two states":"Operar dois estados","Operations with two states":"Operações com dois estados","Paste your blocks here":"Cole seus blocos aqui",Pause:N9,"Pause execution":"Pausar a execução","Pause script":"Pausar script","Phone:":"Telefone:","Please select object ID...":"Selecione o ID do objeto...","Press Ctrl+Enter to get the answer":"Pressione Ctrl+Enter para obter a resposta","Prettify the script":"Embeleze o roteiro","Print some text in log":"Imprimir algum texto no log","Priority:":"Prioridade:",Pushover:M9,Pushsafer:L9,"Read only ID selected: %s":"ID somente leitura selecionada: %s",Rename:P9,"Reorder scripts in folders":"Reordenar scripts em pastas",Repeat:B9,Restart:F9,Result:j9,"Resume execution":"Retomar execução","Root folder":"Pasta principal","Rules description":"Crie regras com blocos IF, THEN, ELSE","Run script":"Executar script",Sa:z9,Saturday:U9,Save:H9,"Save all":"Salvar tudo","Say It":"Say It","Say some text via sayit adapter":"Diga algum texto através do adaptador sayit",Schedule:W9,Script:G9,"Script %s was modified on disk":'O script "%s" foi modificado no disco rígido',"Script is not running":"Script não está sendo executado","Search in scripts":"Pesquisa em scripts","Search...":"Procurar...","Select all":"Selecionar tudo","Send email":"Enviar email","Sends an email":"Envia um email","Sends message via Pushsafer":"Envia mensagem via Pushsafer","Sends message via pushover":"Envia mensagem via pushover","Sends message via telegram":"Envia mensagem via telegrama","Sends message via whatsapp-cmb":"Envia mensagem via whatsapp-cmb",September:V9,"Server time":"Tempo de servidor","Set state action":"Definir ação de estado","Set with delay":"Definido com atraso","Shell command":"Comando shell","Show astronomical events":"Mostrar eventos astronômicos","Show javascript code":"Mostrar código Javascript","Show logs":"Mostrar logs","Show only paused scripts":"Mostrar apenas scripts pausados","Show only running scripts":"Mostrar apenas scripts em execução","Show only scripts with problems":"Mostrar apenas scripts com problemas",Simulate:K9,"Some files will be rejected":"Alguns arquivos serão rejeitados","Sound:":"Som:",Stack:Y9,Start:J9,"Start script":"Iniciar script",State:q9,"State condition":"Condição de estado","Step into function":"Entre na função","Step out from function":"Saia da função","Stop on exception":"Pare na exceção",Su:X9,"Subject:":"Sujeito:",Sunday:Z9,"TS description":"Criando regras escrevendo Typecript",Telegram:Q9,"Text:":"Texto:",Th:eK,"The script will be stopped and must be activated manually after debugging. Continue?":"O script será interrompido e deve ser ativado manualmente após a depuração. Continuar?","This is advances option. You can write your own code here and it will be executed on trigger":"Esta é a opção de avanços. Você pode escrever seu próprio código aqui e ele será executado no gatilho",Thursday:tK,Time:sK,"Time condition":"Condição de tempo","Title:":"Título:","To:":"Para:","Trigger with value":"Trigger com valor",Triggered:oK,Triggers:iK,"Triggers the on script saving or the javascript instance restart":"Aciona o salvamento do script ou a reinicialização da instância javascript","Triggers the rule on update or change of some state":"Aciona a regra na atualização ou mudança de algum estado","Triggers the rule periodically or on some specific time":"Aciona a regra periodicamente ou em algum momento específico",Tu:nK,Tuesday:rK,URL:aK,"Unknown error":"Erro desconhecido","Unknown error!":"Erro desconhecido!","Use generated code":"Usar código gerado","User function":"Função do usuário","User:":"Do utilizador:",Value:lK,"Vibration:":"Vibração:",Volume:cK,We:uK,Wednesday:dK,"Whatsapp-cmb":"Whatsapp-cmb",Write:hK,"Write your own code":"Escreva seu próprio código",Yes:pK,"Yet exists!":"Ainda existe!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Você pode usar %s na URL para usar o valor do gatilho atual, %id para usar o ID do objeto acionado, %name para mostrar o nome do ID do objeto acionado ou %old para usar o valor do gatilho antigo","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Você pode usar %s no comando para usar o valor do acionador atual, %id para usar o ID do objeto acionado, %name para mostrar o nome do ID do objeto acionado ou %old para usar o valor do acionador antigo","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Você pode usar %s no texto para exibir o valor do acionador atual, %id para usar o ID do objeto acionado, %name para mostrar o nome do ID do objeto acionado ou %old para usar o valor do acionador antigo","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Você pode usar %s no valor para usar o valor do acionador atual, %id para usar o ID do objeto acionado, %name para mostrar o nome do ID do objeto acionado ou %old para usar o valor do acionador antigo","You have to enter OpenAI API key in the configuration of javascript adapter.":"Você deve inserir a chave da API OpenAI na configuração do adaptador javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Você deve inserir pelo menos uma chave API (OpenAI, Anthropic ou Gemini) na configuração do adaptador javascript.","Please select a valid model":"Selecione um modelo válido","[equal]":"[igual]","[greater or equal]":"[maior ou igual]","[greater]":"[maior]","[hysteresis]":"[histerese]","[includes]":"[inclui]","[less or equal]":"[menor ou igual]","[less]":"[menos]","[not equal]":"[não igual]",acknowledgment:gK,all:mK,and:fK,"as JSON":"como JSON","as plain text":"como texto simples",astro:$K,at:bK,"clear running":"corrida limpa",control:vK,copy:yK,cron:_K,dawn:wK,debug_help:kK,debug_label:CK,default:"predefinição",dusk:TK,easy:SK,else:"outro","equal to":"igual a",every:EK,"every hour at 0 minutes":"a cada hora em 0 minutos",false:"falso","file reading has failed: %s":"a leitura do arquivo falhou: %s","file reading was aborted":"a leitura do arquivo foi abortada",filter_func:IK,filter_id:xK,filter_name:DK,filter_role:AK,filter_room:OK,"for edit or create script":"para editar ou criar um novo script","for professionals":"para profissionais","for programmers":"para programadores",goldenHour:RK,goldenHourEnd:NK,"greater or equal":"maior ou igual","greater or equal to":"maior ou igual a","greater than":"Maior que",help_just_check:MK,help_on_change:LK,"high priority":"prioridade máxima","high-priority":"prioridade máxima","highest priority":"Prioridade máxima",hours:PK,includes:BK,interval:FK,"just check":"Apenas verifique","less or equal":"menor ou igual","less or equal to":"menor ou igual a","less than":"Menor que","lower priority":"prioridade mais baixa","lowest priority":"prioridade mais baixa",magic:jK,milliseconds:zK,minutes:UK,ms:HK,nadir:WK,nauticalDawn:GK,nauticalDusk:VK,nextSunrise:KK,nextSunset:YK,night:JK,nightEnd:qK,"no blocks found":"Nenhum bloco encontrado","no group":"SEM GRUPO",normal:XK,"normal priority":"prioridade normal","not running":"não está em execução","not equal to":"não é igual a","not properly connected":"Este bloco não está conectado corretamente com outros blocos.",offset:ZK,"on change":"em mudança","on condition change":"na mudança de condição","on update":"em atualização",one:QK,or:e7,quiet:t7,"reset search":"redefinir pesquisa",search:s7,seconds:o7,solarNoon:i7,"store in":"armazenar em",sunrise:n7,sunriseEnd:r7,sunset:a7,sunsetStart:l7,then:c7,"toggle value":"valor de alternância",tooltip_ack:u7,tooltip_from:d7,tooltip_lc:h7,tooltip_quality:p7,tooltip_ts:g7,tooltip_user:m7,tooltip_value:f7,true:"verdade",two:$7,undefined:"Indefinido",update:b7,"use seconds":"use segundos","use trigger value":"use o gatilho",verbose_help:v7,verbose_label:y7,when:_7,with:"com","with date":"com data","with offset":"com deslocamento",wizard:w7,"Loading models...":"Carregando modelos...","Could not connect to API at %s":"Não foi possível conectar à API em %s","Invalid API key":"Chave API inválida","Access denied by API":"Acesso negado pela API","API error: %s":"Erro de API: %s",'Model "%s" not found':'Modelo "%s" não encontrado',"Request failed: %s":"Solicitação falhou: %s",Retry:k7,"No running javascript instance found":"Nenhuma instância JavaScript em execução encontrada"},T7="Подтверждение",S7="Действия",E7="Добавить",I7="Все",x7="Любая",D7="Применить",A7="Апрель",O7="Спросить",R7="Aстрономический",N7="Август",M7="Отмена",L7="Закрыть",P7="Условие",B7="Условия",F7="Приставка",j7="Скопировано",z7="Декабрь",U7="Дефолт",H7="Задержка",W7="Удалить",G7="Описание",V7="Готово",K7="Исполнить shell",Y7="Объяснение",J7="Экспорт",q7="Февраль",X7="Февраль",Z7="Фильтр",Q7="Папка",eY="Пт",tY="пятница",sY="ID",oY="ID1",iY="ID2",nY="Импорт",rY="Экземпляр",aY="Экземпляры",lY="Инструкции",cY="Январь",uY="Январь",dY="Июль",hY="Июнь",pY="Предел",gY="Март",mY="Май",fY="Меню",$Y="Сообщение",bY="Пн",vY="Модель",yY="понедельник",_Y="Месяц",wY="Более",kY="Имя",CY="Ноябрь",TY="Ок",SY="Октябрь",EY="Ok",IY="Пауза",xY="Pushover",DY="Pushsafer",AY="Переименовать",OY="Повторение",RY="Перезапустить",NY="Результат",MY="Сб",LY="суббота",PY="Сохранить",BY="Расписание",FY="скрипт",jY="Сентябрь",zY="Симулировать",UY="Stack",HY="Начинать",WY="Состояние",GY="Вс",VY="Воскресенье",KY="Telegram",YY="Чт",JY="Четверг",qY="Время",XY="Срабатывает",ZY="Триггеры",QY="Вт",eJ="вторник",tJ="URL",sJ="Значение",oJ="Громкость",iJ="Ср",nJ="среда",rJ="Напишите",aJ="Да",lJ="подтверждение",cJ="все",uJ="и",dJ="Астро",hJ="в",pJ="контроль",gJ="копия",mJ="CRON",fJ="Рассвет",$J="Это особый режим, в котором состояния и объекты не будут меняться. Но в протоколе будет отображаться только информация о каждом планируемом изменении.",bJ="Отлаживать",vJ="Сумерки",yJ="легкий",_J="каждые(ый)",wJ="Функция",kJ="ID",CJ="Название",TJ="Роль",SJ="Комната",EJ="Золотой час",IJ="Конец золотого часа",xJ="Код будет выполняться только каждый раз, когда условие истинно. Например. при срабатывании по значению датчика температуры и условию «если температура выше 20°C», действия «затем» будут выполняться каждый раз, когда датчик отправляет значение температуры, и оно превышает 20°C. На 21°С, на 22°С и так далее.",DJ="Код будет выполнен только в случае изменения результата условия. Например, при срабатывании по значению датчика температуры и условию «если температура больше 20°C», действия «затем» будут выполнены один раз, когда температура превысит 20°C. В следующий раз действия «затем» будут выполнены, когда температура опустится ниже 20°C, а затем снова поднимается выше 20°C.",AJ="час(ов)",OJ="содержит",RJ="интервал",NJ="магия",MJ="миллисекунды",LJ="минут(у)",PJ="мс",BJ="Надир",FJ="Морской рассвет",jJ="Морские сумерки",zJ="Следующий восход",UJ="Следующий закат",HJ="Ночь",WJ="Конец ночи",GJ="нормальный",VJ="сдвиг",KJ="один",YJ="или",JJ="тихий",qJ="поиск",XJ="секунд",ZJ="Солнечный полдень",QJ="Восход солнца",eq="Конец восхода",tq="Закат солнца",sq="Начало заката",oq="тогда",iq="Подтверждено",nq="От",rq="Последнее изменение",aq="Качественный",lq="Время",cq="Пользователь",uq="Значение",dq="два",hq="обновить",pq="Добавляет вывод отладки в журнал для многих системных команд.",gq="Подробный протокол",mq="если",fq="Мастер",$q="Повторить",bq={"%s not found":"%s не найден","()":"()","(at %s)":"(в %s)","(optional)":"(необязательный)","-":"-",".":".","AI code generator":"ИИ Генератор кода",Ack:T7,Actions:S7,"Actual time of day":"Фактическое время суток",Add:E7,"Add new script":"Добавить новый скрипт",All:I7,"All files will be accepted":"Все файлы будут приняты",Any:x7,"Any month":"В любой месяц",Apply:D7,April:A7,"Are you sure?":"Вы уверены?",Ask:O7,Astronomical:R7,"Astronomical events today":"Астрономические события сегодня",August:N7,"Blockly description":"Создание правил графическими блоками","Body:":"Тело:",Cancel:M7,"Cannot delete non empty item!":"Не удается удалить непустой элемент!","Change layout":"Изменить макет",'Change theme (actual "%s")':'Сменить тему (сейчас - "%s")',"Check blocks":"Проверить блоки","Check is not active, because javascript adapter is disabled":"Проверка неактивна, потому что адаптер Javascript отключен","Clear search input":"Очистить ввод","Click on this icon":"Нажмите на этот значок",Close:L7,"Close all but current":"Закрыть все кроме текущего","Collapse all":"Свернуть все","Compares current time with astronomical event":"Сравнивает текущее время с астрономическим событием","Compares current time with the user specific time":"Сравнивает текущее время с конкретным временем пользователя","Compares the state value with user defined value":"Сравнивает значение состояния с пользовательским значением",Condition:P7,Conditions:B7,"Configuration not saved.":"Конфигурация не сохранена.",Console:F7,"Control or update some state":"Контролировать или обновлять какое-то состояние","Control or update some state with delay":"Контролировать или обновлять какое-либо состояние с задержкой","Convert blockly to javascript for ever.":"Преобразовать blockly в Javascript навсегда.",Copied:j7,"Copy script":"Скопировать скрипт","Copy to clipboard":"Скопировать в буфер обмена","Create new":"Создать новый","Create new folder":"Создать новую папку","Create new script":"Создать новый скрипт","Create or edit CRON or time wizard":"Создание или редактирование CRON или мастера времени","Dark Theme":"Тёмная тема","Dark style":"Темный стиль",Date:"Дата","Debug instance":"Экземпляр отладки","Debug options":"Варианты отладки",December:z7,Default:U7,"Define cron...":"Задать правило ...","Define schedule...":"Задать расписание...",Delay:H7,Delete:W7,"Delete %s":"Удалить %s...","Delete folder":"Удалить папку","Delete script":"Удалить скрипт",Description:G7,"Deselect all":"Снять выбор со всех","Discard changes for %s":"Отменить изменения для %s",Done:V7,"Double click to write value":"Двойной щелчок для записи значения","Download as file":"Скачать как файл","Drop some files here or click...":"Перетыщите сюда файлы или нажмите ...","Duplicate name":"Повторяющееся имя","Edit script or just double click":"Редактировать скрипт или просто дважды щелкнуть","Empty name is not allowed":"Пустое имя не допускается","End search mode":"Закончить поиск","Enter your question":"Введи свою просьбу",Error:"Ошибка","Error formatting code":"Ошибка форматирования кода","Error was found":"Ошибка была найдена","Every day":"Каждый день",Exec:K7,"Executes some shell command":"Выполняет некоторую команду оболочки","Existing scripts will be overwritten.":"Существующие скрипты будут перезаписаны.","Expand all":"Открыть все","Expert mode":"Экспертный режим",Explanation:Y7,Export:J7,"Export all scripts":"Экспорт всех скриптов","Export blocks":"Экспортировать блоки","Export selected blocks":"Экспортировать выбранные блоки",Februar:q7,February:X7,Filter:Z7,Folder:Q7,Fr:eY,Friday:tY,Function:"Функция","Function editor":"Редактор функции","Function: executed":"Функция: выполнено","Go to next line":"Перейти к следующей строке","HTTP Call":"HTTP-вызов","Hide logs":"Скрыть журналы",ID:sY,ID1:oY,ID2:iY,Import:nY,"Import blocks":"Импортировать блоки","Import error":"Ошибка импорта","Import scripts":"Импорт скриптов","Insert object ID":"Вставить ID объекта",Instance:rY,"Instance is disabled":"Экземпляр отключен","Instance:":"Пример:",Instances:aY,Instructions:lY,"Invalid CRON":"Неправильный CRON","It will not be possible to revert this operation.":"Невозможно вернуть эту операцию.","JS description":"Создание правил путём написания Javascript",Januar:cY,January:uY,July:dY,June:hY,"Just check":"Просто проверить","Language:":"Язык:","Learn More":"Узнать больше","Light style":"Светлый стиль",Limit:pY,"Local time":"Местное время","Locate file":"Показать файл в дереве","Log outputs":"Журнал","Log text":"Текст журнала","Log: %s":"Журнал: %s","Make a HTTP get request":"Сделайте HTTP-запрос на получение","Make a pause between actions":"Сделайте паузу между действиями",March:gY,"March ":"Март ",May:mY,Menu:fY,Message:$Y,Mo:bY,Model:vY,Monday:yY,Month:_Y,More:wY,Name:kY,"No API key found":"API-ключ не найден","No Chat GPT Key found":"Ключ GPT для чата не найден","No active host found":"Активный host не найден","Nothing found":"Ничего не найдено",November:CY,OK:TY,October:SY,Ok:EY,"On condition change":"При изменении реузльтата условий","On script save or adapter start":"При сохранении скрипта или запуске адаптера","On weekdays":"По дням недели","Open configuration":"Открыть настройки","Operate two states":"Операции над двумя состояниями","Operations with two states":"Операции с двумя состояниями","Paste your blocks here":"Вставьте свои блоки сюда",Pause:IY,"Pause execution":"Приостановить выполнение","Pause script":"Остановить скрипт","Phone:":"Телефон:","Please select object ID...":"Пожалуйста, выберите ID объекта ...","Press Ctrl+Enter to get the answer":"Нажмите Ctrl+Enter, чтобы получить ответ","Prettify the script":"Украсьте сценарий","Print some text in log":"Напечатать текст в журнале","Priority:":"Приоритет:",Pushover:xY,Pushsafer:DY,"Read only ID selected: %s":"Выбран идентификатор только для чтения: %s",Rename:AY,"Reorder scripts in folders":"Сортировать скрипты в папках",Repeat:OY,Restart:RY,Result:NY,"Resume execution":"Возобновить выполнение","Root folder":"Корневая папка","Rules description":"Создавайте правила с блоками ЕСЛИ, ТО, ИНАЧЕ","Run script":"Запустить скрипт",Sa:MY,Saturday:LY,Save:PY,"Save all":"Сохранить все","Say It":"Say It","Say some text via sayit adapter":"Произнесите текст через адаптер Sayit",Schedule:BY,Script:FY,"Script %s was modified on disk":'Скрипт "%s" был изменен на диске',"Script is not running":"Сценарий не запущен","Search in scripts":"Поиск в скриптах","Search...":"Поиск...","Select all":"Выбрать все","Send email":"Отправить email","Sends an email":"Отправляет электронное письмо","Sends message via Pushsafer":"Отправляет сообщение через Pushsafer","Sends message via pushover":"Отправляет сообщение через пустышку","Sends message via telegram":"Отправляет сообщение в телеграмме","Sends message via whatsapp-cmb":"Отправляет сообщение через whatsapp-cmb",September:jY,"Server time":"Время сервера","Set state action":"Установить состояние","Set with delay":"Установить с задержкой","Shell command":"Команда оболочки","Show astronomical events":"Показать астрономические события","Show javascript code":"Показать код Javascript","Show logs":"Показать журналы","Show only paused scripts":"Показывать только приостановленные сценарии","Show only running scripts":"Показывать только запущенные скрипты","Show only scripts with problems":"Показывать только скрипты с проблемами",Simulate:zY,"Some files will be rejected":"Некоторые файлы будут отклонены","Sound:":"Звук:",Stack:UY,Start:HY,"Start script":"Старт скрипта",State:WY,"State condition":"Сравнение состояния","Step into function":"Шаг в функционирование","Step out from function":"Выйти из функции","Stop on exception":"Остановить при исключении",Su:GY,"Subject:":"Предмет:",Sunday:VY,"TS description":"Создание правил путём написания Typescript",Telegram:KY,"Text:":"Текст:",Th:YY,"The script will be stopped and must be activated manually after debugging. Continue?":"Cкрипт будет остановлен и должен быть активирован вручную после отладки. Продолжать?","This is advances option. You can write your own code here and it will be executed on trigger":"Это расширеный вариант. Вы можете написать здесь свой код и он будет выполняться по триггеру",Thursday:JY,Time:qY,"Time condition":"Условие времени","Title:":"Заголовок:","To:":"К:","Trigger with value":"Триггер со значением",Triggered:XY,Triggers:ZY,"Triggers the on script saving or the javascript instance restart":"Запускает при сохранении скрипта или перезапуске экземпляра javascript","Triggers the rule on update or change of some state":"Запускает правило при обновлении или изменении какого-либо состояния","Triggers the rule periodically or on some specific time":"Срабатывает правило периодически или в определенное время",Tu:QY,Tuesday:eJ,URL:tJ,"Unknown error":"Неизвестная ошибка","Unknown error!":"Неизвестная ошибка!","Use generated code":"Использовать сгенерированный код","User function":"Функция пользователя","User:":"Пользователь:",Value:sJ,"Vibration:":"Вибрация:",Volume:oJ,We:iJ,Wednesday:nJ,"Whatsapp-cmb":"Whatsapp-cmb",Write:rJ,"Write your own code":"Напишите свой код",Yes:aJ,"Yet exists!":"Имя уже существует!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Вы можете использовать %s в URL-адресе, чтобы использовать текущее значение триггера, %id, чтобы использовать идентификатор инициированного объекта, %name, чтобы показать имя идентификатора инициированного объекта, или %old, чтобы использовать старое значение триггера.","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Вы можете использовать %s в команде, чтобы использовать текущее значение триггера, %id, чтобы использовать идентификатор сработавшего объекта, %name, чтобы показать имя сработавшего идентификатора объекта, или %old, чтобы использовать старое значение триггера.","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Вы можете использовать %s в тексте для отображения текущего значения триггера, %id для использования идентификатора сработавшего объекта, %name для отображения имени сработавшего идентификатора объекта или %old для использования старого значения триггера.","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Вы можете использовать %s в значении, чтобы использовать текущее значение триггера, %id, чтобы использовать идентификатор инициированного объекта, %name, чтобы показать имя идентификатора инициированного объекта, или %old, чтобы использовать старое значение триггера.","You have to enter OpenAI API key in the configuration of javascript adapter.":"Вы должны ввести ключ OpenAI API в конфигурации адаптера javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Необходимо ввести хотя бы один API-ключ (OpenAI, Anthropic или Gemini) в конфигурации адаптера javascript.","Please select a valid model":"Пожалуйста, выберите допустимую модель","[equal]":"[равно]","[greater or equal]":"[больше или равно]","[greater]":"[больше]","[hysteresis]":"[гистерезис]","[includes]":"[содержит]","[less or equal]":"[меньше или равно]","[less]":"[меньше]","[not equal]":"[не равно]",acknowledgment:lJ,all:cJ,and:uJ,"as JSON":"как JSON","as plain text":"как текст",astro:dJ,at:hJ,"clear running":"остановить уже бегущие",control:pJ,copy:gJ,cron:mJ,dawn:fJ,debug_help:$J,debug_label:bJ,default:"дефолт",dusk:vJ,easy:yJ,else:"иначе","equal to":"равно",every:_J,"every hour at 0 minutes":"каждый час через 0 минут",false:"false","file reading has failed: %s":"Ошибка чтения файла: %s","file reading was aborted":"Чтение файла было прервано",filter_func:wJ,filter_id:kJ,filter_name:CJ,filter_role:TJ,filter_room:SJ,"for edit or create script":"для редактирования или создайте новый скрипт","for professionals":"для профессионалов","for programmers":"для программистов",goldenHour:EJ,goldenHourEnd:IJ,"greater or equal":"больше или равно","greater or equal to":"больше или равно","greater than":"больше чем",help_just_check:xJ,help_on_change:DJ,"high priority":"высокий приоритет","high-priority":"высокий-приоритет","highest priority":"высший приоритет",hours:AJ,includes:OJ,interval:RJ,"just check":"просто проверить","less or equal":"меньше или равно","less or equal to":"меньше или равно","less than":"меньше, чем","lower priority":"более низкий приоритет","lowest priority":"самый низкий приоритет",magic:NJ,milliseconds:MJ,minutes:LJ,ms:PJ,nadir:BJ,nauticalDawn:FJ,nauticalDusk:jJ,nextSunrise:zJ,nextSunset:UJ,night:HJ,nightEnd:WJ,"no blocks found":"Блоков нет","no group":"Нет группы",normal:GJ,"normal priority":"нормальный приоритет","not running":"не запущен","not equal to":"не равно","not properly connected":"Этот блок неправильно соединён или не соединён с другими блоками.",offset:VJ,"on change":"по изменению","on condition change":"при изменении результата условия","on update":"при обновлении",one:KJ,or:YJ,quiet:JJ,"reset search":"Cбросить поиск",search:qJ,seconds:XJ,solarNoon:ZJ,"store in":"сохранить в",sunrise:QJ,sunriseEnd:eq,sunset:tq,sunsetStart:sq,then:oq,"toggle value":"инвертировать текщее значение",tooltip_ack:iq,tooltip_from:nq,tooltip_lc:rq,tooltip_quality:aq,tooltip_ts:lq,tooltip_user:cq,tooltip_value:uq,true:"true",two:dq,undefined:"неопределенный",update:hq,"use seconds":"использовать секунды","use trigger value":"использовать значение триггера",verbose_help:pq,verbose_label:gq,when:mq,with:"с","with date":"с датой","with offset":"со сдвигом",wizard:fq,"Loading models...":"Загрузка моделей...","Could not connect to API at %s":"Не удалось подключиться к API по адресу %s","Invalid API key":"Недействительный ключ API","Access denied by API":"Доступ запрещён API","API error: %s":"Ошибка API: %s",'Model "%s" not found':'Модель "%s" не найдена',"Request failed: %s":"Запрос не удался: %s",Retry:$q,"No running javascript instance found":"Не найден работающий экземпляр JavaScript"},vq="Визнано",yq="Дії",_q="додати",wq="все",kq="Будь-який",Cq="Застосувати",Tq="квітень",Sq="Запитуйте",Eq="Астрономічний",Iq="серпень",xq="Скасувати",Dq="Закрити",Aq="Хвороба",Oq="Умови",Rq="Консоль",Nq="Скопійовано",Mq="Грудень",Lq="За замовчуванням",Pq="Затримка",Bq="Видалити",Fq="опис",jq="Готово",zq="Виконавча оболонка",Uq="Пояснення",Hq="Експорт",Wq="Лютий",Gq="Лютий",Vq="фільтр",Kq="Папка",Yq="О",Jq="П'ятниця",qq="ID",Xq="ID1",Zq="ID2",Qq="Імпорт",eX="Екземпляр",tX="Примірники",sX="Інструкції",oX="січень",iX="січня",nX="липень",rX="червень",aX="Ліміт",lX="березень",cX="Може",uX="Меню",dX="повідомлення",hX="пн",pX="Модель",gX="понеділок",mX="місяць",fX="Більше",$X="Ім'я",bX="Листопад",vX="в порядку",yX="жовтень",_X="В порядку",wX="Пауза",kX="Pushover",CX="Pushsafer",TX="Перейменувати",SX="Повторіть",EX="Перезапустіть",IX="Результат",xX="Sa",DX="Субота",AX="зберегти",OX="розклад",RX="Сценарій",NX="Вересень",MX="Симулювати",LX="Стек",PX="старт",BX="Держава",FX="Нд",jX="неділя",zX="Телеграма",UX="чт",HX="четвер",WX="час",GX="Спрацьовує",VX="Тригери",KX="вт",YX="вівторок",JX="URL",qX="Значення",XX="Обсяг",ZX="ми",QX="Середа",eZ="Напишіть",tZ="Так",sZ="підтвердження",oZ="все",iZ="і",nZ="Астро",rZ="в",aZ="КОНТРОЛЬ",lZ="копія",cZ="CRON",uZ="Світанок",dZ="Це особливий режим, в якому стану та об'єкти не змінюватимуться. Але в протоколі відображатиметься лише інформація про кожну заплановану зміну.",hZ="Відлагоджувати",pZ="Сутінки",gZ="легко",mZ="кожен",fZ="функція",$Z="ID",bZ="Ім'я",vZ="Роль",yZ="Кімната",_Z="Золота година",wZ="Кінець золотої години",kZ="Код буде виконуватися лише щоразу, коли умова виконується. наприклад якщо спрацьовує значення датчика температури та умова «якщо температура перевищує 20°C», дії «тоді» виконуватимуться щоразу, коли датчик надсилає температуру, і вона перевищує 20°C. На 21°C, на 22°C і так далі.",CZ="Код буде виконано лише у разі зміни результату умови. наприклад якщо спрацьовує значення датчика температури та умова «якщо температура перевищує 20°C», дії «тоді» будуть виконані один раз, коли температура буде вище 20. Наступного разу дії «тоді» буде виконано, коли температура падає нижче 20, а потім знову піднімається вище 20.",TZ="години",SZ="включає в себе",EZ="інтервал",IZ="магія",xZ="мілісекунд",DZ="хвилин",AZ="РС",OZ="Надір",RZ="Морський світанок",NZ="Морські сутінки",MZ="Наступний схід сонця",LZ="Наступний захід сонця",PZ="ніч",BZ="Кінець ночі",FZ="нормально",jZ="зсув",zZ="один",UZ="або",HZ="тихо",WZ="пошук",GZ="секунд",VZ="Сонячний полудень",KZ="схід сонця",YZ="Кінець сходу сонця",JZ="Захід сонця",qZ="Початок заходу сонця",XZ="потім",ZZ="Визнати",QZ="Від",eQ="Востаннє змінено",tQ="якість",sQ="Мітка часу",oQ="Користувач",iQ="Значення",nQ="два",rQ="оновлення",aQ="Додає вихідні дані налагодження до журналу для багатьох системних команд",lQ="Докладні результати журналу",cQ="коли",uQ="майстер",dQ="Повторити",hQ={"%s not found":"%s не знайдено","()":"()","(at %s)":"(у %s)","(optional)":"(необов'язково)","-":"-",".":".","AI code generator":"Генератор коду ШІ",Ack:vq,Actions:yq,"Actual time of day":"Фактичний час доби",Add:_q,"Add new script":"Додати новий сценарій",All:wq,"All files will be accepted":"Усі файли будуть прийняті",Any:kq,"Any month":"Будь-який місяць",Apply:Cq,April:Tq,"Are you sure?":"Ти впевнений?",Ask:Sq,Astronomical:Eq,"Astronomical events today":"Астрономічні події сьогодні",August:Iq,"Blockly description":"Створення правил за графічними блоками","Body:":"Тіло:",Cancel:xq,"Cannot delete non empty item!":"Неможливо видалити непорожній елемент!","Change layout":"Змінити макет",'Change theme (actual "%s")':'Змінити тему (тепер - "%s")',"Check blocks":"Перевірте блоки","Check is not active, because javascript adapter is disabled":"Перевірка не активна, оскільки адаптер Javascript вимкнено","Clear search input":"Очистити пошуковий запит","Click on this icon":"Натисніть на цей значок",Close:Dq,"Close all but current":"Закрити всі, крім поточних","Collapse all":"Закрити всі","Compares current time with astronomical event":"Порівнює поточний час з астрономічною подією","Compares current time with the user specific time":"Порівнює поточний час із конкретним часом користувача","Compares the state value with user defined value":"Порівнює значення стану з визначеним користувачем значенням",Condition:Aq,Conditions:Oq,"Configuration not saved.":"Конфігурація не збережена.",Console:Rq,"Control or update some state":"Контролюйте або оновлюйте певний стан","Control or update some state with delay":"Контролюйте або оновлюйте деякий стан із затримкою","Convert blockly to javascript for ever.":"Назавжди конвертуйте Blockly у Javascript.",Copied:Nq,"Copy script":"Копіювати сценарій","Copy to clipboard":"Копіювати в буфер обміну","Create new":"Створити новий","Create new folder":"Створити нову папку","Create new script":"Створіть новий сценарій","Create or edit CRON or time wizard":"Створення або редагування CRON або майстра часу","Dark Theme":"Темна тема","Dark style":"Темний стиль",Date:"Дата","Debug instance":"Екземпляр налагодження","Debug options":"Параметри налагодження",December:Mq,Default:Lq,"Define cron...":"Визначити cron...","Define schedule...":"Визначити розклад...",Delay:Pq,Delete:Bq,"Delete %s":"Видалити %s...","Delete folder":"Видалити папку","Delete script":"Видалити сценарій",Description:Fq,"Deselect all":"Зняти вибір із усіх","Discard changes for %s":"Скасувати зміни для %s",Done:jq,"Double click to write value":"Двічі клацніть, щоб записати значення","Download as file":"Завантажити файл","Drop some files here or click...":"Перетягніть кілька файлів сюди або натисніть...","Duplicate name":"Повторюване ім'я","Edit script or just double click":"Відредагуйте сценарій або просто двічі клацніть","Empty name is not allowed":"Порожнє ім'я не допускається","End search mode":"Завершити режим пошуку","Enter your question":"Введи своє прохання",Error:"Помилка","Error formatting code":"Помилка форматування коду","Error was found":"Виявлено помилку","Every day":"Кожен день",Exec:zq,"Executes some shell command":"Виконує певну команду оболонки","Existing scripts will be overwritten.":"Існуючі сценарії буде перезаписано.","Expand all":"Розгорнути все","Expert mode":"Експертний режим",Explanation:Uq,Export:Hq,"Export all scripts":"Експортувати всі сценарії","Export blocks":"Експорт блоків","Export selected blocks":"Експортувати вибрані блоки",Februar:Wq,February:Gq,Filter:Vq,Folder:Kq,Fr:Yq,Friday:Jq,Function:"функція","Function editor":"Редактор функцій","Function: executed":"Функція: виконано","Go to next line":"Перейти до наступного рядка","HTTP Call":"Виклик HTTP","Hide logs":"Приховати журнали",ID:qq,ID1:Xq,ID2:Zq,Import:Qq,"Import blocks":"Імпорт блоків","Import error":"Помилка імпорту","Import scripts":"Імпорт скриптів","Insert object ID":"Вставте ID об'єкта",Instance:eX,"Instance is disabled":"Примірник вимкнено","Instance:":"екземпляр:",Instances:tX,Instructions:sX,"Invalid CRON":"Недійсний CRON","It will not be possible to revert this operation.":"Скасувати цю операцію буде неможливо.","JS description":"Створення правил шляхом написання Javascript",Januar:oX,January:iX,July:nX,June:rX,"Just check":"Просто перевірте","Language:":"Мову:","Learn More":"Вивчайте більше","Light style":"Легкий стиль",Limit:aX,"Local time":"Місцевий час","Locate file":"Знайти файл","Log outputs":"Виходи журналу","Log text":"Текст журналу","Log: %s":"Журнал: %s","Make a HTTP get request":"Зробіть HTTP-запит на отримання","Make a pause between actions":"Між діями робіть паузу",March:lX,"March ":"березень",May:cX,Menu:uX,Message:dX,Mo:hX,Model:pX,Monday:gX,Month:mX,More:fX,Name:$X,"No API key found":"API-ключ не знайдено","No Chat GPT Key found":"Ключ GPT для чату не знайдено","No active host found":"Активний хост не знайдено","Nothing found":"Нічого не знайдено",November:bX,OK:vX,October:yX,Ok:_X,"On condition change":"За умови зміни результату","On script save or adapter start":"Під час збереження сценарію або запуску адаптера","On weekdays":"В будні дні","Open configuration":"Відкрита конфігурація","Operate two states":"Керуйте двома станами","Operations with two states":"Операції з двома станами","Paste your blocks here":"Вставте сюди свої блоки",Pause:wX,"Pause execution":"Призупинити виконання","Pause script":"Призупинити сценарій","Phone:":"телефон:","Please select object ID...":"Виберіть ідентифікатор об'єкта...","Press Ctrl+Enter to get the answer":"Натисніть Ctrl+Enter, щоб отримати відповідь","Prettify the script":"Прикрасьте сценарій","Print some text in log":"Надрукувати текст у журналі","Priority:":"Пріоритет:",Pushover:kX,Pushsafer:CX,"Read only ID selected: %s":"Вибрано ідентифікатор лише для читання: %s",Rename:TX,"Reorder scripts in folders":"Зміна порядку сценаріїв у папках",Repeat:SX,Restart:EX,Result:IX,"Resume execution":"Відновити виконання","Root folder":"Коренева папка","Rules description":"Створюйте правила з блоками IF, THEN, ELSE","Run script":"Запустіть сценарій",Sa:xX,Saturday:DX,Save:AX,"Save all":"Зберегти все","Say It":"Скажи це","Say some text via sayit adapter":"Скажіть текст через адаптер sayit",Schedule:OX,Script:RX,"Script %s was modified on disk":"Сценарій %s змінено на диску","Script is not running":"Сценарій не працює","Search in scripts":"Пошук у скриптах","Search...":"пошук...","Select all":"Вибрати все","Send email":"Відправити лист","Sends an email":"Надсилає електронний лист","Sends message via Pushsafer":"Надсилає повідомлення через Pushsafer","Sends message via pushover":"Надсилає повідомлення через pushover","Sends message via telegram":"Надсилає повідомлення через телеграм","Sends message via whatsapp-cmb":"Надсилає повідомлення через whatsapp-cmb",September:NX,"Server time":"Час сервера","Set state action":"Встановити дію стану","Set with delay":"Встановити із затримкою","Shell command":"Команда оболонки","Show astronomical events":"Показати астрономічні події","Show javascript code":"Показати код Javascript","Show logs":"Показати журнали","Show only paused scripts":"Показувати лише призупинені сценарії","Show only running scripts":"Показувати лише запущені сценарії","Show only scripts with problems":"Показувати лише сценарії з проблемами",Simulate:MX,"Some files will be rejected":"Деякі файли буде відхилено","Sound:":"звук:",Stack:LX,Start:PX,"Start script":"Запустити сценарій",State:BX,"State condition":"Стан стану","Step into function":"Крок у функції","Step out from function":"Вийти з функції","Stop on exception":"Зупинка на винятках",Su:FX,"Subject:":"Тема:",Sunday:jX,"TS description":"Створення правил шляхом написання Typescript",Telegram:zX,"Text:":"Текст:",Th:UX,"The script will be stopped and must be activated manually after debugging. Continue?":"Сценарій буде зупинено, і його необхідно активувати вручну після налагодження. Продовжити?","This is advances option. You can write your own code here and it will be executed on trigger":"Це авансовий варіант. Ви можете написати тут свій власний код, і він буде виконано на тригері",Thursday:HX,Time:WX,"Time condition":"Умова часу","Title:":"Назва:","To:":"до:","Trigger with value":"Тригер зі значенням",Triggered:GX,Triggers:VX,"Triggers the on script saving or the javascript instance restart":"Ініціює збереження сценарію або перезапуск екземпляра JavaScript","Triggers the rule on update or change of some state":"Запускає правило при оновленні або зміні якогось стану","Triggers the rule periodically or on some specific time":"Спрацьовує правило періодично або в певний час",Tu:KX,Tuesday:YX,URL:JX,"Unknown error":"Невідома помилка","Unknown error!":"Невідома помилка!","Use generated code":"Використовуйте згенерований код","User function":"Функція користувача","User:":"Користувач:",Value:qX,"Vibration:":"Вібрація:",Volume:XX,We:ZX,Wednesday:QX,"Whatsapp-cmb":"Whatsapp-cmb",Write:eZ,"Write your own code":"Напишіть власний код",Yes:tZ,"Yet exists!":"Все ж існує!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Ви можете використовувати %s в URL-адресі, щоб використовувати поточне значення тригера, %id, щоб використовувати ідентифікатор активованого об’єкта, %name, щоб показати назву ідентифікатора активованого об’єкта, або %old, щоб використовувати старе значення тригера","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Ви можете використовувати %s у команді, щоб використовувати поточне значення тригера, %id, щоб використовувати ідентифікатор активованого об’єкта, %name, щоб показати назву ідентифікатора активованого об’єкта, або %old, щоб використовувати старе значення тригера","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Ви можете використовувати %s у тексті для відображення поточного значення тригера, %id для використання ідентифікатора активованого об’єкта, %name для відображення імені ідентифікатора активованого об’єкта або %old для використання старого значення тригера","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Ви можете використовувати %s у значенні, щоб використовувати поточне значення тригера, %id, щоб використовувати ідентифікатор активованого об’єкта, %name, щоб показати назву ідентифікатора активованого об’єкта, або %old, щоб використовувати старе значення тригера","You have to enter OpenAI API key in the configuration of javascript adapter.":"Ви повинні ввести ключ OpenAI API у конфігурації адаптера JavaScript.","You have to enter at least one API key in the configuration of javascript adapter.":"Необхідно ввести хоча б один API-ключ (OpenAI, Anthropic або Gemini) у конфігурації адаптера JavaScript.","Please select a valid model":"Будь ласка, виберіть дійсну модель","[equal]":"[рівний]","[greater or equal]":"[більше або дорівнює]","[greater]":"[більший]","[hysteresis]":"[гістерезис]","[includes]":"[включає]","[less or equal]":"[менше або рівно]","[less]":"[менше]","[not equal]":"[не дорівнює]",acknowledgment:sZ,all:oZ,and:iZ,"as JSON":"як JSON","as plain text":"як текст",astro:nZ,at:rZ,"clear running":"чіткий біг",control:aZ,copy:lZ,cron:cZ,dawn:uZ,debug_help:dZ,debug_label:hZ,default:"за замовчуванням",dusk:pZ,easy:gZ,else:"інше","equal to":"дорівнює",every:mZ,"every hour at 0 minutes":"щогодини о 0 хвилин",false:"помилковий","file reading has failed: %s":"не вдалося прочитати файл: %s","file reading was aborted":"читання файлу було перервано",filter_func:fZ,filter_id:$Z,filter_name:bZ,filter_role:vZ,filter_room:yZ,"for edit or create script":"для редагування або створення нового сценарію","for professionals":"для професіоналів","for programmers":"для програмістів",goldenHour:_Z,goldenHourEnd:wZ,"greater or equal":"більший або рівний","greater or equal to":"більше або дорівнює","greater than":"більше, ніж, величніше ніж, крутіший за",help_just_check:kZ,help_on_change:CZ,"high priority":"високий пріоритет","high-priority":"високий пріоритет","highest priority":"найвищий пріоритет",hours:TZ,includes:SZ,interval:EZ,"just check":"просто перевірте","less or equal":"менше або дорівнює","less or equal to":"менше або дорівнює","less than":"менше ніж","lower priority":"нижчий пріоритет","lowest priority":"найнижчий пріоритет",magic:IZ,milliseconds:xZ,minutes:DZ,ms:AZ,nadir:OZ,nauticalDawn:RZ,nauticalDusk:NZ,nextSunrise:MZ,nextSunset:LZ,night:PZ,nightEnd:BZ,"no blocks found":"Блоків не знайдено","no group":"НЕМАЄ ГРУПИ",normal:FZ,"normal priority":"нормальний пріоритет","not running":"не запущено","not equal to":"не дорівнює","not properly connected":"Цей блок неправильно з’єднаний з іншими блоками.",offset:jZ,"on change":"на зміну","on condition change":"про зміну умов","on update":"на оновлення",one:zZ,or:UZ,quiet:HZ,"reset search":"скинути пошук",search:WZ,seconds:GZ,solarNoon:VZ,"store in":"зберігати в",sunrise:KZ,sunriseEnd:YZ,sunset:JZ,sunsetStart:qZ,then:XZ,"toggle value":"значення перемикання",tooltip_ack:ZZ,tooltip_from:QZ,tooltip_lc:eQ,tooltip_quality:tQ,tooltip_ts:sQ,tooltip_user:oQ,tooltip_value:iQ,true:"правда",two:nQ,undefined:"невизначений",update:rQ,"use seconds":"використовуйте секунди","use trigger value":"використовувати значення тригера",verbose_help:aQ,verbose_label:lQ,when:cQ,with:"з","with date":"з датою","with offset":"зі зміщенням",wizard:uQ,"Loading models...":"Завантаження моделей...","Could not connect to API at %s":"Не вдалося підключитися до API за адресою %s","Invalid API key":"Недійсний ключ API","Access denied by API":"Доступ заборонено API","API error: %s":"Помилка API: %s",'Model "%s" not found':'Модель "%s" не знайдено',"Request failed: %s":"Запит не вдався: %s",Retry:dQ,"No running javascript instance found":"Не знайдено запущеного екземпляра JavaScript"},pQ="确认",gQ="动作",mQ="添加",fQ="所有",$Q="任何",bQ="申请",vQ="四月",yQ="问",_Q="天文",wQ="八月",kQ="取消",CQ="关闭",TQ="健康)状况",SQ="情况",EQ="安慰",IQ="复制的",xQ="十二月",DQ="默认",AQ="延迟",OQ="删除",RQ="描述",NQ="完成",MQ="执行力",LQ="解释",PQ="导出",BQ="二月",FQ="二月",jQ="筛选",zQ="文件夹",UQ="r",HQ="星期五",WQ="ID",GQ="ID1",VQ="ID2",KQ="导入",YQ="实例",JQ="实例",qQ="指示",XQ="亚努尔",ZQ="一月",QQ="七月",eee="六月",tee="限制",see="三月",oee="五月",iee="菜单",nee="信息",ree="莫",aee="模型",lee="星期一",cee="月",uee="更多的",dee="名称",hee="十一月",pee="好的",gee="十月",mee="确定",fee="暂停",$ee="俯卧撑",bee="推安全",vee="重命名",yee="重复",_ee="重启",wee="结果",kee="萨",Cee="星期六",Tee="保存",See="日程",Eee="脚本",Iee="九月",xee="模拟",Dee="堆",Aee="开始",Oee="状态",Ree="苏",Nee="星期日",Mee="电报",Lee="4",Pee="星期四",Bee="时间",Fee="触发",jee="扳机",zee="涂",Uee="星期二",Hee="网址",Wee="价值",Gee="体积",Vee="3",Kee="星期三",Yee="写",Jee="是的",qee="致谢",Xee="全部",Zee="和",Qee="天文",ete="在",tte="控制",ste="复制",ote="克朗",ite="黎明",nte="这是一种特殊模式,其中状态和对象不会改变。但只有有关每个计划更改的信息才会显示在协议中。",rte="调试",ate="黄昏",lte="简单的",cte="每一个",ute="功能",dte="ID",hte="名字",pte="角色",gte="房间",mte="黄金时段",fte="黄金时段结束",$te="仅在条件为真时才执行代码。例如。如果触发温度传感器值并且条件为“如果温度大于20°C”,则每次传感器发送温度且温度超过20°C时,将执行“然后”动作。 21°C,22°C等。",bte="仅当条件结果更改时,代码才会执行。例如。如果触发温度传感器值且条件为“如果温度大于20°C”,则温度超过20时将执行一次“则”动作,下一次,当温度超过20时将执行“则”动作低于20失败,然后再次超过20。",vte="小时",yte="包括",_te="间隔",wte="魔法",kte="毫秒",Cte="分钟",Tte="毫秒",Ste="最低点",Ete="航海黎明",Ite="航海黄昏",xte="下一个日出",Dte="下一个日落",Ate="夜晚",Ote="夜晚结束",Rte="普通的",Nte="抵消",Mte="一",Lte="或",Pte="安静的",Bte="搜索",Fte="秒",jte="星期日正午",zte="日出",Ute="日出结束",Hte="日落",Wte="日落开始",Gte="然后",Vte="确认",Kte="从",Yte="上一次改变",Jte="质量",qte="时间戳",Xte="用户",Zte="值",Qte="二",ese="更新",tse="将调试输出添加到许多系统命令的日志中",sse="详细日志输出",ose="什么时候",ise="巫师",nse="重试",rse={"%s not found":"%s 未找到","()":"()","(at %s)":"(在 %s)","(optional)":"(选修的)","-":"-",".":".","AI code generator":"AI代码生成器",Ack:pQ,Actions:gQ,"Actual time of day":"一天中的实际时间",Add:mQ,"Add new script":"添加新脚本",All:fQ,"All files will be accepted":"所有文件都将被接受",Any:$Q,"Any month":"任何月份",Apply:bQ,April:vQ,"Are you sure?":"你确定吗?",Ask:yQ,Astronomical:_Q,"Astronomical events today":"今天的天文事件",August:wQ,"Blockly description":"按图形块创建规则","Body:":"身体:",Cancel:kQ,"Cannot delete non empty item!":"无法删除非空项目!","Change layout":"变更版面",'Change theme (actual "%s")':"更改主题(现在为“%s”)","Check blocks":"检查块","Check is not active, because javascript adapter is disabled":"检查未激活,因为禁用了Javascript适配器","Clear search input":"清除搜索输入","Click on this icon":"单击此图标",Close:CQ,"Close all but current":"关闭所有(当前除外)","Collapse all":"全部收缩","Compares current time with astronomical event":"将当前时间与天文事件进行比较","Compares current time with the user specific time":"将当前时间与用户特定时间进行比较","Compares the state value with user defined value":"比较状态值和用户定义的值",Condition:TQ,Conditions:SQ,"Configuration not saved.":"配置未保存。",Console:EQ,"Control or update some state":"控制或更新某些状态","Control or update some state with delay":"延迟控制或更新某些状态","Convert blockly to javascript for ever.":"立即将blockly转换为Javascript。",Copied:IQ,"Copy script":"复制脚本","Copy to clipboard":"复制到剪贴板","Create new":"创建新的","Create new folder":"创建新文件夹","Create new script":"创建新脚本","Create or edit CRON or time wizard":"创建或编辑周期任务或时间向导","Dark Theme":"深色调主题","Dark style":"深色调风格",Date:"日期","Debug instance":"调试实例","Debug options":"调试选项",December:xQ,Default:DQ,"Define cron...":"定义周期任务...","Define schedule...":"定义调度器......",Delay:AQ,Delete:OQ,"Delete %s":"删除%s...","Delete folder":"删除文件夹","Delete script":"删除脚本",Description:RQ,"Deselect all":"取消全选","Discard changes for %s":"放弃%s的更改",Done:NQ,"Double click to write value":"Double click to write value","Download as file":"档案","Drop some files here or click...":"将文件拖拽到这里或单击......","Duplicate name":"重名","Edit script or just double click":"双击编辑脚本","Empty name is not allowed":"不允许使用空名称","End search mode":"结束搜索模式","Enter your question":"输入您的要求",Error:"错误","Error formatting code":"代码格式错误","Error was found":"发现错误","Every day":"每天",Exec:MQ,"Executes some shell command":"执行一些shell命令","Existing scripts will be overwritten.":"现有脚本将被覆盖。","Expand all":"展开全部","Expert mode":"专家模式",Explanation:LQ,Export:PQ,"Export all scripts":"导出所有脚本","Export blocks":"导出块","Export selected blocks":"导出选定的块",Februar:BQ,February:FQ,Filter:jQ,Folder:zQ,Fr:UQ,Friday:HQ,Function:"功能","Function editor":"功能编辑器","Function: executed":"功能:执行","Go to next line":"转到下一行","HTTP Call":"HTTP呼叫","Hide logs":"隐藏日志",ID:WQ,ID1:GQ,ID2:VQ,Import:KQ,"Import blocks":"导入块","Import error":"导入错误","Import scripts":"导入脚本","Insert object ID":"插入对象ID",Instance:YQ,"Instance is disabled":"实例已禁用","Instance:":"实例:",Instances:JQ,Instructions:qQ,"Invalid CRON":"无效的周期任务","It will not be possible to revert this operation.":"无法恢复此操作。","JS description":"通过编写Javascript来创建规则",Januar:XQ,January:ZQ,July:QQ,June:eee,"Just check":"只是检查","Language:":"语言:","Learn More":"了解更多","Light style":"浅色调风格",Limit:tee,"Local time":"当地时间","Locate file":"定位文件","Log outputs":"记录输出","Log text":"记录文字","Log: %s":"日志:%s","Make a HTTP get request":"发出HTTP获取请求","Make a pause between actions":"在动作之间暂停",March:see,"March ":"行进",May:oee,Menu:iee,Message:nee,Mo:ree,Model:aee,Monday:lee,Month:cee,More:uee,Name:dee,"No API key found":"未找到 API 密钥","No Chat GPT Key found":"找不到聊天 GPT 密钥","No active host found":"找不到活动主机","Nothing found":"没有发现",November:hee,OK:pee,October:gee,Ok:mee,"On condition change":"条件变化时","On script save or adapter start":"在脚本保存或适配器启动时","On weekdays":"在工作日","Open configuration":"开放配置","Operate two states":"操作两种状态","Operations with two states":"具有两种状态的操作","Paste your blocks here":"在此处粘贴您的区块",Pause:fee,"Pause execution":"暂停执行","Pause script":"暂停脚本","Phone:":"电话:","Please select object ID...":"请选择对象ID...","Press Ctrl+Enter to get the answer":"按 Ctrl+Enter 即可得到答案","Prettify the script":"美化脚本","Print some text in log":"在日志中打印一些文本","Priority:":"优先:",Pushover:$ee,Pushsafer:bee,"Read only ID selected: %s":"选择的只读ID:%s",Rename:vee,"Reorder scripts in folders":"重新排序文件夹中的脚本",Repeat:yee,Restart:_ee,Result:wee,"Resume execution":"恢复执行","Root folder":"根文件夹","Rules description":"使用IF,THEN,ELSE块创建规则","Run script":"运行脚本",Sa:kee,Saturday:Cee,Save:Tee,"Save all":"保存全部","Say It":"Say It","Say some text via sayit adapter":"通过sayit适配器说一些文字",Schedule:See,Script:Eee,"Script %s was modified on disk":"脚本%s已在磁盘上修改","Script is not running":"脚本没有运行","Search in scripts":"在脚本中搜索","Search...":"搜索...","Select all":"全选","Send email":"发送电子邮件","Sends an email":"发送邮件","Sends message via Pushsafer":"通过Pushsafer发送消息","Sends message via pushover":"通过推播发送消息","Sends message via telegram":"通过电报发送消息","Sends message via whatsapp-cmb":"通过whatsapp-cmb发送消息",September:Iee,"Server time":"服务器时间","Set state action":"设定状态动作","Set with delay":"延迟设置","Shell command":"Shell命令","Show astronomical events":"显示天文事件","Show javascript code":"显示Javascript代码","Show logs":"显示记录","Show only paused scripts":"仅显示暂停的脚本","Show only running scripts":"仅显示正在运行的脚本","Show only scripts with problems":"仅显示有问题的脚本",Simulate:xee,"Some files will be rejected":"有些文件将被拒绝","Sound:":"声音:",Stack:Dee,Start:Aee,"Start script":"启动脚本",State:Oee,"State condition":"状态条件","Step into function":"进入功能","Step out from function":"退出函数","Stop on exception":"异常停止",Su:Ree,"Subject:":"学科:",Sunday:Nee,"TS description":"通过编写Typescript来创建规则",Telegram:Mee,"Text:":"文本:",Th:Lee,"The script will be stopped and must be activated manually after debugging. Continue?":"该脚本将停止,并且必须在调试后手动激活。继续?","This is advances option. You can write your own code here and it will be executed on trigger":"这是高级选项。您可以在此处编写自己的代码,它将在触发器上执行",Thursday:Pee,Time:Bee,"Time condition":"时间条件","Title:":"标题:","To:":"到:","Trigger with value":"用值触发",Triggered:Fee,Triggers:jee,"Triggers the on script saving or the javascript instance restart":"触发脚本保存或javascript实例重启","Triggers the rule on update or change of some state":"在某些状态的更新或更改时触发规则","Triggers the rule periodically or on some specific time":"定期或在特定时间触发规则",Tu:zee,Tuesday:Uee,URL:Hee,"Unknown error":"未知错误","Unknown error!":"未知错误!","Use generated code":"使用生成的代码","User function":"用户功能","User:":"用户:",Value:Wee,"Vibration:":"振动:",Volume:Gee,We:Vee,Wednesday:Kee,"Whatsapp-cmb":"Whatsapp的cmb",Write:Yee,"Write your own code":"编写自己的代码",Yes:Jee,"Yet exists!":"不存在!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"您可以在 URL 中使用 %s 以使用当前触发值,%id 以使用触发对象 ID,%name 以显示触发对象 ID 名称或 %old 以使用旧触发值","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"您可以在命令中使用 %s 以使用当前触发值,%id 使用触发对象 ID,%name 显示触发对象 ID 名称或 %old 使用旧触发值","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"您可以在文本中使用 %s 显示当前触发值,%id 使用触发对象 ID,%name 显示触发对象 ID 名称或 %old 使用旧触发值","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"您可以在值中使用 %s 以使用当前触发器值,%id 使用触发对象 ID,%name 显示触发对象 ID 名称或 %old 使用旧触发器值","You have to enter OpenAI API key in the configuration of javascript adapter.":"您必须在 javascript 适配器的配置中输入 OpenAI API 密钥。","You have to enter at least one API key in the configuration of javascript adapter.":"您必须在 javascript 适配器的配置中输入至少一个 API 密钥(OpenAI、Anthropic 或 Gemini)。","Please select a valid model":"请选择一个有效的模型","[equal]":"[平等的]","[greater or equal]":"[大于等于]","[greater]":"[更大]","[hysteresis]":"[磁滞]","[includes]":"[包括]","[less or equal]":"[小于或等于]","[less]":"[较少的]","[not equal]":"[不相等]",acknowledgment:qee,all:Xee,and:Zee,"as JSON":"为 JSON","as plain text":"为纯文本",astro:Qee,at:ete,"clear running":"畅通无阻",control:tte,copy:ste,cron:ote,dawn:ite,debug_help:nte,debug_label:rte,default:"默认",dusk:ate,easy:lte,else:"别的","equal to":"等于",every:cte,"every hour at 0 minutes":"每小时0分钟",false:"错误的","file reading has failed: %s":"文件读取失败:%s","file reading was aborted":"文件读取中止",filter_func:ute,filter_id:dte,filter_name:hte,filter_role:pte,filter_room:gte,"for edit or create script":"用于编辑或创建脚本","for professionals":"对于专业人士","for programmers":"对于程序员",goldenHour:mte,goldenHourEnd:fte,"greater or equal":"大于或等于","greater or equal to":"大于或等于","greater than":"比...更棒",help_just_check:$te,help_on_change:bte,"high priority":"高优先级","high-priority":"高优先级","highest priority":"最高优先级",hours:vte,includes:yte,interval:_te,"just check":"只是检查","less or equal":"小于或等于","less or equal to":"小于或等于","less than":"少于","lower priority":"低优先级","lowest priority":"最低优先级",magic:wte,milliseconds:kte,minutes:Cte,ms:Tte,nadir:Ste,nauticalDawn:Ete,nauticalDusk:Ite,nextSunrise:xte,nextSunset:Dte,night:Ate,nightEnd:Ote,"no blocks found":"找不到块","no group":"没有组",normal:Rte,"normal priority":"正常优先","not running":"未运行","not equal to":"不等于","not properly connected":"此块未正确连接到其他块。",offset:Nte,"on change":"在变化","on condition change":"在条件变化时","on update":"更新时",one:Mte,or:Lte,quiet:Pte,"reset search":"重置搜索",search:Bte,seconds:Fte,solarNoon:jte,"store in":"存放在",sunrise:zte,sunriseEnd:Ute,sunset:Hte,sunsetStart:Wte,then:Gte,"toggle value":"切换值",tooltip_ack:Vte,tooltip_from:Kte,tooltip_lc:Yte,tooltip_quality:Jte,tooltip_ts:qte,tooltip_user:Xte,tooltip_value:Zte,true:"真的",two:Qte,undefined:"不明确的",update:ese,"use seconds":"精确到秒","use trigger value":"使用触发值",verbose_help:tse,verbose_label:sse,when:ose,with:"和","with date":"有日期","with offset":"带偏移",wizard:ise,"Loading models...":"加载模型...","Could not connect to API at %s":"无法连接到 %s 的 API","Invalid API key":"无效的 API 密钥","Access denied by API":"API 拒绝访问","API error: %s":"API 错误:%s",'Model "%s" not found':'未找到模型 "%s"',"Request failed: %s":"请求失败:%s",Retry:nse,"No running javascript instance found":"未找到正在运行的 JavaScript 实例"};function pc(a){throw new Error('Could not dynamically require "'+a+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var OC={exports:{}};(function(a,s){(function(i){a.exports=i()})(function(){return(function i(r,l,c){function d(f,b){if(!l[f]){if(!r[f]){var y=typeof pc=="function"&&pc;if(!b&&y)return y(f,!0);if(h)return h(f,!0);var w=new Error("Cannot find module '"+f+"'");throw w.code="MODULE_NOT_FOUND",w}var v=l[f]={exports:{}};r[f][0].call(v.exports,function(_){var $=r[f][1][_];return d($||_)},v,v.exports,i,r,l,c)}return l[f].exports}for(var h=typeof pc=="function"&&pc,p=0;p>2,v=(3&f)<<4|b>>4,_=1>6:64,$=2>4,b=(15&w)<<4|(v=h.indexOf(p.charAt($++)))>>2,y=(3&v)<<6|(_=h.indexOf(p.charAt($++))),E[S++]=f,v!==64&&(E[S++]=b),_!==64&&(E[S++]=y);return E}},{"./support":30,"./utils":32}],2:[function(i,r,l){var c=i("./external"),d=i("./stream/DataWorker"),h=i("./stream/Crc32Probe"),p=i("./stream/DataLengthProbe");function f(b,y,w,v,_){this.compressedSize=b,this.uncompressedSize=y,this.crc32=w,this.compression=v,this.compressedContent=_}f.prototype={getContentWorker:function(){var b=new d(c.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new p("data_length")),y=this;return b.on("end",function(){if(this.streamInfo.data_length!==y.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),b},getCompressedWorker:function(){return new d(c.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},f.createWorkerFrom=function(b,y,w){return b.pipe(new h).pipe(new p("uncompressedSize")).pipe(y.compressWorker(w)).pipe(new p("compressedSize")).withStreamInfo("compression",y)},r.exports=f},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(i,r,l){var c=i("./stream/GenericWorker");l.STORE={magic:"\0\0",compressWorker:function(){return new c("STORE compression")},uncompressWorker:function(){return new c("STORE decompression")}},l.DEFLATE=i("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(i,r,l){var c=i("./utils"),d=(function(){for(var h,p=[],f=0;f<256;f++){h=f;for(var b=0;b<8;b++)h=1&h?3988292384^h>>>1:h>>>1;p[f]=h}return p})();r.exports=function(h,p){return h!==void 0&&h.length?c.getTypeOf(h)!=="string"?(function(f,b,y,w){var v=d,_=w+y;f^=-1;for(var $=w;$<_;$++)f=f>>>8^v[255&(f^b[$])];return-1^f})(0|p,h,h.length,0):(function(f,b,y,w){var v=d,_=w+y;f^=-1;for(var $=w;$<_;$++)f=f>>>8^v[255&(f^b.charCodeAt($))];return-1^f})(0|p,h,h.length,0):0}},{"./utils":32}],5:[function(i,r,l){l.base64=!1,l.binary=!1,l.dir=!1,l.createFolders=!0,l.date=null,l.compression=null,l.compressionOptions=null,l.comment=null,l.unixPermissions=null,l.dosPermissions=null},{}],6:[function(i,r,l){var c=null;c=typeof Promise<"u"?Promise:i("lie"),r.exports={Promise:c}},{lie:37}],7:[function(i,r,l){var c=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",d=i("pako"),h=i("./utils"),p=i("./stream/GenericWorker"),f=c?"uint8array":"array";function b(y,w){p.call(this,"FlateWorker/"+y),this._pako=null,this._pakoAction=y,this._pakoOptions=w,this.meta={}}l.magic="\b\0",h.inherits(b,p),b.prototype.processChunk=function(y){this.meta=y.meta,this._pako===null&&this._createPako(),this._pako.push(h.transformTo(f,y.data),!1)},b.prototype.flush=function(){p.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},b.prototype.cleanUp=function(){p.prototype.cleanUp.call(this),this._pako=null},b.prototype._createPako=function(){this._pako=new d[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var y=this;this._pako.onData=function(w){y.push({data:w,meta:y.meta})}},l.compressWorker=function(y){return new b("Deflate",y)},l.uncompressWorker=function(){return new b("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(i,r,l){function c(v,_){var $,S="";for($=0;$<_;$++)S+=String.fromCharCode(255&v),v>>>=8;return S}function d(v,_,$,S,T,E){var D,M,P=v.file,W=v.compression,G=E!==f.utf8encode,z=h.transformTo("string",E(P.name)),Z=h.transformTo("string",f.utf8encode(P.name)),he=P.comment,Ce=h.transformTo("string",E(he)),R=h.transformTo("string",f.utf8encode(he)),K=Z.length!==P.name.length,C=R.length!==he.length,Q="",ve="",ce="",ne=P.dir,me=P.date,re={crc32:0,compressedSize:0,uncompressedSize:0};_&&!$||(re.crc32=v.crc32,re.compressedSize=v.compressedSize,re.uncompressedSize=v.uncompressedSize);var B=0;_&&(B|=8),G||!K&&!C||(B|=2048);var N=0,te=0;ne&&(N|=16),T==="UNIX"?(te=798,N|=(function(se,j){var Te=se;return se||(Te=j?16893:33204),(65535&Te)<<16})(P.unixPermissions,ne)):(te=20,N|=(function(se){return 63&(se||0)})(P.dosPermissions)),D=me.getUTCHours(),D<<=6,D|=me.getUTCMinutes(),D<<=5,D|=me.getUTCSeconds()/2,M=me.getUTCFullYear()-1980,M<<=4,M|=me.getUTCMonth()+1,M<<=5,M|=me.getUTCDate(),K&&(ve=c(1,1)+c(b(z),4)+Z,Q+="up"+c(ve.length,2)+ve),C&&(ce=c(1,1)+c(b(Ce),4)+R,Q+="uc"+c(ce.length,2)+ce);var q="";return q+=` -\0`,q+=c(B,2),q+=W.magic,q+=c(D,2),q+=c(M,2),q+=c(re.crc32,4),q+=c(re.compressedSize,4),q+=c(re.uncompressedSize,4),q+=c(z.length,2),q+=c(Q.length,2),{fileRecord:y.LOCAL_FILE_HEADER+q+z+Q,dirRecord:y.CENTRAL_FILE_HEADER+c(te,2)+q+c(Ce.length,2)+"\0\0\0\0"+c(N,4)+c(S,4)+z+Q+Ce}}var h=i("../utils"),p=i("../stream/GenericWorker"),f=i("../utf8"),b=i("../crc32"),y=i("../signature");function w(v,_,$,S){p.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=_,this.zipPlatform=$,this.encodeFileName=S,this.streamFiles=v,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}h.inherits(w,p),w.prototype.push=function(v){var _=v.meta.percent||0,$=this.entriesCount,S=this._sources.length;this.accumulate?this.contentBuffer.push(v):(this.bytesWritten+=v.data.length,p.prototype.push.call(this,{data:v.data,meta:{currentFile:this.currentFile,percent:$?(_+100*($-S-1))/$:100}}))},w.prototype.openedSource=function(v){this.currentSourceOffset=this.bytesWritten,this.currentFile=v.file.name;var _=this.streamFiles&&!v.file.dir;if(_){var $=d(v,_,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:$.fileRecord,meta:{percent:0}})}else this.accumulate=!0},w.prototype.closedSource=function(v){this.accumulate=!1;var _=this.streamFiles&&!v.file.dir,$=d(v,_,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push($.dirRecord),_)this.push({data:(function(S){return y.DATA_DESCRIPTOR+c(S.crc32,4)+c(S.compressedSize,4)+c(S.uncompressedSize,4)})(v),meta:{percent:100}});else for(this.push({data:$.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},w.prototype.flush=function(){for(var v=this.bytesWritten,_=0;_=this.index;p--)f=(f<<8)+this.byteAt(p);return this.index+=h,f},readString:function(h){return c.transformTo("string",this.readData(h))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var h=this.readInt(4);return new Date(Date.UTC(1980+(h>>25&127),(h>>21&15)-1,h>>16&31,h>>11&31,h>>5&63,(31&h)<<1))}},r.exports=d},{"../utils":32}],19:[function(i,r,l){var c=i("./Uint8ArrayReader");function d(h){c.call(this,h)}i("../utils").inherits(d,c),d.prototype.readData=function(h){this.checkOffset(h);var p=this.data.slice(this.zero+this.index,this.zero+this.index+h);return this.index+=h,p},r.exports=d},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(i,r,l){var c=i("./DataReader");function d(h){c.call(this,h)}i("../utils").inherits(d,c),d.prototype.byteAt=function(h){return this.data.charCodeAt(this.zero+h)},d.prototype.lastIndexOfSignature=function(h){return this.data.lastIndexOf(h)-this.zero},d.prototype.readAndCheckSignature=function(h){return h===this.readData(4)},d.prototype.readData=function(h){this.checkOffset(h);var p=this.data.slice(this.zero+this.index,this.zero+this.index+h);return this.index+=h,p},r.exports=d},{"../utils":32,"./DataReader":18}],21:[function(i,r,l){var c=i("./ArrayReader");function d(h){c.call(this,h)}i("../utils").inherits(d,c),d.prototype.readData=function(h){if(this.checkOffset(h),h===0)return new Uint8Array(0);var p=this.data.subarray(this.zero+this.index,this.zero+this.index+h);return this.index+=h,p},r.exports=d},{"../utils":32,"./ArrayReader":17}],22:[function(i,r,l){var c=i("../utils"),d=i("../support"),h=i("./ArrayReader"),p=i("./StringReader"),f=i("./NodeBufferReader"),b=i("./Uint8ArrayReader");r.exports=function(y){var w=c.getTypeOf(y);return c.checkSupport(w),w!=="string"||d.uint8array?w==="nodebuffer"?new f(y):d.uint8array?new b(c.transformTo("uint8array",y)):new h(c.transformTo("array",y)):new p(y)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(i,r,l){l.LOCAL_FILE_HEADER="PK",l.CENTRAL_FILE_HEADER="PK",l.CENTRAL_DIRECTORY_END="PK",l.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",l.ZIP64_CENTRAL_DIRECTORY_END="PK",l.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(i,r,l){var c=i("./GenericWorker"),d=i("../utils");function h(p){c.call(this,"ConvertWorker to "+p),this.destType=p}d.inherits(h,c),h.prototype.processChunk=function(p){this.push({data:d.transformTo(this.destType,p.data),meta:p.meta})},r.exports=h},{"../utils":32,"./GenericWorker":28}],25:[function(i,r,l){var c=i("./GenericWorker"),d=i("../crc32");function h(){c.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}i("../utils").inherits(h,c),h.prototype.processChunk=function(p){this.streamInfo.crc32=d(p.data,this.streamInfo.crc32||0),this.push(p)},r.exports=h},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(i,r,l){var c=i("../utils"),d=i("./GenericWorker");function h(p){d.call(this,"DataLengthProbe for "+p),this.propName=p,this.withStreamInfo(p,0)}c.inherits(h,d),h.prototype.processChunk=function(p){if(p){var f=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=f+p.data.length}d.prototype.processChunk.call(this,p)},r.exports=h},{"../utils":32,"./GenericWorker":28}],27:[function(i,r,l){var c=i("../utils"),d=i("./GenericWorker");function h(p){d.call(this,"DataWorker");var f=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,p.then(function(b){f.dataIsReady=!0,f.data=b,f.max=b&&b.length||0,f.type=c.getTypeOf(b),f.isPaused||f._tickAndRepeat()},function(b){f.error(b)})}c.inherits(h,d),h.prototype.cleanUp=function(){d.prototype.cleanUp.call(this),this.data=null},h.prototype.resume=function(){return!!d.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,c.delay(this._tickAndRepeat,[],this)),!0)},h.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(c.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},h.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var p=null,f=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":p=this.data.substring(this.index,f);break;case"uint8array":p=this.data.subarray(this.index,f);break;case"array":case"nodebuffer":p=this.data.slice(this.index,f)}return this.index=f,this.push({data:p,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=h},{"../utils":32,"./GenericWorker":28}],28:[function(i,r,l){function c(d){this.name=d||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}c.prototype={push:function(d){this.emit("data",d)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(d){this.emit("error",d)}return!0},error:function(d){return!this.isFinished&&(this.isPaused?this.generatedError=d:(this.isFinished=!0,this.emit("error",d),this.previous&&this.previous.error(d),this.cleanUp()),!0)},on:function(d,h){return this._listeners[d].push(h),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(d,h){if(this._listeners[d])for(var p=0;p "+d:d}},r.exports=c},{}],29:[function(i,r,l){var c=i("../utils"),d=i("./ConvertWorker"),h=i("./GenericWorker"),p=i("../base64"),f=i("../support"),b=i("../external"),y=null;if(f.nodestream)try{y=i("../nodejs/NodejsStreamOutputAdapter")}catch{}function w(_,$){return new b.Promise(function(S,T){var E=[],D=_._internalType,M=_._outputType,P=_._mimeType;_.on("data",function(W,G){E.push(W),$&&$(G)}).on("error",function(W){E=[],T(W)}).on("end",function(){try{var W=(function(G,z,Z){switch(G){case"blob":return c.newBlob(c.transformTo("arraybuffer",z),Z);case"base64":return p.encode(z);default:return c.transformTo(G,z)}})(M,(function(G,z){var Z,he=0,Ce=null,R=0;for(Z=0;Z"u")l.blob=!1;else{var c=new ArrayBuffer(0);try{l.blob=new Blob([c],{type:"application/zip"}).size===0}catch{try{var d=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);d.append(c),l.blob=d.getBlob("application/zip").size===0}catch{l.blob=!1}}}try{l.nodestream=!!i("readable-stream").Readable}catch{l.nodestream=!1}},{"readable-stream":16}],31:[function(i,r,l){for(var c=i("./utils"),d=i("./support"),h=i("./nodejsUtils"),p=i("./stream/GenericWorker"),f=new Array(256),b=0;b<256;b++)f[b]=252<=b?6:248<=b?5:240<=b?4:224<=b?3:192<=b?2:1;f[254]=f[254]=1;function y(){p.call(this,"utf-8 decode"),this.leftOver=null}function w(){p.call(this,"utf-8 encode")}l.utf8encode=function(v){return d.nodebuffer?h.newBufferFrom(v,"utf-8"):(function(_){var $,S,T,E,D,M=_.length,P=0;for(E=0;E>>6:(S<65536?$[D++]=224|S>>>12:($[D++]=240|S>>>18,$[D++]=128|S>>>12&63),$[D++]=128|S>>>6&63),$[D++]=128|63&S);return $})(v)},l.utf8decode=function(v){return d.nodebuffer?c.transformTo("nodebuffer",v).toString("utf-8"):(function(_){var $,S,T,E,D=_.length,M=new Array(2*D);for($=S=0;$>10&1023,M[S++]=56320|1023&T)}return M.length!==S&&(M.subarray?M=M.subarray(0,S):M.length=S),c.applyFromCharCode(M)})(v=c.transformTo(d.uint8array?"uint8array":"array",v))},c.inherits(y,p),y.prototype.processChunk=function(v){var _=c.transformTo(d.uint8array?"uint8array":"array",v.data);if(this.leftOver&&this.leftOver.length){if(d.uint8array){var $=_;(_=new Uint8Array($.length+this.leftOver.length)).set(this.leftOver,0),_.set($,this.leftOver.length)}else _=this.leftOver.concat(_);this.leftOver=null}var S=(function(E,D){var M;for((D=D||E.length)>E.length&&(D=E.length),M=D-1;0<=M&&(192&E[M])==128;)M--;return M<0||M===0?D:M+f[E[M]]>D?M:D})(_),T=_;S!==_.length&&(d.uint8array?(T=_.subarray(0,S),this.leftOver=_.subarray(S,_.length)):(T=_.slice(0,S),this.leftOver=_.slice(S,_.length))),this.push({data:l.utf8decode(T),meta:v.meta})},y.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:l.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},l.Utf8DecodeWorker=y,c.inherits(w,p),w.prototype.processChunk=function(v){this.push({data:l.utf8encode(v.data),meta:v.meta})},l.Utf8EncodeWorker=w},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(i,r,l){var c=i("./support"),d=i("./base64"),h=i("./nodejsUtils"),p=i("./external");function f($){return $}function b($,S){for(var T=0;T<$.length;++T)S[T]=255&$.charCodeAt(T);return S}i("setimmediate"),l.newBlob=function($,S){l.checkSupport("blob");try{return new Blob([$],{type:S})}catch{try{var T=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return T.append($),T.getBlob(S)}catch{throw new Error("Bug : can't construct the Blob.")}}};var y={stringifyByChunk:function($,S,T){var E=[],D=0,M=$.length;if(M<=T)return String.fromCharCode.apply(null,$);for(;D>8;this.dir=!!(16&this.externalFileAttributes),v==0&&(this.dosPermissions=63&this.externalFileAttributes),v==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var v=c(this.extraFields[1].value);this.uncompressedSize===d.MAX_VALUE_32BITS&&(this.uncompressedSize=v.readInt(8)),this.compressedSize===d.MAX_VALUE_32BITS&&(this.compressedSize=v.readInt(8)),this.localHeaderOffset===d.MAX_VALUE_32BITS&&(this.localHeaderOffset=v.readInt(8)),this.diskNumberStart===d.MAX_VALUE_32BITS&&(this.diskNumberStart=v.readInt(4))}},readExtraFields:function(v){var _,$,S,T=v.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});v.index+4>>6:(v<65536?w[S++]=224|v>>>12:(w[S++]=240|v>>>18,w[S++]=128|v>>>12&63),w[S++]=128|v>>>6&63),w[S++]=128|63&v);return w},l.buf2binstring=function(y){return b(y,y.length)},l.binstring2buf=function(y){for(var w=new c.Buf8(y.length),v=0,_=w.length;v<_;v++)w[v]=y.charCodeAt(v);return w},l.buf2string=function(y,w){var v,_,$,S,T=w||y.length,E=new Array(2*T);for(v=_=0;v>10&1023,E[_++]=56320|1023&$)}return b(E,_)},l.utf8border=function(y,w){var v;for((w=w||y.length)>y.length&&(w=y.length),v=w-1;0<=v&&(192&y[v])==128;)v--;return v<0||v===0?w:v+p[y[v]]>w?v:w}},{"./common":41}],43:[function(i,r,l){r.exports=function(c,d,h,p){for(var f=65535&c|0,b=c>>>16&65535|0,y=0;h!==0;){for(h-=y=2e3>>1:d>>>1;h[p]=d}return h})();r.exports=function(d,h,p,f){var b=c,y=f+p;d^=-1;for(var w=f;w>>8^b[255&(d^h[w])];return-1^d}},{}],46:[function(i,r,l){var c,d=i("../utils/common"),h=i("./trees"),p=i("./adler32"),f=i("./crc32"),b=i("./messages"),y=0,w=4,v=0,_=-2,$=-1,S=4,T=2,E=8,D=9,M=286,P=30,W=19,G=2*M+1,z=15,Z=3,he=258,Ce=he+Z+1,R=42,K=113,C=1,Q=2,ve=3,ce=4;function ne(k,X){return k.msg=b[X],X}function me(k){return(k<<1)-(4k.avail_out&&(Y=k.avail_out),Y!==0&&(d.arraySet(k.output,X.pending_buf,X.pending_out,Y,k.next_out),k.next_out+=Y,X.pending_out+=Y,k.total_out+=Y,k.avail_out-=Y,X.pending-=Y,X.pending===0&&(X.pending_out=0))}function N(k,X){h._tr_flush_block(k,0<=k.block_start?k.block_start:-1,k.strstart-k.block_start,X),k.block_start=k.strstart,B(k.strm)}function te(k,X){k.pending_buf[k.pending++]=X}function q(k,X){k.pending_buf[k.pending++]=X>>>8&255,k.pending_buf[k.pending++]=255&X}function se(k,X){var Y,O,A=k.max_chain_length,U=k.strstart,H=k.prev_length,ue=k.nice_match,V=k.strstart>k.w_size-Ce?k.strstart-(k.w_size-Ce):0,be=k.window,pe=k.w_mask,fe=k.prev,Le=k.strstart+he,Ue=be[U+H-1],Be=be[U+H];k.prev_length>=k.good_match&&(A>>=2),ue>k.lookahead&&(ue=k.lookahead);do if(be[(Y=X)+H]===Be&&be[Y+H-1]===Ue&&be[Y]===be[U]&&be[++Y]===be[U+1]){U+=2,Y++;do;while(be[++U]===be[++Y]&&be[++U]===be[++Y]&&be[++U]===be[++Y]&&be[++U]===be[++Y]&&be[++U]===be[++Y]&&be[++U]===be[++Y]&&be[++U]===be[++Y]&&be[++U]===be[++Y]&&UV&&--A!=0);return H<=k.lookahead?H:k.lookahead}function j(k){var X,Y,O,A,U,H,ue,V,be,pe,fe=k.w_size;do{if(A=k.window_size-k.lookahead-k.strstart,k.strstart>=fe+(fe-Ce)){for(d.arraySet(k.window,k.window,fe,fe,0),k.match_start-=fe,k.strstart-=fe,k.block_start-=fe,X=Y=k.hash_size;O=k.head[--X],k.head[X]=fe<=O?O-fe:0,--Y;);for(X=Y=fe;O=k.prev[--X],k.prev[X]=fe<=O?O-fe:0,--Y;);A+=fe}if(k.strm.avail_in===0)break;if(H=k.strm,ue=k.window,V=k.strstart+k.lookahead,be=A,pe=void 0,pe=H.avail_in,be=Z)for(U=k.strstart-k.insert,k.ins_h=k.window[U],k.ins_h=(k.ins_h<=Z&&(k.ins_h=(k.ins_h<=Z)if(O=h._tr_tally(k,k.strstart-k.match_start,k.match_length-Z),k.lookahead-=k.match_length,k.match_length<=k.max_lazy_match&&k.lookahead>=Z){for(k.match_length--;k.strstart++,k.ins_h=(k.ins_h<=Z&&(k.ins_h=(k.ins_h<=Z&&k.match_length<=k.prev_length){for(A=k.strstart+k.lookahead-Z,O=h._tr_tally(k,k.strstart-1-k.prev_match,k.prev_length-Z),k.lookahead-=k.prev_length-1,k.prev_length-=2;++k.strstart<=A&&(k.ins_h=(k.ins_h<k.pending_buf_size-5&&(Y=k.pending_buf_size-5);;){if(k.lookahead<=1){if(j(k),k.lookahead===0&&X===y)return C;if(k.lookahead===0)break}k.strstart+=k.lookahead,k.lookahead=0;var O=k.block_start+Y;if((k.strstart===0||k.strstart>=O)&&(k.lookahead=k.strstart-O,k.strstart=O,N(k,!1),k.strm.avail_out===0)||k.strstart-k.block_start>=k.w_size-Ce&&(N(k,!1),k.strm.avail_out===0))return C}return k.insert=0,X===w?(N(k,!0),k.strm.avail_out===0?ve:ce):(k.strstart>k.block_start&&(N(k,!1),k.strm.avail_out),C)}),new we(4,4,8,4,Te),new we(4,5,16,8,Te),new we(4,6,32,32,Te),new we(4,4,16,16,ae),new we(8,16,32,32,ae),new we(8,16,128,128,ae),new we(8,32,128,256,ae),new we(32,128,258,1024,ae),new we(32,258,258,4096,ae)],l.deflateInit=function(k,X){return We(k,X,E,15,8,0)},l.deflateInit2=We,l.deflateReset=Ae,l.deflateResetKeep=Ne,l.deflateSetHeader=function(k,X){return k&&k.state?k.state.wrap!==2?_:(k.state.gzhead=X,v):_},l.deflate=function(k,X){var Y,O,A,U;if(!k||!k.state||5>8&255),te(O,O.gzhead.time>>16&255),te(O,O.gzhead.time>>24&255),te(O,O.level===9?2:2<=O.strategy||O.level<2?4:0),te(O,255&O.gzhead.os),O.gzhead.extra&&O.gzhead.extra.length&&(te(O,255&O.gzhead.extra.length),te(O,O.gzhead.extra.length>>8&255)),O.gzhead.hcrc&&(k.adler=f(k.adler,O.pending_buf,O.pending,0)),O.gzindex=0,O.status=69):(te(O,0),te(O,0),te(O,0),te(O,0),te(O,0),te(O,O.level===9?2:2<=O.strategy||O.level<2?4:0),te(O,3),O.status=K);else{var H=E+(O.w_bits-8<<4)<<8;H|=(2<=O.strategy||O.level<2?0:O.level<6?1:O.level===6?2:3)<<6,O.strstart!==0&&(H|=32),H+=31-H%31,O.status=K,q(O,H),O.strstart!==0&&(q(O,k.adler>>>16),q(O,65535&k.adler)),k.adler=1}if(O.status===69)if(O.gzhead.extra){for(A=O.pending;O.gzindex<(65535&O.gzhead.extra.length)&&(O.pending!==O.pending_buf_size||(O.gzhead.hcrc&&O.pending>A&&(k.adler=f(k.adler,O.pending_buf,O.pending-A,A)),B(k),A=O.pending,O.pending!==O.pending_buf_size));)te(O,255&O.gzhead.extra[O.gzindex]),O.gzindex++;O.gzhead.hcrc&&O.pending>A&&(k.adler=f(k.adler,O.pending_buf,O.pending-A,A)),O.gzindex===O.gzhead.extra.length&&(O.gzindex=0,O.status=73)}else O.status=73;if(O.status===73)if(O.gzhead.name){A=O.pending;do{if(O.pending===O.pending_buf_size&&(O.gzhead.hcrc&&O.pending>A&&(k.adler=f(k.adler,O.pending_buf,O.pending-A,A)),B(k),A=O.pending,O.pending===O.pending_buf_size)){U=1;break}U=O.gzindexA&&(k.adler=f(k.adler,O.pending_buf,O.pending-A,A)),U===0&&(O.gzindex=0,O.status=91)}else O.status=91;if(O.status===91)if(O.gzhead.comment){A=O.pending;do{if(O.pending===O.pending_buf_size&&(O.gzhead.hcrc&&O.pending>A&&(k.adler=f(k.adler,O.pending_buf,O.pending-A,A)),B(k),A=O.pending,O.pending===O.pending_buf_size)){U=1;break}U=O.gzindexA&&(k.adler=f(k.adler,O.pending_buf,O.pending-A,A)),U===0&&(O.status=103)}else O.status=103;if(O.status===103&&(O.gzhead.hcrc?(O.pending+2>O.pending_buf_size&&B(k),O.pending+2<=O.pending_buf_size&&(te(O,255&k.adler),te(O,k.adler>>8&255),k.adler=0,O.status=K)):O.status=K),O.pending!==0){if(B(k),k.avail_out===0)return O.last_flush=-1,v}else if(k.avail_in===0&&me(X)<=me(Y)&&X!==w)return ne(k,-5);if(O.status===666&&k.avail_in!==0)return ne(k,-5);if(k.avail_in!==0||O.lookahead!==0||X!==y&&O.status!==666){var ue=O.strategy===2?(function(V,be){for(var pe;;){if(V.lookahead===0&&(j(V),V.lookahead===0)){if(be===y)return C;break}if(V.match_length=0,pe=h._tr_tally(V,0,V.window[V.strstart]),V.lookahead--,V.strstart++,pe&&(N(V,!1),V.strm.avail_out===0))return C}return V.insert=0,be===w?(N(V,!0),V.strm.avail_out===0?ve:ce):V.last_lit&&(N(V,!1),V.strm.avail_out===0)?C:Q})(O,X):O.strategy===3?(function(V,be){for(var pe,fe,Le,Ue,Be=V.window;;){if(V.lookahead<=he){if(j(V),V.lookahead<=he&&be===y)return C;if(V.lookahead===0)break}if(V.match_length=0,V.lookahead>=Z&&0V.lookahead&&(V.match_length=V.lookahead)}if(V.match_length>=Z?(pe=h._tr_tally(V,1,V.match_length-Z),V.lookahead-=V.match_length,V.strstart+=V.match_length,V.match_length=0):(pe=h._tr_tally(V,0,V.window[V.strstart]),V.lookahead--,V.strstart++),pe&&(N(V,!1),V.strm.avail_out===0))return C}return V.insert=0,be===w?(N(V,!0),V.strm.avail_out===0?ve:ce):V.last_lit&&(N(V,!1),V.strm.avail_out===0)?C:Q})(O,X):c[O.level].func(O,X);if(ue!==ve&&ue!==ce||(O.status=666),ue===C||ue===ve)return k.avail_out===0&&(O.last_flush=-1),v;if(ue===Q&&(X===1?h._tr_align(O):X!==5&&(h._tr_stored_block(O,0,0,!1),X===3&&(re(O.head),O.lookahead===0&&(O.strstart=0,O.block_start=0,O.insert=0))),B(k),k.avail_out===0))return O.last_flush=-1,v}return X!==w?v:O.wrap<=0?1:(O.wrap===2?(te(O,255&k.adler),te(O,k.adler>>8&255),te(O,k.adler>>16&255),te(O,k.adler>>24&255),te(O,255&k.total_in),te(O,k.total_in>>8&255),te(O,k.total_in>>16&255),te(O,k.total_in>>24&255)):(q(O,k.adler>>>16),q(O,65535&k.adler)),B(k),0=Y.w_size&&(U===0&&(re(Y.head),Y.strstart=0,Y.block_start=0,Y.insert=0),be=new d.Buf8(Y.w_size),d.arraySet(be,X,pe-Y.w_size,Y.w_size,0),X=be,pe=Y.w_size),H=k.avail_in,ue=k.next_in,V=k.input,k.avail_in=pe,k.next_in=0,k.input=X,j(Y);Y.lookahead>=Z;){for(O=Y.strstart,A=Y.lookahead-(Z-1);Y.ins_h=(Y.ins_h<>>=Z=z>>>24,D-=Z,(Z=z>>>16&255)===0)Q[b++]=65535&z;else{if(!(16&Z)){if((64&Z)==0){z=M[(65535&z)+(E&(1<>>=Z,D-=Z),D<15&&(E+=C[p++]<>>=Z=z>>>24,D-=Z,!(16&(Z=z>>>16&255))){if((64&Z)==0){z=P[(65535&z)+(E&(1<>>=Z,D-=Z,(Z=b-y)>3,E&=(1<<(D-=he<<3))-1,c.next_in=p,c.next_out=b,c.avail_in=p>>24&255)+(R>>>8&65280)+((65280&R)<<8)+((255&R)<<24)}function E(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new c.Buf16(320),this.work=new c.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function D(R){var K;return R&&R.state?(K=R.state,R.total_in=R.total_out=K.total=0,R.msg="",K.wrap&&(R.adler=1&K.wrap),K.mode=_,K.last=0,K.havedict=0,K.dmax=32768,K.head=null,K.hold=0,K.bits=0,K.lencode=K.lendyn=new c.Buf32($),K.distcode=K.distdyn=new c.Buf32(S),K.sane=1,K.back=-1,w):v}function M(R){var K;return R&&R.state?((K=R.state).wsize=0,K.whave=0,K.wnext=0,D(R)):v}function P(R,K){var C,Q;return R&&R.state?(Q=R.state,K<0?(C=0,K=-K):(C=1+(K>>4),K<48&&(K&=15)),K&&(K<8||15=ce.wsize?(c.arraySet(ce.window,K,C-ce.wsize,ce.wsize,0),ce.wnext=0,ce.whave=ce.wsize):(Q<(ve=ce.wsize-ce.wnext)&&(ve=Q),c.arraySet(ce.window,K,C-Q,ve,ce.wnext),(Q-=ve)?(c.arraySet(ce.window,K,C-Q,Q,0),ce.wnext=Q,ce.whave=ce.wsize):(ce.wnext+=ve,ce.wnext===ce.wsize&&(ce.wnext=0),ce.whave>>8&255,C.check=h(C.check,U,2,0),N=B=0,C.mode=2;break}if(C.flags=0,C.head&&(C.head.done=!1),!(1&C.wrap)||(((255&B)<<8)+(B>>8))%31){R.msg="incorrect header check",C.mode=30;break}if((15&B)!=8){R.msg="unknown compression method",C.mode=30;break}if(N-=4,k=8+(15&(B>>>=4)),C.wbits===0)C.wbits=k;else if(k>C.wbits){R.msg="invalid window size",C.mode=30;break}C.dmax=1<>8&1),512&C.flags&&(U[0]=255&B,U[1]=B>>>8&255,C.check=h(C.check,U,2,0)),N=B=0,C.mode=3;case 3:for(;N<32;){if(me===0)break e;me--,B+=Q[ce++]<>>8&255,U[2]=B>>>16&255,U[3]=B>>>24&255,C.check=h(C.check,U,4,0)),N=B=0,C.mode=4;case 4:for(;N<16;){if(me===0)break e;me--,B+=Q[ce++]<>8),512&C.flags&&(U[0]=255&B,U[1]=B>>>8&255,C.check=h(C.check,U,2,0)),N=B=0,C.mode=5;case 5:if(1024&C.flags){for(;N<16;){if(me===0)break e;me--,B+=Q[ce++]<>>8&255,C.check=h(C.check,U,2,0)),N=B=0}else C.head&&(C.head.extra=null);C.mode=6;case 6:if(1024&C.flags&&(me<(se=C.length)&&(se=me),se&&(C.head&&(k=C.head.extra_len-C.length,C.head.extra||(C.head.extra=new Array(C.head.extra_len)),c.arraySet(C.head.extra,Q,ce,se,k)),512&C.flags&&(C.check=h(C.check,Q,se,ce)),me-=se,ce+=se,C.length-=se),C.length))break e;C.length=0,C.mode=7;case 7:if(2048&C.flags){if(me===0)break e;for(se=0;k=Q[ce+se++],C.head&&k&&C.length<65536&&(C.head.name+=String.fromCharCode(k)),k&&se>9&1,C.head.done=!0),R.adler=C.check=0,C.mode=12;break;case 10:for(;N<32;){if(me===0)break e;me--,B+=Q[ce++]<>>=7&N,N-=7&N,C.mode=27;break}for(;N<3;){if(me===0)break e;me--,B+=Q[ce++]<>>=1)){case 0:C.mode=14;break;case 1:if(he(C),C.mode=20,K!==6)break;B>>>=2,N-=2;break e;case 2:C.mode=17;break;case 3:R.msg="invalid block type",C.mode=30}B>>>=2,N-=2;break;case 14:for(B>>>=7&N,N-=7&N;N<32;){if(me===0)break e;me--,B+=Q[ce++]<>>16^65535)){R.msg="invalid stored block lengths",C.mode=30;break}if(C.length=65535&B,N=B=0,C.mode=15,K===6)break e;case 15:C.mode=16;case 16:if(se=C.length){if(me>>=5,N-=5,C.ndist=1+(31&B),B>>>=5,N-=5,C.ncode=4+(15&B),B>>>=4,N-=4,286>>=3,N-=3}for(;C.have<19;)C.lens[H[C.have++]]=0;if(C.lencode=C.lendyn,C.lenbits=7,Y={bits:C.lenbits},X=f(0,C.lens,0,19,C.lencode,0,C.work,Y),C.lenbits=Y.bits,X){R.msg="invalid code lengths set",C.mode=30;break}C.have=0,C.mode=19;case 19:for(;C.have>>16&255,Ie=65535&A,!((ae=A>>>24)<=N);){if(me===0)break e;me--,B+=Q[ce++]<>>=ae,N-=ae,C.lens[C.have++]=Ie;else{if(Ie===16){for(O=ae+2;N>>=ae,N-=ae,C.have===0){R.msg="invalid bit length repeat",C.mode=30;break}k=C.lens[C.have-1],se=3+(3&B),B>>>=2,N-=2}else if(Ie===17){for(O=ae+3;N>>=ae)),B>>>=3,N-=3}else{for(O=ae+7;N>>=ae)),B>>>=7,N-=7}if(C.have+se>C.nlen+C.ndist){R.msg="invalid bit length repeat",C.mode=30;break}for(;se--;)C.lens[C.have++]=k}}if(C.mode===30)break;if(C.lens[256]===0){R.msg="invalid code -- missing end-of-block",C.mode=30;break}if(C.lenbits=9,Y={bits:C.lenbits},X=f(b,C.lens,0,C.nlen,C.lencode,0,C.work,Y),C.lenbits=Y.bits,X){R.msg="invalid literal/lengths set",C.mode=30;break}if(C.distbits=6,C.distcode=C.distdyn,Y={bits:C.distbits},X=f(y,C.lens,C.nlen,C.ndist,C.distcode,0,C.work,Y),C.distbits=Y.bits,X){R.msg="invalid distances set",C.mode=30;break}if(C.mode=20,K===6)break e;case 20:C.mode=21;case 21:if(6<=me&&258<=re){R.next_out=ne,R.avail_out=re,R.next_in=ce,R.avail_in=me,C.hold=B,C.bits=N,p(R,q),ne=R.next_out,ve=R.output,re=R.avail_out,ce=R.next_in,Q=R.input,me=R.avail_in,B=C.hold,N=C.bits,C.mode===12&&(C.back=-1);break}for(C.back=0;we=(A=C.lencode[B&(1<>>16&255,Ie=65535&A,!((ae=A>>>24)<=N);){if(me===0)break e;me--,B+=Q[ce++]<>Ne)])>>>16&255,Ie=65535&A,!(Ne+(ae=A>>>24)<=N);){if(me===0)break e;me--,B+=Q[ce++]<>>=Ne,N-=Ne,C.back+=Ne}if(B>>>=ae,N-=ae,C.back+=ae,C.length=Ie,we===0){C.mode=26;break}if(32&we){C.back=-1,C.mode=12;break}if(64&we){R.msg="invalid literal/length code",C.mode=30;break}C.extra=15&we,C.mode=22;case 22:if(C.extra){for(O=C.extra;N>>=C.extra,N-=C.extra,C.back+=C.extra}C.was=C.length,C.mode=23;case 23:for(;we=(A=C.distcode[B&(1<>>16&255,Ie=65535&A,!((ae=A>>>24)<=N);){if(me===0)break e;me--,B+=Q[ce++]<>Ne)])>>>16&255,Ie=65535&A,!(Ne+(ae=A>>>24)<=N);){if(me===0)break e;me--,B+=Q[ce++]<>>=Ne,N-=Ne,C.back+=Ne}if(B>>>=ae,N-=ae,C.back+=ae,64&we){R.msg="invalid distance code",C.mode=30;break}C.offset=Ie,C.extra=15&we,C.mode=24;case 24:if(C.extra){for(O=C.extra;N>>=C.extra,N-=C.extra,C.back+=C.extra}if(C.offset>C.dmax){R.msg="invalid distance too far back",C.mode=30;break}C.mode=25;case 25:if(re===0)break e;if(se=q-re,C.offset>se){if((se=C.offset-se)>C.whave&&C.sane){R.msg="invalid distance too far back",C.mode=30;break}j=se>C.wnext?(se-=C.wnext,C.wsize-se):C.wnext-se,se>C.length&&(se=C.length),Te=C.window}else Te=ve,j=ne-C.offset,se=C.length;for(reG?(Z=j[Te+S[K]],N[te+S[K]]):(Z=96,0),E=1<>ne)+(D-=E)]=z<<24|Z<<16|he|0,D!==0;);for(E=1<>=1;if(E!==0?(B&=E-1,B+=E):B=0,K++,--q[R]==0){if(R===Q)break;R=y[w+S[K]]}if(ve>>7)]}function te(A,U){A.pending_buf[A.pending++]=255&U,A.pending_buf[A.pending++]=U>>>8&255}function q(A,U,H){A.bi_valid>T-H?(A.bi_buf|=U<>T-A.bi_valid,A.bi_valid+=H-T):(A.bi_buf|=U<>>=1,H<<=1,0<--U;);return H>>>1}function Te(A,U,H){var ue,V,be=new Array(S+1),pe=0;for(ue=1;ue<=S;ue++)be[ue]=pe=pe+H[ue-1]<<1;for(V=0;V<=U;V++){var fe=A[2*V+1];fe!==0&&(A[2*V]=j(be[fe]++,fe))}}function ae(A){var U;for(U=0;U>1;1<=H;H--)Ne(A,be,H);for(V=Le;H=A.heap[1],A.heap[1]=A.heap[A.heap_len--],Ne(A,be,1),ue=A.heap[1],A.heap[--A.heap_max]=H,A.heap[--A.heap_max]=ue,be[2*V]=be[2*H]+be[2*ue],A.depth[V]=(A.depth[H]>=A.depth[ue]?A.depth[H]:A.depth[ue])+1,be[2*H+1]=be[2*ue+1]=V,A.heap[1]=V++,Ne(A,be,1),2<=A.heap_len;);A.heap[--A.heap_max]=A.heap[1],(function(Be,Pt){var ie,Oe,Ps,ze,Zo,Ze,At=Pt.dyn_tree,Qo=Pt.max_code,io=Pt.stat_desc.static_tree,no=Pt.stat_desc.has_stree,Un=Pt.stat_desc.extra_bits,Io=Pt.stat_desc.extra_base,Bs=Pt.stat_desc.max_length,ro=0;for(ze=0;ze<=S;ze++)Be.bl_count[ze]=0;for(At[2*Be.heap[Be.heap_max]+1]=0,ie=Be.heap_max+1;ie<$;ie++)Bs<(ze=At[2*At[2*(Oe=Be.heap[ie])+1]+1]+1)&&(ze=Bs,ro++),At[2*Oe+1]=ze,Qo>=7;V>>=1)if(1&Ue&&fe.dyn_ltree[2*Le]!==0)return d;if(fe.dyn_ltree[18]!==0||fe.dyn_ltree[20]!==0||fe.dyn_ltree[26]!==0)return h;for(Le=32;Le>>3,(be=A.static_len+3+7>>>3)<=V&&(V=be)):V=be=H+5,H+4<=V&&U!==-1?O(A,U,H,ue):A.strategy===4||be===V?(q(A,2+(ue?1:0),3),Ae(A,Ce,R)):(q(A,4+(ue?1:0),3),(function(fe,Le,Ue,Be){var Pt;for(q(fe,Le-257,5),q(fe,Ue-1,5),q(fe,Be-4,4),Pt=0;Pt>>8&255,A.pending_buf[A.d_buf+2*A.last_lit+1]=255&U,A.pending_buf[A.l_buf+A.last_lit]=255&H,A.last_lit++,U===0?A.dyn_ltree[2*H]++:(A.matches++,U--,A.dyn_ltree[2*(C[H]+y+1)]++,A.dyn_dtree[2*N(U)]++),A.last_lit===A.lit_bufsize-1},l._tr_align=function(A){q(A,2,3),se(A,D,Ce),(function(U){U.bi_valid===16?(te(U,U.bi_buf),U.bi_buf=0,U.bi_valid=0):8<=U.bi_valid&&(U.pending_buf[U.pending++]=255&U.bi_buf,U.bi_buf>>=8,U.bi_valid-=8)})(A)}},{"../utils/common":41}],53:[function(i,r,l){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(i,r,l){(function(c){(function(d,h){if(!d.setImmediate){var p,f,b,y,w=1,v={},_=!1,$=d.document,S=Object.getPrototypeOf&&Object.getPrototypeOf(d);S=S&&S.setTimeout?S:d,p={}.toString.call(d.process)==="[object process]"?function(M){process.nextTick(function(){E(M)})}:(function(){if(d.postMessage&&!d.importScripts){var M=!0,P=d.onmessage;return d.onmessage=function(){M=!1},d.postMessage("","*"),d.onmessage=P,M}})()?(y="setImmediate$"+Math.random()+"$",d.addEventListener?d.addEventListener("message",D,!1):d.attachEvent("onmessage",D),function(M){d.postMessage(y+M,"*")}):d.MessageChannel?((b=new MessageChannel).port1.onmessage=function(M){E(M.data)},function(M){b.port2.postMessage(M)}):$&&"onreadystatechange"in $.createElement("script")?(f=$.documentElement,function(M){var P=$.createElement("script");P.onreadystatechange=function(){E(M),P.onreadystatechange=null,f.removeChild(P),P=null},f.appendChild(P)}):function(M){setTimeout(E,0,M)},S.setImmediate=function(M){typeof M!="function"&&(M=new Function(""+M));for(var P=new Array(arguments.length-1),W=0;W"u"?c===void 0?this:c:self)}).call(this,typeof eo<"u"?eo:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(OC);var ase=OC.exports;const ww=Xo(ase);function lse(a){const[s,i]=_e.useState(""),[r,l]=_e.useState("");return Lt(()=>{a.socket.decrypt(a.systemConfig.native.javascriptPassword).then(c=>l(c))},[a.systemConfig,a.socket]),m.jsxs(Ut,{open:!0,onClose:()=>a.onEntered(null),fullWidth:!0,maxWidth:"sm",children:[m.jsx(ss,{children:x.I18n.t("Please enter a password for expert mode")}),m.jsx(qt,{children:m.jsx(Eo,{autoFocus:!0,margin:"dense",variant:"standard",label:x.I18n.t("Password"),type:"password",fullWidth:!0,value:s,onKeyDown:c=>{c.key==="Enter"&&s&&(c.preventDefault(),c.stopPropagation(),r===s?a.onEntered(s):a.onEntered(""))},onChange:c=>i(c.target.value)})}),m.jsxs(Ht,{children:[m.jsx(He,{variant:"contained",disabled:!s,onClick:()=>{r===s?a.onEntered(s):a.onEntered("")},startIcon:m.jsx(qo,{}),children:x.I18n.t("Ok")}),m.jsx(He,{color:"grey",variant:"contained",onClick:()=>a.onEntered(null),startIcon:m.jsx(so,{}),children:x.I18n.t("Cancel")})]})]})}const Gr={root:{flexGrow:1,display:"flex",width:"100%",height:"100%"},mainDiv:{width:"100%",height:"100%",overflow:"hidden"},content:a=>({width:"100%",height:"100%",backgroundColor:a.palette.background&&a.palette.background.default,position:"relative"}),menuOpenCloseButton:a=>({position:"absolute",left:0,borderRadius:"0 5px 5px 0",top:6,pt:1,cursor:"pointer",zIndex:1,height:25,width:20,background:a.palette.secondary.main,color:a.palette.primary.main,pl:"3px","&:hover":{color:"white"}}),showLogButton:a=>({position:"absolute",right:3,borderRadius:"5px 5px 0 0",bottom:0,pt:"3px",cursor:"pointer",zIndex:10,height:20,width:25,background:a.palette.secondary.main,color:a.palette.primary.main,pl:1,"&:hover":{color:"white"}})};class cse extends x.GenericApp{hosts=[];importFile=null;importFileName=null;scripts={};confirmCallback=null;changedScripts={};javascriptPassword="";constructor(s){super(s,{Connection:x.AdminConnection,translations:{en:hM,de:rB,es:ej,fr:YU,it:U5,nl:LV,pl:D6,pt:C7,ru:bq,uk:hQ,"zh-cn":rse},bottomButtons:!1,socket:{autoSubscribeLog:!0},sentryDSN:window.sentryDSN});const i=window.localStorage.getItem("JS.logSizes");let r=[80,20];if(i)try{r=JSON.parse(i)}catch{}const l=window.localStorage.getItem("JS.splitSizes");let c=[20,80];if(l)try{c=JSON.parse(l)}catch{}this.state={...this.state,splitSizes:c,logSizes:r},window.alert=d=>{console.error(d),this.showJsError(d.toString())}}onScriptsChanged=(s,i)=>{if(!s)return;let r=!1;const l={};s.startsWith("script.js.")&&(i?JSON.stringify(this.scripts[s])!==JSON.stringify(i)&&(this.scripts[s]=i,r=!0,l.scriptsHash=this.state.scriptsHash+1):this.scripts[s]&&(delete this.scripts[s],r=!0,l.scriptsHash=this.state.scriptsHash+1)),r&&this.setState(l)};onInstanceChanged=(s,i)=>{var c;if(!s)return;let r=!1;const l={};if(s.match(/^system\.adapter\.[-_\w\d]+\$/)){if(s.startsWith(`system.adapter.${this.adapterName}.`)){const d=parseInt(s.split(".").pop()||"0",10)||0;if((i==null?void 0:i.type)==="instance")this.state.instances.includes(d)||(l.instances=[...this.state.instances],l.instances.push(d),l.instances.sort(),r=!0,this.socket.subscribeState(`${i._id}.alive`,this.onInstanceAliveChange));else if(!i&&this.state.instances.includes(d)){this.socket.unsubscribeState(`${s}.alive`,this.onInstanceAliveChange),l.instances=[...this.state.instances];const h=l.instances.indexOf(d);l.instances.splice(h,1),r=!0}}(c=i==null?void 0:i.common)!=null&&c.blockly&&(this.confirmCallback=d=>d&&window.location.reload(),l.confirm=x.I18n.t("Some blocks were updated. Reload admin?"),r=!0)}r&&this.setState(l)};onHostChanged=(s,i)=>{if(s&&s.startsWith("system.host.")){if((i==null?void 0:i.type)==="host")this.hosts.includes(s)||(this.hosts.push(s),this.hosts.sort());else if(!i&&this.hosts.includes(s)){const r=this.hosts.indexOf(s);this.hosts.splice(r,1)}}};onConnectionReady(){window.systemLang=this.socket.systemLang,this.setState({ready:!1,scriptsHash:0,instances:[],updating:!1,resizing:!1,selected:null,logMessage:{},editing:[],menuOpened:window.localStorage.getItem("App.menuOpened")!=="false",menuSelectId:"",expertMode:window.localStorage.getItem("App.expertMode")==="true",logHorzLayout:window.localStorage.getItem("App.logHorzLayout")==="true",runningInstances:{},confirm:"",importFile:!1,message:"",searchText:"",hideLog:window.localStorage.getItem("App.hideLog")==="true",debugMode:!1,debugInstance:null,splitSizes:[20,80],password:""},async()=>{var d;const s={},i=await this.subscribeOnInstances();s.instances=i.instances,s.runningInstances=i.runningInstances,this.javascriptPassword=((d=this.socket.systemConfig)==null?void 0:d.native.javascriptPassword)||"",await this.readAdaptersWithBlockly();const r=await this.socket.getHosts();this.hosts=r.map(h=>h._id);const l=await this.readAllScripts();window.localStorage.getItem("App.expertMode")!=="true"&&window.localStorage.getItem("App.expertMode")!=="false"&&!this.javascriptPassword?Object.keys(l).find(h=>h.startsWith("script.js.global.")&&l[h].type==="script")&&(s.expertMode=!0):this.javascriptPassword&&(s.expertMode=!1),this.scripts=l;let c=this.state.scriptsHash;this.compareScripts(l)&&c++,s.scriptsHash=c,s.ready=!0,this.setState(s),await this.socket.subscribeObject("script.*",this.onScriptsChanged),await this.socket.subscribeObject("system.adapter.*",this.onInstanceChanged),await this.socket.subscribeObject("system.host.*",this.onHostChanged)})}async subscribeOnInstances(){const i=(await this.socket.getAdapterInstances(this.adapterName)).map(l=>parseInt(l._id.split(".").pop()||"0")).sort(),r={};i.forEach(l=>r[`system.adapter.${this.adapterName}.${l}`]=!1);for(let l=0;ls[r]=i[r]),s}async readAdaptersWithBlockly(){const s=await this.socket.getObjectViewSystem("adapter","system.adapter.","system.adapter.香");return new Promise(i=>et.loadCustomBlockly(s,()=>i()))}onInstanceAliveChange=(s,i)=>{if(s&&(s=s?s.substring(0,s.length-6):"",this.state.runningInstances[s]!==(i?i.val:!1))){const r=JSON.parse(JSON.stringify(this.state.runningInstances));r[s]=i?!!i.val:!1,this.setState({runningInstances:r})}};compareScripts(s){const i=Object.keys(this.scripts),r=Object.keys(s);if(i.length!==r.length)return this.scripts=s,!0;if(JSON.stringify(i)!==JSON.stringify(r))return this.scripts=s,!0;for(let l=0;l ${i}`),this.setState({updating:!0});try{if(((c=this.scripts[s])==null?void 0:c.type)==="script"){const d=JSON.parse(JSON.stringify(this.scripts[s].common));d.name=r||d.name,l!==void 0&&(d.engine=`system.adapter.javascript.${l}`);const h=i.split(".");h.pop();const p=h.join(".");this.scripts[p]&&this.scripts[p].type==="script"&&(h.pop(),i=`${h.join(".")}.${i.split(".").pop()}`),await this.updateScript(s,i,d)}else await this.renameGroup(s,i,r)}catch(d){d.toString().includes("canceled")||this.showJsError(d)}this.setState({updating:!1})}async renameGroup(s,i,r,l){if(l){if(l.length){let c=l.pop();if(c){const d=await this.socket.getObject(c);if(d){try{await this.socket.delObject(c)}catch{}c=i+c.substring(s.length),d._id=c,d.common=d.common||{},d.common.expert=!0,await this.socket.setObject(c,d),await this.renameGroup(s,i,r,l)}}}}else{l=[],l=Object.keys(this.scripts).filter(d=>d.startsWith(`${s}.`));let c=await this.socket.getObject(s);c=c||{common:{},type:"channel"},c.common.name=r||c.common.name||s.split(".").pop()||"",c._id=i;try{await this.socket.delObject(s)}catch{}try{await this.socket.setObject(i,c),await this.renameGroup(s,i,r,l)}catch(d){console.log(d);const h={_id:i,type:"channel",common:{name:r||s.split(".").pop()||"",expert:!0},native:{}};await this.socket.setObject(i,h),await this.renameGroup(s,i,r,l)}}}async onUpdateScript(s,i){var r;if(((r=this.scripts[s])==null?void 0:r.type)==="script")try{await this.updateScript(s,s,i)}catch(l){l.toString().includes("canceled")||this.showJsError(l)}}onSelect(s){this.scripts[s]&&this.scripts[s].common&&this.scripts[s].type==="script"&&this.setState({selected:s,menuSelectId:s},()=>setTimeout(()=>this.setState({menuSelectId:""}),300))}renderPasswordDialog(){return this.state.showPasswordDialog?m.jsx(lse,{socket:this.socket,systemConfig:this.socket.systemConfig,onEntered:s=>{s===null?this.setState({showPasswordDialog:!1,expertMode:!1,password:""}):s?this.setState({expertMode:!0,showPasswordDialog:!1,password:s}):this.setState({showPasswordDialog:!1,expertMode:!1,message:x.I18n.t("Wrong password"),password:""})}},"passwordDialog"):null}onExpertModeChange(s){var i;if(this.state.expertMode!==s)if(s&&this.javascriptPassword)this.setState({showPasswordDialog:!0});else{let r=this.state.selected;r&&!s&&((i=this.scripts[r].native)!=null&&i.protected)&&(r=this.state.editing.find(l=>{var c;return this.scripts[l]&&!((c=this.scripts[l].native)!=null&&c.protected)})||null),window.localStorage.setItem("App.expertMode",s?"true":"false"),this.setState({expertMode:s,password:"",selected:r})}}showJsError(s){this.setState({errorText:s?s.toString():""})}showMessage(s){this.setState({message:s?s.toString():""})}onDelete(s){this.socket.delObject(s).catch(i=>this.showJsError(i))}onEdit(s){this.state.selected!==s&&this.setState({selected:s})}onAddNew(s,i,r,l,c,d){const h=new RegExp(`^${s}\\.`);if(Object.keys(this.scripts).find(p=>s===p||h.test(s)))return this.showJsError(x.I18n.t("Yet exists!"));r?this.socket.setObject(s,{_id:s,type:"channel",common:{name:i,expert:!0},native:{}}).then(()=>setTimeout(()=>this.setState({menuSelectId:s},()=>setTimeout(()=>this.setState({menuSelectId:""}),300)),1e3)).catch(p=>this.showJsError(p)):(c==="Blockly"&&!d&&(d=` + await setStateAsync("${s.oidResult}", val1_${s._id} ${s.operation} val2_${s._id}, ${s.tagCard==="update"});`}renderDebug(s){var i,r;return m.jsxs("span",{children:[x.I18n.t("Set:")," ",m.jsx("span",{className:s.data.ack?(i=this.props.classes)==null?void 0:i.valueAck:(r=this.props.classes)==null?void 0:r.valueNotAck,children:Ln(s.data.val)})]})}onTagChange(){const s=[];s.push({nameRender:"renderObjectID",title:"ID1",attr:"oid1",defaultValue:"",checkReadOnly:!1}),s.push({nameRender:"renderSelect",options:[{value:"+",title:"+"},{value:"-",title:"-"},{value:"*",title:"*"},{value:"/",title:"/"}],doNotTranslate:!0,defaultValue:"+",attr:"operation"}),s.push({nameRender:"renderObjectID",title:"ID2",attr:"oid2",defaultValue:"",checkReadOnly:!1}),s.push({nameRender:"renderNameText",defaultValue:"store in",attr:"textEqual"}),s.push({nameRender:"renderObjectID",attr:"oidResult",defaultValue:"",checkReadOnly:!0}),this.setState({inputs:s},()=>super.onTagChange(null,()=>{const i=JSON.parse(JSON.stringify(this.state.settings));this.props.onChange(i)}))}onValueChanged(s,i){this.onTagChange()}onUpdate(){this.onTagChange()}static getStaticData(){return{acceptedBy:"actions",name:"Operate two states",id:"ActionOperateStates",icon:"AddBox",tagCardArray:["control","update"],title:"Operations with two states"}}getData(){return Vc.getStaticData()}}const fO=[Ii,Pc,Bc,qr,Xr,Vo,jc,Fc,zc,Uc,Hc,Wc,Gc,Vc],hc={sayit:Oc,pushover:Nc,"whatsapp-cmb":Mc,pushsafer:Lc},$O=um({blocks:null,socket:null,onUpdate:!1,setOnUpdate:a=>{},setOnDebugMessage:a=>{},onDebugMessage:[],enableSimulation:!1,setEnableSimulation:a=>{},changedScripts:{},setChangedScripts:a=>{}}),bO=({children:a,socket:s})=>{const[i,r]=kt(null),[l,c]=kt(!1),[d,h]=kt([]),[p,f]=kt(!1),[b,y]=kt({});return Lt(()=>{l&&c(!1)},[l]),Lt(()=>{(async()=>{const w=await s.getAdapterInstances(),v=Object.keys(hc).filter(E=>w.find(D=>{var M;return((M=D==null?void 0:D.common)==null?void 0:M.name)===E})),_=[],$=w.filter(E=>E.common.javascriptRules),S=[];for(const E of $){if(S.includes(E.common.name)||!E.common.javascriptRules)continue;let D;if(E.common.javascriptRules.url.startsWith("http:")||E.common.javascriptRules.url.startsWith("https:")?D=E.common.javascriptRules.url:E.common.javascriptRules.url.startsWith("./")?D=`${window.location.protocol}//${window.location.host}${E.common.javascriptRules.url.replace(/^\./,"")}`:D=`${window.location.protocol}//${window.location.host}/adapter/${E.common.name}/${E.common.javascriptRules.url}`,E.common.javascriptRules.i18n===!0){const M=D.lastIndexOf("/");let P;M!==-1?P=D.substring(0,M):P=D;const W=x.I18n.getLanguage(),G=`${P}/i18n/${W}.json`;await fetch(G).then(z=>z.json()).then(z=>x.I18n.extendTranslations(z,W)).catch(z=>{if(W!=="en")return fetch(`${P}/i18n/en.json`).then(Z=>Z.json()).then(Z=>x.I18n.extendTranslations(Z,W)).catch(Z=>console.error(`Cannot load i18n "${G}": ${Z}`));console.log(`Cannot load i18n "${G}": ${z}`)})}else if(E.common.javascriptRules.i18n&&typeof E.common.javascriptRules.i18n=="object")try{x.I18n.extendTranslations(E.common.javascriptRules.i18n)}catch(M){console.error(`Cannot import i18n for "${E.common.javascriptRules.name}": ${M}`)}try{e_.registerRemotes([{name:E.common.javascriptRules.name,entry:D,type:E.common.javascriptRules.type}]);const M=(await e_.loadRemote(`${E.common.javascriptRules.name}/${E.common.javascriptRules.name}`)).default;M&&(_.push(M),S.push(E.common.name),hc[E.common.name]=null)}catch(M){console.error(`Cannot load component "${E.common.javascriptRules.name}": ${M}`)}}const T=v.filter(E=>hc[E]).map(E=>hc[E]);r([...fO,...T,..._])})()},[]),m.jsx($O.Provider,{value:{blocks:i,socket:s,onUpdate:l,setOnUpdate:c,onDebugMessage:d,setOnDebugMessage:h,enableSimulation:p,setEnableSimulation:f,changedScripts:b,setChangedScripts:y},children:a})},vO="Acknowledged",yO="Actions",_O="Add",wO="All",kO="Any",CO="Apply",TO="April",SO="Ask",EO="Astronomical",IO="August",xO="Cancel",DO="Close",AO="Condition",RO="Conditions",OO="Console",NO="Copied",MO="December",LO="Default",PO="Delay",BO="Delete",jO="Description",FO="Done",zO="Exec shell",UO="Explanation",HO="Export",WO="Februar",GO="February",VO="Filter",KO="Folder",YO="Fr",JO="Friday",qO="ID",XO="ID1",ZO="ID2",QO="Import",e1="Instance",t1="Instances",s1="Instructions",o1="Januar",i1="January",n1="July",r1="June",a1="Limit",l1="March",c1="May",u1="Menu",d1="Message",h1="Mo",p1="Model",g1="Monday",m1="Month",f1="More",$1="Name",b1="November",v1="OK",y1="October",_1="Ok",w1="Pause",k1="Pushover",C1="Pushsafer",T1="Reload",S1="Rename",E1="Repeat",I1="Restart",x1="Result",D1="Sa",A1="Saturday",R1="Save",O1="Schedule",N1="Script",M1="September",L1="Simulate",P1="Stack",B1="Start",j1="State",F1="Su",z1="Sunday",U1="Telegram",H1="Th",W1="Thursday",G1="Time",V1="Triggered",K1="Triggers",Y1="Tu",J1="Tuesday",q1="URL",X1="Value",Z1="Volume",Q1="We",eN="Wednesday",tN="Write",sN="Yes",oN="acknowledgment",iN="all",nN="and",rN="Astro",aN="at",lN="control",cN="copy",uN="CRON",dN="Dawn",hN="This is a special mode in which states and objects will not change. But only information about each planned change will be displayed in the protocol.",pN="Debug",gN="Dusk",mN="easy",fN="every",$N="Function",bN="ID",vN="Name",yN="Role",_N="Room",wN="Golden hour",kN="End of golden hour",CN='The code will be executed only every time when condition is true. E.g. if triggering on the temperature sensor value and the condition is "if temperature is greater than 20°C", the "then" actions will be executed every time when sensor sends the temperature and it is over 20°C. By 21°C, by 22°C and so on.',TN='The code will be executed only if the condition result changes. E.g. if triggering on the temperature sensor value and the condition is "if temperature is greater than 20°C", the "then" actions will be executed once when temperature is over 20. Next time the "then" actions will be executed when the temperature fails under 20 and then rises over 20 again.',SN="hours",EN="includes",IN="interval",xN="magic",DN="milliseconds",AN="minutes",RN="ms",ON="Nadir",NN="Nautical dawn",MN="Nautical dusk",LN="Next Sunrise",PN="Next sunset",BN="Night",jN="Night end",FN="normal",zN="offset",UN="one",HN="or",WN="quiet",GN="search",VN="seconds",KN="Solar noon",YN="sunrise",JN="Sunrise end",qN="Sunset",XN="Sunset start",ZN="then",QN="Acknowledge",eM="From",tM="Last changed",sM="Quality",oM="Timestamp",iM="User",nM="Value",rM="two",aM="update",lM="Adds debug output to the log for many system commands",cM="Verbose log outputs",uM="when",dM="Wizard",hM="Retry",pM={"%s not found":"%s not found","()":"()","(at %s)":"(at %s)","(optional)":"(optional)","-":"-",".":".","AI code generator":"AI code generator",Ack:vO,Actions:yO,"Actual time of day":"Actual time of day",Add:_O,"Add new script":"Add new script",All:wO,"All files will be accepted":"All files will be accepted",Any:kO,"Any month":"Any month",Apply:CO,April:TO,"Are you sure?":"Are you sure?",Ask:SO,Astronomical:EO,"Astronomical events today":"Astronomical events today",August:IO,"Blockly description":"Creating rules by graphic blocks","Body:":"Body:",Cancel:xO,"Cannot delete non empty item!":"Cannot delete non empty item!","Change layout":"Change layout",'Change theme (actual "%s")':'Change theme (now - "%s")',"Check blocks":"Check blocks","Check is not active, because javascript adapter is disabled":"Check is not active, because Javascript adapter is disabled","Clear search input":"Clear search input","Click on this icon":"Click on this icon",Close:DO,"Close all but current":"Close all but current","Collapse all":"Collapse all","Compares current time with astronomical event":"Compares current time with astronomical event","Compares current time with the user specific time":"Compares current time with the user specific time","Compares the state value with user defined value":"Compares the state value with user defined value",Condition:AO,Conditions:RO,"Configuration not saved.":"Configuration not saved.",Console:OO,"Control or update some state":"Control or update some state","Control or update some state with delay":"Control or update some state with delay","Convert blockly to javascript for ever.":"Permanently convert Blockly to Javascript.",Copied:NO,"Copy script":"Copy script","Copy to clipboard":"Copy to clipboard","Create new":"Create new","Create new folder":"Create new folder","Create new script":"Create new script","Create or edit CRON or time wizard":"Create or edit CRON or time wizard","Dark Theme":"Dark theme","Dark style":"Dark style",Date:"Date","Debug instance":"Debug instance","Debug options":"Debug options",December:MO,Default:LO,"Define cron...":"Define cron...","Define schedule...":"Define schedule...",Delay:PO,Delete:BO,"Delete %s":"Delete %s...","Delete folder":"Delete folder","Delete script":"Delete script",Description:jO,"Deselect all":"Deselect all","Discard changes for %s":"Discard changes for %s",Done:FO,"Double click to write value":"Double click to write value","Download as file":"Download as file","Drop some files here or click...":"Drop some files here or click...","Duplicate name":"Duplicate name","Edit script or just double click":"Edit script or just double click","Empty name is not allowed":"Empty name is not allowed","End search mode":"End search mode","Enter your question":"Enter your request",Error:"Error","Error formatting code":"Error formatting code","Error was found":"Error was found","Every day":"Every day",Exec:zO,"Executes some shell command":"Executes some shell command","Existing scripts will be overwritten.":"Existing scripts will be overwritten.","Expand all":"Expand all","Expert mode":"Expert mode",Explanation:UO,Export:HO,"Export all scripts":"Export all scripts","Export blocks":"Export blocks","Export selected blocks":"Export selected blocks",Februar:WO,February:GO,Filter:VO,Folder:KO,Fr:YO,Friday:JO,Function:"Function","Function editor":"Function editor","Function: executed":"Function: executed","Go to next line":"Go to next line","HTTP Call":"HTTP Call","Hide logs":"Hide logs",ID:qO,ID1:XO,ID2:ZO,Import:QO,"Import blocks":"Import blocks","Import error":"Import error","Import scripts":"Import scripts","Insert object ID":"Insert object ID",Instance:e1,"Instance is disabled":"Instance is disabled","Instance:":"Instance:",Instances:t1,Instructions:s1,"Invalid CRON":"Invalid CRON","It will not be possible to revert this operation.":"It will not be possible to revert this operation.","JS description":"Creating rules by writing Javascript",Januar:o1,January:i1,July:n1,June:r1,"Just check":"Just check","Keep my changes":"Keep my changes","Language:":"Language:","Learn More":"Learn More","Light style":"Light style",Limit:a1,"Local time":"Local time","Locate file":"Locate file","Log outputs":"Log outputs","Log text":"Log text","Log: %s":"Log: %s","Make a HTTP get request":"Make a HTTP get request","Make a pause between actions":"Make a pause between actions",March:l1,"March ":"March ",May:c1,Menu:u1,Message:d1,Mo:h1,Model:p1,Monday:g1,Month:m1,More:f1,Name:$1,"No API key found":"No API key found","No Chat GPT Key found":"No Chat GPT Key found","No active host found":"No active host found","Nothing found":"Nothing found",November:b1,OK:v1,October:y1,Ok:_1,"On condition change":"On condition result change","On script save or adapter start":"On script save or adapter start","On weekdays":"On weekdays","Open configuration":"Open configuration","Operate two states":"Operate two states","Operations with two states":"Operations with two states","Paste your blocks here":"Paste your blocks here",Pause:w1,"Pause execution":"Pause execution","Pause script":"Pause script","Phone:":"Phone:","Please select object ID...":"Please select object ID...","Press Ctrl+Enter to get the answer":"Press Ctrl+Enter to get the answer","Prettify the script":"Prettify the script","Print some text in log":"Print some text in log","Priority:":"Priority:",Pushover:k1,Pushsafer:C1,"Read only ID selected: %s":"Read only ID selected: %s",Reload:T1,Rename:S1,"Reorder scripts in folders":"Reorder scripts in folders",Repeat:E1,Restart:I1,Result:x1,"Resume execution":"Resume execution","Root folder":"Root folder","Rules description":"Create rules with IF, THEN, ELSE blocks","Run script":"Run script",Sa:D1,Saturday:A1,Save:R1,"Save all":"Save all","Say It":"Say It","Say some text via sayit adapter":"Say some text via sayit adapter",Schedule:O1,Script:N1,"Script %s was modified on disk":"Script %s was modified on disk","Script was modified externally":"Script was modified externally","Script is not running":"Script is not running","Search in scripts":"Search in scripts","Search...":"Search...","Select all":"Select all","Send email":"Send email","Sends an email":"Sends an email","Sends message via Pushsafer":"Sends message via Pushsafer","Sends message via pushover":"Sends message via pushover","Sends message via telegram":"Sends message via telegram","Sends message via whatsapp-cmb":"Sends message via whatsapp-cmb",September:M1,"Server time":"Server time","Set state action":"Set state action","Set with delay":"Set with delay","Shell command":"Shell command","Show astronomical events":"Show astronomical events","Show javascript code":"Show Javascript code","Show logs":"Show logs","Show only paused scripts":"Show only paused scripts","Show only running scripts":"Show only running scripts","Show only scripts with problems":"Show only scripts with problems",Simulate:L1,"Some files will be rejected":"Some files will be rejected","Sound:":"Sound:",Stack:P1,Start:B1,"Start script":"Start script",State:j1,"State condition":"State condition","Step into function":"Step into function","Step out from function":"Step out from function","Stop on exception":"Stop on exception",Su:F1,"Subject:":"Subject:",Sunday:z1,"TS description":"Creating rules by writing Typescript",Telegram:U1,"Text:":"Text:",Th:H1,'The script "%s" has been modified by another user or in another window. Do you want to reload the script or keep your local changes?':'The script "%s" has been modified by another user or in another window. Do you want to reload the script or keep your local changes?',"The script will be stopped and must be activated manually after debugging. Continue?":"The script will be stopped and must be activated manually after debugging. Continue?","This is advances option. You can write your own code here and it will be executed on trigger":"This is advances option. You can write your own code here and it will be executed on trigger",Thursday:W1,Time:G1,"Time condition":"Time condition","Title:":"Title:","To:":"To:","Trigger with value":"Trigger with value",Triggered:V1,Triggers:K1,"Triggers the on script saving or the javascript instance restart":"Triggers the on script saving or the javascript instance restart","Triggers the rule on update or change of some state":"Triggers the rule on update or change of some state","Triggers the rule periodically or on some specific time":"Triggers the rule periodically or on some specific time",Tu:Y1,Tuesday:J1,URL:q1,"Unknown error":"Unknown error","Unknown error!":"Unknown error!","Use generated code":"Use generated code","User function":"User function","User:":"User:",Value:X1,"Vibration:":"Vibration:",Volume:Z1,We:Q1,Wednesday:eN,"Whatsapp-cmb":"Whatsapp-cmb",Write:tN,"Write your own code":"Write your own code",Yes:sN,"Yet exists!":"Yet exists!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"You can use %s in the URL to use current trigger value, %id to use the triggered object ID, %name to show triggered object ID name or %old to use old trigger value","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"You can use %s in the command to use current trigger value, %id to use the triggered object ID, %name to show triggered object ID name or %old to use old trigger value","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"You can use %s in the text to display current trigger value, %id to use the triggered object ID, %name to show triggered object ID name or %old to use old trigger value","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"You can use %s in the value to use the current trigger value, %id to use the triggered object ID, %name to show triggered object ID name or %old to use old trigger value","You have to enter OpenAI API key in the configuration of javascript adapter.":"You have to enter OpenAI API key in the configuration of javascript adapter.","You have to enter at least one API key in the configuration of javascript adapter.":"You have to enter at least one API key (OpenAI, Anthropic or Gemini) in the configuration of javascript adapter.","Please select a valid model":"Please select a valid model","[equal]":"[equal]","[greater or equal]":"[greater or equal]","[greater]":"[greater]","[hysteresis]":"[hysteresis]","[includes]":"[includes]","[less or equal]":"[less or equal]","[less]":"[less]","[not equal]":"[not equal]",acknowledgment:oN,all:iN,and:nN,"as JSON":"as JSON","as plain text":"as plain text",astro:rN,at:aN,"clear running":"clear running",control:lN,copy:cN,cron:uN,dawn:dN,debug_help:hN,debug_label:pN,default:"default",dusk:gN,easy:mN,else:"else","equal to":"equal to",every:fN,"every hour at 0 minutes":"every hour at 0 minutes",false:"false","file reading has failed: %s":"file reading has failed: %s","file reading was aborted":"file reading was aborted",filter_func:$N,filter_id:bN,filter_name:vN,filter_role:yN,filter_room:_N,"for edit or create script":"for edit or create a new script","for professionals":"for professionals","for programmers":"for programmers",goldenHour:wN,goldenHourEnd:kN,"greater or equal":"greater or equal","greater or equal to":"greater or equal to","greater than":"greater than",help_just_check:CN,help_on_change:TN,"high priority":"high priority","high-priority":"high-priority","highest priority":"highest priority",hours:SN,includes:EN,interval:IN,"just check":"just check","less or equal":"less or equal","less or equal to":"less or equal to","less than":"less than","lower priority":"lower priority","lowest priority":"lowest priority",magic:xN,milliseconds:DN,minutes:AN,ms:RN,nadir:ON,nauticalDawn:NN,nauticalDusk:MN,nextSunrise:LN,nextSunset:PN,night:BN,nightEnd:jN,"no blocks found":"No blocks found","no group":"NO GROUP",normal:FN,"normal priority":"normal priority","not running":"not running","not equal to":"not equal to","not properly connected":"This block is not properly connected to other blocks.",offset:zN,"on change":"on change","on condition change":"on condition change","on update":"on update",one:UN,or:HN,quiet:WN,"reset search":"reset search",search:GN,seconds:VN,solarNoon:KN,"store in":"store in",sunrise:YN,sunriseEnd:JN,sunset:qN,sunsetStart:XN,then:ZN,"toggle value":"toggle value",tooltip_ack:QN,tooltip_from:eM,tooltip_lc:tM,tooltip_quality:sM,tooltip_ts:oM,tooltip_user:iM,tooltip_value:nM,true:"true",two:rM,undefined:"undefined",update:aM,"use seconds":"use seconds","use trigger value":"use trigger value",verbose_help:lM,verbose_label:cM,when:uM,with:"with","with date":"with date","with offset":"with offset",wizard:dM,"Loading models...":"Loading models...","Could not connect to API at %s":"Could not connect to API at %s","Invalid API key":"Invalid API key","Access denied by API":"Access denied by API","API error: %s":"API error: %s",'Model "%s" not found':'Model "%s" not found',"Request failed: %s":"Request failed: %s",Retry:hM,"No running javascript instance found":"No running javascript instance found"},gM="Bestätigt",mM="Aktionen",fM="Hinzufügen",$M="Alle",bM="Egal",vM="Anwenden",yM="April",_M="Fragen",wM="Astronomisch",kM="August",CM="Abbrechen",TM="Schließen",SM="Bedingung",EM="Bedingungen",IM="Konsole",xM="Kopiert",DM="Dezember",AM="Standard",RM="Verzögerung",OM="Löschen",NM="Beschreibung",MM="Fertig",LM="Exec shell",PM="Erläuterung",BM="Export",jM="Februar",FM="Februar",zM="Filter",UM="Ordner",HM="Fr",WM="Freitag",GM="ID",VM="ID1",KM="ID2",YM="Import",JM="Instanz",qM="Instanzen",XM="Anleitung",ZM="Januar",QM="Januar",eL="Juli",tL="Juni",sL="Grenze",oL="März",iL="Mai",nL="Menü",rL="Nachricht",aL="Mo",lL="Modell",cL="Montag",uL="Monat",dL="Mehr",hL="Name",pL="November",gL="OK",mL="Oktober",fL="Ok",$L="Pause",bL="Pushover",vL="Pushsafer",yL="Neu laden",_L="Umbenennen",wL="Wiederholen",kL="Neustart",CL="Ergebnis",TL="Sa",SL="Samstag",EL="Speichern",IL="Zeitplan",xL="Skript",DL="September",AL="Simulieren",RL="Stack",OL="Start",NL="Zustand",ML="So",LL="Sonntag",PL="Telegram",BL="Do",jL="Donnerstag",FL="Zeit",zL="Ausgelöst",UL="Löst aus",HL="Di",WL="Dienstag",GL="URL",VL="Wert",KL="Volumen",YL="Mi",JL="Mittwoch",qL="Schreiben",XL="Ja",ZL="Wissen",QL="alle",eP="und",tP="Astro",sP="um",oP="Steuerung",iP="Kopie",nP="CRON",rP="Morgendämmerung",aP="Dies ist ein spezieller Modus, in dem sich Zustände und Objekte nicht ändern. Im Protokoll werden jedoch nur Informationen zu jeder geplanten Änderung angezeigt.",lP="Debuggen",cP="Abenddämmerung",uP="einfach",dP="jeder",hP="Funktion",pP="ID",gP="Name",mP="Rolle",fP="Raum",$P="Goldene Abendstunde",bP="Vormittag",vP='Der Code wird jedes Mal ausgeführt, wenn die Bedingung erfüllt ist. z.B. wenn der Temperatur wert sich ändert und die Bedingung "Wenn die Temperatur größer als 20°C ist" lautet, werden die "Dann" -Aktionen jedes Mal ausgeführt, wenn der Sensor die Temperatur sendet und diese über 20°C liegt. Bei 21°C, bei 22°C und so weiter.',yP='Der Code wird nur ausgeführt, wenn sich das Ergebnis der Bedingung ändert. z.B. wenn sich der Temperatur wert ändert und die Bedingung "Wenn die Temperatur größer als 20°C ist" lautet, werden die "Dann" -Aktionen einmal ausgeführt, wenn die Temperatur über 20°C liegt. Das nächste Mal werden die "Dann" -Aktionen ausgeführt, wenn die Temperatur unter 20°C gefallen ist und dann wieder über 20°C ansteigt.',_P="Stunden",wP="beinhaltet",kP="Intervall",CP="Magie",TP="Millisekunden",SP="Minuten",EP="ms",IP="Nadir",xP="nautische Morgendämmerung",DP="nautische Abenddämmerung",AP="Nächster Sonnenaufgang",RP="Nächster Sonnenuntergang",OP="Nacht",NP="astronomische Morgendämmerung",MP="Normal",LP="Versatz",PP="einer",BP="oder",jP="ruhig",FP="Suche",zP="Sekunden",UP="(Nach-)Mittag",HP="Sonnenaufgang",WP="Goldene Morgenstunde",GP="Sonnenuntergang",VP="Sonnenuntergang (Anfang)",KP="dann",YP="Bestätigen",JP="Von",qP="Zuletzt geändert",XP="Qualität",ZP="Zeitstempel",QP="Benutzer",eB="Wert",tB="zwei",sB="Aktualisieren",oB="Fügt Debug-Ausgaben für viele Systembefehle zum Protokoll hinzu",iB="Ausführliche Protokollausgaben",nB="falls",rB="Assistent",aB="Erneut versuchen",lB={"%s not found":"%s nicht gefunden","()":"()","(at %s)":"(um %s)","(optional)":"(optional)","-":"-",".":".","AI code generator":"KI-Codegenerator",Ack:gM,Actions:mM,"Actual time of day":"Tatsächliche Tageszeit",Add:fM,"Add new script":"Neues Skript hinzufügen",All:$M,"All files will be accepted":"Alle Dateien werden akzeptiert",Any:bM,"Any month":"Jeden Monat",Apply:vM,April:yM,"Are you sure?":"Wirklich sicher?",Ask:_M,Astronomical:wM,"Astronomical events today":"Astronomische Ereignisse heute",August:kM,"Blockly description":"Erstellen von Regeln durch Grafikblöcke","Body:":"Körper:",Cancel:CM,"Cannot delete non empty item!":"Kann nicht gelöscht werden, weil noch einige Elementen darin sind!","Change layout":"Layout ändern",'Change theme (actual "%s")':'Thema ändern (jetzt - "%s")',"Check blocks":"Blöcke prüfen","Check is not active, because javascript adapter is disabled":"Syntax-Check ist nicht aktiv, weil der Javascript Adapter nicht aktiv ist.","Clear search input":"Sucheingabe löschen","Click on this icon":"Auf dieses Symbol klicken",Close:TM,"Close all but current":"Alle anderen außer dem Aktiven schließen","Collapse all":"Alles einklappen","Compares current time with astronomical event":"Vergleicht die aktuelle Zeit mit einem astronomischen Ereignis","Compares current time with the user specific time":"Vergleicht die aktuelle Zeit mit der benutzerspezifischen Zeit","Compares the state value with user defined value":"Vergleicht den Zustandswert mit dem benutzerdefinierten Wert",Condition:SM,Conditions:EM,"Configuration not saved.":"Die Konfiguration ist nicht gespeichert.",Console:IM,"Control or update some state":"Zustand steuern oder aktualisieren","Control or update some state with delay":"Zustand mit Verzögerung steuern oder aktualisieren","Convert blockly to javascript for ever.":"Blockly dauerhaft in Javascript konvertieren.",Copied:xM,"Copy script":"Skript kopieren","Copy to clipboard":"In die Zwischenablage kopieren","Create new":"Neu erstellen","Create new folder":"Neuen Ordner erstellen","Create new script":"Neues Skript erstellen","Create or edit CRON or time wizard":"CRON- oder Zeit-Assistenten erstellen oder bearbeiten","Dark Theme":"Dunkles Thema","Dark style":"Dunkler Stil",Date:"Datum","Debug instance":"Debug-Instanz","Debug options":"Debug-Optionen",December:DM,Default:AM,"Define cron...":"Cron definieren ...","Define schedule...":"Zeitplan definieren ...",Delay:RM,Delete:OM,"Delete %s":"Löschen %s...","Delete folder":"Ordner löschen","Delete script":"Skript löschen",Description:NM,"Deselect all":"Alles abwählen","Discard changes for %s":"Änderungen für %s verwerfen",Done:MM,"Double click to write value":"Doppelklick zum Schreiben des Wertes","Download as file":"Download als Datei","Drop some files here or click...":"Dateien hier ablegen oder klicken ...","Duplicate name":"Doppelter Name","Edit script or just double click":"Skript bearbeiten oder einfach doppelklicken","Empty name is not allowed":"Leerer Name ist nicht zulässig","End search mode":"Suchmodus beenden","Enter your question":"Anfrage eingeben",Error:"Fehler","Error formatting code":"Fehler beim Formatieren des Codes","Error was found":"Fehler wurde gefunden","Every day":"Täglich",Exec:LM,"Executes some shell command":"Führt einen Shell-Befehl aus","Existing scripts will be overwritten.":"Vorhandene Skripte werden überschrieben.","Expand all":"Alle erweitern","Expert mode":"Expertenmodus",Explanation:PM,Export:BM,"Export all scripts":"Alle Skripte exportieren","Export blocks":"Blöcke exportieren","Export selected blocks":"Ausgewählte Blöcke exportieren",Februar:jM,February:FM,Filter:zM,Folder:UM,Fr:HM,Friday:WM,Function:"Funktion","Function editor":"Funktions-Editor","Function: executed":"Funktion: ausgeführt","Go to next line":"Gehe zur nächsten Zeile","HTTP Call":"HTTP-Aufruf","Hide logs":"Protokoll ausblenden",ID:GM,ID1:VM,ID2:KM,Import:YM,"Import blocks":"Blöcke importieren","Import error":"Fehler beim Importieren","Import scripts":"Skripte importieren","Insert object ID":"Objekt-ID einfügen",Instance:JM,"Instance is disabled":"Instanz ist deaktiviert","Instance:":"Instanz:",Instances:qM,Instructions:XM,"Invalid CRON":"Ungültiger CRON","It will not be possible to revert this operation.":"Dieser Vorgang kann nicht rückgängig gemacht werden.","JS description":"Regeln erstellen mit JavaScript",Januar:ZM,January:QM,July:eL,June:tL,"Just check":"Einfach überprüfen","Keep my changes":"Meine Änderungen behalten","Language:":"Sprache:","Learn More":"Mehr erfahren","Light style":"Heller Stil",Limit:sL,"Local time":"Lokale Zeit","Locate file":"Datei zeigen","Log outputs":"Protokoll","Log text":"Protokolltext","Log: %s":"Log: %s","Make a HTTP get request":"Eine HTTP-Abrufanforderung stellen","Make a pause between actions":"Eine Pause zwischen den Aktionen machen",March:oL,"March ":"März ",May:iL,Menu:nL,Message:rL,Mo:aL,Model:lL,Monday:cL,Month:uL,More:dL,Name:hL,"No API key found":"Kein API-Schlüssel gefunden","No Chat GPT Key found":"Kein Chat-GPT-Schlüssel gefunden","No active host found":"Kein aktiver Host gefunden","Nothing found":"Nichts gefunden",November:pL,OK:gL,October:mL,Ok:fL,"On condition change":"Bei Änderung des Ergebnis der Bedingung","On script save or adapter start":"Beim Speichern des Skripts oder beim Starten des Adapters","On weekdays":"An Wochentagen","Open configuration":"Konfiguration öffnen","Operate two states":"Zwei Zustände operieren","Operations with two states":"Operationen mit zwei Zuständen","Paste your blocks here":"Fügen Sie Ihre Blöcke hier ein",Pause:$L,"Pause execution":"Ausführung pausieren","Pause script":"Skript anhalten","Phone:":"Telefon:","Please select object ID...":"Objekt-ID auswählen ...","Press Ctrl+Enter to get the answer":"Strg+Eingabetaste, um die Antwort zu erhalten","Prettify the script":"Verschönern Sie das Skript","Print some text in log":"Einen Text im Protokoll ausdrucken","Priority:":"Priorität:",Pushover:bL,Pushsafer:vL,"Read only ID selected: %s":"Schreibgeschützte ID ausgewählt: %s",Reload:yL,Rename:_L,"Reorder scripts in folders":"Skripte in Ordnern neu ordnen",Repeat:wL,Restart:kL,Result:CL,"Resume execution":"Ausführung fortsetzen","Root folder":"Root-Verzeichnis","Rules description":"Regeln erstellen mit WENN-, DANN- und SONST-Blöcken","Run script":"Skript ausführen",Sa:TL,Saturday:SL,Save:EL,"Save all":"Alle speichern","Say It":"Say It","Say some text via sayit adapter":"Einen Text über den Sayit-Adapter sagen",Schedule:IL,Script:xL,"Script %s was modified on disk":'Skript "%s" wurde auf der Festplatte geändert',"Script was modified externally":"Skript wurde extern geändert","Script is not running":"Skript läuft nicht","Search in scripts":"Suche in Skripten","Search...":"Suche...","Select all":"Alles auswählen","Send email":"E-Mail senden","Sends an email":"Sendet eine E-Mail","Sends message via Pushsafer":"Sendet eine Nachricht über Pushsafer","Sends message via pushover":"Sendet eine Nachricht per Pushover","Sends message via telegram":"Sendet eine Nachricht per telegram","Sends message via whatsapp-cmb":"Sendet eine Nachricht über WhatsApp-Cmb",September:DL,"Server time":"Server-Zeit","Set state action":"Zustand setzten","Set with delay":"Setzen mit Verzögerung","Shell command":"Shell-Befehl","Show astronomical events":"Astronomische Ereignisse anzeigen","Show javascript code":"Javascript-Code zeigen","Show logs":"Protokoll anzeigen","Show only paused scripts":"Nur angehaltene Skripte zeigen","Show only running scripts":"Nur laufende Skripte zeigen","Show only scripts with problems":"Nur Skripte mit Problemen zeigen",Simulate:AL,"Some files will be rejected":"Einige Dateien werden abgelehnt","Sound:":"Klang:",Stack:RL,Start:OL,"Start script":"Skript starten",State:NL,"State condition":"Zustandsbedingung","Step into function":"Schritt in die Funktion","Step out from function":"Raus aus der Funktion","Stop on exception":"Bei Ausnahme anhalten",Su:ML,"Subject:":"Gegenstand:",Sunday:LL,"TS description":"Regeln erstellen mit TypeScript",Telegram:PL,"Text:":"Text:",Th:BL,'The script "%s" has been modified by another user or in another window. Do you want to reload the script or keep your local changes?':'Das Skript "%s" wurde von einem anderen Benutzer oder in einem anderen Fenster geändert. Möchten Sie das Skript neu laden oder Ihre lokalen Änderungen behalten?',"The script will be stopped and must be activated manually after debugging. Continue?":"Das Skript wird gestoppt und muss nach dem Debuggen manuell aktiviert werden. Fortsetzen?","This is advances option. You can write your own code here and it will be executed on trigger":"Dies ist eine erweiterte Option. Sie können hier Ihren eigenen Code schreiben, der beim Auslösen ausgeführt wird",Thursday:jL,Time:FL,"Time condition":"Zeitbedingung","Title:":"Titel:","To:":"Zu:","Trigger with value":"Trigger mit Wert",Triggered:zL,Triggers:UL,"Triggers the on script saving or the javascript instance restart":"Löst das Speichern des Skripts oder den Neustart der Javascript-Instanz aus","Triggers the rule on update or change of some state":"Löst die Regel beim Aktualisieren oder Ändern eines Zustands aus","Triggers the rule periodically or on some specific time":"Löst periodisch oder zu einem bestimmten Zeitpunkt aus",Tu:HL,Tuesday:WL,URL:GL,"Unknown error":"Unbekannter Fehler","Unknown error!":"Unbekannter Fehler!","Use generated code":"Code verwenden","User function":"Benutzerfunktion","User:":"Benutzer:",Value:VL,"Vibration:":"Vibration:",Volume:KL,We:YL,Wednesday:JL,"Whatsapp-cmb":"WhatsApp-cmb",Write:qL,"Write your own code":"Eigenen Code schreiben",Yes:XL,"Yet exists!":"Existiert schon!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Sie können %s in der URL verwenden, um den aktuellen Triggerwert zu verwenden, %id, um die ausgelöste Objekt-ID zu verwenden, %name, um den ID-Namen des ausgelösten Objekts anzuzeigen, oder %old, um den alten Triggerwert zu verwenden","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Sie können %s im Befehl verwenden, um den aktuellen Triggerwert zu verwenden, %id, um die ausgelöste Objekt-ID zu verwenden, %name, um den ID-Namen des ausgelösten Objekts anzuzeigen, oder %old, um den alten Triggerwert zu verwenden","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Sie können %s im Text verwenden, um den aktuellen Triggerwert anzuzeigen, %id, um die ausgelöste Objekt-ID zu verwenden, %name, um den ID-Namen des ausgelösten Objekts anzuzeigen, oder %old, um den alten Triggerwert zu verwenden","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Sie können %s im Wert verwenden, um den aktuellen Triggerwert zu verwenden, %id, um die ID des ausgelösten Objekts zu verwenden, %name, um den ID-Namen des ausgelösten Objekts anzuzeigen, oder %old, um den alten Triggerwert zu verwenden","You have to enter OpenAI API key in the configuration of javascript adapter.":"Sie müssen den OpenAI-API-Schlüssel in der Konfiguration des Javascript-Adapters eingeben.","You have to enter at least one API key in the configuration of javascript adapter.":"Sie müssen mindestens einen API-Schlüssel (OpenAI, Anthropic oder Gemini) in der Konfiguration des Javascript-Adapters eingeben.","Please select a valid model":"Bitte wählen Sie ein gültiges Modell aus","[equal]":"[gleich]","[greater or equal]":"[größer oder gleich]","[greater]":"[größer]","[hysteresis]":"[Hysterese]","[includes]":"[enthält]","[less or equal]":"[kleiner oder gleich]","[less]":"[kleiner]","[not equal]":"[ungleich]",acknowledgment:ZL,all:QL,and:eP,"as JSON":"als JSON","as plain text":"als Klartext",astro:tP,at:sP,"clear running":"laufende abbrechen",control:oP,copy:iP,cron:nP,dawn:rP,debug_help:aP,debug_label:lP,default:"Standard",dusk:cP,easy:uP,else:"sonst","equal to":"gleich",every:dP,"every hour at 0 minutes":"jede Stunde bei 0 Minuten",false:"falsch","file reading has failed: %s":"Das Lesen der Datei ist fehlgeschlagen: %s","file reading was aborted":"Das Lesen der Datei wurde abgebrochen",filter_func:hP,filter_id:pP,filter_name:gP,filter_role:mP,filter_room:fP,"for edit or create script":"zum Bearbeiten oder zum Erstellen eines neues Skripts","for professionals":"für Profis","for programmers":"für Programmierer",goldenHour:$P,goldenHourEnd:bP,"greater or equal":"größer oder gleich","greater or equal to":"größer oder gleich","greater than":"größer als",help_just_check:vP,help_on_change:yP,"high priority":"hohe Priorität","high-priority":"hohe Priorität","highest priority":"höchste Priorität",hours:_P,includes:wP,interval:kP,"just check":"einfach prüfen","less or equal":"kleiner oder gleich","less or equal to":"kleiner oder gleich","less than":"kleiner als","lower priority":"geringere Priorität","lowest priority":"niedrigste Priorität",magic:CP,milliseconds:TP,minutes:SP,ms:EP,nadir:IP,nauticalDawn:xP,nauticalDusk:DP,nextSunrise:AP,nextSunset:RP,night:OP,nightEnd:NP,"no blocks found":"Keine Blöcke gefunden","no group":"KEINE GRUPPE",normal:MP,"normal priority":"normale Priorität","not running":"nicht gestartet","not equal to":"ungleich","not properly connected":"Dieser Block ist mit anderen nicht richtig verbunden.",offset:LP,"on change":"bei Änderung","on condition change":"bei Zustandsänderung","on update":"beim Aktualisieren",one:PP,or:BP,quiet:jP,"reset search":"Suche zurücksetzen",search:FP,seconds:zP,solarNoon:UP,"store in":"speichern in",sunrise:HP,sunriseEnd:WP,sunset:GP,sunsetStart:VP,then:KP,"toggle value":"Wert umschalten",tooltip_ack:YP,tooltip_from:JP,tooltip_lc:qP,tooltip_quality:XP,tooltip_ts:ZP,tooltip_user:QP,tooltip_value:eB,true:"wahr",two:tB,undefined:"nicht definiert",update:sB,"use seconds":"Sekunden verwenden","use trigger value":"Triggerwert benutzen",verbose_help:oB,verbose_label:iB,when:nB,with:"mit","with date":"mit Datum","with offset":"mit Versatz",wizard:rB,"Loading models...":"Modelle werden geladen...","Could not connect to API at %s":"Verbindung zur API unter %s nicht möglich","Invalid API key":"Ungültiger API-Schlüssel","Access denied by API":"Zugriff von der API verweigert","API error: %s":"API-Fehler: %s",'Model "%s" not found':'Modell "%s" nicht gefunden',"Request failed: %s":"Anfrage fehlgeschlagen: %s",Retry:aB,"No running javascript instance found":"Keine laufende JavaScript-Instanz gefunden"},cB="Admitido",uB="Comportamiento",dB="Añadir",hB="Todos",pB="Alguna",gB="Apply",mB="abril",fB="Preguntar",$B="Astronómico",bB="agosto",vB="Cancelar",yB="Cerrar",_B="Condición",wB="Condiciones",kB="Consola",CB="Copiado",TB="diciembre",SB="Defecto",EB="Demora",IB="Eliminar",xB="Descripción",DB="Hecho",AB="Ejecutivo shell",RB="Explicación",OB="Exportar",NB="Februar",MB="febrero",LB="Filtrar",PB="Carpeta",BB="P.",jB="viernes",FB="CARNÉ DE IDENTIDAD",zB="ID1",UB="ID2",HB="Importar",WB="Ejemplo",GB="Instancias",VB="Instrucciones",KB="Enero",YB="enero",JB="julio",qB="junio",XB="Límite",ZB="marzo",QB="Mayo",e2="Menú",t2="Mensaje",s2="Mes",o2="Modelo",i2="lunes",n2="Mes",r2="Más",a2="Nombre",l2="noviembre",c2="OK",u2="octubre",d2="Okay",h2="Pausa",p2="Persona fácil de convencer",g2="Pushsafer",m2="Recargar",f2="Rebautizar",$2="Repetir",b2="Reiniciar",v2="Resultado",y2="Sa",_2="sábado",w2="Salvar",k2="Calendario",C2="Guión",T2="septiembre",S2="Simular",E2="Stack",I2="Comienzo",x2="Expresar",D2="Su",A2="domingo",R2="Telegrama",O2="4",N2="jueves",M2="Tiempo",L2="Motivado",P2="Disparadores",B2="Tu",j2="martes",F2="URL",z2="Valor",U2="Volumen",H2="3",W2="miércoles",G2="Escribir",V2="sí",K2="Reconocimiento",Y2="todos",J2="y",q2="astro",X2="a",Z2="control",Q2="Copiar",ej="CRON",tj="Amanecer",sj="Este es un modo especial en el que los estados y los objetos no cambiarán. Pero solo se mostrará información sobre cada cambio planificado en el protocolo.",oj="Depurar",ij="Oscuridad",nj="fácil",rj="cada",aj="Función",lj="CARNÉ DE IDENTIDAD",cj="Nombre",uj="Papel",dj="Habitación",hj="hora dorada",pj="Fin de la hora dorada",gj='El código se ejecutará solo cada vez que la condición sea verdadera. P.ej. si se activa en el valor del sensor de temperatura y la condición es "si la temperatura es superior a 20 ° C", las acciones "entonces" se ejecutarán cada vez que el sensor envíe la temperatura y supere los 20 ° C. Por 21 ° C, por 22 ° C y así sucesivamente.',mj='El código se ejecutará solo si cambia el resultado de la condición. P.ej. si se activa en el valor del sensor de temperatura y la condición es "si la temperatura es superior a 20 ° C", las acciones "entonces" se ejecutarán una vez cuando la temperatura sea superior a 20. La próxima vez, las acciones "entonces" se ejecutarán cuando la temperatura falla por debajo de 20 y luego sube por encima de 20 nuevamente.',fj="horas",$j="incluye",bj="intervalo",vj="magia",yj="milisegundos",_j="minutos",wj="ms",kj="nadir",Cj="Amanecer náutico",Tj="Atardecer náutico",Sj="próximo amanecer",Ej="Próxima puesta de sol",Ij="Noche",xj="Fin de la noche",Dj="normal",Aj="compensar",Rj="uno",Oj="o",Nj="tranquilo",Mj="buscar",Lj="segundos",Pj="Mediodía solar",Bj="amanecer",jj="Final del amanecer",Fj="puesta de sol",zj="Inicio al atardecer",Uj="entonces",Hj="Reconocer",Wj="De",Gj="Último cambio",Vj="Calidad",Kj="Marca de tiempo",Yj="Usuario",Jj="Valor",qj="dos",Xj="actualizar",Zj="Agrega salida de depuración al registro para muchos comandos del sistema",Qj="Salidas de registro detalladas",eF="cuando",tF="Wizard",sF="Reintentar",oF={"%s not found":"%s no encontrado","()":"()","(at %s)":"(en %s)","(optional)":"(Opcional)","-":"-",".":".","AI code generator":"Generador de código de IA",Ack:cB,Actions:uB,"Actual time of day":"Hora real del día",Add:dB,"Add new script":"Agregar nuevo script",All:hB,"All files will be accepted":"Todos los archivos serán aceptados.",Any:pB,"Any month":"Cualquier mes",Apply:gB,April:mB,"Are you sure?":"¿Estás seguro?",Ask:fB,Astronomical:$B,"Astronomical events today":"Eventos astronómicos hoy",August:bB,"Blockly description":"Crear reglas por bloques gráficos","Body:":"Cuerpo:",Cancel:vB,"Cannot delete non empty item!":"¡No se puede eliminar un elemento no vacío!","Change layout":"Cambia el diseño",'Change theme (actual "%s")':'Cambiar tema (ahora - "%s")',"Check blocks":"Comprobar bloques","Check is not active, because javascript adapter is disabled":"La comprobación no está activa porque el adaptador Javascript está desactivado","Clear search input":"Borrar entrada de búsqueda","Click on this icon":"Haga clic en este ícono",Close:yB,"Close all but current":"Cerrar todo menos el actual","Collapse all":"Desplegar todo","Compares current time with astronomical event":"Compara la hora actual con un evento astronómico","Compares current time with the user specific time":"Compara la hora actual con la hora específica del usuario","Compares the state value with user defined value":"Compara el valor del estado con el valor definido por el usuario",Condition:_B,Conditions:wB,"Configuration not saved.":"Configuración no guardada.",Console:kB,"Control or update some state":"Controlar o actualizar algún estado","Control or update some state with delay":"Controlar o actualizar algún estado con retraso","Convert blockly to javascript for ever.":"Convierta instantáneamente en bloque a Javascript.",Copied:CB,"Copy script":"Copiar guion","Copy to clipboard":"Copiar al portapapeles","Create new":"Crear nuevo","Create new folder":"Crear nueva carpeta","Create new script":"Crear nuevo script","Create or edit CRON or time wizard":"Crear o editar CRON o asistente de tiempo","Dark Theme":"Tema oscuro","Dark style":"Estilo oscuro",Date:"Fecha","Debug instance":"Instancia de depuración","Debug options":"Opciones de depuración",December:TB,Default:SB,"Define cron...":"Definir cron ...","Define schedule...":"Definir horario ...",Delay:EB,Delete:IB,"Delete %s":"Eliminar %s ...","Delete folder":"Eliminar carpeta","Delete script":"Eliminar guión",Description:xB,"Deselect all":"Deseleccionar todo","Discard changes for %s":"Descartar cambios para %s",Done:DB,"Double click to write value":"Doble clic para escribir el valor","Download as file":"Descargar como archivo","Drop some files here or click...":"Suelta algunos archivos aquí o haz clic ...","Duplicate name":"Nombre duplicado","Edit script or just double click":"Editar guión o simplemente hacer doble clic","Empty name is not allowed":"No se permite el nombre vacío","End search mode":"Fin del modo de búsqueda","Enter your question":"Ingrese su solicitud",Error:"Error","Error formatting code":"Código de formato de error","Error was found":"Error encontrado","Every day":"Diario",Exec:AB,"Executes some shell command":"Ejecuta algún comando de shell","Existing scripts will be overwritten.":"Los guiones existentes se sobrescribirán.","Expand all":"Expandir todo","Expert mode":"Modo experto",Explanation:RB,Export:OB,"Export all scripts":"Exportar todos los scripts","Export blocks":"Exportar bloques","Export selected blocks":"Exportar bloques seleccionados",Februar:NB,February:MB,Filter:LB,Folder:PB,Fr:BB,Friday:jB,Function:"Función","Function editor":"Editor de funciones","Function: executed":"Función: ejecutada","Go to next line":"Ir a la siguiente línea","HTTP Call":"Llamada HTTP","Hide logs":"Ocultar registros",ID:FB,ID1:zB,ID2:UB,Import:HB,"Import blocks":"Importar bloques","Import error":"Error de importación","Import scripts":"Importar guiones","Insert object ID":"Insertar ID de objeto",Instance:WB,"Instance is disabled":"La instancia está deshabilitada","Instance:":"Ejemplo:",Instances:GB,Instructions:VB,"Invalid CRON":"CRON inválido","It will not be possible to revert this operation.":"No será posible revertir esta operación.","JS description":"Crear reglas escribiendo Javascript",Januar:KB,January:YB,July:JB,June:qB,"Just check":"Sólo revisa","Keep my changes":"Mantener mis cambios","Language:":"Idioma:","Learn More":"Aprende más","Light style":"Estilo ligero",Limit:XB,"Local time":"Hora local","Locate file":"Localizar el archivo","Log outputs":"Salidas de registro","Log text":"Texto de registro","Log: %s":"Log: %s","Make a HTTP get request":"Realizar una solicitud de obtención HTTP","Make a pause between actions":"Hacer una pausa entre acciones",March:ZB,"March ":"marzo",May:QB,Menu:e2,Message:t2,Mo:s2,Model:o2,Monday:i2,Month:n2,More:r2,Name:a2,"No API key found":"No se encontró ninguna clave API","No Chat GPT Key found":"No se ha encontrado ninguna clave GPT de chat","No active host found":"No se encontró un host activo","Nothing found":"Nada Encontrado",November:l2,OK:c2,October:u2,Ok:d2,"On condition change":"En condición de cambio","On script save or adapter start":"Al guardar el script o al iniciar el adaptador","On weekdays":"De lunes a viernes","Open configuration":"Configuración abierta","Operate two states":"Operar dos estados","Operations with two states":"Operaciones con dos estados","Paste your blocks here":"Pega tus bloques aquí",Pause:h2,"Pause execution":"Pausar ejecución","Pause script":"Pausar guion","Phone:":"Teléfono:","Please select object ID...":"Por favor, seleccione la ID del objeto ...","Press Ctrl+Enter to get the answer":"Presiona Ctrl+Enter para obtener la respuesta","Prettify the script":"Embellecer el guión","Print some text in log":"Imprime texto en el registro","Priority:":"Prioridad:",Pushover:p2,Pushsafer:g2,"Read only ID selected: %s":"ID de solo lectura seleccionado: %s",Reload:m2,Rename:f2,"Reorder scripts in folders":"Reordenar guiones en carpetas",Repeat:$2,Restart:b2,Result:v2,"Resume execution":"Reanudar ejecución","Root folder":"Carpeta raíz","Rules description":"Crea reglas con bloques IF, THEN, ELSE","Run script":"Ejecutar guión",Sa:y2,Saturday:_2,Save:w2,"Save all":"Salvar a todos","Say It":"Say It","Say some text via sayit adapter":"Di un mensaje de texto a través del adaptador sayit",Schedule:k2,Script:C2,"Script %s was modified on disk":"El script %s fue modificado en el disco","Script was modified externally":"El script fue modificado externamente","Script is not running":"El script no se está ejecutando","Search in scripts":"Buscar en guiones","Search...":"Buscar...","Select all":"Seleccionar todo","Send email":"Enviar correo electrónico","Sends an email":"Envía un correo electrónico","Sends message via Pushsafer":"Envía mensaje a través de Pushsafer","Sends message via pushover":"Envía un mensaje a través de un pushover","Sends message via telegram":"Envía mensaje por telegrama","Sends message via whatsapp-cmb":"Envía mensaje vía whatsapp-cmb",September:T2,"Server time":"Tiempo del servidor","Set state action":"Establecer acción estatal","Set with delay":"Establecer con retraso","Shell command":"Comando de Shell","Show astronomical events":"Mostrar eventos astronómicos","Show javascript code":"Mostrar código Javascript","Show logs":"Mostrar registros","Show only paused scripts":"Mostrar solo secuencias de comandos pausadas","Show only running scripts":"Mostrar solo scripts en ejecución","Show only scripts with problems":"Mostrar solo guiones con problemas",Simulate:S2,"Some files will be rejected":"Algunos archivos serán rechazados","Sound:":"Sonido:",Stack:E2,Start:I2,"Start script":"Iniciar guion",State:x2,"State condition":"Condición del estado","Step into function":"Entra en función","Step out from function":"Sal de la función","Stop on exception":"Deténgase en excepción",Su:D2,"Subject:":"Sujeto:",Sunday:A2,"TS description":"Crear reglas escribiendo el mecanografiado",Telegram:R2,"Text:":"Texto:",Th:O2,'The script "%s" has been modified by another user or in another window. Do you want to reload the script or keep your local changes?':'El script "%s" ha sido modificado por otro usuario o en otra ventana. ¿Desea recargar el script o mantener sus cambios locales?',"The script will be stopped and must be activated manually after debugging. Continue?":"El script se detendrá y deberá activarse manualmente después de la depuración. ¿Continuar?","This is advances option. You can write your own code here and it will be executed on trigger":"Esta es la opción de avances. Puede escribir su propio código aquí y se ejecutará en el disparador",Thursday:N2,Time:M2,"Time condition":"Condición de tiempo","Title:":"Título:","To:":"A:","Trigger with value":"Activar con valor",Triggered:L2,Triggers:P2,"Triggers the on script saving or the javascript instance restart":"Activa el guardado de la secuencia de comandos o el reinicio de la instancia de JavaScript","Triggers the rule on update or change of some state":"Activa la regla de actualización o cambio de algún estado","Triggers the rule periodically or on some specific time":"Activa la regla periódicamente o en un momento específico",Tu:B2,Tuesday:j2,URL:F2,"Unknown error":"Error desconocido","Unknown error!":"¡Error desconocido!","Use generated code":"Usar código generado","User function":"Función de usuario","User:":"Usuario:",Value:z2,"Vibration:":"Vibración:",Volume:U2,We:H2,Wednesday:W2,"Whatsapp-cmb":"Whatsapp-cmb",Write:G2,"Write your own code":"Escribe tu propio código",Yes:V2,"Yet exists!":"¡Sin embargo existe!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Puede usar %s en la URL para usar el valor de activación actual, %id para usar el ID de objeto activado, %name para mostrar el nombre de ID de objeto activado o %old para usar el valor de activación antiguo","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Puede usar %s en el comando para usar el valor de activación actual, %id para usar el ID de objeto activado, %name para mostrar el nombre de ID de objeto activado o %old para usar el valor de activación anterior","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Puede usar %s en el texto para mostrar el valor de activación actual, %id para usar el ID de objeto activado, %name para mostrar el nombre de ID de objeto activado o %old para usar el valor de activación antiguo","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Puede usar %s en el valor para usar el valor de activación actual, %id para usar el ID de objeto activado, %name para mostrar el nombre de ID de objeto activado o %old para usar el valor de activación antiguo","You have to enter OpenAI API key in the configuration of javascript adapter.":"Debe ingresar la clave API de OpenAI en la configuración del adaptador de JavaScript.","You have to enter at least one API key in the configuration of javascript adapter.":"Debe ingresar al menos una clave API (OpenAI, Anthropic o Gemini) en la configuración del adaptador de JavaScript.","Please select a valid model":"Seleccione un modelo válido","[equal]":"[igual]","[greater or equal]":"[mayor o igual]","[greater]":"[mayor que]","[hysteresis]":"[histéresis]","[includes]":"[incluye]","[less or equal]":"[menor o igual]","[less]":"[menos]","[not equal]":"[no es igual]",acknowledgment:K2,all:Y2,and:J2,"as JSON":"como JSON","as plain text":"como texto plano",astro:q2,at:X2,"clear running":"carrera clara",control:Z2,copy:Q2,cron:ej,dawn:tj,debug_help:sj,debug_label:oj,default:"defecto",dusk:ij,easy:nj,else:"demás","equal to":"igual a",every:rj,"every hour at 0 minutes":"cada hora a los 0 minutos",false:"falso","file reading has failed: %s":"la lectura del archivo ha fallado: %s","file reading was aborted":"la lectura del archivo fue abortada",filter_func:aj,filter_id:lj,filter_name:cj,filter_role:uj,filter_room:dj,"for edit or create script":"para editar o crear un nuevo script","for professionals":"para profesionales","for programmers":"para programadores",goldenHour:hj,goldenHourEnd:pj,"greater or equal":"mayor o igual","greater or equal to":"mayor o igual a","greater than":"mas grande que",help_just_check:gj,help_on_change:mj,"high priority":"alta prioridad","high-priority":"alta prioridad","highest priority":"más alta prioridad",hours:fj,includes:$j,interval:bj,"just check":"Sólo revisa","less or equal":"menor o igual","less or equal to":"menor o igual a","less than":"menos que","lower priority":"prioridad más baja","lowest priority":"prioridad más baja",magic:vj,milliseconds:yj,minutes:_j,ms:wj,nadir:kj,nauticalDawn:Cj,nauticalDusk:Tj,nextSunrise:Sj,nextSunset:Ej,night:Ij,nightEnd:xj,"no blocks found":"No se encontraron bloques","no group":"NO GRUPO",normal:Dj,"normal priority":"prioridad normal","not running":"no está en ejecución","not equal to":"no igual a","not properly connected":"Este bloque no está conectado correctamente a otros bloques.",offset:Aj,"on change":"en el cambio","on condition change":"con cambio de condición","on update":"en actualización",one:Rj,or:Oj,quiet:Nj,"reset search":"restablecer la búsqueda",search:Mj,seconds:Lj,solarNoon:Pj,"store in":"almacenar en",sunrise:Bj,sunriseEnd:jj,sunset:Fj,sunsetStart:zj,then:Uj,"toggle value":"alternar valor",tooltip_ack:Hj,tooltip_from:Wj,tooltip_lc:Gj,tooltip_quality:Vj,tooltip_ts:Kj,tooltip_user:Yj,tooltip_value:Jj,true:"cierto",two:qj,undefined:"indefinido",update:Xj,"use seconds":"usar segundos","use trigger value":"usar valor de activación",verbose_help:Zj,verbose_label:Qj,when:eF,with:"con","with date":"con fecha","with offset":"con desplazamiento",wizard:tF,"Loading models...":"Cargando modelos...","Could not connect to API at %s":"No se pudo conectar a la API en %s","Invalid API key":"Clave API no válida","Access denied by API":"Acceso denegado por la API","API error: %s":"Error de API: %s",'Model "%s" not found':'Modelo "%s" no encontrado',"Request failed: %s":"Solicitud fallida: %s",Retry:sF,"No running javascript instance found":"No se encontró ninguna instancia de JavaScript en ejecución"},iF="Reconnu",nF="Actions",rF="Ajouter",aF="Tout",lF="Tout",cF="Postuler",uF="avril",dF="Demander",hF="Astronomique",pF="août",gF="Annuler",mF="proche",fF="État",$F="Conditions",bF="Console",vF="Copié",yF="décembre",_F="Défaut",wF="Retard",kF="Effacer",CF="Description",TF="Terminé",SF="Exec shell",EF="Explication",IF="Exportation",xF="Février",DF="février",AF="Filtre",RF="Dossier",OF="Fr",NF="Vendredi",MF="ID",LF="ID1",PF="ID2",BF="Importation",jF="Exemple",FF="Instances",zF="Instructions",UF="Janvier",HF="janvier",WF="juillet",GF="juin",VF="Limite",KF="Mars",YF="Mai",JF="M e n u",qF="Message",XF="Mo",ZF="Modèle",QF="Lundi",ez="Mois",tz="Plus",sz="Nom",oz="novembre",iz="OK",nz="octobre",rz="D'accord",az="Pause",lz="Pushover",cz="Pushsafer",uz="Recharger",dz="Renommer",hz="Répéter",pz="Redémarrer",gz="Résultat",mz="Sa",fz="samedi",$z="sauver",bz="Horaire",vz="Scénario",yz="septembre",_z="Simuler",wz="Stack",kz="Début",Cz="État",Tz="Su",Sz="dimanche",Ez="Télégramme",Iz="4",xz="Jeudi",Dz="Temps",Az="Déclenché",Rz="Déclencheurs",Oz="Tu",Nz="Mardi",Mz="URL",Lz="Valeur",Pz="Le volume",Bz="3",jz="Mercredi",Fz="Écrivez",zz="Oui",Uz="reconnaissance",Hz="tout",Wz="et",Gz="astro",Vz="à",Kz="contrôler",Yz="copie",Jz="CRON",qz="Aube",Xz="Il s'agit d'un mode spécial dans lequel les états et les objets ne changeront pas. Mais seules les informations sur chaque changement prévu seront affichées dans le protocole.",Zz="Déboguer",Qz="Crépuscule",eU="facile",tU="chaque",sU="Une fonction",oU="ID",iU="Nom",nU="Rôle",rU="Pièce",aU="Heure d'or",lU="Fin de l'heure d'or",cU="Le code ne sera exécuté que chaque fois que la condition est vraie. Par exemple. si déclenchement sur la valeur du capteur de température et que la condition est «si la température est supérieure à 20 ° C», les actions «alors» seront exécutées à chaque fois que le capteur envoie la température et qu'elle est supérieure à 20 ° C. À 21 ° C, à 22 ° C et ainsi de suite.",uU="Le code ne sera exécuté que si le résultat de la condition change. Par exemple. si le déclenchement sur la valeur du capteur de température et que la condition est «si la température est supérieure à 20 ° C», les actions «alors» seront exécutées une fois lorsque la température est supérieure à 20. La prochaine fois, les actions «alors» seront exécutées lorsque la température échoue sous 20 puis remonte au-dessus de 20.",dU="les heures",hU="comprend",pU="intervalle",gU="la magie",mU="millisecondes",fU="minutes",$U="ms",bU="nadir",vU="Aube nautique",yU="Crépuscule nautique",_U="Prochain lever de soleil",wU="Prochain coucher de soleil",kU="Nuit",CU="Fin de nuit",TU="Ordinaire",SU="décalage",EU="une",IU="ou",xU="calmer",DU="chercher",AU="secondes",RU="Midi solaire",OU="lever du soleil",NU="Fin du lever du soleil",MU="le coucher du soleil",LU="Début du coucher du soleil",PU="alors",BU="Reconnaître",jU="De",FU="Dernière modification",zU="Qualité",UU="Horodatage",HU="Utilisateur",WU="Valeur",GU="deux",VU="mettre à jour",KU="Ajoute une sortie de débogage au journal pour de nombreuses commandes système",YU="Sorties de journal détaillées",JU="lorsque",qU="Wizard",XU="Réessayer",ZU={"%s not found":"%s non trouvé","()":"()","(at %s)":"(à %s)","(optional)":"(optionnel)","-":"-",".":".","AI code generator":"Générateur de code IA",Ack:iF,Actions:nF,"Actual time of day":"Heure réelle de la journée",Add:rF,"Add new script":"Ajouter un nouveau script",All:aF,"All files will be accepted":"Tous les fichiers seront acceptés",Any:lF,"Any month":"N'importe quel mois",Apply:cF,April:uF,"Are you sure?":"Êtes-vous sûr?",Ask:dF,Astronomical:hF,"Astronomical events today":"Événements astronomiques aujourd'hui",August:pF,"Blockly description":"Création de règles par blocs graphiques","Body:":"Corps:",Cancel:gF,"Cannot delete non empty item!":"Impossible de supprimer un élément non vide!","Change layout":"Changer la disposition",'Change theme (actual "%s")':'Changer de thème (maintenant - "%s")',"Check blocks":"Vérifier les blocs","Check is not active, because javascript adapter is disabled":"La vérification n'est pas active, car l'adaptateur Javascript est désactivé","Clear search input":"Effacer la recherche","Click on this icon":"Cliquez sur cette icône",Close:mF,"Close all but current":"Ferme tout sauf courant","Collapse all":"Réduire tout","Compares current time with astronomical event":"Compare l'heure actuelle avec un événement astronomique","Compares current time with the user specific time":"Compare l'heure actuelle avec l'heure spécifique de l'utilisateur","Compares the state value with user defined value":"Compare la valeur d'état avec la valeur définie par l'utilisateur",Condition:fF,Conditions:$F,"Configuration not saved.":"Configuration non enregistrée.",Console:bF,"Control or update some state":"Contrôler ou mettre à jour un état","Control or update some state with delay":"Contrôler ou mettre à jour un état avec un délai","Convert blockly to javascript for ever.":"Convertissez instantanément en Javascript.",Copied:vF,"Copy script":"Copier le script","Copy to clipboard":"Copier dans le presse-papier","Create new":"Créer un nouveau","Create new folder":"Créer un nouveau dossier","Create new script":"Créer un nouveau script","Create or edit CRON or time wizard":"Créer ou éditer CRON ou un assistant de temps","Dark Theme":"Thème sombre","Dark style":"Style sombre",Date:"Date","Debug instance":"Instance de débogage","Debug options":"Options de débogage",December:yF,Default:_F,"Define cron...":"Définir le cron ...","Define schedule...":"Définir le calendrier ...",Delay:wF,Delete:kF,"Delete %s":"Supprimer %s ...","Delete folder":"Supprimer le dossier","Delete script":"Supprimer le script",Description:CF,"Deselect all":"Tout déselectionner","Discard changes for %s":"Ignorer les modifications pour %s",Done:TF,"Double click to write value":"Double clic pour écrire la valeur","Download as file":"Télécharger le fichier","Drop some files here or click...":"Déposer des fichiers ici ou cliquez sur ...","Duplicate name":"Nom en double","Edit script or just double click":"Modifiez le script ou double-cliquez simplement sur","Empty name is not allowed":"Le nom vide n'est pas autorisé","End search mode":"Fin du mode de recherche","Enter your question":"Entrez votre demande",Error:"Erreur","Error formatting code":"Erreur lors du formatage du code","Error was found":"Une erreur a été trouvée","Every day":"Tous les jours",Exec:SF,"Executes some shell command":"Exécute une commande shell","Existing scripts will be overwritten.":"Les scripts existants seront écrasés.","Expand all":"Développer tout","Expert mode":"Mode expert",Explanation:EF,Export:IF,"Export all scripts":"Exporter tous les scripts","Export blocks":"Blocs d'exportation","Export selected blocks":"Exporter les blocs sélectionnés",Februar:xF,February:DF,Filter:AF,Folder:RF,Fr:OF,Friday:NF,Function:"Fonction","Function editor":"Éditeur de fonction","Function: executed":"Fonction : exécutée","Go to next line":"Aller à la ligne suivante","HTTP Call":"Appel HTTP","Hide logs":"Masquer les journaux",ID:MF,ID1:LF,ID2:PF,Import:BF,"Import blocks":"Blocs d'importation","Import error":"Erreur d'importation","Import scripts":"Importer des scripts","Insert object ID":"Insérer un identifiant d'objet",Instance:jF,"Instance is disabled":"L'instance est désactivée","Instance:":"Exemple:",Instances:FF,Instructions:zF,"Invalid CRON":"CRON invalide","It will not be possible to revert this operation.":"Il ne sera pas possible de revenir sur cette opération.","JS description":"Créer des règles en écrivant du Javascript",Januar:UF,January:HF,July:WF,June:GF,"Just check":"Vérifiez simplement","Keep my changes":"Garder mes modifications","Language:":"Langue:","Learn More":"Apprendre encore plus","Light style":"Style de lumière",Limit:VF,"Local time":"Heure locale","Locate file":"Localiser le fichier","Log outputs":"Journal des sorties","Log text":"Texte du journal","Log: %s":"Log : %s","Make a HTTP get request":"Faire une requête HTTP Get","Make a pause between actions":"Faites une pause entre les actions",March:KF,"March ":"mars",May:YF,Menu:JF,Message:qF,Mo:XF,Model:ZF,Monday:QF,Month:ez,More:tz,Name:sz,"No API key found":"Aucune clé API trouvée","No Chat GPT Key found":"Aucune clé GPT de chat trouvée","No active host found":"Aucun hôte actif trouvé","Nothing found":"Rien n'a été trouvé",November:oz,OK:iz,October:nz,Ok:rz,"On condition change":"En cas de changement de condition","On script save or adapter start":"Lors de l'enregistrement du script ou du démarrage de l'adaptateur","On weekdays":"En semaine","Open configuration":"Configuration ouverte","Operate two states":"Opérer deux états","Operations with two states":"Opérations à deux états","Paste your blocks here":"Collez vos blocs ici",Pause:az,"Pause execution":"Suspendre l'exécution","Pause script":"Script de pause","Phone:":"Téléphone:","Please select object ID...":"Veuillez sélectionner l'ID d'objet ...","Press Ctrl+Enter to get the answer":"Appuyez sur Ctrl+Entrée pour obtenir la réponse","Prettify the script":"Embellir le scénario","Print some text in log":"Imprimer du texte dans le journal","Priority:":"Priorité:",Pushover:lz,Pushsafer:cz,"Read only ID selected: %s":"ID en lecture seule sélectionné: %s",Reload:uz,Rename:dz,"Reorder scripts in folders":"Réorganiser les scripts dans des dossiers",Repeat:hz,Restart:pz,Result:gz,"Resume execution":"Reprendre l'exécution","Root folder":"Dossier racine","Rules description":"Créer des règles avec des blocs IF, THEN, ELSE","Run script":"Script de lancement",Sa:mz,Saturday:fz,Save:$z,"Save all":"Sauver tous","Say It":"Say It","Say some text via sayit adapter":"Dites du texte via l'adaptateur sayit",Schedule:bz,Script:vz,"Script %s was modified on disk":"Le script %s a été modifié sur le disque","Script was modified externally":"Le script a été modifié en externe","Script is not running":"Le script n'est pas en cours d'exécution","Search in scripts":"Rechercher dans les scripts","Search...":"Chercher...","Select all":"Tout sélectionner","Send email":"Envoyer un e-mail","Sends an email":"Envoie un e-mail","Sends message via Pushsafer":"Envoie un message via Pushsafer","Sends message via pushover":"Envoie un message via pushover","Sends message via telegram":"Envoie un message par télégramme","Sends message via whatsapp-cmb":"Envoie un message via whatsapp-cmb",September:yz,"Server time":"Heure du serveur","Set state action":"Définir l'action de l'état","Set with delay":"Set avec retard","Shell command":"Commande Shell","Show astronomical events":"Afficher les événements astronomiques","Show javascript code":"Afficher le code Javascript","Show logs":"Afficher les journaux","Show only paused scripts":"Afficher uniquement les scripts en pause","Show only running scripts":"Afficher uniquement les scripts en cours d'exécution","Show only scripts with problems":"Afficher uniquement les scripts avec des problèmes",Simulate:_z,"Some files will be rejected":"Certains fichiers seront rejetés","Sound:":"Sonner:",Stack:wz,Start:kz,"Start script":"Lancer le script",State:Cz,"State condition":"État condition","Step into function":"Entrez dans la fonction","Step out from function":"Sortez de la fonction","Stop on exception":"Arrêt sur exception",Su:Tz,"Subject:":"Sujet:",Sunday:Sz,"TS description":"Créer des règles en écrivant des caractères dactylographiés",Telegram:Ez,"Text:":"Texte:",Th:Iz,'The script "%s" has been modified by another user or in another window. Do you want to reload the script or keep your local changes?':'Le script "%s" a été modifié par un autre utilisateur ou dans une autre fenêtre. Voulez-vous recharger le script ou garder vos modifications locales ?',"The script will be stopped and must be activated manually after debugging. Continue?":"Le script sera arrêté et doit être activé manuellement après le débogage. Continuez?","This is advances option. You can write your own code here and it will be executed on trigger":"C'est une option avancée. Vous pouvez écrire votre propre code ici et il sera exécuté au déclenchement",Thursday:xz,Time:Dz,"Time condition":"Condition de temps","Title:":"Titre:","To:":"À:","Trigger with value":"Déclencheur avec valeur",Triggered:Az,Triggers:Rz,"Triggers the on script saving or the javascript instance restart":"Déclenche l'enregistrement du script ou le redémarrage de l'instance javascript","Triggers the rule on update or change of some state":"Déclenche la règle sur la mise à jour ou le changement d'un état","Triggers the rule periodically or on some specific time":"Déclenche la règle périodiquement ou à une heure précise",Tu:Oz,Tuesday:Nz,URL:Mz,"Unknown error":"Erreur inconnue","Unknown error!":"Erreur inconnue!","Use generated code":"Utiliser le code généré","User function":"Fonction utilisateur","User:":"Utilisateur:",Value:Lz,"Vibration:":"Vibration:",Volume:Pz,We:Bz,Wednesday:jz,"Whatsapp-cmb":"Whatsapp-cmb",Write:Fz,"Write your own code":"Écrivez votre propre code",Yes:zz,"Yet exists!":"Pourtant existe!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Vous pouvez utiliser %s dans l'URL pour utiliser la valeur de déclenchement actuelle, %id pour utiliser l'ID de l'objet déclenché, %name pour afficher le nom de l'ID de l'objet déclenché ou %old pour utiliser l'ancienne valeur de déclenchement","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Vous pouvez utiliser %s dans la commande pour utiliser la valeur de déclenchement actuelle, %id pour utiliser l'ID de l'objet déclenché, %name pour afficher le nom de l'ID de l'objet déclenché ou %old pour utiliser l'ancienne valeur de déclenchement","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Vous pouvez utiliser %s dans le texte pour afficher la valeur de déclenchement actuelle, %id pour utiliser l'ID de l'objet déclenché, %name pour afficher le nom de l'ID de l'objet déclenché ou %old pour utiliser l'ancienne valeur de déclenchement","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Vous pouvez utiliser %s dans la valeur pour utiliser la valeur de déclenchement actuelle, %id pour utiliser l'ID de l'objet déclenché, %name pour afficher le nom de l'ID de l'objet déclenché ou %old pour utiliser l'ancienne valeur de déclenchement","You have to enter OpenAI API key in the configuration of javascript adapter.":"Vous devez entrer la clé API OpenAI dans la configuration de l'adaptateur javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Vous devez entrer au moins une clé API (OpenAI, Anthropic ou Gemini) dans la configuration de l'adaptateur javascript.","Please select a valid model":"Veuillez sélectionner un modèle valide","[equal]":"[égal]","[greater or equal]":"[supérieur ou égal]","[greater]":"[plus grand]","[hysteresis]":"[hystérèse]","[includes]":"[comprend]","[less or equal]":"[inférieur ou égal]","[less]":"[moins]","[not equal]":"[inégal]",acknowledgment:Uz,all:Hz,and:Wz,"as JSON":"en JSON","as plain text":"en texte brut",astro:Gz,at:Vz,"clear running":"course claire",control:Kz,copy:Yz,cron:Jz,dawn:qz,debug_help:Xz,debug_label:Zz,default:"défaut",dusk:Qz,easy:eU,else:"autre","equal to":"égal à",every:tU,"every hour at 0 minutes":"toutes les heures à 0 minute",false:"faux","file reading has failed: %s":"La lecture du fichier a échoué: %s","file reading was aborted":"la lecture du fichier a été abandonnée",filter_func:sU,filter_id:oU,filter_name:iU,filter_role:nU,filter_room:rU,"for edit or create script":"pour éditer ou créer un nouveau script","for professionals":"pour les professionnels","for programmers":"pour les programmeurs",goldenHour:aU,goldenHourEnd:lU,"greater or equal":"supérieur ou égal","greater or equal to":"supérieur ou égal à","greater than":"plus grand que",help_just_check:cU,help_on_change:uU,"high priority":"haute priorité","high-priority":"haute priorité","highest priority":"priorité la plus élevée",hours:dU,includes:hU,interval:pU,"just check":"Vérifiez simplement","less or equal":"inférieur ou égal","less or equal to":"inférieur ou égal à","less than":"moins que","lower priority":"priorité inférieure","lowest priority":"priorité la plus basse",magic:gU,milliseconds:mU,minutes:fU,ms:$U,nadir:bU,nauticalDawn:vU,nauticalDusk:yU,nextSunrise:_U,nextSunset:wU,night:kU,nightEnd:CU,"no blocks found":"Aucun bloc trouvé","no group":"PAS DE GROUPE",normal:TU,"normal priority":"priorité normale","not running":"pas en cours d'exécution","not equal to":"pas égal à","not properly connected":"Ce bloc n'est pas correctement connecté à d'autres blocs.",offset:SU,"on change":"sur le changement","on condition change":"sur changement de condition","on update":"sur mise à jour",one:EU,or:IU,quiet:xU,"reset search":"Réinitialiser la recherche",search:DU,seconds:AU,solarNoon:RU,"store in":"stocker dans",sunrise:OU,sunriseEnd:NU,sunset:MU,sunsetStart:LU,then:PU,"toggle value":"valeur de bascule",tooltip_ack:BU,tooltip_from:jU,tooltip_lc:FU,tooltip_quality:zU,tooltip_ts:UU,tooltip_user:HU,tooltip_value:WU,true:"vrai",two:GU,undefined:"indéfini",update:VU,"use seconds":"utiliser les secondes","use trigger value":"use trigger value",verbose_help:KU,verbose_label:YU,when:JU,with:"avec","with date":"avec date","with offset":"avec offset",wizard:qU,"Loading models...":"Chargement des modèles...","Could not connect to API at %s":"Impossible de se connecter à l'API sur %s","Invalid API key":"Clé API invalide","Access denied by API":"Accès refusé par l'API","API error: %s":"Erreur API : %s",'Model "%s" not found':'Modèle "%s" introuvable',"Request failed: %s":"Requête échouée : %s",Retry:XU,"No running javascript instance found":"Aucune instance JavaScript en cours d'exécution trouvée"},QU="Riconosciuto",eH="Azioni",tH="Inserisci",sH="Tutti",oH="Qualunque",iH="Applica",nH="aprile",rH="Chiedere",aH="Astronomico",lH="agosto",cH="Annulla",uH="Vicino",dH="Condizione",hH="Condizioni",pH="Console",gH="Copiato",mH="dicembre",fH="Predefinito",$H="Ritardo",bH="Elimina",vH="Descrizione",yH="Fatto",_H="Execshell",wH="Spiegazione",kH="Esportare",CH="Februar",TH="febbraio",SH="Filtro",EH="Cartella",IH="P",xH="Venerdì",DH="ID",AH="ID1",RH="ID2",OH="Importare",NH="Esempio",MH="istanze",LH="Istruzioni",PH="Januar",BH="gennaio",jH="luglio",FH="giugno",zH="Limite",UH="marzo",HH="Maggio",WH="Menu",GH="Messaggio",VH="Mo",KH="Modello",YH="Lunedi",JH="Mese",qH="Di più",XH="Nome",ZH="novembre",QH="OK",eW="ottobre",tW="Ok",sW="Pausa",oW="Pushover",iW="Pushsafer",nW="Ricaricare",rW="Rinominare",aW="Ripetere",lW="Ricomincia",cW="Risultato",uW="Sa",dW="Sabato",hW="Salva",pW="Programma",gW="copione",mW="settembre",fW="Simulare",$W="Stack",bW="Cominciare",vW="Stato",yW="Su",_W="Domenica",wW="Telegramma",kW="4",CW="giovedi",TW="Tempo",SW="Innescato",EW="Trigger",IW="Tu",xW="martedì",DW="URL",AW="Valore",RW="Volume",OW="3",NW="mercoledì",MW="Scrivi",LW="sì",PW="riconoscimento",BW="tutti",jW="e",FW="astro",zW="a",UW="controllo",HW="copia",WW="CRON",GW="alba",VW="Questa è una modalità speciale in cui gli stati e gli oggetti non cambieranno. Ma nel protocollo verranno visualizzate solo le informazioni su ogni modifica pianificata.",KW="Debug",YW="crepuscolo",JW="facile",qW="ogni",XW="Funzione",ZW="ID",QW="Nome",e5="Ruolo",t5="Camera",s5="Ora d'oro",o5="Fine dell'ora d'oro",i5='Il codice verrà eseguito solo ogni volta che la condizione è vera. Per esempio. se si attiva il valore del sensore di temperatura e la condizione è "se la temperatura è maggiore di 20 ° C", le azioni "allora" verranno eseguite ogni volta che il sensore invia la temperatura e questa è superiore a 20 ° C. Di 21 ° C, di 22 ° C e così via.',n5='Il codice verrà eseguito solo se il risultato della condizione cambia. Per esempio. se si attiva il valore del sensore di temperatura e la condizione è "se la temperatura è maggiore di 20 ° C", le azioni "allora" verranno eseguite una volta quando la temperatura è superiore a 20. La prossima volta le azioni "allora" verranno eseguite quando la temperatura fallisce sotto 20 e poi sale di nuovo oltre 20.',r5="ore",a5="include",l5="intervallo",c5="Magia",u5="millisecondi",d5="minuti",h5="ms",p5="nadir",g5="Alba nautica",m5="Crepuscolo nautico",f5="Prossima alba",$5="Prossimo tramonto",b5="Notte",v5="Fine della notte",y5="normale",_5="compensare",w5="uno",k5="o",C5="silenzioso",T5="ricerca",S5="secondi",E5="Mezzogiorno solare",I5="Alba",x5="Fine dell'alba",D5="tramonto",A5="Inizio del tramonto",R5="poi",O5="Riconoscere",N5="A partire dal",M5="Ultima modifica",L5="Qualità",P5="timestamp",B5="Utente",j5="Valore",F5="Due",z5="aggiornare",U5="Aggiunge l'output di debug al registro per molti comandi di sistema",H5="Output di log dettagliati",W5="quando",G5="procedura guidata",V5="Riprova",K5={"%s not found":"%s non trovato","()":"()","(at %s)":"(a %s)","(optional)":"(opzionale)","-":"-",".":".","AI code generator":"Generatore di codice AI",Ack:QU,Actions:eH,"Actual time of day":"Ora effettiva della giornata",Add:tH,"Add new script":"Aggiungi nuovo script",All:sH,"All files will be accepted":"Tutti i file saranno accettati",Any:oH,"Any month":"Ogni mese",Apply:iH,April:nH,"Are you sure?":"Sei sicuro?",Ask:rH,Astronomical:aH,"Astronomical events today":"Eventi astronomici oggi",August:lH,"Blockly description":"Creazione di regole tramite blocchi grafici","Body:":"Corpo:",Cancel:cH,"Cannot delete non empty item!":"Impossibile eliminare l'elemento non vuoto!","Change layout":"Cambia layout",'Change theme (actual "%s")':'Cambia tema (ora - "%s")',"Check blocks":"Controlla i blocchi","Check is not active, because javascript adapter is disabled":"Il controllo non è attivo perché l'adattatore Javascript è disabilitato","Clear search input":"Cancella input di ricerca","Click on this icon":"Clicca su questa icona",Close:uH,"Close all but current":"Chiudi tutto tranne corrente","Collapse all":"Comprimi tutto","Compares current time with astronomical event":"Confronta l'ora corrente con l'evento astronomico","Compares current time with the user specific time":"Confronta l'ora corrente con l'ora specifica dell'utente","Compares the state value with user defined value":"Confronta il valore dello stato con il valore definito dall'utente",Condition:dH,Conditions:hH,"Configuration not saved.":"Configurazione non salvata.",Console:pH,"Control or update some state":"Controlla o aggiorna uno stato","Control or update some state with delay":"Controlla o aggiorna uno stato con ritardo","Convert blockly to javascript for ever.":"Converti istantaneamente a blocchi in Javascript.",Copied:gH,"Copy script":"Copia script","Copy to clipboard":"Copia negli appunti","Create new":"Creare nuovo","Create new folder":"Crea una nuova cartella","Create new script":"Crea nuovo script","Create or edit CRON or time wizard":"Crea o modifica la procedura guidata CRON o time","Dark Theme":"Tema scuro","Dark style":"Stile scuro",Date:"Data","Debug instance":"Istanza di debug","Debug options":"Opzioni di debug",December:mH,Default:fH,"Define cron...":"Definisci cron ...","Define schedule...":"Definisci programma ...",Delay:$H,Delete:bH,"Delete %s":"Elimina %s ...","Delete folder":"Elimina cartella","Delete script":"Elimina script",Description:vH,"Deselect all":"Deselezionare tutto","Discard changes for %s":"Annulla modifiche per %s",Done:yH,"Double click to write value":"Doppio clic per scrivere il valore","Download as file":"Scarica come file","Drop some files here or click...":"Trascina alcuni file qui o fai clic su ...","Duplicate name":"Nome duplicato","Edit script or just double click":"Modifica lo script o fai doppio clic","Empty name is not allowed":"Il nome vuoto non è consentito","End search mode":"Termina la modalità di ricerca","Enter your question":"Inserisci la tua richiesta",Error:"Errore","Error formatting code":"Errore di formattazione del codice","Error was found":"Errore trovato","Every day":"Ogni giorno",Exec:_H,"Executes some shell command":"Esegue alcuni comandi della shell","Existing scripts will be overwritten.":"Gli script esistenti verranno sovrascritti.","Expand all":"Espandi tutto","Expert mode":"Modalità esperto",Explanation:wH,Export:kH,"Export all scripts":"Esporta tutti gli script","Export blocks":"Esporta blocchi","Export selected blocks":"Esporta i blocchi selezionati",Februar:CH,February:TH,Filter:SH,Folder:EH,Fr:IH,Friday:xH,Function:"Funzione","Function editor":"Editor di funzioni","Function: executed":"Funzione: eseguita","Go to next line":"Vai alla riga successiva","HTTP Call":"Chiamata HTTP","Hide logs":"Nascondi i registri",ID:DH,ID1:AH,ID2:RH,Import:OH,"Import blocks":"Importa blocchi","Import error":"Errore di importazione","Import scripts":"Importa script","Insert object ID":"Inserisci l'ID oggetto",Instance:NH,"Instance is disabled":"L'istanza è disabilitata","Instance:":"Esempio:",Instances:MH,Instructions:LH,"Invalid CRON":"CRON non valido","It will not be possible to revert this operation.":"Non sarà possibile ripristinare questa operazione.","JS description":"Creare regole scrivendo Javascript",Januar:PH,January:BH,July:jH,June:FH,"Just check":"Controlla solamente","Keep my changes":"Mantieni le mie modifiche","Language:":"Linguaggio:","Learn More":"Per saperne di più","Light style":"Stile leggero",Limit:zH,"Local time":"Ora locale","Locate file":"Localizza file","Log outputs":"Registra le uscite","Log text":"Testo del registro","Log: %s":"Log: %s","Make a HTTP get request":"Effettua una richiesta get HTTP","Make a pause between actions":"Fai una pausa tra le azioni",March:UH,"March ":"marzo",May:HH,Menu:WH,Message:GH,Mo:VH,Model:KH,Monday:YH,Month:JH,More:qH,Name:XH,"No API key found":"Nessuna chiave API trovata","No Chat GPT Key found":"Nessuna chiave GPT chat trovata","No active host found":"Nessun host attivo trovato","Nothing found":"Non abbiamo trovato nulla",November:ZH,OK:QH,October:eW,Ok:tW,"On condition change":"A condizione che cambino","On script save or adapter start":"Al salvataggio dello script o all'avvio dell'adattatore","On weekdays":"Nei giorni della settimana","Open configuration":"Configurazione aperta","Operate two states":"Gestisci due stati","Operations with two states":"Operazioni con due stati","Paste your blocks here":"Incolla qui i tuoi blocchi",Pause:sW,"Pause execution":"Metti in pausa l'esecuzione","Pause script":"Metti in pausa lo script","Phone:":"Telefono:","Please select object ID...":"Seleziona l'ID oggetto ...","Press Ctrl+Enter to get the answer":"Premi Ctrl+Invio per ottenere la risposta","Prettify the script":"Abbellire la sceneggiatura","Print some text in log":"Stampa del testo nel registro","Priority:":"Priorità:",Pushover:oW,Pushsafer:iW,"Read only ID selected: %s":"ID di sola lettura selezionato: %s",Reload:nW,Rename:rW,"Reorder scripts in folders":"Riordina gli script nelle cartelle",Repeat:aW,Restart:lW,Result:cW,"Resume execution":"Riprendi esecuzione","Root folder":"Cartella root","Rules description":"Crea regole con i blocchi IF, THEN, ELSE","Run script":"Esegui script",Sa:uW,Saturday:dW,Save:hW,"Save all":"Salva tutto","Say It":"Say It","Say some text via sayit adapter":"Pronuncia del testo tramite l'adattatore sayit",Schedule:pW,Script:gW,"Script %s was modified on disk":"Lo script %s è stato modificato sul disco","Script was modified externally":"Lo script è stato modificato esternamente","Script is not running":"Lo script non è in esecuzione","Search in scripts":"Cerca negli script","Search...":"Ricerca...","Select all":"Seleziona tutto","Send email":"Invia una email","Sends an email":"Invia un'e-mail","Sends message via Pushsafer":"Invia messaggio tramite Pushsafer","Sends message via pushover":"Invia messaggio tramite pushover","Sends message via telegram":"Invia messaggio tramite telegramma","Sends message via whatsapp-cmb":"Invia messaggio tramite whatsapp-cmb",September:mW,"Server time":"Ora del server","Set state action":"Imposta l'azione dello stato","Set with delay":"Impostato con ritardo","Shell command":"Comando Shell","Show astronomical events":"Mostra eventi astronomici","Show javascript code":"Mostra codice Javascript","Show logs":"Mostra i log","Show only paused scripts":"Mostra solo script in pausa","Show only running scripts":"Mostra solo gli script in esecuzione","Show only scripts with problems":"Mostra solo script con problemi",Simulate:fW,"Some files will be rejected":"Alcuni file verranno rifiutati","Sound:":"Suono:",Stack:$W,Start:bW,"Start script":"Avvia script",State:vW,"State condition":"Condizione dello stato","Step into function":"Entra in funzione","Step out from function":"Esci dalla funzione","Stop on exception":"Ferma in caso di eccezione",Su:yW,"Subject:":"Soggetto:",Sunday:_W,"TS description":"Creare regole scrivendo dattiloscritto",Telegram:wW,"Text:":"Testo:",Th:kW,'The script "%s" has been modified by another user or in another window. Do you want to reload the script or keep your local changes?':`Lo script "%s" è stato modificato da un altro utente o in un'altra finestra. Vuoi ricaricare lo script o mantenere le tue modifiche locali?`,"The script will be stopped and must be activated manually after debugging. Continue?":"Lo script verrà interrotto e dovrà essere attivato manualmente dopo il debug. Continua?","This is advances option. You can write your own code here and it will be executed on trigger":"Questa è un'opzione anticipata. Puoi scrivere il tuo codice qui e verrà eseguito al trigger",Thursday:CW,Time:TW,"Time condition":"Condizione temporale","Title:":"Titolo:","To:":"Per:","Trigger with value":"Trigger con valore",Triggered:SW,Triggers:EW,"Triggers the on script saving or the javascript instance restart":"Attiva il salvataggio dello script o il riavvio dell'istanza javascript","Triggers the rule on update or change of some state":"Attiva la regola in caso di aggiornamento o modifica di uno stato","Triggers the rule periodically or on some specific time":"Attiva la regola periodicamente o in un momento specifico",Tu:IW,Tuesday:xW,URL:DW,"Unknown error":"Errore sconosciuto","Unknown error!":"Errore sconosciuto!","Use generated code":"Usa il codice generato","User function":"Funzione utente","User:":"Utente:",Value:AW,"Vibration:":"Vibrazione:",Volume:RW,We:OW,Wednesday:NW,"Whatsapp-cmb":"Whatsapp-cmb",Write:MW,"Write your own code":"Scrivi il tuo codice",Yes:LW,"Yet exists!":"Esiste ancora!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"È possibile utilizzare %s nell'URL per utilizzare il valore di trigger corrente, %id per utilizzare l'ID dell'oggetto attivato, %name per mostrare il nome dell'ID dell'oggetto attivato o %old per utilizzare il vecchio valore di trigger","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"È possibile utilizzare %s nel comando per utilizzare il valore di trigger corrente, %id per utilizzare l'ID dell'oggetto attivato, %name per mostrare il nome dell'ID dell'oggetto attivato o %old per utilizzare il vecchio valore di trigger","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"È possibile utilizzare %s nel testo per visualizzare il valore di trigger corrente, %id per utilizzare l'ID dell'oggetto attivato, %name per mostrare il nome dell'ID dell'oggetto attivato o %old per utilizzare il vecchio valore di trigger","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"È possibile utilizzare %s nel valore per utilizzare il valore di trigger corrente, %id per utilizzare l'ID dell'oggetto attivato, %name per mostrare il nome dell'ID dell'oggetto attivato o %old per utilizzare il vecchio valore di trigger","You have to enter OpenAI API key in the configuration of javascript adapter.":"Devi inserire la chiave API OpenAI nella configurazione dell'adattatore javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Devi inserire almeno una chiave API (OpenAI, Anthropic o Gemini) nella configurazione dell'adattatore javascript.","Please select a valid model":"Seleziona un modello valido","[equal]":"[pari]","[greater or equal]":"[maggiore o uguale]","[greater]":"[maggiore]","[hysteresis]":"[isteresi]","[includes]":"[include]","[less or equal]":"[minore o uguale]","[less]":"[Di meno]","[not equal]":"[non uguale]",acknowledgment:PW,all:BW,and:jW,"as JSON":"come JSON","as plain text":"come testo",astro:FW,at:zW,"clear running":"chiara esecuzione",control:UW,copy:HW,cron:WW,dawn:GW,debug_help:VW,debug_label:KW,default:"predefinito",dusk:YW,easy:JW,else:"altro","equal to":"uguale a",every:qW,"every hour at 0 minutes":"ogni ora a 0 minuti",false:"falso","file reading has failed: %s":"lettura file non riuscita: %s","file reading was aborted":"la lettura del file è stata interrotta",filter_func:XW,filter_id:ZW,filter_name:QW,filter_role:e5,filter_room:t5,"for edit or create script":"per modificare o creare un nuovo script","for professionals":"per i professionisti","for programmers":"per i programmatori",goldenHour:s5,goldenHourEnd:o5,"greater or equal":"maggiore o uguale","greater or equal to":"maggiore o uguale a","greater than":"più grande di",help_just_check:i5,help_on_change:n5,"high priority":"priorità alta","high-priority":"priorità alta","highest priority":"massima priorità",hours:r5,includes:a5,interval:l5,"just check":"controlla solamente","less or equal":"inferiore o uguale","less or equal to":"minore o uguale a","less than":"meno di","lower priority":"priorità inferiore","lowest priority":"priorità più bassa",magic:c5,milliseconds:u5,minutes:d5,ms:h5,nadir:p5,nauticalDawn:g5,nauticalDusk:m5,nextSunrise:f5,nextSunset:$5,night:b5,nightEnd:v5,"no blocks found":"Nessun blocco trovato","no group":"NESSUN GRUPPO",normal:y5,"normal priority":"priorità normale","not running":"non in esecuzione","not equal to":"non uguale a","not properly connected":"Questo blocco non è correttamente collegato ad altri blocchi.",offset:_5,"on change":"sul cambiamento","on condition change":"a cambio di condizione","on update":"in aggiornamento",one:w5,or:k5,quiet:C5,"reset search":"resetta la ricerca",search:T5,seconds:S5,solarNoon:E5,"store in":"conservare in",sunrise:I5,sunriseEnd:x5,sunset:D5,sunsetStart:A5,then:R5,"toggle value":"alterna valore",tooltip_ack:O5,tooltip_from:N5,tooltip_lc:M5,tooltip_quality:L5,tooltip_ts:P5,tooltip_user:B5,tooltip_value:j5,true:"vero",two:F5,undefined:"non definito",update:z5,"use seconds":"usa i secondi","use trigger value":"usa il trigger",verbose_help:U5,verbose_label:H5,when:W5,with:"con","with date":"con data","with offset":"con offset",wizard:G5,"Loading models...":"Caricamento modelli...","Could not connect to API at %s":"Impossibile connettersi all'API su %s","Invalid API key":"Chiave API non valida","Access denied by API":"Accesso negato dall'API","API error: %s":"Errore API: %s",'Model "%s" not found':'Modello "%s" non trovato',"Request failed: %s":"Richiesta fallita: %s",Retry:V5,"No running javascript instance found":"Nessuna istanza JavaScript in esecuzione trovata"},Y5="Erkend",J5="Acties",q5="Toevoegen",X5="Alle",Z5="Ieder",Q5="Solliciteer",e3="april",t3="Vragen",s3="Astronomisch",o3="augustus",i3="annuleren",n3="Dichtbij",r3="Staat",a3="Voorwaarden",l3="Troosten",c3="Gekopieerd",u3="december",d3="Standaard",h3="Vertraging",p3="Verwijder",g3="Beschrijving",m3="Gedaan",f3="Exec shell",$3="Uitleg",b3="Exporteren",v3="Februari",y3="februari",_3="Filter",w3="Map",k3="Vr",C3="vrijdag",T3="ID kaart",S3="ID1",E3="ID2",I3="Importeren",x3="Voorbeeld",D3="Instanties",A3="Instructies",R3="Januar",O3="januari",N3="juli",M3="juni",L3="Begrenzing",P3="maart",B3="mei",j3="Menu",F3="Bericht",z3="Ma",U3="Model",H3="maandag",W3="Maand",G3="Meer",V3="Naam",K3="november",Y3="OK",J3="oktober",q3="OK",X3="Pauze",Z3="Pushover",Q3="Duwijzer",eG="Herladen",tG="andere naam geven",sG="Herhaling",oG="Herstarten",iG="Resultaat",nG="Za",rG="zaterdag",aG="Opslaan",lG="Schema",cG="Script",uG="september",dG="Simuleren",hG="Stack",pG="Begin",gG="Staat",mG="Zo",fG="zondag",$G="Telegram",bG="4",vG="donderdag",yG="Tijd",_G="Veroorzaakt",wG="Triggers",kG="Di",CG="dinsdag",TG="URL",SG="Waarde",EG="Volume",IG="3",xG="woensdag",DG="Schrijven",AG="Ja",RG="erkenning",OG="alle",NG="en",MG="astro",LG="Bij",PG="controle",BG="kopiëren",jG="cron",FG="dageraad",zG="Dit is een speciale modus waarin toestanden en objecten niet veranderen. Maar alleen informatie over elke geplande wijziging wordt in het protocol weergegeven.",UG="Debuggen",HG="schemer",WG="eenvoudig",GG="elke",VG="Functie",KG="ID kaart",YG="Naam",JG="Rol",qG="Kamer",XG="gouden uur",ZG="Einde van gouden uur",QG='De code wordt alleen uitgevoerd als de voorwaarde waar is. Bijv. als het triggeren op de temperatuursensorwaarde en de conditie is "als de temperatuur hoger is dan 20 ° C", zullen de "dan" acties worden uitgevoerd elke keer dat de sensor de temperatuur verzendt en deze hoger is dan 20 ° C. Bij 21 ° C, bij 22 ° C enzovoort.',eV='De code wordt alleen uitgevoerd als het conditieresultaat verandert. Bijv. als de temperatuursensor wordt geactiveerd en de conditie is "als de temperatuur hoger is dan 20 ° C", worden de "dan" -acties eenmaal uitgevoerd wanneer de temperatuur hoger is dan 20. De volgende keer worden de "dan" -acties uitgevoerd wanneer de temperatuur faalt onder de 20 en stijgt dan weer boven de 20.',tV="uren",sV="omvat",oV="interval",iV="magie",nV="milliseconden",rV="minuten",aV="ms",lV="nadir",cV="Nautische dageraad",uV="Nautische schemering",dV="Volgende zonsopgang",hV="Volgende zonsondergang",pV="nacht",gV="Einde van de nacht",mV="normaal",fV="compensatie",$V="een",bV="of",vV="stil",yV="zoeken",_V="seconden",wV="Zonne-middag",kV="zonsopkomst",CV="Einde zonsopgang",TV="zonsondergang",SV="Begin van de zonsondergang",EV="vervolgens",IV="Erkennen",xV="Van",DV="Laatst gewijzigd",AV="Kwaliteit",RV="tijdstempel",OV="Gebruiker",NV="Waarde",MV="twee",LV="bijwerken",PV="Voegt foutopsporingsuitvoer toe aan het logboek voor veel systeemopdrachten",BV="Uitgebreide log-uitgangen",jV="wanneer",FV="tovenaar",zV="Opnieuw proberen",UV={"%s not found":"%s niet gevonden","()":"()","(at %s)":"(op %s)","(optional)":"(optioneel)","-":"-",".":".","AI code generator":"AI-codegenerator",Ack:Y5,Actions:J5,"Actual time of day":"Werkelijke tijd van de dag",Add:q5,"Add new script":"Nieuw script toevoegen",All:X5,"All files will be accepted":"Alle bestanden worden geaccepteerd",Any:Z5,"Any month":"Elke maand",Apply:Q5,April:e3,"Are you sure?":"Weet je zeker dat?",Ask:t3,Astronomical:s3,"Astronomical events today":"Astronomische gebeurtenissen vandaag",August:o3,"Blockly description":"Regels maken door grafische blokken","Body:":"Lichaam:",Cancel:i3,"Cannot delete non empty item!":"Kan niet leeg item niet verwijderen!","Change layout":"Opmaak veranderen",'Change theme (actual "%s")':'Thema wijzigen (nu - "%s")',"Check blocks":"Controleer blokken","Check is not active, because javascript adapter is disabled":"Controle is niet actief, omdat Javascript-adapter is uitgeschakeld","Clear search input":"Zoekopdracht wissen","Click on this icon":"Klik op dit pictogram",Close:n3,"Close all but current":"Alles sluiten behalve huidig","Collapse all":"Alles inklappen","Compares current time with astronomical event":"Vergelijkt huidige tijd met astronomische gebeurtenis","Compares current time with the user specific time":"Vergelijkt de huidige tijd met de gebruikerspecifieke tijd","Compares the state value with user defined value":"Vergelijkt de statuswaarde met de door de gebruiker gedefinieerde waarde",Condition:r3,Conditions:a3,"Configuration not saved.":"Configuratie niet opgeslagen.",Console:l3,"Control or update some state":"Beheer of update een bepaalde staat","Control or update some state with delay":"Beheer of update een bepaalde staat met vertraging","Convert blockly to javascript for ever.":"Converteer direct blockly naar Javascript.",Copied:c3,"Copy script":"Kopieer script","Copy to clipboard":"Kopieer naar klembord","Create new":"Maak nieuw","Create new folder":"Maak een nieuwe map","Create new script":"Maak een nieuw script","Create or edit CRON or time wizard":"Creëer of bewerk CRON of tijdwizard","Dark Theme":"Donker thema","Dark style":"Donkere stijl",Date:"Datum","Debug instance":"Debug-instantie","Debug options":"Foutopsporingsopties",December:u3,Default:d3,"Define cron...":"Definieer cron ...","Define schedule...":"Definieer schema ...",Delay:h3,Delete:p3,"Delete %s":"%s verwijderen ...","Delete folder":"Verwijder map","Delete script":"Script verwijderen",Description:g3,"Deselect all":"Deselecteer alles","Discard changes for %s":"Wijzigingen voor %s annuleren",Done:m3,"Double click to write value":"Dubbelklikken om waarde te schrijven","Download as file":"Download","Drop some files here or click...":"Zet hier enkele bestanden neer of klik op ...","Duplicate name":"Dubbele naam","Edit script or just double click":"Bewerk het script of dubbelklik erop","Empty name is not allowed":"Lege naam is niet toegestaan","End search mode":"Zoekmodus beëindigen","Enter your question":"Voer uw verzoek in",Error:"Fout","Error formatting code":"Fout bij het opmaken van de code","Error was found":"Er is een fout gevonden","Every day":"Elke dag",Exec:f3,"Executes some shell command":"Voert een shell-commando uit","Existing scripts will be overwritten.":"Bestaande scripts worden overschreven.","Expand all":"Alles uitvouwen","Expert mode":"Expert modus",Explanation:$3,Export:b3,"Export all scripts":"Exporteer alle scripts","Export blocks":"Blokken exporteren","Export selected blocks":"Exporteer geselecteerde blokken",Februar:v3,February:y3,Filter:_3,Folder:w3,Fr:k3,Friday:C3,Function:"Functie","Function editor":"Functie-editor","Function: executed":"Functie: uitgevoerd","Go to next line":"Ga naar de volgende regel","HTTP Call":"HTTP-oproep","Hide logs":"Verberg logboeken",ID:T3,ID1:S3,ID2:E3,Import:I3,"Import blocks":"Blokken importeren","Import error":"Importfout","Import scripts":"Scripts importeren","Insert object ID":"Object-ID invoegen",Instance:x3,"Instance is disabled":"Exemplaar is uitgeschakeld","Instance:":"Voorbeeld:",Instances:D3,Instructions:A3,"Invalid CRON":"Ongeldige CRON","It will not be possible to revert this operation.":"Het is niet mogelijk om deze bewerking terug te zetten.","JS description":"Regels maken door Javascript te schrijven",Januar:R3,January:O3,July:N3,June:M3,"Just check":"Kijk maar","Keep my changes":"Mijn wijzigingen behouden","Language:":"Taal:","Learn More":"Leer meer","Light style":"Lichte stijl",Limit:L3,"Local time":"Lokale tijd","Locate file":"Vind het bestand","Log outputs":"Log uitgangen","Log text":"Log tekst","Log: %s":"Logboek: %s","Make a HTTP get request":"Maak een HTTP-ophaalverzoek","Make a pause between actions":"Pauzeer tussen acties",March:P3,"March ":"maart",May:B3,Menu:j3,Message:F3,Mo:z3,Model:U3,Monday:H3,Month:W3,More:G3,Name:V3,"No API key found":"Geen API-sleutel gevonden","No Chat GPT Key found":"Geen Chat GPT-sleutel gevonden","No active host found":"Geen actieve host gevonden","Nothing found":"Niets gevonden",November:K3,OK:Y3,October:J3,Ok:q3,"On condition change":"Op voorwaarde verandering","On script save or adapter start":"Bij het opslaan van het script of het starten van de adapter","On weekdays":"Op weekdagen","Open configuration":"Configuratie openen","Operate two states":"Bedien twee toestanden:","Operations with two states":"Bewerkingen met twee toestanden","Paste your blocks here":"Plak hier je blokken",Pause:X3,"Pause execution":"Uitvoering pauzeren","Pause script":"Pauzeer script","Phone:":"Telefoon:","Please select object ID...":"Selecteer object-ID ...","Press Ctrl+Enter to get the answer":"Druk op Ctrl+Enter om het antwoord te krijgen","Prettify the script":"Maak het script mooier","Print some text in log":"Druk wat tekst af in het logboek","Priority:":"Prioriteit:",Pushover:Z3,Pushsafer:Q3,"Read only ID selected: %s":"Alleen-lezen ID geselecteerd: %s",Reload:eG,Rename:tG,"Reorder scripts in folders":"Sorteer scripts in mappen opnieuw",Repeat:sG,Restart:oG,Result:iG,"Resume execution":"Uitvoering hervatten","Root folder":"Hoofdmap","Rules description":"Maak regels met IF, THEN, ELSE blokken","Run script":"Voer script uit",Sa:nG,Saturday:rG,Save:aG,"Save all":"Sla alles op","Say It":"Say It","Say some text via sayit adapter":"Zeg wat tekst via de sayit-adapter",Schedule:lG,Script:cG,"Script %s was modified on disk":"Script %s is gewijzigd op schijf","Script was modified externally":"Script is extern gewijzigd","Script is not running":"Script is niet actief","Search in scripts":"Zoeken in scripts","Search...":"Zoeken...","Select all":"Selecteer alles","Send email":"E-mail verzenden","Sends an email":"Stuurt een e-mail","Sends message via Pushsafer":"Stuurt bericht via Pushsafer","Sends message via pushover":"Stuurt bericht via pushover","Sends message via telegram":"Verzendt bericht via telegram","Sends message via whatsapp-cmb":"Stuurt bericht via whatsapp-cmb",September:uG,"Server time":"Servertijd","Set state action":"Stel statusactie in","Set with delay":"Met vertraging ingesteld","Shell command":"Shell-opdracht","Show astronomical events":"Laat astronomische gebeurtenissen zien","Show javascript code":"Javascript-code weergeven","Show logs":"Toon logboeken","Show only paused scripts":"Toon alleen onderbroken scripts","Show only running scripts":"Toon alleen actieve scripts","Show only scripts with problems":"Toon alleen scripts met problemen",Simulate:dG,"Some files will be rejected":"Sommige bestanden worden geweigerd","Sound:":"Geluid:",Stack:hG,Start:pG,"Start script":"Start het script",State:gG,"State condition":"Staat staat","Step into function":"Stap in functie","Step out from function":"Stap uit de functie","Stop on exception":"Stop bij uitzondering",Su:mG,"Subject:":"Onderwerpen:",Sunday:fG,"TS description":"Regels maken door Typescript te schrijven",Telegram:$G,"Text:":"Tekst:",Th:bG,'The script "%s" has been modified by another user or in another window. Do you want to reload the script or keep your local changes?':'Het script "%s" is gewijzigd door een andere gebruiker of in een ander venster. Wilt u het script herladen of uw lokale wijzigingen behouden?',"The script will be stopped and must be activated manually after debugging. Continue?":"Het script wordt gestopt en moet na het debuggen handmatig worden geactiveerd. Doorgaan met?","This is advances option. You can write your own code here and it will be executed on trigger":"Dit is een voorschotoptie. U kunt hier uw eigen code schrijven en deze wordt bij een trigger uitgevoerd",Thursday:vG,Time:yG,"Time condition":"Tijdsvoorwaarde","Title:":"Titel:","To:":"Naar:","Trigger with value":"Trigger met waarde",Triggered:_G,Triggers:wG,"Triggers the on script saving or the javascript instance restart":"Activeert het opslaan van het script of het opnieuw opstarten van de JavaScript-instantie","Triggers the rule on update or change of some state":"Activeert de regel voor het bijwerken of wijzigen van een bepaalde staat","Triggers the rule periodically or on some specific time":"Activeert de regel periodiek of op een specifieke tijd",Tu:kG,Tuesday:CG,URL:TG,"Unknown error":"Onbekende fout","Unknown error!":"Onbekende fout!","Use generated code":"Gebruik gegenereerde code","User function":"Gebruikersfunctie","User:":"Gebruiker:",Value:SG,"Vibration:":"Trilling:",Volume:EG,We:IG,Wednesday:xG,"Whatsapp-cmb":"Whatsapp-cmb",Write:DG,"Write your own code":"Schrijf je eigen code",Yes:AG,"Yet exists!":"Toch bestaat!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"U kunt %s in de URL gebruiken om de huidige triggerwaarde te gebruiken, %id om de geactiveerde object-ID te gebruiken, %name om de geactiveerde object-ID-naam te tonen of %old om de oude triggerwaarde te gebruiken","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"U kunt %s in de opdracht gebruiken om de huidige triggerwaarde te gebruiken, %id om de getriggerde object-ID te gebruiken, %name om de getriggerde object-ID-naam te tonen of %old om de oude triggerwaarde te gebruiken","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"U kunt %s in de tekst gebruiken om de huidige triggerwaarde weer te geven, %id om de geactiveerde object-ID te gebruiken, %name om de geactiveerde object-ID-naam weer te geven of %old om de oude triggerwaarde te gebruiken","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"U kunt %s in de waarde gebruiken om de huidige triggerwaarde te gebruiken, %id om de geactiveerde object-ID te gebruiken, %name om de geactiveerde object-ID-naam te tonen of %old om de oude triggerwaarde te gebruiken","You have to enter OpenAI API key in the configuration of javascript adapter.":"U moet de OpenAI API-sleutel invoeren in de configuratie van de javascript-adapter.","You have to enter at least one API key in the configuration of javascript adapter.":"U moet ten minste één API-sleutel (OpenAI, Anthropic of Gemini) invoeren in de configuratie van de javascript-adapter.","Please select a valid model":"Selecteer een geldig model","[equal]":"[Gelijk]","[greater or equal]":"[groter of gelijk]","[greater]":"[groter]","[hysteresis]":"[hysterese]","[includes]":"[inclusief]","[less or equal]":"[minder of gelijk]","[less]":"[minder]","[not equal]":"[niet gelijk]",acknowledgment:RG,all:OG,and:NG,"as JSON":"als JSON","as plain text":"als platte tekst",astro:MG,at:LG,"clear running":"duidelijk rennen",control:PG,copy:BG,cron:jG,dawn:FG,debug_help:zG,debug_label:UG,default:"standaard",dusk:HG,easy:WG,else:"anders","equal to":"gelijk aan",every:GG,"every hour at 0 minutes":"elk uur op 0 minuten",false:"false","file reading has failed: %s":"bestands lezen is mislukt: %s","file reading was aborted":"bestands lezen is afgebroken",filter_func:VG,filter_id:KG,filter_name:YG,filter_role:JG,filter_room:qG,"for edit or create script":"voor bewerken of een nieuw script maken","for professionals":"voor professionals","for programmers":"voor programmeurs",goldenHour:XG,goldenHourEnd:ZG,"greater or equal":"groter of gelijk","greater or equal to":"groter of gelijk aan","greater than":"groter dan",help_just_check:QG,help_on_change:eV,"high priority":"hoge prioriteit","high-priority":"hoge prioriteit","highest priority":"hoogste prioriteit",hours:tV,includes:sV,interval:oV,"just check":"kijk maar","less or equal":"minder of gelijk","less or equal to":"minder of gelijk aan","less than":"minder dan","lower priority":"lagere prioriteit","lowest priority":"laagste prioriteit",magic:iV,milliseconds:nV,minutes:rV,ms:aV,nadir:lV,nauticalDawn:cV,nauticalDusk:uV,nextSunrise:dV,nextSunset:hV,night:pV,nightEnd:gV,"no blocks found":"Geen blokken gevonden","no group":"GEEN GROEP",normal:mV,"normal priority":"normale prioriteit","not running":"niet actief","not equal to":"niet gelijk aan","not properly connected":"Dit blok is niet correct verbonden met andere blokken.",offset:fV,"on change":"bij verandering","on condition change":"op voorwaarde verandering","on update":"bij update",one:$V,or:bV,quiet:vV,"reset search":"reset zoeken",search:yV,seconds:_V,solarNoon:wV,"store in":"opslaan in",sunrise:kV,sunriseEnd:CV,sunset:TV,sunsetStart:SV,then:EV,"toggle value":"schakelwaarde",tooltip_ack:IV,tooltip_from:xV,tooltip_lc:DV,tooltip_quality:AV,tooltip_ts:RV,tooltip_user:OV,tooltip_value:NV,true:"waar",two:MV,undefined:"ongedefinieerd",update:LV,"use seconds":"gebruik seconden","use trigger value":"triggerwaarde gebruiken",verbose_help:PV,verbose_label:BV,when:jV,with:"met","with date":"met datum","with offset":"met offset",wizard:FV,"Loading models...":"Modellen laden...","Could not connect to API at %s":"Kan geen verbinding maken met API op %s","Invalid API key":"Ongeldige API-sleutel","Access denied by API":"Toegang geweigerd door API","API error: %s":"API-fout: %s",'Model "%s" not found':'Model "%s" niet gevonden',"Request failed: %s":"Verzoek mislukt: %s",Retry:zV,"No running javascript instance found":"Geen draaiende JavaScript-instantie gevonden"},HV="Potwierdzony",WV="Działania",GV="Dodaj",VV="Wszystko",KV="Każdy",YV="Zastosuj",JV="Kwiecień",qV="Zapytać",XV="Astronomiczny",ZV="Sierpień",QV="Odwołaj",e4="Zamknij",t4="Stan",s4="Warunki",o4="Konsola",i4="Skopiowano",n4="Grudzień",r4="Domyślna",a4="Opóźnienie",l4="Usuń",c4="Opis",u4="Gotowe",d4="Uruchom shell",h4="Wyjaśnienie",p4="Eksport",g4="Luty",m4="Luty",f4="Filtr",$4="Folder",b4="Pt",v4="Piątek",y4="ID",_4="ID1",w4="ID2",k4="Import",C4="Instancja",T4="Instancje",S4="Instrukcje",E4="Styczeń",I4="Styczeń",x4="Lipiec",D4="Czerwiec",A4="Limit",R4="Marzec",O4="Maj",N4="Menu",M4="Wiadomość",L4="Po",P4="Model",B4="Poniedziałek",j4="Miesiąc",F4="Więcej",z4="Nazwa",U4="Listopad",H4="OK",W4="Październik",G4="Ok",V4="Pauza",K4="Pushover",Y4="Pushsafer",J4="Przeładuj",q4="Przemianuj",X4="Powtórz",Z4="Uruchom ponownie",Q4="Wynik",e8="So",t8="Sobota",s8="Zapisz",o8="Harmonogram",i8="Skrypt",n8="Wrzesień",r8="Symulacja",a8="Stos",l8="Początek",c8="Stan",u8="Nd",d8="Niedziela",h8="Telegram",p8="Cz",g8="Czwartek",m8="Czas",f8="Wyzwolony",$8="Wyzwalacze",b8="Wt",v8="Wtorek",y8="URL",_8="Wartość",w8="Wolumen",k8="Śr",C8="Środa",T8="Pisać",S8="Tak",E8="potwierdzenie",I8="wszystko",x8="i",D8="Astro",A8="w",R8="kontrola",O8="Kopiuj",N8="CRON",M8="Świt",L8="Jest to specjalny tryb, w którym stany i obiekty się nie zmieniają. Jednak w protokole będą wyświetlane tylko informacje o każdej planowanej zmianie.",P8="Odpluskwić",B8="Zmierzch",j8="łatwy",F8="każdy",z8="Funkcja",U8="ID",H8="Nazwa",W8="Rola",G8="Pokój",V8="Złota godzina",K8="Koniec złotej godziny",Y8="Kod zostanie wykonany tylko za każdym razem, gdy warunek będzie spełniony. Na przykład. jeśli wyzwalanie na wartość czujnika temperatury i warunek to „jeśli temperatura jest wyższa niż 20 ° C”, to działania „następnie” będą wykonywane za każdym razem, gdy czujnik wyśle temperaturę i jest powyżej 20 ° C. O 21 ° C, o 22 ° C i tak dalej.",J8="Kod zostanie wykonany tylko wtedy, gdy wynik warunku ulegnie zmianie. Na przykład. jeśli wyzwalanie na wartość czujnika temperatury i warunek „jeśli temperatura jest wyższa niż 20 ° C”, to akcje „następnie” zostaną wykonane raz, gdy temperatura przekroczy 20. Następnym razem działania „następnie” zostaną wykonane, gdy temperatura nie udaje się poniżej 20, a następnie ponownie wzrasta powyżej 20.",q8="godziny",X8="zawiera",Z8="interwał",Q8="magia",e6="milisekund",t6="minuty",s6="ms",o6="Północ słoneczna",i6="Żeglarski świt",n6="Żeglarski zmierzch",r6="Następny wschód słońca",a6="Następny zachód słońca",l6="Noc",c6="Koniec nocy",u6="normalny",d6="przesunięcie",h6="jeden",p6="lub",g6="cisza",m6="Szukaj",f6="sekundy",$6="Południe słoneczne",b6="Wschód słońca",v6="Koniec wschodu słońca",y6="Zachód słońca",_6="Początek zachodu słońca",w6="następnie",k6="Akceptuj",C6="Od",T6="Ostatnia zmiana",S6="Jakość",E6="Znacznik czasu",I6="Użytkownik",x6="Wartość",D6="dwa",A6="aktualizacja",R6="Dodaje wyniki debugowania do dziennika dla wielu poleceń systemowych",O6="Pełne dane wyjściowe dziennika",N6="gdy",M6="Wizard",L6="Ponów próbę",P6={"%s not found":"%s nie znaleziono","()":"()","(at %s)":"(w %s)","(optional)":"(opcjonalny)","-":"-",".":".","AI code generator":"Generator kodu AI",Ack:HV,Actions:WV,"Actual time of day":"Aktualna pora dnia",Add:GV,"Add new script":"Dodaj nowy skrypt",All:VV,"All files will be accepted":"Wszystkie pliki zostaną zaakceptowane",Any:KV,"Any month":"Dowolny miesiąc",Apply:YV,April:JV,"Are you sure?":"Jesteś pewny?",Ask:qV,Astronomical:XV,"Astronomical events today":"Wydarzenia astronomiczne dzisiaj",August:ZV,"Blockly description":"Tworzenie reguł za pomocą bloków graficznych","Body:":"Treść:",Cancel:QV,"Cannot delete non empty item!":"Nie można usunąć niepustego elementu!","Change layout":"Zmiana układu",'Change theme (actual "%s")':"Zmień motyw (obecnie - „%s”)","Check blocks":"Sprawdź bloki","Check is not active, because javascript adapter is disabled":"Sprawdzanie nie jest aktywne, ponieważ adapter Javascript jest wyłączony","Clear search input":"Wyczyść dane wyszukiwania","Click on this icon":"Kliknij tę ikonę",Close:e4,"Close all but current":"Zamknij wszystkie oprócz bieżących","Collapse all":"Zwinąć wszystkie","Compares current time with astronomical event":"Porównuje aktualny czas z wydarzeniem astronomicznym","Compares current time with the user specific time":"Porównuje aktualny czas z czasem określonym przez użytkownika","Compares the state value with user defined value":"Porównuje wartość stanu z wartością zdefiniowaną przez użytkownika",Condition:t4,Conditions:s4,"Configuration not saved.":"Konfiguracja nie została zapisana.",Console:o4,"Control or update some state":"Kontroluj lub aktualizuj stan","Control or update some state with delay":"Kontroluj lub aktualizuj jakiś stan z opóźnieniem","Convert blockly to javascript for ever.":"Bezpowrotna konwersja Blockly na Javascript.",Copied:i4,"Copy script":"Skopiuj skrypt","Copy to clipboard":"Skopiuj do schowka","Create new":"Utwórz nowy","Create new folder":"Utwórz nowy folder","Create new script":"Utwórz nowy skrypt","Create or edit CRON or time wizard":"Utwórz lub edytuj CRON lub kreator czasu","Dark Theme":"Ciemny schemat","Dark style":"Ciemny styl",Date:"Data","Debug instance":"Debuguj instancję","Debug options":"Opcje debugowania",December:n4,Default:r4,"Define cron...":"Zdefiniuj CRON ...","Define schedule...":"Zdefiniuj harmonogram ...",Delay:a4,Delete:l4,"Delete %s":"Usuń %s ...","Delete folder":"Usuń folder","Delete script":"Usuń skrypt",Description:c4,"Deselect all":"Odznacz wszystkie","Discard changes for %s":"Odrzuć zmiany dla %s",Done:u4,"Double click to write value":"Kliknij dwukrotnie, aby zapisać wartość","Download as file":"Download jako plik plik","Drop some files here or click...":"Upuść niektóre pliki tutaj lub kliknij ...","Duplicate name":"Duplikat nazwy","Edit script or just double click":"Edytuj skrypt lub po prostu kliknij dwukrotnie","Empty name is not allowed":"Pusta nazwa jest niedozwolona","End search mode":"Zakończ tryb wyszukiwania","Enter your question":"Wpisz swoją prośbę",Error:"Błąd","Error formatting code":"Błąd formatowania kodu","Error was found":"Błąd został znaleziony","Every day":"Codziennie",Exec:d4,"Executes some shell command":"Wykonuje polecenie powłoki","Existing scripts will be overwritten.":"Istniejące skrypty zostaną zastąpione.","Expand all":"Rozwiń wszystkie","Expert mode":"Tryb ekspercki",Explanation:h4,Export:p4,"Export all scripts":"Wyeksportuj wszystkie skrypty","Export blocks":"Eksportuj bloki","Export selected blocks":"Eksportuj wybrane bloki",Februar:g4,February:m4,Filter:f4,Folder:$4,Fr:b4,Friday:v4,Function:"Funkcja","Function editor":"Edytor funkcji","Function: executed":"Funkcja: wykonywana","Go to next line":"Przejdź do następnej linii","HTTP Call":"Połączenie HTTP","Hide logs":"Ukryj dzienniki",ID:y4,ID1:_4,ID2:w4,Import:k4,"Import blocks":"Importuj bloki","Import error":"Błąd importowania","Import scripts":"Importuj skrypty","Insert object ID":"Wstaw identyfikator obiektu",Instance:C4,"Instance is disabled":"Instancja jest wyłączona","Instance:":"Instancja:",Instances:T4,Instructions:S4,"Invalid CRON":"Nieprawidłowy CRON","It will not be possible to revert this operation.":"Cofnięcie tej operacji nie będzie możliwe.","JS description":"Tworzenie reguł w Javascript",Januar:E4,January:I4,July:x4,June:D4,"Just check":"Po prostu sprawdź","Keep my changes":"Zachowaj moje zmiany","Language:":"Język:","Learn More":"Ucz się więcej","Light style":"Lekki styl",Limit:A4,"Local time":"Czas lokalny","Locate file":"Znajdź plik","Log outputs":"Log dziennika","Log text":"Tekst dziennika","Log: %s":"Dziennik: %s","Make a HTTP get request":"Złóż żądanie HTTP get","Make a pause between actions":"Zrób przerwę między czynnościami",March:R4,"March ":"Marzec ",May:O4,Menu:N4,Message:M4,Mo:L4,Model:P4,Monday:B4,Month:j4,More:F4,Name:z4,"No API key found":"Nie znaleziono klucza API","No Chat GPT Key found":"Nie znaleziono klucza GPT czatu","No active host found":"Nie znaleziono aktywnego hosta","Nothing found":"Nic nie znaleziono",November:U4,OK:H4,October:W4,Ok:G4,"On condition change":"W przypadku zmiany warunków","On script save or adapter start":"Podczas zapisywania skryptu lub uruchamiania adaptera","On weekdays":"W dni powszednie","Open configuration":"Otwarta konfiguracja","Operate two states":"Obsługuj dwa stany","Operations with two states":"Operacje z dwoma stanami","Paste your blocks here":"Wklej tutaj swoje bloki",Pause:V4,"Pause execution":"Wstrzymaj wykonanie","Pause script":"Wstrzymaj skrypt","Phone:":"Telefon:","Please select object ID...":"Wybierz identyfikator obiektu ...","Press Ctrl+Enter to get the answer":"Naciśnij klawisze Ctrl+Enter, aby uzyskać odpowiedź","Prettify the script":"Upiększ skrypt","Print some text in log":"Wydrukuj tekst w dzienniku","Priority:":"Priorytet:",Pushover:K4,Pushsafer:Y4,"Read only ID selected: %s":"Wybrano identyfikator tylko do odczytu: %s",Reload:J4,Rename:q4,"Reorder scripts in folders":"Zmień kolejność skryptów w folderach",Repeat:X4,Restart:Z4,Result:Q4,"Resume execution":"Wznów wykonanie","Root folder":"Folder główny","Rules description":"Twórz reguły z blokami IF, THEN, ELSE","Run script":"Uruchom skrypt",Sa:e8,Saturday:t8,Save:s8,"Save all":"Zapisz wszystko","Say It":"Wypowiedz","Say some text via sayit adapter":"Powiedz tekst przez adapter sayit",Schedule:o8,Script:i8,"Script %s was modified on disk":"Skrypt %s został zmodyfikowany na dysku","Script was modified externally":"Skrypt został zmodyfikowany zewnętrznie","Script is not running":"Skrypt nie działa","Search in scripts":"Szukaj w skryptach","Search...":"Szukaj...","Select all":"Zaznacz wszystko","Send email":"Wysłać email","Sends an email":"Wysyła e-mail","Sends message via Pushsafer":"Wysyła wiadomość przez Pushsafer","Sends message via pushover":"Wysyła wiadomość przez pushover","Sends message via telegram":"Wysyła wiadomość telegramem","Sends message via whatsapp-cmb":"Wysyła wiadomość przez WhatsApp-cmb",September:n8,"Server time":"Czas serwera","Set state action":"Ustaw stan działania","Set with delay":"Ustaw z opóźnieniem","Shell command":"Polecenie powłoki","Show astronomical events":"Pokaż wydarzenia astronomiczne","Show javascript code":"Pokaż kod JavaScript","Show logs":"Pokaż dzienniki","Show only paused scripts":"Pokaż tylko wstrzymane skrypty","Show only running scripts":"Pokaż tylko działające skrypty","Show only scripts with problems":"Pokaż tylko skrypty z problemami",Simulate:r8,"Some files will be rejected":"Niektóre pliki zostaną odrzucone","Sound:":"Dźwięk:",Stack:a8,Start:l8,"Start script":"Uruchom skrypt",State:c8,"State condition":"Warunek stanu","Step into function":"Wejdź do funkcji","Step out from function":"Wyjdź z funkcji","Stop on exception":"Zatrzymaj się na wyjątku",Su:u8,"Subject:":"Temat:",Sunday:d8,"TS description":"Tworzenie reguł w Typescript",Telegram:h8,"Text:":"Tekst:",Th:p8,'The script "%s" has been modified by another user or in another window. Do you want to reload the script or keep your local changes?':'Skrypt "%s" został zmodyfikowany przez innego użytkownika lub w innym oknie. Czy chcesz przeładować skrypt, czy zachować lokalne zmiany?',"The script will be stopped and must be activated manually after debugging. Continue?":"Skrypt zostanie zatrzymany i należy go aktywować ręcznie po debugowaniu. Kontyntynuj?","This is advances option. You can write your own code here and it will be executed on trigger":"To jest opcja zaawansowana. Możesz tutaj napisać własny kod, który zostanie wykonany po wyzwoleniu",Thursday:g8,Time:m8,"Time condition":"Warunek czasowy","Title:":"Tytuł:","To:":"Do:","Trigger with value":"Wyzwalacz z wartością",Triggered:f8,Triggers:$8,"Triggers the on script saving or the javascript instance restart":"Uruchamia zapisywanie skryptu lub restart instancji javascript","Triggers the rule on update or change of some state":"Uruchamia regułę przy aktualizacji lub zmianie jakiegoś stanu","Triggers the rule periodically or on some specific time":"Uruchamia regułę okresowo lub w określonym czasie",Tu:b8,Tuesday:v8,URL:y8,"Unknown error":"Nieznany błąd","Unknown error!":"Nieznany błąd!","Use generated code":"Użyj wygenerowanego kodu","User function":"Funkcja użytkownika","User:":"Użytkownik:",Value:_8,"Vibration:":"Wibracja:",Volume:w8,We:k8,Wednesday:C8,"Whatsapp-cmb":"Whatsapp-cmb",Write:T8,"Write your own code":"Napisz swój własny kod",Yes:S8,"Yet exists!":"A jednak istnieje!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Możesz użyć %s w adresie URL, aby użyć bieżącej wartości wyzwalacza, %id, aby użyć wyzwalanego identyfikatora obiektu, %name, aby wyświetlić nazwę identyfikatora wyzwalanego obiektu, lub %old, aby użyć starej wartości wyzwalacza","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Możesz użyć %s w poleceniu, aby użyć bieżącej wartości wyzwalającej, %id, aby użyć identyfikatora wyzwalanego obiektu, %name, aby wyświetlić nazwę identyfikatora wyzwalanego obiektu, lub %old, aby użyć starej wartości wyzwalającej","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Możesz użyć %s w tekście, aby wyświetlić aktualną wartość wyzwalającą, %id, aby użyć identyfikatora wyzwolonego obiektu, %name, aby wyświetlić nazwę identyfikatora wyzwolonego obiektu lub %old, aby użyć starej wartości wyzwalającej","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Możesz użyć %s w wartości, aby użyć bieżącej wartości wyzwalacza, %id, aby użyć identyfikatora wyzwalanego obiektu, %name, aby wyświetlić nazwę identyfikatora wyzwalanego obiektu, lub %old, aby użyć starej wartości wyzwalacza","You have to enter OpenAI API key in the configuration of javascript adapter.":"Należy wprowadzić klucz OpenAI API w konfiguracji adaptera javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Musisz wprowadzić co najmniej jeden klucz API (OpenAI, Anthropic lub Gemini) w konfiguracji adaptera javascript.","Please select a valid model":"Wybierz prawidłowy model","[equal]":"[równy]","[greater or equal]":"[większe lub równe]","[greater]":"[większe]","[hysteresis]":"[histereza]","[includes]":"[obejmuje]","[less or equal]":"[mniejsze lub równe]","[less]":"[mniejsze]","[not equal]":"[nie równe]",acknowledgment:E8,all:I8,and:x8,"as JSON":"jako JSON","as plain text":"jako zwykły tekst",astro:D8,at:A8,"clear running":"czyste uruchomienie",control:R8,copy:O8,cron:N8,dawn:M8,debug_help:L8,debug_label:P8,default:"domyślna",dusk:B8,easy:j8,else:"inaczej","equal to":"równy",every:F8,"every hour at 0 minutes":"co godzinę po 0 minutach",false:"fałsz","file reading has failed: %s":"odczyt pliku nie powiódł się: %s","file reading was aborted":"odczyt pliku został przerwany",filter_func:z8,filter_id:U8,filter_name:H8,filter_role:W8,filter_room:G8,"for edit or create script":"do edycji lub utwórz nowy skrypt","for professionals":"dla profesjonalistów","for programmers":"dla programistów",goldenHour:V8,goldenHourEnd:K8,"greater or equal":"większe lub równe","greater or equal to":"więcej lub równo","greater than":"więcej niż",help_just_check:Y8,help_on_change:J8,"high priority":"wysoki priorytet","high-priority":"wysoki priorytet","highest priority":"najwyższy priorytet",hours:q8,includes:X8,interval:Z8,"just check":"po prostu sprawdź","less or equal":"mniejsze lub równe","less or equal to":"mniej lub równo","less than":"mniej niż","lower priority":"niższy priorytet","lowest priority":"najniższy priorytet",magic:Q8,milliseconds:e6,minutes:t6,ms:s6,nadir:o6,nauticalDawn:i6,nauticalDusk:n6,nextSunrise:r6,nextSunset:a6,night:l6,nightEnd:c6,"no blocks found":"Nie znaleziono bloków","no group":"BRAK GRUPY",normal:u6,"normal priority":"normalny priorytet","not running":"nie uruchomiony","not equal to":"nie równa się","not properly connected":"Ten blok nie jest poprawnie podłączony do innych bloków.",offset:d6,"on change":"na zmianę","on condition change":"pod warunkiem zmiany warunków","on update":"po aktualizacji",one:h6,or:p6,quiet:g6,"reset search":"zresetuj wyszukiwanie",search:m6,seconds:f6,solarNoon:$6,"store in":"przechowaj w",sunrise:b6,sunriseEnd:v6,sunset:y6,sunsetStart:_6,then:w6,"toggle value":"wartość przełączania",tooltip_ack:k6,tooltip_from:C6,tooltip_lc:T6,tooltip_quality:S6,tooltip_ts:E6,tooltip_user:I6,tooltip_value:x6,true:"prawda",two:D6,undefined:"nieokreślony",update:A6,"use seconds":"użyj sekund","use trigger value":"użyj wartości wyzwalającej",verbose_help:R6,verbose_label:O6,when:N6,with:"z","with date":"z datą","with offset":"z przesunięciem",wizard:M6,"Loading models...":"Ładowanie modeli...","Could not connect to API at %s":"Nie można połączyć się z API pod adresem %s","Invalid API key":"Nieprawidłowy klucz API","Access denied by API":"Odmowa dostępu przez API","API error: %s":"Błąd API: %s",'Model "%s" not found':'Model "%s" nie znaleziony',"Request failed: %s":"Żądanie nie powiodło się: %s",Retry:L6,"No running javascript instance found":"Nie znaleziono uruchomionej instancji JavaScript"},B6="Reconhecido",j6="Ações",F6="Adicionar",z6="Todos",U6="Nenhum",H6="Aplique",W6="abril",G6="Perguntar",V6="Astronômico",K6="agosto",Y6="Cancelar",J6="Fechar",q6="Doença",X6="Condições",Z6="Console",Q6="Copiado",e9="dezembro",t9="Predefinição",s9="Atraso",o9="Deletar",i9="Descrição",n9="Pronto",r9="Exec shell",a9="Explicação",l9="Exportação",c9="Februar",u9="fevereiro",d9="Filtro",h9="Pasta",p9="Fr",g9="Sexta-feira",m9="ID",f9="ID1",$9="ID2",b9="Importar",v9="Instância",y9="Instâncias",_9="Instruções",w9="Januar",k9="janeiro",C9="julho",T9="junho",S9="Limite",E9="março",I9="maio",x9="Menu",D9="mensagem",A9="Mo",R9="Modelo",O9="Segunda-feira",N9="Mês",M9="Mais",L9="Nome",P9="novembro",B9="OK",j9="outubro",F9="Ok",z9="Pausa",U9="Pushover",H9="Pushsafer",W9="Recarregar",G9="Renomear",V9="Repetir",K9="Reiniciar",Y9="Resultado",J9="Sá",q9="Sábado",X9="Salve",Z9="Cronograma",Q9="Script",eK="setembro",tK="Simular",sK="Pilha",oK="Começar",iK="Estado",nK="Su",rK="Domingo",aK="Telegrama",lK="4",cK="Quinta-feira",uK="Tempo",dK="Provocado",hK="Gatilhos",pK="Tu",gK="terça",mK="URL",fK="Valor",$K="Volume",bK="3",vK="quarta",yK="Escrever",_K="sim",wK="reconhecimento",kK="todos",CK="e",TK="astro",SK="no",EK="ao controle",IK="copiar",xK="CRON",DK="alvorecer",AK="Este é um modo especial no qual estados e objetos não serão alterados. Mas apenas as informações sobre cada mudança planejada serão exibidas no protocolo.",RK="Depurar",OK="Crepúsculo",NK="fácil",MK="cada",LK="Função",PK="ID",BK="Nome",jK="Tipo",FK="Quarto",zK="Hora dourada",UK="Fim da hora de ouro",HK='O código será executado apenas sempre que a condição for verdadeira. Por exemplo. se disparar no valor do sensor de temperatura e a condição for "se a temperatura for maior que 20 ° C", as ações "então" serão executadas toda vez que o sensor enviar a temperatura e ela estiver acima de 20 ° C. Por 21 ° C, por 22 ° C e assim por diante.',WK='O código será executado apenas se o resultado da condição mudar. Por exemplo. se disparar no valor do sensor de temperatura e a condição for "se a temperatura for maior que 20 ° C", as ações "então" serão executadas uma vez quando a temperatura estiver acima de 20. Na próxima vez, as ações "então" serão executadas quando a temperatura falha abaixo de 20 e sobe acima de 20 novamente.',GK="horas",VK="inclui",KK="intervalo",YK="Magia",JK="milissegundos",qK="minutos",XK="ms",ZK="nadir",QK="Madrugada náutica",e7="Crepúsculo náutico",t7="próximo nascer do sol",s7="Próximo pôr do sol",o7="Noite",i7="Fim de noite",n7="normal",r7="Deslocamento",a7="1",l7="ou",c7="quieto",u7="procurar",d7="segundos",h7="Meio-dia solar",p7="nascer do sol",g7="Fim do nascer do sol",m7="pôr do sol",f7="Começo do pôr do sol",$7="então",b7="reconhecer",v7="de",y7="Última alteração",_7="Qualidade",w7="timestamp",k7="usuário",C7="valor",T7="dois",S7="atualizar",E7="Adiciona saída de depuração ao log para muitos comandos do sistema",I7="Saídas de log detalhadas",x7="quando",D7="Wizard",A7="Tentar novamente",R7={"%s not found":"%s não encontrado","()":"()","(at %s)":"(em %s)","(optional)":"(opcional)","-":"-",".":".","AI code generator":"Gerador de código de IA",Ack:B6,Actions:j6,"Actual time of day":"Hora real do dia",Add:F6,"Add new script":"Adicionar novo script",All:z6,"All files will be accepted":"Todos os arquivos serão aceitos",Any:U6,"Any month":"Qualquer mês",Apply:H6,April:W6,"Are you sure?":"Você tem certeza?",Ask:G6,Astronomical:V6,"Astronomical events today":"Eventos astronômicos hoje",August:K6,"Blockly description":"Criando regras por blocos gráficos","Body:":"Corpo:",Cancel:Y6,"Cannot delete non empty item!":"Não pode ser deletar, porque não está vazio!","Change layout":"Alterar layout",'Change theme (actual "%s")':'Alterar tema (agora - "%s")',"Check blocks":"Verificar blocos","Check is not active, because javascript adapter is disabled":"A verificação de sintaxe não está ativa porque o adaptador javascript não está rodando.","Clear search input":"Limpar entrada de pesquisa","Click on this icon":"Clique neste ícone",Close:J6,"Close all but current":"Fechar tudo, menos atual","Collapse all":"Recolher todos","Compares current time with astronomical event":"Compara o tempo atual com o evento astronômico","Compares current time with the user specific time":"Compara a hora atual com a hora específica do usuário","Compares the state value with user defined value":"Compara o valor do estado com o valor definido pelo usuário",Condition:q6,Conditions:X6,"Configuration not saved.":"Configuração não esta salva.",Console:Z6,"Control or update some state":"Controlar ou atualizar algum estado","Control or update some state with delay":"Controlar ou atualizar algum estado com atraso","Convert blockly to javascript for ever.":"Converter Blockly em Javascript permanentemente.",Copied:Q6,"Copy script":"Copiar script","Copy to clipboard":"Copiar para área de transferência","Create new":"Crie um novo","Create new folder":"Criar nova pasta","Create new script":"Criar novo script","Create or edit CRON or time wizard":"Criar ou editar o assistente cron ou o assistente de horário","Dark Theme":"Layout escuro","Dark style":"Estilo escuro",Date:"Encontro","Debug instance":"Instância de depuração","Debug options":"Opções de depuração",December:e9,Default:t9,"Define cron...":"Definir cron...","Define schedule...":"Definir agendamento ...",Delay:s9,Delete:o9,"Delete %s":"Deletar %s...","Delete folder":"Deletar pasta","Delete script":"Deletar script",Description:i9,"Deselect all":"Desmarcar todos","Discard changes for %s":"Descartar alterações para %s",Done:n9,"Double click to write value":"Clique duas vezes para escrever o valor","Download as file":"Baixar como arquivo","Drop some files here or click...":"Solte alguns arquivos aqui ou clique em...","Duplicate name":"Nome duplicado","Edit script or just double click":"Edite o script ou clique duas vezes","Empty name is not allowed":"Nome vazio não é permitido","End search mode":"Finalizar modo de pesquisa","Enter your question":"Digite sua solicitação",Error:"Erro","Error formatting code":"Erro de formatação de código","Error was found":"Erro foi encontrado","Every day":"Todos os dias",Exec:r9,"Executes some shell command":"Executa algum comando shell","Existing scripts will be overwritten.":"Os scripts existentes serão substituídos.","Expand all":"Expandir todos","Expert mode":"Modo de especialista",Explanation:a9,Export:l9,"Export all scripts":"Exportar todos os scripts","Export blocks":"Exportar blocos","Export selected blocks":"Exportar blocos selecionados",Februar:c9,February:u9,Filter:d9,Folder:h9,Fr:p9,Friday:g9,Function:"Função","Function editor":"Editor de funções","Function: executed":"Função: executado","Go to next line":"Vá para a próxima linha","HTTP Call":"Chamada HTTP","Hide logs":"Ocultar logs",ID:m9,ID1:f9,ID2:$9,Import:b9,"Import blocks":"Importar blocos","Import error":"Erro de importação","Import scripts":"Importar script","Insert object ID":"Inserir ID do objeto",Instance:v9,"Instance is disabled":"Instância está desativada","Instance:":"Instância:",Instances:y9,Instructions:_9,"Invalid CRON":"CRON inválido","It will not be possible to revert this operation.":"Não será possível reverter esta operação.","JS description":"Criando regras escrevendo Javascript",Januar:w9,January:k9,July:C9,June:T9,"Just check":"Apenas verifique","Keep my changes":"Manter minhas alterações","Language:":"Língua:","Learn More":"Aprender mais","Light style":"Estilo claro",Limit:S9,"Local time":"Hora local","Locate file":"Localize o arquivo","Log outputs":"Saídas de log","Log text":"Texto de registro","Log: %s":"Log: %s","Make a HTTP get request":"Faça uma solicitação HTTP get","Make a pause between actions":"Faça uma pausa entre as ações",March:E9,"March ":"Março",May:I9,Menu:x9,Message:D9,Mo:A9,Model:R9,Monday:O9,Month:N9,More:M9,Name:L9,"No API key found":"Nenhuma chave API encontrada","No Chat GPT Key found":"Nenhuma chave GPT de bate-papo encontrada","No active host found":"Nenhum host ativo encontrado","Nothing found":"Nada encontrado",November:P9,OK:B9,October:j9,Ok:F9,"On condition change":"Na mudança de condição","On script save or adapter start":"Ao salvar o script ou iniciar o adaptador","On weekdays":"Nos dias úteis","Open configuration":"Configuração aberta","Operate two states":"Operar dois estados","Operations with two states":"Operações com dois estados","Paste your blocks here":"Cole seus blocos aqui",Pause:z9,"Pause execution":"Pausar a execução","Pause script":"Pausar script","Phone:":"Telefone:","Please select object ID...":"Selecione o ID do objeto...","Press Ctrl+Enter to get the answer":"Pressione Ctrl+Enter para obter a resposta","Prettify the script":"Embeleze o roteiro","Print some text in log":"Imprimir algum texto no log","Priority:":"Prioridade:",Pushover:U9,Pushsafer:H9,"Read only ID selected: %s":"ID somente leitura selecionada: %s",Reload:W9,Rename:G9,"Reorder scripts in folders":"Reordenar scripts em pastas",Repeat:V9,Restart:K9,Result:Y9,"Resume execution":"Retomar execução","Root folder":"Pasta principal","Rules description":"Crie regras com blocos IF, THEN, ELSE","Run script":"Executar script",Sa:J9,Saturday:q9,Save:X9,"Save all":"Salvar tudo","Say It":"Say It","Say some text via sayit adapter":"Diga algum texto através do adaptador sayit",Schedule:Z9,Script:Q9,"Script %s was modified on disk":'O script "%s" foi modificado no disco rígido',"Script was modified externally":"O script foi modificado externamente","Script is not running":"Script não está sendo executado","Search in scripts":"Pesquisa em scripts","Search...":"Procurar...","Select all":"Selecionar tudo","Send email":"Enviar email","Sends an email":"Envia um email","Sends message via Pushsafer":"Envia mensagem via Pushsafer","Sends message via pushover":"Envia mensagem via pushover","Sends message via telegram":"Envia mensagem via telegrama","Sends message via whatsapp-cmb":"Envia mensagem via whatsapp-cmb",September:eK,"Server time":"Tempo de servidor","Set state action":"Definir ação de estado","Set with delay":"Definido com atraso","Shell command":"Comando shell","Show astronomical events":"Mostrar eventos astronômicos","Show javascript code":"Mostrar código Javascript","Show logs":"Mostrar logs","Show only paused scripts":"Mostrar apenas scripts pausados","Show only running scripts":"Mostrar apenas scripts em execução","Show only scripts with problems":"Mostrar apenas scripts com problemas",Simulate:tK,"Some files will be rejected":"Alguns arquivos serão rejeitados","Sound:":"Som:",Stack:sK,Start:oK,"Start script":"Iniciar script",State:iK,"State condition":"Condição de estado","Step into function":"Entre na função","Step out from function":"Saia da função","Stop on exception":"Pare na exceção",Su:nK,"Subject:":"Sujeito:",Sunday:rK,"TS description":"Criando regras escrevendo Typecript",Telegram:aK,"Text:":"Texto:",Th:lK,'The script "%s" has been modified by another user or in another window. Do you want to reload the script or keep your local changes?':'O script "%s" foi modificado por outro usuário ou em outra janela. Deseja recarregar o script ou manter suas alterações locais?',"The script will be stopped and must be activated manually after debugging. Continue?":"O script será interrompido e deve ser ativado manualmente após a depuração. Continuar?","This is advances option. You can write your own code here and it will be executed on trigger":"Esta é a opção de avanços. Você pode escrever seu próprio código aqui e ele será executado no gatilho",Thursday:cK,Time:uK,"Time condition":"Condição de tempo","Title:":"Título:","To:":"Para:","Trigger with value":"Trigger com valor",Triggered:dK,Triggers:hK,"Triggers the on script saving or the javascript instance restart":"Aciona o salvamento do script ou a reinicialização da instância javascript","Triggers the rule on update or change of some state":"Aciona a regra na atualização ou mudança de algum estado","Triggers the rule periodically or on some specific time":"Aciona a regra periodicamente ou em algum momento específico",Tu:pK,Tuesday:gK,URL:mK,"Unknown error":"Erro desconhecido","Unknown error!":"Erro desconhecido!","Use generated code":"Usar código gerado","User function":"Função do usuário","User:":"Do utilizador:",Value:fK,"Vibration:":"Vibração:",Volume:$K,We:bK,Wednesday:vK,"Whatsapp-cmb":"Whatsapp-cmb",Write:yK,"Write your own code":"Escreva seu próprio código",Yes:_K,"Yet exists!":"Ainda existe!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Você pode usar %s na URL para usar o valor do gatilho atual, %id para usar o ID do objeto acionado, %name para mostrar o nome do ID do objeto acionado ou %old para usar o valor do gatilho antigo","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Você pode usar %s no comando para usar o valor do acionador atual, %id para usar o ID do objeto acionado, %name para mostrar o nome do ID do objeto acionado ou %old para usar o valor do acionador antigo","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Você pode usar %s no texto para exibir o valor do acionador atual, %id para usar o ID do objeto acionado, %name para mostrar o nome do ID do objeto acionado ou %old para usar o valor do acionador antigo","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Você pode usar %s no valor para usar o valor do acionador atual, %id para usar o ID do objeto acionado, %name para mostrar o nome do ID do objeto acionado ou %old para usar o valor do acionador antigo","You have to enter OpenAI API key in the configuration of javascript adapter.":"Você deve inserir a chave da API OpenAI na configuração do adaptador javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Você deve inserir pelo menos uma chave API (OpenAI, Anthropic ou Gemini) na configuração do adaptador javascript.","Please select a valid model":"Selecione um modelo válido","[equal]":"[igual]","[greater or equal]":"[maior ou igual]","[greater]":"[maior]","[hysteresis]":"[histerese]","[includes]":"[inclui]","[less or equal]":"[menor ou igual]","[less]":"[menos]","[not equal]":"[não igual]",acknowledgment:wK,all:kK,and:CK,"as JSON":"como JSON","as plain text":"como texto simples",astro:TK,at:SK,"clear running":"corrida limpa",control:EK,copy:IK,cron:xK,dawn:DK,debug_help:AK,debug_label:RK,default:"predefinição",dusk:OK,easy:NK,else:"outro","equal to":"igual a",every:MK,"every hour at 0 minutes":"a cada hora em 0 minutos",false:"falso","file reading has failed: %s":"a leitura do arquivo falhou: %s","file reading was aborted":"a leitura do arquivo foi abortada",filter_func:LK,filter_id:PK,filter_name:BK,filter_role:jK,filter_room:FK,"for edit or create script":"para editar ou criar um novo script","for professionals":"para profissionais","for programmers":"para programadores",goldenHour:zK,goldenHourEnd:UK,"greater or equal":"maior ou igual","greater or equal to":"maior ou igual a","greater than":"Maior que",help_just_check:HK,help_on_change:WK,"high priority":"prioridade máxima","high-priority":"prioridade máxima","highest priority":"Prioridade máxima",hours:GK,includes:VK,interval:KK,"just check":"Apenas verifique","less or equal":"menor ou igual","less or equal to":"menor ou igual a","less than":"Menor que","lower priority":"prioridade mais baixa","lowest priority":"prioridade mais baixa",magic:YK,milliseconds:JK,minutes:qK,ms:XK,nadir:ZK,nauticalDawn:QK,nauticalDusk:e7,nextSunrise:t7,nextSunset:s7,night:o7,nightEnd:i7,"no blocks found":"Nenhum bloco encontrado","no group":"SEM GRUPO",normal:n7,"normal priority":"prioridade normal","not running":"não está em execução","not equal to":"não é igual a","not properly connected":"Este bloco não está conectado corretamente com outros blocos.",offset:r7,"on change":"em mudança","on condition change":"na mudança de condição","on update":"em atualização",one:a7,or:l7,quiet:c7,"reset search":"redefinir pesquisa",search:u7,seconds:d7,solarNoon:h7,"store in":"armazenar em",sunrise:p7,sunriseEnd:g7,sunset:m7,sunsetStart:f7,then:$7,"toggle value":"valor de alternância",tooltip_ack:b7,tooltip_from:v7,tooltip_lc:y7,tooltip_quality:_7,tooltip_ts:w7,tooltip_user:k7,tooltip_value:C7,true:"verdade",two:T7,undefined:"Indefinido",update:S7,"use seconds":"use segundos","use trigger value":"use o gatilho",verbose_help:E7,verbose_label:I7,when:x7,with:"com","with date":"com data","with offset":"com deslocamento",wizard:D7,"Loading models...":"Carregando modelos...","Could not connect to API at %s":"Não foi possível conectar à API em %s","Invalid API key":"Chave API inválida","Access denied by API":"Acesso negado pela API","API error: %s":"Erro de API: %s",'Model "%s" not found':'Modelo "%s" não encontrado',"Request failed: %s":"Solicitação falhou: %s",Retry:A7,"No running javascript instance found":"Nenhuma instância JavaScript em execução encontrada"},O7="Подтверждение",N7="Действия",M7="Добавить",L7="Все",P7="Любая",B7="Применить",j7="Апрель",F7="Спросить",z7="Aстрономический",U7="Август",H7="Отмена",W7="Закрыть",G7="Условие",V7="Условия",K7="Приставка",Y7="Скопировано",J7="Декабрь",q7="Дефолт",X7="Задержка",Z7="Удалить",Q7="Описание",eY="Готово",tY="Исполнить shell",sY="Объяснение",oY="Экспорт",iY="Февраль",nY="Февраль",rY="Фильтр",aY="Папка",lY="Пт",cY="пятница",uY="ID",dY="ID1",hY="ID2",pY="Импорт",gY="Экземпляр",mY="Экземпляры",fY="Инструкции",$Y="Январь",bY="Январь",vY="Июль",yY="Июнь",_Y="Предел",wY="Март",kY="Май",CY="Меню",TY="Сообщение",SY="Пн",EY="Модель",IY="понедельник",xY="Месяц",DY="Более",AY="Имя",RY="Ноябрь",OY="Ок",NY="Октябрь",MY="Ok",LY="Пауза",PY="Pushover",BY="Pushsafer",jY="Перезагрузить",FY="Переименовать",zY="Повторение",UY="Перезапустить",HY="Результат",WY="Сб",GY="суббота",VY="Сохранить",KY="Расписание",YY="скрипт",JY="Сентябрь",qY="Симулировать",XY="Stack",ZY="Начинать",QY="Состояние",eJ="Вс",tJ="Воскресенье",sJ="Telegram",oJ="Чт",iJ="Четверг",nJ="Время",rJ="Срабатывает",aJ="Триггеры",lJ="Вт",cJ="вторник",uJ="URL",dJ="Значение",hJ="Громкость",pJ="Ср",gJ="среда",mJ="Напишите",fJ="Да",$J="подтверждение",bJ="все",vJ="и",yJ="Астро",_J="в",wJ="контроль",kJ="копия",CJ="CRON",TJ="Рассвет",SJ="Это особый режим, в котором состояния и объекты не будут меняться. Но в протоколе будет отображаться только информация о каждом планируемом изменении.",EJ="Отлаживать",IJ="Сумерки",xJ="легкий",DJ="каждые(ый)",AJ="Функция",RJ="ID",OJ="Название",NJ="Роль",MJ="Комната",LJ="Золотой час",PJ="Конец золотого часа",BJ="Код будет выполняться только каждый раз, когда условие истинно. Например. при срабатывании по значению датчика температуры и условию «если температура выше 20°C», действия «затем» будут выполняться каждый раз, когда датчик отправляет значение температуры, и оно превышает 20°C. На 21°С, на 22°С и так далее.",jJ="Код будет выполнен только в случае изменения результата условия. Например, при срабатывании по значению датчика температуры и условию «если температура больше 20°C», действия «затем» будут выполнены один раз, когда температура превысит 20°C. В следующий раз действия «затем» будут выполнены, когда температура опустится ниже 20°C, а затем снова поднимается выше 20°C.",FJ="час(ов)",zJ="содержит",UJ="интервал",HJ="магия",WJ="миллисекунды",GJ="минут(у)",VJ="мс",KJ="Надир",YJ="Морской рассвет",JJ="Морские сумерки",qJ="Следующий восход",XJ="Следующий закат",ZJ="Ночь",QJ="Конец ночи",eq="нормальный",tq="сдвиг",sq="один",oq="или",iq="тихий",nq="поиск",rq="секунд",aq="Солнечный полдень",lq="Восход солнца",cq="Конец восхода",uq="Закат солнца",dq="Начало заката",hq="тогда",pq="Подтверждено",gq="От",mq="Последнее изменение",fq="Качественный",$q="Время",bq="Пользователь",vq="Значение",yq="два",_q="обновить",wq="Добавляет вывод отладки в журнал для многих системных команд.",kq="Подробный протокол",Cq="если",Tq="Мастер",Sq="Повторить",Eq={"%s not found":"%s не найден","()":"()","(at %s)":"(в %s)","(optional)":"(необязательный)","-":"-",".":".","AI code generator":"ИИ Генератор кода",Ack:O7,Actions:N7,"Actual time of day":"Фактическое время суток",Add:M7,"Add new script":"Добавить новый скрипт",All:L7,"All files will be accepted":"Все файлы будут приняты",Any:P7,"Any month":"В любой месяц",Apply:B7,April:j7,"Are you sure?":"Вы уверены?",Ask:F7,Astronomical:z7,"Astronomical events today":"Астрономические события сегодня",August:U7,"Blockly description":"Создание правил графическими блоками","Body:":"Тело:",Cancel:H7,"Cannot delete non empty item!":"Не удается удалить непустой элемент!","Change layout":"Изменить макет",'Change theme (actual "%s")':'Сменить тему (сейчас - "%s")',"Check blocks":"Проверить блоки","Check is not active, because javascript adapter is disabled":"Проверка неактивна, потому что адаптер Javascript отключен","Clear search input":"Очистить ввод","Click on this icon":"Нажмите на этот значок",Close:W7,"Close all but current":"Закрыть все кроме текущего","Collapse all":"Свернуть все","Compares current time with astronomical event":"Сравнивает текущее время с астрономическим событием","Compares current time with the user specific time":"Сравнивает текущее время с конкретным временем пользователя","Compares the state value with user defined value":"Сравнивает значение состояния с пользовательским значением",Condition:G7,Conditions:V7,"Configuration not saved.":"Конфигурация не сохранена.",Console:K7,"Control or update some state":"Контролировать или обновлять какое-то состояние","Control or update some state with delay":"Контролировать или обновлять какое-либо состояние с задержкой","Convert blockly to javascript for ever.":"Преобразовать blockly в Javascript навсегда.",Copied:Y7,"Copy script":"Скопировать скрипт","Copy to clipboard":"Скопировать в буфер обмена","Create new":"Создать новый","Create new folder":"Создать новую папку","Create new script":"Создать новый скрипт","Create or edit CRON or time wizard":"Создание или редактирование CRON или мастера времени","Dark Theme":"Тёмная тема","Dark style":"Темный стиль",Date:"Дата","Debug instance":"Экземпляр отладки","Debug options":"Варианты отладки",December:J7,Default:q7,"Define cron...":"Задать правило ...","Define schedule...":"Задать расписание...",Delay:X7,Delete:Z7,"Delete %s":"Удалить %s...","Delete folder":"Удалить папку","Delete script":"Удалить скрипт",Description:Q7,"Deselect all":"Снять выбор со всех","Discard changes for %s":"Отменить изменения для %s",Done:eY,"Double click to write value":"Двойной щелчок для записи значения","Download as file":"Скачать как файл","Drop some files here or click...":"Перетыщите сюда файлы или нажмите ...","Duplicate name":"Повторяющееся имя","Edit script or just double click":"Редактировать скрипт или просто дважды щелкнуть","Empty name is not allowed":"Пустое имя не допускается","End search mode":"Закончить поиск","Enter your question":"Введи свою просьбу",Error:"Ошибка","Error formatting code":"Ошибка форматирования кода","Error was found":"Ошибка была найдена","Every day":"Каждый день",Exec:tY,"Executes some shell command":"Выполняет некоторую команду оболочки","Existing scripts will be overwritten.":"Существующие скрипты будут перезаписаны.","Expand all":"Открыть все","Expert mode":"Экспертный режим",Explanation:sY,Export:oY,"Export all scripts":"Экспорт всех скриптов","Export blocks":"Экспортировать блоки","Export selected blocks":"Экспортировать выбранные блоки",Februar:iY,February:nY,Filter:rY,Folder:aY,Fr:lY,Friday:cY,Function:"Функция","Function editor":"Редактор функции","Function: executed":"Функция: выполнено","Go to next line":"Перейти к следующей строке","HTTP Call":"HTTP-вызов","Hide logs":"Скрыть журналы",ID:uY,ID1:dY,ID2:hY,Import:pY,"Import blocks":"Импортировать блоки","Import error":"Ошибка импорта","Import scripts":"Импорт скриптов","Insert object ID":"Вставить ID объекта",Instance:gY,"Instance is disabled":"Экземпляр отключен","Instance:":"Пример:",Instances:mY,Instructions:fY,"Invalid CRON":"Неправильный CRON","It will not be possible to revert this operation.":"Невозможно вернуть эту операцию.","JS description":"Создание правил путём написания Javascript",Januar:$Y,January:bY,July:vY,June:yY,"Just check":"Просто проверить","Keep my changes":"Сохранить мои изменения","Language:":"Язык:","Learn More":"Узнать больше","Light style":"Светлый стиль",Limit:_Y,"Local time":"Местное время","Locate file":"Показать файл в дереве","Log outputs":"Журнал","Log text":"Текст журнала","Log: %s":"Журнал: %s","Make a HTTP get request":"Сделайте HTTP-запрос на получение","Make a pause between actions":"Сделайте паузу между действиями",March:wY,"March ":"Март ",May:kY,Menu:CY,Message:TY,Mo:SY,Model:EY,Monday:IY,Month:xY,More:DY,Name:AY,"No API key found":"API-ключ не найден","No Chat GPT Key found":"Ключ GPT для чата не найден","No active host found":"Активный host не найден","Nothing found":"Ничего не найдено",November:RY,OK:OY,October:NY,Ok:MY,"On condition change":"При изменении реузльтата условий","On script save or adapter start":"При сохранении скрипта или запуске адаптера","On weekdays":"По дням недели","Open configuration":"Открыть настройки","Operate two states":"Операции над двумя состояниями","Operations with two states":"Операции с двумя состояниями","Paste your blocks here":"Вставьте свои блоки сюда",Pause:LY,"Pause execution":"Приостановить выполнение","Pause script":"Остановить скрипт","Phone:":"Телефон:","Please select object ID...":"Пожалуйста, выберите ID объекта ...","Press Ctrl+Enter to get the answer":"Нажмите Ctrl+Enter, чтобы получить ответ","Prettify the script":"Украсьте сценарий","Print some text in log":"Напечатать текст в журнале","Priority:":"Приоритет:",Pushover:PY,Pushsafer:BY,"Read only ID selected: %s":"Выбран идентификатор только для чтения: %s",Reload:jY,Rename:FY,"Reorder scripts in folders":"Сортировать скрипты в папках",Repeat:zY,Restart:UY,Result:HY,"Resume execution":"Возобновить выполнение","Root folder":"Корневая папка","Rules description":"Создавайте правила с блоками ЕСЛИ, ТО, ИНАЧЕ","Run script":"Запустить скрипт",Sa:WY,Saturday:GY,Save:VY,"Save all":"Сохранить все","Say It":"Say It","Say some text via sayit adapter":"Произнесите текст через адаптер Sayit",Schedule:KY,Script:YY,"Script %s was modified on disk":'Скрипт "%s" был изменен на диске',"Script was modified externally":"Скрипт был изменён извне","Script is not running":"Сценарий не запущен","Search in scripts":"Поиск в скриптах","Search...":"Поиск...","Select all":"Выбрать все","Send email":"Отправить email","Sends an email":"Отправляет электронное письмо","Sends message via Pushsafer":"Отправляет сообщение через Pushsafer","Sends message via pushover":"Отправляет сообщение через пустышку","Sends message via telegram":"Отправляет сообщение в телеграмме","Sends message via whatsapp-cmb":"Отправляет сообщение через whatsapp-cmb",September:JY,"Server time":"Время сервера","Set state action":"Установить состояние","Set with delay":"Установить с задержкой","Shell command":"Команда оболочки","Show astronomical events":"Показать астрономические события","Show javascript code":"Показать код Javascript","Show logs":"Показать журналы","Show only paused scripts":"Показывать только приостановленные сценарии","Show only running scripts":"Показывать только запущенные скрипты","Show only scripts with problems":"Показывать только скрипты с проблемами",Simulate:qY,"Some files will be rejected":"Некоторые файлы будут отклонены","Sound:":"Звук:",Stack:XY,Start:ZY,"Start script":"Старт скрипта",State:QY,"State condition":"Сравнение состояния","Step into function":"Шаг в функционирование","Step out from function":"Выйти из функции","Stop on exception":"Остановить при исключении",Su:eJ,"Subject:":"Предмет:",Sunday:tJ,"TS description":"Создание правил путём написания Typescript",Telegram:sJ,"Text:":"Текст:",Th:oJ,'The script "%s" has been modified by another user or in another window. Do you want to reload the script or keep your local changes?':'Скрипт "%s" был изменён другим пользователем или в другом окне. Вы хотите перезагрузить скрипт или сохранить свои локальные изменения?',"The script will be stopped and must be activated manually after debugging. Continue?":"Cкрипт будет остановлен и должен быть активирован вручную после отладки. Продолжать?","This is advances option. You can write your own code here and it will be executed on trigger":"Это расширеный вариант. Вы можете написать здесь свой код и он будет выполняться по триггеру",Thursday:iJ,Time:nJ,"Time condition":"Условие времени","Title:":"Заголовок:","To:":"К:","Trigger with value":"Триггер со значением",Triggered:rJ,Triggers:aJ,"Triggers the on script saving or the javascript instance restart":"Запускает при сохранении скрипта или перезапуске экземпляра javascript","Triggers the rule on update or change of some state":"Запускает правило при обновлении или изменении какого-либо состояния","Triggers the rule periodically or on some specific time":"Срабатывает правило периодически или в определенное время",Tu:lJ,Tuesday:cJ,URL:uJ,"Unknown error":"Неизвестная ошибка","Unknown error!":"Неизвестная ошибка!","Use generated code":"Использовать сгенерированный код","User function":"Функция пользователя","User:":"Пользователь:",Value:dJ,"Vibration:":"Вибрация:",Volume:hJ,We:pJ,Wednesday:gJ,"Whatsapp-cmb":"Whatsapp-cmb",Write:mJ,"Write your own code":"Напишите свой код",Yes:fJ,"Yet exists!":"Имя уже существует!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Вы можете использовать %s в URL-адресе, чтобы использовать текущее значение триггера, %id, чтобы использовать идентификатор инициированного объекта, %name, чтобы показать имя идентификатора инициированного объекта, или %old, чтобы использовать старое значение триггера.","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Вы можете использовать %s в команде, чтобы использовать текущее значение триггера, %id, чтобы использовать идентификатор сработавшего объекта, %name, чтобы показать имя сработавшего идентификатора объекта, или %old, чтобы использовать старое значение триггера.","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Вы можете использовать %s в тексте для отображения текущего значения триггера, %id для использования идентификатора сработавшего объекта, %name для отображения имени сработавшего идентификатора объекта или %old для использования старого значения триггера.","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Вы можете использовать %s в значении, чтобы использовать текущее значение триггера, %id, чтобы использовать идентификатор инициированного объекта, %name, чтобы показать имя идентификатора инициированного объекта, или %old, чтобы использовать старое значение триггера.","You have to enter OpenAI API key in the configuration of javascript adapter.":"Вы должны ввести ключ OpenAI API в конфигурации адаптера javascript.","You have to enter at least one API key in the configuration of javascript adapter.":"Необходимо ввести хотя бы один API-ключ (OpenAI, Anthropic или Gemini) в конфигурации адаптера javascript.","Please select a valid model":"Пожалуйста, выберите допустимую модель","[equal]":"[равно]","[greater or equal]":"[больше или равно]","[greater]":"[больше]","[hysteresis]":"[гистерезис]","[includes]":"[содержит]","[less or equal]":"[меньше или равно]","[less]":"[меньше]","[not equal]":"[не равно]",acknowledgment:$J,all:bJ,and:vJ,"as JSON":"как JSON","as plain text":"как текст",astro:yJ,at:_J,"clear running":"остановить уже бегущие",control:wJ,copy:kJ,cron:CJ,dawn:TJ,debug_help:SJ,debug_label:EJ,default:"дефолт",dusk:IJ,easy:xJ,else:"иначе","equal to":"равно",every:DJ,"every hour at 0 minutes":"каждый час через 0 минут",false:"false","file reading has failed: %s":"Ошибка чтения файла: %s","file reading was aborted":"Чтение файла было прервано",filter_func:AJ,filter_id:RJ,filter_name:OJ,filter_role:NJ,filter_room:MJ,"for edit or create script":"для редактирования или создайте новый скрипт","for professionals":"для профессионалов","for programmers":"для программистов",goldenHour:LJ,goldenHourEnd:PJ,"greater or equal":"больше или равно","greater or equal to":"больше или равно","greater than":"больше чем",help_just_check:BJ,help_on_change:jJ,"high priority":"высокий приоритет","high-priority":"высокий-приоритет","highest priority":"высший приоритет",hours:FJ,includes:zJ,interval:UJ,"just check":"просто проверить","less or equal":"меньше или равно","less or equal to":"меньше или равно","less than":"меньше, чем","lower priority":"более низкий приоритет","lowest priority":"самый низкий приоритет",magic:HJ,milliseconds:WJ,minutes:GJ,ms:VJ,nadir:KJ,nauticalDawn:YJ,nauticalDusk:JJ,nextSunrise:qJ,nextSunset:XJ,night:ZJ,nightEnd:QJ,"no blocks found":"Блоков нет","no group":"Нет группы",normal:eq,"normal priority":"нормальный приоритет","not running":"не запущен","not equal to":"не равно","not properly connected":"Этот блок неправильно соединён или не соединён с другими блоками.",offset:tq,"on change":"по изменению","on condition change":"при изменении результата условия","on update":"при обновлении",one:sq,or:oq,quiet:iq,"reset search":"Cбросить поиск",search:nq,seconds:rq,solarNoon:aq,"store in":"сохранить в",sunrise:lq,sunriseEnd:cq,sunset:uq,sunsetStart:dq,then:hq,"toggle value":"инвертировать текщее значение",tooltip_ack:pq,tooltip_from:gq,tooltip_lc:mq,tooltip_quality:fq,tooltip_ts:$q,tooltip_user:bq,tooltip_value:vq,true:"true",two:yq,undefined:"неопределенный",update:_q,"use seconds":"использовать секунды","use trigger value":"использовать значение триггера",verbose_help:wq,verbose_label:kq,when:Cq,with:"с","with date":"с датой","with offset":"со сдвигом",wizard:Tq,"Loading models...":"Загрузка моделей...","Could not connect to API at %s":"Не удалось подключиться к API по адресу %s","Invalid API key":"Недействительный ключ API","Access denied by API":"Доступ запрещён API","API error: %s":"Ошибка API: %s",'Model "%s" not found':'Модель "%s" не найдена',"Request failed: %s":"Запрос не удался: %s",Retry:Sq,"No running javascript instance found":"Не найден работающий экземпляр JavaScript"},Iq="Визнано",xq="Дії",Dq="додати",Aq="все",Rq="Будь-який",Oq="Застосувати",Nq="квітень",Mq="Запитуйте",Lq="Астрономічний",Pq="серпень",Bq="Скасувати",jq="Закрити",Fq="Хвороба",zq="Умови",Uq="Консоль",Hq="Скопійовано",Wq="Грудень",Gq="За замовчуванням",Vq="Затримка",Kq="Видалити",Yq="опис",Jq="Готово",qq="Виконавча оболонка",Xq="Пояснення",Zq="Експорт",Qq="Лютий",eX="Лютий",tX="фільтр",sX="Папка",oX="О",iX="П'ятниця",nX="ID",rX="ID1",aX="ID2",lX="Імпорт",cX="Екземпляр",uX="Примірники",dX="Інструкції",hX="січень",pX="січня",gX="липень",mX="червень",fX="Ліміт",$X="березень",bX="Може",vX="Меню",yX="повідомлення",_X="пн",wX="Модель",kX="понеділок",CX="місяць",TX="Більше",SX="Ім'я",EX="Листопад",IX="в порядку",xX="жовтень",DX="В порядку",AX="Пауза",RX="Pushover",OX="Pushsafer",NX="Перезавантажити",MX="Перейменувати",LX="Повторіть",PX="Перезапустіть",BX="Результат",jX="Sa",FX="Субота",zX="зберегти",UX="розклад",HX="Сценарій",WX="Вересень",GX="Симулювати",VX="Стек",KX="старт",YX="Держава",JX="Нд",qX="неділя",XX="Телеграма",ZX="чт",QX="четвер",eZ="час",tZ="Спрацьовує",sZ="Тригери",oZ="вт",iZ="вівторок",nZ="URL",rZ="Значення",aZ="Обсяг",lZ="ми",cZ="Середа",uZ="Напишіть",dZ="Так",hZ="підтвердження",pZ="все",gZ="і",mZ="Астро",fZ="в",$Z="КОНТРОЛЬ",bZ="копія",vZ="CRON",yZ="Світанок",_Z="Це особливий режим, в якому стану та об'єкти не змінюватимуться. Але в протоколі відображатиметься лише інформація про кожну заплановану зміну.",wZ="Відлагоджувати",kZ="Сутінки",CZ="легко",TZ="кожен",SZ="функція",EZ="ID",IZ="Ім'я",xZ="Роль",DZ="Кімната",AZ="Золота година",RZ="Кінець золотої години",OZ="Код буде виконуватися лише щоразу, коли умова виконується. наприклад якщо спрацьовує значення датчика температури та умова «якщо температура перевищує 20°C», дії «тоді» виконуватимуться щоразу, коли датчик надсилає температуру, і вона перевищує 20°C. На 21°C, на 22°C і так далі.",NZ="Код буде виконано лише у разі зміни результату умови. наприклад якщо спрацьовує значення датчика температури та умова «якщо температура перевищує 20°C», дії «тоді» будуть виконані один раз, коли температура буде вище 20. Наступного разу дії «тоді» буде виконано, коли температура падає нижче 20, а потім знову піднімається вище 20.",MZ="години",LZ="включає в себе",PZ="інтервал",BZ="магія",jZ="мілісекунд",FZ="хвилин",zZ="РС",UZ="Надір",HZ="Морський світанок",WZ="Морські сутінки",GZ="Наступний схід сонця",VZ="Наступний захід сонця",KZ="ніч",YZ="Кінець ночі",JZ="нормально",qZ="зсув",XZ="один",ZZ="або",QZ="тихо",eQ="пошук",tQ="секунд",sQ="Сонячний полудень",oQ="схід сонця",iQ="Кінець сходу сонця",nQ="Захід сонця",rQ="Початок заходу сонця",aQ="потім",lQ="Визнати",cQ="Від",uQ="Востаннє змінено",dQ="якість",hQ="Мітка часу",pQ="Користувач",gQ="Значення",mQ="два",fQ="оновлення",$Q="Додає вихідні дані налагодження до журналу для багатьох системних команд",bQ="Докладні результати журналу",vQ="коли",yQ="майстер",_Q="Повторити",wQ={"%s not found":"%s не знайдено","()":"()","(at %s)":"(у %s)","(optional)":"(необов'язково)","-":"-",".":".","AI code generator":"Генератор коду ШІ",Ack:Iq,Actions:xq,"Actual time of day":"Фактичний час доби",Add:Dq,"Add new script":"Додати новий сценарій",All:Aq,"All files will be accepted":"Усі файли будуть прийняті",Any:Rq,"Any month":"Будь-який місяць",Apply:Oq,April:Nq,"Are you sure?":"Ти впевнений?",Ask:Mq,Astronomical:Lq,"Astronomical events today":"Астрономічні події сьогодні",August:Pq,"Blockly description":"Створення правил за графічними блоками","Body:":"Тіло:",Cancel:Bq,"Cannot delete non empty item!":"Неможливо видалити непорожній елемент!","Change layout":"Змінити макет",'Change theme (actual "%s")':'Змінити тему (тепер - "%s")',"Check blocks":"Перевірте блоки","Check is not active, because javascript adapter is disabled":"Перевірка не активна, оскільки адаптер Javascript вимкнено","Clear search input":"Очистити пошуковий запит","Click on this icon":"Натисніть на цей значок",Close:jq,"Close all but current":"Закрити всі, крім поточних","Collapse all":"Закрити всі","Compares current time with astronomical event":"Порівнює поточний час з астрономічною подією","Compares current time with the user specific time":"Порівнює поточний час із конкретним часом користувача","Compares the state value with user defined value":"Порівнює значення стану з визначеним користувачем значенням",Condition:Fq,Conditions:zq,"Configuration not saved.":"Конфігурація не збережена.",Console:Uq,"Control or update some state":"Контролюйте або оновлюйте певний стан","Control or update some state with delay":"Контролюйте або оновлюйте деякий стан із затримкою","Convert blockly to javascript for ever.":"Назавжди конвертуйте Blockly у Javascript.",Copied:Hq,"Copy script":"Копіювати сценарій","Copy to clipboard":"Копіювати в буфер обміну","Create new":"Створити новий","Create new folder":"Створити нову папку","Create new script":"Створіть новий сценарій","Create or edit CRON or time wizard":"Створення або редагування CRON або майстра часу","Dark Theme":"Темна тема","Dark style":"Темний стиль",Date:"Дата","Debug instance":"Екземпляр налагодження","Debug options":"Параметри налагодження",December:Wq,Default:Gq,"Define cron...":"Визначити cron...","Define schedule...":"Визначити розклад...",Delay:Vq,Delete:Kq,"Delete %s":"Видалити %s...","Delete folder":"Видалити папку","Delete script":"Видалити сценарій",Description:Yq,"Deselect all":"Зняти вибір із усіх","Discard changes for %s":"Скасувати зміни для %s",Done:Jq,"Double click to write value":"Двічі клацніть, щоб записати значення","Download as file":"Завантажити файл","Drop some files here or click...":"Перетягніть кілька файлів сюди або натисніть...","Duplicate name":"Повторюване ім'я","Edit script or just double click":"Відредагуйте сценарій або просто двічі клацніть","Empty name is not allowed":"Порожнє ім'я не допускається","End search mode":"Завершити режим пошуку","Enter your question":"Введи своє прохання",Error:"Помилка","Error formatting code":"Помилка форматування коду","Error was found":"Виявлено помилку","Every day":"Кожен день",Exec:qq,"Executes some shell command":"Виконує певну команду оболонки","Existing scripts will be overwritten.":"Існуючі сценарії буде перезаписано.","Expand all":"Розгорнути все","Expert mode":"Експертний режим",Explanation:Xq,Export:Zq,"Export all scripts":"Експортувати всі сценарії","Export blocks":"Експорт блоків","Export selected blocks":"Експортувати вибрані блоки",Februar:Qq,February:eX,Filter:tX,Folder:sX,Fr:oX,Friday:iX,Function:"функція","Function editor":"Редактор функцій","Function: executed":"Функція: виконано","Go to next line":"Перейти до наступного рядка","HTTP Call":"Виклик HTTP","Hide logs":"Приховати журнали",ID:nX,ID1:rX,ID2:aX,Import:lX,"Import blocks":"Імпорт блоків","Import error":"Помилка імпорту","Import scripts":"Імпорт скриптів","Insert object ID":"Вставте ID об'єкта",Instance:cX,"Instance is disabled":"Примірник вимкнено","Instance:":"екземпляр:",Instances:uX,Instructions:dX,"Invalid CRON":"Недійсний CRON","It will not be possible to revert this operation.":"Скасувати цю операцію буде неможливо.","JS description":"Створення правил шляхом написання Javascript",Januar:hX,January:pX,July:gX,June:mX,"Just check":"Просто перевірте","Keep my changes":"Зберегти мої зміни","Language:":"Мову:","Learn More":"Вивчайте більше","Light style":"Легкий стиль",Limit:fX,"Local time":"Місцевий час","Locate file":"Знайти файл","Log outputs":"Виходи журналу","Log text":"Текст журналу","Log: %s":"Журнал: %s","Make a HTTP get request":"Зробіть HTTP-запит на отримання","Make a pause between actions":"Між діями робіть паузу",March:$X,"March ":"березень",May:bX,Menu:vX,Message:yX,Mo:_X,Model:wX,Monday:kX,Month:CX,More:TX,Name:SX,"No API key found":"API-ключ не знайдено","No Chat GPT Key found":"Ключ GPT для чату не знайдено","No active host found":"Активний хост не знайдено","Nothing found":"Нічого не знайдено",November:EX,OK:IX,October:xX,Ok:DX,"On condition change":"За умови зміни результату","On script save or adapter start":"Під час збереження сценарію або запуску адаптера","On weekdays":"В будні дні","Open configuration":"Відкрита конфігурація","Operate two states":"Керуйте двома станами","Operations with two states":"Операції з двома станами","Paste your blocks here":"Вставте сюди свої блоки",Pause:AX,"Pause execution":"Призупинити виконання","Pause script":"Призупинити сценарій","Phone:":"телефон:","Please select object ID...":"Виберіть ідентифікатор об'єкта...","Press Ctrl+Enter to get the answer":"Натисніть Ctrl+Enter, щоб отримати відповідь","Prettify the script":"Прикрасьте сценарій","Print some text in log":"Надрукувати текст у журналі","Priority:":"Пріоритет:",Pushover:RX,Pushsafer:OX,"Read only ID selected: %s":"Вибрано ідентифікатор лише для читання: %s",Reload:NX,Rename:MX,"Reorder scripts in folders":"Зміна порядку сценаріїв у папках",Repeat:LX,Restart:PX,Result:BX,"Resume execution":"Відновити виконання","Root folder":"Коренева папка","Rules description":"Створюйте правила з блоками IF, THEN, ELSE","Run script":"Запустіть сценарій",Sa:jX,Saturday:FX,Save:zX,"Save all":"Зберегти все","Say It":"Скажи це","Say some text via sayit adapter":"Скажіть текст через адаптер sayit",Schedule:UX,Script:HX,"Script %s was modified on disk":"Сценарій %s змінено на диску","Script was modified externally":"Скрипт було змінено ззовні","Script is not running":"Сценарій не працює","Search in scripts":"Пошук у скриптах","Search...":"пошук...","Select all":"Вибрати все","Send email":"Відправити лист","Sends an email":"Надсилає електронний лист","Sends message via Pushsafer":"Надсилає повідомлення через Pushsafer","Sends message via pushover":"Надсилає повідомлення через pushover","Sends message via telegram":"Надсилає повідомлення через телеграм","Sends message via whatsapp-cmb":"Надсилає повідомлення через whatsapp-cmb",September:WX,"Server time":"Час сервера","Set state action":"Встановити дію стану","Set with delay":"Встановити із затримкою","Shell command":"Команда оболонки","Show astronomical events":"Показати астрономічні події","Show javascript code":"Показати код Javascript","Show logs":"Показати журнали","Show only paused scripts":"Показувати лише призупинені сценарії","Show only running scripts":"Показувати лише запущені сценарії","Show only scripts with problems":"Показувати лише сценарії з проблемами",Simulate:GX,"Some files will be rejected":"Деякі файли буде відхилено","Sound:":"звук:",Stack:VX,Start:KX,"Start script":"Запустити сценарій",State:YX,"State condition":"Стан стану","Step into function":"Крок у функції","Step out from function":"Вийти з функції","Stop on exception":"Зупинка на винятках",Su:JX,"Subject:":"Тема:",Sunday:qX,"TS description":"Створення правил шляхом написання Typescript",Telegram:XX,"Text:":"Текст:",Th:ZX,'The script "%s" has been modified by another user or in another window. Do you want to reload the script or keep your local changes?':'Скрипт "%s" було змінено іншим користувачем або в іншому вікні. Бажаєте перезавантажити скрипт чи зберегти свої локальні зміни?',"The script will be stopped and must be activated manually after debugging. Continue?":"Сценарій буде зупинено, і його необхідно активувати вручну після налагодження. Продовжити?","This is advances option. You can write your own code here and it will be executed on trigger":"Це авансовий варіант. Ви можете написати тут свій власний код, і він буде виконано на тригері",Thursday:QX,Time:eZ,"Time condition":"Умова часу","Title:":"Назва:","To:":"до:","Trigger with value":"Тригер зі значенням",Triggered:tZ,Triggers:sZ,"Triggers the on script saving or the javascript instance restart":"Ініціює збереження сценарію або перезапуск екземпляра JavaScript","Triggers the rule on update or change of some state":"Запускає правило при оновленні або зміні якогось стану","Triggers the rule periodically or on some specific time":"Спрацьовує правило періодично або в певний час",Tu:oZ,Tuesday:iZ,URL:nZ,"Unknown error":"Невідома помилка","Unknown error!":"Невідома помилка!","Use generated code":"Використовуйте згенерований код","User function":"Функція користувача","User:":"Користувач:",Value:rZ,"Vibration:":"Вібрація:",Volume:aZ,We:lZ,Wednesday:cZ,"Whatsapp-cmb":"Whatsapp-cmb",Write:uZ,"Write your own code":"Напишіть власний код",Yes:dZ,"Yet exists!":"Все ж існує!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"Ви можете використовувати %s в URL-адресі, щоб використовувати поточне значення тригера, %id, щоб використовувати ідентифікатор активованого об’єкта, %name, щоб показати назву ідентифікатора активованого об’єкта, або %old, щоб використовувати старе значення тригера","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"Ви можете використовувати %s у команді, щоб використовувати поточне значення тригера, %id, щоб використовувати ідентифікатор активованого об’єкта, %name, щоб показати назву ідентифікатора активованого об’єкта, або %old, щоб використовувати старе значення тригера","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"Ви можете використовувати %s у тексті для відображення поточного значення тригера, %id для використання ідентифікатора активованого об’єкта, %name для відображення імені ідентифікатора активованого об’єкта або %old для використання старого значення тригера","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"Ви можете використовувати %s у значенні, щоб використовувати поточне значення тригера, %id, щоб використовувати ідентифікатор активованого об’єкта, %name, щоб показати назву ідентифікатора активованого об’єкта, або %old, щоб використовувати старе значення тригера","You have to enter OpenAI API key in the configuration of javascript adapter.":"Ви повинні ввести ключ OpenAI API у конфігурації адаптера JavaScript.","You have to enter at least one API key in the configuration of javascript adapter.":"Необхідно ввести хоча б один API-ключ (OpenAI, Anthropic або Gemini) у конфігурації адаптера JavaScript.","Please select a valid model":"Будь ласка, виберіть дійсну модель","[equal]":"[рівний]","[greater or equal]":"[більше або дорівнює]","[greater]":"[більший]","[hysteresis]":"[гістерезис]","[includes]":"[включає]","[less or equal]":"[менше або рівно]","[less]":"[менше]","[not equal]":"[не дорівнює]",acknowledgment:hZ,all:pZ,and:gZ,"as JSON":"як JSON","as plain text":"як текст",astro:mZ,at:fZ,"clear running":"чіткий біг",control:$Z,copy:bZ,cron:vZ,dawn:yZ,debug_help:_Z,debug_label:wZ,default:"за замовчуванням",dusk:kZ,easy:CZ,else:"інше","equal to":"дорівнює",every:TZ,"every hour at 0 minutes":"щогодини о 0 хвилин",false:"помилковий","file reading has failed: %s":"не вдалося прочитати файл: %s","file reading was aborted":"читання файлу було перервано",filter_func:SZ,filter_id:EZ,filter_name:IZ,filter_role:xZ,filter_room:DZ,"for edit or create script":"для редагування або створення нового сценарію","for professionals":"для професіоналів","for programmers":"для програмістів",goldenHour:AZ,goldenHourEnd:RZ,"greater or equal":"більший або рівний","greater or equal to":"більше або дорівнює","greater than":"більше, ніж, величніше ніж, крутіший за",help_just_check:OZ,help_on_change:NZ,"high priority":"високий пріоритет","high-priority":"високий пріоритет","highest priority":"найвищий пріоритет",hours:MZ,includes:LZ,interval:PZ,"just check":"просто перевірте","less or equal":"менше або дорівнює","less or equal to":"менше або дорівнює","less than":"менше ніж","lower priority":"нижчий пріоритет","lowest priority":"найнижчий пріоритет",magic:BZ,milliseconds:jZ,minutes:FZ,ms:zZ,nadir:UZ,nauticalDawn:HZ,nauticalDusk:WZ,nextSunrise:GZ,nextSunset:VZ,night:KZ,nightEnd:YZ,"no blocks found":"Блоків не знайдено","no group":"НЕМАЄ ГРУПИ",normal:JZ,"normal priority":"нормальний пріоритет","not running":"не запущено","not equal to":"не дорівнює","not properly connected":"Цей блок неправильно з’єднаний з іншими блоками.",offset:qZ,"on change":"на зміну","on condition change":"про зміну умов","on update":"на оновлення",one:XZ,or:ZZ,quiet:QZ,"reset search":"скинути пошук",search:eQ,seconds:tQ,solarNoon:sQ,"store in":"зберігати в",sunrise:oQ,sunriseEnd:iQ,sunset:nQ,sunsetStart:rQ,then:aQ,"toggle value":"значення перемикання",tooltip_ack:lQ,tooltip_from:cQ,tooltip_lc:uQ,tooltip_quality:dQ,tooltip_ts:hQ,tooltip_user:pQ,tooltip_value:gQ,true:"правда",two:mQ,undefined:"невизначений",update:fQ,"use seconds":"використовуйте секунди","use trigger value":"використовувати значення тригера",verbose_help:$Q,verbose_label:bQ,when:vQ,with:"з","with date":"з датою","with offset":"зі зміщенням",wizard:yQ,"Loading models...":"Завантаження моделей...","Could not connect to API at %s":"Не вдалося підключитися до API за адресою %s","Invalid API key":"Недійсний ключ API","Access denied by API":"Доступ заборонено API","API error: %s":"Помилка API: %s",'Model "%s" not found':'Модель "%s" не знайдено',"Request failed: %s":"Запит не вдався: %s",Retry:_Q,"No running javascript instance found":"Не знайдено запущеного екземпляра JavaScript"},kQ="确认",CQ="动作",TQ="添加",SQ="所有",EQ="任何",IQ="申请",xQ="四月",DQ="问",AQ="天文",RQ="八月",OQ="取消",NQ="关闭",MQ="健康)状况",LQ="情况",PQ="安慰",BQ="复制的",jQ="十二月",FQ="默认",zQ="延迟",UQ="删除",HQ="描述",WQ="完成",GQ="执行力",VQ="解释",KQ="导出",YQ="二月",JQ="二月",qQ="筛选",XQ="文件夹",ZQ="r",QQ="星期五",eee="ID",tee="ID1",see="ID2",oee="导入",iee="实例",nee="实例",ree="指示",aee="亚努尔",lee="一月",cee="七月",uee="六月",dee="限制",hee="三月",pee="五月",gee="菜单",mee="信息",fee="莫",$ee="模型",bee="星期一",vee="月",yee="更多的",_ee="名称",wee="十一月",kee="好的",Cee="十月",Tee="确定",See="暂停",Eee="俯卧撑",Iee="推安全",xee="重新加载",Dee="重命名",Aee="重复",Ree="重启",Oee="结果",Nee="萨",Mee="星期六",Lee="保存",Pee="日程",Bee="脚本",jee="九月",Fee="模拟",zee="堆",Uee="开始",Hee="状态",Wee="苏",Gee="星期日",Vee="电报",Kee="4",Yee="星期四",Jee="时间",qee="触发",Xee="扳机",Zee="涂",Qee="星期二",ete="网址",tte="价值",ste="体积",ote="3",ite="星期三",nte="写",rte="是的",ate="致谢",lte="全部",cte="和",ute="天文",dte="在",hte="控制",pte="复制",gte="克朗",mte="黎明",fte="这是一种特殊模式,其中状态和对象不会改变。但只有有关每个计划更改的信息才会显示在协议中。",$te="调试",bte="黄昏",vte="简单的",yte="每一个",_te="功能",wte="ID",kte="名字",Cte="角色",Tte="房间",Ste="黄金时段",Ete="黄金时段结束",Ite="仅在条件为真时才执行代码。例如。如果触发温度传感器值并且条件为“如果温度大于20°C”,则每次传感器发送温度且温度超过20°C时,将执行“然后”动作。 21°C,22°C等。",xte="仅当条件结果更改时,代码才会执行。例如。如果触发温度传感器值且条件为“如果温度大于20°C”,则温度超过20时将执行一次“则”动作,下一次,当温度超过20时将执行“则”动作低于20失败,然后再次超过20。",Dte="小时",Ate="包括",Rte="间隔",Ote="魔法",Nte="毫秒",Mte="分钟",Lte="毫秒",Pte="最低点",Bte="航海黎明",jte="航海黄昏",Fte="下一个日出",zte="下一个日落",Ute="夜晚",Hte="夜晚结束",Wte="普通的",Gte="抵消",Vte="一",Kte="或",Yte="安静的",Jte="搜索",qte="秒",Xte="星期日正午",Zte="日出",Qte="日出结束",ese="日落",tse="日落开始",sse="然后",ose="确认",ise="从",nse="上一次改变",rse="质量",ase="时间戳",lse="用户",cse="值",use="二",dse="更新",hse="将调试输出添加到许多系统命令的日志中",pse="详细日志输出",gse="什么时候",mse="巫师",fse="重试",$se={"%s not found":"%s 未找到","()":"()","(at %s)":"(在 %s)","(optional)":"(选修的)","-":"-",".":".","AI code generator":"AI代码生成器",Ack:kQ,Actions:CQ,"Actual time of day":"一天中的实际时间",Add:TQ,"Add new script":"添加新脚本",All:SQ,"All files will be accepted":"所有文件都将被接受",Any:EQ,"Any month":"任何月份",Apply:IQ,April:xQ,"Are you sure?":"你确定吗?",Ask:DQ,Astronomical:AQ,"Astronomical events today":"今天的天文事件",August:RQ,"Blockly description":"按图形块创建规则","Body:":"身体:",Cancel:OQ,"Cannot delete non empty item!":"无法删除非空项目!","Change layout":"变更版面",'Change theme (actual "%s")':"更改主题(现在为“%s”)","Check blocks":"检查块","Check is not active, because javascript adapter is disabled":"检查未激活,因为禁用了Javascript适配器","Clear search input":"清除搜索输入","Click on this icon":"单击此图标",Close:NQ,"Close all but current":"关闭所有(当前除外)","Collapse all":"全部收缩","Compares current time with astronomical event":"将当前时间与天文事件进行比较","Compares current time with the user specific time":"将当前时间与用户特定时间进行比较","Compares the state value with user defined value":"比较状态值和用户定义的值",Condition:MQ,Conditions:LQ,"Configuration not saved.":"配置未保存。",Console:PQ,"Control or update some state":"控制或更新某些状态","Control or update some state with delay":"延迟控制或更新某些状态","Convert blockly to javascript for ever.":"立即将blockly转换为Javascript。",Copied:BQ,"Copy script":"复制脚本","Copy to clipboard":"复制到剪贴板","Create new":"创建新的","Create new folder":"创建新文件夹","Create new script":"创建新脚本","Create or edit CRON or time wizard":"创建或编辑周期任务或时间向导","Dark Theme":"深色调主题","Dark style":"深色调风格",Date:"日期","Debug instance":"调试实例","Debug options":"调试选项",December:jQ,Default:FQ,"Define cron...":"定义周期任务...","Define schedule...":"定义调度器......",Delay:zQ,Delete:UQ,"Delete %s":"删除%s...","Delete folder":"删除文件夹","Delete script":"删除脚本",Description:HQ,"Deselect all":"取消全选","Discard changes for %s":"放弃%s的更改",Done:WQ,"Double click to write value":"Double click to write value","Download as file":"档案","Drop some files here or click...":"将文件拖拽到这里或单击......","Duplicate name":"重名","Edit script or just double click":"双击编辑脚本","Empty name is not allowed":"不允许使用空名称","End search mode":"结束搜索模式","Enter your question":"输入您的要求",Error:"错误","Error formatting code":"代码格式错误","Error was found":"发现错误","Every day":"每天",Exec:GQ,"Executes some shell command":"执行一些shell命令","Existing scripts will be overwritten.":"现有脚本将被覆盖。","Expand all":"展开全部","Expert mode":"专家模式",Explanation:VQ,Export:KQ,"Export all scripts":"导出所有脚本","Export blocks":"导出块","Export selected blocks":"导出选定的块",Februar:YQ,February:JQ,Filter:qQ,Folder:XQ,Fr:ZQ,Friday:QQ,Function:"功能","Function editor":"功能编辑器","Function: executed":"功能:执行","Go to next line":"转到下一行","HTTP Call":"HTTP呼叫","Hide logs":"隐藏日志",ID:eee,ID1:tee,ID2:see,Import:oee,"Import blocks":"导入块","Import error":"导入错误","Import scripts":"导入脚本","Insert object ID":"插入对象ID",Instance:iee,"Instance is disabled":"实例已禁用","Instance:":"实例:",Instances:nee,Instructions:ree,"Invalid CRON":"无效的周期任务","It will not be possible to revert this operation.":"无法恢复此操作。","JS description":"通过编写Javascript来创建规则",Januar:aee,January:lee,July:cee,June:uee,"Just check":"只是检查","Keep my changes":"保留我的更改","Language:":"语言:","Learn More":"了解更多","Light style":"浅色调风格",Limit:dee,"Local time":"当地时间","Locate file":"定位文件","Log outputs":"记录输出","Log text":"记录文字","Log: %s":"日志:%s","Make a HTTP get request":"发出HTTP获取请求","Make a pause between actions":"在动作之间暂停",March:hee,"March ":"行进",May:pee,Menu:gee,Message:mee,Mo:fee,Model:$ee,Monday:bee,Month:vee,More:yee,Name:_ee,"No API key found":"未找到 API 密钥","No Chat GPT Key found":"找不到聊天 GPT 密钥","No active host found":"找不到活动主机","Nothing found":"没有发现",November:wee,OK:kee,October:Cee,Ok:Tee,"On condition change":"条件变化时","On script save or adapter start":"在脚本保存或适配器启动时","On weekdays":"在工作日","Open configuration":"开放配置","Operate two states":"操作两种状态","Operations with two states":"具有两种状态的操作","Paste your blocks here":"在此处粘贴您的区块",Pause:See,"Pause execution":"暂停执行","Pause script":"暂停脚本","Phone:":"电话:","Please select object ID...":"请选择对象ID...","Press Ctrl+Enter to get the answer":"按 Ctrl+Enter 即可得到答案","Prettify the script":"美化脚本","Print some text in log":"在日志中打印一些文本","Priority:":"优先:",Pushover:Eee,Pushsafer:Iee,"Read only ID selected: %s":"选择的只读ID:%s",Reload:xee,Rename:Dee,"Reorder scripts in folders":"重新排序文件夹中的脚本",Repeat:Aee,Restart:Ree,Result:Oee,"Resume execution":"恢复执行","Root folder":"根文件夹","Rules description":"使用IF,THEN,ELSE块创建规则","Run script":"运行脚本",Sa:Nee,Saturday:Mee,Save:Lee,"Save all":"保存全部","Say It":"Say It","Say some text via sayit adapter":"通过sayit适配器说一些文字",Schedule:Pee,Script:Bee,"Script %s was modified on disk":"脚本%s已在磁盘上修改","Script was modified externally":"脚本已被外部修改","Script is not running":"脚本没有运行","Search in scripts":"在脚本中搜索","Search...":"搜索...","Select all":"全选","Send email":"发送电子邮件","Sends an email":"发送邮件","Sends message via Pushsafer":"通过Pushsafer发送消息","Sends message via pushover":"通过推播发送消息","Sends message via telegram":"通过电报发送消息","Sends message via whatsapp-cmb":"通过whatsapp-cmb发送消息",September:jee,"Server time":"服务器时间","Set state action":"设定状态动作","Set with delay":"延迟设置","Shell command":"Shell命令","Show astronomical events":"显示天文事件","Show javascript code":"显示Javascript代码","Show logs":"显示记录","Show only paused scripts":"仅显示暂停的脚本","Show only running scripts":"仅显示正在运行的脚本","Show only scripts with problems":"仅显示有问题的脚本",Simulate:Fee,"Some files will be rejected":"有些文件将被拒绝","Sound:":"声音:",Stack:zee,Start:Uee,"Start script":"启动脚本",State:Hee,"State condition":"状态条件","Step into function":"进入功能","Step out from function":"退出函数","Stop on exception":"异常停止",Su:Wee,"Subject:":"学科:",Sunday:Gee,"TS description":"通过编写Typescript来创建规则",Telegram:Vee,"Text:":"文本:",Th:Kee,'The script "%s" has been modified by another user or in another window. Do you want to reload the script or keep your local changes?':'脚本 "%s" 已被其他用户或在其他窗口中修改。您想重新加载脚本还是保留您的本地更改?',"The script will be stopped and must be activated manually after debugging. Continue?":"该脚本将停止,并且必须在调试后手动激活。继续?","This is advances option. You can write your own code here and it will be executed on trigger":"这是高级选项。您可以在此处编写自己的代码,它将在触发器上执行",Thursday:Yee,Time:Jee,"Time condition":"时间条件","Title:":"标题:","To:":"到:","Trigger with value":"用值触发",Triggered:qee,Triggers:Xee,"Triggers the on script saving or the javascript instance restart":"触发脚本保存或javascript实例重启","Triggers the rule on update or change of some state":"在某些状态的更新或更改时触发规则","Triggers the rule periodically or on some specific time":"定期或在特定时间触发规则",Tu:Zee,Tuesday:Qee,URL:ete,"Unknown error":"未知错误","Unknown error!":"未知错误!","Use generated code":"使用生成的代码","User function":"用户功能","User:":"用户:",Value:tte,"Vibration:":"振动:",Volume:ste,We:ote,Wednesday:ite,"Whatsapp-cmb":"Whatsapp的cmb",Write:nte,"Write your own code":"编写自己的代码",Yes:rte,"Yet exists!":"不存在!","You can use %s in the URL to use current trigger value or %id to use the triggered object ID":"您可以在 URL 中使用 %s 以使用当前触发值,%id 以使用触发对象 ID,%name 以显示触发对象 ID 名称或 %old 以使用旧触发值","You can use %s in the command to use current trigger value or %id to use the triggered object ID":"您可以在命令中使用 %s 以使用当前触发值,%id 使用触发对象 ID,%name 显示触发对象 ID 名称或 %old 使用旧触发值","You can use %s in the text to display current trigger value or %id to display the triggered object ID":"您可以在文本中使用 %s 显示当前触发值,%id 使用触发对象 ID,%name 显示触发对象 ID 名称或 %old 使用旧触发值","You can use %s in the value to use the current trigger value or %id to display the triggered object ID":"您可以在值中使用 %s 以使用当前触发器值,%id 使用触发对象 ID,%name 显示触发对象 ID 名称或 %old 使用旧触发器值","You have to enter OpenAI API key in the configuration of javascript adapter.":"您必须在 javascript 适配器的配置中输入 OpenAI API 密钥。","You have to enter at least one API key in the configuration of javascript adapter.":"您必须在 javascript 适配器的配置中输入至少一个 API 密钥(OpenAI、Anthropic 或 Gemini)。","Please select a valid model":"请选择一个有效的模型","[equal]":"[平等的]","[greater or equal]":"[大于等于]","[greater]":"[更大]","[hysteresis]":"[磁滞]","[includes]":"[包括]","[less or equal]":"[小于或等于]","[less]":"[较少的]","[not equal]":"[不相等]",acknowledgment:ate,all:lte,and:cte,"as JSON":"为 JSON","as plain text":"为纯文本",astro:ute,at:dte,"clear running":"畅通无阻",control:hte,copy:pte,cron:gte,dawn:mte,debug_help:fte,debug_label:$te,default:"默认",dusk:bte,easy:vte,else:"别的","equal to":"等于",every:yte,"every hour at 0 minutes":"每小时0分钟",false:"错误的","file reading has failed: %s":"文件读取失败:%s","file reading was aborted":"文件读取中止",filter_func:_te,filter_id:wte,filter_name:kte,filter_role:Cte,filter_room:Tte,"for edit or create script":"用于编辑或创建脚本","for professionals":"对于专业人士","for programmers":"对于程序员",goldenHour:Ste,goldenHourEnd:Ete,"greater or equal":"大于或等于","greater or equal to":"大于或等于","greater than":"比...更棒",help_just_check:Ite,help_on_change:xte,"high priority":"高优先级","high-priority":"高优先级","highest priority":"最高优先级",hours:Dte,includes:Ate,interval:Rte,"just check":"只是检查","less or equal":"小于或等于","less or equal to":"小于或等于","less than":"少于","lower priority":"低优先级","lowest priority":"最低优先级",magic:Ote,milliseconds:Nte,minutes:Mte,ms:Lte,nadir:Pte,nauticalDawn:Bte,nauticalDusk:jte,nextSunrise:Fte,nextSunset:zte,night:Ute,nightEnd:Hte,"no blocks found":"找不到块","no group":"没有组",normal:Wte,"normal priority":"正常优先","not running":"未运行","not equal to":"不等于","not properly connected":"此块未正确连接到其他块。",offset:Gte,"on change":"在变化","on condition change":"在条件变化时","on update":"更新时",one:Vte,or:Kte,quiet:Yte,"reset search":"重置搜索",search:Jte,seconds:qte,solarNoon:Xte,"store in":"存放在",sunrise:Zte,sunriseEnd:Qte,sunset:ese,sunsetStart:tse,then:sse,"toggle value":"切换值",tooltip_ack:ose,tooltip_from:ise,tooltip_lc:nse,tooltip_quality:rse,tooltip_ts:ase,tooltip_user:lse,tooltip_value:cse,true:"真的",two:use,undefined:"不明确的",update:dse,"use seconds":"精确到秒","use trigger value":"使用触发值",verbose_help:hse,verbose_label:pse,when:gse,with:"和","with date":"有日期","with offset":"带偏移",wizard:mse,"Loading models...":"加载模型...","Could not connect to API at %s":"无法连接到 %s 的 API","Invalid API key":"无效的 API 密钥","Access denied by API":"API 拒绝访问","API error: %s":"API 错误:%s",'Model "%s" not found':'未找到模型 "%s"',"Request failed: %s":"请求失败:%s",Retry:fse,"No running javascript instance found":"未找到正在运行的 JavaScript 实例"};function pc(a){throw new Error('Could not dynamically require "'+a+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var RC={exports:{}};(function(a,s){(function(i){a.exports=i()})(function(){return(function i(r,l,c){function d(f,b){if(!l[f]){if(!r[f]){var y=typeof pc=="function"&&pc;if(!b&&y)return y(f,!0);if(h)return h(f,!0);var w=new Error("Cannot find module '"+f+"'");throw w.code="MODULE_NOT_FOUND",w}var v=l[f]={exports:{}};r[f][0].call(v.exports,function(_){var $=r[f][1][_];return d($||_)},v,v.exports,i,r,l,c)}return l[f].exports}for(var h=typeof pc=="function"&&pc,p=0;p>2,v=(3&f)<<4|b>>4,_=1>6:64,$=2>4,b=(15&w)<<4|(v=h.indexOf(p.charAt($++)))>>2,y=(3&v)<<6|(_=h.indexOf(p.charAt($++))),E[S++]=f,v!==64&&(E[S++]=b),_!==64&&(E[S++]=y);return E}},{"./support":30,"./utils":32}],2:[function(i,r,l){var c=i("./external"),d=i("./stream/DataWorker"),h=i("./stream/Crc32Probe"),p=i("./stream/DataLengthProbe");function f(b,y,w,v,_){this.compressedSize=b,this.uncompressedSize=y,this.crc32=w,this.compression=v,this.compressedContent=_}f.prototype={getContentWorker:function(){var b=new d(c.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new p("data_length")),y=this;return b.on("end",function(){if(this.streamInfo.data_length!==y.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),b},getCompressedWorker:function(){return new d(c.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},f.createWorkerFrom=function(b,y,w){return b.pipe(new h).pipe(new p("uncompressedSize")).pipe(y.compressWorker(w)).pipe(new p("compressedSize")).withStreamInfo("compression",y)},r.exports=f},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(i,r,l){var c=i("./stream/GenericWorker");l.STORE={magic:"\0\0",compressWorker:function(){return new c("STORE compression")},uncompressWorker:function(){return new c("STORE decompression")}},l.DEFLATE=i("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(i,r,l){var c=i("./utils"),d=(function(){for(var h,p=[],f=0;f<256;f++){h=f;for(var b=0;b<8;b++)h=1&h?3988292384^h>>>1:h>>>1;p[f]=h}return p})();r.exports=function(h,p){return h!==void 0&&h.length?c.getTypeOf(h)!=="string"?(function(f,b,y,w){var v=d,_=w+y;f^=-1;for(var $=w;$<_;$++)f=f>>>8^v[255&(f^b[$])];return-1^f})(0|p,h,h.length,0):(function(f,b,y,w){var v=d,_=w+y;f^=-1;for(var $=w;$<_;$++)f=f>>>8^v[255&(f^b.charCodeAt($))];return-1^f})(0|p,h,h.length,0):0}},{"./utils":32}],5:[function(i,r,l){l.base64=!1,l.binary=!1,l.dir=!1,l.createFolders=!0,l.date=null,l.compression=null,l.compressionOptions=null,l.comment=null,l.unixPermissions=null,l.dosPermissions=null},{}],6:[function(i,r,l){var c=null;c=typeof Promise<"u"?Promise:i("lie"),r.exports={Promise:c}},{lie:37}],7:[function(i,r,l){var c=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",d=i("pako"),h=i("./utils"),p=i("./stream/GenericWorker"),f=c?"uint8array":"array";function b(y,w){p.call(this,"FlateWorker/"+y),this._pako=null,this._pakoAction=y,this._pakoOptions=w,this.meta={}}l.magic="\b\0",h.inherits(b,p),b.prototype.processChunk=function(y){this.meta=y.meta,this._pako===null&&this._createPako(),this._pako.push(h.transformTo(f,y.data),!1)},b.prototype.flush=function(){p.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},b.prototype.cleanUp=function(){p.prototype.cleanUp.call(this),this._pako=null},b.prototype._createPako=function(){this._pako=new d[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var y=this;this._pako.onData=function(w){y.push({data:w,meta:y.meta})}},l.compressWorker=function(y){return new b("Deflate",y)},l.uncompressWorker=function(){return new b("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(i,r,l){function c(v,_){var $,S="";for($=0;$<_;$++)S+=String.fromCharCode(255&v),v>>>=8;return S}function d(v,_,$,S,T,E){var D,M,P=v.file,W=v.compression,G=E!==f.utf8encode,z=h.transformTo("string",E(P.name)),Z=h.transformTo("string",f.utf8encode(P.name)),he=P.comment,Ce=h.transformTo("string",E(he)),O=h.transformTo("string",f.utf8encode(he)),K=Z.length!==P.name.length,C=O.length!==he.length,Q="",ve="",ce="",ne=P.dir,me=P.date,re={crc32:0,compressedSize:0,uncompressedSize:0};_&&!$||(re.crc32=v.crc32,re.compressedSize=v.compressedSize,re.uncompressedSize=v.uncompressedSize);var B=0;_&&(B|=8),G||!K&&!C||(B|=2048);var N=0,te=0;ne&&(N|=16),T==="UNIX"?(te=798,N|=(function(se,F){var Te=se;return se||(Te=F?16893:33204),(65535&Te)<<16})(P.unixPermissions,ne)):(te=20,N|=(function(se){return 63&(se||0)})(P.dosPermissions)),D=me.getUTCHours(),D<<=6,D|=me.getUTCMinutes(),D<<=5,D|=me.getUTCSeconds()/2,M=me.getUTCFullYear()-1980,M<<=4,M|=me.getUTCMonth()+1,M<<=5,M|=me.getUTCDate(),K&&(ve=c(1,1)+c(b(z),4)+Z,Q+="up"+c(ve.length,2)+ve),C&&(ce=c(1,1)+c(b(Ce),4)+O,Q+="uc"+c(ce.length,2)+ce);var q="";return q+=` +\0`,q+=c(B,2),q+=W.magic,q+=c(D,2),q+=c(M,2),q+=c(re.crc32,4),q+=c(re.compressedSize,4),q+=c(re.uncompressedSize,4),q+=c(z.length,2),q+=c(Q.length,2),{fileRecord:y.LOCAL_FILE_HEADER+q+z+Q,dirRecord:y.CENTRAL_FILE_HEADER+c(te,2)+q+c(Ce.length,2)+"\0\0\0\0"+c(N,4)+c(S,4)+z+Q+Ce}}var h=i("../utils"),p=i("../stream/GenericWorker"),f=i("../utf8"),b=i("../crc32"),y=i("../signature");function w(v,_,$,S){p.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=_,this.zipPlatform=$,this.encodeFileName=S,this.streamFiles=v,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}h.inherits(w,p),w.prototype.push=function(v){var _=v.meta.percent||0,$=this.entriesCount,S=this._sources.length;this.accumulate?this.contentBuffer.push(v):(this.bytesWritten+=v.data.length,p.prototype.push.call(this,{data:v.data,meta:{currentFile:this.currentFile,percent:$?(_+100*($-S-1))/$:100}}))},w.prototype.openedSource=function(v){this.currentSourceOffset=this.bytesWritten,this.currentFile=v.file.name;var _=this.streamFiles&&!v.file.dir;if(_){var $=d(v,_,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:$.fileRecord,meta:{percent:0}})}else this.accumulate=!0},w.prototype.closedSource=function(v){this.accumulate=!1;var _=this.streamFiles&&!v.file.dir,$=d(v,_,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push($.dirRecord),_)this.push({data:(function(S){return y.DATA_DESCRIPTOR+c(S.crc32,4)+c(S.compressedSize,4)+c(S.uncompressedSize,4)})(v),meta:{percent:100}});else for(this.push({data:$.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},w.prototype.flush=function(){for(var v=this.bytesWritten,_=0;_=this.index;p--)f=(f<<8)+this.byteAt(p);return this.index+=h,f},readString:function(h){return c.transformTo("string",this.readData(h))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var h=this.readInt(4);return new Date(Date.UTC(1980+(h>>25&127),(h>>21&15)-1,h>>16&31,h>>11&31,h>>5&63,(31&h)<<1))}},r.exports=d},{"../utils":32}],19:[function(i,r,l){var c=i("./Uint8ArrayReader");function d(h){c.call(this,h)}i("../utils").inherits(d,c),d.prototype.readData=function(h){this.checkOffset(h);var p=this.data.slice(this.zero+this.index,this.zero+this.index+h);return this.index+=h,p},r.exports=d},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(i,r,l){var c=i("./DataReader");function d(h){c.call(this,h)}i("../utils").inherits(d,c),d.prototype.byteAt=function(h){return this.data.charCodeAt(this.zero+h)},d.prototype.lastIndexOfSignature=function(h){return this.data.lastIndexOf(h)-this.zero},d.prototype.readAndCheckSignature=function(h){return h===this.readData(4)},d.prototype.readData=function(h){this.checkOffset(h);var p=this.data.slice(this.zero+this.index,this.zero+this.index+h);return this.index+=h,p},r.exports=d},{"../utils":32,"./DataReader":18}],21:[function(i,r,l){var c=i("./ArrayReader");function d(h){c.call(this,h)}i("../utils").inherits(d,c),d.prototype.readData=function(h){if(this.checkOffset(h),h===0)return new Uint8Array(0);var p=this.data.subarray(this.zero+this.index,this.zero+this.index+h);return this.index+=h,p},r.exports=d},{"../utils":32,"./ArrayReader":17}],22:[function(i,r,l){var c=i("../utils"),d=i("../support"),h=i("./ArrayReader"),p=i("./StringReader"),f=i("./NodeBufferReader"),b=i("./Uint8ArrayReader");r.exports=function(y){var w=c.getTypeOf(y);return c.checkSupport(w),w!=="string"||d.uint8array?w==="nodebuffer"?new f(y):d.uint8array?new b(c.transformTo("uint8array",y)):new h(c.transformTo("array",y)):new p(y)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(i,r,l){l.LOCAL_FILE_HEADER="PK",l.CENTRAL_FILE_HEADER="PK",l.CENTRAL_DIRECTORY_END="PK",l.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",l.ZIP64_CENTRAL_DIRECTORY_END="PK",l.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(i,r,l){var c=i("./GenericWorker"),d=i("../utils");function h(p){c.call(this,"ConvertWorker to "+p),this.destType=p}d.inherits(h,c),h.prototype.processChunk=function(p){this.push({data:d.transformTo(this.destType,p.data),meta:p.meta})},r.exports=h},{"../utils":32,"./GenericWorker":28}],25:[function(i,r,l){var c=i("./GenericWorker"),d=i("../crc32");function h(){c.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}i("../utils").inherits(h,c),h.prototype.processChunk=function(p){this.streamInfo.crc32=d(p.data,this.streamInfo.crc32||0),this.push(p)},r.exports=h},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(i,r,l){var c=i("../utils"),d=i("./GenericWorker");function h(p){d.call(this,"DataLengthProbe for "+p),this.propName=p,this.withStreamInfo(p,0)}c.inherits(h,d),h.prototype.processChunk=function(p){if(p){var f=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=f+p.data.length}d.prototype.processChunk.call(this,p)},r.exports=h},{"../utils":32,"./GenericWorker":28}],27:[function(i,r,l){var c=i("../utils"),d=i("./GenericWorker");function h(p){d.call(this,"DataWorker");var f=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,p.then(function(b){f.dataIsReady=!0,f.data=b,f.max=b&&b.length||0,f.type=c.getTypeOf(b),f.isPaused||f._tickAndRepeat()},function(b){f.error(b)})}c.inherits(h,d),h.prototype.cleanUp=function(){d.prototype.cleanUp.call(this),this.data=null},h.prototype.resume=function(){return!!d.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,c.delay(this._tickAndRepeat,[],this)),!0)},h.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(c.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},h.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var p=null,f=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":p=this.data.substring(this.index,f);break;case"uint8array":p=this.data.subarray(this.index,f);break;case"array":case"nodebuffer":p=this.data.slice(this.index,f)}return this.index=f,this.push({data:p,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=h},{"../utils":32,"./GenericWorker":28}],28:[function(i,r,l){function c(d){this.name=d||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}c.prototype={push:function(d){this.emit("data",d)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(d){this.emit("error",d)}return!0},error:function(d){return!this.isFinished&&(this.isPaused?this.generatedError=d:(this.isFinished=!0,this.emit("error",d),this.previous&&this.previous.error(d),this.cleanUp()),!0)},on:function(d,h){return this._listeners[d].push(h),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(d,h){if(this._listeners[d])for(var p=0;p "+d:d}},r.exports=c},{}],29:[function(i,r,l){var c=i("../utils"),d=i("./ConvertWorker"),h=i("./GenericWorker"),p=i("../base64"),f=i("../support"),b=i("../external"),y=null;if(f.nodestream)try{y=i("../nodejs/NodejsStreamOutputAdapter")}catch{}function w(_,$){return new b.Promise(function(S,T){var E=[],D=_._internalType,M=_._outputType,P=_._mimeType;_.on("data",function(W,G){E.push(W),$&&$(G)}).on("error",function(W){E=[],T(W)}).on("end",function(){try{var W=(function(G,z,Z){switch(G){case"blob":return c.newBlob(c.transformTo("arraybuffer",z),Z);case"base64":return p.encode(z);default:return c.transformTo(G,z)}})(M,(function(G,z){var Z,he=0,Ce=null,O=0;for(Z=0;Z"u")l.blob=!1;else{var c=new ArrayBuffer(0);try{l.blob=new Blob([c],{type:"application/zip"}).size===0}catch{try{var d=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);d.append(c),l.blob=d.getBlob("application/zip").size===0}catch{l.blob=!1}}}try{l.nodestream=!!i("readable-stream").Readable}catch{l.nodestream=!1}},{"readable-stream":16}],31:[function(i,r,l){for(var c=i("./utils"),d=i("./support"),h=i("./nodejsUtils"),p=i("./stream/GenericWorker"),f=new Array(256),b=0;b<256;b++)f[b]=252<=b?6:248<=b?5:240<=b?4:224<=b?3:192<=b?2:1;f[254]=f[254]=1;function y(){p.call(this,"utf-8 decode"),this.leftOver=null}function w(){p.call(this,"utf-8 encode")}l.utf8encode=function(v){return d.nodebuffer?h.newBufferFrom(v,"utf-8"):(function(_){var $,S,T,E,D,M=_.length,P=0;for(E=0;E>>6:(S<65536?$[D++]=224|S>>>12:($[D++]=240|S>>>18,$[D++]=128|S>>>12&63),$[D++]=128|S>>>6&63),$[D++]=128|63&S);return $})(v)},l.utf8decode=function(v){return d.nodebuffer?c.transformTo("nodebuffer",v).toString("utf-8"):(function(_){var $,S,T,E,D=_.length,M=new Array(2*D);for($=S=0;$>10&1023,M[S++]=56320|1023&T)}return M.length!==S&&(M.subarray?M=M.subarray(0,S):M.length=S),c.applyFromCharCode(M)})(v=c.transformTo(d.uint8array?"uint8array":"array",v))},c.inherits(y,p),y.prototype.processChunk=function(v){var _=c.transformTo(d.uint8array?"uint8array":"array",v.data);if(this.leftOver&&this.leftOver.length){if(d.uint8array){var $=_;(_=new Uint8Array($.length+this.leftOver.length)).set(this.leftOver,0),_.set($,this.leftOver.length)}else _=this.leftOver.concat(_);this.leftOver=null}var S=(function(E,D){var M;for((D=D||E.length)>E.length&&(D=E.length),M=D-1;0<=M&&(192&E[M])==128;)M--;return M<0||M===0?D:M+f[E[M]]>D?M:D})(_),T=_;S!==_.length&&(d.uint8array?(T=_.subarray(0,S),this.leftOver=_.subarray(S,_.length)):(T=_.slice(0,S),this.leftOver=_.slice(S,_.length))),this.push({data:l.utf8decode(T),meta:v.meta})},y.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:l.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},l.Utf8DecodeWorker=y,c.inherits(w,p),w.prototype.processChunk=function(v){this.push({data:l.utf8encode(v.data),meta:v.meta})},l.Utf8EncodeWorker=w},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(i,r,l){var c=i("./support"),d=i("./base64"),h=i("./nodejsUtils"),p=i("./external");function f($){return $}function b($,S){for(var T=0;T<$.length;++T)S[T]=255&$.charCodeAt(T);return S}i("setimmediate"),l.newBlob=function($,S){l.checkSupport("blob");try{return new Blob([$],{type:S})}catch{try{var T=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return T.append($),T.getBlob(S)}catch{throw new Error("Bug : can't construct the Blob.")}}};var y={stringifyByChunk:function($,S,T){var E=[],D=0,M=$.length;if(M<=T)return String.fromCharCode.apply(null,$);for(;D>8;this.dir=!!(16&this.externalFileAttributes),v==0&&(this.dosPermissions=63&this.externalFileAttributes),v==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var v=c(this.extraFields[1].value);this.uncompressedSize===d.MAX_VALUE_32BITS&&(this.uncompressedSize=v.readInt(8)),this.compressedSize===d.MAX_VALUE_32BITS&&(this.compressedSize=v.readInt(8)),this.localHeaderOffset===d.MAX_VALUE_32BITS&&(this.localHeaderOffset=v.readInt(8)),this.diskNumberStart===d.MAX_VALUE_32BITS&&(this.diskNumberStart=v.readInt(4))}},readExtraFields:function(v){var _,$,S,T=v.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});v.index+4>>6:(v<65536?w[S++]=224|v>>>12:(w[S++]=240|v>>>18,w[S++]=128|v>>>12&63),w[S++]=128|v>>>6&63),w[S++]=128|63&v);return w},l.buf2binstring=function(y){return b(y,y.length)},l.binstring2buf=function(y){for(var w=new c.Buf8(y.length),v=0,_=w.length;v<_;v++)w[v]=y.charCodeAt(v);return w},l.buf2string=function(y,w){var v,_,$,S,T=w||y.length,E=new Array(2*T);for(v=_=0;v>10&1023,E[_++]=56320|1023&$)}return b(E,_)},l.utf8border=function(y,w){var v;for((w=w||y.length)>y.length&&(w=y.length),v=w-1;0<=v&&(192&y[v])==128;)v--;return v<0||v===0?w:v+p[y[v]]>w?v:w}},{"./common":41}],43:[function(i,r,l){r.exports=function(c,d,h,p){for(var f=65535&c|0,b=c>>>16&65535|0,y=0;h!==0;){for(h-=y=2e3>>1:d>>>1;h[p]=d}return h})();r.exports=function(d,h,p,f){var b=c,y=f+p;d^=-1;for(var w=f;w>>8^b[255&(d^h[w])];return-1^d}},{}],46:[function(i,r,l){var c,d=i("../utils/common"),h=i("./trees"),p=i("./adler32"),f=i("./crc32"),b=i("./messages"),y=0,w=4,v=0,_=-2,$=-1,S=4,T=2,E=8,D=9,M=286,P=30,W=19,G=2*M+1,z=15,Z=3,he=258,Ce=he+Z+1,O=42,K=113,C=1,Q=2,ve=3,ce=4;function ne(k,X){return k.msg=b[X],X}function me(k){return(k<<1)-(4k.avail_out&&(Y=k.avail_out),Y!==0&&(d.arraySet(k.output,X.pending_buf,X.pending_out,Y,k.next_out),k.next_out+=Y,X.pending_out+=Y,k.total_out+=Y,k.avail_out-=Y,X.pending-=Y,X.pending===0&&(X.pending_out=0))}function N(k,X){h._tr_flush_block(k,0<=k.block_start?k.block_start:-1,k.strstart-k.block_start,X),k.block_start=k.strstart,B(k.strm)}function te(k,X){k.pending_buf[k.pending++]=X}function q(k,X){k.pending_buf[k.pending++]=X>>>8&255,k.pending_buf[k.pending++]=255&X}function se(k,X){var Y,R,A=k.max_chain_length,U=k.strstart,H=k.prev_length,ue=k.nice_match,V=k.strstart>k.w_size-Ce?k.strstart-(k.w_size-Ce):0,be=k.window,pe=k.w_mask,fe=k.prev,Le=k.strstart+he,He=be[U+H-1],Be=be[U+H];k.prev_length>=k.good_match&&(A>>=2),ue>k.lookahead&&(ue=k.lookahead);do if(be[(Y=X)+H]===Be&&be[Y+H-1]===He&&be[Y]===be[U]&&be[++Y]===be[U+1]){U+=2,Y++;do;while(be[++U]===be[++Y]&&be[++U]===be[++Y]&&be[++U]===be[++Y]&&be[++U]===be[++Y]&&be[++U]===be[++Y]&&be[++U]===be[++Y]&&be[++U]===be[++Y]&&be[++U]===be[++Y]&&UV&&--A!=0);return H<=k.lookahead?H:k.lookahead}function F(k){var X,Y,R,A,U,H,ue,V,be,pe,fe=k.w_size;do{if(A=k.window_size-k.lookahead-k.strstart,k.strstart>=fe+(fe-Ce)){for(d.arraySet(k.window,k.window,fe,fe,0),k.match_start-=fe,k.strstart-=fe,k.block_start-=fe,X=Y=k.hash_size;R=k.head[--X],k.head[X]=fe<=R?R-fe:0,--Y;);for(X=Y=fe;R=k.prev[--X],k.prev[X]=fe<=R?R-fe:0,--Y;);A+=fe}if(k.strm.avail_in===0)break;if(H=k.strm,ue=k.window,V=k.strstart+k.lookahead,be=A,pe=void 0,pe=H.avail_in,be=Z)for(U=k.strstart-k.insert,k.ins_h=k.window[U],k.ins_h=(k.ins_h<=Z&&(k.ins_h=(k.ins_h<=Z)if(R=h._tr_tally(k,k.strstart-k.match_start,k.match_length-Z),k.lookahead-=k.match_length,k.match_length<=k.max_lazy_match&&k.lookahead>=Z){for(k.match_length--;k.strstart++,k.ins_h=(k.ins_h<=Z&&(k.ins_h=(k.ins_h<=Z&&k.match_length<=k.prev_length){for(A=k.strstart+k.lookahead-Z,R=h._tr_tally(k,k.strstart-1-k.prev_match,k.prev_length-Z),k.lookahead-=k.prev_length-1,k.prev_length-=2;++k.strstart<=A&&(k.ins_h=(k.ins_h<k.pending_buf_size-5&&(Y=k.pending_buf_size-5);;){if(k.lookahead<=1){if(F(k),k.lookahead===0&&X===y)return C;if(k.lookahead===0)break}k.strstart+=k.lookahead,k.lookahead=0;var R=k.block_start+Y;if((k.strstart===0||k.strstart>=R)&&(k.lookahead=k.strstart-R,k.strstart=R,N(k,!1),k.strm.avail_out===0)||k.strstart-k.block_start>=k.w_size-Ce&&(N(k,!1),k.strm.avail_out===0))return C}return k.insert=0,X===w?(N(k,!0),k.strm.avail_out===0?ve:ce):(k.strstart>k.block_start&&(N(k,!1),k.strm.avail_out),C)}),new we(4,4,8,4,Te),new we(4,5,16,8,Te),new we(4,6,32,32,Te),new we(4,4,16,16,ae),new we(8,16,32,32,ae),new we(8,16,128,128,ae),new we(8,32,128,256,ae),new we(32,128,258,1024,ae),new we(32,258,258,4096,ae)],l.deflateInit=function(k,X){return We(k,X,E,15,8,0)},l.deflateInit2=We,l.deflateReset=Ae,l.deflateResetKeep=Ne,l.deflateSetHeader=function(k,X){return k&&k.state?k.state.wrap!==2?_:(k.state.gzhead=X,v):_},l.deflate=function(k,X){var Y,R,A,U;if(!k||!k.state||5>8&255),te(R,R.gzhead.time>>16&255),te(R,R.gzhead.time>>24&255),te(R,R.level===9?2:2<=R.strategy||R.level<2?4:0),te(R,255&R.gzhead.os),R.gzhead.extra&&R.gzhead.extra.length&&(te(R,255&R.gzhead.extra.length),te(R,R.gzhead.extra.length>>8&255)),R.gzhead.hcrc&&(k.adler=f(k.adler,R.pending_buf,R.pending,0)),R.gzindex=0,R.status=69):(te(R,0),te(R,0),te(R,0),te(R,0),te(R,0),te(R,R.level===9?2:2<=R.strategy||R.level<2?4:0),te(R,3),R.status=K);else{var H=E+(R.w_bits-8<<4)<<8;H|=(2<=R.strategy||R.level<2?0:R.level<6?1:R.level===6?2:3)<<6,R.strstart!==0&&(H|=32),H+=31-H%31,R.status=K,q(R,H),R.strstart!==0&&(q(R,k.adler>>>16),q(R,65535&k.adler)),k.adler=1}if(R.status===69)if(R.gzhead.extra){for(A=R.pending;R.gzindex<(65535&R.gzhead.extra.length)&&(R.pending!==R.pending_buf_size||(R.gzhead.hcrc&&R.pending>A&&(k.adler=f(k.adler,R.pending_buf,R.pending-A,A)),B(k),A=R.pending,R.pending!==R.pending_buf_size));)te(R,255&R.gzhead.extra[R.gzindex]),R.gzindex++;R.gzhead.hcrc&&R.pending>A&&(k.adler=f(k.adler,R.pending_buf,R.pending-A,A)),R.gzindex===R.gzhead.extra.length&&(R.gzindex=0,R.status=73)}else R.status=73;if(R.status===73)if(R.gzhead.name){A=R.pending;do{if(R.pending===R.pending_buf_size&&(R.gzhead.hcrc&&R.pending>A&&(k.adler=f(k.adler,R.pending_buf,R.pending-A,A)),B(k),A=R.pending,R.pending===R.pending_buf_size)){U=1;break}U=R.gzindexA&&(k.adler=f(k.adler,R.pending_buf,R.pending-A,A)),U===0&&(R.gzindex=0,R.status=91)}else R.status=91;if(R.status===91)if(R.gzhead.comment){A=R.pending;do{if(R.pending===R.pending_buf_size&&(R.gzhead.hcrc&&R.pending>A&&(k.adler=f(k.adler,R.pending_buf,R.pending-A,A)),B(k),A=R.pending,R.pending===R.pending_buf_size)){U=1;break}U=R.gzindexA&&(k.adler=f(k.adler,R.pending_buf,R.pending-A,A)),U===0&&(R.status=103)}else R.status=103;if(R.status===103&&(R.gzhead.hcrc?(R.pending+2>R.pending_buf_size&&B(k),R.pending+2<=R.pending_buf_size&&(te(R,255&k.adler),te(R,k.adler>>8&255),k.adler=0,R.status=K)):R.status=K),R.pending!==0){if(B(k),k.avail_out===0)return R.last_flush=-1,v}else if(k.avail_in===0&&me(X)<=me(Y)&&X!==w)return ne(k,-5);if(R.status===666&&k.avail_in!==0)return ne(k,-5);if(k.avail_in!==0||R.lookahead!==0||X!==y&&R.status!==666){var ue=R.strategy===2?(function(V,be){for(var pe;;){if(V.lookahead===0&&(F(V),V.lookahead===0)){if(be===y)return C;break}if(V.match_length=0,pe=h._tr_tally(V,0,V.window[V.strstart]),V.lookahead--,V.strstart++,pe&&(N(V,!1),V.strm.avail_out===0))return C}return V.insert=0,be===w?(N(V,!0),V.strm.avail_out===0?ve:ce):V.last_lit&&(N(V,!1),V.strm.avail_out===0)?C:Q})(R,X):R.strategy===3?(function(V,be){for(var pe,fe,Le,He,Be=V.window;;){if(V.lookahead<=he){if(F(V),V.lookahead<=he&&be===y)return C;if(V.lookahead===0)break}if(V.match_length=0,V.lookahead>=Z&&0V.lookahead&&(V.match_length=V.lookahead)}if(V.match_length>=Z?(pe=h._tr_tally(V,1,V.match_length-Z),V.lookahead-=V.match_length,V.strstart+=V.match_length,V.match_length=0):(pe=h._tr_tally(V,0,V.window[V.strstart]),V.lookahead--,V.strstart++),pe&&(N(V,!1),V.strm.avail_out===0))return C}return V.insert=0,be===w?(N(V,!0),V.strm.avail_out===0?ve:ce):V.last_lit&&(N(V,!1),V.strm.avail_out===0)?C:Q})(R,X):c[R.level].func(R,X);if(ue!==ve&&ue!==ce||(R.status=666),ue===C||ue===ve)return k.avail_out===0&&(R.last_flush=-1),v;if(ue===Q&&(X===1?h._tr_align(R):X!==5&&(h._tr_stored_block(R,0,0,!1),X===3&&(re(R.head),R.lookahead===0&&(R.strstart=0,R.block_start=0,R.insert=0))),B(k),k.avail_out===0))return R.last_flush=-1,v}return X!==w?v:R.wrap<=0?1:(R.wrap===2?(te(R,255&k.adler),te(R,k.adler>>8&255),te(R,k.adler>>16&255),te(R,k.adler>>24&255),te(R,255&k.total_in),te(R,k.total_in>>8&255),te(R,k.total_in>>16&255),te(R,k.total_in>>24&255)):(q(R,k.adler>>>16),q(R,65535&k.adler)),B(k),0=Y.w_size&&(U===0&&(re(Y.head),Y.strstart=0,Y.block_start=0,Y.insert=0),be=new d.Buf8(Y.w_size),d.arraySet(be,X,pe-Y.w_size,Y.w_size,0),X=be,pe=Y.w_size),H=k.avail_in,ue=k.next_in,V=k.input,k.avail_in=pe,k.next_in=0,k.input=X,F(Y);Y.lookahead>=Z;){for(R=Y.strstart,A=Y.lookahead-(Z-1);Y.ins_h=(Y.ins_h<>>=Z=z>>>24,D-=Z,(Z=z>>>16&255)===0)Q[b++]=65535&z;else{if(!(16&Z)){if((64&Z)==0){z=M[(65535&z)+(E&(1<>>=Z,D-=Z),D<15&&(E+=C[p++]<>>=Z=z>>>24,D-=Z,!(16&(Z=z>>>16&255))){if((64&Z)==0){z=P[(65535&z)+(E&(1<>>=Z,D-=Z,(Z=b-y)>3,E&=(1<<(D-=he<<3))-1,c.next_in=p,c.next_out=b,c.avail_in=p>>24&255)+(O>>>8&65280)+((65280&O)<<8)+((255&O)<<24)}function E(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new c.Buf16(320),this.work=new c.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function D(O){var K;return O&&O.state?(K=O.state,O.total_in=O.total_out=K.total=0,O.msg="",K.wrap&&(O.adler=1&K.wrap),K.mode=_,K.last=0,K.havedict=0,K.dmax=32768,K.head=null,K.hold=0,K.bits=0,K.lencode=K.lendyn=new c.Buf32($),K.distcode=K.distdyn=new c.Buf32(S),K.sane=1,K.back=-1,w):v}function M(O){var K;return O&&O.state?((K=O.state).wsize=0,K.whave=0,K.wnext=0,D(O)):v}function P(O,K){var C,Q;return O&&O.state?(Q=O.state,K<0?(C=0,K=-K):(C=1+(K>>4),K<48&&(K&=15)),K&&(K<8||15=ce.wsize?(c.arraySet(ce.window,K,C-ce.wsize,ce.wsize,0),ce.wnext=0,ce.whave=ce.wsize):(Q<(ve=ce.wsize-ce.wnext)&&(ve=Q),c.arraySet(ce.window,K,C-Q,ve,ce.wnext),(Q-=ve)?(c.arraySet(ce.window,K,C-Q,Q,0),ce.wnext=Q,ce.whave=ce.wsize):(ce.wnext+=ve,ce.wnext===ce.wsize&&(ce.wnext=0),ce.whave>>8&255,C.check=h(C.check,U,2,0),N=B=0,C.mode=2;break}if(C.flags=0,C.head&&(C.head.done=!1),!(1&C.wrap)||(((255&B)<<8)+(B>>8))%31){O.msg="incorrect header check",C.mode=30;break}if((15&B)!=8){O.msg="unknown compression method",C.mode=30;break}if(N-=4,k=8+(15&(B>>>=4)),C.wbits===0)C.wbits=k;else if(k>C.wbits){O.msg="invalid window size",C.mode=30;break}C.dmax=1<>8&1),512&C.flags&&(U[0]=255&B,U[1]=B>>>8&255,C.check=h(C.check,U,2,0)),N=B=0,C.mode=3;case 3:for(;N<32;){if(me===0)break e;me--,B+=Q[ce++]<>>8&255,U[2]=B>>>16&255,U[3]=B>>>24&255,C.check=h(C.check,U,4,0)),N=B=0,C.mode=4;case 4:for(;N<16;){if(me===0)break e;me--,B+=Q[ce++]<>8),512&C.flags&&(U[0]=255&B,U[1]=B>>>8&255,C.check=h(C.check,U,2,0)),N=B=0,C.mode=5;case 5:if(1024&C.flags){for(;N<16;){if(me===0)break e;me--,B+=Q[ce++]<>>8&255,C.check=h(C.check,U,2,0)),N=B=0}else C.head&&(C.head.extra=null);C.mode=6;case 6:if(1024&C.flags&&(me<(se=C.length)&&(se=me),se&&(C.head&&(k=C.head.extra_len-C.length,C.head.extra||(C.head.extra=new Array(C.head.extra_len)),c.arraySet(C.head.extra,Q,ce,se,k)),512&C.flags&&(C.check=h(C.check,Q,se,ce)),me-=se,ce+=se,C.length-=se),C.length))break e;C.length=0,C.mode=7;case 7:if(2048&C.flags){if(me===0)break e;for(se=0;k=Q[ce+se++],C.head&&k&&C.length<65536&&(C.head.name+=String.fromCharCode(k)),k&&se>9&1,C.head.done=!0),O.adler=C.check=0,C.mode=12;break;case 10:for(;N<32;){if(me===0)break e;me--,B+=Q[ce++]<>>=7&N,N-=7&N,C.mode=27;break}for(;N<3;){if(me===0)break e;me--,B+=Q[ce++]<>>=1)){case 0:C.mode=14;break;case 1:if(he(C),C.mode=20,K!==6)break;B>>>=2,N-=2;break e;case 2:C.mode=17;break;case 3:O.msg="invalid block type",C.mode=30}B>>>=2,N-=2;break;case 14:for(B>>>=7&N,N-=7&N;N<32;){if(me===0)break e;me--,B+=Q[ce++]<>>16^65535)){O.msg="invalid stored block lengths",C.mode=30;break}if(C.length=65535&B,N=B=0,C.mode=15,K===6)break e;case 15:C.mode=16;case 16:if(se=C.length){if(me>>=5,N-=5,C.ndist=1+(31&B),B>>>=5,N-=5,C.ncode=4+(15&B),B>>>=4,N-=4,286>>=3,N-=3}for(;C.have<19;)C.lens[H[C.have++]]=0;if(C.lencode=C.lendyn,C.lenbits=7,Y={bits:C.lenbits},X=f(0,C.lens,0,19,C.lencode,0,C.work,Y),C.lenbits=Y.bits,X){O.msg="invalid code lengths set",C.mode=30;break}C.have=0,C.mode=19;case 19:for(;C.have>>16&255,Ie=65535&A,!((ae=A>>>24)<=N);){if(me===0)break e;me--,B+=Q[ce++]<>>=ae,N-=ae,C.lens[C.have++]=Ie;else{if(Ie===16){for(R=ae+2;N>>=ae,N-=ae,C.have===0){O.msg="invalid bit length repeat",C.mode=30;break}k=C.lens[C.have-1],se=3+(3&B),B>>>=2,N-=2}else if(Ie===17){for(R=ae+3;N>>=ae)),B>>>=3,N-=3}else{for(R=ae+7;N>>=ae)),B>>>=7,N-=7}if(C.have+se>C.nlen+C.ndist){O.msg="invalid bit length repeat",C.mode=30;break}for(;se--;)C.lens[C.have++]=k}}if(C.mode===30)break;if(C.lens[256]===0){O.msg="invalid code -- missing end-of-block",C.mode=30;break}if(C.lenbits=9,Y={bits:C.lenbits},X=f(b,C.lens,0,C.nlen,C.lencode,0,C.work,Y),C.lenbits=Y.bits,X){O.msg="invalid literal/lengths set",C.mode=30;break}if(C.distbits=6,C.distcode=C.distdyn,Y={bits:C.distbits},X=f(y,C.lens,C.nlen,C.ndist,C.distcode,0,C.work,Y),C.distbits=Y.bits,X){O.msg="invalid distances set",C.mode=30;break}if(C.mode=20,K===6)break e;case 20:C.mode=21;case 21:if(6<=me&&258<=re){O.next_out=ne,O.avail_out=re,O.next_in=ce,O.avail_in=me,C.hold=B,C.bits=N,p(O,q),ne=O.next_out,ve=O.output,re=O.avail_out,ce=O.next_in,Q=O.input,me=O.avail_in,B=C.hold,N=C.bits,C.mode===12&&(C.back=-1);break}for(C.back=0;we=(A=C.lencode[B&(1<>>16&255,Ie=65535&A,!((ae=A>>>24)<=N);){if(me===0)break e;me--,B+=Q[ce++]<>Ne)])>>>16&255,Ie=65535&A,!(Ne+(ae=A>>>24)<=N);){if(me===0)break e;me--,B+=Q[ce++]<>>=Ne,N-=Ne,C.back+=Ne}if(B>>>=ae,N-=ae,C.back+=ae,C.length=Ie,we===0){C.mode=26;break}if(32&we){C.back=-1,C.mode=12;break}if(64&we){O.msg="invalid literal/length code",C.mode=30;break}C.extra=15&we,C.mode=22;case 22:if(C.extra){for(R=C.extra;N>>=C.extra,N-=C.extra,C.back+=C.extra}C.was=C.length,C.mode=23;case 23:for(;we=(A=C.distcode[B&(1<>>16&255,Ie=65535&A,!((ae=A>>>24)<=N);){if(me===0)break e;me--,B+=Q[ce++]<>Ne)])>>>16&255,Ie=65535&A,!(Ne+(ae=A>>>24)<=N);){if(me===0)break e;me--,B+=Q[ce++]<>>=Ne,N-=Ne,C.back+=Ne}if(B>>>=ae,N-=ae,C.back+=ae,64&we){O.msg="invalid distance code",C.mode=30;break}C.offset=Ie,C.extra=15&we,C.mode=24;case 24:if(C.extra){for(R=C.extra;N>>=C.extra,N-=C.extra,C.back+=C.extra}if(C.offset>C.dmax){O.msg="invalid distance too far back",C.mode=30;break}C.mode=25;case 25:if(re===0)break e;if(se=q-re,C.offset>se){if((se=C.offset-se)>C.whave&&C.sane){O.msg="invalid distance too far back",C.mode=30;break}F=se>C.wnext?(se-=C.wnext,C.wsize-se):C.wnext-se,se>C.length&&(se=C.length),Te=C.window}else Te=ve,F=ne-C.offset,se=C.length;for(reG?(Z=F[Te+S[K]],N[te+S[K]]):(Z=96,0),E=1<>ne)+(D-=E)]=z<<24|Z<<16|he|0,D!==0;);for(E=1<>=1;if(E!==0?(B&=E-1,B+=E):B=0,K++,--q[O]==0){if(O===Q)break;O=y[w+S[K]]}if(ve>>7)]}function te(A,U){A.pending_buf[A.pending++]=255&U,A.pending_buf[A.pending++]=U>>>8&255}function q(A,U,H){A.bi_valid>T-H?(A.bi_buf|=U<>T-A.bi_valid,A.bi_valid+=H-T):(A.bi_buf|=U<>>=1,H<<=1,0<--U;);return H>>>1}function Te(A,U,H){var ue,V,be=new Array(S+1),pe=0;for(ue=1;ue<=S;ue++)be[ue]=pe=pe+H[ue-1]<<1;for(V=0;V<=U;V++){var fe=A[2*V+1];fe!==0&&(A[2*V]=F(be[fe]++,fe))}}function ae(A){var U;for(U=0;U>1;1<=H;H--)Ne(A,be,H);for(V=Le;H=A.heap[1],A.heap[1]=A.heap[A.heap_len--],Ne(A,be,1),ue=A.heap[1],A.heap[--A.heap_max]=H,A.heap[--A.heap_max]=ue,be[2*V]=be[2*H]+be[2*ue],A.depth[V]=(A.depth[H]>=A.depth[ue]?A.depth[H]:A.depth[ue])+1,be[2*H+1]=be[2*ue+1]=V,A.heap[1]=V++,Ne(A,be,1),2<=A.heap_len;);A.heap[--A.heap_max]=A.heap[1],(function(Be,jt){var ie,Re,Ps,ze,Zo,Ze,At=jt.dyn_tree,Qo=jt.max_code,io=jt.stat_desc.static_tree,no=jt.stat_desc.has_stree,Un=jt.stat_desc.extra_bits,Io=jt.stat_desc.extra_base,Bs=jt.stat_desc.max_length,ro=0;for(ze=0;ze<=S;ze++)Be.bl_count[ze]=0;for(At[2*Be.heap[Be.heap_max]+1]=0,ie=Be.heap_max+1;ie<$;ie++)Bs<(ze=At[2*At[2*(Re=Be.heap[ie])+1]+1]+1)&&(ze=Bs,ro++),At[2*Re+1]=ze,Qo>=7;V>>=1)if(1&He&&fe.dyn_ltree[2*Le]!==0)return d;if(fe.dyn_ltree[18]!==0||fe.dyn_ltree[20]!==0||fe.dyn_ltree[26]!==0)return h;for(Le=32;Le>>3,(be=A.static_len+3+7>>>3)<=V&&(V=be)):V=be=H+5,H+4<=V&&U!==-1?R(A,U,H,ue):A.strategy===4||be===V?(q(A,2+(ue?1:0),3),Ae(A,Ce,O)):(q(A,4+(ue?1:0),3),(function(fe,Le,He,Be){var jt;for(q(fe,Le-257,5),q(fe,He-1,5),q(fe,Be-4,4),jt=0;jt>>8&255,A.pending_buf[A.d_buf+2*A.last_lit+1]=255&U,A.pending_buf[A.l_buf+A.last_lit]=255&H,A.last_lit++,U===0?A.dyn_ltree[2*H]++:(A.matches++,U--,A.dyn_ltree[2*(C[H]+y+1)]++,A.dyn_dtree[2*N(U)]++),A.last_lit===A.lit_bufsize-1},l._tr_align=function(A){q(A,2,3),se(A,D,Ce),(function(U){U.bi_valid===16?(te(U,U.bi_buf),U.bi_buf=0,U.bi_valid=0):8<=U.bi_valid&&(U.pending_buf[U.pending++]=255&U.bi_buf,U.bi_buf>>=8,U.bi_valid-=8)})(A)}},{"../utils/common":41}],53:[function(i,r,l){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(i,r,l){(function(c){(function(d,h){if(!d.setImmediate){var p,f,b,y,w=1,v={},_=!1,$=d.document,S=Object.getPrototypeOf&&Object.getPrototypeOf(d);S=S&&S.setTimeout?S:d,p={}.toString.call(d.process)==="[object process]"?function(M){process.nextTick(function(){E(M)})}:(function(){if(d.postMessage&&!d.importScripts){var M=!0,P=d.onmessage;return d.onmessage=function(){M=!1},d.postMessage("","*"),d.onmessage=P,M}})()?(y="setImmediate$"+Math.random()+"$",d.addEventListener?d.addEventListener("message",D,!1):d.attachEvent("onmessage",D),function(M){d.postMessage(y+M,"*")}):d.MessageChannel?((b=new MessageChannel).port1.onmessage=function(M){E(M.data)},function(M){b.port2.postMessage(M)}):$&&"onreadystatechange"in $.createElement("script")?(f=$.documentElement,function(M){var P=$.createElement("script");P.onreadystatechange=function(){E(M),P.onreadystatechange=null,f.removeChild(P),P=null},f.appendChild(P)}):function(M){setTimeout(E,0,M)},S.setImmediate=function(M){typeof M!="function"&&(M=new Function(""+M));for(var P=new Array(arguments.length-1),W=0;W"u"?c===void 0?this:c:self)}).call(this,typeof eo<"u"?eo:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(RC);var bse=RC.exports;const ww=Xo(bse);function vse(a){const[s,i]=_e.useState(""),[r,l]=_e.useState("");return Lt(()=>{a.socket.decrypt(a.systemConfig.native.javascriptPassword).then(c=>l(c))},[a.systemConfig,a.socket]),m.jsxs(Pt,{open:!0,onClose:()=>a.onEntered(null),fullWidth:!0,maxWidth:"sm",children:[m.jsx(Xt,{children:x.I18n.t("Please enter a password for expert mode")}),m.jsx(Wt,{children:m.jsx(Eo,{autoFocus:!0,margin:"dense",variant:"standard",label:x.I18n.t("Password"),type:"password",fullWidth:!0,value:s,onKeyDown:c=>{c.key==="Enter"&&s&&(c.preventDefault(),c.stopPropagation(),r===s?a.onEntered(s):a.onEntered(""))},onChange:c=>i(c.target.value)})}),m.jsxs(Bt,{children:[m.jsx(Ue,{variant:"contained",disabled:!s,onClick:()=>{r===s?a.onEntered(s):a.onEntered("")},startIcon:m.jsx(qo,{}),children:x.I18n.t("Ok")}),m.jsx(Ue,{color:"grey",variant:"contained",onClick:()=>a.onEntered(null),startIcon:m.jsx(so,{}),children:x.I18n.t("Cancel")})]})]})}const Gr={root:{flexGrow:1,display:"flex",width:"100%",height:"100%"},mainDiv:{width:"100%",height:"100%",overflow:"hidden"},content:a=>({width:"100%",height:"100%",backgroundColor:a.palette.background&&a.palette.background.default,position:"relative"}),menuOpenCloseButton:a=>({position:"absolute",left:0,borderRadius:"0 5px 5px 0",top:6,pt:1,cursor:"pointer",zIndex:1,height:25,width:20,background:a.palette.secondary.main,color:a.palette.primary.main,pl:"3px","&:hover":{color:"white"}}),showLogButton:a=>({position:"absolute",right:3,borderRadius:"5px 5px 0 0",bottom:0,pt:"3px",cursor:"pointer",zIndex:10,height:20,width:25,background:a.palette.secondary.main,color:a.palette.primary.main,pl:1,"&:hover":{color:"white"}})};class yse extends x.GenericApp{hosts=[];importFile=null;importFileName=null;scripts={};confirmCallback=null;changedScripts={};javascriptPassword="";constructor(s){super(s,{Connection:x.AdminConnection,translations:{en:pM,de:lB,es:oF,fr:ZU,it:K5,nl:UV,pl:P6,pt:R7,ru:Eq,uk:wQ,"zh-cn":$se},bottomButtons:!1,socket:{autoSubscribeLog:!0},sentryDSN:window.sentryDSN});const i=window.localStorage.getItem("JS.logSizes");let r=[80,20];if(i)try{r=JSON.parse(i)}catch{}const l=window.localStorage.getItem("JS.splitSizes");let c=[20,80];if(l)try{c=JSON.parse(l)}catch{}this.state={...this.state,splitSizes:c,logSizes:r},window.alert=d=>{console.error(d),this.showJsError(d.toString())}}onScriptsChanged=(s,i)=>{if(!s)return;let r=!1;const l={};s.startsWith("script.js.")&&(i?JSON.stringify(this.scripts[s])!==JSON.stringify(i)&&(this.scripts[s]=i,r=!0,l.scriptsHash=this.state.scriptsHash+1):this.scripts[s]&&(delete this.scripts[s],r=!0,l.scriptsHash=this.state.scriptsHash+1)),r&&this.setState(l)};onInstanceChanged=(s,i)=>{var c;if(!s)return;let r=!1;const l={};if(s.match(/^system\.adapter\.[-_\w\d]+\$/)){if(s.startsWith(`system.adapter.${this.adapterName}.`)){const d=parseInt(s.split(".").pop()||"0",10)||0;if((i==null?void 0:i.type)==="instance")this.state.instances.includes(d)||(l.instances=[...this.state.instances],l.instances.push(d),l.instances.sort(),r=!0,this.socket.subscribeState(`${i._id}.alive`,this.onInstanceAliveChange));else if(!i&&this.state.instances.includes(d)){this.socket.unsubscribeState(`${s}.alive`,this.onInstanceAliveChange),l.instances=[...this.state.instances];const h=l.instances.indexOf(d);l.instances.splice(h,1),r=!0}}(c=i==null?void 0:i.common)!=null&&c.blockly&&(this.confirmCallback=d=>d&&window.location.reload(),l.confirm=x.I18n.t("Some blocks were updated. Reload admin?"),r=!0)}r&&this.setState(l)};onHostChanged=(s,i)=>{if(s&&s.startsWith("system.host.")){if((i==null?void 0:i.type)==="host")this.hosts.includes(s)||(this.hosts.push(s),this.hosts.sort());else if(!i&&this.hosts.includes(s)){const r=this.hosts.indexOf(s);this.hosts.splice(r,1)}}};onConnectionReady(){window.systemLang=this.socket.systemLang,this.setState({ready:!1,scriptsHash:0,instances:[],updating:!1,resizing:!1,selected:null,logMessage:{},editing:[],menuOpened:window.localStorage.getItem("App.menuOpened")!=="false",menuSelectId:"",expertMode:window.localStorage.getItem("App.expertMode")==="true",logHorzLayout:window.localStorage.getItem("App.logHorzLayout")==="true",runningInstances:{},confirm:"",importFile:!1,message:"",searchText:"",hideLog:window.localStorage.getItem("App.hideLog")==="true",debugMode:!1,debugInstance:null,splitSizes:[20,80],password:""},async()=>{var d;const s={},i=await this.subscribeOnInstances();s.instances=i.instances,s.runningInstances=i.runningInstances,this.javascriptPassword=((d=this.socket.systemConfig)==null?void 0:d.native.javascriptPassword)||"",await this.readAdaptersWithBlockly();const r=await this.socket.getHosts();this.hosts=r.map(h=>h._id);const l=await this.readAllScripts();window.localStorage.getItem("App.expertMode")!=="true"&&window.localStorage.getItem("App.expertMode")!=="false"&&!this.javascriptPassword?Object.keys(l).find(h=>h.startsWith("script.js.global.")&&l[h].type==="script")&&(s.expertMode=!0):this.javascriptPassword&&(s.expertMode=!1),this.scripts=l;let c=this.state.scriptsHash;this.compareScripts(l)&&c++,s.scriptsHash=c,s.ready=!0,this.setState(s),await this.socket.subscribeObject("script.*",this.onScriptsChanged),await this.socket.subscribeObject("system.adapter.*",this.onInstanceChanged),await this.socket.subscribeObject("system.host.*",this.onHostChanged)})}async subscribeOnInstances(){const i=(await this.socket.getAdapterInstances(this.adapterName)).map(l=>parseInt(l._id.split(".").pop()||"0")).sort(),r={};i.forEach(l=>r[`system.adapter.${this.adapterName}.${l}`]=!1);for(let l=0;ls[r]=i[r]),s}async readAdaptersWithBlockly(){const s=await this.socket.getObjectViewSystem("adapter","system.adapter.","system.adapter.香");return new Promise(i=>et.loadCustomBlockly(s,()=>i()))}onInstanceAliveChange=(s,i)=>{if(s&&(s=s?s.substring(0,s.length-6):"",this.state.runningInstances[s]!==(i?i.val:!1))){const r=JSON.parse(JSON.stringify(this.state.runningInstances));r[s]=i?!!i.val:!1,this.setState({runningInstances:r})}};compareScripts(s){const i=Object.keys(this.scripts),r=Object.keys(s);if(i.length!==r.length)return this.scripts=s,!0;if(JSON.stringify(i)!==JSON.stringify(r))return this.scripts=s,!0;for(let l=0;l ${i}`),this.setState({updating:!0});try{if(((c=this.scripts[s])==null?void 0:c.type)==="script"){const d=JSON.parse(JSON.stringify(this.scripts[s].common));d.name=r||d.name,l!==void 0&&(d.engine=`system.adapter.javascript.${l}`);const h=i.split(".");h.pop();const p=h.join(".");this.scripts[p]&&this.scripts[p].type==="script"&&(h.pop(),i=`${h.join(".")}.${i.split(".").pop()}`),await this.updateScript(s,i,d)}else await this.renameGroup(s,i,r)}catch(d){d.toString().includes("canceled")||this.showJsError(d)}this.setState({updating:!1})}async renameGroup(s,i,r,l){if(l){if(l.length){let c=l.pop();if(c){const d=await this.socket.getObject(c);if(d){try{await this.socket.delObject(c)}catch{}c=i+c.substring(s.length),d._id=c,d.common=d.common||{},d.common.expert=!0,await this.socket.setObject(c,d),await this.renameGroup(s,i,r,l)}}}}else{l=[],l=Object.keys(this.scripts).filter(d=>d.startsWith(`${s}.`));let c=await this.socket.getObject(s);c=c||{common:{},type:"channel"},c.common.name=r||c.common.name||s.split(".").pop()||"",c._id=i;try{await this.socket.delObject(s)}catch{}try{await this.socket.setObject(i,c),await this.renameGroup(s,i,r,l)}catch(d){console.log(d);const h={_id:i,type:"channel",common:{name:r||s.split(".").pop()||"",expert:!0},native:{}};await this.socket.setObject(i,h),await this.renameGroup(s,i,r,l)}}}async onUpdateScript(s,i){var r;if(((r=this.scripts[s])==null?void 0:r.type)==="script")try{await this.updateScript(s,s,i)}catch(l){l.toString().includes("canceled")||this.showJsError(l)}}onSelect(s){this.scripts[s]&&this.scripts[s].common&&this.scripts[s].type==="script"&&this.setState({selected:s,menuSelectId:s},()=>setTimeout(()=>this.setState({menuSelectId:""}),300))}renderPasswordDialog(){return this.state.showPasswordDialog?m.jsx(vse,{socket:this.socket,systemConfig:this.socket.systemConfig,onEntered:s=>{s===null?this.setState({showPasswordDialog:!1,expertMode:!1,password:""}):s?this.setState({expertMode:!0,showPasswordDialog:!1,password:s}):this.setState({showPasswordDialog:!1,expertMode:!1,message:x.I18n.t("Wrong password"),password:""})}},"passwordDialog"):null}onExpertModeChange(s){var i;if(this.state.expertMode!==s)if(s&&this.javascriptPassword)this.setState({showPasswordDialog:!0});else{let r=this.state.selected;r&&!s&&((i=this.scripts[r].native)!=null&&i.protected)&&(r=this.state.editing.find(l=>{var c;return this.scripts[l]&&!((c=this.scripts[l].native)!=null&&c.protected)})||null),window.localStorage.setItem("App.expertMode",s?"true":"false"),this.setState({expertMode:s,password:"",selected:r})}}showJsError(s){this.setState({errorText:s?s.toString():""})}showMessage(s){this.setState({message:s?s.toString():""})}onDelete(s){this.socket.delObject(s).catch(i=>this.showJsError(i))}onEdit(s){this.state.selected!==s&&this.setState({selected:s})}onAddNew(s,i,r,l,c,d){const h=new RegExp(`^${s}\\.`);if(Object.keys(this.scripts).find(p=>s===p||h.test(s)))return this.showJsError(x.I18n.t("Yet exists!"));r?this.socket.setObject(s,{_id:s,type:"channel",common:{name:i,expert:!0},native:{}}).then(()=>setTimeout(()=>this.setState({menuSelectId:s},()=>setTimeout(()=>this.setState({menuSelectId:""}),300)),1e3)).catch(p=>this.showJsError(p)):(c==="Blockly"&&!d&&(d=` //${btoa(encodeURIComponent(''))}`),this.socket.setObject(s,{_id:s,type:"script",common:{name:i,expert:!0,engineType:c||"Javascript/js",enabled:!1,engine:`system.adapter.javascript.${l||0}`,source:d||"",debug:!1,verbose:!1},native:{}}).then(()=>setTimeout(()=>this.onSelect(s),1e3)).catch(p=>this.showJsError(p)))}async updateScript(s,i,r){let l=await this.socket.getObject(s);const c={common:{}};if(r.engine!==void 0&&(c.common.engine=r.engine),r.enabled!==void 0&&(c.common.enabled=r.enabled),r.source!==void 0&&(c.common.source=r.source),r.debug!==void 0&&(c.common.debug=r.debug),r.verbose!==void 0&&(c.common.verbose=r.verbose),c.from="system.adapter.admin.0",s===i&&(l!=null&&l.common)&&r.name===l.common.name){(!r.engineType||r.engineType!==l.common.engineType)&&r.engineType!==void 0&&(c.common.engineType=r.engineType||"Javascript/js"),c.type="script",await this.socket.extendObject(s,c);return}if(l!=null&&l.common){l.common.engineType=r.engineType||l.common.engineType||"Javascript/js",await this.socket.delObject(s),c.common.engine!==void 0&&(l.common.engine=c.common.engine),c.common.enabled!==void 0&&(l.common.enabled=c.common.enabled),c.common.source!==void 0&&(l.common.source=c.common.source),c.common.name!==void 0&&(l.common.name=c.common.name),c.common.debug!==void 0&&(l.common.debug=c.common.debug),c.common.verbose!==void 0&&(l.common.verbose=c.common.verbose),l._rev!==void 0&&delete l._rev,l.common.name=r.name,l.common.expert=!0,l.type="script",l._id=i,await this.socket.setObject(i,l);return}l=c,l.common.name=r.name,l.common.expert=!0,l.type="script",l._id=i,await this.socket.setObject(i,l)}onEnableDisable(s,i){var r;if(((r=this.scripts[s])==null?void 0:r.type)==="script"){const l=this.scripts[s].common;l.enabled=i,l.expert=!0,this.updateScript(s,s,l).catch(c=>c!=="canceled"&&this.showJsError(c))}}async getLiveHost(){for(let s=0;s{if(typeof d=="string"){const h=document.createElement("a");h.href=`../../files/${d}`,document.body.appendChild(h),h.click(),h.remove()}else if(d.error&&this.showJsError(d.error),d.data){const h=document.createElement("a");h.href=`data: application/zip;base64,${d.data}`,h.download=`${r}scripts.zip`,document.body.appendChild(h),h.click(),h.remove()}})}else{const c=new ww;for(const[d,h]of Object.entries(this.scripts))if(h.type==="script"){const p=h,f=p.common.engineType==="TypeScript/ts"?"ts":p.common.engineType==="Blockly"?"blockly":p.common.engineType==="Rules"?"rules":"js";let b=`/******* (ext=${f}/engine=${p.common.engine}/debug=${p.common.debug}/verbose=${p.common.verbose}/enabled=${p.common.enabled}) *******/ `;b+=p.common.source||"";const y=`${d.substring(10).replace(/\./g,"/")}.${f}`;c.file(y,b)}c.generateAsync({type:"blob"}).then(d=>{const h=document.createElement("a");h.href=URL.createObjectURL(d),h.download=`${r}scripts_plain.zip`,document.body.appendChild(h),h.click(),h.remove(),URL.revokeObjectURL(h.href)})}}onImport(s,i){this.importFile=s||null,this.importFileName=i||null,s?(this.confirmCallback=this.onImportConfirmed.bind(this),this.setState({importFile:!1,confirm:x.I18n.t("Existing scripts will be overwritten.")})):this.setState({importFile:!1})}async onImportConfirmed(s){let i=this.importFile;const r=this.importFileName;if(this.importFile=null,this.importFileName=null,s&&i)if(r&&/_(plain|text)\.zip$/i.test(r)){i=i.split(",")[1];try{const c=await ww.loadAsync(i,{base64:!0}),d=[];c.forEach((h,p)=>{p.dir||d.push(p.async("string").then(async f=>{const b=f.split(` `),y=b[0]||"",w=b.slice(1).join(` -`),v=y.match(/\/\*{7}\s*\(ext=(\w+)\/engine=([^/]+)\/debug=(\w+)\/verbose=(\w+)\/enabled=(\w+)\)\s*\*{7}\//);let _="Javascript/js",$="system.adapter.javascript.0",S=!1,T=!1,E=!1;if(v){const G=v[1];$=v[2],S=v[3]==="true",T=v[4]==="true",E=v[5]==="true",G==="ts"?_="TypeScript/ts":G==="blockly"?_="Blockly":G==="rules"&&(_="Rules")}const D=h.replace(/\.\w+$/,"").replace(/\//g,"."),M=`script.js.${D}`,P=D.split(".").pop()||D,W=M.split(".");for(let G=3;G{d==="permissionError"?this.showJsError(x.I18n.t(d)):!d||d.error?this.showJsError(d?x.I18n.t(d.error||""):x.I18n.t("Unknown error")):this.showMessage(x.I18n.t("Done"))})}}toggleLogLayout(){window.localStorage.setItem("App.logHorzLayout",this.state.logHorzLayout?"false":"true"),this.setState({logHorzLayout:!this.state.logHorzLayout})}renderEditor(){var i;const s=Object.keys(this.scripts).reduce((r,l)=>r+(this.scripts[l].common.engineType==="Rules"?1:0),0);return m.jsx(On,{scriptsHash:this.state.scriptsHash,debugMode:this.state.debugMode,onDebugModeChange:r=>{r?this.setState({debugMode:!0}):this.setState({debugMode:!1,debugInstance:null})},visible:!this.state.resizing,socket:this.socket,adapterName:this.adapterName,onLocate:r=>this.setState({menuSelectId:r}),password:this.state.password,runningInstances:this.state.runningInstances,menuOpened:this.state.menuOpened,searchText:this.state.searchText,themeType:this.state.themeType,themeName:this.state.themeName,theme:this.state.theme,expertMode:this.state.expertMode,onChange:(r,l)=>this.onUpdateScript(r,l),isAnyRulesExists:s,debugInstance:this.state.debugInstance,onSelectedChange:(r,l)=>{const c={};let d=!1;r!==this.state.selected&&(d=!0,c.selected=r),JSON.stringify(l)!==JSON.stringify(this.state.editing)&&(d=!0,c.editing=[...l]),d&&this.setState(c)},onRestart:r=>this.socket.extendObject(r,{common:{enabled:!0}}),selected:this.state.selected&&((i=this.scripts[this.state.selected])==null?void 0:i.type)==="script"?this.state.selected:"",objects:this.scripts,resizing:this.state.resizing,onChangedChanged:r=>this.changedScripts=r},"editor")}showLogButton(){return m.jsx(wt,{title:x.I18n.t("Show logs"),sx:Gr.showLogButton,onClick:()=>{window.localStorage.setItem("App.hideLog","false"),this.setState({hideLog:!1,resizing:!0}),setTimeout(()=>this.setState({resizing:!1}),300)},children:m.jsx(SS,{})},"showLog")}renderErrorDialog(){return this.state.errorText?m.jsx(su,{onClose:()=>this.setState({errorText:""}),text:this.state.errorText},"dialogError"):null}renderMain(){let s;return this.state.debugMode||this.state.hideLog?s=m.jsxs(m.Fragment,{children:[!this.state.debugMode&&this.state.hideLog?this.showLogButton():void 0,this.renderEditor()]}):s=m.jsxs(d_,{direction:this.state.logHorzLayout?ft.Horizontal:ft.Vertical,initialSizes:this.state.logSizes,minWidths:[500,100],minHeights:[150,50],onResizeStarted:()=>this.setState({resizing:!0}),onResizeFinished:(i,r)=>{this.setState({logSizes:r,resizing:!1}),window.localStorage.setItem("JS.logSizes",JSON.stringify(r))},gutterClassName:this.state.themeType==="dark"?"Dark visGutter":"Light visGutter",children:[this.renderEditor(),m.jsx(wm,{verticalLayout:!this.state.logHorzLayout,onLayoutChange:()=>this.toggleLogLayout(),editing:this.state.editing,socket:this.socket,selected:this.state.selected,onHideLog:()=>{window.localStorage.setItem("App.hideLog","true"),this.setState({hideLog:!0,resizing:!0}),setTimeout(()=>this.setState({resizing:!1}),300)}},"log")]}),m.jsxs(wt,{sx:Gr.content,className:"iobVerticalSplitter",children:[m.jsx(wt,{sx:Gr.menuOpenCloseButton,onClick:()=>{window.localStorage.setItem("App.menuOpened",this.state.menuOpened?"false":"true"),this.setState({menuOpened:!this.state.menuOpened,resizing:!0}),setTimeout(()=>this.setState({resizing:!1}),300)},children:this.state.menuOpened?m.jsx(ES,{}):m.jsx(IS,{})},"closeMenu"),this.state.message?m.jsx(x.Message,{onClose:()=>this.setState({message:""}),text:this.state.message},"dialogMessage"):null,this.renderErrorDialog(),this.state.importFile?m.jsx(Hm,{onClose:(i,r)=>this.onImport(i,r)},"dialogImportFile"):null,this.state.confirm?m.jsx(x.Confirm,{onClose:i=>{this.state.confirm&&this.setState({confirm:""}),this.confirmCallback&&this.confirmCallback(i),this.confirmCallback=null},text:this.state.confirm},"dialogConfirm"):null,this.renderPasswordDialog(),s]},"main")}render(){if(!this.state.ready)return m.jsx(a_,{injectFirst:!0,children:m.jsx(l_,{theme:this.state.theme,children:m.jsx(x.Loader,{themeType:this.state.themeType})})});let s;return this.state.menuOpened?s=m.jsxs(d_,{direction:ft.Horizontal,initialSizes:this.state.splitSizes,minWidths:[270,400],onResizeFinished:(i,r)=>{this.setState({splitSizes:r}),window.localStorage.setItem("JS.splitSizes",JSON.stringify(r))},gutterClassName:this.state.themeType==="dark"?"Dark visGutter":"Light visGutter",children:[m.jsx("div",{style:Gr.mainDiv,children:m.jsx(So,{password:this.state.password,debugMode:this.state.debugMode,onDebugInstance:i=>this.setState({debugInstance:i,debugMode:!!i}),scripts:this.scripts,scriptsHash:this.state.scriptsHash,instances:this.state.instances,onRename:this.onRename.bind(this),socket:this.socket,selectId:this.state.menuSelectId,onEdit:this.onEdit.bind(this),expertMode:this.state.expertMode,themeName:this.state.themeName,onThemeChange:i=>{x.Utils.setThemeName(i);const r=x.Utils.getThemeType(i);this.setState({themeName:i,themeType:r},()=>this.toggleTheme(i))},runningInstances:this.state.runningInstances,onExpertModeChange:i=>this.onExpertModeChange(i),onDelete:this.onDelete.bind(this),onAddNew:this.onAddNew.bind(this),onEnableDisable:this.onEnableDisable.bind(this),onExport:this.onExport.bind(this),width:500,onImport:()=>this.setState({importFile:!0}),onSearch:i=>this.setState({searchText:i}),version:this.props.version,changedScripts:this.changedScripts},"sidemenu")},"menu"),this.renderMain()]}):s=this.renderMain(),m.jsx(a_,{injectFirst:!0,children:m.jsx(l_,{theme:this.state.theme,children:m.jsx("div",{style:Gr.root,children:m.jsx(bR,{socket:this.socket,children:s})})})})}}window.location.hostname==="localhost"||window.location.hostname==="[::1]"||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/);function use(){"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(a=>{a.unregister()})}const dse="9.1.1",RC={version:dse};var Jo;(function(a){a.mouse="mouse",a.touch="touch",a.keyboard="keyboard"})(Jo||(Jo={}));class hse{get delay(){var s;return(s=this.args.delay)!==null&&s!==void 0?s:0}get scrollAngleRanges(){return this.args.scrollAngleRanges}get getDropTargetElementsAtPoint(){return this.args.getDropTargetElementsAtPoint}get ignoreContextMenu(){var s;return(s=this.args.ignoreContextMenu)!==null&&s!==void 0?s:!1}get enableHoverOutsideTarget(){var s;return(s=this.args.enableHoverOutsideTarget)!==null&&s!==void 0?s:!1}get enableKeyboardEvents(){var s;return(s=this.args.enableKeyboardEvents)!==null&&s!==void 0?s:!1}get enableMouseEvents(){var s;return(s=this.args.enableMouseEvents)!==null&&s!==void 0?s:!1}get enableTouchEvents(){var s;return(s=this.args.enableTouchEvents)!==null&&s!==void 0?s:!0}get touchSlop(){return this.args.touchSlop||0}get delayTouchStart(){var s,i,r,l;return(l=(r=(s=this.args)===null||s===void 0?void 0:s.delayTouchStart)!==null&&r!==void 0?r:(i=this.args)===null||i===void 0?void 0:i.delay)!==null&&l!==void 0?l:0}get delayMouseStart(){var s,i,r,l;return(l=(r=(s=this.args)===null||s===void 0?void 0:s.delayMouseStart)!==null&&r!==void 0?r:(i=this.args)===null||i===void 0?void 0:i.delay)!==null&&l!==void 0?l:0}get window(){if(this.context&&this.context.window)return this.context.window;if(typeof window<"u")return window}get document(){var s;if(!((s=this.context)===null||s===void 0)&&s.document)return this.context.document;if(this.window)return this.window.document}get rootElement(){var s;return((s=this.args)===null||s===void 0?void 0:s.rootElement)||this.document}constructor(s,i){this.args=s,this.context=i}}function pse(a,s,i,r){return Math.sqrt(Math.pow(Math.abs(i-a),2)+Math.pow(Math.abs(r-s),2))}function gse(a,s,i,r,l){if(!l)return!1;const c=Math.atan2(r-s,i-a)*180/Math.PI+180;for(let d=0;d=h.start)&&(h.end==null||c<=h.end))return!0}return!1}const mse={Left:1},fse={Left:0};function Eg(a){return a.button===void 0||a.button===fse.Left}function $se(a){return a.buttons===void 0||(a.buttons&mse.Left)===0}function NC(a){return!!a.targetTouches}const bse=1;function vse(a){const s=a.nodeType===bse?a:a.parentElement;if(!s)return;const{top:i,left:r}=s.getBoundingClientRect();return{x:r,y:i}}function yse(a,s){if(a.targetTouches.length===1)return Kc(a.targetTouches[0]);if(s&&a.touches.length===1&&a.touches[0].target===s.target)return Kc(a.touches[0])}function Kc(a,s){return NC(a)?yse(a,s):{x:a.clientX,y:a.clientY}}const kw=(()=>{let a=!1;try{addEventListener("test",()=>{},Object.defineProperty({},"passive",{get(){return a=!0,!0}}))}catch{}return a})(),Vr={[Jo.mouse]:{start:"mousedown",move:"mousemove",end:"mouseup",contextmenu:"contextmenu"},[Jo.touch]:{start:"touchstart",move:"touchmove",end:"touchend"},[Jo.keyboard]:{keydown:"keydown"}};class Zr{profile(){var s;return{sourceNodes:this.sourceNodes.size,sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,targetNodes:this.targetNodes.size,dragOverTargetIds:((s=this.dragOverTargetIds)===null||s===void 0?void 0:s.length)||0}}get document(){return this.options.document}setup(){const s=this.options.rootElement;s&&(Ve(!Zr.isSetUp,"Cannot have two Touch backends at the same time."),Zr.isSetUp=!0,this.addEventListener(s,"start",this.getTopMoveStartHandler()),this.addEventListener(s,"start",this.handleTopMoveStartCapture,!0),this.addEventListener(s,"move",this.handleTopMove),this.addEventListener(s,"move",this.handleTopMoveCapture,!0),this.addEventListener(s,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.addEventListener(s,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.addEventListener(s,"keydown",this.handleCancelOnEscape,!0))}teardown(){const s=this.options.rootElement;s&&(Zr.isSetUp=!1,this._mouseClientOffset={},this.removeEventListener(s,"start",this.handleTopMoveStartCapture,!0),this.removeEventListener(s,"start",this.handleTopMoveStart),this.removeEventListener(s,"move",this.handleTopMoveCapture,!0),this.removeEventListener(s,"move",this.handleTopMove),this.removeEventListener(s,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.removeEventListener(s,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.removeEventListener(s,"keydown",this.handleCancelOnEscape,!0),this.uninstallSourceNodeRemovalObserver())}addEventListener(s,i,r,l=!1){const c=kw?{capture:l,passive:!1}:l;this.listenerTypes.forEach(function(d){const h=Vr[d][i];h&&s.addEventListener(h,r,c)})}removeEventListener(s,i,r,l=!1){const c=kw?{capture:l,passive:!1}:l;this.listenerTypes.forEach(function(d){const h=Vr[d][i];h&&s.removeEventListener(h,r,c)})}connectDragSource(s,i){const r=this.handleMoveStart.bind(this,s);return this.sourceNodes.set(s,i),this.addEventListener(i,"start",r),()=>{this.sourceNodes.delete(s),this.removeEventListener(i,"start",r)}}connectDragPreview(s,i,r){return this.sourcePreviewNodeOptions.set(s,r),this.sourcePreviewNodes.set(s,i),()=>{this.sourcePreviewNodes.delete(s),this.sourcePreviewNodeOptions.delete(s)}}connectDropTarget(s,i){const r=this.options.rootElement;if(!this.document||!r)return()=>{};const l=c=>{if(!this.document||!r||!this.monitor.isDragging())return;let d;switch(c.type){case Vr.mouse.move:d={x:c.clientX,y:c.clientY};break;case Vr.touch.move:var h,p;d={x:((h=c.touches[0])===null||h===void 0?void 0:h.clientX)||0,y:((p=c.touches[0])===null||p===void 0?void 0:p.clientY)||0};break}const f=d!=null?this.document.elementFromPoint(d.x,d.y):void 0,b=f&&i.contains(f);if(f===i||b)return this.handleMove(c,s)};return this.addEventListener(this.document.body,"move",l),this.targetNodes.set(s,i),()=>{this.document&&(this.targetNodes.delete(s),this.removeEventListener(this.document.body,"move",l))}}getTopMoveStartHandler(){return!this.options.delayTouchStart&&!this.options.delayMouseStart?this.handleTopMoveStart:this.handleTopMoveStartDelay}installSourceNodeRemovalObserver(s){this.uninstallSourceNodeRemovalObserver(),this.draggedSourceNode=s,this.draggedSourceNodeRemovalObserver=new MutationObserver(()=>{s&&!s.parentElement&&(this.resurrectSourceNode(),this.uninstallSourceNodeRemovalObserver())}),!(!s||!s.parentElement)&&this.draggedSourceNodeRemovalObserver.observe(s.parentElement,{childList:!0})}resurrectSourceNode(){this.document&&this.draggedSourceNode&&(this.draggedSourceNode.style.display="none",this.draggedSourceNode.removeAttribute("data-reactid"),this.document.body.appendChild(this.draggedSourceNode))}uninstallSourceNodeRemovalObserver(){this.draggedSourceNodeRemovalObserver&&this.draggedSourceNodeRemovalObserver.disconnect(),this.draggedSourceNodeRemovalObserver=void 0,this.draggedSourceNode=void 0}constructor(s,i,r){this.getSourceClientOffset=l=>{const c=this.sourceNodes.get(l);return c&&vse(c)},this.handleTopMoveStartCapture=l=>{Eg(l)&&(this.moveStartSourceIds=[])},this.handleMoveStart=l=>{Array.isArray(this.moveStartSourceIds)&&this.moveStartSourceIds.unshift(l)},this.handleTopMoveStart=l=>{if(!Eg(l))return;const c=Kc(l);c&&(NC(l)&&(this.lastTargetTouchFallback=l.targetTouches[0]),this._mouseClientOffset=c),this.waitingForDelay=!1},this.handleTopMoveStartDelay=l=>{if(!Eg(l))return;const c=l.type===Vr.touch.start?this.options.delayTouchStart:this.options.delayMouseStart;this.timeout=setTimeout(this.handleTopMoveStart.bind(this,l),c),this.waitingForDelay=!0},this.handleTopMoveCapture=()=>{this.dragOverTargetIds=[]},this.handleMove=(l,c)=>{this.dragOverTargetIds&&this.dragOverTargetIds.unshift(c)},this.handleTopMove=l=>{if(this.timeout&&clearTimeout(this.timeout),!this.document||this.waitingForDelay)return;const{moveStartSourceIds:c,dragOverTargetIds:d}=this,h=this.options.enableHoverOutsideTarget,p=Kc(l,this.lastTargetTouchFallback);if(!p)return;if(this._isScrolling||!this.monitor.isDragging()&&gse(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,p.x,p.y,this.options.scrollAngleRanges)){this._isScrolling=!0;return}if(!this.monitor.isDragging()&&this._mouseClientOffset.hasOwnProperty("x")&&c&&pse(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,p.x,p.y)>(this.options.touchSlop?this.options.touchSlop:0)&&(this.moveStartSourceIds=void 0,this.actions.beginDrag(c,{clientOffset:this._mouseClientOffset,getSourceClientOffset:this.getSourceClientOffset,publishSource:!1})),!this.monitor.isDragging())return;const f=this.sourceNodes.get(this.monitor.getSourceId());this.installSourceNodeRemovalObserver(f),this.actions.publishDragSource(),l.cancelable&&l.preventDefault();const b=(d||[]).map(_=>this.targetNodes.get(_)).filter(_=>!!_),y=this.options.getDropTargetElementsAtPoint?this.options.getDropTargetElementsAtPoint(p.x,p.y,b):this.document.elementsFromPoint(p.x,p.y),w=[];for(const _ in y){if(!y.hasOwnProperty(_))continue;let $=y[_];for($!=null&&w.push($);$;)$=$.parentElement,$&&w.indexOf($)===-1&&w.push($)}const v=w.filter(_=>b.indexOf(_)>-1).map(_=>this._getDropTargetId(_)).filter(_=>!!_).filter((_,$,S)=>S.indexOf(_)===$);if(h)for(const _ in this.targetNodes){const $=this.targetNodes.get(_);if(f&&$&&$.contains(f)&&v.indexOf(_)===-1){v.unshift(_);break}}v.reverse(),this.actions.hover(v,{clientOffset:p})},this._getDropTargetId=l=>{const c=this.targetNodes.keys();let d=c.next();for(;d.done===!1;){const h=d.value;if(l===this.targetNodes.get(h))return h;d=c.next()}},this.handleTopMoveEndCapture=l=>{if(this._isScrolling=!1,this.lastTargetTouchFallback=void 0,!!$se(l)){if(!this.monitor.isDragging()||this.monitor.didDrop()){this.moveStartSourceIds=void 0;return}l.cancelable&&l.preventDefault(),this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.drop(),this.actions.endDrag()}},this.handleCancelOnEscape=l=>{l.key==="Escape"&&this.monitor.isDragging()&&(this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.endDrag())},this.options=new hse(r,i),this.actions=s.getActions(),this.monitor=s.getMonitor(),this.sourceNodes=new Map,this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.targetNodes=new Map,this.listenerTypes=[],this._mouseClientOffset={},this._isScrolling=!1,this.options.enableMouseEvents&&this.listenerTypes.push(Jo.mouse),this.options.enableTouchEvents&&this.listenerTypes.push(Jo.touch),this.options.enableKeyboardEvents&&this.listenerTypes.push(Jo.keyboard)}}const _se=function(s,i={},r={}){return new Zr(s,i,r)};window.GenericBlock=at;window.adapterName="javascript";window.sentryDSN="https://504499a725eb4898930d3b9e9da95740@sentry.iobroker.net/56";console.log(`iobroker.${window.adapterName}@${RC.version}`);const wse=window.innerWidth<600,Cw=document.getElementById("root");Cw&&Fw(Cw).render(m.jsx(ek,{backend:wse?_se:hk,children:m.jsx(cse,{version:RC.version})}));use();const gc=window.loadDynamicScript;gc&&gc(window.location.port==="3000"?`${window.location.protocol}//${window.location.hostname}:8081/lib/js/socket.io.js`:"./../../lib/js/socket.io.js",()=>gc("vs/loader.js",()=>gc("vs/configure.js",()=>typeof window.socketLoadedHandler=="function"&&window.socketLoadedHandler())));export{$R as C,sO as D,at as G,pk as I,fw as M,Ns as S,$I as a,LI as b,WI as c,Ei as d,pne as e,Gm as f,su as g,cx as h,gne as j,d_ as m,zn as u,ft as z}; +`),v=y.match(/\/\*{7}\s*\(ext=(\w+)\/engine=([^/]+)\/debug=(\w+)\/verbose=(\w+)\/enabled=(\w+)\)\s*\*{7}\//);let _="Javascript/js",$="system.adapter.javascript.0",S=!1,T=!1,E=!1;if(v){const G=v[1];$=v[2],S=v[3]==="true",T=v[4]==="true",E=v[5]==="true",G==="ts"?_="TypeScript/ts":G==="blockly"?_="Blockly":G==="rules"&&(_="Rules")}const D=h.replace(/\.\w+$/,"").replace(/\//g,"."),M=`script.js.${D}`,P=D.split(".").pop()||D,W=M.split(".");for(let G=3;G{d==="permissionError"?this.showJsError(x.I18n.t(d)):!d||d.error?this.showJsError(d?x.I18n.t(d.error||""):x.I18n.t("Unknown error")):this.showMessage(x.I18n.t("Done"))})}}toggleLogLayout(){window.localStorage.setItem("App.logHorzLayout",this.state.logHorzLayout?"false":"true"),this.setState({logHorzLayout:!this.state.logHorzLayout})}renderEditor(){var i;const s=Object.keys(this.scripts).reduce((r,l)=>r+(this.scripts[l].common.engineType==="Rules"?1:0),0);return m.jsx(Rn,{scriptsHash:this.state.scriptsHash,debugMode:this.state.debugMode,onDebugModeChange:r=>{r?this.setState({debugMode:!0}):this.setState({debugMode:!1,debugInstance:null})},visible:!this.state.resizing,socket:this.socket,adapterName:this.adapterName,onLocate:r=>this.setState({menuSelectId:r}),password:this.state.password,runningInstances:this.state.runningInstances,menuOpened:this.state.menuOpened,searchText:this.state.searchText,themeType:this.state.themeType,themeName:this.state.themeName,theme:this.state.theme,expertMode:this.state.expertMode,onChange:(r,l)=>this.onUpdateScript(r,l),isAnyRulesExists:s,debugInstance:this.state.debugInstance,onSelectedChange:(r,l)=>{const c={};let d=!1;r!==this.state.selected&&(d=!0,c.selected=r),JSON.stringify(l)!==JSON.stringify(this.state.editing)&&(d=!0,c.editing=[...l]),d&&this.setState(c)},onRestart:r=>this.socket.extendObject(r,{common:{enabled:!0}}),selected:this.state.selected&&((i=this.scripts[this.state.selected])==null?void 0:i.type)==="script"?this.state.selected:"",objects:this.scripts,resizing:this.state.resizing,onChangedChanged:r=>this.changedScripts=r},"editor")}showLogButton(){return m.jsx(wt,{title:x.I18n.t("Show logs"),sx:Gr.showLogButton,onClick:()=>{window.localStorage.setItem("App.hideLog","false"),this.setState({hideLog:!1,resizing:!0}),setTimeout(()=>this.setState({resizing:!1}),300)},children:m.jsx(SS,{})},"showLog")}renderErrorDialog(){return this.state.errorText?m.jsx(su,{onClose:()=>this.setState({errorText:""}),text:this.state.errorText},"dialogError"):null}renderMain(){let s;return this.state.debugMode||this.state.hideLog?s=m.jsxs(m.Fragment,{children:[!this.state.debugMode&&this.state.hideLog?this.showLogButton():void 0,this.renderEditor()]}):s=m.jsxs(d_,{direction:this.state.logHorzLayout?ft.Horizontal:ft.Vertical,initialSizes:this.state.logSizes,minWidths:[500,100],minHeights:[150,50],onResizeStarted:()=>this.setState({resizing:!0}),onResizeFinished:(i,r)=>{this.setState({logSizes:r,resizing:!1}),window.localStorage.setItem("JS.logSizes",JSON.stringify(r))},gutterClassName:this.state.themeType==="dark"?"Dark visGutter":"Light visGutter",children:[this.renderEditor(),m.jsx(wm,{verticalLayout:!this.state.logHorzLayout,onLayoutChange:()=>this.toggleLogLayout(),editing:this.state.editing,socket:this.socket,selected:this.state.selected,onHideLog:()=>{window.localStorage.setItem("App.hideLog","true"),this.setState({hideLog:!0,resizing:!0}),setTimeout(()=>this.setState({resizing:!1}),300)}},"log")]}),m.jsxs(wt,{sx:Gr.content,className:"iobVerticalSplitter",children:[m.jsx(wt,{sx:Gr.menuOpenCloseButton,onClick:()=>{window.localStorage.setItem("App.menuOpened",this.state.menuOpened?"false":"true"),this.setState({menuOpened:!this.state.menuOpened,resizing:!0}),setTimeout(()=>this.setState({resizing:!1}),300)},children:this.state.menuOpened?m.jsx(ES,{}):m.jsx(IS,{})},"closeMenu"),this.state.message?m.jsx(x.Message,{onClose:()=>this.setState({message:""}),text:this.state.message},"dialogMessage"):null,this.renderErrorDialog(),this.state.importFile?m.jsx(Hm,{onClose:(i,r)=>this.onImport(i,r)},"dialogImportFile"):null,this.state.confirm?m.jsx(x.Confirm,{onClose:i=>{this.state.confirm&&this.setState({confirm:""}),this.confirmCallback&&this.confirmCallback(i),this.confirmCallback=null},text:this.state.confirm},"dialogConfirm"):null,this.renderPasswordDialog(),s]},"main")}render(){if(!this.state.ready)return m.jsx(a_,{injectFirst:!0,children:m.jsx(l_,{theme:this.state.theme,children:m.jsx(x.Loader,{themeType:this.state.themeType})})});let s;return this.state.menuOpened?s=m.jsxs(d_,{direction:ft.Horizontal,initialSizes:this.state.splitSizes,minWidths:[270,400],onResizeFinished:(i,r)=>{this.setState({splitSizes:r}),window.localStorage.setItem("JS.splitSizes",JSON.stringify(r))},gutterClassName:this.state.themeType==="dark"?"Dark visGutter":"Light visGutter",children:[m.jsx("div",{style:Gr.mainDiv,children:m.jsx(So,{password:this.state.password,debugMode:this.state.debugMode,onDebugInstance:i=>this.setState({debugInstance:i,debugMode:!!i}),scripts:this.scripts,scriptsHash:this.state.scriptsHash,instances:this.state.instances,onRename:this.onRename.bind(this),socket:this.socket,selectId:this.state.menuSelectId,onEdit:this.onEdit.bind(this),expertMode:this.state.expertMode,themeName:this.state.themeName,onThemeChange:i=>{x.Utils.setThemeName(i);const r=x.Utils.getThemeType(i);this.setState({themeName:i,themeType:r},()=>this.toggleTheme(i))},runningInstances:this.state.runningInstances,onExpertModeChange:i=>this.onExpertModeChange(i),onDelete:this.onDelete.bind(this),onAddNew:this.onAddNew.bind(this),onEnableDisable:this.onEnableDisable.bind(this),onExport:this.onExport.bind(this),width:500,onImport:()=>this.setState({importFile:!0}),onSearch:i=>this.setState({searchText:i}),version:this.props.version,changedScripts:this.changedScripts},"sidemenu")},"menu"),this.renderMain()]}):s=this.renderMain(),m.jsx(a_,{injectFirst:!0,children:m.jsx(l_,{theme:this.state.theme,children:m.jsx("div",{style:Gr.root,children:m.jsx(bO,{socket:this.socket,children:s})})})})}}window.location.hostname==="localhost"||window.location.hostname==="[::1]"||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/);function _se(){"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(a=>{a.unregister()})}const wse="9.1.1",OC={version:wse};var Jo;(function(a){a.mouse="mouse",a.touch="touch",a.keyboard="keyboard"})(Jo||(Jo={}));class kse{get delay(){var s;return(s=this.args.delay)!==null&&s!==void 0?s:0}get scrollAngleRanges(){return this.args.scrollAngleRanges}get getDropTargetElementsAtPoint(){return this.args.getDropTargetElementsAtPoint}get ignoreContextMenu(){var s;return(s=this.args.ignoreContextMenu)!==null&&s!==void 0?s:!1}get enableHoverOutsideTarget(){var s;return(s=this.args.enableHoverOutsideTarget)!==null&&s!==void 0?s:!1}get enableKeyboardEvents(){var s;return(s=this.args.enableKeyboardEvents)!==null&&s!==void 0?s:!1}get enableMouseEvents(){var s;return(s=this.args.enableMouseEvents)!==null&&s!==void 0?s:!1}get enableTouchEvents(){var s;return(s=this.args.enableTouchEvents)!==null&&s!==void 0?s:!0}get touchSlop(){return this.args.touchSlop||0}get delayTouchStart(){var s,i,r,l;return(l=(r=(s=this.args)===null||s===void 0?void 0:s.delayTouchStart)!==null&&r!==void 0?r:(i=this.args)===null||i===void 0?void 0:i.delay)!==null&&l!==void 0?l:0}get delayMouseStart(){var s,i,r,l;return(l=(r=(s=this.args)===null||s===void 0?void 0:s.delayMouseStart)!==null&&r!==void 0?r:(i=this.args)===null||i===void 0?void 0:i.delay)!==null&&l!==void 0?l:0}get window(){if(this.context&&this.context.window)return this.context.window;if(typeof window<"u")return window}get document(){var s;if(!((s=this.context)===null||s===void 0)&&s.document)return this.context.document;if(this.window)return this.window.document}get rootElement(){var s;return((s=this.args)===null||s===void 0?void 0:s.rootElement)||this.document}constructor(s,i){this.args=s,this.context=i}}function Cse(a,s,i,r){return Math.sqrt(Math.pow(Math.abs(i-a),2)+Math.pow(Math.abs(r-s),2))}function Tse(a,s,i,r,l){if(!l)return!1;const c=Math.atan2(r-s,i-a)*180/Math.PI+180;for(let d=0;d=h.start)&&(h.end==null||c<=h.end))return!0}return!1}const Sse={Left:1},Ese={Left:0};function Eg(a){return a.button===void 0||a.button===Ese.Left}function Ise(a){return a.buttons===void 0||(a.buttons&Sse.Left)===0}function NC(a){return!!a.targetTouches}const xse=1;function Dse(a){const s=a.nodeType===xse?a:a.parentElement;if(!s)return;const{top:i,left:r}=s.getBoundingClientRect();return{x:r,y:i}}function Ase(a,s){if(a.targetTouches.length===1)return Kc(a.targetTouches[0]);if(s&&a.touches.length===1&&a.touches[0].target===s.target)return Kc(a.touches[0])}function Kc(a,s){return NC(a)?Ase(a,s):{x:a.clientX,y:a.clientY}}const kw=(()=>{let a=!1;try{addEventListener("test",()=>{},Object.defineProperty({},"passive",{get(){return a=!0,!0}}))}catch{}return a})(),Vr={[Jo.mouse]:{start:"mousedown",move:"mousemove",end:"mouseup",contextmenu:"contextmenu"},[Jo.touch]:{start:"touchstart",move:"touchmove",end:"touchend"},[Jo.keyboard]:{keydown:"keydown"}};class Zr{profile(){var s;return{sourceNodes:this.sourceNodes.size,sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,targetNodes:this.targetNodes.size,dragOverTargetIds:((s=this.dragOverTargetIds)===null||s===void 0?void 0:s.length)||0}}get document(){return this.options.document}setup(){const s=this.options.rootElement;s&&(Ve(!Zr.isSetUp,"Cannot have two Touch backends at the same time."),Zr.isSetUp=!0,this.addEventListener(s,"start",this.getTopMoveStartHandler()),this.addEventListener(s,"start",this.handleTopMoveStartCapture,!0),this.addEventListener(s,"move",this.handleTopMove),this.addEventListener(s,"move",this.handleTopMoveCapture,!0),this.addEventListener(s,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.addEventListener(s,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.addEventListener(s,"keydown",this.handleCancelOnEscape,!0))}teardown(){const s=this.options.rootElement;s&&(Zr.isSetUp=!1,this._mouseClientOffset={},this.removeEventListener(s,"start",this.handleTopMoveStartCapture,!0),this.removeEventListener(s,"start",this.handleTopMoveStart),this.removeEventListener(s,"move",this.handleTopMoveCapture,!0),this.removeEventListener(s,"move",this.handleTopMove),this.removeEventListener(s,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.removeEventListener(s,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.removeEventListener(s,"keydown",this.handleCancelOnEscape,!0),this.uninstallSourceNodeRemovalObserver())}addEventListener(s,i,r,l=!1){const c=kw?{capture:l,passive:!1}:l;this.listenerTypes.forEach(function(d){const h=Vr[d][i];h&&s.addEventListener(h,r,c)})}removeEventListener(s,i,r,l=!1){const c=kw?{capture:l,passive:!1}:l;this.listenerTypes.forEach(function(d){const h=Vr[d][i];h&&s.removeEventListener(h,r,c)})}connectDragSource(s,i){const r=this.handleMoveStart.bind(this,s);return this.sourceNodes.set(s,i),this.addEventListener(i,"start",r),()=>{this.sourceNodes.delete(s),this.removeEventListener(i,"start",r)}}connectDragPreview(s,i,r){return this.sourcePreviewNodeOptions.set(s,r),this.sourcePreviewNodes.set(s,i),()=>{this.sourcePreviewNodes.delete(s),this.sourcePreviewNodeOptions.delete(s)}}connectDropTarget(s,i){const r=this.options.rootElement;if(!this.document||!r)return()=>{};const l=c=>{if(!this.document||!r||!this.monitor.isDragging())return;let d;switch(c.type){case Vr.mouse.move:d={x:c.clientX,y:c.clientY};break;case Vr.touch.move:var h,p;d={x:((h=c.touches[0])===null||h===void 0?void 0:h.clientX)||0,y:((p=c.touches[0])===null||p===void 0?void 0:p.clientY)||0};break}const f=d!=null?this.document.elementFromPoint(d.x,d.y):void 0,b=f&&i.contains(f);if(f===i||b)return this.handleMove(c,s)};return this.addEventListener(this.document.body,"move",l),this.targetNodes.set(s,i),()=>{this.document&&(this.targetNodes.delete(s),this.removeEventListener(this.document.body,"move",l))}}getTopMoveStartHandler(){return!this.options.delayTouchStart&&!this.options.delayMouseStart?this.handleTopMoveStart:this.handleTopMoveStartDelay}installSourceNodeRemovalObserver(s){this.uninstallSourceNodeRemovalObserver(),this.draggedSourceNode=s,this.draggedSourceNodeRemovalObserver=new MutationObserver(()=>{s&&!s.parentElement&&(this.resurrectSourceNode(),this.uninstallSourceNodeRemovalObserver())}),!(!s||!s.parentElement)&&this.draggedSourceNodeRemovalObserver.observe(s.parentElement,{childList:!0})}resurrectSourceNode(){this.document&&this.draggedSourceNode&&(this.draggedSourceNode.style.display="none",this.draggedSourceNode.removeAttribute("data-reactid"),this.document.body.appendChild(this.draggedSourceNode))}uninstallSourceNodeRemovalObserver(){this.draggedSourceNodeRemovalObserver&&this.draggedSourceNodeRemovalObserver.disconnect(),this.draggedSourceNodeRemovalObserver=void 0,this.draggedSourceNode=void 0}constructor(s,i,r){this.getSourceClientOffset=l=>{const c=this.sourceNodes.get(l);return c&&Dse(c)},this.handleTopMoveStartCapture=l=>{Eg(l)&&(this.moveStartSourceIds=[])},this.handleMoveStart=l=>{Array.isArray(this.moveStartSourceIds)&&this.moveStartSourceIds.unshift(l)},this.handleTopMoveStart=l=>{if(!Eg(l))return;const c=Kc(l);c&&(NC(l)&&(this.lastTargetTouchFallback=l.targetTouches[0]),this._mouseClientOffset=c),this.waitingForDelay=!1},this.handleTopMoveStartDelay=l=>{if(!Eg(l))return;const c=l.type===Vr.touch.start?this.options.delayTouchStart:this.options.delayMouseStart;this.timeout=setTimeout(this.handleTopMoveStart.bind(this,l),c),this.waitingForDelay=!0},this.handleTopMoveCapture=()=>{this.dragOverTargetIds=[]},this.handleMove=(l,c)=>{this.dragOverTargetIds&&this.dragOverTargetIds.unshift(c)},this.handleTopMove=l=>{if(this.timeout&&clearTimeout(this.timeout),!this.document||this.waitingForDelay)return;const{moveStartSourceIds:c,dragOverTargetIds:d}=this,h=this.options.enableHoverOutsideTarget,p=Kc(l,this.lastTargetTouchFallback);if(!p)return;if(this._isScrolling||!this.monitor.isDragging()&&Tse(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,p.x,p.y,this.options.scrollAngleRanges)){this._isScrolling=!0;return}if(!this.monitor.isDragging()&&this._mouseClientOffset.hasOwnProperty("x")&&c&&Cse(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,p.x,p.y)>(this.options.touchSlop?this.options.touchSlop:0)&&(this.moveStartSourceIds=void 0,this.actions.beginDrag(c,{clientOffset:this._mouseClientOffset,getSourceClientOffset:this.getSourceClientOffset,publishSource:!1})),!this.monitor.isDragging())return;const f=this.sourceNodes.get(this.monitor.getSourceId());this.installSourceNodeRemovalObserver(f),this.actions.publishDragSource(),l.cancelable&&l.preventDefault();const b=(d||[]).map(_=>this.targetNodes.get(_)).filter(_=>!!_),y=this.options.getDropTargetElementsAtPoint?this.options.getDropTargetElementsAtPoint(p.x,p.y,b):this.document.elementsFromPoint(p.x,p.y),w=[];for(const _ in y){if(!y.hasOwnProperty(_))continue;let $=y[_];for($!=null&&w.push($);$;)$=$.parentElement,$&&w.indexOf($)===-1&&w.push($)}const v=w.filter(_=>b.indexOf(_)>-1).map(_=>this._getDropTargetId(_)).filter(_=>!!_).filter((_,$,S)=>S.indexOf(_)===$);if(h)for(const _ in this.targetNodes){const $=this.targetNodes.get(_);if(f&&$&&$.contains(f)&&v.indexOf(_)===-1){v.unshift(_);break}}v.reverse(),this.actions.hover(v,{clientOffset:p})},this._getDropTargetId=l=>{const c=this.targetNodes.keys();let d=c.next();for(;d.done===!1;){const h=d.value;if(l===this.targetNodes.get(h))return h;d=c.next()}},this.handleTopMoveEndCapture=l=>{if(this._isScrolling=!1,this.lastTargetTouchFallback=void 0,!!Ise(l)){if(!this.monitor.isDragging()||this.monitor.didDrop()){this.moveStartSourceIds=void 0;return}l.cancelable&&l.preventDefault(),this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.drop(),this.actions.endDrag()}},this.handleCancelOnEscape=l=>{l.key==="Escape"&&this.monitor.isDragging()&&(this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.endDrag())},this.options=new kse(r,i),this.actions=s.getActions(),this.monitor=s.getMonitor(),this.sourceNodes=new Map,this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.targetNodes=new Map,this.listenerTypes=[],this._mouseClientOffset={},this._isScrolling=!1,this.options.enableMouseEvents&&this.listenerTypes.push(Jo.mouse),this.options.enableTouchEvents&&this.listenerTypes.push(Jo.touch),this.options.enableKeyboardEvents&&this.listenerTypes.push(Jo.keyboard)}}const Rse=function(s,i={},r={}){return new Zr(s,i,r)};window.GenericBlock=at;window.adapterName="javascript";window.sentryDSN="https://504499a725eb4898930d3b9e9da95740@sentry.iobroker.net/56";console.log(`iobroker.${window.adapterName}@${OC.version}`);const Ose=window.innerWidth<600,Cw=document.getElementById("root");Cw&&jw(Cw).render(m.jsx(ek,{backend:Ose?Rse:hk,children:m.jsx(yse,{version:OC.version})}));_se();const gc=window.loadDynamicScript;gc&&gc(window.location.port==="3000"?`${window.location.protocol}//${window.location.hostname}:8081/lib/js/socket.io.js`:"./../../lib/js/socket.io.js",()=>gc("vs/loader.js",()=>gc("vs/configure.js",()=>typeof window.socketLoadedHandler=="function"&&window.socketLoadedHandler())));export{$O as C,sR as D,at as G,pk as I,fw as M,Ns as S,$I as a,LI as b,WI as c,Ei as d,Cne as e,Gm as f,su as g,cx as h,Tne as j,d_ as m,zn as u,ft as z}; diff --git a/admin/assets/index-C9EIOjDT.js b/admin/assets/index-ns4mNOlq.js similarity index 99% rename from admin/assets/index-C9EIOjDT.js rename to admin/assets/index-ns4mNOlq.js index 72e08a5c7..d39ef0dfa 100644 --- a/admin/assets/index-C9EIOjDT.js +++ b/admin/assets/index-ns4mNOlq.js @@ -1,4 +1,4 @@ -import{j as M}from"./createSvgIcon-DPvF8xqu.js";import{a as ft}from"./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js";import{m as Rt,z as Bt,g as Ut}from"./index-Bm6wEaaB.js";import{z as Ze,o as Te,v as Nt,w as Mt,s as Lt,u as Vt,r as zt,_ as Ht,a as Gt,C as Pt,D as _t,F as Yt,G as wt,H as Qt}from"./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js";import{M as Zt,k as Xt,l as ea,O as Tt,S as ta,J as aa,n as ra,t as na,v as sa,u as oa,T as ia,U as la,V as ca,W as ua}from"./index-C49cpVll.js";import{_ as we}from"./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js";import pa from"./ScriptEditorVanillaMonaco-DSYvOslZ.js";import{r as fa}from"./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js";function da(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}import"./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js";import"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js";import"./preload-helper-BDBacUwf.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js";import"./inheritsLoose-B0Ba5G9z.js";const ba={editorDiv:{height:"100%",width:"100%",overflow:"hidden",position:"relative"}};class ha extends ft.Component{constructor(v){super(v),this.state={lines:(this.props.script||"").split(/\r\n|\n/)}}render(){return M.jsx("div",{style:ba.editorDiv,children:M.jsx(pa,{triggerPrettier:1,name:this.props.scriptName,adapterName:this.props.adapterName,readOnly:!0,code:this.props.script||"",isDark:this.props.themeType==="dark",socket:this.props.socket,runningInstances:this.props.runningInstances,language:"javascript",breakpoints:this.props.breakpoints,location:this.props.paused?this.props.location:null,onToggleBreakpoint:v=>this.props.onToggleBreakpoint(v)},"scriptEditor2")},"scriptEditorDiv2")}}const Dt=34,Ke={logBox:{width:"100%",height:"100%",position:"relative",overflow:"hidden"},logBoxInner:Z=>({display:"inline-block",color:Z.palette.mode==="dark"?"white":"black",width:`calc(100% - ${Dt}px)`,height:"100%",overflow:"auto",position:"relative",verticalAlign:"top"}),info:Z=>({background:Z.palette.mode==="dark"?"darkgrey":"lightgrey",color:(Z.palette.mode==="dark","black")}),error:Z=>({background:"#FF0000",color:Z.palette.mode==="dark"?"black":"white"}),warn:Z=>({background:"#FF8000",color:Z.palette.mode==="dark"?"black":"white"}),debug:Z=>({background:"gray",opacity:.8,color:Z.palette.mode==="dark"?"black":"white"}),silly:Z=>({background:"gray",opacity:.6,color:Z.palette.mode==="dark"?"black":"white"}),table:{fontFamily:"monospace",width:"100%"},toolbox:{width:Dt,height:"100%",boxShadow:"2px 0px 4px -1px rgba(0, 0, 0, 0.2), 4px 0px 5px 0px rgba(0, 0, 0, 0.14), 1px 0px 10px 0px rgba(0, 0, 0, 0.12)",display:"inline-block",verticalAlign:"top",overflow:"hidden"},trTime:{width:90},trSeverity:{width:40,fontWeight:"bold"},iconButtons:{width:32,height:32,padding:4}};function ma(Z){let v,g=Z.getHours();return g<10&&(g=`0${g.toString()}`),v=`${g}:`,g=Z.getMinutes(),g<10&&(g=`0${g.toString()}`),v+=`${g}:`,g=Z.getSeconds(),g<10&&(g=`0${g.toString()}`),v+=`${g}.`,g=Z.getMilliseconds(),g<10?g=`00${g.toString()}`:g<100&&(g=`0${g.toString()}`),v+=g,v}class Ct extends ft.Component{messagesEnd;constructor(v){super(v),this.state={goBottom:!0},this.messagesEnd=ft.createRef()}static generateLine(v){return M.jsxs(Ze,{component:"tr",sx:Ke[v.severity],children:[M.jsx("td",{style:Ke.trTime,children:ma(new Date(v.ts))}),M.jsx("td",{style:Ke.trSeverity,children:v.severity}),M.jsx("td",{children:v.text})]},`tr_${v.ts}_${v.text.substring(v.text.length-10,v.text.length)}`)}renderLogList(v){return v!=null&&v.length?M.jsxs(Ze,{sx:Ke.logBoxInner,children:[M.jsx("table",{style:Ke.table,children:M.jsx("tbody",{children:v.map(g=>Ct.generateLine(g))})},"logTable"),M.jsx("div",{ref:this.messagesEnd,style:{float:"left",clear:"both"}},"logScrollPoint")]},"logList"):M.jsx(Ze,{sx:Ke.logBoxInner,style:{paddingLeft:10},children:we.I18n.t("Log outputs")},"logList")}onCopy(){we.Utils.copyToClipboard(this.props.console.join(` +import{j as M}from"./createSvgIcon-DPvF8xqu.js";import{a as ft}from"./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js";import{m as Rt,z as Bt,g as Ut}from"./index-bny2V8S2.js";import{z as Ze,o as Te,v as Nt,w as Mt,s as Lt,u as Vt,r as zt,_ as Ht,a as Gt,C as Pt,D as _t,F as Yt,G as wt,H as Qt}from"./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js";import{M as Zt,k as Xt,l as ea,O as Tt,S as ta,J as aa,n as ra,t as na,v as sa,u as oa,T as ia,U as la,V as ca,W as ua}from"./index-C49cpVll.js";import{_ as we}from"./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js";import pa from"./ScriptEditorVanillaMonaco-DSYvOslZ.js";import{r as fa}from"./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js";function da(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}import"./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js";import"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-s4ROfmWJ.js";import"./preload-helper-BDBacUwf.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js";import"./inheritsLoose-B0Ba5G9z.js";const ba={editorDiv:{height:"100%",width:"100%",overflow:"hidden",position:"relative"}};class ha extends ft.Component{constructor(v){super(v),this.state={lines:(this.props.script||"").split(/\r\n|\n/)}}render(){return M.jsx("div",{style:ba.editorDiv,children:M.jsx(pa,{triggerPrettier:1,name:this.props.scriptName,adapterName:this.props.adapterName,readOnly:!0,code:this.props.script||"",isDark:this.props.themeType==="dark",socket:this.props.socket,runningInstances:this.props.runningInstances,language:"javascript",breakpoints:this.props.breakpoints,location:this.props.paused?this.props.location:null,onToggleBreakpoint:v=>this.props.onToggleBreakpoint(v)},"scriptEditor2")},"scriptEditorDiv2")}}const Dt=34,Ke={logBox:{width:"100%",height:"100%",position:"relative",overflow:"hidden"},logBoxInner:Z=>({display:"inline-block",color:Z.palette.mode==="dark"?"white":"black",width:`calc(100% - ${Dt}px)`,height:"100%",overflow:"auto",position:"relative",verticalAlign:"top"}),info:Z=>({background:Z.palette.mode==="dark"?"darkgrey":"lightgrey",color:(Z.palette.mode==="dark","black")}),error:Z=>({background:"#FF0000",color:Z.palette.mode==="dark"?"black":"white"}),warn:Z=>({background:"#FF8000",color:Z.palette.mode==="dark"?"black":"white"}),debug:Z=>({background:"gray",opacity:.8,color:Z.palette.mode==="dark"?"black":"white"}),silly:Z=>({background:"gray",opacity:.6,color:Z.palette.mode==="dark"?"black":"white"}),table:{fontFamily:"monospace",width:"100%"},toolbox:{width:Dt,height:"100%",boxShadow:"2px 0px 4px -1px rgba(0, 0, 0, 0.2), 4px 0px 5px 0px rgba(0, 0, 0, 0.14), 1px 0px 10px 0px rgba(0, 0, 0, 0.12)",display:"inline-block",verticalAlign:"top",overflow:"hidden"},trTime:{width:90},trSeverity:{width:40,fontWeight:"bold"},iconButtons:{width:32,height:32,padding:4}};function ma(Z){let v,g=Z.getHours();return g<10&&(g=`0${g.toString()}`),v=`${g}:`,g=Z.getMinutes(),g<10&&(g=`0${g.toString()}`),v+=`${g}:`,g=Z.getSeconds(),g<10&&(g=`0${g.toString()}`),v+=`${g}.`,g=Z.getMilliseconds(),g<10?g=`00${g.toString()}`:g<100&&(g=`0${g.toString()}`),v+=g,v}class Ct extends ft.Component{messagesEnd;constructor(v){super(v),this.state={goBottom:!0},this.messagesEnd=ft.createRef()}static generateLine(v){return M.jsxs(Ze,{component:"tr",sx:Ke[v.severity],children:[M.jsx("td",{style:Ke.trTime,children:ma(new Date(v.ts))}),M.jsx("td",{style:Ke.trSeverity,children:v.severity}),M.jsx("td",{children:v.text})]},`tr_${v.ts}_${v.text.substring(v.text.length-10,v.text.length)}`)}renderLogList(v){return v!=null&&v.length?M.jsxs(Ze,{sx:Ke.logBoxInner,children:[M.jsx("table",{style:Ke.table,children:M.jsx("tbody",{children:v.map(g=>Ct.generateLine(g))})},"logTable"),M.jsx("div",{ref:this.messagesEnd,style:{float:"left",clear:"both"}},"logScrollPoint")]},"logList"):M.jsx(Ze,{sx:Ke.logBoxInner,style:{paddingLeft:10},children:we.I18n.t("Log outputs")},"logList")}onCopy(){we.Utils.copyToClipboard(this.props.console.join(` `))}scrollToBottom(){var v,g;(g=(v=this.messagesEnd)==null?void 0:v.current)==null||g.scrollIntoView({behavior:"smooth"})}componentDidUpdate(){this.state.goBottom&&this.scrollToBottom()}render(){const v=this.props.console;return M.jsxs("div",{style:Ke.logBox,children:[M.jsxs("div",{style:Ke.toolbox,children:[M.jsx(Te,{style:Ke.iconButtons,onClick:()=>this.setState({goBottom:!this.state.goBottom}),color:this.state.goBottom?"secondary":void 0,size:"medium",children:M.jsx(Zt,{})}),v!=null&&v.length?M.jsx(Te,{style:Ke.iconButtons,onClick:()=>this.props.onClearAllLogs(),size:"medium",children:M.jsx(Xt,{})}):null,v!=null&&v.length?M.jsx(Te,{style:Ke.iconButtons,onClick:()=>this.onCopy(),size:"medium",children:M.jsx(ea,{})}):null]},"toolbox"),this.renderLogList(v)]})}}var It={exports:{}},va=It.exports;(function(Z,v){(function(g,a){Z.exports=a(fa)})(va,(function(g){return(function(a){var t={};function e(s){if(t[s])return t[s].exports;var c=t[s]={i:s,l:!1,exports:{}};return a[s].call(c.exports,c,c.exports,e),c.l=!0,c.exports}return e.m=a,e.c=t,e.d=function(s,c,d){e.o(s,c)||Object.defineProperty(s,c,{enumerable:!0,get:d})},e.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},e.t=function(s,c){if(1&c&&(s=e(s)),8&c||4&c&&typeof s=="object"&&s&&s.__esModule)return s;var d=Object.create(null);if(e.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:s}),2&c&&typeof s!="string")for(var p in s)e.d(d,p,function(f){return s[f]}.bind(null,p));return d},e.n=function(s){var c=s&&s.__esModule?function(){return s.default}:function(){return s};return e.d(c,"a",c),c},e.o=function(s,c){return Object.prototype.hasOwnProperty.call(s,c)},e.p="",e(e.s=48)})([function(a,t){a.exports=g},function(a,t){var e=a.exports={version:"2.6.12"};typeof __e=="number"&&(__e=e)},function(a,t,e){var s=e(26)("wks"),c=e(17),d=e(3).Symbol,p=typeof d=="function";(a.exports=function(f){return s[f]||(s[f]=p&&d[f]||(p?d:c)("Symbol."+f))}).store=s},function(a,t){var e=a.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=e)},function(a,t,e){a.exports=!e(8)((function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7}))},function(a,t){var e={}.hasOwnProperty;a.exports=function(s,c){return e.call(s,c)}},function(a,t,e){var s=e(7),c=e(16);a.exports=e(4)?function(d,p,f){return s.f(d,p,c(1,f))}:function(d,p,f){return d[p]=f,d}},function(a,t,e){var s=e(10),c=e(35),d=e(23),p=Object.defineProperty;t.f=e(4)?Object.defineProperty:function(f,h,S){if(s(f),h=d(h,!0),s(S),c)try{return p(f,h,S)}catch{}if("get"in S||"set"in S)throw TypeError("Accessors not supported!");return"value"in S&&(f[h]=S.value),f}},function(a,t){a.exports=function(e){try{return!!e()}catch{return!0}}},function(a,t,e){var s=e(40),c=e(22);a.exports=function(d){return s(c(d))}},function(a,t,e){var s=e(11);a.exports=function(c){if(!s(c))throw TypeError(c+" is not an object!");return c}},function(a,t){a.exports=function(e){return typeof e=="object"?e!==null:typeof e=="function"}},function(a,t){a.exports={}},function(a,t,e){var s=e(39),c=e(27);a.exports=Object.keys||function(d){return s(d,c)}},function(a,t){a.exports=!0},function(a,t,e){var s=e(3),c=e(1),d=e(53),p=e(6),f=e(5),h=function(S,b,w){var I,R,H,L=S&h.F,X=S&h.G,r=S&h.S,D=S&h.P,V=S&h.B,z=S&h.W,q=X?c:c[b]||(c[b]={}),k=q.prototype,A=X?s:r?s[b]:(s[b]||{}).prototype;for(I in X&&(w=b),w)(R=!L&&A&&A[I]!==void 0)&&f(q,I)||(H=R?A[I]:w[I],q[I]=X&&typeof A[I]!="function"?w[I]:V&&R?d(H,s):z&&A[I]==H?(function(T){var W=function(E,ee,J){if(this instanceof T){switch(arguments.length){case 0:return new T;case 1:return new T(E);case 2:return new T(E,ee)}return new T(E,ee,J)}return T.apply(this,arguments)};return W.prototype=T.prototype,W})(H):D&&typeof H=="function"?d(Function.call,H):H,D&&((q.virtual||(q.virtual={}))[I]=H,S&h.R&&k&&!k[I]&&p(k,I,H)))};h.F=1,h.G=2,h.S=4,h.P=8,h.B=16,h.W=32,h.U=64,h.R=128,a.exports=h},function(a,t){a.exports=function(e,s){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:s}}},function(a,t){var e=0,s=Math.random();a.exports=function(c){return"Symbol(".concat(c===void 0?"":c,")_",(++e+s).toString(36))}},function(a,t,e){var s=e(22);a.exports=function(c){return Object(s(c))}},function(a,t){t.f={}.propertyIsEnumerable},function(a,t,e){var s=e(52)(!0);e(34)(String,"String",(function(c){this._t=String(c),this._i=0}),(function(){var c,d=this._t,p=this._i;return p>=d.length?{value:void 0,done:!0}:(c=s(d,p),this._i+=c.length,{value:c,done:!1})}))},function(a,t){var e=Math.ceil,s=Math.floor;a.exports=function(c){return isNaN(c=+c)?0:(c>0?s:e)(c)}},function(a,t){a.exports=function(e){if(e==null)throw TypeError("Can't call method on "+e);return e}},function(a,t,e){var s=e(11);a.exports=function(c,d){if(!s(c))return c;var p,f;if(d&&typeof(p=c.toString)=="function"&&!s(f=p.call(c))||typeof(p=c.valueOf)=="function"&&!s(f=p.call(c))||!d&&typeof(p=c.toString)=="function"&&!s(f=p.call(c)))return f;throw TypeError("Can't convert object to primitive value")}},function(a,t){var e={}.toString;a.exports=function(s){return e.call(s).slice(8,-1)}},function(a,t,e){var s=e(26)("keys"),c=e(17);a.exports=function(d){return s[d]||(s[d]=c(d))}},function(a,t,e){var s=e(1),c=e(3),d=c["__core-js_shared__"]||(c["__core-js_shared__"]={});(a.exports=function(p,f){return d[p]||(d[p]=f!==void 0?f:{})})("versions",[]).push({version:s.version,mode:e(14)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(a,t){a.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(a,t,e){var s=e(7).f,c=e(5),d=e(2)("toStringTag");a.exports=function(p,f,h){p&&!c(p=h?p:p.prototype,d)&&s(p,d,{configurable:!0,value:f})}},function(a,t,e){e(62);for(var s=e(3),c=e(6),d=e(12),p=e(2)("toStringTag"),f="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),h=0;hdocument.F=Object<\/script>"),S.close(),h=S.F;w--;)delete h.prototype[d[w]];return h()};a.exports=Object.create||function(S,b){var w;return S!==null?(f.prototype=s(S),w=new f,f.prototype=null,w[p]=S):w=h(),b===void 0?w:c(w,b)}},function(a,t,e){var s=e(5),c=e(9),d=e(57)(!1),p=e(25)("IE_PROTO");a.exports=function(f,h){var S,b=c(f),w=0,I=[];for(S in b)S!=p&&s(b,S)&&I.push(S);for(;h.length>w;)s(b,S=h[w++])&&(~d(I,S)||I.push(S));return I}},function(a,t,e){var s=e(24);a.exports=Object("z").propertyIsEnumerable(0)?Object:function(c){return s(c)=="String"?c.split(""):Object(c)}},function(a,t,e){var s=e(39),c=e(27).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(d){return s(d,c)}},function(a,t,e){var s=e(24),c=e(2)("toStringTag"),d=s((function(){return arguments})())=="Arguments";a.exports=function(p){var f,h,S;return p===void 0?"Undefined":p===null?"Null":typeof(h=(function(b,w){try{return b[w]}catch{}})(f=Object(p),c))=="string"?h:d?s(f):(S=s(f))=="Object"&&typeof f.callee=="function"?"Arguments":S}},function(a,t){var e;e=(function(){return this})();try{e=e||new Function("return this")()}catch{typeof window=="object"&&(e=window)}a.exports=e},function(a,t){var e=/-?\d+(\.\d+)?%?/g;a.exports=function(s){return s.match(e)}},function(a,t,e){Object.defineProperty(t,"__esModule",{value:!0}),t.getBase16Theme=t.createStyling=t.invertTheme=void 0;var s=R(e(49)),c=R(e(76)),d=R(e(81)),p=R(e(89)),f=R(e(93)),h=(function(k){if(k&&k.__esModule)return k;var A={};if(k!=null)for(var T in k)Object.prototype.hasOwnProperty.call(k,T)&&(A[T]=k[T]);return A.default=k,A})(e(94)),S=R(e(132)),b=R(e(133)),w=R(e(138)),I=e(139);function R(k){return k&&k.__esModule?k:{default:k}}var H=h.default,L=(0,p.default)(H),X=(0,w.default)(b.default,I.rgb2yuv,(function(k){var A,T=(0,d.default)(k,3),W=T[0],E=T[1],ee=T[2];return[(A=W,A<.25?1:A<.5?.9-A:1.1-A),E,ee]}),I.yuv2rgb,S.default),r=function(k){return function(A){return{className:[A.className,k.className].filter(Boolean).join(" "),style:(0,c.default)({},A.style||{},k.style||{})}}},D=function(k,A){var T=(0,p.default)(A);for(var W in k)T.indexOf(W)===-1&&T.push(W);return T.reduce((function(E,ee){return E[ee]=(function(J,C){if(J===void 0)return C;if(C===void 0)return J;var Y=J===void 0?"undefined":(0,s.default)(J),be=C===void 0?"undefined":(0,s.default)(C);switch(Y){case"string":switch(be){case"string":return[C,J].filter(Boolean).join(" ");case"object":return r({className:J,style:C});case"function":return function(ce){for(var U=arguments.length,le=Array(U>1?U-1:0),Q=1;Q1?U-1:0),Q=1;Q1?U-1:0),Q=1;Q1?U-1:0),Q=1;Q1?U-1:0),Q=1;Q2?T-2:0),E=2;E3?A-3:0),W=3;W1&&arguments[1]!==void 0?arguments[1]:{},ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},J=E.defaultBase16,C=J===void 0?H:J,Y=E.base16Themes,be=Y===void 0?null:Y,ce=q(ee,be);ce&&(ee=(0,c.default)({},ce,ee));var U=L.reduce((function(ve,Ne){return ve[Ne]=ee[Ne]||C[Ne],ve}),{}),le=(0,p.default)(ee).reduce((function(ve,Ne){return L.indexOf(Ne)===-1&&(ve[Ne]=ee[Ne]),ve}),{}),Q=k(U),he=D(le,Q);return(0,f.default)(V,2).apply(void 0,[he].concat(T))}),3),t.getBase16Theme=function(k,A){if(k&&k.extend&&(k=k.extend),typeof k=="string"){var T=k.split(":"),W=(0,d.default)(T,2),E=W[0],ee=W[1];k=(A||{})[E]||h[E],ee==="inverted"&&(k=z(k))}return k&&k.hasOwnProperty("base00")?k:void 0})},function(a,t,e){var s,c=typeof Reflect=="object"?Reflect:null,d=c&&typeof c.apply=="function"?c.apply:function(r,D,V){return Function.prototype.apply.call(r,D,V)};s=c&&typeof c.ownKeys=="function"?c.ownKeys:Object.getOwnPropertySymbols?function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:function(r){return Object.getOwnPropertyNames(r)};var p=Number.isNaN||function(r){return r!=r};function f(){f.init.call(this)}a.exports=f,a.exports.once=function(r,D){return new Promise((function(V,z){function q(){k!==void 0&&r.removeListener("error",k),V([].slice.call(arguments))}var k;D!=="error"&&(k=function(A){r.removeListener(D,q),z(A)},r.once("error",k)),r.once(D,q)}))},f.EventEmitter=f,f.prototype._events=void 0,f.prototype._eventsCount=0,f.prototype._maxListeners=void 0;var h=10;function S(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}function b(r){return r._maxListeners===void 0?f.defaultMaxListeners:r._maxListeners}function w(r,D,V,z){var q,k,A,T;if(S(V),(k=r._events)===void 0?(k=r._events=Object.create(null),r._eventsCount=0):(k.newListener!==void 0&&(r.emit("newListener",D,V.listener?V.listener:V),k=r._events),A=k[D]),A===void 0)A=k[D]=V,++r._eventsCount;else if(typeof A=="function"?A=k[D]=z?[V,A]:[A,V]:z?A.unshift(V):A.push(V),(q=b(r))>0&&A.length>q&&!A.warned){A.warned=!0;var W=new Error("Possible EventEmitter memory leak detected. "+A.length+" "+String(D)+" listeners added. Use emitter.setMaxListeners() to increase limit");W.name="MaxListenersExceededWarning",W.emitter=r,W.type=D,W.count=A.length,T=W,console&&console.warn&&console.warn(T)}return r}function I(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function R(r,D,V){var z={fired:!1,wrapFn:void 0,target:r,type:D,listener:V},q=I.bind(z);return q.listener=V,z.wrapFn=q,q}function H(r,D,V){var z=r._events;if(z===void 0)return[];var q=z[D];return q===void 0?[]:typeof q=="function"?V?[q.listener||q]:[q]:V?(function(k){for(var A=new Array(k.length),T=0;T0&&(k=D[0]),k instanceof Error)throw k;var A=new Error("Unhandled error."+(k?" ("+k.message+")":""));throw A.context=k,A}var T=q[r];if(T===void 0)return!1;if(typeof T=="function")d(T,this,D);else{var W=T.length,E=X(T,W);for(V=0;V=0;k--)if(V[k]===D||V[k].listener===D){A=V[k].listener,q=k;break}if(q<0)return this;q===0?V.shift():(function(T,W){for(;W+1=0;z--)this.removeListener(r,D[z]);return this},f.prototype.listeners=function(r){return H(this,r,!0)},f.prototype.rawListeners=function(r){return H(this,r,!1)},f.listenerCount=function(r,D){return typeof r.listenerCount=="function"?r.listenerCount(D):L.call(r,D)},f.prototype.listenerCount=L,f.prototype.eventNames=function(){return this._eventsCount>0?s(this._events):[]}},function(a,t,e){a.exports.Dispatcher=e(140)},function(a,t,e){a.exports=e(142)},function(a,t,e){t.__esModule=!0;var s=p(e(50)),c=p(e(65)),d=typeof c.default=="function"&&typeof s.default=="symbol"?function(f){return typeof f}:function(f){return f&&typeof c.default=="function"&&f.constructor===c.default&&f!==c.default.prototype?"symbol":typeof f};function p(f){return f&&f.__esModule?f:{default:f}}t.default=typeof c.default=="function"&&d(s.default)==="symbol"?function(f){return f===void 0?"undefined":d(f)}:function(f){return f&&typeof c.default=="function"&&f.constructor===c.default&&f!==c.default.prototype?"symbol":f===void 0?"undefined":d(f)}},function(a,t,e){a.exports={default:e(51),__esModule:!0}},function(a,t,e){e(20),e(29),a.exports=e(30).f("iterator")},function(a,t,e){var s=e(21),c=e(22);a.exports=function(d){return function(p,f){var h,S,b=String(c(p)),w=s(f),I=b.length;return w<0||w>=I?d?"":void 0:(h=b.charCodeAt(w))<55296||h>56319||w+1===I||(S=b.charCodeAt(w+1))<56320||S>57343?d?b.charAt(w):h:d?b.slice(w,w+2):S-56320+(h-55296<<10)+65536}}},function(a,t,e){var s=e(54);a.exports=function(c,d,p){if(s(c),d===void 0)return c;switch(p){case 1:return function(f){return c.call(d,f)};case 2:return function(f,h){return c.call(d,f,h)};case 3:return function(f,h,S){return c.call(d,f,h,S)}}return function(){return c.apply(d,arguments)}}},function(a,t){a.exports=function(e){if(typeof e!="function")throw TypeError(e+" is not a function!");return e}},function(a,t,e){var s=e(38),c=e(16),d=e(28),p={};e(6)(p,e(2)("iterator"),(function(){return this})),a.exports=function(f,h,S){f.prototype=s(p,{next:c(1,S)}),d(f,h+" Iterator")}},function(a,t,e){var s=e(7),c=e(10),d=e(13);a.exports=e(4)?Object.defineProperties:function(p,f){c(p);for(var h,S=d(f),b=S.length,w=0;b>w;)s.f(p,h=S[w++],f[h]);return p}},function(a,t,e){var s=e(9),c=e(58),d=e(59);a.exports=function(p){return function(f,h,S){var b,w=s(f),I=c(w.length),R=d(S,I);if(p&&h!=h){for(;I>R;)if((b=w[R++])!=b)return!0}else for(;I>R;R++)if((p||R in w)&&w[R]===h)return p||R||0;return!p&&-1}}},function(a,t,e){var s=e(21),c=Math.min;a.exports=function(d){return d>0?c(s(d),9007199254740991):0}},function(a,t,e){var s=e(21),c=Math.max,d=Math.min;a.exports=function(p,f){return(p=s(p))<0?c(p+f,0):d(p,f)}},function(a,t,e){var s=e(3).document;a.exports=s&&s.documentElement},function(a,t,e){var s=e(5),c=e(18),d=e(25)("IE_PROTO"),p=Object.prototype;a.exports=Object.getPrototypeOf||function(f){return f=c(f),s(f,d)?f[d]:typeof f.constructor=="function"&&f instanceof f.constructor?f.constructor.prototype:f instanceof Object?p:null}},function(a,t,e){var s=e(63),c=e(64),d=e(12),p=e(9);a.exports=e(34)(Array,"Array",(function(f,h){this._t=p(f),this._i=0,this._k=h}),(function(){var f=this._t,h=this._k,S=this._i++;return!f||S>=f.length?(this._t=void 0,c(1)):c(0,h=="keys"?S:h=="values"?f[S]:[S,f[S]])}),"values"),d.Arguments=d.Array,s("keys"),s("values"),s("entries")},function(a,t){a.exports=function(){}},function(a,t){a.exports=function(e,s){return{value:s,done:!!e}}},function(a,t,e){a.exports={default:e(66),__esModule:!0}},function(a,t,e){e(67),e(73),e(74),e(75),a.exports=e(1).Symbol},function(a,t,e){var s=e(3),c=e(5),d=e(4),p=e(15),f=e(37),h=e(68).KEY,S=e(8),b=e(26),w=e(28),I=e(17),R=e(2),H=e(30),L=e(31),X=e(69),r=e(70),D=e(10),V=e(11),z=e(18),q=e(9),k=e(23),A=e(16),T=e(38),W=e(71),E=e(72),ee=e(32),J=e(7),C=e(13),Y=E.f,be=J.f,ce=W.f,U=s.Symbol,le=s.JSON,Q=le&&le.stringify,he=R("_hidden"),ve=R("toPrimitive"),Ne={}.propertyIsEnumerable,Ee=b("symbol-registry"),Oe=b("symbols"),fe=b("op-symbols"),ge=Object.prototype,De=typeof U=="function"&&!!ee.f,Ue=s.QObject,Xe=!Ue||!Ue.prototype||!Ue.prototype.findChild,et=d&&S((function(){return T(be({},"a",{get:function(){return be(this,"a",{value:7}).a}})).a!=7}))?function(j,N,B){var K=Y(ge,N);K&&delete ge[N],be(j,N,B),K&&j!==ge&&be(ge,N,K)}:be,tt=function(j){var N=Oe[j]=T(U.prototype);return N._k=j,N},at=De&&typeof U.iterator=="symbol"?function(j){return typeof j=="symbol"}:function(j){return j instanceof U},He=function(j,N,B){return j===ge&&He(fe,N,B),D(j),N=k(N,!0),D(B),c(Oe,N)?(B.enumerable?(c(j,he)&&j[he][N]&&(j[he][N]=!1),B=T(B,{enumerable:A(0,!1)})):(c(j,he)||be(j,he,A(1,{})),j[he][N]=!0),et(j,N,B)):be(j,N,B)},st=function(j,N){D(j);for(var B,K=X(N=q(N)),re=0,te=K.length;te>re;)He(j,B=K[re++],N[B]);return j},ot=function(j){var N=Ne.call(this,j=k(j,!0));return!(this===ge&&c(Oe,j)&&!c(fe,j))&&(!(N||!c(this,j)||!c(Oe,j)||c(this,he)&&this[he][j])||N)},rt=function(j,N){if(j=q(j),N=k(N,!0),j!==ge||!c(Oe,N)||c(fe,N)){var B=Y(j,N);return!B||!c(Oe,N)||c(j,he)&&j[he][N]||(B.enumerable=!0),B}},it=function(j){for(var N,B=ce(q(j)),K=[],re=0;B.length>re;)c(Oe,N=B[re++])||N==he||N==h||K.push(N);return K},Ge=function(j){for(var N,B=j===ge,K=ce(B?fe:q(j)),re=[],te=0;K.length>te;)!c(Oe,N=K[te++])||B&&!c(ge,N)||re.push(Oe[N]);return re};De||(f((U=function(){if(this instanceof U)throw TypeError("Symbol is not a constructor!");var j=I(arguments.length>0?arguments[0]:void 0),N=function(B){this===ge&&N.call(fe,B),c(this,he)&&c(this[he],j)&&(this[he][j]=!1),et(this,j,A(1,B))};return d&&Xe&&et(ge,j,{configurable:!0,set:N}),tt(j)}).prototype,"toString",(function(){return this._k})),E.f=rt,J.f=He,e(41).f=W.f=it,e(19).f=ot,ee.f=Ge,d&&!e(14)&&f(ge,"propertyIsEnumerable",ot,!0),H.f=function(j){return tt(R(j))}),p(p.G+p.W+p.F*!De,{Symbol:U});for(var Ve="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),Ce=0;Ve.length>Ce;)R(Ve[Ce++]);for(var nt=C(R.store),F=0;nt.length>F;)L(nt[F++]);p(p.S+p.F*!De,"Symbol",{for:function(j){return c(Ee,j+="")?Ee[j]:Ee[j]=U(j)},keyFor:function(j){if(!at(j))throw TypeError(j+" is not a symbol!");for(var N in Ee)if(Ee[N]===j)return N},useSetter:function(){Xe=!0},useSimple:function(){Xe=!1}}),p(p.S+p.F*!De,"Object",{create:function(j,N){return N===void 0?T(j):st(T(j),N)},defineProperty:He,defineProperties:st,getOwnPropertyDescriptor:rt,getOwnPropertyNames:it,getOwnPropertySymbols:Ge});var x=S((function(){ee.f(1)}));p(p.S+p.F*x,"Object",{getOwnPropertySymbols:function(j){return ee.f(z(j))}}),le&&p(p.S+p.F*(!De||S((function(){var j=U();return Q([j])!="[null]"||Q({a:j})!="{}"||Q(Object(j))!="{}"}))),"JSON",{stringify:function(j){for(var N,B,K=[j],re=1;arguments.length>re;)K.push(arguments[re++]);if(B=N=K[1],(V(N)||j!==void 0)&&!at(j))return r(N)||(N=function(te,ue){if(typeof B=="function"&&(ue=B.call(this,te,ue)),!at(ue))return ue}),K[1]=N,Q.apply(le,K)}}),U.prototype[ve]||e(6)(U.prototype,ve,U.prototype.valueOf),w(U,"Symbol"),w(Math,"Math",!0),w(s.JSON,"JSON",!0)},function(a,t,e){var s=e(17)("meta"),c=e(11),d=e(5),p=e(7).f,f=0,h=Object.isExtensible||function(){return!0},S=!e(8)((function(){return h(Object.preventExtensions({}))})),b=function(I){p(I,s,{value:{i:"O"+ ++f,w:{}}})},w=a.exports={KEY:s,NEED:!1,fastKey:function(I,R){if(!c(I))return typeof I=="symbol"?I:(typeof I=="string"?"S":"P")+I;if(!d(I,s)){if(!h(I))return"F";if(!R)return"E";b(I)}return I[s].i},getWeak:function(I,R){if(!d(I,s)){if(!h(I))return!0;if(!R)return!1;b(I)}return I[s].w},onFreeze:function(I){return S&&w.NEED&&h(I)&&!d(I,s)&&b(I),I}}},function(a,t,e){var s=e(13),c=e(32),d=e(19);a.exports=function(p){var f=s(p),h=c.f;if(h)for(var S,b=h(p),w=d.f,I=0;b.length>I;)w.call(p,S=b[I++])&&f.push(S);return f}},function(a,t,e){var s=e(24);a.exports=Array.isArray||function(c){return s(c)=="Array"}},function(a,t,e){var s=e(9),c=e(41).f,d={}.toString,p=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];a.exports.f=function(f){return p&&d.call(f)=="[object Window]"?(function(h){try{return c(h)}catch{return p.slice()}})(f):c(s(f))}},function(a,t,e){var s=e(19),c=e(16),d=e(9),p=e(23),f=e(5),h=e(35),S=Object.getOwnPropertyDescriptor;t.f=e(4)?S:function(b,w){if(b=d(b),w=p(w,!0),h)try{return S(b,w)}catch{}if(f(b,w))return c(!s.f.call(b,w),b[w])}},function(a,t){},function(a,t,e){e(31)("asyncIterator")},function(a,t,e){e(31)("observable")},function(a,t,e){t.__esModule=!0;var s,c=e(77),d=(s=c)&&s.__esModule?s:{default:s};t.default=d.default||function(p){for(var f=1;fH;)for(var r,D=h(arguments[H++]),V=L?c(D).concat(L(D)):c(D),z=V.length,q=0;z>q;)r=V[q++],s&&!X.call(D,r)||(I[r]=D[r]);return I}:S},function(a,t,e){t.__esModule=!0;var s=d(e(82)),c=d(e(85));function d(p){return p&&p.__esModule?p:{default:p}}t.default=function(p,f){if(Array.isArray(p))return p;if((0,s.default)(Object(p)))return(function(h,S){var b=[],w=!0,I=!1,R=void 0;try{for(var H,L=(0,c.default)(h);!(w=(H=L.next()).done)&&(b.push(H.value),!S||b.length!==S);w=!0);}catch(X){I=!0,R=X}finally{try{!w&&L.return&&L.return()}finally{if(I)throw R}}return b})(p,f);throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(a,t,e){a.exports={default:e(83),__esModule:!0}},function(a,t,e){e(29),e(20),a.exports=e(84)},function(a,t,e){var s=e(42),c=e(2)("iterator"),d=e(12);a.exports=e(1).isIterable=function(p){var f=Object(p);return f[c]!==void 0||"@@iterator"in f||d.hasOwnProperty(s(f))}},function(a,t,e){a.exports={default:e(86),__esModule:!0}},function(a,t,e){e(29),e(20),a.exports=e(87)},function(a,t,e){var s=e(10),c=e(88);a.exports=e(1).getIterator=function(d){var p=c(d);if(typeof p!="function")throw TypeError(d+" is not iterable!");return s(p.call(d))}},function(a,t,e){var s=e(42),c=e(2)("iterator"),d=e(12);a.exports=e(1).getIteratorMethod=function(p){if(p!=null)return p[c]||p["@@iterator"]||d[s(p)]}},function(a,t,e){a.exports={default:e(90),__esModule:!0}},function(a,t,e){e(91),a.exports=e(1).Object.keys},function(a,t,e){var s=e(18),c=e(13);e(92)("keys",(function(){return function(d){return c(s(d))}}))},function(a,t,e){var s=e(15),c=e(1),d=e(8);a.exports=function(p,f){var h=(c.Object||{})[p]||Object[p],S={};S[p]=f(h),s(s.S+s.F*d((function(){h(1)})),"Object",S)}},function(a,t,e){(function(s){var c=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],d=/^\s+|\s+$/g,p=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,f=/\{\n\/\* \[wrapped with (.+)\] \*/,h=/,? & /,S=/^[-+]0x[0-9a-f]+$/i,b=/^0b[01]+$/i,w=/^\[object .+?Constructor\]$/,I=/^0o[0-7]+$/i,R=/^(?:0|[1-9]\d*)$/,H=parseInt,L=typeof s=="object"&&s&&s.Object===Object&&s,X=typeof self=="object"&&self&&self.Object===Object&&self,r=L||X||Function("return this")();function D(F,x,j){switch(j.length){case 0:return F.call(x);case 1:return F.call(x,j[0]);case 2:return F.call(x,j[0],j[1]);case 3:return F.call(x,j[0],j[1],j[2])}return F.apply(x,j)}function V(F,x){return!!(F&&F.length)&&(function(j,N,B){if(N!=N)return(function(te,ue,ye,xe){for(var Ie=te.length,me=ye+-1;++me-1}function z(F){return F!=F}function q(F,x){for(var j=F.length,N=0;j--;)F[j]===x&&N++;return N}function k(F,x){for(var j=-1,N=F.length,B=0,K=[];++j2?T:void 0);function Ne(F){return Ve(F)?le(F):{}}function Ee(F){return!(!Ve(F)||(function(x){return!!C&&C in x})(F))&&((function(x){var j=Ve(x)?ce.call(x):"";return j=="[object Function]"||j=="[object GeneratorFunction]"})(F)||(function(x){var j=!1;if(x!=null&&typeof x.toString!="function")try{j=!!(x+"")}catch{}return j})(F)?U:w).test((function(x){if(x!=null){try{return Y.call(x)}catch{}try{return x+""}catch{}}return""})(F))}function Oe(F,x,j,N){for(var B=-1,K=F.length,re=j.length,te=-1,ue=x.length,ye=Q(K-re,0),xe=Array(ue+ye),Ie=!N;++te1&&se.reverse(),xe&&ue1?"& ":"")+x[N],x=x.join(j>2?", ":" "),F.replace(p,`{ /* [wrapped with `+x+`] */ `)}function st(F,x){return!!(x=x??9007199254740991)&&(typeof F=="number"||R.test(F))&&F>-1&&F%1==0&&F1&&d--,f=6*d<1?s+6*(c-s)*d:2*d<1?c:3*d<2?s+(c-s)*(2/3-d)*6:s,p[w]=255*f;return p}},function(a,t,e){(function(s){var c=typeof s=="object"&&s&&s.Object===Object&&s,d=typeof self=="object"&&self&&self.Object===Object&&self,p=c||d||Function("return this")();function f(k,A,T){switch(T.length){case 0:return k.call(A);case 1:return k.call(A,T[0]);case 2:return k.call(A,T[0],T[1]);case 3:return k.call(A,T[0],T[1],T[2])}return k.apply(A,T)}function h(k,A){for(var T=-1,W=A.length,E=k.length;++T-1&&E%1==0&&E<=9007199254740991})(W.length)&&!(function(E){var ee=(function(J){var C=typeof J;return!!J&&(C=="object"||C=="function")})(E)?w.call(E):"";return ee=="[object Function]"||ee=="[object GeneratorFunction]"})(W)})(T)})(A)&&b.call(A,"callee")&&(!R.call(A,"callee")||w.call(A)=="[object Arguments]")})(k)||!!(H&&k&&k[H])}var r=Array.isArray,D,V,z,q=(V=function(k){var A=(k=(function(E,ee,J,C,Y){var be=-1,ce=E.length;for(J||(J=X),Y||(Y=[]);++be2?d-2:0),f=2;f"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch{return!1}})();return function(){var n,o=w(l);if(u){var i=w(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return H(this,n)}}e.r(t);var X=e(0),r=e.n(X);function D(){var l=this.constructor.getDerivedStateFromProps(this.props,this.state);l!=null&&this.setState(l)}function V(l){this.setState(function(u){var n=this.constructor.getDerivedStateFromProps(l,u);return n??null}.bind(this))}function z(l,u){try{var n=this.props,o=this.state;this.props=l,this.state=u,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,o)}finally{this.props=n,this.state=o}}function q(l){var u=l.prototype;if(!u||!u.isReactComponent)throw new Error("Can only polyfill class components");if(typeof l.getDerivedStateFromProps!="function"&&typeof u.getSnapshotBeforeUpdate!="function")return l;var n=null,o=null,i=null;if(typeof u.componentWillMount=="function"?n="componentWillMount":typeof u.UNSAFE_componentWillMount=="function"&&(n="UNSAFE_componentWillMount"),typeof u.componentWillReceiveProps=="function"?o="componentWillReceiveProps":typeof u.UNSAFE_componentWillReceiveProps=="function"&&(o="UNSAFE_componentWillReceiveProps"),typeof u.componentWillUpdate=="function"?i="componentWillUpdate":typeof u.UNSAFE_componentWillUpdate=="function"&&(i="UNSAFE_componentWillUpdate"),n!==null||o!==null||i!==null){var y=l.displayName||l.name,O=typeof l.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs. diff --git a/admin/custom/assets/Components-B8x6wOMD.js b/admin/custom/assets/Components-B9ZyjeRI.js similarity index 52% rename from admin/custom/assets/Components-B8x6wOMD.js rename to admin/custom/assets/Components-B9ZyjeRI.js index cae912048..6cc23812c 100644 --- a/admin/custom/assets/Components-B8x6wOMD.js +++ b/admin/custom/assets/Components-B9ZyjeRI.js @@ -1 +1 @@ -import{j as r}from"./jsx-runtime-DfVU3AZG.js";import{_ as pe,a as D}from"./ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_x_mf_2_date_mf_2_pickers__loadShare__.mjs-DgHZUNxn.js";import{_ as ve,a as we,b as S,c as P,d as k,e as q,f as v,g as Y}from"./ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-KsT5vKjV.js";import{_ as d}from"./ConfigCustomJavascriptSet__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-B7D2xOvV.js";import{_}from"./ConfigCustomJavascriptSet__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__.mjs-ClsgYnEX.js";import{_ as j,a as T,b as ye,c as be,d as ie,e as re,f as B,g as Me,h as G,i as Pe}from"./ConfigCustomJavascriptSet__loadShare__react__loadShare__.mjs-0SjJESw9.js";import{_ as oe}from"./ConfigCustomJavascriptSet__loadShare__leaflet__loadShare__.mjs-BYONkEgA.js";import"./ConfigCustomJavascriptSet__loadShare__react_mf_2_dom__loadShare__.mjs-CL--xmjC.js";import{T as ke}from"./ThemeProvider-B4G3jidj.js";import{l as xe,e as se,p as We,i as ze,f as je,a as Te,b as $e,c as De,d as Se,g as Ce,h as E,j as Q,k as U,m as L,n as Ne,s as Ae,o as Ee,q as Le,r as He,t as Oe,u as Ge,v as Ve,w as Fe,x as Ie,y as Xe,z as Re,A as Je,B as qe,C as Ye,D as _e,E as Be,F as Qe,G as Ue,H as Ke,I as Ze,J as et,K as tt,L as at,M as nt,N as it,O as rt,P as ot,Q as st,R as dt,S as l,T as o,U as s,V as y,W as M,X as de}from"./isSameWeek-DDsSIa_t.js";import{_ as ut}from"./DefaultPropsProvider-CGb21NGY.js";import"./ConfigCustomJavascriptSet__loadShare__react__loadShare__.mjs_commonjs-proxy-CInLgMWW.js";import"./createTheme-Wd4QxQE0.js";import"./blue-CagzI6CQ.js";import"./index-AZB1OHDH.js";import"./useTheme-DWZ6jNyq.js";const mt={y:{sectionType:"year",contentType:"digit",maxLength:4},yy:"year",yyy:{sectionType:"year",contentType:"digit",maxLength:4},yyyy:"year",M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMMM:{sectionType:"month",contentType:"letter"},MMM:{sectionType:"month",contentType:"letter"},L:{sectionType:"month",contentType:"digit",maxLength:2},LL:"month",LLL:{sectionType:"month",contentType:"letter"},LLLL:{sectionType:"month",contentType:"letter"},d:{sectionType:"day",contentType:"digit",maxLength:2},dd:"day",do:{sectionType:"day",contentType:"digit-with-letter"},E:{sectionType:"weekDay",contentType:"letter"},EE:{sectionType:"weekDay",contentType:"letter"},EEE:{sectionType:"weekDay",contentType:"letter"},EEEE:{sectionType:"weekDay",contentType:"letter"},EEEEE:{sectionType:"weekDay",contentType:"letter"},i:{sectionType:"weekDay",contentType:"digit",maxLength:1},ii:"weekDay",iii:{sectionType:"weekDay",contentType:"letter"},iiii:{sectionType:"weekDay",contentType:"letter"},e:{sectionType:"weekDay",contentType:"digit",maxLength:1},ee:"weekDay",eee:{sectionType:"weekDay",contentType:"letter"},eeee:{sectionType:"weekDay",contentType:"letter"},eeeee:{sectionType:"weekDay",contentType:"letter"},eeeeee:{sectionType:"weekDay",contentType:"letter"},c:{sectionType:"weekDay",contentType:"digit",maxLength:1},cc:"weekDay",ccc:{sectionType:"weekDay",contentType:"letter"},cccc:{sectionType:"weekDay",contentType:"letter"},ccccc:{sectionType:"weekDay",contentType:"letter"},cccccc:{sectionType:"weekDay",contentType:"letter"},a:"meridiem",aa:"meridiem",aaa:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},lt={year:"yyyy",month:"LLLL",monthShort:"MMM",dayOfMonth:"d",dayOfMonthFull:"do",weekday:"EEEE",weekdayShort:"EEEEEE",hours24h:"HH",hours12h:"hh",meridiem:"aa",minutes:"mm",seconds:"ss",fullDate:"PP",keyboardDate:"P",shortDate:"MMM d",normalDate:"d MMMM",normalDateWithWeekday:"EEE, MMM d",fullTime:"p",fullTime12h:"hh:mm aa",fullTime24h:"HH:mm",keyboardDateTime:"P p",keyboardDateTime12h:"P hh:mm aa",keyboardDateTime24h:"P HH:mm"};class ct{constructor(a){this.isMUIAdapter=!0,this.isTimezoneCompatible=!1,this.lib=void 0,this.locale=void 0,this.formats=void 0,this.formatTokenMap=mt,this.escapedCharacters={start:"'",end:"'"},this.longFormatters=void 0,this.date=m=>typeof m>"u"?new Date:m===null?null:new Date(m),this.getInvalidDate=()=>new Date("Invalid Date"),this.getTimezone=()=>"default",this.setTimezone=m=>m,this.toJsDate=m=>m,this.getCurrentLocaleCode=()=>this.locale.code,this.is12HourCycleInCurrentLocale=()=>/a/.test(this.locale.formatLong.time({width:"short"})),this.expandFormat=m=>{const g=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;return m.match(g).map(h=>{const w=h[0];if(w==="p"||w==="P"){const x=this.longFormatters[w];return x(h,this.locale.formatLong)}return h}).join("")},this.formatNumber=m=>m,this.getDayOfWeek=m=>m.getDay()+1;const{locale:n,formats:t,longFormatters:i,lib:c}=a;this.locale=n,this.formats=ut({},lt,t),this.longFormatters=i,this.lib=c||"date-fns"}}class ht extends ct{constructor({locale:a,formats:n}={}){super({locale:a??se,formats:n,longFormatters:xe}),this.parse=(t,i)=>t===""?null:We(t,i,new Date,{locale:this.locale}),this.isValid=t=>t==null?!1:ze(t),this.format=(t,i)=>this.formatByString(t,this.formats[i]),this.formatByString=(t,i)=>je(t,i,{locale:this.locale}),this.isEqual=(t,i)=>t===null&&i===null?!0:t===null||i===null?!1:Te(t,i),this.isSameYear=(t,i)=>$e(t,i),this.isSameMonth=(t,i)=>De(t,i),this.isSameDay=(t,i)=>Se(t,i),this.isSameHour=(t,i)=>Ce(t,i),this.isAfter=(t,i)=>E(t,i),this.isAfterYear=(t,i)=>E(t,Q(i)),this.isAfterDay=(t,i)=>E(t,U(i)),this.isBefore=(t,i)=>L(t,i),this.isBeforeYear=(t,i)=>L(t,this.startOfYear(i)),this.isBeforeDay=(t,i)=>L(t,this.startOfDay(i)),this.isWithinRange=(t,[i,c])=>Ne(t,{start:i,end:c}),this.startOfYear=t=>Ae(t),this.startOfMonth=t=>Ee(t),this.startOfWeek=t=>Le(t,{locale:this.locale}),this.startOfDay=t=>He(t),this.endOfYear=t=>Q(t),this.endOfMonth=t=>Oe(t),this.endOfWeek=t=>Ge(t,{locale:this.locale}),this.endOfDay=t=>U(t),this.addYears=(t,i)=>Ve(t,i),this.addMonths=(t,i)=>Fe(t,i),this.addWeeks=(t,i)=>Ie(t,i),this.addDays=(t,i)=>Xe(t,i),this.addHours=(t,i)=>Re(t,i),this.addMinutes=(t,i)=>Je(t,i),this.addSeconds=(t,i)=>qe(t,i),this.getYear=t=>Ye(t),this.getMonth=t=>_e(t),this.getDate=t=>Be(t),this.getHours=t=>Qe(t),this.getMinutes=t=>Ue(t),this.getSeconds=t=>Ke(t),this.getMilliseconds=t=>Ze(t),this.setYear=(t,i)=>et(t,i),this.setMonth=(t,i)=>tt(t,i),this.setDate=(t,i)=>at(t,i),this.setHours=(t,i)=>nt(t,i),this.setMinutes=(t,i)=>it(t,i),this.setSeconds=(t,i)=>rt(t,i),this.setMilliseconds=(t,i)=>ot(t,i),this.getDaysInMonth=t=>st(t),this.getWeekArray=t=>{const i=this.startOfWeek(this.startOfMonth(t)),c=this.endOfWeek(this.endOfMonth(t));let m=0,g=i;const h=[];for(;this.isBefore(g,c);){const w=Math.floor(m/7);h[w]=h[w]||[],h[w].push(g),g=this.addDays(g,1),m+=1}return h},this.getWeekNumber=t=>dt(t,{locale:this.locale}),this.getYearRange=([t,i])=>{const c=this.startOfYear(t),m=this.endOfYear(i),g=[];let h=c;for(;this.isBefore(h,m);)g.push(h),h=this.addYears(h,1);return g}}}const K={lessThanXSeconds:{standalone:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"},withPreposition:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"}},xSeconds:{standalone:{one:"1 Sekunde",other:"{{count}} Sekunden"},withPreposition:{one:"1 Sekunde",other:"{{count}} Sekunden"}},halfAMinute:{standalone:"eine halbe Minute",withPreposition:"einer halben Minute"},lessThanXMinutes:{standalone:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"},withPreposition:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"}},xMinutes:{standalone:{one:"1 Minute",other:"{{count}} Minuten"},withPreposition:{one:"1 Minute",other:"{{count}} Minuten"}},aboutXHours:{standalone:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"},withPreposition:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"}},xHours:{standalone:{one:"1 Stunde",other:"{{count}} Stunden"},withPreposition:{one:"1 Stunde",other:"{{count}} Stunden"}},xDays:{standalone:{one:"1 Tag",other:"{{count}} Tage"},withPreposition:{one:"1 Tag",other:"{{count}} Tagen"}},aboutXWeeks:{standalone:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"},withPreposition:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"}},xWeeks:{standalone:{one:"1 Woche",other:"{{count}} Wochen"},withPreposition:{one:"1 Woche",other:"{{count}} Wochen"}},aboutXMonths:{standalone:{one:"etwa 1 Monat",other:"etwa {{count}} Monate"},withPreposition:{one:"etwa 1 Monat",other:"etwa {{count}} Monaten"}},xMonths:{standalone:{one:"1 Monat",other:"{{count}} Monate"},withPreposition:{one:"1 Monat",other:"{{count}} Monaten"}},aboutXYears:{standalone:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahre"},withPreposition:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahren"}},xYears:{standalone:{one:"1 Jahr",other:"{{count}} Jahre"},withPreposition:{one:"1 Jahr",other:"{{count}} Jahren"}},overXYears:{standalone:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahre"},withPreposition:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahren"}},almostXYears:{standalone:{one:"fast 1 Jahr",other:"fast {{count}} Jahre"},withPreposition:{one:"fast 1 Jahr",other:"fast {{count}} Jahren"}}},gt=(e,a,n)=>{let t;const i=n!=null&&n.addSuffix?K[e].withPreposition:K[e].standalone;return typeof i=="string"?t=i:a===1?t=i.one:t=i.other.replace("{{count}}",String(a)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+t:"vor "+t:t},ft={full:"EEEE, do MMMM y",long:"do MMMM y",medium:"do MMM y",short:"dd.MM.y"},pt={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},vt={full:"{{date}} 'um' {{time}}",long:"{{date}} 'um' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},wt={date:l({formats:ft,defaultWidth:"full"}),time:l({formats:pt,defaultWidth:"full"}),dateTime:l({formats:vt,defaultWidth:"full"})},yt={lastWeek:"'letzten' eeee 'um' p",yesterday:"'gestern um' p",today:"'heute um' p",tomorrow:"'morgen um' p",nextWeek:"eeee 'um' p",other:"P"},bt=(e,a,n,t)=>yt[e],Mt={narrow:["v.Chr.","n.Chr."],abbreviated:["v.Chr.","n.Chr."],wide:["vor Christus","nach Christus"]},Pt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. Quartal","2. Quartal","3. Quartal","4. Quartal"]},V={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],wide:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]},kt={narrow:V.narrow,abbreviated:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sep.","Okt.","Nov.","Dez."],wide:V.wide},xt={narrow:["S","M","D","M","D","F","S"],short:["So","Mo","Di","Mi","Do","Fr","Sa"],abbreviated:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],wide:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},Wt={narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachm.",evening:"Abend",night:"Nacht"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"}},zt={narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachm.",evening:"abends",night:"nachts"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"}},jt=e=>Number(e)+".",Tt={ordinalNumber:jt,era:o({values:Mt,defaultWidth:"wide"}),quarter:o({values:Pt,defaultWidth:"wide",argumentCallback:e=>e-1}),month:o({values:V,formattingValues:kt,defaultWidth:"wide"}),day:o({values:xt,defaultWidth:"wide"}),dayPeriod:o({values:Wt,defaultWidth:"wide",formattingValues:zt,defaultFormattingWidth:"wide"})},$t=/^(\d+)(\.)?/i,Dt=/\d+/i,St={narrow:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,abbreviated:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,wide:/^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i},Ct={any:[/^v/i,/^n/i]},Nt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? Quartal/i},At={any:[/1/i,/2/i,/3/i,/4/i]},Et={narrow:/^[jfmasond]/i,abbreviated:/^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,wide:/^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i},Lt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^j[aä]/i,/^f/i,/^mär/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Ht={narrow:/^[smdmf]/i,short:/^(so|mo|di|mi|do|fr|sa)/i,abbreviated:/^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,wide:/^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i},Ot={any:[/^so/i,/^mo/i,/^di/i,/^mi/i,/^do/i,/^f/i,/^sa/i]},Gt={narrow:/^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,abbreviated:/^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,wide:/^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i},Vt={any:{am:/^v/i,pm:/^n/i,midnight:/^Mitte/i,noon:/^Mitta/i,morning:/morgens/i,afternoon:/nachmittags/i,evening:/abends/i,night:/nachts/i}},Ft={ordinalNumber:y({matchPattern:$t,parsePattern:Dt,valueCallback:e=>parseInt(e)}),era:s({matchPatterns:St,defaultMatchWidth:"wide",parsePatterns:Ct,defaultParseWidth:"any"}),quarter:s({matchPatterns:Nt,defaultMatchWidth:"wide",parsePatterns:At,defaultParseWidth:"any",valueCallback:e=>e+1}),month:s({matchPatterns:Et,defaultMatchWidth:"wide",parsePatterns:Lt,defaultParseWidth:"any"}),day:s({matchPatterns:Ht,defaultMatchWidth:"wide",parsePatterns:Ot,defaultParseWidth:"any"}),dayPeriod:s({matchPatterns:Gt,defaultMatchWidth:"wide",parsePatterns:Vt,defaultParseWidth:"any"})},It={code:"de",formatDistance:gt,formatLong:wt,formatRelative:bt,localize:Tt,match:Ft,options:{weekStartsOn:1,firstWeekContainsDate:4}},Xt={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},Rt=(e,a,n)=>{let t;const i=Xt[e];return typeof i=="string"?t=i:a===1?t=i.one:t=i.other.replace("{{count}}",a.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"en "+t:"hace "+t:t},Jt={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},qt={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Yt={full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},_t={date:l({formats:Jt,defaultWidth:"full"}),time:l({formats:qt,defaultWidth:"full"}),dateTime:l({formats:Yt,defaultWidth:"full"})},Bt={lastWeek:"'el' eeee 'pasado a la' p",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},Qt={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},Ut=(e,a,n,t)=>a.getHours()!==1?Qt[e]:Bt[e],Kt={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},Zt={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},ea={narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},ta={narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sá"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},aa={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},na={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},ia=(e,a)=>Number(e)+"º",ra={ordinalNumber:ia,era:o({values:Kt,defaultWidth:"wide"}),quarter:o({values:Zt,defaultWidth:"wide",argumentCallback:e=>Number(e)-1}),month:o({values:ea,defaultWidth:"wide"}),day:o({values:ta,defaultWidth:"wide"}),dayPeriod:o({values:aa,defaultWidth:"wide",formattingValues:na,defaultFormattingWidth:"wide"})},oa=/^(\d+)(º)?/i,sa=/\d+/i,da={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},ua={any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},ma={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},la={any:[/1/i,/2/i,/3/i,/4/i]},ca={narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},ha={narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},ga={narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},fa={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},pa={narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},va={any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},wa={ordinalNumber:y({matchPattern:oa,parsePattern:sa,valueCallback:function(e){return parseInt(e,10)}}),era:s({matchPatterns:da,defaultMatchWidth:"wide",parsePatterns:ua,defaultParseWidth:"any"}),quarter:s({matchPatterns:ma,defaultMatchWidth:"wide",parsePatterns:la,defaultParseWidth:"any",valueCallback:e=>e+1}),month:s({matchPatterns:ca,defaultMatchWidth:"wide",parsePatterns:ha,defaultParseWidth:"any"}),day:s({matchPatterns:ga,defaultMatchWidth:"wide",parsePatterns:fa,defaultParseWidth:"any"}),dayPeriod:s({matchPatterns:pa,defaultMatchWidth:"any",parsePatterns:va,defaultParseWidth:"any"})},ya={code:"es",formatDistance:Rt,formatLong:_t,formatRelative:Ut,localize:ra,match:wa,options:{weekStartsOn:1,firstWeekContainsDate:1}},ba={lessThanXSeconds:{one:"moins d’une seconde",other:"moins de {{count}} secondes"},xSeconds:{one:"1 seconde",other:"{{count}} secondes"},halfAMinute:"30 secondes",lessThanXMinutes:{one:"moins d’une minute",other:"moins de {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"environ 1 heure",other:"environ {{count}} heures"},xHours:{one:"1 heure",other:"{{count}} heures"},xDays:{one:"1 jour",other:"{{count}} jours"},aboutXWeeks:{one:"environ 1 semaine",other:"environ {{count}} semaines"},xWeeks:{one:"1 semaine",other:"{{count}} semaines"},aboutXMonths:{one:"environ 1 mois",other:"environ {{count}} mois"},xMonths:{one:"1 mois",other:"{{count}} mois"},aboutXYears:{one:"environ 1 an",other:"environ {{count}} ans"},xYears:{one:"1 an",other:"{{count}} ans"},overXYears:{one:"plus d’un an",other:"plus de {{count}} ans"},almostXYears:{one:"presqu’un an",other:"presque {{count}} ans"}},Ma=(e,a,n)=>{let t;const i=ba[e];return typeof i=="string"?t=i:a===1?t=i.one:t=i.other.replace("{{count}}",String(a)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"dans "+t:"il y a "+t:t},Pa={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},ka={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},xa={full:"{{date}} 'à' {{time}}",long:"{{date}} 'à' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Wa={date:l({formats:Pa,defaultWidth:"full"}),time:l({formats:ka,defaultWidth:"full"}),dateTime:l({formats:xa,defaultWidth:"full"})},za={lastWeek:"eeee 'dernier à' p",yesterday:"'hier à' p",today:"'aujourd’hui à' p",tomorrow:"'demain à' p'",nextWeek:"eeee 'prochain à' p",other:"P"},ja=(e,a,n,t)=>za[e],Ta={narrow:["av. J.-C","ap. J.-C"],abbreviated:["av. J.-C","ap. J.-C"],wide:["avant Jésus-Christ","après Jésus-Christ"]},$a={narrow:["T1","T2","T3","T4"],abbreviated:["1er trim.","2ème trim.","3ème trim.","4ème trim."],wide:["1er trimestre","2ème trimestre","3ème trimestre","4ème trimestre"]},Da={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],wide:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"]},Sa={narrow:["D","L","M","M","J","V","S"],short:["di","lu","ma","me","je","ve","sa"],abbreviated:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],wide:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},Ca={narrow:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"mat.",afternoon:"ap.m.",evening:"soir",night:"mat."},abbreviated:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"matin",afternoon:"après-midi",evening:"soir",night:"matin"},wide:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"du matin",afternoon:"de l’après-midi",evening:"du soir",night:"du matin"}},Na=(e,a)=>{const n=Number(e),t=a==null?void 0:a.unit;if(n===0)return"0";const i=["year","week","hour","minute","second"];let c;return n===1?c=t&&i.includes(t)?"ère":"er":c="ème",n+c},Aa=["MMM","MMMM"],Ea={preprocessor:(e,a)=>e.getDate()===1||!a.some(t=>t.isToken&&Aa.includes(t.value))?a:a.map(t=>t.isToken&&t.value==="do"?{isToken:!0,value:"d"}:t),ordinalNumber:Na,era:o({values:Ta,defaultWidth:"wide"}),quarter:o({values:$a,defaultWidth:"wide",argumentCallback:e=>e-1}),month:o({values:Da,defaultWidth:"wide"}),day:o({values:Sa,defaultWidth:"wide"}),dayPeriod:o({values:Ca,defaultWidth:"wide"})},La=/^(\d+)(ième|ère|ème|er|e)?/i,Ha=/\d+/i,Oa={narrow:/^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,abbreviated:/^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,wide:/^(avant Jésus-Christ|après Jésus-Christ)/i},Ga={any:[/^av/i,/^ap/i]},Va={narrow:/^T?[1234]/i,abbreviated:/^[1234](er|ème|e)? trim\.?/i,wide:/^[1234](er|ème|e)? trimestre/i},Fa={any:[/1/i,/2/i,/3/i,/4/i]},Ia={narrow:/^[jfmasond]/i,abbreviated:/^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,wide:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i},Xa={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^av/i,/^ma/i,/^juin/i,/^juil/i,/^ao/i,/^s/i,/^o/i,/^n/i,/^d/i]},Ra={narrow:/^[lmjvsd]/i,short:/^(di|lu|ma|me|je|ve|sa)/i,abbreviated:/^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,wide:/^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i},Ja={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^di/i,/^lu/i,/^ma/i,/^me/i,/^je/i,/^ve/i,/^sa/i]},qa={narrow:/^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,any:/^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i},Ya={any:{am:/^a/i,pm:/^p/i,midnight:/^min/i,noon:/^mid/i,morning:/mat/i,afternoon:/ap/i,evening:/soir/i,night:/nuit/i}},_a={ordinalNumber:y({matchPattern:La,parsePattern:Ha,valueCallback:e=>parseInt(e)}),era:s({matchPatterns:Oa,defaultMatchWidth:"wide",parsePatterns:Ga,defaultParseWidth:"any"}),quarter:s({matchPatterns:Va,defaultMatchWidth:"wide",parsePatterns:Fa,defaultParseWidth:"any",valueCallback:e=>e+1}),month:s({matchPatterns:Ia,defaultMatchWidth:"wide",parsePatterns:Xa,defaultParseWidth:"any"}),day:s({matchPatterns:Ra,defaultMatchWidth:"wide",parsePatterns:Ja,defaultParseWidth:"any"}),dayPeriod:s({matchPatterns:qa,defaultMatchWidth:"any",parsePatterns:Ya,defaultParseWidth:"any"})},Ba={code:"fr",formatDistance:Ma,formatLong:Wa,formatRelative:ja,localize:Ea,match:_a,options:{weekStartsOn:1,firstWeekContainsDate:4}},Qa={lessThanXSeconds:{one:"meno di un secondo",other:"meno di {{count}} secondi"},xSeconds:{one:"un secondo",other:"{{count}} secondi"},halfAMinute:"alcuni secondi",lessThanXMinutes:{one:"meno di un minuto",other:"meno di {{count}} minuti"},xMinutes:{one:"un minuto",other:"{{count}} minuti"},aboutXHours:{one:"circa un'ora",other:"circa {{count}} ore"},xHours:{one:"un'ora",other:"{{count}} ore"},xDays:{one:"un giorno",other:"{{count}} giorni"},aboutXWeeks:{one:"circa una settimana",other:"circa {{count}} settimane"},xWeeks:{one:"una settimana",other:"{{count}} settimane"},aboutXMonths:{one:"circa un mese",other:"circa {{count}} mesi"},xMonths:{one:"un mese",other:"{{count}} mesi"},aboutXYears:{one:"circa un anno",other:"circa {{count}} anni"},xYears:{one:"un anno",other:"{{count}} anni"},overXYears:{one:"più di un anno",other:"più di {{count}} anni"},almostXYears:{one:"quasi un anno",other:"quasi {{count}} anni"}},Ua=(e,a,n)=>{let t;const i=Qa[e];return typeof i=="string"?t=i:a===1?t=i.one:t=i.other.replace("{{count}}",a.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"tra "+t:t+" fa":t},Ka={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},Za={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},en={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},tn={date:l({formats:Ka,defaultWidth:"full"}),time:l({formats:Za,defaultWidth:"full"}),dateTime:l({formats:en,defaultWidth:"full"})},I=["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"];function an(e){return e===0?"'domenica scorsa alle' p":"'"+I[e]+" scorso alle' p"}function Z(e){return"'"+I[e]+" alle' p"}function nn(e){return e===0?"'domenica prossima alle' p":"'"+I[e]+" prossimo alle' p"}const rn={lastWeek:(e,a,n)=>{const t=e.getDay();return M(e,a,n)?Z(t):an(t)},yesterday:"'ieri alle' p",today:"'oggi alle' p",tomorrow:"'domani alle' p",nextWeek:(e,a,n)=>{const t=e.getDay();return M(e,a,n)?Z(t):nn(t)},other:"P"},on=(e,a,n,t)=>{const i=rn[e];return typeof i=="function"?i(a,n,t):i},sn={narrow:["aC","dC"],abbreviated:["a.C.","d.C."],wide:["avanti Cristo","dopo Cristo"]},dn={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},un={narrow:["G","F","M","A","M","G","L","A","S","O","N","D"],abbreviated:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],wide:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"]},mn={narrow:["D","L","M","M","G","V","S"],short:["dom","lun","mar","mer","gio","ven","sab"],abbreviated:["dom","lun","mar","mer","gio","ven","sab"],wide:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"]},ln={narrow:{am:"m.",pm:"p.",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"},abbreviated:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"},wide:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"}},cn={narrow:{am:"m.",pm:"p.",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"},abbreviated:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"},wide:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"}},hn=(e,a)=>{const n=Number(e);return String(n)},gn={ordinalNumber:hn,era:o({values:sn,defaultWidth:"wide"}),quarter:o({values:dn,defaultWidth:"wide",argumentCallback:e=>e-1}),month:o({values:un,defaultWidth:"wide"}),day:o({values:mn,defaultWidth:"wide"}),dayPeriod:o({values:ln,defaultWidth:"wide",formattingValues:cn,defaultFormattingWidth:"wide"})},fn=/^(\d+)(º)?/i,pn=/\d+/i,vn={narrow:/^(aC|dC)/i,abbreviated:/^(a\.?\s?C\.?|a\.?\s?e\.?\s?v\.?|d\.?\s?C\.?|e\.?\s?v\.?)/i,wide:/^(avanti Cristo|avanti Era Volgare|dopo Cristo|Era Volgare)/i},wn={any:[/^a/i,/^(d|e)/i]},yn={narrow:/^[1234]/i,abbreviated:/^t[1234]/i,wide:/^[1234](º)? trimestre/i},bn={any:[/1/i,/2/i,/3/i,/4/i]},Mn={narrow:/^[gfmalsond]/i,abbreviated:/^(gen|feb|mar|apr|mag|giu|lug|ago|set|ott|nov|dic)/i,wide:/^(gennaio|febbraio|marzo|aprile|maggio|giugno|luglio|agosto|settembre|ottobre|novembre|dicembre)/i},Pn={narrow:[/^g/i,/^f/i,/^m/i,/^a/i,/^m/i,/^g/i,/^l/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ge/i,/^f/i,/^mar/i,/^ap/i,/^mag/i,/^gi/i,/^l/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},kn={narrow:/^[dlmgvs]/i,short:/^(do|lu|ma|me|gi|ve|sa)/i,abbreviated:/^(dom|lun|mar|mer|gio|ven|sab)/i,wide:/^(domenica|luned[i|ì]|marted[i|ì]|mercoled[i|ì]|gioved[i|ì]|venerd[i|ì]|sabato)/i},xn={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^g/i,/^v/i,/^s/i],any:[/^d/i,/^l/i,/^ma/i,/^me/i,/^g/i,/^v/i,/^s/i]},Wn={narrow:/^(a|m\.|p|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i,any:/^([ap]\.?\s?m\.?|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i},zn={any:{am:/^a/i,pm:/^p/i,midnight:/^mezza/i,noon:/^mezzo/i,morning:/mattina/i,afternoon:/pomeriggio/i,evening:/sera/i,night:/notte/i}},jn={ordinalNumber:y({matchPattern:fn,parsePattern:pn,valueCallback:e=>parseInt(e,10)}),era:s({matchPatterns:vn,defaultMatchWidth:"wide",parsePatterns:wn,defaultParseWidth:"any"}),quarter:s({matchPatterns:yn,defaultMatchWidth:"wide",parsePatterns:bn,defaultParseWidth:"any",valueCallback:e=>e+1}),month:s({matchPatterns:Mn,defaultMatchWidth:"wide",parsePatterns:Pn,defaultParseWidth:"any"}),day:s({matchPatterns:kn,defaultMatchWidth:"wide",parsePatterns:xn,defaultParseWidth:"any"}),dayPeriod:s({matchPatterns:Wn,defaultMatchWidth:"any",parsePatterns:zn,defaultParseWidth:"any"})},Tn={code:"it",formatDistance:Ua,formatLong:tn,formatRelative:on,localize:gn,match:jn,options:{weekStartsOn:1,firstWeekContainsDate:4}},$n={lessThanXSeconds:{one:"minder dan een seconde",other:"minder dan {{count}} seconden"},xSeconds:{one:"1 seconde",other:"{{count}} seconden"},halfAMinute:"een halve minuut",lessThanXMinutes:{one:"minder dan een minuut",other:"minder dan {{count}} minuten"},xMinutes:{one:"een minuut",other:"{{count}} minuten"},aboutXHours:{one:"ongeveer 1 uur",other:"ongeveer {{count}} uur"},xHours:{one:"1 uur",other:"{{count}} uur"},xDays:{one:"1 dag",other:"{{count}} dagen"},aboutXWeeks:{one:"ongeveer 1 week",other:"ongeveer {{count}} weken"},xWeeks:{one:"1 week",other:"{{count}} weken"},aboutXMonths:{one:"ongeveer 1 maand",other:"ongeveer {{count}} maanden"},xMonths:{one:"1 maand",other:"{{count}} maanden"},aboutXYears:{one:"ongeveer 1 jaar",other:"ongeveer {{count}} jaar"},xYears:{one:"1 jaar",other:"{{count}} jaar"},overXYears:{one:"meer dan 1 jaar",other:"meer dan {{count}} jaar"},almostXYears:{one:"bijna 1 jaar",other:"bijna {{count}} jaar"}},Dn=(e,a,n)=>{let t;const i=$n[e];return typeof i=="string"?t=i:a===1?t=i.one:t=i.other.replace("{{count}}",String(a)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"over "+t:t+" geleden":t},Sn={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd-MM-y"},Cn={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Nn={full:"{{date}} 'om' {{time}}",long:"{{date}} 'om' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},An={date:l({formats:Sn,defaultWidth:"full"}),time:l({formats:Cn,defaultWidth:"full"}),dateTime:l({formats:Nn,defaultWidth:"full"})},En={lastWeek:"'afgelopen' eeee 'om' p",yesterday:"'gisteren om' p",today:"'vandaag om' p",tomorrow:"'morgen om' p",nextWeek:"eeee 'om' p",other:"P"},Ln=(e,a,n,t)=>En[e],Hn={narrow:["v.C.","n.C."],abbreviated:["v.Chr.","n.Chr."],wide:["voor Christus","na Christus"]},On={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["1e kwartaal","2e kwartaal","3e kwartaal","4e kwartaal"]},Gn={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["jan.","feb.","mrt.","apr.","mei","jun.","jul.","aug.","sep.","okt.","nov.","dec."],wide:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"]},Vn={narrow:["Z","M","D","W","D","V","Z"],short:["zo","ma","di","wo","do","vr","za"],abbreviated:["zon","maa","din","woe","don","vri","zat"],wide:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"]},Fn={narrow:{am:"AM",pm:"PM",midnight:"middernacht",noon:"het middaguur",morning:"'s ochtends",afternoon:"'s middags",evening:"'s avonds",night:"'s nachts"},abbreviated:{am:"AM",pm:"PM",midnight:"middernacht",noon:"het middaguur",morning:"'s ochtends",afternoon:"'s middags",evening:"'s avonds",night:"'s nachts"},wide:{am:"AM",pm:"PM",midnight:"middernacht",noon:"het middaguur",morning:"'s ochtends",afternoon:"'s middags",evening:"'s avonds",night:"'s nachts"}},In=(e,a)=>Number(e)+"e",Xn={ordinalNumber:In,era:o({values:Hn,defaultWidth:"wide"}),quarter:o({values:On,defaultWidth:"wide",argumentCallback:e=>e-1}),month:o({values:Gn,defaultWidth:"wide"}),day:o({values:Vn,defaultWidth:"wide"}),dayPeriod:o({values:Fn,defaultWidth:"wide"})},Rn=/^(\d+)e?/i,Jn=/\d+/i,qn={narrow:/^([vn]\.? ?C\.?)/,abbreviated:/^([vn]\. ?Chr\.?)/,wide:/^((voor|na) Christus)/},Yn={any:[/^v/,/^n/]},_n={narrow:/^[1234]/i,abbreviated:/^K[1234]/i,wide:/^[1234]e kwartaal/i},Bn={any:[/1/i,/2/i,/3/i,/4/i]},Qn={narrow:/^[jfmasond]/i,abbreviated:/^(jan.|feb.|mrt.|apr.|mei|jun.|jul.|aug.|sep.|okt.|nov.|dec.)/i,wide:/^(januari|februari|maart|april|mei|juni|juli|augustus|september|oktober|november|december)/i},Un={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^jan/i,/^feb/i,/^m(r|a)/i,/^apr/i,/^mei/i,/^jun/i,/^jul/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i]},Kn={narrow:/^[zmdwv]/i,short:/^(zo|ma|di|wo|do|vr|za)/i,abbreviated:/^(zon|maa|din|woe|don|vri|zat)/i,wide:/^(zondag|maandag|dinsdag|woensdag|donderdag|vrijdag|zaterdag)/i},Zn={narrow:[/^z/i,/^m/i,/^d/i,/^w/i,/^d/i,/^v/i,/^z/i],any:[/^zo/i,/^ma/i,/^di/i,/^wo/i,/^do/i,/^vr/i,/^za/i]},ei={any:/^(am|pm|middernacht|het middaguur|'s (ochtends|middags|avonds|nachts))/i},ti={any:{am:/^am/i,pm:/^pm/i,midnight:/^middernacht/i,noon:/^het middaguur/i,morning:/ochtend/i,afternoon:/middag/i,evening:/avond/i,night:/nacht/i}},ai={ordinalNumber:y({matchPattern:Rn,parsePattern:Jn,valueCallback:e=>parseInt(e,10)}),era:s({matchPatterns:qn,defaultMatchWidth:"wide",parsePatterns:Yn,defaultParseWidth:"any"}),quarter:s({matchPatterns:_n,defaultMatchWidth:"wide",parsePatterns:Bn,defaultParseWidth:"any",valueCallback:e=>e+1}),month:s({matchPatterns:Qn,defaultMatchWidth:"wide",parsePatterns:Un,defaultParseWidth:"any"}),day:s({matchPatterns:Kn,defaultMatchWidth:"wide",parsePatterns:Zn,defaultParseWidth:"any"}),dayPeriod:s({matchPatterns:ei,defaultMatchWidth:"any",parsePatterns:ti,defaultParseWidth:"any"})},ni={code:"nl",formatDistance:Dn,formatLong:An,formatRelative:Ln,localize:Xn,match:ai,options:{weekStartsOn:1,firstWeekContainsDate:4}},ii={lessThanXSeconds:{one:{regular:"mniej niż sekunda",past:"mniej niż sekundę",future:"mniej niż sekundę"},twoFour:"mniej niż {{count}} sekundy",other:"mniej niż {{count}} sekund"},xSeconds:{one:{regular:"sekunda",past:"sekundę",future:"sekundę"},twoFour:"{{count}} sekundy",other:"{{count}} sekund"},halfAMinute:{one:"pół minuty",twoFour:"pół minuty",other:"pół minuty"},lessThanXMinutes:{one:{regular:"mniej niż minuta",past:"mniej niż minutę",future:"mniej niż minutę"},twoFour:"mniej niż {{count}} minuty",other:"mniej niż {{count}} minut"},xMinutes:{one:{regular:"minuta",past:"minutę",future:"minutę"},twoFour:"{{count}} minuty",other:"{{count}} minut"},aboutXHours:{one:{regular:"około godziny",past:"około godziny",future:"około godzinę"},twoFour:"około {{count}} godziny",other:"około {{count}} godzin"},xHours:{one:{regular:"godzina",past:"godzinę",future:"godzinę"},twoFour:"{{count}} godziny",other:"{{count}} godzin"},xDays:{one:{regular:"dzień",past:"dzień",future:"1 dzień"},twoFour:"{{count}} dni",other:"{{count}} dni"},aboutXWeeks:{one:"około tygodnia",twoFour:"około {{count}} tygodni",other:"około {{count}} tygodni"},xWeeks:{one:"tydzień",twoFour:"{{count}} tygodnie",other:"{{count}} tygodni"},aboutXMonths:{one:"około miesiąc",twoFour:"około {{count}} miesiące",other:"około {{count}} miesięcy"},xMonths:{one:"miesiąc",twoFour:"{{count}} miesiące",other:"{{count}} miesięcy"},aboutXYears:{one:"około rok",twoFour:"około {{count}} lata",other:"około {{count}} lat"},xYears:{one:"rok",twoFour:"{{count}} lata",other:"{{count}} lat"},overXYears:{one:"ponad rok",twoFour:"ponad {{count}} lata",other:"ponad {{count}} lat"},almostXYears:{one:"prawie rok",twoFour:"prawie {{count}} lata",other:"prawie {{count}} lat"}};function ri(e,a){if(a===1)return e.one;const n=a%100;if(n<=20&&n>10)return e.other;const t=n%10;return t>=2&&t<=4?e.twoFour:e.other}function H(e,a,n){const t=ri(e,a);return(typeof t=="string"?t:t[n]).replace("{{count}}",String(a))}const oi=(e,a,n)=>{const t=ii[e];return n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"za "+H(t,a,"future"):H(t,a,"past")+" temu":H(t,a,"regular")},si={full:"EEEE, do MMMM y",long:"do MMMM y",medium:"do MMM y",short:"dd.MM.y"},di={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},ui={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},mi={date:l({formats:si,defaultWidth:"full"}),time:l({formats:di,defaultWidth:"full"}),dateTime:l({formats:ui,defaultWidth:"full"})},li={masculine:"ostatni",feminine:"ostatnia"},ci={masculine:"ten",feminine:"ta"},hi={masculine:"następny",feminine:"następna"},gi={0:"feminine",1:"masculine",2:"masculine",3:"feminine",4:"masculine",5:"masculine",6:"feminine"};function ee(e,a,n,t){let i;if(M(a,n,t))i=ci;else if(e==="lastWeek")i=li;else if(e==="nextWeek")i=hi;else throw new Error(`Cannot determine adjectives for token ${e}`);const c=a.getDay(),m=gi[c];return`'${i[m]}' eeee 'o' p`}const fi={lastWeek:ee,yesterday:"'wczoraj o' p",today:"'dzisiaj o' p",tomorrow:"'jutro o' p",nextWeek:ee,other:"P"},pi=(e,a,n,t)=>{const i=fi[e];return typeof i=="function"?i(e,a,n,t):i},vi={narrow:["p.n.e.","n.e."],abbreviated:["p.n.e.","n.e."],wide:["przed naszą erą","naszej ery"]},wi={narrow:["1","2","3","4"],abbreviated:["I kw.","II kw.","III kw.","IV kw."],wide:["I kwartał","II kwartał","III kwartał","IV kwartał"]},yi={narrow:["S","L","M","K","M","C","L","S","W","P","L","G"],abbreviated:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","paź","lis","gru"],wide:["styczeń","luty","marzec","kwiecień","maj","czerwiec","lipiec","sierpień","wrzesień","październik","listopad","grudzień"]},bi={narrow:["s","l","m","k","m","c","l","s","w","p","l","g"],abbreviated:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","paź","lis","gru"],wide:["stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","września","października","listopada","grudnia"]},Mi={narrow:["N","P","W","Ś","C","P","S"],short:["nie","pon","wto","śro","czw","pią","sob"],abbreviated:["niedz.","pon.","wt.","śr.","czw.","pt.","sob."],wide:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"]},Pi={narrow:["n","p","w","ś","c","p","s"],short:["nie","pon","wto","śro","czw","pią","sob"],abbreviated:["niedz.","pon.","wt.","śr.","czw.","pt.","sob."],wide:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"]},ki={narrow:{am:"a",pm:"p",midnight:"półn.",noon:"poł",morning:"rano",afternoon:"popoł.",evening:"wiecz.",night:"noc"},abbreviated:{am:"AM",pm:"PM",midnight:"północ",noon:"południe",morning:"rano",afternoon:"popołudnie",evening:"wieczór",night:"noc"},wide:{am:"AM",pm:"PM",midnight:"północ",noon:"południe",morning:"rano",afternoon:"popołudnie",evening:"wieczór",night:"noc"}},xi={narrow:{am:"a",pm:"p",midnight:"o półn.",noon:"w poł.",morning:"rano",afternoon:"po poł.",evening:"wiecz.",night:"w nocy"},abbreviated:{am:"AM",pm:"PM",midnight:"o północy",noon:"w południe",morning:"rano",afternoon:"po południu",evening:"wieczorem",night:"w nocy"},wide:{am:"AM",pm:"PM",midnight:"o północy",noon:"w południe",morning:"rano",afternoon:"po południu",evening:"wieczorem",night:"w nocy"}},Wi=(e,a)=>String(e),zi={ordinalNumber:Wi,era:o({values:vi,defaultWidth:"wide"}),quarter:o({values:wi,defaultWidth:"wide",argumentCallback:e=>e-1}),month:o({values:yi,defaultWidth:"wide",formattingValues:bi,defaultFormattingWidth:"wide"}),day:o({values:Mi,defaultWidth:"wide",formattingValues:Pi,defaultFormattingWidth:"wide"}),dayPeriod:o({values:ki,defaultWidth:"wide",formattingValues:xi,defaultFormattingWidth:"wide"})},ji=/^(\d+)?/i,Ti=/\d+/i,$i={narrow:/^(p\.?\s*n\.?\s*e\.?\s*|n\.?\s*e\.?\s*)/i,abbreviated:/^(p\.?\s*n\.?\s*e\.?\s*|n\.?\s*e\.?\s*)/i,wide:/^(przed\s*nasz(ą|a)\s*er(ą|a)|naszej\s*ery)/i},Di={any:[/^p/i,/^n/i]},Si={narrow:/^[1234]/i,abbreviated:/^(I|II|III|IV)\s*kw\.?/i,wide:/^(I|II|III|IV)\s*kwarta(ł|l)/i},Ci={narrow:[/1/i,/2/i,/3/i,/4/i],any:[/^I kw/i,/^II kw/i,/^III kw/i,/^IV kw/i]},Ni={narrow:/^[slmkcwpg]/i,abbreviated:/^(sty|lut|mar|kwi|maj|cze|lip|sie|wrz|pa(ź|z)|lis|gru)/i,wide:/^(stycznia|stycze(ń|n)|lutego|luty|marca|marzec|kwietnia|kwiecie(ń|n)|maja|maj|czerwca|czerwiec|lipca|lipiec|sierpnia|sierpie(ń|n)|wrze(ś|s)nia|wrzesie(ń|n)|pa(ź|z)dziernika|pa(ź|z)dziernik|listopada|listopad|grudnia|grudzie(ń|n))/i},Ai={narrow:[/^s/i,/^l/i,/^m/i,/^k/i,/^m/i,/^c/i,/^l/i,/^s/i,/^w/i,/^p/i,/^l/i,/^g/i],any:[/^st/i,/^lu/i,/^mar/i,/^k/i,/^maj/i,/^c/i,/^lip/i,/^si/i,/^w/i,/^p/i,/^lis/i,/^g/i]},Ei={narrow:/^[npwścs]/i,short:/^(nie|pon|wto|(ś|s)ro|czw|pi(ą|a)|sob)/i,abbreviated:/^(niedz|pon|wt|(ś|s)r|czw|pt|sob)\.?/i,wide:/^(niedziela|poniedzia(ł|l)ek|wtorek|(ś|s)roda|czwartek|pi(ą|a)tek|sobota)/i},Li={narrow:[/^n/i,/^p/i,/^w/i,/^ś/i,/^c/i,/^p/i,/^s/i],abbreviated:[/^n/i,/^po/i,/^w/i,/^(ś|s)r/i,/^c/i,/^pt/i,/^so/i],any:[/^n/i,/^po/i,/^w/i,/^(ś|s)r/i,/^c/i,/^pi/i,/^so/i]},Hi={narrow:/^(^a$|^p$|pó(ł|l)n\.?|o\s*pó(ł|l)n\.?|po(ł|l)\.?|w\s*po(ł|l)\.?|po\s*po(ł|l)\.?|rano|wiecz\.?|noc|w\s*nocy)/i,any:/^(am|pm|pó(ł|l)noc|o\s*pó(ł|l)nocy|po(ł|l)udnie|w\s*po(ł|l)udnie|popo(ł|l)udnie|po\s*po(ł|l)udniu|rano|wieczór|wieczorem|noc|w\s*nocy)/i},Oi={narrow:{am:/^a$/i,pm:/^p$/i,midnight:/pó(ł|l)n/i,noon:/po(ł|l)/i,morning:/rano/i,afternoon:/po\s*po(ł|l)/i,evening:/wiecz/i,night:/noc/i},any:{am:/^am/i,pm:/^pm/i,midnight:/pó(ł|l)n/i,noon:/po(ł|l)/i,morning:/rano/i,afternoon:/po\s*po(ł|l)/i,evening:/wiecz/i,night:/noc/i}},Gi={ordinalNumber:y({matchPattern:ji,parsePattern:Ti,valueCallback:e=>parseInt(e,10)}),era:s({matchPatterns:$i,defaultMatchWidth:"wide",parsePatterns:Di,defaultParseWidth:"any"}),quarter:s({matchPatterns:Si,defaultMatchWidth:"wide",parsePatterns:Ci,defaultParseWidth:"any",valueCallback:e=>e+1}),month:s({matchPatterns:Ni,defaultMatchWidth:"wide",parsePatterns:Ai,defaultParseWidth:"any"}),day:s({matchPatterns:Ei,defaultMatchWidth:"wide",parsePatterns:Li,defaultParseWidth:"any"}),dayPeriod:s({matchPatterns:Hi,defaultMatchWidth:"any",parsePatterns:Oi,defaultParseWidth:"any"})},Vi={code:"pl",formatDistance:oi,formatLong:mi,formatRelative:pi,localize:zi,match:Gi,options:{weekStartsOn:1,firstWeekContainsDate:4}},Fi={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"aproximadamente 1 hora",other:"aproximadamente {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"aproximadamente 1 semana",other:"aproximadamente {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"aproximadamente 1 mês",other:"aproximadamente {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"aproximadamente 1 ano",other:"aproximadamente {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},Ii=(e,a,n)=>{let t;const i=Fi[e];return typeof i=="string"?t=i:a===1?t=i.one:t=i.other.replace("{{count}}",String(a)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"daqui a "+t:"há "+t:t},Xi={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d 'de' MMM 'de' y",short:"dd/MM/y"},Ri={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Ji={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},qi={date:l({formats:Xi,defaultWidth:"full"}),time:l({formats:Ri,defaultWidth:"full"}),dateTime:l({formats:Ji,defaultWidth:"full"})},Yi={lastWeek:e=>{const a=e.getDay();return"'"+(a===0||a===6?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},_i=(e,a,n,t)=>{const i=Yi[e];return typeof i=="function"?i(a):i},Bi={narrow:["aC","dC"],abbreviated:["a.C.","d.C."],wide:["antes de Cristo","depois de Cristo"]},Qi={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},Ui={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},Ki={narrow:["d","s","t","q","q","s","s"],short:["dom","seg","ter","qua","qui","sex","sáb"],abbreviated:["dom","seg","ter","qua","qui","sex","sáb"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},Zi={narrow:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"},wide:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"}},er={narrow:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"},wide:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"}},tr=(e,a)=>Number(e)+"º",ar={ordinalNumber:tr,era:o({values:Bi,defaultWidth:"wide"}),quarter:o({values:Qi,defaultWidth:"wide",argumentCallback:e=>e-1}),month:o({values:Ui,defaultWidth:"wide"}),day:o({values:Ki,defaultWidth:"wide"}),dayPeriod:o({values:Zi,defaultWidth:"wide",formattingValues:er,defaultFormattingWidth:"wide"})},nr=/^(\d+)(º|ª)?/i,ir=/\d+/i,rr={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes da era comum|depois de cristo|era comum)/i},or={any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes da era comum)/i,/^(depois de cristo|era comum)/i]},sr={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º|ª)? trimestre/i},dr={any:[/1/i,/2/i,/3/i,/4/i]},ur={narrow:/^[jfmasond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},mr={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ab/i,/^mai/i,/^jun/i,/^jul/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},lr={narrow:/^[dstq]/i,short:/^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,wide:/^(domingo|segunda-?\s?feira|terça-?\s?feira|quarta-?\s?feira|quinta-?\s?feira|sexta-?\s?feira|s[áa]bado)/i},cr={narrow:[/^d/i,/^s/i,/^t/i,/^q/i,/^q/i,/^s/i,/^s/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[áa]/i]},hr={narrow:/^(a|p|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i,any:/^([ap]\.?\s?m\.?|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i},gr={any:{am:/^a/i,pm:/^p/i,midnight:/^meia/i,noon:/^meio/i,morning:/manh[ãa]/i,afternoon:/tarde/i,evening:/noite/i,night:/madrugada/i}},fr={ordinalNumber:y({matchPattern:nr,parsePattern:ir,valueCallback:e=>parseInt(e,10)}),era:s({matchPatterns:rr,defaultMatchWidth:"wide",parsePatterns:or,defaultParseWidth:"any"}),quarter:s({matchPatterns:sr,defaultMatchWidth:"wide",parsePatterns:dr,defaultParseWidth:"any",valueCallback:e=>e+1}),month:s({matchPatterns:ur,defaultMatchWidth:"wide",parsePatterns:mr,defaultParseWidth:"any"}),day:s({matchPatterns:lr,defaultMatchWidth:"wide",parsePatterns:cr,defaultParseWidth:"any"}),dayPeriod:s({matchPatterns:hr,defaultMatchWidth:"any",parsePatterns:gr,defaultParseWidth:"any"})},pr={code:"pt",formatDistance:Ii,formatLong:qi,formatRelative:_i,localize:ar,match:fr,options:{weekStartsOn:1,firstWeekContainsDate:4}},vr={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"cerca de 1 hora",other:"cerca de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"cerca de 1 semana",other:"cerca de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"cerca de 1 mês",other:"cerca de {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"cerca de 1 ano",other:"cerca de {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},wr=(e,a,n)=>{let t;const i=vr[e];return typeof i=="string"?t=i:a===1?t=i.one:t=i.other.replace("{{count}}",String(a)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"em "+t:"há "+t:t},yr={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},br={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Mr={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Pr={date:l({formats:yr,defaultWidth:"full"}),time:l({formats:br,defaultWidth:"full"}),dateTime:l({formats:Mr,defaultWidth:"full"})},kr={lastWeek:e=>{const a=e.getDay();return"'"+(a===0||a===6?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},xr=(e,a,n,t)=>{const i=kr[e];return typeof i=="function"?i(a):i},Wr={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},zr={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},jr={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},Tr={narrow:["D","S","T","Q","Q","S","S"],short:["dom","seg","ter","qua","qui","sex","sab"],abbreviated:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},$r={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"}},Dr={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"}},Sr=(e,a)=>{const n=Number(e);return(a==null?void 0:a.unit)==="week"?n+"ª":n+"º"},Cr={ordinalNumber:Sr,era:o({values:Wr,defaultWidth:"wide"}),quarter:o({values:zr,defaultWidth:"wide",argumentCallback:e=>e-1}),month:o({values:jr,defaultWidth:"wide"}),day:o({values:Tr,defaultWidth:"wide"}),dayPeriod:o({values:$r,defaultWidth:"wide",formattingValues:Dr,defaultFormattingWidth:"wide"})},Nr=/^(\d+)[ºªo]?/i,Ar=/\d+/i,Er={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},Lr={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},Hr={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},Or={any:[/1/i,/2/i,/3/i,/4/i]},Gr={narrow:/^[jfmajsond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},Vr={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^fev/i,/^mar/i,/^abr/i,/^mai/i,/^jun/i,/^jul/i,/^ago/i,/^set/i,/^out/i,/^nov/i,/^dez/i]},Fr={narrow:/^(dom|[23456]ª?|s[aá]b)/i,short:/^(dom|[23456]ª?|s[aá]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,wide:/^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i},Ir={short:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],narrow:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[aá]b/i]},Xr={narrow:/^(a|p|mn|md|(da) (manhã|tarde|noite))/i,any:/^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i},Rr={any:{am:/^a/i,pm:/^p/i,midnight:/^mn|^meia[-\s]noite/i,noon:/^md|^meio[-\s]dia/i,morning:/manhã/i,afternoon:/tarde/i,evening:/tarde/i,night:/noite/i}},Jr={ordinalNumber:y({matchPattern:Nr,parsePattern:Ar,valueCallback:e=>parseInt(e,10)}),era:s({matchPatterns:Er,defaultMatchWidth:"wide",parsePatterns:Lr,defaultParseWidth:"any"}),quarter:s({matchPatterns:Hr,defaultMatchWidth:"wide",parsePatterns:Or,defaultParseWidth:"any",valueCallback:e=>e+1}),month:s({matchPatterns:Gr,defaultMatchWidth:"wide",parsePatterns:Vr,defaultParseWidth:"any"}),day:s({matchPatterns:Fr,defaultMatchWidth:"wide",parsePatterns:Ir,defaultParseWidth:"any"}),dayPeriod:s({matchPatterns:Xr,defaultMatchWidth:"any",parsePatterns:Rr,defaultParseWidth:"any"})},qr={code:"pt-BR",formatDistance:wr,formatLong:Pr,formatRelative:xr,localize:Cr,match:Jr,options:{weekStartsOn:0,firstWeekContainsDate:1}};function W(e,a){if(e.one!==void 0&&a===1)return e.one;const n=a%10,t=a%100;return n===1&&t!==11?e.singularNominative.replace("{{count}}",String(a)):n>=2&&n<=4&&(t<10||t>20)?e.singularGenitive.replace("{{count}}",String(a)):e.pluralGenitive.replace("{{count}}",String(a))}function f(e){return(a,n)=>n!=null&&n.addSuffix?n.comparison&&n.comparison>0?e.future?W(e.future,a):"через "+W(e.regular,a):e.past?W(e.past,a):W(e.regular,a)+" назад":W(e.regular,a)}const Yr={lessThanXSeconds:f({regular:{one:"меньше секунды",singularNominative:"меньше {{count}} секунды",singularGenitive:"меньше {{count}} секунд",pluralGenitive:"меньше {{count}} секунд"},future:{one:"меньше, чем через секунду",singularNominative:"меньше, чем через {{count}} секунду",singularGenitive:"меньше, чем через {{count}} секунды",pluralGenitive:"меньше, чем через {{count}} секунд"}}),xSeconds:f({regular:{singularNominative:"{{count}} секунда",singularGenitive:"{{count}} секунды",pluralGenitive:"{{count}} секунд"},past:{singularNominative:"{{count}} секунду назад",singularGenitive:"{{count}} секунды назад",pluralGenitive:"{{count}} секунд назад"},future:{singularNominative:"через {{count}} секунду",singularGenitive:"через {{count}} секунды",pluralGenitive:"через {{count}} секунд"}}),halfAMinute:(e,a)=>a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"через полминуты":"полминуты назад":"полминуты",lessThanXMinutes:f({regular:{one:"меньше минуты",singularNominative:"меньше {{count}} минуты",singularGenitive:"меньше {{count}} минут",pluralGenitive:"меньше {{count}} минут"},future:{one:"меньше, чем через минуту",singularNominative:"меньше, чем через {{count}} минуту",singularGenitive:"меньше, чем через {{count}} минуты",pluralGenitive:"меньше, чем через {{count}} минут"}}),xMinutes:f({regular:{singularNominative:"{{count}} минута",singularGenitive:"{{count}} минуты",pluralGenitive:"{{count}} минут"},past:{singularNominative:"{{count}} минуту назад",singularGenitive:"{{count}} минуты назад",pluralGenitive:"{{count}} минут назад"},future:{singularNominative:"через {{count}} минуту",singularGenitive:"через {{count}} минуты",pluralGenitive:"через {{count}} минут"}}),aboutXHours:f({regular:{singularNominative:"около {{count}} часа",singularGenitive:"около {{count}} часов",pluralGenitive:"около {{count}} часов"},future:{singularNominative:"приблизительно через {{count}} час",singularGenitive:"приблизительно через {{count}} часа",pluralGenitive:"приблизительно через {{count}} часов"}}),xHours:f({regular:{singularNominative:"{{count}} час",singularGenitive:"{{count}} часа",pluralGenitive:"{{count}} часов"}}),xDays:f({regular:{singularNominative:"{{count}} день",singularGenitive:"{{count}} дня",pluralGenitive:"{{count}} дней"}}),aboutXWeeks:f({regular:{singularNominative:"около {{count}} недели",singularGenitive:"около {{count}} недель",pluralGenitive:"около {{count}} недель"},future:{singularNominative:"приблизительно через {{count}} неделю",singularGenitive:"приблизительно через {{count}} недели",pluralGenitive:"приблизительно через {{count}} недель"}}),xWeeks:f({regular:{singularNominative:"{{count}} неделя",singularGenitive:"{{count}} недели",pluralGenitive:"{{count}} недель"}}),aboutXMonths:f({regular:{singularNominative:"около {{count}} месяца",singularGenitive:"около {{count}} месяцев",pluralGenitive:"около {{count}} месяцев"},future:{singularNominative:"приблизительно через {{count}} месяц",singularGenitive:"приблизительно через {{count}} месяца",pluralGenitive:"приблизительно через {{count}} месяцев"}}),xMonths:f({regular:{singularNominative:"{{count}} месяц",singularGenitive:"{{count}} месяца",pluralGenitive:"{{count}} месяцев"}}),aboutXYears:f({regular:{singularNominative:"около {{count}} года",singularGenitive:"около {{count}} лет",pluralGenitive:"около {{count}} лет"},future:{singularNominative:"приблизительно через {{count}} год",singularGenitive:"приблизительно через {{count}} года",pluralGenitive:"приблизительно через {{count}} лет"}}),xYears:f({regular:{singularNominative:"{{count}} год",singularGenitive:"{{count}} года",pluralGenitive:"{{count}} лет"}}),overXYears:f({regular:{singularNominative:"больше {{count}} года",singularGenitive:"больше {{count}} лет",pluralGenitive:"больше {{count}} лет"},future:{singularNominative:"больше, чем через {{count}} год",singularGenitive:"больше, чем через {{count}} года",pluralGenitive:"больше, чем через {{count}} лет"}}),almostXYears:f({regular:{singularNominative:"почти {{count}} год",singularGenitive:"почти {{count}} года",pluralGenitive:"почти {{count}} лет"},future:{singularNominative:"почти через {{count}} год",singularGenitive:"почти через {{count}} года",pluralGenitive:"почти через {{count}} лет"}})},_r=(e,a,n)=>Yr[e](a,n),Br={full:"EEEE, d MMMM y 'г.'",long:"d MMMM y 'г.'",medium:"d MMM y 'г.'",short:"dd.MM.y"},Qr={full:"H:mm:ss zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},Ur={any:"{{date}}, {{time}}"},Kr={date:l({formats:Br,defaultWidth:"full"}),time:l({formats:Qr,defaultWidth:"full"}),dateTime:l({formats:Ur,defaultWidth:"any"})},X=["воскресенье","понедельник","вторник","среду","четверг","пятницу","субботу"];function Zr(e){const a=X[e];switch(e){case 0:return"'в прошлое "+a+" в' p";case 1:case 2:case 4:return"'в прошлый "+a+" в' p";case 3:case 5:case 6:return"'в прошлую "+a+" в' p"}}function te(e){const a=X[e];return e===2?"'во "+a+" в' p":"'в "+a+" в' p"}function eo(e){const a=X[e];switch(e){case 0:return"'в следующее "+a+" в' p";case 1:case 2:case 4:return"'в следующий "+a+" в' p";case 3:case 5:case 6:return"'в следующую "+a+" в' p"}}const to={lastWeek:(e,a,n)=>{const t=e.getDay();return M(e,a,n)?te(t):Zr(t)},yesterday:"'вчера в' p",today:"'сегодня в' p",tomorrow:"'завтра в' p",nextWeek:(e,a,n)=>{const t=e.getDay();return M(e,a,n)?te(t):eo(t)},other:"P"},ao=(e,a,n,t)=>{const i=to[e];return typeof i=="function"?i(a,n,t):i},no={narrow:["до н.э.","н.э."],abbreviated:["до н. э.","н. э."],wide:["до нашей эры","нашей эры"]},io={narrow:["1","2","3","4"],abbreviated:["1-й кв.","2-й кв.","3-й кв.","4-й кв."],wide:["1-й квартал","2-й квартал","3-й квартал","4-й квартал"]},ro={narrow:["Я","Ф","М","А","М","И","И","А","С","О","Н","Д"],abbreviated:["янв.","фев.","март","апр.","май","июнь","июль","авг.","сент.","окт.","нояб.","дек."],wide:["январь","февраль","март","апрель","май","июнь","июль","август","сентябрь","октябрь","ноябрь","декабрь"]},oo={narrow:["Я","Ф","М","А","М","И","И","А","С","О","Н","Д"],abbreviated:["янв.","фев.","мар.","апр.","мая","июн.","июл.","авг.","сент.","окт.","нояб.","дек."],wide:["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"]},so={narrow:["В","П","В","С","Ч","П","С"],short:["вс","пн","вт","ср","чт","пт","сб"],abbreviated:["вск","пнд","втр","срд","чтв","птн","суб"],wide:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"]},uo={narrow:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утро",afternoon:"день",evening:"веч.",night:"ночь"},abbreviated:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утро",afternoon:"день",evening:"веч.",night:"ночь"},wide:{am:"ДП",pm:"ПП",midnight:"полночь",noon:"полдень",morning:"утро",afternoon:"день",evening:"вечер",night:"ночь"}},mo={narrow:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утра",afternoon:"дня",evening:"веч.",night:"ночи"},abbreviated:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утра",afternoon:"дня",evening:"веч.",night:"ночи"},wide:{am:"ДП",pm:"ПП",midnight:"полночь",noon:"полдень",morning:"утра",afternoon:"дня",evening:"вечера",night:"ночи"}},lo=(e,a)=>{const n=Number(e),t=a==null?void 0:a.unit;let i;return t==="date"?i="-е":t==="week"||t==="minute"||t==="second"?i="-я":i="-й",n+i},co={ordinalNumber:lo,era:o({values:no,defaultWidth:"wide"}),quarter:o({values:io,defaultWidth:"wide",argumentCallback:e=>e-1}),month:o({values:ro,defaultWidth:"wide",formattingValues:oo,defaultFormattingWidth:"wide"}),day:o({values:so,defaultWidth:"wide"}),dayPeriod:o({values:uo,defaultWidth:"any",formattingValues:mo,defaultFormattingWidth:"wide"})},ho=/^(\d+)(-?(е|я|й|ое|ье|ая|ья|ый|ой|ий|ый))?/i,go=/\d+/i,fo={narrow:/^((до )?н\.?\s?э\.?)/i,abbreviated:/^((до )?н\.?\s?э\.?)/i,wide:/^(до нашей эры|нашей эры|наша эра)/i},po={any:[/^д/i,/^н/i]},vo={narrow:/^[1234]/i,abbreviated:/^[1234](-?[ыои]?й?)? кв.?/i,wide:/^[1234](-?[ыои]?й?)? квартал/i},wo={any:[/1/i,/2/i,/3/i,/4/i]},yo={narrow:/^[яфмаисонд]/i,abbreviated:/^(янв|фев|март?|апр|ма[йя]|июн[ья]?|июл[ья]?|авг|сент?|окт|нояб?|дек)\.?/i,wide:/^(январ[ья]|феврал[ья]|марта?|апрел[ья]|ма[йя]|июн[ья]|июл[ья]|августа?|сентябр[ья]|октябр[ья]|октябр[ья]|ноябр[ья]|декабр[ья])/i},bo={narrow:[/^я/i,/^ф/i,/^м/i,/^а/i,/^м/i,/^и/i,/^и/i,/^а/i,/^с/i,/^о/i,/^н/i,/^я/i],any:[/^я/i,/^ф/i,/^мар/i,/^ап/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^ав/i,/^с/i,/^о/i,/^н/i,/^д/i]},Mo={narrow:/^[впсч]/i,short:/^(вс|во|пн|по|вт|ср|чт|че|пт|пя|сб|су)\.?/i,abbreviated:/^(вск|вос|пнд|пон|втр|вто|срд|сре|чтв|чет|птн|пят|суб).?/i,wide:/^(воскресень[ея]|понедельника?|вторника?|сред[аы]|четверга?|пятниц[аы]|суббот[аы])/i},Po={narrow:[/^в/i,/^п/i,/^в/i,/^с/i,/^ч/i,/^п/i,/^с/i],any:[/^в[ос]/i,/^п[он]/i,/^в/i,/^ср/i,/^ч/i,/^п[ят]/i,/^с[уб]/i]},ko={narrow:/^([дп]п|полн\.?|полд\.?|утр[оа]|день|дня|веч\.?|ноч[ьи])/i,abbreviated:/^([дп]п|полн\.?|полд\.?|утр[оа]|день|дня|веч\.?|ноч[ьи])/i,wide:/^([дп]п|полночь|полдень|утр[оа]|день|дня|вечера?|ноч[ьи])/i},xo={any:{am:/^дп/i,pm:/^пп/i,midnight:/^полн/i,noon:/^полд/i,morning:/^у/i,afternoon:/^д[ен]/i,evening:/^в/i,night:/^н/i}},Wo={ordinalNumber:y({matchPattern:ho,parsePattern:go,valueCallback:e=>parseInt(e,10)}),era:s({matchPatterns:fo,defaultMatchWidth:"wide",parsePatterns:po,defaultParseWidth:"any"}),quarter:s({matchPatterns:vo,defaultMatchWidth:"wide",parsePatterns:wo,defaultParseWidth:"any",valueCallback:e=>e+1}),month:s({matchPatterns:yo,defaultMatchWidth:"wide",parsePatterns:bo,defaultParseWidth:"any"}),day:s({matchPatterns:Mo,defaultMatchWidth:"wide",parsePatterns:Po,defaultParseWidth:"any"}),dayPeriod:s({matchPatterns:ko,defaultMatchWidth:"wide",parsePatterns:xo,defaultParseWidth:"any"})},zo={code:"ru",formatDistance:_r,formatLong:Kr,formatRelative:ao,localize:co,match:Wo,options:{weekStartsOn:1,firstWeekContainsDate:1}};function z(e,a){if(e.one!==void 0&&a===1)return e.one;const n=a%10,t=a%100;return n===1&&t!==11?e.singularNominative.replace("{{count}}",String(a)):n>=2&&n<=4&&(t<10||t>20)?e.singularGenitive.replace("{{count}}",String(a)):e.pluralGenitive.replace("{{count}}",String(a))}function p(e){return(a,n)=>n&&n.addSuffix?n.comparison&&n.comparison>0?e.future?z(e.future,a):"за "+z(e.regular,a):e.past?z(e.past,a):z(e.regular,a)+" тому":z(e.regular,a)}const jo=(e,a)=>a&&a.addSuffix?a.comparison&&a.comparison>0?"за півхвилини":"півхвилини тому":"півхвилини",To={lessThanXSeconds:p({regular:{one:"менше секунди",singularNominative:"менше {{count}} секунди",singularGenitive:"менше {{count}} секунд",pluralGenitive:"менше {{count}} секунд"},future:{one:"менше, ніж за секунду",singularNominative:"менше, ніж за {{count}} секунду",singularGenitive:"менше, ніж за {{count}} секунди",pluralGenitive:"менше, ніж за {{count}} секунд"}}),xSeconds:p({regular:{singularNominative:"{{count}} секунда",singularGenitive:"{{count}} секунди",pluralGenitive:"{{count}} секунд"},past:{singularNominative:"{{count}} секунду тому",singularGenitive:"{{count}} секунди тому",pluralGenitive:"{{count}} секунд тому"},future:{singularNominative:"за {{count}} секунду",singularGenitive:"за {{count}} секунди",pluralGenitive:"за {{count}} секунд"}}),halfAMinute:jo,lessThanXMinutes:p({regular:{one:"менше хвилини",singularNominative:"менше {{count}} хвилини",singularGenitive:"менше {{count}} хвилин",pluralGenitive:"менше {{count}} хвилин"},future:{one:"менше, ніж за хвилину",singularNominative:"менше, ніж за {{count}} хвилину",singularGenitive:"менше, ніж за {{count}} хвилини",pluralGenitive:"менше, ніж за {{count}} хвилин"}}),xMinutes:p({regular:{singularNominative:"{{count}} хвилина",singularGenitive:"{{count}} хвилини",pluralGenitive:"{{count}} хвилин"},past:{singularNominative:"{{count}} хвилину тому",singularGenitive:"{{count}} хвилини тому",pluralGenitive:"{{count}} хвилин тому"},future:{singularNominative:"за {{count}} хвилину",singularGenitive:"за {{count}} хвилини",pluralGenitive:"за {{count}} хвилин"}}),aboutXHours:p({regular:{singularNominative:"близько {{count}} години",singularGenitive:"близько {{count}} годин",pluralGenitive:"близько {{count}} годин"},future:{singularNominative:"приблизно за {{count}} годину",singularGenitive:"приблизно за {{count}} години",pluralGenitive:"приблизно за {{count}} годин"}}),xHours:p({regular:{singularNominative:"{{count}} годину",singularGenitive:"{{count}} години",pluralGenitive:"{{count}} годин"}}),xDays:p({regular:{singularNominative:"{{count}} день",singularGenitive:"{{count}} днi",pluralGenitive:"{{count}} днів"}}),aboutXWeeks:p({regular:{singularNominative:"близько {{count}} тижня",singularGenitive:"близько {{count}} тижнів",pluralGenitive:"близько {{count}} тижнів"},future:{singularNominative:"приблизно за {{count}} тиждень",singularGenitive:"приблизно за {{count}} тижні",pluralGenitive:"приблизно за {{count}} тижнів"}}),xWeeks:p({regular:{singularNominative:"{{count}} тиждень",singularGenitive:"{{count}} тижні",pluralGenitive:"{{count}} тижнів"}}),aboutXMonths:p({regular:{singularNominative:"близько {{count}} місяця",singularGenitive:"близько {{count}} місяців",pluralGenitive:"близько {{count}} місяців"},future:{singularNominative:"приблизно за {{count}} місяць",singularGenitive:"приблизно за {{count}} місяці",pluralGenitive:"приблизно за {{count}} місяців"}}),xMonths:p({regular:{singularNominative:"{{count}} місяць",singularGenitive:"{{count}} місяці",pluralGenitive:"{{count}} місяців"}}),aboutXYears:p({regular:{singularNominative:"близько {{count}} року",singularGenitive:"близько {{count}} років",pluralGenitive:"близько {{count}} років"},future:{singularNominative:"приблизно за {{count}} рік",singularGenitive:"приблизно за {{count}} роки",pluralGenitive:"приблизно за {{count}} років"}}),xYears:p({regular:{singularNominative:"{{count}} рік",singularGenitive:"{{count}} роки",pluralGenitive:"{{count}} років"}}),overXYears:p({regular:{singularNominative:"більше {{count}} року",singularGenitive:"більше {{count}} років",pluralGenitive:"більше {{count}} років"},future:{singularNominative:"більше, ніж за {{count}} рік",singularGenitive:"більше, ніж за {{count}} роки",pluralGenitive:"більше, ніж за {{count}} років"}}),almostXYears:p({regular:{singularNominative:"майже {{count}} рік",singularGenitive:"майже {{count}} роки",pluralGenitive:"майже {{count}} років"},future:{singularNominative:"майже за {{count}} рік",singularGenitive:"майже за {{count}} роки",pluralGenitive:"майже за {{count}} років"}})},$o=(e,a,n)=>(n=n||{},To[e](a,n)),Do={full:"EEEE, do MMMM y 'р.'",long:"do MMMM y 'р.'",medium:"d MMM y 'р.'",short:"dd.MM.y"},So={full:"H:mm:ss zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},Co={full:"{{date}} 'о' {{time}}",long:"{{date}} 'о' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},No={date:l({formats:Do,defaultWidth:"full"}),time:l({formats:So,defaultWidth:"full"}),dateTime:l({formats:Co,defaultWidth:"full"})},R=["неділю","понеділок","вівторок","середу","четвер","п’ятницю","суботу"];function Ao(e){const a=R[e];switch(e){case 0:case 3:case 5:case 6:return"'у минулу "+a+" о' p";case 1:case 2:case 4:return"'у минулий "+a+" о' p"}}function ue(e){return"'у "+R[e]+" о' p"}function Eo(e){const a=R[e];switch(e){case 0:case 3:case 5:case 6:return"'у наступну "+a+" о' p";case 1:case 2:case 4:return"'у наступний "+a+" о' p"}}const Lo=(e,a,n)=>{const t=de(e),i=t.getDay();return M(t,a,n)?ue(i):Ao(i)},Ho=(e,a,n)=>{const t=de(e),i=t.getDay();return M(t,a,n)?ue(i):Eo(i)},Oo={lastWeek:Lo,yesterday:"'вчора о' p",today:"'сьогодні о' p",tomorrow:"'завтра о' p",nextWeek:Ho,other:"P"},Go=(e,a,n,t)=>{const i=Oo[e];return typeof i=="function"?i(a,n,t):i},Vo={narrow:["до н.е.","н.е."],abbreviated:["до н. е.","н. е."],wide:["до нашої ери","нашої ери"]},Fo={narrow:["1","2","3","4"],abbreviated:["1-й кв.","2-й кв.","3-й кв.","4-й кв."],wide:["1-й квартал","2-й квартал","3-й квартал","4-й квартал"]},Io={narrow:["С","Л","Б","К","Т","Ч","Л","С","В","Ж","Л","Г"],abbreviated:["січ.","лют.","берез.","квіт.","трав.","черв.","лип.","серп.","верес.","жовт.","листоп.","груд."],wide:["січень","лютий","березень","квітень","травень","червень","липень","серпень","вересень","жовтень","листопад","грудень"]},Xo={narrow:["С","Л","Б","К","Т","Ч","Л","С","В","Ж","Л","Г"],abbreviated:["січ.","лют.","берез.","квіт.","трав.","черв.","лип.","серп.","верес.","жовт.","листоп.","груд."],wide:["січня","лютого","березня","квітня","травня","червня","липня","серпня","вересня","жовтня","листопада","грудня"]},Ro={narrow:["Н","П","В","С","Ч","П","С"],short:["нд","пн","вт","ср","чт","пт","сб"],abbreviated:["нед","пон","вів","сер","чтв","птн","суб"],wide:["неділя","понеділок","вівторок","середа","четвер","п’ятниця","субота"]},Jo={narrow:{am:"ДП",pm:"ПП",midnight:"півн.",noon:"пол.",morning:"ранок",afternoon:"день",evening:"веч.",night:"ніч"},abbreviated:{am:"ДП",pm:"ПП",midnight:"півн.",noon:"пол.",morning:"ранок",afternoon:"день",evening:"веч.",night:"ніч"},wide:{am:"ДП",pm:"ПП",midnight:"північ",noon:"полудень",morning:"ранок",afternoon:"день",evening:"вечір",night:"ніч"}},qo={narrow:{am:"ДП",pm:"ПП",midnight:"півн.",noon:"пол.",morning:"ранку",afternoon:"дня",evening:"веч.",night:"ночі"},abbreviated:{am:"ДП",pm:"ПП",midnight:"півн.",noon:"пол.",morning:"ранку",afternoon:"дня",evening:"веч.",night:"ночі"},wide:{am:"ДП",pm:"ПП",midnight:"північ",noon:"полудень",morning:"ранку",afternoon:"дня",evening:"веч.",night:"ночі"}},Yo=(e,a)=>{const n=String(a==null?void 0:a.unit),t=Number(e);let i;return n==="date"?t===3||t===23?i="-є":i="-е":n==="minute"||n==="second"||n==="hour"?i="-а":i="-й",t+i},_o={ordinalNumber:Yo,era:o({values:Vo,defaultWidth:"wide"}),quarter:o({values:Fo,defaultWidth:"wide",argumentCallback:e=>e-1}),month:o({values:Io,defaultWidth:"wide",formattingValues:Xo,defaultFormattingWidth:"wide"}),day:o({values:Ro,defaultWidth:"wide"}),dayPeriod:o({values:Jo,defaultWidth:"any",formattingValues:qo,defaultFormattingWidth:"wide"})},Bo=/^(\d+)(-?(е|й|є|а|я))?/i,Qo=/\d+/i,Uo={narrow:/^((до )?н\.?\s?е\.?)/i,abbreviated:/^((до )?н\.?\s?е\.?)/i,wide:/^(до нашої ери|нашої ери|наша ера)/i},Ko={any:[/^д/i,/^н/i]},Zo={narrow:/^[1234]/i,abbreviated:/^[1234](-?[иі]?й?)? кв.?/i,wide:/^[1234](-?[иі]?й?)? квартал/i},es={any:[/1/i,/2/i,/3/i,/4/i]},ts={narrow:/^[слбктчвжг]/i,abbreviated:/^(січ|лют|бер(ез)?|квіт|трав|черв|лип|серп|вер(ес)?|жовт|лис(топ)?|груд)\.?/i,wide:/^(січень|січня|лютий|лютого|березень|березня|квітень|квітня|травень|травня|червня|червень|липень|липня|серпень|серпня|вересень|вересня|жовтень|жовтня|листопад[а]?|грудень|грудня)/i},as={narrow:[/^с/i,/^л/i,/^б/i,/^к/i,/^т/i,/^ч/i,/^л/i,/^с/i,/^в/i,/^ж/i,/^л/i,/^г/i],any:[/^сі/i,/^лю/i,/^б/i,/^к/i,/^т/i,/^ч/i,/^лип/i,/^се/i,/^в/i,/^ж/i,/^лис/i,/^г/i]},ns={narrow:/^[нпвсч]/i,short:/^(нд|пн|вт|ср|чт|пт|сб)\.?/i,abbreviated:/^(нед|пон|вів|сер|че?тв|птн?|суб)\.?/i,wide:/^(неділ[яі]|понеділ[ок][ка]|вівтор[ок][ка]|серед[аи]|четвер(га)?|п\W*?ятниц[яі]|субот[аи])/i},is={narrow:[/^н/i,/^п/i,/^в/i,/^с/i,/^ч/i,/^п/i,/^с/i],any:[/^н/i,/^п[он]/i,/^в/i,/^с[ер]/i,/^ч/i,/^п\W*?[ят]/i,/^с[уб]/i]},rs={narrow:/^([дп]п|півн\.?|пол\.?|ранок|ранку|день|дня|веч\.?|ніч|ночі)/i,abbreviated:/^([дп]п|півн\.?|пол\.?|ранок|ранку|день|дня|веч\.?|ніч|ночі)/i,wide:/^([дп]п|північ|полудень|ранок|ранку|день|дня|вечір|вечора|ніч|ночі)/i},os={any:{am:/^дп/i,pm:/^пп/i,midnight:/^півн/i,noon:/^пол/i,morning:/^р/i,afternoon:/^д[ен]/i,evening:/^в/i,night:/^н/i}},ss={ordinalNumber:y({matchPattern:Bo,parsePattern:Qo,valueCallback:e=>parseInt(e,10)}),era:s({matchPatterns:Uo,defaultMatchWidth:"wide",parsePatterns:Ko,defaultParseWidth:"any"}),quarter:s({matchPatterns:Zo,defaultMatchWidth:"wide",parsePatterns:es,defaultParseWidth:"any",valueCallback:e=>e+1}),month:s({matchPatterns:ts,defaultMatchWidth:"wide",parsePatterns:as,defaultParseWidth:"any"}),day:s({matchPatterns:ns,defaultMatchWidth:"wide",parsePatterns:is,defaultParseWidth:"any"}),dayPeriod:s({matchPatterns:rs,defaultMatchWidth:"wide",parsePatterns:os,defaultParseWidth:"any"})},ds={code:"uk",formatDistance:$o,formatLong:No,formatRelative:Go,localize:_o,match:ss,options:{weekStartsOn:1,firstWeekContainsDate:1}},us={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},ms=(e,a,n)=>{let t;const i=us[e];return typeof i=="string"?t=i:a===1?t=i.one:t=i.other.replace("{{count}}",String(a)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?t+"内":t+"前":t},ls={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},cs={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},hs={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},gs={date:l({formats:ls,defaultWidth:"full"}),time:l({formats:cs,defaultWidth:"full"}),dateTime:l({formats:hs,defaultWidth:"full"})};function ae(e,a,n){const t="eeee p";return M(e,a,n)?t:e.getTime()>a.getTime()?"'下个'"+t:"'上个'"+t}const fs={lastWeek:ae,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:ae,other:"PP p"},ps=(e,a,n,t)=>{const i=fs[e];return typeof i=="function"?i(a,n,t):i},vs={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},ws={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},ys={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},bs={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},Ms={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},Ps={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},ks=(e,a)=>{const n=Number(e);switch(a==null?void 0:a.unit){case"date":return n.toString()+"日";case"hour":return n.toString()+"时";case"minute":return n.toString()+"分";case"second":return n.toString()+"秒";default:return"第 "+n.toString()}},xs={ordinalNumber:ks,era:o({values:vs,defaultWidth:"wide"}),quarter:o({values:ws,defaultWidth:"wide",argumentCallback:e=>e-1}),month:o({values:ys,defaultWidth:"wide"}),day:o({values:bs,defaultWidth:"wide"}),dayPeriod:o({values:Ms,defaultWidth:"wide",formattingValues:Ps,defaultFormattingWidth:"wide"})},Ws=/^(第\s*)?\d+(日|时|分|秒)?/i,zs=/\d+/i,js={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},Ts={any:[/^(前)/i,/^(公元)/i]},$s={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},Ds={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},Ss={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},Cs={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},Ns={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},As={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},Es={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},Ls={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},Hs={ordinalNumber:y({matchPattern:Ws,parsePattern:zs,valueCallback:e=>parseInt(e,10)}),era:s({matchPatterns:js,defaultMatchWidth:"wide",parsePatterns:Ts,defaultParseWidth:"any"}),quarter:s({matchPatterns:$s,defaultMatchWidth:"wide",parsePatterns:Ds,defaultParseWidth:"any",valueCallback:e=>e+1}),month:s({matchPatterns:Ss,defaultMatchWidth:"wide",parsePatterns:Cs,defaultParseWidth:"any"}),day:s({matchPatterns:Ns,defaultMatchWidth:"wide",parsePatterns:As,defaultParseWidth:"any"}),dayPeriod:s({matchPatterns:Es,defaultMatchWidth:"any",parsePatterns:Ls,defaultParseWidth:"any"})},Os={code:"zh-CN",formatDistance:ms,formatLong:gs,formatRelative:ps,localize:xs,match:Hs,options:{weekStartsOn:1,firstWeekContainsDate:4}};function Gs(e,a){const n=j(a);T(function(){a!==n.current&&e.attributionControl!=null&&(n.current!=null&&e.attributionControl.removeAttribution(n.current),a!=null&&e.attributionControl.addAttribution(a)),n.current=a},[e,a])}const Vs=1;function Fs(e){return Object.freeze({__version:Vs,map:e})}const me=ye(null),Is=me.Provider;function le(){const e=be(me);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of ");return e}function Xs(e){function a(n,t){const{instance:i}=e(n).current;return re(t,()=>i),null}return ie(a)}function Rs(e,a){const n=j();T(function(){return a!=null&&e.instance.on(a),n.current=a,function(){n.current!=null&&e.instance.off(n.current),n.current=null}},[e,a])}function ce(e,a){const n=e.pane??a.pane;return n?{...e,pane:n}:e}function Js(e,a,n){return Object.freeze({instance:e,context:a,container:n})}function qs(e,a){return a==null?function(t,i){const c=j();return c.current||(c.current=e(t,i)),c}:function(t,i){const c=j();c.current||(c.current=e(t,i));const m=j(t),{instance:g}=c.current;return T(function(){m.current!==t&&(a(g,t,m.current),m.current=t)},[g,t,i]),c}}function Ys(e,a){T(function(){return(a.layerContainer??a.map).addLayer(e.instance),function(){var c;(c=a.layerContainer)==null||c.removeLayer(e.instance),a.map.removeLayer(e.instance)}},[a,e])}function _s(e){return function(n){const t=le(),i=e(ce(n,t),t);return Gs(t.map,n.attribution),Rs(i.current,n.eventHandlers),Ys(i.current,t),i}}function Bs(e,a){const n=qs(e,a),t=_s(n);return Xs(t)}function Qs(e,a,n){const{opacity:t,zIndex:i}=a;t!=null&&t!==n.opacity&&e.setOpacity(t),i!=null&&i!==n.zIndex&&e.setZIndex(i)}function Us(){return le().map}function F(){return F=Object.assign||function(e){for(var a=1;a(u==null?void 0:u.map)??null,[u]);const ge=Me(J=>{if(J!==null&&u===null){const $=new oe.Map(J,x);n!=null&&w!=null?$.setView(n,w):e!=null&&$.fitBounds(e,a),h!=null&&$.whenReady(h),he(Fs($))}},[]);T(()=>()=>{u==null||u.map.remove()},[u]);const fe=u?G.createElement(Is,{value:u},t):m??null;return G.createElement("div",F({},b,{ref:ge}),fe)}const Zs=ie(Ks),ed=Bs(function({url:a,...n},t){const i=new oe.TileLayer(a,ce(n,t));return Js(i,t)},function(a,n,t){Qs(a,n,t);const{url:i}=n;i!=null&&i!==t.url&&a.setUrl(i)}),td="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH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/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=",ad="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC",nd="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAAB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crpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==";function id(e){var n;const a=Us();return(n=e.addMap)==null||n.call(e,a),null}class rd extends Pe{divRef;marker;map;latLongTimer;resizeTimer;constructor(a){super(a),this.state={zoom:14,latitude:this.props.latitude,longitude:this.props.longitude,width:0,height:0},this.divRef=G.createRef(),this.marker=null}onMap=a=>{if(!this.map||this.map!==a){this.map=a;const n=[parseFloat(this.state.latitude!==void 0?this.state.latitude:50)||0,parseFloat(this.state.longitude!==void 0?this.state.longitude:10)||0],t=window.L.icon({iconUrl:td,iconRetinaUrl:nd,shadowUrl:ad,iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]});this.marker=window.L.marker(n,{draggable:!0,title:"Resource location",alt:"Resource Location",riseOnHover:!0,icon:t}).addTo(a).bindPopup("Popup for any custom information.").on({dragend:i=>this.onMarkerDragend(i)})}};componentDidUpdate(){this.map&&this.marker&&(this.props.latitude!==this.state.latitude||this.props.longitude!==this.state.longitude)&&this.setState({latitude:this.props.latitude,longitude:this.props.longitude},()=>{this.latLongTimer&&clearTimeout(this.latLongTimer),this.latLongTimer=setTimeout(()=>{this.latLongTimer=null,this.map.flyTo([this.state.latitude,this.state.longitude]),this.marker.setLatLng([this.state.latitude,this.state.longitude])},500)}),this.divRef.current&&(this.state.width!==this.divRef.current.clientWidth||this.state.height!==this.divRef.current.clientHeight)&&(this.resizeTimer&&clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout(()=>{this.resizeTimer=null,this.divRef.current&&this.setState({width:this.divRef.current.clientWidth,height:this.divRef.current.clientHeight})},100))}componentWillUnmount(){this.latLongTimer&&(clearTimeout(this.latLongTimer),this.latLongTimer=null),this.resizeTimer&&(clearTimeout(this.resizeTimer),this.resizeTimer=null),this.marker&&(this.marker.off("dragend"),this.marker.remove(),this.marker=null),this.map&&(this.map.remove(),this.map=void 0)}onMarkerDragend=a=>{if(this.props.readOnly){this.map.flyTo([this.state.latitude,this.state.longitude]),this.marker.setLatLng([this.state.latitude,this.state.longitude]);return}const n=JSON.parse(JSON.stringify(a.target._latlng));this.setState({latitude:n.lat,longitude:n.lng},()=>this.props.onChange(this.state.latitude,this.state.longitude))};render(){const a=[parseFloat(this.props.latitude!==void 0?this.props.latitude:50)||0,parseFloat(this.props.longitude!==void 0?this.props.longitude:10)||0],{zoom:n}=this.state;return r.jsx("div",{style:{width:"100%",height:"100%",minHeight:350},ref:this.divRef,children:this.state.width&&this.state.height?r.jsxs(Zs,{style:{width:"100%",height:"100%",minHeight:350,borderRadius:5},center:a,zoom:n,maxZoom:18,attributionControl:!1,zoomControl:!0,doubleClickZoom:!0,scrollWheelZoom:!0,dragging:!this.props.readOnly,easeLinearity:.35,children:[r.jsx(ed,{url:"https://{s}.tile.osm.org/{z}/{x}/{y}.png"}),r.jsx(id,{addMap:t=>this.onMap(t)})]}):null})}}const od={en:se,fr:Ba,ru:zo,de:It,es:ya,br:qr,nl:ni,it:Tn,pt:pr,pl:Vi,uk:ds,"zh-cn":Os},O=["useSystemGPS","latitude","longitude","sunriseEvent","sunriseOffset","sunriseLimitStart","sunriseLimitEnd","sunsetEvent","sunsetOffset","sunsetLimitStart","sunsetLimitEnd"];function C(e){if(!e)return new Date;const a=e.split(":");return new Date(2e3,0,1,parseInt(a[0],10),parseInt(a[1],10))}function N(e){return e?`${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}`:""}function ne(e){const a=e.getHours().toString().padStart(2,"0"),n=e.getMinutes().toString().padStart(2,"0"),t=e.getSeconds().toString().padStart(2,"0");return`${a}:${n}:${t}`}class sd extends _.ConfigGeneric{calcTimeout;lastCalc;mounted=!1;constructor(a){super(a),Object.assign(this.state,{theme:d.Theme(this.props.themeName||"light")})}componentDidMount(){super.componentDidMount(),this.mounted=!0;const a={};O.forEach(n=>{a[n]=_.ConfigGeneric.getValue(this.props.data,n)}),a.sunsetOffset=a.sunsetOffset||0,a.sunriseOffset=a.sunriseOffset||0,a.sunriseLimitStart=C(a.sunriseLimitStart),a.sunriseLimitEnd=C(a.sunriseLimitEnd),a.sunsetLimitStart=C(a.sunsetLimitStart),a.sunsetLimitEnd=C(a.sunsetLimitEnd),a.useSystemGPS&&(a.latitude=this.props.oContext.systemConfig.latitude,a.longitude=this.props.oContext.systemConfig.longitude),a.ampm=this.props.oContext.systemConfig.dateFormat.includes("/"),this.setState(a,()=>this.onAstroChange())}componentWillUnmount(){this.mounted=!1,this.calcTimeout&&(clearTimeout(this.calcTimeout),this.calcTimeout=null)}renderMap(){return r.jsx(rd,{longitude:this.state.longitude,latitude:this.state.latitude,readOnly:!!this.state.useSystemGPS,onChange:(a,n)=>this.setState({latitude:a,longitude:n})})}onAstroChange(a,n){let t={};typeof a=="object"?t=a:a!==void 0&&(t={[a]:n}),this.setState(t,()=>{const i={};O.forEach(m=>i[m]=this.state[m]),i.sunriseLimitStart=N(i.sunriseLimitStart),i.sunriseLimitEnd=N(i.sunriseLimitEnd),i.sunsetLimitStart=N(i.sunsetLimitStart),i.sunsetLimitEnd=N(i.sunsetLimitEnd),i.sunsetOffset=parseInt(i.sunsetOffset,10)||0,i.sunriseOffset=parseInt(i.sunriseOffset,10)||0,this.calculateRiseSet(i);const c=JSON.parse(JSON.stringify(this.props.data));O.forEach(m=>c[m]=i[m]),a!==void 0&&this.props.onChange(c)})}calculateRiseSet(a){this.props.alive&&this.lastCalc!==JSON.stringify(a)&&(this.lastCalc=JSON.stringify(a),this.calcTimeout&&clearTimeout(this.calcTimeout),this.calcTimeout=setTimeout(async()=>{if(this.calcTimeout=null,!this.mounted)return;const n=await this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,"calcAstro",a);if(this.mounted){if(!n||n.error){console.error(`Cannot calculate astro times: ${JSON.stringify(n.error)}`);return}this.setState({nextSunrise:n.nextSunrise.isValidDate?ne(new Date(n.nextSunrise.date)):"n/a",nextSunset:n.nextSunset.isValidDate?ne(new Date(n.nextSunset.date)):"n/a",nextSunriseServer:n.nextSunrise.serverTime,nextSunsetServer:n.nextSunset.serverTime})}},300))}renderItem(){const{useSystemGPS:a,latitude:n,longitude:t,sunriseEvent:i,sunriseOffset:c,sunriseLimitStart:m,sunriseLimitEnd:g,sunsetEvent:h,sunsetOffset:w,sunsetLimitStart:x,sunsetLimitEnd:A}=this.state,b=window.innerWidth<800;return r.jsx(ke,{theme:this.state.theme,children:r.jsxs("div",{style:{width:"100%",display:b?void 0:"flex",gap:10},children:[r.jsx("div",{style:{width:b?"100%":"calc(50% - 5px)",display:b?"block":"inline-block"},children:r.jsxs(pe,{dateAdapter:ht,adapterLocale:od[d.I18n.getLanguage()],children:[r.jsx(ve,{style:{width:"calc(100% - 10px)"},control:r.jsx(we,{checked:!!a,onChange:u=>{u.target.checked?this.onAstroChange({useSystemGPS:!0,latitude:this.props.oContext.systemConfig.latitude,longitude:this.props.oContext.systemConfig.longitude}):this.onAstroChange({useSystemGPS:!1,latitude:n||this.props.oContext.systemConfig.latitude,longitude:t||this.props.oContext.systemConfig.longitude})}}),label:d.I18n.t("Use system settings")}),a?null:r.jsx(S,{variant:"standard",type:"text",style:{width:150,marginRight:10},label:d.I18n.t("Latitude °"),value:(n||"").toString(),onChange:u=>this.onAstroChange("latitude",u.target.value)}),a?null:r.jsx(S,{variant:"standard",style:{width:150},type:"text",label:d.I18n.t("Longitude °"),value:(t||"").toString(),onChange:u=>this.onAstroChange("longitude",u.target.value)}),a?null:r.jsx("div",{style:{width:"calc(100% - 10px)"},children:d.I18n.t("Help")}),r.jsx("h2",{style:{width:"calc(100% - 10px)",marginTop:20,backgroundColor:this.props.oContext.themeType==="dark"?"#333":"#ccc",color:this.props.oContext.themeType==="dark"?"#FFF":"#000",padding:"2px 8px",borderRadius:3},children:d.I18n.t("Day time settings")}),r.jsxs("div",{style:{width:"calc(100% - 10px)",display:"flex",gap:8,flexWrap:"wrap",backgroundColor:this.props.oContext.themeType==="dark"?"#333":"#ccc",paddingTop:8,paddingLeft:8,paddingRight:8,paddingBottom:0,borderRadius:"5px 5px 0 0"},children:[r.jsxs(P,{variant:"standard",style:{width:250},children:[r.jsx(k,{shrink:!0,children:d.I18n.t("Time event")}),r.jsxs(q,{variant:"standard",value:i||"_",onChange:u=>this.onAstroChange("sunriseEvent",u.target.value==="_"?"":u.target.value),children:[r.jsx(v,{value:"_",children:d.I18n.t("none")}),r.jsx(v,{value:"nightEnd",children:d.I18n.t("sch_astro_nightEnd")}),r.jsx(v,{value:"nauticalDawn",children:d.I18n.t("sch_astro_nauticalDawn")}),r.jsx(v,{value:"dawn",children:d.I18n.t("sch_astro_dawn")}),r.jsx(v,{value:"sunrise",children:d.I18n.t("sch_astro_sunrise")}),r.jsx(v,{value:"sunriseEnd",children:d.I18n.t("sch_astro_sunriseEnd")}),r.jsx(v,{value:"goldenHourEnd",children:d.I18n.t("sch_astro_goldenHourEnd")})]}),r.jsx(Y,{children:d.I18n.t("Used as start of the daytime")})]}),r.jsx(S,{style:{width:80},variant:"standard",disabled:!this.state.sunriseEvent,label:d.I18n.t("Offset"),value:c||0,helperText:d.I18n.t("in minutes"),onChange:u=>this.onAstroChange("sunriseOffset",u.target.value)}),r.jsxs(P,{variant:"standard",style:{width:150},children:[r.jsx(k,{shrink:!0,children:d.I18n.t("But not earlier")}),r.jsx(D,{className:`astroToolbarTime ${this.props.oContext.themeType}`,disabled:!this.state.sunriseEvent,ampm:!!this.state.ampm,views:["hours","minutes"],value:m||new Date(2e3,0,1,0,0),onChange:u=>this.onAstroChange("sunriseLimitStart",new Date(u))})]}),r.jsxs(P,{variant:"standard",style:{width:150},children:[r.jsx(k,{shrink:!0,children:d.I18n.t("And not later")}),r.jsx(D,{className:`astroToolbarTime ${this.props.oContext.themeType}`,disabled:!this.state.sunriseEvent,ampm:!!this.state.ampm,views:["hours","minutes"],value:g||new Date(2e3,0,1,0,0),onChange:u=>this.onAstroChange("sunriseLimitEnd",new Date(u))})]})]}),this.props.alive?r.jsxs("div",{style:{backgroundColor:this.props.oContext.themeType==="dark"?"#333":"#ccc",width:"calc(100% - 10px)",paddingTop:20,paddingLeft:8,paddingRight:8,paddingBottom:8,borderRadius:"0 0 5px 5px"},children:[r.jsx("span",{style:{marginRight:8},children:d.I18n.t("Next sunrise")}),r.jsxs("span",{children:[this.state.nextSunriseServer,this.state.nextSunrise!==this.state.nextSunriseServer?` ${d.I18n.t("Local time")}: ${this.state.nextSunrise}`:""]})]}):null,r.jsxs("div",{style:{width:"calc(100% - 10px)",display:"flex",gap:8,marginTop:30,flexWrap:"wrap",backgroundColor:this.props.oContext.themeType==="dark"?"#333":"#ccc",paddingTop:8,paddingLeft:8,paddingRight:8,paddingBottom:0,borderRadius:"5px 5px 0 0"},children:[r.jsxs(P,{variant:"standard",style:{width:250},children:[r.jsx(k,{shrink:!0,children:d.I18n.t("Time event")}),r.jsxs(q,{variant:"standard",value:h||"_",onChange:u=>this.onAstroChange("sunsetEvent",u.target.value==="_"?"":u.target.value),children:[r.jsx(v,{value:"_",children:d.I18n.t("none")}),r.jsx(v,{value:"goldenHour",children:d.I18n.t("sch_astro_goldenHour")}),r.jsx(v,{value:"sunsetStart",children:d.I18n.t("sch_astro_sunsetStart")}),r.jsx(v,{value:"sunset",children:d.I18n.t("sch_astro_sunset")}),r.jsx(v,{value:"dusk",children:d.I18n.t("sch_astro_dusk")}),r.jsx(v,{value:"nauticalDusk",children:d.I18n.t("sch_astro_nauticalDusk")}),r.jsx(v,{value:"night",children:d.I18n.t("sch_astro_night")})]}),r.jsx(Y,{children:d.I18n.t("Used as end of the daytime")})]}),r.jsx(S,{style:{width:80},variant:"standard",disabled:!this.state.sunsetEvent,label:d.I18n.t("Offset"),value:w||0,helperText:d.I18n.t("in minutes"),onChange:u=>this.onAstroChange("sunsetOffset",u.target.value)}),r.jsxs(P,{variant:"standard",style:{width:150},children:[r.jsx(k,{shrink:!0,children:d.I18n.t("But not earlier")}),r.jsx(D,{className:`astroToolbarTime ${this.props.oContext.themeType}`,disabled:!this.state.sunsetEvent,ampm:!!this.state.ampm,views:["hours","minutes"],value:x||new Date(2e3,0,1,0,0),onChange:u=>this.onAstroChange("sunsetLimitStart",new Date(u))})]}),r.jsxs(P,{variant:"standard",style:{width:150},children:[r.jsx(k,{shrink:!0,children:d.I18n.t("And not later")}),r.jsx(D,{className:`astroToolbarTime ${this.props.oContext.themeType}`,disabled:!this.state.sunsetEvent,ampm:!!this.state.ampm,views:["hours","minutes"],value:A||new Date(2e3,0,1,0,0),onChange:u=>this.onAstroChange("sunsetLimitEnd",new Date(u))})]})]}),this.props.alive?r.jsxs("div",{style:{backgroundColor:this.props.oContext.themeType==="dark"?"#333":"#ccc",width:"calc(100% - 10px)",paddingTop:20,paddingLeft:8,paddingRight:8,paddingBottom:8,borderRadius:"0 0 5px 5px",marginBottom:b?20:0},children:[r.jsx("span",{style:{marginRight:8},children:d.I18n.t("Next sunset")}),r.jsxs("span",{children:[this.state.nextSunsetServer,this.state.nextSunset!==this.state.nextSunsetServer?` ${d.I18n.t("Local time")}: ${this.state.nextSunset}`:""]})]}):null]})}),r.jsx("div",{style:{width:b?"100%":"calc(50% - 5px)",display:b?"block":"inline-block",minHeight:350},children:this.renderMap()})]})})}}const xd={Astro:sd};export{xd as default}; +import{j as r}from"./jsx-runtime-DfVU3AZG.js";import{_ as ve,a as D}from"./ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_x_mf_2_date_mf_2_pickers__loadShare__.mjs-DgHZUNxn.js";import{_ as we,a as ye,b as S,c as P,d as k,e as q,f as v,g as Y}from"./ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-KsT5vKjV.js";import{_ as d}from"./ConfigCustomJavascriptSet__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-B7D2xOvV.js";import{_}from"./ConfigCustomJavascriptSet__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__.mjs-ClsgYnEX.js";import{_ as j,a as T,b as be,c as Me,d as re,e as oe,f as B,g as Pe,h as A,i as ke}from"./ConfigCustomJavascriptSet__loadShare__react__loadShare__.mjs-0SjJESw9.js";import{_ as se}from"./ConfigCustomJavascriptSet__loadShare__leaflet__loadShare__.mjs-BYONkEgA.js";import"./ConfigCustomJavascriptSet__loadShare__react_mf_2_dom__loadShare__.mjs-CL--xmjC.js";import{T as xe}from"./ThemeProvider-B4G3jidj.js";import{l as We,e as de,p as ze,i as je,f as Te,a as $e,b as De,c as Se,d as Ce,g as Ne,h as L,j as Q,k as U,m as H,n as Ae,s as Ee,o as Le,q as He,r as Oe,t as Ge,u as Ve,v as Fe,w as Ie,x as Xe,y as Re,z as Je,A as qe,B as Ye,C as _e,D as Be,E as Qe,F as Ue,G as Ke,H as Ze,I as et,J as tt,K as at,L as nt,M as it,N as rt,O as ot,P as st,Q as dt,R as ut,S as l,T as o,U as s,V as y,W as M,X as ue}from"./isSameWeek-DDsSIa_t.js";import{_ as mt}from"./DefaultPropsProvider-CGb21NGY.js";import"./ConfigCustomJavascriptSet__loadShare__react__loadShare__.mjs_commonjs-proxy-CInLgMWW.js";import"./createTheme-Wd4QxQE0.js";import"./blue-CagzI6CQ.js";import"./index-AZB1OHDH.js";import"./useTheme-DWZ6jNyq.js";const lt={y:{sectionType:"year",contentType:"digit",maxLength:4},yy:"year",yyy:{sectionType:"year",contentType:"digit",maxLength:4},yyyy:"year",M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMMM:{sectionType:"month",contentType:"letter"},MMM:{sectionType:"month",contentType:"letter"},L:{sectionType:"month",contentType:"digit",maxLength:2},LL:"month",LLL:{sectionType:"month",contentType:"letter"},LLLL:{sectionType:"month",contentType:"letter"},d:{sectionType:"day",contentType:"digit",maxLength:2},dd:"day",do:{sectionType:"day",contentType:"digit-with-letter"},E:{sectionType:"weekDay",contentType:"letter"},EE:{sectionType:"weekDay",contentType:"letter"},EEE:{sectionType:"weekDay",contentType:"letter"},EEEE:{sectionType:"weekDay",contentType:"letter"},EEEEE:{sectionType:"weekDay",contentType:"letter"},i:{sectionType:"weekDay",contentType:"digit",maxLength:1},ii:"weekDay",iii:{sectionType:"weekDay",contentType:"letter"},iiii:{sectionType:"weekDay",contentType:"letter"},e:{sectionType:"weekDay",contentType:"digit",maxLength:1},ee:"weekDay",eee:{sectionType:"weekDay",contentType:"letter"},eeee:{sectionType:"weekDay",contentType:"letter"},eeeee:{sectionType:"weekDay",contentType:"letter"},eeeeee:{sectionType:"weekDay",contentType:"letter"},c:{sectionType:"weekDay",contentType:"digit",maxLength:1},cc:"weekDay",ccc:{sectionType:"weekDay",contentType:"letter"},cccc:{sectionType:"weekDay",contentType:"letter"},ccccc:{sectionType:"weekDay",contentType:"letter"},cccccc:{sectionType:"weekDay",contentType:"letter"},a:"meridiem",aa:"meridiem",aaa:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},ct={year:"yyyy",month:"LLLL",monthShort:"MMM",dayOfMonth:"d",dayOfMonthFull:"do",weekday:"EEEE",weekdayShort:"EEEEEE",hours24h:"HH",hours12h:"hh",meridiem:"aa",minutes:"mm",seconds:"ss",fullDate:"PP",keyboardDate:"P",shortDate:"MMM d",normalDate:"d MMMM",normalDateWithWeekday:"EEE, MMM d",fullTime:"p",fullTime12h:"hh:mm aa",fullTime24h:"HH:mm",keyboardDateTime:"P p",keyboardDateTime12h:"P hh:mm aa",keyboardDateTime24h:"P HH:mm"};class ht{constructor(a){this.isMUIAdapter=!0,this.isTimezoneCompatible=!1,this.lib=void 0,this.locale=void 0,this.formats=void 0,this.formatTokenMap=lt,this.escapedCharacters={start:"'",end:"'"},this.longFormatters=void 0,this.date=m=>typeof m>"u"?new Date:m===null?null:new Date(m),this.getInvalidDate=()=>new Date("Invalid Date"),this.getTimezone=()=>"default",this.setTimezone=m=>m,this.toJsDate=m=>m,this.getCurrentLocaleCode=()=>this.locale.code,this.is12HourCycleInCurrentLocale=()=>/a/.test(this.locale.formatLong.time({width:"short"})),this.expandFormat=m=>{const g=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;return m.match(g).map(h=>{const w=h[0];if(w==="p"||w==="P"){const x=this.longFormatters[w];return x(h,this.locale.formatLong)}return h}).join("")},this.formatNumber=m=>m,this.getDayOfWeek=m=>m.getDay()+1;const{locale:n,formats:e,longFormatters:i,lib:c}=a;this.locale=n,this.formats=mt({},ct,e),this.longFormatters=i,this.lib=c||"date-fns"}}class gt extends ht{constructor({locale:a,formats:n}={}){super({locale:a??de,formats:n,longFormatters:We}),this.parse=(e,i)=>e===""?null:ze(e,i,new Date,{locale:this.locale}),this.isValid=e=>e==null?!1:je(e),this.format=(e,i)=>this.formatByString(e,this.formats[i]),this.formatByString=(e,i)=>Te(e,i,{locale:this.locale}),this.isEqual=(e,i)=>e===null&&i===null?!0:e===null||i===null?!1:$e(e,i),this.isSameYear=(e,i)=>De(e,i),this.isSameMonth=(e,i)=>Se(e,i),this.isSameDay=(e,i)=>Ce(e,i),this.isSameHour=(e,i)=>Ne(e,i),this.isAfter=(e,i)=>L(e,i),this.isAfterYear=(e,i)=>L(e,Q(i)),this.isAfterDay=(e,i)=>L(e,U(i)),this.isBefore=(e,i)=>H(e,i),this.isBeforeYear=(e,i)=>H(e,this.startOfYear(i)),this.isBeforeDay=(e,i)=>H(e,this.startOfDay(i)),this.isWithinRange=(e,[i,c])=>Ae(e,{start:i,end:c}),this.startOfYear=e=>Ee(e),this.startOfMonth=e=>Le(e),this.startOfWeek=e=>He(e,{locale:this.locale}),this.startOfDay=e=>Oe(e),this.endOfYear=e=>Q(e),this.endOfMonth=e=>Ge(e),this.endOfWeek=e=>Ve(e,{locale:this.locale}),this.endOfDay=e=>U(e),this.addYears=(e,i)=>Fe(e,i),this.addMonths=(e,i)=>Ie(e,i),this.addWeeks=(e,i)=>Xe(e,i),this.addDays=(e,i)=>Re(e,i),this.addHours=(e,i)=>Je(e,i),this.addMinutes=(e,i)=>qe(e,i),this.addSeconds=(e,i)=>Ye(e,i),this.getYear=e=>_e(e),this.getMonth=e=>Be(e),this.getDate=e=>Qe(e),this.getHours=e=>Ue(e),this.getMinutes=e=>Ke(e),this.getSeconds=e=>Ze(e),this.getMilliseconds=e=>et(e),this.setYear=(e,i)=>tt(e,i),this.setMonth=(e,i)=>at(e,i),this.setDate=(e,i)=>nt(e,i),this.setHours=(e,i)=>it(e,i),this.setMinutes=(e,i)=>rt(e,i),this.setSeconds=(e,i)=>ot(e,i),this.setMilliseconds=(e,i)=>st(e,i),this.getDaysInMonth=e=>dt(e),this.getWeekArray=e=>{const i=this.startOfWeek(this.startOfMonth(e)),c=this.endOfWeek(this.endOfMonth(e));let m=0,g=i;const h=[];for(;this.isBefore(g,c);){const w=Math.floor(m/7);h[w]=h[w]||[],h[w].push(g),g=this.addDays(g,1),m+=1}return h},this.getWeekNumber=e=>ut(e,{locale:this.locale}),this.getYearRange=([e,i])=>{const c=this.startOfYear(e),m=this.endOfYear(i),g=[];let h=c;for(;this.isBefore(h,m);)g.push(h),h=this.addYears(h,1);return g}}}const K={lessThanXSeconds:{standalone:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"},withPreposition:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"}},xSeconds:{standalone:{one:"1 Sekunde",other:"{{count}} Sekunden"},withPreposition:{one:"1 Sekunde",other:"{{count}} Sekunden"}},halfAMinute:{standalone:"eine halbe Minute",withPreposition:"einer halben Minute"},lessThanXMinutes:{standalone:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"},withPreposition:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"}},xMinutes:{standalone:{one:"1 Minute",other:"{{count}} Minuten"},withPreposition:{one:"1 Minute",other:"{{count}} Minuten"}},aboutXHours:{standalone:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"},withPreposition:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"}},xHours:{standalone:{one:"1 Stunde",other:"{{count}} Stunden"},withPreposition:{one:"1 Stunde",other:"{{count}} Stunden"}},xDays:{standalone:{one:"1 Tag",other:"{{count}} Tage"},withPreposition:{one:"1 Tag",other:"{{count}} Tagen"}},aboutXWeeks:{standalone:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"},withPreposition:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"}},xWeeks:{standalone:{one:"1 Woche",other:"{{count}} Wochen"},withPreposition:{one:"1 Woche",other:"{{count}} Wochen"}},aboutXMonths:{standalone:{one:"etwa 1 Monat",other:"etwa {{count}} Monate"},withPreposition:{one:"etwa 1 Monat",other:"etwa {{count}} Monaten"}},xMonths:{standalone:{one:"1 Monat",other:"{{count}} Monate"},withPreposition:{one:"1 Monat",other:"{{count}} Monaten"}},aboutXYears:{standalone:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahre"},withPreposition:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahren"}},xYears:{standalone:{one:"1 Jahr",other:"{{count}} Jahre"},withPreposition:{one:"1 Jahr",other:"{{count}} Jahren"}},overXYears:{standalone:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahre"},withPreposition:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahren"}},almostXYears:{standalone:{one:"fast 1 Jahr",other:"fast {{count}} Jahre"},withPreposition:{one:"fast 1 Jahr",other:"fast {{count}} Jahren"}}},ft=(t,a,n)=>{let e;const i=n!=null&&n.addSuffix?K[t].withPreposition:K[t].standalone;return typeof i=="string"?e=i:a===1?e=i.one:e=i.other.replace("{{count}}",String(a)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+e:"vor "+e:e},pt={full:"EEEE, do MMMM y",long:"do MMMM y",medium:"do MMM y",short:"dd.MM.y"},vt={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},wt={full:"{{date}} 'um' {{time}}",long:"{{date}} 'um' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},yt={date:l({formats:pt,defaultWidth:"full"}),time:l({formats:vt,defaultWidth:"full"}),dateTime:l({formats:wt,defaultWidth:"full"})},bt={lastWeek:"'letzten' eeee 'um' p",yesterday:"'gestern um' p",today:"'heute um' p",tomorrow:"'morgen um' p",nextWeek:"eeee 'um' p",other:"P"},Mt=(t,a,n,e)=>bt[t],Pt={narrow:["v.Chr.","n.Chr."],abbreviated:["v.Chr.","n.Chr."],wide:["vor Christus","nach Christus"]},kt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. Quartal","2. Quartal","3. Quartal","4. Quartal"]},V={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],wide:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]},xt={narrow:V.narrow,abbreviated:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sep.","Okt.","Nov.","Dez."],wide:V.wide},Wt={narrow:["S","M","D","M","D","F","S"],short:["So","Mo","Di","Mi","Do","Fr","Sa"],abbreviated:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],wide:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},zt={narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachm.",evening:"Abend",night:"Nacht"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"}},jt={narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachm.",evening:"abends",night:"nachts"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"}},Tt=t=>Number(t)+".",$t={ordinalNumber:Tt,era:o({values:Pt,defaultWidth:"wide"}),quarter:o({values:kt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:o({values:V,formattingValues:xt,defaultWidth:"wide"}),day:o({values:Wt,defaultWidth:"wide"}),dayPeriod:o({values:zt,defaultWidth:"wide",formattingValues:jt,defaultFormattingWidth:"wide"})},Dt=/^(\d+)(\.)?/i,St=/\d+/i,Ct={narrow:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,abbreviated:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,wide:/^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i},Nt={any:[/^v/i,/^n/i]},At={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? Quartal/i},Et={any:[/1/i,/2/i,/3/i,/4/i]},Lt={narrow:/^[jfmasond]/i,abbreviated:/^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,wide:/^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i},Ht={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^j[aä]/i,/^f/i,/^mär/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Ot={narrow:/^[smdmf]/i,short:/^(so|mo|di|mi|do|fr|sa)/i,abbreviated:/^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,wide:/^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i},Gt={any:[/^so/i,/^mo/i,/^di/i,/^mi/i,/^do/i,/^f/i,/^sa/i]},Vt={narrow:/^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,abbreviated:/^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,wide:/^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i},Ft={any:{am:/^v/i,pm:/^n/i,midnight:/^Mitte/i,noon:/^Mitta/i,morning:/morgens/i,afternoon:/nachmittags/i,evening:/abends/i,night:/nachts/i}},It={ordinalNumber:y({matchPattern:Dt,parsePattern:St,valueCallback:t=>parseInt(t)}),era:s({matchPatterns:Ct,defaultMatchWidth:"wide",parsePatterns:Nt,defaultParseWidth:"any"}),quarter:s({matchPatterns:At,defaultMatchWidth:"wide",parsePatterns:Et,defaultParseWidth:"any",valueCallback:t=>t+1}),month:s({matchPatterns:Lt,defaultMatchWidth:"wide",parsePatterns:Ht,defaultParseWidth:"any"}),day:s({matchPatterns:Ot,defaultMatchWidth:"wide",parsePatterns:Gt,defaultParseWidth:"any"}),dayPeriod:s({matchPatterns:Vt,defaultMatchWidth:"wide",parsePatterns:Ft,defaultParseWidth:"any"})},Xt={code:"de",formatDistance:ft,formatLong:yt,formatRelative:Mt,localize:$t,match:It,options:{weekStartsOn:1,firstWeekContainsDate:4}},Rt={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},Jt=(t,a,n)=>{let e;const i=Rt[t];return typeof i=="string"?e=i:a===1?e=i.one:e=i.other.replace("{{count}}",a.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"en "+e:"hace "+e:e},qt={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},Yt={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},_t={full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Bt={date:l({formats:qt,defaultWidth:"full"}),time:l({formats:Yt,defaultWidth:"full"}),dateTime:l({formats:_t,defaultWidth:"full"})},Qt={lastWeek:"'el' eeee 'pasado a la' p",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},Ut={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},Kt=(t,a,n,e)=>a.getHours()!==1?Ut[t]:Qt[t],Zt={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},ea={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},ta={narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},aa={narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sá"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},na={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},ia={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},ra=(t,a)=>Number(t)+"º",oa={ordinalNumber:ra,era:o({values:Zt,defaultWidth:"wide"}),quarter:o({values:ea,defaultWidth:"wide",argumentCallback:t=>Number(t)-1}),month:o({values:ta,defaultWidth:"wide"}),day:o({values:aa,defaultWidth:"wide"}),dayPeriod:o({values:na,defaultWidth:"wide",formattingValues:ia,defaultFormattingWidth:"wide"})},sa=/^(\d+)(º)?/i,da=/\d+/i,ua={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},ma={any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},la={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},ca={any:[/1/i,/2/i,/3/i,/4/i]},ha={narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},ga={narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},fa={narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},pa={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},va={narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},wa={any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},ya={ordinalNumber:y({matchPattern:sa,parsePattern:da,valueCallback:function(t){return parseInt(t,10)}}),era:s({matchPatterns:ua,defaultMatchWidth:"wide",parsePatterns:ma,defaultParseWidth:"any"}),quarter:s({matchPatterns:la,defaultMatchWidth:"wide",parsePatterns:ca,defaultParseWidth:"any",valueCallback:t=>t+1}),month:s({matchPatterns:ha,defaultMatchWidth:"wide",parsePatterns:ga,defaultParseWidth:"any"}),day:s({matchPatterns:fa,defaultMatchWidth:"wide",parsePatterns:pa,defaultParseWidth:"any"}),dayPeriod:s({matchPatterns:va,defaultMatchWidth:"any",parsePatterns:wa,defaultParseWidth:"any"})},ba={code:"es",formatDistance:Jt,formatLong:Bt,formatRelative:Kt,localize:oa,match:ya,options:{weekStartsOn:1,firstWeekContainsDate:1}},Ma={lessThanXSeconds:{one:"moins d’une seconde",other:"moins de {{count}} secondes"},xSeconds:{one:"1 seconde",other:"{{count}} secondes"},halfAMinute:"30 secondes",lessThanXMinutes:{one:"moins d’une minute",other:"moins de {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"environ 1 heure",other:"environ {{count}} heures"},xHours:{one:"1 heure",other:"{{count}} heures"},xDays:{one:"1 jour",other:"{{count}} jours"},aboutXWeeks:{one:"environ 1 semaine",other:"environ {{count}} semaines"},xWeeks:{one:"1 semaine",other:"{{count}} semaines"},aboutXMonths:{one:"environ 1 mois",other:"environ {{count}} mois"},xMonths:{one:"1 mois",other:"{{count}} mois"},aboutXYears:{one:"environ 1 an",other:"environ {{count}} ans"},xYears:{one:"1 an",other:"{{count}} ans"},overXYears:{one:"plus d’un an",other:"plus de {{count}} ans"},almostXYears:{one:"presqu’un an",other:"presque {{count}} ans"}},Pa=(t,a,n)=>{let e;const i=Ma[t];return typeof i=="string"?e=i:a===1?e=i.one:e=i.other.replace("{{count}}",String(a)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"dans "+e:"il y a "+e:e},ka={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},xa={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Wa={full:"{{date}} 'à' {{time}}",long:"{{date}} 'à' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},za={date:l({formats:ka,defaultWidth:"full"}),time:l({formats:xa,defaultWidth:"full"}),dateTime:l({formats:Wa,defaultWidth:"full"})},ja={lastWeek:"eeee 'dernier à' p",yesterday:"'hier à' p",today:"'aujourd’hui à' p",tomorrow:"'demain à' p'",nextWeek:"eeee 'prochain à' p",other:"P"},Ta=(t,a,n,e)=>ja[t],$a={narrow:["av. J.-C","ap. J.-C"],abbreviated:["av. J.-C","ap. J.-C"],wide:["avant Jésus-Christ","après Jésus-Christ"]},Da={narrow:["T1","T2","T3","T4"],abbreviated:["1er trim.","2ème trim.","3ème trim.","4ème trim."],wide:["1er trimestre","2ème trimestre","3ème trimestre","4ème trimestre"]},Sa={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],wide:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"]},Ca={narrow:["D","L","M","M","J","V","S"],short:["di","lu","ma","me","je","ve","sa"],abbreviated:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],wide:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},Na={narrow:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"mat.",afternoon:"ap.m.",evening:"soir",night:"mat."},abbreviated:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"matin",afternoon:"après-midi",evening:"soir",night:"matin"},wide:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"du matin",afternoon:"de l’après-midi",evening:"du soir",night:"du matin"}},Aa=(t,a)=>{const n=Number(t),e=a==null?void 0:a.unit;if(n===0)return"0";const i=["year","week","hour","minute","second"];let c;return n===1?c=e&&i.includes(e)?"ère":"er":c="ème",n+c},Ea=["MMM","MMMM"],La={preprocessor:(t,a)=>t.getDate()===1||!a.some(e=>e.isToken&&Ea.includes(e.value))?a:a.map(e=>e.isToken&&e.value==="do"?{isToken:!0,value:"d"}:e),ordinalNumber:Aa,era:o({values:$a,defaultWidth:"wide"}),quarter:o({values:Da,defaultWidth:"wide",argumentCallback:t=>t-1}),month:o({values:Sa,defaultWidth:"wide"}),day:o({values:Ca,defaultWidth:"wide"}),dayPeriod:o({values:Na,defaultWidth:"wide"})},Ha=/^(\d+)(ième|ère|ème|er|e)?/i,Oa=/\d+/i,Ga={narrow:/^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,abbreviated:/^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,wide:/^(avant Jésus-Christ|après Jésus-Christ)/i},Va={any:[/^av/i,/^ap/i]},Fa={narrow:/^T?[1234]/i,abbreviated:/^[1234](er|ème|e)? trim\.?/i,wide:/^[1234](er|ème|e)? trimestre/i},Ia={any:[/1/i,/2/i,/3/i,/4/i]},Xa={narrow:/^[jfmasond]/i,abbreviated:/^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,wide:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i},Ra={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^av/i,/^ma/i,/^juin/i,/^juil/i,/^ao/i,/^s/i,/^o/i,/^n/i,/^d/i]},Ja={narrow:/^[lmjvsd]/i,short:/^(di|lu|ma|me|je|ve|sa)/i,abbreviated:/^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,wide:/^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i},qa={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^di/i,/^lu/i,/^ma/i,/^me/i,/^je/i,/^ve/i,/^sa/i]},Ya={narrow:/^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,any:/^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i},_a={any:{am:/^a/i,pm:/^p/i,midnight:/^min/i,noon:/^mid/i,morning:/mat/i,afternoon:/ap/i,evening:/soir/i,night:/nuit/i}},Ba={ordinalNumber:y({matchPattern:Ha,parsePattern:Oa,valueCallback:t=>parseInt(t)}),era:s({matchPatterns:Ga,defaultMatchWidth:"wide",parsePatterns:Va,defaultParseWidth:"any"}),quarter:s({matchPatterns:Fa,defaultMatchWidth:"wide",parsePatterns:Ia,defaultParseWidth:"any",valueCallback:t=>t+1}),month:s({matchPatterns:Xa,defaultMatchWidth:"wide",parsePatterns:Ra,defaultParseWidth:"any"}),day:s({matchPatterns:Ja,defaultMatchWidth:"wide",parsePatterns:qa,defaultParseWidth:"any"}),dayPeriod:s({matchPatterns:Ya,defaultMatchWidth:"any",parsePatterns:_a,defaultParseWidth:"any"})},Qa={code:"fr",formatDistance:Pa,formatLong:za,formatRelative:Ta,localize:La,match:Ba,options:{weekStartsOn:1,firstWeekContainsDate:4}},Ua={lessThanXSeconds:{one:"meno di un secondo",other:"meno di {{count}} secondi"},xSeconds:{one:"un secondo",other:"{{count}} secondi"},halfAMinute:"alcuni secondi",lessThanXMinutes:{one:"meno di un minuto",other:"meno di {{count}} minuti"},xMinutes:{one:"un minuto",other:"{{count}} minuti"},aboutXHours:{one:"circa un'ora",other:"circa {{count}} ore"},xHours:{one:"un'ora",other:"{{count}} ore"},xDays:{one:"un giorno",other:"{{count}} giorni"},aboutXWeeks:{one:"circa una settimana",other:"circa {{count}} settimane"},xWeeks:{one:"una settimana",other:"{{count}} settimane"},aboutXMonths:{one:"circa un mese",other:"circa {{count}} mesi"},xMonths:{one:"un mese",other:"{{count}} mesi"},aboutXYears:{one:"circa un anno",other:"circa {{count}} anni"},xYears:{one:"un anno",other:"{{count}} anni"},overXYears:{one:"più di un anno",other:"più di {{count}} anni"},almostXYears:{one:"quasi un anno",other:"quasi {{count}} anni"}},Ka=(t,a,n)=>{let e;const i=Ua[t];return typeof i=="string"?e=i:a===1?e=i.one:e=i.other.replace("{{count}}",a.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"tra "+e:e+" fa":e},Za={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},en={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},tn={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},an={date:l({formats:Za,defaultWidth:"full"}),time:l({formats:en,defaultWidth:"full"}),dateTime:l({formats:tn,defaultWidth:"full"})},I=["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"];function nn(t){return t===0?"'domenica scorsa alle' p":"'"+I[t]+" scorso alle' p"}function Z(t){return"'"+I[t]+" alle' p"}function rn(t){return t===0?"'domenica prossima alle' p":"'"+I[t]+" prossimo alle' p"}const on={lastWeek:(t,a,n)=>{const e=t.getDay();return M(t,a,n)?Z(e):nn(e)},yesterday:"'ieri alle' p",today:"'oggi alle' p",tomorrow:"'domani alle' p",nextWeek:(t,a,n)=>{const e=t.getDay();return M(t,a,n)?Z(e):rn(e)},other:"P"},sn=(t,a,n,e)=>{const i=on[t];return typeof i=="function"?i(a,n,e):i},dn={narrow:["aC","dC"],abbreviated:["a.C.","d.C."],wide:["avanti Cristo","dopo Cristo"]},un={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},mn={narrow:["G","F","M","A","M","G","L","A","S","O","N","D"],abbreviated:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],wide:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"]},ln={narrow:["D","L","M","M","G","V","S"],short:["dom","lun","mar","mer","gio","ven","sab"],abbreviated:["dom","lun","mar","mer","gio","ven","sab"],wide:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"]},cn={narrow:{am:"m.",pm:"p.",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"},abbreviated:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"},wide:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"}},hn={narrow:{am:"m.",pm:"p.",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"},abbreviated:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"},wide:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"}},gn=(t,a)=>{const n=Number(t);return String(n)},fn={ordinalNumber:gn,era:o({values:dn,defaultWidth:"wide"}),quarter:o({values:un,defaultWidth:"wide",argumentCallback:t=>t-1}),month:o({values:mn,defaultWidth:"wide"}),day:o({values:ln,defaultWidth:"wide"}),dayPeriod:o({values:cn,defaultWidth:"wide",formattingValues:hn,defaultFormattingWidth:"wide"})},pn=/^(\d+)(º)?/i,vn=/\d+/i,wn={narrow:/^(aC|dC)/i,abbreviated:/^(a\.?\s?C\.?|a\.?\s?e\.?\s?v\.?|d\.?\s?C\.?|e\.?\s?v\.?)/i,wide:/^(avanti Cristo|avanti Era Volgare|dopo Cristo|Era Volgare)/i},yn={any:[/^a/i,/^(d|e)/i]},bn={narrow:/^[1234]/i,abbreviated:/^t[1234]/i,wide:/^[1234](º)? trimestre/i},Mn={any:[/1/i,/2/i,/3/i,/4/i]},Pn={narrow:/^[gfmalsond]/i,abbreviated:/^(gen|feb|mar|apr|mag|giu|lug|ago|set|ott|nov|dic)/i,wide:/^(gennaio|febbraio|marzo|aprile|maggio|giugno|luglio|agosto|settembre|ottobre|novembre|dicembre)/i},kn={narrow:[/^g/i,/^f/i,/^m/i,/^a/i,/^m/i,/^g/i,/^l/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ge/i,/^f/i,/^mar/i,/^ap/i,/^mag/i,/^gi/i,/^l/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},xn={narrow:/^[dlmgvs]/i,short:/^(do|lu|ma|me|gi|ve|sa)/i,abbreviated:/^(dom|lun|mar|mer|gio|ven|sab)/i,wide:/^(domenica|luned[i|ì]|marted[i|ì]|mercoled[i|ì]|gioved[i|ì]|venerd[i|ì]|sabato)/i},Wn={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^g/i,/^v/i,/^s/i],any:[/^d/i,/^l/i,/^ma/i,/^me/i,/^g/i,/^v/i,/^s/i]},zn={narrow:/^(a|m\.|p|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i,any:/^([ap]\.?\s?m\.?|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i},jn={any:{am:/^a/i,pm:/^p/i,midnight:/^mezza/i,noon:/^mezzo/i,morning:/mattina/i,afternoon:/pomeriggio/i,evening:/sera/i,night:/notte/i}},Tn={ordinalNumber:y({matchPattern:pn,parsePattern:vn,valueCallback:t=>parseInt(t,10)}),era:s({matchPatterns:wn,defaultMatchWidth:"wide",parsePatterns:yn,defaultParseWidth:"any"}),quarter:s({matchPatterns:bn,defaultMatchWidth:"wide",parsePatterns:Mn,defaultParseWidth:"any",valueCallback:t=>t+1}),month:s({matchPatterns:Pn,defaultMatchWidth:"wide",parsePatterns:kn,defaultParseWidth:"any"}),day:s({matchPatterns:xn,defaultMatchWidth:"wide",parsePatterns:Wn,defaultParseWidth:"any"}),dayPeriod:s({matchPatterns:zn,defaultMatchWidth:"any",parsePatterns:jn,defaultParseWidth:"any"})},$n={code:"it",formatDistance:Ka,formatLong:an,formatRelative:sn,localize:fn,match:Tn,options:{weekStartsOn:1,firstWeekContainsDate:4}},Dn={lessThanXSeconds:{one:"minder dan een seconde",other:"minder dan {{count}} seconden"},xSeconds:{one:"1 seconde",other:"{{count}} seconden"},halfAMinute:"een halve minuut",lessThanXMinutes:{one:"minder dan een minuut",other:"minder dan {{count}} minuten"},xMinutes:{one:"een minuut",other:"{{count}} minuten"},aboutXHours:{one:"ongeveer 1 uur",other:"ongeveer {{count}} uur"},xHours:{one:"1 uur",other:"{{count}} uur"},xDays:{one:"1 dag",other:"{{count}} dagen"},aboutXWeeks:{one:"ongeveer 1 week",other:"ongeveer {{count}} weken"},xWeeks:{one:"1 week",other:"{{count}} weken"},aboutXMonths:{one:"ongeveer 1 maand",other:"ongeveer {{count}} maanden"},xMonths:{one:"1 maand",other:"{{count}} maanden"},aboutXYears:{one:"ongeveer 1 jaar",other:"ongeveer {{count}} jaar"},xYears:{one:"1 jaar",other:"{{count}} jaar"},overXYears:{one:"meer dan 1 jaar",other:"meer dan {{count}} jaar"},almostXYears:{one:"bijna 1 jaar",other:"bijna {{count}} jaar"}},Sn=(t,a,n)=>{let e;const i=Dn[t];return typeof i=="string"?e=i:a===1?e=i.one:e=i.other.replace("{{count}}",String(a)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"over "+e:e+" geleden":e},Cn={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd-MM-y"},Nn={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},An={full:"{{date}} 'om' {{time}}",long:"{{date}} 'om' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},En={date:l({formats:Cn,defaultWidth:"full"}),time:l({formats:Nn,defaultWidth:"full"}),dateTime:l({formats:An,defaultWidth:"full"})},Ln={lastWeek:"'afgelopen' eeee 'om' p",yesterday:"'gisteren om' p",today:"'vandaag om' p",tomorrow:"'morgen om' p",nextWeek:"eeee 'om' p",other:"P"},Hn=(t,a,n,e)=>Ln[t],On={narrow:["v.C.","n.C."],abbreviated:["v.Chr.","n.Chr."],wide:["voor Christus","na Christus"]},Gn={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["1e kwartaal","2e kwartaal","3e kwartaal","4e kwartaal"]},Vn={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["jan.","feb.","mrt.","apr.","mei","jun.","jul.","aug.","sep.","okt.","nov.","dec."],wide:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"]},Fn={narrow:["Z","M","D","W","D","V","Z"],short:["zo","ma","di","wo","do","vr","za"],abbreviated:["zon","maa","din","woe","don","vri","zat"],wide:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"]},In={narrow:{am:"AM",pm:"PM",midnight:"middernacht",noon:"het middaguur",morning:"'s ochtends",afternoon:"'s middags",evening:"'s avonds",night:"'s nachts"},abbreviated:{am:"AM",pm:"PM",midnight:"middernacht",noon:"het middaguur",morning:"'s ochtends",afternoon:"'s middags",evening:"'s avonds",night:"'s nachts"},wide:{am:"AM",pm:"PM",midnight:"middernacht",noon:"het middaguur",morning:"'s ochtends",afternoon:"'s middags",evening:"'s avonds",night:"'s nachts"}},Xn=(t,a)=>Number(t)+"e",Rn={ordinalNumber:Xn,era:o({values:On,defaultWidth:"wide"}),quarter:o({values:Gn,defaultWidth:"wide",argumentCallback:t=>t-1}),month:o({values:Vn,defaultWidth:"wide"}),day:o({values:Fn,defaultWidth:"wide"}),dayPeriod:o({values:In,defaultWidth:"wide"})},Jn=/^(\d+)e?/i,qn=/\d+/i,Yn={narrow:/^([vn]\.? ?C\.?)/,abbreviated:/^([vn]\. ?Chr\.?)/,wide:/^((voor|na) Christus)/},_n={any:[/^v/,/^n/]},Bn={narrow:/^[1234]/i,abbreviated:/^K[1234]/i,wide:/^[1234]e kwartaal/i},Qn={any:[/1/i,/2/i,/3/i,/4/i]},Un={narrow:/^[jfmasond]/i,abbreviated:/^(jan.|feb.|mrt.|apr.|mei|jun.|jul.|aug.|sep.|okt.|nov.|dec.)/i,wide:/^(januari|februari|maart|april|mei|juni|juli|augustus|september|oktober|november|december)/i},Kn={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^jan/i,/^feb/i,/^m(r|a)/i,/^apr/i,/^mei/i,/^jun/i,/^jul/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i]},Zn={narrow:/^[zmdwv]/i,short:/^(zo|ma|di|wo|do|vr|za)/i,abbreviated:/^(zon|maa|din|woe|don|vri|zat)/i,wide:/^(zondag|maandag|dinsdag|woensdag|donderdag|vrijdag|zaterdag)/i},ei={narrow:[/^z/i,/^m/i,/^d/i,/^w/i,/^d/i,/^v/i,/^z/i],any:[/^zo/i,/^ma/i,/^di/i,/^wo/i,/^do/i,/^vr/i,/^za/i]},ti={any:/^(am|pm|middernacht|het middaguur|'s (ochtends|middags|avonds|nachts))/i},ai={any:{am:/^am/i,pm:/^pm/i,midnight:/^middernacht/i,noon:/^het middaguur/i,morning:/ochtend/i,afternoon:/middag/i,evening:/avond/i,night:/nacht/i}},ni={ordinalNumber:y({matchPattern:Jn,parsePattern:qn,valueCallback:t=>parseInt(t,10)}),era:s({matchPatterns:Yn,defaultMatchWidth:"wide",parsePatterns:_n,defaultParseWidth:"any"}),quarter:s({matchPatterns:Bn,defaultMatchWidth:"wide",parsePatterns:Qn,defaultParseWidth:"any",valueCallback:t=>t+1}),month:s({matchPatterns:Un,defaultMatchWidth:"wide",parsePatterns:Kn,defaultParseWidth:"any"}),day:s({matchPatterns:Zn,defaultMatchWidth:"wide",parsePatterns:ei,defaultParseWidth:"any"}),dayPeriod:s({matchPatterns:ti,defaultMatchWidth:"any",parsePatterns:ai,defaultParseWidth:"any"})},ii={code:"nl",formatDistance:Sn,formatLong:En,formatRelative:Hn,localize:Rn,match:ni,options:{weekStartsOn:1,firstWeekContainsDate:4}},ri={lessThanXSeconds:{one:{regular:"mniej niż sekunda",past:"mniej niż sekundę",future:"mniej niż sekundę"},twoFour:"mniej niż {{count}} sekundy",other:"mniej niż {{count}} sekund"},xSeconds:{one:{regular:"sekunda",past:"sekundę",future:"sekundę"},twoFour:"{{count}} sekundy",other:"{{count}} sekund"},halfAMinute:{one:"pół minuty",twoFour:"pół minuty",other:"pół minuty"},lessThanXMinutes:{one:{regular:"mniej niż minuta",past:"mniej niż minutę",future:"mniej niż minutę"},twoFour:"mniej niż {{count}} minuty",other:"mniej niż {{count}} minut"},xMinutes:{one:{regular:"minuta",past:"minutę",future:"minutę"},twoFour:"{{count}} minuty",other:"{{count}} minut"},aboutXHours:{one:{regular:"około godziny",past:"około godziny",future:"około godzinę"},twoFour:"około {{count}} godziny",other:"około {{count}} godzin"},xHours:{one:{regular:"godzina",past:"godzinę",future:"godzinę"},twoFour:"{{count}} godziny",other:"{{count}} godzin"},xDays:{one:{regular:"dzień",past:"dzień",future:"1 dzień"},twoFour:"{{count}} dni",other:"{{count}} dni"},aboutXWeeks:{one:"około tygodnia",twoFour:"około {{count}} tygodni",other:"około {{count}} tygodni"},xWeeks:{one:"tydzień",twoFour:"{{count}} tygodnie",other:"{{count}} tygodni"},aboutXMonths:{one:"około miesiąc",twoFour:"około {{count}} miesiące",other:"około {{count}} miesięcy"},xMonths:{one:"miesiąc",twoFour:"{{count}} miesiące",other:"{{count}} miesięcy"},aboutXYears:{one:"około rok",twoFour:"około {{count}} lata",other:"około {{count}} lat"},xYears:{one:"rok",twoFour:"{{count}} lata",other:"{{count}} lat"},overXYears:{one:"ponad rok",twoFour:"ponad {{count}} lata",other:"ponad {{count}} lat"},almostXYears:{one:"prawie rok",twoFour:"prawie {{count}} lata",other:"prawie {{count}} lat"}};function oi(t,a){if(a===1)return t.one;const n=a%100;if(n<=20&&n>10)return t.other;const e=n%10;return e>=2&&e<=4?t.twoFour:t.other}function O(t,a,n){const e=oi(t,a);return(typeof e=="string"?e:e[n]).replace("{{count}}",String(a))}const si=(t,a,n)=>{const e=ri[t];return n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"za "+O(e,a,"future"):O(e,a,"past")+" temu":O(e,a,"regular")},di={full:"EEEE, do MMMM y",long:"do MMMM y",medium:"do MMM y",short:"dd.MM.y"},ui={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},mi={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},li={date:l({formats:di,defaultWidth:"full"}),time:l({formats:ui,defaultWidth:"full"}),dateTime:l({formats:mi,defaultWidth:"full"})},ci={masculine:"ostatni",feminine:"ostatnia"},hi={masculine:"ten",feminine:"ta"},gi={masculine:"następny",feminine:"następna"},fi={0:"feminine",1:"masculine",2:"masculine",3:"feminine",4:"masculine",5:"masculine",6:"feminine"};function ee(t,a,n,e){let i;if(M(a,n,e))i=hi;else if(t==="lastWeek")i=ci;else if(t==="nextWeek")i=gi;else throw new Error(`Cannot determine adjectives for token ${t}`);const c=a.getDay(),m=fi[c];return`'${i[m]}' eeee 'o' p`}const pi={lastWeek:ee,yesterday:"'wczoraj o' p",today:"'dzisiaj o' p",tomorrow:"'jutro o' p",nextWeek:ee,other:"P"},vi=(t,a,n,e)=>{const i=pi[t];return typeof i=="function"?i(t,a,n,e):i},wi={narrow:["p.n.e.","n.e."],abbreviated:["p.n.e.","n.e."],wide:["przed naszą erą","naszej ery"]},yi={narrow:["1","2","3","4"],abbreviated:["I kw.","II kw.","III kw.","IV kw."],wide:["I kwartał","II kwartał","III kwartał","IV kwartał"]},bi={narrow:["S","L","M","K","M","C","L","S","W","P","L","G"],abbreviated:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","paź","lis","gru"],wide:["styczeń","luty","marzec","kwiecień","maj","czerwiec","lipiec","sierpień","wrzesień","październik","listopad","grudzień"]},Mi={narrow:["s","l","m","k","m","c","l","s","w","p","l","g"],abbreviated:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","paź","lis","gru"],wide:["stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","września","października","listopada","grudnia"]},Pi={narrow:["N","P","W","Ś","C","P","S"],short:["nie","pon","wto","śro","czw","pią","sob"],abbreviated:["niedz.","pon.","wt.","śr.","czw.","pt.","sob."],wide:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"]},ki={narrow:["n","p","w","ś","c","p","s"],short:["nie","pon","wto","śro","czw","pią","sob"],abbreviated:["niedz.","pon.","wt.","śr.","czw.","pt.","sob."],wide:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"]},xi={narrow:{am:"a",pm:"p",midnight:"półn.",noon:"poł",morning:"rano",afternoon:"popoł.",evening:"wiecz.",night:"noc"},abbreviated:{am:"AM",pm:"PM",midnight:"północ",noon:"południe",morning:"rano",afternoon:"popołudnie",evening:"wieczór",night:"noc"},wide:{am:"AM",pm:"PM",midnight:"północ",noon:"południe",morning:"rano",afternoon:"popołudnie",evening:"wieczór",night:"noc"}},Wi={narrow:{am:"a",pm:"p",midnight:"o półn.",noon:"w poł.",morning:"rano",afternoon:"po poł.",evening:"wiecz.",night:"w nocy"},abbreviated:{am:"AM",pm:"PM",midnight:"o północy",noon:"w południe",morning:"rano",afternoon:"po południu",evening:"wieczorem",night:"w nocy"},wide:{am:"AM",pm:"PM",midnight:"o północy",noon:"w południe",morning:"rano",afternoon:"po południu",evening:"wieczorem",night:"w nocy"}},zi=(t,a)=>String(t),ji={ordinalNumber:zi,era:o({values:wi,defaultWidth:"wide"}),quarter:o({values:yi,defaultWidth:"wide",argumentCallback:t=>t-1}),month:o({values:bi,defaultWidth:"wide",formattingValues:Mi,defaultFormattingWidth:"wide"}),day:o({values:Pi,defaultWidth:"wide",formattingValues:ki,defaultFormattingWidth:"wide"}),dayPeriod:o({values:xi,defaultWidth:"wide",formattingValues:Wi,defaultFormattingWidth:"wide"})},Ti=/^(\d+)?/i,$i=/\d+/i,Di={narrow:/^(p\.?\s*n\.?\s*e\.?\s*|n\.?\s*e\.?\s*)/i,abbreviated:/^(p\.?\s*n\.?\s*e\.?\s*|n\.?\s*e\.?\s*)/i,wide:/^(przed\s*nasz(ą|a)\s*er(ą|a)|naszej\s*ery)/i},Si={any:[/^p/i,/^n/i]},Ci={narrow:/^[1234]/i,abbreviated:/^(I|II|III|IV)\s*kw\.?/i,wide:/^(I|II|III|IV)\s*kwarta(ł|l)/i},Ni={narrow:[/1/i,/2/i,/3/i,/4/i],any:[/^I kw/i,/^II kw/i,/^III kw/i,/^IV kw/i]},Ai={narrow:/^[slmkcwpg]/i,abbreviated:/^(sty|lut|mar|kwi|maj|cze|lip|sie|wrz|pa(ź|z)|lis|gru)/i,wide:/^(stycznia|stycze(ń|n)|lutego|luty|marca|marzec|kwietnia|kwiecie(ń|n)|maja|maj|czerwca|czerwiec|lipca|lipiec|sierpnia|sierpie(ń|n)|wrze(ś|s)nia|wrzesie(ń|n)|pa(ź|z)dziernika|pa(ź|z)dziernik|listopada|listopad|grudnia|grudzie(ń|n))/i},Ei={narrow:[/^s/i,/^l/i,/^m/i,/^k/i,/^m/i,/^c/i,/^l/i,/^s/i,/^w/i,/^p/i,/^l/i,/^g/i],any:[/^st/i,/^lu/i,/^mar/i,/^k/i,/^maj/i,/^c/i,/^lip/i,/^si/i,/^w/i,/^p/i,/^lis/i,/^g/i]},Li={narrow:/^[npwścs]/i,short:/^(nie|pon|wto|(ś|s)ro|czw|pi(ą|a)|sob)/i,abbreviated:/^(niedz|pon|wt|(ś|s)r|czw|pt|sob)\.?/i,wide:/^(niedziela|poniedzia(ł|l)ek|wtorek|(ś|s)roda|czwartek|pi(ą|a)tek|sobota)/i},Hi={narrow:[/^n/i,/^p/i,/^w/i,/^ś/i,/^c/i,/^p/i,/^s/i],abbreviated:[/^n/i,/^po/i,/^w/i,/^(ś|s)r/i,/^c/i,/^pt/i,/^so/i],any:[/^n/i,/^po/i,/^w/i,/^(ś|s)r/i,/^c/i,/^pi/i,/^so/i]},Oi={narrow:/^(^a$|^p$|pó(ł|l)n\.?|o\s*pó(ł|l)n\.?|po(ł|l)\.?|w\s*po(ł|l)\.?|po\s*po(ł|l)\.?|rano|wiecz\.?|noc|w\s*nocy)/i,any:/^(am|pm|pó(ł|l)noc|o\s*pó(ł|l)nocy|po(ł|l)udnie|w\s*po(ł|l)udnie|popo(ł|l)udnie|po\s*po(ł|l)udniu|rano|wieczór|wieczorem|noc|w\s*nocy)/i},Gi={narrow:{am:/^a$/i,pm:/^p$/i,midnight:/pó(ł|l)n/i,noon:/po(ł|l)/i,morning:/rano/i,afternoon:/po\s*po(ł|l)/i,evening:/wiecz/i,night:/noc/i},any:{am:/^am/i,pm:/^pm/i,midnight:/pó(ł|l)n/i,noon:/po(ł|l)/i,morning:/rano/i,afternoon:/po\s*po(ł|l)/i,evening:/wiecz/i,night:/noc/i}},Vi={ordinalNumber:y({matchPattern:Ti,parsePattern:$i,valueCallback:t=>parseInt(t,10)}),era:s({matchPatterns:Di,defaultMatchWidth:"wide",parsePatterns:Si,defaultParseWidth:"any"}),quarter:s({matchPatterns:Ci,defaultMatchWidth:"wide",parsePatterns:Ni,defaultParseWidth:"any",valueCallback:t=>t+1}),month:s({matchPatterns:Ai,defaultMatchWidth:"wide",parsePatterns:Ei,defaultParseWidth:"any"}),day:s({matchPatterns:Li,defaultMatchWidth:"wide",parsePatterns:Hi,defaultParseWidth:"any"}),dayPeriod:s({matchPatterns:Oi,defaultMatchWidth:"any",parsePatterns:Gi,defaultParseWidth:"any"})},Fi={code:"pl",formatDistance:si,formatLong:li,formatRelative:vi,localize:ji,match:Vi,options:{weekStartsOn:1,firstWeekContainsDate:4}},Ii={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"aproximadamente 1 hora",other:"aproximadamente {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"aproximadamente 1 semana",other:"aproximadamente {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"aproximadamente 1 mês",other:"aproximadamente {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"aproximadamente 1 ano",other:"aproximadamente {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},Xi=(t,a,n)=>{let e;const i=Ii[t];return typeof i=="string"?e=i:a===1?e=i.one:e=i.other.replace("{{count}}",String(a)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"daqui a "+e:"há "+e:e},Ri={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d 'de' MMM 'de' y",short:"dd/MM/y"},Ji={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},qi={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Yi={date:l({formats:Ri,defaultWidth:"full"}),time:l({formats:Ji,defaultWidth:"full"}),dateTime:l({formats:qi,defaultWidth:"full"})},_i={lastWeek:t=>{const a=t.getDay();return"'"+(a===0||a===6?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},Bi=(t,a,n,e)=>{const i=_i[t];return typeof i=="function"?i(a):i},Qi={narrow:["aC","dC"],abbreviated:["a.C.","d.C."],wide:["antes de Cristo","depois de Cristo"]},Ui={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},Ki={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},Zi={narrow:["d","s","t","q","q","s","s"],short:["dom","seg","ter","qua","qui","sex","sáb"],abbreviated:["dom","seg","ter","qua","qui","sex","sáb"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},er={narrow:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"},wide:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"}},tr={narrow:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"},wide:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"}},ar=(t,a)=>Number(t)+"º",nr={ordinalNumber:ar,era:o({values:Qi,defaultWidth:"wide"}),quarter:o({values:Ui,defaultWidth:"wide",argumentCallback:t=>t-1}),month:o({values:Ki,defaultWidth:"wide"}),day:o({values:Zi,defaultWidth:"wide"}),dayPeriod:o({values:er,defaultWidth:"wide",formattingValues:tr,defaultFormattingWidth:"wide"})},ir=/^(\d+)(º|ª)?/i,rr=/\d+/i,or={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes da era comum|depois de cristo|era comum)/i},sr={any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes da era comum)/i,/^(depois de cristo|era comum)/i]},dr={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º|ª)? trimestre/i},ur={any:[/1/i,/2/i,/3/i,/4/i]},mr={narrow:/^[jfmasond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},lr={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ab/i,/^mai/i,/^jun/i,/^jul/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},cr={narrow:/^[dstq]/i,short:/^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,wide:/^(domingo|segunda-?\s?feira|terça-?\s?feira|quarta-?\s?feira|quinta-?\s?feira|sexta-?\s?feira|s[áa]bado)/i},hr={narrow:[/^d/i,/^s/i,/^t/i,/^q/i,/^q/i,/^s/i,/^s/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[áa]/i]},gr={narrow:/^(a|p|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i,any:/^([ap]\.?\s?m\.?|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i},fr={any:{am:/^a/i,pm:/^p/i,midnight:/^meia/i,noon:/^meio/i,morning:/manh[ãa]/i,afternoon:/tarde/i,evening:/noite/i,night:/madrugada/i}},pr={ordinalNumber:y({matchPattern:ir,parsePattern:rr,valueCallback:t=>parseInt(t,10)}),era:s({matchPatterns:or,defaultMatchWidth:"wide",parsePatterns:sr,defaultParseWidth:"any"}),quarter:s({matchPatterns:dr,defaultMatchWidth:"wide",parsePatterns:ur,defaultParseWidth:"any",valueCallback:t=>t+1}),month:s({matchPatterns:mr,defaultMatchWidth:"wide",parsePatterns:lr,defaultParseWidth:"any"}),day:s({matchPatterns:cr,defaultMatchWidth:"wide",parsePatterns:hr,defaultParseWidth:"any"}),dayPeriod:s({matchPatterns:gr,defaultMatchWidth:"any",parsePatterns:fr,defaultParseWidth:"any"})},vr={code:"pt",formatDistance:Xi,formatLong:Yi,formatRelative:Bi,localize:nr,match:pr,options:{weekStartsOn:1,firstWeekContainsDate:4}},wr={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"cerca de 1 hora",other:"cerca de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"cerca de 1 semana",other:"cerca de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"cerca de 1 mês",other:"cerca de {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"cerca de 1 ano",other:"cerca de {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},yr=(t,a,n)=>{let e;const i=wr[t];return typeof i=="string"?e=i:a===1?e=i.one:e=i.other.replace("{{count}}",String(a)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"em "+e:"há "+e:e},br={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},Mr={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Pr={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},kr={date:l({formats:br,defaultWidth:"full"}),time:l({formats:Mr,defaultWidth:"full"}),dateTime:l({formats:Pr,defaultWidth:"full"})},xr={lastWeek:t=>{const a=t.getDay();return"'"+(a===0||a===6?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},Wr=(t,a,n,e)=>{const i=xr[t];return typeof i=="function"?i(a):i},zr={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},jr={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},Tr={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},$r={narrow:["D","S","T","Q","Q","S","S"],short:["dom","seg","ter","qua","qui","sex","sab"],abbreviated:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},Dr={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"}},Sr={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"}},Cr=(t,a)=>{const n=Number(t);return(a==null?void 0:a.unit)==="week"?n+"ª":n+"º"},Nr={ordinalNumber:Cr,era:o({values:zr,defaultWidth:"wide"}),quarter:o({values:jr,defaultWidth:"wide",argumentCallback:t=>t-1}),month:o({values:Tr,defaultWidth:"wide"}),day:o({values:$r,defaultWidth:"wide"}),dayPeriod:o({values:Dr,defaultWidth:"wide",formattingValues:Sr,defaultFormattingWidth:"wide"})},Ar=/^(\d+)[ºªo]?/i,Er=/\d+/i,Lr={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},Hr={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},Or={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},Gr={any:[/1/i,/2/i,/3/i,/4/i]},Vr={narrow:/^[jfmajsond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},Fr={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^fev/i,/^mar/i,/^abr/i,/^mai/i,/^jun/i,/^jul/i,/^ago/i,/^set/i,/^out/i,/^nov/i,/^dez/i]},Ir={narrow:/^(dom|[23456]ª?|s[aá]b)/i,short:/^(dom|[23456]ª?|s[aá]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,wide:/^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i},Xr={short:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],narrow:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[aá]b/i]},Rr={narrow:/^(a|p|mn|md|(da) (manhã|tarde|noite))/i,any:/^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i},Jr={any:{am:/^a/i,pm:/^p/i,midnight:/^mn|^meia[-\s]noite/i,noon:/^md|^meio[-\s]dia/i,morning:/manhã/i,afternoon:/tarde/i,evening:/tarde/i,night:/noite/i}},qr={ordinalNumber:y({matchPattern:Ar,parsePattern:Er,valueCallback:t=>parseInt(t,10)}),era:s({matchPatterns:Lr,defaultMatchWidth:"wide",parsePatterns:Hr,defaultParseWidth:"any"}),quarter:s({matchPatterns:Or,defaultMatchWidth:"wide",parsePatterns:Gr,defaultParseWidth:"any",valueCallback:t=>t+1}),month:s({matchPatterns:Vr,defaultMatchWidth:"wide",parsePatterns:Fr,defaultParseWidth:"any"}),day:s({matchPatterns:Ir,defaultMatchWidth:"wide",parsePatterns:Xr,defaultParseWidth:"any"}),dayPeriod:s({matchPatterns:Rr,defaultMatchWidth:"any",parsePatterns:Jr,defaultParseWidth:"any"})},Yr={code:"pt-BR",formatDistance:yr,formatLong:kr,formatRelative:Wr,localize:Nr,match:qr,options:{weekStartsOn:0,firstWeekContainsDate:1}};function W(t,a){if(t.one!==void 0&&a===1)return t.one;const n=a%10,e=a%100;return n===1&&e!==11?t.singularNominative.replace("{{count}}",String(a)):n>=2&&n<=4&&(e<10||e>20)?t.singularGenitive.replace("{{count}}",String(a)):t.pluralGenitive.replace("{{count}}",String(a))}function f(t){return(a,n)=>n!=null&&n.addSuffix?n.comparison&&n.comparison>0?t.future?W(t.future,a):"через "+W(t.regular,a):t.past?W(t.past,a):W(t.regular,a)+" назад":W(t.regular,a)}const _r={lessThanXSeconds:f({regular:{one:"меньше секунды",singularNominative:"меньше {{count}} секунды",singularGenitive:"меньше {{count}} секунд",pluralGenitive:"меньше {{count}} секунд"},future:{one:"меньше, чем через секунду",singularNominative:"меньше, чем через {{count}} секунду",singularGenitive:"меньше, чем через {{count}} секунды",pluralGenitive:"меньше, чем через {{count}} секунд"}}),xSeconds:f({regular:{singularNominative:"{{count}} секунда",singularGenitive:"{{count}} секунды",pluralGenitive:"{{count}} секунд"},past:{singularNominative:"{{count}} секунду назад",singularGenitive:"{{count}} секунды назад",pluralGenitive:"{{count}} секунд назад"},future:{singularNominative:"через {{count}} секунду",singularGenitive:"через {{count}} секунды",pluralGenitive:"через {{count}} секунд"}}),halfAMinute:(t,a)=>a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"через полминуты":"полминуты назад":"полминуты",lessThanXMinutes:f({regular:{one:"меньше минуты",singularNominative:"меньше {{count}} минуты",singularGenitive:"меньше {{count}} минут",pluralGenitive:"меньше {{count}} минут"},future:{one:"меньше, чем через минуту",singularNominative:"меньше, чем через {{count}} минуту",singularGenitive:"меньше, чем через {{count}} минуты",pluralGenitive:"меньше, чем через {{count}} минут"}}),xMinutes:f({regular:{singularNominative:"{{count}} минута",singularGenitive:"{{count}} минуты",pluralGenitive:"{{count}} минут"},past:{singularNominative:"{{count}} минуту назад",singularGenitive:"{{count}} минуты назад",pluralGenitive:"{{count}} минут назад"},future:{singularNominative:"через {{count}} минуту",singularGenitive:"через {{count}} минуты",pluralGenitive:"через {{count}} минут"}}),aboutXHours:f({regular:{singularNominative:"около {{count}} часа",singularGenitive:"около {{count}} часов",pluralGenitive:"около {{count}} часов"},future:{singularNominative:"приблизительно через {{count}} час",singularGenitive:"приблизительно через {{count}} часа",pluralGenitive:"приблизительно через {{count}} часов"}}),xHours:f({regular:{singularNominative:"{{count}} час",singularGenitive:"{{count}} часа",pluralGenitive:"{{count}} часов"}}),xDays:f({regular:{singularNominative:"{{count}} день",singularGenitive:"{{count}} дня",pluralGenitive:"{{count}} дней"}}),aboutXWeeks:f({regular:{singularNominative:"около {{count}} недели",singularGenitive:"около {{count}} недель",pluralGenitive:"около {{count}} недель"},future:{singularNominative:"приблизительно через {{count}} неделю",singularGenitive:"приблизительно через {{count}} недели",pluralGenitive:"приблизительно через {{count}} недель"}}),xWeeks:f({regular:{singularNominative:"{{count}} неделя",singularGenitive:"{{count}} недели",pluralGenitive:"{{count}} недель"}}),aboutXMonths:f({regular:{singularNominative:"около {{count}} месяца",singularGenitive:"около {{count}} месяцев",pluralGenitive:"около {{count}} месяцев"},future:{singularNominative:"приблизительно через {{count}} месяц",singularGenitive:"приблизительно через {{count}} месяца",pluralGenitive:"приблизительно через {{count}} месяцев"}}),xMonths:f({regular:{singularNominative:"{{count}} месяц",singularGenitive:"{{count}} месяца",pluralGenitive:"{{count}} месяцев"}}),aboutXYears:f({regular:{singularNominative:"около {{count}} года",singularGenitive:"около {{count}} лет",pluralGenitive:"около {{count}} лет"},future:{singularNominative:"приблизительно через {{count}} год",singularGenitive:"приблизительно через {{count}} года",pluralGenitive:"приблизительно через {{count}} лет"}}),xYears:f({regular:{singularNominative:"{{count}} год",singularGenitive:"{{count}} года",pluralGenitive:"{{count}} лет"}}),overXYears:f({regular:{singularNominative:"больше {{count}} года",singularGenitive:"больше {{count}} лет",pluralGenitive:"больше {{count}} лет"},future:{singularNominative:"больше, чем через {{count}} год",singularGenitive:"больше, чем через {{count}} года",pluralGenitive:"больше, чем через {{count}} лет"}}),almostXYears:f({regular:{singularNominative:"почти {{count}} год",singularGenitive:"почти {{count}} года",pluralGenitive:"почти {{count}} лет"},future:{singularNominative:"почти через {{count}} год",singularGenitive:"почти через {{count}} года",pluralGenitive:"почти через {{count}} лет"}})},Br=(t,a,n)=>_r[t](a,n),Qr={full:"EEEE, d MMMM y 'г.'",long:"d MMMM y 'г.'",medium:"d MMM y 'г.'",short:"dd.MM.y"},Ur={full:"H:mm:ss zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},Kr={any:"{{date}}, {{time}}"},Zr={date:l({formats:Qr,defaultWidth:"full"}),time:l({formats:Ur,defaultWidth:"full"}),dateTime:l({formats:Kr,defaultWidth:"any"})},X=["воскресенье","понедельник","вторник","среду","четверг","пятницу","субботу"];function eo(t){const a=X[t];switch(t){case 0:return"'в прошлое "+a+" в' p";case 1:case 2:case 4:return"'в прошлый "+a+" в' p";case 3:case 5:case 6:return"'в прошлую "+a+" в' p"}}function te(t){const a=X[t];return t===2?"'во "+a+" в' p":"'в "+a+" в' p"}function to(t){const a=X[t];switch(t){case 0:return"'в следующее "+a+" в' p";case 1:case 2:case 4:return"'в следующий "+a+" в' p";case 3:case 5:case 6:return"'в следующую "+a+" в' p"}}const ao={lastWeek:(t,a,n)=>{const e=t.getDay();return M(t,a,n)?te(e):eo(e)},yesterday:"'вчера в' p",today:"'сегодня в' p",tomorrow:"'завтра в' p",nextWeek:(t,a,n)=>{const e=t.getDay();return M(t,a,n)?te(e):to(e)},other:"P"},no=(t,a,n,e)=>{const i=ao[t];return typeof i=="function"?i(a,n,e):i},io={narrow:["до н.э.","н.э."],abbreviated:["до н. э.","н. э."],wide:["до нашей эры","нашей эры"]},ro={narrow:["1","2","3","4"],abbreviated:["1-й кв.","2-й кв.","3-й кв.","4-й кв."],wide:["1-й квартал","2-й квартал","3-й квартал","4-й квартал"]},oo={narrow:["Я","Ф","М","А","М","И","И","А","С","О","Н","Д"],abbreviated:["янв.","фев.","март","апр.","май","июнь","июль","авг.","сент.","окт.","нояб.","дек."],wide:["январь","февраль","март","апрель","май","июнь","июль","август","сентябрь","октябрь","ноябрь","декабрь"]},so={narrow:["Я","Ф","М","А","М","И","И","А","С","О","Н","Д"],abbreviated:["янв.","фев.","мар.","апр.","мая","июн.","июл.","авг.","сент.","окт.","нояб.","дек."],wide:["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"]},uo={narrow:["В","П","В","С","Ч","П","С"],short:["вс","пн","вт","ср","чт","пт","сб"],abbreviated:["вск","пнд","втр","срд","чтв","птн","суб"],wide:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"]},mo={narrow:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утро",afternoon:"день",evening:"веч.",night:"ночь"},abbreviated:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утро",afternoon:"день",evening:"веч.",night:"ночь"},wide:{am:"ДП",pm:"ПП",midnight:"полночь",noon:"полдень",morning:"утро",afternoon:"день",evening:"вечер",night:"ночь"}},lo={narrow:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утра",afternoon:"дня",evening:"веч.",night:"ночи"},abbreviated:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утра",afternoon:"дня",evening:"веч.",night:"ночи"},wide:{am:"ДП",pm:"ПП",midnight:"полночь",noon:"полдень",morning:"утра",afternoon:"дня",evening:"вечера",night:"ночи"}},co=(t,a)=>{const n=Number(t),e=a==null?void 0:a.unit;let i;return e==="date"?i="-е":e==="week"||e==="minute"||e==="second"?i="-я":i="-й",n+i},ho={ordinalNumber:co,era:o({values:io,defaultWidth:"wide"}),quarter:o({values:ro,defaultWidth:"wide",argumentCallback:t=>t-1}),month:o({values:oo,defaultWidth:"wide",formattingValues:so,defaultFormattingWidth:"wide"}),day:o({values:uo,defaultWidth:"wide"}),dayPeriod:o({values:mo,defaultWidth:"any",formattingValues:lo,defaultFormattingWidth:"wide"})},go=/^(\d+)(-?(е|я|й|ое|ье|ая|ья|ый|ой|ий|ый))?/i,fo=/\d+/i,po={narrow:/^((до )?н\.?\s?э\.?)/i,abbreviated:/^((до )?н\.?\s?э\.?)/i,wide:/^(до нашей эры|нашей эры|наша эра)/i},vo={any:[/^д/i,/^н/i]},wo={narrow:/^[1234]/i,abbreviated:/^[1234](-?[ыои]?й?)? кв.?/i,wide:/^[1234](-?[ыои]?й?)? квартал/i},yo={any:[/1/i,/2/i,/3/i,/4/i]},bo={narrow:/^[яфмаисонд]/i,abbreviated:/^(янв|фев|март?|апр|ма[йя]|июн[ья]?|июл[ья]?|авг|сент?|окт|нояб?|дек)\.?/i,wide:/^(январ[ья]|феврал[ья]|марта?|апрел[ья]|ма[йя]|июн[ья]|июл[ья]|августа?|сентябр[ья]|октябр[ья]|октябр[ья]|ноябр[ья]|декабр[ья])/i},Mo={narrow:[/^я/i,/^ф/i,/^м/i,/^а/i,/^м/i,/^и/i,/^и/i,/^а/i,/^с/i,/^о/i,/^н/i,/^я/i],any:[/^я/i,/^ф/i,/^мар/i,/^ап/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^ав/i,/^с/i,/^о/i,/^н/i,/^д/i]},Po={narrow:/^[впсч]/i,short:/^(вс|во|пн|по|вт|ср|чт|че|пт|пя|сб|су)\.?/i,abbreviated:/^(вск|вос|пнд|пон|втр|вто|срд|сре|чтв|чет|птн|пят|суб).?/i,wide:/^(воскресень[ея]|понедельника?|вторника?|сред[аы]|четверга?|пятниц[аы]|суббот[аы])/i},ko={narrow:[/^в/i,/^п/i,/^в/i,/^с/i,/^ч/i,/^п/i,/^с/i],any:[/^в[ос]/i,/^п[он]/i,/^в/i,/^ср/i,/^ч/i,/^п[ят]/i,/^с[уб]/i]},xo={narrow:/^([дп]п|полн\.?|полд\.?|утр[оа]|день|дня|веч\.?|ноч[ьи])/i,abbreviated:/^([дп]п|полн\.?|полд\.?|утр[оа]|день|дня|веч\.?|ноч[ьи])/i,wide:/^([дп]п|полночь|полдень|утр[оа]|день|дня|вечера?|ноч[ьи])/i},Wo={any:{am:/^дп/i,pm:/^пп/i,midnight:/^полн/i,noon:/^полд/i,morning:/^у/i,afternoon:/^д[ен]/i,evening:/^в/i,night:/^н/i}},zo={ordinalNumber:y({matchPattern:go,parsePattern:fo,valueCallback:t=>parseInt(t,10)}),era:s({matchPatterns:po,defaultMatchWidth:"wide",parsePatterns:vo,defaultParseWidth:"any"}),quarter:s({matchPatterns:wo,defaultMatchWidth:"wide",parsePatterns:yo,defaultParseWidth:"any",valueCallback:t=>t+1}),month:s({matchPatterns:bo,defaultMatchWidth:"wide",parsePatterns:Mo,defaultParseWidth:"any"}),day:s({matchPatterns:Po,defaultMatchWidth:"wide",parsePatterns:ko,defaultParseWidth:"any"}),dayPeriod:s({matchPatterns:xo,defaultMatchWidth:"wide",parsePatterns:Wo,defaultParseWidth:"any"})},jo={code:"ru",formatDistance:Br,formatLong:Zr,formatRelative:no,localize:ho,match:zo,options:{weekStartsOn:1,firstWeekContainsDate:1}};function z(t,a){if(t.one!==void 0&&a===1)return t.one;const n=a%10,e=a%100;return n===1&&e!==11?t.singularNominative.replace("{{count}}",String(a)):n>=2&&n<=4&&(e<10||e>20)?t.singularGenitive.replace("{{count}}",String(a)):t.pluralGenitive.replace("{{count}}",String(a))}function p(t){return(a,n)=>n&&n.addSuffix?n.comparison&&n.comparison>0?t.future?z(t.future,a):"за "+z(t.regular,a):t.past?z(t.past,a):z(t.regular,a)+" тому":z(t.regular,a)}const To=(t,a)=>a&&a.addSuffix?a.comparison&&a.comparison>0?"за півхвилини":"півхвилини тому":"півхвилини",$o={lessThanXSeconds:p({regular:{one:"менше секунди",singularNominative:"менше {{count}} секунди",singularGenitive:"менше {{count}} секунд",pluralGenitive:"менше {{count}} секунд"},future:{one:"менше, ніж за секунду",singularNominative:"менше, ніж за {{count}} секунду",singularGenitive:"менше, ніж за {{count}} секунди",pluralGenitive:"менше, ніж за {{count}} секунд"}}),xSeconds:p({regular:{singularNominative:"{{count}} секунда",singularGenitive:"{{count}} секунди",pluralGenitive:"{{count}} секунд"},past:{singularNominative:"{{count}} секунду тому",singularGenitive:"{{count}} секунди тому",pluralGenitive:"{{count}} секунд тому"},future:{singularNominative:"за {{count}} секунду",singularGenitive:"за {{count}} секунди",pluralGenitive:"за {{count}} секунд"}}),halfAMinute:To,lessThanXMinutes:p({regular:{one:"менше хвилини",singularNominative:"менше {{count}} хвилини",singularGenitive:"менше {{count}} хвилин",pluralGenitive:"менше {{count}} хвилин"},future:{one:"менше, ніж за хвилину",singularNominative:"менше, ніж за {{count}} хвилину",singularGenitive:"менше, ніж за {{count}} хвилини",pluralGenitive:"менше, ніж за {{count}} хвилин"}}),xMinutes:p({regular:{singularNominative:"{{count}} хвилина",singularGenitive:"{{count}} хвилини",pluralGenitive:"{{count}} хвилин"},past:{singularNominative:"{{count}} хвилину тому",singularGenitive:"{{count}} хвилини тому",pluralGenitive:"{{count}} хвилин тому"},future:{singularNominative:"за {{count}} хвилину",singularGenitive:"за {{count}} хвилини",pluralGenitive:"за {{count}} хвилин"}}),aboutXHours:p({regular:{singularNominative:"близько {{count}} години",singularGenitive:"близько {{count}} годин",pluralGenitive:"близько {{count}} годин"},future:{singularNominative:"приблизно за {{count}} годину",singularGenitive:"приблизно за {{count}} години",pluralGenitive:"приблизно за {{count}} годин"}}),xHours:p({regular:{singularNominative:"{{count}} годину",singularGenitive:"{{count}} години",pluralGenitive:"{{count}} годин"}}),xDays:p({regular:{singularNominative:"{{count}} день",singularGenitive:"{{count}} днi",pluralGenitive:"{{count}} днів"}}),aboutXWeeks:p({regular:{singularNominative:"близько {{count}} тижня",singularGenitive:"близько {{count}} тижнів",pluralGenitive:"близько {{count}} тижнів"},future:{singularNominative:"приблизно за {{count}} тиждень",singularGenitive:"приблизно за {{count}} тижні",pluralGenitive:"приблизно за {{count}} тижнів"}}),xWeeks:p({regular:{singularNominative:"{{count}} тиждень",singularGenitive:"{{count}} тижні",pluralGenitive:"{{count}} тижнів"}}),aboutXMonths:p({regular:{singularNominative:"близько {{count}} місяця",singularGenitive:"близько {{count}} місяців",pluralGenitive:"близько {{count}} місяців"},future:{singularNominative:"приблизно за {{count}} місяць",singularGenitive:"приблизно за {{count}} місяці",pluralGenitive:"приблизно за {{count}} місяців"}}),xMonths:p({regular:{singularNominative:"{{count}} місяць",singularGenitive:"{{count}} місяці",pluralGenitive:"{{count}} місяців"}}),aboutXYears:p({regular:{singularNominative:"близько {{count}} року",singularGenitive:"близько {{count}} років",pluralGenitive:"близько {{count}} років"},future:{singularNominative:"приблизно за {{count}} рік",singularGenitive:"приблизно за {{count}} роки",pluralGenitive:"приблизно за {{count}} років"}}),xYears:p({regular:{singularNominative:"{{count}} рік",singularGenitive:"{{count}} роки",pluralGenitive:"{{count}} років"}}),overXYears:p({regular:{singularNominative:"більше {{count}} року",singularGenitive:"більше {{count}} років",pluralGenitive:"більше {{count}} років"},future:{singularNominative:"більше, ніж за {{count}} рік",singularGenitive:"більше, ніж за {{count}} роки",pluralGenitive:"більше, ніж за {{count}} років"}}),almostXYears:p({regular:{singularNominative:"майже {{count}} рік",singularGenitive:"майже {{count}} роки",pluralGenitive:"майже {{count}} років"},future:{singularNominative:"майже за {{count}} рік",singularGenitive:"майже за {{count}} роки",pluralGenitive:"майже за {{count}} років"}})},Do=(t,a,n)=>(n=n||{},$o[t](a,n)),So={full:"EEEE, do MMMM y 'р.'",long:"do MMMM y 'р.'",medium:"d MMM y 'р.'",short:"dd.MM.y"},Co={full:"H:mm:ss zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},No={full:"{{date}} 'о' {{time}}",long:"{{date}} 'о' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ao={date:l({formats:So,defaultWidth:"full"}),time:l({formats:Co,defaultWidth:"full"}),dateTime:l({formats:No,defaultWidth:"full"})},R=["неділю","понеділок","вівторок","середу","четвер","п’ятницю","суботу"];function Eo(t){const a=R[t];switch(t){case 0:case 3:case 5:case 6:return"'у минулу "+a+" о' p";case 1:case 2:case 4:return"'у минулий "+a+" о' p"}}function me(t){return"'у "+R[t]+" о' p"}function Lo(t){const a=R[t];switch(t){case 0:case 3:case 5:case 6:return"'у наступну "+a+" о' p";case 1:case 2:case 4:return"'у наступний "+a+" о' p"}}const Ho=(t,a,n)=>{const e=ue(t),i=e.getDay();return M(e,a,n)?me(i):Eo(i)},Oo=(t,a,n)=>{const e=ue(t),i=e.getDay();return M(e,a,n)?me(i):Lo(i)},Go={lastWeek:Ho,yesterday:"'вчора о' p",today:"'сьогодні о' p",tomorrow:"'завтра о' p",nextWeek:Oo,other:"P"},Vo=(t,a,n,e)=>{const i=Go[t];return typeof i=="function"?i(a,n,e):i},Fo={narrow:["до н.е.","н.е."],abbreviated:["до н. е.","н. е."],wide:["до нашої ери","нашої ери"]},Io={narrow:["1","2","3","4"],abbreviated:["1-й кв.","2-й кв.","3-й кв.","4-й кв."],wide:["1-й квартал","2-й квартал","3-й квартал","4-й квартал"]},Xo={narrow:["С","Л","Б","К","Т","Ч","Л","С","В","Ж","Л","Г"],abbreviated:["січ.","лют.","берез.","квіт.","трав.","черв.","лип.","серп.","верес.","жовт.","листоп.","груд."],wide:["січень","лютий","березень","квітень","травень","червень","липень","серпень","вересень","жовтень","листопад","грудень"]},Ro={narrow:["С","Л","Б","К","Т","Ч","Л","С","В","Ж","Л","Г"],abbreviated:["січ.","лют.","берез.","квіт.","трав.","черв.","лип.","серп.","верес.","жовт.","листоп.","груд."],wide:["січня","лютого","березня","квітня","травня","червня","липня","серпня","вересня","жовтня","листопада","грудня"]},Jo={narrow:["Н","П","В","С","Ч","П","С"],short:["нд","пн","вт","ср","чт","пт","сб"],abbreviated:["нед","пон","вів","сер","чтв","птн","суб"],wide:["неділя","понеділок","вівторок","середа","четвер","п’ятниця","субота"]},qo={narrow:{am:"ДП",pm:"ПП",midnight:"півн.",noon:"пол.",morning:"ранок",afternoon:"день",evening:"веч.",night:"ніч"},abbreviated:{am:"ДП",pm:"ПП",midnight:"півн.",noon:"пол.",morning:"ранок",afternoon:"день",evening:"веч.",night:"ніч"},wide:{am:"ДП",pm:"ПП",midnight:"північ",noon:"полудень",morning:"ранок",afternoon:"день",evening:"вечір",night:"ніч"}},Yo={narrow:{am:"ДП",pm:"ПП",midnight:"півн.",noon:"пол.",morning:"ранку",afternoon:"дня",evening:"веч.",night:"ночі"},abbreviated:{am:"ДП",pm:"ПП",midnight:"півн.",noon:"пол.",morning:"ранку",afternoon:"дня",evening:"веч.",night:"ночі"},wide:{am:"ДП",pm:"ПП",midnight:"північ",noon:"полудень",morning:"ранку",afternoon:"дня",evening:"веч.",night:"ночі"}},_o=(t,a)=>{const n=String(a==null?void 0:a.unit),e=Number(t);let i;return n==="date"?e===3||e===23?i="-є":i="-е":n==="minute"||n==="second"||n==="hour"?i="-а":i="-й",e+i},Bo={ordinalNumber:_o,era:o({values:Fo,defaultWidth:"wide"}),quarter:o({values:Io,defaultWidth:"wide",argumentCallback:t=>t-1}),month:o({values:Xo,defaultWidth:"wide",formattingValues:Ro,defaultFormattingWidth:"wide"}),day:o({values:Jo,defaultWidth:"wide"}),dayPeriod:o({values:qo,defaultWidth:"any",formattingValues:Yo,defaultFormattingWidth:"wide"})},Qo=/^(\d+)(-?(е|й|є|а|я))?/i,Uo=/\d+/i,Ko={narrow:/^((до )?н\.?\s?е\.?)/i,abbreviated:/^((до )?н\.?\s?е\.?)/i,wide:/^(до нашої ери|нашої ери|наша ера)/i},Zo={any:[/^д/i,/^н/i]},es={narrow:/^[1234]/i,abbreviated:/^[1234](-?[иі]?й?)? кв.?/i,wide:/^[1234](-?[иі]?й?)? квартал/i},ts={any:[/1/i,/2/i,/3/i,/4/i]},as={narrow:/^[слбктчвжг]/i,abbreviated:/^(січ|лют|бер(ез)?|квіт|трав|черв|лип|серп|вер(ес)?|жовт|лис(топ)?|груд)\.?/i,wide:/^(січень|січня|лютий|лютого|березень|березня|квітень|квітня|травень|травня|червня|червень|липень|липня|серпень|серпня|вересень|вересня|жовтень|жовтня|листопад[а]?|грудень|грудня)/i},ns={narrow:[/^с/i,/^л/i,/^б/i,/^к/i,/^т/i,/^ч/i,/^л/i,/^с/i,/^в/i,/^ж/i,/^л/i,/^г/i],any:[/^сі/i,/^лю/i,/^б/i,/^к/i,/^т/i,/^ч/i,/^лип/i,/^се/i,/^в/i,/^ж/i,/^лис/i,/^г/i]},is={narrow:/^[нпвсч]/i,short:/^(нд|пн|вт|ср|чт|пт|сб)\.?/i,abbreviated:/^(нед|пон|вів|сер|че?тв|птн?|суб)\.?/i,wide:/^(неділ[яі]|понеділ[ок][ка]|вівтор[ок][ка]|серед[аи]|четвер(га)?|п\W*?ятниц[яі]|субот[аи])/i},rs={narrow:[/^н/i,/^п/i,/^в/i,/^с/i,/^ч/i,/^п/i,/^с/i],any:[/^н/i,/^п[он]/i,/^в/i,/^с[ер]/i,/^ч/i,/^п\W*?[ят]/i,/^с[уб]/i]},os={narrow:/^([дп]п|півн\.?|пол\.?|ранок|ранку|день|дня|веч\.?|ніч|ночі)/i,abbreviated:/^([дп]п|півн\.?|пол\.?|ранок|ранку|день|дня|веч\.?|ніч|ночі)/i,wide:/^([дп]п|північ|полудень|ранок|ранку|день|дня|вечір|вечора|ніч|ночі)/i},ss={any:{am:/^дп/i,pm:/^пп/i,midnight:/^півн/i,noon:/^пол/i,morning:/^р/i,afternoon:/^д[ен]/i,evening:/^в/i,night:/^н/i}},ds={ordinalNumber:y({matchPattern:Qo,parsePattern:Uo,valueCallback:t=>parseInt(t,10)}),era:s({matchPatterns:Ko,defaultMatchWidth:"wide",parsePatterns:Zo,defaultParseWidth:"any"}),quarter:s({matchPatterns:es,defaultMatchWidth:"wide",parsePatterns:ts,defaultParseWidth:"any",valueCallback:t=>t+1}),month:s({matchPatterns:as,defaultMatchWidth:"wide",parsePatterns:ns,defaultParseWidth:"any"}),day:s({matchPatterns:is,defaultMatchWidth:"wide",parsePatterns:rs,defaultParseWidth:"any"}),dayPeriod:s({matchPatterns:os,defaultMatchWidth:"wide",parsePatterns:ss,defaultParseWidth:"any"})},us={code:"uk",formatDistance:Do,formatLong:Ao,formatRelative:Vo,localize:Bo,match:ds,options:{weekStartsOn:1,firstWeekContainsDate:1}},ms={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},ls=(t,a,n)=>{let e;const i=ms[t];return typeof i=="string"?e=i:a===1?e=i.one:e=i.other.replace("{{count}}",String(a)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?e+"内":e+"前":e},cs={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},hs={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},gs={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},fs={date:l({formats:cs,defaultWidth:"full"}),time:l({formats:hs,defaultWidth:"full"}),dateTime:l({formats:gs,defaultWidth:"full"})};function ae(t,a,n){const e="eeee p";return M(t,a,n)?e:t.getTime()>a.getTime()?"'下个'"+e:"'上个'"+e}const ps={lastWeek:ae,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:ae,other:"PP p"},vs=(t,a,n,e)=>{const i=ps[t];return typeof i=="function"?i(a,n,e):i},ws={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},ys={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},bs={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},Ms={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},Ps={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},ks={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},xs=(t,a)=>{const n=Number(t);switch(a==null?void 0:a.unit){case"date":return n.toString()+"日";case"hour":return n.toString()+"时";case"minute":return n.toString()+"分";case"second":return n.toString()+"秒";default:return"第 "+n.toString()}},Ws={ordinalNumber:xs,era:o({values:ws,defaultWidth:"wide"}),quarter:o({values:ys,defaultWidth:"wide",argumentCallback:t=>t-1}),month:o({values:bs,defaultWidth:"wide"}),day:o({values:Ms,defaultWidth:"wide"}),dayPeriod:o({values:Ps,defaultWidth:"wide",formattingValues:ks,defaultFormattingWidth:"wide"})},zs=/^(第\s*)?\d+(日|时|分|秒)?/i,js=/\d+/i,Ts={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},$s={any:[/^(前)/i,/^(公元)/i]},Ds={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},Ss={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},Cs={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},Ns={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},As={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},Es={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},Ls={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},Hs={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},Os={ordinalNumber:y({matchPattern:zs,parsePattern:js,valueCallback:t=>parseInt(t,10)}),era:s({matchPatterns:Ts,defaultMatchWidth:"wide",parsePatterns:$s,defaultParseWidth:"any"}),quarter:s({matchPatterns:Ds,defaultMatchWidth:"wide",parsePatterns:Ss,defaultParseWidth:"any",valueCallback:t=>t+1}),month:s({matchPatterns:Cs,defaultMatchWidth:"wide",parsePatterns:Ns,defaultParseWidth:"any"}),day:s({matchPatterns:As,defaultMatchWidth:"wide",parsePatterns:Es,defaultParseWidth:"any"}),dayPeriod:s({matchPatterns:Ls,defaultMatchWidth:"any",parsePatterns:Hs,defaultParseWidth:"any"})},Gs={code:"zh-CN",formatDistance:ls,formatLong:fs,formatRelative:vs,localize:Ws,match:Os,options:{weekStartsOn:1,firstWeekContainsDate:4}};function Vs(t,a){const n=j(a);T(function(){a!==n.current&&t.attributionControl!=null&&(n.current!=null&&t.attributionControl.removeAttribution(n.current),a!=null&&t.attributionControl.addAttribution(a)),n.current=a},[t,a])}const Fs=1;function Is(t){return Object.freeze({__version:Fs,map:t})}const le=be(null),Xs=le.Provider;function ce(){const t=Me(le);if(t==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of ");return t}function Rs(t){function a(n,e){const{instance:i}=t(n).current;return oe(e,()=>i),null}return re(a)}function Js(t,a){const n=j();T(function(){return a!=null&&t.instance.on(a),n.current=a,function(){n.current!=null&&t.instance.off(n.current),n.current=null}},[t,a])}function he(t,a){const n=t.pane??a.pane;return n?{...t,pane:n}:t}function qs(t,a,n){return Object.freeze({instance:t,context:a,container:n})}function Ys(t,a){return a==null?function(e,i){const c=j();return c.current||(c.current=t(e,i)),c}:function(e,i){const c=j();c.current||(c.current=t(e,i));const m=j(e),{instance:g}=c.current;return T(function(){m.current!==e&&(a(g,e,m.current),m.current=e)},[g,e,i]),c}}function _s(t,a){T(function(){return(a.layerContainer??a.map).addLayer(t.instance),function(){var c;(c=a.layerContainer)==null||c.removeLayer(t.instance),a.map.removeLayer(t.instance)}},[a,t])}function Bs(t){return function(n){const e=ce(),i=t(he(n,e),e);return Vs(e.map,n.attribution),Js(i.current,n.eventHandlers),_s(i.current,e),i}}function Qs(t,a){const n=Ys(t,a),e=Bs(n);return Rs(e)}function Us(t,a,n){const{opacity:e,zIndex:i}=a;e!=null&&e!==n.opacity&&t.setOpacity(e),i!=null&&i!==n.zIndex&&t.setZIndex(i)}function Ks(){return ce().map}function F(){return F=Object.assign||function(t){for(var a=1;a(u==null?void 0:u.map)??null,[u]);const fe=Pe(J=>{if(J!==null&&u===null){const $=new se.Map(J,x);n!=null&&w!=null?$.setView(n,w):t!=null&&$.fitBounds(t,a),h!=null&&$.whenReady(h),ge(Is($))}},[]);T(()=>()=>{u==null||u.map.remove()},[u]);const pe=u?A.createElement(Xs,{value:u},e):m??null;return A.createElement("div",F({},b,{ref:fe}),pe)}const ed=re(Zs),td=Qs(function({url:a,...n},e){const i=new se.TileLayer(a,he(n,e));return qs(i,e)},function(a,n,e){Us(a,n,e);const{url:i}=n;i!=null&&i!==e.url&&a.setUrl(i)}),ad="data:image/png;base64,iVBORw0KGg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3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC",id="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzh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ZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==";function rd(t){var e;const a=Ks(),n=A.useRef(null);return n.current!==a&&(n.current=a,(e=t.addMap)==null||e.call(t,a)),null}let ne=0;class od extends ke{divRef;marker;map;latLongTimer;resizeTimer;mapKey;constructor(a){super(a),this.state={zoom:14,latitude:this.props.latitude,longitude:this.props.longitude,width:0,height:0},this.divRef=A.createRef(),this.marker=null,ne++,this.mapKey=ne}onMap=a=>{if(!this.map||this.map!==a){this.map=a;const n=[parseFloat(this.state.latitude!==void 0?this.state.latitude:50)||0,parseFloat(this.state.longitude!==void 0?this.state.longitude:10)||0],e=window.L.icon({iconUrl:ad,iconRetinaUrl:id,shadowUrl:nd,iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]});this.marker=window.L.marker(n,{draggable:!0,title:"Resource location",alt:"Resource Location",riseOnHover:!0,icon:e}).addTo(a).bindPopup("Popup for any custom information.").on({dragend:i=>this.onMarkerDragend(i)})}};componentDidUpdate(){this.map&&this.marker&&(this.props.latitude!==this.state.latitude||this.props.longitude!==this.state.longitude)&&this.setState({latitude:this.props.latitude,longitude:this.props.longitude},()=>{this.latLongTimer&&clearTimeout(this.latLongTimer),this.latLongTimer=setTimeout(()=>{this.latLongTimer=null,this.map.flyTo([this.state.latitude,this.state.longitude]),this.marker.setLatLng([this.state.latitude,this.state.longitude])},500)}),this.divRef.current&&(this.state.width!==this.divRef.current.clientWidth||this.state.height!==this.divRef.current.clientHeight)&&(this.resizeTimer&&clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout(()=>{this.resizeTimer=null,this.divRef.current&&this.setState({width:this.divRef.current.clientWidth,height:this.divRef.current.clientHeight})},100))}componentWillUnmount(){this.latLongTimer&&(clearTimeout(this.latLongTimer),this.latLongTimer=null),this.resizeTimer&&(clearTimeout(this.resizeTimer),this.resizeTimer=null),this.marker&&(this.marker.off("dragend"),this.marker.remove(),this.marker=null),this.map=void 0}onMarkerDragend=a=>{if(this.props.readOnly){this.map.flyTo([this.state.latitude,this.state.longitude]),this.marker.setLatLng([this.state.latitude,this.state.longitude]);return}const n=JSON.parse(JSON.stringify(a.target._latlng));this.setState({latitude:n.lat,longitude:n.lng},()=>this.props.onChange(this.state.latitude,this.state.longitude))};render(){const a=[parseFloat(this.props.latitude!==void 0?this.props.latitude:50)||0,parseFloat(this.props.longitude!==void 0?this.props.longitude:10)||0],{zoom:n}=this.state;return r.jsx("div",{style:{width:"100%",height:"100%",minHeight:350},ref:this.divRef,children:this.state.width&&this.state.height?r.jsxs(ed,{style:{width:"100%",height:"100%",minHeight:350,borderRadius:5},center:a,zoom:n,maxZoom:18,attributionControl:!1,zoomControl:!0,doubleClickZoom:!0,scrollWheelZoom:!0,dragging:!this.props.readOnly,easeLinearity:.35,children:[r.jsx(td,{url:"https://{s}.tile.osm.org/{z}/{x}/{y}.png"}),r.jsx(rd,{addMap:e=>this.onMap(e)})]},`map-${this.mapKey}`):null})}}const sd={en:de,fr:Qa,ru:jo,de:Xt,es:ba,br:Yr,nl:ii,it:$n,pt:vr,pl:Fi,uk:us,"zh-cn":Gs},G=["useSystemGPS","latitude","longitude","sunriseEvent","sunriseOffset","sunriseLimitStart","sunriseLimitEnd","sunsetEvent","sunsetOffset","sunsetLimitStart","sunsetLimitEnd"];function C(t){if(!t)return new Date;const a=t.split(":");return new Date(2e3,0,1,parseInt(a[0],10),parseInt(a[1],10))}function N(t){return t?`${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}`:""}function ie(t){const a=t.getHours().toString().padStart(2,"0"),n=t.getMinutes().toString().padStart(2,"0"),e=t.getSeconds().toString().padStart(2,"0");return`${a}:${n}:${e}`}class dd extends _.ConfigGeneric{calcTimeout;lastCalc;mounted=!1;constructor(a){super(a),Object.assign(this.state,{theme:d.Theme(this.props.themeName||"light")})}componentDidMount(){super.componentDidMount(),this.mounted=!0;const a={};G.forEach(n=>{a[n]=_.ConfigGeneric.getValue(this.props.data,n)}),a.sunsetOffset=a.sunsetOffset||0,a.sunriseOffset=a.sunriseOffset||0,a.sunriseLimitStart=C(a.sunriseLimitStart),a.sunriseLimitEnd=C(a.sunriseLimitEnd),a.sunsetLimitStart=C(a.sunsetLimitStart),a.sunsetLimitEnd=C(a.sunsetLimitEnd),a.useSystemGPS&&(a.latitude=this.props.oContext.systemConfig.latitude,a.longitude=this.props.oContext.systemConfig.longitude),a.ampm=this.props.oContext.systemConfig.dateFormat.includes("/"),this.setState(a,()=>this.onAstroChange())}componentWillUnmount(){this.mounted=!1,this.calcTimeout&&(clearTimeout(this.calcTimeout),this.calcTimeout=null)}renderMap(){return r.jsx(od,{longitude:this.state.longitude,latitude:this.state.latitude,readOnly:!!this.state.useSystemGPS,onChange:(a,n)=>this.setState({latitude:a,longitude:n})})}onAstroChange(a,n){let e={};typeof a=="object"?e=a:a!==void 0&&(e={[a]:n}),this.setState(e,()=>{const i={};G.forEach(m=>i[m]=this.state[m]),i.sunriseLimitStart=N(i.sunriseLimitStart),i.sunriseLimitEnd=N(i.sunriseLimitEnd),i.sunsetLimitStart=N(i.sunsetLimitStart),i.sunsetLimitEnd=N(i.sunsetLimitEnd),i.sunsetOffset=parseInt(i.sunsetOffset,10)||0,i.sunriseOffset=parseInt(i.sunriseOffset,10)||0,this.calculateRiseSet(i);const c=JSON.parse(JSON.stringify(this.props.data));G.forEach(m=>c[m]=i[m]),a!==void 0&&this.props.onChange(c)})}calculateRiseSet(a){this.props.alive&&this.lastCalc!==JSON.stringify(a)&&(this.lastCalc=JSON.stringify(a),this.calcTimeout&&clearTimeout(this.calcTimeout),this.calcTimeout=setTimeout(async()=>{if(this.calcTimeout=null,!this.mounted)return;const n=await this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,"calcAstro",a);if(this.mounted){if(!n||n.error){console.error(`Cannot calculate astro times: ${JSON.stringify(n.error)}`);return}this.setState({nextSunrise:n.nextSunrise.isValidDate?ie(new Date(n.nextSunrise.date)):"n/a",nextSunset:n.nextSunset.isValidDate?ie(new Date(n.nextSunset.date)):"n/a",nextSunriseServer:n.nextSunrise.serverTime,nextSunsetServer:n.nextSunset.serverTime})}},300))}renderItem(){const{useSystemGPS:a,latitude:n,longitude:e,sunriseEvent:i,sunriseOffset:c,sunriseLimitStart:m,sunriseLimitEnd:g,sunsetEvent:h,sunsetOffset:w,sunsetLimitStart:x,sunsetLimitEnd:E}=this.state,b=window.innerWidth<800;return r.jsx(xe,{theme:this.state.theme,children:r.jsxs("div",{style:{width:"100%",display:b?void 0:"flex",gap:10},children:[r.jsx("div",{style:{width:b?"100%":"calc(50% - 5px)",display:b?"block":"inline-block"},children:r.jsxs(ve,{dateAdapter:gt,adapterLocale:sd[d.I18n.getLanguage()],children:[r.jsx(we,{style:{width:"calc(100% - 10px)"},control:r.jsx(ye,{checked:!!a,onChange:u=>{u.target.checked?this.onAstroChange({useSystemGPS:!0,latitude:this.props.oContext.systemConfig.latitude,longitude:this.props.oContext.systemConfig.longitude}):this.onAstroChange({useSystemGPS:!1,latitude:n||this.props.oContext.systemConfig.latitude,longitude:e||this.props.oContext.systemConfig.longitude})}}),label:d.I18n.t("Use system settings")}),a?null:r.jsx(S,{variant:"standard",type:"text",style:{width:150,marginRight:10},label:d.I18n.t("Latitude °"),value:(n||"").toString(),onChange:u=>this.onAstroChange("latitude",u.target.value)}),a?null:r.jsx(S,{variant:"standard",style:{width:150},type:"text",label:d.I18n.t("Longitude °"),value:(e||"").toString(),onChange:u=>this.onAstroChange("longitude",u.target.value)}),a?null:r.jsx("div",{style:{width:"calc(100% - 10px)"},children:d.I18n.t("Help")}),r.jsx("h2",{style:{width:"calc(100% - 10px)",marginTop:20,backgroundColor:this.props.oContext.themeType==="dark"?"#333":"#ccc",color:this.props.oContext.themeType==="dark"?"#FFF":"#000",padding:"2px 8px",borderRadius:3},children:d.I18n.t("Day time settings")}),r.jsxs("div",{style:{width:"calc(100% - 10px)",display:"flex",gap:8,flexWrap:"wrap",backgroundColor:this.props.oContext.themeType==="dark"?"#333":"#ccc",paddingTop:8,paddingLeft:8,paddingRight:8,paddingBottom:0,borderRadius:"5px 5px 0 0"},children:[r.jsxs(P,{variant:"standard",style:{width:250},children:[r.jsx(k,{shrink:!0,children:d.I18n.t("Time event")}),r.jsxs(q,{variant:"standard",value:i||"_",onChange:u=>this.onAstroChange("sunriseEvent",u.target.value==="_"?"":u.target.value),children:[r.jsx(v,{value:"_",children:d.I18n.t("none")}),r.jsx(v,{value:"nightEnd",children:d.I18n.t("sch_astro_nightEnd")}),r.jsx(v,{value:"nauticalDawn",children:d.I18n.t("sch_astro_nauticalDawn")}),r.jsx(v,{value:"dawn",children:d.I18n.t("sch_astro_dawn")}),r.jsx(v,{value:"sunrise",children:d.I18n.t("sch_astro_sunrise")}),r.jsx(v,{value:"sunriseEnd",children:d.I18n.t("sch_astro_sunriseEnd")}),r.jsx(v,{value:"goldenHourEnd",children:d.I18n.t("sch_astro_goldenHourEnd")})]}),r.jsx(Y,{children:d.I18n.t("Used as start of the daytime")})]}),r.jsx(S,{style:{width:80},variant:"standard",disabled:!this.state.sunriseEvent,label:d.I18n.t("Offset"),value:c||0,helperText:d.I18n.t("in minutes"),onChange:u=>this.onAstroChange("sunriseOffset",u.target.value)}),r.jsxs(P,{variant:"standard",style:{width:150},children:[r.jsx(k,{shrink:!0,children:d.I18n.t("But not earlier")}),r.jsx(D,{className:`astroToolbarTime ${this.props.oContext.themeType}`,disabled:!this.state.sunriseEvent,ampm:!!this.state.ampm,views:["hours","minutes"],value:m||new Date(2e3,0,1,0,0),onChange:u=>this.onAstroChange("sunriseLimitStart",new Date(u))})]}),r.jsxs(P,{variant:"standard",style:{width:150},children:[r.jsx(k,{shrink:!0,children:d.I18n.t("And not later")}),r.jsx(D,{className:`astroToolbarTime ${this.props.oContext.themeType}`,disabled:!this.state.sunriseEvent,ampm:!!this.state.ampm,views:["hours","minutes"],value:g||new Date(2e3,0,1,0,0),onChange:u=>this.onAstroChange("sunriseLimitEnd",new Date(u))})]})]}),this.props.alive?r.jsxs("div",{style:{backgroundColor:this.props.oContext.themeType==="dark"?"#333":"#ccc",width:"calc(100% - 10px)",paddingTop:20,paddingLeft:8,paddingRight:8,paddingBottom:8,borderRadius:"0 0 5px 5px"},children:[r.jsx("span",{style:{marginRight:8},children:d.I18n.t("Next sunrise")}),r.jsxs("span",{children:[this.state.nextSunriseServer,this.state.nextSunrise!==this.state.nextSunriseServer?` ${d.I18n.t("Local time")}: ${this.state.nextSunrise}`:""]})]}):null,r.jsxs("div",{style:{width:"calc(100% - 10px)",display:"flex",gap:8,marginTop:30,flexWrap:"wrap",backgroundColor:this.props.oContext.themeType==="dark"?"#333":"#ccc",paddingTop:8,paddingLeft:8,paddingRight:8,paddingBottom:0,borderRadius:"5px 5px 0 0"},children:[r.jsxs(P,{variant:"standard",style:{width:250},children:[r.jsx(k,{shrink:!0,children:d.I18n.t("Time event")}),r.jsxs(q,{variant:"standard",value:h||"_",onChange:u=>this.onAstroChange("sunsetEvent",u.target.value==="_"?"":u.target.value),children:[r.jsx(v,{value:"_",children:d.I18n.t("none")}),r.jsx(v,{value:"goldenHour",children:d.I18n.t("sch_astro_goldenHour")}),r.jsx(v,{value:"sunsetStart",children:d.I18n.t("sch_astro_sunsetStart")}),r.jsx(v,{value:"sunset",children:d.I18n.t("sch_astro_sunset")}),r.jsx(v,{value:"dusk",children:d.I18n.t("sch_astro_dusk")}),r.jsx(v,{value:"nauticalDusk",children:d.I18n.t("sch_astro_nauticalDusk")}),r.jsx(v,{value:"night",children:d.I18n.t("sch_astro_night")})]}),r.jsx(Y,{children:d.I18n.t("Used as end of the daytime")})]}),r.jsx(S,{style:{width:80},variant:"standard",disabled:!this.state.sunsetEvent,label:d.I18n.t("Offset"),value:w||0,helperText:d.I18n.t("in minutes"),onChange:u=>this.onAstroChange("sunsetOffset",u.target.value)}),r.jsxs(P,{variant:"standard",style:{width:150},children:[r.jsx(k,{shrink:!0,children:d.I18n.t("But not earlier")}),r.jsx(D,{className:`astroToolbarTime ${this.props.oContext.themeType}`,disabled:!this.state.sunsetEvent,ampm:!!this.state.ampm,views:["hours","minutes"],value:x||new Date(2e3,0,1,0,0),onChange:u=>this.onAstroChange("sunsetLimitStart",new Date(u))})]}),r.jsxs(P,{variant:"standard",style:{width:150},children:[r.jsx(k,{shrink:!0,children:d.I18n.t("And not later")}),r.jsx(D,{className:`astroToolbarTime ${this.props.oContext.themeType}`,disabled:!this.state.sunsetEvent,ampm:!!this.state.ampm,views:["hours","minutes"],value:E||new Date(2e3,0,1,0,0),onChange:u=>this.onAstroChange("sunsetLimitEnd",new Date(u))})]})]}),this.props.alive?r.jsxs("div",{style:{backgroundColor:this.props.oContext.themeType==="dark"?"#333":"#ccc",width:"calc(100% - 10px)",paddingTop:20,paddingLeft:8,paddingRight:8,paddingBottom:8,borderRadius:"0 0 5px 5px",marginBottom:b?20:0},children:[r.jsx("span",{style:{marginRight:8},children:d.I18n.t("Next sunset")}),r.jsxs("span",{children:[this.state.nextSunsetServer,this.state.nextSunset!==this.state.nextSunsetServer?` ${d.I18n.t("Local time")}: ${this.state.nextSunset}`:""]})]}):null]})}),r.jsx("div",{style:{width:b?"100%":"calc(50% - 5px)",display:b?"block":"inline-block",minHeight:350},children:this.renderMap()})]})})}}const Wd={Astro:dd};export{Wd as default}; diff --git a/admin/custom/assets/index-DbXK0odl.js b/admin/custom/assets/index-1mjx3wAv.js similarity index 95% rename from admin/custom/assets/index-DbXK0odl.js rename to admin/custom/assets/index-1mjx3wAv.js index f3ef39dea..0c649201e 100644 --- a/admin/custom/assets/index-DbXK0odl.js +++ b/admin/custom/assets/index-1mjx3wAv.js @@ -1 +1 @@ -import"./virtual_mf-REMOTE_ENTRY_ID_ConfigCustomJavascriptSet__customComponents_js-BZZsMeVW.js";import{j as n}from"./jsx-runtime-DfVU3AZG.js";import{h as d}from"./ConfigCustomJavascriptSet__loadShare__react__loadShare__.mjs-0SjJESw9.js";import{r as m}from"./ConfigCustomJavascriptSet__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-CorOEig8.js";import"./preload-helper-BDBacUwf.js";import"./ConfigCustomJavascriptSet__loadShare__react__loadShare__.mjs_commonjs-proxy-CInLgMWW.js";import"./ConfigCustomJavascriptSet__loadShare__react_mf_2_dom__loadShare__.mjs-CL--xmjC.js";(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))i(e);new MutationObserver(e=>{for(const t of e)if(t.type==="childList")for(const o of t.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function a(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?t.credentials="include":e.crossOrigin==="anonymous"?t.credentials="omit":t.credentials="same-origin",t}function i(e){if(e.ep)return;e.ep=!0;const t=a(e);fetch(e.href,t)}})();var c,s=m;c=s.createRoot,s.hydrateRoot;window.adapterName="adapter-component-template";const u=document.getElementById("root"),f=c(u);f.render(n.jsx(d.StrictMode,{children:n.jsx("div",{})})); +import"./virtual_mf-REMOTE_ENTRY_ID_ConfigCustomJavascriptSet__customComponents_js-BfZkrlkY.js";import{j as n}from"./jsx-runtime-DfVU3AZG.js";import{h as d}from"./ConfigCustomJavascriptSet__loadShare__react__loadShare__.mjs-0SjJESw9.js";import{r as m}from"./ConfigCustomJavascriptSet__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-CorOEig8.js";import"./preload-helper-BDBacUwf.js";import"./ConfigCustomJavascriptSet__loadShare__react__loadShare__.mjs_commonjs-proxy-CInLgMWW.js";import"./ConfigCustomJavascriptSet__loadShare__react_mf_2_dom__loadShare__.mjs-CL--xmjC.js";(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))i(e);new MutationObserver(e=>{for(const t of e)if(t.type==="childList")for(const o of t.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function a(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?t.credentials="include":e.crossOrigin==="anonymous"?t.credentials="omit":t.credentials="same-origin",t}function i(e){if(e.ep)return;e.ep=!0;const t=a(e);fetch(e.href,t)}})();var c,s=m;c=s.createRoot,s.hydrateRoot;window.adapterName="adapter-component-template";const u=document.getElementById("root"),f=c(u);f.render(n.jsx(d.StrictMode,{children:n.jsx("div",{})})); diff --git a/admin/custom/assets/index-N2n19KrF.js b/admin/custom/assets/index-Bjqk2TGv.js similarity index 99% rename from admin/custom/assets/index-N2n19KrF.js rename to admin/custom/assets/index-Bjqk2TGv.js index ce54dc703..4237a0bbf 100644 --- a/admin/custom/assets/index-N2n19KrF.js +++ b/admin/custom/assets/index-Bjqk2TGv.js @@ -1,5 +1,5 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-iRHaQfi-.js","./index-huvZQhZw.js","./ConfigCustomJavascriptSet__loadShare__react__loadShare__.mjs_commonjs-proxy-CInLgMWW.js","./ConfigCustomJavascriptSet__loadShare__react__loadShare__.mjs-0SjJESw9.js"])))=>i.map(i=>d[i]); -import{i as So,h as _,f as Ul,a as Kl,n as Gl}from"./ConfigCustomJavascriptSet__loadShare__react__loadShare__.mjs-0SjJESw9.js";import{c as Ge,r as Bs}from"./ConfigCustomJavascriptSet__loadShare__react__loadShare__.mjs_commonjs-proxy-CInLgMWW.js";function Jl(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var n=e.default;if(typeof n=="function"){var t=function r(){var o=!1;try{o=this instanceof r}catch{}return o?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};t.prototype=n.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),t}function Yl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}import{G as He,p as Se,F as Mn,i as Bn,M as vt,z as we,r as re,W as Ps,X as Ws,s as Ie,Y as js,g as ge,Z as Bi,b as de,$ as fn,h as Tt,c as fe,d as Te,e as Be,f as xe,_ as Qn,a as Qt,a0 as Do,Q as In,T as Ao,S as ct,R as Ee,V as On,k as Ut,l as gn,m as mn,n as Ql,o as vn,a1 as Xl,a2 as Zl,D as ql,a3 as zs,j as ki,E as Pi,A as $o,B as Hs,x as ec,y as tc,a4 as nc,a5 as ic,N as sc,a6 as xo,a7 as _o,I as rc,U as oc,a8 as os,a9 as ac,aa as lc,t as cc,v as hc,w as uc}from"./ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-KsT5vKjV.js";import{a7 as zn,W as Kt,k as Ti,aj as dc,ak as ko,al as pc,am as To,an as fc,J as gc,S as Hn,u as Lo,ao as Mo,ap as Io,c as xt,E as Vs,R as Vn,aq as Oo,M as Fo,_ as mc,ar as vc,as as yc,at as bc,au as wc,af as Li,av as Ei,aw as Si,n as un,b as Us,a as _t,ax as Cc,ay as Ec,az as Sc,q as Dc,aA as Ro,w as No,r as Bo,aB as Ks,d as Ac,aC as $c,aD as xc,a8 as Po,aE as _c,aF as kc,aG as Tc,aH as Lc,aI as Mc,aJ as Ic,aK as Oc,aL as Fc,aM as Rc,V as Nc,aN as Bc,j as Pc,X as Wc,aO as jc,aP as zc,aQ as Hc,aR as Vc,G as Fr}from"./ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__.mjs-B551AMx-.js";import{_ as W,A as Uc}from"./ConfigCustomJavascriptSet__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-B7D2xOvV.js";import{R as Kc}from"./ConfigCustomJavascriptSet__loadShare__react_mf_2_dom__loadShare__.mjs-CL--xmjC.js";import{b as Gc}from"./blue-CagzI6CQ.js";import{C as Jc,D as Wo}from"./index-YBvFYuP6.js";import{d as $s}from"./virtual_mf-REMOTE_ENTRY_ID_ConfigCustomJavascriptSet__customComponents_js-BZZsMeVW.js";import{b as Yc,a as Qc}from"./ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_x_mf_2_date_mf_2_pickers__loadShare__.mjs-DgHZUNxn.js";import{p as Gs}from"./index-huvZQhZw.js";import{_ as jo}from"./preload-helper-BDBacUwf.js";const Xc=Object.freeze(Object.defineProperty({__proto__:null,get ConfigGeneric(){return U},get ConfigPanel(){return qt},get JsonConfig(){return Mf},get JsonConfigComponent(){return _i}},Symbol.toStringTag,{value:"Module"}));var Zc=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,qc=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\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\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF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/,eh=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B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\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\u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D804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\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B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,as={Space_Separator:Zc,ID_Start:qc,ID_Continue:eh},_e={isSpaceSeparator(m){return typeof m=="string"&&as.Space_Separator.test(m)},isIdStartChar(m){return typeof m=="string"&&(m>="a"&&m<="z"||m>="A"&&m<="Z"||m==="$"||m==="_"||as.ID_Start.test(m))},isIdContinueChar(m){return typeof m=="string"&&(m>="a"&&m<="z"||m>="A"&&m<="Z"||m>="0"&&m<="9"||m==="$"||m==="_"||m==="‌"||m==="‍"||as.ID_Continue.test(m))},isDigit(m){return typeof m=="string"&&/[0-9]/.test(m)},isHexDigit(m){return typeof m=="string"&&/[0-9A-Fa-f]/.test(m)}};let xs,je,gt,Mi,Lt,rt,Re,Js,Pn;var th=function(e,t){xs=String(e),je="start",gt=[],Mi=0,Lt=1,rt=0,Re=void 0,Js=void 0,Pn=void 0;do Re=nh(),rh[je]();while(Re.type!=="eof");return typeof t=="function"?_s({"":Pn},"",t):Pn};function _s(m,e,t){const n=m[e];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let d=0;d="a"&&m<="z"||m>="A"&&m<="Z"||m==="$"||m==="_"||as.ID_Start.test(m))},isIdContinueChar(m){return typeof m=="string"&&(m>="a"&&m<="z"||m>="A"&&m<="Z"||m>="0"&&m<="9"||m==="$"||m==="_"||m==="‌"||m==="‍"||as.ID_Continue.test(m))},isDigit(m){return typeof m=="string"&&/[0-9]/.test(m)},isHexDigit(m){return typeof m=="string"&&/[0-9A-Fa-f]/.test(m)}};let xs,je,gt,Mi,Lt,rt,Re,Js,Pn;var th=function(e,t){xs=String(e),je="start",gt=[],Mi=0,Lt=1,rt=0,Re=void 0,Js=void 0,Pn=void 0;do Re=nh(),rh[je]();while(Re.type!=="eof");return typeof t=="function"?_s({"":Pn},"",t):Pn};function _s(m,e,t){const n=m[e];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let d=0;dawait import("./index-CYc31Gwg.js"),"@iobroker/json-config":async()=>await import("./index-N2n19KrF.js"),"@mui/icons-material":async()=>await import("./index-C0RmLaAj.js"),"@mui/material":async()=>await import("./index-BptSiKBK.js"),"@mui/x-date-pickers":async()=>await import("./index-Dp7A3XHd.js"),"date-fns":async()=>await import("./index-Bvwv5H7k.js"),leaflet:async()=>await import("./leaflet-src-k2rCV-Ix.js").then(t=>t.l),react:async()=>await import("./index-CmJ8HzSc.js").then(t=>t.i),"react-dom":async()=>await import("./index-D0iTiVVG.js").then(t=>t.i)},n={"@iobroker/adapter-react-v5":{name:"@iobroker/adapter-react-v5",version:"8.1.3",scope:["default"],loaded:!1,from:"ConfigCustomJavascriptSet",async get(){n["@iobroker/adapter-react-v5"].loaded=!0;const{"@iobroker/adapter-react-v5":e}=a,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"@iobroker/json-config":{name:"@iobroker/json-config",version:"8.2.8",scope:["default"],loaded:!1,from:"ConfigCustomJavascriptSet",async get(){n["@iobroker/json-config"].loaded=!0;const{"@iobroker/json-config":e}=a,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"@mui/icons-material":{name:"@mui/icons-material",version:"6.5.0",scope:["default"],loaded:!1,from:"ConfigCustomJavascriptSet",async get(){n["@mui/icons-material"].loaded=!0;const{"@mui/icons-material":e}=a,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"@mui/material":{name:"@mui/material",version:"6.5.0",scope:["default"],loaded:!1,from:"ConfigCustomJavascriptSet",async get(){n["@mui/material"].loaded=!0;const{"@mui/material":e}=a,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"@mui/x-date-pickers":{name:"@mui/x-date-pickers",version:"7.29.4",scope:["default"],loaded:!1,from:"ConfigCustomJavascriptSet",async get(){n["@mui/x-date-pickers"].loaded=!0;const{"@mui/x-date-pickers":e}=a,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"date-fns":{name:"date-fns",version:"4.1.0",scope:["default"],loaded:!1,from:"ConfigCustomJavascriptSet",async get(){n["date-fns"].loaded=!0;const{"date-fns":e}=a,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},leaflet:{name:"leaflet",version:"1.9.4",scope:["default"],loaded:!1,from:"ConfigCustomJavascriptSet",async get(){n.leaflet.loaded=!0;const{leaflet:e}=a,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},react:{name:"react",version:"18.3.1",scope:["default"],loaded:!1,from:"ConfigCustomJavascriptSet",async get(){n.react.loaded=!0;const{react:e}=a,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"react-dom":{name:"react-dom",version:"18.3.1",scope:["default"],loaded:!1,from:"ConfigCustomJavascriptSet",async get(){n["react-dom"].loaded=!0;const{"react-dom":e}=a,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}}},u=[];export{u as usedRemotes,n as usedShared}; +import"./virtual_mf-REMOTE_ENTRY_ID_ConfigCustomJavascriptSet__customComponents_js-BfZkrlkY.js";const a={"@iobroker/adapter-react-v5":async()=>await import("./index-CYc31Gwg.js"),"@iobroker/json-config":async()=>await import("./index-Bjqk2TGv.js"),"@mui/icons-material":async()=>await import("./index-C0RmLaAj.js"),"@mui/material":async()=>await import("./index-BptSiKBK.js"),"@mui/x-date-pickers":async()=>await import("./index-Dp7A3XHd.js"),"date-fns":async()=>await import("./index-Bvwv5H7k.js"),leaflet:async()=>await import("./leaflet-src-k2rCV-Ix.js").then(t=>t.l),react:async()=>await import("./index-CmJ8HzSc.js").then(t=>t.i),"react-dom":async()=>await import("./index-D0iTiVVG.js").then(t=>t.i)},n={"@iobroker/adapter-react-v5":{name:"@iobroker/adapter-react-v5",version:"8.1.3",scope:["default"],loaded:!1,from:"ConfigCustomJavascriptSet",async get(){n["@iobroker/adapter-react-v5"].loaded=!0;const{"@iobroker/adapter-react-v5":e}=a,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"@iobroker/json-config":{name:"@iobroker/json-config",version:"8.2.8",scope:["default"],loaded:!1,from:"ConfigCustomJavascriptSet",async get(){n["@iobroker/json-config"].loaded=!0;const{"@iobroker/json-config":e}=a,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"@mui/icons-material":{name:"@mui/icons-material",version:"6.5.0",scope:["default"],loaded:!1,from:"ConfigCustomJavascriptSet",async get(){n["@mui/icons-material"].loaded=!0;const{"@mui/icons-material":e}=a,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"@mui/material":{name:"@mui/material",version:"6.5.0",scope:["default"],loaded:!1,from:"ConfigCustomJavascriptSet",async get(){n["@mui/material"].loaded=!0;const{"@mui/material":e}=a,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"@mui/x-date-pickers":{name:"@mui/x-date-pickers",version:"7.29.4",scope:["default"],loaded:!1,from:"ConfigCustomJavascriptSet",async get(){n["@mui/x-date-pickers"].loaded=!0;const{"@mui/x-date-pickers":e}=a,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"date-fns":{name:"date-fns",version:"4.1.0",scope:["default"],loaded:!1,from:"ConfigCustomJavascriptSet",async get(){n["date-fns"].loaded=!0;const{"date-fns":e}=a,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},leaflet:{name:"leaflet",version:"1.9.4",scope:["default"],loaded:!1,from:"ConfigCustomJavascriptSet",async get(){n.leaflet.loaded=!0;const{leaflet:e}=a,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},react:{name:"react",version:"18.3.1",scope:["default"],loaded:!1,from:"ConfigCustomJavascriptSet",async get(){n.react.loaded=!0;const{react:e}=a,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"react-dom":{name:"react-dom",version:"18.3.1",scope:["default"],loaded:!1,from:"ConfigCustomJavascriptSet",async get(){n["react-dom"].loaded=!0;const{"react-dom":e}=a,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}}},u=[];export{u as usedRemotes,n as usedShared}; diff --git a/admin/custom/assets/virtualExposes-CqrW7o8v.js b/admin/custom/assets/virtualExposes-jSvr-kK3.js similarity index 68% rename from admin/custom/assets/virtualExposes-CqrW7o8v.js rename to admin/custom/assets/virtualExposes-jSvr-kK3.js index 06155922c..884d316ba 100644 --- a/admin/custom/assets/virtualExposes-CqrW7o8v.js +++ b/admin/custom/assets/virtualExposes-jSvr-kK3.js @@ -1,2 +1,2 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Components-BOms95_F.css"])))=>i.map(i=>d[i]); -import{_ as o}from"./preload-helper-BDBacUwf.js";const s={"./Components":async()=>{const t=await o(()=>import("./Components-B8x6wOMD.js"),__vite__mapDeps([0]),import.meta.url),e={};return Object.assign(e,t),Object.defineProperty(e,"__esModule",{value:!0,enumerable:!1}),e}};export{s as default}; +import{_ as o}from"./preload-helper-BDBacUwf.js";const s={"./Components":async()=>{const t=await o(()=>import("./Components-B9ZyjeRI.js"),__vite__mapDeps([0]),import.meta.url),e={};return Object.assign(e,t),Object.defineProperty(e,"__esModule",{value:!0,enumerable:!1}),e}};export{s as default}; diff --git a/admin/custom/assets/virtual_mf-REMOTE_ENTRY_ID_ConfigCustomJavascriptSet__customComponents_js-BZZsMeVW.js b/admin/custom/assets/virtual_mf-REMOTE_ENTRY_ID_ConfigCustomJavascriptSet__customComponents_js-BfZkrlkY.js similarity index 99% rename from admin/custom/assets/virtual_mf-REMOTE_ENTRY_ID_ConfigCustomJavascriptSet__customComponents_js-BZZsMeVW.js rename to admin/custom/assets/virtual_mf-REMOTE_ENTRY_ID_ConfigCustomJavascriptSet__customComponents_js-BfZkrlkY.js index 877ab9784..fa6b605d1 100644 --- a/admin/custom/assets/virtual_mf-REMOTE_ENTRY_ID_ConfigCustomJavascriptSet__customComponents_js-BZZsMeVW.js +++ b/admin/custom/assets/virtual_mf-REMOTE_ENTRY_ID_ConfigCustomJavascriptSet__customComponents_js-BfZkrlkY.js @@ -1,8 +1,8 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./localSharedImportMap-2Enh8EZe.js","./preload-helper-BDBacUwf.js","./virtualExposes-CqrW7o8v.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./localSharedImportMap-DS3qfiqR.js","./preload-helper-BDBacUwf.js","./virtualExposes-jSvr-kK3.js"])))=>i.map(i=>d[i]); import{_ as sr}from"./preload-helper-BDBacUwf.js";var ir={},ar={},Tt={},M={},D={},P={};const ln="federation-manifest.json",cn=".json",un="FEDERATION_DEBUG",j={AT:"@",HYPHEN:"-",SLASH:"/"},De={[j.AT]:"scope_",[j.HYPHEN]:"_",[j.SLASH]:"__"},fn={[De[j.AT]]:j.AT,[De[j.HYPHEN]]:j.HYPHEN,[De[j.SLASH]]:j.SLASH},dn=":",hn="mf-manifest.json",mn="mf-stats.json",_n={NPM:"npm",APP:"app"},gn="__MF_DEVTOOLS_MODULE_INFO__",pn="ENCODE_NAME_PREFIX",yn=".federation",En={identifier:"MFDataPrefetch",globalKey:"__PREFETCH__",library:"mf-data-prefetch",exportsKey:"__PREFETCH_EXPORTS__",fileName:"bootstrap.js"};let Sn=(function(e){return e[e.UNKNOWN=1]="UNKNOWN",e[e.CALCULATED=2]="CALCULATED",e[e.NO_USE=0]="NO_USE",e})({});P.BROWSER_LOG_KEY=un;P.ENCODE_NAME_PREFIX=pn;P.EncodedNameTransformMap=fn;P.FederationModuleManifest=ln;P.MANIFEST_EXT=cn;P.MFModuleType=_n;P.MFPrefetchCommon=En;P.MODULE_DEVTOOL_IDENTIFIER=gn;P.ManifestFileName=hn;P.NameTransformMap=De;P.NameTransformSymbol=j;P.SEPARATOR=dn;P.StatsFileName=mn;P.TEMP_DIR=yn;P.TreeShakingStatus=Sn;var lr={},re={},Ot=Object.defineProperty,bn=(e,t)=>{let r={};for(var n in e)Ot(r,n,{get:e[n],enumerable:!0});return t||Ot(r,Symbol.toStringTag,{value:"Module"}),r};re.__exportAll=bn;(function(e){var r=re.__exportAll({});Object.defineProperty(e,"ContainerPlugin_exports",{enumerable:!0,get:function(){return r}})})(lr);var cr={};(function(e){var r=re.__exportAll({});Object.defineProperty(e,"ContainerReferencePlugin_exports",{enumerable:!0,get:function(){return r}})})(cr);var ur={};(function(e){var r=re.__exportAll({});Object.defineProperty(e,"ModuleFederationPlugin_exports",{enumerable:!0,get:function(){return r}})})(ur);var fr={};(function(e){var r=re.__exportAll({});Object.defineProperty(e,"SharePlugin_exports",{enumerable:!0,get:function(){return r}})})(fr);var dr={};(function(e){var r=re.__exportAll({});Object.defineProperty(e,"ConsumeSharedPlugin_exports",{enumerable:!0,get:function(){return r}})})(dr);var hr={};(function(e){var r=re.__exportAll({});Object.defineProperty(e,"ProvideSharedPlugin_exports",{enumerable:!0,get:function(){return r}})})(hr);var J={},be={};const Rn=P,mr=!0;function _r(){return mr}function Tn(){return typeof navigator<"u"&&(navigator==null?void 0:navigator.product)==="ReactNative"}function In(){try{if(_r()&&window.localStorage)return!!localStorage.getItem(Rn.BROWSER_LOG_KEY)}catch{return!1}return!1}function $n(){return typeof process<"u"&&be&&be.FEDERATION_DEBUG?!!be.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&FEDERATION_DEBUG?!0:In()}const Nn=function(){return typeof process<"u"&&be?be:{}};J.getProcessEnv=Nn;J.isBrowserEnv=_r;J.isBrowserEnvValue=mr;J.isDebugMode=$n;J.isReactNativeEnv=Tn;var H={};const S=P,dt=J,gr="[ Federation Runtime ]",Mn=(e,t,r=S.SEPARATOR)=>{const n=e.split(r),o=dt.getProcessEnv().NODE_ENV==="development"&&t,s="*",i=a=>a.startsWith("http")||a.includes(S.MANIFEST_EXT);if(n.length>=2){let[a,...c]=n;e.startsWith(r)&&(a=n.slice(0,2).join(r),c=[o||n.slice(2).join(r)]);let l=o||c.join(r);return i(l)?{name:a,entry:l}:{name:a,version:l||s}}else if(n.length===1){const[a]=n;return o&&i(o)?{name:a,entry:o}:{name:a,version:o||s}}else throw`Invalid entry value: ${e}`},Pn=function(...e){return e.length?e.reduce((t,r)=>r?t?`${t}${S.SEPARATOR}${r}`:r:t,""):""},It=function(e,t="",r=!1){try{const n=r?".js":"";return`${t}${e.replace(new RegExp(`${S.NameTransformSymbol.AT}`,"g"),S.NameTransformMap[S.NameTransformSymbol.AT]).replace(new RegExp(`${S.NameTransformSymbol.HYPHEN}`,"g"),S.NameTransformMap[S.NameTransformSymbol.HYPHEN]).replace(new RegExp(`${S.NameTransformSymbol.SLASH}`,"g"),S.NameTransformMap[S.NameTransformSymbol.SLASH])}${n}`}catch(n){throw n}},vn=function(e,t,r){try{let n=e;if(t){if(!n.startsWith(t))return n;n=n.replace(new RegExp(t,"g"),"")}return n=n.replace(new RegExp(`${S.NameTransformMap[S.NameTransformSymbol.AT]}`,"g"),S.EncodedNameTransformMap[S.NameTransformMap[S.NameTransformSymbol.AT]]).replace(new RegExp(`${S.NameTransformMap[S.NameTransformSymbol.SLASH]}`,"g"),S.EncodedNameTransformMap[S.NameTransformMap[S.NameTransformSymbol.SLASH]]).replace(new RegExp(`${S.NameTransformMap[S.NameTransformSymbol.HYPHEN]}`,"g"),S.EncodedNameTransformMap[S.NameTransformMap[S.NameTransformSymbol.HYPHEN]]),r&&(n=n.replace(".js","")),n}catch(n){throw n}},An=(e,t)=>{if(!e)return"";let r=e;return r==="."&&(r="default_export"),r.startsWith("./")&&(r=r.replace("./","")),It(r,"__federation_expose_",t)},On=(e,t)=>e?It(e,"__federation_shared_",t):"",kn=(e,t)=>{if("getPublicPath"in e){let r;return e.getPublicPath.startsWith("function")?r=new Function("return "+e.getPublicPath)()():r=new Function(e.getPublicPath)(),`${r}${t}`}else return"publicPath"in e?!dt.isBrowserEnv()&&!dt.isReactNativeEnv()&&"ssrPublicPath"in e&&typeof e.ssrPublicPath=="string"?`${e.ssrPublicPath}${t}`:`${e.publicPath}${t}`:(console.warn("Cannot get resource URL. If in debug mode, please ignore.",e,t),"")},wn=(e,t)=>{e||pr(t)},pr=e=>{throw new Error(`${gr}: ${e}`)},Fn=e=>{console.warn(`${gr}: ${e}`)};function Ln(e){try{return JSON.stringify(e,null,2)}catch{return""}}const Dn=/^([\d^=v<>~]|[*xX]$)/;function Hn(e){return Dn.test(e)}H.assert=wn;H.composeKeyWithSeparator=Pn;H.decodeName=vn;H.encodeName=It;H.error=pr;H.generateExposeFilename=An;H.generateShareFilename=On;H.getResourceUrl=kn;H.isRequiredVersion=Hn;H.parseEntry=Mn;H.safeToString=Ln;H.warn=Fn;var ue={};const ye=P,Q=(e,t)=>{if(!e)return t;const n=(o=>{if(o===".")return"";if(o.startsWith("./"))return o.replace("./","");if(o.startsWith("/")){const s=o.slice(1);return s.endsWith("/")?s.slice(0,-1):s}return o})(e);return n?n.endsWith("/")?`${n}${t}`:`${n}/${t}`:t};function yr(e){return e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function Cn(e,t={}){var E,I,k;const{remotes:r={},overrides:n={},version:o}=t;let s;const i=()=>"publicPath"in e.metaData?(e.metaData.publicPath==="auto"||e.metaData.publicPath==="")&&o?yr(o):e.metaData.publicPath:e.metaData.getPublicPath,a=Object.keys(n);let c={};Object.keys(r).length||(c=((E=e.remotes)==null?void 0:E.reduce((y,N)=>{let R;const v=N.federationContainerName;return a.includes(v)?R=n[v]:"version"in N?R=N.version:R=N.entry,y[v]={matchedVersion:R},y},{}))||{}),Object.keys(r).forEach(y=>c[y]={matchedVersion:a.includes(y)?n[y]:r[y]});const{remoteEntry:{path:l,name:u,type:d},types:f={path:"",name:"",zip:"",api:""},buildInfo:{buildVersion:h},globalName:m,ssrRemoteEntry:_}=e.metaData,{exposes:g}=e;let p={version:o||"",buildVersion:h,globalName:m,remoteEntry:Q(l,u),remoteEntryType:d,remoteTypes:Q(f.path,f.name),remoteTypesZip:f.zip||"",remoteTypesAPI:f.api||"",remotesInfo:c,shared:e==null?void 0:e.shared.map(y=>({assets:y.assets,sharedName:y.name,version:y.version,usedExports:y.referenceExports||[]})),modules:g==null?void 0:g.map(y=>({moduleName:y.name,modulePath:y.path,assets:y.assets}))};if((I=e.metaData)!=null&&I.prefetchInterface){const y=e.metaData.prefetchInterface;p={...p,prefetchInterface:y}}if((k=e.metaData)!=null&&k.prefetchEntry){const{path:y,name:N,type:R}=e.metaData.prefetchEntry;p={...p,prefetchEntry:Q(y,N),prefetchEntryType:R}}if("publicPath"in e.metaData?(s={...p,publicPath:i()},typeof e.metaData.ssrPublicPath=="string"&&(s.ssrPublicPath=e.metaData.ssrPublicPath)):s={...p,getPublicPath:i()},_){const y=Q(_.path,_.name);s.ssrRemoteEntry=y,s.ssrRemoteEntryType=_.type||"commonjs-module"}return s}function qn(e){return!!("remoteEntry"in e&&e.remoteEntry.includes(ye.MANIFEST_EXT))}function Gn(e){if(!e)return{statsFileName:ye.StatsFileName,manifestFileName:ye.ManifestFileName};let t=typeof e=="boolean"?"":e.filePath||"",r=typeof e=="boolean"?"":e.fileName||"";const n=".json",o=a=>a.endsWith(n)?a:`${a}${n}`,s=(a,c)=>a.replace(n,`${c}${n}`),i=r?o(r):ye.ManifestFileName;return{statsFileName:Q(t,r?s(i,"-stats"):ye.StatsFileName),manifestFileName:Q(t,i)}}ue.generateSnapshotFromManifest=Cn;ue.getManifestFileName=Gn;ue.inferAutoPublicPath=yr;ue.isManifestProvider=qn;ue.simpleJoinRemoteEntry=Q;var fe={};const kt=J,Er="[ Module Federation ]",ge=console,Un=["logger.ts","logger.js","captureStackTrace","Logger.emit","Logger.log","Logger.info","Logger.warn","Logger.error","Logger.debug"];function Wn(){try{const e=new Error().stack;if(!e)return;const[,...t]=e.split(` `),r=t.filter(n=>!Un.some(o=>n.includes(o)));return r.length?`Stack trace: ${r.slice(0,5).join(` `)}`:void 0}catch{return}}var Sr=class{constructor(e,t=ge){this.prefix=e,this.delegate=t??ge}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??ge}emit(e,t){const r=this.delegate,n=kt.isDebugMode()?Wn():void 0,o=n?[...t,n]:t,s=(()=>{switch(e){case"log":return["log","info"];case"info":return["info","log"];case"warn":return["warn","info","log"];case"error":return["error","warn","log"];default:return["debug","log"]}})();for(const i of s){const a=r[i];if(typeof a=="function"){a.call(r,this.prefix,...o);return}}for(const i of s){const a=ge[i];if(typeof a=="function"){a.call(ge,this.prefix,...o);return}}}log(...e){this.emit("log",e)}warn(...e){this.emit("warn",e)}error(...e){this.emit("error",e)}success(...e){this.emit("info",e)}info(...e){this.emit("info",e)}ready(...e){this.emit("info",e)}debug(...e){kt.isDebugMode()&&this.emit("debug",e)}};function br(e){return new Sr(e)}function Rr(e){const t=new Sr(e);return Object.defineProperty(t,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),t}function Bn(e,t,r){if(e.__mf_infrastructure_logger__&&t!=null&&t.getInfrastructureLogger)try{const n=t.getInfrastructureLogger(r);n&&typeof n=="object"&&(typeof n.log=="function"||typeof n.info=="function"||typeof n.warn=="function"||typeof n.error=="function")&&e.setDelegate(n)}catch{e.setDelegate(void 0)}}const jn=br(Er),Vn=Rr(Er);fe.bindLoggerToCompiler=Bn;fe.createInfrastructureLogger=Rr;fe.createLogger=br;fe.infrastructureLogger=Vn;fe.logger=jn;var de={};const Xn=H;async function $t(e,t){try{return await e()}catch(r){!t&&Xn.warn(r);return}}function Ue(e,t){const r=/^(https?:)?\/\//i;return e.replace(r,"").replace(/\/$/,"")===t.replace(r,"").replace(/\/$/,"")}function Tr(e){let t=null,r=!0,n=2e4,o;const s=document.getElementsByTagName("script");for(let l=0;l{t&&(d==="async"||d==="defer"?t[d]=l[d]:t.getAttribute(d)||t.setAttribute(d,l[d]))})}let i=null;const a=typeof window<"u"?l=>{if(l.filename&&Ue(l.filename,e.url)){const u=new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${l.message} (${l.filename}:${l.lineno}:${l.colno})`);u.name="ScriptExecutionError",i=u}}:null;a&&window.addEventListener("error",a);const c=async(l,u)=>{clearTimeout(o),a&&window.removeEventListener("error",a);const d=()=>{if((u==null?void 0:u.type)==="error"){const f=new Error(`ScriptNetworkError: Failed to load script "${e.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);f.name="ScriptNetworkError",e!=null&&e.onErrorCallback&&(e==null||e.onErrorCallback(f))}else i?e!=null&&e.onErrorCallback&&(e==null||e.onErrorCallback(i)):e!=null&&e.cb&&(e==null||e.cb())};if(t&&(t.onerror=null,t.onload=null,$t(()=>{const{needDeleteScript:f=!0}=e;f&&t!=null&&t.parentNode&&t.parentNode.removeChild(t)}),l&&typeof l=="function")){const f=l(u);if(f instanceof Promise){const h=await f;return d(),h}return d(),f}d()};return t.onerror=c.bind(null,t.onerror),t.onload=c.bind(null,t.onload),o=setTimeout(()=>{c(null,new Error(`Remote script "${e.url}" time-outed.`))},n),{script:t,needAttach:r}}function xn(e){let t=null,r=!0;const n=document.getElementsByTagName("link");for(let s=0;s{t&&!t.getAttribute(a)&&t.setAttribute(a,i[a])})}const o=(s,i)=>{const a=()=>{(i==null?void 0:i.type)==="error"?e!=null&&e.onErrorCallback&&(e==null||e.onErrorCallback(i)):e!=null&&e.cb&&(e==null||e.cb())};if(t&&(t.onerror=null,t.onload=null,$t(()=>{const{needDeleteLink:c=!0}=e;c&&t!=null&&t.parentNode&&t.parentNode.removeChild(t)}),s)){const c=s(i);return a(),c}a()};return t.onerror=o.bind(null,t.onerror),t.onload=o.bind(null,t.onload),{link:t,needAttach:r}}function Kn(e,t){const{attrs:r={},createScriptHook:n}=t;return new Promise((o,s)=>{const{script:i,needAttach:a}=Tr({url:e,cb:o,onErrorCallback:s,attrs:{fetchpriority:"high",...r},createScriptHook:n,needDeleteScript:!0});a&&document.head.appendChild(i)})}de.createLink=xn;de.createScript=Tr;de.isStaticResourcesEqual=Ue;de.loadScript=Kn;de.safeWrapper=$t;var Nt={};const Yn=(e,t,r,n)=>{t(new Error("createScriptNode is disabled in non-Node.js environment"))},zn=(e,t)=>{throw new Error("loadScriptNode is disabled in non-Node.js environment")};Nt.createScriptNode=Yn;Nt.loadScriptNode=zn;var Ir={};function Jn(e,t,r){return function(n){if(n===!1)return!1;if(typeof n>"u")return e?t:!1;if(n===!0)return t;if(n&&typeof n=="object")return{...t,...n};throw new Error(`Unexpected type for \`${r}\`, expect boolean/undefined/object, got: ${typeof n}`)}}Ir.normalizeOptions=Jn;var $r={};const Zn=e=>e;$r.createModuleFederationConfig=Zn;(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=P,r=lr,n=cr,o=ur,s=fr,i=dr,a=hr,c=J,l=H,u=ue,d=fe,f=de,h=Nt,m=Ir,_=$r;e.BROWSER_LOG_KEY=t.BROWSER_LOG_KEY,e.ENCODE_NAME_PREFIX=t.ENCODE_NAME_PREFIX,e.EncodedNameTransformMap=t.EncodedNameTransformMap,e.FederationModuleManifest=t.FederationModuleManifest,e.MANIFEST_EXT=t.MANIFEST_EXT,e.MFModuleType=t.MFModuleType,e.MFPrefetchCommon=t.MFPrefetchCommon,e.MODULE_DEVTOOL_IDENTIFIER=t.MODULE_DEVTOOL_IDENTIFIER,e.ManifestFileName=t.ManifestFileName,e.NameTransformMap=t.NameTransformMap,e.NameTransformSymbol=t.NameTransformSymbol,e.SEPARATOR=t.SEPARATOR,e.StatsFileName=t.StatsFileName,e.TEMP_DIR=t.TEMP_DIR,e.TreeShakingStatus=t.TreeShakingStatus,e.assert=l.assert,e.bindLoggerToCompiler=d.bindLoggerToCompiler,e.composeKeyWithSeparator=l.composeKeyWithSeparator,Object.defineProperty(e,"consumeSharedPlugin",{enumerable:!0,get:function(){return i.ConsumeSharedPlugin_exports}}),Object.defineProperty(e,"containerPlugin",{enumerable:!0,get:function(){return r.ContainerPlugin_exports}}),Object.defineProperty(e,"containerReferencePlugin",{enumerable:!0,get:function(){return n.ContainerReferencePlugin_exports}}),e.createInfrastructureLogger=d.createInfrastructureLogger,e.createLink=f.createLink,e.createLogger=d.createLogger,e.createModuleFederationConfig=_.createModuleFederationConfig,e.createScript=f.createScript,e.createScriptNode=h.createScriptNode,e.decodeName=l.decodeName,e.encodeName=l.encodeName,e.error=l.error,e.generateExposeFilename=l.generateExposeFilename,e.generateShareFilename=l.generateShareFilename,e.generateSnapshotFromManifest=u.generateSnapshotFromManifest,e.getManifestFileName=u.getManifestFileName,e.getProcessEnv=c.getProcessEnv,e.getResourceUrl=l.getResourceUrl,e.inferAutoPublicPath=u.inferAutoPublicPath,e.infrastructureLogger=d.infrastructureLogger,e.isBrowserEnv=c.isBrowserEnv,e.isBrowserEnvValue=c.isBrowserEnvValue,e.isDebugMode=c.isDebugMode,e.isManifestProvider=u.isManifestProvider,e.isReactNativeEnv=c.isReactNativeEnv,e.isRequiredVersion=l.isRequiredVersion,e.isStaticResourcesEqual=f.isStaticResourcesEqual,e.loadScript=f.loadScript,e.loadScriptNode=h.loadScriptNode,e.logger=d.logger,Object.defineProperty(e,"moduleFederationPlugin",{enumerable:!0,get:function(){return o.ModuleFederationPlugin_exports}}),e.normalizeOptions=m.normalizeOptions,e.parseEntry=l.parseEntry,Object.defineProperty(e,"provideSharedPlugin",{enumerable:!0,get:function(){return a.ProvideSharedPlugin_exports}}),e.safeToString=l.safeToString,e.safeWrapper=f.safeWrapper,Object.defineProperty(e,"sharePlugin",{enumerable:!0,get:function(){return s.SharePlugin_exports}}),e.simpleJoinRemoteEntry=u.simpleJoinRemoteEntry,e.warn=l.warn})(D);var Nr={},Mt={};const Qn=e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`,eo=(e,t,r,n)=>{const o=[`${[t[e]]} #${e}`];return r&&o.push(`args: ${JSON.stringify(r)}`),o.push(Qn(e)),n&&o.push(`Original Error Message: ${n}`),o.join(` `)};Mt.getShortErrorMsg=eo;(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Mt;function r(n,o,s,i,a,c){return i(t.getShortErrorMsg(n,o,s,a))}e.logAndReport=r})(Nr);let to=D,ro=Nr;const ee="[ Federation Runtime ]",ht=(0,to.createLogger)(ee);function no(e,t,r,n,o){e||(r!==void 0?mt(t,r,n,void 0,o):mt(t))}function mt(e,t,r,n,o){if(t!==void 0)return(0,ro.logAndReport)(e,t,r??{},i=>{throw new Error(`${ee}: ${i}`)},n,o);const s=e;throw s instanceof Error?(s.message.startsWith(ee)||(s.message=`${ee}: ${s.message}`),s):new Error(`${ee}: ${s}`)}function oo(e){e instanceof Error&&(e.message.startsWith(ee)||(e.message=`${ee}: ${e.message}`)),ht.warn(e)}M.assert=no;M.error=mt;M.logger=ht;M.warn=oo;var $={};const so=M;let wt=D;function io(e,t){return e.findIndex(r=>r===t)===-1&&e.push(t),e}function ao(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function lo(e){return typeof e.entry<"u"}function co(e){return!e.entry.includes(".json")}async function uo(e,t){try{return await e()}catch(r){!t&&so.warn(r);return}}function fo(e){return e&&typeof e=="object"}const Mr=Object.prototype.toString;function ho(e){return Mr.call(e)==="[object Object]"}function mo(e,t){const r=/^(https?:)?\/\//i;return e.replace(r,"").replace(/\/$/,"")===t.replace(r,"").replace(/\/$/,"")}function _o(e){return Array.isArray(e)?e:[e]}function go(e){const t={url:"",type:"global",globalName:""};return wt.isBrowserEnvValue||(0,wt.isReactNativeEnv)()||!("ssrRemoteEntry"in e)?"remoteEntry"in e?{url:e.remoteEntry,type:e.remoteEntryType,globalName:e.globalName}:t:"ssrRemoteEntry"in e?{url:e.ssrRemoteEntry||t.url,type:e.ssrRemoteEntryType||t.type,globalName:e.globalName}:t}const po=(e,t)=>{let r;return e.endsWith("/")?r=e.slice(0,-1):r=e,t.startsWith(".")&&(t=t.slice(1)),r=r+t,r};$.addUniqueItem=io;$.arrayOptions=_o;$.getFMId=ao;$.getRemoteEntryInfoFromSnapshot=go;$.isObject=fo;$.isPlainObject=ho;$.isPureRemoteEntry=co;$.isRemoteInfoWithEntry=lo;$.isStaticResourcesEqual=mo;$.objectToString=Mr;$.processModuleAlias=po;$.safeWrapper=uo;var b={};const Pr=M,_t=$;let yo=D;const O=typeof globalThis=="object"?globalThis:window,C=(()=>{try{return document.defaultView}catch{return O}})(),Eo=C;function He(e,t,r){Object.defineProperty(e,t,{value:r,configurable:!1,writable:!0})}function Ce(e,t){return Object.hasOwnProperty.call(e,t)}Ce(O,"__GLOBAL_LOADING_REMOTE_ENTRY__")||He(O,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const gt=O.__GLOBAL_LOADING_REMOTE_ENTRY__;function vr(e){Ce(e,"__VMOK__")&&!Ce(e,"__FEDERATION__")&&He(e,"__FEDERATION__",e.__VMOK__),Ce(e,"__FEDERATION__")||(He(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),He(e,"__VMOK__",e.__FEDERATION__)),e.__FEDERATION__.__GLOBAL_PLUGIN__??=[],e.__FEDERATION__.__INSTANCES__??=[],e.__FEDERATION__.moduleInfo??={},e.__FEDERATION__.__SHARE__??={},e.__FEDERATION__.__MANIFEST_LOADING__??={},e.__FEDERATION__.__PRELOADED_MAP__??=new Map}vr(O);vr(C);function So(){O.__FEDERATION__.__GLOBAL_PLUGIN__=[],O.__FEDERATION__.__INSTANCES__=[],O.__FEDERATION__.moduleInfo={},O.__FEDERATION__.__SHARE__={},O.__FEDERATION__.__MANIFEST_LOADING__={},Object.keys(gt).forEach(e=>{delete gt[e]})}function bo(e){O.__FEDERATION__.__INSTANCES__.push(e)}function Ro(){return O.__FEDERATION__.__DEBUG_CONSTRUCTOR__}function To(e,t=(0,yo.isDebugMode)()){t&&(O.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,O.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="2.2.2")}function pt(e,t){if(typeof t=="string"){if(e[t])return{value:e[t],key:t};{const r=Object.keys(e);for(const n of r){const[o,s]=n.split(":"),i=`${o}:${t}`,a=e[i];if(a)return{value:a,key:i}}return{value:void 0,key:t}}}else Pr.error(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}const Io=()=>C.__FEDERATION__.moduleInfo,Ar=(e,t)=>{const r=pt(t,_t.getFMId(e)).value;if(r&&!r.version&&"version"in e&&e.version&&(r.version=e.version),r)return r;if("version"in e&&e.version){const{version:n,...o}=e,s=_t.getFMId(o),i=pt(C.__FEDERATION__.moduleInfo,s).value;if((i==null?void 0:i.version)===n)return i}},$o=e=>Ar(e,C.__FEDERATION__.moduleInfo),No=(e,t)=>{const r=_t.getFMId(e);return C.__FEDERATION__.moduleInfo[r]=t,C.__FEDERATION__.moduleInfo},Mo=e=>(C.__FEDERATION__.moduleInfo={...C.__FEDERATION__.moduleInfo,...e},()=>{const t=Object.keys(e);for(const r of t)delete C.__FEDERATION__.moduleInfo[r]}),Po=(e,t)=>{const r=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:r,entryExports:O[r]}},vo=e=>{const{__GLOBAL_PLUGIN__:t}=C.__FEDERATION__;e.forEach(r=>{t.findIndex(n=>n.name===r.name)===-1?t.push(r):Pr.warn(`The plugin ${r.name} has been registered.`)})},Ao=()=>C.__FEDERATION__.__GLOBAL_PLUGIN__,Oo=e=>O.__FEDERATION__.__PRELOADED_MAP__.get(e),ko=e=>O.__FEDERATION__.__PRELOADED_MAP__.set(e,!0);b.CurrentGlobal=O;b.Global=Eo;b.addGlobalSnapshot=Mo;b.getGlobalFederationConstructor=Ro;b.getGlobalHostPlugins=Ao;b.getGlobalSnapshot=Io;b.getGlobalSnapshotInfoByModuleInfo=$o;b.getInfoWithoutType=pt;b.getPreloaded=Oo;b.getRemoteEntryExports=Po;b.getTargetSnapshotInfoByModuleInfo=Ar;b.globalLoading=gt;b.nativeGlobal=C;b.registerGlobalPlugins=vo;b.resetFederationGlobalInfo=So;b.setGlobalFederationConstructor=To;b.setGlobalFederationInstance=bo;b.setGlobalSnapshotInfoByModuleInfo=No;b.setPreloaded=ko;var Pt={},ne={},W={};const Ft="[0-9A-Za-z-]+",vt=`(?:\\+(${Ft}(?:\\.${Ft})*))`,Re="0|[1-9]\\d*",qe="[0-9]+",Or="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Lt=`(?:${qe}|${Or})`,wo=`(?:-?(${Lt}(?:\\.${Lt})*))`,Dt=`(?:${Re}|${Or})`,kr=`(?:-(${Dt}(?:\\.${Dt})*))`,ze=`${Re}|x|X|\\*`,ce=`[v=\\s]*(${ze})(?:\\.(${ze})(?:\\.(${ze})(?:${kr})?${vt}?)?)?`,Fo=`^\\s*(${ce})\\s+-\\s+(${ce})\\s*$`,Lo=`[v=\\s]*${`(${qe})\\.(${qe})\\.(${qe})`}${wo}?${vt}?`,At="((?:<|>)?=?)",Do=`(\\s*)${At}\\s*(${Lo}|${ce})`,wr="(?:~>?)",Ho=`(\\s*)${wr}\\s+`,Fr="(?:\\^)",Co=`(\\s*)${Fr}\\s+`,qo="(<|>)?=?\\s*\\*",Go=`^${Fr}${ce}$`,Uo=`v?${`(${Re})\\.(${Re})\\.(${Re})`}${kr}?${vt}?`,Wo=`^${wr}${ce}$`,Bo=`^${At}\\s*${ce}$`,jo=`^${At}\\s*(${Uo})$|^$`,Vo="^\\s*>=\\s*0.0.0\\s*$";W.caret=Go;W.caretTrim=Co;W.comparator=jo;W.comparatorTrim=Do;W.gte0=Vo;W.hyphenRange=Fo;W.star=qo;W.tilde=Wo;W.tildeTrim=Ho;W.xRange=Bo;const Xo=W;function Lr(e){return new RegExp(e)}function xo(e){return!e||e.toLowerCase()==="x"||e==="*"}function Ko(...e){return t=>e.reduce((r,n)=>n(r),t)}function Yo(e){return e.match(Lr(Xo.comparator))}function zo(e,t,r,n){const o=`${e}.${t}.${r}`;return n?`${o}-${n}`:o}ne.combineVersion=zo;ne.extractComparator=Yo;ne.isXVersion=xo;ne.parseRegex=Lr;ne.pipe=Ko;var V={};const x=W,T=ne;function Jo(e){return e.replace(T.parseRegex(x.hyphenRange),(t,r,n,o,s,i,a,c,l,u,d,f)=>(T.isXVersion(n)?r="":T.isXVersion(o)?r=`>=${n}.0.0`:T.isXVersion(s)?r=`>=${n}.${o}.0`:r=`>=${r}`,T.isXVersion(l)?c="":T.isXVersion(u)?c=`<${Number(l)+1}.0.0-0`:T.isXVersion(d)?c=`<${l}.${Number(u)+1}.0-0`:f?c=`<=${l}.${u}.${d}-${f}`:c=`<=${c}`,`${r} ${c}`.trim()))}function Zo(e){return e.replace(T.parseRegex(x.comparatorTrim),"$1$2$3")}function Qo(e){return e.replace(T.parseRegex(x.tildeTrim),"$1~")}function es(e){return e.replace(T.parseRegex(x.caretTrim),"$1^")}function ts(e){return e.trim().split(/\s+/).map(t=>t.replace(T.parseRegex(x.caret),(r,n,o,s,i)=>T.isXVersion(n)?"":T.isXVersion(o)?`>=${n}.0.0 <${Number(n)+1}.0.0-0`:T.isXVersion(s)?n==="0"?`>=${n}.${o}.0 <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.0 <${Number(n)+1}.0.0-0`:i?n==="0"?o==="0"?`>=${n}.${o}.${s}-${i} <${n}.${o}.${Number(s)+1}-0`:`>=${n}.${o}.${s}-${i} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${s}-${i} <${Number(n)+1}.0.0-0`:n==="0"?o==="0"?`>=${n}.${o}.${s} <${n}.${o}.${Number(s)+1}-0`:`>=${n}.${o}.${s} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${s} <${Number(n)+1}.0.0-0`)).join(" ")}function rs(e){return e.trim().split(/\s+/).map(t=>t.replace(T.parseRegex(x.tilde),(r,n,o,s,i)=>T.isXVersion(n)?"":T.isXVersion(o)?`>=${n}.0.0 <${Number(n)+1}.0.0-0`:T.isXVersion(s)?`>=${n}.${o}.0 <${n}.${Number(o)+1}.0-0`:i?`>=${n}.${o}.${s}-${i} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${s} <${n}.${Number(o)+1}.0-0`)).join(" ")}function ns(e){return e.split(/\s+/).map(t=>t.trim().replace(T.parseRegex(x.xRange),(r,n,o,s,i,a)=>{const c=T.isXVersion(o),l=c||T.isXVersion(s),u=l||T.isXVersion(i);return n==="="&&u&&(n=""),a="",c?n===">"||n==="<"?"<0.0.0-0":"*":n&&u?(l&&(s=0),i=0,n===">"?(n=">=",l?(o=Number(o)+1,s=0,i=0):(s=Number(s)+1,i=0)):n==="<="&&(n="<",l?o=Number(o)+1:s=Number(s)+1),n==="<"&&(a="-0"),`${n+o}.${s}.${i}${a}`):l?`>=${o}.0.0${a} <${Number(o)+1}.0.0-0`:u?`>=${o}.${s}.0${a} <${o}.${Number(s)+1}.0-0`:r})).join(" ")}function os(e){return e.trim().replace(T.parseRegex(x.star),"")}function ss(e){return e.trim().replace(T.parseRegex(x.gte0),"")}V.parseCaretTrim=es;V.parseCarets=ts;V.parseComparatorTrim=Zo;V.parseGTE0=ss;V.parseHyphen=Jo;V.parseStar=os;V.parseTildeTrim=Qo;V.parseTildes=rs;V.parseXRanges=ns;var Dr={};function Ge(e,t){return e=Number(e)||e,t=Number(t)||t,e>t?1:e===t?0:-1}function is(e,t){const{preRelease:r}=e,{preRelease:n}=t;if(r===void 0&&n)return 1;if(r&&n===void 0)return-1;if(r===void 0&&n===void 0)return 0;for(let o=0,s=r.length;o<=s;o++){const i=r[o],a=n[o];if(i!==a)return i===void 0&&a===void 0?0:i?a?Ge(i,a):-1:1}return 0}function ke(e,t){return Ge(e.major,t.major)||Ge(e.minor,t.minor)||Ge(e.patch,t.patch)||is(e,t)}function Je(e,t){return e.version===t.version}function as(e,t){switch(e.operator){case"":case"=":return Je(e,t);case">":return ke(e,t)<0;case">=":return Je(e,t)||ke(e,t)<0;case"<":return ke(e,t)>0;case"<=":return Je(e,t)||ke(e,t)>0;case void 0:return!0;default:return!1}}Dr.compare=as;const ae=ne,X=V,ls=Dr;function cs(e){return ae.pipe(X.parseCarets,X.parseTildes,X.parseXRanges,X.parseStar)(e)}function us(e){return ae.pipe(X.parseHyphen,X.parseComparatorTrim,X.parseTildeTrim,X.parseCaretTrim)(e.trim()).split(/\s+/).join(" ")}function fs(e,t){if(!e)return!1;const r=ae.extractComparator(e);if(!r)return!1;const[,n,,o,s,i,a]=r,c={operator:n,version:ae.combineVersion(o,s,i,a),major:o,minor:s,patch:i,preRelease:a==null?void 0:a.split(".")},l=t.split("||");for(const u of l){const d=u.trim();if(!d||d==="*"||d==="x")return!0;try{const f=us(d);if(!f.trim())return!0;const h=f.split(" ").map(g=>cs(g)).join(" ");if(!h.trim())return!0;const m=h.split(/\s+/).map(g=>X.parseGTE0(g)).filter(Boolean);if(m.length===0)continue;let _=!0;for(const g of m){const p=ae.extractComparator(g);if(!p){_=!1;break}const[,E,,I,k,y,N]=p;if(!ls.compare({operator:E,version:ae.combineVersion(I,k,y,N),major:I,minor:k,patch:y,preRelease:N==null?void 0:N.split(".")},c)){_=!1;break}}if(_)return!0}catch(f){console.error(`[semver] Error processing range part "${d}":`,f);continue}}return!1}Pt.satisfy=fs;var q={},oe={};const ds="default",hs="global";oe.DEFAULT_REMOTE_TYPE=hs;oe.DEFAULT_SCOPE=ds;const We=M,Hr=$,Cr=b,ms=oe,Ee=Pt;let yt=D;function _s(e,t,r,n){var s,i;let o;return"get"in e?o=e.get:"lib"in e?o=()=>Promise.resolve(e.lib):o=()=>Promise.resolve(()=>{We.error(`Cannot get shared "${r}" from "${t}": neither "get" nor "lib" is provided in the share config.`)}),(s=e.shareConfig)!=null&&s.eager&&((i=e.treeShaking)!=null&&i.mode)&&We.error(`Invalid shared config for "${r}" from "${t}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`),{deps:[],useIn:[],from:t,loading:null,...e,shareConfig:{requiredVersion:`^${e.version}`,singleton:!1,eager:!1,strictVersion:!1,...e.shareConfig},get:o,loaded:e!=null&&e.loaded||"lib"in e?!0:void 0,version:e.version??"0",scope:Array.isArray(e.scope)?e.scope:[e.scope??"default"],strategy:(e.strategy??n)||"version-first",treeShaking:e.treeShaking?{...e.treeShaking,mode:e.treeShaking.mode??"server-calc",status:e.treeShaking.status??yt.TreeShakingStatus.UNKNOWN,useIn:[]}:void 0}}function gs(e,t){const r=t.shared||{},n=t.name,o=Object.keys(r).reduce((i,a)=>{const c=Hr.arrayOptions(r[a]);return i[a]=i[a]||[],c.forEach(l=>{i[a].push(_s(l,n,a,t.shareStrategy))}),i},{}),s={...e.shared};return Object.keys(o).forEach(i=>{s[i]?o[i].forEach(a=>{s[i].find(c=>c.version===a.version)||s[i].push(a)}):s[i]=o[i]}),{allShareInfos:s,newShareInfos:o}}function Te(e,t){if(!e)return!1;const{status:r,mode:n}=e;return r===yt.TreeShakingStatus.NO_USE?!1:r===yt.TreeShakingStatus.CALCULATED?!0:n==="runtime-infer"?t?ys(e,t):!0:!1}function te(e,t){const r=n=>{if(!Number.isNaN(Number(n))){const o=n.split(".");let s=n;for(let i=0;i<3-o.length;i++)s+=".0";return s}return n};return!!Ee.satisfy(r(e),`<=${r(t)}`)}const Ie=(e,t)=>{const r=t||function(n,o){return te(n,o)};return Object.keys(e).reduce((n,o)=>!n||r(n,o)||n==="0"?o:n,0)},Be=e=>!!e.loaded||typeof e.lib=="function",ps=e=>!!e.loading,ys=(e,t)=>{if(!e||!t)return!1;const{usedExports:r}=e;return r?!!t.every(n=>r.includes(n)):!1};function Es(e,t,r,n){const o=e[t][r];let s="",i=Te(n);const a=function(c,l){return i?o[c].treeShaking?o[l].treeShaking?!Be(o[c].treeShaking)&&te(c,l):!1:!0:!Be(o[c])&&te(c,l)};if(i){if(s=Ie(e[t][r],a),s)return{version:s,useTreesShaking:i};i=!1}return{version:Ie(e[t][r],a),useTreesShaking:i}}const se=e=>Be(e)||ps(e);function Ss(e,t,r,n){const o=e[t][r];let s="",i=Te(n);const a=function(c,l){if(i){if(!o[c].treeShaking)return!0;if(!o[l].treeShaking)return!1;if(se(o[l].treeShaking))return se(o[c].treeShaking)?!!te(c,l):!0;if(se(o[c].treeShaking))return!1}return se(o[l])?se(o[c])?!!te(c,l):!0:se(o[c])?!1:te(c,l)};if(i){if(s=Ie(e[t][r],a),s)return{version:s,useTreesShaking:i};i=!1}return{version:Ie(e[t][r],a),useTreesShaking:i}}function bs(e){return e==="loaded-first"?Ss:Es}function Rs(e,t,r,n){if(!e)return;const{shareConfig:o,scope:s=ms.DEFAULT_SCOPE,strategy:i,treeShaking:a}=r,c=Array.isArray(s)?s:[s];for(const l of c)if(o&&e[l]&&e[l][t]){const{requiredVersion:u}=o,{version:d,useTreesShaking:f}=bs(i)(e,l,t,a),h=()=>{const _=e[l][t][d];if(o.singleton){if(typeof u=="string"&&!Ee.satisfy(d,u)){const g=`Version ${d} from ${d&&_.from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${u})`;o.strictVersion?We.error(g):We.warn(g)}return{shared:_,useTreesShaking:f}}else{if(u===!1||u==="*")return{shared:_,useTreesShaking:f};if(Ee.satisfy(d,u))return{shared:_,useTreesShaking:f};const g=Te(a);if(g){for(const[p,E]of Object.entries(e[l][t]))if(Te(E.treeShaking,a==null?void 0:a.usedExports)&&Ee.satisfy(p,u))return{shared:E,useTreesShaking:g}}for(const[p,E]of Object.entries(e[l][t]))if(Ee.satisfy(p,u))return{shared:E,useTreesShaking:!1}}},m={shareScopeMap:e,scope:l,pkgName:t,version:d,GlobalFederation:Cr.Global.__FEDERATION__,shareInfo:r,resolver:h};return(n.emit(m)||m).resolver()}}function Ts(){return Cr.Global.__FEDERATION__.__SHARE__}function Is(e){const{pkgName:t,extraOptions:r,shareInfos:n}=e,o=c=>{if(!c)return;const l={};return c.forEach(d=>{l[d.version]=d}),l[Ie(l,function(d,f){return!Be(l[d])&&te(d,f)})]},s=(r==null?void 0:r.resolver)??o,i=c=>c!==null&&typeof c=="object"&&!Array.isArray(c),a=(...c)=>{const l={};for(const u of c)if(u)for(const[d,f]of Object.entries(u)){const h=l[d];i(h)&&i(f)?l[d]=a(h,f):f!==void 0&&(l[d]=f)}return l};return a(s(n[t]),r==null?void 0:r.customShareInfo)}const $s=(e,t)=>{e.useIn||(e.useIn=[]),Hr.addUniqueItem(e.useIn,t)};function Ns(e,t){return t&&e.treeShaking?e.treeShaking:e}q.addUseIn=$s;q.directShare=Ns;q.formatShareConfigs=gs;q.getGlobalShareScope=Ts;q.getRegisteredShare=Rs;q.getTargetSharedOptions=Is;q.shouldUseTreeShaking=Te;var he={};function Ms(e,t){for(const r of e){const n=t.startsWith(r.name);let o=t.replace(r.name,"");if(n){if(o.startsWith("/")){const a=r.name;return o=`.${o}`,{pkgNameOrAlias:a,expose:o,remote:r}}else if(o==="")return{pkgNameOrAlias:r.name,expose:".",remote:r}}const s=r.alias&&t.startsWith(r.alias);let i=r.alias&&t.replace(r.alias,"");if(r.alias&&s){if(i&&i.startsWith("/")){const a=r.alias;return i=`.${i}`,{pkgNameOrAlias:a,expose:i,remote:r}}else if(i==="")return{pkgNameOrAlias:r.alias,expose:".",remote:r}}}}function Ps(e,t){for(const r of e)if(t===r.name||r.alias&&t===r.alias)return r}he.matchRemote=Ps;he.matchRemoteWithNameAndExpose=Ms;var K={},Y={},F={};const vs="RUNTIME-001",As="RUNTIME-002",Os="RUNTIME-003",ks="RUNTIME-004",ws="RUNTIME-005",Fs="RUNTIME-006",Ls="RUNTIME-007",Ds="RUNTIME-008",Hs="RUNTIME-009",Cs="RUNTIME-010",qs="RUNTIME-011",Gs="TYPE-001",Us="BUILD-001",Ws="BUILD-002";F.BUILD_001=Us;F.BUILD_002=Ws;F.RUNTIME_001=vs;F.RUNTIME_002=As;F.RUNTIME_003=Os;F.RUNTIME_004=ks;F.RUNTIME_005=ws;F.RUNTIME_006=Fs;F.RUNTIME_007=Ls;F.RUNTIME_008=Ds;F.RUNTIME_009=Hs;F.RUNTIME_010=Cs;F.RUNTIME_011=qs;F.TYPE_001=Gs;var Me={};const L=F,qr={[L.RUNTIME_001]:"Failed to get remoteEntry exports.",[L.RUNTIME_002]:'The remote entry interface does not contain "init"',[L.RUNTIME_003]:"Failed to get manifest.",[L.RUNTIME_004]:"Failed to locate remote.",[L.RUNTIME_005]:"Invalid loadShareSync function call from bundler runtime",[L.RUNTIME_006]:"Invalid loadShareSync function call from runtime",[L.RUNTIME_007]:"Failed to get remote snapshot.",[L.RUNTIME_008]:"Failed to load script resources.",[L.RUNTIME_009]:"Please call createInstance first.",[L.RUNTIME_010]:'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',[L.RUNTIME_011]:"The remoteEntry URL is missing from the remote snapshot."},Gr={[L.TYPE_001]:"Failed to generate type declaration. Execute the below cmd to reproduce and fix the error."},Ur={[L.BUILD_001]:"Failed to find expose module.",[L.BUILD_002]:"PublicPath is required in prod mode."},Bs={...qr,...Gr,...Ur};Me.buildDescMap=Ur;Me.errorDescMap=Bs;Me.runtimeDescMap=qr;Me.typeDescMap=Gr;(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=F,r=Mt,n=Me;e.BUILD_001=t.BUILD_001,e.BUILD_002=t.BUILD_002,e.RUNTIME_001=t.RUNTIME_001,e.RUNTIME_002=t.RUNTIME_002,e.RUNTIME_003=t.RUNTIME_003,e.RUNTIME_004=t.RUNTIME_004,e.RUNTIME_005=t.RUNTIME_005,e.RUNTIME_006=t.RUNTIME_006,e.RUNTIME_007=t.RUNTIME_007,e.RUNTIME_008=t.RUNTIME_008,e.RUNTIME_009=t.RUNTIME_009,e.RUNTIME_010=t.RUNTIME_010,e.RUNTIME_011=t.RUNTIME_011,e.TYPE_001=t.TYPE_001,e.buildDescMap=n.buildDescMap,e.errorDescMap=n.errorDescMap,e.getShortErrorMsg=r.getShortErrorMsg,e.runtimeDescMap=n.runtimeDescMap,e.typeDescMap=n.typeDescMap})(Y);const Ve=M,le=b,Ht=oe;let Wr=D,$e=Y;const Br=".then(callbacks[0]).catch(callbacks[1])";async function js({entry:e,remoteEntryExports:t}){return new Promise((r,n)=>{try{t?r(t):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${e}")${Br}`)([r,n]):import(e).then(r).catch(n)}catch(o){Ve.error(`Failed to load ESM entry from "${e}". ${o instanceof Error?o.message:String(o)}`)}})}async function Vs({entry:e,remoteEntryExports:t}){return new Promise((r,n)=>{try{t?r(t):typeof __system_context__>"u"?System.import(e).then(r).catch(n):new Function("callbacks",`System.import("${e}")${Br}`)([r,n])}catch(o){Ve.error(`Failed to load SystemJS entry from "${e}". ${o instanceof Error?o.message:String(o)}`)}})}function Xs(e,t,r){const{remoteEntryKey:n,entryExports:o}=le.getRemoteEntryExports(e,t);return o||Ve.error($e.RUNTIME_001,$e.runtimeDescMap,{remoteName:e,remoteEntryUrl:r,remoteEntryKey:n}),o}async function xs({name:e,globalName:t,entry:r,loaderHook:n,getEntryUrl:o}){const{entryExports:s}=le.getRemoteEntryExports(e,t);if(s)return s;const i=o?o(r):r;return(0,Wr.loadScript)(i,{attrs:{},createScriptHook:(a,c)=>{const l=n.lifecycle.createScript.emit({url:a,attrs:c});if(l&&(l instanceof HTMLScriptElement||"script"in l||"timeout"in l))return l}}).then(()=>Xs(e,t,r),a=>{const c=a instanceof Error?a.message:String(a);Ve.error($e.RUNTIME_008,$e.runtimeDescMap,{remoteName:e,resourceUrl:i},c)})}async function Ks({remoteInfo:e,remoteEntryExports:t,loaderHook:r,getEntryUrl:n}){const{entry:o,entryGlobalName:s,name:i,type:a}=e;switch(a){case"esm":case"module":return js({entry:o,remoteEntryExports:t});case"system":return Vs({entry:o,remoteEntryExports:t});default:return xs({entry:o,globalName:s,name:i,loaderHook:r,getEntryUrl:n})}}function Et(e){const{entry:t,name:r}=e;return(0,Wr.composeKeyWithSeparator)(r,t)}async function jr(e){const{origin:t,remoteEntryExports:r,remoteInfo:n,getEntryUrl:o,_inErrorHandling:s=!1}=e,i=Et(n);if(r)return r;if(!le.globalLoading[i]){const a=t.remoteHandler.hooks.lifecycle.loadEntry,c=t.loaderHook;le.globalLoading[i]=a.emit({loaderHook:c,remoteInfo:n,remoteEntryExports:r}).then(l=>l||Ks({remoteInfo:n,remoteEntryExports:r,loaderHook:c,getEntryUrl:o})).catch(async l=>{const u=Et(n),d=l instanceof Error&&l.message.includes("ScriptExecutionError");if(l instanceof Error&&l.message.includes($e.RUNTIME_008)&&!d&&!s){const f=m=>jr({...m,_inErrorHandling:!0}),h=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:f,origin:t,remoteInfo:n,remoteEntryExports:r,globalLoading:le.globalLoading,uniqueKey:u});if(h)return h}throw l})}return le.globalLoading[i]}function Ys(e){return{...e,entry:"entry"in e?e.entry:"",type:e.type||Ht.DEFAULT_REMOTE_TYPE,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||Ht.DEFAULT_SCOPE}}K.getRemoteEntry=jr;K.getRemoteEntryUniqueKey=Et;K.getRemoteInfo=Ys;var Vr={};function zs(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}Vr.getBuilderId=zs;var Xr={};const Js=b;function Zs(e,t){const r=Js.getGlobalHostPlugins(),n=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return r.length>0&&r.forEach(o=>{e!=null&&e.find(s=>s.name!==o.name)&&e.push(o)}),e&&e.length>0&&e.forEach(o=>{n.forEach(s=>{s.applyPlugin(o,t)})}),e}Xr.registerPlugins=Zs;var Pe={};function Qs(e){return{name:e.name,alias:e.alias,entry:"entry"in e?e.entry:void 0,version:"version"in e?e.version:void 0,type:e.type,entryGlobalName:e.entryGlobalName,shareScope:e.shareScope}}function ei(e){var r,n,o,s,i,a;const t={};for(const[c,l]of Object.entries(e.shared)){const u=l[0];u&&(t[c]={version:u.version,singleton:(r=u.shareConfig)==null?void 0:r.singleton,requiredVersion:((n=u.shareConfig)==null?void 0:n.requiredVersion)===!1?!1:(o=u.shareConfig)==null?void 0:o.requiredVersion,eager:u.eager,strictVersion:(s=u.shareConfig)==null?void 0:s.strictVersion})}return{project:{name:e.name,mfRole:((i=e.remotes)==null?void 0:i.length)>0?"host":"unknown"},mfConfig:{name:e.name,remotes:((a=e.remotes)==null?void 0:a.map(Qs))??[],shared:t}}}Pe.optionsToMFContext=ei;var xr={},Z={};const ti=M,ri=he,Ct=K;let Se=D;function Kr(e){return{resourceCategory:"sync",share:!0,depsRemote:!0,prefetchInterface:!1,...e}}function ni(e,t){return t.map(r=>{const n=ri.matchRemote(e,r.nameOrAlias);return ti.assert(n,`Unable to preload ${r.nameOrAlias} as it is not included in ${!n&&(0,Se.safeToString)({remoteInfo:n,remotes:e})}`),{remote:n,preloadConfig:Kr(r)}})}function oi(e){return e?e.map(t=>t==="."?t:t.startsWith("./")?t.replace("./",""):t):[]}function si(e,t,r,n=!0){const{cssAssets:o,jsAssetsWithoutEntry:s,entryAssets:i}=r;if(t.options.inBrowser){if(i.forEach(a=>{const{moduleInfo:c}=a,l=t.moduleCache.get(e.name);l?Ct.getRemoteEntry({origin:t,remoteInfo:c,remoteEntryExports:l.remoteEntryExports}):Ct.getRemoteEntry({origin:t,remoteInfo:c,remoteEntryExports:void 0})}),n){const a={rel:"preload",as:"style"};o.forEach(c=>{const{link:l,needAttach:u}=(0,Se.createLink)({url:c,cb:()=>{},attrs:a,createLinkHook:(d,f)=>{const h=t.loaderHook.lifecycle.createLink.emit({url:d,attrs:f});if(h instanceof HTMLLinkElement)return h}});u&&document.head.appendChild(l)})}else{const a={rel:"stylesheet",type:"text/css"};o.forEach(c=>{const{link:l,needAttach:u}=(0,Se.createLink)({url:c,cb:()=>{},attrs:a,createLinkHook:(d,f)=>{const h=t.loaderHook.lifecycle.createLink.emit({url:d,attrs:f});if(h instanceof HTMLLinkElement)return h},needDeleteLink:!1});u&&document.head.appendChild(l)})}if(n){const a={rel:"preload",as:"script"};s.forEach(c=>{const{link:l,needAttach:u}=(0,Se.createLink)({url:c,cb:()=>{},attrs:a,createLinkHook:(d,f)=>{const h=t.loaderHook.lifecycle.createLink.emit({url:d,attrs:f});if(h instanceof HTMLLinkElement)return h}});u&&document.head.appendChild(l)})}else{const a={fetchpriority:"high",type:(e==null?void 0:e.type)==="module"?"module":"text/javascript"};s.forEach(c=>{const{script:l,needAttach:u}=(0,Se.createScript)({url:c,cb:()=>{},attrs:a,createScriptHook:(d,f)=>{const h=t.loaderHook.lifecycle.createScript.emit({url:d,attrs:f});if(h instanceof HTMLScriptElement)return h},needDeleteScript:!0});u&&document.head.appendChild(l)})}}}Z.defaultPreloadArgs=Kr;Z.formatPreloadArgs=ni;Z.normalizePreloadExposes=oi;Z.preloadAssets=si;const w=b,qt=q,ii=he,ai=K,li=Z,ci={getRegisteredShare:qt.getRegisteredShare,getGlobalShareScope:qt.getGlobalShareScope},ui={Global:w.Global,nativeGlobal:w.nativeGlobal,resetFederationGlobalInfo:w.resetFederationGlobalInfo,setGlobalFederationInstance:w.setGlobalFederationInstance,getGlobalFederationConstructor:w.getGlobalFederationConstructor,setGlobalFederationConstructor:w.setGlobalFederationConstructor,getInfoWithoutType:w.getInfoWithoutType,getGlobalSnapshot:w.getGlobalSnapshot,getTargetSnapshotInfoByModuleInfo:w.getTargetSnapshotInfoByModuleInfo,getGlobalSnapshotInfoByModuleInfo:w.getGlobalSnapshotInfoByModuleInfo,setGlobalSnapshotInfoByModuleInfo:w.setGlobalSnapshotInfoByModuleInfo,addGlobalSnapshot:w.addGlobalSnapshot,getRemoteEntryExports:w.getRemoteEntryExports,registerGlobalPlugins:w.registerGlobalPlugins,getGlobalHostPlugins:w.getGlobalHostPlugins,getPreloaded:w.getPreloaded,setPreloaded:w.setPreloaded};var fi={global:ui,share:ci,utils:{matchRemoteWithNameAndExpose:ii.matchRemoteWithNameAndExpose,preloadAssets:li.preloadAssets,getRemoteInfo:ai.getRemoteInfo}};xr.default=fi;var Xe={};const Ze=M,Gt=$,di=K,hi=Pe;let mi=D,Ut=Y;function _i(e,t,r){const n=t,o=Array.isArray(e.shareScope)?e.shareScope:[e.shareScope];o.length||o.push("default"),o.forEach(i=>{n[i]||(n[i]={})});const s={version:e.version||"",shareScopeKeys:Array.isArray(e.shareScope)?o:e.shareScope||"default"};return Object.defineProperty(s,"shareScopeMap",{value:n,enumerable:!1}),{remoteEntryInitOptions:s,shareScope:n[o[0]],initScope:r??[]}}var gi=class{constructor({remoteInfo:e,host:t}){this.inited=!1,this.initing=!1,this.lib=void 0,this.remoteInfo=e,this.host=t}async getEntry(){if(this.remoteEntryExports)return this.remoteEntryExports;const e=await di.getRemoteEntry({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports});return Ze.assert(e,`remoteEntryExports is undefined - ${(0,mi.safeToString)(this.remoteInfo)}`),this.remoteEntryExports=e,this.remoteEntryExports}async init(e,t,r){const n=await this.getEntry();if(this.inited)return n;if(this.initPromise)return await this.initPromise,n;this.initing=!0,this.initPromise=(async()=>{const{remoteEntryInitOptions:o,shareScope:s,initScope:i}=_i(this.remoteInfo,this.host.shareScopeMap,r),a=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:s,remoteEntryInitOptions:o,initScope:i,remoteInfo:this.remoteInfo,origin:this.host});typeof(n==null?void 0:n.init)>"u"&&Ze.error(Ut.RUNTIME_002,Ut.runtimeDescMap,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,hi.optionsToMFContext(this.host.options)),await n.init(a.shareScope,a.initScope,a.remoteEntryInitOptions),await this.host.hooks.lifecycle.initContainer.emit({...a,id:e,remoteSnapshot:t,remoteEntryExports:n}),this.inited=!0})();try{await this.initPromise}finally{this.initing=!1,this.initPromise=void 0}return n}async get(e,t,r,n){const{loadFactory:o=!0}=r||{loadFactory:!0},s=await this.init(e,n);this.lib=s;let i;i=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:s,expose:t,moduleInfo:this.remoteInfo}),i||(i=await s.get(t)),Ze.assert(i,`${Gt.getFMId(this.remoteInfo)} remote don't export ${t}.`);const a=Gt.processModuleAlias(this.remoteInfo.name,t),c=this.wraperFactory(i,a);return o?await c():c}wraperFactory(e,t){function r(n,o){n&&typeof n=="object"&&Object.isExtensible(n)&&!Object.getOwnPropertyDescriptor(n,Symbol.for("mf_module_id"))&&Object.defineProperty(n,Symbol.for("mf_module_id"),{value:o,enumerable:!1})}return e instanceof Promise?async()=>{const n=await e();return r(n,t),n}:()=>{const n=e();return r(n,t),n}}};Xe.Module=gi;var Yr={},me={},pi=class{constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}on(e){typeof e=="function"&&this.listeners.add(e)}once(e){const t=this;this.on(function r(...n){return t.remove(r),e.apply(null,n)})}emit(...e){let t;return this.listeners.size>0&&this.listeners.forEach(r=>{t=r(...e)}),t}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}};me.SyncHook=pi;var ve={};const yi=me;var Ei=class extends yi.SyncHook{emit(...e){let t;const r=Array.from(this.listeners);if(r.length>0){let n=0;const o=s=>s===!1?!1:n0){let r=0;const n=s=>(et.warn(s),this.onerror(s),e),o=s=>{if(Ii.checkReturnData(e,s)){if(e=s,r{const s=e[o];s&&this.lifecycle[o].on(s)}))}removePlugin(e){we.assert(e,"A name is required.");const t=this.registerPlugins[e];we.assert(t,`The plugin "${e}" is not registered.`),Object.keys(t).forEach(r=>{r!=="name"&&this.lifecycle[r].remove(t[r])})}};Oe.PluginSystem=Mi;var xe={};const Pi=M,St=$,vi=Z;let Wt=D,Bt=Y;function Zr(e,t){const r=St.getRemoteEntryInfoFromSnapshot(t);r.url||Pi.error(Bt.RUNTIME_011,Bt.runtimeDescMap,{remoteName:e.name});let n=(0,Wt.getResourceUrl)(t,r.url);!Wt.isBrowserEnvValue&&!n.startsWith("http")&&(n=`https:${n}`),e.type=r.type,e.entryGlobalName=r.globalName,e.entry=n,e.version=t.version,e.buildVersion=t.buildVersion}function Ai(){return{name:"snapshot-plugin",async afterResolve(e){const{remote:t,pkgNameOrAlias:r,expose:n,origin:o,remoteInfo:s,id:i}=e;if(!St.isRemoteInfoWithEntry(t)||!St.isPureRemoteEntry(t)){const{remoteSnapshot:a,globalSnapshot:c}=await o.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:i});Zr(s,a);const l={remote:t,preloadConfig:{nameOrAlias:r,exposes:[n],resourceCategory:"sync",share:!1,depsRemote:!1}},u=await o.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:o,preloadOptions:l,remoteInfo:s,remote:t,remoteSnapshot:a,globalSnapshot:c});return u&&vi.preloadAssets(s,o,u,!1),{...e,remoteSnapshot:a}}return e}}}xe.assignRemoteInfo=Zr;xe.snapshotPlugin=Ai;var Qr={};const Ne=$,bt=b,Oi=q,jt=Z,ki=xe;let je=D;function wi(e){const t=e.split(":");return t.length===1?{name:t[0],version:void 0}:t.length===2?{name:t[0],version:t[1]}:{name:t[1],version:t[2]}}function en(e,t,r,n,o={},s){const{value:i}=bt.getInfoWithoutType(e,Ne.getFMId(t)),a=s||i;if(a&&!(0,je.isManifestProvider)(a)&&(r(a,t,n),a.remotesInfo)){const c=Object.keys(a.remotesInfo);for(const l of c){if(o[l])continue;o[l]=!0;const u=wi(l),d=a.remotesInfo[l];en(e,{name:u.name,version:d.matchedVersion},r,!1,o,void 0)}}}const tt=(e,t)=>document.querySelector(`${e}[${e==="link"?"href":"src"}="${t}"]`);function Fi(e,t,r,n,o){const s=[],i=[],a=[],c=new Set,l=new Set,{options:u}=e,{preloadConfig:d}=t,{depsRemote:f}=d;if(en(n,r,(m,_,g)=>{var N;let p;if(g)p=d;else if(Array.isArray(f)){const R=f.find(v=>v.nameOrAlias===_.name||v.nameOrAlias===_.alias);if(!R)return;p=jt.defaultPreloadArgs(R)}else if(f===!0)p=d;else return;const E=(0,je.getResourceUrl)(m,Ne.getRemoteEntryInfoFromSnapshot(m).url);E&&a.push({name:_.name,moduleInfo:{name:_.name,entry:E,type:"remoteEntryType"in m?m.remoteEntryType:"global",entryGlobalName:"globalName"in m?m.globalName:_.name,shareScope:"",version:"version"in m?m.version:void 0},url:E});let I="modules"in m?m.modules:[];const k=jt.normalizePreloadExposes(p.exposes);k.length&&"modules"in m&&(I=(N=m==null?void 0:m.modules)==null?void 0:N.reduce((R,v)=>((k==null?void 0:k.indexOf(v.moduleName))!==-1&&R.push(v),R),[]));function y(R){const v=R.map(B=>(0,je.getResourceUrl)(m,B));return p.filter?v.filter(p.filter):v}if(I){const R=I.length;for(let v=0;v0){const m=(_,g)=>{const{shared:p}=Oi.getRegisteredShare(e.shareScopeMap,g.sharedName,_,e.sharedHandler.hooks.lifecycle.resolveShare)||{};p&&typeof p.lib=="function"&&(g.assets.js.sync.forEach(E=>{c.add(E)}),g.assets.css.sync.forEach(E=>{l.add(E)}))};o.shared.forEach(_=>{var E;const g=(E=u.shared)==null?void 0:E[_.sharedName];if(!g)return;const p=_.version?g.find(I=>I.version===_.version):g;p&&Ne.arrayOptions(p).forEach(I=>{m(I,_)})})}const h=i.filter(m=>!c.has(m)&&!tt("script",m));return{cssAssets:s.filter(m=>!l.has(m)&&!tt("link",m)),jsAssetsWithoutEntry:h,entryAssets:a.filter(m=>!tt("script",m.url))}}const Li=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(e){const{origin:t,preloadOptions:r,remoteInfo:n,remote:o,globalSnapshot:s,remoteSnapshot:i}=e;return je.isBrowserEnvValue?Ne.isRemoteInfoWithEntry(o)&&Ne.isPureRemoteEntry(o)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:o.name,url:o.entry,moduleInfo:{name:n.name,entry:o.entry,type:n.type||"global",entryGlobalName:"",shareScope:""}}]}:(ki.assignRemoteInfo(n,i),Fi(t,r,n,s,i)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};Qr.generatePreloadAssetsPlugin=Li;var Ke={};const rt=M,Di=$,U=b,Vt=Pe,Hi=ve,nt=Ae,Ci=Oe;let ot=D,Fe=Y;function tn(e,t){const r=U.getGlobalSnapshotInfoByModuleInfo({name:t.name,version:t.options.version}),n=r&&"remotesInfo"in r&&r.remotesInfo&&U.getInfoWithoutType(r.remotesInfo,e.name).value;return n&&n.matchedVersion?{hostGlobalSnapshot:r,globalSnapshot:U.getGlobalSnapshot(),remoteSnapshot:U.getGlobalSnapshotInfoByModuleInfo({name:e.name,version:n.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:U.getGlobalSnapshot(),remoteSnapshot:U.getGlobalSnapshotInfoByModuleInfo({name:e.name,version:"version"in e?e.version:void 0})}}var qi=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new Ci.PluginSystem({beforeLoadRemoteSnapshot:new Hi.AsyncHook("beforeLoadRemoteSnapshot"),loadSnapshot:new nt.AsyncWaterfallHook("loadGlobalSnapshot"),loadRemoteSnapshot:new nt.AsyncWaterfallHook("loadRemoteSnapshot"),afterLoadSnapshot:new nt.AsyncWaterfallHook("afterLoadSnapshot")}),this.manifestLoading=U.Global.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:t,expose:r}){const{options:n}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:n,moduleInfo:e});let o=U.getGlobalSnapshotInfoByModuleInfo({name:this.HostInstance.options.name,version:this.HostInstance.options.version});o||(o={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},U.addGlobalSnapshot({[this.HostInstance.options.name]:o})),o&&"remotesInfo"in o&&!U.getInfoWithoutType(o.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(o.remotesInfo={...o==null?void 0:o.remotesInfo,[e.name]:{matchedVersion:"version"in e?e.version:e.entry}});const{hostGlobalSnapshot:s,remoteSnapshot:i,globalSnapshot:a}=this.getGlobalRemoteInfo(e),{remoteSnapshot:c,globalSnapshot:l}=await this.hooks.lifecycle.loadSnapshot.emit({options:n,moduleInfo:e,hostGlobalSnapshot:s,remoteSnapshot:i,globalSnapshot:a});let u,d;if(c)if((0,ot.isManifestProvider)(c)){const f=ot.isBrowserEnvValue?c.remoteEntry:c.ssrRemoteEntry||c.remoteEntry||"",h=await this.getManifestJson(f,e,{}),m=U.setGlobalSnapshotInfoByModuleInfo({...e,entry:f},h);u=h,d=m}else{const{remoteSnapshot:f}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:c,from:"global"});u=f,d=l}else if(Di.isRemoteInfoWithEntry(e)){const f=await this.getManifestJson(e.entry,e,{}),h=U.setGlobalSnapshotInfoByModuleInfo(e,f),{remoteSnapshot:m}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:f,from:"global"});u=m,d=h}else rt.error(Fe.RUNTIME_007,Fe.runtimeDescMap,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(l)},void 0,Vt.optionsToMFContext(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:t,host:this.HostInstance,options:n,moduleInfo:e,remoteSnapshot:u}),{remoteSnapshot:u,globalSnapshot:d}}getGlobalRemoteInfo(e){return tn(e,this.HostInstance)}async getManifestJson(e,t,r){const n=async()=>{let s=this.manifestCache.get(e);if(s)return s;try{let i=await this.loaderHook.lifecycle.fetch.emit(e,{});(!i||!(i instanceof Response))&&(i=await fetch(e,{})),s=await i.json()}catch(i){s=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:i,from:"runtime",lifecycle:"afterResolve",origin:this.HostInstance}),s||(delete this.manifestLoading[e],rt.error(Fe.RUNTIME_003,Fe.runtimeDescMap,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${i}`,Vt.optionsToMFContext(this.HostInstance.options)))}return rt.assert(s.metaData&&s.exposes&&s.shared,`"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${[!s.metaData&&"metaData",!s.exposes&&"exposes",!s.shared&&"shared"].filter(Boolean).join(", ")}.`),this.manifestCache.set(e,s),s},o=async()=>{const s=await n(),i=(0,ot.generateSnapshotFromManifest)(s,{version:e}),{remoteSnapshot:a}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:t,manifestJson:s,remoteSnapshot:i,manifestUrl:e,from:"manifest"});return a};return this.manifestLoading[e]||(this.manifestLoading[e]=o().then(s=>s)),this.manifestLoading[e]}};Ke.SnapshotHandler=qi;Ke.getGlobalRemoteInfo=tn;var rn={};const st=M,Gi=oe,A=q,Xt=Pe,Ui=ve,it=_e,xt=Ae,Wi=Oe;let pe=Y;var Bi=class{constructor(e){this.hooks=new Wi.PluginSystem({beforeRegisterShare:new it.SyncWaterfallHook("beforeRegisterShare"),afterResolve:new xt.AsyncWaterfallHook("afterResolve"),beforeLoadShare:new xt.AsyncWaterfallHook("beforeLoadShare"),loadShare:new Ui.AsyncHook,resolveShare:new it.SyncWaterfallHook("resolveShare"),initContainerShareScopeMap:new it.SyncWaterfallHook("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}registerShared(e,t){const{newShareInfos:r,allShareInfos:n}=A.formatShareConfigs(e,t);return Object.keys(r).forEach(o=>{r[o].forEach(s=>{s.scope.forEach(i=>{var a;this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:o,shared:s}),(a=this.shareScopeMap[i])!=null&&a[o]||this.setShared({pkgName:o,lib:s.lib,get:s.get,loaded:s.loaded||!!s.lib,shared:s,from:t.name})})})}),{newShareInfos:r,allShareInfos:n}}async loadShare(e,t){const{host:r}=this,n=A.getTargetSharedOptions({pkgName:e,extraOptions:t,shareInfos:r.options.shared});n!=null&&n.scope&&await Promise.all(n.scope.map(async a=>{await Promise.all(this.initializeSharing(a,{strategy:n.strategy}))}));const{shareInfo:o}=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:n,shared:r.options.shared,origin:r});st.assert(o,`Cannot find shared "${e}" in host "${r.options.name}". Ensure the shared config for "${e}" is declared in the federation plugin options and the host has been initialized before loading shares.`);const{shared:s,useTreesShaking:i}=A.getRegisteredShare(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare)||{};if(s){const a=A.directShare(s,i);if(a.lib)return A.addUseIn(a,r.options.name),a.lib;if(a.loading&&!a.loaded){const c=await a.loading;return a.loaded=!0,a.lib||(a.lib=c),A.addUseIn(a,r.options.name),c}else{const l=(async()=>{const u=await a.get();return A.addUseIn(a,r.options.name),a.loaded=!0,a.lib=u,u})();return this.setShared({pkgName:e,loaded:!1,shared:s,from:r.options.name,lib:null,loading:l,treeShaking:i?a:void 0}),l}}else{if(t!=null&&t.customShareInfo)return!1;const a=A.shouldUseTreeShaking(o.treeShaking),c=A.directShare(o,a),u=(async()=>{const d=await c.get();c.lib=d,c.loaded=!0,A.addUseIn(c,r.options.name);const{shared:f,useTreesShaking:h}=A.getRegisteredShare(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare)||{};if(f){const m=A.directShare(f,h);m.lib=d,m.loaded=!0,f.from=o.from}return d})();return this.setShared({pkgName:e,loaded:!1,shared:o,from:r.options.name,lib:null,loading:u,treeShaking:a?c:void 0}),u}}initializeSharing(e=Gi.DEFAULT_SCOPE,t){const{host:r}=this,n=t==null?void 0:t.from,o=t==null?void 0:t.strategy;let s=t==null?void 0:t.initScope;const i=[];if(n!=="build"){const{initTokens:f}=this;s||(s=[]);let h=f[e];if(h||(h=f[e]={from:this.host.name}),s.indexOf(h)>=0)return i;s.push(h)}const a=this.shareScopeMap,c=r.options.name;a[e]||(a[e]={});const l=a[e],u=(f,h)=>{var I;const{version:m,eager:_}=h;l[f]=l[f]||{};const g=l[f],p=g[m]&&A.directShare(g[m]),E=!!(p&&("eager"in p&&p.eager||"shareConfig"in p&&((I=p.shareConfig)!=null&&I.eager)));(!p||p.strategy!=="loaded-first"&&!p.loaded&&(!_!=!E?_:c>g[m].from))&&(g[m]=h)},d=async f=>{const{module:h}=await r.remoteHandler.getRemoteModuleAndOptions({id:f});let m;try{m=await h.getEntry()}catch(_){if(m=await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:f,error:_,from:"runtime",lifecycle:"beforeLoadShare",origin:r}),!m)return}finally{m!=null&&m.init&&!h.initing&&(h.remoteEntryExports=m,await h.init(void 0,void 0,s))}};return Object.keys(r.options.shared).forEach(f=>{r.options.shared[f].forEach(h=>{h.scope.includes(e)&&u(f,h)})}),(r.options.shareStrategy==="version-first"||o==="version-first")&&r.options.remotes.forEach(f=>{f.shareScope===e&&i.push(d(f.name))}),i}loadShareSync(e,t){const{host:r}=this,n=A.getTargetSharedOptions({pkgName:e,extraOptions:t,shareInfos:r.options.shared});n!=null&&n.scope&&n.scope.forEach(i=>{this.initializeSharing(i,{strategy:n.strategy})});const{shared:o,useTreesShaking:s}=A.getRegisteredShare(this.shareScopeMap,e,n,this.hooks.lifecycle.resolveShare)||{};if(o){if(typeof o.lib=="function")return A.addUseIn(o,r.options.name),o.loaded||(o.loaded=!0,o.from===r.options.name&&(n.loaded=!0)),o.lib;if(typeof o.get=="function"){const i=o.get();if(!(i instanceof Promise))return A.addUseIn(o,r.options.name),this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:i,shared:o}),i}}if(n.lib)return n.loaded||(n.loaded=!0),n.lib;if(n.get){const i=n.get();return i instanceof Promise&&st.error((t==null?void 0:t.from)==="build"?pe.RUNTIME_005:pe.RUNTIME_006,pe.runtimeDescMap,{hostName:r.options.name,sharedPkgName:e},void 0,Xt.optionsToMFContext(r.options)),n.lib=i,this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:n.lib,shared:n}),n.lib}st.error(pe.RUNTIME_006,pe.runtimeDescMap,{hostName:r.options.name,sharedPkgName:e},void 0,Xt.optionsToMFContext(r.options))}initShareScopeMap(e,t,r={}){const{host:n}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:n.options,origin:n,scopeName:e,hostShareScopeMap:r.hostShareScopeMap})}setShared({pkgName:e,shared:t,from:r,lib:n,loading:o,loaded:s,get:i,treeShaking:a}){const{version:c,scope:l="default",...u}=t,d=Array.isArray(l)?l:[l],f=h=>{const m=(g,p,E)=>{E&&!g[p]&&(g[p]=E)},_=a?h.treeShaking:h;m(_,"loaded",s),m(_,"loading",o),m(_,"get",i)};d.forEach(h=>{this.shareScopeMap[h]||(this.shareScopeMap[h]={}),this.shareScopeMap[h][e]||(this.shareScopeMap[h][e]={}),this.shareScopeMap[h][e][c]||(this.shareScopeMap[h][e][c]={version:c,scope:[h],...u,lib:n});const m=this.shareScopeMap[h][e][c];f(m),r&&m.from!==r&&(m.from=r)})}_setGlobalShareScopeMap(e){const t=A.getGlobalShareScope(),r=e.id||e.name;r&&!t[r]&&(t[r]=this.shareScopeMap)}};rn.SharedHandler=Bi;var nn={};const Le=M,G=b,Kt=oe,ji=q,Vi=he,at=K,Xi=Pe,Yt=Z,xi=Xe,Ki=me,ie=ve,zt=_e,Yi=Ae,zi=Oe,Ji=Ke;let lt=D,Jt=Y;var Zi=class{constructor(e){this.hooks=new zi.PluginSystem({beforeRegisterRemote:new zt.SyncWaterfallHook("beforeRegisterRemote"),registerRemote:new zt.SyncWaterfallHook("registerRemote"),beforeRequest:new Yi.AsyncWaterfallHook("beforeRequest"),onLoad:new ie.AsyncHook("onLoad"),handlePreloadModule:new Ki.SyncHook("handlePreloadModule"),errorLoadRemote:new ie.AsyncHook("errorLoadRemote"),beforePreloadRemote:new ie.AsyncHook("beforePreloadRemote"),generatePreloadAssets:new ie.AsyncHook("generatePreloadAssets"),afterPreloadRemote:new ie.AsyncHook,loadEntry:new ie.AsyncHook}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce((r,n)=>(this.registerRemote(n,r,{force:!1}),r),e.remotes)}setIdToRemoteMap(e,t){const{remote:r,expose:n}=t,{name:o,alias:s}=r;if(this.idToRemoteMap[e]={name:r.name,expose:n},s&&e.startsWith(o)){const i=e.replace(o,s);this.idToRemoteMap[i]={name:r.name,expose:n};return}if(s&&e.startsWith(s)){const i=e.replace(s,o);this.idToRemoteMap[i]={name:r.name,expose:n}}}async loadRemote(e,t){const{host:r}=this;try{const{loadFactory:n=!0}=t||{loadFactory:!0},{module:o,moduleOptions:s,remoteMatchInfo:i}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:a,remote:c,expose:l,id:u,remoteSnapshot:d}=i,f=await o.get(u,l,t,d),h=await this.hooks.lifecycle.onLoad.emit({id:u,pkgNameOrAlias:a,expose:l,exposeModule:n?f:void 0,exposeModuleFactory:n?void 0:f,remote:c,options:s,moduleInstance:o,origin:r});return this.setIdToRemoteMap(e,i),typeof h=="function"?h:f}catch(n){const{from:o="runtime"}=t||{from:"runtime"},s=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:n,from:o,lifecycle:"onLoad",origin:r});if(!s)throw n;return s}}async preloadRemote(e){const{host:t}=this;await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});const r=Yt.formatPreloadArgs(t.options.remotes,e);await Promise.all(r.map(async n=>{const{remote:o}=n,s=at.getRemoteInfo(o),{globalSnapshot:i,remoteSnapshot:a}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:o}),c=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:n,remote:o,remoteInfo:s,globalSnapshot:i,remoteSnapshot:a});c&&Yt.preloadAssets(s,t,c)}))}registerRemotes(e,t){const{host:r}=this;e.forEach(n=>{this.registerRemote(n,r.options.remotes,{force:t==null?void 0:t.force})})}async getRemoteModuleAndOptions(e){const{host:t}=this,{id:r}=e;let n;try{n=await this.hooks.lifecycle.beforeRequest.emit({id:r,options:t.options,origin:t})}catch(h){if(n=await this.hooks.lifecycle.errorLoadRemote.emit({id:r,options:t.options,origin:t,from:"runtime",error:h,lifecycle:"beforeRequest"}),!n)throw h}const{id:o}=n,s=Vi.matchRemoteWithNameAndExpose(t.options.remotes,o);s||Le.error(Jt.RUNTIME_004,Jt.runtimeDescMap,{hostName:t.options.name,requestId:o},void 0,Xi.optionsToMFContext(t.options));const{remote:i}=s,a=at.getRemoteInfo(i),c=await t.sharedHandler.hooks.lifecycle.afterResolve.emit({id:o,...s,options:t.options,origin:t,remoteInfo:a}),{remote:l,expose:u}=c;Le.assert(l&&u,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${o}.`);let d=t.moduleCache.get(l.name);const f={host:t,remoteInfo:a};return d||(d=new xi.Module(f),t.moduleCache.set(l.name,d)),{module:d,moduleOptions:f,remoteMatchInfo:c}}registerRemote(e,t,r){const{host:n}=this,o=()=>{if(e.alias){const i=t.find(a=>{var c;return e.alias&&(a.name.startsWith(e.alias)||((c=a.alias)==null?void 0:c.startsWith(e.alias)))});Le.assert(!i,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${i&&i.name} name or alias`)}"entry"in e&<.isBrowserEnvValue&&typeof window<"u"&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=Kt.DEFAULT_SCOPE),e.type||(e.type=Kt.DEFAULT_REMOTE_TYPE)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:n});const s=t.find(i=>i.name===e.name);if(!s)o(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:n});else{const i=[`The remote "${e.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];r!=null&&r.force&&(this.removeRemote(s),o(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:n}),(0,lt.warn)(i.join(" ")))}}removeRemote(e){var t;try{const{host:r}=this,{name:n}=e,o=r.options.remotes.findIndex(i=>i.name===n);o!==-1&&r.options.remotes.splice(o,1);const s=r.moduleCache.get(e.name);if(s){const i=s.remoteInfo,a=i.entryGlobalName;G.CurrentGlobal[a]&&((t=Object.getOwnPropertyDescriptor(G.CurrentGlobal,a))!=null&&t.configurable?delete G.CurrentGlobal[a]:G.CurrentGlobal[a]=void 0);const c=at.getRemoteEntryUniqueKey(s.remoteInfo);G.globalLoading[c]&&delete G.globalLoading[c],r.snapshotHandler.manifestCache.delete(i.entry);let l=i.buildVersion?(0,lt.composeKeyWithSeparator)(i.name,i.buildVersion):i.name;const u=G.CurrentGlobal.__FEDERATION__.__INSTANCES__.findIndex(f=>i.buildVersion?f.options.id===l:f.name===l);if(u!==-1){const f=G.CurrentGlobal.__FEDERATION__.__INSTANCES__[u];l=f.options.id||l;const h=ji.getGlobalShareScope();let m=!0;const _=[];Object.keys(h).forEach(g=>{const p=h[g];p&&Object.keys(p).forEach(E=>{const I=p[E];I&&Object.keys(I).forEach(k=>{const y=I[k];y&&Object.keys(y).forEach(N=>{const R=y[N];R&&typeof R=="object"&&R.from===i.name&&(R.loaded||R.loading?(R.useIn=R.useIn.filter(v=>v!==i.name),R.useIn.length?m=!1:_.push([g,E,k,N])):_.push([g,E,k,N]))})})})}),m&&(f.shareScopeMap={},delete h[l]),_.forEach(([g,p,E,I])=>{var k,y,N;(N=(y=(k=h[g])==null?void 0:k[p])==null?void 0:y[E])==null||delete N[I]}),G.CurrentGlobal.__FEDERATION__.__INSTANCES__.splice(u,1)}const{hostGlobalSnapshot:d}=Ji.getGlobalRemoteInfo(e,r);if(d){const f=d&&"remotesInfo"in d&&d.remotesInfo&&G.getInfoWithoutType(d.remotesInfo,e.name).key;f&&(delete d.remotesInfo[f],G.Global.__FEDERATION__.__MANIFEST_LOADING__[f]&&delete G.Global.__FEDERATION__.__MANIFEST_LOADING__[f])}r.moduleCache.delete(e.name)}}catch(r){Le.logger.error(`removeRemote failed: ${r instanceof Error?r.message:String(r)}`)}}};nn.RemoteHandler=Zi;const Qi=M,ea=oe,ta=q,ra=Vr,na=Xr,oa=K,sa=Xe,z=me,ct=ve,ia=_e,Zt=Ae,ut=Oe,aa=xe,la=Qr,ca=Ke,ua=rn,fa=nn;let da=D,ft=Y;const ha=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN=="boolean"?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0;var ma=class{constructor(e){this.hooks=new ut.PluginSystem({beforeInit:new ia.SyncWaterfallHook("beforeInit"),init:new z.SyncHook,beforeInitContainer:new Zt.AsyncWaterfallHook("beforeInitContainer"),initContainer:new Zt.AsyncWaterfallHook("initContainer")}),this.version="2.2.2",this.moduleCache=new Map,this.loaderHook=new ut.PluginSystem({getModuleInfo:new z.SyncHook,createScript:new z.SyncHook,createLink:new z.SyncHook,fetch:new ct.AsyncHook,loadEntryError:new ct.AsyncHook,getModuleFactory:new ct.AsyncHook}),this.bridgeHook=new ut.PluginSystem({beforeBridgeRender:new z.SyncHook,afterBridgeRender:new z.SyncHook,beforeBridgeDestroy:new z.SyncHook,afterBridgeDestroy:new z.SyncHook});const t=ha?[aa.snapshotPlugin(),la.generatePreloadAssetsPlugin()]:[],r={id:ra.getBuilderId(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:da.isBrowserEnvValue};this.name=e.name,this.options=r,this.snapshotHandler=new ca.SnapshotHandler(this),this.sharedHandler=new ua.SharedHandler(this),this.remoteHandler=new fa.RemoteHandler(this),this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...r.plugins,...e.plugins||[]]),this.options=this.formatOptions(r,e)}initOptions(e){e.name&&e.name!==this.options.name&&Qi.error((0,ft.getShortErrorMsg)(ft.RUNTIME_010,ft.runtimeDescMap)),this.registerPlugins(e.plugins);const t=this.formatOptions(this.options,e);return this.options=t,t}async loadShare(e,t){return this.sharedHandler.loadShare(e,t)}loadShareSync(e,t){return this.sharedHandler.loadShareSync(e,t)}initializeSharing(e=ea.DEFAULT_SCOPE,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,r){const n=oa.getRemoteInfo({name:e,entry:t}),o=new sa.Module({host:this,remoteInfo:n});return o.remoteEntryExports=r,this.moduleCache.set(e,o),o}async loadRemote(e,t){return this.remoteHandler.loadRemote(e,t)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,t,r={}){this.sharedHandler.initShareScopeMap(e,t,r)}formatOptions(e,t){const{allShareInfos:r}=ta.formatShareConfigs(e,t),{userOptions:n,options:o}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:r}),s=this.remoteHandler.formatAndRegisterRemote(o,n),{allShareInfos:i}=this.sharedHandler.registerShared(o,n),a=[...o.plugins];n.plugins&&n.plugins.forEach(l=>{a.includes(l)||a.push(l)});const c={...e,...t,plugins:a,remotes:s,shared:i};return this.hooks.lifecycle.init.emit({origin:this,options:c}),c}registerPlugins(e){const t=na.registerPlugins(e,this);this.options.plugins=this.options.plugins.reduce((r,n)=>(n&&r&&!r.find(o=>o.name===n.name)&&r.push(n),r),t||[])}registerRemotes(e,t){return this.remoteHandler.registerRemotes(e,t)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}};Yr.ModuleFederation=ma;var on={},sn={},Qt=Object.defineProperty,_a=(e,t)=>{let r={};for(var n in e)Qt(r,n,{get:e[n],enumerable:!0});return t||Qt(r,Symbol.toStringTag,{value:"Module"}),r};sn.__exportAll=_a;(function(e){var r=sn.__exportAll({});Object.defineProperty(e,"type_exports",{enumerable:!0,get:function(){return r}})})(on);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=M,r=$,n=b,o=Pt,s=q,i=he,a=K,c=xr,l=Xe,u=Yr,d=on;let f=D;const h=c.default;e.CurrentGlobal=n.CurrentGlobal,e.Global=n.Global,e.Module=l.Module,e.ModuleFederation=u.ModuleFederation,e.addGlobalSnapshot=n.addGlobalSnapshot,e.assert=t.assert,e.error=t.error,e.getGlobalFederationConstructor=n.getGlobalFederationConstructor,e.getGlobalSnapshot=n.getGlobalSnapshot,e.getInfoWithoutType=n.getInfoWithoutType,e.getRegisteredShare=s.getRegisteredShare,e.getRemoteEntry=a.getRemoteEntry,e.getRemoteInfo=a.getRemoteInfo,e.helpers=h,e.isStaticResourcesEqual=r.isStaticResourcesEqual,Object.defineProperty(e,"loadScript",{enumerable:!0,get:function(){return f.loadScript}}),Object.defineProperty(e,"loadScriptNode",{enumerable:!0,get:function(){return f.loadScriptNode}}),e.matchRemoteWithNameAndExpose=i.matchRemoteWithNameAndExpose,e.registerGlobalPlugins=n.registerGlobalPlugins,e.resetFederationGlobalInfo=n.resetFederationGlobalInfo,e.safeWrapper=r.safeWrapper,e.satisfy=o.satisfy,e.setGlobalFederationConstructor=n.setGlobalFederationConstructor,e.setGlobalFederationInstance=n.setGlobalFederationInstance,Object.defineProperty(e,"types",{enumerable:!0,get:function(){return d.type_exports}})})(Tt);let ga=Tt;function pa(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function ya(e,t){const r=pa();return ga.CurrentGlobal.__FEDERATION__.__INSTANCES__.find(n=>!!(r&&n.options.id===r||n.options.name===e&&!n.options.version&&!t||n.options.name===e&&t&&n.options.version===t))}ar.getGlobalFederationInstance=ya;(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ar;let r=Tt,n=Y;function o(_){const g=new((0,r.getGlobalFederationConstructor)()||r.ModuleFederation)(_);return(0,r.setGlobalFederationInstance)(g),g}let s=null;function i(_){const g=t.getGlobalFederationInstance(_.name,_.version);return g?(g.initOptions(_),s||(s=g),g):(s=o(_),s)}function a(..._){return(0,r.assert)(s,n.RUNTIME_009,n.runtimeDescMap),s.loadRemote.apply(s,_)}function c(..._){return(0,r.assert)(s,n.RUNTIME_009,n.runtimeDescMap),s.loadShare.apply(s,_)}function l(..._){return(0,r.assert)(s,n.RUNTIME_009,n.runtimeDescMap),s.loadShareSync.apply(s,_)}function u(..._){return(0,r.assert)(s,n.RUNTIME_009,n.runtimeDescMap),s.preloadRemote.apply(s,_)}function d(..._){return(0,r.assert)(s,n.RUNTIME_009,n.runtimeDescMap),s.registerRemotes.apply(s,_)}function f(..._){return(0,r.assert)(s,n.RUNTIME_009,n.runtimeDescMap),s.registerPlugins.apply(s,_)}function h(){return s}function m(..._){return(0,r.assert)(s,n.RUNTIME_009,n.runtimeDescMap),s.registerShared.apply(s,_)}(0,r.setGlobalFederationConstructor)(r.ModuleFederation),Object.defineProperty(e,"Module",{enumerable:!0,get:function(){return r.Module}}),e.ModuleFederation=r.ModuleFederation,e.createInstance=o,e.getInstance=h,Object.defineProperty(e,"getRemoteEntry",{enumerable:!0,get:function(){return r.getRemoteEntry}}),Object.defineProperty(e,"getRemoteInfo",{enumerable:!0,get:function(){return r.getRemoteInfo}}),e.init=i,e.loadRemote=a,Object.defineProperty(e,"loadScript",{enumerable:!0,get:function(){return r.loadScript}}),Object.defineProperty(e,"loadScriptNode",{enumerable:!0,get:function(){return r.loadScriptNode}}),e.loadShare=c,e.loadShareSync=l,e.preloadRemote=u,Object.defineProperty(e,"registerGlobalPlugins",{enumerable:!0,get:function(){return r.registerGlobalPlugins}}),e.registerPlugins=f,e.registerRemotes=d,e.registerShared=m})(ir);const an="__mf_init____mf__virtual/ConfigCustomJavascriptSet__mf_v__runtimeInit__mf_v__.js__";let Rt=globalThis[an];if(!Rt){let e,t;const r=new Promise((n,o)=>{e=n,t=o});Rt=globalThis[an]={initPromise:r,initResolve:e,initReject:t},typeof window>"u"&&e({loadRemote:function(){return Promise.resolve(void 0)},loadShare:function(){return Promise.resolve(void 0)}})}const Ea=Rt.initResolve,er={},tr="default",rr="ConfigCustomJavascriptSet";let nr,or;async function Sa(){return nr??=sr(()=>import("./localSharedImportMap-2Enh8EZe.js"),__vite__mapDeps([0,1]),import.meta.url),nr}async function ba(){return or??=sr(()=>import("./virtualExposes-CqrW7o8v.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.default??e),or}async function Ta(e={},t=[]){const{usedShared:r,usedRemotes:n}=await Sa(),o=ir.init({name:rr,remotes:n,shared:r,plugins:[],shareStrategy:"version-first"});var s=er[tr];if(s||(s=er[tr]={from:rr}),!(t.indexOf(s)>=0)){t.push(s),o.initShareScopeMap("default",e),Ea(o);try{await Promise.all(await o.initializeSharing("default",{strategy:"version-first",from:"build",initScope:t}))}catch(i){console.error(i)}return o}}async function Ia(e){const t=await ba();if(!(e in t))throw new Error(`Module ${e} does not exist in container.`);return t[e]().then(r=>()=>r)}export{ir as d,Ia as g,Ta as i}; + ${(0,mi.safeToString)(this.remoteInfo)}`),this.remoteEntryExports=e,this.remoteEntryExports}async init(e,t,r){const n=await this.getEntry();if(this.inited)return n;if(this.initPromise)return await this.initPromise,n;this.initing=!0,this.initPromise=(async()=>{const{remoteEntryInitOptions:o,shareScope:s,initScope:i}=_i(this.remoteInfo,this.host.shareScopeMap,r),a=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:s,remoteEntryInitOptions:o,initScope:i,remoteInfo:this.remoteInfo,origin:this.host});typeof(n==null?void 0:n.init)>"u"&&Ze.error(Ut.RUNTIME_002,Ut.runtimeDescMap,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,hi.optionsToMFContext(this.host.options)),await n.init(a.shareScope,a.initScope,a.remoteEntryInitOptions),await this.host.hooks.lifecycle.initContainer.emit({...a,id:e,remoteSnapshot:t,remoteEntryExports:n}),this.inited=!0})();try{await this.initPromise}finally{this.initing=!1,this.initPromise=void 0}return n}async get(e,t,r,n){const{loadFactory:o=!0}=r||{loadFactory:!0},s=await this.init(e,n);this.lib=s;let i;i=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:s,expose:t,moduleInfo:this.remoteInfo}),i||(i=await s.get(t)),Ze.assert(i,`${Gt.getFMId(this.remoteInfo)} remote don't export ${t}.`);const a=Gt.processModuleAlias(this.remoteInfo.name,t),c=this.wraperFactory(i,a);return o?await c():c}wraperFactory(e,t){function r(n,o){n&&typeof n=="object"&&Object.isExtensible(n)&&!Object.getOwnPropertyDescriptor(n,Symbol.for("mf_module_id"))&&Object.defineProperty(n,Symbol.for("mf_module_id"),{value:o,enumerable:!1})}return e instanceof Promise?async()=>{const n=await e();return r(n,t),n}:()=>{const n=e();return r(n,t),n}}};Xe.Module=gi;var Yr={},me={},pi=class{constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}on(e){typeof e=="function"&&this.listeners.add(e)}once(e){const t=this;this.on(function r(...n){return t.remove(r),e.apply(null,n)})}emit(...e){let t;return this.listeners.size>0&&this.listeners.forEach(r=>{t=r(...e)}),t}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}};me.SyncHook=pi;var ve={};const yi=me;var Ei=class extends yi.SyncHook{emit(...e){let t;const r=Array.from(this.listeners);if(r.length>0){let n=0;const o=s=>s===!1?!1:n0){let r=0;const n=s=>(et.warn(s),this.onerror(s),e),o=s=>{if(Ii.checkReturnData(e,s)){if(e=s,r{const s=e[o];s&&this.lifecycle[o].on(s)}))}removePlugin(e){we.assert(e,"A name is required.");const t=this.registerPlugins[e];we.assert(t,`The plugin "${e}" is not registered.`),Object.keys(t).forEach(r=>{r!=="name"&&this.lifecycle[r].remove(t[r])})}};Oe.PluginSystem=Mi;var xe={};const Pi=M,St=$,vi=Z;let Wt=D,Bt=Y;function Zr(e,t){const r=St.getRemoteEntryInfoFromSnapshot(t);r.url||Pi.error(Bt.RUNTIME_011,Bt.runtimeDescMap,{remoteName:e.name});let n=(0,Wt.getResourceUrl)(t,r.url);!Wt.isBrowserEnvValue&&!n.startsWith("http")&&(n=`https:${n}`),e.type=r.type,e.entryGlobalName=r.globalName,e.entry=n,e.version=t.version,e.buildVersion=t.buildVersion}function Ai(){return{name:"snapshot-plugin",async afterResolve(e){const{remote:t,pkgNameOrAlias:r,expose:n,origin:o,remoteInfo:s,id:i}=e;if(!St.isRemoteInfoWithEntry(t)||!St.isPureRemoteEntry(t)){const{remoteSnapshot:a,globalSnapshot:c}=await o.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:i});Zr(s,a);const l={remote:t,preloadConfig:{nameOrAlias:r,exposes:[n],resourceCategory:"sync",share:!1,depsRemote:!1}},u=await o.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:o,preloadOptions:l,remoteInfo:s,remote:t,remoteSnapshot:a,globalSnapshot:c});return u&&vi.preloadAssets(s,o,u,!1),{...e,remoteSnapshot:a}}return e}}}xe.assignRemoteInfo=Zr;xe.snapshotPlugin=Ai;var Qr={};const Ne=$,bt=b,Oi=q,jt=Z,ki=xe;let je=D;function wi(e){const t=e.split(":");return t.length===1?{name:t[0],version:void 0}:t.length===2?{name:t[0],version:t[1]}:{name:t[1],version:t[2]}}function en(e,t,r,n,o={},s){const{value:i}=bt.getInfoWithoutType(e,Ne.getFMId(t)),a=s||i;if(a&&!(0,je.isManifestProvider)(a)&&(r(a,t,n),a.remotesInfo)){const c=Object.keys(a.remotesInfo);for(const l of c){if(o[l])continue;o[l]=!0;const u=wi(l),d=a.remotesInfo[l];en(e,{name:u.name,version:d.matchedVersion},r,!1,o,void 0)}}}const tt=(e,t)=>document.querySelector(`${e}[${e==="link"?"href":"src"}="${t}"]`);function Fi(e,t,r,n,o){const s=[],i=[],a=[],c=new Set,l=new Set,{options:u}=e,{preloadConfig:d}=t,{depsRemote:f}=d;if(en(n,r,(m,_,g)=>{var N;let p;if(g)p=d;else if(Array.isArray(f)){const R=f.find(v=>v.nameOrAlias===_.name||v.nameOrAlias===_.alias);if(!R)return;p=jt.defaultPreloadArgs(R)}else if(f===!0)p=d;else return;const E=(0,je.getResourceUrl)(m,Ne.getRemoteEntryInfoFromSnapshot(m).url);E&&a.push({name:_.name,moduleInfo:{name:_.name,entry:E,type:"remoteEntryType"in m?m.remoteEntryType:"global",entryGlobalName:"globalName"in m?m.globalName:_.name,shareScope:"",version:"version"in m?m.version:void 0},url:E});let I="modules"in m?m.modules:[];const k=jt.normalizePreloadExposes(p.exposes);k.length&&"modules"in m&&(I=(N=m==null?void 0:m.modules)==null?void 0:N.reduce((R,v)=>((k==null?void 0:k.indexOf(v.moduleName))!==-1&&R.push(v),R),[]));function y(R){const v=R.map(B=>(0,je.getResourceUrl)(m,B));return p.filter?v.filter(p.filter):v}if(I){const R=I.length;for(let v=0;v0){const m=(_,g)=>{const{shared:p}=Oi.getRegisteredShare(e.shareScopeMap,g.sharedName,_,e.sharedHandler.hooks.lifecycle.resolveShare)||{};p&&typeof p.lib=="function"&&(g.assets.js.sync.forEach(E=>{c.add(E)}),g.assets.css.sync.forEach(E=>{l.add(E)}))};o.shared.forEach(_=>{var E;const g=(E=u.shared)==null?void 0:E[_.sharedName];if(!g)return;const p=_.version?g.find(I=>I.version===_.version):g;p&&Ne.arrayOptions(p).forEach(I=>{m(I,_)})})}const h=i.filter(m=>!c.has(m)&&!tt("script",m));return{cssAssets:s.filter(m=>!l.has(m)&&!tt("link",m)),jsAssetsWithoutEntry:h,entryAssets:a.filter(m=>!tt("script",m.url))}}const Li=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(e){const{origin:t,preloadOptions:r,remoteInfo:n,remote:o,globalSnapshot:s,remoteSnapshot:i}=e;return je.isBrowserEnvValue?Ne.isRemoteInfoWithEntry(o)&&Ne.isPureRemoteEntry(o)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:o.name,url:o.entry,moduleInfo:{name:n.name,entry:o.entry,type:n.type||"global",entryGlobalName:"",shareScope:""}}]}:(ki.assignRemoteInfo(n,i),Fi(t,r,n,s,i)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};Qr.generatePreloadAssetsPlugin=Li;var Ke={};const rt=M,Di=$,U=b,Vt=Pe,Hi=ve,nt=Ae,Ci=Oe;let ot=D,Fe=Y;function tn(e,t){const r=U.getGlobalSnapshotInfoByModuleInfo({name:t.name,version:t.options.version}),n=r&&"remotesInfo"in r&&r.remotesInfo&&U.getInfoWithoutType(r.remotesInfo,e.name).value;return n&&n.matchedVersion?{hostGlobalSnapshot:r,globalSnapshot:U.getGlobalSnapshot(),remoteSnapshot:U.getGlobalSnapshotInfoByModuleInfo({name:e.name,version:n.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:U.getGlobalSnapshot(),remoteSnapshot:U.getGlobalSnapshotInfoByModuleInfo({name:e.name,version:"version"in e?e.version:void 0})}}var qi=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new Ci.PluginSystem({beforeLoadRemoteSnapshot:new Hi.AsyncHook("beforeLoadRemoteSnapshot"),loadSnapshot:new nt.AsyncWaterfallHook("loadGlobalSnapshot"),loadRemoteSnapshot:new nt.AsyncWaterfallHook("loadRemoteSnapshot"),afterLoadSnapshot:new nt.AsyncWaterfallHook("afterLoadSnapshot")}),this.manifestLoading=U.Global.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:t,expose:r}){const{options:n}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:n,moduleInfo:e});let o=U.getGlobalSnapshotInfoByModuleInfo({name:this.HostInstance.options.name,version:this.HostInstance.options.version});o||(o={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},U.addGlobalSnapshot({[this.HostInstance.options.name]:o})),o&&"remotesInfo"in o&&!U.getInfoWithoutType(o.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(o.remotesInfo={...o==null?void 0:o.remotesInfo,[e.name]:{matchedVersion:"version"in e?e.version:e.entry}});const{hostGlobalSnapshot:s,remoteSnapshot:i,globalSnapshot:a}=this.getGlobalRemoteInfo(e),{remoteSnapshot:c,globalSnapshot:l}=await this.hooks.lifecycle.loadSnapshot.emit({options:n,moduleInfo:e,hostGlobalSnapshot:s,remoteSnapshot:i,globalSnapshot:a});let u,d;if(c)if((0,ot.isManifestProvider)(c)){const f=ot.isBrowserEnvValue?c.remoteEntry:c.ssrRemoteEntry||c.remoteEntry||"",h=await this.getManifestJson(f,e,{}),m=U.setGlobalSnapshotInfoByModuleInfo({...e,entry:f},h);u=h,d=m}else{const{remoteSnapshot:f}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:c,from:"global"});u=f,d=l}else if(Di.isRemoteInfoWithEntry(e)){const f=await this.getManifestJson(e.entry,e,{}),h=U.setGlobalSnapshotInfoByModuleInfo(e,f),{remoteSnapshot:m}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:f,from:"global"});u=m,d=h}else rt.error(Fe.RUNTIME_007,Fe.runtimeDescMap,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(l)},void 0,Vt.optionsToMFContext(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:t,host:this.HostInstance,options:n,moduleInfo:e,remoteSnapshot:u}),{remoteSnapshot:u,globalSnapshot:d}}getGlobalRemoteInfo(e){return tn(e,this.HostInstance)}async getManifestJson(e,t,r){const n=async()=>{let s=this.manifestCache.get(e);if(s)return s;try{let i=await this.loaderHook.lifecycle.fetch.emit(e,{});(!i||!(i instanceof Response))&&(i=await fetch(e,{})),s=await i.json()}catch(i){s=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:i,from:"runtime",lifecycle:"afterResolve",origin:this.HostInstance}),s||(delete this.manifestLoading[e],rt.error(Fe.RUNTIME_003,Fe.runtimeDescMap,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${i}`,Vt.optionsToMFContext(this.HostInstance.options)))}return rt.assert(s.metaData&&s.exposes&&s.shared,`"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${[!s.metaData&&"metaData",!s.exposes&&"exposes",!s.shared&&"shared"].filter(Boolean).join(", ")}.`),this.manifestCache.set(e,s),s},o=async()=>{const s=await n(),i=(0,ot.generateSnapshotFromManifest)(s,{version:e}),{remoteSnapshot:a}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:t,manifestJson:s,remoteSnapshot:i,manifestUrl:e,from:"manifest"});return a};return this.manifestLoading[e]||(this.manifestLoading[e]=o().then(s=>s)),this.manifestLoading[e]}};Ke.SnapshotHandler=qi;Ke.getGlobalRemoteInfo=tn;var rn={};const st=M,Gi=oe,A=q,Xt=Pe,Ui=ve,it=_e,xt=Ae,Wi=Oe;let pe=Y;var Bi=class{constructor(e){this.hooks=new Wi.PluginSystem({beforeRegisterShare:new it.SyncWaterfallHook("beforeRegisterShare"),afterResolve:new xt.AsyncWaterfallHook("afterResolve"),beforeLoadShare:new xt.AsyncWaterfallHook("beforeLoadShare"),loadShare:new Ui.AsyncHook,resolveShare:new it.SyncWaterfallHook("resolveShare"),initContainerShareScopeMap:new it.SyncWaterfallHook("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}registerShared(e,t){const{newShareInfos:r,allShareInfos:n}=A.formatShareConfigs(e,t);return Object.keys(r).forEach(o=>{r[o].forEach(s=>{s.scope.forEach(i=>{var a;this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:o,shared:s}),(a=this.shareScopeMap[i])!=null&&a[o]||this.setShared({pkgName:o,lib:s.lib,get:s.get,loaded:s.loaded||!!s.lib,shared:s,from:t.name})})})}),{newShareInfos:r,allShareInfos:n}}async loadShare(e,t){const{host:r}=this,n=A.getTargetSharedOptions({pkgName:e,extraOptions:t,shareInfos:r.options.shared});n!=null&&n.scope&&await Promise.all(n.scope.map(async a=>{await Promise.all(this.initializeSharing(a,{strategy:n.strategy}))}));const{shareInfo:o}=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:n,shared:r.options.shared,origin:r});st.assert(o,`Cannot find shared "${e}" in host "${r.options.name}". Ensure the shared config for "${e}" is declared in the federation plugin options and the host has been initialized before loading shares.`);const{shared:s,useTreesShaking:i}=A.getRegisteredShare(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare)||{};if(s){const a=A.directShare(s,i);if(a.lib)return A.addUseIn(a,r.options.name),a.lib;if(a.loading&&!a.loaded){const c=await a.loading;return a.loaded=!0,a.lib||(a.lib=c),A.addUseIn(a,r.options.name),c}else{const l=(async()=>{const u=await a.get();return A.addUseIn(a,r.options.name),a.loaded=!0,a.lib=u,u})();return this.setShared({pkgName:e,loaded:!1,shared:s,from:r.options.name,lib:null,loading:l,treeShaking:i?a:void 0}),l}}else{if(t!=null&&t.customShareInfo)return!1;const a=A.shouldUseTreeShaking(o.treeShaking),c=A.directShare(o,a),u=(async()=>{const d=await c.get();c.lib=d,c.loaded=!0,A.addUseIn(c,r.options.name);const{shared:f,useTreesShaking:h}=A.getRegisteredShare(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare)||{};if(f){const m=A.directShare(f,h);m.lib=d,m.loaded=!0,f.from=o.from}return d})();return this.setShared({pkgName:e,loaded:!1,shared:o,from:r.options.name,lib:null,loading:u,treeShaking:a?c:void 0}),u}}initializeSharing(e=Gi.DEFAULT_SCOPE,t){const{host:r}=this,n=t==null?void 0:t.from,o=t==null?void 0:t.strategy;let s=t==null?void 0:t.initScope;const i=[];if(n!=="build"){const{initTokens:f}=this;s||(s=[]);let h=f[e];if(h||(h=f[e]={from:this.host.name}),s.indexOf(h)>=0)return i;s.push(h)}const a=this.shareScopeMap,c=r.options.name;a[e]||(a[e]={});const l=a[e],u=(f,h)=>{var I;const{version:m,eager:_}=h;l[f]=l[f]||{};const g=l[f],p=g[m]&&A.directShare(g[m]),E=!!(p&&("eager"in p&&p.eager||"shareConfig"in p&&((I=p.shareConfig)!=null&&I.eager)));(!p||p.strategy!=="loaded-first"&&!p.loaded&&(!_!=!E?_:c>g[m].from))&&(g[m]=h)},d=async f=>{const{module:h}=await r.remoteHandler.getRemoteModuleAndOptions({id:f});let m;try{m=await h.getEntry()}catch(_){if(m=await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:f,error:_,from:"runtime",lifecycle:"beforeLoadShare",origin:r}),!m)return}finally{m!=null&&m.init&&!h.initing&&(h.remoteEntryExports=m,await h.init(void 0,void 0,s))}};return Object.keys(r.options.shared).forEach(f=>{r.options.shared[f].forEach(h=>{h.scope.includes(e)&&u(f,h)})}),(r.options.shareStrategy==="version-first"||o==="version-first")&&r.options.remotes.forEach(f=>{f.shareScope===e&&i.push(d(f.name))}),i}loadShareSync(e,t){const{host:r}=this,n=A.getTargetSharedOptions({pkgName:e,extraOptions:t,shareInfos:r.options.shared});n!=null&&n.scope&&n.scope.forEach(i=>{this.initializeSharing(i,{strategy:n.strategy})});const{shared:o,useTreesShaking:s}=A.getRegisteredShare(this.shareScopeMap,e,n,this.hooks.lifecycle.resolveShare)||{};if(o){if(typeof o.lib=="function")return A.addUseIn(o,r.options.name),o.loaded||(o.loaded=!0,o.from===r.options.name&&(n.loaded=!0)),o.lib;if(typeof o.get=="function"){const i=o.get();if(!(i instanceof Promise))return A.addUseIn(o,r.options.name),this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:i,shared:o}),i}}if(n.lib)return n.loaded||(n.loaded=!0),n.lib;if(n.get){const i=n.get();return i instanceof Promise&&st.error((t==null?void 0:t.from)==="build"?pe.RUNTIME_005:pe.RUNTIME_006,pe.runtimeDescMap,{hostName:r.options.name,sharedPkgName:e},void 0,Xt.optionsToMFContext(r.options)),n.lib=i,this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:n.lib,shared:n}),n.lib}st.error(pe.RUNTIME_006,pe.runtimeDescMap,{hostName:r.options.name,sharedPkgName:e},void 0,Xt.optionsToMFContext(r.options))}initShareScopeMap(e,t,r={}){const{host:n}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:n.options,origin:n,scopeName:e,hostShareScopeMap:r.hostShareScopeMap})}setShared({pkgName:e,shared:t,from:r,lib:n,loading:o,loaded:s,get:i,treeShaking:a}){const{version:c,scope:l="default",...u}=t,d=Array.isArray(l)?l:[l],f=h=>{const m=(g,p,E)=>{E&&!g[p]&&(g[p]=E)},_=a?h.treeShaking:h;m(_,"loaded",s),m(_,"loading",o),m(_,"get",i)};d.forEach(h=>{this.shareScopeMap[h]||(this.shareScopeMap[h]={}),this.shareScopeMap[h][e]||(this.shareScopeMap[h][e]={}),this.shareScopeMap[h][e][c]||(this.shareScopeMap[h][e][c]={version:c,scope:[h],...u,lib:n});const m=this.shareScopeMap[h][e][c];f(m),r&&m.from!==r&&(m.from=r)})}_setGlobalShareScopeMap(e){const t=A.getGlobalShareScope(),r=e.id||e.name;r&&!t[r]&&(t[r]=this.shareScopeMap)}};rn.SharedHandler=Bi;var nn={};const Le=M,G=b,Kt=oe,ji=q,Vi=he,at=K,Xi=Pe,Yt=Z,xi=Xe,Ki=me,ie=ve,zt=_e,Yi=Ae,zi=Oe,Ji=Ke;let lt=D,Jt=Y;var Zi=class{constructor(e){this.hooks=new zi.PluginSystem({beforeRegisterRemote:new zt.SyncWaterfallHook("beforeRegisterRemote"),registerRemote:new zt.SyncWaterfallHook("registerRemote"),beforeRequest:new Yi.AsyncWaterfallHook("beforeRequest"),onLoad:new ie.AsyncHook("onLoad"),handlePreloadModule:new Ki.SyncHook("handlePreloadModule"),errorLoadRemote:new ie.AsyncHook("errorLoadRemote"),beforePreloadRemote:new ie.AsyncHook("beforePreloadRemote"),generatePreloadAssets:new ie.AsyncHook("generatePreloadAssets"),afterPreloadRemote:new ie.AsyncHook,loadEntry:new ie.AsyncHook}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce((r,n)=>(this.registerRemote(n,r,{force:!1}),r),e.remotes)}setIdToRemoteMap(e,t){const{remote:r,expose:n}=t,{name:o,alias:s}=r;if(this.idToRemoteMap[e]={name:r.name,expose:n},s&&e.startsWith(o)){const i=e.replace(o,s);this.idToRemoteMap[i]={name:r.name,expose:n};return}if(s&&e.startsWith(s)){const i=e.replace(s,o);this.idToRemoteMap[i]={name:r.name,expose:n}}}async loadRemote(e,t){const{host:r}=this;try{const{loadFactory:n=!0}=t||{loadFactory:!0},{module:o,moduleOptions:s,remoteMatchInfo:i}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:a,remote:c,expose:l,id:u,remoteSnapshot:d}=i,f=await o.get(u,l,t,d),h=await this.hooks.lifecycle.onLoad.emit({id:u,pkgNameOrAlias:a,expose:l,exposeModule:n?f:void 0,exposeModuleFactory:n?void 0:f,remote:c,options:s,moduleInstance:o,origin:r});return this.setIdToRemoteMap(e,i),typeof h=="function"?h:f}catch(n){const{from:o="runtime"}=t||{from:"runtime"},s=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:n,from:o,lifecycle:"onLoad",origin:r});if(!s)throw n;return s}}async preloadRemote(e){const{host:t}=this;await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});const r=Yt.formatPreloadArgs(t.options.remotes,e);await Promise.all(r.map(async n=>{const{remote:o}=n,s=at.getRemoteInfo(o),{globalSnapshot:i,remoteSnapshot:a}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:o}),c=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:n,remote:o,remoteInfo:s,globalSnapshot:i,remoteSnapshot:a});c&&Yt.preloadAssets(s,t,c)}))}registerRemotes(e,t){const{host:r}=this;e.forEach(n=>{this.registerRemote(n,r.options.remotes,{force:t==null?void 0:t.force})})}async getRemoteModuleAndOptions(e){const{host:t}=this,{id:r}=e;let n;try{n=await this.hooks.lifecycle.beforeRequest.emit({id:r,options:t.options,origin:t})}catch(h){if(n=await this.hooks.lifecycle.errorLoadRemote.emit({id:r,options:t.options,origin:t,from:"runtime",error:h,lifecycle:"beforeRequest"}),!n)throw h}const{id:o}=n,s=Vi.matchRemoteWithNameAndExpose(t.options.remotes,o);s||Le.error(Jt.RUNTIME_004,Jt.runtimeDescMap,{hostName:t.options.name,requestId:o},void 0,Xi.optionsToMFContext(t.options));const{remote:i}=s,a=at.getRemoteInfo(i),c=await t.sharedHandler.hooks.lifecycle.afterResolve.emit({id:o,...s,options:t.options,origin:t,remoteInfo:a}),{remote:l,expose:u}=c;Le.assert(l&&u,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${o}.`);let d=t.moduleCache.get(l.name);const f={host:t,remoteInfo:a};return d||(d=new xi.Module(f),t.moduleCache.set(l.name,d)),{module:d,moduleOptions:f,remoteMatchInfo:c}}registerRemote(e,t,r){const{host:n}=this,o=()=>{if(e.alias){const i=t.find(a=>{var c;return e.alias&&(a.name.startsWith(e.alias)||((c=a.alias)==null?void 0:c.startsWith(e.alias)))});Le.assert(!i,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${i&&i.name} name or alias`)}"entry"in e&<.isBrowserEnvValue&&typeof window<"u"&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=Kt.DEFAULT_SCOPE),e.type||(e.type=Kt.DEFAULT_REMOTE_TYPE)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:n});const s=t.find(i=>i.name===e.name);if(!s)o(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:n});else{const i=[`The remote "${e.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];r!=null&&r.force&&(this.removeRemote(s),o(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:n}),(0,lt.warn)(i.join(" ")))}}removeRemote(e){var t;try{const{host:r}=this,{name:n}=e,o=r.options.remotes.findIndex(i=>i.name===n);o!==-1&&r.options.remotes.splice(o,1);const s=r.moduleCache.get(e.name);if(s){const i=s.remoteInfo,a=i.entryGlobalName;G.CurrentGlobal[a]&&((t=Object.getOwnPropertyDescriptor(G.CurrentGlobal,a))!=null&&t.configurable?delete G.CurrentGlobal[a]:G.CurrentGlobal[a]=void 0);const c=at.getRemoteEntryUniqueKey(s.remoteInfo);G.globalLoading[c]&&delete G.globalLoading[c],r.snapshotHandler.manifestCache.delete(i.entry);let l=i.buildVersion?(0,lt.composeKeyWithSeparator)(i.name,i.buildVersion):i.name;const u=G.CurrentGlobal.__FEDERATION__.__INSTANCES__.findIndex(f=>i.buildVersion?f.options.id===l:f.name===l);if(u!==-1){const f=G.CurrentGlobal.__FEDERATION__.__INSTANCES__[u];l=f.options.id||l;const h=ji.getGlobalShareScope();let m=!0;const _=[];Object.keys(h).forEach(g=>{const p=h[g];p&&Object.keys(p).forEach(E=>{const I=p[E];I&&Object.keys(I).forEach(k=>{const y=I[k];y&&Object.keys(y).forEach(N=>{const R=y[N];R&&typeof R=="object"&&R.from===i.name&&(R.loaded||R.loading?(R.useIn=R.useIn.filter(v=>v!==i.name),R.useIn.length?m=!1:_.push([g,E,k,N])):_.push([g,E,k,N]))})})})}),m&&(f.shareScopeMap={},delete h[l]),_.forEach(([g,p,E,I])=>{var k,y,N;(N=(y=(k=h[g])==null?void 0:k[p])==null?void 0:y[E])==null||delete N[I]}),G.CurrentGlobal.__FEDERATION__.__INSTANCES__.splice(u,1)}const{hostGlobalSnapshot:d}=Ji.getGlobalRemoteInfo(e,r);if(d){const f=d&&"remotesInfo"in d&&d.remotesInfo&&G.getInfoWithoutType(d.remotesInfo,e.name).key;f&&(delete d.remotesInfo[f],G.Global.__FEDERATION__.__MANIFEST_LOADING__[f]&&delete G.Global.__FEDERATION__.__MANIFEST_LOADING__[f])}r.moduleCache.delete(e.name)}}catch(r){Le.logger.error(`removeRemote failed: ${r instanceof Error?r.message:String(r)}`)}}};nn.RemoteHandler=Zi;const Qi=M,ea=oe,ta=q,ra=Vr,na=Xr,oa=K,sa=Xe,z=me,ct=ve,ia=_e,Zt=Ae,ut=Oe,aa=xe,la=Qr,ca=Ke,ua=rn,fa=nn;let da=D,ft=Y;const ha=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN=="boolean"?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0;var ma=class{constructor(e){this.hooks=new ut.PluginSystem({beforeInit:new ia.SyncWaterfallHook("beforeInit"),init:new z.SyncHook,beforeInitContainer:new Zt.AsyncWaterfallHook("beforeInitContainer"),initContainer:new Zt.AsyncWaterfallHook("initContainer")}),this.version="2.2.2",this.moduleCache=new Map,this.loaderHook=new ut.PluginSystem({getModuleInfo:new z.SyncHook,createScript:new z.SyncHook,createLink:new z.SyncHook,fetch:new ct.AsyncHook,loadEntryError:new ct.AsyncHook,getModuleFactory:new ct.AsyncHook}),this.bridgeHook=new ut.PluginSystem({beforeBridgeRender:new z.SyncHook,afterBridgeRender:new z.SyncHook,beforeBridgeDestroy:new z.SyncHook,afterBridgeDestroy:new z.SyncHook});const t=ha?[aa.snapshotPlugin(),la.generatePreloadAssetsPlugin()]:[],r={id:ra.getBuilderId(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:da.isBrowserEnvValue};this.name=e.name,this.options=r,this.snapshotHandler=new ca.SnapshotHandler(this),this.sharedHandler=new ua.SharedHandler(this),this.remoteHandler=new fa.RemoteHandler(this),this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...r.plugins,...e.plugins||[]]),this.options=this.formatOptions(r,e)}initOptions(e){e.name&&e.name!==this.options.name&&Qi.error((0,ft.getShortErrorMsg)(ft.RUNTIME_010,ft.runtimeDescMap)),this.registerPlugins(e.plugins);const t=this.formatOptions(this.options,e);return this.options=t,t}async loadShare(e,t){return this.sharedHandler.loadShare(e,t)}loadShareSync(e,t){return this.sharedHandler.loadShareSync(e,t)}initializeSharing(e=ea.DEFAULT_SCOPE,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,r){const n=oa.getRemoteInfo({name:e,entry:t}),o=new sa.Module({host:this,remoteInfo:n});return o.remoteEntryExports=r,this.moduleCache.set(e,o),o}async loadRemote(e,t){return this.remoteHandler.loadRemote(e,t)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,t,r={}){this.sharedHandler.initShareScopeMap(e,t,r)}formatOptions(e,t){const{allShareInfos:r}=ta.formatShareConfigs(e,t),{userOptions:n,options:o}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:r}),s=this.remoteHandler.formatAndRegisterRemote(o,n),{allShareInfos:i}=this.sharedHandler.registerShared(o,n),a=[...o.plugins];n.plugins&&n.plugins.forEach(l=>{a.includes(l)||a.push(l)});const c={...e,...t,plugins:a,remotes:s,shared:i};return this.hooks.lifecycle.init.emit({origin:this,options:c}),c}registerPlugins(e){const t=na.registerPlugins(e,this);this.options.plugins=this.options.plugins.reduce((r,n)=>(n&&r&&!r.find(o=>o.name===n.name)&&r.push(n),r),t||[])}registerRemotes(e,t){return this.remoteHandler.registerRemotes(e,t)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}};Yr.ModuleFederation=ma;var on={},sn={},Qt=Object.defineProperty,_a=(e,t)=>{let r={};for(var n in e)Qt(r,n,{get:e[n],enumerable:!0});return t||Qt(r,Symbol.toStringTag,{value:"Module"}),r};sn.__exportAll=_a;(function(e){var r=sn.__exportAll({});Object.defineProperty(e,"type_exports",{enumerable:!0,get:function(){return r}})})(on);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=M,r=$,n=b,o=Pt,s=q,i=he,a=K,c=xr,l=Xe,u=Yr,d=on;let f=D;const h=c.default;e.CurrentGlobal=n.CurrentGlobal,e.Global=n.Global,e.Module=l.Module,e.ModuleFederation=u.ModuleFederation,e.addGlobalSnapshot=n.addGlobalSnapshot,e.assert=t.assert,e.error=t.error,e.getGlobalFederationConstructor=n.getGlobalFederationConstructor,e.getGlobalSnapshot=n.getGlobalSnapshot,e.getInfoWithoutType=n.getInfoWithoutType,e.getRegisteredShare=s.getRegisteredShare,e.getRemoteEntry=a.getRemoteEntry,e.getRemoteInfo=a.getRemoteInfo,e.helpers=h,e.isStaticResourcesEqual=r.isStaticResourcesEqual,Object.defineProperty(e,"loadScript",{enumerable:!0,get:function(){return f.loadScript}}),Object.defineProperty(e,"loadScriptNode",{enumerable:!0,get:function(){return f.loadScriptNode}}),e.matchRemoteWithNameAndExpose=i.matchRemoteWithNameAndExpose,e.registerGlobalPlugins=n.registerGlobalPlugins,e.resetFederationGlobalInfo=n.resetFederationGlobalInfo,e.safeWrapper=r.safeWrapper,e.satisfy=o.satisfy,e.setGlobalFederationConstructor=n.setGlobalFederationConstructor,e.setGlobalFederationInstance=n.setGlobalFederationInstance,Object.defineProperty(e,"types",{enumerable:!0,get:function(){return d.type_exports}})})(Tt);let ga=Tt;function pa(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function ya(e,t){const r=pa();return ga.CurrentGlobal.__FEDERATION__.__INSTANCES__.find(n=>!!(r&&n.options.id===r||n.options.name===e&&!n.options.version&&!t||n.options.name===e&&t&&n.options.version===t))}ar.getGlobalFederationInstance=ya;(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ar;let r=Tt,n=Y;function o(_){const g=new((0,r.getGlobalFederationConstructor)()||r.ModuleFederation)(_);return(0,r.setGlobalFederationInstance)(g),g}let s=null;function i(_){const g=t.getGlobalFederationInstance(_.name,_.version);return g?(g.initOptions(_),s||(s=g),g):(s=o(_),s)}function a(..._){return(0,r.assert)(s,n.RUNTIME_009,n.runtimeDescMap),s.loadRemote.apply(s,_)}function c(..._){return(0,r.assert)(s,n.RUNTIME_009,n.runtimeDescMap),s.loadShare.apply(s,_)}function l(..._){return(0,r.assert)(s,n.RUNTIME_009,n.runtimeDescMap),s.loadShareSync.apply(s,_)}function u(..._){return(0,r.assert)(s,n.RUNTIME_009,n.runtimeDescMap),s.preloadRemote.apply(s,_)}function d(..._){return(0,r.assert)(s,n.RUNTIME_009,n.runtimeDescMap),s.registerRemotes.apply(s,_)}function f(..._){return(0,r.assert)(s,n.RUNTIME_009,n.runtimeDescMap),s.registerPlugins.apply(s,_)}function h(){return s}function m(..._){return(0,r.assert)(s,n.RUNTIME_009,n.runtimeDescMap),s.registerShared.apply(s,_)}(0,r.setGlobalFederationConstructor)(r.ModuleFederation),Object.defineProperty(e,"Module",{enumerable:!0,get:function(){return r.Module}}),e.ModuleFederation=r.ModuleFederation,e.createInstance=o,e.getInstance=h,Object.defineProperty(e,"getRemoteEntry",{enumerable:!0,get:function(){return r.getRemoteEntry}}),Object.defineProperty(e,"getRemoteInfo",{enumerable:!0,get:function(){return r.getRemoteInfo}}),e.init=i,e.loadRemote=a,Object.defineProperty(e,"loadScript",{enumerable:!0,get:function(){return r.loadScript}}),Object.defineProperty(e,"loadScriptNode",{enumerable:!0,get:function(){return r.loadScriptNode}}),e.loadShare=c,e.loadShareSync=l,e.preloadRemote=u,Object.defineProperty(e,"registerGlobalPlugins",{enumerable:!0,get:function(){return r.registerGlobalPlugins}}),e.registerPlugins=f,e.registerRemotes=d,e.registerShared=m})(ir);const an="__mf_init____mf__virtual/ConfigCustomJavascriptSet__mf_v__runtimeInit__mf_v__.js__";let Rt=globalThis[an];if(!Rt){let e,t;const r=new Promise((n,o)=>{e=n,t=o});Rt=globalThis[an]={initPromise:r,initResolve:e,initReject:t},typeof window>"u"&&e({loadRemote:function(){return Promise.resolve(void 0)},loadShare:function(){return Promise.resolve(void 0)}})}const Ea=Rt.initResolve,er={},tr="default",rr="ConfigCustomJavascriptSet";let nr,or;async function Sa(){return nr??=sr(()=>import("./localSharedImportMap-DS3qfiqR.js"),__vite__mapDeps([0,1]),import.meta.url),nr}async function ba(){return or??=sr(()=>import("./virtualExposes-jSvr-kK3.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.default??e),or}async function Ta(e={},t=[]){const{usedShared:r,usedRemotes:n}=await Sa(),o=ir.init({name:rr,remotes:n,shared:r,plugins:[],shareStrategy:"version-first"});var s=er[tr];if(s||(s=er[tr]={from:rr}),!(t.indexOf(s)>=0)){t.push(s),o.initShareScopeMap("default",e),Ea(o);try{await Promise.all(await o.initializeSharing("default",{strategy:"version-first",from:"build",initScope:t}))}catch(i){console.error(i)}return o}}async function Ia(e){const t=await ba();if(!(e in t))throw new Error(`Module ${e} does not exist in container.`);return t[e]().then(r=>()=>r)}export{ir as d,Ia as g,Ta as i}; diff --git a/admin/custom/customComponents.js b/admin/custom/customComponents.js index 83f7dd882..9bb011093 100644 --- a/admin/custom/customComponents.js +++ b/admin/custom/customComponents.js @@ -1 +1 @@ -import"./assets/preload-helper-BDBacUwf.js";import{g as r,i as a}from"./assets/virtual_mf-REMOTE_ENTRY_ID_ConfigCustomJavascriptSet__customComponents_js-BZZsMeVW.js";export{r as get,a as init}; +import"./assets/preload-helper-BDBacUwf.js";import{g as r,i as a}from"./assets/virtual_mf-REMOTE_ENTRY_ID_ConfigCustomJavascriptSet__customComponents_js-BfZkrlkY.js";export{r as get,a as init}; diff --git a/admin/tab.html b/admin/tab.html index 480af2523..40e6d386e 100644 --- a/admin/tab.html +++ b/admin/tab.html @@ -115,7 +115,7 @@ type="text/javascript" src="google-blockly/own/blocks_object.js" > - + diff --git a/src-admin/src/Components/Map.tsx b/src-admin/src/Components/Map.tsx index 7a7453435..a504f2dd9 100644 --- a/src-admin/src/Components/Map.tsx +++ b/src-admin/src/Components/Map.tsx @@ -8,7 +8,12 @@ import markerRetinaIcon from 'leaflet/dist/images/marker-icon-2x.png'; function MyMapComponent(props: { addMap: (map: LeafletMap) => void }): null { const map = useMap(); - props.addMap?.(map); + // Use a ref-like pattern to only call addMap once per map instance + const mapRef = React.useRef(null); + if (mapRef.current !== map) { + mapRef.current = map; + props.addMap?.(map); + } return null; } @@ -27,12 +32,15 @@ interface MapState { height: number; } +let mapKeyCounter = 0; + class Map extends Component { divRef: React.RefObject; marker: Marker | null; map?: LeafletMap; latLongTimer?: ReturnType | null; resizeTimer?: ReturnType | null; + mapKey: number; constructor(props: MapProps) { super(props); @@ -45,6 +53,8 @@ class Map extends Component { }; this.divRef = React.createRef(); this.marker = null; + mapKeyCounter++; + this.mapKey = mapKeyCounter; } onMap = (map: LeafletMap): void => { @@ -126,10 +136,9 @@ class Map extends Component { this.marker.remove(); this.marker = null; } - if (this.map) { - this.map.remove(); - this.map = undefined; - } + // Do not call this.map.remove() here — react-leaflet's MapContainer + // manages the Leaflet map lifecycle and will clean it up on unmount. + this.map = undefined; } onMarkerDragend = (evt: DragEndEvent): void => { @@ -158,6 +167,7 @@ class Map extends Component { > {this.state.width && this.state.height ? ( Date: Sun, 22 Mar 2026 11:20:47 +0100 Subject: [PATCH 7/7] Fixing build --- package-lock.json | 20289 ++++++++++++++++++++++---------------------- package.json | 229 +- 2 files changed, 10148 insertions(+), 10370 deletions(-) diff --git a/package-lock.json b/package-lock.json index 733c0e55f..ff61c25ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,10260 +1,10037 @@ { - "name": "iobroker.javascript", - "version": "9.1.1", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "iobroker.javascript", - "version": "9.1.1", - "license": "MIT", - "dependencies": { - "@iobroker/adapter-core": "^3.3.2", - "@iobroker/types": "^7.1.0", - "@types/node": "^25.5.0", - "axios": "^1.13.6", - "jsonata": "^2.1.0", - "jszip": "^3.10.1", - "node-inspect": "^2.0.0", - "node-schedule": "2.1.1", - "prettier": "^3.8.1", - "promisify-child-process": "^5.0.1", - "semver": "^7.7.4", - "suncalc2": "^1.8.1", - "typescript": "~5.9.3", - "virtual-tsc": "^0.6.2", - "wake_on_lan": "^1.0.0" - }, - "devDependencies": { - "@alcalzone/release-script": "^5.1.1", - "@alcalzone/release-script-plugin-iobroker": "^5.1.2", - "@alcalzone/release-script-plugin-license": "^5.1.1", - "@iobroker/adapter-dev": "^1.5.0", - "@iobroker/build-tools": "^3.0.1", - "@iobroker/eslint-config": "^2.2.0", - "@iobroker/plugin-sentry": "^3.0.4", - "@iobroker/testing": "^5.2.2", - "@iobroker/vis-2-widgets-react-dev": "^4.0.4", - "@types/node-schedule": "^2.1.8", - "@types/nodemailer": "^7.0.11", - "@types/request": "^2.48.13", - "@types/suncalc": "^1.9.2", - "alcalzone-shared": "^5.0.0", - "timekeeper": "^2.3.1" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@alcalzone/esbuild-register": { - "version": "2.5.1-1", - "resolved": "https://registry.npmjs.org/@alcalzone/esbuild-register/-/esbuild-register-2.5.1-1.tgz", - "integrity": "sha512-u19/K/ZaiWQhYIQZeF2FImUeJDiMD4i2h7qPdU0HVFCxoQynye59N4oy6EvjxeXaxLnGkppcb5KKeiYD4cT1iQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "esbuild": "^0.11.5", - "jsonc-parser": "^3.0.0" - } - }, - "node_modules/@alcalzone/esbuild-register/node_modules/esbuild": { - "version": "0.11.23", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.11.23.tgz", - "integrity": "sha512-iaiZZ9vUF5wJV8ob1tl+5aJTrwDczlvGP0JoMmnpC2B0ppiMCu8n8gmy5ZTGl5bcG081XBVn+U+jP+mPFm5T5Q==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - } - }, - "node_modules/@alcalzone/pak": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@alcalzone/pak/-/pak-0.12.0.tgz", - "integrity": "sha512-9r0zM5JAVTuPma1M/nMXiIlihQ07bWnxiYdqQrRsqFcWfm/p2hATbMtDMBXonkKZZGuOQxEMzTk7kpzGgnEJEQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ky": "^1.14.3", - "nano-spawn": "^2.0.0", - "semver": "^7.7.4", - "tiny-glob": "^0.2.9" - }, - "engines": { - "node": ">= 20" - } - }, - "node_modules/@alcalzone/release-script": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@alcalzone/release-script/-/release-script-5.1.1.tgz", - "integrity": "sha512-AndvNEfl6QWRcg6zSlBWiqyiceRPdmveO0WO+KC8eo+WMwhlflbl52ojwH53RE7UcoQLudjkz5PXlfBFl3E+Fg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@alcalzone/release-script-core": "5.1.1", - "@alcalzone/release-script-plugin-changelog": "5.1.1", - "@alcalzone/release-script-plugin-exec": "5.1.1", - "@alcalzone/release-script-plugin-git": "5.1.1", - "@alcalzone/release-script-plugin-package": "5.1.1", - "@alcalzone/release-script-plugin-version": "5.1.1", - "alcalzone-shared": "^5.0.0", - "enquirer": "^2.3.6", - "picocolors": "1.0.0", - "semver": "^7.7.2", - "source-map-support": "^0.5.21", - "yargs": "^17.4.1" - }, - "bin": { - "release-script": "bin/release.js" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@alcalzone/release-script-core": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@alcalzone/release-script-core/-/release-script-core-5.1.1.tgz", - "integrity": "sha512-aN+mmuHQ3h/K9+RBWCUl4/NF/O/kGIa6GhrlK5pposZ5FTSEitzE0wT4yHbtXRWfnfHwDajvOTWYHm9e3RnI0Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "execa": "^5.1.1" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@alcalzone/release-script-plugin-changelog": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-changelog/-/release-script-plugin-changelog-5.1.1.tgz", - "integrity": "sha512-AkdrtZUFYiJqFqGjhqbsIl6RFxmA8R2yvodtrAPZ2tXLeGGocSJp4o4KT+zcCttMsYQ5tNMSLIl1Dtfgy6twog==", - "dev": true, - "license": "MIT", - "dependencies": { - "@alcalzone/release-script-core": "5.1.1", - "alcalzone-shared": "^5.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@alcalzone/release-script-plugin-exec": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-exec/-/release-script-plugin-exec-5.1.1.tgz", - "integrity": "sha512-o3TaxXFcu4DG41kaTjmgGNvwe7M13XNxeY/NDnp1VudfEUYH9QxWfZs7BFGOL27FBLCyjaiI6lJI8/7J+VkVkA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@alcalzone/release-script-core": "5.1.1", - "alcalzone-shared": "^5.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@alcalzone/release-script-plugin-git": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-git/-/release-script-plugin-git-5.1.1.tgz", - "integrity": "sha512-+o7X3vAAOXfwZixHFXXaZpLMLBstz2nzBrdyH0JfQ3KFBdxuXZzlKbaQ3sot2x5Pp4Suw5GTRBrlzH/VHp83Ug==", - "dev": true, - "license": "MIT", - "dependencies": { - "@alcalzone/release-script-core": "5.1.1" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@alcalzone/release-script-plugin-iobroker": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-iobroker/-/release-script-plugin-iobroker-5.1.2.tgz", - "integrity": "sha512-8mqm95NdFUimy10zjKSkqxBFWMs5NebVFHTGQRUTNGzrUnt8s14Nrt8VBTOJw6YTbjhFe49SJDoQ+S4qipdk6g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@alcalzone/release-script-core": "5.1.1", - "alcalzone-shared": "^5.0.0", - "ky": "^1.7.5", - "semver": "^7.7.2" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@alcalzone/release-script-plugin-license": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-license/-/release-script-plugin-license-5.1.1.tgz", - "integrity": "sha512-fQAuh46MEtJj0mdtq4FiIX08Bzvv6THmpgBMr7VXTfTe/kbUh7CAnz52rzdB4go0s0yqLkGfP9z04/SLLCH0mQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@alcalzone/release-script-core": "5.1.1", - "tiny-glob": "^0.2.9" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@alcalzone/release-script-plugin-package": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-package/-/release-script-plugin-package-5.1.1.tgz", - "integrity": "sha512-WElqWx2n/6bVuomX+4N+s4ZShsXrwaMkMcuNtnwGhVyPkDczvJnW0zNh5BS+oeWQndZLAGfyeJ6uKa8kFur48A==", - "dev": true, - "license": "MIT", - "dependencies": { - "@alcalzone/pak": "^0.12.0", - "@alcalzone/release-script-core": "5.1.1", - "alcalzone-shared": "^5.0.0", - "semver": "^7.7.2" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@alcalzone/release-script-plugin-version": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-version/-/release-script-plugin-version-5.1.1.tgz", - "integrity": "sha512-hWYb+reuLhljRRr2AiW602FIDBOukY2HCb1PchLj/hgsrcHW581AucSyH5Dol7BW+1itP0oeDo2os6NCDYQFOA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@alcalzone/release-script-core": "5.1.1", - "alcalzone-shared": "^5.0.0", - "semver": "^7.7.2", - "tiny-glob": "^0.2.9" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", - "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/runtime": { - "version": "7.28.4", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.4.tgz", - "integrity": "sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==", - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@emotion/cache": { - "version": "11.14.0", - "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.14.0.tgz", - "integrity": "sha512-L/B1lc/TViYk4DcpGxtAVbx0ZyiKM5ktoIyafGkH6zg/tj+mA+NE//aPYKG0k8kCHSHVJrpLpcAlOBEXQ3SavA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@emotion/memoize": "^0.9.0", - "@emotion/sheet": "^1.4.0", - "@emotion/utils": "^1.4.2", - "@emotion/weak-memoize": "^0.4.0", - "stylis": "4.2.0" - } - }, - "node_modules/@emotion/hash": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.2.tgz", - "integrity": "sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g==", - "dev": true, - "license": "MIT" - }, - "node_modules/@emotion/memoize": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.9.0.tgz", - "integrity": "sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/@emotion/serialize": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.3.3.tgz", - "integrity": "sha512-EISGqt7sSNWHGI76hC7x1CksiXPahbxEOrC5RjmFRJTqLyEK9/9hZvBbiYn70dw4wuwMKiEMCUlR6ZXTSWQqxA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@emotion/hash": "^0.9.2", - "@emotion/memoize": "^0.9.0", - "@emotion/unitless": "^0.10.0", - "@emotion/utils": "^1.4.2", - "csstype": "^3.0.2" - } - }, - "node_modules/@emotion/sheet": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.4.0.tgz", - "integrity": "sha512-fTBW9/8r2w3dXWYM4HCB1Rdp8NLibOw2+XELH5m5+AkWiL/KqYX6dc0kKYlaYyKjrQ6ds33MCdMPEwgs2z1rqg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@emotion/unitless": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.10.0.tgz", - "integrity": "sha512-dFoMUuQA20zvtVTuxZww6OHoJYgrzfKM1t52mVySDJnMSEa08ruEvdYQbhvyu6soU+NeLVd3yKfTfT0NeV6qGg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@emotion/utils": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.4.2.tgz", - "integrity": "sha512-3vLclRofFziIa3J2wDh9jjbkUz9qk5Vi3IZ/FSTKViB0k+ef0fPV7dYrUIugbgupYDx7v9ud/SjrtEP8Y4xLoA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@emotion/weak-memoize": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.4.0.tgz", - "integrity": "sha512-snKqtPW01tN0ui7yu9rGv69aJXr/a/Ywvl11sUjNtEcRc+ng/mQriFL0wLXMef74iHa/EkftbDzU9F8iFbH+zg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@es-joy/jsdoccomment": { - "version": "0.56.0", - "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.56.0.tgz", - "integrity": "sha512-c6EW+aA1w2rjqOMjbL93nZlwxp6c1Ln06vTYs5FjRRhmJXK8V/OrSXdT+pUr4aRYgjCgu8/OkiZr0tzeVrRSbw==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "@types/estree": "^1.0.8", - "@typescript-eslint/types": "^8.42.0", - "comment-parser": "1.4.1", - "esquery": "^1.6.0", - "jsdoc-type-pratt-parser": "~5.1.0" - }, - "engines": { - "node": ">=20.11.0" - } - }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.11.tgz", - "integrity": "sha512-Xt1dOL13m8u0WE8iplx9Ibbm+hFAO0GsU2P34UNoDGvZYkY8ifSiy6Zuc1lYxfG7svWE2fzqCUmFp5HCn51gJg==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.11.tgz", - "integrity": "sha512-uoa7dU+Dt3HYsethkJ1k6Z9YdcHjTrSb5NUy66ZfZaSV8hEYGD5ZHbEMXnqLFlbBflLsl89Zke7CAdDJ4JI+Gg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.11.tgz", - "integrity": "sha512-9slpyFBc4FPPz48+f6jyiXOx/Y4v34TUeDDXJpZqAWQn/08lKGeD8aDp9TMn9jDz2CiEuHwfhRmGBvpnd/PWIQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.11.tgz", - "integrity": "sha512-Sgiab4xBjPU1QoPEIqS3Xx+R2lezu0LKIEcYe6pftr56PqPygbB7+szVnzoShbx64MUupqoE0KyRlN7gezbl8g==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.11.tgz", - "integrity": "sha512-VekY0PBCukppoQrycFxUqkCojnTQhdec0vevUL/EDOCnXd9LKWqD/bHwMPzigIJXPhC59Vd1WFIL57SKs2mg4w==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.11.tgz", - "integrity": "sha512-+hfp3yfBalNEpTGp9loYgbknjR695HkqtY3d3/JjSRUyPg/xd6q+mQqIb5qdywnDxRZykIHs3axEqU6l1+oWEQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.11.tgz", - "integrity": "sha512-CmKjrnayyTJF2eVuO//uSjl/K3KsMIeYeyN7FyDBjsR3lnSJHaXlVoAK8DZa7lXWChbuOk7NjAc7ygAwrnPBhA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.11.tgz", - "integrity": "sha512-Dyq+5oscTJvMaYPvW3x3FLpi2+gSZTCE/1ffdwuM6G1ARang/mb3jvjxs0mw6n3Lsw84ocfo9CrNMqc5lTfGOw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.11.tgz", - "integrity": "sha512-TBMv6B4kCfrGJ8cUPo7vd6NECZH/8hPpBHHlYI3qzoYFvWu2AdTvZNuU/7hsbKWqu/COU7NIK12dHAAqBLLXgw==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.11.tgz", - "integrity": "sha512-Qr8AzcplUhGvdyUF08A1kHU3Vr2O88xxP0Tm8GcdVOUm25XYcMPp2YqSVHbLuXzYQMf9Bh/iKx7YPqECs6ffLA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.11.tgz", - "integrity": "sha512-TmnJg8BMGPehs5JKrCLqyWTVAvielc615jbkOirATQvWWB1NMXY77oLMzsUjRLa0+ngecEmDGqt5jiDC6bfvOw==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.11.tgz", - "integrity": "sha512-DIGXL2+gvDaXlaq8xruNXUJdT5tF+SBbJQKbWy/0J7OhU8gOHOzKmGIlfTTl6nHaCOoipxQbuJi7O++ldrxgMw==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.11.tgz", - "integrity": "sha512-Osx1nALUJu4pU43o9OyjSCXokFkFbyzjXb6VhGIJZQ5JZi8ylCQ9/LFagolPsHtgw6himDSyb5ETSfmp4rpiKQ==", - "cpu": [ - "mips64el" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.11.tgz", - "integrity": "sha512-nbLFgsQQEsBa8XSgSTSlrnBSrpoWh7ioFDUmwo158gIm5NNP+17IYmNWzaIzWmgCxq56vfr34xGkOcZ7jX6CPw==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.11.tgz", - "integrity": "sha512-HfyAmqZi9uBAbgKYP1yGuI7tSREXwIb438q0nqvlpxAOs3XnZ8RsisRfmVsgV486NdjD7Mw2UrFSw51lzUk1ww==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.11.tgz", - "integrity": "sha512-HjLqVgSSYnVXRisyfmzsH6mXqyvj0SA7pG5g+9W7ESgwA70AXYNpfKBqh1KbTxmQVaYxpzA/SvlB9oclGPbApw==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.11.tgz", - "integrity": "sha512-HSFAT4+WYjIhrHxKBwGmOOSpphjYkcswF449j6EjsjbinTZbp8PJtjsVK1XFJStdzXdy/jaddAep2FGY+wyFAQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-arm64": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.11.tgz", - "integrity": "sha512-hr9Oxj1Fa4r04dNpWr3P8QKVVsjQhqrMSUzZzf+LZcYjZNqhA3IAfPQdEh1FLVUJSiu6sgAwp3OmwBfbFgG2Xg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.11.tgz", - "integrity": "sha512-u7tKA+qbzBydyj0vgpu+5h5AeudxOAGncb8N6C9Kh1N4n7wU1Xw1JDApsRjpShRpXRQlJLb9wY28ELpwdPcZ7A==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.11.tgz", - "integrity": "sha512-Qq6YHhayieor3DxFOoYM1q0q1uMFYb7cSpLD2qzDSvK1NAvqFi8Xgivv0cFC6J+hWVw2teCYltyy9/m/14ryHg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.11.tgz", - "integrity": "sha512-CN+7c++kkbrckTOz5hrehxWN7uIhFFlmS/hqziSFVWpAzpWrQoAG4chH+nN3Be+Kzv/uuo7zhX716x3Sn2Jduw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openharmony-arm64": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.11.tgz", - "integrity": "sha512-rOREuNIQgaiR+9QuNkbkxubbp8MSO9rONmwP5nKncnWJ9v5jQ4JxFnLu4zDSRPf3x4u+2VN4pM4RdyIzDty/wQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.11.tgz", - "integrity": "sha512-nq2xdYaWxyg9DcIyXkZhcYulC6pQ2FuCgem3LI92IwMgIZ69KHeY8T4Y88pcwoLIjbed8n36CyKoYRDygNSGhA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.11.tgz", - "integrity": "sha512-3XxECOWJq1qMZ3MN8srCJ/QfoLpL+VaxD/WfNRm1O3B4+AZ/BnLVgFbUV3eiRYDMXetciH16dwPbbHqwe1uU0Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.11.tgz", - "integrity": "sha512-3ukss6gb9XZ8TlRyJlgLn17ecsK4NSQTmdIXRASVsiS2sQ6zPPZklNJT5GR5tE/MUarymmy8kCEf5xPCNCqVOA==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.11.tgz", - "integrity": "sha512-D7Hpz6A2L4hzsRpPaCYkQnGOotdUpDzSGRIv9I+1ITdHROSFUWW95ZPZWQmGka1Fg7W3zFJowyn9WGwMJ0+KPA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@eslint-community/eslint-utils": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", - "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "eslint-visitor-keys": "^3.4.3" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" - } - }, - "node_modules/@eslint-community/regexpp": { - "version": "4.12.2", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", - "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" - } - }, - "node_modules/@eslint/config-array": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz", - "integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@eslint/object-schema": "^2.1.7", - "debug": "^4.3.1", - "minimatch": "^3.1.2" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/config-helpers": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", - "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@eslint/core": "^0.17.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/config-helpers/node_modules/@eslint/core": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", - "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@types/json-schema": "^7.0.15" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/core": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.16.0.tgz", - "integrity": "sha512-nmC8/totwobIiFcGkDza3GIKfAw1+hLiYVrh3I1nIomQ8PEr5cxg34jnkmGawul/ep52wGRAcyeDCNtWKSOj4Q==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@types/json-schema": "^7.0.15" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", - "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^10.0.1", - "globals": "^14.0.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", - "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@eslint/js": { - "version": "9.38.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.38.0.tgz", - "integrity": "sha512-UZ1VpFvXf9J06YG9xQBdnzU+kthors6KjhMAl6f4gH4usHyh31rUf2DLGInT8RFYIReYXNSydgPY0V2LuWgl7A==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://eslint.org/donate" - } - }, - "node_modules/@eslint/object-schema": { - "version": "2.1.7", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", - "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/plugin-kit": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", - "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@eslint/core": "^0.17.0", - "levn": "^0.4.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/plugin-kit/node_modules/@eslint/core": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", - "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@types/json-schema": "^7.0.15" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@esm2cjs/execa": { - "version": "6.1.1-cjs.1", - "resolved": "https://registry.npmjs.org/@esm2cjs/execa/-/execa-6.1.1-cjs.1.tgz", - "integrity": "sha512-FHxfnmuDIjY1VS/BLzDkL8EkbcFvi8s6x1nYQ1Nyu0An0n88EJcGhDBcRWLFwt3C3nT7xwI+MwHRH1TZcAFW2w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@esm2cjs/human-signals": "^3.0.1", - "@esm2cjs/is-stream": "^3.0.0", - "@esm2cjs/npm-run-path": "^5.1.1-cjs.0", - "@esm2cjs/onetime": "^6.0.1-cjs.0", - "@esm2cjs/strip-final-newline": "^3.0.1-cjs.0", - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "merge-stream": "^2.0.0", - "signal-exit": "^3.0.7" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/AlCalzone" - } - }, - "node_modules/@esm2cjs/human-signals": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@esm2cjs/human-signals/-/human-signals-3.0.1.tgz", - "integrity": "sha512-QZme4eF/PwTpeSbMB4AaWGQ4VSygzE30jI+Oas1NPTtZQAgcHwWVDOQpIW8FUmtzn5Q+2cS7AjnTzbtqtc5P6g==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=12.20.0" - }, - "funding": { - "url": "https://github.com/sponsors/AlCalzone" - } - }, - "node_modules/@esm2cjs/is-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@esm2cjs/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-qcBscHlJpZFOD5nnmMHkzOrq2xyvsp9fbVreQLS8x2LOs8N3CrNi3fqvFY0GVJR+YSOHscwhG9T5t4Ck7R7QGw==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/AlCalzone" - } - }, - "node_modules/@esm2cjs/mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@esm2cjs/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-LIIAjcpjLr4rcbYmRQ+eRu55Upy/MMB78seIlwqbnyiA+cTa1/pxWnJ1NHJQrw6tx2wMQmlYoJj+wf16NjWH6Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/AlCalzone" - } - }, - "node_modules/@esm2cjs/npm-run-path": { - "version": "5.1.1-cjs.0", - "resolved": "https://registry.npmjs.org/@esm2cjs/npm-run-path/-/npm-run-path-5.1.1-cjs.0.tgz", - "integrity": "sha512-CWeAIyE8iNSCgP2ItPE8iPgS+lACqgH+MuFRaWOIl2T7hnHqPFfhAJJ/LcLJJ/RMIxNMeenjFMwc91HW7NWr1A==", - "dev": true, - "license": "MIT", - "dependencies": { - "@esm2cjs/path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/AlCalzone" - } - }, - "node_modules/@esm2cjs/onetime": { - "version": "6.0.1-cjs.0", - "resolved": "https://registry.npmjs.org/@esm2cjs/onetime/-/onetime-6.0.1-cjs.0.tgz", - "integrity": "sha512-MkZMZSxrSC/6yUuAw6Azc56XOgwHQQIsNDlO/zgFmOcycJBhRwRuc/gdYUUOFNZIh7y+f0JSIxkNdJPFvJ5W0w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@esm2cjs/mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/AlCalzone" - } - }, - "node_modules/@esm2cjs/path-key": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@esm2cjs/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-fKzZ3uIIP4j+7WfyG0MEkomGHL0hUXWCx1kY2Zct3GTdl4pyY+3k5lCUxjgdDa2Ld1BCjMNorXnRHiBP6jW6CQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/AlCalzone" - } - }, - "node_modules/@esm2cjs/strip-final-newline": { - "version": "3.0.1-cjs.0", - "resolved": "https://registry.npmjs.org/@esm2cjs/strip-final-newline/-/strip-final-newline-3.0.1-cjs.0.tgz", - "integrity": "sha512-o41riCGPiOEStayoikBCAqwa6igbv9L9rP+k5UCfQ24EJD/wGrdDs/KTNwkHG5JzDK3T60D5dMkWkLKEPy8gjA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/AlCalzone" - } - }, - "node_modules/@fastify/otel": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@fastify/otel/-/otel-0.17.1.tgz", - "integrity": "sha512-K4wyxfUZx2ux5o+b6BtTqouYFVILohLZmSbA2tKUueJstNcBnoGPVhllCaOvbQ3ZrXdUxUC/fyrSWSCqHhdOPg==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fastify" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/fastify" - } - ], - "license": "MIT", - "dependencies": { - "@opentelemetry/core": "^2.0.0", - "@opentelemetry/instrumentation": "^0.212.0", - "@opentelemetry/semantic-conventions": "^1.28.0", - "minimatch": "^10.2.4" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.9.0" - } - }, - "node_modules/@fastify/otel/node_modules/@opentelemetry/api-logs": { - "version": "0.212.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.212.0.tgz", - "integrity": "sha512-TEEVrLbNROUkYY51sBJGk7lO/OLjuepch8+hmpM6ffMJQ2z/KVCjdHuCFX6fJj8OkJP2zckPjrJzQtXU3IAsFg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/api": "^1.3.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/@fastify/otel/node_modules/@opentelemetry/instrumentation": { - "version": "0.212.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.212.0.tgz", - "integrity": "sha512-IyXmpNnifNouMOe0I/gX7ENfv2ZCNdYTF0FpCsoBcpbIHzk81Ww9rQTYTnvghszCg7qGrIhNvWC8dhEifgX9Jg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/api-logs": "0.212.0", - "import-in-the-middle": "^2.0.6", - "require-in-the-middle": "^8.0.0" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@fastify/otel/node_modules/balanced-match": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", - "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "18 || 20 || >=22" - } - }, - "node_modules/@fastify/otel/node_modules/brace-expansion": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.4.tgz", - "integrity": "sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^4.0.2" - }, - "engines": { - "node": "18 || 20 || >=22" - } - }, - "node_modules/@fastify/otel/node_modules/import-in-the-middle": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-2.0.6.tgz", - "integrity": "sha512-3vZV3jX0XRFW3EJDTwzWoZa+RH1b8eTTx6YOCjglrLyPuepwoBti1k3L2dKwdCUrnVEfc5CuRuGstaC/uQJJaw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "acorn": "^8.15.0", - "acorn-import-attributes": "^1.9.5", - "cjs-module-lexer": "^2.2.0", - "module-details-from-path": "^1.0.4" - } - }, - "node_modules/@fastify/otel/node_modules/minimatch": { - "version": "10.2.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", - "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "brace-expansion": "^5.0.2" - }, - "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@google-cloud/common": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-6.0.0.tgz", - "integrity": "sha512-IXh04DlkLMxWgYLIUYuHHKXKOUwPDzDgke1ykkkJPe48cGIS9kkL2U/o0pm4ankHLlvzLF/ma1eO86n/bkumIA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@google-cloud/projectify": "^4.0.0", - "@google-cloud/promisify": "^4.0.0", - "arrify": "^2.0.0", - "duplexify": "^4.1.3", - "extend": "^3.0.2", - "google-auth-library": "^10.0.0-rc.1", - "html-entities": "^2.5.2", - "retry-request": "^8.0.0", - "teeny-request": "^10.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@google-cloud/common/node_modules/@google-cloud/promisify": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-4.1.0.tgz", - "integrity": "sha512-G/FQx5cE/+DqBbOpA5jKsegGwdPniU6PuIEMt+qxWgFxvxuFOzVmp6zYchtYuwAWV5/8Dgs0yAmjvNZv3uXLQg==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=18" - } - }, - "node_modules/@google-cloud/projectify": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-4.0.0.tgz", - "integrity": "sha512-MmaX6HeSvyPbWGwFq7mXdo0uQZLGBYCwziiLIGq5JVX+/bdI3SAq6bP98trV5eTWfLuvsMcIC1YJOF2vfteLFA==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@google-cloud/promisify": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-5.0.0.tgz", - "integrity": "sha512-N8qS6dlORGHwk7WjGXKOSsLjIjNINCPicsOX6gyyLiYk7mq3MtII96NZ9N2ahwA2vnkLmZODOIH9rlNniYWvCQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=18" - } - }, - "node_modules/@google-cloud/translate": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/@google-cloud/translate/-/translate-9.2.1.tgz", - "integrity": "sha512-7/RWxkMd4fKX88Pzzhr2ly8yOjEepCW4ro4ZsdAUsf2Wo2ZLgp75yNZaQGKBBetgOc8yPVl8djr/2XFIHnWS3w==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@google-cloud/common": "^6.0.0", - "@google-cloud/promisify": "^5.0.0", - "arrify": "^2.0.0", - "extend": "^3.0.2", - "google-gax": "^5.0.0", - "is-html": "^2.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@grpc/grpc-js": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.14.0.tgz", - "integrity": "sha512-N8Jx6PaYzcTRNzirReJCtADVoq4z7+1KQ4E70jTg/koQiMoUSN1kbNjPOqpPbhMFhfU1/l7ixspPl8dNY+FoUg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@grpc/proto-loader": "^0.8.0", - "@js-sdsl/ordered-map": "^4.4.2" - }, - "engines": { - "node": ">=12.10.0" - } - }, - "node_modules/@grpc/proto-loader": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.8.0.tgz", - "integrity": "sha512-rc1hOQtjIWGxcxpb9aHAfLpIctjEnsDehj0DAiVfBlmT84uvR0uUtN2hEi/ecvWVjXUGf5qPF4qEgiLOx1YIMQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "lodash.camelcase": "^4.3.0", - "long": "^5.0.0", - "protobufjs": "^7.5.3", - "yargs": "^17.7.2" - }, - "bin": { - "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@humanfs/core": { - "version": "0.19.1", - "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", - "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "engines": { - "node": ">=18.18.0" - } - }, - "node_modules/@humanfs/node": { - "version": "0.16.7", - "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", - "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@humanfs/core": "^0.19.1", - "@humanwhocodes/retry": "^0.4.0" - }, - "engines": { - "node": ">=18.18.0" - } - }, - "node_modules/@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "engines": { - "node": ">=12.22" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "node_modules/@humanwhocodes/retry": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", - "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "engines": { - "node": ">=18.18" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "node_modules/@iobroker/adapter-core": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@iobroker/adapter-core/-/adapter-core-3.3.2.tgz", - "integrity": "sha512-knuCX6F1JUTnY1OdHzDhwNtOoe9/RZgBziDKSzCO3E4koteY/KRqZ7gtzmoavcAokejG68S5osbEnIb4MYT3VA==", - "license": "MIT", - "engines": { - "node": ">=16" - }, - "peerDependencies": { - "@iobroker/types": ">=6.0.11" - } - }, - "node_modules/@iobroker/adapter-dev": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@iobroker/adapter-dev/-/adapter-dev-1.5.0.tgz", - "integrity": "sha512-L1FhO7oxaz4hNMobvgbanSGyn2LaCESGKqPPJhXWU00vVEw5Cc166xdnU63Dk+JDnV5zl/HzOcFANGisETAWIg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@esm2cjs/execa": "^6.1.1-cjs.1", - "@google-cloud/translate": "^9.2.0", - "ansi-colors": "^4.1.3", - "axios": "^1.11.0", - "deepl-node": "^1.19.0", - "esbuild": "^0.25.9", - "fs-extra": "^11.3.1", - "rimraf": "^5.0.10", - "tiny-glob": "^0.2.9", - "yargs": "^18.0.0" - }, - "bin": { - "build-adapter": "bin/build-adapter.js", - "clean-dir": "bin/clean-dir.js", - "translate-adapter": "bin/translate-adapter.js" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@iobroker/adapter-dev/node_modules/ansi-regex": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", - "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/@iobroker/adapter-dev/node_modules/ansi-styles": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", - "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@iobroker/adapter-dev/node_modules/cliui": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-9.0.1.tgz", - "integrity": "sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^7.2.0", - "strip-ansi": "^7.1.0", - "wrap-ansi": "^9.0.0" - }, - "engines": { - "node": ">=20" - } - }, - "node_modules/@iobroker/adapter-dev/node_modules/emoji-regex": { - "version": "10.6.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", - "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", - "dev": true, - "license": "MIT" - }, - "node_modules/@iobroker/adapter-dev/node_modules/fs-extra": { - "version": "11.3.2", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.2.tgz", - "integrity": "sha512-Xr9F6z6up6Ws+NjzMCZc6WXg2YFRlrLP9NQDO3VQrWrfiojdhS56TzueT88ze0uBdCTwEIhQ3ptnmKeWGFAe0A==", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=14.14" - } - }, - "node_modules/@iobroker/adapter-dev/node_modules/string-width": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", - "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^10.3.0", - "get-east-asian-width": "^1.0.0", - "strip-ansi": "^7.1.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@iobroker/adapter-dev/node_modules/strip-ansi": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", - "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/@iobroker/adapter-dev/node_modules/wrap-ansi": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", - "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.2.1", - "string-width": "^7.0.0", - "strip-ansi": "^7.1.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/@iobroker/adapter-dev/node_modules/yargs": { - "version": "18.0.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-18.0.0.tgz", - "integrity": "sha512-4UEqdc2RYGHZc7Doyqkrqiln3p9X2DZVxaGbwhn2pi7MrRagKaOcIKe8L3OxYcbhXLgLFUS3zAYuQjKBQgmuNg==", - "dev": true, - "license": "MIT", - "dependencies": { - "cliui": "^9.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "string-width": "^7.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^22.0.0" - }, - "engines": { - "node": "^20.19.0 || ^22.12.0 || >=23" - } - }, - "node_modules/@iobroker/adapter-dev/node_modules/yargs-parser": { - "version": "22.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-22.0.0.tgz", - "integrity": "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==", - "dev": true, - "license": "ISC", - "engines": { - "node": "^20.19.0 || ^22.12.0 || >=23" - } - }, - "node_modules/@iobroker/build-tools": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@iobroker/build-tools/-/build-tools-3.0.1.tgz", - "integrity": "sha512-i5PsBOHNscMAqmdYrdYxJUplyFCkTwPUVJVL5iQozbG7+e79bHTHXuLCHwslaN/m5ACfr0KmtpoMram8gzGnPg==", - "dev": true, - "dependencies": { - "glob": "^13.0.1" - }, - "engines": { - "node": ">=20" - } - }, - "node_modules/@iobroker/build-tools/node_modules/balanced-match": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", - "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "18 || 20 || >=22" - } - }, - "node_modules/@iobroker/build-tools/node_modules/brace-expansion": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.4.tgz", - "integrity": "sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^4.0.2" - }, - "engines": { - "node": "18 || 20 || >=22" - } - }, - "node_modules/@iobroker/build-tools/node_modules/glob": { - "version": "13.0.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", - "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "minimatch": "^10.2.2", - "minipass": "^7.1.3", - "path-scurry": "^2.0.2" - }, - "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@iobroker/build-tools/node_modules/lru-cache": { - "version": "11.2.7", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.7.tgz", - "integrity": "sha512-aY/R+aEsRelme17KGQa/1ZSIpLpNYYrhcrepKTZgE+W3WM16YMCaPwOHLHsmopZHELU0Ojin1lPVxKR0MihncA==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": "20 || >=22" - } - }, - "node_modules/@iobroker/build-tools/node_modules/minimatch": { - "version": "10.2.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", - "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "brace-expansion": "^5.0.2" - }, - "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@iobroker/build-tools/node_modules/path-scurry": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz", - "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^11.0.0", - "minipass": "^7.1.2" - }, - "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@iobroker/eslint-config": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@iobroker/eslint-config/-/eslint-config-2.2.0.tgz", - "integrity": "sha512-89U2d81BUrReVgVFUJwjxYsHSbvjAt8w8OoKavtNp//wkG7JU4n/VnISMEvQqaQt7i0sWc/xSx27TYDx9FXAYg==", - "dev": true, - "peerDependencies": { - "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.34.0", - "@typescript-eslint/eslint-plugin": "^8.40.0", - "@typescript-eslint/parser": "^8.40.0", - "eslint": ">=9.32.0", - "eslint-config-prettier": "^10.1.8", - "eslint-plugin-import": "^2.30.0", - "eslint-plugin-jsdoc": "^54.1.1", - "eslint-plugin-prettier": "^5.5.4", - "eslint-plugin-react": "^7.37.5", - "eslint-plugin-react-hooks": "^5.2.0", - "eslint-plugin-unicorn": "^60.0.0", - "globals": "^16.3.0", - "prettier": ">=3.6.2", - "typescript-eslint": "^8.40.0" - } - }, - "node_modules/@iobroker/plugin-base": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@iobroker/plugin-base/-/plugin-base-3.0.3.tgz", - "integrity": "sha512-pUKOz9/ZqIDxPQo9E97UdCF6p8NyO+x9REAQYPQNmwkElWq0bka9tgphx+RTUj8inZoYbUd50o9YnotV5C/Jpg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@iobroker/plugin-sentry": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@iobroker/plugin-sentry/-/plugin-sentry-3.0.4.tgz", - "integrity": "sha512-VCHQ9zo5TKyO+A1xpWD8xXe/nW6/BYbEKFxAqHvfDM4U2R0wERZtbH6Ztg3lfV+JRwUn5TgqVRNXvHkvolgPHg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@iobroker/plugin-base": "^3.0.3", - "@sentry/integrations": "^7.114.0", - "@sentry/node": "^10.32.1", - "source-map-support": "^0.5.21" - } - }, - "node_modules/@iobroker/testing": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/@iobroker/testing/-/testing-5.2.2.tgz", - "integrity": "sha512-AiYi9qziPLiNDcwZJa3tcgdSjIq9lq7z4QFvWY9w099chmKOWyvUgWzDy3S/R3L7lJ0yviOeNEdpOHtX4wTf6g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@alcalzone/esbuild-register": "^2.5.1-1", - "@types/chai": "^4.3.20", - "@types/chai-as-promised": "^7.1.8", - "@types/mocha": "^10.0.10", - "@types/sinon": "^17.0.4", - "@types/sinon-chai": "^3.2.12", - "alcalzone-shared": "~5.0.0", - "chai": "^4.5.0", - "chai-as-promised": "^7.1.2", - "debug": "^4.4.3", - "fs-extra": "^11.3.2", - "json5": "^2.2.3", - "mocha": "^11.7.3", - "sinon": "^21.0.0", - "sinon-chai": "^3.7.0" - } - }, - "node_modules/@iobroker/testing/node_modules/fs-extra": { - "version": "11.3.2", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.2.tgz", - "integrity": "sha512-Xr9F6z6up6Ws+NjzMCZc6WXg2YFRlrLP9NQDO3VQrWrfiojdhS56TzueT88ze0uBdCTwEIhQ3ptnmKeWGFAe0A==", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=14.14" - } - }, - "node_modules/@iobroker/testing/node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, - "license": "MIT", - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@iobroker/types": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@iobroker/types/-/types-7.1.0.tgz", - "integrity": "sha512-e9MVfxBiepSVK2U53i/jSA57rtoMn4ysn22wy+enHOZDyXAzm9DnOKaLWtBnRWNn3MhHlyBbx1oMwsYAhT0QSg==", - "license": "MIT", - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/@iobroker/vis-2-widgets-react-dev": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@iobroker/vis-2-widgets-react-dev/-/vis-2-widgets-react-dev-4.0.4.tgz", - "integrity": "sha512-l7jOrzwE9gxLtQCYyF/BXPMaFpT6fZHq6BoH9BAm/GhmoGzkh708zSx5jHfo0E6Dj4XnY/lgil+77tbDZeR6Gw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@mui/icons-material": "^6.1.8", - "@mui/material": "^6.1.8", - "@sentry/browser": "^8.40.0", - "acorn": "^8.14.0", - "acorn-jsx": "^5.3.2", - "acorn-jsx-walk": "^2.0.0", - "acorn-walk": "^8.3.4", - "node-dir": "^0.1.17" - } - }, - "node_modules/@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", - "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", - "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/@js-sdsl/ordered-map": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", - "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==", - "dev": true, - "license": "MIT", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/js-sdsl" - } - }, - "node_modules/@mui/core-downloads-tracker": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-6.5.0.tgz", - "integrity": "sha512-LGb8t8i6M2ZtS3Drn3GbTI1DVhDY6FJ9crEey2lZ0aN2EMZo8IZBZj9wRf4vqbZHaWjsYgtbOnJw5V8UWbmK2Q==", - "dev": true, - "license": "MIT", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mui-org" - } - }, - "node_modules/@mui/icons-material": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-6.5.0.tgz", - "integrity": "sha512-VPuPqXqbBPlcVSA0BmnoE4knW4/xG6Thazo8vCLWkOKusko6DtwFV6B665MMWJ9j0KFohTIf3yx2zYtYacvG1g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.26.0" - }, - "engines": { - "node": ">=14.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mui-org" - }, - "peerDependencies": { - "@mui/material": "^6.5.0", - "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", - "react": "^17.0.0 || ^18.0.0 || ^19.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@mui/material": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@mui/material/-/material-6.5.0.tgz", - "integrity": "sha512-yjvtXoFcrPLGtgKRxFaH6OQPtcLPhkloC0BML6rBG5UeldR0nPULR/2E2BfXdo5JNV7j7lOzrrLX2Qf/iSidow==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.26.0", - "@mui/core-downloads-tracker": "^6.5.0", - "@mui/system": "^6.5.0", - "@mui/types": "~7.2.24", - "@mui/utils": "^6.4.9", - "@popperjs/core": "^2.11.8", - "@types/react-transition-group": "^4.4.12", - "clsx": "^2.1.1", - "csstype": "^3.1.3", - "prop-types": "^15.8.1", - "react-is": "^19.0.0", - "react-transition-group": "^4.4.5" - }, - "engines": { - "node": ">=14.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mui-org" - }, - "peerDependencies": { - "@emotion/react": "^11.5.0", - "@emotion/styled": "^11.3.0", - "@mui/material-pigment-css": "^6.5.0", - "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", - "react": "^17.0.0 || ^18.0.0 || ^19.0.0", - "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0" - }, - "peerDependenciesMeta": { - "@emotion/react": { - "optional": true - }, - "@emotion/styled": { - "optional": true - }, - "@mui/material-pigment-css": { - "optional": true - }, - "@types/react": { - "optional": true - } - } - }, - "node_modules/@mui/private-theming": { - "version": "6.4.9", - "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-6.4.9.tgz", - "integrity": "sha512-LktcVmI5X17/Q5SkwjCcdOLBzt1hXuc14jYa7NPShog0GBDCDvKtcnP0V7a2s6EiVRlv7BzbWEJzH6+l/zaCxw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.26.0", - "@mui/utils": "^6.4.9", - "prop-types": "^15.8.1" - }, - "engines": { - "node": ">=14.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mui-org" - }, - "peerDependencies": { - "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", - "react": "^17.0.0 || ^18.0.0 || ^19.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@mui/styled-engine": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-6.5.0.tgz", - "integrity": "sha512-8woC2zAqF4qUDSPIBZ8v3sakj+WgweolpyM/FXf8jAx6FMls+IE4Y8VDZc+zS805J7PRz31vz73n2SovKGaYgw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.26.0", - "@emotion/cache": "^11.13.5", - "@emotion/serialize": "^1.3.3", - "@emotion/sheet": "^1.4.0", - "csstype": "^3.1.3", - "prop-types": "^15.8.1" - }, - "engines": { - "node": ">=14.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mui-org" - }, - "peerDependencies": { - "@emotion/react": "^11.4.1", - "@emotion/styled": "^11.3.0", - "react": "^17.0.0 || ^18.0.0 || ^19.0.0" - }, - "peerDependenciesMeta": { - "@emotion/react": { - "optional": true - }, - "@emotion/styled": { - "optional": true - } - } - }, - "node_modules/@mui/system": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@mui/system/-/system-6.5.0.tgz", - "integrity": "sha512-XcbBYxDS+h/lgsoGe78ExXFZXtuIlSBpn/KsZq8PtZcIkUNJInkuDqcLd2rVBQrDC1u+rvVovdaWPf2FHKJf3w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.26.0", - "@mui/private-theming": "^6.4.9", - "@mui/styled-engine": "^6.5.0", - "@mui/types": "~7.2.24", - "@mui/utils": "^6.4.9", - "clsx": "^2.1.1", - "csstype": "^3.1.3", - "prop-types": "^15.8.1" - }, - "engines": { - "node": ">=14.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mui-org" - }, - "peerDependencies": { - "@emotion/react": "^11.5.0", - "@emotion/styled": "^11.3.0", - "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", - "react": "^17.0.0 || ^18.0.0 || ^19.0.0" - }, - "peerDependenciesMeta": { - "@emotion/react": { - "optional": true - }, - "@emotion/styled": { - "optional": true - }, - "@types/react": { - "optional": true - } - } - }, - "node_modules/@mui/types": { - "version": "7.2.24", - "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.24.tgz", - "integrity": "sha512-3c8tRt/CbWZ+pEg7QpSwbdxOk36EfmhbKf6AGZsD1EcLDLTSZoxxJ86FVtcjxvjuhdyBiWKSTGZFaXCnidO2kw==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@mui/utils": { - "version": "6.4.9", - "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-6.4.9.tgz", - "integrity": "sha512-Y12Q9hbK9g+ZY0T3Rxrx9m2m10gaphDuUMgWxyV5kNJevVxXYCLclYUCC9vXaIk1/NdNDTcW2Yfr2OGvNFNmHg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.26.0", - "@mui/types": "~7.2.24", - "@types/prop-types": "^15.7.14", - "clsx": "^2.1.1", - "prop-types": "^15.8.1", - "react-is": "^19.0.0" - }, - "engines": { - "node": ">=14.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mui-org" - }, - "peerDependencies": { - "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", - "react": "^17.0.0 || ^18.0.0 || ^19.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@opentelemetry/api": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", - "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/@opentelemetry/api-logs": { - "version": "0.213.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.213.0.tgz", - "integrity": "sha512-zRM5/Qj6G84Ej3F1yt33xBVY/3tnMxtL1fiDIxYbDWYaZ/eudVw3/PBiZ8G7JwUxXxjW8gU4g6LnOyfGKYHYgw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/api": "^1.3.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/@opentelemetry/context-async-hooks": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-2.6.0.tgz", - "integrity": "sha512-L8UyDwqpTcbkIK5cgwDRDYDoEhQoj8wp8BwsO19w3LB1Z41yEQm2VJyNfAi9DrLP/YTqXqWpKHyZfR9/tFYo1Q==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.10.0" - } - }, - "node_modules/@opentelemetry/core": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.6.0.tgz", - "integrity": "sha512-HLM1v2cbZ4TgYN6KEOj+Bbj8rAKriOdkF9Ed3tG25FoprSiQl7kYc+RRT6fUZGOvx0oMi5U67GoFdT+XUn8zEg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/semantic-conventions": "^1.29.0" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.10.0" - } - }, - "node_modules/@opentelemetry/instrumentation": { - "version": "0.213.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.213.0.tgz", - "integrity": "sha512-3i9NdkET/KvQomeh7UaR/F4r9P25Rx6ooALlWXPIjypcEOUxksCmVu0zA70NBJWlrMW1rPr/LRidFAflLI+s/w==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/api-logs": "0.213.0", - "import-in-the-middle": "^3.0.0", - "require-in-the-middle": "^8.0.0" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-amqplib": { - "version": "0.60.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-amqplib/-/instrumentation-amqplib-0.60.0.tgz", - "integrity": "sha512-q/B2IvoVXRm1M00MvhnzpMN6rKYOszPXVsALi6u0ss4AYHe+TidZEtLW9N1ZhrobI1dSriHnBqqtAOZVAv07sg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/core": "^2.0.0", - "@opentelemetry/instrumentation": "^0.213.0", - "@opentelemetry/semantic-conventions": "^1.33.0" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-connect": { - "version": "0.56.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-connect/-/instrumentation-connect-0.56.0.tgz", - "integrity": "sha512-PKp+sSZ7AfzMvGgO3VCyo1inwNu+q7A1k9X88WK4PQ+S6Hp7eFk8pie+sWHDTaARovmqq5V2osav3lQej2B0nw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/core": "^2.0.0", - "@opentelemetry/instrumentation": "^0.213.0", - "@opentelemetry/semantic-conventions": "^1.27.0", - "@types/connect": "3.4.38" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-dataloader": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-dataloader/-/instrumentation-dataloader-0.30.0.tgz", - "integrity": "sha512-MXHP2Q38cd2OhzEBKAIXUi9uBlPEYzF6BNJbyjUXBQ6kLaf93kRC41vNMIz0Nl5mnuwK7fDvKT+/lpx7BXRwdg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/instrumentation": "^0.213.0" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-express": { - "version": "0.61.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-express/-/instrumentation-express-0.61.0.tgz", - "integrity": "sha512-Xdmqo9RZuZlL29Flg8QdwrrX7eW1CZ7wFQPKHyXljNymgKhN1MCsYuqQ/7uxavhSKwAl7WxkTzKhnqpUApLMvQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/core": "^2.0.0", - "@opentelemetry/instrumentation": "^0.213.0", - "@opentelemetry/semantic-conventions": "^1.27.0" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-fs": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-fs/-/instrumentation-fs-0.32.0.tgz", - "integrity": "sha512-koR6apx0g0wX6RRiPpjA4AFQUQUbXrK16kq4/SZjVp7u5cffJhNkY4TnITxcGA4acGSPYAfx3NHRIv4Khn1axQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/core": "^2.0.0", - "@opentelemetry/instrumentation": "^0.213.0" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-generic-pool": { - "version": "0.56.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-generic-pool/-/instrumentation-generic-pool-0.56.0.tgz", - "integrity": "sha512-fg+Jffs6fqrf0uQS0hom7qBFKsbtpBiBl8+Vkc63Gx8xh6pVh+FhagmiO6oM0m3vyb683t1lP7yGYq22SiDnqg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/instrumentation": "^0.213.0" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-graphql": { - "version": "0.61.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-graphql/-/instrumentation-graphql-0.61.0.tgz", - "integrity": "sha512-pUiVASv6nh2XrerTvlbVHh7vKFzscpgwiQ/xvnZuAIzQ5lRjWVdRPUuXbvZJ/Yq79QsE81TZdJ7z9YsXiss1ew==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/instrumentation": "^0.213.0" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-hapi": { - "version": "0.59.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-hapi/-/instrumentation-hapi-0.59.0.tgz", - "integrity": "sha512-33wa4mEr+9+ztwdgLor1SeBu4Opz4IsmpcLETXAd3VmBrOjez8uQtrsOhPCa5Vhbm5gzDlMYTgFRLQzf8/YHFA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/core": "^2.0.0", - "@opentelemetry/instrumentation": "^0.213.0", - "@opentelemetry/semantic-conventions": "^1.27.0" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-http": { - "version": "0.213.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-http/-/instrumentation-http-0.213.0.tgz", - "integrity": "sha512-B978Xsm5XEPGhm1P07grDoaOFLHapJPkOG9h016cJsyWWxmiLnPu2M/4Nrm7UCkHSiLnkXgC+zVGUAIahy8EEA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/core": "2.6.0", - "@opentelemetry/instrumentation": "0.213.0", - "@opentelemetry/semantic-conventions": "^1.29.0", - "forwarded-parse": "2.1.2" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-ioredis": { - "version": "0.61.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-ioredis/-/instrumentation-ioredis-0.61.0.tgz", - "integrity": "sha512-hsHDadUtAFbws1YSDc1XW0svGFKiUbqv2td1Cby+UAiwvojm1NyBo/taifH0t8CuFZ0x/2SDm0iuTwrM5pnVOg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/instrumentation": "^0.213.0", - "@opentelemetry/redis-common": "^0.38.2", - "@opentelemetry/semantic-conventions": "^1.33.0" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-kafkajs": { - "version": "0.22.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-kafkajs/-/instrumentation-kafkajs-0.22.0.tgz", - "integrity": "sha512-wJU4IBQMUikdJAcTChLFqK5lo+flo7pahqd8DSLv7uMxsdOdAHj6RzKYAm8pPfUS6ItKYutYyuicwKaFwQKsoA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/instrumentation": "^0.213.0", - "@opentelemetry/semantic-conventions": "^1.30.0" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-knex": { - "version": "0.57.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-knex/-/instrumentation-knex-0.57.0.tgz", - "integrity": "sha512-vMCSh8kolEm5rRsc+FZeTZymWmIJwc40hjIKnXH4O0Dv/gAkJJIRXCsPX5cPbe0c0j/34+PsENd0HqKruwhVYw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/instrumentation": "^0.213.0", - "@opentelemetry/semantic-conventions": "^1.33.1" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-koa": { - "version": "0.61.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-koa/-/instrumentation-koa-0.61.0.tgz", - "integrity": "sha512-lvrfWe9ShK/D2X4brmx8ZqqeWPfRl8xekU0FCn7C1dHm5k6+rTOOi36+4fnaHAP8lig9Ux6XQ1D4RNIpPCt1WQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/core": "^2.0.0", - "@opentelemetry/instrumentation": "^0.213.0", - "@opentelemetry/semantic-conventions": "^1.36.0" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.9.0" - } - }, - "node_modules/@opentelemetry/instrumentation-lru-memoizer": { - "version": "0.57.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-lru-memoizer/-/instrumentation-lru-memoizer-0.57.0.tgz", - "integrity": "sha512-cEqpUocSKJfwDtLYTTJehRLWzkZ2eoePCxfVIgGkGkb83fMB71O+y4MvRHJPbeV2bdoWdOVrl8uO0+EynWhTEA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/instrumentation": "^0.213.0" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-mongodb": { - "version": "0.66.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongodb/-/instrumentation-mongodb-0.66.0.tgz", - "integrity": "sha512-d7m9QnAY+4TCWI4q1QRkfrc6fo/92VwssaB1DzQfXNRvu51b78P+HJlWP7Qg6N6nkwdb9faMZNBCZJfftmszkw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/instrumentation": "^0.213.0", - "@opentelemetry/semantic-conventions": "^1.33.0" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-mongoose": { - "version": "0.59.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongoose/-/instrumentation-mongoose-0.59.0.tgz", - "integrity": "sha512-6/jWU+c1NgznkVLDU/2y0bXV2nJo3o9FWZ9mZ9nN6T/JBNRoMnVXZl2FdBmgH+a5MwaWLs5kmRJTP5oUVGIkPw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/core": "^2.0.0", - "@opentelemetry/instrumentation": "^0.213.0", - "@opentelemetry/semantic-conventions": "^1.33.0" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-mysql": { - "version": "0.59.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mysql/-/instrumentation-mysql-0.59.0.tgz", - "integrity": "sha512-r+V/Fh0sm7Ga8/zk/TI5H5FQRAjwr0RrpfPf8kNIehlsKf12XnvIaZi8ViZkpX0gyPEpLXqzqWD6QHlgObgzZw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/instrumentation": "^0.213.0", - "@opentelemetry/semantic-conventions": "^1.33.0", - "@types/mysql": "2.15.27" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-mysql2": { - "version": "0.59.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mysql2/-/instrumentation-mysql2-0.59.0.tgz", - "integrity": "sha512-n9/xrVCRBfG9egVbffnlU1uhr+HX0vF4GgtAB/Bvm48wpFgRidqD8msBMiym1kRYzmpWvJqTxNT47u1MkgBEdw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/instrumentation": "^0.213.0", - "@opentelemetry/semantic-conventions": "^1.33.0", - "@opentelemetry/sql-common": "^0.41.2" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-pg": { - "version": "0.65.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-pg/-/instrumentation-pg-0.65.0.tgz", - "integrity": "sha512-W0zpHEIEuyZ8zvb3njaX9AAbHgPYOsSWVOoWmv1sjVRSF6ZpBqtlxBWbU+6hhq1TFWBeWJOXZ8nZS/PUFpLJYQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/core": "^2.0.0", - "@opentelemetry/instrumentation": "^0.213.0", - "@opentelemetry/semantic-conventions": "^1.34.0", - "@opentelemetry/sql-common": "^0.41.2", - "@types/pg": "8.15.6", - "@types/pg-pool": "2.0.7" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-redis": { - "version": "0.61.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-redis/-/instrumentation-redis-0.61.0.tgz", - "integrity": "sha512-JnPexA034/0UJRsvH96B0erQoNOqKJZjE2ZRSw9hiTSC23LzE0nJE/u6D+xqOhgUhRnhhcPHq4MdYtmUdYTF+Q==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/instrumentation": "^0.213.0", - "@opentelemetry/redis-common": "^0.38.2", - "@opentelemetry/semantic-conventions": "^1.27.0" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-tedious": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-tedious/-/instrumentation-tedious-0.32.0.tgz", - "integrity": "sha512-BQS6gG8RJ1foEqfEZ+wxoqlwfCAzb1ZVG0ad8Gfe4x8T658HJCLGLd4E4NaoQd8EvPfLqOXgzGaE/2U4ytDSWA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/instrumentation": "^0.213.0", - "@opentelemetry/semantic-conventions": "^1.33.0", - "@types/tedious": "^4.0.14" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-undici": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-undici/-/instrumentation-undici-0.23.0.tgz", - "integrity": "sha512-LL0VySzKVR2cJSFVZaTYpZl1XTpBGnfzoQPe2W7McS2267ldsaEIqtQY6VXs2KCXN0poFjze5110PIpxHDaDGg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/core": "^2.0.0", - "@opentelemetry/instrumentation": "^0.213.0", - "@opentelemetry/semantic-conventions": "^1.24.0" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.7.0" - } - }, - "node_modules/@opentelemetry/redis-common": { - "version": "0.38.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/redis-common/-/redis-common-0.38.2.tgz", - "integrity": "sha512-1BCcU93iwSRZvDAgwUxC/DV4T/406SkMfxGqu5ojc3AvNI+I9GhV7v0J1HljsczuuhcnFLYqD5VmwVXfCGHzxA==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.19.0 || >=20.6.0" - } - }, - "node_modules/@opentelemetry/resources": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-2.6.0.tgz", - "integrity": "sha512-D4y/+OGe3JSuYUCBxtH5T9DSAWNcvCb/nQWIga8HNtXTVPQn59j0nTBAgaAXxUVBDl40mG3Tc76b46wPlZaiJQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/core": "2.6.0", - "@opentelemetry/semantic-conventions": "^1.29.0" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.10.0" - } - }, - "node_modules/@opentelemetry/sdk-trace-base": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-2.6.0.tgz", - "integrity": "sha512-g/OZVkqlxllgFM7qMKqbPV9c1DUPhQ7d4n3pgZFcrnrNft9eJXZM2TNHTPYREJBrtNdRytYyvwjgL5geDKl3EQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/core": "2.6.0", - "@opentelemetry/resources": "2.6.0", - "@opentelemetry/semantic-conventions": "^1.29.0" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.10.0" - } - }, - "node_modules/@opentelemetry/semantic-conventions": { - "version": "1.40.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz", - "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=14" - } - }, - "node_modules/@opentelemetry/sql-common": { - "version": "0.41.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/sql-common/-/sql-common-0.41.2.tgz", - "integrity": "sha512-4mhWm3Z8z+i508zQJ7r6Xi7y4mmoJpdvH0fZPFRkWrdp5fq7hhZ2HhYokEOLkfqSMgPR4Z9EyB3DBkbKGOqZiQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/core": "^2.0.0" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.1.0" - } - }, - "node_modules/@pkgjs/parseargs": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/@pkgr/core": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.9.tgz", - "integrity": "sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": "^12.20.0 || ^14.18.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/pkgr" - } - }, - "node_modules/@popperjs/core": { - "version": "2.11.8", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", - "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", - "dev": true, - "license": "MIT", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/popperjs" - } - }, - "node_modules/@prisma/instrumentation": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/@prisma/instrumentation/-/instrumentation-7.4.2.tgz", - "integrity": "sha512-r9JfchJF1Ae6yAxcaLu/V1TGqBhAuSDe3mRNOssBfx1rMzfZ4fdNvrgUBwyb/TNTGXFxlH9AZix5P257x07nrg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/instrumentation": "^0.207.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.8" - } - }, - "node_modules/@prisma/instrumentation/node_modules/@opentelemetry/api-logs": { - "version": "0.207.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.207.0.tgz", - "integrity": "sha512-lAb0jQRVyleQQGiuuvCOTDVspc14nx6XJjP4FspJ1sNARo3Regq4ZZbrc3rN4b1TYSuUCvgH+UXUPug4SLOqEQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/api": "^1.3.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/@prisma/instrumentation/node_modules/@opentelemetry/instrumentation": { - "version": "0.207.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.207.0.tgz", - "integrity": "sha512-y6eeli9+TLKnznrR8AZlQMSJT7wILpXH+6EYq5Vf/4Ao+huI7EedxQHwRgVUOMLFbe7VFDvHJrX9/f4lcwnJsA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/api-logs": "0.207.0", - "import-in-the-middle": "^2.0.0", - "require-in-the-middle": "^8.0.0" - }, - "engines": { - "node": "^18.19.0 || >=20.6.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@prisma/instrumentation/node_modules/import-in-the-middle": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-2.0.6.tgz", - "integrity": "sha512-3vZV3jX0XRFW3EJDTwzWoZa+RH1b8eTTx6YOCjglrLyPuepwoBti1k3L2dKwdCUrnVEfc5CuRuGstaC/uQJJaw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "acorn": "^8.15.0", - "acorn-import-attributes": "^1.9.5", - "cjs-module-lexer": "^2.2.0", - "module-details-from-path": "^1.0.4" - } - }, - "node_modules/@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" - } - }, - "node_modules/@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/@rtsao/scc": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", - "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", - "dev": true, - "license": "MIT", - "peer": true - }, - "node_modules/@sentry-internal/browser-utils": { - "version": "8.55.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/browser-utils/-/browser-utils-8.55.0.tgz", - "integrity": "sha512-ROgqtQfpH/82AQIpESPqPQe0UyWywKJsmVIqi3c5Fh+zkds5LUxnssTj3yNd1x+kxaPDVB023jAP+3ibNgeNDw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@sentry/core": "8.55.0" - }, - "engines": { - "node": ">=14.18" - } - }, - "node_modules/@sentry-internal/feedback": { - "version": "8.55.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-8.55.0.tgz", - "integrity": "sha512-cP3BD/Q6pquVQ+YL+rwCnorKuTXiS9KXW8HNKu4nmmBAyf7urjs+F6Hr1k9MXP5yQ8W3yK7jRWd09Yu6DHWOiw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@sentry/core": "8.55.0" - }, - "engines": { - "node": ">=14.18" - } - }, - "node_modules/@sentry-internal/replay": { - "version": "8.55.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/replay/-/replay-8.55.0.tgz", - "integrity": "sha512-roCDEGkORwolxBn8xAKedybY+Jlefq3xYmgN2fr3BTnsXjSYOPC7D1/mYqINBat99nDtvgFvNfRcZPiwwZ1hSw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@sentry-internal/browser-utils": "8.55.0", - "@sentry/core": "8.55.0" - }, - "engines": { - "node": ">=14.18" - } - }, - "node_modules/@sentry-internal/replay-canvas": { - "version": "8.55.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-8.55.0.tgz", - "integrity": "sha512-nIkfgRWk1091zHdu4NbocQsxZF1rv1f7bbp3tTIlZYbrH62XVZosx5iHAuZG0Zc48AETLE7K4AX9VGjvQj8i9w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@sentry-internal/replay": "8.55.0", - "@sentry/core": "8.55.0" - }, - "engines": { - "node": ">=14.18" - } - }, - "node_modules/@sentry/browser": { - "version": "8.55.0", - "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-8.55.0.tgz", - "integrity": "sha512-1A31mCEWCjaMxJt6qGUK+aDnLDcK6AwLAZnqpSchNysGni1pSn1RWSmk9TBF8qyTds5FH8B31H480uxMPUJ7Cw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@sentry-internal/browser-utils": "8.55.0", - "@sentry-internal/feedback": "8.55.0", - "@sentry-internal/replay": "8.55.0", - "@sentry-internal/replay-canvas": "8.55.0", - "@sentry/core": "8.55.0" - }, - "engines": { - "node": ">=14.18" - } - }, - "node_modules/@sentry/core": { - "version": "8.55.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.55.0.tgz", - "integrity": "sha512-6g7jpbefjHYs821Z+EBJ8r4Z7LT5h80YSWRJaylGS4nW5W5Z2KXzpdnyFarv37O7QjauzVC2E+PABmpkw5/JGA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14.18" - } - }, - "node_modules/@sentry/integrations": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry/integrations/-/integrations-7.114.0.tgz", - "integrity": "sha512-BJIBWXGKeIH0ifd7goxOS29fBA8BkEgVVCahs6xIOXBjX1IRS6PmX0zYx/GP23nQTfhJiubv2XPzoYOlZZmDxg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@sentry/core": "7.114.0", - "@sentry/types": "7.114.0", - "@sentry/utils": "7.114.0", - "localforage": "^1.8.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@sentry/integrations/node_modules/@sentry/core": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.114.0.tgz", - "integrity": "sha512-YnanVlmulkjgZiVZ9BfY9k6I082n+C+LbZo52MTvx3FY6RE5iyiPMpaOh67oXEZRWcYQEGm+bKruRxLVP6RlbA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@sentry/types": "7.114.0", - "@sentry/utils": "7.114.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@sentry/node": { - "version": "10.44.0", - "resolved": "https://registry.npmjs.org/@sentry/node/-/node-10.44.0.tgz", - "integrity": "sha512-q+/WR9ZeF9Af8uyehOj2tQQOa7LH07mJfOuDus5X6G6cLuugdRUGUBB5Qhw+J/ULSxbzGADBZv6AYOyoGaNx7w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@fastify/otel": "0.17.1", - "@opentelemetry/api": "^1.9.0", - "@opentelemetry/context-async-hooks": "^2.6.0", - "@opentelemetry/core": "^2.6.0", - "@opentelemetry/instrumentation": "^0.213.0", - "@opentelemetry/instrumentation-amqplib": "0.60.0", - "@opentelemetry/instrumentation-connect": "0.56.0", - "@opentelemetry/instrumentation-dataloader": "0.30.0", - "@opentelemetry/instrumentation-express": "0.61.0", - "@opentelemetry/instrumentation-fs": "0.32.0", - "@opentelemetry/instrumentation-generic-pool": "0.56.0", - "@opentelemetry/instrumentation-graphql": "0.61.0", - "@opentelemetry/instrumentation-hapi": "0.59.0", - "@opentelemetry/instrumentation-http": "0.213.0", - "@opentelemetry/instrumentation-ioredis": "0.61.0", - "@opentelemetry/instrumentation-kafkajs": "0.22.0", - "@opentelemetry/instrumentation-knex": "0.57.0", - "@opentelemetry/instrumentation-koa": "0.61.0", - "@opentelemetry/instrumentation-lru-memoizer": "0.57.0", - "@opentelemetry/instrumentation-mongodb": "0.66.0", - "@opentelemetry/instrumentation-mongoose": "0.59.0", - "@opentelemetry/instrumentation-mysql": "0.59.0", - "@opentelemetry/instrumentation-mysql2": "0.59.0", - "@opentelemetry/instrumentation-pg": "0.65.0", - "@opentelemetry/instrumentation-redis": "0.61.0", - "@opentelemetry/instrumentation-tedious": "0.32.0", - "@opentelemetry/instrumentation-undici": "0.23.0", - "@opentelemetry/resources": "^2.6.0", - "@opentelemetry/sdk-trace-base": "^2.6.0", - "@opentelemetry/semantic-conventions": "^1.40.0", - "@prisma/instrumentation": "7.4.2", - "@sentry/core": "10.44.0", - "@sentry/node-core": "10.44.0", - "@sentry/opentelemetry": "10.44.0", - "import-in-the-middle": "^3.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@sentry/node-core": { - "version": "10.44.0", - "resolved": "https://registry.npmjs.org/@sentry/node-core/-/node-core-10.44.0.tgz", - "integrity": "sha512-jUGsadMrvZ08UMbqJBfjFFMk1k3VbyxfUypf0iDGGgyLmuHotYQPo/5aND+o2KxMDXR60LwcQrMoZFpanK6jXQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@sentry/core": "10.44.0", - "@sentry/opentelemetry": "10.44.0", - "import-in-the-middle": "^3.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.9.0", - "@opentelemetry/context-async-hooks": "^1.30.1 || ^2.1.0", - "@opentelemetry/core": "^1.30.1 || ^2.1.0", - "@opentelemetry/instrumentation": ">=0.57.1 <1", - "@opentelemetry/resources": "^1.30.1 || ^2.1.0", - "@opentelemetry/sdk-trace-base": "^1.30.1 || ^2.1.0", - "@opentelemetry/semantic-conventions": "^1.39.0" - }, - "peerDependenciesMeta": { - "@opentelemetry/api": { - "optional": true - }, - "@opentelemetry/context-async-hooks": { - "optional": true - }, - "@opentelemetry/core": { - "optional": true - }, - "@opentelemetry/instrumentation": { - "optional": true - }, - "@opentelemetry/resources": { - "optional": true - }, - "@opentelemetry/sdk-trace-base": { - "optional": true - }, - "@opentelemetry/semantic-conventions": { - "optional": true - } - } - }, - "node_modules/@sentry/node-core/node_modules/@sentry/core": { - "version": "10.44.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-10.44.0.tgz", - "integrity": "sha512-aa7CiDaNFZvHpqd97LJhuskolfJ/4IH5xyuVVLnv7l6B0v9KTwskPUxb0tH1ej3FxuzfH+i8iTiTFuqpfHS3QA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - } - }, - "node_modules/@sentry/node/node_modules/@sentry/core": { - "version": "10.44.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-10.44.0.tgz", - "integrity": "sha512-aa7CiDaNFZvHpqd97LJhuskolfJ/4IH5xyuVVLnv7l6B0v9KTwskPUxb0tH1ej3FxuzfH+i8iTiTFuqpfHS3QA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - } - }, - "node_modules/@sentry/opentelemetry": { - "version": "10.44.0", - "resolved": "https://registry.npmjs.org/@sentry/opentelemetry/-/opentelemetry-10.44.0.tgz", - "integrity": "sha512-zP4vP8tBxjlmxQ4VcWOwZ0b3lPUxlYPg9FqJwANm9SRJN+7V5psm8TIaAtu9uqtIcJMRHdXkOM4cAggNiLk0KA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@sentry/core": "10.44.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.9.0", - "@opentelemetry/context-async-hooks": "^1.30.1 || ^2.1.0", - "@opentelemetry/core": "^1.30.1 || ^2.1.0", - "@opentelemetry/sdk-trace-base": "^1.30.1 || ^2.1.0", - "@opentelemetry/semantic-conventions": "^1.39.0" - } - }, - "node_modules/@sentry/opentelemetry/node_modules/@sentry/core": { - "version": "10.44.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-10.44.0.tgz", - "integrity": "sha512-aa7CiDaNFZvHpqd97LJhuskolfJ/4IH5xyuVVLnv7l6B0v9KTwskPUxb0tH1ej3FxuzfH+i8iTiTFuqpfHS3QA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - } - }, - "node_modules/@sentry/types": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.114.0.tgz", - "integrity": "sha512-tsqkkyL3eJtptmPtT0m9W/bPLkU7ILY7nvwpi1hahA5jrM7ppoU0IMaQWAgTD+U3rzFH40IdXNBFb8Gnqcva4w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/@sentry/utils": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.114.0.tgz", - "integrity": "sha512-319N90McVpupQ6vws4+tfCy/03AdtsU0MurIE4+W5cubHME08HtiEWlfacvAxX+yuKFhvdsO4K4BB/dj54ideg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@sentry/types": "7.114.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@sinonjs/commons": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", - "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "type-detect": "4.0.8" - } - }, - "node_modules/@sinonjs/commons/node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/@sinonjs/fake-timers": { - "version": "13.0.5", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-13.0.5.tgz", - "integrity": "sha512-36/hTbH2uaWuGVERyC6da9YwGWnzUZXuPro/F2LfsdOsLnCojz/iSH8MxUt/FD2S5XBSVPhmArFUXcpCQ2Hkiw==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@sinonjs/commons": "^3.0.1" - } - }, - "node_modules/@sinonjs/samsam": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-8.0.3.tgz", - "integrity": "sha512-hw6HbX+GyVZzmaYNh82Ecj1vdGZrqVIn/keDTg63IgAwiQPO+xCz99uG6Woqgb4tM0mUiFENKZ4cqd7IX94AXQ==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@sinonjs/commons": "^3.0.1", - "type-detect": "^4.1.0" - } - }, - "node_modules/@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10" - } - }, - "node_modules/@types/caseless": { - "version": "0.12.5", - "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.5.tgz", - "integrity": "sha512-hWtVTC2q7hc7xZ/RLbxapMvDMgUnDvKvMOpKal4DrMyfGBUfB1oKaZlIRr6mJL+If3bAP6sV/QneGzF6tJjZDg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/chai": { - "version": "4.3.20", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.20.tgz", - "integrity": "sha512-/pC9HAB5I/xMlc5FP77qjCnI16ChlJfW0tGa0IUcFn38VJrTV6DeZ60NU5KZBtaOZqjdpwTWohz5HU1RrhiYxQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/chai-as-promised": { - "version": "7.1.8", - "resolved": "https://registry.npmjs.org/@types/chai-as-promised/-/chai-as-promised-7.1.8.tgz", - "integrity": "sha512-ThlRVIJhr69FLlh6IctTXFkmhtP3NpMZ2QGq69StYLyKZFp/HOp1VdKZj7RvfNWYYcJ1xlbLGLLWj1UvP5u/Gw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/chai": "*" - } - }, - "node_modules/@types/connect": { - "version": "3.4.38", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", - "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/estree": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", - "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", - "dev": true, - "license": "MIT", - "peer": true - }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true, - "license": "MIT", - "peer": true - }, - "node_modules/@types/json5": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", - "dev": true, - "license": "MIT", - "peer": true - }, - "node_modules/@types/mocha": { - "version": "10.0.10", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.10.tgz", - "integrity": "sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/mysql": { - "version": "2.15.27", - "resolved": "https://registry.npmjs.org/@types/mysql/-/mysql-2.15.27.tgz", - "integrity": "sha512-YfWiV16IY0OeBfBCk8+hXKmdTKrKlwKN1MNKAPBu5JYxLwBEZl7QzeEpGnlZb3VMGJrrGmB84gXiH+ofs/TezA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/node": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-25.5.0.tgz", - "integrity": "sha512-jp2P3tQMSxWugkCUKLRPVUpGaL5MVFwF8RDuSRztfwgN1wmqJeMSbKlnEtQqU8UrhTmzEmZdu2I6v2dpp7XIxw==", - "license": "MIT", - "dependencies": { - "undici-types": "~7.18.0" - } - }, - "node_modules/@types/node-schedule": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@types/node-schedule/-/node-schedule-2.1.8.tgz", - "integrity": "sha512-k00g6Yj/oUg/CDC+MeLHUzu0+OFxWbIqrFfDiLi6OPKxTujvpv29mHGM8GtKr7B+9Vv92FcK/8mRqi1DK5f3hA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/nodemailer": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/nodemailer/-/nodemailer-7.0.11.tgz", - "integrity": "sha512-E+U4RzR2dKrx+u3N4DlsmLaDC6mMZOM/TPROxA0UAPiTgI0y4CEFBmZE+coGWTjakDriRsXG368lNk1u9Q0a2g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/pg": { - "version": "8.15.6", - "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.15.6.tgz", - "integrity": "sha512-NoaMtzhxOrubeL/7UZuNTrejB4MPAJ0RpxZqXQf2qXuVlTPuG6Y8p4u9dKRaue4yjmC7ZhzVO2/Yyyn25znrPQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*", - "pg-protocol": "*", - "pg-types": "^2.2.0" - } - }, - "node_modules/@types/pg-pool": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/@types/pg-pool/-/pg-pool-2.0.7.tgz", - "integrity": "sha512-U4CwmGVQcbEuqpyju8/ptOKg6gEC+Tqsvj2xS9o1g71bUh8twxnC6ZL5rZKCsGN0iyH0CwgUyc9VR5owNQF9Ng==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/pg": "*" - } - }, - "node_modules/@types/prop-types": { - "version": "15.7.15", - "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz", - "integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/react": { - "version": "19.2.2", - "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.2.tgz", - "integrity": "sha512-6mDvHUFSjyT2B2yeNx2nUgMxh9LtOWvkhIU3uePn2I2oyNymUAX1NIsdgviM4CH+JSrp2D2hsMvJOkxY+0wNRA==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "csstype": "^3.0.2" - } - }, - "node_modules/@types/react-transition-group": { - "version": "4.4.12", - "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.12.tgz", - "integrity": "sha512-8TV6R3h2j7a91c+1DXdJi3Syo69zzIZbz7Lg5tORM5LEJG7X/E6a1V3drRyBRZq7/utz7A+c4OgYLiLcYGHG6w==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "@types/react": "*" - } - }, - "node_modules/@types/request": { - "version": "2.48.13", - "resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.13.tgz", - "integrity": "sha512-FGJ6udDNUCjd19pp0Q3iTiDkwhYup7J8hpMW9c4k53NrccQFFWKRho6hvtPPEhnXWKvukfwAlB6DbDz4yhH5Gg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/caseless": "*", - "@types/node": "*", - "@types/tough-cookie": "*", - "form-data": "^2.5.5" - } - }, - "node_modules/@types/sinon": { - "version": "17.0.4", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.4.tgz", - "integrity": "sha512-RHnIrhfPO3+tJT0s7cFaXGZvsL4bbR3/k7z3P312qMS4JaS2Tk+KiwiLx1S0rQ56ERj00u1/BtdyVd0FY+Pdew==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/sinonjs__fake-timers": "*" - } - }, - "node_modules/@types/sinon-chai": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/@types/sinon-chai/-/sinon-chai-3.2.12.tgz", - "integrity": "sha512-9y0Gflk3b0+NhQZ/oxGtaAJDvRywCa5sIyaVnounqLvmf93yBF4EgIRspePtkMs3Tr844nCclYMlcCNmLCvjuQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/chai": "*", - "@types/sinon": "*" - } - }, - "node_modules/@types/sinonjs__fake-timers": { - "version": "15.0.1", - "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-15.0.1.tgz", - "integrity": "sha512-Ko2tjWJq8oozHzHV+reuvS5KYIRAokHnGbDwGh/J64LntgpbuylF74ipEL24HCyRjf9FOlBiBHWBR1RlVKsI1w==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/suncalc": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@types/suncalc/-/suncalc-1.9.2.tgz", - "integrity": "sha512-ATAGBHHfA1TlE2tjfidLyTcysjoT2JHHEAmWRULh73SU9UTn++j5fqHEW16X6Y/2Li87jEQXzgu4R/OOdlDqzw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/tedious": { - "version": "4.0.14", - "resolved": "https://registry.npmjs.org/@types/tedious/-/tedious-4.0.14.tgz", - "integrity": "sha512-KHPsfX/FoVbUGbyYvk1q9MMQHLPeRZhRJZdO45Q4YjvFkv4hMNghCWTvy7rdKessBsmtz4euWCWAB6/tVpI1Iw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/tough-cookie": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", - "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.46.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.46.2.tgz", - "integrity": "sha512-ZGBMToy857/NIPaaCucIUQgqueOiq7HeAKkhlvqVV4lm089zUFW6ikRySx2v+cAhKeUCPuWVHeimyk6Dw1iY3w==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.46.2", - "@typescript-eslint/type-utils": "8.46.2", - "@typescript-eslint/utils": "8.46.2", - "@typescript-eslint/visitor-keys": "8.46.2", - "graphemer": "^1.4.0", - "ignore": "^7.0.0", - "natural-compare": "^1.4.0", - "ts-api-utils": "^2.1.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^8.46.2", - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <6.0.0" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", - "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/@typescript-eslint/parser": { - "version": "8.46.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.46.2.tgz", - "integrity": "sha512-BnOroVl1SgrPLywqxyqdJ4l3S2MsKVLDVxZvjI1Eoe8ev2r3kGDo+PcMihNmDE+6/KjkTubSJnmqGZZjQSBq/g==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "@typescript-eslint/scope-manager": "8.46.2", - "@typescript-eslint/types": "8.46.2", - "@typescript-eslint/typescript-estree": "8.46.2", - "@typescript-eslint/visitor-keys": "8.46.2", - "debug": "^4.3.4" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <6.0.0" - } - }, - "node_modules/@typescript-eslint/project-service": { - "version": "8.46.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.46.2.tgz", - "integrity": "sha512-PULOLZ9iqwI7hXcmL4fVfIsBi6AN9YxRc0frbvmg8f+4hQAjQ5GYNKK0DIArNo+rOKmR/iBYwkpBmnIwin4wBg==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.46.2", - "@typescript-eslint/types": "^8.46.2", - "debug": "^4.3.4" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "8.46.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.46.2.tgz", - "integrity": "sha512-LF4b/NmGvdWEHD2H4MsHD8ny6JpiVNDzrSZr3CsckEgCbAGZbYM4Cqxvi9L+WqDMT+51Ozy7lt2M+d0JLEuBqA==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "@typescript-eslint/types": "8.46.2", - "@typescript-eslint/visitor-keys": "8.46.2" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.46.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.46.2.tgz", - "integrity": "sha512-a7QH6fw4S57+F5y2FIxxSDyi5M4UfGF+Jl1bCGd7+L4KsaUY80GsiF/t0UoRFDHAguKlBaACWJRmdrc6Xfkkag==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" - } - }, - "node_modules/@typescript-eslint/type-utils": { - "version": "8.46.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.46.2.tgz", - "integrity": "sha512-HbPM4LbaAAt/DjxXaG9yiS9brOOz6fabal4uvUmaUYe6l3K1phQDMQKBRUrr06BQkxkvIZVVHttqiybM9nJsLA==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "@typescript-eslint/types": "8.46.2", - "@typescript-eslint/typescript-estree": "8.46.2", - "@typescript-eslint/utils": "8.46.2", - "debug": "^4.3.4", - "ts-api-utils": "^2.1.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <6.0.0" - } - }, - "node_modules/@typescript-eslint/types": { - "version": "8.46.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.46.2.tgz", - "integrity": "sha512-lNCWCbq7rpg7qDsQrd3D6NyWYu+gkTENkG5IKYhUIcxSb59SQC/hEQ+MrG4sTgBVghTonNWq42bA/d4yYumldQ==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.46.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.46.2.tgz", - "integrity": "sha512-f7rW7LJ2b7Uh2EiQ+7sza6RDZnajbNbemn54Ob6fRwQbgcIn+GWfyuHDHRYgRoZu1P4AayVScrRW+YfbTvPQoQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "@typescript-eslint/project-service": "8.46.2", - "@typescript-eslint/tsconfig-utils": "8.46.2", - "@typescript-eslint/types": "8.46.2", - "@typescript-eslint/visitor-keys": "8.46.2", - "debug": "^4.3.4", - "fast-glob": "^3.3.2", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^2.1.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "license": "ISC", - "peer": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@typescript-eslint/utils": { - "version": "8.46.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.46.2.tgz", - "integrity": "sha512-sExxzucx0Tud5tE0XqR0lT0psBQvEpnpiul9XbGUB1QwpWJJAps1O/Z7hJxLGiZLBKMCutjTzDgmd1muEhBnVg==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.46.2", - "@typescript-eslint/types": "8.46.2", - "@typescript-eslint/typescript-estree": "8.46.2" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <6.0.0" - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.46.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.46.2.tgz", - "integrity": "sha512-tUFMXI4gxzzMXt4xpGJEsBsTox0XbNQ1y94EwlD/CuZwFcQP79xfQqMhau9HsRc/J0cAPA/HZt1dZPtGn9V/7w==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "@typescript-eslint/types": "8.46.2", - "eslint-visitor-keys": "^4.2.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", - "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/acorn": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", - "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", - "dev": true, - "license": "MIT", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-import-attributes": { - "version": "1.9.5", - "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", - "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "acorn": "^8" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/acorn-jsx-walk": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/acorn-jsx-walk/-/acorn-jsx-walk-2.0.0.tgz", - "integrity": "sha512-uuo6iJj4D4ygkdzd6jPtcxs8vZgDX9YFIkqczGImoypX2fQ4dVImmu3UzA4ynixCIMTrEOWW+95M2HuBaCEOVA==", - "dev": true, - "license": "MIT" - }, - "node_modules/acorn-walk": { - "version": "8.3.4", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", - "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", - "dev": true, - "license": "MIT", - "dependencies": { - "acorn": "^8.11.0" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/adm-zip": { - "version": "0.5.16", - "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.16.tgz", - "integrity": "sha512-TGw5yVi4saajsSEgz25grObGHEUaDrniwvA2qwSC060KfqGPdglhvPMA2lPIoxs3PQIItj2iag35fONcQqgUaQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.0" - } - }, - "node_modules/agent-base": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", - "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/alcalzone-shared": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/alcalzone-shared/-/alcalzone-shared-5.0.0.tgz", - "integrity": "sha512-X73hgVWcrIKUUB6jZgHj5flRbTft8AAoJ2MqRKEcAX1whW3OeGkxsQ6ol4nd4/rKxd1eoCRXUGW3cIhXrXU4Sg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - } - }, - "node_modules/ansi-colors": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", - "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/are-docs-informative": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz", - "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true, - "license": "Python-2.0" - }, - "node_modules/array-buffer-byte-length": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", - "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bound": "^1.0.3", - "is-array-buffer": "^3.0.5" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array-includes": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.9.tgz", - "integrity": "sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.4", - "define-properties": "^1.2.1", - "es-abstract": "^1.24.0", - "es-object-atoms": "^1.1.1", - "get-intrinsic": "^1.3.0", - "is-string": "^1.1.1", - "math-intrinsics": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.findlast": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz", - "integrity": "sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "es-shim-unscopables": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.findlastindex": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.6.tgz", - "integrity": "sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.4", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.9", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.1.1", - "es-shim-unscopables": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.flat": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz", - "integrity": "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bind": "^1.0.8", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.5", - "es-shim-unscopables": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.flatmap": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.3.tgz", - "integrity": "sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bind": "^1.0.8", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.5", - "es-shim-unscopables": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.tosorted": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.4.tgz", - "integrity": "sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.3", - "es-errors": "^1.3.0", - "es-shim-unscopables": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/arraybuffer.prototype.slice": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", - "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "array-buffer-byte-length": "^1.0.1", - "call-bind": "^1.0.8", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.5", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.6", - "is-array-buffer": "^3.0.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/arrify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", - "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", - "dev": true, - "license": "MIT", - "engines": { - "node": "*" - } - }, - "node_modules/async-function": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", - "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "license": "MIT" - }, - "node_modules/available-typed-arrays": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", - "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "possible-typed-array-names": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/axios": { - "version": "1.13.6", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.6.tgz", - "integrity": "sha512-ChTCHMouEe2kn713WHbQGcuYrr6fXTBiu460OTwWrWob16g1bXn4vtz07Ope7ewMozJAnEquLk5lWQWtBig9DQ==", - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.15.11", - "form-data": "^4.0.5", - "proxy-from-env": "^1.1.0" - } - }, - "node_modules/axios/node_modules/form-data": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", - "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", - "license": "MIT", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "es-set-tostringtag": "^2.1.0", - "hasown": "^2.0.2", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "license": "MIT" - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/baseline-browser-mapping": { - "version": "2.8.21", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.21.tgz", - "integrity": "sha512-JU0h5APyQNsHOlAM7HnQnPToSDQoEBZqzu/YBlqDnEeymPnZDREeXJA3KBMQee+dKteAxZ2AtvQEvVYdZf241Q==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "bin": { - "baseline-browser-mapping": "dist/cli.js" - } - }, - "node_modules/bignumber.js": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.1.tgz", - "integrity": "sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "*" - } - }, - "node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true, - "license": "ISC" - }, - "node_modules/browserslist": { - "version": "4.27.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.27.0.tgz", - "integrity": "sha512-AXVQwdhot1eqLihwasPElhX2tAZiBjWdJ9i/Zcj2S6QYIjkx62OKSfnobkriB81C3l4w0rVy3Nt4jaTBltYEpw==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "peer": true, - "dependencies": { - "baseline-browser-mapping": "^2.8.19", - "caniuse-lite": "^1.0.30001751", - "electron-to-chromium": "^1.5.238", - "node-releases": "^2.0.26", - "update-browserslist-db": "^1.1.4" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/buffer-equal-constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/builtin-modules": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-5.0.0.tgz", - "integrity": "sha512-bkXY9WsVpY7CvMhKSR6pZilZu9Ln5WDrKVBUXf2S443etkmEO4V58heTecXcUIsNsi4Rx8JUO4NfX1IcQl4deg==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=18.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/call-bind": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", - "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bind-apply-helpers": "^1.0.0", - "es-define-property": "^1.0.0", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/call-bind-apply-helpers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", - "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/call-bound": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", - "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "get-intrinsic": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/caniuse-lite": { - "version": "1.0.30001751", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001751.tgz", - "integrity": "sha512-A0QJhug0Ly64Ii3eIqHu5X51ebln3k4yTUkY1j8drqpWHVreg/VLijN48cZ1bYPiqOQuqpkIKnzr/Ul8V+p6Cw==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/caniuse-lite" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "CC-BY-4.0", - "peer": true - }, - "node_modules/chai": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", - "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", - "dev": true, - "license": "MIT", - "dependencies": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.3", - "deep-eql": "^4.1.3", - "get-func-name": "^2.0.2", - "loupe": "^2.3.6", - "pathval": "^1.1.1", - "type-detect": "^4.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/chai-as-promised": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-7.1.2.tgz", - "integrity": "sha512-aBDHZxRzYnUYuIAIPBH2s511DjlKPzXNlXSGFC8CwmroWQLfrW0LtE1nK3MAwwNhJPa9raEjNCmRoFpG0Hurdw==", - "dev": true, - "license": "WTFPL", - "dependencies": { - "check-error": "^1.0.2" - }, - "peerDependencies": { - "chai": ">= 2.1.2 < 6" - } - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/change-case": { - "version": "5.4.4", - "resolved": "https://registry.npmjs.org/change-case/-/change-case-5.4.4.tgz", - "integrity": "sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==", - "dev": true, - "license": "MIT", - "peer": true - }, - "node_modules/check-error": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", - "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", - "dev": true, - "license": "MIT", - "dependencies": { - "get-func-name": "^2.0.2" - }, - "engines": { - "node": "*" - } - }, - "node_modules/chokidar": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", - "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", - "dev": true, - "license": "MIT", - "dependencies": { - "readdirp": "^4.0.1" - }, - "engines": { - "node": ">= 14.16.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/ci-info": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.3.1.tgz", - "integrity": "sha512-Wdy2Igu8OcBpI2pZePZ5oWjPC38tmDVx5WKUXKwlLYkA0ozo85sLsLvkBbBn/sZaSCMFOGZJ14fvW9t5/d7kdA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "license": "MIT", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/cjs-module-lexer": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-2.2.0.tgz", - "integrity": "sha512-4bHTS2YuzUvtoLjdy+98ykbNB5jS0+07EvFNXerqZQJ89F7DI6ET7OQo/HJuW6K0aVsKA9hj9/RVb2kQVOrPDQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/clean-regexp": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clean-regexp/-/clean-regexp-1.0.0.tgz", - "integrity": "sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "escape-string-regexp": "^1.0.5" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/clean-regexp/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/cliui/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/cliui/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/clsx": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", - "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "license": "MIT", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/comment-parser": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", - "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 12.0.0" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "license": "MIT" - }, - "node_modules/core-js-compat": { - "version": "3.46.0", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.46.0.tgz", - "integrity": "sha512-p9hObIIEENxSV8xIu+V68JjSeARg6UVMG5mR+JEUguG3sI6MsiS1njz2jHmyJDvA+8jX/sytkBHup6kxhM9law==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "browserslist": "^4.26.3" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" - } - }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "license": "MIT" - }, - "node_modules/cron-parser": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-4.9.0.tgz", - "integrity": "sha512-p0SaNjrHOnQeR8/VnfGbmg9te2kfyYSQ7Sc/j/6DtPL3JQvKxmjO9TSjNFpujqV3vEYYBvNNvXSxzyksBWAx1Q==", - "license": "MIT", - "dependencies": { - "luxon": "^3.2.1" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/cross-spawn": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/csstype": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", - "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", - "dev": true, - "license": "MIT" - }, - "node_modules/data-uri-to-buffer": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", - "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 12" - } - }, - "node_modules/data-view-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", - "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bound": "^1.0.3", - "es-errors": "^1.3.0", - "is-data-view": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/data-view-byte-length": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", - "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bound": "^1.0.3", - "es-errors": "^1.3.0", - "is-data-view": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/inspect-js" - } - }, - "node_modules/data-view-byte-offset": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", - "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "is-data-view": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/deep-eql": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", - "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==", - "dev": true, - "license": "MIT", - "dependencies": { - "type-detect": "^4.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true, - "license": "MIT", - "peer": true - }, - "node_modules/deepl-node": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/deepl-node/-/deepl-node-1.20.0.tgz", - "integrity": "sha512-2MNJgJgQQWHAieaKYJyxYe1g21P8MYOtMbcS7ApyBHT8856c6EYO9RRNevodGaIf0oiKMzwyenJ59O7B0NQyGw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": ">=12.0", - "adm-zip": "^0.5.16", - "axios": "^1.7.4", - "form-data": "^3.0.0", - "loglevel": ">=1.6.2", - "uuid": "^8.3.2" - }, - "engines": { - "node": ">=12.0" - } - }, - "node_modules/deepl-node/node_modules/form-data": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.4.tgz", - "integrity": "sha512-f0cRzm6dkyVYV3nPoooP8XlccPQukegwhAnpoLcXy+X+A8KfpGOoXwDr9FLZd3wzgLaBGQBE3lY93Zm/i1JvIQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "es-set-tostringtag": "^2.1.0", - "hasown": "^2.0.2", - "mime-types": "^2.1.35" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/define-properties": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", - "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "define-data-property": "^1.0.1", - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "license": "MIT", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/diff": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", - "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/dom-helpers": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", - "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.8.7", - "csstype": "^3.0.2" - } - }, - "node_modules/dunder-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "es-errors": "^1.3.0", - "gopd": "^1.2.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/duplexify": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.3.tgz", - "integrity": "sha512-M3BmBhwJRZsSx38lZyhE53Csddgzl5R7xGJNk7CVddZD6CcmwMCH8J+7AprIrQKH7TonKxaCjcv27Qmf+sQ+oA==", - "dev": true, - "license": "MIT", - "dependencies": { - "end-of-stream": "^1.4.1", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1", - "stream-shift": "^1.0.2" - } - }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true, - "license": "MIT" - }, - "node_modules/ecdsa-sig-formatter": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", - "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "safe-buffer": "^5.0.1" - } - }, - "node_modules/electron-to-chromium": { - "version": "1.5.243", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.243.tgz", - "integrity": "sha512-ZCphxFW3Q1TVhcgS9blfut1PX8lusVi2SvXQgmEEnK4TCmE1JhH2JkjJN+DNt0pJJwfBri5AROBnz2b/C+YU9g==", - "dev": true, - "license": "ISC", - "peer": true - }, - "node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true, - "license": "MIT" - }, - "node_modules/end-of-stream": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", - "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", - "dev": true, - "license": "MIT", - "dependencies": { - "once": "^1.4.0" - } - }, - "node_modules/enquirer": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", - "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-colors": "^4.1.1", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/es-abstract": { - "version": "1.24.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.0.tgz", - "integrity": "sha512-WSzPgsdLtTcQwm4CROfS5ju2Wa1QQcVeT37jFjYzdFz1r9ahadC8B8/a4qxJxM+09F18iumCdRmlr96ZYkQvEg==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "array-buffer-byte-length": "^1.0.2", - "arraybuffer.prototype.slice": "^1.0.4", - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.8", - "call-bound": "^1.0.4", - "data-view-buffer": "^1.0.2", - "data-view-byte-length": "^1.0.2", - "data-view-byte-offset": "^1.0.1", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.1.1", - "es-set-tostringtag": "^2.1.0", - "es-to-primitive": "^1.3.0", - "function.prototype.name": "^1.1.8", - "get-intrinsic": "^1.3.0", - "get-proto": "^1.0.1", - "get-symbol-description": "^1.1.0", - "globalthis": "^1.0.4", - "gopd": "^1.2.0", - "has-property-descriptors": "^1.0.2", - "has-proto": "^1.2.0", - "has-symbols": "^1.1.0", - "hasown": "^2.0.2", - "internal-slot": "^1.1.0", - "is-array-buffer": "^3.0.5", - "is-callable": "^1.2.7", - "is-data-view": "^1.0.2", - "is-negative-zero": "^2.0.3", - "is-regex": "^1.2.1", - "is-set": "^2.0.3", - "is-shared-array-buffer": "^1.0.4", - "is-string": "^1.1.1", - "is-typed-array": "^1.1.15", - "is-weakref": "^1.1.1", - "math-intrinsics": "^1.1.0", - "object-inspect": "^1.13.4", - "object-keys": "^1.1.1", - "object.assign": "^4.1.7", - "own-keys": "^1.0.1", - "regexp.prototype.flags": "^1.5.4", - "safe-array-concat": "^1.1.3", - "safe-push-apply": "^1.0.0", - "safe-regex-test": "^1.1.0", - "set-proto": "^1.0.0", - "stop-iteration-iterator": "^1.1.0", - "string.prototype.trim": "^1.2.10", - "string.prototype.trimend": "^1.0.9", - "string.prototype.trimstart": "^1.0.8", - "typed-array-buffer": "^1.0.3", - "typed-array-byte-length": "^1.0.3", - "typed-array-byte-offset": "^1.0.4", - "typed-array-length": "^1.0.7", - "unbox-primitive": "^1.1.0", - "which-typed-array": "^1.1.19" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/es-define-property": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-iterator-helpers": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.2.1.tgz", - "integrity": "sha512-uDn+FE1yrDzyC0pCo961B2IHbdM8y/ACZsKD4dG6WqrjV53BADjwa7D+1aom2rsNVfLyDgU/eigvlJGJ08OQ4w==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.6", - "es-errors": "^1.3.0", - "es-set-tostringtag": "^2.0.3", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.6", - "globalthis": "^1.0.4", - "gopd": "^1.2.0", - "has-property-descriptors": "^1.0.2", - "has-proto": "^1.2.0", - "has-symbols": "^1.1.0", - "internal-slot": "^1.1.0", - "iterator.prototype": "^1.1.4", - "safe-array-concat": "^1.1.3" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-object-atoms": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", - "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-set-tostringtag": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", - "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.6", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-shim-unscopables": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz", - "integrity": "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-to-primitive": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", - "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "is-callable": "^1.2.7", - "is-date-object": "^1.0.5", - "is-symbol": "^1.0.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/esbuild": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.11.tgz", - "integrity": "sha512-KohQwyzrKTQmhXDW1PjCv3Tyspn9n5GcY2RTDqeORIdIJY8yKIF7sTSopFmn/wpMPW4rdPXI0UE5LJLuq3bx0Q==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.25.11", - "@esbuild/android-arm": "0.25.11", - "@esbuild/android-arm64": "0.25.11", - "@esbuild/android-x64": "0.25.11", - "@esbuild/darwin-arm64": "0.25.11", - "@esbuild/darwin-x64": "0.25.11", - "@esbuild/freebsd-arm64": "0.25.11", - "@esbuild/freebsd-x64": "0.25.11", - "@esbuild/linux-arm": "0.25.11", - "@esbuild/linux-arm64": "0.25.11", - "@esbuild/linux-ia32": "0.25.11", - "@esbuild/linux-loong64": "0.25.11", - "@esbuild/linux-mips64el": "0.25.11", - "@esbuild/linux-ppc64": "0.25.11", - "@esbuild/linux-riscv64": "0.25.11", - "@esbuild/linux-s390x": "0.25.11", - "@esbuild/linux-x64": "0.25.11", - "@esbuild/netbsd-arm64": "0.25.11", - "@esbuild/netbsd-x64": "0.25.11", - "@esbuild/openbsd-arm64": "0.25.11", - "@esbuild/openbsd-x64": "0.25.11", - "@esbuild/openharmony-arm64": "0.25.11", - "@esbuild/sunos-x64": "0.25.11", - "@esbuild/win32-arm64": "0.25.11", - "@esbuild/win32-ia32": "0.25.11", - "@esbuild/win32-x64": "0.25.11" - } - }, - "node_modules/escalade": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint": { - "version": "9.38.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.38.0.tgz", - "integrity": "sha512-t5aPOpmtJcZcz5UJyY2GbvpDlsK5E8JqRqoKtfiKE3cNh437KIqfJr3A3AKf5k64NPx6d0G3dno6XDY05PqPtw==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.8.0", - "@eslint-community/regexpp": "^4.12.1", - "@eslint/config-array": "^0.21.1", - "@eslint/config-helpers": "^0.4.1", - "@eslint/core": "^0.16.0", - "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "9.38.0", - "@eslint/plugin-kit": "^0.4.0", - "@humanfs/node": "^0.16.6", - "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.4.2", - "@types/estree": "^1.0.6", - "ajv": "^6.12.4", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.6", - "debug": "^4.3.2", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.4.0", - "eslint-visitor-keys": "^4.2.1", - "espree": "^10.4.0", - "esquery": "^1.5.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^8.0.0", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "ignore": "^5.2.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.3" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://eslint.org/donate" - }, - "peerDependencies": { - "jiti": "*" - }, - "peerDependenciesMeta": { - "jiti": { - "optional": true - } - } - }, - "node_modules/eslint-config-prettier": { - "version": "10.1.8", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz", - "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", - "dev": true, - "license": "MIT", - "peer": true, - "bin": { - "eslint-config-prettier": "bin/cli.js" - }, - "funding": { - "url": "https://opencollective.com/eslint-config-prettier" - }, - "peerDependencies": { - "eslint": ">=7.0.0" - } - }, - "node_modules/eslint-import-resolver-node": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", - "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "debug": "^3.2.7", - "is-core-module": "^2.13.0", - "resolve": "^1.22.4" - } - }, - "node_modules/eslint-import-resolver-node/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/eslint-module-utils": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.1.tgz", - "integrity": "sha512-L8jSWTze7K2mTg0vos/RuLRS5soomksDPoJLXIslC7c8Wmut3bx7CPpJijDcBZtxQ5lrbUdM+s0OlNbz0DCDNw==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "debug": "^3.2.7" - }, - "engines": { - "node": ">=4" - }, - "peerDependenciesMeta": { - "eslint": { - "optional": true - } - } - }, - "node_modules/eslint-module-utils/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/eslint-plugin-import": { - "version": "2.32.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.32.0.tgz", - "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "@rtsao/scc": "^1.1.0", - "array-includes": "^3.1.9", - "array.prototype.findlastindex": "^1.2.6", - "array.prototype.flat": "^1.3.3", - "array.prototype.flatmap": "^1.3.3", - "debug": "^3.2.7", - "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.9", - "eslint-module-utils": "^2.12.1", - "hasown": "^2.0.2", - "is-core-module": "^2.16.1", - "is-glob": "^4.0.3", - "minimatch": "^3.1.2", - "object.fromentries": "^2.0.8", - "object.groupby": "^1.0.3", - "object.values": "^1.2.1", - "semver": "^6.3.1", - "string.prototype.trimend": "^1.0.9", - "tsconfig-paths": "^3.15.0" - }, - "engines": { - "node": ">=4" - }, - "peerDependencies": { - "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" - } - }, - "node_modules/eslint-plugin-import/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/eslint-plugin-import/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "license": "ISC", - "peer": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/eslint-plugin-jsdoc": { - "version": "54.7.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-54.7.0.tgz", - "integrity": "sha512-u5Na4he2+6kY1rWqxzbQaAwJL3/tDCuT5ElDRc5UJ9stOeQeQ5L1JJ1kRRu7ldYMlOHMCJLsY8Mg/Tu3ExdZiQ==", - "dev": true, - "license": "BSD-3-Clause", - "peer": true, - "dependencies": { - "@es-joy/jsdoccomment": "~0.56.0", - "are-docs-informative": "^0.0.2", - "comment-parser": "1.4.1", - "debug": "^4.4.1", - "escape-string-regexp": "^4.0.0", - "espree": "^10.4.0", - "esquery": "^1.6.0", - "parse-imports-exports": "^0.2.4", - "semver": "^7.7.2", - "spdx-expression-parse": "^4.0.0" - }, - "engines": { - "node": ">=20.11.0" - }, - "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" - } - }, - "node_modules/eslint-plugin-prettier": { - "version": "5.5.4", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.4.tgz", - "integrity": "sha512-swNtI95SToIz05YINMA6Ox5R057IMAmWZ26GqPxusAp1TZzj+IdY9tXNWWD3vkF/wEqydCONcwjTFpxybBqZsg==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "prettier-linter-helpers": "^1.0.0", - "synckit": "^0.11.7" - }, - "engines": { - "node": "^14.18.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint-plugin-prettier" - }, - "peerDependencies": { - "@types/eslint": ">=8.0.0", - "eslint": ">=8.0.0", - "eslint-config-prettier": ">= 7.0.0 <10.0.0 || >=10.1.0", - "prettier": ">=3.0.0" - }, - "peerDependenciesMeta": { - "@types/eslint": { - "optional": true - }, - "eslint-config-prettier": { - "optional": true - } - } - }, - "node_modules/eslint-plugin-react": { - "version": "7.37.5", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.5.tgz", - "integrity": "sha512-Qteup0SqU15kdocexFNAJMvCJEfa2xUKNV4CC1xsVMrIIqEy3SQ/rqyxCWNzfrd3/ldy6HMlD2e0JDVpDg2qIA==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "array-includes": "^3.1.8", - "array.prototype.findlast": "^1.2.5", - "array.prototype.flatmap": "^1.3.3", - "array.prototype.tosorted": "^1.1.4", - "doctrine": "^2.1.0", - "es-iterator-helpers": "^1.2.1", - "estraverse": "^5.3.0", - "hasown": "^2.0.2", - "jsx-ast-utils": "^2.4.1 || ^3.0.0", - "minimatch": "^3.1.2", - "object.entries": "^1.1.9", - "object.fromentries": "^2.0.8", - "object.values": "^1.2.1", - "prop-types": "^15.8.1", - "resolve": "^2.0.0-next.5", - "semver": "^6.3.1", - "string.prototype.matchall": "^4.0.12", - "string.prototype.repeat": "^1.0.0" - }, - "engines": { - "node": ">=4" - }, - "peerDependencies": { - "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" - } - }, - "node_modules/eslint-plugin-react-hooks": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-5.2.0.tgz", - "integrity": "sha512-+f15FfK64YQwZdJNELETdn5ibXEUQmW1DZL6KXhNnc2heoy/sg9VJJeT7n8TlMWouzWqSWavFkIhHyIbIAEapg==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0" - } - }, - "node_modules/eslint-plugin-react/node_modules/resolve": { - "version": "2.0.0-next.5", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", - "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "is-core-module": "^2.13.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/eslint-plugin-react/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "license": "ISC", - "peer": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/eslint-plugin-unicorn": { - "version": "60.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-60.0.0.tgz", - "integrity": "sha512-QUzTefvP8stfSXsqKQ+vBQSEsXIlAiCduS/V1Em+FKgL9c21U/IIm20/e3MFy1jyCf14tHAhqC1sX8OTy6VUCg==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.27.1", - "@eslint-community/eslint-utils": "^4.7.0", - "@eslint/plugin-kit": "^0.3.3", - "change-case": "^5.4.4", - "ci-info": "^4.3.0", - "clean-regexp": "^1.0.0", - "core-js-compat": "^3.44.0", - "esquery": "^1.6.0", - "find-up-simple": "^1.0.1", - "globals": "^16.3.0", - "indent-string": "^5.0.0", - "is-builtin-module": "^5.0.0", - "jsesc": "^3.1.0", - "pluralize": "^8.0.0", - "regexp-tree": "^0.1.27", - "regjsparser": "^0.12.0", - "semver": "^7.7.2", - "strip-indent": "^4.0.0" - }, - "engines": { - "node": "^20.10.0 || >=21.0.0" - }, - "funding": { - "url": "https://github.com/sindresorhus/eslint-plugin-unicorn?sponsor=1" - }, - "peerDependencies": { - "eslint": ">=9.29.0" - } - }, - "node_modules/eslint-plugin-unicorn/node_modules/@eslint/core": { - "version": "0.15.2", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.15.2.tgz", - "integrity": "sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@types/json-schema": "^7.0.15" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/eslint-plugin-unicorn/node_modules/@eslint/plugin-kit": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.5.tgz", - "integrity": "sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@eslint/core": "^0.15.2", - "levn": "^0.4.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/eslint-scope": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", - "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", - "dev": true, - "license": "BSD-2-Clause", - "peer": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", - "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/espree": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", - "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", - "dev": true, - "license": "BSD-2-Clause", - "peer": true, - "dependencies": { - "acorn": "^8.15.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.2.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", - "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/esquery": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", - "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", - "dev": true, - "license": "BSD-3-Clause", - "peer": true, - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "license": "BSD-2-Clause", - "peer": true, - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "license": "BSD-2-Clause", - "peer": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "license": "BSD-2-Clause", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "dev": true, - "license": "MIT", - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true, - "license": "MIT" - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "license": "MIT", - "peer": true - }, - "node_modules/fast-diff": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", - "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", - "dev": true, - "license": "Apache-2.0", - "peer": true - }, - "node_modules/fast-glob": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", - "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.8" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-glob/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "license": "ISC", - "peer": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true, - "license": "MIT", - "peer": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true, - "license": "MIT", - "peer": true - }, - "node_modules/fastq": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", - "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", - "dev": true, - "license": "ISC", - "peer": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/fetch-blob": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", - "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "paypal", - "url": "https://paypal.me/jimmywarting" - } - ], - "license": "MIT", - "dependencies": { - "node-domexception": "^1.0.0", - "web-streams-polyfill": "^3.0.3" - }, - "engines": { - "node": "^12.20 || >= 14.13" - } - }, - "node_modules/file-entry-cache": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", - "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "flat-cache": "^4.0.0" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "license": "MIT", - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/find-up-simple": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.1.tgz", - "integrity": "sha512-afd4O7zpqHeRyg4PfDQsXmlDe2PfdHtJt6Akt8jOWaApLOZk5JXs6VMR29lz03pRe9mpykrRCYIYxaJYcfpncQ==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "dev": true, - "license": "BSD-3-Clause", - "bin": { - "flat": "cli.js" - } - }, - "node_modules/flat-cache": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", - "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "flatted": "^3.2.9", - "keyv": "^4.5.4" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/flatted": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", - "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", - "dev": true, - "license": "ISC", - "peer": true - }, - "node_modules/follow-redirects": { - "version": "1.15.11", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", - "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "license": "MIT", - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, - "node_modules/for-each": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", - "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "is-callable": "^1.2.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/foreground-child": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", - "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", - "dev": true, - "license": "ISC", - "dependencies": { - "cross-spawn": "^7.0.6", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/foreground-child/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/form-data": { - "version": "2.5.5", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.5.tgz", - "integrity": "sha512-jqdObeR2rxZZbPSGL+3VckHMYtu+f9//KXBsVny6JSX/pa38Fy+bGjuG8eW/H6USNQWhLi8Num++cU2yOCNz4A==", - "dev": true, - "license": "MIT", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "es-set-tostringtag": "^2.1.0", - "hasown": "^2.0.2", - "mime-types": "^2.1.35", - "safe-buffer": "^5.2.1" - }, - "engines": { - "node": ">= 0.12" - } - }, - "node_modules/formdata-polyfill": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", - "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", - "dev": true, - "license": "MIT", - "dependencies": { - "fetch-blob": "^3.1.2" - }, - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/forwarded-parse": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/forwarded-parse/-/forwarded-parse-2.1.2.tgz", - "integrity": "sha512-alTFZZQDKMporBH77856pXgzhEzaUVmLCDk+egLgIgHst3Tpndzz8MnKe+GzRJRfvVdn69HhpW7cmXzvtLvJAw==", - "dev": true, - "license": "MIT" - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/function.prototype.name": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", - "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "define-properties": "^1.2.1", - "functions-have-names": "^1.2.3", - "hasown": "^2.0.2", - "is-callable": "^1.2.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/functions-have-names": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", - "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", - "dev": true, - "license": "MIT", - "peer": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/gaxios": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-7.1.2.tgz", - "integrity": "sha512-/Szrn8nr+2TsQT1Gp8iIe/BEytJmbyfrbFh419DfGQSkEgNEhbPi7JRJuughjkTzPWgU9gBQf5AVu3DbHt0OXA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "extend": "^3.0.2", - "https-proxy-agent": "^7.0.1", - "node-fetch": "^3.3.2" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/gcp-metadata": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-8.1.1.tgz", - "integrity": "sha512-dTCcAe9fRQf06ELwel6lWWFrEbstwjUBYEhr5VRGoC+iPDZQucHppCowaIp8b8v92tU1G4X4H3b/Y6zXZxkMsQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "gaxios": "^7.0.0", - "google-logging-utils": "^1.0.0", - "json-bigint": "^1.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/generator-function": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/generator-function/-/generator-function-2.0.1.tgz", - "integrity": "sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, - "license": "ISC", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/get-east-asian-width": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.4.0.tgz", - "integrity": "sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/get-func-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", - "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "*" - } - }, - "node_modules/get-intrinsic": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", - "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.1.1", - "function-bind": "^1.1.2", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "has-symbols": "^1.1.0", - "hasown": "^2.0.2", - "math-intrinsics": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", - "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "license": "MIT", - "dependencies": { - "dunder-proto": "^1.0.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/get-symbol-description": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", - "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bound": "^1.0.3", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.6" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/glob": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", - "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", - "dev": true, - "license": "ISC", - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "license": "ISC", - "peer": true, - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/glob/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/glob/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/globals": { - "version": "16.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-16.4.0.tgz", - "integrity": "sha512-ob/2LcVVaVGCYN+r14cnwnoDPUufjiYgSqRhiFD0Q1iI4Odora5RE8Iv1D24hAz5oMophRGkGz+yuvQmmUMnMw==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globalthis": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", - "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "define-properties": "^1.2.1", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/globalyzer": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz", - "integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/globrex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", - "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==", - "dev": true, - "license": "MIT" - }, - "node_modules/google-auth-library": { - "version": "10.4.2", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-10.4.2.tgz", - "integrity": "sha512-EKiQasw6aEdxSovPEf1oBxCEvxjFamZ6MPaVOSPXZMnqKFLo+rrYjHyjKlFfZcXiKi9qAH6cutr5WRqqa1jKhg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "base64-js": "^1.3.0", - "ecdsa-sig-formatter": "^1.0.11", - "gaxios": "^7.0.0", - "gcp-metadata": "^8.0.0", - "google-logging-utils": "^1.0.0", - "gtoken": "^8.0.0", - "jws": "^4.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/google-gax": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-5.0.4.tgz", - "integrity": "sha512-HmQ6zIYBs2EikTk+kjeHmtHprNTEpsnVaKONw9cwZZwUNCkUb+D5RYrJpCxyjdvIDvJp3wLbVReolJLRZRms1g==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@grpc/grpc-js": "^1.12.6", - "@grpc/proto-loader": "^0.8.0", - "duplexify": "^4.1.3", - "google-auth-library": "^10.1.0", - "google-logging-utils": "^1.1.1", - "node-fetch": "^3.3.2", - "object-hash": "^3.0.0", - "proto3-json-serializer": "^3.0.0", - "protobufjs": "^7.5.3", - "retry-request": "^8.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/google-logging-utils": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-1.1.1.tgz", - "integrity": "sha512-rcX58I7nqpu4mbKztFeOAObbomBbHU2oIb/d3tJfF3dizGSApqtSwYJigGCooHdnMyQBIw8BrWyK96w3YXgr6A==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=14" - } - }, - "node_modules/gopd": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true, - "license": "MIT", - "peer": true - }, - "node_modules/gtoken": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-8.0.0.tgz", - "integrity": "sha512-+CqsMbHPiSTdtSO14O51eMNlrp9N79gmeqmXeouJOhfucAedHw9noVe/n5uJk3tbKE6a+6ZCQg3RPhVhHByAIw==", - "dev": true, - "license": "MIT", - "dependencies": { - "gaxios": "^7.0.0", - "jws": "^4.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/has-bigints": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", - "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", - "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "dunder-proto": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "license": "MIT", - "dependencies": { - "has-symbols": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true, - "license": "MIT", - "bin": { - "he": "bin/he" - } - }, - "node_modules/html-entities": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.6.0.tgz", - "integrity": "sha512-kig+rMn/QOVRvr7c86gQ8lWXq+Hkv6CbAH1hLu+RG338StTpE8Z0b44SDVaqVu7HGKf27frdmUYEs9hTUX/cLQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/mdevils" - }, - { - "type": "patreon", - "url": "https://patreon.com/mdevils" - } - ], - "license": "MIT" - }, - "node_modules/html-tags": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/html-tags/-/html-tags-3.3.1.tgz", - "integrity": "sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/http-proxy-agent/node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/https-proxy-agent": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", - "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.1.2", - "debug": "4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=10.17.0" - } - }, - "node_modules/ignore": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", - "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/immediate": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", - "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==", - "license": "MIT" - }, - "node_modules/import-fresh": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", - "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/import-in-the-middle": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-3.0.0.tgz", - "integrity": "sha512-OnGy+eYT7wVejH2XWgLRgbmzujhhVIATQH0ztIeRilwHBjTeG3pD+XnH3PKX0r9gJ0BuJmJ68q/oh9qgXnNDQg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "acorn": "^8.15.0", - "acorn-import-attributes": "^1.9.5", - "cjs-module-lexer": "^2.2.0", - "module-details-from-path": "^1.0.4" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/indent-string": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", - "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "license": "ISC" - }, - "node_modules/internal-slot": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", - "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "es-errors": "^1.3.0", - "hasown": "^2.0.2", - "side-channel": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/is-array-buffer": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", - "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "get-intrinsic": "^1.2.6" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-async-function": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", - "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "async-function": "^1.0.0", - "call-bound": "^1.0.3", - "get-proto": "^1.0.1", - "has-tostringtag": "^1.0.2", - "safe-regex-test": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-bigint": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", - "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "has-bigints": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-boolean-object": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", - "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bound": "^1.0.3", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-builtin-module": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-5.0.0.tgz", - "integrity": "sha512-f4RqJKBUe5rQkJ2eJEJBXSticB3hGbN9j0yxxMQFqIW89Jp9WYFtzfTcRlstDKVUTRzSOTLKRfO9vIztenwtxA==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "builtin-modules": "^5.0.0" - }, - "engines": { - "node": ">=18.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-callable": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-core-module": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", - "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-data-view": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", - "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bound": "^1.0.2", - "get-intrinsic": "^1.2.6", - "is-typed-array": "^1.1.13" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-date-object": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", - "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bound": "^1.0.2", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-finalizationregistry": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", - "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bound": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-generator-function": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz", - "integrity": "sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bound": "^1.0.4", - "generator-function": "^2.0.0", - "get-proto": "^1.0.1", - "has-tostringtag": "^1.0.2", - "safe-regex-test": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-html": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-html/-/is-html-2.0.0.tgz", - "integrity": "sha512-S+OpgB5i7wzIue/YSE5hg0e5ZYfG3hhpNh9KGl6ayJ38p7ED6wxQLd1TV91xHpcTvw90KMJ9EwN3F/iNflHBVg==", - "dev": true, - "license": "MIT", - "dependencies": { - "html-tags": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-map": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", - "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-negative-zero": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", - "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-number-object": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", - "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bound": "^1.0.3", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-regex": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", - "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bound": "^1.0.2", - "gopd": "^1.2.0", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-set": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", - "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-shared-array-buffer": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", - "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bound": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-string": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", - "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bound": "^1.0.3", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-symbol": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", - "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bound": "^1.0.2", - "has-symbols": "^1.1.0", - "safe-regex-test": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-typed-array": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", - "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "which-typed-array": "^1.1.16" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-weakmap": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", - "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-weakref": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", - "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bound": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-weakset": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", - "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bound": "^1.0.3", - "get-intrinsic": "^1.2.6" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/isarray": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true, - "license": "MIT", - "peer": true - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "license": "ISC" - }, - "node_modules/iterator.prototype": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.5.tgz", - "integrity": "sha512-H0dkQoCa3b2VEeKQBOxFph+JAbcrQdE7KC0UkqwpLmv2EC4P41QXP+rqo9wYodACiG5/WM5s9oDApTU8utwj9g==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "define-data-property": "^1.1.4", - "es-object-atoms": "^1.0.0", - "get-intrinsic": "^1.2.6", - "get-proto": "^1.0.0", - "has-symbols": "^1.1.0", - "set-function-name": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/jackspeak": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", - "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" - } - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/jsdoc-type-pratt-parser": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-5.1.1.tgz", - "integrity": "sha512-DYYlVP1fe4QBMh2xTIs20/YeTz2GYVbWAEZweHSZD+qQ/Cx2d5RShuhhsdk64eTjNq0FeVnteP/qVOgaywSRbg==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/jsesc": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", - "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", - "dev": true, - "license": "MIT", - "peer": true, - "bin": { - "jsesc": "bin/jsesc" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/json-bigint": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", - "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "bignumber.js": "^9.0.0" - } - }, - "node_modules/json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true, - "license": "MIT", - "peer": true - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true, - "license": "MIT", - "peer": true - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true, - "license": "MIT", - "peer": true - }, - "node_modules/json5": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", - "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "minimist": "^1.2.0" - }, - "bin": { - "json5": "lib/cli.js" - } - }, - "node_modules/jsonata": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/jsonata/-/jsonata-2.1.0.tgz", - "integrity": "sha512-OCzaRMK8HobtX8fp37uIVmL8CY1IGc/a6gLsDqz3quExFR09/U78HUzWYr7T31UEB6+Eu0/8dkVD5fFDOl9a8w==", - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, - "node_modules/jsonc-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz", - "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", - "dev": true, - "license": "MIT", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/jsx-ast-utils": { - "version": "3.3.5", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", - "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "array-includes": "^3.1.6", - "array.prototype.flat": "^1.3.1", - "object.assign": "^4.1.4", - "object.values": "^1.1.6" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/jszip": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", - "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==", - "license": "(MIT OR GPL-3.0-or-later)", - "dependencies": { - "lie": "~3.3.0", - "pako": "~1.0.2", - "readable-stream": "~2.3.6", - "setimmediate": "^1.0.5" - } - }, - "node_modules/jszip/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "license": "MIT" - }, - "node_modules/jszip/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "license": "MIT", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/jszip/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "license": "MIT" - }, - "node_modules/jszip/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/jwa": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz", - "integrity": "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==", - "dev": true, - "license": "MIT", - "dependencies": { - "buffer-equal-constant-time": "^1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/jws": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.1.tgz", - "integrity": "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==", - "dev": true, - "license": "MIT", - "dependencies": { - "jwa": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/keyv": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "json-buffer": "3.0.1" - } - }, - "node_modules/ky": { - "version": "1.14.3", - "resolved": "https://registry.npmjs.org/ky/-/ky-1.14.3.tgz", - "integrity": "sha512-9zy9lkjac+TR1c2tG+mkNSVlyOpInnWdSMiue4F+kq8TwJSgv6o8jhLRg8Ho6SnZ9wOYUq/yozts9qQCfk7bIw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sindresorhus/ky?sponsor=1" - } - }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/lie": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", - "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", - "license": "MIT", - "dependencies": { - "immediate": "~3.0.5" - } - }, - "node_modules/localforage": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/localforage/-/localforage-1.10.0.tgz", - "integrity": "sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "lie": "3.1.1" - } - }, - "node_modules/localforage/node_modules/lie": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz", - "integrity": "sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==", - "dev": true, - "license": "MIT", - "dependencies": { - "immediate": "~3.0.5" - } - }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", - "dev": true, - "license": "MIT" - }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true, - "license": "MIT", - "peer": true - }, - "node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/loglevel": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.9.2.tgz", - "integrity": "sha512-HgMmCqIJSAKqo68l0rS2AanEWfkxaZ5wNiEFb5ggm08lDs9Xl2KxBlX3PTcaD2chBM1gXAYf491/M2Rv8Jwayg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6.0" - }, - "funding": { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/loglevel" - } - }, - "node_modules/long": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", - "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", - "dev": true, - "license": "Apache-2.0" - }, - "node_modules/long-timeout": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/long-timeout/-/long-timeout-0.1.1.tgz", - "integrity": "sha512-BFRuQUqc7x2NWxfJBCyUrN8iYUYznzL9JROmRz1gZ6KlOIgmoD+njPVbb+VNn2nGMKggMsK79iUNErillsrx7w==", - "license": "MIT" - }, - "node_modules/loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "js-tokens": "^3.0.0 || ^4.0.0" - }, - "bin": { - "loose-envify": "cli.js" - } - }, - "node_modules/loupe": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", - "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", - "dev": true, - "license": "MIT", - "dependencies": { - "get-func-name": "^2.0.1" - } - }, - "node_modules/lru-cache": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/luxon": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.7.2.tgz", - "integrity": "sha512-vtEhXh/gNjI9Yg1u4jX/0YVPMvxzHuGgCm6tC5kZyb08yjGWGnqAjGJvcXbqQR2P3MyMEFnRbpcdFS6PBcLqew==", - "license": "MIT", - "engines": { - "node": ">=12" - } - }, - "node_modules/math-intrinsics": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", - "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true, - "license": "MIT" - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", - "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "braces": "^3.0.3", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "license": "MIT", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/minipass": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", - "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/mocha": { - "version": "11.7.4", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.4.tgz", - "integrity": "sha512-1jYAaY8x0kAZ0XszLWu14pzsf4KV740Gld4HXkhNTXwcHx4AUEDkPzgEHg9CM5dVcW+zv036tjpsEbLraPJj4w==", - "dev": true, - "license": "MIT", - "dependencies": { - "browser-stdout": "^1.3.1", - "chokidar": "^4.0.1", - "debug": "^4.3.5", - "diff": "^7.0.0", - "escape-string-regexp": "^4.0.0", - "find-up": "^5.0.0", - "glob": "^10.4.5", - "he": "^1.2.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", - "log-symbols": "^4.1.0", - "minimatch": "^9.0.5", - "ms": "^2.1.3", - "picocolors": "^1.1.1", - "serialize-javascript": "^6.0.2", - "strip-json-comments": "^3.1.1", - "supports-color": "^8.1.1", - "workerpool": "^9.2.0", - "yargs": "^17.7.2", - "yargs-parser": "^21.1.1", - "yargs-unparser": "^2.0.0" - }, - "bin": { - "_mocha": "bin/_mocha", - "mocha": "bin/mocha.js" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/mocha/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/mocha/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/mocha/node_modules/picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true, - "license": "ISC" - }, - "node_modules/mocha/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/module-details-from-path": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.4.tgz", - "integrity": "sha512-EGWKgxALGMgzvxYF1UyGTy0HXX/2vHLkw6+NvDKW2jypWbHpjQuj4UMcqQWXHERJhVGKikolT06G3bcKe4fi7w==", - "dev": true, - "license": "MIT" - }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "license": "MIT" - }, - "node_modules/nano-spawn": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/nano-spawn/-/nano-spawn-2.0.0.tgz", - "integrity": "sha512-tacvGzUY5o2D8CBh2rrwxyNojUsZNU2zjNTzKQrkgGJQTbGAfArVWXSKMBokBeeg6C7OLRGUEyoFlYbfeWQIqw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=20.17" - }, - "funding": { - "url": "https://github.com/sindresorhus/nano-spawn?sponsor=1" - } - }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true, - "license": "MIT", - "peer": true - }, - "node_modules/node-dir": { - "version": "0.1.17", - "resolved": "https://registry.npmjs.org/node-dir/-/node-dir-0.1.17.tgz", - "integrity": "sha512-tmPX422rYgofd4epzrNoOXiE8XFZYOcCq1vD7MAXCDO+O+zndlA2ztdKKMa+EeuBG5tHETpr4ml4RGgpqDCCAg==", - "dev": true, - "license": "MIT", - "dependencies": { - "minimatch": "^3.0.2" - }, - "engines": { - "node": ">= 0.10.5" - } - }, - "node_modules/node-domexception": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", - "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", - "deprecated": "Use your platform's native DOMException instead", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "github", - "url": "https://paypal.me/jimmywarting" - } - ], - "license": "MIT", - "engines": { - "node": ">=10.5.0" - } - }, - "node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", - "dev": true, - "license": "MIT", - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, - "node_modules/node-inspect": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/node-inspect/-/node-inspect-2.0.0.tgz", - "integrity": "sha512-vaDNU6Fa/vt8gv/PV+QoeSIPhcBnHMiNOtInxcojfagspQg5KP9HloUDGJWIacamT8Agiu51eF+fuBjrE25a6w==", - "deprecated": "This module is part of Node.js core and does not need to be installed separately. It is now unmaintained.", - "license": "MIT", - "bin": { - "node-inspect": "cli.js" - } - }, - "node_modules/node-releases": { - "version": "2.0.27", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz", - "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==", - "dev": true, - "license": "MIT", - "peer": true - }, - "node_modules/node-schedule": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/node-schedule/-/node-schedule-2.1.1.tgz", - "integrity": "sha512-OXdegQq03OmXEjt2hZP33W2YPs/E5BcFQks46+G2gAxs4gHOIVD1u7EqlYLYSKsaIpyKCK9Gbk0ta1/gjRSMRQ==", - "license": "MIT", - "dependencies": { - "cron-parser": "^4.2.0", - "long-timeout": "0.1.1", - "sorted-array-functions": "^1.3.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-key": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-hash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", - "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 6" - } - }, - "node_modules/object-inspect": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", - "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.assign": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", - "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0", - "has-symbols": "^1.1.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object.entries": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.9.tgz", - "integrity": "sha512-8u/hfXFRBD1O0hPUjioLhoWFHRmt6tKA4/vZPyckBr18l1KE9uHrFaFaUi8MDRTpi4uak2goyPTSNJLXX2k2Hw==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.4", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.fromentries": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", - "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object.groupby": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", - "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.values": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.1.tgz", - "integrity": "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "license": "ISC", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "license": "MIT", - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/optionator": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", - "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.5" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/own-keys": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", - "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "get-intrinsic": "^1.2.6", - "object-keys": "^1.1.1", - "safe-push-apply": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/package-json-from-dist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", - "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", - "dev": true, - "license": "BlueOak-1.0.0" - }, - "node_modules/pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "license": "(MIT AND Zlib)" - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/parse-imports-exports": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/parse-imports-exports/-/parse-imports-exports-0.2.4.tgz", - "integrity": "sha512-4s6vd6dx1AotCx/RCI2m7t7GCh5bDRUtGNvRfHSP2wbBQdMi67pPe7mtzmgwcaQ8VKK/6IB7Glfyu3qdZJPybQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "parse-statements": "1.0.11" - } - }, - "node_modules/parse-statements": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/parse-statements/-/parse-statements-1.0.11.tgz", - "integrity": "sha512-HlsyYdMBnbPQ9Jr/VgJ1YF4scnldvJpJxCVx6KgqPL4dxppsWrJHCIIxQXMJrqGnsRkNPATbeMJ8Yxu7JMsYcA==", - "dev": true, - "license": "MIT", - "peer": true - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true, - "license": "MIT", - "peer": true - }, - "node_modules/path-scurry": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", - "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^10.2.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" - }, - "engines": { - "node": ">=16 || 14 >=14.18" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "*" - } - }, - "node_modules/pg-int8": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", - "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/pg-protocol": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.13.0.tgz", - "integrity": "sha512-zzdvXfS6v89r6v7OcFCHfHlyG/wvry1ALxZo4LqgUoy7W9xhBDMaqOuMiF3qEV45VqsN6rdlcehHrfDtlCPc8w==", - "dev": true, - "license": "MIT" - }, - "node_modules/pg-types": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", - "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", - "dev": true, - "license": "MIT", - "dependencies": { - "pg-int8": "1.0.1", - "postgres-array": "~2.0.0", - "postgres-bytea": "~1.0.0", - "postgres-date": "~1.0.4", - "postgres-interval": "^1.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "license": "ISC" - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/pluralize": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", - "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/possible-typed-array-names": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", - "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/postgres-array": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", - "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/postgres-bytea": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.1.tgz", - "integrity": "sha512-5+5HqXnsZPE65IJZSMkZtURARZelel2oXUEO8rH83VS/hxH5vv1uHquPg5wZs8yMAfdv971IU+kcPUczi7NVBQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/postgres-date": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", - "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/postgres-interval": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", - "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "xtend": "^4.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/prettier": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.1.tgz", - "integrity": "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==", - "license": "MIT", - "bin": { - "prettier": "bin/prettier.cjs" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "node_modules/prettier-linter-helpers": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", - "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "fast-diff": "^1.1.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "license": "MIT" - }, - "node_modules/promisify-child-process": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/promisify-child-process/-/promisify-child-process-5.0.1.tgz", - "integrity": "sha512-jP2Aw1acio5NYIgCEpW9Ay2OhWlcbKTZp4aY6iivx75K2yXizJBt6Wz7sQrHloXKIfrjhbUfdH9m6UZrus4tmA==", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.26.0" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "dev": true, - "license": "MIT", - "dependencies": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" - } - }, - "node_modules/prop-types/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/proto3-json-serializer": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/proto3-json-serializer/-/proto3-json-serializer-3.0.3.tgz", - "integrity": "sha512-iUi7jGLuECChuoUwtvf6eXBDcFXTHAt5GM6ckvtD3RqD+j2wW0GW6WndPOu9IWeUk7n933lzrskcNMHJy2tFSw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "protobufjs": "^7.4.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/protobufjs": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.4.tgz", - "integrity": "sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg==", - "dev": true, - "hasInstallScript": true, - "license": "BSD-3-Clause", - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/node": ">=13.7.0", - "long": "^5.0.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", - "license": "MIT" - }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "peer": true - }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, - "node_modules/react": { - "version": "19.2.0", - "resolved": "https://registry.npmjs.org/react/-/react-19.2.0.tgz", - "integrity": "sha512-tmbWg6W31tQLeB5cdIBOicJDJRR2KzXsV7uSK9iNfLWQ5bIZfxuPEHp7M8wiHyHnn0DD1i7w3Zmin0FtkrwoCQ==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/react-dom": { - "version": "19.2.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.0.tgz", - "integrity": "sha512-UlbRu4cAiGaIewkPyiRGJk0imDN2T3JjieT6spoL2UeSf5od4n5LB/mQ4ejmxhCFT1tYe8IvaFulzynWovsEFQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "scheduler": "^0.27.0" - }, - "peerDependencies": { - "react": "^19.2.0" - } - }, - "node_modules/react-is": { - "version": "19.2.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.2.0.tgz", - "integrity": "sha512-x3Ax3kNSMIIkyVYhWPyO09bu0uttcAIoecO/um/rKGQ4EltYWVYtyiGkS/3xMynrbVQdS69Jhlv8FXUEZehlzA==", - "dev": true, - "license": "MIT" - }, - "node_modules/react-transition-group": { - "version": "4.4.5", - "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", - "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@babel/runtime": "^7.5.5", - "dom-helpers": "^5.0.1", - "loose-envify": "^1.4.0", - "prop-types": "^15.6.2" - }, - "peerDependencies": { - "react": ">=16.6.0", - "react-dom": ">=16.6.0" - } - }, - "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "license": "MIT", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/readdirp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", - "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14.18.0" - }, - "funding": { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/reflect.getprototypeof": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", - "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bind": "^1.0.8", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.9", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "get-intrinsic": "^1.2.7", - "get-proto": "^1.0.1", - "which-builtin-type": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/regexp-tree": { - "version": "0.1.27", - "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.27.tgz", - "integrity": "sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==", - "dev": true, - "license": "MIT", - "peer": true, - "bin": { - "regexp-tree": "bin/regexp-tree" - } - }, - "node_modules/regexp.prototype.flags": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", - "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bind": "^1.0.8", - "define-properties": "^1.2.1", - "es-errors": "^1.3.0", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "set-function-name": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/regjsparser": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.12.0.tgz", - "integrity": "sha512-cnE+y8bz4NhMjISKbgeVJtqNbtf5QpjZP+Bslo+UqkIt9QPnX9q095eiRRASJG1/tz6dlNr6Z5NsBiWYokp6EQ==", - "dev": true, - "license": "BSD-2-Clause", - "peer": true, - "dependencies": { - "jsesc": "~3.0.2" - }, - "bin": { - "regjsparser": "bin/parser" - } - }, - "node_modules/regjsparser/node_modules/jsesc": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", - "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", - "dev": true, - "license": "MIT", - "peer": true, - "bin": { - "jsesc": "bin/jsesc" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/require-in-the-middle": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-8.0.1.tgz", - "integrity": "sha512-QT7FVMXfWOYFbeRBF6nu+I6tr2Tf3u0q8RIEjNob/heKY/nh7drD/k7eeMFmSQgnTtCzLDcCu/XEnpW2wk4xCQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "^4.3.5", - "module-details-from-path": "^1.0.3" - }, - "engines": { - "node": ">=9.3.0 || >=8.10.0 <9.0.0" - } - }, - "node_modules/resolve": { - "version": "1.22.11", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", - "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "is-core-module": "^2.16.1", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/retry-request": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-8.0.2.tgz", - "integrity": "sha512-JzFPAfklk1kjR1w76f0QOIhoDkNkSqW8wYKT08n9yysTmZfB+RQ2QoXoTAeOi1HD9ZipTyTAZg3c4pM/jeqgSw==", - "dev": true, - "license": "MIT", - "dependencies": { - "extend": "^3.0.2", - "teeny-request": "^10.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/reusify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", - "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", - "integrity": "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "glob": "^10.3.7" - }, - "bin": { - "rimraf": "dist/esm/bin.mjs" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "peer": true, - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/safe-array-concat": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", - "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.2", - "get-intrinsic": "^1.2.6", - "has-symbols": "^1.1.0", - "isarray": "^2.0.5" - }, - "engines": { - "node": ">=0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/safe-push-apply": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", - "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "es-errors": "^1.3.0", - "isarray": "^2.0.5" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/safe-regex-test": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", - "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "is-regex": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/scheduler": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", - "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", - "dev": true, - "license": "MIT", - "peer": true - }, - "node_modules/semver": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", - "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/serialize-javascript": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", - "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "randombytes": "^2.1.0" - } - }, - "node_modules/set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/set-function-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", - "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "functions-have-names": "^1.2.3", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/set-proto": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", - "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "dunder-proto": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", - "license": "MIT" - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/side-channel": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", - "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3", - "side-channel-list": "^1.0.0", - "side-channel-map": "^1.0.1", - "side-channel-weakmap": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-list": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", - "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", - "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-weakmap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", - "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3", - "side-channel-map": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/sinon": { - "version": "21.0.0", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-21.0.0.tgz", - "integrity": "sha512-TOgRcwFPbfGtpqvZw+hyqJDvqfapr1qUlOizROIk4bBLjlsjlB00Pg6wMFXNtJRpu+eCZuVOaLatG7M8105kAw==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@sinonjs/commons": "^3.0.1", - "@sinonjs/fake-timers": "^13.0.5", - "@sinonjs/samsam": "^8.0.1", - "diff": "^7.0.0", - "supports-color": "^7.2.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/sinon" - } - }, - "node_modules/sinon-chai": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/sinon-chai/-/sinon-chai-3.7.0.tgz", - "integrity": "sha512-mf5NURdUaSdnatJx3uhoBOrY9dtL19fiOtAdT1Azxg3+lNJFiuN0uzaU3xX1LeAfL17kHQhTAJgpsfhbMJMY2g==", - "dev": true, - "license": "(BSD-2-Clause OR WTFPL)", - "peerDependencies": { - "chai": "^4.0.0", - "sinon": ">=4.0.0" - } - }, - "node_modules/sorted-array-functions": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/sorted-array-functions/-/sorted-array-functions-1.3.0.tgz", - "integrity": "sha512-2sqgzeFlid6N4Z2fUQ1cvFmTOLRi/sEDzSQ0OKYchqgoPmQBVyM3959qYx3fpS6Esef80KjmpgPeEr028dP3OA==", - "license": "MIT" - }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, - "license": "MIT", - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "node_modules/spdx-exceptions": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", - "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", - "dev": true, - "license": "CC-BY-3.0", - "peer": true - }, - "node_modules/spdx-expression-parse": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz", - "integrity": "sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-license-ids": { - "version": "3.0.22", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.22.tgz", - "integrity": "sha512-4PRT4nh1EImPbt2jASOKHX7PB7I+e4IWNLvkKFDxNhJlfjbYlleYQh285Z/3mPTHSAK/AvdMmw5BNNuYH8ShgQ==", - "dev": true, - "license": "CC0-1.0", - "peer": true - }, - "node_modules/stop-iteration-iterator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", - "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "es-errors": "^1.3.0", - "internal-slot": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/stream-events": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/stream-events/-/stream-events-1.0.5.tgz", - "integrity": "sha512-E1GUzBSgvct8Jsb3v2X15pjzN1tYebtbLaMg+eBOUOAxgbLoSbT2NS91ckc5lJD1KfLjId+jXJRgo0qnV5Nerg==", - "dev": true, - "license": "MIT", - "dependencies": { - "stubs": "^3.0.0" - } - }, - "node_modules/stream-shift": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz", - "integrity": "sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/string-width/node_modules/ansi-regex": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", - "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/string-width/node_modules/strip-ansi": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", - "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/string.prototype.matchall": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.12.tgz", - "integrity": "sha512-6CC9uyBL+/48dYizRf7H7VAYCMCNTBeM78x/VTUe9bFEaxBepPJDa1Ow99LqI/1yF7kuy7Q3cQsYMrcjGUcskA==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.6", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "get-intrinsic": "^1.2.6", - "gopd": "^1.2.0", - "has-symbols": "^1.1.0", - "internal-slot": "^1.1.0", - "regexp.prototype.flags": "^1.5.3", - "set-function-name": "^2.0.2", - "side-channel": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/string.prototype.repeat": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/string.prototype.repeat/-/string.prototype.repeat-1.0.0.tgz", - "integrity": "sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5" - } - }, - "node_modules/string.prototype.trim": { - "version": "1.2.10", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", - "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.2", - "define-data-property": "^1.1.4", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.5", - "es-object-atoms": "^1.0.0", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/string.prototype.trimend": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", - "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.2", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/string.prototype.trimstart": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", - "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi-cjs": { - "name": "strip-ansi", - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/strip-indent": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-4.1.1.tgz", - "integrity": "sha512-SlyRoSkdh1dYP0PzclLE7r0M9sgbFKKMFXpFRUMNuKhQSbC6VQIGzq3E0qsfvGJaUFJPGv6Ws1NZ/haTAjfbMA==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/stubs": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/stubs/-/stubs-3.0.0.tgz", - "integrity": "sha512-PdHt7hHUJKxvTCgbKX9C1V/ftOcjJQgz8BZwNfV5c4B6dcGqlpelTbJ999jBGZ2jYiPAwcX5dP6oBwVlBlUbxw==", - "dev": true, - "license": "MIT" - }, - "node_modules/stylis": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.2.0.tgz", - "integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==", - "dev": true, - "license": "MIT" - }, - "node_modules/suncalc2": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/suncalc2/-/suncalc2-1.8.1.tgz", - "integrity": "sha512-tNoAni1LqWzBzJRX3NRCsD50gVsuejH1jd9Y+XyKO3WkpPIU+QNyWF4Zf2JnUQKW2LKLWIBgVDQCrgsQwqs0tA==" - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/synckit": { - "version": "0.11.11", - "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.11.tgz", - "integrity": "sha512-MeQTA1r0litLUf0Rp/iisCaL8761lKAZHaimlbGK4j0HysC4PLfqygQj9srcs0m2RdtDYnF8UuYyKpbjHYp7Jw==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "@pkgr/core": "^0.2.9" - }, - "engines": { - "node": "^14.18.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/synckit" - } - }, - "node_modules/teeny-request": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-10.1.0.tgz", - "integrity": "sha512-3ZnLvgWF29jikg1sAQ1g0o+lr5JX6sVgYvfUJazn7ZjJroDBUTWp44/+cFVX0bULjv4vci+rBD+oGVAkWqhUbw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.0", - "node-fetch": "^3.3.2", - "stream-events": "^1.0.5" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/teeny-request/node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/teeny-request/node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/timekeeper": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/timekeeper/-/timekeeper-2.3.1.tgz", - "integrity": "sha512-LeQRS7/4JcC0PgdSFnfUiStQEdiuySlCj/5SJ18D+T1n9BoY7PxKFfCwLulpHXoLUFr67HxBddQdEX47lDGx1g==", - "dev": true, - "license": "MIT" - }, - "node_modules/tiny-glob": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz", - "integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==", - "dev": true, - "license": "MIT", - "dependencies": { - "globalyzer": "0.1.0", - "globrex": "^0.1.2" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/ts-api-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", - "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=18.12" - }, - "peerDependencies": { - "typescript": ">=4.8.4" - } - }, - "node_modules/tsconfig-paths": { - "version": "3.15.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", - "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "@types/json5": "^0.0.29", - "json5": "^1.0.2", - "minimist": "^1.2.6", - "strip-bom": "^3.0.0" - } - }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/type-detect": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", - "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/typed-array-buffer": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", - "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bound": "^1.0.3", - "es-errors": "^1.3.0", - "is-typed-array": "^1.1.14" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/typed-array-byte-length": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", - "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bind": "^1.0.8", - "for-each": "^0.3.3", - "gopd": "^1.2.0", - "has-proto": "^1.2.0", - "is-typed-array": "^1.1.14" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/typed-array-byte-offset": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", - "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.8", - "for-each": "^0.3.3", - "gopd": "^1.2.0", - "has-proto": "^1.2.0", - "is-typed-array": "^1.1.15", - "reflect.getprototypeof": "^1.0.9" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/typed-array-length": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", - "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bind": "^1.0.7", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "is-typed-array": "^1.1.13", - "possible-typed-array-names": "^1.0.0", - "reflect.getprototypeof": "^1.0.6" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/typescript": { - "version": "5.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/typescript-eslint": { - "version": "8.46.2", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.46.2.tgz", - "integrity": "sha512-vbw8bOmiuYNdzzV3lsiWv6sRwjyuKJMQqWulBOU7M0RrxedXledX8G8kBbQeiOYDnTfiXz0Y4081E1QMNB6iQg==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "@typescript-eslint/eslint-plugin": "8.46.2", - "@typescript-eslint/parser": "8.46.2", - "@typescript-eslint/typescript-estree": "8.46.2", - "@typescript-eslint/utils": "8.46.2" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <6.0.0" - } - }, - "node_modules/unbox-primitive": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", - "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bound": "^1.0.3", - "has-bigints": "^1.0.2", - "has-symbols": "^1.1.0", - "which-boxed-primitive": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/undici-types": { - "version": "7.18.2", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", - "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==", - "license": "MIT" - }, - "node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/update-browserslist-db": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.4.tgz", - "integrity": "sha512-q0SPT4xyU84saUX+tomz1WLkxUbuaJnR1xWt17M7fJtEJigJeWUNGUqrauFXsHnqev9y9JTRGwk13tFBuKby4A==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" + "name": "iobroker.javascript", + "version": "9.1.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "iobroker.javascript", + "version": "9.1.1", + "license": "MIT", + "dependencies": { + "@iobroker/adapter-core": "^3.3.2", + "@iobroker/types": "^7.1.0", + "@types/node": "^25.5.0", + "axios": "^1.13.6", + "jsonata": "^2.1.0", + "jszip": "^3.10.1", + "node-inspect": "^2.0.0", + "node-schedule": "2.1.1", + "prettier": "^3.8.1", + "promisify-child-process": "^5.0.1", + "semver": "^7.7.4", + "suncalc2": "^1.8.1", + "typescript": "~5.9.3", + "virtual-tsc": "^0.6.2", + "wake_on_lan": "^1.0.0" + }, + "devDependencies": { + "@alcalzone/release-script": "^5.1.1", + "@alcalzone/release-script-plugin-iobroker": "^5.1.2", + "@alcalzone/release-script-plugin-license": "^5.1.1", + "@iobroker/adapter-dev": "^1.5.0", + "@iobroker/build-tools": "^3.0.1", + "@iobroker/eslint-config": "^2.2.0", + "@iobroker/plugin-sentry": "^3.0.4", + "@iobroker/testing": "^5.2.2", + "@iobroker/vis-2-widgets-react-dev": "^4.0.4", + "@types/node-schedule": "^2.1.8", + "@types/nodemailer": "^7.0.11", + "@types/request": "^2.48.13", + "@types/suncalc": "^1.9.2", + "alcalzone-shared": "^5.0.0", + "timekeeper": "^2.3.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@alcalzone/esbuild-register": { + "version": "2.5.1-1", + "resolved": "https://registry.npmjs.org/@alcalzone/esbuild-register/-/esbuild-register-2.5.1-1.tgz", + "integrity": "sha512-u19/K/ZaiWQhYIQZeF2FImUeJDiMD4i2h7qPdU0HVFCxoQynye59N4oy6EvjxeXaxLnGkppcb5KKeiYD4cT1iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.11.5", + "jsonc-parser": "^3.0.0" + } + }, + "node_modules/@alcalzone/esbuild-register/node_modules/esbuild": { + "version": "0.11.23", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.11.23.tgz", + "integrity": "sha512-iaiZZ9vUF5wJV8ob1tl+5aJTrwDczlvGP0JoMmnpC2B0ppiMCu8n8gmy5ZTGl5bcG081XBVn+U+jP+mPFm5T5Q==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + } + }, + "node_modules/@alcalzone/pak": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@alcalzone/pak/-/pak-0.12.0.tgz", + "integrity": "sha512-9r0zM5JAVTuPma1M/nMXiIlihQ07bWnxiYdqQrRsqFcWfm/p2hATbMtDMBXonkKZZGuOQxEMzTk7kpzGgnEJEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ky": "^1.14.3", + "nano-spawn": "^2.0.0", + "semver": "^7.7.4", + "tiny-glob": "^0.2.9" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/@alcalzone/release-script": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@alcalzone/release-script/-/release-script-5.1.1.tgz", + "integrity": "sha512-AndvNEfl6QWRcg6zSlBWiqyiceRPdmveO0WO+KC8eo+WMwhlflbl52ojwH53RE7UcoQLudjkz5PXlfBFl3E+Fg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@alcalzone/release-script-core": "5.1.1", + "@alcalzone/release-script-plugin-changelog": "5.1.1", + "@alcalzone/release-script-plugin-exec": "5.1.1", + "@alcalzone/release-script-plugin-git": "5.1.1", + "@alcalzone/release-script-plugin-package": "5.1.1", + "@alcalzone/release-script-plugin-version": "5.1.1", + "alcalzone-shared": "^5.0.0", + "enquirer": "^2.3.6", + "picocolors": "1.0.0", + "semver": "^7.7.2", + "source-map-support": "^0.5.21", + "yargs": "^17.4.1" + }, + "bin": { + "release-script": "bin/release.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@alcalzone/release-script-core": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@alcalzone/release-script-core/-/release-script-core-5.1.1.tgz", + "integrity": "sha512-aN+mmuHQ3h/K9+RBWCUl4/NF/O/kGIa6GhrlK5pposZ5FTSEitzE0wT4yHbtXRWfnfHwDajvOTWYHm9e3RnI0Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "execa": "^5.1.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@alcalzone/release-script-plugin-changelog": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-changelog/-/release-script-plugin-changelog-5.1.1.tgz", + "integrity": "sha512-AkdrtZUFYiJqFqGjhqbsIl6RFxmA8R2yvodtrAPZ2tXLeGGocSJp4o4KT+zcCttMsYQ5tNMSLIl1Dtfgy6twog==", + "dev": true, + "license": "MIT", + "dependencies": { + "@alcalzone/release-script-core": "5.1.1", + "alcalzone-shared": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@alcalzone/release-script-plugin-exec": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-exec/-/release-script-plugin-exec-5.1.1.tgz", + "integrity": "sha512-o3TaxXFcu4DG41kaTjmgGNvwe7M13XNxeY/NDnp1VudfEUYH9QxWfZs7BFGOL27FBLCyjaiI6lJI8/7J+VkVkA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@alcalzone/release-script-core": "5.1.1", + "alcalzone-shared": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@alcalzone/release-script-plugin-git": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-git/-/release-script-plugin-git-5.1.1.tgz", + "integrity": "sha512-+o7X3vAAOXfwZixHFXXaZpLMLBstz2nzBrdyH0JfQ3KFBdxuXZzlKbaQ3sot2x5Pp4Suw5GTRBrlzH/VHp83Ug==", + "dev": true, + "license": "MIT", + "dependencies": { + "@alcalzone/release-script-core": "5.1.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@alcalzone/release-script-plugin-iobroker": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-iobroker/-/release-script-plugin-iobroker-5.1.2.tgz", + "integrity": "sha512-8mqm95NdFUimy10zjKSkqxBFWMs5NebVFHTGQRUTNGzrUnt8s14Nrt8VBTOJw6YTbjhFe49SJDoQ+S4qipdk6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@alcalzone/release-script-core": "5.1.1", + "alcalzone-shared": "^5.0.0", + "ky": "^1.7.5", + "semver": "^7.7.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@alcalzone/release-script-plugin-license": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-license/-/release-script-plugin-license-5.1.1.tgz", + "integrity": "sha512-fQAuh46MEtJj0mdtq4FiIX08Bzvv6THmpgBMr7VXTfTe/kbUh7CAnz52rzdB4go0s0yqLkGfP9z04/SLLCH0mQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@alcalzone/release-script-core": "5.1.1", + "tiny-glob": "^0.2.9" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@alcalzone/release-script-plugin-package": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-package/-/release-script-plugin-package-5.1.1.tgz", + "integrity": "sha512-WElqWx2n/6bVuomX+4N+s4ZShsXrwaMkMcuNtnwGhVyPkDczvJnW0zNh5BS+oeWQndZLAGfyeJ6uKa8kFur48A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@alcalzone/pak": "^0.12.0", + "@alcalzone/release-script-core": "5.1.1", + "alcalzone-shared": "^5.0.0", + "semver": "^7.7.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@alcalzone/release-script-plugin-version": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-version/-/release-script-plugin-version-5.1.1.tgz", + "integrity": "sha512-hWYb+reuLhljRRr2AiW602FIDBOukY2HCb1PchLj/hgsrcHW581AucSyH5Dol7BW+1itP0oeDo2os6NCDYQFOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@alcalzone/release-script-core": "5.1.1", + "alcalzone-shared": "^5.0.0", + "semver": "^7.7.2", + "tiny-glob": "^0.2.9" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.4.tgz", + "integrity": "sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@emotion/cache": { + "version": "11.14.0", + "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.14.0.tgz", + "integrity": "sha512-L/B1lc/TViYk4DcpGxtAVbx0ZyiKM5ktoIyafGkH6zg/tj+mA+NE//aPYKG0k8kCHSHVJrpLpcAlOBEXQ3SavA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@emotion/memoize": "^0.9.0", + "@emotion/sheet": "^1.4.0", + "@emotion/utils": "^1.4.2", + "@emotion/weak-memoize": "^0.4.0", + "stylis": "4.2.0" + } + }, + "node_modules/@emotion/hash": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.2.tgz", + "integrity": "sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@emotion/memoize": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.9.0.tgz", + "integrity": "sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@emotion/serialize": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.3.3.tgz", + "integrity": "sha512-EISGqt7sSNWHGI76hC7x1CksiXPahbxEOrC5RjmFRJTqLyEK9/9hZvBbiYn70dw4wuwMKiEMCUlR6ZXTSWQqxA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@emotion/hash": "^0.9.2", + "@emotion/memoize": "^0.9.0", + "@emotion/unitless": "^0.10.0", + "@emotion/utils": "^1.4.2", + "csstype": "^3.0.2" + } + }, + "node_modules/@emotion/sheet": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.4.0.tgz", + "integrity": "sha512-fTBW9/8r2w3dXWYM4HCB1Rdp8NLibOw2+XELH5m5+AkWiL/KqYX6dc0kKYlaYyKjrQ6ds33MCdMPEwgs2z1rqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@emotion/unitless": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.10.0.tgz", + "integrity": "sha512-dFoMUuQA20zvtVTuxZww6OHoJYgrzfKM1t52mVySDJnMSEa08ruEvdYQbhvyu6soU+NeLVd3yKfTfT0NeV6qGg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@emotion/utils": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.4.2.tgz", + "integrity": "sha512-3vLclRofFziIa3J2wDh9jjbkUz9qk5Vi3IZ/FSTKViB0k+ef0fPV7dYrUIugbgupYDx7v9ud/SjrtEP8Y4xLoA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@emotion/weak-memoize": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.4.0.tgz", + "integrity": "sha512-snKqtPW01tN0ui7yu9rGv69aJXr/a/Ywvl11sUjNtEcRc+ng/mQriFL0wLXMef74iHa/EkftbDzU9F8iFbH+zg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@es-joy/jsdoccomment": { + "version": "0.56.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.56.0.tgz", + "integrity": "sha512-c6EW+aA1w2rjqOMjbL93nZlwxp6c1Ln06vTYs5FjRRhmJXK8V/OrSXdT+pUr4aRYgjCgu8/OkiZr0tzeVrRSbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.8", + "@typescript-eslint/types": "^8.42.0", + "comment-parser": "1.4.1", + "esquery": "^1.6.0", + "jsdoc-type-pratt-parser": "~5.1.0" + }, + "engines": { + "node": ">=20.11.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.11.tgz", + "integrity": "sha512-Xt1dOL13m8u0WE8iplx9Ibbm+hFAO0GsU2P34UNoDGvZYkY8ifSiy6Zuc1lYxfG7svWE2fzqCUmFp5HCn51gJg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.11.tgz", + "integrity": "sha512-uoa7dU+Dt3HYsethkJ1k6Z9YdcHjTrSb5NUy66ZfZaSV8hEYGD5ZHbEMXnqLFlbBflLsl89Zke7CAdDJ4JI+Gg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.11.tgz", + "integrity": "sha512-9slpyFBc4FPPz48+f6jyiXOx/Y4v34TUeDDXJpZqAWQn/08lKGeD8aDp9TMn9jDz2CiEuHwfhRmGBvpnd/PWIQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.11.tgz", + "integrity": "sha512-Sgiab4xBjPU1QoPEIqS3Xx+R2lezu0LKIEcYe6pftr56PqPygbB7+szVnzoShbx64MUupqoE0KyRlN7gezbl8g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.11.tgz", + "integrity": "sha512-VekY0PBCukppoQrycFxUqkCojnTQhdec0vevUL/EDOCnXd9LKWqD/bHwMPzigIJXPhC59Vd1WFIL57SKs2mg4w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.11.tgz", + "integrity": "sha512-+hfp3yfBalNEpTGp9loYgbknjR695HkqtY3d3/JjSRUyPg/xd6q+mQqIb5qdywnDxRZykIHs3axEqU6l1+oWEQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.11.tgz", + "integrity": "sha512-CmKjrnayyTJF2eVuO//uSjl/K3KsMIeYeyN7FyDBjsR3lnSJHaXlVoAK8DZa7lXWChbuOk7NjAc7ygAwrnPBhA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.11.tgz", + "integrity": "sha512-Dyq+5oscTJvMaYPvW3x3FLpi2+gSZTCE/1ffdwuM6G1ARang/mb3jvjxs0mw6n3Lsw84ocfo9CrNMqc5lTfGOw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.11.tgz", + "integrity": "sha512-TBMv6B4kCfrGJ8cUPo7vd6NECZH/8hPpBHHlYI3qzoYFvWu2AdTvZNuU/7hsbKWqu/COU7NIK12dHAAqBLLXgw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.11.tgz", + "integrity": "sha512-Qr8AzcplUhGvdyUF08A1kHU3Vr2O88xxP0Tm8GcdVOUm25XYcMPp2YqSVHbLuXzYQMf9Bh/iKx7YPqECs6ffLA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.11.tgz", + "integrity": "sha512-TmnJg8BMGPehs5JKrCLqyWTVAvielc615jbkOirATQvWWB1NMXY77oLMzsUjRLa0+ngecEmDGqt5jiDC6bfvOw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.11.tgz", + "integrity": "sha512-DIGXL2+gvDaXlaq8xruNXUJdT5tF+SBbJQKbWy/0J7OhU8gOHOzKmGIlfTTl6nHaCOoipxQbuJi7O++ldrxgMw==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.11.tgz", + "integrity": "sha512-Osx1nALUJu4pU43o9OyjSCXokFkFbyzjXb6VhGIJZQ5JZi8ylCQ9/LFagolPsHtgw6himDSyb5ETSfmp4rpiKQ==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.11.tgz", + "integrity": "sha512-nbLFgsQQEsBa8XSgSTSlrnBSrpoWh7ioFDUmwo158gIm5NNP+17IYmNWzaIzWmgCxq56vfr34xGkOcZ7jX6CPw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.11.tgz", + "integrity": "sha512-HfyAmqZi9uBAbgKYP1yGuI7tSREXwIb438q0nqvlpxAOs3XnZ8RsisRfmVsgV486NdjD7Mw2UrFSw51lzUk1ww==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.11.tgz", + "integrity": "sha512-HjLqVgSSYnVXRisyfmzsH6mXqyvj0SA7pG5g+9W7ESgwA70AXYNpfKBqh1KbTxmQVaYxpzA/SvlB9oclGPbApw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.11.tgz", + "integrity": "sha512-HSFAT4+WYjIhrHxKBwGmOOSpphjYkcswF449j6EjsjbinTZbp8PJtjsVK1XFJStdzXdy/jaddAep2FGY+wyFAQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.11.tgz", + "integrity": "sha512-hr9Oxj1Fa4r04dNpWr3P8QKVVsjQhqrMSUzZzf+LZcYjZNqhA3IAfPQdEh1FLVUJSiu6sgAwp3OmwBfbFgG2Xg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.11.tgz", + "integrity": "sha512-u7tKA+qbzBydyj0vgpu+5h5AeudxOAGncb8N6C9Kh1N4n7wU1Xw1JDApsRjpShRpXRQlJLb9wY28ELpwdPcZ7A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.11.tgz", + "integrity": "sha512-Qq6YHhayieor3DxFOoYM1q0q1uMFYb7cSpLD2qzDSvK1NAvqFi8Xgivv0cFC6J+hWVw2teCYltyy9/m/14ryHg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.11.tgz", + "integrity": "sha512-CN+7c++kkbrckTOz5hrehxWN7uIhFFlmS/hqziSFVWpAzpWrQoAG4chH+nN3Be+Kzv/uuo7zhX716x3Sn2Jduw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.11.tgz", + "integrity": "sha512-rOREuNIQgaiR+9QuNkbkxubbp8MSO9rONmwP5nKncnWJ9v5jQ4JxFnLu4zDSRPf3x4u+2VN4pM4RdyIzDty/wQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.11.tgz", + "integrity": "sha512-nq2xdYaWxyg9DcIyXkZhcYulC6pQ2FuCgem3LI92IwMgIZ69KHeY8T4Y88pcwoLIjbed8n36CyKoYRDygNSGhA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.11.tgz", + "integrity": "sha512-3XxECOWJq1qMZ3MN8srCJ/QfoLpL+VaxD/WfNRm1O3B4+AZ/BnLVgFbUV3eiRYDMXetciH16dwPbbHqwe1uU0Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.11.tgz", + "integrity": "sha512-3ukss6gb9XZ8TlRyJlgLn17ecsK4NSQTmdIXRASVsiS2sQ6zPPZklNJT5GR5tE/MUarymmy8kCEf5xPCNCqVOA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.11.tgz", + "integrity": "sha512-D7Hpz6A2L4hzsRpPaCYkQnGOotdUpDzSGRIv9I+1ITdHROSFUWW95ZPZWQmGka1Fg7W3zFJowyn9WGwMJ0+KPA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", + "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz", + "integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.7", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", + "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-helpers/node_modules/@eslint/core": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.16.0.tgz", + "integrity": "sha512-nmC8/totwobIiFcGkDza3GIKfAw1+hLiYVrh3I1nIomQ8PEr5cxg34jnkmGawul/ep52wGRAcyeDCNtWKSOj4Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", + "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "9.38.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.38.0.tgz", + "integrity": "sha512-UZ1VpFvXf9J06YG9xQBdnzU+kthors6KjhMAl6f4gH4usHyh31rUf2DLGInT8RFYIReYXNSydgPY0V2LuWgl7A==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", + "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", + "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit/node_modules/@eslint/core": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@esm2cjs/execa": { + "version": "6.1.1-cjs.1", + "resolved": "https://registry.npmjs.org/@esm2cjs/execa/-/execa-6.1.1-cjs.1.tgz", + "integrity": "sha512-FHxfnmuDIjY1VS/BLzDkL8EkbcFvi8s6x1nYQ1Nyu0An0n88EJcGhDBcRWLFwt3C3nT7xwI+MwHRH1TZcAFW2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@esm2cjs/human-signals": "^3.0.1", + "@esm2cjs/is-stream": "^3.0.0", + "@esm2cjs/npm-run-path": "^5.1.1-cjs.0", + "@esm2cjs/onetime": "^6.0.1-cjs.0", + "@esm2cjs/strip-final-newline": "^3.0.1-cjs.0", + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "merge-stream": "^2.0.0", + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/AlCalzone" + } + }, + "node_modules/@esm2cjs/human-signals": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@esm2cjs/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-QZme4eF/PwTpeSbMB4AaWGQ4VSygzE30jI+Oas1NPTtZQAgcHwWVDOQpIW8FUmtzn5Q+2cS7AjnTzbtqtc5P6g==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.20.0" + }, + "funding": { + "url": "https://github.com/sponsors/AlCalzone" + } + }, + "node_modules/@esm2cjs/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@esm2cjs/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-qcBscHlJpZFOD5nnmMHkzOrq2xyvsp9fbVreQLS8x2LOs8N3CrNi3fqvFY0GVJR+YSOHscwhG9T5t4Ck7R7QGw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/AlCalzone" + } + }, + "node_modules/@esm2cjs/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@esm2cjs/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-LIIAjcpjLr4rcbYmRQ+eRu55Upy/MMB78seIlwqbnyiA+cTa1/pxWnJ1NHJQrw6tx2wMQmlYoJj+wf16NjWH6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/AlCalzone" + } + }, + "node_modules/@esm2cjs/npm-run-path": { + "version": "5.1.1-cjs.0", + "resolved": "https://registry.npmjs.org/@esm2cjs/npm-run-path/-/npm-run-path-5.1.1-cjs.0.tgz", + "integrity": "sha512-CWeAIyE8iNSCgP2ItPE8iPgS+lACqgH+MuFRaWOIl2T7hnHqPFfhAJJ/LcLJJ/RMIxNMeenjFMwc91HW7NWr1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@esm2cjs/path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/AlCalzone" + } + }, + "node_modules/@esm2cjs/onetime": { + "version": "6.0.1-cjs.0", + "resolved": "https://registry.npmjs.org/@esm2cjs/onetime/-/onetime-6.0.1-cjs.0.tgz", + "integrity": "sha512-MkZMZSxrSC/6yUuAw6Azc56XOgwHQQIsNDlO/zgFmOcycJBhRwRuc/gdYUUOFNZIh7y+f0JSIxkNdJPFvJ5W0w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@esm2cjs/mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/AlCalzone" + } + }, + "node_modules/@esm2cjs/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@esm2cjs/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-fKzZ3uIIP4j+7WfyG0MEkomGHL0hUXWCx1kY2Zct3GTdl4pyY+3k5lCUxjgdDa2Ld1BCjMNorXnRHiBP6jW6CQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/AlCalzone" + } + }, + "node_modules/@esm2cjs/strip-final-newline": { + "version": "3.0.1-cjs.0", + "resolved": "https://registry.npmjs.org/@esm2cjs/strip-final-newline/-/strip-final-newline-3.0.1-cjs.0.tgz", + "integrity": "sha512-o41riCGPiOEStayoikBCAqwa6igbv9L9rP+k5UCfQ24EJD/wGrdDs/KTNwkHG5JzDK3T60D5dMkWkLKEPy8gjA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/AlCalzone" + } + }, + "node_modules/@fastify/otel": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/@fastify/otel/-/otel-0.17.1.tgz", + "integrity": "sha512-K4wyxfUZx2ux5o+b6BtTqouYFVILohLZmSbA2tKUueJstNcBnoGPVhllCaOvbQ3ZrXdUxUC/fyrSWSCqHhdOPg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.212.0", + "@opentelemetry/semantic-conventions": "^1.28.0", + "minimatch": "^10.2.4" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.9.0" + } + }, + "node_modules/@fastify/otel/node_modules/@opentelemetry/api-logs": { + "version": "0.212.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.212.0.tgz", + "integrity": "sha512-TEEVrLbNROUkYY51sBJGk7lO/OLjuepch8+hmpM6ffMJQ2z/KVCjdHuCFX6fJj8OkJP2zckPjrJzQtXU3IAsFg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/api": "^1.3.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@fastify/otel/node_modules/@opentelemetry/instrumentation": { + "version": "0.212.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.212.0.tgz", + "integrity": "sha512-IyXmpNnifNouMOe0I/gX7ENfv2ZCNdYTF0FpCsoBcpbIHzk81Ww9rQTYTnvghszCg7qGrIhNvWC8dhEifgX9Jg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/api-logs": "0.212.0", + "import-in-the-middle": "^2.0.6", + "require-in-the-middle": "^8.0.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@fastify/otel/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/@fastify/otel/node_modules/brace-expansion": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.4.tgz", + "integrity": "sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/@fastify/otel/node_modules/import-in-the-middle": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-2.0.6.tgz", + "integrity": "sha512-3vZV3jX0XRFW3EJDTwzWoZa+RH1b8eTTx6YOCjglrLyPuepwoBti1k3L2dKwdCUrnVEfc5CuRuGstaC/uQJJaw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "acorn": "^8.15.0", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^2.2.0", + "module-details-from-path": "^1.0.4" + } + }, + "node_modules/@fastify/otel/node_modules/minimatch": { + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@google-cloud/common": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-6.0.0.tgz", + "integrity": "sha512-IXh04DlkLMxWgYLIUYuHHKXKOUwPDzDgke1ykkkJPe48cGIS9kkL2U/o0pm4ankHLlvzLF/ma1eO86n/bkumIA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@google-cloud/projectify": "^4.0.0", + "@google-cloud/promisify": "^4.0.0", + "arrify": "^2.0.0", + "duplexify": "^4.1.3", + "extend": "^3.0.2", + "google-auth-library": "^10.0.0-rc.1", + "html-entities": "^2.5.2", + "retry-request": "^8.0.0", + "teeny-request": "^10.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@google-cloud/common/node_modules/@google-cloud/promisify": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-4.1.0.tgz", + "integrity": "sha512-G/FQx5cE/+DqBbOpA5jKsegGwdPniU6PuIEMt+qxWgFxvxuFOzVmp6zYchtYuwAWV5/8Dgs0yAmjvNZv3uXLQg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/@google-cloud/projectify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-4.0.0.tgz", + "integrity": "sha512-MmaX6HeSvyPbWGwFq7mXdo0uQZLGBYCwziiLIGq5JVX+/bdI3SAq6bP98trV5eTWfLuvsMcIC1YJOF2vfteLFA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@google-cloud/promisify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-5.0.0.tgz", + "integrity": "sha512-N8qS6dlORGHwk7WjGXKOSsLjIjNINCPicsOX6gyyLiYk7mq3MtII96NZ9N2ahwA2vnkLmZODOIH9rlNniYWvCQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/@google-cloud/translate": { + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/@google-cloud/translate/-/translate-9.2.1.tgz", + "integrity": "sha512-7/RWxkMd4fKX88Pzzhr2ly8yOjEepCW4ro4ZsdAUsf2Wo2ZLgp75yNZaQGKBBetgOc8yPVl8djr/2XFIHnWS3w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@google-cloud/common": "^6.0.0", + "@google-cloud/promisify": "^5.0.0", + "arrify": "^2.0.0", + "extend": "^3.0.2", + "google-gax": "^5.0.0", + "is-html": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@grpc/grpc-js": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.14.0.tgz", + "integrity": "sha512-N8Jx6PaYzcTRNzirReJCtADVoq4z7+1KQ4E70jTg/koQiMoUSN1kbNjPOqpPbhMFhfU1/l7ixspPl8dNY+FoUg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@grpc/proto-loader": "^0.8.0", + "@js-sdsl/ordered-map": "^4.4.2" + }, + "engines": { + "node": ">=12.10.0" + } + }, + "node_modules/@grpc/proto-loader": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.8.0.tgz", + "integrity": "sha512-rc1hOQtjIWGxcxpb9aHAfLpIctjEnsDehj0DAiVfBlmT84uvR0uUtN2hEi/ecvWVjXUGf5qPF4qEgiLOx1YIMQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "lodash.camelcase": "^4.3.0", + "long": "^5.0.0", + "protobufjs": "^7.5.3", + "yargs": "^17.7.2" + }, + "bin": { + "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.7", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", + "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.4.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@iobroker/adapter-core": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/@iobroker/adapter-core/-/adapter-core-3.3.2.tgz", + "integrity": "sha512-knuCX6F1JUTnY1OdHzDhwNtOoe9/RZgBziDKSzCO3E4koteY/KRqZ7gtzmoavcAokejG68S5osbEnIb4MYT3VA==", + "license": "MIT", + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "@iobroker/types": ">=6.0.11" + } + }, + "node_modules/@iobroker/adapter-dev": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@iobroker/adapter-dev/-/adapter-dev-1.5.0.tgz", + "integrity": "sha512-L1FhO7oxaz4hNMobvgbanSGyn2LaCESGKqPPJhXWU00vVEw5Cc166xdnU63Dk+JDnV5zl/HzOcFANGisETAWIg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@esm2cjs/execa": "^6.1.1-cjs.1", + "@google-cloud/translate": "^9.2.0", + "ansi-colors": "^4.1.3", + "axios": "^1.11.0", + "deepl-node": "^1.19.0", + "esbuild": "^0.25.9", + "fs-extra": "^11.3.1", + "rimraf": "^5.0.10", + "tiny-glob": "^0.2.9", + "yargs": "^18.0.0" + }, + "bin": { + "build-adapter": "bin/build-adapter.js", + "clean-dir": "bin/clean-dir.js", + "translate-adapter": "bin/translate-adapter.js" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@iobroker/adapter-dev/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@iobroker/adapter-dev/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@iobroker/adapter-dev/node_modules/cliui": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-9.0.1.tgz", + "integrity": "sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^7.2.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@iobroker/adapter-dev/node_modules/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "dev": true, + "license": "MIT" + }, + "node_modules/@iobroker/adapter-dev/node_modules/fs-extra": { + "version": "11.3.2", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.2.tgz", + "integrity": "sha512-Xr9F6z6up6Ws+NjzMCZc6WXg2YFRlrLP9NQDO3VQrWrfiojdhS56TzueT88ze0uBdCTwEIhQ3ptnmKeWGFAe0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/@iobroker/adapter-dev/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@iobroker/adapter-dev/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@iobroker/adapter-dev/node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@iobroker/adapter-dev/node_modules/yargs": { + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-18.0.0.tgz", + "integrity": "sha512-4UEqdc2RYGHZc7Doyqkrqiln3p9X2DZVxaGbwhn2pi7MrRagKaOcIKe8L3OxYcbhXLgLFUS3zAYuQjKBQgmuNg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^9.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "string-width": "^7.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^22.0.0" + }, + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=23" + } + }, + "node_modules/@iobroker/adapter-dev/node_modules/yargs-parser": { + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-22.0.0.tgz", + "integrity": "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=23" + } + }, + "node_modules/@iobroker/build-tools": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@iobroker/build-tools/-/build-tools-3.0.1.tgz", + "integrity": "sha512-i5PsBOHNscMAqmdYrdYxJUplyFCkTwPUVJVL5iQozbG7+e79bHTHXuLCHwslaN/m5ACfr0KmtpoMram8gzGnPg==", + "dev": true, + "dependencies": { + "glob": "^13.0.1" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@iobroker/build-tools/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/@iobroker/build-tools/node_modules/brace-expansion": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.4.tgz", + "integrity": "sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/@iobroker/build-tools/node_modules/glob": { + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", + "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@iobroker/build-tools/node_modules/lru-cache": { + "version": "11.2.7", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.7.tgz", + "integrity": "sha512-aY/R+aEsRelme17KGQa/1ZSIpLpNYYrhcrepKTZgE+W3WM16YMCaPwOHLHsmopZHELU0Ojin1lPVxKR0MihncA==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/@iobroker/build-tools/node_modules/minimatch": { + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@iobroker/build-tools/node_modules/path-scurry": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz", + "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@iobroker/eslint-config": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@iobroker/eslint-config/-/eslint-config-2.2.0.tgz", + "integrity": "sha512-89U2d81BUrReVgVFUJwjxYsHSbvjAt8w8OoKavtNp//wkG7JU4n/VnISMEvQqaQt7i0sWc/xSx27TYDx9FXAYg==", + "dev": true, + "peerDependencies": { + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "^9.34.0", + "@typescript-eslint/eslint-plugin": "^8.40.0", + "@typescript-eslint/parser": "^8.40.0", + "eslint": ">=9.32.0", + "eslint-config-prettier": "^10.1.8", + "eslint-plugin-import": "^2.30.0", + "eslint-plugin-jsdoc": "^54.1.1", + "eslint-plugin-prettier": "^5.5.4", + "eslint-plugin-react": "^7.37.5", + "eslint-plugin-react-hooks": "^5.2.0", + "eslint-plugin-unicorn": "^60.0.0", + "globals": "^16.3.0", + "prettier": ">=3.6.2", + "typescript-eslint": "^8.40.0" + } + }, + "node_modules/@iobroker/plugin-base": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@iobroker/plugin-base/-/plugin-base-3.0.3.tgz", + "integrity": "sha512-pUKOz9/ZqIDxPQo9E97UdCF6p8NyO+x9REAQYPQNmwkElWq0bka9tgphx+RTUj8inZoYbUd50o9YnotV5C/Jpg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@iobroker/plugin-sentry": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@iobroker/plugin-sentry/-/plugin-sentry-3.0.4.tgz", + "integrity": "sha512-VCHQ9zo5TKyO+A1xpWD8xXe/nW6/BYbEKFxAqHvfDM4U2R0wERZtbH6Ztg3lfV+JRwUn5TgqVRNXvHkvolgPHg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@iobroker/plugin-base": "^3.0.3", + "@sentry/integrations": "^7.114.0", + "@sentry/node": "^10.32.1", + "source-map-support": "^0.5.21" + } + }, + "node_modules/@iobroker/testing": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/@iobroker/testing/-/testing-5.2.2.tgz", + "integrity": "sha512-AiYi9qziPLiNDcwZJa3tcgdSjIq9lq7z4QFvWY9w099chmKOWyvUgWzDy3S/R3L7lJ0yviOeNEdpOHtX4wTf6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@alcalzone/esbuild-register": "^2.5.1-1", + "@types/chai": "^4.3.20", + "@types/chai-as-promised": "^7.1.8", + "@types/mocha": "^10.0.10", + "@types/sinon": "^17.0.4", + "@types/sinon-chai": "^3.2.12", + "alcalzone-shared": "~5.0.0", + "chai": "^4.5.0", + "chai-as-promised": "^7.1.2", + "debug": "^4.4.3", + "fs-extra": "^11.3.2", + "json5": "^2.2.3", + "mocha": "^11.7.3", + "sinon": "^21.0.0", + "sinon-chai": "^3.7.0" + } + }, + "node_modules/@iobroker/testing/node_modules/fs-extra": { + "version": "11.3.2", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.2.tgz", + "integrity": "sha512-Xr9F6z6up6Ws+NjzMCZc6WXg2YFRlrLP9NQDO3VQrWrfiojdhS56TzueT88ze0uBdCTwEIhQ3ptnmKeWGFAe0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/@iobroker/testing/node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@iobroker/types": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@iobroker/types/-/types-7.1.0.tgz", + "integrity": "sha512-e9MVfxBiepSVK2U53i/jSA57rtoMn4ysn22wy+enHOZDyXAzm9DnOKaLWtBnRWNn3MhHlyBbx1oMwsYAhT0QSg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@iobroker/vis-2-widgets-react-dev": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@iobroker/vis-2-widgets-react-dev/-/vis-2-widgets-react-dev-4.0.4.tgz", + "integrity": "sha512-l7jOrzwE9gxLtQCYyF/BXPMaFpT6fZHq6BoH9BAm/GhmoGzkh708zSx5jHfo0E6Dj4XnY/lgil+77tbDZeR6Gw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@mui/icons-material": "^6.1.8", + "@mui/material": "^6.1.8", + "@sentry/browser": "^8.40.0", + "acorn": "^8.14.0", + "acorn-jsx": "^5.3.2", + "acorn-jsx-walk": "^2.0.0", + "acorn-walk": "^8.3.4", + "node-dir": "^0.1.17" + } + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@js-sdsl/ordered-map": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", + "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==", + "dev": true, + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, + "node_modules/@mui/core-downloads-tracker": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-6.5.0.tgz", + "integrity": "sha512-LGb8t8i6M2ZtS3Drn3GbTI1DVhDY6FJ9crEey2lZ0aN2EMZo8IZBZj9wRf4vqbZHaWjsYgtbOnJw5V8UWbmK2Q==", + "dev": true, + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + } + }, + "node_modules/@mui/icons-material": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-6.5.0.tgz", + "integrity": "sha512-VPuPqXqbBPlcVSA0BmnoE4knW4/xG6Thazo8vCLWkOKusko6DtwFV6B665MMWJ9j0KFohTIf3yx2zYtYacvG1g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.26.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@mui/material": "^6.5.0", + "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react": "^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/material": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@mui/material/-/material-6.5.0.tgz", + "integrity": "sha512-yjvtXoFcrPLGtgKRxFaH6OQPtcLPhkloC0BML6rBG5UeldR0nPULR/2E2BfXdo5JNV7j7lOzrrLX2Qf/iSidow==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.26.0", + "@mui/core-downloads-tracker": "^6.5.0", + "@mui/system": "^6.5.0", + "@mui/types": "~7.2.24", + "@mui/utils": "^6.4.9", + "@popperjs/core": "^2.11.8", + "@types/react-transition-group": "^4.4.12", + "clsx": "^2.1.1", + "csstype": "^3.1.3", + "prop-types": "^15.8.1", + "react-is": "^19.0.0", + "react-transition-group": "^4.4.5" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@emotion/react": "^11.5.0", + "@emotion/styled": "^11.3.0", + "@mui/material-pigment-css": "^6.5.0", + "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@emotion/react": { + "optional": true + }, + "@emotion/styled": { + "optional": true + }, + "@mui/material-pigment-css": { + "optional": true + }, + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/private-theming": { + "version": "6.4.9", + "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-6.4.9.tgz", + "integrity": "sha512-LktcVmI5X17/Q5SkwjCcdOLBzt1hXuc14jYa7NPShog0GBDCDvKtcnP0V7a2s6EiVRlv7BzbWEJzH6+l/zaCxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.26.0", + "@mui/utils": "^6.4.9", + "prop-types": "^15.8.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react": "^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/styled-engine": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-6.5.0.tgz", + "integrity": "sha512-8woC2zAqF4qUDSPIBZ8v3sakj+WgweolpyM/FXf8jAx6FMls+IE4Y8VDZc+zS805J7PRz31vz73n2SovKGaYgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.26.0", + "@emotion/cache": "^11.13.5", + "@emotion/serialize": "^1.3.3", + "@emotion/sheet": "^1.4.0", + "csstype": "^3.1.3", + "prop-types": "^15.8.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@emotion/react": "^11.4.1", + "@emotion/styled": "^11.3.0", + "react": "^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@emotion/react": { + "optional": true + }, + "@emotion/styled": { + "optional": true + } + } + }, + "node_modules/@mui/system": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@mui/system/-/system-6.5.0.tgz", + "integrity": "sha512-XcbBYxDS+h/lgsoGe78ExXFZXtuIlSBpn/KsZq8PtZcIkUNJInkuDqcLd2rVBQrDC1u+rvVovdaWPf2FHKJf3w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.26.0", + "@mui/private-theming": "^6.4.9", + "@mui/styled-engine": "^6.5.0", + "@mui/types": "~7.2.24", + "@mui/utils": "^6.4.9", + "clsx": "^2.1.1", + "csstype": "^3.1.3", + "prop-types": "^15.8.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@emotion/react": "^11.5.0", + "@emotion/styled": "^11.3.0", + "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react": "^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@emotion/react": { + "optional": true + }, + "@emotion/styled": { + "optional": true + }, + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/types": { + "version": "7.2.24", + "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.24.tgz", + "integrity": "sha512-3c8tRt/CbWZ+pEg7QpSwbdxOk36EfmhbKf6AGZsD1EcLDLTSZoxxJ86FVtcjxvjuhdyBiWKSTGZFaXCnidO2kw==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/utils": { + "version": "6.4.9", + "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-6.4.9.tgz", + "integrity": "sha512-Y12Q9hbK9g+ZY0T3Rxrx9m2m10gaphDuUMgWxyV5kNJevVxXYCLclYUCC9vXaIk1/NdNDTcW2Yfr2OGvNFNmHg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.26.0", + "@mui/types": "~7.2.24", + "@types/prop-types": "^15.7.14", + "clsx": "^2.1.1", + "prop-types": "^15.8.1", + "react-is": "^19.0.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react": "^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@opentelemetry/api": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", + "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@opentelemetry/api-logs": { + "version": "0.213.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.213.0.tgz", + "integrity": "sha512-zRM5/Qj6G84Ej3F1yt33xBVY/3tnMxtL1fiDIxYbDWYaZ/eudVw3/PBiZ8G7JwUxXxjW8gU4g6LnOyfGKYHYgw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/api": "^1.3.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@opentelemetry/context-async-hooks": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-2.6.0.tgz", + "integrity": "sha512-L8UyDwqpTcbkIK5cgwDRDYDoEhQoj8wp8BwsO19w3LB1Z41yEQm2VJyNfAi9DrLP/YTqXqWpKHyZfR9/tFYo1Q==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/core": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.6.0.tgz", + "integrity": "sha512-HLM1v2cbZ4TgYN6KEOj+Bbj8rAKriOdkF9Ed3tG25FoprSiQl7kYc+RRT6fUZGOvx0oMi5U67GoFdT+XUn8zEg==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/instrumentation": { + "version": "0.213.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.213.0.tgz", + "integrity": "sha512-3i9NdkET/KvQomeh7UaR/F4r9P25Rx6ooALlWXPIjypcEOUxksCmVu0zA70NBJWlrMW1rPr/LRidFAflLI+s/w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/api-logs": "0.213.0", + "import-in-the-middle": "^3.0.0", + "require-in-the-middle": "^8.0.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-amqplib": { + "version": "0.60.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-amqplib/-/instrumentation-amqplib-0.60.0.tgz", + "integrity": "sha512-q/B2IvoVXRm1M00MvhnzpMN6rKYOszPXVsALi6u0ss4AYHe+TidZEtLW9N1ZhrobI1dSriHnBqqtAOZVAv07sg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.213.0", + "@opentelemetry/semantic-conventions": "^1.33.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-connect": { + "version": "0.56.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-connect/-/instrumentation-connect-0.56.0.tgz", + "integrity": "sha512-PKp+sSZ7AfzMvGgO3VCyo1inwNu+q7A1k9X88WK4PQ+S6Hp7eFk8pie+sWHDTaARovmqq5V2osav3lQej2B0nw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.213.0", + "@opentelemetry/semantic-conventions": "^1.27.0", + "@types/connect": "3.4.38" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-dataloader": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-dataloader/-/instrumentation-dataloader-0.30.0.tgz", + "integrity": "sha512-MXHP2Q38cd2OhzEBKAIXUi9uBlPEYzF6BNJbyjUXBQ6kLaf93kRC41vNMIz0Nl5mnuwK7fDvKT+/lpx7BXRwdg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.213.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-express": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-express/-/instrumentation-express-0.61.0.tgz", + "integrity": "sha512-Xdmqo9RZuZlL29Flg8QdwrrX7eW1CZ7wFQPKHyXljNymgKhN1MCsYuqQ/7uxavhSKwAl7WxkTzKhnqpUApLMvQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.213.0", + "@opentelemetry/semantic-conventions": "^1.27.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-fs": { + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-fs/-/instrumentation-fs-0.32.0.tgz", + "integrity": "sha512-koR6apx0g0wX6RRiPpjA4AFQUQUbXrK16kq4/SZjVp7u5cffJhNkY4TnITxcGA4acGSPYAfx3NHRIv4Khn1axQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.213.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-generic-pool": { + "version": "0.56.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-generic-pool/-/instrumentation-generic-pool-0.56.0.tgz", + "integrity": "sha512-fg+Jffs6fqrf0uQS0hom7qBFKsbtpBiBl8+Vkc63Gx8xh6pVh+FhagmiO6oM0m3vyb683t1lP7yGYq22SiDnqg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.213.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-graphql": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-graphql/-/instrumentation-graphql-0.61.0.tgz", + "integrity": "sha512-pUiVASv6nh2XrerTvlbVHh7vKFzscpgwiQ/xvnZuAIzQ5lRjWVdRPUuXbvZJ/Yq79QsE81TZdJ7z9YsXiss1ew==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.213.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-hapi": { + "version": "0.59.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-hapi/-/instrumentation-hapi-0.59.0.tgz", + "integrity": "sha512-33wa4mEr+9+ztwdgLor1SeBu4Opz4IsmpcLETXAd3VmBrOjez8uQtrsOhPCa5Vhbm5gzDlMYTgFRLQzf8/YHFA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.213.0", + "@opentelemetry/semantic-conventions": "^1.27.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-http": { + "version": "0.213.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-http/-/instrumentation-http-0.213.0.tgz", + "integrity": "sha512-B978Xsm5XEPGhm1P07grDoaOFLHapJPkOG9h016cJsyWWxmiLnPu2M/4Nrm7UCkHSiLnkXgC+zVGUAIahy8EEA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "2.6.0", + "@opentelemetry/instrumentation": "0.213.0", + "@opentelemetry/semantic-conventions": "^1.29.0", + "forwarded-parse": "2.1.2" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-ioredis": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-ioredis/-/instrumentation-ioredis-0.61.0.tgz", + "integrity": "sha512-hsHDadUtAFbws1YSDc1XW0svGFKiUbqv2td1Cby+UAiwvojm1NyBo/taifH0t8CuFZ0x/2SDm0iuTwrM5pnVOg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.213.0", + "@opentelemetry/redis-common": "^0.38.2", + "@opentelemetry/semantic-conventions": "^1.33.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-kafkajs": { + "version": "0.22.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-kafkajs/-/instrumentation-kafkajs-0.22.0.tgz", + "integrity": "sha512-wJU4IBQMUikdJAcTChLFqK5lo+flo7pahqd8DSLv7uMxsdOdAHj6RzKYAm8pPfUS6ItKYutYyuicwKaFwQKsoA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.213.0", + "@opentelemetry/semantic-conventions": "^1.30.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-knex": { + "version": "0.57.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-knex/-/instrumentation-knex-0.57.0.tgz", + "integrity": "sha512-vMCSh8kolEm5rRsc+FZeTZymWmIJwc40hjIKnXH4O0Dv/gAkJJIRXCsPX5cPbe0c0j/34+PsENd0HqKruwhVYw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.213.0", + "@opentelemetry/semantic-conventions": "^1.33.1" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-koa": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-koa/-/instrumentation-koa-0.61.0.tgz", + "integrity": "sha512-lvrfWe9ShK/D2X4brmx8ZqqeWPfRl8xekU0FCn7C1dHm5k6+rTOOi36+4fnaHAP8lig9Ux6XQ1D4RNIpPCt1WQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.213.0", + "@opentelemetry/semantic-conventions": "^1.36.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.9.0" + } + }, + "node_modules/@opentelemetry/instrumentation-lru-memoizer": { + "version": "0.57.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-lru-memoizer/-/instrumentation-lru-memoizer-0.57.0.tgz", + "integrity": "sha512-cEqpUocSKJfwDtLYTTJehRLWzkZ2eoePCxfVIgGkGkb83fMB71O+y4MvRHJPbeV2bdoWdOVrl8uO0+EynWhTEA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.213.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-mongodb": { + "version": "0.66.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongodb/-/instrumentation-mongodb-0.66.0.tgz", + "integrity": "sha512-d7m9QnAY+4TCWI4q1QRkfrc6fo/92VwssaB1DzQfXNRvu51b78P+HJlWP7Qg6N6nkwdb9faMZNBCZJfftmszkw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.213.0", + "@opentelemetry/semantic-conventions": "^1.33.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-mongoose": { + "version": "0.59.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongoose/-/instrumentation-mongoose-0.59.0.tgz", + "integrity": "sha512-6/jWU+c1NgznkVLDU/2y0bXV2nJo3o9FWZ9mZ9nN6T/JBNRoMnVXZl2FdBmgH+a5MwaWLs5kmRJTP5oUVGIkPw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.213.0", + "@opentelemetry/semantic-conventions": "^1.33.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-mysql": { + "version": "0.59.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mysql/-/instrumentation-mysql-0.59.0.tgz", + "integrity": "sha512-r+V/Fh0sm7Ga8/zk/TI5H5FQRAjwr0RrpfPf8kNIehlsKf12XnvIaZi8ViZkpX0gyPEpLXqzqWD6QHlgObgzZw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.213.0", + "@opentelemetry/semantic-conventions": "^1.33.0", + "@types/mysql": "2.15.27" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-mysql2": { + "version": "0.59.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mysql2/-/instrumentation-mysql2-0.59.0.tgz", + "integrity": "sha512-n9/xrVCRBfG9egVbffnlU1uhr+HX0vF4GgtAB/Bvm48wpFgRidqD8msBMiym1kRYzmpWvJqTxNT47u1MkgBEdw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.213.0", + "@opentelemetry/semantic-conventions": "^1.33.0", + "@opentelemetry/sql-common": "^0.41.2" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-pg": { + "version": "0.65.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-pg/-/instrumentation-pg-0.65.0.tgz", + "integrity": "sha512-W0zpHEIEuyZ8zvb3njaX9AAbHgPYOsSWVOoWmv1sjVRSF6ZpBqtlxBWbU+6hhq1TFWBeWJOXZ8nZS/PUFpLJYQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.213.0", + "@opentelemetry/semantic-conventions": "^1.34.0", + "@opentelemetry/sql-common": "^0.41.2", + "@types/pg": "8.15.6", + "@types/pg-pool": "2.0.7" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-redis": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-redis/-/instrumentation-redis-0.61.0.tgz", + "integrity": "sha512-JnPexA034/0UJRsvH96B0erQoNOqKJZjE2ZRSw9hiTSC23LzE0nJE/u6D+xqOhgUhRnhhcPHq4MdYtmUdYTF+Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.213.0", + "@opentelemetry/redis-common": "^0.38.2", + "@opentelemetry/semantic-conventions": "^1.27.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-tedious": { + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-tedious/-/instrumentation-tedious-0.32.0.tgz", + "integrity": "sha512-BQS6gG8RJ1foEqfEZ+wxoqlwfCAzb1ZVG0ad8Gfe4x8T658HJCLGLd4E4NaoQd8EvPfLqOXgzGaE/2U4ytDSWA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.213.0", + "@opentelemetry/semantic-conventions": "^1.33.0", + "@types/tedious": "^4.0.14" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-undici": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-undici/-/instrumentation-undici-0.23.0.tgz", + "integrity": "sha512-LL0VySzKVR2cJSFVZaTYpZl1XTpBGnfzoQPe2W7McS2267ldsaEIqtQY6VXs2KCXN0poFjze5110PIpxHDaDGg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.213.0", + "@opentelemetry/semantic-conventions": "^1.24.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.7.0" + } + }, + "node_modules/@opentelemetry/redis-common": { + "version": "0.38.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/redis-common/-/redis-common-0.38.2.tgz", + "integrity": "sha512-1BCcU93iwSRZvDAgwUxC/DV4T/406SkMfxGqu5ojc3AvNI+I9GhV7v0J1HljsczuuhcnFLYqD5VmwVXfCGHzxA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.19.0 || >=20.6.0" + } + }, + "node_modules/@opentelemetry/resources": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-2.6.0.tgz", + "integrity": "sha512-D4y/+OGe3JSuYUCBxtH5T9DSAWNcvCb/nQWIga8HNtXTVPQn59j0nTBAgaAXxUVBDl40mG3Tc76b46wPlZaiJQ==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@opentelemetry/core": "2.6.0", + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-trace-base": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-2.6.0.tgz", + "integrity": "sha512-g/OZVkqlxllgFM7qMKqbPV9c1DUPhQ7d4n3pgZFcrnrNft9eJXZM2TNHTPYREJBrtNdRytYyvwjgL5geDKl3EQ==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@opentelemetry/core": "2.6.0", + "@opentelemetry/resources": "2.6.0", + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/semantic-conventions": { + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz", + "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/sql-common": { + "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/sql-common/-/sql-common-0.41.2.tgz", + "integrity": "sha512-4mhWm3Z8z+i508zQJ7r6Xi7y4mmoJpdvH0fZPFRkWrdp5fq7hhZ2HhYokEOLkfqSMgPR4Z9EyB3DBkbKGOqZiQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.1.0" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@pkgr/core": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.9.tgz", + "integrity": "sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/pkgr" + } + }, + "node_modules/@popperjs/core": { + "version": "2.11.8", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", + "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", + "dev": true, + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } + }, + "node_modules/@prisma/instrumentation": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@prisma/instrumentation/-/instrumentation-7.4.2.tgz", + "integrity": "sha512-r9JfchJF1Ae6yAxcaLu/V1TGqBhAuSDe3mRNOssBfx1rMzfZ4fdNvrgUBwyb/TNTGXFxlH9AZix5P257x07nrg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.207.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.8" + } + }, + "node_modules/@prisma/instrumentation/node_modules/@opentelemetry/api-logs": { + "version": "0.207.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.207.0.tgz", + "integrity": "sha512-lAb0jQRVyleQQGiuuvCOTDVspc14nx6XJjP4FspJ1sNARo3Regq4ZZbrc3rN4b1TYSuUCvgH+UXUPug4SLOqEQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/api": "^1.3.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@prisma/instrumentation/node_modules/@opentelemetry/instrumentation": { + "version": "0.207.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.207.0.tgz", + "integrity": "sha512-y6eeli9+TLKnznrR8AZlQMSJT7wILpXH+6EYq5Vf/4Ao+huI7EedxQHwRgVUOMLFbe7VFDvHJrX9/f4lcwnJsA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/api-logs": "0.207.0", + "import-in-the-middle": "^2.0.0", + "require-in-the-middle": "^8.0.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@prisma/instrumentation/node_modules/import-in-the-middle": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-2.0.6.tgz", + "integrity": "sha512-3vZV3jX0XRFW3EJDTwzWoZa+RH1b8eTTx6YOCjglrLyPuepwoBti1k3L2dKwdCUrnVEfc5CuRuGstaC/uQJJaw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "acorn": "^8.15.0", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^2.2.0", + "module-details-from-path": "^1.0.4" + } + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@rtsao/scc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", + "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@sentry-internal/browser-utils": { + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/browser-utils/-/browser-utils-8.55.0.tgz", + "integrity": "sha512-ROgqtQfpH/82AQIpESPqPQe0UyWywKJsmVIqi3c5Fh+zkds5LUxnssTj3yNd1x+kxaPDVB023jAP+3ibNgeNDw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sentry/core": "8.55.0" + }, + "engines": { + "node": ">=14.18" + } + }, + "node_modules/@sentry-internal/feedback": { + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-8.55.0.tgz", + "integrity": "sha512-cP3BD/Q6pquVQ+YL+rwCnorKuTXiS9KXW8HNKu4nmmBAyf7urjs+F6Hr1k9MXP5yQ8W3yK7jRWd09Yu6DHWOiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sentry/core": "8.55.0" + }, + "engines": { + "node": ">=14.18" + } + }, + "node_modules/@sentry-internal/replay": { + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/replay/-/replay-8.55.0.tgz", + "integrity": "sha512-roCDEGkORwolxBn8xAKedybY+Jlefq3xYmgN2fr3BTnsXjSYOPC7D1/mYqINBat99nDtvgFvNfRcZPiwwZ1hSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sentry-internal/browser-utils": "8.55.0", + "@sentry/core": "8.55.0" + }, + "engines": { + "node": ">=14.18" + } + }, + "node_modules/@sentry-internal/replay-canvas": { + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-8.55.0.tgz", + "integrity": "sha512-nIkfgRWk1091zHdu4NbocQsxZF1rv1f7bbp3tTIlZYbrH62XVZosx5iHAuZG0Zc48AETLE7K4AX9VGjvQj8i9w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sentry-internal/replay": "8.55.0", + "@sentry/core": "8.55.0" + }, + "engines": { + "node": ">=14.18" + } + }, + "node_modules/@sentry/browser": { + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-8.55.0.tgz", + "integrity": "sha512-1A31mCEWCjaMxJt6qGUK+aDnLDcK6AwLAZnqpSchNysGni1pSn1RWSmk9TBF8qyTds5FH8B31H480uxMPUJ7Cw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sentry-internal/browser-utils": "8.55.0", + "@sentry-internal/feedback": "8.55.0", + "@sentry-internal/replay": "8.55.0", + "@sentry-internal/replay-canvas": "8.55.0", + "@sentry/core": "8.55.0" + }, + "engines": { + "node": ">=14.18" + } + }, + "node_modules/@sentry/core": { + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.55.0.tgz", + "integrity": "sha512-6g7jpbefjHYs821Z+EBJ8r4Z7LT5h80YSWRJaylGS4nW5W5Z2KXzpdnyFarv37O7QjauzVC2E+PABmpkw5/JGA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.18" + } + }, + "node_modules/@sentry/integrations": { + "version": "7.114.0", + "resolved": "https://registry.npmjs.org/@sentry/integrations/-/integrations-7.114.0.tgz", + "integrity": "sha512-BJIBWXGKeIH0ifd7goxOS29fBA8BkEgVVCahs6xIOXBjX1IRS6PmX0zYx/GP23nQTfhJiubv2XPzoYOlZZmDxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sentry/core": "7.114.0", + "@sentry/types": "7.114.0", + "@sentry/utils": "7.114.0", + "localforage": "^1.8.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry/integrations/node_modules/@sentry/core": { + "version": "7.114.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.114.0.tgz", + "integrity": "sha512-YnanVlmulkjgZiVZ9BfY9k6I082n+C+LbZo52MTvx3FY6RE5iyiPMpaOh67oXEZRWcYQEGm+bKruRxLVP6RlbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sentry/types": "7.114.0", + "@sentry/utils": "7.114.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry/node": { + "version": "10.44.0", + "resolved": "https://registry.npmjs.org/@sentry/node/-/node-10.44.0.tgz", + "integrity": "sha512-q+/WR9ZeF9Af8uyehOj2tQQOa7LH07mJfOuDus5X6G6cLuugdRUGUBB5Qhw+J/ULSxbzGADBZv6AYOyoGaNx7w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@fastify/otel": "0.17.1", + "@opentelemetry/api": "^1.9.0", + "@opentelemetry/context-async-hooks": "^2.6.0", + "@opentelemetry/core": "^2.6.0", + "@opentelemetry/instrumentation": "^0.213.0", + "@opentelemetry/instrumentation-amqplib": "0.60.0", + "@opentelemetry/instrumentation-connect": "0.56.0", + "@opentelemetry/instrumentation-dataloader": "0.30.0", + "@opentelemetry/instrumentation-express": "0.61.0", + "@opentelemetry/instrumentation-fs": "0.32.0", + "@opentelemetry/instrumentation-generic-pool": "0.56.0", + "@opentelemetry/instrumentation-graphql": "0.61.0", + "@opentelemetry/instrumentation-hapi": "0.59.0", + "@opentelemetry/instrumentation-http": "0.213.0", + "@opentelemetry/instrumentation-ioredis": "0.61.0", + "@opentelemetry/instrumentation-kafkajs": "0.22.0", + "@opentelemetry/instrumentation-knex": "0.57.0", + "@opentelemetry/instrumentation-koa": "0.61.0", + "@opentelemetry/instrumentation-lru-memoizer": "0.57.0", + "@opentelemetry/instrumentation-mongodb": "0.66.0", + "@opentelemetry/instrumentation-mongoose": "0.59.0", + "@opentelemetry/instrumentation-mysql": "0.59.0", + "@opentelemetry/instrumentation-mysql2": "0.59.0", + "@opentelemetry/instrumentation-pg": "0.65.0", + "@opentelemetry/instrumentation-redis": "0.61.0", + "@opentelemetry/instrumentation-tedious": "0.32.0", + "@opentelemetry/instrumentation-undici": "0.23.0", + "@opentelemetry/resources": "^2.6.0", + "@opentelemetry/sdk-trace-base": "^2.6.0", + "@opentelemetry/semantic-conventions": "^1.40.0", + "@prisma/instrumentation": "7.4.2", + "@sentry/core": "10.44.0", + "@sentry/node-core": "10.44.0", + "@sentry/opentelemetry": "10.44.0", + "import-in-the-middle": "^3.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@sentry/node-core": { + "version": "10.44.0", + "resolved": "https://registry.npmjs.org/@sentry/node-core/-/node-core-10.44.0.tgz", + "integrity": "sha512-jUGsadMrvZ08UMbqJBfjFFMk1k3VbyxfUypf0iDGGgyLmuHotYQPo/5aND+o2KxMDXR60LwcQrMoZFpanK6jXQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sentry/core": "10.44.0", + "@sentry/opentelemetry": "10.44.0", + "import-in-the-middle": "^3.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.9.0", + "@opentelemetry/context-async-hooks": "^1.30.1 || ^2.1.0", + "@opentelemetry/core": "^1.30.1 || ^2.1.0", + "@opentelemetry/instrumentation": ">=0.57.1 <1", + "@opentelemetry/resources": "^1.30.1 || ^2.1.0", + "@opentelemetry/sdk-trace-base": "^1.30.1 || ^2.1.0", + "@opentelemetry/semantic-conventions": "^1.39.0" + }, + "peerDependenciesMeta": { + "@opentelemetry/api": { + "optional": true + }, + "@opentelemetry/context-async-hooks": { + "optional": true + }, + "@opentelemetry/core": { + "optional": true + }, + "@opentelemetry/instrumentation": { + "optional": true + }, + "@opentelemetry/resources": { + "optional": true + }, + "@opentelemetry/sdk-trace-base": { + "optional": true + }, + "@opentelemetry/semantic-conventions": { + "optional": true + } + } + }, + "node_modules/@sentry/node-core/node_modules/@sentry/core": { + "version": "10.44.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-10.44.0.tgz", + "integrity": "sha512-aa7CiDaNFZvHpqd97LJhuskolfJ/4IH5xyuVVLnv7l6B0v9KTwskPUxb0tH1ej3FxuzfH+i8iTiTFuqpfHS3QA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@sentry/node/node_modules/@sentry/core": { + "version": "10.44.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-10.44.0.tgz", + "integrity": "sha512-aa7CiDaNFZvHpqd97LJhuskolfJ/4IH5xyuVVLnv7l6B0v9KTwskPUxb0tH1ej3FxuzfH+i8iTiTFuqpfHS3QA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@sentry/opentelemetry": { + "version": "10.44.0", + "resolved": "https://registry.npmjs.org/@sentry/opentelemetry/-/opentelemetry-10.44.0.tgz", + "integrity": "sha512-zP4vP8tBxjlmxQ4VcWOwZ0b3lPUxlYPg9FqJwANm9SRJN+7V5psm8TIaAtu9uqtIcJMRHdXkOM4cAggNiLk0KA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sentry/core": "10.44.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.9.0", + "@opentelemetry/context-async-hooks": "^1.30.1 || ^2.1.0", + "@opentelemetry/core": "^1.30.1 || ^2.1.0", + "@opentelemetry/sdk-trace-base": "^1.30.1 || ^2.1.0", + "@opentelemetry/semantic-conventions": "^1.39.0" + } + }, + "node_modules/@sentry/opentelemetry/node_modules/@sentry/core": { + "version": "10.44.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-10.44.0.tgz", + "integrity": "sha512-aa7CiDaNFZvHpqd97LJhuskolfJ/4IH5xyuVVLnv7l6B0v9KTwskPUxb0tH1ej3FxuzfH+i8iTiTFuqpfHS3QA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@sentry/types": { + "version": "7.114.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.114.0.tgz", + "integrity": "sha512-tsqkkyL3eJtptmPtT0m9W/bPLkU7ILY7nvwpi1hahA5jrM7ppoU0IMaQWAgTD+U3rzFH40IdXNBFb8Gnqcva4w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry/utils": { + "version": "7.114.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.114.0.tgz", + "integrity": "sha512-319N90McVpupQ6vws4+tfCy/03AdtsU0MurIE4+W5cubHME08HtiEWlfacvAxX+yuKFhvdsO4K4BB/dj54ideg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sentry/types": "7.114.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@sinonjs/commons": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/commons/node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-13.0.5.tgz", + "integrity": "sha512-36/hTbH2uaWuGVERyC6da9YwGWnzUZXuPro/F2LfsdOsLnCojz/iSH8MxUt/FD2S5XBSVPhmArFUXcpCQ2Hkiw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.1" + } + }, + "node_modules/@sinonjs/samsam": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-8.0.3.tgz", + "integrity": "sha512-hw6HbX+GyVZzmaYNh82Ecj1vdGZrqVIn/keDTg63IgAwiQPO+xCz99uG6Woqgb4tM0mUiFENKZ4cqd7IX94AXQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.1", + "type-detect": "^4.1.0" + } + }, + "node_modules/@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10" + } + }, + "node_modules/@types/caseless": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.5.tgz", + "integrity": "sha512-hWtVTC2q7hc7xZ/RLbxapMvDMgUnDvKvMOpKal4DrMyfGBUfB1oKaZlIRr6mJL+If3bAP6sV/QneGzF6tJjZDg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/chai": { + "version": "4.3.20", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.20.tgz", + "integrity": "sha512-/pC9HAB5I/xMlc5FP77qjCnI16ChlJfW0tGa0IUcFn38VJrTV6DeZ60NU5KZBtaOZqjdpwTWohz5HU1RrhiYxQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/chai-as-promised": { + "version": "7.1.8", + "resolved": "https://registry.npmjs.org/@types/chai-as-promised/-/chai-as-promised-7.1.8.tgz", + "integrity": "sha512-ThlRVIJhr69FLlh6IctTXFkmhtP3NpMZ2QGq69StYLyKZFp/HOp1VdKZj7RvfNWYYcJ1xlbLGLLWj1UvP5u/Gw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/mocha": { + "version": "10.0.10", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.10.tgz", + "integrity": "sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/mysql": { + "version": "2.15.27", + "resolved": "https://registry.npmjs.org/@types/mysql/-/mysql-2.15.27.tgz", + "integrity": "sha512-YfWiV16IY0OeBfBCk8+hXKmdTKrKlwKN1MNKAPBu5JYxLwBEZl7QzeEpGnlZb3VMGJrrGmB84gXiH+ofs/TezA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/node": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.5.0.tgz", + "integrity": "sha512-jp2P3tQMSxWugkCUKLRPVUpGaL5MVFwF8RDuSRztfwgN1wmqJeMSbKlnEtQqU8UrhTmzEmZdu2I6v2dpp7XIxw==", + "license": "MIT", + "peer": true, + "dependencies": { + "undici-types": "~7.18.0" + } + }, + "node_modules/@types/node-schedule": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@types/node-schedule/-/node-schedule-2.1.8.tgz", + "integrity": "sha512-k00g6Yj/oUg/CDC+MeLHUzu0+OFxWbIqrFfDiLi6OPKxTujvpv29mHGM8GtKr7B+9Vv92FcK/8mRqi1DK5f3hA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/nodemailer": { + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/nodemailer/-/nodemailer-7.0.11.tgz", + "integrity": "sha512-E+U4RzR2dKrx+u3N4DlsmLaDC6mMZOM/TPROxA0UAPiTgI0y4CEFBmZE+coGWTjakDriRsXG368lNk1u9Q0a2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/pg": { + "version": "8.15.6", + "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.15.6.tgz", + "integrity": "sha512-NoaMtzhxOrubeL/7UZuNTrejB4MPAJ0RpxZqXQf2qXuVlTPuG6Y8p4u9dKRaue4yjmC7ZhzVO2/Yyyn25znrPQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "pg-protocol": "*", + "pg-types": "^2.2.0" + } + }, + "node_modules/@types/pg-pool": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/pg-pool/-/pg-pool-2.0.7.tgz", + "integrity": "sha512-U4CwmGVQcbEuqpyju8/ptOKg6gEC+Tqsvj2xS9o1g71bUh8twxnC6ZL5rZKCsGN0iyH0CwgUyc9VR5owNQF9Ng==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/pg": "*" + } + }, + "node_modules/@types/prop-types": { + "version": "15.7.15", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz", + "integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/react": { + "version": "19.2.2", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.2.tgz", + "integrity": "sha512-6mDvHUFSjyT2B2yeNx2nUgMxh9LtOWvkhIU3uePn2I2oyNymUAX1NIsdgviM4CH+JSrp2D2hsMvJOkxY+0wNRA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "csstype": "^3.0.2" + } + }, + "node_modules/@types/react-transition-group": { + "version": "4.4.12", + "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.12.tgz", + "integrity": "sha512-8TV6R3h2j7a91c+1DXdJi3Syo69zzIZbz7Lg5tORM5LEJG7X/E6a1V3drRyBRZq7/utz7A+c4OgYLiLcYGHG6w==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "*" + } + }, + "node_modules/@types/request": { + "version": "2.48.13", + "resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.13.tgz", + "integrity": "sha512-FGJ6udDNUCjd19pp0Q3iTiDkwhYup7J8hpMW9c4k53NrccQFFWKRho6hvtPPEhnXWKvukfwAlB6DbDz4yhH5Gg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/caseless": "*", + "@types/node": "*", + "@types/tough-cookie": "*", + "form-data": "^2.5.5" + } + }, + "node_modules/@types/sinon": { + "version": "17.0.4", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.4.tgz", + "integrity": "sha512-RHnIrhfPO3+tJT0s7cFaXGZvsL4bbR3/k7z3P312qMS4JaS2Tk+KiwiLx1S0rQ56ERj00u1/BtdyVd0FY+Pdew==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/sinonjs__fake-timers": "*" + } + }, + "node_modules/@types/sinon-chai": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/@types/sinon-chai/-/sinon-chai-3.2.12.tgz", + "integrity": "sha512-9y0Gflk3b0+NhQZ/oxGtaAJDvRywCa5sIyaVnounqLvmf93yBF4EgIRspePtkMs3Tr844nCclYMlcCNmLCvjuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "*", + "@types/sinon": "*" + } + }, + "node_modules/@types/sinonjs__fake-timers": { + "version": "15.0.1", + "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-15.0.1.tgz", + "integrity": "sha512-Ko2tjWJq8oozHzHV+reuvS5KYIRAokHnGbDwGh/J64LntgpbuylF74ipEL24HCyRjf9FOlBiBHWBR1RlVKsI1w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/suncalc": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@types/suncalc/-/suncalc-1.9.2.tgz", + "integrity": "sha512-ATAGBHHfA1TlE2tjfidLyTcysjoT2JHHEAmWRULh73SU9UTn++j5fqHEW16X6Y/2Li87jEQXzgu4R/OOdlDqzw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/tedious": { + "version": "4.0.14", + "resolved": "https://registry.npmjs.org/@types/tedious/-/tedious-4.0.14.tgz", + "integrity": "sha512-KHPsfX/FoVbUGbyYvk1q9MMQHLPeRZhRJZdO45Q4YjvFkv4hMNghCWTvy7rdKessBsmtz4euWCWAB6/tVpI1Iw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/tough-cookie": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", + "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.46.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.46.2.tgz", + "integrity": "sha512-ZGBMToy857/NIPaaCucIUQgqueOiq7HeAKkhlvqVV4lm089zUFW6ikRySx2v+cAhKeUCPuWVHeimyk6Dw1iY3w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.46.2", + "@typescript-eslint/type-utils": "8.46.2", + "@typescript-eslint/utils": "8.46.2", + "@typescript-eslint/visitor-keys": "8.46.2", + "graphemer": "^1.4.0", + "ignore": "^7.0.0", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.1.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.46.2", + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.46.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.46.2.tgz", + "integrity": "sha512-BnOroVl1SgrPLywqxyqdJ4l3S2MsKVLDVxZvjI1Eoe8ev2r3kGDo+PcMihNmDE+6/KjkTubSJnmqGZZjQSBq/g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@typescript-eslint/scope-manager": "8.46.2", + "@typescript-eslint/types": "8.46.2", + "@typescript-eslint/typescript-estree": "8.46.2", + "@typescript-eslint/visitor-keys": "8.46.2", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.46.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.46.2.tgz", + "integrity": "sha512-PULOLZ9iqwI7hXcmL4fVfIsBi6AN9YxRc0frbvmg8f+4hQAjQ5GYNKK0DIArNo+rOKmR/iBYwkpBmnIwin4wBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.46.2", + "@typescript-eslint/types": "^8.46.2", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.46.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.46.2.tgz", + "integrity": "sha512-LF4b/NmGvdWEHD2H4MsHD8ny6JpiVNDzrSZr3CsckEgCbAGZbYM4Cqxvi9L+WqDMT+51Ozy7lt2M+d0JLEuBqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.46.2", + "@typescript-eslint/visitor-keys": "8.46.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.46.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.46.2.tgz", + "integrity": "sha512-a7QH6fw4S57+F5y2FIxxSDyi5M4UfGF+Jl1bCGd7+L4KsaUY80GsiF/t0UoRFDHAguKlBaACWJRmdrc6Xfkkag==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.46.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.46.2.tgz", + "integrity": "sha512-HbPM4LbaAAt/DjxXaG9yiS9brOOz6fabal4uvUmaUYe6l3K1phQDMQKBRUrr06BQkxkvIZVVHttqiybM9nJsLA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.46.2", + "@typescript-eslint/typescript-estree": "8.46.2", + "@typescript-eslint/utils": "8.46.2", + "debug": "^4.3.4", + "ts-api-utils": "^2.1.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.46.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.46.2.tgz", + "integrity": "sha512-lNCWCbq7rpg7qDsQrd3D6NyWYu+gkTENkG5IKYhUIcxSb59SQC/hEQ+MrG4sTgBVghTonNWq42bA/d4yYumldQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.46.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.46.2.tgz", + "integrity": "sha512-f7rW7LJ2b7Uh2EiQ+7sza6RDZnajbNbemn54Ob6fRwQbgcIn+GWfyuHDHRYgRoZu1P4AayVScrRW+YfbTvPQoQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/project-service": "8.46.2", + "@typescript-eslint/tsconfig-utils": "8.46.2", + "@typescript-eslint/types": "8.46.2", + "@typescript-eslint/visitor-keys": "8.46.2", + "debug": "^4.3.4", + "fast-glob": "^3.3.2", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.1.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.46.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.46.2.tgz", + "integrity": "sha512-sExxzucx0Tud5tE0XqR0lT0psBQvEpnpiul9XbGUB1QwpWJJAps1O/Z7hJxLGiZLBKMCutjTzDgmd1muEhBnVg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.7.0", + "@typescript-eslint/scope-manager": "8.46.2", + "@typescript-eslint/types": "8.46.2", + "@typescript-eslint/typescript-estree": "8.46.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.46.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.46.2.tgz", + "integrity": "sha512-tUFMXI4gxzzMXt4xpGJEsBsTox0XbNQ1y94EwlD/CuZwFcQP79xfQqMhau9HsRc/J0cAPA/HZt1dZPtGn9V/7w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.46.2", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/acorn": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^8" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/acorn-jsx-walk": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/acorn-jsx-walk/-/acorn-jsx-walk-2.0.0.tgz", + "integrity": "sha512-uuo6iJj4D4ygkdzd6jPtcxs8vZgDX9YFIkqczGImoypX2fQ4dVImmu3UzA4ynixCIMTrEOWW+95M2HuBaCEOVA==", + "dev": true, + "license": "MIT" + }, + "node_modules/acorn-walk": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", + "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/adm-zip": { + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.16.tgz", + "integrity": "sha512-TGw5yVi4saajsSEgz25grObGHEUaDrniwvA2qwSC060KfqGPdglhvPMA2lPIoxs3PQIItj2iag35fONcQqgUaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0" + } + }, + "node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/alcalzone-shared": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/alcalzone-shared/-/alcalzone-shared-5.0.0.tgz", + "integrity": "sha512-X73hgVWcrIKUUB6jZgHj5flRbTft8AAoJ2MqRKEcAX1whW3OeGkxsQ6ol4nd4/rKxd1eoCRXUGW3cIhXrXU4Sg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/are-docs-informative": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz", + "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", + "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "is-array-buffer": "^3.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-includes": { + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.9.tgz", + "integrity": "sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.24.0", + "es-object-atoms": "^1.1.1", + "get-intrinsic": "^1.3.0", + "is-string": "^1.1.1", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.findlast": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz", + "integrity": "sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.6.tgz", + "integrity": "sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "es-shim-unscopables": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz", + "integrity": "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.3.tgz", + "integrity": "sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.tosorted": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.4.tgz", + "integrity": "sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.3", + "es-errors": "^1.3.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", + "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/async-function": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", + "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/axios": { + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.6.tgz", + "integrity": "sha512-ChTCHMouEe2kn713WHbQGcuYrr6fXTBiu460OTwWrWob16g1bXn4vtz07Ope7ewMozJAnEquLk5lWQWtBig9DQ==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.11", + "form-data": "^4.0.5", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/axios/node_modules/form-data": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/baseline-browser-mapping": { + "version": "2.8.21", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.21.tgz", + "integrity": "sha512-JU0h5APyQNsHOlAM7HnQnPToSDQoEBZqzu/YBlqDnEeymPnZDREeXJA3KBMQee+dKteAxZ2AtvQEvVYdZf241Q==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.js" + } + }, + "node_modules/bignumber.js": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.1.tgz", + "integrity": "sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true, + "license": "ISC" + }, + "node_modules/browserslist": { + "version": "4.27.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.27.0.tgz", + "integrity": "sha512-AXVQwdhot1eqLihwasPElhX2tAZiBjWdJ9i/Zcj2S6QYIjkx62OKSfnobkriB81C3l4w0rVy3Nt4jaTBltYEpw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "baseline-browser-mapping": "^2.8.19", + "caniuse-lite": "^1.0.30001751", + "electron-to-chromium": "^1.5.238", + "node-releases": "^2.0.26", + "update-browserslist-db": "^1.1.4" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/builtin-modules": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-5.0.0.tgz", + "integrity": "sha512-bkXY9WsVpY7CvMhKSR6pZilZu9Ln5WDrKVBUXf2S443etkmEO4V58heTecXcUIsNsi4Rx8JUO4NfX1IcQl4deg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001751", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001751.tgz", + "integrity": "sha512-A0QJhug0Ly64Ii3eIqHu5X51ebln3k4yTUkY1j8drqpWHVreg/VLijN48cZ1bYPiqOQuqpkIKnzr/Ul8V+p6Cw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chai": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", + "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", + "pathval": "^1.1.1", + "type-detect": "^4.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chai-as-promised": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-7.1.2.tgz", + "integrity": "sha512-aBDHZxRzYnUYuIAIPBH2s511DjlKPzXNlXSGFC8CwmroWQLfrW0LtE1nK3MAwwNhJPa9raEjNCmRoFpG0Hurdw==", + "dev": true, + "license": "WTFPL", + "dependencies": { + "check-error": "^1.0.2" + }, + "peerDependencies": { + "chai": ">= 2.1.2 < 6" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/change-case": { + "version": "5.4.4", + "resolved": "https://registry.npmjs.org/change-case/-/change-case-5.4.4.tgz", + "integrity": "sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/check-error": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-func-name": "^2.0.2" + }, + "engines": { + "node": "*" + } + }, + "node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/ci-info": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.3.1.tgz", + "integrity": "sha512-Wdy2Igu8OcBpI2pZePZ5oWjPC38tmDVx5WKUXKwlLYkA0ozo85sLsLvkBbBn/sZaSCMFOGZJ14fvW9t5/d7kdA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cjs-module-lexer": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-2.2.0.tgz", + "integrity": "sha512-4bHTS2YuzUvtoLjdy+98ykbNB5jS0+07EvFNXerqZQJ89F7DI6ET7OQo/HJuW6K0aVsKA9hj9/RVb2kQVOrPDQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/clean-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clean-regexp/-/clean-regexp-1.0.0.tgz", + "integrity": "sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/clean-regexp/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/comment-parser": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", + "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/core-js-compat": { + "version": "3.46.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.46.0.tgz", + "integrity": "sha512-p9hObIIEENxSV8xIu+V68JjSeARg6UVMG5mR+JEUguG3sI6MsiS1njz2jHmyJDvA+8jX/sytkBHup6kxhM9law==", + "dev": true, + "license": "MIT", + "dependencies": { + "browserslist": "^4.26.3" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "license": "MIT" + }, + "node_modules/cron-parser": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-4.9.0.tgz", + "integrity": "sha512-p0SaNjrHOnQeR8/VnfGbmg9te2kfyYSQ7Sc/j/6DtPL3JQvKxmjO9TSjNFpujqV3vEYYBvNNvXSxzyksBWAx1Q==", + "license": "MIT", + "dependencies": { + "luxon": "^3.2.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/csstype": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", + "dev": true, + "license": "MIT" + }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/data-view-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", + "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", + "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/inspect-js" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", + "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deep-eql": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", + "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/deepl-node": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/deepl-node/-/deepl-node-1.20.0.tgz", + "integrity": "sha512-2MNJgJgQQWHAieaKYJyxYe1g21P8MYOtMbcS7ApyBHT8856c6EYO9RRNevodGaIf0oiKMzwyenJ59O7B0NQyGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": ">=12.0", + "adm-zip": "^0.5.16", + "axios": "^1.7.4", + "form-data": "^3.0.0", + "loglevel": ">=1.6.2", + "uuid": "^8.3.2" + }, + "engines": { + "node": ">=12.0" + } + }, + "node_modules/deepl-node/node_modules/form-data": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.4.tgz", + "integrity": "sha512-f0cRzm6dkyVYV3nPoooP8XlccPQukegwhAnpoLcXy+X+A8KfpGOoXwDr9FLZd3wzgLaBGQBE3lY93Zm/i1JvIQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.35" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/diff": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", + "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/dom-helpers": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", + "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.8.7", + "csstype": "^3.0.2" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/duplexify": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.3.tgz", + "integrity": "sha512-M3BmBhwJRZsSx38lZyhE53Csddgzl5R7xGJNk7CVddZD6CcmwMCH8J+7AprIrQKH7TonKxaCjcv27Qmf+sQ+oA==", + "dev": true, + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.4.1", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1", + "stream-shift": "^1.0.2" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true, + "license": "MIT" + }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.243", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.243.tgz", + "integrity": "sha512-ZCphxFW3Q1TVhcgS9blfut1PX8lusVi2SvXQgmEEnK4TCmE1JhH2JkjJN+DNt0pJJwfBri5AROBnz2b/C+YU9g==", + "dev": true, + "license": "ISC" + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/enquirer": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", + "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-colors": "^4.1.1", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/es-abstract": { + "version": "1.24.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.0.tgz", + "integrity": "sha512-WSzPgsdLtTcQwm4CROfS5ju2Wa1QQcVeT37jFjYzdFz1r9ahadC8B8/a4qxJxM+09F18iumCdRmlr96ZYkQvEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.2", + "arraybuffer.prototype.slice": "^1.0.4", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "data-view-buffer": "^1.0.2", + "data-view-byte-length": "^1.0.2", + "data-view-byte-offset": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "es-set-tostringtag": "^2.1.0", + "es-to-primitive": "^1.3.0", + "function.prototype.name": "^1.1.8", + "get-intrinsic": "^1.3.0", + "get-proto": "^1.0.1", + "get-symbol-description": "^1.1.0", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "internal-slot": "^1.1.0", + "is-array-buffer": "^3.0.5", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.2", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.2.1", + "is-set": "^2.0.3", + "is-shared-array-buffer": "^1.0.4", + "is-string": "^1.1.1", + "is-typed-array": "^1.1.15", + "is-weakref": "^1.1.1", + "math-intrinsics": "^1.1.0", + "object-inspect": "^1.13.4", + "object-keys": "^1.1.1", + "object.assign": "^4.1.7", + "own-keys": "^1.0.1", + "regexp.prototype.flags": "^1.5.4", + "safe-array-concat": "^1.1.3", + "safe-push-apply": "^1.0.0", + "safe-regex-test": "^1.1.0", + "set-proto": "^1.0.0", + "stop-iteration-iterator": "^1.1.0", + "string.prototype.trim": "^1.2.10", + "string.prototype.trimend": "^1.0.9", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.3", + "typed-array-byte-length": "^1.0.3", + "typed-array-byte-offset": "^1.0.4", + "typed-array-length": "^1.0.7", + "unbox-primitive": "^1.1.0", + "which-typed-array": "^1.1.19" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-iterator-helpers": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.2.1.tgz", + "integrity": "sha512-uDn+FE1yrDzyC0pCo961B2IHbdM8y/ACZsKD4dG6WqrjV53BADjwa7D+1aom2rsNVfLyDgU/eigvlJGJ08OQ4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.6", + "es-errors": "^1.3.0", + "es-set-tostringtag": "^2.0.3", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.6", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "internal-slot": "^1.1.0", + "iterator.prototype": "^1.1.4", + "safe-array-concat": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz", + "integrity": "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-to-primitive": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", + "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.2.7", + "is-date-object": "^1.0.5", + "is-symbol": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/esbuild": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.11.tgz", + "integrity": "sha512-KohQwyzrKTQmhXDW1PjCv3Tyspn9n5GcY2RTDqeORIdIJY8yKIF7sTSopFmn/wpMPW4rdPXI0UE5LJLuq3bx0Q==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.11", + "@esbuild/android-arm": "0.25.11", + "@esbuild/android-arm64": "0.25.11", + "@esbuild/android-x64": "0.25.11", + "@esbuild/darwin-arm64": "0.25.11", + "@esbuild/darwin-x64": "0.25.11", + "@esbuild/freebsd-arm64": "0.25.11", + "@esbuild/freebsd-x64": "0.25.11", + "@esbuild/linux-arm": "0.25.11", + "@esbuild/linux-arm64": "0.25.11", + "@esbuild/linux-ia32": "0.25.11", + "@esbuild/linux-loong64": "0.25.11", + "@esbuild/linux-mips64el": "0.25.11", + "@esbuild/linux-ppc64": "0.25.11", + "@esbuild/linux-riscv64": "0.25.11", + "@esbuild/linux-s390x": "0.25.11", + "@esbuild/linux-x64": "0.25.11", + "@esbuild/netbsd-arm64": "0.25.11", + "@esbuild/netbsd-x64": "0.25.11", + "@esbuild/openbsd-arm64": "0.25.11", + "@esbuild/openbsd-x64": "0.25.11", + "@esbuild/openharmony-arm64": "0.25.11", + "@esbuild/sunos-x64": "0.25.11", + "@esbuild/win32-arm64": "0.25.11", + "@esbuild/win32-ia32": "0.25.11", + "@esbuild/win32-x64": "0.25.11" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "9.38.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.38.0.tgz", + "integrity": "sha512-t5aPOpmtJcZcz5UJyY2GbvpDlsK5E8JqRqoKtfiKE3cNh437KIqfJr3A3AKf5k64NPx6d0G3dno6XDY05PqPtw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.21.1", + "@eslint/config-helpers": "^0.4.1", + "@eslint/core": "^0.16.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.38.0", + "@eslint/plugin-kit": "^0.4.0", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.4.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-config-prettier": { + "version": "10.1.8", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz", + "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "funding": { + "url": "https://opencollective.com/eslint-config-prettier" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-module-utils": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.1.tgz", + "integrity": "sha512-L8jSWTze7K2mTg0vos/RuLRS5soomksDPoJLXIslC7c8Wmut3bx7CPpJijDcBZtxQ5lrbUdM+s0OlNbz0DCDNw==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^3.2.7" + }, + "engines": { + "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import": { + "version": "2.32.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.32.0.tgz", + "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rtsao/scc": "^1.1.0", + "array-includes": "^3.1.9", + "array.prototype.findlastindex": "^1.2.6", + "array.prototype.flat": "^1.3.3", + "array.prototype.flatmap": "^1.3.3", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.12.1", + "hasown": "^2.0.2", + "is-core-module": "^2.16.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.8", + "object.groupby": "^1.0.3", + "object.values": "^1.2.1", + "semver": "^6.3.1", + "string.prototype.trimend": "^1.0.9", + "tsconfig-paths": "^3.15.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-plugin-jsdoc": { + "version": "54.7.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-54.7.0.tgz", + "integrity": "sha512-u5Na4he2+6kY1rWqxzbQaAwJL3/tDCuT5ElDRc5UJ9stOeQeQ5L1JJ1kRRu7ldYMlOHMCJLsY8Mg/Tu3ExdZiQ==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@es-joy/jsdoccomment": "~0.56.0", + "are-docs-informative": "^0.0.2", + "comment-parser": "1.4.1", + "debug": "^4.4.1", + "escape-string-regexp": "^4.0.0", + "espree": "^10.4.0", + "esquery": "^1.6.0", + "parse-imports-exports": "^0.2.4", + "semver": "^7.7.2", + "spdx-expression-parse": "^4.0.0" + }, + "engines": { + "node": ">=20.11.0" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" + } + }, + "node_modules/eslint-plugin-prettier": { + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.4.tgz", + "integrity": "sha512-swNtI95SToIz05YINMA6Ox5R057IMAmWZ26GqPxusAp1TZzj+IdY9tXNWWD3vkF/wEqydCONcwjTFpxybBqZsg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.11.7" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-plugin-prettier" + }, + "peerDependencies": { + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "eslint-config-prettier": ">= 7.0.0 <10.0.0 || >=10.1.0", + "prettier": ">=3.0.0" + }, + "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, + "eslint-config-prettier": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-react": { + "version": "7.37.5", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.5.tgz", + "integrity": "sha512-Qteup0SqU15kdocexFNAJMvCJEfa2xUKNV4CC1xsVMrIIqEy3SQ/rqyxCWNzfrd3/ldy6HMlD2e0JDVpDg2qIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-includes": "^3.1.8", + "array.prototype.findlast": "^1.2.5", + "array.prototype.flatmap": "^1.3.3", + "array.prototype.tosorted": "^1.1.4", + "doctrine": "^2.1.0", + "es-iterator-helpers": "^1.2.1", + "estraverse": "^5.3.0", + "hasown": "^2.0.2", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "minimatch": "^3.1.2", + "object.entries": "^1.1.9", + "object.fromentries": "^2.0.8", + "object.values": "^1.2.1", + "prop-types": "^15.8.1", + "resolve": "^2.0.0-next.5", + "semver": "^6.3.1", + "string.prototype.matchall": "^4.0.12", + "string.prototype.repeat": "^1.0.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" + } + }, + "node_modules/eslint-plugin-react-hooks": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-5.2.0.tgz", + "integrity": "sha512-+f15FfK64YQwZdJNELETdn5ibXEUQmW1DZL6KXhNnc2heoy/sg9VJJeT7n8TlMWouzWqSWavFkIhHyIbIAEapg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0" + } + }, + "node_modules/eslint-plugin-react/node_modules/resolve": { + "version": "2.0.0-next.5", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", + "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/eslint-plugin-react/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-plugin-unicorn": { + "version": "60.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-60.0.0.tgz", + "integrity": "sha512-QUzTefvP8stfSXsqKQ+vBQSEsXIlAiCduS/V1Em+FKgL9c21U/IIm20/e3MFy1jyCf14tHAhqC1sX8OTy6VUCg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.27.1", + "@eslint-community/eslint-utils": "^4.7.0", + "@eslint/plugin-kit": "^0.3.3", + "change-case": "^5.4.4", + "ci-info": "^4.3.0", + "clean-regexp": "^1.0.0", + "core-js-compat": "^3.44.0", + "esquery": "^1.6.0", + "find-up-simple": "^1.0.1", + "globals": "^16.3.0", + "indent-string": "^5.0.0", + "is-builtin-module": "^5.0.0", + "jsesc": "^3.1.0", + "pluralize": "^8.0.0", + "regexp-tree": "^0.1.27", + "regjsparser": "^0.12.0", + "semver": "^7.7.2", + "strip-indent": "^4.0.0" + }, + "engines": { + "node": "^20.10.0 || >=21.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/eslint-plugin-unicorn?sponsor=1" + }, + "peerDependencies": { + "eslint": ">=9.29.0" + } + }, + "node_modules/eslint-plugin-unicorn/node_modules/@eslint/core": { + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.15.2.tgz", + "integrity": "sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/eslint-plugin-unicorn/node_modules/@eslint/plugin-kit": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.5.tgz", + "integrity": "sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.15.2", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/eslint-scope": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", + "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.15.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fastq": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", + "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-up-simple": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.1.tgz", + "integrity": "sha512-afd4O7zpqHeRyg4PfDQsXmlDe2PfdHtJt6Akt8jOWaApLOZk5JXs6VMR29lz03pRe9mpykrRCYIYxaJYcfpncQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "license": "BSD-3-Clause", + "bin": { + "flat": "cli.js" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "dev": true, + "license": "ISC" + }, + "node_modules/follow-redirects": { + "version": "1.15.11", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", + "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/for-each": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/form-data": { + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.5.tgz", + "integrity": "sha512-jqdObeR2rxZZbPSGL+3VckHMYtu+f9//KXBsVny6JSX/pa38Fy+bGjuG8eW/H6USNQWhLi8Num++cU2yOCNz4A==", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.35", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/forwarded-parse": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/forwarded-parse/-/forwarded-parse-2.1.2.tgz", + "integrity": "sha512-alTFZZQDKMporBH77856pXgzhEzaUVmLCDk+egLgIgHst3Tpndzz8MnKe+GzRJRfvVdn69HhpW7cmXzvtLvJAw==", + "dev": true, + "license": "MIT" + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.prototype.name": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", + "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "functions-have-names": "^1.2.3", + "hasown": "^2.0.2", + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gaxios": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-7.1.2.tgz", + "integrity": "sha512-/Szrn8nr+2TsQT1Gp8iIe/BEytJmbyfrbFh419DfGQSkEgNEhbPi7JRJuughjkTzPWgU9gBQf5AVu3DbHt0OXA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "extend": "^3.0.2", + "https-proxy-agent": "^7.0.1", + "node-fetch": "^3.3.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/gcp-metadata": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-8.1.1.tgz", + "integrity": "sha512-dTCcAe9fRQf06ELwel6lWWFrEbstwjUBYEhr5VRGoC+iPDZQucHppCowaIp8b8v92tU1G4X4H3b/Y6zXZxkMsQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "gaxios": "^7.0.0", + "google-logging-utils": "^1.0.0", + "json-bigint": "^1.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/generator-function": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/generator-function/-/generator-function-2.0.1.tgz", + "integrity": "sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-east-asian-width": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.4.0.tgz", + "integrity": "sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-symbol-description": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", + "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/globals": { + "version": "16.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-16.4.0.tgz", + "integrity": "sha512-ob/2LcVVaVGCYN+r14cnwnoDPUufjiYgSqRhiFD0Q1iI4Odora5RE8Iv1D24hAz5oMophRGkGz+yuvQmmUMnMw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/globalyzer": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz", + "integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/globrex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", + "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==", + "dev": true, + "license": "MIT" + }, + "node_modules/google-auth-library": { + "version": "10.4.2", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-10.4.2.tgz", + "integrity": "sha512-EKiQasw6aEdxSovPEf1oBxCEvxjFamZ6MPaVOSPXZMnqKFLo+rrYjHyjKlFfZcXiKi9qAH6cutr5WRqqa1jKhg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", + "gaxios": "^7.0.0", + "gcp-metadata": "^8.0.0", + "google-logging-utils": "^1.0.0", + "gtoken": "^8.0.0", + "jws": "^4.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/google-gax": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-5.0.4.tgz", + "integrity": "sha512-HmQ6zIYBs2EikTk+kjeHmtHprNTEpsnVaKONw9cwZZwUNCkUb+D5RYrJpCxyjdvIDvJp3wLbVReolJLRZRms1g==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@grpc/grpc-js": "^1.12.6", + "@grpc/proto-loader": "^0.8.0", + "duplexify": "^4.1.3", + "google-auth-library": "^10.1.0", + "google-logging-utils": "^1.1.1", + "node-fetch": "^3.3.2", + "object-hash": "^3.0.0", + "proto3-json-serializer": "^3.0.0", + "protobufjs": "^7.5.3", + "retry-request": "^8.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/google-logging-utils": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-1.1.1.tgz", + "integrity": "sha512-rcX58I7nqpu4mbKztFeOAObbomBbHU2oIb/d3tJfF3dizGSApqtSwYJigGCooHdnMyQBIw8BrWyK96w3YXgr6A==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=14" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true, + "license": "MIT" + }, + "node_modules/gtoken": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-8.0.0.tgz", + "integrity": "sha512-+CqsMbHPiSTdtSO14O51eMNlrp9N79gmeqmXeouJOhfucAedHw9noVe/n5uJk3tbKE6a+6ZCQg3RPhVhHByAIw==", + "dev": true, + "license": "MIT", + "dependencies": { + "gaxios": "^7.0.0", + "jws": "^4.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/has-bigints": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", + "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", + "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "license": "MIT", + "bin": { + "he": "bin/he" + } + }, + "node_modules/html-entities": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.6.0.tgz", + "integrity": "sha512-kig+rMn/QOVRvr7c86gQ8lWXq+Hkv6CbAH1hLu+RG338StTpE8Z0b44SDVaqVu7HGKf27frdmUYEs9hTUX/cLQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/mdevils" + }, + { + "type": "patreon", + "url": "https://patreon.com/mdevils" + } + ], + "license": "MIT" + }, + "node_modules/html-tags": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/html-tags/-/html-tags-3.3.1.tgz", + "integrity": "sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/http-proxy-agent/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==", + "license": "MIT" + }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-in-the-middle": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-3.0.0.tgz", + "integrity": "sha512-OnGy+eYT7wVejH2XWgLRgbmzujhhVIATQH0ztIeRilwHBjTeG3pD+XnH3PKX0r9gJ0BuJmJ68q/oh9qgXnNDQg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "acorn": "^8.15.0", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^2.2.0", + "module-details-from-path": "^1.0.4" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/internal-slot": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", + "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.2", + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", + "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-async-function": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", + "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "async-function": "^1.0.0", + "call-bound": "^1.0.3", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", + "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-bigints": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-boolean-object": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", + "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-builtin-module": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-5.0.0.tgz", + "integrity": "sha512-f4RqJKBUe5rQkJ2eJEJBXSticB3hGbN9j0yxxMQFqIW89Jp9WYFtzfTcRlstDKVUTRzSOTLKRfO9vIztenwtxA==", + "dev": true, + "license": "MIT", + "dependencies": { + "builtin-modules": "^5.0.0" + }, + "engines": { + "node": ">=18.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", + "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", + "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-finalizationregistry": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", + "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-function": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz", + "integrity": "sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.4", + "generator-function": "^2.0.0", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-html": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-html/-/is-html-2.0.0.tgz", + "integrity": "sha512-S+OpgB5i7wzIue/YSE5hg0e5ZYfG3hhpNh9KGl6ayJ38p7ED6wxQLd1TV91xHpcTvw90KMJ9EwN3F/iNflHBVg==", + "dev": true, + "license": "MIT", + "dependencies": { + "html-tags": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", + "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-set": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", + "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-string": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", + "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", + "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-symbols": "^1.1.0", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-weakmap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", + "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakset": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", + "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/iterator.prototype": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.5.tgz", + "integrity": "sha512-H0dkQoCa3b2VEeKQBOxFph+JAbcrQdE7KC0UkqwpLmv2EC4P41QXP+rqo9wYodACiG5/WM5s9oDApTU8utwj9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.6", + "get-proto": "^1.0.0", + "has-symbols": "^1.1.0", + "set-function-name": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsdoc-type-pratt-parser": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-5.1.1.tgz", + "integrity": "sha512-DYYlVP1fe4QBMh2xTIs20/YeTz2GYVbWAEZweHSZD+qQ/Cx2d5RShuhhsdk64eTjNq0FeVnteP/qVOgaywSRbg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "bignumber.js": "^9.0.0" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/jsonata": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/jsonata/-/jsonata-2.1.0.tgz", + "integrity": "sha512-OCzaRMK8HobtX8fp37uIVmL8CY1IGc/a6gLsDqz3quExFR09/U78HUzWYr7T31UEB6+Eu0/8dkVD5fFDOl9a8w==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/jsonc-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz", + "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/jsonfile": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", + "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsx-ast-utils": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", + "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "object.assign": "^4.1.4", + "object.values": "^1.1.6" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/jszip": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", + "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==", + "license": "(MIT OR GPL-3.0-or-later)", + "dependencies": { + "lie": "~3.3.0", + "pako": "~1.0.2", + "readable-stream": "~2.3.6", + "setimmediate": "^1.0.5" + } + }, + "node_modules/jszip/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "license": "MIT" + }, + "node_modules/jszip/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/jszip/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, + "node_modules/jszip/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/jwa": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz", + "integrity": "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-equal-constant-time": "^1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.1.tgz", + "integrity": "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==", + "dev": true, + "license": "MIT", + "dependencies": { + "jwa": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/ky": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/ky/-/ky-1.14.3.tgz", + "integrity": "sha512-9zy9lkjac+TR1c2tG+mkNSVlyOpInnWdSMiue4F+kq8TwJSgv6o8jhLRg8Ho6SnZ9wOYUq/yozts9qQCfk7bIw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sindresorhus/ky?sponsor=1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lie": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "license": "MIT", + "dependencies": { + "immediate": "~3.0.5" + } + }, + "node_modules/localforage": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/localforage/-/localforage-1.10.0.tgz", + "integrity": "sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "lie": "3.1.1" + } + }, + "node_modules/localforage/node_modules/lie": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz", + "integrity": "sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==", + "dev": true, + "license": "MIT", + "dependencies": { + "immediate": "~3.0.5" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/loglevel": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.9.2.tgz", + "integrity": "sha512-HgMmCqIJSAKqo68l0rS2AanEWfkxaZ5wNiEFb5ggm08lDs9Xl2KxBlX3PTcaD2chBM1gXAYf491/M2Rv8Jwayg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6.0" + }, + "funding": { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/loglevel" + } + }, + "node_modules/long": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", + "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/long-timeout": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/long-timeout/-/long-timeout-0.1.1.tgz", + "integrity": "sha512-BFRuQUqc7x2NWxfJBCyUrN8iYUYznzL9JROmRz1gZ6KlOIgmoD+njPVbb+VNn2nGMKggMsK79iUNErillsrx7w==", + "license": "MIT" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/loupe": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-func-name": "^2.0.1" + } + }, + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/luxon": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.7.2.tgz", + "integrity": "sha512-vtEhXh/gNjI9Yg1u4jX/0YVPMvxzHuGgCm6tC5kZyb08yjGWGnqAjGJvcXbqQR2P3MyMEFnRbpcdFS6PBcLqew==", + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true, + "license": "MIT" + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mocha": { + "version": "11.7.4", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.4.tgz", + "integrity": "sha512-1jYAaY8x0kAZ0XszLWu14pzsf4KV740Gld4HXkhNTXwcHx4AUEDkPzgEHg9CM5dVcW+zv036tjpsEbLraPJj4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "browser-stdout": "^1.3.1", + "chokidar": "^4.0.1", + "debug": "^4.3.5", + "diff": "^7.0.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^10.4.5", + "he": "^1.2.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^9.0.5", + "ms": "^2.1.3", + "picocolors": "^1.1.1", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^9.2.0", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1", + "yargs-unparser": "^2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/mocha/node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/mocha/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mocha/node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/module-details-from-path": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.4.tgz", + "integrity": "sha512-EGWKgxALGMgzvxYF1UyGTy0HXX/2vHLkw6+NvDKW2jypWbHpjQuj4UMcqQWXHERJhVGKikolT06G3bcKe4fi7w==", + "dev": true, + "license": "MIT" + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/nano-spawn": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/nano-spawn/-/nano-spawn-2.0.0.tgz", + "integrity": "sha512-tacvGzUY5o2D8CBh2rrwxyNojUsZNU2zjNTzKQrkgGJQTbGAfArVWXSKMBokBeeg6C7OLRGUEyoFlYbfeWQIqw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/nano-spawn?sponsor=1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-dir": { + "version": "0.1.17", + "resolved": "https://registry.npmjs.org/node-dir/-/node-dir-0.1.17.tgz", + "integrity": "sha512-tmPX422rYgofd4epzrNoOXiE8XFZYOcCq1vD7MAXCDO+O+zndlA2ztdKKMa+EeuBG5tHETpr4ml4RGgpqDCCAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "minimatch": "^3.0.2" + }, + "engines": { + "node": ">= 0.10.5" + } + }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "deprecated": "Use your platform's native DOMException instead", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/node-inspect": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/node-inspect/-/node-inspect-2.0.0.tgz", + "integrity": "sha512-vaDNU6Fa/vt8gv/PV+QoeSIPhcBnHMiNOtInxcojfagspQg5KP9HloUDGJWIacamT8Agiu51eF+fuBjrE25a6w==", + "deprecated": "This module is part of Node.js core and does not need to be installed separately. It is now unmaintained.", + "license": "MIT", + "bin": { + "node-inspect": "cli.js" + } + }, + "node_modules/node-releases": { + "version": "2.0.27", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz", + "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-schedule": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/node-schedule/-/node-schedule-2.1.1.tgz", + "integrity": "sha512-OXdegQq03OmXEjt2hZP33W2YPs/E5BcFQks46+G2gAxs4gHOIVD1u7EqlYLYSKsaIpyKCK9Gbk0ta1/gjRSMRQ==", + "license": "MIT", + "dependencies": { + "cron-parser": "^4.2.0", + "long-timeout": "0.1.1", + "sorted-array-functions": "^1.3.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-hash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", + "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", + "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.entries": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.9.tgz", + "integrity": "sha512-8u/hfXFRBD1O0hPUjioLhoWFHRmt6tKA4/vZPyckBr18l1KE9uHrFaFaUi8MDRTpi4uak2goyPTSNJLXX2k2Hw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.fromentries": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.groupby": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.values": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.1.tgz", + "integrity": "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/own-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", + "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.6", + "object-keys": "^1.1.1", + "safe-push-apply": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "license": "(MIT AND Zlib)" + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-imports-exports": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/parse-imports-exports/-/parse-imports-exports-0.2.4.tgz", + "integrity": "sha512-4s6vd6dx1AotCx/RCI2m7t7GCh5bDRUtGNvRfHSP2wbBQdMi67pPe7mtzmgwcaQ8VKK/6IB7Glfyu3qdZJPybQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "parse-statements": "1.0.11" + } + }, + "node_modules/parse-statements": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/parse-statements/-/parse-statements-1.0.11.tgz", + "integrity": "sha512-HlsyYdMBnbPQ9Jr/VgJ1YF4scnldvJpJxCVx6KgqPL4dxppsWrJHCIIxQXMJrqGnsRkNPATbeMJ8Yxu7JMsYcA==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/pg-int8": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", + "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/pg-protocol": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.13.0.tgz", + "integrity": "sha512-zzdvXfS6v89r6v7OcFCHfHlyG/wvry1ALxZo4LqgUoy7W9xhBDMaqOuMiF3qEV45VqsN6rdlcehHrfDtlCPc8w==", + "dev": true, + "license": "MIT" + }, + "node_modules/pg-types": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", + "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "dev": true, + "license": "MIT", + "dependencies": { + "pg-int8": "1.0.1", + "postgres-array": "~2.0.0", + "postgres-bytea": "~1.0.0", + "postgres-date": "~1.0.4", + "postgres-interval": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pluralize": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/postgres-array": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", + "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/postgres-bytea": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.1.tgz", + "integrity": "sha512-5+5HqXnsZPE65IJZSMkZtURARZelel2oXUEO8rH83VS/hxH5vv1uHquPg5wZs8yMAfdv971IU+kcPUczi7NVBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-date": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", + "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-interval": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", + "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "xtend": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.1.tgz", + "integrity": "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==", + "license": "MIT", + "peer": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "license": "MIT" + }, + "node_modules/promisify-child-process": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/promisify-child-process/-/promisify-child-process-5.0.1.tgz", + "integrity": "sha512-jP2Aw1acio5NYIgCEpW9Ay2OhWlcbKTZp4aY6iivx75K2yXizJBt6Wz7sQrHloXKIfrjhbUfdH9m6UZrus4tmA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.26.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "dev": true, + "license": "MIT", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "node_modules/prop-types/node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/proto3-json-serializer": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/proto3-json-serializer/-/proto3-json-serializer-3.0.3.tgz", + "integrity": "sha512-iUi7jGLuECChuoUwtvf6eXBDcFXTHAt5GM6ckvtD3RqD+j2wW0GW6WndPOu9IWeUk7n933lzrskcNMHJy2tFSw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "protobufjs": "^7.4.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/protobufjs": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.4.tgz", + "integrity": "sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg==", + "dev": true, + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "license": "MIT" + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/react": { + "version": "19.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.0.tgz", + "integrity": "sha512-tmbWg6W31tQLeB5cdIBOicJDJRR2KzXsV7uSK9iNfLWQ5bIZfxuPEHp7M8wiHyHnn0DD1i7w3Zmin0FtkrwoCQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.2.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.0.tgz", + "integrity": "sha512-UlbRu4cAiGaIewkPyiRGJk0imDN2T3JjieT6spoL2UeSf5od4n5LB/mQ4ejmxhCFT1tYe8IvaFulzynWovsEFQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "scheduler": "^0.27.0" + }, + "peerDependencies": { + "react": "^19.2.0" + } + }, + "node_modules/react-is": { + "version": "19.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.2.0.tgz", + "integrity": "sha512-x3Ax3kNSMIIkyVYhWPyO09bu0uttcAIoecO/um/rKGQ4EltYWVYtyiGkS/3xMynrbVQdS69Jhlv8FXUEZehlzA==", + "dev": true, + "license": "MIT" + }, + "node_modules/react-transition-group": { + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", + "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/runtime": "^7.5.5", + "dom-helpers": "^5.0.1", + "loose-envify": "^1.4.0", + "prop-types": "^15.6.2" + }, + "peerDependencies": { + "react": ">=16.6.0", + "react-dom": ">=16.6.0" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/reflect.getprototypeof": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", + "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.1", + "which-builtin-type": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regexp-tree": { + "version": "0.1.27", + "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.27.tgz", + "integrity": "sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==", + "dev": true, + "license": "MIT", + "bin": { + "regexp-tree": "bin/regexp-tree" + } + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", + "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "set-function-name": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regjsparser": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.12.0.tgz", + "integrity": "sha512-cnE+y8bz4NhMjISKbgeVJtqNbtf5QpjZP+Bslo+UqkIt9QPnX9q095eiRRASJG1/tz6dlNr6Z5NsBiWYokp6EQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "jsesc": "~3.0.2" + }, + "bin": { + "regjsparser": "bin/parser" + } + }, + "node_modules/regjsparser/node_modules/jsesc": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", + "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-in-the-middle": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-8.0.1.tgz", + "integrity": "sha512-QT7FVMXfWOYFbeRBF6nu+I6tr2Tf3u0q8RIEjNob/heKY/nh7drD/k7eeMFmSQgnTtCzLDcCu/XEnpW2wk4xCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.5", + "module-details-from-path": "^1.0.3" + }, + "engines": { + "node": ">=9.3.0 || >=8.10.0 <9.0.0" + } + }, + "node_modules/resolve": { + "version": "1.22.11", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", + "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.16.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/retry-request": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-8.0.2.tgz", + "integrity": "sha512-JzFPAfklk1kjR1w76f0QOIhoDkNkSqW8wYKT08n9yysTmZfB+RQ2QoXoTAeOi1HD9ZipTyTAZg3c4pM/jeqgSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "extend": "^3.0.2", + "teeny-request": "^10.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", + "integrity": "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^10.3.7" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-array-concat": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", + "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "has-symbols": "^1.1.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safe-push-apply": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", + "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/scheduler": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", + "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", + "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "license": "MIT" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/sinon": { + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-21.0.0.tgz", + "integrity": "sha512-TOgRcwFPbfGtpqvZw+hyqJDvqfapr1qUlOizROIk4bBLjlsjlB00Pg6wMFXNtJRpu+eCZuVOaLatG7M8105kAw==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@sinonjs/commons": "^3.0.1", + "@sinonjs/fake-timers": "^13.0.5", + "@sinonjs/samsam": "^8.0.1", + "diff": "^7.0.0", + "supports-color": "^7.2.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/sinon" + } + }, + "node_modules/sinon-chai": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/sinon-chai/-/sinon-chai-3.7.0.tgz", + "integrity": "sha512-mf5NURdUaSdnatJx3uhoBOrY9dtL19fiOtAdT1Azxg3+lNJFiuN0uzaU3xX1LeAfL17kHQhTAJgpsfhbMJMY2g==", + "dev": true, + "license": "(BSD-2-Clause OR WTFPL)", + "peerDependencies": { + "chai": "^4.0.0", + "sinon": ">=4.0.0" + } + }, + "node_modules/sorted-array-functions": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/sorted-array-functions/-/sorted-array-functions-1.3.0.tgz", + "integrity": "sha512-2sqgzeFlid6N4Z2fUQ1cvFmTOLRi/sEDzSQ0OKYchqgoPmQBVyM3959qYx3fpS6Esef80KjmpgPeEr028dP3OA==", + "license": "MIT" + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true, + "license": "CC-BY-3.0" + }, + "node_modules/spdx-expression-parse": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz", + "integrity": "sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.22", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.22.tgz", + "integrity": "sha512-4PRT4nh1EImPbt2jASOKHX7PB7I+e4IWNLvkKFDxNhJlfjbYlleYQh285Z/3mPTHSAK/AvdMmw5BNNuYH8ShgQ==", + "dev": true, + "license": "CC0-1.0" + }, + "node_modules/stop-iteration-iterator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", + "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "internal-slot": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/stream-events": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/stream-events/-/stream-events-1.0.5.tgz", + "integrity": "sha512-E1GUzBSgvct8Jsb3v2X15pjzN1tYebtbLaMg+eBOUOAxgbLoSbT2NS91ckc5lJD1KfLjId+jXJRgo0qnV5Nerg==", + "dev": true, + "license": "MIT", + "dependencies": { + "stubs": "^3.0.0" + } + }, + "node_modules/stream-shift": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz", + "integrity": "sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/string-width/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/string.prototype.matchall": { + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.12.tgz", + "integrity": "sha512-6CC9uyBL+/48dYizRf7H7VAYCMCNTBeM78x/VTUe9bFEaxBepPJDa1Ow99LqI/1yF7kuy7Q3cQsYMrcjGUcskA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.6", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.6", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "internal-slot": "^1.1.0", + "regexp.prototype.flags": "^1.5.3", + "set-function-name": "^2.0.2", + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.repeat": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/string.prototype.repeat/-/string.prototype.repeat-1.0.0.tgz", + "integrity": "sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.10", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", + "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-data-property": "^1.1.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-object-atoms": "^1.0.0", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", + "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-indent": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-4.1.1.tgz", + "integrity": "sha512-SlyRoSkdh1dYP0PzclLE7r0M9sgbFKKMFXpFRUMNuKhQSbC6VQIGzq3E0qsfvGJaUFJPGv6Ws1NZ/haTAjfbMA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/stubs": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stubs/-/stubs-3.0.0.tgz", + "integrity": "sha512-PdHt7hHUJKxvTCgbKX9C1V/ftOcjJQgz8BZwNfV5c4B6dcGqlpelTbJ999jBGZ2jYiPAwcX5dP6oBwVlBlUbxw==", + "dev": true, + "license": "MIT" + }, + "node_modules/stylis": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.2.0.tgz", + "integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==", + "dev": true, + "license": "MIT" + }, + "node_modules/suncalc2": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/suncalc2/-/suncalc2-1.8.1.tgz", + "integrity": "sha512-tNoAni1LqWzBzJRX3NRCsD50gVsuejH1jd9Y+XyKO3WkpPIU+QNyWF4Zf2JnUQKW2LKLWIBgVDQCrgsQwqs0tA==" + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/synckit": { + "version": "0.11.11", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.11.tgz", + "integrity": "sha512-MeQTA1r0litLUf0Rp/iisCaL8761lKAZHaimlbGK4j0HysC4PLfqygQj9srcs0m2RdtDYnF8UuYyKpbjHYp7Jw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@pkgr/core": "^0.2.9" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/synckit" + } + }, + "node_modules/teeny-request": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-10.1.0.tgz", + "integrity": "sha512-3ZnLvgWF29jikg1sAQ1g0o+lr5JX6sVgYvfUJazn7ZjJroDBUTWp44/+cFVX0bULjv4vci+rBD+oGVAkWqhUbw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.0", + "node-fetch": "^3.3.2", + "stream-events": "^1.0.5" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/teeny-request/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/teeny-request/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/timekeeper": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/timekeeper/-/timekeeper-2.3.1.tgz", + "integrity": "sha512-LeQRS7/4JcC0PgdSFnfUiStQEdiuySlCj/5SJ18D+T1n9BoY7PxKFfCwLulpHXoLUFr67HxBddQdEX47lDGx1g==", + "dev": true, + "license": "MIT" + }, + "node_modules/tiny-glob": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz", + "integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==", + "dev": true, + "license": "MIT", + "dependencies": { + "globalyzer": "0.1.0", + "globrex": "^0.1.2" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-api-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", + "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, + "node_modules/tsconfig-paths": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", + "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", + "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", + "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", + "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.15", + "reflect.getprototypeof": "^1.0.9" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", + "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0", + "reflect.getprototypeof": "^1.0.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "license": "Apache-2.0", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/typescript-eslint": { + "version": "8.46.2", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.46.2.tgz", + "integrity": "sha512-vbw8bOmiuYNdzzV3lsiWv6sRwjyuKJMQqWulBOU7M0RrxedXledX8G8kBbQeiOYDnTfiXz0Y4081E1QMNB6iQg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.46.2", + "@typescript-eslint/parser": "8.46.2", + "@typescript-eslint/typescript-estree": "8.46.2", + "@typescript-eslint/utils": "8.46.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/unbox-primitive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", + "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-bigints": "^1.0.2", + "has-symbols": "^1.1.0", + "which-boxed-primitive": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/undici-types": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", + "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==", + "license": "MIT" + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.4.tgz", + "integrity": "sha512-q0SPT4xyU84saUX+tomz1WLkxUbuaJnR1xWt17M7fJtEJigJeWUNGUqrauFXsHnqev9y9JTRGwk13tFBuKby4A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/update-browserslist-db/node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/virtual-tsc": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/virtual-tsc/-/virtual-tsc-0.6.2.tgz", + "integrity": "sha512-NeCuRFla3ASmhn24Da00UzEQX2FoLrOWX7P3K0IK0kK2WX//joUOLbOYkQEQg+FqYf75lw9jBI++iGszvospjg==", + "license": "MIT", + "dependencies": { + "debug": "^4.3.3", + "picocolors": "1.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "typescript": ">=2.0.0" + } + }, + "node_modules/wake_on_lan": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wake_on_lan/-/wake_on_lan-1.0.0.tgz", + "integrity": "sha512-0QSpxny0QmsssshI6kePj6cobQPK+i8r5shfj58ZfQIUH9fUTyAaYPqZO3W/Ai7mN4vQVdTdsSGIr20M81UL6Q==", + "license": "MIT", + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "wake": "wake" + } + }, + "node_modules/web-streams-polyfill": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", + "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", + "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-bigint": "^1.1.0", + "is-boolean-object": "^1.2.1", + "is-number-object": "^1.1.1", + "is-string": "^1.1.1", + "is-symbol": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", + "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "function.prototype.name": "^1.1.6", + "has-tostringtag": "^1.0.2", + "is-async-function": "^2.0.0", + "is-date-object": "^1.1.0", + "is-finalizationregistry": "^1.1.0", + "is-generator-function": "^1.0.10", + "is-regex": "^1.2.1", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.1.0", + "which-collection": "^1.0.2", + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-collection": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.19", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.19.tgz", + "integrity": "sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "for-each": "^0.3.5", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/workerpool": { + "version": "9.3.4", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-9.3.4.tgz", + "integrity": "sha512-TmPRQYYSAnnDiEB0P/Ytip7bFGvqnSU6I2BcuSw7Hx+JSg/DsUi5ebYfc8GYaSdpuvOcEs6dXxPurOYpe9QFwg==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } } - ], - "license": "MIT", - "peer": true, - "dependencies": { - "escalade": "^3.2.0", - "picocolors": "^1.1.1" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - } - }, - "node_modules/update-browserslist-db/node_modules/picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true, - "license": "ISC", - "peer": true - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "license": "BSD-2-Clause", - "peer": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "license": "MIT" - }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true, - "license": "MIT", - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/virtual-tsc": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/virtual-tsc/-/virtual-tsc-0.6.2.tgz", - "integrity": "sha512-NeCuRFla3ASmhn24Da00UzEQX2FoLrOWX7P3K0IK0kK2WX//joUOLbOYkQEQg+FqYf75lw9jBI++iGszvospjg==", - "license": "MIT", - "dependencies": { - "debug": "^4.3.3", - "picocolors": "1.0.0" - }, - "peerDependencies": { - "@types/node": "*", - "typescript": ">=2.0.0" - } - }, - "node_modules/wake_on_lan": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wake_on_lan/-/wake_on_lan-1.0.0.tgz", - "integrity": "sha512-0QSpxny0QmsssshI6kePj6cobQPK+i8r5shfj58ZfQIUH9fUTyAaYPqZO3W/Ai7mN4vQVdTdsSGIr20M81UL6Q==", - "license": "MIT", - "dependencies": { - "minimist": "^1.2.0" - }, - "bin": { - "wake": "wake" - } - }, - "node_modules/web-streams-polyfill": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", - "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/which-boxed-primitive": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", - "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "is-bigint": "^1.1.0", - "is-boolean-object": "^1.2.1", - "is-number-object": "^1.1.1", - "is-string": "^1.1.1", - "is-symbol": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-builtin-type": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", - "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "call-bound": "^1.0.2", - "function.prototype.name": "^1.1.6", - "has-tostringtag": "^1.0.2", - "is-async-function": "^2.0.0", - "is-date-object": "^1.1.0", - "is-finalizationregistry": "^1.1.0", - "is-generator-function": "^1.0.10", - "is-regex": "^1.2.1", - "is-weakref": "^1.0.2", - "isarray": "^2.0.5", - "which-boxed-primitive": "^1.1.0", - "which-collection": "^1.0.2", - "which-typed-array": "^1.1.16" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-collection": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", - "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "is-map": "^2.0.3", - "is-set": "^2.0.3", - "is-weakmap": "^2.0.2", - "is-weakset": "^2.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-typed-array": { - "version": "1.1.19", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.19.tgz", - "integrity": "sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.8", - "call-bound": "^1.0.4", - "for-each": "^0.3.5", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/workerpool": { - "version": "9.3.4", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-9.3.4.tgz", - "integrity": "sha512-TmPRQYYSAnnDiEB0P/Ytip7bFGvqnSU6I2BcuSw7Hx+JSg/DsUi5ebYfc8GYaSdpuvOcEs6dXxPurOYpe9QFwg==", - "dev": true, - "license": "Apache-2.0" - }, - "node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs": { - "name": "wrap-ansi", - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/wrap-ansi-cjs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", - "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", - "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", - "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.4" - } - }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "dev": true, - "license": "MIT", - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs-unparser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", - "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", - "dev": true, - "license": "MIT", - "dependencies": { - "camelcase": "^6.0.0", - "decamelize": "^4.0.0", - "flat": "^5.0.2", - "is-plain-obj": "^2.1.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/yargs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } } - } } diff --git a/package.json b/package.json index 46865578f..4af22bfe3 100644 --- a/package.json +++ b/package.json @@ -1,120 +1,121 @@ { - "name": "iobroker.javascript", - "version": "9.1.1", - "description": "Rules Engine for ioBroker", - "author": "bluefox ", - "contributors": [ - { - "name": "hobbyquaker", - "email": "hq@ccu.io" + "name": "iobroker.javascript", + "version": "9.1.1", + "description": "Rules Engine for ioBroker", + "author": "bluefox ", + "contributors": [ + { + "name": "hobbyquaker", + "email": "hq@ccu.io" + }, + { + "name": "Apollon77", + "email": "ingo@fischer-ka.de" + }, + { + "name": "AlCalzone", + "email": "d.griesel@gmx.net" + }, + { + "name": "Matthias Kleine", + "email": "info@haus-automatisierung.com" + } + ], + "homepage": "https://github.com/ioBroker/ioBroker.javascript", + "license": "MIT", + "keywords": [ + "ioBroker", + "javascript", + "script", + "engine", + "home automation" + ], + "repository": { + "type": "git", + "url": "https://github.com/ioBroker/ioBroker.javascript" }, - { - "name": "Apollon77", - "email": "ingo@fischer-ka.de" + "engines": { + "node": ">=18" }, - { - "name": "AlCalzone", - "email": "d.griesel@gmx.net" + "depsComment": { + "@types/node": "should match the lowest MAJOR version of Node.js we support." }, - { - "name": "Matthias Kleine", - "email": "info@haus-automatisierung.com" + "dependencies": { + "@iobroker/adapter-core": "^3.3.2", + "@iobroker/types": "^7.1.0", + "@types/node": "^25.5.0", + "axios": "^1.13.6", + "jsonata": "^2.1.0", + "jszip": "^3.10.1", + "node-inspect": "^2.0.0", + "node-schedule": "2.1.1", + "prettier": "^3.8.1", + "promisify-child-process": "^5.0.1", + "semver": "^7.7.4", + "suncalc2": "^1.8.1", + "typescript": "~5.9.3", + "virtual-tsc": "^0.6.2", + "wake_on_lan": "^1.0.0" + }, + "devDependencies": { + "@alcalzone/release-script": "^5.1.1", + "@alcalzone/release-script-plugin-iobroker": "^5.1.2", + "@alcalzone/release-script-plugin-license": "^5.1.1", + "@iobroker/adapter-dev": "^1.5.0", + "@iobroker/build-tools": "^3.0.1", + "@iobroker/eslint-config": "^2.2.0", + "@iobroker/plugin-sentry": "^3.0.4", + "@iobroker/testing": "^5.2.2", + "@iobroker/vis-2-widgets-react-dev": "^4.0.4", + "@types/node-schedule": "^2.1.8", + "@types/nodemailer": "^7.0.11", + "@types/request": "^2.48.13", + "@types/suncalc": "^1.9.2", + "alcalzone-shared": "^5.0.0", + "timekeeper": "^2.3.1" + }, + "bugs": { + "url": "https://github.com/ioBroker/ioBroker.javascript/issues" + }, + "main": "build/main.js", + "files": [ + "admin/", + "build/", + "docs/", + "install/", + "io-package.json", + "LICENSE", + "admin/vsFont/codicon.json" + ], + "scripts": { + "test:declarations": "tsc -p test/lib/TS/tsconfig.json && tsc -p test/lib/JS/tsconfig.json", + "test:integration": "mocha --exit", + "test:package": "mocha test/testPackageFiles.js --exit", + "test:scheduler": "mocha test/testScheduler.js --exit", + "test": "npm run test:declarations && npm run test:integration", + "translate": "translate-adapter", + "//postinstall": "node ./install/installTypings.js", + "build": "npm run build-backend && node tasks", + "build-backend": "tsc -p tsconfig.build.json && node tasks --copy-types", + "release": "release-script --noPush -y --all", + "update-packages": "npx -y npm-check-updates --upgrade && cd src-editor && npx -y npm-check-updates --upgrade && cd ../src-admin && npx -y npm-check-updates --upgrade", + "npm": "npm i && cd src-editor && npm i -f && cd ../src-admin && npm i", + "lint": "eslint -c eslint.config.mjs", + "lint-all": "eslint -c eslint.config.mjs && cd src-editor && eslint -c eslint.config.mjs && cd ../src-admin && eslint -c eslint.config.mjs", + "admin-0-clean": "node tasks.js --admin-0-clean", + "admin-1-npm": "node tasks.js --admin-1-npm", + "admin-2-compile": "node tasks.js --admin-2-compile", + "admin-3-copy": "node tasks.js --admin-3-copy", + "admin-build": "node tasks.js --admin-build", + "0-clean": "node tasks.js --0-clean", + "1-npm": "node tasks.js --1-npm", + "2-build": "node tasks.js --2-build", + "3-copy": "node tasks.js --3-copy", + "4-patch": "node tasks.js --4-patch", + "build-editor": "node tasks.js --build", + "blocklyJson2words": "node tasks.js --blocklyJson2words", + "blocklyWords2json": "node tasks.js --blocklyWords2json", + "monaco-update": "node tasks.js --monaco-update", + "monaco-typescript": "node tasks.js --monaco-typescript" } - ], - "homepage": "https://github.com/ioBroker/ioBroker.javascript", - "license": "MIT", - "keywords": [ - "ioBroker", - "javascript", - "script", - "engine", - "home automation" - ], - "repository": { - "type": "git", - "url": "https://github.com/ioBroker/ioBroker.javascript" - }, - "engines": { - "node": ">=18" - }, - "depsComment": { - "@types/node": "should match the lowest MAJOR version of Node.js we support." - }, - "dependencies": { - "@iobroker/adapter-core": "^3.3.2", - "@iobroker/types": "^7.1.0", - "@types/node": "^25.5.0", - "axios": "^1.13.6", - "jsonata": "^2.1.0", - "jszip": "^3.10.1", - "node-inspect": "^2.0.0", - "node-schedule": "2.1.1", - "prettier": "^3.8.1", - "promisify-child-process": "^5.0.1", - "semver": "^7.7.4", - "suncalc2": "^1.8.1", - "typescript": "~5.9.3", - "virtual-tsc": "^0.6.2", - "wake_on_lan": "^1.0.0" - }, - "devDependencies": { - "@alcalzone/release-script": "^5.1.1", - "@alcalzone/release-script-plugin-iobroker": "^5.1.2", - "@alcalzone/release-script-plugin-license": "^5.1.1", - "@iobroker/adapter-dev": "^1.5.0", - "@iobroker/build-tools": "^3.0.1", - "@iobroker/eslint-config": "^2.2.0", - "@iobroker/testing": "^5.2.2", - "@iobroker/vis-2-widgets-react-dev": "^4.0.4", - "@types/node-schedule": "^2.1.8", - "@types/nodemailer": "^7.0.11", - "@types/request": "^2.48.13", - "@types/suncalc": "^1.9.2", - "alcalzone-shared": "^5.0.0", - "timekeeper": "^2.3.1" - }, - "bugs": { - "url": "https://github.com/ioBroker/ioBroker.javascript/issues" - }, - "main": "build/main.js", - "files": [ - "admin/", - "build/", - "docs/", - "install/", - "io-package.json", - "LICENSE", - "admin/vsFont/codicon.json" - ], - "scripts": { - "test:declarations": "tsc -p test/lib/TS/tsconfig.json && tsc -p test/lib/JS/tsconfig.json", - "test:integration": "mocha --exit", - "test:package": "mocha test/testPackageFiles.js --exit", - "test:scheduler": "mocha test/testScheduler.js --exit", - "test": "npm run test:declarations && npm run test:integration", - "translate": "translate-adapter", - "//postinstall": "node ./install/installTypings.js", - "build": "npm run build-backend && node tasks", - "build-backend": "tsc -p tsconfig.build.json && node tasks --copy-types", - "release": "release-script --noPush -y --all", - "update-packages": "npx -y npm-check-updates --upgrade && cd src-editor && npx -y npm-check-updates --upgrade && cd ../src-admin && npx -y npm-check-updates --upgrade", - "npm": "npm i && cd src-editor && npm i -f && cd ../src-admin && npm i", - "lint": "eslint -c eslint.config.mjs", - "lint-all": "eslint -c eslint.config.mjs && cd src-editor && eslint -c eslint.config.mjs && cd ../src-admin && eslint -c eslint.config.mjs", - "admin-0-clean": "node tasks.js --admin-0-clean", - "admin-1-npm": "node tasks.js --admin-1-npm", - "admin-2-compile": "node tasks.js --admin-2-compile", - "admin-3-copy": "node tasks.js --admin-3-copy", - "admin-build": "node tasks.js --admin-build", - "0-clean": "node tasks.js --0-clean", - "1-npm": "node tasks.js --1-npm", - "2-build": "node tasks.js --2-build", - "3-copy": "node tasks.js --3-copy", - "4-patch": "node tasks.js --4-patch", - "build-editor": "node tasks.js --build", - "blocklyJson2words": "node tasks.js --blocklyJson2words", - "blocklyWords2json": "node tasks.js --blocklyWords2json", - "monaco-update": "node tasks.js --monaco-update", - "monaco-typescript": "node tasks.js --monaco-typescript" - } }